blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905
values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 115
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1f2bb6d6aee1be36f2a180df0dd73189c47bb735 | d5d189fff2e027f7aa38ecde58952bcb4b636d47 | /include/caffe/layers/tanh_layer.hpp | 7a137a681ab9ac3a0588dad08a13842de79673a7 | [] | no_license | wyc2015fq/cstd | 5979a3c26d5c7f00aadda440b04176dcf043e7dc | 664bcb4680a32811767f5541a8aae1551d621598 | refs/heads/master | 2020-05-15T20:22:19.209717 | 2019-04-20T16:08:03 | 2019-04-20T16:08:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,705 | hpp | #ifndef CAFFE_TANH_LAYER_HPP_
#define CAFFE_TANH_LAYER_HPP_
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/layer.hpp"
#include "caffe/proto/caffe.pb.h"
#include "caffe/layers/neuron_layer.hpp"
namespace caffe
{
/**
* @brief TanH hyperbolic tangent non-linearity @f$
* y = \frac{\exp(2x) - 1}{\exp(2x) + 1}
* @f$, popular in auto-encoders.
*
* Note that the gradient vanishes as the values move away from 0.
* The ReLULayer is often a better choice for this reason.
*/
template <typename Dtype>
class TanHLayer : public NeuronLayer<Dtype>
{
public:
explicit TanHLayer(const LayerParameter & param)
: NeuronLayer<Dtype>(param) {}
virtual inline const char* type() const { return "TanH"; }
protected:
/**
* @param bottom input Blob vector (length 1)
* -# @f$ (N \times C \times H \times W) @f$
* the inputs @f$ x @f$
* @param top output Blob vector (length 1)
* -# @f$ (N \times C \times H \times W) @f$
* the computed outputs @f$
* y = \frac{\exp(2x) - 1}{\exp(2x) + 1}
* @f$
*/
virtual void Forward_cpu(const vector<Blob<Dtype>*> & bottom,
const vector<Blob<Dtype>*> & top);
virtual void Forward_gpu(const vector<Blob<Dtype>*> & bottom,
const vector<Blob<Dtype>*> & top);
/**
* @brief Computes the error gradient w.r.t. the sigmoid inputs.
*
* @param top output Blob vector (length 1), providing the error gradient with
* respect to the outputs
* -# @f$ (N \times C \times H \times W) @f$
* containing error gradients @f$ \frac{\partial E}{\partial y} @f$
* with respect to computed outputs @f$ y @f$
* @param propagate_down see Layer::Backward.
* @param bottom input Blob vector (length 1)
* -# @f$ (N \times C \times H \times W) @f$
* the inputs @f$ x @f$; Backward fills their diff with
* gradients @f$
* \frac{\partial E}{\partial x}
* = \frac{\partial E}{\partial y}
* \left(1 - \left[\frac{\exp(2x) - 1}{exp(2x) + 1} \right]^2 \right)
* = \frac{\partial E}{\partial y} (1 - y^2)
* @f$ if propagate_down[0]
*/
virtual void Backward_cpu(const vector<Blob<Dtype>*> & top,
const vector<bool> & propagate_down, const vector<Blob<Dtype>*> & bottom);
virtual void Backward_gpu(const vector<Blob<Dtype>*> & top,
const vector<bool> & propagate_down, const vector<Blob<Dtype>*> & bottom);
};
} // namespace caffe
#endif // CAFFE_TANH_LAYER_HPP_
| [
"31720406@qq.com"
] | 31720406@qq.com |
a9262e6ffc0ad336e244a288e71b0c9567ea497b | 3ed05581d6fb5044115448e40cee43a6136daa27 | /src/token.h | 6568facef28f17c183a145e1280187df84eaf3a7 | [] | no_license | rwaldron/iv | acb0addbcb682772d437ff738e9555147a108882 | 40bdb765d82d8e6fa09ffd39f0869f275d238a5a | refs/heads/master | 2021-01-17T21:46:42.421227 | 2010-12-03T16:04:04 | 2010-12-03T16:04:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,396 | h | #ifndef _IV_TOKEN_H_
#define _IV_TOKEN_H_
#include <cstddef>
#include <cassert>
#include "none.h"
namespace iv {
namespace core {
namespace detail {
template<typename T>
struct TokenContents {
static const char* kContents[];
};
} // namespace iv::core::detail
typedef detail::TokenContents<None> TokenContents;
class Token {
public:
enum Type {
EOS, // EOS
ILLEGAL, // ILLEGAL
PERIOD, // .
COLON, // :
SEMICOLON, // ;
COMMA, // ,
LPAREN, // (
RPAREN, // )
LBRACK, // [
RBRACK, // ]
LBRACE, // {
RBRACE, // }
CONDITIONAL, // ?
EQ, // ==
EQ_STRICT, // ===
NOT, // !
NE, // !=
NE_STRICT, // !==
INC, // ++
DEC, // --
ADD, // +
SUB, // -
MUL, // *
DIV, // /
MOD, // %
REL_FIRST, // RELATIONAL FIRST
LT, // <
GT, // >
LTE, // <=
GTE, // >=
INSTANCEOF, // instanceof
REL_LAST, // RELATIONAL LAST
SAR, // >>
SHR, // >>>
SHL, // <<
BIT_AND, // &
BIT_OR, // |
BIT_XOR, // ^
BIT_NOT, // ~
LOGICAL_AND, // &&
LOGICAL_OR, // ||
HTML_COMMENT, // <!--
ASSIGN_FIRST, // ASSIGN OP FIRST
ASSIGN, // =
ASSIGN_ADD, // +=
ASSIGN_SUB, // -=
ASSIGN_MUL, // *=
ASSIGN_MOD, // %=
ASSIGN_DIV, // /=
ASSIGN_SAR, // >>=
ASSIGN_SHR, // >>>=
ASSIGN_SHL, // <<=
ASSIGN_BIT_AND, // &=
ASSIGN_BIT_OR, // |=
ASSIGN_BIT_XOR, // ^=
ASSIGN_LAST, // ASSIGN OP LAST
DELETE, // delete
TYPEOF, // typeof
VOID, // void
BREAK, // break
CASE, // case
CATCH, // catch
CONTINUE, // continue
DEBUGGER, // debugger
DEFAULT, // default
DO, // do
ELSE, // else
FINALLY, // finaly
FOR, // for
FUNCTION, // function
IF, // if
IN, // in
NEW, // new
RETURN, // return
SWITCH, // switch
THIS, // this
THROW, // throw
TRY, // try
VAR, // var
WHILE, // while
WITH, // with
ABSTRACT, // abstract
BOOLEAN, // boolean
BYTE, // byte
CHAR, // char
CLASS, // class
CONST, // const
DOUBLE, // double
ENUM, // enum
EXPORT, // export
EXTENDS, // extends
FINAL, // final
FLOAT, // float
GOTO, // goto
IMPLEMENTS, // implements
IMPORT, // import
INT, // int
INTERFACE, // interface
LONG, // long
NATIVE, // native
PACKAGE, // package
PRIVATE, // private
PROTECTED, // protected
PUBLIC, // public
SHORT, // short
STATIC, // static
SUPER, // super
SYNCHRONIZED, // synchronized
THROWS, // throws
TRANSIENT, // transient
VOLATILE, // volatile
LET, // let
YIELD, // yield
GET, // get
SET, // set
NULL_LITERAL, // NULL LITERAL
FALSE_LITERAL, // FALSE LITERAL
TRUE_LITERAL, // TRUE LITERAL
NUMBER, // NUMBER LITERAL
STRING, // STRING LITERAL
IDENTIFIER, // IDENTIFIER
NOT_FOUND, // NOT_FOUND
NUM_TOKENS // number of tokens
};
static const std::size_t kMaxSize = 12; // "synchronized"
static inline bool IsAssignOp(Token::Type type) {
return Token::ASSIGN_FIRST < type && type < Token::ASSIGN_LAST;
}
static inline const char* ToString(Token::Type type) {
assert(0 <= type && type < NUM_TOKENS);
assert(type != Token::ASSIGN_FIRST &&
type != Token::ASSIGN_LAST &&
type != Token::REL_FIRST &&
type != Token::REL_LAST &&
type != Token::STRING &&
type != Token::NUMBER &&
type != Token::IDENTIFIER &&
type != Token::EOS &&
type != Token::ILLEGAL &&
type != Token::NOT_FOUND);
return TokenContents::kContents[type];
}
};
namespace detail {
template<typename T>
const char* TokenContents<T>::kContents[Token::NUM_TOKENS] = {
NULL, // EOS
NULL, // ILLEGAL
".",
":",
";",
",",
"(",
")",
"[",
"]",
"{",
"}",
"?",
"==",
"===",
"!",
"!=",
"!==",
"++",
"--",
"+",
"-",
"*",
"/",
"%",
NULL, // RELATIONAL FIRST
"<",
">",
"<=",
">=",
"instanceof",
NULL, // RELATIONAL LAST
">>",
">>>",
"<<",
"&",
"|",
"^",
"~",
"&&",
"||",
"<!--",
NULL, // ASSIGN OP FIRST
"=",
"+=",
"-=",
"*=",
"%=",
"/=",
">>=",
">>>=",
"<<=",
"&=",
"|=",
"~=",
NULL, // ASSIGN OP LAST
"delete",
"typeof",
"void",
"break",
"case",
"catch",
"continue",
"debugger",
"default",
"do",
"else",
"finaly",
"for",
"function",
"if",
"in",
"new",
"return",
"switch",
"this",
"throw",
"try",
"var",
"while",
"with",
"abstract",
"boolean",
"byte",
"char",
"class",
"const",
"double",
"enum",
"export",
"extends",
"final",
"float",
"goto",
"implements",
"import",
"int",
"interface",
"long",
"native",
"package",
"private",
"protected",
"public",
"short",
"static",
"super",
"synchronized",
"throws",
"transient",
"volatile",
"let",
"yield",
"get",
"set",
"null",
"false",
"true",
NULL, // NUMBER LITERAL
NULL, // STRING LITERAL
NULL, // IDENTIFIER
NULL // NOT FOUND
};
} // namespace iv::core::detail
} } // namespace iv::core
#endif // _IV_TOKEN_H_
| [
"utatane.tea@gmail.com"
] | utatane.tea@gmail.com |
0884faf714f868d8ff6ac1bff6a149cd1ea7aadd | e3806a74a79aed7dadbb53e41586f9ac8e39199f | /include/deco/types/floating_point.h | 614b7aa855be8b824365fb5df5c67046a3ca9e75 | [
"Apache-2.0",
"LLVM-exception"
] | permissive | Enhex/Deco | 8a4f87a6b23e64564064ba6820fd1539ae4623a6 | 9d5b1532f753d17c979eaa46b4b5b5dcf08198b2 | refs/heads/master | 2023-06-08T16:27:07.175076 | 2023-06-06T13:31:08 | 2023-06-06T13:31:08 | 115,511,298 | 92 | 2 | null | 2017-12-28T21:15:01 | 2017-12-27T10:46:49 | C++ | UTF-8 | C++ | false | false | 1,004 | h | #ifndef deco_floating_point_h
#define deco_floating_point_h
#include "../InputStream.h"
#include "../OutputStream.h"
#include <fmt/format.h>
namespace deco
{
template<typename T>
struct is_single_entry<T, std::enable_if_t<std::is_floating_point_v<T>> > : std::true_type {};
template<typename T>
std::enable_if_t<std::is_floating_point_v<T>
, std::string>
to_string(const T& value)
{
return fmt::to_string(value);
}
template<typename Stream, typename T> constexpr
std::enable_if_t<
std::is_base_of_v<OutputStream, std::decay_t<Stream>> &&
std::is_floating_point_v<T>
>
write(Stream& stream, const T& value)
{
stream.entry(to_string(value));
}
template<typename I, typename T> constexpr
std::enable_if_t<std::is_floating_point_v<T>>
read(InputStream<I>& stream, T& value)
{
const auto content = stream.parse_entry().content;
using namespace boost::spirit::x3;
phrase_parse(content.begin(), content.end(), real_parser<T>(), ascii::space, value);
}
}
#endif//guard
| [
"enhex0@gmail.com"
] | enhex0@gmail.com |
73d197120f878a970986834dcdbe5645dc412ff6 | 40a725a41533c20c90c0cb7f48a0a2f3f79d7357 | /binomial_coefficient.cpp | 761954c65850f96c7affaf6d0afb5d5365cad6c3 | [] | no_license | akhilchoudhary2k/Solutions-CSES-Problem-Set | ffe98f349340dca45d45252e479771add499bc7e | 5a14356f99c5bd17d835e0de754d1fdad85e0451 | refs/heads/main | 2023-06-12T02:16:05.625796 | 2021-07-03T20:03:57 | 2021-07-03T20:03:57 | 363,860,463 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 716 | cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
int mod = 1e9+7;
const int N = 1e6;
int fact[N+1];
// a^b
int power(int a, int b){
if(b==0) return 1;
int small = power(a,b/2);
int ans = (small*small)%mod;
if(b&1) ans *= a;
return ans%mod;
}
int fermat_inverse(int x){
return power(x,mod-2);
}
void test_case(){
int n,r;
cin >> n >> r ;
//nCr = n! / (n-r)! r!
int num = fact[n];
int den = (fact[n-r]*fact[r])%mod;
int ans = (num * fermat_inverse(den))%mod;
cout << ans <<"\n";
}
signed main(){
ios_base::sync_with_stdio(false); cin.tie(0);
fact[0]=1;
for(int i=1;i<=N;i++){
fact[i] = (i*fact[i-1])%mod;
}
int t=1;
cin >> t;
while(t--) test_case();
return 0;
}
| [
"akhil.choudhary2000@gmail.com"
] | akhil.choudhary2000@gmail.com |
8fa3196eca92b20258ae2b070ef1caef02e99bfb | 58f46a28fc1b58f9cd4904c591b415c29ab2842f | /chromium-courgette-redacted-29.0.1547.57/chrome/browser/storage_monitor/storage_monitor_win.cc | 4fcc8f6b2856f377ee57f7c3c533f1c08fb14c9e | [
"BSD-3-Clause"
] | permissive | bbmjja8123/chromium-1 | e739ef69d176c636d461e44d54ec66d11ed48f96 | 2a46d8855c48acd51dafc475be7a56420a716477 | refs/heads/master | 2021-01-16T17:50:45.184775 | 2015-03-20T18:38:11 | 2015-03-20T18:42:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,963 | cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/storage_monitor/storage_monitor_win.h"
#include <windows.h>
#include <dbt.h>
#include <fileapi.h>
#include "base/win/wrapped_window_proc.h"
#include "chrome/browser/storage_monitor/portable_device_watcher_win.h"
#include "chrome/browser/storage_monitor/removable_device_constants.h"
#include "chrome/browser/storage_monitor/storage_info.h"
#include "chrome/browser/storage_monitor/volume_mount_watcher_win.h"
namespace chrome {
// StorageMonitorWin -------------------------------------------------------
// static
StorageMonitorWin* StorageMonitorWin::Create() {
return new StorageMonitorWin(new VolumeMountWatcherWin(),
new PortableDeviceWatcherWin());
}
StorageMonitorWin::StorageMonitorWin(
VolumeMountWatcherWin* volume_mount_watcher,
PortableDeviceWatcherWin* portable_device_watcher)
: window_class_(0),
instance_(NULL),
window_(NULL),
volume_mount_watcher_(volume_mount_watcher),
portable_device_watcher_(portable_device_watcher) {
DCHECK(volume_mount_watcher_);
DCHECK(portable_device_watcher_);
volume_mount_watcher_->SetNotifications(receiver());
portable_device_watcher_->SetNotifications(receiver());
}
StorageMonitorWin::~StorageMonitorWin() {
volume_mount_watcher_->SetNotifications(NULL);
portable_device_watcher_->SetNotifications(NULL);
if (window_)
DestroyWindow(window_);
if (window_class_)
UnregisterClass(MAKEINTATOM(window_class_), instance_);
}
void StorageMonitorWin::Init() {
WNDCLASSEX window_class;
base::win::InitializeWindowClass(
L"Chrome_StorageMonitorWindow",
&base::win::WrappedWindowProc<StorageMonitorWin::WndProcThunk>,
0, 0, 0, NULL, NULL, NULL, NULL, NULL,
&window_class);
instance_ = window_class.hInstance;
window_class_ = RegisterClassEx(&window_class);
DCHECK(window_class_);
window_ = CreateWindow(MAKEINTATOM(window_class_), 0, 0, 0, 0, 0, 0, 0, 0,
instance_, 0);
SetWindowLongPtr(window_, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
volume_mount_watcher_->Init();
portable_device_watcher_->Init(window_);
}
bool StorageMonitorWin::GetStorageInfoForPath(const base::FilePath& path,
StorageInfo* device_info) const {
DCHECK(device_info);
// TODO(gbillock): Move this logic up to StorageMonitor.
// If we already know the StorageInfo for the path, just return it.
// This will account for portable devices as well.
std::vector<StorageInfo> attached_devices = GetAllAvailableStorages();
size_t best_parent = attached_devices.size();
size_t best_length = 0;
for (size_t i = 0; i < attached_devices.size(); i++) {
if (!StorageInfo::IsRemovableDevice(attached_devices[i].device_id()))
continue;
base::FilePath relative;
if (base::FilePath(attached_devices[i].location()).AppendRelativePath(
path, &relative)) {
// Note: the relative path is longer for shorter shared path between
// the path and the device mount point, so we want the shortest
// relative path.
if (relative.value().size() < best_length) {
best_parent = i;
best_length = relative.value().size();
}
}
}
if (best_parent != attached_devices.size()) {
*device_info = attached_devices[best_parent];
return true;
}
return GetDeviceInfo(path, device_info);
}
void StorageMonitorWin::EjectDevice(
const std::string& device_id,
base::Callback<void(EjectStatus)> callback) {
StorageInfo::Type type;
if (!StorageInfo::CrackDeviceId(device_id, &type, NULL)) {
callback.Run(EJECT_FAILURE);
return;
}
if (type == StorageInfo::MTP_OR_PTP)
portable_device_watcher_->EjectDevice(device_id, callback);
else if (StorageInfo::IsRemovableDevice(device_id))
volume_mount_watcher_->EjectDevice(device_id, callback);
else
callback.Run(EJECT_FAILURE);
}
bool StorageMonitorWin::GetMTPStorageInfoFromDeviceId(
const std::string& storage_device_id,
base::string16* device_location,
base::string16* storage_object_id) const {
StorageInfo::Type type;
StorageInfo::CrackDeviceId(storage_device_id, &type, NULL);
return ((type == StorageInfo::MTP_OR_PTP) &&
portable_device_watcher_->GetMTPStorageInfoFromDeviceId(
storage_device_id, device_location, storage_object_id));
}
// static
LRESULT CALLBACK StorageMonitorWin::WndProcThunk(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam) {
StorageMonitorWin* msg_wnd = reinterpret_cast<StorageMonitorWin*>(
GetWindowLongPtr(hwnd, GWLP_USERDATA));
if (msg_wnd)
return msg_wnd->WndProc(hwnd, message, wparam, lparam);
return ::DefWindowProc(hwnd, message, wparam, lparam);
}
LRESULT CALLBACK StorageMonitorWin::WndProc(HWND hwnd, UINT message,
WPARAM wparam, LPARAM lparam) {
switch (message) {
case WM_DEVICECHANGE:
OnDeviceChange(static_cast<UINT>(wparam), lparam);
return TRUE;
default:
break;
}
return ::DefWindowProc(hwnd, message, wparam, lparam);
}
bool StorageMonitorWin::GetDeviceInfo(const base::FilePath& device_path,
StorageInfo* info) const {
DCHECK(info);
// TODO(kmadhusu) Implement PortableDeviceWatcherWin::GetDeviceInfo()
// function when we have the functionality to add a sub directory of
// portable device as a media gallery.
return volume_mount_watcher_->GetDeviceInfo(device_path, info);
}
void StorageMonitorWin::OnDeviceChange(UINT event_type, LPARAM data) {
volume_mount_watcher_->OnWindowMessage(event_type, data);
portable_device_watcher_->OnWindowMessage(event_type, data);
}
} // namespace chrome
| [
"Khilan.Gudka@cl.cam.ac.uk"
] | Khilan.Gudka@cl.cam.ac.uk |
ed436191ff299ed802259d50f8ff00a0c11d42d2 | 31c3ee6d0ac9a216b4173fe6ab242c36fac62d07 | /Disjoint_set.h | dc6fdf716c9d776908599a9c4fff8d6f6f563491 | [] | no_license | aishwarya-an/Maze-Solver | d893998e5fc15cf5beb437d30fab81e08ad12959 | c5066ce64c88e311964024122c79d9d30ae36c7c | refs/heads/master | 2020-05-29T08:48:09.165563 | 2015-08-10T03:15:12 | 2015-08-10T03:15:12 | 68,880,395 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 531 | h | // This is the declaration of the Disjoint_set class
#include <iostream>
#include <vector>
#ifndef DISJOINT_SET_H
#define DISJOINT_SET_H
using namespace std;
struct cell{
int index;
int rank;
int representative;
};
class Disjoint_set{
private:
vector<cell>* set;
int elements;
int num_of_sets;
public:
Disjoint_set(int);
Disjoint_set(const Disjoint_set&);
int find_set(int);
const vector<cell>* get_set() const;
int get_size() const;
int get_num_of_sets() const;
void Union(int, int);
~Disjoint_set();
};
#endif | [
"aishwarya.an95@gmail.com"
] | aishwarya.an95@gmail.com |
3b2b93c7e503fd1bf376c4763f07031c07893f36 | a83057e19bcfcb208bedf45855b2fd65f7877e73 | /WS07/Project1/Project1/Hero.cpp | b4be202b747ce123a9ba43a4014fed6d271acd06 | [] | no_license | chenzhao7920/C-Workshops | 900d271c3e403d37e7cc1d8b1e19cc83daaa788b | c2379ec04668a03749ea642bddb1a62740c18766 | refs/heads/master | 2020-06-24T20:42:05.947198 | 2019-07-26T21:31:53 | 2019-07-26T21:31:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,684 | cpp | //Student Name:Chen Zhao
//Student Id:120122189
//Section: SAA
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include "Hero.h"
using namespace std;
namespace sict {
// public function
//defalte constructor
Hero::Hero() {
name[0] = '?';
health = 0;
strength = 0;
}
//three parameter constructor
Hero::Hero(const char* n_, int h_, int s_) {
bool valid = (n_ != nullptr && h_ >= 0 && s_ >= 0);
if (valid) {
strncpy(name, n_, max_name_size);
name[max_name_size] = '\0';
health = h_;
strength = s_;
}
else {
strcpy(name, "?");
health = 0;
strength = 0;
}
}
//isEmpty, if object in the empty state, the return true
bool Hero::isEmpty() const{
if (strcmp(name, "?") == 0 )
return true;
else
return false;
}
//operater -=
void Hero::operator-=(int attack) {
if (attack > 0) {
health -= attack;
if (health < 0)
health = 0;
}
}
//function isAlive,return if it is alive
bool Hero::isAlive() const {
bool alive = health > 0 ? true : false;
return alive;
}
//return the attack strength of the current object, if the object is in a safe empty state, return '0'
int Hero::attackStrength() const {
int str;
if (isEmpty())
str = 0;
else
str = strength;
return str;
}
//helper function
//print the name of hero, if hero is empty, print "No hero"
//helper function in the class could access the private data member otherwise , we need member function
std::ostream& operator<<(std::ostream& os, const Hero& hero) {
if (hero.isEmpty())
os << "No hero";
else
os << hero.name;
return os;
}
//non-friend function, return the winner of max_rounds battle
const Hero& operator*(const Hero& first, const Hero& second) {
Hero left=first;
Hero right=second;
bool fight = true;
int left_str = left.attackStrength();
int right_str = right.attackStrength();
for (int i = 1; i <= max_roungs && fight; i++) {
left -= right_str;
right -= left_str;
if (left.isAlive() && (!right.isAlive())) {
fight = false;
cout << "Ancient Battle! " << first << " vs " << second << " : Winner is " << first << " in " << i << " rounds." << endl;
}
else if ((!left.isAlive()) && (!right.isAlive())) {
fight = false;
cout << "Ancient Battle! " << first << " vs " << second << " : Winner is " << first << " in " << i << " rounds." << endl;
}
else if ((!left.isAlive()) && (right.isAlive())) {
fight = false;
cout << "Ancient Battle! " << first << " vs " << second << " : Winner is " << second << " in " << i << " rounds." << endl;
}
}
return (left.isAlive()) ? first : second;
}
}
| [
"chenzhao7920@gmail.com"
] | chenzhao7920@gmail.com |
0e6099ac0318df59fc0ae5d265ab005b32c0ab9a | a7eb6c84d31b2cd1e46654102fdfd9c2d3d789a2 | /engines/engine/inc/tcp/connection.h | d82bc344c171414c993ae1ca14f62ce6af17282e | [] | no_license | zjh-tech/cplusplus | cd4f90f7d3d7a1537cc658a2cb7038cca017a87c | 3388999b537e543cf0249b93cb16ac5376c63ef5 | refs/heads/master | 2023-03-29T12:03:49.551352 | 2021-04-07T07:50:26 | 2021-04-07T07:50:26 | 333,028,332 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,940 | h | #pragma once
#include <string>
#include <tuple>
#include "engine/inc/tcp/iconnection.h"
#include "engine/inc/tcp/netdefine.h"
using namespace std;
namespace Framework
{
namespace Tcp
{
class ISession;
class Connection : public enable_shared_from_this<Connection>, public IConnection
{
public:
Connection(asio::io_context& io_context, INet* net, shared_ptr<ISession> session_ptr, uint64_t conn_id);
virtual ~Connection();
static void PrintQps(int64_t diff_time);
public:
tuple<string, uint16_t> GetLocalEndPoint()
{
auto endpoint = socket_.local_endpoint();
return make_tuple(endpoint.address().to_string(), endpoint.port());
}
tuple<string, uint16_t> GetRemoteEndPoint()
{
auto endpoint = socket_.remote_endpoint();
return make_tuple(endpoint.address().to_string(), endpoint.port());
}
tcp::socket& GetSocket() override
{
return socket_;
}
asio::io_context& GetIoContext()
{
return io_context_;
}
shared_ptr<ISession> GetSessionPtr() override
{
return session_ptr_.lock();
}
void SetSessionPtr(shared_ptr<ISession> session_ptr)
{
session_ptr_ = session_ptr;
}
uint64_t GetConnID() override
{
return conn_id_;
}
void AsyncSend(const char* msg, uint32_t len) override;
void Terminate() override;
void DoRead() override;
void DoWrite() override;
void Close(bool autoFlag);
private:
void close_socket();
void add_check_send_end_timer(int mill_sec, bool terminate);
bool is_send_finish();
private:
vector<string>* send_vec_ptr_;
vector<string>* two_send_vec_ptr_;
uint32_t two_send_vec_index_ = 0;
char recv_buffer_[MAX_MESSAGE_SIZE] = {0};
uint32_t recv_buffer_index_ = 0;
static atomic<int64_t> s_send_qps_count;
static atomic<int64_t> s_recv_qps_count;
private:
asio::io_context& io_context_;
tcp::socket socket_;
weak_ptr<ISession> session_ptr_;
uint64_t conn_id_ = 0;
INet* net_ptr_ = nullptr;
enum class ConnctionState
{
Establish = 1,
Closed = 2,
};
atomic<int> state_ = (int)ConnctionState::Establish;
shared_ptr<asio::steady_timer> check_send_end_timer_ = nullptr;
};
} // namespace Tcp
} // namespace Framework
| [
"zhengjinhong@bilibili.com"
] | zhengjinhong@bilibili.com |
2b6fcdf502093ce99a181d72ec2f4a68f2c7e10a | f221ab39e0d2c307be6fbf7adf58f636b24bdeea | /include/MIPOMDP.h | d310c17baab7d1e93da50f4b61fe8492319ab64f | [
"BSD-3-Clause"
] | permissive | ChristianFrisson/NMPT | 3a40e81e5e69f03980d7460d1d3ccf18d4bc3978 | dda56fa5202bde140500120ee472465d386b685c | refs/heads/master | 2021-01-20T07:00:10.101779 | 2018-07-18T00:46:30 | 2018-07-18T00:46:30 | 11,305,943 | 5 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 28,936 | h | /*
* MIPOMDP.h
* FaceTracker
*
* Created by Nicholas Butko on 10/3/08.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*
*/
#ifndef _MIPOMDP_H
#define _MIPOMDP_H
#include <opencv2/core/core_c.h>
#include <iostream>
#include <string>
#include "OpenCVHaarDetector.h"
#include "ObjectDetector.h"
#include "ImagePatchPyramid.h"
#include "MultinomialObservationModel.h"
#include "OpenLoopPolicies.h"
#include "ConvolutionalLogisticPolicy.h"
#include "ImageDataSet.h"
/**
* \ingroup MPGroup
* \brief <tt> <b> Machine Perception Primitive: </b> </tt> An implementation of
* the "Multinomial IPOMDP" algorithm from Butko and Movellan, 2009 (see \ref
* bib_sec).
*
* \author Nicholas Butko
* \date 2010
* \version 0.4
*/
class MIPOMDP {
public:
/*Constructors*/
/**
*\brief Load a saved MIPOMDP from a file. The file should have been saved
* via the saveToFile() method.
*
* @param filename The name of a file that was saved via the saveToFile()
* method.
**/
static MIPOMDP* loadFromFile(const char* filename);
/**
* \brief Main Constructor: Manually create an MIPOMDP.
*
* An MIPOMDP needs to know how big the images it receives are,
* to what smaller size it should scale each image patch, the size (height /
* width) of the grid-cell tiling of the image, how many image patches there
* will be, the size (height/width) in grid-cells of each image patch, and
* what object detector to apply.
*
* In order to be able to properly save and load object detectors, the
* class of the object detector must be specified in the MIPOMDP. To use an
* object detector other than OpenCVHaarDetector, replace
* "OpenCVHaarDetector" in MIPOMDP.h and MIPOMDP.cpp, and recompile the
* NMPT library. (setHaarCascadeScaleFactor() and setHaarCascadeMinSize()
* will also need to be removed, or implemented in your own object detector
* for successful compilation).
*
* @param inputImageSize The size of the images that will be given to the
* IPP to turn into MIPOMDP observations. This allocates memory for
* underlying data, but it can be changed easily later if needed without
* recreating the object by calling the changeInputSize() functions.
*
* @param subImageSize The common size to which all image patches will be
* reduced, creating the foveation effect. The smaller subImageSize is, the
* faster search is, and the more extreme the effect of foveation. This
* allocates memory for underlying data, but it can be changed easily
* later if needed without recreating the object by calling the
* changeInputSize() functions.
*
* @param gridSize Size of the discretization of the image. The number of POMDP states is the
* product of the demensions of this size (e.g. 21x21).
*
* @param numSubImages Number of Patches in the Image Patch Pyramid.
*
* @param subImageGridPoints A matrix that describes the size and shape of
* each level (patch) of the IP Pyramid. This must be a matrix with size
* [numSubImages x 2]. Each row contains the width and height of the
* corresponding levels. These should be in order of *decreasing* size, so
* that the largest Image Patch is first. For example, in Butko and Movellan
* CVPR 2009, we used [21 21; 15 15; 9 9; 3 3]. Finaly, note that it is not
* necessary that the largest patch cover the entire image. However, when
* the largest patch is the same size as grid-cell-matrix, special
* optimizations become available that reduce the complexity of the
* algorithm when the same image, or same frame of video, is fixated
* multiple times.
*
* @param haarDetectorXMLFile A file that was saved as the result of using
* OpenCV's haar-detector training facilities. In order to be able to
* properly save and load object detectors, the class of the object detector
* must be specified in the MIPOMDP. To use an object detector other than
* OpenCVHaarDetector, simply replace "OpenCVHaarDetector" in MIPOMDP.h and
* MIPOMDP.cpp, and recompile the NMPT library.
**/
MIPOMDP(CvSize inputImageSize, CvSize subImageSize, CvSize gridSize,
int numSubImages, CvMat* subImageGridPoints,
const char* haarDetectorXMLFile);
/**
*\brief Default Constructor: Create an MIPOMDP with the same properties as
* the MIPOMDP used in Butko and Movellan, CVPR 2009 (see \ref bib_sec).
* NOTE: This requires "data/haarcascade_frontalface_alt2.xml" to be a
* haar-detector file that exists.
**/
MIPOMDP();
/**
*\brief Default Destructor: Deallocates all memory associated with the
* MIPOMDP
**/
virtual ~MIPOMDP();
/*Save*/
/**
*\brief Save MIPOMDP Data: Save data about the structure of the MIPOMDP so
* that it can be persist past the current run of the program. This includes
* details about the structure of the IPP, the object detector used, the
* parameters of the multionmial observation model, the policy used. It does
* not include details about the state of the MIPOMDP (the current location
* of the target), but rather the properties of the model.
*
* @param filename The name of the saved file.
**/
void saveToFile(const char* filename);
/*Modify*/
/**
*\brief Interface with MIPOMDP: Reset the belief about the location of the
* object to be uniform over space (complete uncertainty).
**/
void resetPrior();
/**
*\brief Interface with MIPOMDP: Tell MIPOMDP whether there is a possiblity
* that the target can move. When searching a static frame, set this to 0.
* When searching sequential frames of a movie, set this to 1.
*
* By default, a simple dynamical model is assumed. The object is expected
* to move with brownian motion, with a small probability of jumping
* randomly anywhere in the image.
*
* NOTE: If a frame is searched with one of the search functions that
* performs multiple fixations, dynamics are automatically, temporarily
* disabled. At the end of the function call, the targetCanMove is restored
* to its former state.
*
* @param flag Set to 1 (default) if searching sequential frames of a movie.
* Set to 0 if searching a static image.
**/
void setTargetCanMove(int flag);
/**
*\brief Interface with MIPOMDP: Figure out whether the MIPOMDP expects that
* the target can move.
*
* @return 1 (default) if searching sequential frames of a movie, 0 if
* searching a static image.
**/
int getTargetCanMove();
/**
*\brief Interface with MIPOMDP: Find the shape of the grid that forms the
* basis for the MIPOMDP state space and action space.
*
* @return The size of the visual grid world, where each location is a
* potential object location (state) and potential eye-movement (action).
**/
CvSize getGridSize();
/*Current state*/
/**
*\brief Interface with MIPOMDP State: Given the current point, where does
* the MIPOMDP's Convolutional logistic policy recommend looking? Since the
* CLP (usually) gives stochastic output, this will not always return the
* same result, even given the same belief state.
*
* @return A grid-cell point that should be good to fixate.
**/
CvPoint recommendSearchPointForCurrentBelief();
/**
*\brief Interface with MIPOMDP State: Get an estimate of the probability
* that the MIPOMDP knows the exactly correct location of the target.
*
* I.e. what is the probability of being correct given the (MxN)
* alternative forced choice task, "Where is the target" (where M is the
* width of the grid, and N is the height).
*
* @return The probability that the MIPOMDP knows the exactly correct
* location of the target.
**/
double getProb();
/**
*\brief Interface with MIPOMDP State: The certainty (information-reward)
* about the location of the target, i.e. the mutual information (minus a
* constant) between all previous actions/observations and the target
* location.
*
* @return The information-reward (Sum p*log(p)) of the current belief
* state. Has range -(1/MN)log(MN):0 (where M is the width of the grid, and
* N is the height).
**/
double getReward();
/**
*\brief Interface with MIPOMDP State: Find the grid-cell that is most
* likely to be the location of the target.
*
* @return The grid-cell that is most likely to be the location of the
* target.
**/
CvPoint getMostLikelyTargetLocation();
/**
*\brief Interface with MIPOMDP State: Access the current belief
* distribution directly. Changes each time one of the search functions is
* called.
*
* This is representd as an image of type IPL_DEPTH_32F, 1 channle. This is
* so that the belief-distribution can be visualized directly in a GUI.
**/
IplImage* currentBelief; //has size of grid
/**
*\brief Interface with MIPOMDP State: A visually informative representation
* of the IPP Foveal represention.
*
* This is meant as an image that is appropriate for display in a GUI, to
* visualize the algorithm in action. The image has the same size as
* inputImageSize. In order to increase efficiency, generation of this
* visualization should be disabled if it is not going to be accessed. This
* can be achieved by calling setGeneratePreview(0).
**/
IplImage* foveaRepresentation; //has size of full gray image
/*Search Functions*/
/**
*\brief Search function: Search an image (or frame of video) at a location
* recommended by the Convolutional Logistic Policy, and update belief
* based on what was found.
*
* Since this is taken to be a new frame, the IPP knows not to use same-
* frame optimizations.
*
* @param grayFrame The image to search. Must be of type IPL_DEPTH_8U, 1
* channel.
*
* @return The most likely location of the search target.
**/
CvPoint searchNewFrame(IplImage* grayFrame);
/**
*\brief Search function: Search an image (or frame of video) at a location
* decided by the calling program. and update belief
* based on what was found.
*
* Since this is taken to be a new frame, the IPP knows not to use same-
* frame optimizations.
*
* @param grayFrame The image to search. Must be of type IPL_DEPTH_8U, 1
* channel.
*
* @param searchPoint The grid location to center the digital fovea for
* further image processing.
*
* @return The most likely location of the search target.
**/
CvPoint searchNewFrameAtGridPoint(IplImage* grayFrame, CvPoint searchPoint);
/**
*\brief Search function: Search an image (or frame of video) at a location
* recommended by the calling program, and update belief
* based on what was found.
*
* Since this is taken to be a repeat of the last frame, the IPP knows
* that it can use same-frame optimizations (if appropriate).
*
* @param grayFrame The image to search. Must be of type IPL_DEPTH_8U, 1
* channel.
*
* @param searchPoint The grid location to center the digital fovea for
* further image processing.
*
* @return The most likely location of the search target.
**/
virtual CvPoint searchFrameAtGridPoint(IplImage* grayFrame, CvPoint searchPoint);
/**
*\brief Search function: Search an image (or frame of video) at a sequence
* of fixation points recommended by the CLP, and update belief
* based on what was found. Employs an early-stop criterion of the first
* repeat fixation. Otherwise, stops at when confidence in the target
* location reaches a maximum value.
*
* Since this is taken to be a new frame, the IPP knows not to use same-
* frame optimizations on the first saccade, and then
* that it can use same-frame optimizations on subsequent fixations
* (if appropriate).
*
* @param grayFrame The image to search. Must be of type IPL_DEPTH_8U, 1
* channel.
*
* @param confidenceThresh Probability that max-location really contains
* the object before stopping.
*
* @return The most likely location of the search target.
**/
CvPoint searchFrameUntilConfident(IplImage* grayFrame,
double confidenceThresh);
/**
*\brief Search function: Search an image (or frame of video) at a sequence
* of fixation points chosen randomly, and update belief
* based on what was found. Employs an early-stop criterion of the first
* repeat fixation. Otherwise, stops at when confidence in the target
* location reaches a maximum value.
*
* Since this is taken to be a new frame, the IPP knows not to use same-
* frame optimizations on the first saccade, and then
* that it can use same-frame optimizations on subsequent fixations
* (if appropriate).
*
* @param grayFrame The image to search. Must be of type IPL_DEPTH_8U, 1
* channel.
*
* @param confidenceThresh Probability that max-location really contains
* the object before stopping.
*
* @return The most likely location of the search target.
**/
CvPoint searchFrameRandomlyUntilConfident(IplImage* grayFrame,
double confidenceThresh);
/**
*\brief Search function: Search an image (or frame of video) at a sequence
* of fixation points recommended by the CLP, and update belief
* based on what was found. Fixates the specified number of times (no
* early stopping is used).
*
* Since this is taken to be a new frame, the IPP knows not to use same-
* frame optimizations on the first saccade, and then
* that it can use same-frame optimizations on subsequent fixations
* (if appropriate).
*
* @param grayFrame The image to search. Must be of type IPL_DEPTH_8U, 1
* channel.
*
* @param numfixations The number of fixations to apply.
*
* @return The most likely location of the search target.
**/
CvPoint searchFrameForNFixations(IplImage* grayFrame, int numfixations);
/**
*\brief Search function: Search an image (or frame of video) at a sequence
* of fixation points recommended by an open loop fixation policy, and
* update belief based on what was found. Fixates the specified number of
* times (no early stopping is used).
*
* Since this is taken to be a new frame, the IPP knows not to use same-
* frame optimizations on the first saccade, and then
* that it can use same-frame optimizations on subsequent fixations
* (if appropriate).
*
* @param grayFrame The image to search. Must be of type IPL_DEPTH_8U, 1
* channel.
*
* @param numfixations The number of fixations to apply.
*
* @param OLPolicyType The type of open-loop policy to use. Should be one of
* OpenLoopPolicy::RANDOM, OpenLoopPolicy::ORDERED, OpenLoopPolicy::SPIRAL.
*
* @return The most likely location of the search target.
**/
CvPoint searchFrameForNFixationsOpenLoop(IplImage* grayFrame,
int numfixations,
int OLPolicyType);
/**
*\brief Search function: Search an image (or frame of video) at a sequence
* of fixation points recommended by the CLP, and update belief
* based on what was found. Fixates the specified number of times (no
* early stopping is used). Visualize the process in a provided OpenCV
* UI Window, at a specified frame rate.
*
* Since this is taken to be a new frame, the IPP knows not to use same-
* frame optimizations on the first saccade, and then
* that it can use same-frame optimizations on subsequent fixations
* (if appropriate).
*
* @param grayFrame The image to search. Must be of type IPL_DEPTH_8U, 1
* channel.
*
* @param numfixations The number of fixations to apply.
*
* @param window The string handle (name) of an OpenCV UI Window that
* you have previously created. Output will displayed in this window.
*
* @param msec_wait Number of milliseconds to wait between fixations so
* that the process of each fixation can be appreciated visually by the
* user.
*
* @return The most likely location of the search target.
**/
CvPoint searchFrameForNFixationsAndVisualize(IplImage* grayFrame,
int numfixations,
const char* window,
int msec_wait);
/**
*\brief Search function: Search an image (or frame of video) at every
* grid-point (no early stopping is used).
*
* Since this is taken to be a new frame, the IPP knows not to use same-
* frame optimizations on the first saccade, and then
* that it can use same-frame optimizations on subsequent fixations
* (if appropriate).
*
* @param grayFrame The image to search. Must be of type IPL_DEPTH_8U, 1
* channel.
*
* @return The most likely location of the search target.
**/
CvPoint searchFrameAtAllGridPoints(IplImage* grayFrame);
/**
*\brief Search function: Apply the Object Detector to the entire input
* image.
*
* The belief map is not changed by this operation. The count
* vector of objects found in each grid-cell is set. The location of the
* grid-cell with the most found objects is returned. The fovea
* representation is set to contain the entire high-resolution image,
* overlaid with grid-cells.
**/
CvPoint searchHighResImage(IplImage* grayFrame);
/*IPP Interface*/
/**
*\brief Interface with IPP: Change the size of the input image and the
* downsampled image patches. Omitting a newSubImageSize causes the
* smallest-used-scale to have a 1-1 pixel mapping with the downsampled
* image patch -- i.e. information is not lost in the smallest scale.
*
* @param newInputSize The size of the next image that will be searched.
**/
void changeInputImageSize(CvSize newInputSize);
/**
*\brief Interface with IPP:
* Change the size of the input image and the downsampled image patches.
*
* @param newInputSize The size of the next image that will be searched.
*
* @param newSubImageSize The desired size of the downsampled image patches.
* If the subImageSize is too small (below getMinSize()), the smallest scale
* is dropped and subImageSize is scaled up proportionally to the next
* scale. This process is repeated until subImageSIze is greater than
* getMinSize(). By default, minSize is 60x40.
**/
void changeInputImageSize(CvSize newInputSize, CvSize newSubImageSize);
/**
*\brief Interface with IPP: The total number of levels that the IP Pyramid
* has.
*
* Note that this may be different from the number of scales that the IP
* Pyramid is using. If the subImageSize is too small (below getMinSize()),
* the smallest scale is dropped and subImageSize is scaled up
* proportionally to the next scale. This process is repeated until
* subImageSIze is greater than getMinSize(). To find out how many scales
that the IPP is using, call getUsedScales().
**/
int getNumScales();
/**
*\brief Interface with IPP: Map a pixel location in the original image into
* a grid-cell.
**/
CvPoint gridPointForPixel(CvPoint pixel);
/**
*\brief Interface with IPP: Find the pixel in the original image that is in
* the center of a grid-cell.
**/
CvPoint pixelForGridPoint(CvPoint gridPoint);
/**
*\brief Interface with IPP: Turns on/off the code that modifies
* foveaRepresentation to visualize the process of fixating.
*
* @param flag Set to 0 if visualization is not desired (more efficient) or
* to 1 if visualization is desired.
**/
void setGeneratePreview(int flag);
/**
*\brief Interface with IPP: Set the minimum allowed subImageSize.
*
* If the subImageSize is too small (below getMinSize()), the smallest scale
* is dropped and subImageSize is scaled up proportionally to the next
* scale. This process is repeated until subImageSIze is greater than
* getMinSize(). By default, minSize is 60x40.
*
* The will have no effect on the current subImageSize, or getUsedScales()
* until changeInputImageSize() is called.
*
* @param minsize The minimum allowed subImageSize.
**/
void setMinSize(CvSize minsize);
/**
*\brief Interface with IPP: Set whether same-frame optimizations are being
* used.
*
* Under certain conditions, the computation needed to search a frame a
* second time are less than the computations needed to search it a first
* time. In these conditions, the same-frame optimizations will
* automatically be used. However, this requires setting setNewImage() each
* time the image to search changes (i.e. a new frame). If you are in a
* situation in which you know that each frame will only be fixated at one
* point, you may wish to turn same-frame optimizations off.
*
* Generally same-frame optimizations should not be turned on unless you
* know that they were turned on automatically. Turning them on when
* inappropriate will lead to incorrect behavior. In general, it is
* appropriate to turn them on if the first scale (largest scale) in the IPP
* is the same size as entire visual field.
*
* @param flag If 0, Same Frame Optimizations will not be used. If 1, Same
* Frame Optimizations will be used regardless of whether or not it's
* appropriate. Be careful setting this to 1.
**/
void useSameFrameOptimizations(int flag);
/**
*\brief Interface with IPP: Save a variety of visual representations of the
* process of fixating with an IPP to image files.
*
* This method saves a series of .png image files, each with a prefix given
* by base_filename. Images with the following suffix are created:
* \li FullInputImage - The full input image contained in grayFrame.
* \li Scale-[0:N] - The down-sampled representation of each image patch.
* \li FoveatedInputImage - A reconstruction of the full image using the
* donwsampled patches.
* \li FoveatedInputImageWithLooking - Same as above, with white boxes drawn
* around each scale.
* \li FoveatedInputImageWithGrid - Same as above, but with a grid overlayed
* showing the grid-cells.
* \li FullInputImageWithGrid - Full image with black rectangles showing
* grid-cell locations.
* \li FullInputImageWithLooking - Same as above, but with wite boxes drawn
* around each scale.
*
* Additionally, one CSV file is created, suffix "FaceCounts.csv", which
* records the output of the object detector on the foveated representation
* in each grid-cell.
*
* @param grayFrame The image to search. This image should have size
* inputImageSize, and be of type IPL_DEPTH_8U with a single channel.
*
* @param searchPoint The center of fixation.
*
* @param base_filename All of the files generated by this function will be
* given this as a prefix.
**/
void saveVisualization(IplImage* grayFrame, CvPoint searchPoint,
const char* base_filename);
/**
*\brief Interface with IPP: Get the count of faces found in each grid
* cell after the last search call.
**/
IplImage* getCounts();
/*Object Detector Interface*/
/**
*\brief Interface with Object Detector: Sets the factor by which the
* image-patch-search-scale is increased. Should be greater than 1. By
* default, the scale factor is 1.1, meaning that faces are searched for at
* sizes that increase by 10%.
*
* @param factor The size-granularity of object search.
**/
void setHaarCascadeScaleFactor(double factor);
/**
*\brief Interface with Object Detector: Sets the minimum patch size at
* which the classifier searches for the object. By default, this is 0,
* meaning that the smallest size appropriate to XML file is used. In the
* case of the frontal face detector provided, this happens to be 20x20
* pixels.
*
* @param size The width/height of the smallest patches to try to detect the
* object.
*/
void setHaarCascadeMinSize(int size);
/*Observation Model Interface*/
/**
*\brief Interface with Observation Model: Fit a multinomial observation
* model by recording the object detector output at different fixation
* points, given known face locations contained in an ImageDataSet.
*
* Resets the current observation model to a uniform prior before tabulating
* the data.
*
* @param trainingSet An iamge dataset, consisting of image files and
* labeled object locations. The first two indices (0, 1) of all labels in
* the trainingSet should be the width and height (respectively) of the
* object's center in the image.
**/
void trainObservationModel(ImageDataSet* trainingSet);
/**
*\brief Interface with Observation Model: Add data to an existing
* multinomial observation model by recording the object detector output at
* different fixation points, given known face locations contained in an
* ImageDataSet.
*
* Does not reset the current observation model to a uniform prior before
* tabulating the data.
*
* @param trainingSet An iamge dataset, consisting of image files and
* labeled object locations. The first two indices (0, 1) of all labels in
* the trainingSet should be the width and height (respectively)
* of the object's center in the image.
**/
void addDataToObservationModel(ImageDataSet* trainingSet);
/**
*\brief Interface with Observation Model: Reset the experience-counts used
* to estimate the multinomial parameters. Sets all counts to 1.
*
* The multinomial distribution probabilities are estimated from experience
* counts. The table of counts forms a dirichlet posterior over the
* parameters of the multinomials. When the counts are reset to 1, there is
* a flat prior over multinomial parameters, and all outcomes are seen as
* equally likely. This is a particularly bad model, and will make it
* impossible to figure out the location of the face, so only call
* resetCounts if you're then going to call updateProbTableCounts for enough
* images to build up a good model.
**/
void resetModel();
/**
*\brief Interface with Observation Model: Combine the evidence from two
* MIPOMDPs' multinomial observation models (merge their counts and subtract
* off the extra priors).
*
* @param otherPomdp A second MIPOMDP with a model that has been fit to
* different data than this one: We can estimate the model for the combined
* set of data by simply adding the counts, and subtracting duplicate
* priors. In this way, we can efficiently compose models fit to different
* subsets of a larger dataset (e.g. for cross-validation).
**/
void combineModels(MIPOMDP* otherPomdp);
/*Policy Interface*/
/**
*\brief Interface with CLP: Tell the CLP what kind of convolution policy to
* use in the future.
*
* @param policyNumber Must be one of:
* \li ConvolutionalLogisticPolicy::BOX
* \li ConvolutionalLogisticPolicy::GAUSSIAN
* \li ConvolutionalLogisticPolicy::IMPULSE
* \li ConvolutionalLogisticPolicy::MAX
**/
void setPolicy(int policyNumber);
/**
*\brief Interface with CLP: Tell the CLP the shape of the convolution
* kernel to use.
*
* @param softmaxGain Has the following effect for:
* \li ConvolutionalLogisticPolicy::BOX - The kernel is a square with
* integral=softmaxGain.
* \li ConvolutionalLogisticPolicy::GAUSSIAN - The kernel is a Gaussian with
* integral=softmaxGain
* \li ConvolutionalLogisticPolicy::IMPULSE - The kernel is an impulse
* response with value softmaxGain
* \li ConvolutionalLogisticPolicy::MAX - No effect
*
* @param boxSize Has the following effect for:
* \li ConvolutionalLogisticPolicy::BOX - The kernel is a boxSize x boxSize
* grid-cell square.
* \li ConvolutionalLogisticPolicy::GAUSSIAN - The kernel is a Gaussian with
* standard-deviation boxSize grid-cells.
* \li ConvolutionalLogisticPolicy::IMPULSE - No effect
* \li ConvolutionalLogisticPolicy::MAX - No effect
**/
void setHeuristicPolicyParameters(double softmaxGain, double boxSize);
/**
* \brief Change the file used by the object detector for doing detecting.
* This is critical if a weights file is located at an absolute path that
* may have changed from training time.
*
* When an ObjectDetector is loaded from disk, it will try to reload its
* weights file from the same source used in training. If this fails, a
* warning will be printed, and the detector's source will need to be set.
*/
void setObjectDetectorSource(std::string newFileName);
protected:
MIPOMDP(CvSize gridSize);
ImagePatchPyramid* ipp;
MultinomialObservationModel* obsmodel;
ConvolutionalLogisticPolicy* policy;
CvSize gridSize;
int useOnlyFaceCenter;
int useObsProbTables;
int dynamicsoff;
int repeatOff;
IplImage* actProb; //has size of grid
IplImage* fixationCount; //has size of grid
virtual void runForwardBeliefDynamics();
virtual void setObservationProbability(CvPoint searchPoint);
float randomFloat();
virtual void updateProbTableCounts(IplImage* grayFrame, CvRect objectLocation) ;
void normalizeProbTables() ;
};
#endif
| [
"christian.frisson@gmail.com"
] | christian.frisson@gmail.com |
0b6239a59318c6e5d89a699e901a4cb852acbc29 | 2c4d79335c37fb6c6b207b3d662e1d189909d4c9 | /a_game/screens.h | f8cdbdc61c3abdce894233d12a5e3866e98fa062 | [] | no_license | bringmethehorizon/TankBattle | 40cb1092644587262d1ec8b4b72b5bd471c21033 | 95807f3df01e7f3b9e63e2e7a9a173d6ead2fae6 | refs/heads/master | 2021-01-19T14:57:26.813485 | 2014-04-16T15:23:01 | 2014-04-16T15:23:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 249 | h | #pragma once
#include <SFML/Graphics.hpp>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <chrono>
#include <random>
class cScreen
{
public :
virtual int run (sf::RenderWindow &App) = 0;
}; | [
"teodor_me@yahoo.com"
] | teodor_me@yahoo.com |
de8f0fbab536dd9463e2cf85705e157d7ba9a1d6 | 5bb2d3364a529f7b15c97d2f3aa175e77af3c695 | /cf133A.cpp | f66de85e218c45f696ae1bc4f42ecbc31db4ae9c | [] | no_license | suraj021/Codeforces-Solutions | c589cf3ff72aa5297d06e854c73aa2d587ed4257 | 7d669635778700c4772674865c7b7560abe2cf89 | refs/heads/master | 2021-01-17T02:22:27.159917 | 2018-06-23T15:12:05 | 2018-06-23T15:12:05 | 37,797,992 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 276 | cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
bool flag= false;
for( int i=0; i< s.length(); ++i )
if( s[i]== 'H' || s[i]== 'Q' || s[i]== '9' ){
flag= true;
break;
}
if( flag )
printf("YES\n");
else
printf("NO\n");
} | [
"surajbora021@gmail.com"
] | surajbora021@gmail.com |
e1f5d7e97913b0b281974c6bcd2d8339305c540e | 04af3b839eb8fde7a1662fc9e625864d9673ec05 | /core/src/cluster/ClusterControllerClient.cpp | c0a6f58c537eab383ea002e0510043ff24574979 | [] | no_license | gralkapk/megamol_pub_backup | d7a53adf53011f9e8b9b2069f908db0413f6baae | 7b405a4003d578adbb70cb6a29ffcc8d01e0fca1 | refs/heads/master | 2021-06-21T17:58:40.648674 | 2017-08-03T10:32:54 | 2017-08-03T10:32:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,100 | cpp | /*
* ClusterControllerClient.cpp
*
* Copyright (C) 2009 - 2010 by VISUS (Universitaet Stuttgart).
* Alle Rechte vorbehalten.
*/
#include "stdafx.h"
#include "mmcore/cluster/ClusterControllerClient.h"
#include "mmcore/cluster/CallRegisterAtController.h"
#include "mmcore/param/StringParam.h"
#include "vislib/sys/Log.h"
#include "vislib/net/IPEndPoint.h"
#include "vislib/net/NetworkInformation.h"
using namespace megamol::core;
/*
* cluster::ClusterControllerClient::ClusterControllerClient
*/
cluster::ClusterControllerClient::ClusterControllerClient(void)
: AbstractSlot::Listener(), vislib::Listenable<ClusterControllerClient>(),
registerSlot("register", "The slot to register the client at the controller"),
ctrlr(NULL) {
this->registerSlot.SetCompatibleCall<CallRegisterAtControllerDescription>();
this->registerSlot.AddListener(this);
// must be published in derived class to avoid diamond-inheritance
}
/*
* cluster::ClusterControllerClient::~ClusterControllerClient
*/
cluster::ClusterControllerClient::~ClusterControllerClient(void) {
}
/*
* cluster::ClusterControllerClient::SendUserMsg
*/
void cluster::ClusterControllerClient::SendUserMsg(
const UINT32 msgType, const BYTE *msgBody, const SIZE_T msgSize) {
if (this->ctrlr == NULL) {
vislib::sys::Log::DefaultLog.WriteMsg(vislib::sys::Log::LEVEL_ERROR,
"Cannot 'SendUserMsg[%d]': ClusterControllerClient is not connected to the controller\n",
__LINE__);
return;
}
this->ctrlr->SendUserMsg(msgType, msgBody, msgSize);
}
/*
* cluster::ClusterControllerClient::SendUserMsg
*/
void cluster::ClusterControllerClient::SendUserMsg(
const cluster::ClusterController::PeerHandle& hPeer,
const UINT32 msgType, const BYTE *msgBody, const SIZE_T msgSize) {
if (this->ctrlr == NULL) {
vislib::sys::Log::DefaultLog.WriteMsg(vislib::sys::Log::LEVEL_ERROR,
"Cannot 'SendUserMsg[%d]': ClusterControllerClient is not connected to the controller\n",
__LINE__);
return;
}
this->ctrlr->SendUserMsg(hPeer, msgType, msgBody, msgSize);
}
/*
* cluster::ClusterControllerClient::OnConnect
*/
void cluster::ClusterControllerClient::OnConnect(AbstractSlot& slot) {
if (&slot != &this->registerSlot) return;
CallRegisterAtController *crac
= this->registerSlot.CallAs<CallRegisterAtController>();
if (crac != NULL) {
crac->SetClient(this);
(*crac)(CallRegisterAtController::CALL_REGISTER);
}
}
/*
* cluster::ClusterControllerClient::OnDisconnect
*/
void cluster::ClusterControllerClient::OnDisconnect(AbstractSlot& slot) {
if (&slot != &this->registerSlot) return;
CallRegisterAtController *crac
= this->registerSlot.CallAs<CallRegisterAtController>();
if (crac != NULL) {
crac->SetClient(this);
(*crac)(CallRegisterAtController::CALL_UNREGISTER);
}
}
/*
* cluster::ClusterControllerClient::onClusterAvailable
*/
void cluster::ClusterControllerClient::onClusterAvailable(void) {
ListenerIterator iter = this->GetListeners();
while (iter.HasNext()) {
Listener *l = dynamic_cast<Listener*>(iter.Next());
if (l == NULL) continue;
l->OnClusterDiscoveryAvailable(*this);
}
}
/*
* cluster::ClusterControllerClient::onClusterUnavailable
*/
void cluster::ClusterControllerClient::onClusterUnavailable(void) {
ListenerIterator iter = this->GetListeners();
while (iter.HasNext()) {
Listener *l = dynamic_cast<Listener*>(iter.Next());
if (l == NULL) continue;
l->OnClusterDiscoveryUnavailable(*this);
}
}
/*
* cluster::ClusterControllerClient::onNodeFound
*/
void cluster::ClusterControllerClient::onNodeFound(const cluster::ClusterController::PeerHandle& hPeer) {
ListenerIterator iter = this->GetListeners();
while (iter.HasNext()) {
Listener *l = dynamic_cast<Listener*>(iter.Next());
if (l == NULL) continue;
l->OnClusterNodeFound(*this, hPeer);
}
}
/*
* cluster::ClusterControllerClient::onNodeLost
*/
void cluster::ClusterControllerClient::onNodeLost(const cluster::ClusterController::PeerHandle& hPeer) {
ListenerIterator iter = this->GetListeners();
while (iter.HasNext()) {
Listener *l = dynamic_cast<Listener*>(iter.Next());
if (l == NULL) continue;
l->OnClusterNodeLost(*this, hPeer);
}
}
/*
* cluster::ClusterControllerClient::onUserMsg
*/
void cluster::ClusterControllerClient::onUserMsg(const ClusterController::PeerHandle& hPeer, bool isClusterMember, const UINT32 msgType, const BYTE *msgBody) {
ListenerIterator iter = this->GetListeners();
while (iter.HasNext()) {
Listener *l = dynamic_cast<Listener*>(iter.Next());
if (l == NULL) continue;
l->OnClusterUserMessage(*this, hPeer, isClusterMember, msgType, msgBody);
}
}
| [
"grottel@77d55b08-817d-0410-979b-1fec1beb8c2e"
] | grottel@77d55b08-817d-0410-979b-1fec1beb8c2e |
ce72e31a7ff6c03000aaa96ea5ae87291d4e6b11 | f6bfb3f1ec8708d47a9deb1f2575cab12f85ad0e | /src/UtilConstant.cc | 7ed94b0b841354bdd649efd2ce110a160815e816 | [] | no_license | hclspring/user-event-code | 8216be5942018e8fb02f02d664049a3c13d1d1d2 | f3f3bfecf7371e9eeb9c916d5c1dc6945e31717d | refs/heads/master | 2023-03-07T18:57:24.590677 | 2019-02-09T13:57:46 | 2019-02-09T13:57:46 | 56,387,611 | 0 | 1 | null | 2023-02-19T14:42:53 | 2016-04-16T14:21:31 | C++ | UTF-8 | C++ | false | false | 5,705 | cc | #include "UtilConstant.h"
#include <iostream>
//#include <boost/algorithm/string/case_conv.hpp>
#include "Util.h"
Problem UtilConstant::toProblem(const std::string& val) {
std::string lowercase = Util::to_lower_copy(val);
if (lowercase.compare("calc_cost") == 0) {
return CALC_COST;
} else if (lowercase.compare("preprocess") == 0) {
return PREPROCESS;
} else if (lowercase.compare("calc_assignment") == 0) {
return CALC_ASSIGNMENT;
} else if (lowercase.compare("calc_match") == 0) {
return CALC_MATCH;
} else {
std::cerr << "Error parsing string: " << val << std::endl;
exit(-1);
}
}
TargetFunction UtilConstant::toTargetFunction(const std::string& val) {
std::string lowercase = Util::to_lower_copy(val);
if (lowercase.compare("clique") == 0) {
return CLIQUE;
} else if (lowercase.compare("cut") == 0) {
return CUT;
} else if (lowercase.compare("clique_and_cut") == 0) {
return CLIQUE_AND_CUT;
} else if (lowercase.compare("match") == 0) {
return MATCH;
} else {
std::cerr << "Error parsing string: " << val << std::endl;
exit(-1);
}
}
Algorithm UtilConstant::toAlgorithm(const std::string& val) {
std::string lowercase = Util::to_lower_copy(val);
if (lowercase.compare("exhaustive") == 0) {
return EXHAUSTIVE;
} else if (lowercase.compare("sa") == 0) {
return SA;
} else if (lowercase.compare("greedy") == 0) {
return GREEDY;
} else if (lowercase.compare("fgreedy") == 0) {
return FGREEDY;
} else if (lowercase.compare("fdta") == 0) {
return FDTA;
} else if (lowercase.compare("pdta") == 0) {
return PDTA;
} else {
std::cerr << "Error parsing string: " << val << std::endl;
exit(-1);
}
}
bool UtilConstant::toBool(const std::string& val) {
std::string lowercase = Util::to_lower_copy(val);
if (lowercase.compare("true") == 0) {
return true;
} else {
return false;
}
}
OptionKey UtilConstant::int2OptionKey(const int& val) {
std::vector<OptionKey> vec = {
OPT_HELP, // 'h'
OPT_INPUT_FILE,
OPT_INPUT_ATTRIBUTE_FILE,
OPT_INPUT_USER_CAPACITY_FILE,
OPT_INPUT_EVENT_CAPACITY_FILE,
OPT_INPUT_USER_LOCATION_FILE,
OPT_INPUT_EVENT_LOCATION_FILE,
OPT_INPUT_EVENT_CONFLICT_FILE,
OPT_INPUT_USER_ARRIVAL_FILE,
OPT_INPUT_ASSIGNMENT_FILE,
OPT_OUTPUT_FILE,
OPT_OUTPUT_DIR,
OPT_ONLINE,
OPT_OFFLINE,
OPT_COUNT,
OPT_ALPHA,
OPT_BETA,
OPT_GAMMA,
OPT_PROBLEM,
OPT_TARGET_FUNCTION,
OPT_ALGORITHM
/*
OPT_NET_TYPE,
OPT_NET_INROOT,
OPT_NET_INJSON,
OPT_NET_VOLUNTEERS,
OPT_OUT_DIR,
OPT_PART_STR_LENGTH,
OPT_DISEASE,
OPT_INFECT_RATE,
OPT_INFECT_RATE_SECONDS,
OPT_INFECTIOUS_RATE,
OPT_INFECTIOUS_RATE_SECONDS,
OPT_RECOVER_RATE,
OPT_RECOVER_RATE_SECONDS,
OPT_SECONDS_PER_WEIGHT,
OPT_SECONDS_PER_STEP,
OPT_SOURCE_COUNT,
OPT_SNAPSHOT_COVERAGE,
OPT_MAX_SIM_DAYS,
OPT_REPEAT_TIMES,
OPT_SRC_IDN_METHOD,
OPT_UB_R,
OPT_SRC_IDN_KNOWNTIME,
OPT_START_PART,
OPT_END_PART,
OPT_LAST_PARTS_THRESHOLD,
OPT_CALC_EDGES,
OPT_NET_FRIENDSHIP,
OPT_FD_FUNC,
OPT_EVOLVE_PARA_ALPHA,
OPT_EVOLVE_PARA_A,
OPT_EVOLVE_PARA_B,
OPT_IF,
OPT_IE,
OPT_MERGE_PARTS
*/
};
if (val >= 'h' && val < 'h' + vec.size()) {
return vec[val - 'h'];
} else {
std::cerr << "Error: unknown OptionKey." << std::endl;
exit(-1);
}
}
/*
DiseaseStage UtilConstant::int2DiseaseStage(const int& val) {
switch (val) {
case 0: return SUSCEPTIBLE;
case 1: return EXPOSED;
case 2: return INFECTIOUS;
case 3: return RECOVERED;
default: std::cerr << "Error: unknown DiseaseStage." << std::endl; exit(-1);
}
}
bool UtilConstant::canBeInfected(const DiseaseStage& stage) {
return stage == SUSCEPTIBLE;
}
bool UtilConstant::isInfected(const DiseaseModel& disease, const DiseaseStage& stage) {
switch (stage) {
case INFECTIOUS: return true;
case EXPOSED:
switch (disease) {
case SI:
case SIR:
case SIS:
return false;
case SEIR:
return true;
default:
std::cerr << "Error: unknown DiseaseModel." << std::endl;
exit(-1);
}
default: return false;
}
}
bool UtilConstant::isInfectious(const DiseaseModel& disease, const DiseaseStage& stage) {
return stage == INFECTIOUS;
}
bool UtilConstant::hasBeenInfected(const DiseaseModel& disease, const DiseaseStage& stage) {
switch (disease) {
case SI: if (stage == INFECTIOUS) return true; else return false;
case SIR: if (stage == INFECTIOUS || stage == RECOVERED) return true; else return false;
case SIS: if (stage == INFECTIOUS) return true; else return false;
case SEIR: if (stage == EXPOSED || stage == INFECTIOUS || stage == RECOVERED) {
return true;
} else {
return false;
}
default:
std::cerr << "Error: unknown DiseaseModel." << std::endl;
exit(-1);
}
}
std::vector<DiseaseStage> UtilConstant::getUnstableStages(const DiseaseModel& disease) {
std::vector<DiseaseStage> res;
switch (disease) {
case SI:
case SIS:
case SIR:
res.push_back(INFECTIOUS); break;
case SEIR:
res.push_back(INFECTIOUS); res.push_back(EXPOSED); break;
default:
std::cerr << "Error: unknown DiseaseModel." << std::endl;
exit(-1);
}
return res;
}
bool UtilConstant::isStable(
const DiseaseModel& disease,
const std::vector<DiseaseStage>& stages,
const std::vector<DiseaseStage>& unstable_stages) {
for (int i = 0; i < stages.size(); ++i) {
if (Util::contains(unstable_stages, stages[i])) {
return false;
}
}
return true;
}
DiseaseStage UtilConstant::getInitialInfectedStage(const DiseaseModel& disease) {
switch (disease) {
case SI:
case SIS:
case SIR:
return INFECTIOUS;
case SEIR:
return EXPOSED;
default:
std::cerr << "Error: unknown disease." << std::endl;
exit(-1);
}
}
*/
| [
"yespow@gmail.com"
] | yespow@gmail.com |
674400c8825c1443e0223cdcf9df1c144d3aba24 | d10324106e797b80a8449eddf48ebdb803eab429 | /myPTM.cpp | 45b1154d0208b58f5b9ea63ba884c9a2d836f405 | [] | no_license | yongpitt/PTMOpt | fd370031f94fbc80fac93f0445f65e958c06fb34 | 0d219f6b41723f3d6bc2c83ee2374a86b47119c9 | refs/heads/master | 2020-05-17T10:08:20.610390 | 2013-06-15T21:41:36 | 2013-06-15T21:41:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,962 | cpp | // myIQO.cpp :
//
#include "stdafx.h"
#include <boost/assign.hpp>
#include "TranManager.h"
#include "Scheduler.h"
#include "DataManager.h"
using namespace std;
string ReadAll(const char* fileName){
string inFileBuf;
ifstream ifs(fileName);
if (!ifs){
return inFileBuf;
}
ifs.unsetf(ios::skipws);//unset skip space
copy(istream_iterator<char>(ifs), istream_iterator<char>(), back_inserter(inFileBuf));
return inFileBuf;
}
vector<string> ReadLines1(const char* fileName)
{
vector<string> lines;
ifstream ifs(fileName);
if (!ifs){
return lines;
}
string line; /* space to read a line into */
while ( getline(ifs, line, '\n') ) /* read each line */
{
lines.push_back(string(line));
}
return lines;
}
int main(int argc, char** argv)
{
int i;
unsigned int mySeed;
int RoundRobin;
int lines;
std::vector<const char*> filePathes; //the files starts at the third input parameters
typedef vector<string> StrVec;
std::vector<StrVec> FileLinesList;
if (argc < 5){
cerr<<"Not enough parameters!\n";
return 1;
}
mySeed = atoi(argv[1]);
RoundRobin = atoi(argv[2]);
lines = atoi(argv[3]);
argc -= 3;
i = 4;
while(argc-- > 1)
{
vector<string> lines;
filePathes.push_back(argv[i]);
lines = ReadLines1(argv[i]);
FileLinesList.push_back(lines);
i++;
}
srand(mySeed);
//operation input and transaction management:
TranManager TransactionManager;
if(RoundRobin)
TransactionManager = TranManager(FileLinesList);
else
{
lines = rand() % 10 + 1; //allow to read 1 - 10 lines once
TransactionManager = TranManager(FileLinesList,lines);
}
//operations in transactions: TRAN_ID, OP_TYPE, MODE, FILE_NAME, RECORD_ID, CLIENT_NAME, PHONE
//schedule the transactions here:
Scheduler shr;
shr.ScheduleTransactions(TransactionManager.getTrans());
//output to database
DataManager myData;
myData.UpdateDatabase(shr.GetCommitedOutput());
return 0;
}
| [
"mysec@126.com"
] | mysec@126.com |
8af6d186ceea7808b0e52a740e81cb851e81ae05 | 4f995c4e5f995540a20cd86994559ca2a3073cba | /include/fieldkit/gl/PointCloud.h | fb540ba9190d43466b8bca556890b724c130b60f | [] | no_license | rockolo/FieldKit.cpp | ad91ed7ec3e353a403a031f814922242e7d4cabf | 097978a23ca1e5407863670d51254267ae42e1b0 | refs/heads/master | 2021-01-18T03:48:34.206326 | 2011-03-23T13:51:25 | 2011-03-23T13:51:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,581 | h | /*
* _____ __ _____ __ ____
* / ___/ / / /____/ / / / \ FieldKit
* / ___/ /_/ /____/ / /__ / / / (c) 2010, FIELD. All rights reserved.
* /_/ /____/ /____/ /_____/ http://www.field.io
*
* Created by Marcus Wendt on 30/06/2010.
*/
#pragma once
#include "fieldkit/gl/GLKit_Prefix.h"
#include "fieldkit/gl/PointDataFormat.h"
#include "cinder/gl/GlslProg.h"
#include "cinder/gl/Vbo.h"
#define POINTCLOUD_DEFAULT_VS "\
attribute vec3 InVertex;\
attribute vec4 InColor;\
attribute float InSize;\
void main() {\
vec4 vertex = vec4(InVertex, 1.0);\
vec4 position = gl_ProjectionMatrix * gl_ModelViewMatrix * vertex;\
gl_Position = position;\
gl_PointSize = InSize;\
gl_FrontColor = InColor;\
}"
#define POINTCLOUD_DEFAULT_FS "\
float smoothstepVar(float edge1, float edge2, float curve, float value) { \
float width = edge2 - edge1; \
float phase = (value - edge1) / width; \
phase = clamp(phase,0.0,1.0); \
curve = (curve + 0.025) * 99.075; \
float outValue = pow(phase,curve); \
return outValue; \
} \
void main() { \
vec2 tc = gl_TexCoord[0].st; \
float dist = distance(tc, vec2(0.5, 0.5)); \
float d = 1.0 - smoothstepVar(0.0, 0.5, 0.5, dist); \
if(dist > 0.5) discard; \
gl_FragColor = gl_Color * d; \
} \
"
namespace fieldkit { namespace gl {
class PointCloud {
public:
PointCloud();
~PointCloud();
//! initializes this clouds buffer to a certain format
void init(PointDataFormat const format, int capacity, GlslProg const shader);
//! clears the buffer data
void clear();
//! inserts a float attribute for the current particle
void inline put(float const& value)
{
*ptr = value; ++ptr;
}
//! inserts a 2d vector attribute for the current particle
void put(Vec2f const& v);
//! inserts a 3d vector attribute for the current particle
void put(Vec3f const& v);
//! inserts a 4d vector attribute for the current particle
void put(Vec4f const& v);
//! inserts a color attribute for the current particle
void put(ColorAf const& v);
//! call this when all data for a single particle was inserted
void insert();
//! draws this cloud to screen
void draw();
protected:
PointDataFormat format;
int capacity;
int bytesPerParticle;
GLfloat* data;
int size;
GLfloat* ptr;
Vbo vbo;
GlslProg shader;
};
} } // namespace fieldkit::gl | [
"marcus@field.io"
] | marcus@field.io |
ad825a7612904cd7727c71faf6189163a0379aae | e11856e67da14193ee29ed150ada1cf9f25930c4 | /seq_rtmidi/src/midi_alsa.cpp | 61ccf08265f7d18d90e88ed0ca11655240022b67 | [] | no_license | fourks/seq66 | 5f00184e9b9502cbd37fc6028fc4092c71face23 | d8edfd5dbbca44d82214a32de4d63d4843c5be79 | refs/heads/master | 2020-11-27T23:35:37.081999 | 2019-10-20T13:53:01 | 2019-10-20T13:53:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 26,934 | cpp | /*
* This file is part of seq66.
*
* seq66 is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* seq66 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 seq66; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* \file midi_alsa.cpp
*
* This module declares/defines the base class for handling MIDI I/O via
* the ALSA system.
*
* \library seq66 application
* \author Chris Ahlstrom
* \date 2016-12-18
* \updates 2019-02-10
* \license GNU GPLv2 or above
*
* This file provides a Linux-only implementation of ALSA MIDI support.
* It is derived from the seq_alsamidi implementation in that midibus module.
* Note that we are changing the MIDI API somewhat from the original RtMidi
* midi_api class; that interface didn't really fit the seq66 model,
* and it was getting very painful to warp RtMidi to fit.
*
* Examples of subscription:
* Capture from keyboard:
*
* Assume MIDI input port = 64:0, application port = 128:0, and queue for
* timestamp = 1 with real-time stamp. The application port must have
* capability SND_SEQ_PORT_CAP_WRITE.
*
\verbatim
void capture_keyboard (snd_seq_t * seq)
{
snd_seq_addr_t sender, dest;
snd_seq_port_subscribe_t *subs;
sender.client = 64;
sender.port = 0;
dest.client = 128;
dest.port = 0;
snd_seq_port_subscribe_alloca(&subs);
snd_seq_port_subscribe_set_sender(subs, &sender);
snd_seq_port_subscribe_set_dest(subs, &dest);
snd_seq_port_subscribe_set_queue(subs, 1);
snd_seq_port_subscribe_set_time_update(subs, 1);
snd_seq_port_subscribe_set_time_real(subs, 1);
snd_seq_subscribe_port(seq, subs);
}
\endverbatim
*
* Output to MIDI device:
*
* Assume MIDI output port = 65:1 and application port = 128:0. The
* application port must have capability SND_SEQ_PORT_CAP_READ.
*
\verbatim
void subscribe_output(snd_seq_t *seq)
{
snd_seq_addr_t sender, dest;
snd_seq_port_subscribe_t *subs;
sender.client = 128;
sender.port = 0;
dest.client = 65;
dest.port = 1;
snd_seq_port_subscribe_alloca(&subs);
snd_seq_port_subscribe_set_sender(subs, &sender);
snd_seq_port_subscribe_set_dest(subs, &dest);
snd_seq_subscribe_port(seq, subs);
}
\endverbatim
*
* See http://www.alsa-project.org/alsa-doc/alsa-lib/seq.html for a wealth of
* information on ALSA sequencing.
*/
#include "cfg/settings.hpp" /* seq66::rc() */
#include "midi/event.hpp" /* seq66::event (MIDI event) */
#include "midibus_rm.hpp" /* seq66::midibus for rtmidi */
#include "midi_alsa.hpp" /* seq66::midi_alsa for ALSA */
#include "midi_info.hpp" /* seq66::midi_info */
#include "util/calculations.hpp" /* clock_ticks_from_ppqn() */
/*
* Do not document a namespace; it breaks Doxygen.
*/
namespace seq66
{
/**
* Provides a constructor with client number, port number, ALSA sequencer
* support, name of client, name of port, etc., mostly contained within an
* already-initialized midi_info object.
*
* This constructor is the only one that is used for the MIDI input and
* output busses, whether the [manual-ports] option is in force or not.
* The actual setup of a normal or virtual port is done in the api_*_init_*()
* routines.
*
* Also used for the announce buss, and in the mastermidi_alsa::port_start()
* function. There's currently some overlap between local/dest client and
* port numbers and the buss and port numbers of the new midibase interface.
* Also, note that the rcfile module uses the master buss to get the
* buss names when it writes the file.
*
* We get the actual user-client ID from ALSA, then rebuild the descriptive
* name for this port. Also have to do it for the parent midibus. We'd like
* to use seq_client_name(), but it comes up unresolved by the damned GNU
* linker! The obvious fixes don't work!
*
* Another issue (2017-05-27): ALSA returns "130" as the client ID. That is
* our ALSA ID, not the ID of the client we are representing. Thus, we
* should not set the buss ID and name of the parent-bus; these have already
* been determined.
*
* \param parentbus
* Provides much of the infor about this ALSA buss.
*
* \param masterinfo
* Provides the information about the desired port, and more.
*/
midi_alsa::midi_alsa (midibus & parentbus, midi_info & masterinfo)
:
midi_api (parentbus, masterinfo),
m_seq
(
reinterpret_cast<snd_seq_t *>(masterinfo.midi_handle())
),
m_dest_addr_client (parentbus.get_bus_id()),
m_dest_addr_port (parentbus.get_port_id()),
m_local_addr_client (snd_seq_client_id(m_seq)), /* our client ID */
m_local_addr_port (-1),
m_input_port_name (rc().app_client_name() + " in")
{
set_bus_id(m_local_addr_client);
set_name(SEQ66_CLIENT_NAME, bus_name(), port_name());
}
/**
* A rote empty virtual destructor.
*/
midi_alsa::~midi_alsa ()
{
// empty body
}
/**
* Initialize the MIDI output port. This initialization is done when the
* "manual-ports" option is not in force.
*
* This initialization is like the "open_port()" function of the RtMidi
* library, with the addition of the snd_seq_connect_to() call involving
* the local and destination ports.
*
* \tricky
* One important thing to note is that this output port is initialized
* with the SND_SEQ_PORT_CAP_READ flag, which means this is really an
* input port. We connect this input port with a system output port that
* was discovered. This is backwards of the way RtMidi does it.
*
* \return
* Returns true unless setting up ALSA MIDI failed in some way.
*/
bool
midi_alsa::api_init_out ()
{
std::string busname = parent_bus().bus_name();
int result = snd_seq_create_simple_port /* create ports */
(
m_seq, busname.c_str(),
SND_SEQ_PORT_CAP_NO_EXPORT | SND_SEQ_PORT_CAP_READ,
SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION
);
m_local_addr_port = result;
if (result < 0)
{
errprint("snd_seq_create_simple_port(write) error");
return false;
}
result = snd_seq_connect_to /* connect to port */
(
m_seq, m_local_addr_port, m_dest_addr_client, m_dest_addr_port
);
if (result < 0)
{
fprintf
(
stderr, "snd_seq_connect_to(%d:%d) error\n",
m_dest_addr_client, m_dest_addr_port
);
return false;
}
else
{
set_port_open();
#if defined SEQ66_SHOW_API_CALLS
printf
(
"READ/output port '%s' created:\n local port %d connected to %d:%d\n",
busname.c_str(), m_local_addr_port,
m_dest_addr_client, m_dest_addr_port
);
#endif
}
return true;
}
/**
* Initialize the MIDI input port.
*
* Subscription handlers:
*
* In ALSA library, subscription is done via snd_seq_subscribe_port()
* function. It takes the argument of snd_seq_port_subscribe_t record
* pointer. Suppose that you have a client which will receive data from a
* MIDI input device. The source and destination addresses are like the
* below:
*
\verbatim
snd_seq_addr_t sender, dest;
sender.client = MIDI_input_client;
sender.port = MIDI_input_port;
dest.client = my_client;
dest.port = my_port;
\endverbatim
*
To set these values as the connection call like this.
*
\verbatim
snd_seq_port_subscribe_t *subs;
snd_seq_port_subscribe_alloca(&subs);
snd_seq_port_subscribe_set_sender(subs, &sender);
snd_seq_port_subscribe_set_dest(subs, &dest);
snd_seq_subscribe_port(handle, subs);
\endverbatim
*
* \tricky
* One important thing to note is that this input port is initialized
* with the SND_SEQ_PORT_CAP_WRITE flag, which means this is really an
* output port. We connect this output port with a system input port
* that was discovered. This is backwards of the way RtMidi does it.
*
* \return
* Returns true unless setting up ALSA MIDI failed in some way.
*/
bool
midi_alsa::api_init_in ()
{
std::string portname = parent_bus().port_name();
int result = snd_seq_create_simple_port /* create ports */
(
m_seq, portname.c_str(),
SND_SEQ_PORT_CAP_NO_EXPORT | SND_SEQ_PORT_CAP_WRITE,
SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION
);
m_local_addr_port = result;
if (result < 0)
{
errprint("snd_seq_create_simple_port(read) error");
return false;
}
snd_seq_port_subscribe_t * subs;
snd_seq_port_subscribe_alloca(&subs);
snd_seq_addr_t sender;
sender.client = m_dest_addr_client; /* MIDI input client */
sender.port = m_dest_addr_port; /* MIDI input port */
snd_seq_port_subscribe_set_sender(subs, &sender); /* destination */
snd_seq_addr_t dest;
dest.client = m_local_addr_client; /* my client */
dest.port = m_local_addr_port; /* my port */
snd_seq_port_subscribe_set_dest(subs, &dest); /* local */
/*
* Use the master queue, and get ticks, then subscribe.
*/
int queue = parent_bus().queue_number();
snd_seq_port_subscribe_set_queue(subs, queue);
snd_seq_port_subscribe_set_time_update(subs, 1);
result = snd_seq_subscribe_port(m_seq, subs);
if (result < 0)
{
fprintf
(
stderr, "snd_seq_connect_from(%d:%d) error\n",
m_dest_addr_client, m_dest_addr_port
);
return false;
}
else
{
set_port_open();
#if defined SEQ66_SHOW_API_CALLS
printf
(
"WRITE/input port '%s' created; sender %d:%d, "
"destination (local) %d:%d\n",
m_input_port_name.c_str(),
m_dest_addr_client, m_dest_addr_port,
m_local_addr_client, m_local_addr_port
);
#endif
}
return true;
}
/**
* Gets information directly from ALSA. The problem this function solves is
* that the midibus constructor for a virtual ALSA port doesn't not have all
* of the information it needs at that point. Here, we can get this
* information and get the actual data we need to rename the port to
* something accurate. Same as the seq_alsamidi version of this function.
*
* \return
* Returns true if all of the information could be obtained. If false is
* returned, then the caller should not use the side-effects.
*
* \sideeffect
* Passes back the values found.
*/
bool
midi_alsa::set_virtual_name (int portid, const std::string & portname)
{
bool result = not_nullptr(m_seq);
if (result)
{
snd_seq_client_info_t * cinfo; /* client info */
snd_seq_client_info_alloca(&cinfo); /* will fill cinfo */
snd_seq_get_client_info(m_seq, cinfo); /* filled! */
int cid = snd_seq_client_info_get_client(cinfo);
const char * cname = snd_seq_client_info_get_name(cinfo);
result = not_nullptr(cname);
if (result)
{
std::string clientname = cname;
std::string pname = portname;
set_port_id(portid);
pname += " ";
pname += std::to_string(portid);
port_name(pname);
set_bus_id(cid);
set_name(rc().application_name(), clientname, pname);
parent_bus().set_name(rc().application_name(), clientname, pname);
}
}
return result;
}
/**
* Initialize the output in a different way. This version of initialization
* is used by mastermidi_alsa in the "manual-ports" clause. This code
* is also very similar to the same function in the
* midibus::api_init_out_sub() function of midibus::api_init_out_sub().
*
* \return
* Returns true unless setting up the ALSA port failed in some way.
*/
bool
midi_alsa::api_init_out_sub ()
{
std::string portname = port_name();
if (portname.empty())
portname = rc().app_client_name() + " out";
int result = snd_seq_create_simple_port /* create ports */
(
m_seq, portname.c_str(),
SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ,
SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION
);
m_local_addr_port = result;
if (result < 0)
{
errprint("snd_seq_create_simple_port(write) error");
return false;
}
else
{
set_virtual_name(result, portname);
set_port_open();
#if defined SEQ66_SHOW_API_CALLS
printf
(
"virtual READ/output port '%s' created, local port %d\n",
portname.c_str(), result
);
#endif
}
return true;
}
/**
* Initialize the output in a different way?
*
* \return
* Returns true unless setting up the ALSA port failed in some way.
*/
bool
midi_alsa::api_init_in_sub ()
{
std::string portname = port_name();
if (portname.empty())
portname = rc().app_client_name() + " midi in";
int result = snd_seq_create_simple_port /* create ports */
(
m_seq,
m_input_port_name.c_str(), // portname.c_str()
SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE,
SND_SEQ_PORT_TYPE_MIDI_GENERIC | SND_SEQ_PORT_TYPE_APPLICATION
);
m_local_addr_port = result;
if (result < 0)
{
errprint("snd_seq_create_simple_port(write) error");
return false;
}
else
{
set_virtual_name(result, portname);
set_port_open();
#if defined SEQ66_SHOW_API_CALLS
printf("virtual WRITE/input port 'seq66 in' created; port %d\n", result);
#endif
}
return true;
}
/**
* Deinitialize the MIDI input. Set the input and the output ports.
* The destination port is actually our local port.
*
* \return
* Returns true, unless an error occurs.
*/
bool
midi_alsa::api_deinit_in ()
{
snd_seq_port_subscribe_t * subs;
snd_seq_port_subscribe_alloca(&subs);
snd_seq_addr_t sender; /* output */
sender.client = m_dest_addr_client;
sender.port = m_dest_addr_port;
snd_seq_port_subscribe_set_sender(subs, &sender);
snd_seq_addr_t dest; /* input */
dest.client = m_local_addr_client;
dest.port = m_local_addr_port;
snd_seq_port_subscribe_set_dest(subs, &dest);
/*
* This would seem to unsubscribe all ports. True? Danger?
*/
int queue = parent_bus().queue_number();
snd_seq_port_subscribe_set_queue(subs, queue);
snd_seq_port_subscribe_set_time_update(subs, queue); /* get ticks */
int result = snd_seq_unsubscribe_port(m_seq, subs); /* unsubscribe */
if (result < 0)
{
fprintf
(
stderr, "snd_seq_unsubscribe_port(%d:%d) error\n",
m_dest_addr_client, m_dest_addr_port
);
return false;
}
#if defined SEQ66_SHOW_API_CALLS
printf
(
"WRITE/input port deinit'ed; sender %d:%d, destination (local) %d:%d\n",
m_dest_addr_client, m_dest_addr_port,
m_local_addr_client, m_local_addr_port
);
#endif
return true;
}
/*
* This function is supposed to poll for MIDI data, but the current
* ALSA implementation DOES NOT USE THIS FUNCTION. Commented out.
* This kills startup: return master_info().api_poll_for_midi();
*
* int
* midi_alsa::api_poll_for_midi ()
* {
* millisleep(1);
* return 0;
* }
*
*/
/**
* Defines the size of the MIDI event buffer, which should be large enough to
* accomodate the largest MIDI message to be encoded.
* A local define for visibility.
*/
#define SEQ66_MIDI_EVENT_SIZE_MAX 10
/**
* This play() function takes a native event, encodes it to an ALSA MIDI
* sequencer event, sets the broadcasting to the subscribers, sets the
* direct-passing mode to send the event without queueing, and puts it in the
* queue.
*
* \threadsafe
*
* \param e24
* The event to be played on this bus. For speed, we don't bother to
* check the pointer.
*
* \param channel
* The channel of the playback.
*/
void
midi_alsa::api_play (event * e24, midibyte channel)
{
midibyte buffer[4]; /* temp for MIDI data */
buffer[0] = e24->get_status(); /* fill buffer */
buffer[0] += (channel & 0x0F);
e24->get_data(buffer[1], buffer[2]); /* set MIDI data */
snd_midi_event_t * midi_ev; /* ALSA MIDI parser */
snd_midi_event_new(SEQ66_MIDI_EVENT_SIZE_MAX, &midi_ev);
snd_seq_event_t ev;
snd_seq_ev_clear(&ev); /* clear event */
snd_midi_event_encode(midi_ev, buffer, 3, &ev); /* encode 3 raw bytes */
snd_midi_event_free(midi_ev); /* free the parser */
snd_seq_ev_set_source(&ev, m_local_addr_port); /* set source */
#if defined SEQ66_SHOW_API_CALLS_TMI /* Too Much Information */
printf("midi_alsa::play() local port %d\n", m_local_addr_port);
#endif
snd_seq_ev_set_subs(&ev);
snd_seq_ev_set_direct(&ev); /* it is immediate */
snd_seq_event_output(m_seq, &ev); /* pump into the queue */
}
/**
* min() for long values.
*
* \param a
* First operand.
*
* \param b
* Second operand.
*
* \return
* Returns the minimum value of a and b.
*/
inline long
min (long a, long b)
{
return (a < b) ? a : b ;
}
/**
* Defines the value used for sleeping, in microseconds. Defined locally
* simply for visibility. Why 80000?
*/
#define SEQ66_USLEEP_US 80000
/**
* Takes a native SYSEX event, encodes it to an ALSA event, and then
* puts it in the queue.
*
* \param e24
* The event to be handled.
*/
void
midi_alsa::api_sysex (event * e24)
{
snd_seq_event_t ev;
snd_seq_ev_clear(&ev); /* clear event */
snd_seq_ev_set_priority(&ev, 1);
snd_seq_ev_set_source(&ev, m_local_addr_port); /* set source */
snd_seq_ev_set_subs(&ev);
snd_seq_ev_set_direct(&ev); /* it's immediate */
/*
* Replaced by a vector of midibytes:
*
* midibyte * data = e24->get_sysex();
*
* This is a bit tricky, and relies on the standard property of
* std::vector where all n elements of the vector are guaranteed to be
* stored contiguously (in order to be accessible via random-access
* iterators).
*
* 256 == c_midi_alsa_sysex_chunk
*/
const int chunk = 256;
event::sysex & data = e24->get_sysex();
int data_size = e24->get_sysex_size();
for (int offset = 0; offset < data_size; offset += chunk)
{
int data_left = data_size - offset;
snd_seq_ev_set_sysex(&ev, min(data_left, chunk), &data[offset]);
snd_seq_event_output_direct(m_seq, &ev); /* pump into queue */
usleep(SEQ66_USLEEP_US);
api_flush();
}
}
/**
* Flushes our local queue events out into ALSA. This is also a midi_alsa_info
* function.
*/
void
midi_alsa::api_flush ()
{
snd_seq_drain_output(m_seq);
}
/**
* Continue from the given tick.
*
* Also defined in midi_alsa_info.
*
* \param tick
* The continuing tick, unused in the ALSA implementation here.
* The midibase::continue_from() function uses it.
*
* \param beats
* The beats value calculated by midibase::continue_from().
*/
#if defined SEQ66_SHOW_API_CALLS
#define tick_parameter tick
#else
#define tick_parameter /* tick */
#endif
void
midi_alsa::api_continue_from (midipulse tick_parameter, midipulse beats)
{
snd_seq_event_t ev;
snd_seq_ev_clear(&ev); /* clear event */
ev.type = SND_SEQ_EVENT_CONTINUE;
snd_seq_event_t evc;
snd_seq_ev_clear(&evc); /* clear event */
evc.type = SND_SEQ_EVENT_SONGPOS;
evc.data.control.value = beats;
snd_seq_ev_set_fixed(&ev);
snd_seq_ev_set_fixed(&evc);
snd_seq_ev_set_priority(&ev, 1);
snd_seq_ev_set_priority(&evc, 1);
snd_seq_ev_set_source(&evc, m_local_addr_port); /* set the source */
snd_seq_ev_set_subs(&evc);
snd_seq_ev_set_source(&ev, m_local_addr_port);
snd_seq_ev_set_subs(&ev);
snd_seq_ev_set_direct(&ev); /* it's immediate */
snd_seq_ev_set_direct(&evc);
snd_seq_event_output(m_seq, &evc); /* pump into queue */
api_flush();
snd_seq_event_output(m_seq, &ev);
#if defined SEQ66_SHOW_API_CALLS
if (tick > 0)
{
printf
(
"midi_alsa::continue_from(%ld) local port %d\n", tick, m_local_addr_port
);
}
#endif
}
/**
* This function gets the MIDI clock a-runnin', if the clock type is not
* e_clock::off.
*/
void
midi_alsa::api_start ()
{
snd_seq_event_t ev;
snd_seq_ev_clear(&ev); /* memsets it to 0 */
ev.type = SND_SEQ_EVENT_START;
snd_seq_ev_set_fixed(&ev);
snd_seq_ev_set_priority(&ev, 1);
snd_seq_ev_set_source(&ev, m_local_addr_port); /* set the source */
snd_seq_ev_set_subs(&ev);
snd_seq_ev_set_direct(&ev); /* it's immediate */
snd_seq_event_output(m_seq, &ev); /* pump into queue */
}
/**
* Stop the MIDI buss.
*/
void
midi_alsa::api_stop ()
{
snd_seq_event_t ev;
snd_seq_ev_clear(&ev); /* memsets it to 0 */
ev.type = SND_SEQ_EVENT_STOP;
snd_seq_ev_set_fixed(&ev);
snd_seq_ev_set_priority(&ev, 1);
snd_seq_ev_set_source(&ev, m_local_addr_port); /* set the source */
snd_seq_ev_set_subs(&ev);
snd_seq_ev_set_direct(&ev); /* it's immediate */
snd_seq_event_output(m_seq, &ev); /* pump into queue */
}
/**
* Generates the MIDI clock, starting at the given tick value.
* Also sets the event tag to 127 so the sequences won't remove it.
*
* \threadsafe
*
* \param tick
* Provides the starting tick, unused in the ALSA implementation.
*/
void
midi_alsa::api_clock (midipulse tick)
{
if (tick >= 0)
{
#if defined SEQ66_PLATFORM_DEBUG_TMI
midibase::show_clock("ALSA", tick);
#endif
}
snd_seq_event_t ev;
snd_seq_ev_clear(&ev); /* clear event */
ev.type = SND_SEQ_EVENT_CLOCK;
ev.tag = 127;
snd_seq_ev_set_fixed(&ev);
snd_seq_ev_set_priority(&ev, 1);
snd_seq_ev_set_source(&ev, m_local_addr_port); /* set source */
snd_seq_ev_set_subs(&ev);
snd_seq_ev_set_direct(&ev); /* it's immediate */
snd_seq_event_output(m_seq, &ev); /* pump it into queue */
}
/**
* Currently, this code is implemented in the midi_alsa_info module, since
* it is a mastermidibus function. Note the implementation here, though.
* Which actually gets used?
*/
void
midi_alsa::api_set_ppqn (int ppqn)
{
int queue = parent_bus().queue_number();
snd_seq_queue_tempo_t * tempo;
snd_seq_queue_tempo_alloca(&tempo); /* allocate tempo struct */
snd_seq_get_queue_tempo(m_seq, queue, tempo);
snd_seq_queue_tempo_set_ppq(tempo, ppqn);
snd_seq_set_queue_tempo(m_seq, queue, tempo);
}
/**
* Set the BPM value (beats per minute). This is done by creating
* an ALSA tempo structure, adding tempo information to it, and then
* setting the ALSA sequencer object with this information.
*
* We fill the ALSA tempo structure (snd_seq_queue_tempo_t) with the current
* tempo information, set the BPM value, put it in the tempo structure, and
* give the tempo value to the ALSA queue.
*
* \note
* Consider using snd_seq_change_queue_tempo() here if the ALSA queue has
* already been started. It's arguments would be m_alsa_seq, m_queue,
* tempo (microseconds), and null.
*
* \threadsafe
*
* \param bpm
* Provides the beats-per-minute value to set.
*/
void
midi_alsa::api_set_beats_per_minute (midibpm bpm)
{
int queue = parent_bus().queue_number();
snd_seq_queue_tempo_t * tempo;
snd_seq_queue_tempo_alloca(&tempo); /* allocate tempo struct */
snd_seq_get_queue_tempo(m_seq, queue, tempo);
snd_seq_queue_tempo_set_tempo(tempo, unsigned(tempo_us_from_bpm(bpm)));
snd_seq_set_queue_tempo(m_seq, queue, tempo);
}
#if defined REMOVE_QUEUED_ON_EVENTS_CODE
/**
* Deletes events in the queue. This function is not used anywhere, and
* there was no comment about the intent/context of this function.
*/
void
midi_alsa::remove_queued_on_events (int tag)
{
snd_seq_remove_events_t * remove_events;
snd_seq_remove_events_malloc(&remove_events);
snd_seq_remove_events_set_condition
(
remove_events, SND_SEQ_REMOVE_OUTPUT | SND_SEQ_REMOVE_TAG_MATCH |
SND_SEQ_REMOVE_IGNORE_OFF
);
snd_seq_remove_events_set_tag(remove_events, tag);
snd_seq_remove_events(m_seq, remove_events);
snd_seq_remove_events_free(remove_events);
}
#endif // REMOVE_QUEUED_ON_EVENTS_CODE
/**
* ALSA MIDI input normal port or virtual port constructor. The kind of port
* is determine by which port-initialization function the mastermidibus
* calls.
*/
midi_in_alsa::midi_in_alsa (midibus & parentbus, midi_info & masterinfo)
:
midi_alsa (parentbus, masterinfo)
{
// Empty body
}
/**
* ALSA MIDI output normal port or virtual port constructor. The kind of
* port is determine by which port-initialization function the mastermidibus
* calls.
*/
midi_out_alsa::midi_out_alsa (midibus & parentbus, midi_info & masterinfo)
:
midi_alsa (parentbus, masterinfo)
{
// Empty body
}
} // namespace seq66
/*
* midi_alsa.cpp
*
* vim: sw=4 ts=4 wm=4 et ft=cpp
*/
| [
"ahlstromcj@gmail.com"
] | ahlstromcj@gmail.com |
26d47b1b692ebc9fdfcffe2741342ad7dc3cbd3c | f54f058d973efd641cd65b84715b27eec2a6cba7 | /DemoDirectX/FrameWork/GameObjects/Player/PlayerJumpThrowingState.cpp | 306812fc1a6b11ad3a60366349b37323f9e61d25 | [] | no_license | nganle97/Aladdin | bd9cb355e23b2fb9add8442bd5758b9a5912fa73 | 1c64eb701525dd751820c586acd0e6eaeb8f7278 | refs/heads/master | 2020-09-05T17:05:50.553274 | 2019-11-07T06:16:11 | 2019-11-07T06:16:11 | 220,164,396 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,984 | cpp | #include "PlayerStandingState.h"
#include "Player.h"
#include "PlayerRunningState.h"
#include "PlayerJumpThrowingState.h"
#include "PlayerThrowingState.h"
#include "PlayerFallingState.h"
#include "PlayerLandingState.h"
#include "../../GameDefines/define.h"
PlayerJumpThrowingState::PlayerJumpThrowingState(PlayerData* playerData)
{
this->mPlayerData = playerData;
acceleratorX = Define::PLAYER_RUN_SPEED;
acceleratorY = 10.0f / 6;
if (mPlayerData->player->getFaceDirection() == Entity::FaceDirection::LEFT)
mPlayerData->player->SetReverse(true);
else mPlayerData->player->SetReverse(false);
mPlayerData->player->SetVy(mPlayerData->player->GetVy());
noPressed = false;
}
PlayerJumpThrowingState::~PlayerJumpThrowingState()
{
}
void PlayerJumpThrowingState::Update(float dt)
{
/*if (this->mPlayerData->player->GetCurrentAnimation()->mCurrentIndex == 6) isDone = true;//
Code kiểm tra chạm đất -> đổi State sang Standing.
*/
if (mPlayerData->player->GetVy() < Define::PLAYER_MAX_JUMP_VELOCITY)
mPlayerData->player->AddVy(acceleratorY);
//**/
if (this->mPlayerData->player->GetCurrentAnimation()->mCurrentIndex == 4 && canThrow == true)
{
mPlayerData->player->ThrowApple();
isDone = true;
canThrow = false;
}
if (noPressed)
{
if (mPlayerData->player->getMoveDirection() == Player::MoveToLeft)
{
//player dang di chuyen sang ben trai
mPlayerData->player->SetVx(0);
}
else if (mPlayerData->player->getMoveDirection() == Player::MoveToRight)
{
//player dang di chuyen sang phai
mPlayerData->player->SetVx(0);
}
}
}
void PlayerJumpThrowingState::OnCollision(Entity *impactor, Entity::SideCollisions side, Entity::CollisionReturn data)
{
switch (side)
{
case Entity::Left:
this->mPlayerData->player->AddPosition(data.RegionCollision.right - data.RegionCollision.left, 0);
this->mPlayerData->player->SetVx(0);
break;
case Entity::Right:
this->mPlayerData->player->AddPosition(-(data.RegionCollision.right - data.RegionCollision.left), 0);
this->mPlayerData->player->SetVx(0);
break;
case Entity::Top:
return;
case Entity::Bottom:
case Entity::BottomRight:
case Entity::BottomLeft:
if (mPlayerData->player->GetVy()>0)
{
this->mPlayerData->player->AddPosition(0, -(data.RegionCollision.bottom - data.RegionCollision.top));
this->mPlayerData->player->SetState(new PlayerStandingState(this->mPlayerData));
break;
}
default:
break;
}
}
void PlayerJumpThrowingState::HandleKeyboard(std::map<int, bool> keys)
{
if (keys[VK_RIGHT])
{
mPlayerData->player->SetReverse(false);
//di chuyen sang phai
mPlayerData->player->SetVx(acceleratorX);
noPressed = false;
}
else if (keys[VK_LEFT])
{
mPlayerData->player->SetReverse(true);
//di chuyen sang trai
mPlayerData->player->SetVx(-acceleratorX);
noPressed = false;
}
else
{
noPressed = true;
}
}
PlayerState::StateName PlayerJumpThrowingState::GetState()
{
return PlayerState::JumpThrow;
} | [
"lephutrongngan@gmail.com"
] | lephutrongngan@gmail.com |
2c6af4d744732aee3e8e92d6d952fa35501c7b9e | 94d1bffbf4b9c7ebe3f97ead01e2ea5df6eb7e39 | /src/ShipGraphicsComponent.cpp | b3a6ebb6c1aadc2f66f3d461347bbb447c4dc4c3 | [] | no_license | cwbriones/sfml-game | 062e968859525ffb65ffc797d02bc04ff96acd70 | 8b0ad6092185b0af84bad1ef122b7bb2345c65b1 | refs/heads/master | 2020-05-20T05:59:19.493019 | 2013-07-18T23:59:58 | 2013-07-18T23:59:58 | 9,860,024 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,215 | cpp | #include "Component/ShipGraphicsComponent.h"
#include "Entity.h"
#include <SFML/Graphics/VertexArray.hpp>
namespace demo {
ShipGraphicsComponent::ShipGraphicsComponent() {
const int NUM_VERTICES = 4;
const float SCALE = 2.5;
vertices_ = sf::VertexArray(sf::LinesStrip, NUM_VERTICES + 1);
const int xCoords[NUM_VERTICES] = {0, 6, 12, 6};
const int yCoords[NUM_VERTICES] = {15, 10, 15, 0};
const sf::Vector2f center_(SCALE * 6.0f, SCALE * 7.5f);
for(int i = 0; i < NUM_VERTICES; i++){
vertices_[i].position = sf::Vector2f(SCALE * xCoords[i] - center_.x, SCALE * yCoords[i] - center_.y);
}
// Draw line to fully enclose shape
vertices_[NUM_VERTICES] = sf::Vector2f(SCALE * xCoords[0] - center_.x, SCALE * yCoords[0] - center_.y);
}
void ShipGraphicsComponent::update(Entity& entity, int delta){
// rotation_ += ROTATION_RATE * delta;
// const float ROTATION_RATE = 0.00628f * 2.0f;
// entity.rotate(ROTATION_RATE * delta);
}
sf::Vector2f ShipGraphicsComponent::getCenter(){
return center_;
}
void ShipGraphicsComponent::render(Entity& entity, sf::RenderTarget& target){
target.draw(vertices_, entity.getTransform());
}
} // namespace demo
| [
"cwbriones@gmail.com"
] | cwbriones@gmail.com |
e54f2be012b01dc8c2df2cd0598e76fa2a5d5b8b | d2190cbb5ea5463410eb84ec8b4c6a660e4b3d0e | /old_hydra/hydra/tags/v8_21/showertofino/hshowertofpidfinder.cc | 2091030d832119c47c6373b7a1be9b19e87d50e5 | [] | no_license | wesmail/hydra | 6c681572ff6db2c60c9e36ec864a3c0e83e6aa6a | ab934d4c7eff335cc2d25f212034121f050aadf1 | refs/heads/master | 2021-07-05T17:04:53.402387 | 2020-08-12T08:54:11 | 2020-08-12T08:54:11 | 149,625,232 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,624 | cc | //*-- AUTHOR : Jacek Otwinowski
//*-- Modified : 19/04/05 by Jacek Otwinowski
//
//_HADES_CLASS_DESCRIPTION
///////////////////////////////////////////////////////////////////////
//
//
// HShowerTofPIDFinder
//
// HShowerTofPIDFinder reconstructor is looking for good lepton candidates
// in Shower/Tofino detector. It takes information from HKickTrack,
// HShowerHitTof data containers and checks if correlated hits fulfill
// shower (sum_post1/sum_pre > 1.9 or sum_post2/sum_pre > 1.9)
// and time of flight (5 < tof < 10 ns) conditions.
//
//////////////////////////////////////////////////////////////////////
#include "hshowerhit.h"
#include "hshowerpid.h"
#include "hshowerhitheader.h"
#include "hshowercriterium.h"
#include "TArrayI.h"
#include "hruntimedb.h"
#include "hevent.h"
#include "hspectrometer.h"
#include "hdetector.h"
#include "hshowerdetector.h"
#include "hratreeext.h"
#include "hcategory.h"
#include "hmatrixcategory.h"
#include "hlinearcatiter.h"
#include "hlocation.h"
#include "hshowercal.h"
#include "hshowerhitfpar.h"
#include "hshowergeometry.h"
#include "hshowerpad.h"
#include "hiterator.h"
#include "hdebug.h"
#include "hades.h"
#include "hgeomvector.h"
#include "hgeomvector2.h"
#include "showerdef.h"
#include "hshowertofpidfinder.h"
#include "hshowertofpid.h"
#include "hshowerhittof.h"
#include "showertofinodef.h"
#include "kickdef.h"
#include "htofinocalpar.h"
#include "htofinocalparcell.h"
ClassImp(HShowerTofPIDFinder)
HShowerTofPIDFinder::HShowerTofPIDFinder(const Text_t *name,const Text_t *title) :
HReconstructor(name,title)
{
fKickTrackIter = NULL;
m_pKickTrackCat=NULL;
m_pHitTofCat=NULL;
m_pPIDCat=NULL;
m_Loc.set(0);
setFillPID();
setSortFlag(kTRUE);
}
HShowerTofPIDFinder::HShowerTofPIDFinder()
{
fKickTrackIter = NULL;
m_pKickTrackCat=NULL;
m_pHitTofCat=NULL;
m_pPIDCat=NULL;
m_Loc.set(0);
setFillPID();
setSortFlag(kTRUE);
}
HShowerTofPIDFinder::~HShowerTofPIDFinder(void) {
}
Bool_t HShowerTofPIDFinder::init() {
// create input and output categories and adds them to the event
// make iterators over input categories
printf("initialization of shower tofino pid finder\n");
HShowerDetector *pShowerDet = (HShowerDetector*)gHades->getSetup()
->getDetector("Shower");
// create and add HShowerHitTof input category
m_pHitTofCat=gHades->getCurrentEvent()->getCategory(catShowerHitTof);
if (!m_pHitTofCat) {
m_pHitTofCat=pShowerDet->buildCategory(catShowerHitTof);
if (!m_pHitTofCat) return kFALSE;
else gHades->getCurrentEvent()
->addCategory(catShowerHitTof,m_pHitTofCat , "Shower");
}
// create and add HKickTrack input category
m_pKickTrackCat=gHades->getCurrentEvent()->getCategory(catKickTrack);
if (!m_pKickTrackCat) {
Error("init","No kick plane input available");
if (!m_pKickTrackCat) return kFALSE;
else gHades->getCurrentEvent()
->addCategory(catKickTrack, m_pKickTrackCat, "KickTrack");
}
// create and add HShowerTofPID output category
m_pPIDCat=gHades->getCurrentEvent()->getCategory(catShowerTofPID);
if (!m_pPIDCat) {
m_pPIDCat= new HLinearCategory("HShowerTofPID",1000);
if (!m_pPIDCat) return kFALSE;
else gHades->getCurrentEvent()
->addCategory(catShowerTofPID, m_pPIDCat, "ShowerTofino");
}
// make iterator over HKickTrack input category
fKickTrackIter = (HIterator*)getKickTrackCat()->MakeIterator();
//init parameters
return initParameters();
}
Bool_t HShowerTofPIDFinder::initParameters() {
// init parameter containers
HRuntimeDb* rtdb=gHades->getRuntimeDb();
HShowerGeometry *pGeom = (HShowerGeometry*)rtdb->
getContainer("ShowerGeometry");
setGeometry(pGeom);
if (!pGeom) return kFALSE;
HShowerHitFPar *pHitFPar = (HShowerHitFPar*)rtdb->
getContainer("ShowerHitFinderParams");
setHitFPar(pHitFPar);
if (!pHitFPar) return kFALSE;
HTofinoCalPar *pTofinoCalPar =
(HTofinoCalPar*)rtdb->getContainer("TofinoCalPar");
setTofinoCalPar(pTofinoCalPar);
if(!pTofinoCalPar) return kFALSE;
return kTRUE;
}
Bool_t HShowerTofPIDFinder::finalize() {
return kTRUE;
}
HShowerTofPIDFinder& HShowerTofPIDFinder::operator=(HShowerTofPIDFinder &c) {
return c;
}
Int_t HShowerTofPIDFinder::execute()
{
// loop over HKickTrack objects and get HShowerHitTof objects,
// check shower and time of flight condition and fill HShowerTofPID
// data category
Int_t nIndex = -1,nMult[24],isLep[24][20],isInTimeWindow[24][20]; // up to 20 hits per paddle
Float_t fTof[24][20];
Float_t dist0; //min distance to the tofino padle
Float_t dist; //distance to the tofino padle
HKickTrack *pKickTrack = 0;
HShowerHitTof *pShower = 0 ;
HShowerTofPID *pid = 0;
HLocation loc;
loc.set(2,0,0);
for(Int_t i = 0; i < 24; i++) { // clear tables before next event
nMult[i] = 0;
for (Int_t j = 0; j < 20; j++) {
fTof[i][j] = 0;
isLep[i][j] = 0;
isInTimeWindow[i][j] = 0;
}
}
// iterate over HKickTrack objects
fKickTrackIter->Reset();
while((pKickTrack = (HKickTrack*)fKickTrackIter->Next()) != 0) {
if (pKickTrack) {
if(pKickTrack->getSystem() == 0) {
// get HShowerHitTof objects
if( (pShower =
(HShowerHitTof*)m_pHitTofCat->getObject(pKickTrack->getOuterHitId())) != 0) {
nIndex = 4*pShower->getSector()+pShower->getTofinoCell();
loc[0]=pShower->getSector();
loc[1]=pShower->getTofinoCell();
dist = 300*pKickTrack->getBeta()*pKickTrack->getTof(); // dist from target (300 to get it in mm)
dist0 = ((HTofinoCalPar*)m_pTofinoCalPar)->getMinLength(loc); // distance from target
if(pShower->getTofinoMult()>0) {
nMult[nIndex]++;
fTof[nIndex][nMult[nIndex]] = pShower->getTof()*dist0/dist;
// check shower and time of flight conditions
if(IsShower(pKickTrack)) isLep[nIndex][nMult[nIndex]] = 1;
else isLep[nIndex][nMult[nIndex]] = 0;
if(IsTofInWindow(fTof[nIndex][nMult[nIndex]])) isInTimeWindow[nIndex][nMult[nIndex]] = 1;
else isInTimeWindow[nIndex][nMult[nIndex]] = 0;
}
}
}
}
}
for(Int_t i = 0; i < 24; i++ ) {
for(Int_t j = 0; j < 20; j++) {
if(isInTimeWindow[i][j] ==0 ) continue;
if(nMult[i] > 0) {
if(isLep[i][j] ==1) isLep[i][j] = 1;
else isLep[i][j] = 0;
}
}
}
for(Int_t i = 0 ; i < 24;i++) nMult[i] = 0;
fKickTrackIter->Reset();
pKickTrack=NULL;
pid=NULL;
while((pKickTrack = (HKickTrack*)fKickTrackIter->Next()) != 0) {
if(pKickTrack->getSystem()==0) {
if((pShower=
(HShowerHitTof*)m_pHitTofCat->getObject(pKickTrack->getOuterHitId())) != 0) {
nIndex = 4*pShower->getSector()+pShower->getTofinoCell();
nMult[nIndex]++;
// create and fill HShowerTofPID data objects for lepton candidates
if(isLep[nIndex][nMult[nIndex]] && isInTimeWindow[nIndex][nMult[nIndex]]) {
if (m_pPIDCat) {
pid=(HShowerTofPID *)m_pPIDCat->getNewSlot(m_Loc);
if (pid) {
pid=new(pid) HShowerTofPID;
fillPID(pKickTrack, pid);
}
}
}
}
}
}
// sort HShowerTofPID category
if (IsSortFlagSet()) {
m_pPIDCat->sort();
}
return 0;
}
Bool_t HShowerTofPIDFinder::IsLepton(HKickTrack* pTrack) {
// in case shower and time of flight conditions are fulfilled
// return kTRUE, otherwise return kFALSE
#if DEBUG_LEVEL>2
gDebuger->enterFunc("HShowerTofPIDFinder::execute");
gDebuger->message("KickTrack cat points to %p",fKickTrack);
#endif
Bool_t isLep = kFALSE;
HShowerHitTof *pShower = 0;
if (pTrack) {
if(pTrack->getSystem() == 0) {
pShower =(HShowerHitTof*)m_pHitTofCat->getObject(pTrack->getOuterHitId());
if(pShower) {
if(IsShower(pTrack) && IsTofInWindow(pShower))
isLep = kTRUE;
}
}
}
return isLep;
}
Bool_t HShowerTofPIDFinder::IsShower(HKickTrack *pKick) {
// in case shower condition is fulfilled
// return kTRUE, otherwise return kFALSE
Bool_t isShower = kFALSE;
Float_t fact10 = 0.0, fact20 = 0.0;
Float_t lepThr10 = 0.0, lepThr20 = 0.0;
Float_t showScaleFact;
showScaleFact = ((HShowerHitFPar*)m_pHitFPar)->getScaleFactor();
// if(pShower->getSum(1)) fact10 = pShower->getSum(0)/pShower->getSum(1);
// if(pShower->getSum(2)) fact20 = pShower->getSum(0)/pShower->getSum(2);
fact10 = pKick->getShowerSum10(1.);
fact20 = pKick->getShowerSum20(2.);
lepThr10 =
getShowFactor(((HShowerHitFPar*)m_pHitFPar)->getFirstFitParam(),pKick->getP(),showScaleFact);
lepThr20 =
getShowFactor(((HShowerHitFPar*)m_pHitFPar)->getSecondFitParam(),pKick->getP(),showScaleFact);
//cout << "lepThr10 " << lepThr10 <<"lepThr20 " << lepThr20 << endl;
if(lepThr10<=0 && lepThr20<=0) return isShower;
if(fact10>=lepThr10 || fact20>=lepThr20) isShower = kTRUE;
return isShower;
}
Float_t HShowerTofPIDFinder::getShowFactor(Float_t *pPar,Float_t mom,Float_t fParam) {
Float_t fFactor = -1;
fFactor = calcFromFit(pPar,mom);
return fFactor*fParam;
}
Float_t HShowerTofPIDFinder::calcFromFit(Float_t *pPar, Float_t fMom)
{
return (pPar[0]+pPar[1]*fMom+pPar[2]*fMom*fMom+pPar[3]*fMom*fMom*fMom);
}
Bool_t HShowerTofPIDFinder::IsTofInWindow(HShowerHitTof *pShower) {
// in case time of fligth condition is fulfilled
// return kTRUE, otherwise return kFALSE
Bool_t isTime = kFALSE;
Float_t minTime ,maxTime ;
minTime = ((HShowerHitFPar*)m_pHitFPar)->getMinTof();
maxTime =((HShowerHitFPar*)m_pHitFPar)->getMaxTof();
if(pShower->getTof() > minTime && pShower->getTof()<maxTime ) isTime = kTRUE;
return isTime;
}
Bool_t HShowerTofPIDFinder::IsTofInWindow(Float_t time) {
Bool_t isTime = kFALSE;
Float_t minTime,maxTime ;
minTime = ((HShowerHitFPar*)m_pHitFPar)->getMinTof();
maxTime =((HShowerHitFPar*)m_pHitFPar)->getMaxTof();
//cout << " minTime "<< minTime << " maxTime " << maxTime << endl;
if(time > minTime && time<maxTime ) isTime = kTRUE;
return isTime;
}
void HShowerTofPIDFinder::fillPID(HKickTrack *pKick , HShowerTofPID* pid) {
// fill HShowerTofPID category
HShowerHitTof *hit = 0 ;
Float_t fR, fPhi, fTheta;
Float_t d0 ;
Float_t d;
HLocation loc;
loc.set(2,0,0);
if( (hit=(HShowerHitTof*)m_pHitTofCat->getObject(pKick->getOuterHitId())) !=0) {
loc[0]=hit->getSector();
loc[1]=hit->getTofinoCell();
d = 300*pKick->getBeta()*pKick->getTof(); // dist from target (300 to get it in mm)
d0 = ((HTofinoCalPar*)m_pTofinoCalPar)->getMinLength(loc); // min distance from target
pid->setSector(hit->getSector());
pid->setModule(hit->getModule());
pid->setRow(hit->getRow());
pid->setCol(hit->getCol());
pid->setAddress(hit->getAddress());
hit->getSphereCoord(&fR, &fPhi, &fTheta);
pid->setRadius(fR);
pid->setPhi(fPhi);
pid->setTheta(fTheta);
pid->setTof(hit->getTof());
//pid->setTof(hit->getTof()*d0/d);
//pid->setFact10(hit->getSum(1)/hit->getSum(0));
//pid->setFact20(hit->getSum(2)/hit->getSum(0));
pid->setFact10( pKick->getShowerSum10(1.));
pid->setFact20( pKick->getShowerSum20(2.));
pid->setTofinoCell(hit->getTofinoCell());
pid->setTofinoMult(hit->getTofinoMult());
pid->setOuterHitId(m_pHitTofCat->getIndex(hit));
pid->setTrackLength(d);
}
}
| [
"waleed.physics@gmail.com"
] | waleed.physics@gmail.com |
2587bd0233e2d617cdaab8ef37d658e3140635a9 | d2e549a72ae4b7c351183ebd10f4dc3db6459537 | /linux/my_application.cc | ceea3d3accbd89380411b589f9ac7a88e76e7723 | [
"MIT"
] | permissive | bigV4/termare_ssh | 97254525d36a9406f5ae659db6cec69257be529d | d7030e5524282bf907cca7f533380ec69a4db4f2 | refs/heads/main | 2023-06-25T14:16:06.424289 | 2021-08-01T03:41:30 | 2021-08-01T03:41:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,654 | cc | #include "my_application.h"
#include <flutter_linux/flutter_linux.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#include "flutter/generated_plugin_registrant.h"
struct _MyApplication {
GtkApplication parent_instance;
char** dart_entrypoint_arguments;
};
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
// Implements GApplication::activate.
static void my_application_activate(GApplication* application) {
MyApplication* self = MY_APPLICATION(application);
GtkWindow* window =
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
// Use a header bar when running in GNOME as this is the common style used
// by applications and is the setup most users will be using (e.g. Ubuntu
// desktop).
// If running on X and not using GNOME then just use a traditional title bar
// in case the window manager does more exotic layout, e.g. tiling.
// If running on Wayland assume the header bar will work (may need changing
// if future cases occur).
gboolean use_header_bar = TRUE;
#ifdef GDK_WINDOWING_X11
GdkScreen *screen = gtk_window_get_screen(window);
if (GDK_IS_X11_SCREEN(screen)) {
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
use_header_bar = FALSE;
}
}
#endif
if (use_header_bar) {
GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar));
gtk_header_bar_set_title(header_bar, "termare_ssh");
gtk_header_bar_set_show_close_button(header_bar, TRUE);
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
}
else {
gtk_window_set_title(window, "termare_ssh");
}
gtk_window_set_default_size(window, 1280, 720);
gtk_widget_show(GTK_WIDGET(window));
g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
FlView* view = fl_view_new(project);
gtk_widget_show(GTK_WIDGET(view));
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
gtk_widget_grab_focus(GTK_WIDGET(view));
}
// Implements GApplication::local_command_line.
static gboolean my_application_local_command_line(GApplication* application, gchar ***arguments, int *exit_status) {
MyApplication* self = MY_APPLICATION(application);
// Strip out the first argument as it is the binary name.
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
g_autoptr(GError) error = nullptr;
if (!g_application_register(application, nullptr, &error)) {
g_warning("Failed to register: %s", error->message);
*exit_status = 1;
return TRUE;
}
g_application_activate(application);
*exit_status = 0;
return TRUE;
}
// Implements GObject::dispose.
static void my_application_dispose(GObject *object) {
MyApplication* self = MY_APPLICATION(object);
g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
}
static void my_application_class_init(MyApplicationClass* klass) {
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
}
static void my_application_init(MyApplication* self) {}
MyApplication* my_application_new() {
return MY_APPLICATION(g_object_new(my_application_get_type(),
"application-id", APPLICATION_ID,
nullptr));
}
| [
"906262255@qq.com"
] | 906262255@qq.com |
f3fc13c52d6b910efe03b3823dbe889b0ab972d3 | 4117c318b7e0cd551a17e6187e675ff3ac2fdcbe | /Clase 2/Ejemplos de clase/firstFor.cpp | 20a0a322f70ab50b5e4604bdd08406281006c014 | [] | no_license | agustinbc/ICOMDS-ME | 2de06bfc67e2ab36cb2b0077362abcd522733564 | 9a05988a31f1a94cc1b47a8e5d1e9fddff1a53a3 | refs/heads/master | 2022-11-13T09:28:27.446190 | 2020-07-08T17:49:59 | 2020-07-08T17:49:59 | 272,009,501 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 316 | cpp | #include <iostream>
using namespace std;
int main() {
int a;
cout<<"Ingrese un numero positivo, menor a 128." <<endl;
cin>>a;
for(int i=0; i<a; i++){
/* i++ es equivalente a decir i = i + 1 que es equivalente a i += 1*/
cout<<"Contando numeros: "<<i+1<<endl;
}
return 0;
} | [
"agustin.bernardo.sfe@gmail.com"
] | agustin.bernardo.sfe@gmail.com |
79211dc283fd59815597b0aab636006287370eee | 26e688fa40ccfd40a363c70afd3d972d55128a15 | /ShoppingSystem/ShoppingSystem/DAL/Ado.h | 4af31e50a66b7b9416294ed0b53bf4ed024df1ef | [] | no_license | presscad/OOP-Exercise | 963be0aa9e853cad0c8ee88f05dcd3084a4dc9a9 | 70676e1b9cba2a950f9f72b4804411441b28d4bc | refs/heads/master | 2021-06-23T18:28:43.052059 | 2017-06-03T14:35:44 | 2017-06-03T14:35:44 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 5,261 | h | /*########################################################################
【文件名】: ado.h
【名 称】: ADO 封装类.
【版 本】: 0.20
【作 者】: 成真
【E-mail】: anyou@sina.com
---------------------------------------------------------
【创建时间】: 20/1/2003 19:08
【修改时间】: 09/4/2003
---------------------------------------------------------
【版本历史】:
[0.20] : 封装了 CAdoCommand 类.
[-15/4/2003-]
[0.11] : 修正了一些 bug.
删除 oleinit() 函数, 因为觉得不妥。
增加了记录集存取函数.
[-09/4/2003-]
[0.10] : 主要包括 CAdoConnection 和 CAdoRecordSet 两个类, 封装了
对ado的常用的操作方法.
[-20/1/2003-]
---------------------------------------------------------
【使用说明】:
1. 必须在下面指明 msado15.dll 的全路径, 一般在 "C:\Program Files\
Common Files\System\ADO\" 目录下.
2. 在使用本类之前必须要初始化 COM 环境, 可以调用 CoInitialize(NULL)
来初始化, 用 CoUninitialize() 释放;
3. 在使用记录集对象前必须先调用 CAdoConnection::Open() 连接数据库,
连接后可给多个 CAdoRecordSet 对象使用, 用完后须关闭数据库.
4. 使用记录集执行SQL语句之前, 要使用构建方法或调用 SetAdoConnection()
关联到连接对象.
5. 在编译过程中不用理会下面的编译警告:
warning: unary minus operator applied to unsigned type, result
still unsigned
如果不想此警告出现,可以在 StdAfx.h 文件中加入这样一行代码以禁止
此警告: #pragma warning(disable:4146)
########################################################################*/
#if !defined(_ANYOU_COOL_ADO_H)
#define _ANYOU_COOL_ADO_H
#if _MSC_VER > 1000
#pragma once
#endif
// 导入 ado 库 -----------------------------------------------------------
#pragma warning(disable:4146)
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" named_guids rename("EOF","adoEOF"), rename("BOF","adoBOF")
#pragma warning(default:4146)
using namespace ADODB;
#include <icrsint.h>
class CAdoConnection;
#include "AdoRecordSet.h"
#include "AdoCommand.h"
// 数值类型转换 -----------------------------------
COleDateTime vartodate(const _variant_t& var);
COleCurrency vartocy(const _variant_t& var);
bool vartobool(const _variant_t& var);
BYTE vartoby(const _variant_t& var);
short vartoi(const _variant_t& var);
long vartol(const _variant_t& var);
double vartof(const _variant_t& var);
CString vartostr(const _variant_t& var);
/*########################################################################
------------------------------------------------
CAdoConnection class
------------------------------------------------
########################################################################*/
class CAdoConnection
{
// 构建/析构 ------------------------------------------
public:
CAdoConnection();
virtual ~CAdoConnection();
protected:
void Release();
// 属性 -----------------------------------------------
public:
// 连接对象 ----------------------------------
_ConnectionPtr& GetConnection() {return m_pConnection;};
// 异常信息 ----------------------------------
CString GetLastErrorText();
ErrorsPtr GetErrors();
ErrorPtr GetError(long index);
// 连接字串 ----------------------------------
CString GetConnectionText() {return m_strConnect;}
// 连接信息 ----------------------------------
CString GetProviderName();
CString GetVersion();
CString GetDefaultDatabase();
// 连接状态 ----------------------------------
BOOL IsOpen();
long GetState();
// 连接模式 ----------------------------------
ConnectModeEnum GetMode();
BOOL SetMode(ConnectModeEnum mode);
// 连接时间 ----------------------------------
long GetConnectTimeOut();
BOOL SetConnectTimeOut(long lTime = 5);
// 数据源信息 -------------------------------
_RecordsetPtr OpenSchema(SchemaEnum QueryType);
// 操作 -----------------------------------------------
public:
// 数据库连接 --------------------------------
BOOL Open(LPCTSTR lpszConnect =_T(""), long lOptions = adConnectUnspecified);
BOOL ConnectSQLServer(CString dbsrc, CString dbname, CString user, CString pass, long lOptions = adConnectUnspecified);
BOOL ConnectAccess(CString dbpath, CString pass = _T(""), long lOptions = adConnectUnspecified);
BOOL OpenUDLFile(LPCTSTR strFileName, long lOptions = adConnectUnspecified);
void Close();
// 处理 -----------------------------------------------
public:
// 事务处理 ----------------------------------
long BeginTrans();
BOOL RollbackTrans();
BOOL CommitTrans();
// 执行 SQL 语句 ------------------------------
_RecordsetPtr Execute(LPCTSTR strSQL, long *lRecordsAffected, long lOptions = adCmdText);
//BOOL CAdoConnection::Execute(LPCTSTR lpszSQL, _RecordsetPtr& RecordSet, long *lRecordsAffected, long lOptions = adCmdText);
BOOL Cancel();
// 数据 -----------------------------------------------
protected:
CString m_strConnect;
_ConnectionPtr m_pConnection;
};
#endif // !defined(_ANYOU_COOL_ADO_H)
| [
"zhouxiaochun_000@163.com"
] | zhouxiaochun_000@163.com |
b7e22f8ca0b9f3e4930d8e93b670a2f87f6422af | ee24ef7aaa7d4ab6a66c56e95953414306302df3 | /Cpp/SDK/Menu_MainMenu_Lobby_classes.h | aeeb69c754f4ed57d19be40830d427a1cf2a755f | [] | no_license | zH4x-SDK/zAWL-SDK | bfc0573125d3398d892c85eac05a6575592db187 | 3d7001585dab120480e0d16fc24396f61a1d46c6 | refs/heads/main | 2023-07-15T11:05:51.834741 | 2021-08-31T15:10:19 | 2021-08-31T15:10:19 | 401,745,502 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,703 | h | #pragma once
// Name: AWL, Version: 4.24.3
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Classes
//---------------------------------------------------------------------------
// WidgetBlueprintGeneratedClass Menu_MainMenu_Lobby.Menu_MainMenu_Lobby_C
// 0x0000
class UMenu_MainMenu_Lobby_C : public UMenu_InGame_Panel_ROOT_C
{
public:
static UClass* StaticClass()
{
static UClass* ptr = UObject::FindClass("WidgetBlueprintGeneratedClass Menu_MainMenu_Lobby.Menu_MainMenu_Lobby_C");
return ptr;
}
void SaveInventoryCost();
void AddStringToVerticcalBox();
void GetPlayerStringByUniq();
void GetFriendByUniq();
void GetPlayerByUniq();
void GetPlayerState();
void UpdateFriends();
void OnFailure_0F934F7F4EE87502C488BD8D3349A95E();
void OnSuccess_0F934F7F4EE87502C488BD8D3349A95E();
void OnFailure_6C771462491759E53D667AAA8F29280B();
void OnSuccess_6C771462491759E53D667AAA8F29280B();
void Construct();
void Destruct();
void UpdateLobbyInfo();
void ShowConfirm();
void BndEvt__LobbyConfirm_K2Node_ComponentBoundEvent_2_Yes__DelegateSignature();
void BndEvt__LobbyConfirm_K2Node_ComponentBoundEvent_3_No__DelegateSignature();
void SetInLobby();
void SearchAgain();
void UpdateFriendsArray();
void BndEvt__CloseLobby_K2Node_ComponentBoundEvent_232_OnButtonClickedEvent__DelegateSignature();
void BndEvt__BUTTON_Play_K2Node_ComponentBoundEvent_1_OnButtonClickedEvent__DelegateSignature();
void CancelInviteIfLeader();
void ExecuteUbergraph_Menu_MainMenu_Lobby();
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"zp2kshield@gmail.com"
] | zp2kshield@gmail.com |
c7421d5eca2e87f0735f81d296d2f93c65fbc0ec | 6dc16c030b82a731e21057dc613cc44a780b5422 | /src/qt/bitcoinunits.cpp | 93522beed5c05617843b19f6dc72c9dd3ce02218 | [
"MIT"
] | permissive | jajorda2/cryptobugcoin-2 | e664c88e9a7bb6314d36213332d7abf173d9d09f | 7ac548e30a4eaa4e9c8c03cd52c4c27e00da7ec9 | refs/heads/master | 2021-05-12T07:45:30.279628 | 2018-01-12T19:22:20 | 2018-01-12T19:22:20 | 117,256,561 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,299 | cpp | #include "bitcoinunits.h"
#include <QStringList>
BitcoinUnits::BitcoinUnits(QObject *parent):
QAbstractListModel(parent),
unitlist(availableUnits())
{
}
QList<BitcoinUnits::Unit> BitcoinUnits::availableUnits()
{
QList<BitcoinUnits::Unit> unitlist;
unitlist.append(BTC);
unitlist.append(mBTC);
unitlist.append(uBTC);
return unitlist;
}
bool BitcoinUnits::valid(int unit)
{
switch(unit)
{
case BTC:
case mBTC:
case uBTC:
return true;
default:
return false;
}
}
QString BitcoinUnits::name(int unit)
{
switch(unit)
{
case BTC: return QString("cbg");
case mBTC: return QString("mcbg");
case uBTC: return QString::fromUtf8("μcbg");
default: return QString("???");
}
}
QString BitcoinUnits::description(int unit)
{
switch(unit)
{
case BTC: return QString("CryptoBugCoins");
case mBTC: return QString("Milli-CryptoBugCoins (1 / 1,000)");
case uBTC: return QString("Micro-CryptoBugCoins (1 / 1,000,000)");
default: return QString("???");
}
}
qint64 BitcoinUnits::factor(int unit)
{
switch(unit)
{
case BTC: return 100000000;
case mBTC: return 100000;
case uBTC: return 100;
default: return 100000000;
}
}
int BitcoinUnits::amountDigits(int unit)
{
switch(unit)
{
case BTC: return 8; // 21,000,000 (# digits, without commas)
case mBTC: return 11; // 21,000,000,000
case uBTC: return 14; // 21,000,000,000,000
default: return 0;
}
}
int BitcoinUnits::decimals(int unit)
{
switch(unit)
{
case BTC: return 8;
case mBTC: return 5;
case uBTC: return 2;
default: return 0;
}
}
QString BitcoinUnits::format(int unit, qint64 n, bool fPlus)
{
// Note: not using straight sprintf here because we do NOT want
// localized number formatting.
if(!valid(unit))
return QString(); // Refuse to format invalid unit
qint64 coin = factor(unit);
int num_decimals = decimals(unit);
qint64 n_abs = (n > 0 ? n : -n);
qint64 quotient = n_abs / coin;
qint64 remainder = n_abs % coin;
QString quotient_str = QString::number(quotient);
QString remainder_str = QString::number(remainder).rightJustified(num_decimals, '0');
// Right-trim excess zeros after the decimal point
int nTrim = 0;
for (int i = remainder_str.size()-1; i>=2 && (remainder_str.at(i) == '0'); --i)
++nTrim;
remainder_str.chop(nTrim);
if (n < 0)
quotient_str.insert(0, '-');
else if (fPlus && n > 0)
quotient_str.insert(0, '+');
return quotient_str + QString(".") + remainder_str;
}
QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign)
{
return format(unit, amount, plussign) + QString(" ") + name(unit);
}
bool BitcoinUnits::parse(int unit, const QString &value, qint64 *val_out)
{
if(!valid(unit) || value.isEmpty())
return false; // Refuse to parse invalid unit or empty string
int num_decimals = decimals(unit);
QStringList parts = value.split(".");
if(parts.size() > 2)
{
return false; // More than one dot
}
QString whole = parts[0];
QString decimals;
if(parts.size() > 1)
{
decimals = parts[1];
}
if(decimals.size() > num_decimals)
{
return false; // Exceeds max precision
}
bool ok = false;
QString str = whole + decimals.leftJustified(num_decimals, '0');
if(str.size() > 18)
{
return false; // Longer numbers will exceed 63 bits
}
qint64 retvalue = str.toLongLong(&ok);
if(val_out)
{
*val_out = retvalue;
}
return ok;
}
int BitcoinUnits::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return unitlist.size();
}
QVariant BitcoinUnits::data(const QModelIndex &index, int role) const
{
int row = index.row();
if(row >= 0 && row < unitlist.size())
{
Unit unit = unitlist.at(row);
switch(role)
{
case Qt::EditRole:
case Qt::DisplayRole:
return QVariant(name(unit));
case Qt::ToolTipRole:
return QVariant(description(unit));
case UnitRole:
return QVariant(static_cast<int>(unit));
}
}
return QVariant();
}
| [
"jajorda2@me.com"
] | jajorda2@me.com |
a506db3ffbf1bf15ffa9d6583b8457327da80d44 | 855ca9e93e9bf15fde74fe66c1991920605011e4 | /resource/Paragraph.hpp | e4706c0a30b4fb2331cdda84e6fdda6807b28fc8 | [
"SGI-B-1.1",
"BSD-2-Clause"
] | permissive | szk/reprize | 0526959a4affa87ec926c31b7f71c3f925c9a470 | a827aa0247f7954f9f36ae573f97db1397645bf5 | refs/heads/master | 2016-09-06T01:53:33.862334 | 2016-01-28T15:09:33 | 2016-01-28T15:09:33 | 11,900,571 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,454 | hpp | #ifndef PARAGRAPH_HPP_
#define PARAGRAPH_HPP_
namespace reprize
{
namespace res
{
class Paragraph : public Node
{
public:
Paragraph(const Str name_, Size32 max_ln_ = 512)
: Node(name_), max_ln(max_ln_), updated_ln(0), idx_gap(0), overall_ln(0)
{
for (Size32 i = 0; max_ln_ > i; ++i) { history.push_back(""); }
}
virtual ~Paragraph(void) {}
Size32 printf(const Char* msg_, ...)
{
va_list ap;
Char buffer[MAX_CONSOLE_CHAR];
va_start(ap, msg_);
vsnprintf(buffer, MAX_CONSOLE_CHAR, msg_, ap);
va_end(ap);
#ifdef WIN32
OutputDebugStringA((LPCSTR)buffer);
OutputDebugStringA("\r\n");
#else
std::cerr << buffer << std::endl;
#endif
if (buffer == NULL) { return 1; }
if (++idx_gap >= max_ln) { idx_gap = 0; }
history[idx_gap].assign(buffer);
// Overflow XXX
++updated_ln;
++overall_ln;
return 0;
}
Size32 get_overall_ln_n(void) { return overall_ln; }
const Str& get_line(Size32 n_) { return history.at(n_); }
const Str& tail(Size32 history_idx_)
{ return history[(idx_gap - history_idx_) % max_ln]; }
void refresh(void) { updated_ln = 0; }
protected:
std::vector<Str> history;
const Size32 max_ln;
Size32 updated_ln, idx_gap, overall_ln;
std::ofstream of;
};
}
}
#endif
| [
"s@vram.org"
] | s@vram.org |
e5c58c5ad6822ba455937f8a85512db6aa8f9f0d | 948f4e13af6b3014582909cc6d762606f2a43365 | /testcases/juliet_test_suite/testcases/CWE762_Mismatched_Memory_Management_Routines/s01/CWE762_Mismatched_Memory_Management_Routines__delete_array_class_calloc_10.cpp | 6efeb6acd2d2a7c3b4f25d452b5f4900fdaca63b | [] | no_license | junxzm1990/ASAN-- | 0056a341b8537142e10373c8417f27d7825ad89b | ca96e46422407a55bed4aa551a6ad28ec1eeef4e | refs/heads/master | 2022-08-02T15:38:56.286555 | 2022-06-16T22:19:54 | 2022-06-16T22:19:54 | 408,238,453 | 74 | 13 | null | 2022-06-16T22:19:55 | 2021-09-19T21:14:59 | null | UTF-8 | C++ | false | false | 4,678 | cpp | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__delete_array_class_calloc_10.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete_array.label.xml
Template File: sources-sinks-10.tmpl.cpp
*/
/*
* @description
* CWE: 762 Mismatched Memory Management Routines
* BadSource: calloc Allocate data using calloc()
* GoodSource: Allocate data using new []
* Sinks:
* GoodSink: Deallocate data using free()
* BadSink : Deallocate data using delete []
* Flow Variant: 10 Control flow: if(globalTrue) and if(globalFalse)
*
* */
#include "std_testcase.h"
namespace CWE762_Mismatched_Memory_Management_Routines__delete_array_class_calloc_10
{
#ifndef OMITBAD
void bad()
{
TwoIntsClass * data;
/* Initialize data*/
data = NULL;
if(globalTrue)
{
/* POTENTIAL FLAW: Allocate memory with a function that requires free() to free the memory */
data = (TwoIntsClass *)calloc(100, sizeof(TwoIntsClass));
}
if(globalTrue)
{
/* POTENTIAL FLAW: Deallocate memory using delete [] - the source memory allocation function may
* require a call to free() to deallocate the memory */
delete [] data;
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodB2G1() - use badsource and goodsink by changing the second globalTrue to globalFalse */
static void goodB2G1()
{
TwoIntsClass * data;
/* Initialize data*/
data = NULL;
if(globalTrue)
{
/* POTENTIAL FLAW: Allocate memory with a function that requires free() to free the memory */
data = (TwoIntsClass *)calloc(100, sizeof(TwoIntsClass));
}
if(globalFalse)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* FIX: Free memory using free() */
free(data);
}
}
/* goodB2G2() - use badsource and goodsink by reversing the blocks in the second if */
static void goodB2G2()
{
TwoIntsClass * data;
/* Initialize data*/
data = NULL;
if(globalTrue)
{
/* POTENTIAL FLAW: Allocate memory with a function that requires free() to free the memory */
data = (TwoIntsClass *)calloc(100, sizeof(TwoIntsClass));
}
if(globalTrue)
{
/* FIX: Free memory using free() */
free(data);
}
}
/* goodG2B1() - use goodsource and badsink by changing the first globalTrue to globalFalse */
static void goodG2B1()
{
TwoIntsClass * data;
/* Initialize data*/
data = NULL;
if(globalFalse)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* FIX: Allocate memory using new [] */
data = new TwoIntsClass[100];
}
if(globalTrue)
{
/* POTENTIAL FLAW: Deallocate memory using delete [] - the source memory allocation function may
* require a call to free() to deallocate the memory */
delete [] data;
}
}
/* goodG2B2() - use goodsource and badsink by reversing the blocks in the first if */
static void goodG2B2()
{
TwoIntsClass * data;
/* Initialize data*/
data = NULL;
if(globalTrue)
{
/* FIX: Allocate memory using new [] */
data = new TwoIntsClass[100];
}
if(globalTrue)
{
/* POTENTIAL FLAW: Deallocate memory using delete [] - the source memory allocation function may
* require a call to free() to deallocate the memory */
delete [] data;
}
}
void good()
{
goodB2G1();
goodB2G2();
goodG2B1();
goodG2B2();
}
#endif /* OMITGOOD */
} /* close namespace */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
using namespace CWE762_Mismatched_Memory_Management_Routines__delete_array_class_calloc_10; /* so that we can use good and bad easily */
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| [
"yzhang0701@gmail.com"
] | yzhang0701@gmail.com |
6dafe43874d9d5556c3004a0f52e4a84e7c8c91e | 9354c19849e72bba1c49c30948803fd6f2b54002 | /include/mapnik/plugin.hpp | f2b4ebd58e5de015cec93e016f4079f44d0a70ad | [] | no_license | Whirlwind/mapnik-ios-framework | f3cdb34176421f08e2d406b93d2c45f2237479ce | c85998fd2fdb91cadadfdeec2cd431da9dacfe7e | refs/heads/master | 2021-01-17T07:29:50.477130 | 2013-10-23T06:32:21 | 2013-10-23T06:32:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,438 | hpp | /*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2011 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
#ifndef MAPNIK_PLUGIN_HPP
#define MAPNIK_PLUGIN_HPP
// boost
#include <boost/utility.hpp>
// stl
#include <string>
// ltdl
//#include <ltdl.h>
namespace mapnik
{
class PluginInfo : boost::noncopyable
{
private:
std::string name_;
//lt_dlhandle module_;
public:
PluginInfo (const std::string& name);
~PluginInfo();
const std::string& name() const;
//lt_dlhandle handle() const;
};
}
#endif // MAPNIK_PLUGIN_HPP
| [
"whirlwindjames@foxmail.com"
] | whirlwindjames@foxmail.com |
a94afd07ca2a18e0530e388d7f05fb5f772502fe | 600df3590cce1fe49b9a96e9ca5b5242884a2a70 | /chrome/browser/search/instant_io_context.cc | 6c2c43a56897790a9dcb573c9867a975fb770d00 | [
"BSD-3-Clause"
] | permissive | metux/chromium-suckless | efd087ba4f4070a6caac5bfbfb0f7a4e2f3c438a | 72a05af97787001756bae2511b7985e61498c965 | refs/heads/orig | 2022-12-04T23:53:58.681218 | 2017-04-30T10:59:06 | 2017-04-30T23:35:58 | 89,884,931 | 5 | 3 | BSD-3-Clause | 2022-11-23T20:52:53 | 2017-05-01T00:09:08 | null | UTF-8 | C++ | false | false | 3,262 | cc | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/search/instant_io_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/resource_request_info.h"
#include "net/url_request/url_request.h"
#include "url/gurl.h"
using content::BrowserThread;
namespace {
// Retrieves the Instant data from the |context|'s named user-data.
InstantIOContext* GetDataForResourceContext(
content::ResourceContext* context) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
return base::UserDataAdapter<InstantIOContext>::Get(
context, InstantIOContext::kInstantIOContextKeyName);
}
InstantIOContext* GetDataForRequest(const net::URLRequest* request) {
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);
if (!info)
return NULL;
return GetDataForResourceContext(info->GetContext());
}
} // namespace
const char InstantIOContext::kInstantIOContextKeyName[] = "instant_io_context";
InstantIOContext::InstantIOContext() {
// The InstantIOContext is created on the UI thread but is accessed
// on the IO thread.
DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
InstantIOContext::~InstantIOContext() {
}
// static
void InstantIOContext::SetUserDataOnIO(
content::ResourceContext* resource_context,
scoped_refptr<InstantIOContext> instant_io_context) {
resource_context->SetUserData(
InstantIOContext::kInstantIOContextKeyName,
new base::UserDataAdapter<InstantIOContext>(instant_io_context.get()));
}
// static
void InstantIOContext::AddInstantProcessOnIO(
scoped_refptr<InstantIOContext> instant_io_context,
int process_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
instant_io_context->process_ids_.insert(process_id);
}
// static
void InstantIOContext::RemoveInstantProcessOnIO(
scoped_refptr<InstantIOContext> instant_io_context, int process_id) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
instant_io_context->process_ids_.erase(process_id);
}
// static
void InstantIOContext::ClearInstantProcessesOnIO(
scoped_refptr<InstantIOContext> instant_io_context) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
instant_io_context->process_ids_.clear();
}
// static
bool InstantIOContext::ShouldServiceRequest(const net::URLRequest* request) {
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);
if (!info)
return false;
InstantIOContext* instant_io_context = GetDataForRequest(request);
if (!instant_io_context)
return false;
int process_id = -1;
int render_frame_id = -1;
info->GetAssociatedRenderFrame(&process_id, &render_frame_id);
// For PlzNavigate, the process_id for the navigation request will be -1. If
// so, allow this request since it's not going to another renderer.
if (process_id == -1 || instant_io_context->IsInstantProcess(process_id))
return true;
return false;
}
bool InstantIOContext::IsInstantProcess(int process_id) const {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
return process_ids_.find(process_id) != process_ids_.end();
}
| [
"enrico.weigelt@gr13.net"
] | enrico.weigelt@gr13.net |
b4ebbb11683c1bb2e1171028faca790b7e54ec34 | 17708ae24a167e0a9a8f338a8fa0b5d7096739d7 | /binarytree/源.cpp | 04b905462c3b37b2928fe6e2b7f475efc4202484 | [] | no_license | bobo607/BinaryTree | 169df57ae41cc256ba833e20d1654fdb3126e2d9 | 3956cf5628801b4bbade29b845270ed8f54f1ead | refs/heads/master | 2020-07-22T22:44:19.176244 | 2016-09-09T15:15:54 | 2016-09-09T15:15:54 | 67,809,470 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,856 | cpp | #include <iostream>
using namespace std;
#include <stack>
#include <assert.h>
#include <queue>
template <class T>
struct Binarytreenode
{
struct Binarytreenode(T _data)
:data(_data)
,PRight(NULL)
,PLeft(NULL)
{}
T data;
Binarytreenode<T>* PLeft;
Binarytreenode<T>* PRight;
};
template<class T>
class Binarytree
{
public:
Binarytree()
:PRoot(NULL)
{}
Binarytree(Binarytreenode<T>*& PRoot, size_t size, size_t& iIdx, const T arr[])
{
PRoot = createBinarytree(PRoot, size,iIdx, arr);
}
Binarytreenode<T>* createBinarytree(Binarytreenode<T>*& PRoot, size_t size, size_t& iIdx, const T arr[])
{
if (PRoot == NULL)
assert(false);
Binarytreenode<T>* a = PRoot;
if (iIdx < size&& arr[iIdx] != '#')
{
a = new Binarytreenode<T>(arr[iIdx]);
a->PLeft = createBinarytree(a, size, ++iIdx, arr);
a->PRight = createBinarytree(a, size, ++iIdx, arr);
}
else
{
a = NULL;
}
return a;
}
Binarytree(const Binarytreenode<T>*& a) //拷贝构造
{
_pRoot = CopyBinaryTree(b._pRoot);
}
/*BinaryTreeNode<T>* CopyBinaryTree(BinaryTreeNode<T>* pNode)
{
BinaryTreeNode<T>* pNewNode = NULL;
if (pNode == NULL)
{
return NULL;
}
pNewNode = new BinaryTreeNode<T>(pNode->_data);
pNewNode->pLeft = CopyBinaryTree(pNode->pLeft);
pNewNode->pRight = CopyBinaryTree(pNode->pRight);
return pNewNode;
}*/
/*BinaryTree<T>& operator=(BinaryTree*<T> b)
{
swap(_pRoot, b._pRoot);
return *this;
}
*/
Binarytreenode<T>& operator=(const Binarytreenode<T>& a)
{
data(a.data);
PRight(a.PLeft);
PLeft(a.PRight);
return *this;
}
~Binarytree()
{
void destroy(Binarytree<T>& PRoot);
PRoot = NULL;
}
void destroy(Binarytree<T>& PRoot)
{
if (PRoot != NULL)
destroy(PRoot)
destroy()
delete(PRoot);
}
/*void inorder(Binarytreenode<T>* a)const
{
stack<Binarytreenode<T>> s;
Binarytreenode<T>* Pcur = a;
if (Pcur != NULL)
{
s.push(Pcur);
Binarytreenode<T>* Pcur = Pcur->PLeft;
while (Pcur != NULL)
{
s.push(Pcur);
Pcur = Pcur->PLeft;
}
while (!s.empty)
{
Binarytreenode<T>* ret = s.top;
cout << ret->data << " ";
s.pop;
if (ret->PRight != NULL)
{
while (ret->PRight)
{
ret = ret->PRight
s.push(ret);
}
cout << ret->PRight->data << " ";
}
}
}
}
*/
void inorder(Binarytreenode<T>* PRoot)const //中序遍历
{
stack<Binarytreenode<T>*> s;
Binarytreenode<T>* Pcur = PRoot;
while (Pcur || !s.empty)
{
if (Pcur!=NULL)
{
s.push(Pcur);
Pcur = Pcur->PLeft;
}
else
{
Pcur = s.top;
cout << Pcur->data << " ";
s.pop;
Pcur = Pcur->PRight;
}
}
}
void frontorder(Binarytreenode<T>* PRoot)const //先序遍历
{
stack<Binarytreenode<T>> s;
Binarytreenode<T>* Pcur = PRoot;
while (!s.empty || Pcur)
{
if (Pcur != NULL)
{
s.push(Pcur);
cout << Pcur->data << " ";
Pcur = Pcur->PLeft;
}
else
{
Pcur = s.top;
s.pop();
Pcur = Pcur->PRight;
}
}
}
void backorder(Binarytreenode<T>* PRoot)const //后序遍历
{
stack<Binarytreenode<T>> s;
Binarytreenode<T>* Pcur = PRoot;
}
void levelorder(Binarytreenode<T>* PRoot)const //层序遍历
{
queue <Binarytreenode<T>> q;
Binarytreenode<T>* Pcur = PRoot;
if (PRoot != NULL)
{
q.push(Pcur);
while(!q.empty())
{
if (Pcur->PLeft != NULL)
{
q.push(Pcur->PLeft);
}
if (Pcur->PRight != NULL)
{
q.push(Pcur->PRight);
}
cout<< Pcur<< " ";
q.pop();
Pcur = q.front();
}
}
}
private:
Binarytreenode<T>* PRoot;
};
int main()
{
char arr[] = {'1','2','#','#','3'};
size_t size = sizeof(arr) / sizeof(arr[0]);
size_t iIdx = 0;
Binarytreenode<char>* PRoot;
Binarytree<char> a(PRoot,size,iIdx,arr);
a.levelorder(PRoot);
return 0;
} | [
"1291048987@qq.com"
] | 1291048987@qq.com |
0ee35d694a010a0a11a49df9292277966afb1def | 011359e589f99ae5fe8271962d447165e9ff7768 | /src/burn/misc/post90s/d_tumbleb.cpp | 1e55eab42d1edc5b46d00968f84f870adfd3256a | [] | no_license | PS3emulators/fba-next-slim | 4c753375fd68863c53830bb367c61737393f9777 | d082dea48c378bddd5e2a686fe8c19beb06db8e1 | refs/heads/master | 2021-01-17T23:05:29.479865 | 2011-12-01T18:16:02 | 2011-12-01T18:16:02 | 2,899,840 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 148,258 | cpp | #include "tiles_generic.h"
#include "burn_ym2151.h"
#include "msm6295.h"
#include "burn_ym3812.h"
static unsigned char DrvInputPort0[8] = {0, 0, 0, 0, 0, 0, 0, 0};
static unsigned char DrvInputPort1[8] = {0, 0, 0, 0, 0, 0, 0, 0};
static unsigned char DrvInputPort2[8] = {0, 0, 0, 0, 0, 0, 0, 0};
static unsigned char DrvDip[2] = {0, 0};
static unsigned char DrvInput[3] = {0, 0, 0};
static unsigned char DrvReset = 0;
static unsigned char *Mem = NULL;
static unsigned char *MemEnd = NULL;
static unsigned char *RamStart = NULL;
static unsigned char *RamEnd = NULL;
static unsigned char *Drv68KRom = NULL;
static unsigned char *Drv68KRam = NULL;
static unsigned char *DrvZ80Rom = NULL;
static unsigned char *DrvZ80Ram = NULL;
static unsigned char *DrvProtData = NULL;
static unsigned char *DrvMSM6295ROMSrc = NULL;
static unsigned char *DrvSpriteRam = NULL;
static unsigned char *DrvPf1Ram = NULL;
static unsigned char *DrvPf2Ram = NULL;
static unsigned char *DrvPaletteRam = NULL;
static unsigned char *DrvChars = NULL;
static unsigned char *DrvTiles = NULL;
static unsigned char *DrvSprites = NULL;
static unsigned char *DrvTempRom = NULL;
static unsigned int *DrvPalette = NULL;
static UINT16 *DrvControl = NULL;
static unsigned char DrvVBlank;
static unsigned char DrvOkiBank;
static unsigned char DrvZ80Bank;
static UINT16 DrvTileBank;
static int DrvSoundLatch;
static int Tumbleb2MusicCommand;
static int Tumbleb2MusicBank;
static int Tumbleb2MusicIsPlaying;
static int DrvSpriteXOffset;
static int DrvSpriteYOffset;
static int DrvSpriteRamSize;
static int DrvSpriteMask;
static int DrvSpriteColourMask;
static int DrvYM2151Freq;
static int DrvNumSprites;
static int DrvNumChars;
static int DrvNumTiles;
static int DrvHasZ80;
static int DrvHasYM2151;
static int DrvHasYM3812;
static int DrvHasProt;
static int Tumbleb2;
static int Jumpkids;
static int Chokchok;
static int Wlstar;
static int Wondl96;
static int Bcstry;
static int Semibase;
static int SemicomSoundCommand;
static int Pf1XOffset;
static int Pf1YOffset;
static int Pf2XOffset;
static int Pf2YOffset;
typedef int (*LoadRoms)();
static LoadRoms DrvLoadRoms;
typedef void (*Map68k)();
static Map68k DrvMap68k;
typedef void (*MapZ80)();
static MapZ80 DrvMapZ80;
typedef void (*Render)();
static Render DrvRender;
static void DrvDraw();
static void PangpangDraw();
static void SuprtrioDraw();
static void HtchctchDraw();
static void FncywldDraw();
static void SdfightDraw();
static void JumppopDraw();
static int nCyclesDone[2], nCyclesTotal[2];
static int nCyclesSegment;
static struct BurnInputInfo TumblebInputList[] =
{
{"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" },
{"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" },
{"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" },
{"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" },
{"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" },
{"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" },
{"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" },
{"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" },
{"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" },
{"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" },
{"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" },
{"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" },
{"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" },
{"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" },
{"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" },
{"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" },
{"Reset" , BIT_DIGITAL , &DrvReset , "reset" },
{"Service" , BIT_DIGITAL , DrvInputPort2 + 2, "service" },
{"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" },
{"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" },
};
STDINPUTINFO(Tumbleb)
static struct BurnInputInfo MetlsavrInputList[] =
{
{"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" },
{"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" },
{"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" },
{"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" },
{"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" },
{"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" },
{"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" },
{"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" },
{"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" },
{"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" },
{"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" },
{"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" },
{"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" },
{"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" },
{"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" },
{"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" },
{"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" },
{"P2 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" },
{"Reset" , BIT_DIGITAL , &DrvReset , "reset" },
{"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" },
{"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" },
};
STDINPUTINFO(Metlsavr)
static struct BurnInputInfo SuprtrioInputList[] =
{
{"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" },
{"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" },
{"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" },
{"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" },
{"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" },
{"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" },
{"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" },
{"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" },
{"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" },
{"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" },
{"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" },
{"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" },
{"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" },
{"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" },
{"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" },
{"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" },
{"P2 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" },
{"Reset" , BIT_DIGITAL , &DrvReset , "reset" },
{"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" },
};
STDINPUTINFO(Suprtrio)
static struct BurnInputInfo HtchctchInputList[] =
{
{"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" },
{"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" },
{"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" },
{"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" },
{"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" },
{"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" },
{"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" },
{"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" },
{"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" },
{"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" },
{"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" },
{"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" },
{"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" },
{"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" },
{"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" },
{"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" },
{"Reset" , BIT_DIGITAL , &DrvReset , "reset" },
{"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" },
{"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" },
};
STDINPUTINFO(Htchctch)
static struct BurnInputInfo FncywldInputList[] =
{
{"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" },
{"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" },
{"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" },
{"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" },
{"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" },
{"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" },
{"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" },
{"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" },
{"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" },
{"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" },
{"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" },
{"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" },
{"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" },
{"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" },
{"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" },
{"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" },
{"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" },
{"P2 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" },
{"Reset" , BIT_DIGITAL , &DrvReset , "reset" },
{"Service" , BIT_DIGITAL , DrvInputPort2 + 2, "service" },
{"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" },
{"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" },
};
STDINPUTINFO(Fncywld)
static struct BurnInputInfo SemibaseInputList[] =
{
{"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" },
{"Start 1" , BIT_DIGITAL , DrvInputPort0 + 7, "p1 start" },
{"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" },
{"Start 2" , BIT_DIGITAL , DrvInputPort1 + 7, "p2 start" },
{"Coin 3" , BIT_DIGITAL , DrvInputPort2 + 2, "p3 coin" },
{"Coin 4" , BIT_DIGITAL , DrvInputPort2 + 3, "p4 coin" },
{"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" },
{"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" },
{"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" },
{"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" },
{"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" },
{"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" },
{"P1 Fire 3" , BIT_DIGITAL , DrvInputPort0 + 6, "p1 fire 3" },
{"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" },
{"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" },
{"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" },
{"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" },
{"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" },
{"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" },
{"P2 Fire 3" , BIT_DIGITAL , DrvInputPort1 + 6, "p2 fire 3" },
{"Reset" , BIT_DIGITAL , &DrvReset , "reset" },
{"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" },
{"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" },
};
STDINPUTINFO(Semibase)
static struct BurnInputInfo JumppopInputList[] =
{
{"Coin 1" , BIT_DIGITAL , DrvInputPort2 + 0, "p1 coin" },
{"Start 1" , BIT_DIGITAL , DrvInputPort2 + 2, "p1 start" },
{"Coin 2" , BIT_DIGITAL , DrvInputPort2 + 1, "p2 coin" },
{"Start 2" , BIT_DIGITAL , DrvInputPort2 + 3, "p2 start" },
{"P1 Up" , BIT_DIGITAL , DrvInputPort0 + 0, "p1 up" },
{"P1 Down" , BIT_DIGITAL , DrvInputPort0 + 1, "p1 down" },
{"P1 Left" , BIT_DIGITAL , DrvInputPort0 + 2, "p1 left" },
{"P1 Right" , BIT_DIGITAL , DrvInputPort0 + 3, "p1 right" },
{"P1 Fire 1" , BIT_DIGITAL , DrvInputPort0 + 4, "p1 fire 1" },
{"P1 Fire 2" , BIT_DIGITAL , DrvInputPort0 + 5, "p1 fire 2" },
{"P2 Up" , BIT_DIGITAL , DrvInputPort1 + 0, "p2 up" },
{"P2 Down" , BIT_DIGITAL , DrvInputPort1 + 1, "p2 down" },
{"P2 Left" , BIT_DIGITAL , DrvInputPort1 + 2, "p2 left" },
{"P2 Right" , BIT_DIGITAL , DrvInputPort1 + 3, "p2 right" },
{"P2 Fire 1" , BIT_DIGITAL , DrvInputPort1 + 4, "p2 fire 1" },
{"P2 Fire 2" , BIT_DIGITAL , DrvInputPort1 + 5, "p2 fire 2" },
{"Reset" , BIT_DIGITAL , &DrvReset , "reset" },
{"Dip 1" , BIT_DIPSWITCH, DrvDip + 0 , "dip" },
{"Dip 2" , BIT_DIPSWITCH, DrvDip + 1 , "dip" },
};
STDINPUTINFO(Jumppop)
static struct BurnDIPInfo TumblebDIPList[]=
{
// Default Values
{0x12, 0xff, 0xff, 0xff, NULL },
{0x13, 0xff, 0xff, 0xfe, NULL },
// Dip 1
{0 , 0xfe, 0 , 8 , "Coin A" },
{0x12, 0x01, 0xe0, 0x00, "3 Coins 1 Credit" },
{0x12, 0x01, 0xe0, 0x80, "2 Coins 1 Credit" },
{0x12, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" },
{0x12, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" },
{0x12, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" },
{0x12, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" },
{0x12, 0x01, 0xe0, 0xc0, "1 Coin 5 Credits" },
{0x12, 0x01, 0xe0, 0x40, "1 Coin 6 Credits" },
{0 , 0xfe, 0 , 8 , "Coin B" },
{0x12, 0x01, 0x1c, 0x00, "3 Coins 1 Credit" },
{0x12, 0x01, 0x1c, 0x10, "2 Coins 1 Credit" },
{0x12, 0x01, 0x1c, 0x1c, "1 Coin 1 Credit" },
{0x12, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" },
{0x12, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" },
{0x12, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" },
{0x12, 0x01, 0x1c, 0x18, "1 Coin 5 Credits" },
{0x12, 0x01, 0x1c, 0x08, "1 Coin 6 Credits" },
{0 , 0xfe, 0 , 2 , "Flip Screen" },
{0x12, 0x01, 0x02, 0x02, "Off" },
{0x12, 0x01, 0x02, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "2 Coins to Start, 1 to Continue" },
{0x12, 0x01, 0x01, 0x01, "Off" },
{0x12, 0x01, 0x01, 0x00, "On" },
// Dip 2
{0 , 0xfe, 0 , 4 , "Lives" },
{0x13, 0x01, 0xc0, 0x80, "1" },
{0x13, 0x01, 0xc0, 0x00, "2" },
{0x13, 0x01, 0xc0, 0xc0, "3" },
{0x13, 0x01, 0xc0, 0x40, "4" },
{0 , 0xfe, 0 , 4 , "Difficulty" },
{0x13, 0x01, 0x30, 0x10, "Easy" },
{0x13, 0x01, 0x30, 0x30, "Normal" },
{0x13, 0x01, 0x30, 0x20, "Hard" },
{0x13, 0x01, 0x30, 0x00, "Hardest" },
{0 , 0xfe, 0 , 2 , "Allow Continue" },
{0x13, 0x01, 0x02, 0x00, "Off" },
{0x13, 0x01, 0x02, 0x02, "On" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x13, 0x01, 0x01, 0x01, "Off" },
{0x13, 0x01, 0x01, 0x00, "On" },
};
STDDIPINFO(Tumbleb)
static struct BurnDIPInfo MetlsavrDIPList[]=
{
// Default Values
{0x13, 0xff, 0xff, 0xff, NULL },
{0x14, 0xff, 0xff, 0xff, NULL },
// Dip 1
{0 , 0xfe, 0 , 4 , "Lives" },
{0x13, 0x01, 0x0c, 0x00, "2" },
{0x13, 0x01, 0x0c, 0x0c, "3" },
{0x13, 0x01, 0x0c, 0x08, "4" },
{0x13, 0x01, 0x0c, 0x04, "5" },
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x13, 0x01, 0x70, 0x00, "5 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x10, "4 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x20, "3 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x30, "2 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x70, "1 Coin 1 Credit" },
{0x13, 0x01, 0x70, 0x60, "1 Coin 2 Credits" },
{0x13, 0x01, 0x70, 0x50, "1 Coin 3 Credits" },
{0x13, 0x01, 0x70, 0x40, "1 Coin 5 Credits" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x13, 0x01, 0x80, 0x00, "Off" },
{0x13, 0x01, 0x80, 0x80, "On" },
// Dip 2
{0 , 0xfe, 0 , 2 , "Language" },
{0x14, 0x01, 0x08, 0x08, "English" },
{0x14, 0x01, 0x08, 0x00, "Korean" },
{0 , 0xfe, 0 , 4 , "Life Meter" },
{0x14, 0x01, 0x30, 0x00, "66%" },
{0x14, 0x01, 0x30, 0x30, "100%" },
{0x14, 0x01, 0x30, 0x20, "133%" },
{0x14, 0x01, 0x30, 0x10, "166%" },
{0 , 0xfe, 0 , 4 , "Time" },
{0x14, 0x01, 0xc0, 0x40, "30 Seconds" },
{0x14, 0x01, 0xc0, 0x80, "40 Seconds" },
{0x14, 0x01, 0xc0, 0xc0, "60 Seconds" },
{0x14, 0x01, 0xc0, 0x00, "80 Seconds" },
};
STDDIPINFO(Metlsavr)
static struct BurnDIPInfo SuprtrioDIPList[]=
{
// Default Values
{0x12, 0xff, 0xff, 0x10, NULL },
// Dip 1
{0 , 0xfe, 0 , 8 , "Coin A" },
{0x12, 0x01, 0x07, 0x06, "5 Coins 1 Credit" },
{0x12, 0x01, 0x07, 0x05, "4 Coins 1 Credit" },
{0x12, 0x01, 0x07, 0x04, "3 Coins 1 Credit" },
{0x12, 0x01, 0x07, 0x03, "2 Coins 1 Credit" },
{0x12, 0x01, 0x07, 0x00, "1 Coin 1 Credit" },
{0x12, 0x01, 0x07, 0x01, "1 Coin 2 Credits" },
{0x12, 0x01, 0x07, 0x02, "1 Coin 3 Credits" },
{0x12, 0x01, 0x07, 0x07, "Free Play" },
{0 , 0xfe, 0 , 4 , "Lives" },
{0x12, 0x01, 0x18, 0x00, "1" },
{0x12, 0x01, 0x18, 0x08, "2" },
{0x12, 0x01, 0x18, 0x10, "3" },
{0x12, 0x01, 0x18, 0x18, "5" },
{0 , 0xfe, 0 , 2 , "Difficulty" },
{0x12, 0x01, 0x20, 0x00, "Normal" },
{0x12, 0x01, 0x20, 0x20, "Hard" },
{0 , 0xfe, 0 , 2 , "Bonus Life" },
{0x12, 0x01, 0x40, 0x00, "50000" },
{0x12, 0x01, 0x40, 0x40, "60000" },
{0 , 0xfe, 0 , 2 , "Service Mode" },
{0x12, 0x01, 0x80, 0x00, "Off" },
{0x12, 0x01, 0x80, 0x80, "On" },
};
STDDIPINFO(Suprtrio)
static struct BurnDIPInfo HtchctchDIPList[]=
{
// Default Values
{0x11, 0xff, 0xff, 0xff, NULL },
{0x12, 0xff, 0xff, 0x7f, NULL },
// Dip 1
// Dip 2
{0 , 0xfe, 0 , 2 , "Service Mode" },
{0x12, 0x01, 0x01, 0x01, "Off" },
{0x12, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 4 , "Difficulty" },
{0x12, 0x01, 0x06, 0x00, "Easy" },
{0x12, 0x01, 0x06, 0x06, "Normal" },
{0x12, 0x01, 0x06, 0x02, "Hard" },
{0x12, 0x01, 0x06, 0x04, "Very Hard" },
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x20, "4 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x30, "2 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credit" },
{0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" },
{0x12, 0x01, 0x38, 0x18, "1 Coin 2 Credits" },
{0x12, 0x01, 0x38, 0x08, "1 Coin 3 Credits" },
{0 , 0xfe, 0 , 2 , "Stage Skip" },
{0x12, 0x01, 0x40, 0x40, "Off" },
{0x12, 0x01, 0x40, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x12, 0x01, 0x80, 0x80, "Off" },
{0x12, 0x01, 0x80, 0x00, "On" },
};
STDDIPINFO(Htchctch)
static struct BurnDIPInfo CookbibDIPList[]=
{
// Default Values
{0x11, 0xff, 0xff, 0xff, NULL },
{0x12, 0xff, 0xff, 0x7f, NULL },
// Dip 1
// Dip 2
{0 , 0xfe, 0 , 2 , "Service Mode" },
{0x12, 0x01, 0x01, 0x01, "Off" },
{0x12, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 4 , "Difficulty" },
{0x12, 0x01, 0x06, 0x00, "Easy" },
{0x12, 0x01, 0x06, 0x06, "Normal" },
{0x12, 0x01, 0x06, 0x02, "Hard" },
{0x12, 0x01, 0x06, 0x04, "Very Hard" },
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x20, "4 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x30, "2 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credit" },
{0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" },
{0x12, 0x01, 0x38, 0x18, "1 Coin 2 Credits" },
{0x12, 0x01, 0x38, 0x08, "1 Coin 3 Credits" },
{0 , 0xfe, 0 , 2 , "Winning Rounds (vs mode)"},
{0x12, 0x01, 0x40, 0x00, "1" },
{0x12, 0x01, 0x40, 0x40, "2" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x12, 0x01, 0x80, 0x80, "Off" },
{0x12, 0x01, 0x80, 0x00, "On" },
};
STDDIPINFO(Cookbib)
static struct BurnDIPInfo ChokchokDIPList[]=
{
// Default Values
{0x11, 0xff, 0xff, 0xff, NULL },
{0x12, 0xff, 0xff, 0x7f, NULL },
// Dip 1
{0 , 0xfe, 0 , 2 , "Winning Rounds (vs mode)"},
{0x11, 0x01, 0x01, 0x00, "2" },
{0x11, 0x01, 0x01, 0x01, "3" },
{0 , 0xfe, 0 , 2 , "Time" },
{0x11, 0x01, 0x20, 0x20, "60 Seconds" },
{0x11, 0x01, 0x20, 0x00, "90 Seconds" },
{0 , 0xfe, 0 , 4 , "Starting Balls" },
{0x11, 0x01, 0xc0, 0x00, "3" },
{0x11, 0x01, 0xc0, 0xc0, "4" },
{0x11, 0x01, 0xc0, 0x40, "5" },
{0x11, 0x01, 0xc0, 0x80, "6" },
// Dip 2
{0 , 0xfe, 0 , 2 , "Service Mode" },
{0x12, 0x01, 0x01, 0x01, "Off" },
{0x12, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 4 , "Difficulty" },
{0x12, 0x01, 0x06, 0x00, "Easy" },
{0x12, 0x01, 0x06, 0x06, "Normal" },
{0x12, 0x01, 0x06, 0x02, "Hard" },
{0x12, 0x01, 0x06, 0x04, "Very Hard" },
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x12, 0x01, 0x38, 0x00, "5 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x20, "4 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x10, "3 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x30, "2 Coins 1 Credit" },
{0x12, 0x01, 0x38, 0x38, "1 Coin 1 Credit" },
{0x12, 0x01, 0x38, 0x28, "2 Coins 3 Credits" },
{0x12, 0x01, 0x38, 0x18, "1 Coin 2 Credits" },
{0x12, 0x01, 0x38, 0x08, "1 Coin 3 Credits" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x12, 0x01, 0x80, 0x80, "Off" },
{0x12, 0x01, 0x80, 0x00, "On" },
};
STDDIPINFO(Chokchok)
static struct BurnDIPInfo WlstarDIPList[]=
{
// Default Values
{0x13, 0xff, 0xff, 0xff, NULL },
{0x14, 0xff, 0xff, 0x7f, NULL },
// Dip 1
{0 , 0xfe, 0 , 2 , "2 Players Game" },
{0x13, 0x01, 0x10, 0x00, "1 Credit" },
{0x13, 0x01, 0x10, 0x10, "2 Credits" },
{0 , 0xfe, 0 , 4 , "Difficulty" },
{0x13, 0x01, 0xc0, 0x00, "Easy" },
{0x13, 0x01, 0xc0, 0xc0, "Normal" },
{0x13, 0x01, 0xc0, 0x40, "Hard" },
{0x13, 0x01, 0xc0, 0x80, "Hardest" },
// Dip 2
{0 , 0xfe, 0 , 2 , "Last Inning" },
{0x14, 0x01, 0x01, 0x00, "9" },
{0x14, 0x01, 0x01, 0x01, "12" },
{0 , 0xfe, 0 , 2 , "Versus CPU Game Ends" },
{0x14, 0x01, 0x02, 0x02, "+10" },
{0x14, 0x01, 0x02, 0x00, "+7" },
{0 , 0xfe, 0 , 2 , "Versus Game" },
{0x14, 0x01, 0x04, 0x00, "1 Credit / 2 Innings" },
{0x14, 0x01, 0x04, 0x04, "1 Credit / 3 Innings" },
{0 , 0xfe, 0 , 2 , "Full 2 Players Game" },
{0x14, 0x01, 0x08, 0x00, "4 Credits" },
{0x14, 0x01, 0x08, 0x08, "6 Credits" },
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x14, 0x01, 0x70, 0x00, "5 Coins 1 Credit" },
{0x14, 0x01, 0x70, 0x40, "4 Coins 1 Credit" },
{0x14, 0x01, 0x70, 0x20, "3 Coins 1 Credit" },
{0x14, 0x01, 0x70, 0x60, "2 Coins 1 Credit" },
{0x14, 0x01, 0x70, 0x70, "1 Coin 1 Credit" },
{0x14, 0x01, 0x70, 0x50, "2 Coins 3 Credits" },
{0x14, 0x01, 0x70, 0x30, "1 Coin 2 Credits" },
{0x14, 0x01, 0x70, 0x10, "1 Coin 3 Credits" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x14, 0x01, 0x80, 0x80, "Off" },
{0x14, 0x01, 0x80, 0x00, "On" },
};
STDDIPINFO(Wlstar)
static struct BurnDIPInfo Wondl96DIPList[]=
{
// Default Values
{0x13, 0xff, 0xff, 0x7f, NULL },
{0x14, 0xff, 0xff, 0xff, NULL },
// Dip 1
{0 , 0xfe, 0 , 2 , "Free Play" },
{0x13, 0x01, 0x01, 0x01, "Off" },
{0x13, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "Field Colour" },
{0x13, 0x01, 0x10, 0x10, "Blue" },
{0x13, 0x01, 0x10, 0x00, "Green" },
{0 , 0xfe, 0 , 2 , "Versus CPU Game Ends" },
{0x13, 0x01, 0x20, 0x20, "+10" },
{0x13, 0x01, 0x20, 0x00, "+7" },
{0 , 0xfe, 0 , 2 , "Versus Game" },
{0x13, 0x01, 0x40, 0x00, "1 Credit / 2 Innings" },
{0x13, 0x01, 0x40, 0x40, "1 Credit / 3 Innings" },
{0 , 0xfe, 0 , 2 , "Full 2 Players Game" },
{0x13, 0x01, 0x80, 0x80, "4 Credits" },
{0x13, 0x01, 0x80, 0x00, "6 Credits" },
// Dip 2
{0 , 0xfe, 0 , 8 , "Difficulty" },
{0x14, 0x01, 0x0e, 0x04, "Level 1" },
{0x14, 0x01, 0x0e, 0x08, "Level 2" },
{0x14, 0x01, 0x0e, 0x00, "Level 3" },
{0x14, 0x01, 0x0e, 0x0e, "Level 4" },
{0x14, 0x01, 0x0e, 0x06, "Level 5" },
{0x14, 0x01, 0x0e, 0x0a, "Level 6" },
{0x14, 0x01, 0x0e, 0x02, "Level 7" },
{0x14, 0x01, 0x0e, 0x0c, "Level 8" },
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x14, 0x01, 0x70, 0x00, "5 Coins 1 Credit" },
{0x14, 0x01, 0x70, 0x40, "4 Coins 1 Credit" },
{0x14, 0x01, 0x70, 0x20, "3 Coins 1 Credit" },
{0x14, 0x01, 0x70, 0x60, "2 Coins 1 Credit" },
{0x14, 0x01, 0x70, 0x70, "1 Coin 1 Credit" },
{0x14, 0x01, 0x70, 0x50, "2 Coins 3 Credits" },
{0x14, 0x01, 0x70, 0x30, "1 Coin 2 Credits" },
{0x14, 0x01, 0x70, 0x10, "1 Coin 3 Credits" },
};
STDDIPINFO(Wondl96)
static struct BurnDIPInfo FncywldDIPList[]=
{
// Default Values
{0x14, 0xff, 0xff, 0xf7, NULL },
{0x15, 0xff, 0xff, 0xff, NULL },
// Dip 1
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x14, 0x01, 0xe0, 0x20, "4 Coins 1 Credit" },
{0x14, 0x01, 0xe0, 0x40, "3 Coins 1 Credit" },
{0x14, 0x01, 0xe0, 0x60, "2 Coins 1 Credit" },
{0x14, 0x01, 0xe0, 0x00, "2 Coins 1 Credit" },
{0x14, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" },
{0x14, 0x01, 0xe0, 0xc0, "1 Coin 2 Credits" },
{0x14, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" },
{0x14, 0x01, 0xe0, 0x80, "1 Coin 4 Credits" },
{0 , 0xfe, 0 , 2 , "Allow Continue" },
{0x14, 0x01, 0x10, 0x00, "Off" },
{0x14, 0x01, 0x10, 0x10, "On" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x14, 0x01, 0x08, 0x08, "Off" },
{0x14, 0x01, 0x08, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "Language" },
{0x14, 0x01, 0x04, 0x04, "English" },
{0x14, 0x01, 0x04, 0x00, "Korean" },
{0 , 0xfe, 0 , 2 , "Flip Screen" },
{0x14, 0x01, 0x02, 0x02, "Off" },
{0x14, 0x01, 0x02, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "2 Coins to Start, 1 to Continue" },
{0x14, 0x01, 0x01, 0x01, "Off" },
{0x14, 0x01, 0x01, 0x00, "On" },
// Dip 2
{0 , 0xfe, 0 , 4 , "Lives" },
{0x15, 0x01, 0xc0, 0x80, "1" },
{0x15, 0x01, 0xc0, 0x00, "2" },
{0x15, 0x01, 0xc0, 0xc0, "3" },
{0x15, 0x01, 0xc0, 0x40, "4" },
{0 , 0xfe, 0 , 4 , "Difficulty" },
{0x15, 0x01, 0x30, 0x30, "Easy" },
{0x15, 0x01, 0x30, 0x20, "Normal" },
{0x15, 0x01, 0x30, 0x10, "Hard" },
{0x15, 0x01, 0x30, 0x00, "Hardest" },
{0 , 0xfe, 0 , 2 , "Freeze" },
{0x15, 0x01, 0x01, 0x01, "Off" },
{0x15, 0x01, 0x01, 0x00, "On" },
};
STDDIPINFO(Fncywld)
static struct BurnDIPInfo SdfightDIPList[]=
{
// Default Values
{0x13, 0xff, 0xff, 0x7f, NULL },
{0x14, 0xff, 0xff, 0xff, NULL },
// Dip 1
{0 , 0xfe, 0 , 2 , "Service Mode" },
{0x13, 0x01, 0x01, 0x01, "Off" },
{0x13, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 8 , "Difficulty" },
{0x13, 0x01, 0x0e, 0x04, "1" },
{0x13, 0x01, 0x0e, 0x08, "2" },
{0x13, 0x01, 0x0e, 0x00, "3" },
{0x13, 0x01, 0x0e, 0x0e, "4" },
{0x13, 0x01, 0x0e, 0x06, "5" },
{0x13, 0x01, 0x0e, 0x0a, "6" },
{0x13, 0x01, 0x0e, 0x02, "7" },
{0x13, 0x01, 0x0e, 0x0c, "8" },
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x13, 0x01, 0x70, 0x00, "5 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x40, "4 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x20, "3 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x60, "2 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x70, "1 Coin 1 Credit" },
{0x13, 0x01, 0x70, 0x50, "2 Coins 3 Credits" },
{0x13, 0x01, 0x70, 0x30, "1 Coin 2 Credits" },
{0x13, 0x01, 0x70, 0x10, "1 Coin 3 Credits" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x13, 0x01, 0x80, 0x80, "Off" },
{0x13, 0x01, 0x80, 0x00, "On" },
// Dip 2
{0 , 0xfe, 0 , 2 , "Free Play" },
{0x14, 0x01, 0x01, 0x01, "Off" },
{0x14, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "Winning Rounds" },
{0x14, 0x01, 0x08, 0x08, "2" },
{0x14, 0x01, 0x08, 0x00, "3" },
{0 , 0xfe, 0 , 4 , "Time" },
{0x14, 0x01, 0xc0, 0x40, "30" },
{0x14, 0x01, 0xc0, 0x80, "50" },
{0x14, 0x01, 0xc0, 0xc0, "70" },
{0x14, 0x01, 0xc0, 0x00, "90" },
};
STDDIPINFO(Sdfight)
static struct BurnDIPInfo BcstryDIPList[]=
{
// Default Values
{0x13, 0xff, 0xff, 0x7f, NULL },
{0x14, 0xff, 0xff, 0xdf, NULL },
// Dip 1
{0 , 0xfe, 0 , 2 , "Service Mode" },
{0x13, 0x01, 0x01, 0x01, "Off" },
{0x13, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 8 , "Difficulty" },
{0x13, 0x01, 0x0e, 0x04, "1" },
{0x13, 0x01, 0x0e, 0x08, "2" },
{0x13, 0x01, 0x0e, 0x00, "3" },
{0x13, 0x01, 0x0e, 0x0e, "4" },
{0x13, 0x01, 0x0e, 0x06, "5" },
{0x13, 0x01, 0x0e, 0x0a, "6" },
{0x13, 0x01, 0x0e, 0x02, "7" },
{0x13, 0x01, 0x0e, 0x0c, "8" },
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x13, 0x01, 0x70, 0x00, "5 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x40, "4 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x20, "3 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x60, "2 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x70, "1 Coin 1 Credit" },
{0x13, 0x01, 0x70, 0x50, "2 Coins 3 Credits" },
{0x13, 0x01, 0x70, 0x30, "1 Coin 2 Credits" },
{0x13, 0x01, 0x70, 0x10, "1 Coin 3 Credits" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x13, 0x01, 0x80, 0x80, "Off" },
{0x13, 0x01, 0x80, 0x00, "On" },
// Dip 2
{0 , 0xfe, 0 , 2 , "Free Play" },
{0x14, 0x01, 0x01, 0x01, "Off" },
{0x14, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "Event Selection" },
{0x14, 0x01, 0x20, 0x20, "Off" },
{0x14, 0x01, 0x20, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "Control Type" },
{0x14, 0x01, 0x40, 0x40, "Joysticks & Buttons" },
{0x14, 0x01, 0x40, 0x00, "Buttons" },
{0 , 0xfe, 0 , 2 , "Debug Mode" },
{0x14, 0x01, 0x80, 0x80, "Off" },
{0x14, 0x01, 0x80, 0x00, "On" },
};
STDDIPINFO(Bcstry)
static struct BurnDIPInfo SemibaseDIPList[]=
{
// Default Values
{0x15, 0xff, 0xff, 0x7f, NULL },
{0x16, 0xff, 0xff, 0xdf, NULL },
// Dip 1
{0 , 0xfe, 0 , 2 , "Service Mode" },
{0x15, 0x01, 0x01, 0x01, "Off" },
{0x15, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 8 , "Difficulty" },
{0x15, 0x01, 0x0e, 0x04, "1" },
{0x15, 0x01, 0x0e, 0x08, "2" },
{0x15, 0x01, 0x0e, 0x00, "3" },
{0x15, 0x01, 0x0e, 0x0e, "4" },
{0x15, 0x01, 0x0e, 0x06, "5" },
{0x15, 0x01, 0x0e, 0x0a, "6" },
{0x15, 0x01, 0x0e, 0x02, "7" },
{0x15, 0x01, 0x0e, 0x0c, "8" },
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x15, 0x01, 0x70, 0x00, "5 Coins 1 Credit" },
{0x15, 0x01, 0x70, 0x40, "4 Coins 1 Credit" },
{0x15, 0x01, 0x70, 0x20, "3 Coins 1 Credit" },
{0x15, 0x01, 0x70, 0x60, "2 Coins 1 Credit" },
{0x15, 0x01, 0x70, 0x70, "1 Coin 1 Credit" },
{0x15, 0x01, 0x70, 0x50, "2 Coins 3 Credits" },
{0x15, 0x01, 0x70, 0x30, "1 Coin 2 Credits" },
{0x15, 0x01, 0x70, 0x10, "1 Coin 3 Credits" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x15, 0x01, 0x80, 0x80, "Off" },
{0x15, 0x01, 0x80, 0x00, "On" },
// Dip 2
{0 , 0xfe, 0 , 2 , "Free Play" },
{0x16, 0x01, 0x01, 0x01, "Off" },
{0x16, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "vs CPU Game Ends" },
{0x16, 0x01, 0x20, 0x20, "+10" },
{0x16, 0x01, 0x20, 0x00, "+7" },
{0 , 0xfe, 0 , 2 , "Vs Game" },
{0x16, 0x01, 0x40, 0x40, "1 Credit / 2 Innings" },
{0x16, 0x01, 0x40, 0x00, "1 Credit / 3 Innings" },
{0 , 0xfe, 0 , 2 , "Full 2 Players Game" },
{0x16, 0x01, 0x80, 0x00, "4 Credits" },
{0x16, 0x01, 0x80, 0x80, "6 Credits" },
};
STDDIPINFO(Semibase)
static struct BurnDIPInfo DquizgoDIPList[]=
{
// Default Values
{0x13, 0xff, 0xff, 0x7f, NULL },
{0x14, 0xff, 0xff, 0xff, NULL },
// Dip 1
{0 , 0xfe, 0 , 2 , "Service Mode" },
{0x13, 0x01, 0x01, 0x01, "Off" },
{0x13, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 8 , "Difficulty" },
{0x13, 0x01, 0x0e, 0x04, "1" },
{0x13, 0x01, 0x0e, 0x08, "2" },
{0x13, 0x01, 0x0e, 0x00, "3" },
{0x13, 0x01, 0x0e, 0x0e, "4" },
{0x13, 0x01, 0x0e, 0x06, "5" },
{0x13, 0x01, 0x0e, 0x0a, "6" },
{0x13, 0x01, 0x0e, 0x02, "7" },
{0x13, 0x01, 0x0e, 0x0c, "8" },
{0 , 0xfe, 0 , 8 , "Coinage" },
{0x13, 0x01, 0x70, 0x00, "3 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x40, "3 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x20, "3 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x60, "2 Coins 1 Credit" },
{0x13, 0x01, 0x70, 0x70, "1 Coin 1 Credit" },
{0x13, 0x01, 0x70, 0x50, "2 Coins 3 Credits" },
{0x13, 0x01, 0x70, 0x30, "1 Coin 2 Credits" },
{0x13, 0x01, 0x70, 0x10, "1 Coin 3 Credits" },
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x13, 0x01, 0x80, 0x80, "Off" },
{0x13, 0x01, 0x80, 0x00, "On" },
// Dip 2
{0 , 0xfe, 0 , 2 , "Free Play" },
{0x14, 0x01, 0x01, 0x01, "Off" },
{0x14, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 4 , "Lives" },
{0x14, 0x01, 0xc0, 0x00, "2" },
{0x14, 0x01, 0xc0, 0xc0, "3" },
{0x14, 0x01, 0xc0, 0x40, "4" },
{0x14, 0x01, 0xc0, 0x80, "5" },
};
STDDIPINFO(Dquizgo)
static struct BurnDIPInfo JumppopDIPList[]=
{
// Default Values
{0x11, 0xff, 0xff, 0xff, NULL },
{0x12, 0xff, 0xff, 0xfe, NULL },
// Dip 1
{0 , 0xfe, 0 , 2 , "Service Mode" },
{0x11, 0x01, 0x01, 0x01, "Off" },
{0x11, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "Free Play" },
{0x11, 0x01, 0x02, 0x02, "Off" },
{0x11, 0x01, 0x02, 0x00, "On" },
{0 , 0xfe, 0 , 8 , "Coin A" },
{0x11, 0x01, 0xe0, 0x00, "3 Coins 1 Credit" },
{0x11, 0x01, 0xe0, 0x80, "2 Coins 1 Credit" },
{0x11, 0x01, 0xe0, 0xe0, "1 Coin 1 Credit" },
{0x11, 0x01, 0xe0, 0x60, "1 Coin 2 Credits" },
{0x11, 0x01, 0xe0, 0xa0, "1 Coin 3 Credits" },
{0x11, 0x01, 0xe0, 0x20, "1 Coin 4 Credits" },
{0x11, 0x01, 0xe0, 0xc0, "1 Coin 5 Credits" },
{0x11, 0x01, 0xe0, 0x40, "1 Coin 6 Credits" },
{0 , 0xfe, 0 , 8 , "Coin B" },
{0x11, 0x01, 0x1c, 0x00, "3 Coins 1 Credit" },
{0x11, 0x01, 0x1c, 0x10, "2 Coins 1 Credit" },
{0x11, 0x01, 0x1c, 0x1c, "1 Coin 1 Credit" },
{0x11, 0x01, 0x1c, 0x0c, "1 Coin 2 Credits" },
{0x11, 0x01, 0x1c, 0x14, "1 Coin 3 Credits" },
{0x11, 0x01, 0x1c, 0x04, "1 Coin 4 Credits" },
{0x11, 0x01, 0x1c, 0x18, "1 Coin 5 Credits" },
{0x11, 0x01, 0x1c, 0x08, "1 Coin 6 Credits" },
// Dip 2
{0 , 0xfe, 0 , 2 , "Demo Sounds" },
{0x12, 0x01, 0x01, 0x01, "Off" },
{0x12, 0x01, 0x01, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "Allow Continue" },
{0x12, 0x01, 0x02, 0x00, "Off" },
{0x12, 0x01, 0x02, 0x02, "On" },
{0 , 0xfe, 0 , 2 , "Picture Viewer" },
{0x12, 0x01, 0x04, 0x04, "Off" },
{0x12, 0x01, 0x04, 0x00, "On" },
{0 , 0xfe, 0 , 2 , "Background Type" },
{0x12, 0x01, 0x08, 0x08, "1" },
{0x12, 0x01, 0x08, 0x00, "2" },
{0 , 0xfe, 0 , 4 , "Difficulty" },
{0x12, 0x01, 0x30, 0x20, "Easy" },
{0x12, 0x01, 0x30, 0x30, "Normal" },
{0x12, 0x01, 0x30, 0x10, "Hard" },
{0x12, 0x01, 0x30, 0x00, "Hardest" },
{0 , 0xfe, 0 , 4 , "Lives" },
{0x12, 0x01, 0xc0, 0x80, "1" },
{0x12, 0x01, 0xc0, 0x00, "2" },
{0x12, 0x01, 0xc0, 0xc0, "3" },
{0x12, 0x01, 0xc0, 0x40, "4" },
};
STDDIPINFO(Jumppop)
static inline void DrvMakeInputs()
{
// Reset Inputs
DrvInput[0] = DrvInput[1] = DrvInput[2] = 0x00;
// Compile Digital Inputs
for (int i = 0; i < 8; i++) {
DrvInput[0] |= (DrvInputPort0[i] & 1) << i;
DrvInput[1] |= (DrvInputPort1[i] & 1) << i;
DrvInput[2] |= (DrvInputPort2[i] & 1) << i;
}
// Clear Opposites
DrvClearOpposites(&DrvInput[0]);
DrvClearOpposites(&DrvInput[1]);
}
static struct BurnRomInfo TumblebRomDesc[] = {
{ "thumbpop.12", 0x40000, 0x0c984703, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "thumbpop.13", 0x40000, 0x864c4053, BRF_ESS | BRF_PRG }, // 1
{ "thumbpop.19", 0x40000, 0x0795aab4, BRF_GRA }, // 2 Tiles
{ "thumbpop.18", 0x40000, 0xad58df43, BRF_GRA }, // 3
{ "map-01.rom", 0x80000, 0xe81ffa09, BRF_GRA }, // 4 Sprites
{ "map-00.rom", 0x80000, 0x8c879cfe, BRF_GRA }, // 5
{ "thumbpop.snd", 0x80000, 0xfabbf15d, BRF_SND }, // 6 Samples
};
STD_ROM_PICK(Tumbleb)
STD_ROM_FN(Tumbleb)
static struct BurnRomInfo Tumbleb2RomDesc[] = {
{ "thumbpop.2", 0x40000, 0x34b016e1, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "thumbpop.3", 0x40000, 0x89501c71, BRF_ESS | BRF_PRG }, // 1
{ "thumbpop.19", 0x40000, 0x0795aab4, BRF_GRA }, // 2 Tiles
{ "thumbpop.18", 0x40000, 0xad58df43, BRF_GRA }, // 3
{ "map-01.rom", 0x80000, 0xe81ffa09, BRF_GRA }, // 4 Sprites
{ "map-00.rom", 0x80000, 0x8c879cfe, BRF_GRA }, // 5
{ "thumbpop.snd", 0x80000, 0xfabbf15d, BRF_SND }, // 6 Samples
{ "pic_16c57", 0x02d4c, 0x00000000, BRF_NODUMP },
};
STD_ROM_PICK(Tumbleb2)
STD_ROM_FN(Tumbleb2)
static struct BurnRomInfo JumpkidsRomDesc[] = {
{ "23-ic29.15c", 0x40000, 0x6ba11e91, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "24-ic30.17c", 0x40000, 0x5795d98b, BRF_ESS | BRF_PRG }, // 1
{ "22-ic19.3c", 0x08000, 0xbd619530, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "30-ic125.15j", 0x40000, 0x44b9a089, BRF_GRA }, // 3 Tiles
{ "29-ic124.13j", 0x40000, 0x3f98ec69, BRF_GRA }, // 4
{ "25-ic69.1g", 0x40000, 0x176ae857, BRF_GRA }, // 5 Sprites
{ "28-ic131.1l", 0x40000, 0xed837757, BRF_GRA }, // 6
{ "26-ic70.2g", 0x40000, 0xe8b34980, BRF_GRA }, // 7
{ "27-ic100.1j", 0x40000, 0x3918dda3, BRF_GRA }, // 8
{ "21-ic17.1c", 0x80000, 0xe5094f75, BRF_SND }, // 9 Samples
{ "ic18.2c", 0x20000, 0xa63736c3, BRF_SND }, // 10
};
STD_ROM_PICK(Jumpkids)
STD_ROM_FN(Jumpkids)
static struct BurnRomInfo MetlsavrRomDesc[] = {
{ "first-4.ub17", 0x40000, 0x667a494d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "first-3.ub18", 0x40000, 0x87bf4ed2, BRF_ESS | BRF_PRG }, // 1
{ "first-2.ua7", 0x10000, 0x49505edf, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0x17aa17a9, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "first-5.rom5", 0x40000, 0xdd4af746, BRF_GRA }, // 4 Tiles
{ "first-6.rom6", 0x40000, 0x808b0e0b, BRF_GRA }, // 5
{ "first-7.uor1", 0x80000, 0xa6816747, BRF_GRA }, // 6 Sprites
{ "first-8.uor2", 0x80000, 0x377020e5, BRF_GRA }, // 7
{ "first-9.uor3", 0x80000, 0xfccf1bb7, BRF_GRA }, // 8
{ "first-10.uor4", 0x80000, 0xa22b587b, BRF_GRA }, // 9
{ "first-1.uc1", 0x40000, 0xe943dacb, BRF_SND }, // 10 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11
};
STD_ROM_PICK(Metlsavr)
STD_ROM_FN(Metlsavr)
static struct BurnRomInfo PangpangRomDesc[] = {
{ "2.bin", 0x40000, 0x45436666, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "3.bin", 0x40000, 0x2725cbe7, BRF_ESS | BRF_PRG }, // 1
{ "11.bin", 0x40000, 0xa2b9fec8, BRF_GRA }, // 2 Tiles
{ "10.bin", 0x40000, 0x4f59d7b9, BRF_GRA }, // 3
{ "6.bin", 0x40000, 0x1ebbc4f1, BRF_GRA }, // 4
{ "7.bin", 0x40000, 0xcd544173, BRF_GRA }, // 5
{ "8.bin", 0x40000, 0xea0fa1e0, BRF_GRA }, // 6 Sprites
{ "9.bin", 0x40000, 0x1da5fe49, BRF_GRA }, // 7
{ "4.bin", 0x40000, 0x4f282eb1, BRF_GRA }, // 8
{ "5.bin", 0x40000, 0x00694df9, BRF_GRA }, // 9
{ "1.bin", 0x80000, 0xe722bb02, BRF_SND }, // 10 Samples
{ "pic_16c57", 0x02d4c, 0x1ca515b4, BRF_OPT },
};
STD_ROM_PICK(Pangpang)
STD_ROM_FN(Pangpang)
static struct BurnRomInfo SuprtrioRomDesc[] = {
{ "rom2", 0x40000, 0x4102e59d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "rom1", 0x40000, 0xcc3a83c3, BRF_ESS | BRF_PRG }, // 1
{ "rom4l", 0x10000, 0x466aa96d, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "rom4", 0x80000, 0xcd2dfae4, BRF_GRA }, // 3 Tiles
{ "rom5", 0x80000, 0x4e64da64, BRF_GRA }, // 4
{ "rom9l", 0x40000, 0xcc45f437, BRF_GRA }, // 5 Sprites
{ "rom8l", 0x40000, 0x9bc90169, BRF_GRA }, // 6
{ "rom7l", 0x40000, 0xbfc7c756, BRF_GRA }, // 7
{ "rom6l", 0x40000, 0xbb3499af, BRF_GRA }, // 8
{ "rom3h", 0x80000, 0x34ea7ec9, BRF_SND }, // 9 Samples
{ "rom3l", 0x20000, 0x1b73233b, BRF_SND }, // 10
};
STD_ROM_PICK(Suprtrio)
STD_ROM_FN(Suprtrio)
static struct BurnRomInfo HtchctchRomDesc[] = {
{ "p04.b17", 0x20000, 0x6991483a, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "p03.b16", 0x20000, 0xeff14c40, BRF_ESS | BRF_PRG }, // 1
{ "p02.b5", 0x10000, 0xc5a03186, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0x5b27adb6, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "p06srom5.bin", 0x40000, 0x3d2cbb0d, BRF_GRA }, // 4 Tiles
{ "p07srom6.bin", 0x40000, 0x0207949c, BRF_GRA }, // 5
{ "p08uor1.bin", 0x20000, 0x6811e7b6, BRF_GRA }, // 6 Sprites
{ "p09uor2.bin", 0x20000, 0x1c6549cf, BRF_GRA }, // 7
{ "p10uor3.bin", 0x20000, 0x6462e6e0, BRF_GRA }, // 8
{ "p11uor4.bin", 0x20000, 0x9c511d98, BRF_GRA }, // 9
{ "p01.c1", 0x20000, 0x18c06829, BRF_SND }, // 10 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11
};
STD_ROM_PICK(Htchctch)
STD_ROM_FN(Htchctch)
static struct BurnRomInfo CookbibRomDesc[] = {
{ "prg2.ub17", 0x20000, 0x2664a335, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "prg1.ub16", 0x20000, 0xcda6335f, BRF_ESS | BRF_PRG }, // 1
{ "prg-s.ub5", 0x10000, 0x547d6ea3, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0xa77d13f4, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "srom5.bin", 0x40000, 0x73a46e43, BRF_GRA }, // 4 Tiles
{ "srom6.bin", 0x40000, 0xade2dbec, BRF_GRA }, // 5
{ "uor1.bin", 0x20000, 0xa7d91f23, BRF_GRA }, // 6 Sprites
{ "uor2.bin", 0x20000, 0x9aacbec2, BRF_GRA }, // 7
{ "uor3.bin", 0x20000, 0x3fee0c3c, BRF_GRA }, // 8
{ "uor4.bin", 0x20000, 0xbed9ed2d, BRF_GRA }, // 9
{ "sound.uc1", 0x20000, 0x545e19b6, BRF_SND }, // 10 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11
};
STD_ROM_PICK(Cookbib)
STD_ROM_FN(Cookbib)
static struct BurnRomInfo ChokchokRomDesc[] = {
{ "ub17.bin", 0x40000, 0xecdb45ca, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "ub18.bin", 0x40000, 0xb183852a, BRF_ESS | BRF_PRG }, // 1
{ "ub5.bin", 0x10000, 0x30c2171d, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0x0bd39834, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "srom5.bin", 0x80000, 0x836608b8, BRF_GRA }, // 4 Tiles
{ "srom6.bin", 0x80000, 0x31d5715d, BRF_GRA }, // 5
{ "uor1.bin", 0x80000, 0xded6642a, BRF_GRA }, // 6 Sprites
{ "uor2.bin", 0x80000, 0x493f9516, BRF_GRA }, // 7
{ "uor3.bin", 0x80000, 0xe2dc3e12, BRF_GRA }, // 8
{ "uor4.bin", 0x80000, 0x6f377530, BRF_GRA }, // 9
{ "uc1.bin", 0x40000, 0xf3f57abd, BRF_SND }, // 10 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11
};
STD_ROM_PICK(Chokchok)
STD_ROM_FN(Chokchok)
static struct BurnRomInfo WlstarRomDesc[] = {
{ "n-4.u817", 0x40000, 0xfc3e829b, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "n-3.u818", 0x40000, 0xf01bc623, BRF_ESS | BRF_PRG }, // 1
{ "ua7", 0x10000, 0x90cafa5f, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0xb7ffde5b, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "5.srom5", 0x80000, 0xf7f8c859, BRF_GRA }, // 4 Tiles
{ "6.srom6", 0x80000, 0x34ace2a8, BRF_GRA }, // 5
{ "7.udr1", 0x80000, 0x6e47c31d, BRF_GRA }, // 6 Sprites
{ "8.udr2", 0x80000, 0x09c5d57c, BRF_GRA }, // 7
{ "9.udr3", 0x80000, 0x3ec064f0, BRF_GRA }, // 8
{ "10.udr4", 0x80000, 0xb4693cdd, BRF_GRA }, // 9
{ "ua1", 0x40000, 0xde217d30, BRF_SND }, // 10 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11
};
STD_ROM_PICK(Wlstar)
STD_ROM_FN(Wlstar)
static struct BurnRomInfo Wondl96RomDesc[] = {
{ "ub17.bin", 0x40000, 0x41d8e03c, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "ub18.bin", 0x40000, 0x0e4963af, BRF_ESS | BRF_PRG }, // 1
{ "ub5.bin", 0x10000, 0xd99d19c4, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0xd7578b1e, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "srom5.bin", 0x80000, 0xdb8010c3, BRF_GRA }, // 4 Tiles
{ "srom6.bin", 0x80000, 0x2f364e54, BRF_GRA }, // 5
{ "uor1.bin", 0x80000, 0xe1e9eebb, BRF_GRA }, // 6 Sprites
{ "uor2.bin", 0x80000, 0xddebfe83, BRF_GRA }, // 7
{ "uor3.bin", 0x80000, 0x7efe4d67, BRF_GRA }, // 8
{ "uor4.bin", 0x80000, 0x7b1596d1, BRF_GRA }, // 9
{ "uc1.bin", 0x40000, 0x0e7913e6, BRF_SND }, // 10 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11
};
STD_ROM_PICK(Wondl96)
STD_ROM_FN(Wondl96)
static struct BurnRomInfo FncywldRomDesc[] = {
{ "01_fw02.bin", 0x80000, 0xecb978c1, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "02_fw03.bin", 0x80000, 0x2d233b42, BRF_ESS | BRF_PRG }, // 1
{ "08_fw09.bin", 0x40000, 0xa4a00de9, BRF_GRA }, // 2 Tiles
{ "07_fw08.bin", 0x40000, 0xb48cd1d4, BRF_GRA }, // 3
{ "10_fw11.bin", 0x40000, 0xf21bab48, BRF_GRA }, // 4
{ "09_fw10.bin", 0x40000, 0x6aea8e0f, BRF_GRA }, // 5
{ "05_fw06.bin", 0x40000, 0xe141ecdc, BRF_GRA }, // 6 Sprites
{ "06_fw07.bin", 0x40000, 0x0058a812, BRF_GRA }, // 7
{ "03_fw04.bin", 0x40000, 0x6ad38c14, BRF_GRA }, // 8
{ "04_fw05.bin", 0x40000, 0xb8d079a6, BRF_GRA }, // 9
{ "00_fw01.bin", 0x40000, 0xb395fe01, BRF_SND }, // 10 Samples
};
STD_ROM_PICK(Fncywld)
STD_ROM_FN(Fncywld)
static struct BurnRomInfo SdfightRomDesc[] = {
{ "u817", 0x80000, 0x9f284f4d, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "u818", 0x80000, 0xa60e5b22, BRF_ESS | BRF_PRG }, // 1
{ "ua7", 0x10000, 0xc3d36da4, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0xefb8b822, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "9.ug11", 0x80000, 0xbf809ccd, BRF_GRA }, // 4 Tiles
{ "10.ug12", 0x80000, 0xa5a3bfa2, BRF_GRA }, // 5
{ "15.ui11", 0x80000, 0x3bc8aa6d, BRF_GRA }, // 6
{ "16.ui12", 0x80000, 0x71e6b78d, BRF_GRA }, // 7
{ "11.uk2", 0x80000, 0xd006fadc, BRF_GRA }, // 8 Sprites
{ "12.uk3", 0x80000, 0x2a2f4153, BRF_GRA }, // 9
{ "5.uj2", 0x80000, 0xf1246cbf, BRF_GRA }, // 10
{ "6.uj3", 0x80000, 0xd346878c, BRF_GRA }, // 11
{ "13.uk4", 0x80000, 0x9bc40774, BRF_GRA }, // 12
{ "14.uk5", 0x80000, 0xa1e61674, BRF_GRA }, // 13
{ "7.uj4", 0x80000, 0xdbdece8a, BRF_GRA }, // 14
{ "8.uj5", 0x80000, 0x60be7dd1, BRF_GRA }, // 15
{ "uc1", 0x40000, 0x535cae2c, BRF_SND }, // 16 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 17
};
STD_ROM_PICK(Sdfight)
STD_ROM_FN(Sdfight)
static struct BurnRomInfo BcstryRomDesc[] = {
{ "bcstry_u.62", 0x40000, 0x7f7aa244, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "bcstry_u.35", 0x40000, 0xd25b80a4, BRF_ESS | BRF_PRG }, // 1
{ "bcstry_u.21", 0x10000, 0x3ba072d4, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0xe84e328c, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "bcstry_u.109", 0x80000, 0xeb04d37a, BRF_GRA }, // 4 Tiles
{ "bcstry_u.113", 0x80000, 0x746ecdd7, BRF_GRA }, // 5
{ "bcstry_u.110", 0x80000, 0x1bfe65c3, BRF_GRA }, // 6
{ "bcstry_u.111", 0x80000, 0xc8bf3a3c, BRF_GRA }, // 7
{ "bcstry_u.100", 0x80000, 0x8c11cbed, BRF_GRA }, // 8 Sprites
{ "bcstry_u.106", 0x80000, 0x5219bcbf, BRF_GRA }, // 9
{ "bcstry_u.99", 0x80000, 0xcdb1af87, BRF_GRA }, // 10
{ "bcstry_u.105", 0x80000, 0x8166b596, BRF_GRA }, // 11
{ "bcstry_u.104", 0x80000, 0x377c0c71, BRF_GRA }, // 12
{ "bcstry_u.108", 0x80000, 0x442307ed, BRF_GRA }, // 13
{ "bcstry_u.102", 0x80000, 0x71b40ece, BRF_GRA }, // 14
{ "bcstry_u.107", 0x80000, 0xab3c923a, BRF_GRA }, // 15
{ "bcstry_u.64", 0x40000, 0x23f0e0fe, BRF_SND }, // 16 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 17
};
STD_ROM_PICK(Bcstry)
STD_ROM_FN(Bcstry)
static struct BurnRomInfo BcstryaRomDesc[] = {
{ "prg2.ic62", 0x40000, 0xf54c0a96, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "prg1.ic35", 0x40000, 0x2c55100a, BRF_ESS | BRF_PRG }, // 1
{ "bcstry_u.21", 0x10000, 0x3ba072d4, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0xe84e328c, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "bcstry_u.109", 0x80000, 0xeb04d37a, BRF_GRA }, // 4 Tiles
{ "bcstry_u.113", 0x80000, 0x746ecdd7, BRF_GRA }, // 5
{ "bcstry_u.110", 0x80000, 0x1bfe65c3, BRF_GRA }, // 6
{ "bcstry_u.111", 0x80000, 0xc8bf3a3c, BRF_GRA }, // 7
{ "bcstry_u.100", 0x80000, 0x8c11cbed, BRF_GRA }, // 8 Sprites
{ "bcstry_u.106", 0x80000, 0x5219bcbf, BRF_GRA }, // 9
{ "bcstry_u.99", 0x80000, 0xcdb1af87, BRF_GRA }, // 10
{ "bcstry_u.105", 0x80000, 0x8166b596, BRF_GRA }, // 11
{ "bcstry_u.104", 0x80000, 0x377c0c71, BRF_GRA }, // 12
{ "bcstry_u.108", 0x80000, 0x442307ed, BRF_GRA }, // 13
{ "bcstry_u.102", 0x80000, 0x71b40ece, BRF_GRA }, // 14
{ "bcstry_u.107", 0x80000, 0xab3c923a, BRF_GRA }, // 15
{ "bcstry_u.64", 0x40000, 0x23f0e0fe, BRF_SND }, // 16 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 17
};
STD_ROM_PICK(Bcstrya)
STD_ROM_FN(Bcstrya)
static struct BurnRomInfo SemibaseRomDesc[] = {
{ "ic62.68k", 0x40000, 0x85ea81c3, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "ic35.68k", 0x40000, 0xd2249605, BRF_ESS | BRF_PRG }, // 1
{ "ic21.z80", 0x10000, 0xd95c64d0, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0xecbf2163, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "ic109.gfx", 0x80000, 0x2b86e983, BRF_GRA }, // 4 Tiles
{ "ic113.gfx", 0x80000, 0xe39b6610, BRF_GRA }, // 5
{ "ic110.gfx", 0x80000, 0xbba4a015, BRF_GRA }, // 6
{ "ic111.gfx", 0x80000, 0x61133b63, BRF_GRA }, // 7
{ "ic100.gfx", 0x80000, 0x01c3d12a, BRF_GRA }, // 8 Sprites
{ "ic106.gfx", 0x80000, 0xdb282ac2, BRF_GRA }, // 9
{ "ic99.gfx", 0x80000, 0x349df821, BRF_GRA }, // 10
{ "ic105.gfx", 0x80000, 0xf7caa81c, BRF_GRA }, // 11
{ "ic104.gfx", 0x80000, 0x51a5d38a, BRF_GRA }, // 12
{ "ic108.gfx", 0x80000, 0xb253d60e, BRF_GRA }, // 13
{ "ic102.gfx", 0x80000, 0x3caefe97, BRF_GRA }, // 14
{ "ic107.gfx", 0x80000, 0x68109898, BRF_GRA }, // 15
{ "ic64.snd", 0x40000, 0x8a60649c, BRF_SND }, // 16 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 17
};
STD_ROM_PICK(Semibase)
STD_ROM_FN(Semibase)
static struct BurnRomInfo DquizgoRomDesc[] = {
{ "ub17", 0x80000, 0x0b96ab14, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "ub18", 0x80000, 0x07f869f2, BRF_ESS | BRF_PRG }, // 1
{ "ub5", 0x10000, 0xe40481da, BRF_ESS | BRF_PRG }, // 2 Z80 Program Code
{ "protdata.bin", 0x00200, 0x6064b9e0, BRF_ESS | BRF_PRG }, // 3 Shared RAM Data
{ "srom5", 0x80000, 0xf1cdd21d, BRF_GRA }, // 4 Tiles
{ "srom6", 0x80000, 0xf848939e, BRF_GRA }, // 5
{ "uor1", 0x80000, 0xb4912bf6, BRF_GRA }, // 6 Sprites
{ "uor2", 0x80000, 0xb011cf93, BRF_GRA }, // 7
{ "uor3", 0x80000, 0xd96c3582, BRF_GRA }, // 8
{ "uor4", 0x80000, 0x77ff23eb, BRF_GRA }, // 9
{ "uc1", 0x40000, 0xd0f4c4ba, BRF_SND }, // 10 Samples
{ "87c52.mcu", 0x10000, 0x00000000, BRF_NODUMP }, // 11
};
STD_ROM_PICK(Dquizgo)
STD_ROM_FN(Dquizgo)
static struct BurnRomInfo JumppopRomDesc[] = {
{ "68k_prg.bin", 0x080000, 0x123536b9, BRF_ESS | BRF_PRG }, // 0 68000 Program Code
{ "z80_prg.bin", 0x040000, 0xa88d4424, BRF_ESS | BRF_PRG }, // 1 Z80 Program Code
{ "bg0.bin", 0x100000, 0x35a1363d, BRF_GRA }, // 2 Tiles
{ "bg1.bin", 0x100000, 0x5b37f943, BRF_GRA }, // 3
{ "sp0.bin", 0x100000, 0x7c5d0633, BRF_GRA }, // 4 Sprites
{ "sp1.bin", 0x100000, 0x7eae782e, BRF_GRA }, // 5
{ "samples.bin", 0x040000, 0x066f30a7, BRF_SND }, // 6 Samples
};
STD_ROM_PICK(Jumppop)
STD_ROM_FN(Jumppop)
static int MemIndex()
{
unsigned char *Next; Next = Mem;
Drv68KRom = Next; Next += 0x100000;
if (DrvHasZ80)DrvZ80Rom = Next; Next += 0x010000;
if (DrvHasProt) DrvProtData = Next; Next += 0x000200;
MSM6295ROM = Next; Next += 0x040000;
DrvMSM6295ROMSrc = Next; Next += 0x100000;
RamStart = Next;
Drv68KRam = Next; Next += 0x010800;
if (DrvHasZ80)DrvZ80Ram = Next; Next += 0x000800;
DrvSpriteRam = Next; Next += DrvSpriteRamSize;
DrvPf1Ram = Next; Next += 0x002000;
DrvPf2Ram = Next; Next += 0x002000;
DrvPaletteRam = Next; Next += 0x001000;
DrvControl = (UINT16*)Next; Next += 8 * sizeof(UINT16);
RamEnd = Next;
DrvChars = Next; Next += DrvNumChars * 8 * 8;
DrvTiles = Next; Next += DrvNumTiles * 16 * 16;
DrvSprites = Next; Next += DrvNumSprites * 16 * 16;
DrvPalette = (unsigned int*)Next; Next += 0x00800 * sizeof(unsigned int);
MemEnd = Next;
return 0;
}
static int JumppopMemIndex()
{
unsigned char *Next; Next = Mem;
Drv68KRom = Next; Next += 0x080000;
DrvZ80Rom = Next; Next += 0x040000;
MSM6295ROM = Next; Next += 0x040000;
RamStart = Next;
Drv68KRam = Next; Next += 0x0c0000;
DrvZ80Ram = Next; Next += 0x000800;
DrvSpriteRam = Next; Next += DrvSpriteRamSize;
DrvPf1Ram = Next; Next += 0x004000;
DrvPf2Ram = Next; Next += 0x004000;
DrvPaletteRam = Next; Next += 0x000800;
DrvControl = (UINT16*)Next; Next += 8 * sizeof(UINT16);
RamEnd = Next;
DrvChars = Next; Next += DrvNumChars * 8 * 8;
DrvTiles = Next; Next += DrvNumTiles * 16 * 16;
DrvSprites = Next; Next += DrvNumSprites * 16 * 16;
DrvPalette = (unsigned int*)Next; Next += 0x00400 * sizeof(unsigned int);
MemEnd = Next;
return 0;
}
static int DrvDoReset()
{
if (DrvHasProt == 1) memcpy(Drv68KRam + 0x000, DrvProtData, 0x200);
if (DrvHasProt == 2) memcpy(Drv68KRam + 0x200, DrvProtData, 0x200);
SekOpen(0);
SekReset();
SekClose();
if (DrvHasZ80) {
ZetOpen(0);
ZetReset();
ZetClose();
}
if (DrvHasYM2151) BurnYM2151Reset();
if (DrvHasYM3812) BurnYM3812Reset();
MSM6295Reset(0);
DrvVBlank = 0;
DrvOkiBank = 0;
DrvTileBank = 0;
DrvSoundLatch = 0;
Tumbleb2MusicCommand = 0;
Tumbleb2MusicBank = 0;
Tumbleb2MusicIsPlaying = 0;
memset(DrvControl, 0, 8);
return 0;
}
static const int Tumbleb2SoundLookup[256] = {
/*0 1 2 3 4 5 6 7 8 9 a b c d e f*/
0x00, -2, 0x00, 0x00, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, 0x00, -2, /* 0 */
-2, 0x00, -2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, /* 2 */
0x19, 0x00, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 3 */
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, /* 4 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 5 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 6 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 7 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* e */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* f */
};
static void Tumbleb2PlayMusic()
{
int Status = MSM6295ReadStatus(0);
if (Tumbleb2MusicIsPlaying)
{
if ((Status & 0x08) == 0) {
MSM6295Command(0, 0x80 | Tumbleb2MusicCommand);
MSM6295Command(0, 0x00 | 0x82);
}
}
}
static void Tumbleb2SetMusicBank(int Bank)
{
memcpy(MSM6295ROM + 0x38000, DrvMSM6295ROMSrc + 0x38000 + (Bank * 0x8000), 0x8000);
}
static void Tumbleb2PlaySound(UINT16 data)
{
int Status = MSM6295ReadStatus(0);
if ((Status & 0x01) == 0) {
MSM6295Command(0, 0x80 | data);
MSM6295Command(0, 0x00 | 0x12);
} else {
if ((Status & 0x02) == 0) {
MSM6295Command(0, 0x80 | data);
MSM6295Command(0, 0x00 | 0x22);
} else {
if ((Status & 0x04) == 0) {
MSM6295Command(0, 0x80 | data);
MSM6295Command(0, 0x00 | 0x42);
}
}
}
}
static void Tumbleb2ProcessMusicCommand(UINT16 data)
{
int Status = MSM6295ReadStatus(0);
if (data == 1) {
if ((Status & 0x08) == 0x08) {
MSM6295Command(0, 0x40);
Tumbleb2MusicIsPlaying = 0;
}
} else {
if (Tumbleb2MusicIsPlaying != data) {
Tumbleb2MusicIsPlaying = data;
MSM6295Command(0, 0x40);
switch (data) {
case 0x04: // map screen
Tumbleb2MusicBank = 1;
Tumbleb2MusicCommand = 0x38;
break;
case 0x05: // america
Tumbleb2MusicBank = 6;
Tumbleb2MusicCommand = 0x38;
break;
case 0x06: // asia
Tumbleb2MusicBank = 2;
Tumbleb2MusicCommand = 0x38;
break;
case 0x07: // africa/egypt -- don't seem to have a tune for this one
Tumbleb2MusicBank = 4;
Tumbleb2MusicCommand = 0x38;
break;
case 0x08: // antartica
Tumbleb2MusicBank = 3;
Tumbleb2MusicCommand = 0x38;
break;
case 0x09: // brazil / south america
Tumbleb2MusicBank = 4;
Tumbleb2MusicCommand = 0x38;
break;
case 0x0a: // japan -- don't seem to have a tune
Tumbleb2MusicBank = 2;
Tumbleb2MusicCommand = 0x38;
break;
case 0x0b: // australia
Tumbleb2MusicBank = 5;
Tumbleb2MusicCommand = 0x38;
break;
case 0x0c: // france/europe
Tumbleb2MusicBank = 6;
Tumbleb2MusicCommand = 0x38;
break;
case 0x0d: // how to play
Tumbleb2MusicBank = 7;
Tumbleb2MusicCommand = 0x38;
break;
case 0x0f: // stage clear
Tumbleb2MusicBank = 0;
Tumbleb2MusicCommand = 0x33;
break;
case 0x10: // boss stage
Tumbleb2MusicBank = 8;
Tumbleb2MusicCommand = 0x38;
break;
case 0x12: // world clear
Tumbleb2MusicBank = 0;
Tumbleb2MusicCommand = 0x34;
break;
default: // anything else..
Tumbleb2MusicBank = 8;
Tumbleb2MusicCommand = 0x38;
break;
}
Tumbleb2SetMusicBank(Tumbleb2MusicBank);
Tumbleb2PlayMusic();
}
}
}
static void Tumbleb2SoundMCUCommand(UINT16 data)
{
int Sound = Tumbleb2SoundLookup[data & 0xff];
if (Sound == 0) {
} else {
if (Sound == -2) {
Tumbleb2ProcessMusicCommand(data);
} else {
Tumbleb2PlaySound(Sound);
}
}
}
unsigned char __fastcall Tumbleb68KReadByte(unsigned int a)
{
switch (a) {
case 0x100001: {
return ~0;
}
case 0x180002: {
return DrvDip[1];
}
case 0x180003: {
return DrvDip[0];
}
case 0x180009: {
if (Semibase) return 0xff - DrvInput[2];
if (DrvVBlank) {
if (Wondl96) {
return 0xf3 - DrvInput[2];
} else {
return 0xf7 - DrvInput[2];
}
}
if (Wondl96) return 0xfb - DrvInput[2];
return 0xff - DrvInput[2];
}
#if 0
case 0x18000a: {
return 0;
}
default: {
bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a);
}
#endif
}
return 0;
}
void __fastcall Tumbleb68KWriteByte(unsigned int a, unsigned char d)
{
switch (a) {
case 0x100000: {
if (Tumbleb2) {
Tumbleb2SoundMCUCommand(d);
return;
} else {
MSM6295Command(0, d);
return;
}
}
case 0x100001: {
if (SemicomSoundCommand) DrvSoundLatch = d;
return;
}
case 0x100002: {
if (Chokchok) DrvTileBank = (d << 8) << 1;
if (Bcstry) DrvTileBank = d << 8;
return;
}
#if 0
case 0x100003: {
return;
}
default: {
bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d);
}
#endif
}
}
unsigned short __fastcall Tumbleb68KReadWord(unsigned int a)
{
switch (a) {
case 0x100004: {
return rand() % 0x10000;
}
case 0x180000: {
return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]);
}
case 0x180002: {
return (DrvDip[1] << 8) | DrvDip[0];
}
case 0x180004:
case 0x180006:
return -0;
case 0x180008: {
if (Bcstry && (SekGetPC(0) == 0x560)) {
return 0x1a0;
} else {
if (Semibase) return 0xffff - DrvInput[2];
if (DrvVBlank) {
if (Wondl96) {
return 0xfff3 - DrvInput[2];
} else {
return 0xfff7 - DrvInput[2];
}
}
}
if (Wondl96) return 0xfff3 - DrvInput[2];
return 0xffff - DrvInput[2];
}
#if 0
case 0x18000a: {
return 0;
}
case 0x18000c: {
return 0;
}
case 0x18000e: {
return -0;
}
default: {
bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a);
}
#endif
}
return 0;
}
void __fastcall Tumbleb68KWriteWord(unsigned int a, unsigned short d)
{
#if 1 && defined FBA_DEBUG
if (a >= 0x160800 && a <= 0x160807) return;
if (a >= 0x198000 && a <= 0x1a8015) return;
if (a >= 0x321000 && a <= 0x321fff) return;
if (a >= 0x323000 && a <= 0x331fff) return;
if (a >= 0x340000 && a <= 0x3401ff) return;
if (a >= 0x340400 && a <= 0x34047f) return;
if (a >= 0x342000 && a <= 0x3421ff) return;
if (a >= 0x342400 && a <= 0x34247f) return;
#endif
if (a >= 0x300000 && a <= 0x30000f) {
DrvControl[(a - 0x300000) >> 1] = d;
return;
}
switch (a) {
case 0x100000: {
if (Tumbleb2) {
Tumbleb2SoundMCUCommand(d);
return;
} else {
if (Jumpkids) {
DrvSoundLatch = d & 0xff;
ZetOpen(0);
ZetRaiseIrq(0);
ZetClose();
return;
} else {
if (SemicomSoundCommand) {
if (d & 0xff) DrvSoundLatch = d & 0xff;
return;
} else {
MSM6295Command(0, d & 0xff);
return;
}
}
}
}
case 0x100002: {
if (Wlstar) DrvTileBank = d & 0x4000;
return;
}
#if 0
case 0x18000c: {
return;
}
default: {
bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d);
}
#endif
}
}
unsigned short __fastcall Suprtrio68KReadWord(unsigned int a)
{
switch (a) {
case 0xe00000: {
return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]);
}
case 0xe40000: {
return 0xffff - DrvInput[2];
}
case 0xe80002: {
return 0xff00 | DrvDip[0];
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a);
}
#endif
}
return 0;
}
void __fastcall Suprtrio68KWriteWord(unsigned int a, unsigned short d)
{
if (a >= 0xa00000 && a <= 0xa0000f) {
DrvControl[(a - 0xa00000) >> 1] = d;
return;
}
switch (a) {
case 0xe00000: {
DrvTileBank = d << 14;
return;
}
case 0xec0000: {
if (SemicomSoundCommand) {
if (d & 0xff) DrvSoundLatch = d & 0xff;
}
return;
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d);
}
#endif
}
}
unsigned char __fastcall Fncywld68KReadByte(unsigned int a)
{
switch (a) {
#if 0
case 0x100003: {
return 0;
}
#endif
case 0x100005: {
return MSM6295ReadStatus(0);
}
case 0x180002: {
return DrvDip[1];
}
#if 0
case 0x180005: {
return -0;
}
#endif
case 0x180009: {
if (DrvVBlank) return 0xf7 - DrvInput[2];
return 0xff - DrvInput[2];
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("68K Read byte => %06X\n"), a);
}
#endif
}
return 0;
}
void __fastcall Fncywld68KWriteByte(unsigned int a, unsigned char d)
{
switch (a) {
case 0x100001: {
BurnYM2151SelectRegister(d);
return;
}
case 0x100003: {
BurnYM2151WriteRegister(d);
return;
}
case 0x100005: {
MSM6295Command(0, d);
return;
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("68K Write byte => %06X, %02X\n"), a, d);
}
#endif
}
}
unsigned short __fastcall Fncywld68KReadWord(unsigned int a)
{
switch (a) {
case 0x180000: {
return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]);
}
case 0x180002: {
return (DrvDip[1] << 8) | DrvDip[0];
}
case 0x180004:
case 0x18000e:
case 0x180006:
return -0;
case 0x180008: {
if (DrvVBlank) return 0xfff7 - DrvInput[2];
return 0xffff - DrvInput[2];
}
#if 0
case 0x18000a: {
return 0;
}
case 0x18000c: {
return 0;
}
default: {
bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a);
}
#endif
}
return 0;
}
void __fastcall Fncywld68KWriteWord(unsigned int a, unsigned short d)
{
if (a >= 0x160800 && a <= 0x160807) return;
if (a >= 0x300000 && a <= 0x30000f) {
DrvControl[(a - 0x300000) >> 1] = d;
return;
}
switch (a) {
case 0x100000: {
BurnYM2151SelectRegister(d);
return;
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d);
}
#endif
}
}
unsigned short __fastcall Jumppop68KReadWord(unsigned int a)
{
switch (a) {
case 0x180002: {
return ((0xff - DrvInput[1]) << 8) | (0xff - DrvInput[0]);
}
case 0x180004: {
return 0xffff - DrvInput[2];
}
case 0x180006: {
return (DrvDip[1] << 8) | DrvDip[0];
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("68K Read word => %06X\n"), a);
}
#endif
}
return 0;
}
void __fastcall Jumppop68KWriteWord(unsigned int a, unsigned short d)
{
if (a >= 0x380000 && a <= 0x38000f) {
DrvControl[(a - 0x380000) >> 1] = d;
return;
}
switch (a) {
#if 0
case 0x180000: {
// NOP
return;
}
#endif
case 0x18000c: {
DrvSoundLatch = d & 0xff;
//bprintf(PRINT_NORMAL, _T("Latch Sent -> %02X\n"), DrvSoundLatch);
ZetOpen(0);
ZetRaiseIrq(0);
nCyclesDone[1] += ZetRun(100);
ZetClose();
return;
}
#if 0
case 0x180008:
case 0x18000a: {
return;
}
default: {
bprintf(PRINT_NORMAL, _T("68K Write word => %06X, %04X\n"), a, d);
}
#endif
}
}
unsigned char __fastcall JumpkidsZ80Read(unsigned short a)
{
switch (a) {
case 0x9800: {
return MSM6295ReadStatus(0);
}
case 0xa000: {
return DrvSoundLatch;
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a);
}
#endif
}
return 0;
}
void __fastcall JumpkidsZ80Write(unsigned short a, unsigned char d)
{
switch (a) {
case 0x9000: {
DrvOkiBank = d & 3;
memcpy(MSM6295ROM + 0x20000, DrvMSM6295ROMSrc + (DrvOkiBank * 0x20000), 0x20000);
return;
}
case 0x9800: {
MSM6295Command(0, d);
return;
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d);
}
#endif
}
}
unsigned char __fastcall SemicomZ80Read(unsigned short a)
{
switch (a) {
case 0xf001: {
return BurnYM2151ReadStatus();
}
case 0xf002: {
return MSM6295ReadStatus(0);
}
case 0xf008: {
return DrvSoundLatch;
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("Z80 Read => %04X\n"), a);
}
#endif
}
return 0;
}
void __fastcall SemicomZ80Write(unsigned short a, unsigned char d)
{
switch (a) {
case 0xf000: {
BurnYM2151SelectRegister(d);
return;
}
case 0xf001: {
BurnYM2151WriteRegister(d);
return;
}
case 0xf002: {
MSM6295Command(0, d);
return;
}
#if 0
case 0xf006: {
return;
}
#endif
case 0xf00e: {
DrvOkiBank = d;
memcpy(MSM6295ROM + 0x30000, DrvMSM6295ROMSrc + 0x30000 + (DrvOkiBank * 0x10000), 0x10000);
return;
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("Z80 Write => %04X, %02X\n"), a, d);
}
#endif
}
}
unsigned char __fastcall JumppopZ80PortRead(unsigned short a)
{
a &= 0xff;
switch (a) {
case 0x02: {
return MSM6295ReadStatus(0);
}
case 0x03: {
//bprintf(PRINT_IMPORTANT, _T("Latch Read %02X\n"), DrvSoundLatch);
ZetLowerIrq(0);
return DrvSoundLatch;
}
#if 0
case 0x06: {
// NOP
return 0;
}
default: {
bprintf(PRINT_NORMAL, _T("Z80 Port Read -> %02X\n"), a);
}
#endif
}
return 0;
}
void __fastcall JumppopZ80PortWrite(unsigned short a, unsigned char d)
{
a &= 0xff;
switch (a) {
case 0x00: {
BurnYM3812Write(0, d);
return;
}
case 0x01: {
BurnYM3812Write(1, d);
return;
}
case 0x02: {
MSM6295Command(0, d);
return;
}
#if 0
case 0x04: {
// NOP
return;
}
#endif
case 0x05: {
//memory_set_bankptr(1, memory_region(REGION_CPU2) + 0x10000 + (0x4000 * data));
DrvZ80Bank = d;
ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + (DrvZ80Bank * 0x4000));
ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + (DrvZ80Bank * 0x4000));
return;
}
#if 0
default: {
bprintf(PRINT_NORMAL, _T("Z80 Port Write -> %02X, %02x\n"), a, d);
}
#endif
}
}
static int CharPlaneOffsets[4] = { 0x200008, 0x200000, 8, 0 };
static int CharXOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
static int CharYOffsets[8] = { 0, 16, 32, 48, 64, 80, 96, 112 };
static int SpritePlaneOffsets[4] = { 0x400008, 0x400000, 8, 0 };
static int Sprite2PlaneOffsets[4] = { 0x800008, 0x800000, 8, 0 };
static int Sprite3PlaneOffsets[4] = { 0x1000008, 0x1000000, 8, 0 };
static int SpriteXOffsets[16] = { 256, 257, 258, 259, 260, 261, 262, 263, 0, 1, 2, 3, 4, 5, 6, 7 };
static int SpriteYOffsets[16] = { 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240 };
static int SuprtrioPlaneOffsets[4] = { 0x400000, 0, 0x600000, 0x200000 };
static int SuprtrioXOffsets[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 135 };
static int SuprtrioYOffsets[16] = { 8, 0, 16, 24, 40, 32, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 };
static int JpCharPlaneOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
static int JpCharXOffsets[8] = { 0x800000, 0x800008, 0, 8, 0x800010, 0x800018, 16, 24 };
static int JpCharYOffsets[8] = { 0, 32, 64, 96, 128, 160, 192, 224 };
static int JpTilePlaneOffsets[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
static int JpTileXOffsets[16] = { 0x800000, 0x800008, 0, 8, 0x800010, 0x800018, 16, 24, 0x800100, 0x800108, 256, 264, 0x800110, 0x800118, 272, 280 };
static int JpTileYOffsets[16] = { 0, 32, 64, 96, 128, 160, 192, 224, 512, 544, 576, 608, 640, 672, 704, 736 };
static void TumblebTilesRearrange()
{
UINT8 *rom = DrvTempRom;
int len = DrvNumTiles * 128;
int i;
/* gfx data is in the wrong order */
for (i = 0;i < len;i++)
{
if ((i & 0x20) == 0)
{
int t = rom[i]; rom[i] = rom[i + 0x20]; rom[i + 0x20] = t;
}
}
/* low/high half are also swapped */
for (i = 0;i < len/2;i++)
{
int t = rom[i]; rom[i] = rom[i + len/2]; rom[i + len/2] = t;
}
}
static int TumblebLoadRoms()
{
int nRet = 0;
DrvTempRom = (unsigned char *)malloc(0x100000);
// Load 68000 Program Roms
nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1;
// Load and decode the tiles
nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 3, 2); if (nRet != 0) return 1;
TumblebTilesRearrange();
GfxDecode(DrvNumChars, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars);
GfxDecode(DrvNumTiles, 4, 16, 16, CharPlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x100000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 4, 1); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080000, 5, 1); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 6, 1); if (nRet != 0) return 1;
if (Tumbleb2) nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x80000, 6, 1); if (nRet != 0) return 1;
memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000);
free(DrvTempRom);
return 0;
}
static int JumpkidsLoadRoms()
{
int nRet = 0;
DrvTempRom = (unsigned char *)malloc(0x100000);
// Load 68000 Program Roms
nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1;
// Load Z80 Program Roms
nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1;
// Load and decode the tiles
nRet = BurnLoadRom(DrvTempRom + 0x000000, 3, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 4, 2); if (nRet != 0) return 1;
TumblebTilesRearrange();
GfxDecode(DrvNumChars, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars);
GfxDecode(DrvNumTiles, 4, 16, 16, CharPlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x100000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 6, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080000, 7, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080001, 8, 2); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 9, 1); if (nRet != 0) return 1;
nRet = BurnLoadRom(MSM6295ROM + 0x00000, 10, 1); if (nRet != 0) return 1;
free(DrvTempRom);
return 0;
}
static int MetlsavrLoadRoms()
{
int nRet = 0;
DrvTempRom = (unsigned char *)malloc(0x200000);
// Load 68000 Program Roms
nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1;
// Load Z80 Program Roms
nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1;
// Load Shared RAM data
nRet = BurnLoadRom(DrvProtData, 3, 1); if (nRet) return 1;
unsigned char *pTemp = (unsigned char*)malloc(0x200);
memcpy(pTemp, DrvProtData, 0x200);
for (int i = 0; i < 0x200; i+=2) {
DrvProtData[i + 0] = pTemp[i + 1];
DrvProtData[i + 1] = pTemp[i + 0];
}
free(pTemp);
// Load and decode the tiles
nRet = BurnLoadRom(DrvTempRom + 0x000001, 4, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 2); if (nRet != 0) return 1;
TumblebTilesRearrange();
GfxDecode(DrvNumChars, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars);
GfxDecode(DrvNumTiles, 4, 16, 16, CharPlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x200000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x100000, 8, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x100001, 9, 2); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(MSM6295ROM, 10, 1); if (nRet != 0) return 1;
free(DrvTempRom);
return 0;
}
static int PangpangLoadRoms()
{
int nRet = 0;
DrvTempRom = (unsigned char *)malloc(0x100000);
// Load 68000 Program Roms
nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1;
// Load and decode the tiles
nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 3, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080000, 4, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080001, 5, 2); if (nRet != 0) return 1;
unsigned char *pTemp = (unsigned char*)malloc(0x100000);
memcpy(pTemp, DrvTempRom, 0x100000);
memset(DrvTempRom, 0, 0x100000);
memcpy(DrvTempRom + 0x000000, pTemp + 0x000000, 0x40000);
memcpy(DrvTempRom + 0x080000, pTemp + 0x040000, 0x40000);
memcpy(DrvTempRom + 0x040000, pTemp + 0x080000, 0x40000);
memcpy(DrvTempRom + 0x0c0000, pTemp + 0x0c0000, 0x40000);
free(pTemp);
TumblebTilesRearrange();
GfxDecode(DrvNumChars, 4, 8, 8, SpritePlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars);
GfxDecode(DrvNumTiles, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x100000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080000, 8, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080001, 9, 2); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 10, 1); if (nRet != 0) return 1;
memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000);
free(DrvTempRom);
return 0;
}
static void SuprtrioDecrypt68KRom()
{
UINT16 *Rom = (UINT16*)Drv68KRom;
UINT16 *pTemp = (UINT16*)malloc(0x80000);
int i;
memcpy(pTemp, Rom, 0x80000);
for (i = 0; i < 0x40000; i++) {
int j = i ^ 0x06;
if ((i & 1) == 0) j ^= 0x02;
if ((i & 3) == 0) j ^= 0x08;
Rom[i] = pTemp[j];
}
free(pTemp);
}
static void SuprtrioDecryptTiles()
{
UINT16 *Rom = (UINT16*)DrvTempRom;
UINT16 *pTemp = (UINT16*)malloc(0x100000);
int i;
memcpy(pTemp, Rom, 0x100000);
for (i = 0; i < 0x80000; i++) {
int j = i ^ 0x02;
if (i & 1) j ^= 0x04;
Rom[i] = pTemp[j];
}
free(pTemp);
}
static int SuprtrioLoadRoms()
{
int nRet = 0;
DrvTempRom = (unsigned char *)malloc(0x100000);
// Load 68000 Program Roms
nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1;
SuprtrioDecrypt68KRom();
// Load Z80 Program Roms
nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1;
// Load and decode the tiles
nRet = BurnLoadRom(DrvTempRom + 0x000000, 3, 1); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080000, 4, 1); if (nRet != 0) return 1;
unsigned char *pTemp = (unsigned char*)malloc(0x100000);
memcpy(pTemp, DrvTempRom, 0x100000);
memset(DrvTempRom, 0, 0x100000);
memcpy(DrvTempRom + 0x000000, pTemp + 0x000000, 0x20000);
memcpy(DrvTempRom + 0x040000, pTemp + 0x020000, 0x20000);
memcpy(DrvTempRom + 0x020000, pTemp + 0x040000, 0x20000);
memcpy(DrvTempRom + 0x060000, pTemp + 0x060000, 0x20000);
memcpy(DrvTempRom + 0x080000, pTemp + 0x080000, 0x20000);
memcpy(DrvTempRom + 0x0c0000, pTemp + 0x0a0000, 0x20000);
memcpy(DrvTempRom + 0x0a0000, pTemp + 0x0c0000, 0x20000);
memcpy(DrvTempRom + 0x0e0000, pTemp + 0x0e0000, 0x20000);
free(pTemp);
SuprtrioDecryptTiles();
GfxDecode(DrvNumTiles, 4, 16, 16, SuprtrioPlaneOffsets, SuprtrioXOffsets, SuprtrioYOffsets, 0x100, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x100000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 6, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080000, 7, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080001, 8, 2); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x00000, 9, 1); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvMSM6295ROMSrc + 0x80000, 10, 1); if (nRet != 0) return 1;
memcpy(MSM6295ROM, DrvMSM6295ROMSrc, 0x40000);
free(DrvTempRom);
return 0;
}
static int HtchctchLoadRoms()
{
int nRet = 0;
DrvTempRom = (unsigned char *)malloc(0x100000);
// Load 68000 Program Roms
nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1;
// Load Z80 Program Roms
nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1;
// Load Shared RAM data
nRet = BurnLoadRom(DrvProtData, 3, 1); if (nRet) return 1;
unsigned char *pTemp = (unsigned char*)malloc(0x200);
memcpy(pTemp, DrvProtData, 0x200);
for (int i = 0; i < 0x200; i+=2) {
DrvProtData[i + 0] = pTemp[i + 1];
DrvProtData[i + 1] = pTemp[i + 0];
}
free(pTemp);
// Load and decode the tiles
nRet = BurnLoadRom(DrvTempRom + 0x000001, 4, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 2); if (nRet != 0) return 1;
TumblebTilesRearrange();
GfxDecode(DrvNumChars, 4, 8, 8, CharPlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars);
GfxDecode(DrvNumTiles, 4, 16, 16, CharPlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x100000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x040000, 8, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x040001, 9, 2); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, CharPlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(MSM6295ROM, 10, 1); if (nRet != 0) return 1;
free(DrvTempRom);
return 0;
}
static int ChokchokLoadRoms()
{
int nRet = 0;
DrvTempRom = (unsigned char *)malloc(0x200000);
// Load 68000 Program Roms
nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1;
// Load Z80 Program Roms
nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1;
// Load Shared RAM data
nRet = BurnLoadRom(DrvProtData, 3, 1); if (nRet) return 1;
unsigned char *pTemp = (unsigned char*)malloc(0x200);
memcpy(pTemp, DrvProtData, 0x200);
for (int i = 0; i < 0x200; i+=2) {
DrvProtData[i + 0] = pTemp[i + 1];
DrvProtData[i + 1] = pTemp[i + 0];
}
free(pTemp);
// Load and decode the tiles
nRet = BurnLoadRom(DrvTempRom + 0x000001, 4, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000000, 5, 2); if (nRet != 0) return 1;
pTemp = (unsigned char*)malloc(0x100000);
memcpy(pTemp, DrvTempRom, 0x100000);
memset(DrvTempRom, 0, 0x200000);
memcpy(DrvTempRom + 0x000000, pTemp + 0x000000, 0x40000);
memcpy(DrvTempRom + 0x100000, pTemp + 0x040000, 0x40000);
memcpy(DrvTempRom + 0x040000, pTemp + 0x080000, 0x40000);
memcpy(DrvTempRom + 0x140000, pTemp + 0x0c0000, 0x40000);
free(pTemp);
TumblebTilesRearrange();
GfxDecode(DrvNumChars, 4, 8, 8, Sprite2PlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars);
GfxDecode(DrvNumTiles, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x200000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x100000, 8, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x100001, 9, 2); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(MSM6295ROM, 10, 1); if (nRet != 0) return 1;
free(DrvTempRom);
return 0;
}
static int FncywldLoadRoms()
{
int nRet = 0;
DrvTempRom = (unsigned char *)malloc(0x100000);
// Load 68000 Program Roms
nRet = BurnLoadRom(Drv68KRom + 0x00001, 0, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(Drv68KRom + 0x00000, 1, 2); if (nRet != 0) return 1;
// Load and decode the tiles
nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 3, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080000, 4, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080001, 5, 2); if (nRet != 0) return 1;
TumblebTilesRearrange();
GfxDecode(DrvNumChars, 4, 8, 8, SpritePlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars);
GfxDecode(DrvNumTiles, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x100000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 6, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 7, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080000, 8, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x080001, 9, 2); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, SpritePlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(MSM6295ROM + 0x00000, 10, 1); if (nRet != 0) return 1;
free(DrvTempRom);
return 0;
}
static int SdfightLoadRoms()
{
int nRet = 0;
DrvTempRom = (unsigned char *)malloc(0x400000);
// Load 68000 Program Roms
nRet = BurnLoadRom(DrvTempRom + 0x00001, 0, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x00000, 1, 2); if (nRet != 0) return 1;
memcpy(Drv68KRom + 0xc0000, DrvTempRom + 0x00000, 0x40000);
memcpy(Drv68KRom + 0x80000, DrvTempRom + 0x40000, 0x40000);
memcpy(Drv68KRom + 0x40000, DrvTempRom + 0x80000, 0x40000);
memcpy(Drv68KRom + 0x00000, DrvTempRom + 0xc0000, 0x40000);
// Load Z80 Program Roms
nRet = BurnLoadRom(DrvZ80Rom, 2, 1); if (nRet != 0) return 1;
// Load Shared RAM data
memset(DrvTempRom, 0, 0x400000);
nRet = BurnLoadRom(DrvTempRom, 3, 1); if (nRet) return 1;
for (int i = 0; i < 0x200; i+=2) {
DrvProtData[i + 0] = DrvTempRom[i + 1];
DrvProtData[i + 1] = DrvTempRom[i + 0];
}
// Load and decode the tiles
memset(DrvTempRom, 0, 0x400000);
nRet = BurnLoadRom(DrvTempRom + 0x200001, 4, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x200000, 5, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x300001, 6, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x300000, 7, 2); if (nRet != 0) return 1;
memcpy(DrvTempRom + 0x000000, DrvTempRom + 0x200000, 0x40000);
memcpy(DrvTempRom + 0x100000, DrvTempRom + 0x240000, 0x40000);
memcpy(DrvTempRom + 0x040000, DrvTempRom + 0x280000, 0x40000);
memcpy(DrvTempRom + 0x140000, DrvTempRom + 0x2c0000, 0x40000);
memcpy(DrvTempRom + 0x080000, DrvTempRom + 0x300000, 0x40000);
memcpy(DrvTempRom + 0x180000, DrvTempRom + 0x340000, 0x40000);
memcpy(DrvTempRom + 0x0c0000, DrvTempRom + 0x380000, 0x40000);
memcpy(DrvTempRom + 0x1c0000, DrvTempRom + 0x3c0000, 0x40000);
TumblebTilesRearrange();
GfxDecode(DrvNumChars, 4, 8, 8, Sprite2PlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars);
GfxDecode(DrvNumTiles, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x200000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 8, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 9, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x100000, 10, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x100001, 11, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x200000, 12, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x200001, 13, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x300000, 14, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x300001, 15, 2); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, Sprite3PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(MSM6295ROM, 16, 1); if (nRet != 0) return 1;
free(DrvTempRom);
return 0;
}
static int BcstryLoadRoms()
{
int nRet = 0;
DrvTempRom = (unsigned char *)malloc(0x400000);
// Load 68000 Program Roms
nRet = BurnLoadRom(DrvTempRom + 0x00001, 0, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x00000, 1, 2); if (nRet != 0) return 1;
memcpy(Drv68KRom + 0x40000, DrvTempRom + 0x00000, 0x40000);
memcpy(Drv68KRom + 0x00000, DrvTempRom + 0x40000, 0x40000);
// Load Z80 Program Roms
memset(DrvTempRom, 0, 0x400000);
nRet = BurnLoadRom(DrvTempRom, 2, 1); if (nRet != 0) return 1;
memcpy(DrvZ80Rom + 0x04000, DrvTempRom + 0x00000, 0x04000);
memcpy(DrvZ80Rom + 0x00000, DrvTempRom + 0x04000, 0x04000);
memcpy(DrvZ80Rom + 0x0c000, DrvTempRom + 0x08000, 0x04000);
memcpy(DrvZ80Rom + 0x08000, DrvTempRom + 0x0c000, 0x04000);
// Load Shared RAM data
memset(DrvTempRom, 0, 0x400000);
nRet = BurnLoadRom(DrvTempRom, 3, 1); if (nRet) return 1;
for (int i = 0; i < 0x200; i+=2) {
DrvProtData[i + 0] = DrvTempRom[i + 1];
DrvProtData[i + 1] = DrvTempRom[i + 0];
}
// Load and decode the tiles
memset(DrvTempRom, 0, 0x400000);
nRet = BurnLoadRom(DrvTempRom + 0x200000, 4, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x200001, 5, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x300000, 6, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x300001, 7, 2); if (nRet != 0) return 1;
memcpy(DrvTempRom + 0x000000, DrvTempRom + 0x200000, 0x40000);
memcpy(DrvTempRom + 0x100000, DrvTempRom + 0x240000, 0x40000);
memcpy(DrvTempRom + 0x040000, DrvTempRom + 0x280000, 0x40000);
memcpy(DrvTempRom + 0x140000, DrvTempRom + 0x2c0000, 0x40000);
memcpy(DrvTempRom + 0x080000, DrvTempRom + 0x300000, 0x40000);
memcpy(DrvTempRom + 0x180000, DrvTempRom + 0x340000, 0x40000);
memcpy(DrvTempRom + 0x0c0000, DrvTempRom + 0x380000, 0x40000);
memcpy(DrvTempRom + 0x1c0000, DrvTempRom + 0x3c0000, 0x40000);
TumblebTilesRearrange();
GfxDecode(DrvNumChars, 4, 8, 8, Sprite2PlaneOffsets, CharXOffsets, CharYOffsets, 0x80, DrvTempRom, DrvChars);
GfxDecode(DrvNumTiles, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x200000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 8, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x000001, 9, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x100000, 10, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x100001, 11, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x200000, 12, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x200001, 13, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x300000, 14, 2); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x300001, 15, 2); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, Sprite3PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(MSM6295ROM, 16, 1); if (nRet != 0) return 1;
free(DrvTempRom);
return 0;
}
static void TumblebMap68k()
{
// Setup the 68000 emulation
SekInit(0, 0x68000);
SekOpen(0);
SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, SM_ROM);
SekMapMemory(Drv68KRam , 0x120000, 0x123fff, SM_RAM);
SekMapMemory(DrvPaletteRam , 0x140000, 0x1407ff, SM_RAM);
SekMapMemory(DrvSpriteRam , 0x160000, 0x1607ff, SM_RAM);
SekMapMemory(Drv68KRam + 0x4000 , 0x1a0000, 0x1a07ff, SM_RAM);
SekMapMemory(DrvPf1Ram , 0x320000, 0x320fff, SM_RAM);
SekMapMemory(DrvPf2Ram , 0x322000, 0x322fff, SM_RAM);
SekSetReadWordHandler(0, Tumbleb68KReadWord);
SekSetWriteWordHandler(0, Tumbleb68KWriteWord);
SekSetReadByteHandler(0, Tumbleb68KReadByte);
SekSetWriteByteHandler(0, Tumbleb68KWriteByte);
SekClose();
}
static void PangpangMap68k()
{
// Setup the 68000 emulation
SekInit(0, 0x68000);
SekOpen(0);
SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, SM_ROM);
SekMapMemory(Drv68KRam , 0x120000, 0x123fff, SM_RAM);
SekMapMemory(DrvPaletteRam , 0x140000, 0x1407ff, SM_RAM);
SekMapMemory(DrvSpriteRam , 0x160000, 0x1607ff, SM_RAM);
SekMapMemory(Drv68KRam + 0x4000 , 0x1a0000, 0x1a07ff, SM_RAM);
SekMapMemory(DrvPf1Ram , 0x320000, 0x321fff, SM_RAM);
SekMapMemory(DrvPf2Ram , 0x340000, 0x341fff, SM_RAM);
SekSetReadWordHandler(0, Tumbleb68KReadWord);
SekSetWriteWordHandler(0, Tumbleb68KWriteWord);
SekSetReadByteHandler(0, Tumbleb68KReadByte);
SekSetWriteByteHandler(0, Tumbleb68KWriteByte);
SekClose();
}
static void SuprtrioMap68k()
{
// Setup the 68000 emulation
SekInit(0, 0x68000);
SekOpen(0);
SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, SM_ROM);
SekMapMemory(DrvSpriteRam , 0x700000, 0x7007ff, SM_RAM);
SekMapMemory(DrvPf1Ram , 0xa20000, 0xa20fff, SM_RAM);
SekMapMemory(DrvPf2Ram , 0xa22000, 0xa22fff, SM_RAM);
SekMapMemory(DrvPaletteRam , 0xcf0000, 0xcf05ff, SM_RAM);
SekMapMemory(Drv68KRam , 0xf00000, 0xf07fff, SM_RAM);
SekSetReadWordHandler(0, Suprtrio68KReadWord);
SekSetWriteWordHandler(0, Suprtrio68KWriteWord);
SekClose();
}
static void HtchctchMap68k()
{
// Setup the 68000 emulation
SekInit(0, 0x68000);
SekOpen(0);
SekMapMemory(Drv68KRom , 0x000000, 0x0fffff, SM_ROM);
SekMapMemory(Drv68KRam , 0x120000, 0x123fff, SM_RAM);
SekMapMemory(DrvPaletteRam , 0x140000, 0x1407ff, SM_RAM);
SekMapMemory(DrvSpriteRam , 0x160000, 0x160fff, SM_RAM);
SekMapMemory(Drv68KRam + 0x4000 , 0x1a0000, 0x1a0fff, SM_RAM);
SekMapMemory(DrvPf1Ram , 0x320000, 0x321fff, SM_RAM);
SekMapMemory(DrvPf2Ram , 0x322000, 0x322fff, SM_RAM);
SekMapMemory(Drv68KRam + 0x5000 , 0x341000, 0x342fff, SM_RAM);
SekSetReadWordHandler(0, Tumbleb68KReadWord);
SekSetWriteWordHandler(0, Tumbleb68KWriteWord);
SekSetReadByteHandler(0, Tumbleb68KReadByte);
SekSetWriteByteHandler(0, Tumbleb68KWriteByte);
SekClose();
}
static void FncywldMap68k()
{
// Setup the 68000 emulation
SekInit(0, 0x68000);
SekOpen(0);
SekMapMemory(Drv68KRom , 0x000000, 0x0fffff, SM_ROM);
SekMapMemory(DrvPaletteRam , 0x140000, 0x140fff, SM_RAM);
SekMapMemory(DrvSpriteRam , 0x160000, 0x1607ff, SM_RAM);
SekMapMemory(DrvPf1Ram , 0x320000, 0x321fff, SM_RAM);
SekMapMemory(DrvPf2Ram , 0x322000, 0x323fff, SM_RAM);
SekMapMemory(Drv68KRam , 0xff0000, 0xffffff, SM_RAM);
SekSetReadWordHandler(0, Fncywld68KReadWord);
SekSetWriteWordHandler(0, Fncywld68KWriteWord);
SekSetReadByteHandler(0, Fncywld68KReadByte);
SekSetWriteByteHandler(0, Fncywld68KWriteByte);
SekClose();
}
static void JumpkidsMapZ80()
{
// Setup the Z80 emulation
ZetInit(1);
ZetOpen(0);
ZetSetReadHandler(JumpkidsZ80Read);
ZetSetWriteHandler(JumpkidsZ80Write);
ZetMapArea(0x0000, 0x7fff, 0, DrvZ80Rom );
ZetMapArea(0x0000, 0x7fff, 2, DrvZ80Rom );
ZetMapArea(0x8000, 0x87ff, 0, DrvZ80Ram );
ZetMapArea(0x8000, 0x87ff, 1, DrvZ80Ram );
ZetMapArea(0x8000, 0x87ff, 2, DrvZ80Ram );
ZetMemEnd();
ZetClose();
}
static void SemicomMapZ80()
{
// Setup the Z80 emulation
ZetInit(1);
ZetOpen(0);
ZetSetReadHandler(SemicomZ80Read);
ZetSetWriteHandler(SemicomZ80Write);
ZetMapArea(0x0000, 0xcfff, 0, DrvZ80Rom );
ZetMapArea(0x0000, 0xcfff, 2, DrvZ80Rom );
ZetMapArea(0xd000, 0xd7ff, 0, DrvZ80Ram );
ZetMapArea(0xd000, 0xd7ff, 1, DrvZ80Ram );
ZetMapArea(0xd000, 0xd7ff, 2, DrvZ80Ram );
ZetMemEnd();
ZetClose();
}
void SemicomYM2151IrqHandler(int Irq)
{
if (Irq) {
ZetSetIRQLine(0xff, ZET_IRQSTATUS_ACK);
} else {
ZetSetIRQLine(0, ZET_IRQSTATUS_NONE);
}
}
static int DrvInit(bool bReset, int SpriteRamSize, int SpriteMask, int SpriteXOffset, int SpriteYOffset, int NumSprites, int NumChars, int NumTiles, double Refresh, int OkiFreq)
{
int nRet = 0, nLen;
DrvSpriteRamSize = SpriteRamSize;
DrvNumSprites = NumSprites,
DrvNumChars = NumChars,
DrvNumTiles = NumTiles,
// Allocate and Blank all required memory
Mem = NULL;
MemIndex();
nLen = MemEnd - (unsigned char *)0;
if ((Mem = (unsigned char *)malloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
MemIndex();
nRet = DrvLoadRoms();
DrvMap68k();
if (DrvHasZ80) DrvMapZ80();
if (DrvHasYM2151) {
if (!DrvYM2151Freq) DrvYM2151Freq = 3427190;
BurnYM2151Init(DrvYM2151Freq, 25.0);
if (DrvHasZ80) BurnYM2151SetIrqHandler(&SemicomYM2151IrqHandler);
}
// Setup the OKIM6295 emulation
if (DrvHasYM2151) {
MSM6295Init(0, OkiFreq / 132, 100.0, 1);
} else {
MSM6295Init(0, OkiFreq / 132, 100.0, 0);
}
BurnSetRefreshRate(Refresh);
nCyclesTotal[0] = 14000000 / 60;
DrvSpriteXOffset = SpriteXOffset;
DrvSpriteYOffset = SpriteYOffset;
DrvSpriteMask = SpriteMask;
DrvSpriteColourMask = 0x0f;
Pf1XOffset = -5;
Pf1YOffset = 0;
Pf2XOffset = -1;
Pf2YOffset = 0;
GenericTilesInit();
// Reset the driver
if (bReset) DrvDoReset();
return 0;
}
static int TumblebInit()
{
DrvLoadRoms = TumblebLoadRoms;
DrvMap68k = TumblebMap68k;
DrvRender = DrvDraw;
return DrvInit(1, 0x800, 0x3fff, -1, 0, 0x2000, 0x4000, 0x1000, 58.0, 8000000 / 10);
}
static int Tumbleb2Init()
{
Tumbleb2 = 1;
return TumblebInit();
}
static int JumpkidsInit()
{
int nRet;
Jumpkids = 1;
DrvHasZ80 = 1;
DrvLoadRoms = JumpkidsLoadRoms;
DrvMap68k = TumblebMap68k;
DrvMapZ80 = JumpkidsMapZ80;
DrvRender = DrvDraw;
nRet = DrvInit(1, 0x800, 0x7fff, -1, 0, 0x2000, 0x4000, 0x1000, 60.0, 8000000 / 8);
nCyclesTotal[0] = 12000000 / 60;
nCyclesTotal[1] = (8000000 / 2) / 60;
return nRet;
}
static int MetlsavrInit()
{
int nRet;
DrvHasZ80 = 1;
DrvHasYM2151 = 1;
DrvHasProt = 1;
SemicomSoundCommand = 1;
DrvLoadRoms = MetlsavrLoadRoms;
DrvMap68k = HtchctchMap68k;
DrvMapZ80 = SemicomMapZ80;
DrvRender = DrvDraw;
nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x4000, 0x4000, 0x1000, 60.0, 1024000);
nCyclesTotal[0] = 15000000 / 60;
nCyclesTotal[1] = (15000000 / 4) / 60;
return nRet;
}
static int PangpangInit()
{
Tumbleb2 = 1;
DrvLoadRoms = PangpangLoadRoms;
DrvMap68k = PangpangMap68k;
DrvRender = PangpangDraw;
return DrvInit(1, 0x800, 0x7fff, -1, 0, 0x2000, 0x8000, 0x2000, 58.0, 8000000 / 10);
}
static int SuprtrioInit()
{
int nRet;
DrvHasZ80 = 1;
SemicomSoundCommand = 1;
DrvLoadRoms = SuprtrioLoadRoms;
DrvMap68k = SuprtrioMap68k;
DrvMapZ80 = SemicomMapZ80;
DrvRender = SuprtrioDraw;
nRet = DrvInit(1, 0x800, 0x7fff, 0, 0, 0x2000, 0x8000, 0x2000, 60.0, 875000);
Pf1XOffset = -6;
Pf2XOffset = -2;
nCyclesTotal[1] = 8000000 / 60;
return nRet;
}
static int HtchctchInit()
{
int nRet;
DrvHasZ80 = 1;
DrvHasYM2151 = 1;
DrvHasProt = 1;
SemicomSoundCommand = 1;
DrvLoadRoms = HtchctchLoadRoms;
DrvMap68k = HtchctchMap68k;
DrvMapZ80 = SemicomMapZ80;
DrvRender = HtchctchDraw;
nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x1000, 0x4000, 0x1000, 60.0, 1024000);
nCyclesTotal[0] = 15000000 / 60;
nCyclesTotal[1] = (15000000 / 4) / 60;
return nRet;
}
static int CookbibInit()
{
int nRet = HtchctchInit();
Pf1XOffset = -5;
Pf1YOffset = 0;
Pf2XOffset = -1;
Pf2YOffset = 2;
return nRet;
}
static int ChokchokInit()
{
int nRet;
Chokchok = 1;
DrvHasZ80 = 1;
DrvHasYM2151 = 1;
DrvHasProt = 1;
SemicomSoundCommand = 1;
DrvLoadRoms = ChokchokLoadRoms;
DrvMap68k = HtchctchMap68k;
DrvMapZ80 = SemicomMapZ80;
DrvRender = DrvDraw;
nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x4000, 0x10000, 0x4000, 60.0, 1024000);
nCyclesTotal[0] = 15000000 / 60;
nCyclesTotal[1] = (15000000 / 4) / 60;
Pf1XOffset = -5;
Pf1YOffset = 0;
Pf2XOffset = -1;
Pf2YOffset = 2;
return nRet;
}
static int WlstarInit()
{
int nRet;
Wlstar = 1;
DrvHasZ80 = 1;
DrvHasYM2151 = 1;
DrvHasProt = 1;
SemicomSoundCommand = 1;
DrvLoadRoms = ChokchokLoadRoms;
DrvMap68k = HtchctchMap68k;
DrvMapZ80 = SemicomMapZ80;
DrvRender = HtchctchDraw;
nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x4000, 0x10000, 0x4000, 60.0, 1024000);
nCyclesTotal[0] = 15000000 / 60;
nCyclesTotal[1] = (15000000 / 4) / 60;
Pf1XOffset = -5;
Pf1YOffset = 0;
Pf2XOffset = -1;
Pf2YOffset = 2;
return nRet;
}
static int Wondl96Init()
{
int nRet;
Wlstar = 1;
Wondl96 = 1;
DrvHasZ80 = 1;
DrvHasYM2151 = 1;
DrvHasProt = 2;
SemicomSoundCommand = 1;
DrvLoadRoms = ChokchokLoadRoms;
DrvMap68k = HtchctchMap68k;
DrvMapZ80 = SemicomMapZ80;
DrvRender = HtchctchDraw;
nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x4000, 0x10000, 0x4000, 60.0, 1024000);
nCyclesTotal[0] = 15000000 / 60;
nCyclesTotal[1] = (15000000 / 4) / 60;
Pf1XOffset = -5;
Pf1YOffset = 0;
Pf2XOffset = -1;
Pf2YOffset = 2;
return nRet;
}
static int FncywldInit()
{
int nRet;
DrvHasYM2151 = 1;
DrvYM2151Freq = 32220000 / 9;
DrvLoadRoms = FncywldLoadRoms;
DrvMap68k = FncywldMap68k;
DrvRender = FncywldDraw;
nRet = DrvInit(1, 0x800, 0x3fff, -1, 0, 0x2000, 0x8000, 0x2000, 60.0, 1023924);
nCyclesTotal[0] = 12000000 / 60;
DrvSpriteColourMask = 0x3f;
return nRet;
}
static int SdfightInit()
{
int nRet;
Bcstry = 1;
DrvHasZ80 = 1;
DrvHasYM2151 = 1;
DrvYM2151Freq = 3427190;
DrvHasProt = 1;
SemicomSoundCommand = 1;
DrvLoadRoms = SdfightLoadRoms;
DrvMap68k = HtchctchMap68k;
DrvMapZ80 = SemicomMapZ80;
DrvRender = SdfightDraw;
nRet = DrvInit(1, 0x1000, 0x7fff, 0, 1, 0x8000, 0x10000, 0x4000, 60.0, 1024000);
nCyclesTotal[0] = 15000000 / 60;
nCyclesTotal[1] = (15000000 / 4) / 60;
Pf1XOffset = -5;
Pf1YOffset = -16;
Pf2XOffset = -1;
Pf2YOffset = 0;
return nRet;
}
static int BcstryInit()
{
int nRet;
Bcstry = 1;
DrvHasZ80 = 1;
DrvHasYM2151 = 1;
DrvYM2151Freq = 3427190;
DrvHasProt = 1;
SemicomSoundCommand = 1;
DrvLoadRoms = BcstryLoadRoms;
DrvMap68k = HtchctchMap68k;
DrvMapZ80 = SemicomMapZ80;
DrvRender = HtchctchDraw;
nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x8000, 0x10000, 0x4000, 60.0, 1024000);
nCyclesTotal[0] = 15000000 / 60;
nCyclesTotal[1] = (15000000 / 4) / 60;
//Pf1XOffset = 8;
Pf1XOffset = -5;
Pf1YOffset = 0;
//Pf2XOffset = 8;
Pf2XOffset = -1;
Pf2YOffset = 0;
return nRet;
}
static int SemibaseInit()
{
int nRet;
Semibase = 1;
Bcstry = 1;
DrvHasZ80 = 1;
DrvHasYM2151 = 1;
DrvYM2151Freq = 3427190;
DrvHasProt = 1;
SemicomSoundCommand = 1;
DrvLoadRoms = BcstryLoadRoms;
DrvMap68k = HtchctchMap68k;
DrvMapZ80 = SemicomMapZ80;
DrvRender = HtchctchDraw;
nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x8000, 0x10000, 0x4000, 60.0, 1024000);
nCyclesTotal[0] = 15000000 / 60;
nCyclesTotal[1] = (15000000 / 4) / 60;
Pf1XOffset = -2;
Pf1YOffset = 0;
Pf2XOffset = -1;
Pf2YOffset = 0;
return nRet;
}
static int DquizgoInit()
{
int nRet;
DrvHasZ80 = 1;
DrvHasYM2151 = 1;
DrvHasProt = 2;
SemicomSoundCommand = 1;
DrvLoadRoms = MetlsavrLoadRoms;
DrvMap68k = HtchctchMap68k;
DrvMapZ80 = SemicomMapZ80;
DrvRender = HtchctchDraw;
nRet = DrvInit(1, 0x1000, 0x7fff, -1, 0, 0x4000, 0x4000, 0x1000, 60.0, 1024000);
nCyclesTotal[0] = 15000000 / 60;
nCyclesTotal[1] = (15000000 / 4) / 60;
Pf1XOffset = -5;
Pf1YOffset = 0;
Pf2XOffset = -1;
Pf2YOffset = 2;
return nRet;
}
static inline int JumppopSynchroniseStream(int nSoundRate)
{
return (long long)(ZetTotalCycles() * nSoundRate / 3500000);
}
static int JumppopInit()
{
int nRet = 0, nLen;
DrvSpriteRamSize = 0x1000;
DrvNumSprites = 0x4000,
DrvNumChars = 0x8000,
DrvNumTiles = 0x2000,
DrvHasZ80 = 1;
DrvHasYM3812 = 1;
// Allocate and Blank all required memory
Mem = NULL;
JumppopMemIndex();
nLen = MemEnd - (unsigned char *)0;
if ((Mem = (unsigned char *)malloc(nLen)) == NULL) return 1;
memset(Mem, 0, nLen);
JumppopMemIndex();
DrvTempRom = (unsigned char *)malloc(0x200000);
// Load 68000 Program Roms
nRet = BurnLoadRom(Drv68KRom + 0x00000, 0, 1); if (nRet != 0) return 1;
// Load Z80 Program Roms
memset(DrvTempRom, 0, 0x200000);
nRet = BurnLoadRom(DrvZ80Rom, 1, 1); if (nRet != 0) return 1;
// Load and decode the tiles
memset(DrvTempRom, 0, 0x200000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 2, 1); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x100000, 3, 1); if (nRet != 0) return 1;
GfxDecode(DrvNumChars, 8, 8, 8, JpCharPlaneOffsets, JpCharXOffsets, JpCharYOffsets, 0x100, DrvTempRom, DrvChars);
GfxDecode(DrvNumTiles, 8, 16, 16, JpTilePlaneOffsets, JpTileXOffsets, JpTileYOffsets, 0x400, DrvTempRom, DrvTiles);
// Load and decode the sprites
memset(DrvTempRom, 0, 0x200000);
nRet = BurnLoadRom(DrvTempRom + 0x000000, 4, 1); if (nRet != 0) return 1;
nRet = BurnLoadRom(DrvTempRom + 0x100000, 5, 1); if (nRet != 0) return 1;
GfxDecode(DrvNumSprites, 4, 16, 16, Sprite2PlaneOffsets, SpriteXOffsets, SpriteYOffsets, 0x200, DrvTempRom, DrvSprites);
// Load Sample Roms
nRet = BurnLoadRom(MSM6295ROM, 6, 1); if (nRet != 0) return 1;
free(DrvTempRom);
// Setup the 68000 emulation
SekInit(0, 0x68000);
SekOpen(0);
SekMapMemory(Drv68KRom , 0x000000, 0x07ffff, SM_ROM);
SekMapMemory(Drv68KRam , 0x120000, 0x123fff, SM_RAM);
SekMapMemory(DrvPaletteRam , 0x140000, 0x1407ff, SM_RAM);
SekMapMemory(DrvSpriteRam , 0x160000, 0x160fff, SM_RAM);
SekMapMemory(Drv68KRam + 0x4000 , 0x1a0000, 0x1a7fff, SM_RAM);
SekMapMemory(DrvPf1Ram , 0x320000, 0x323fff, SM_RAM);
SekMapMemory(DrvPf2Ram , 0x300000, 0x303fff, SM_RAM);
SekSetReadWordHandler(0, Jumppop68KReadWord);
SekSetWriteWordHandler(0, Jumppop68KWriteWord);
SekClose();
// Setup the Z80 emulation
ZetInit(1);
ZetOpen(0);
ZetSetInHandler(JumppopZ80PortRead);
ZetSetOutHandler(JumppopZ80PortWrite);
ZetMapArea(0x0000, 0x2fff, 0, DrvZ80Rom );
ZetMapArea(0x0000, 0x2fff, 2, DrvZ80Rom );
ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + 0x8000 );
ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + 0x8000 );
ZetMapArea(0xf800, 0xffff, 0, DrvZ80Ram );
ZetMapArea(0xf800, 0xffff, 1, DrvZ80Ram );
ZetMapArea(0xf800, 0xffff, 2, DrvZ80Ram );
ZetMemEnd();
ZetClose();
BurnYM3812Init(3500000, NULL, JumppopSynchroniseStream, 0);
BurnTimerAttachZetYM3812(3500000);
// Setup the OKIM6295 emulation
MSM6295Init(0, 875000 / 132, 100.0, 1);
BurnSetRefreshRate(60.0);
nCyclesTotal[0] = 16000000 / 60;
nCyclesTotal[1] = 3500000 / 60;
DrvSpriteXOffset = 1;
DrvSpriteYOffset = 0;
DrvSpriteMask = 0x7fff;
DrvSpriteColourMask = 0x0f;
Pf1XOffset = -0x3a0;
Pf1YOffset = 0;
Pf2XOffset = -0x3a2;
Pf2YOffset = 0;
GenericTilesInit();
DrvRender = JumppopDraw;
// Reset the driver
DrvDoReset();
return 0;
}
static int DrvExit()
{
SekExit();
if (DrvHasZ80) ZetExit();
if (DrvHasYM2151) BurnYM2151Exit();
MSM6295Exit(0);
GenericTilesExit();
DrvVBlank = 0;
DrvOkiBank = 0;
DrvZ80Bank = 0;
DrvTileBank = 0;
DrvSoundLatch = 0;
Tumbleb2MusicCommand = 0;
Tumbleb2MusicBank = 0;
Tumbleb2MusicIsPlaying = 0;
DrvSpriteXOffset = 0;
DrvSpriteYOffset = 0;
DrvSpriteRamSize = 0;
DrvSpriteMask = 0;
DrvSpriteColourMask = 0;
DrvYM2151Freq = 0;
DrvNumSprites = 0;
DrvNumChars = 0;
DrvNumTiles = 0;
DrvHasZ80 = 0;
DrvHasYM2151 = 0;
DrvHasYM3812 = 0;
DrvHasProt = 0;
Tumbleb2 = 0;
Jumpkids = 0;
Chokchok = 0;
Wlstar = 0;
Wondl96 = 0;
Bcstry = 0;
Semibase = 0;
SemicomSoundCommand = 0;
Pf1XOffset = 0;
Pf1YOffset = 0;
Pf2XOffset = 0;
Pf2YOffset = 0;
DrvLoadRoms = NULL;
DrvMap68k = NULL;
DrvMapZ80 = NULL;
DrvRender = NULL;
free(Mem);
Mem = NULL;
return 0;
}
static inline unsigned char pal4bit(unsigned char bits)
{
bits &= 0x0f;
return (bits << 4) | bits;
}
static inline unsigned char pal5bit(unsigned char bits)
{
bits &= 0x1f;
return (bits << 3) | (bits >> 2);
}
static inline unsigned int CalcCol(unsigned short nColour)
{
int r, g, b;
nColour = swapWord(nColour);
r = pal4bit(nColour >> 0);
g = pal4bit(nColour >> 4);
b = pal4bit(nColour >> 8);
return BurnHighCol(r, g, b, 0);
}
static inline unsigned int HtchctchCalcCol(unsigned short nColour)
{
int r, g, b;
nColour = swapWord(nColour);
r = pal5bit(nColour >> 0);
g = pal5bit(nColour >> 5);
b = pal5bit(nColour >> 10);
return BurnHighCol(r, g, b, 0);
}
static inline unsigned int FncywldCalcCol(unsigned short nColour)
{
int r, g, b;
nColour = swapWord(nColour);
r = pal4bit(nColour >> 8);
g = pal4bit(nColour >> 4);
b = pal4bit(nColour >> 0);
return BurnHighCol(r, g, b, 0);
}
static inline unsigned int JumppopCalcCol(unsigned short nColour)
{
int r, g, b;
nColour = swapWord(nColour);
r = pal5bit(nColour >> 10);
g = pal5bit(nColour >> 5);
b = pal5bit(nColour >> 0);
return BurnHighCol(r, g, b, 0);
}
static void DrvCalcPalette()
{
int i;
unsigned short* ps;
unsigned int* pd;
for (i = 0, ps = (unsigned short*)DrvPaletteRam, pd = DrvPalette; i < 0x400; i++, ps++, pd++) {
*pd = CalcCol(*ps);
}
}
static void HtchctchCalcPalette()
{
int i;
unsigned short* ps;
unsigned int* pd;
for (i = 0, ps = (unsigned short*)DrvPaletteRam, pd = DrvPalette; i < 0x400; i++, ps++, pd++) {
*pd = HtchctchCalcCol(*ps);
}
}
static void FncywldCalcPalette()
{
int i;
unsigned short* ps;
unsigned int* pd;
for (i = 0, ps = (unsigned short*)DrvPaletteRam, pd = DrvPalette; i < 0x800; i++, ps++, pd++) {
*pd = FncywldCalcCol(*ps);
}
}
static void JumppopCalcPalette()
{
int i;
unsigned short* ps;
unsigned int* pd;
for (i = 0, ps = (unsigned short*)DrvPaletteRam, pd = DrvPalette; i < 0x400; i++, ps++, pd++) {
*pd = JumppopCalcCol(*ps);
}
}
static void DrvRenderPf2Layer(int ScrollX, int ScrollY)
{
int mx, my, Attr, Code, Colour, x, y, TileIndex;
UINT16 *VideoRam = (UINT16*)DrvPf2Ram;
for (my = 0; my < 32; my++) {
for (mx = 0; mx < 64; mx++) {
TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5);
Attr = swapWord(VideoRam[TileIndex]);
Code = (Attr & 0xfff) | (DrvTileBank >> 2);
Colour = Attr >> 12;
Code &= (DrvNumTiles - 1);
x = 16 * mx;
y = 16 * my;
x -= ((ScrollX + Pf2XOffset) & 0x3ff);
y -= ((ScrollY + Pf2YOffset) & 0x1ff);
if (x < -16) x += 1024;
if (y < -16) y += 512;
y -= 8;
if (x > 0 && x < 304 && y > 0 && y < 224) {
Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 512, DrvTiles);
} else {
Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 512, DrvTiles);
}
}
}
}
static void PangpangRenderPf2Layer()
{
int mx, my, Attr, Code, Colour, x, y, TileIndex;
UINT16 *VideoRam = (UINT16*)DrvPf2Ram;
for (my = 0; my < 32; my++) {
for (mx = 0; mx < 64; mx++) {
TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5);
Attr = swapWord(VideoRam[TileIndex * 2 + 0]);
Code = swapWord(VideoRam[TileIndex * 2 + 1]) & 0xfff;
Code |= 0x1000;
Colour = (Attr >> 12) & 0x0f;
Code &= (DrvNumTiles - 1);
x = 16 * mx;
y = 16 * my;
x -= ((DrvControl[3] + Pf2XOffset) & 0x3ff);
y -= ((DrvControl[4] + Pf2YOffset) & 0x1ff);
if (x < -16) x += 1024;
if (y < -16) y += 512;
y -= 8;
if (x > 0 && x < 304 && y > 0 && y < 224) {
Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 512, DrvTiles);
} else {
Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 512, DrvTiles);
}
}
}
}
static void FncywldRenderPf2Layer()
{
int mx, my, Attr, Code, Colour, x, y, TileIndex;
UINT16 *VideoRam = (UINT16*)DrvPf2Ram;
for (my = 0; my < 32; my++) {
for (mx = 0; mx < 64; mx++) {
TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5);
Attr = swapWord(VideoRam[TileIndex * 2 + 1]);
Code = swapWord(VideoRam[TileIndex * 2 + 0]);
Colour = Attr & 0x1f;
Code &= (DrvNumTiles - 1);
x = 16 * mx;
y = 16 * my;
x -= ((DrvControl[3] + Pf2XOffset) & 0x3ff);
y -= ((DrvControl[4] + Pf2YOffset) & 0x1ff);
if (x < -16) x += 1024;
if (y < -16) y += 512;
y -= 8;
if (x > 0 && x < 304 && y > 0 && y < 224) {
Render16x16Tile(pTransDraw, Code, x, y, Colour, 4, 0x400, DrvTiles);
} else {
Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 4, 0x400, DrvTiles);
}
}
}
}
static void JumppopRenderPf2Layer()
{
int mx, my, Code, Colour, x, y, TileIndex = 0;
UINT16 *VideoRam = (UINT16*)DrvPf2Ram;
for (my = 0; my < 64; my++) {
for (mx = 0; mx < 64; mx++) {
Code = swapWord(VideoRam[TileIndex]);
Code &= (DrvNumTiles - 1);
Colour = 0;
x = 16 * mx;
y = 16 * my;
x -= ((DrvControl[0] + Pf2XOffset) & 0x3ff);
y -= ((DrvControl[1] + Pf2YOffset) & 0x3ff);
if (x < -16) x += 1024;
if (y < -16) y += 1024;
y -= 8;
if (x > 0 && x < 304 && y > 0 && y < 224) {
Render16x16Tile(pTransDraw, Code, x, y, Colour, 8, 512, DrvTiles);
} else {
Render16x16Tile_Clip(pTransDraw, Code, x, y, Colour, 8, 512, DrvTiles);
}
TileIndex++;
}
}
}
static void JumppopRenderPf2AltLayer()
{
int mx, my, Code, Colour, x, y, TileIndex = 0;
UINT16 *VideoRam = (UINT16*)DrvPf2Ram;
for (my = 0; my < 64; my++) {
for (mx = 0; mx < 128; mx++) {
Code = swapWord(VideoRam[TileIndex]);
Colour = 0;
x = 8 * mx;
y = 8 * my;
x -= ((DrvControl[0] + Pf2XOffset) & 0x3ff);
y -= ((DrvControl[1] + Pf2YOffset) & 0x1ff);
if (x < -8) x += 1024;
if (y < -8) y += 512;
y -= 8;
if (x > 0 && x < 312 && y > 0 && y < 232) {
Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 8, 0, 512, DrvChars);
} else {
Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 512, DrvChars);
}
TileIndex++;
}
}
}
static void DrvRenderPf1Layer(int ScrollX, int ScrollY)
{
int mx, my, Attr, Code, Colour, x, y, TileIndex;
UINT16 *VideoRam = (UINT16*)DrvPf1Ram;
for (my = 0; my < 32; my++) {
for (mx = 0; mx < 64; mx++) {
TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5);
Attr = swapWord(VideoRam[TileIndex]);
Code = (Attr & 0xfff) | (DrvTileBank >> 2);
Colour = Attr >> 12;
Code &= (DrvNumTiles - 1);
x = 16 * mx;
y = 16 * my;
x -= ((ScrollX + Pf1XOffset) & 0x3ff);
y -= ((ScrollY + Pf1YOffset) & 0x1ff);
if (x < -16) x += 1024;
if (y < -16) y += 512;
y -= 8;
if (x > 0 && x < 304 && y > 0 && y < 224) {
Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles);
} else {
Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles);
}
}
}
}
static void PangpangRenderPf1Layer()
{
int mx, my, Attr, Code, Colour, x, y, TileIndex;
UINT16 *VideoRam = (UINT16*)DrvPf1Ram;
for (my = 0; my < 32; my++) {
for (mx = 0; mx < 64; mx++) {
TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5);
Attr = swapWord(VideoRam[TileIndex * 2 + 0]);
Code = swapWord(VideoRam[TileIndex * 2 + 1]);
Colour = (Attr >> 12) & 0x0f;
Code &= (DrvNumTiles - 1);
x = 16 * mx;
y = 16 * my;
x -= ((DrvControl[1] + Pf1XOffset) & 0x3ff);
y -= ((DrvControl[2] + Pf1YOffset) & 0x1ff);
if (x < -16) x += 1024;
if (y < -16) y += 512;
y -= 8;
if (x > 0 && x < 304 && y > 0 && y < 224) {
Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles);
} else {
Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvTiles);
}
}
}
}
static void FncywldRenderPf1Layer()
{
int mx, my, Attr, Code, Colour, x, y, TileIndex;
UINT16 *VideoRam = (UINT16*)DrvPf1Ram;
for (my = 0; my < 32; my++) {
for (mx = 0; mx < 64; mx++) {
TileIndex = (mx & 0x1f) + ((my & 0x1f) << 5) + ((mx & 0x60) << 5);
Attr = swapWord(VideoRam[TileIndex * 2 + 1]);
Code = swapWord(VideoRam[TileIndex * 2 + 0]);
Colour = Attr & 0x1f;
Code &= (DrvNumTiles - 1);
x = 16 * mx;
y = 16 * my;
x -= ((DrvControl[1] + Pf1XOffset) & 0x3ff);
y -= ((DrvControl[2] + Pf1YOffset) & 0x1ff);
if (x < -16) x += 1024;
if (y < -16) y += 512;
y -= 8;
if (x > 0 && x < 304 && y > 0 && y < 224) {
Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvTiles);
} else {
Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x200, DrvTiles);
}
}
}
}
static void JumppopRenderPf1Layer()
{
int mx, my, Code, Colour, x, y, TileIndex = 0;
UINT16 *VideoRam = (UINT16*)DrvPf1Ram;
for (my = 0; my < 64; my++) {
for (mx = 0; mx < 64; mx++) {
Code = swapWord(VideoRam[TileIndex]) & 0x1fff;
Code &= (DrvNumTiles - 1);
Colour = 0;
x = 16 * mx;
y = 16 * my;
x -= ((DrvControl[2] + Pf1XOffset) & 0x3ff);
y -= ((DrvControl[3] + Pf1YOffset) & 0x3ff);
if (x < -16) x += 1024;
if (y < -16) y += 1024;
y -= 8;
if (x > 0 && x < 304 && y > 0 && y < 224) {
Render16x16Tile_Mask(pTransDraw, Code, x, y, Colour, 8, 0, 256, DrvTiles);
} else {
Render16x16Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 256, DrvTiles);
}
TileIndex++;
}
}
}
static void DrvRenderCharLayer()
{
int mx, my, Attr, Code, Colour, x, y, TileIndex = 0;
UINT16 *VideoRam = (UINT16*)DrvPf1Ram;
for (my = 0; my < 32; my++) {
for (mx = 0; mx < 64; mx++) {
Attr = swapWord(VideoRam[TileIndex]);
Code = (Attr & 0xfff) | DrvTileBank;
Colour = Attr >> 12;
Code &= (DrvNumChars - 1);
x = 8 * mx;
y = 8 * my;
x -= ((DrvControl[1] + Pf1XOffset) & 0x1ff);
y -= ((DrvControl[2] + Pf1YOffset) & 0xff);
if (x < -8) x += 512;
if (y < -8) y += 256;
y -= 8;
if (x > 0 && x < 312 && y > 0 && y < 232) {
Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars);
} else {
Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars);
}
TileIndex++;
}
}
}
static void PangpangRenderCharLayer()
{
int mx, my, Attr, Code, Colour, x, y, TileIndex = 0;
UINT16 *VideoRam = (UINT16*)DrvPf1Ram;
for (my = 0; my < 32; my++) {
for (mx = 0; mx < 64; mx++) {
Attr = swapWord(VideoRam[TileIndex * 2 + 0]);
Code = swapWord(VideoRam[TileIndex * 2 + 1]) & 0x1fff;
Colour = (Attr >> 12) & 0x1f;
Code &= (DrvNumChars - 1);
x = 8 * mx;
y = 8 * my;
x -= ((DrvControl[1] + Pf1XOffset) & 0x1ff);
y -= ((DrvControl[2] + Pf1YOffset) & 0xff);
if (x < -8) x += 512;
if (y < -8) y += 256;
y -= 8;
if (x > 0 && x < 312 && y > 0 && y < 232) {
Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars);
} else {
Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars);
}
TileIndex++;
}
}
}
static void FncywldRenderCharLayer()
{
int mx, my, Attr, Code, Colour, x, y, TileIndex = 0;
UINT16 *VideoRam = (UINT16*)DrvPf1Ram;
for (my = 0; my < 32; my++) {
for (mx = 0; mx < 64; mx++) {
Attr = swapWord(VideoRam[TileIndex * 2 + 1]);
Code = swapWord(VideoRam[TileIndex * 2 + 0]) & 0x1fff;
if (Code) {
Colour = Attr & 0x1f;
Code &= (DrvNumChars - 1);
x = 8 * mx;
y = 8 * my;
x -= ((DrvControl[1] + Pf1XOffset) & 0x1ff);
y -= ((DrvControl[2] + Pf1YOffset) & 0xff);
if (x < -8) x += 512;
if (y < -8) y += 256;
y -= 8;
if (x > 0 && x < 312 && y > 0 && y < 232) {
Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x400, DrvChars);
} else {
Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0x0f, 0x400, DrvChars);
}
}
TileIndex++;
}
}
}
static void SdfightRenderCharLayer()
{
int mx, my, Attr, Code, Colour, x, y, TileIndex = 0;
UINT16 *VideoRam = (UINT16*)DrvPf1Ram;
for (my = 0; my < 64; my++) {
for (mx = 0; mx < 64; mx++) {
Attr = swapWord(VideoRam[TileIndex]);
Code = (Attr & 0xfff) | DrvTileBank;
Colour = Attr >> 12;
Code &= (DrvNumChars - 1);
x = 8 * mx;
y = 8 * my;
x -= ((DrvControl[1] + Pf1XOffset) & 0x1ff);
y -= ((DrvControl[2] + Pf1YOffset) & 0x1ff);
if (x < -8) x += 512;
if (y < -8) y += 512;
y -= 8;
if (x > 0 && x < 312 && y > 0 && y < 232) {
Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars);
} else {
Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 4, 0, 256, DrvChars);
}
TileIndex++;
}
}
}
static void JumppopRenderCharLayer()
{
int mx, my, Code, Colour, x, y, TileIndex = 0;
UINT16 *VideoRam = (UINT16*)DrvPf1Ram;
for (my = 0; my < 64; my++) {
for (mx = 0; mx < 128; mx++) {
Code = swapWord(VideoRam[TileIndex]);
Colour = 0;
x = 8 * mx;
y = 8 * my;
x -= ((DrvControl[2] + Pf1XOffset) & 0x3ff);
y -= ((DrvControl[3] + Pf1YOffset) & 0x1ff);
if (x < -8) x += 1024;
if (y < -8) y += 512;
y -= 8;
if (x > 0 && x < 312 && y > 0 && y < 232) {
Render8x8Tile_Mask(pTransDraw, Code, x, y, Colour, 8, 0, 256, DrvChars);
} else {
Render8x8Tile_Mask_Clip(pTransDraw, Code, x, y, Colour, 8, 0, 256, DrvChars);
}
TileIndex++;
}
}
}
static void DrvRenderSprites(int MaskColour, int xFlipped)
{
int Offset;
UINT16 *SpriteRam = (UINT16*)DrvSpriteRam;
for (Offset = 0; Offset < DrvSpriteRamSize / 2; Offset += 4) {
int x, y, Code, Colour, Flash, Multi, xFlip, yFlip, Inc, Mult;
Code = swapWord(SpriteRam[Offset + 1]) & DrvSpriteMask;
if (!Code) continue;
y = swapWord(SpriteRam[Offset]);
Flash = y & 0x1000;
if (Flash && (GetCurrentFrame() & 1)) continue;
x = swapWord(SpriteRam[Offset + 2]);
Colour = (x >> 9) & DrvSpriteColourMask;
xFlip = y & 0x2000;
yFlip = y & 0x4000;
Multi = (1 << ((y & 0x600) >> 9)) - 1;
x &= 0x1ff;
y &= 0x1ff;
if (x >= 320) x -= 512;
if (y >= 256) y -= 512;
y = 240 - y;
x = 304 - x;
y -= 8;
if (yFlip) {
Inc = -1;
} else {
Code += Multi;
Inc = 1;
}
if (xFlipped) {
xFlip = !xFlip;
x = 304 - x;
}
Mult = -16;
while (Multi >= 0) {
int RenderCode = Code - (Multi * Inc);
int RenderX = DrvSpriteXOffset + x;
int RenderY = DrvSpriteYOffset + y + (Mult * Multi);
RenderCode &= (DrvNumSprites - 1);
if (RenderX > 16 && RenderX < 304 && RenderY > 16 && RenderY < 224) {
if (xFlip) {
if (yFlip) {
Render16x16Tile_Mask_FlipXY(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites);
} else {
Render16x16Tile_Mask_FlipX(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites);
}
} else {
if (yFlip) {
Render16x16Tile_Mask_FlipY(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites);
} else {
Render16x16Tile_Mask(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites);
}
}
} else {
if (xFlip) {
if (yFlip) {
Render16x16Tile_Mask_FlipXY_Clip(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites);
} else {
Render16x16Tile_Mask_FlipX_Clip(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites);
}
} else {
if (yFlip) {
Render16x16Tile_Mask_FlipY_Clip(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites);
} else {
Render16x16Tile_Mask_Clip(pTransDraw, RenderCode, RenderX, RenderY, Colour, 4, MaskColour, 0, DrvSprites);
}
}
}
Multi--;
}
}
}
static void DrvDraw()
{
BurnTransferClear();
DrvCalcPalette();
DrvRenderPf2Layer(DrvControl[3], DrvControl[4]);
if (DrvControl[6] & 0x80) {
DrvRenderCharLayer();
} else {
DrvRenderPf1Layer(DrvControl[1], DrvControl[2]);
}
DrvRenderSprites(0, 0);
BurnTransferCopy(DrvPalette);
}
static void PangpangDraw()
{
BurnTransferClear();
DrvCalcPalette();
PangpangRenderPf2Layer();
if (DrvControl[6] & 0x80) {
PangpangRenderCharLayer();
} else {
PangpangRenderPf1Layer();
}
DrvRenderSprites(0, 0);
BurnTransferCopy(DrvPalette);
}
static void SuprtrioDraw()
{
BurnTransferClear();
HtchctchCalcPalette();
DrvRenderPf2Layer(-DrvControl[3], -DrvControl[4]);
DrvRenderPf1Layer(-DrvControl[1], -DrvControl[2]);
DrvRenderSprites(0, 0);
BurnTransferCopy(DrvPalette);
}
static void HtchctchDraw()
{
BurnTransferClear();
HtchctchCalcPalette();
DrvRenderPf2Layer(DrvControl[3], DrvControl[4]);
if (DrvControl[6] & 0x80) {
DrvRenderCharLayer();
} else {
DrvRenderPf1Layer(DrvControl[1], DrvControl[2]);
}
DrvRenderSprites(0, 0);
BurnTransferCopy(DrvPalette);
}
static void FncywldDraw()
{
BurnTransferClear();
FncywldCalcPalette();
FncywldRenderPf2Layer();
if (DrvControl[6] & 0x80) {
FncywldRenderCharLayer();
} else {
FncywldRenderPf1Layer();
}
DrvRenderSprites(0x0f, 0);
BurnTransferCopy(DrvPalette);
}
static void SdfightDraw()
{
BurnTransferClear();
HtchctchCalcPalette();
DrvRenderPf2Layer(DrvControl[3], DrvControl[4]);
if (DrvControl[6] & 0x80) {
SdfightRenderCharLayer();
} else {
DrvRenderPf1Layer(DrvControl[1], DrvControl[2]);
}
DrvRenderSprites(0, 0);
BurnTransferCopy(DrvPalette);
}
static void JumppopDraw()
{
BurnTransferClear();
JumppopCalcPalette();
if (DrvControl[7] & 0x01) {
JumppopRenderPf2Layer();
} else {
JumppopRenderPf2AltLayer();
}
if (DrvControl[7] & 0x02) {
JumppopRenderPf1Layer();
} else {
JumppopRenderCharLayer();
}
DrvRenderSprites(0, 1);
BurnTransferCopy(DrvPalette);
}
#define NUM_SCANLINES 315
#define SCANLINE_VBLANK_START 37
#define SCANLINE_VBLANK_END SCANLINE_VBLANK_START + 240
static int DrvFrame()
{
int nInterleave = NUM_SCANLINES;
int nSoundBufferPos = 0;
if (DrvReset) DrvDoReset();
DrvMakeInputs();
nCyclesDone[0] = nCyclesDone[1] = 0;
SekNewFrame();
if (DrvHasZ80) ZetNewFrame();
DrvVBlank = 0;
for (int i = 0; i < nInterleave; i++) {
int nCurrentCPU, nNext;
// Run 68000
nCurrentCPU = 0;
SekOpen(0);
nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave;
nCyclesSegment = nNext - nCyclesDone[nCurrentCPU];
nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment);
if (i == SCANLINE_VBLANK_START) DrvVBlank = 1;
if (i == SCANLINE_VBLANK_END) DrvVBlank = 0;
if (i == NUM_SCANLINES - 1) {
SekSetIRQLine(6, SEK_IRQSTATUS_AUTO);
if (Tumbleb2) Tumbleb2PlayMusic();
}
SekClose();
if (DrvHasZ80) {
// Run Z80
nCurrentCPU = 1;
ZetOpen(0);
nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave;
nCyclesSegment = nNext - nCyclesDone[nCurrentCPU];
nCyclesSegment = ZetRun(nCyclesSegment);
nCyclesDone[nCurrentCPU] += nCyclesSegment;
ZetClose();
}
if (pBurnSoundOut) {
int nSegmentLength = nBurnSoundLen / nInterleave;
short* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
if (DrvHasYM2151) {
if (DrvHasZ80) ZetOpen(0);
BurnYM2151Render(pSoundBuf, nSegmentLength);
if (DrvHasZ80) ZetClose();
}
MSM6295Render(0, pSoundBuf, nSegmentLength);
nSoundBufferPos += nSegmentLength;
}
}
// Make sure the buffer is entirely filled.
if (pBurnSoundOut) {
int nSegmentLength = nBurnSoundLen - nSoundBufferPos;
short* pSoundBuf = pBurnSoundOut + (nSoundBufferPos << 1);
if (nSegmentLength) {
if (DrvHasYM2151) {
if (DrvHasZ80) ZetOpen(0);
BurnYM2151Render(pSoundBuf, nSegmentLength);
if (DrvHasZ80) ZetClose();
}
MSM6295Render(0, pSoundBuf, nSegmentLength);
}
}
if (pBurnDraw) DrvRender();
return 0;
}
static int JumppopFrame()
{
int nInterleave = 1953;
if (DrvReset) DrvDoReset();
DrvMakeInputs();
nCyclesDone[0] = nCyclesDone[1] = 0;
SekNewFrame();
ZetNewFrame();
for (int i = 0; i < nInterleave; i++) {
int nCurrentCPU, nNext;
// Run 68000
nCurrentCPU = 0;
SekOpen(0);
nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave;
nCyclesSegment = nNext - nCyclesDone[nCurrentCPU];
nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment);
if (i == 1952) {
SekSetIRQLine(6, SEK_IRQSTATUS_AUTO);
}
SekClose();
// Run Z80
nCurrentCPU = 1;
ZetOpen(0);
nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave;
nCyclesSegment = nNext - nCyclesDone[nCurrentCPU];
nCyclesSegment = ZetRun(nCyclesSegment);
nCyclesDone[nCurrentCPU] += nCyclesSegment;
ZetNmi();
ZetClose();
}
ZetOpen(0);
BurnTimerEndFrameYM3812(nCyclesTotal[1] - nCyclesDone[1]);
BurnYM3812Update(pBurnSoundOut, nBurnSoundLen);
ZetClose();
MSM6295Render(0, pBurnSoundOut, nBurnSoundLen);
if (pBurnDraw) JumppopDraw();
return 0;
}
#undef NUM_SCANLINES
#undef SCANLINE_VBLANK_START
#undef SCANLINE_VBLANK_END
static int DrvScan(int nAction, int *pnMin)
{
struct BurnArea ba;
if (pnMin != NULL) { // Return minimum compatible version
*pnMin = 0x029676;
}
if (nAction & ACB_MEMORY_RAM) {
memset(&ba, 0, sizeof(ba));
ba.Data = RamStart;
ba.nLen = RamEnd-RamStart;
ba.szName = "All Ram";
BurnAcb(&ba);
}
if (nAction & ACB_DRIVER_DATA) {
SekScan(nAction);
if (DrvHasZ80) ZetScan(nAction);
if (DrvHasYM2151) BurnYM2151Scan(nAction);
MSM6295Scan(0, nAction);
// Scan critical driver variables
SCAN_VAR(nCyclesDone);
SCAN_VAR(nCyclesSegment);
SCAN_VAR(DrvDip);
SCAN_VAR(DrvInput);
SCAN_VAR(DrvVBlank);
SCAN_VAR(DrvOkiBank);
SCAN_VAR(DrvZ80Bank);
SCAN_VAR(DrvTileBank);
SCAN_VAR(DrvSoundLatch);
SCAN_VAR(Tumbleb2MusicCommand);
SCAN_VAR(Tumbleb2MusicBank);
SCAN_VAR(Tumbleb2MusicIsPlaying);
}
if (nAction & ACB_WRITE) {
if (DrvOkiBank) {
if (Jumpkids) {
memcpy(MSM6295ROM + 0x20000, DrvMSM6295ROMSrc + (DrvOkiBank * 0x20000), 0x20000);
} else {
memcpy(MSM6295ROM + 0x30000, DrvMSM6295ROMSrc + 0x30000 + (DrvOkiBank * 0x10000), 0x10000);
}
}
if (DrvZ80Bank) {
ZetOpen(0);
ZetMapArea(0x8000, 0xbfff, 0, DrvZ80Rom + (DrvZ80Bank * 0x4000));
ZetMapArea(0x8000, 0xbfff, 2, DrvZ80Rom + (DrvZ80Bank * 0x4000));
ZetClose();
}
}
return 0;
}
struct BurnDriver BurnDrvTumbleb = {
"tumbleb", "tumblep", NULL, "1991",
"Tumble Pop (bootleg set 1)\0", NULL, "bootleg", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_MISC,
NULL, TumblebRomInfo, TumblebRomName, TumblebInputInfo, TumblebDIPInfo,
TumblebInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvTumbleb2 = {
"tumbleb2", "tumblep", NULL, "1991",
"Tumble Pop (bootleg set 2)\0", NULL, "bootleg", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE | BDF_BOOTLEG, 2, HARDWARE_MISC_MISC,
NULL, Tumbleb2RomInfo, Tumbleb2RomName, TumblebInputInfo, TumblebDIPInfo,
Tumbleb2Init, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvJumpkids = {
"jumpkids", NULL, NULL, "1993",
"Jump Kids\0", NULL, "Comad", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, JumpkidsRomInfo, JumpkidsRomName, TumblebInputInfo, TumblebDIPInfo,
JumpkidsInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvMetlsavr = {
"metlsavr", NULL, NULL, "1994",
"Metal Saver\0", NULL, "First Amusement", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, MetlsavrRomInfo, MetlsavrRomName, MetlsavrInputInfo, MetlsavrDIPInfo,
MetlsavrInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvPangpang = {
"pangpang", NULL, NULL, "1994",
"Pang Pang\0", NULL, "Dong Gue La Mi Ltd.", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, PangpangRomInfo, PangpangRomName, TumblebInputInfo, TumblebDIPInfo,
PangpangInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvSuprtrio = {
"suprtrio", NULL, NULL, "1994",
"Super Trio\0", NULL, "Gameace", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, SuprtrioRomInfo, SuprtrioRomName, SuprtrioInputInfo, SuprtrioDIPInfo,
SuprtrioInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvHtchctch = {
"htchctch", NULL, NULL, "1995",
"Hatch Catch\0", NULL, "SemiCom", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, HtchctchRomInfo, HtchctchRomName, HtchctchInputInfo, HtchctchDIPInfo,
HtchctchInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvCookbib = {
"cookbib", NULL, NULL, "1995",
"Cookie & Bibi\0", NULL, "SemiCom", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, CookbibRomInfo, CookbibRomName, HtchctchInputInfo, CookbibDIPInfo,
CookbibInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvChokChok = {
"chokchok", NULL, NULL, "1995",
"Choky! Choky!\0", NULL, "SemiCom", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, ChokchokRomInfo, ChokchokRomName, HtchctchInputInfo, ChokchokDIPInfo,
ChokchokInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvWlstar = {
"wlstar", NULL, NULL, "1995",
"Wonder League Star - Sok-Magicball Fighting (Korea)\0", NULL, "Mijin", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, WlstarRomInfo, WlstarRomName, MetlsavrInputInfo, WlstarDIPInfo,
WlstarInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvWondl96 = {
"wondl96", NULL, NULL, "1995",
"Wonder League '96 (Korea)\0", NULL, "SemiCom", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, Wondl96RomInfo, Wondl96RomName, MetlsavrInputInfo, Wondl96DIPInfo,
Wondl96Init, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvFancywld = {
"fncywld", NULL, NULL, "1996",
"Fancy World - Earth of Crisis\0", NULL, "Unico", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, FncywldRomInfo, FncywldRomName, FncywldInputInfo, FncywldDIPInfo,
FncywldInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvSdfight = {
"sdfight", NULL, NULL, "1996",
"SD Fighters (Korea)\0", NULL, "SemiCom", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, SdfightRomInfo, SdfightRomName, MetlsavrInputInfo, SdfightDIPInfo,
SdfightInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvBcstry = {
"bcstry", NULL, NULL, "1997",
"B.C. Story (set 1)\0", NULL, "SemiCom", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, BcstryRomInfo, BcstryRomName, MetlsavrInputInfo, BcstryDIPInfo,
BcstryInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvBcstrya = {
"bcstrya", "bcstry", NULL, "1997",
"B.C. Story (set 2)\0", NULL, "SemiCom", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_MISC_MISC,
NULL, BcstryaRomInfo, BcstryaRomName, MetlsavrInputInfo, BcstryDIPInfo,
BcstryInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvSemibase = {
"semibase", NULL, NULL, "1997",
"MuHanSeungBu (SemiCom Baseball) (Korea)\0", NULL, "SemiCom", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, SemibaseRomInfo, SemibaseRomName, SemibaseInputInfo, SemibaseDIPInfo,
SemibaseInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvDquizgo = {
"dquizgo", NULL, NULL, "1998",
"Date Quiz Go Go (Korea)\0", NULL, "SemiCom", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, DquizgoRomInfo, DquizgoRomName, MetlsavrInputInfo, DquizgoDIPInfo,
DquizgoInit, DrvExit, DrvFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
struct BurnDriver BurnDrvJumppop = {
"jumppop", NULL, NULL, "2001",
"Jumping Pop\0", "Missing Sounds", "ESD", "Miscellaneous",
NULL, NULL, NULL, NULL,
BDF_GAME_WORKING, 2, HARDWARE_MISC_MISC,
NULL, JumppopRomInfo, JumppopRomName, JumppopInputInfo, JumppopDIPInfo,
JumppopInit, DrvExit, JumppopFrame, NULL, DrvScan,
NULL, 320, 240, 4, 3
};
| [
"twinaphex1@gmail.com"
] | twinaphex1@gmail.com |
623efa29c752cc100a7316a414d8d91e9fc67bb5 | 4bdb20c69bbc289c491d76179b77fcee4f262f29 | /ogsr_engine/xrGame/visual_memory_manager.cpp | 36f889f0b8e17174bce6e5e08b48fe7605a9a677 | [] | no_license | Roman-n/ogsr-engine | 1a42e3f378c93c55ca918be171e2feb0ffd50e4c | 6b16bf6593bd8a647f7f150e5cf6f80d7474585f | refs/heads/main | 2023-02-22T01:38:06.681481 | 2018-05-02T20:54:55 | 2018-05-02T20:54:55 | 332,519,405 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 24,881 | cpp | ////////////////////////////////////////////////////////////////////////////
// Module : visual_memory_manager.cpp
// Created : 02.10.2001
// Modified : 19.11.2003
// Author : Dmitriy Iassenev
// Description : Visual memory manager
////////////////////////////////////////////////////////////////////////////
#include "pch_script.h"
#include "visual_memory_manager.h"
#include "ai/stalker/ai_stalker.h"
#include "memory_space_impl.h"
#include "../xr_3da/skeletoncustom.h"
#include "clsid_game.h"
#include "ai_object_location.h"
#include "level_graph.h"
#include "stalker_movement_manager.h"
#include "gamemtllib.h"
#include "agent_manager.h"
#include "agent_member_manager.h"
#include "ai_space.h"
#include "profiler.h"
#include "actor.h"
#include "../xr_3da/camerabase.h"
#include "gamepersistent.h"
#include "actor_memory.h"
#include "client_spawn_manager.h"
#include "client_spawn_manager.h"
#include "memory_manager.h"
#ifndef MASTER_GOLD
# include "clsid_game.h"
# include "ai_debug.h"
#endif // MASTER_GOLD
struct SRemoveOfflinePredicate {
bool operator() (const CVisibleObject &object) const
{
VERIFY (object.m_object);
return (!!object.m_object->getDestroy() || object.m_object->H_Parent());
}
bool operator() (const CNotYetVisibleObject &object) const
{
VERIFY (object.m_object);
return (!!object.m_object->getDestroy() || object.m_object->H_Parent());
}
};
struct CVisibleObjectPredicate {
u32 m_id;
CVisibleObjectPredicate (u32 id) :
m_id(id)
{
}
bool operator() (const CObject *object) const
{
VERIFY (object);
return (object->ID() == m_id);
}
};
struct CNotYetVisibleObjectPredicate{
const CGameObject *m_game_object;
IC CNotYetVisibleObjectPredicate(const CGameObject *game_object)
{
m_game_object = game_object;
}
IC bool operator() (const CNotYetVisibleObject &object) const
{
return (object.m_object->ID() == m_game_object->ID());
}
};
CVisualMemoryManager::CVisualMemoryManager (CCustomMonster *object)
{
m_object = object;
m_stalker = 0;
m_client = 0;
initialize ();
}
CVisualMemoryManager::CVisualMemoryManager (CAI_Stalker *stalker)
{
m_object = stalker;
m_stalker = stalker;
m_client = 0;
initialize ();
}
CVisualMemoryManager::CVisualMemoryManager (vision_client *client)
{
m_object = 0;
m_stalker = 0;
m_client = client;
initialize ();
m_objects = xr_new<VISIBLES>();
}
void CVisualMemoryManager::initialize ()
{
m_max_object_count = 1;
m_enabled = true;
m_objects = 0;
}
CVisualMemoryManager::~CVisualMemoryManager ()
{
clear_delayed_objects ();
if (!m_client)
return;
xr_delete (m_objects);
}
void CVisualMemoryManager::reinit ()
{
if (!m_client)
m_objects = 0;
else {
VERIFY (m_objects);
m_objects->clear ();
}
m_visible_objects.clear ();
// m_visible_objects.reserve (100);
m_not_yet_visible_objects.clear ();
// m_not_yet_visible_objects.reserve (100);
if (m_object)
m_object->feel_vision_clear ();
m_last_update_time = u32(-1);
}
void CVisualMemoryManager::reload (LPCSTR section)
{
m_max_object_count = READ_IF_EXISTS(pSettings,r_s32,section,"DynamicObjectsCount",1);
if (m_stalker) {
m_free.Load (pSettings->r_string(section,"vision_free_section"),true);
m_danger.Load (pSettings->r_string(section,"vision_danger_section"),true);
}
else
m_free.Load (section,!!m_client);
}
IC const CVisionParameters &CVisualMemoryManager::current_state() const
{
return (!m_stalker || (m_stalker->movement().mental_state() != eMentalStateDanger) ? m_free : m_danger);
}
u32 CVisualMemoryManager::visible_object_time_last_seen (const CObject *object) const
{
VISIBLES::iterator I = std::find(m_objects->begin(),m_objects->end(),object_id(object));
if (I != m_objects->end())
return (I->m_level_time);
else
return u32(-1);
}
bool CVisualMemoryManager::visible_right_now (const CGameObject *game_object) const
{
VISIBLES::const_iterator I = std::find(objects().begin(),objects().end(),object_id(game_object));
if ((objects().end() == I))
return (false);
if (!(*I).visible(mask()))
return (false);
if ((*I).m_level_time < m_last_update_time)
return (false);
return (true);
}
bool CVisualMemoryManager::visible_now (const CGameObject *game_object) const
{
VISIBLES::const_iterator I = std::find(objects().begin(),objects().end(),object_id(game_object));
return ((objects().end() != I) && (*I).visible(mask()));
}
void CVisualMemoryManager::enable (const CObject *object, bool enable)
{
VISIBLES::iterator J = std::find(m_objects->begin(),m_objects->end(),object_id(object));
if (J == m_objects->end())
return;
(*J).m_enabled = enable;
}
float CVisualMemoryManager::object_visible_distance(const CGameObject *game_object, float &object_distance) const
{
Fvector eye_position = Fvector().set(0.f,0.f,0.f), eye_direction;
Fmatrix eye_matrix;
float object_range = flt_max, object_fov = flt_max;
if (m_object) {
eye_matrix =
smart_cast<CKinematics*>(
m_object->Visual()
)
->LL_GetTransform (
u16(m_object->eye_bone)
);
Fvector temp;
eye_matrix.transform_tiny (temp,eye_position);
m_object->XFORM().transform_tiny(eye_position,temp);
if (m_stalker) {
eye_direction.setHP (-m_stalker->movement().m_head.current.yaw, -m_stalker->movement().m_head.current.pitch);
} else { // if its a monster
const MonsterSpace::SBoneRotation &head_orient = m_object->head_orientation();
eye_direction.setHP (-head_orient.current.yaw, -head_orient.current.pitch);
}
}
else {
Fvector dummy;
float _0,_1;
m_client->camera (eye_position,eye_direction,dummy,object_fov,_0,_1,object_range);
}
Fvector object_direction;
game_object->Center (object_direction);
object_distance = object_direction.distance_to(eye_position);
object_direction.sub (eye_position);
object_direction.normalize_safe ();
if (m_object)
m_object->update_range_fov (object_range,object_fov,m_object->eye_range,deg2rad(m_object->eye_fov));
float fov = object_fov*.5f;
float cos_alpha = eye_direction.dotproduct(object_direction);
clamp (cos_alpha,-.99999f,.99999f);
float alpha = acosf(cos_alpha);
clamp (alpha,0.f,fov);
float max_view_distance = object_range, min_view_distance = object_range;
max_view_distance *= current_state().m_max_view_distance;
min_view_distance *= current_state().m_min_view_distance;
float distance = (1.f - alpha/fov)*(max_view_distance - min_view_distance) + min_view_distance;
return (distance);
}
float CVisualMemoryManager::object_luminocity (const CGameObject *game_object) const
{
if (game_object->CLS_ID != CLSID_OBJECT_ACTOR)
return (1.f);
float luminocity = const_cast<CGameObject*>(game_object)->ROS()->get_luminocity();
float power = log(luminocity > .001f ? luminocity : .001f)*current_state().m_luminocity_factor;
return (exp(power));
}
float CVisualMemoryManager::get_object_velocity (const CGameObject *game_object, const CNotYetVisibleObject ¬_yet_visible_object) const
{
if ((game_object->ps_Size() < 2) || (not_yet_visible_object.m_prev_time == game_object->ps_Element(game_object->ps_Size() - 2).dwTime))
return (0.f);
CObject::SavedPosition pos0 = game_object->ps_Element (game_object->ps_Size() - 2);
CObject::SavedPosition pos1 = game_object->ps_Element (game_object->ps_Size() - 1);
return (
pos1.vPosition.distance_to(pos0.vPosition)/
(
float(pos1.dwTime)/1000.f -
float(pos0.dwTime)/1000.f
)
);
}
float CVisualMemoryManager::get_visible_value (float distance, float object_distance, float time_delta, float object_velocity, float luminocity) const
{
float always_visible_distance = current_state().m_always_visible_distance;
if (distance <= always_visible_distance + EPS_L)
return (current_state().m_visibility_threshold);
return (
time_delta /
current_state().m_time_quant *
luminocity *
(1.f + current_state().m_velocity_factor*object_velocity) *
(distance - object_distance) /
(distance - always_visible_distance)
);
}
CNotYetVisibleObject *CVisualMemoryManager::not_yet_visible_object(const CGameObject *game_object)
{
START_PROFILE("Memory Manager/visuals/not_yet_visible_object")
xr_vector<CNotYetVisibleObject>::iterator I = std::find_if(
m_not_yet_visible_objects.begin(),
m_not_yet_visible_objects.end(),
CNotYetVisibleObjectPredicate(game_object)
);
if (I == m_not_yet_visible_objects.end())
return (0);
return (&*I);
STOP_PROFILE
}
void CVisualMemoryManager::add_not_yet_visible_object (const CNotYetVisibleObject ¬_yet_visible_object)
{
m_not_yet_visible_objects.push_back (not_yet_visible_object);
}
u32 CVisualMemoryManager::get_prev_time (const CGameObject *game_object) const
{
if (!game_object->ps_Size())
return (0);
if (game_object->ps_Size() == 1)
return (game_object->ps_Element(0).dwTime);
return (game_object->ps_Element(game_object->ps_Size() - 2).dwTime);
}
bool CVisualMemoryManager::visible (const CGameObject *game_object, float time_delta)
{
VERIFY (game_object);
if (game_object->getDestroy())
return (false);
#ifndef USE_STALKER_VISION_FOR_MONSTERS
if (!m_stalker && !m_client)
return (true);
#endif
float object_distance, distance = object_visible_distance(game_object,object_distance);
CNotYetVisibleObject *object = not_yet_visible_object(game_object);
if (distance < object_distance) {
if (object) {
object->m_value -= current_state().m_decrease_value;
if (object->m_value < 0.f)
object->m_value = 0.f;
else
object->m_update_time = Device.dwTimeGlobal;
return (object->m_value >= current_state().m_visibility_threshold);
}
return (false);
}
if (!object) {
CNotYetVisibleObject new_object;
new_object.m_object = game_object;
new_object.m_prev_time = 0;
new_object.m_value = get_visible_value(distance,object_distance,time_delta,get_object_velocity(game_object,new_object),object_luminocity(game_object));
clamp (new_object.m_value,0.f,current_state().m_visibility_threshold + EPS_L);
new_object.m_update_time = Device.dwTimeGlobal;
new_object.m_prev_time = get_prev_time(game_object);
add_not_yet_visible_object (new_object);
return (new_object.m_value >= current_state().m_visibility_threshold);
}
object->m_update_time = Device.dwTimeGlobal;
object->m_value += get_visible_value(distance,object_distance,time_delta,get_object_velocity(game_object,*object),object_luminocity(game_object));
clamp (object->m_value,0.f,current_state().m_visibility_threshold + EPS_L);
object->m_prev_time = get_prev_time(game_object);
return (object->m_value >= current_state().m_visibility_threshold);
}
void CVisualMemoryManager::add_visible_object (const CObject *object, float time_delta, bool fictitious)
{
#ifndef MASTER_GOLD
if (object && (object->CLS_ID == CLSID_OBJECT_ACTOR) && psAI_Flags.test(aiIgnoreActor))
return;
#endif // MASTER_GOLD
xr_vector<CVisibleObject>::iterator J;
const CGameObject *game_object;
const CGameObject *self;
// START_PROFILE("Memory Manager/visuals/update/add_visibles/visible")
game_object = smart_cast<const CGameObject*>(object);
if (!game_object || (!fictitious && !visible(game_object,time_delta)))
return;
// STOP_PROFILE
// START_PROFILE("Memory Manager/visuals/update/add_visibles/find_object_by_id")
self = m_object;
J = std::find(m_objects->begin(),m_objects->end(),object_id(game_object));
// STOP_PROFILE
// START_PROFILE("Memory Manager/visuals/update/add_visibles/fill")
if (m_objects->end() == J) {
CVisibleObject visible_object;
visible_object.fill (game_object,self,mask(),mask());
#ifdef USE_FIRST_GAME_TIME
visible_object.m_first_game_time = Level().GetGameTime();
#endif
#ifdef USE_FIRST_LEVEL_TIME
visible_object.m_first_level_time = Device.dwTimeGlobal;
#endif
if (m_max_object_count <= m_objects->size()) {
xr_vector<CVisibleObject>::iterator I = std::min_element(m_objects->begin(),m_objects->end(),SLevelTimePredicate<CGameObject>());
VERIFY (m_objects->end() != I);
*I = visible_object;
}
else
m_objects->push_back(visible_object);
}
else {
if (!fictitious)
(*J).fill (game_object,self,(*J).m_squad_mask.get() | mask(),(*J).m_visible.get() | mask());
else {
(*J).m_visible.assign ((*J).m_visible.get() | mask());
(*J).m_squad_mask.assign((*J).m_squad_mask.get() | mask());
(*J).m_enabled = true;
}
}
// STOP_PROFILE
}
void CVisualMemoryManager::add_visible_object (const CVisibleObject visible_object)
{
#ifndef MASTER_GOLD
if (visible_object.m_object && (visible_object.m_object->CLS_ID == CLSID_OBJECT_ACTOR) && psAI_Flags.test(aiIgnoreActor))
return;
#endif // MASTER_GOLD
VERIFY (m_objects);
xr_vector<CVisibleObject>::iterator J = std::find(m_objects->begin(),m_objects->end(),object_id(visible_object.m_object));
if (m_objects->end() != J)
*J = visible_object;
else
if (m_max_object_count <= m_objects->size()) {
xr_vector<CVisibleObject>::iterator I = std::min_element(m_objects->begin(),m_objects->end(),SLevelTimePredicate<CGameObject>());
VERIFY (m_objects->end() != I);
*I = visible_object;
}
else
m_objects->push_back(visible_object);
}
#ifdef DEBUG
void CVisualMemoryManager::check_visibles () const
{
squad_mask_type mask = this->mask();
xr_vector<CVisibleObject>::iterator I = m_objects->begin();
xr_vector<CVisibleObject>::iterator E = m_objects->end();
for ( ; I != E; ++I) {
if (!(*I).visible(mask))
continue;
xr_vector<Feel::Vision::feel_visible_Item>::iterator i = m_object->feel_visible.begin();
xr_vector<Feel::Vision::feel_visible_Item>::iterator e = m_object->feel_visible.end();
for (; i!=e; ++i)
if (i->O->ID() == (*I).m_object->ID()) {
VERIFY (i->fuzzy > 0.f);
break;
}
}
}
#endif
bool CVisualMemoryManager::visible(u32 _level_vertex_id, float yaw, float eye_fov) const
{
Fvector direction;
direction.sub (ai().level_graph().vertex_position(_level_vertex_id),m_object->Position());
direction.normalize_safe();
float y, p;
direction.getHP (y,p);
if (angle_difference(yaw,y) <= eye_fov*PI/180.f/2.f)
return(ai().level_graph().check_vertex_in_direction(m_object->ai_location().level_vertex_id(),m_object->Position(),_level_vertex_id));
else
return(false);
}
float CVisualMemoryManager::feel_vision_mtl_transp(CObject* O, u32 element)
{
float vis = 1.f;
if (O){
CKinematics* V = smart_cast<CKinematics*>(O->Visual());
if (0!=V){
CBoneData& B = V->LL_GetData((u16)element);
vis = GMLib.GetMaterialByIdx(B.game_mtl_idx)->fVisTransparencyFactor;
}
}else{
CDB::TRI* T = Level().ObjectSpace.GetStaticTris()+element;
vis = GMLib.GetMaterialByIdx(T->material)->fVisTransparencyFactor;
}
return vis;
}
struct CVisibleObjectPredicateEx {
const CObject *m_object;
CVisibleObjectPredicateEx (const CObject *object) :
m_object (object)
{
}
bool operator() (const MemorySpace::CVisibleObject &visible_object) const
{
if (!m_object)
return (!visible_object.m_object);
if (!visible_object.m_object)
return (false);
return (m_object->ID() == visible_object.m_object->ID());
}
bool operator() (const MemorySpace::CNotYetVisibleObject ¬_yet_visible_object) const
{
if (!m_object)
return (!not_yet_visible_object.m_object);
if (!not_yet_visible_object.m_object)
return (false);
return (m_object->ID() == not_yet_visible_object.m_object->ID());
}
};
void CVisualMemoryManager::remove_links (CObject *object)
{
{
VERIFY (m_objects);
VISIBLES::iterator I = std::find_if(m_objects->begin(),m_objects->end(),CVisibleObjectPredicateEx(object));
if (I != m_objects->end())
m_objects->erase (I);
}
{
NOT_YET_VISIBLES::iterator I = std::find_if(m_not_yet_visible_objects.begin(),m_not_yet_visible_objects.end(),CVisibleObjectPredicateEx(object));
if (I != m_not_yet_visible_objects.end())
m_not_yet_visible_objects.erase (I);
}
}
CVisibleObject *CVisualMemoryManager::visible_object (const CGameObject *game_object)
{
VISIBLES::iterator I = std::find_if(m_objects->begin(),m_objects->end(),CVisibleObjectPredicateEx(game_object));
if (I == m_objects->end())
return (0);
return (&*I);
}
IC squad_mask_type CVisualMemoryManager::mask () const
{
if (!m_stalker)
return (squad_mask_type(-1));
return (m_stalker->agent_manager().member().mask(m_stalker));
}
void CVisualMemoryManager::update (float time_delta)
{
START_PROFILE("Memory Manager/visuals/update")
clear_delayed_objects ();
if (!enabled())
return;
m_last_update_time = Device.dwTimeGlobal;
squad_mask_type mask = this->mask();
VERIFY (m_objects);
m_visible_objects.clear ();
START_PROFILE("Memory Manager/visuals/update/feel_vision_get")
if (m_object)
m_object->feel_vision_get (m_visible_objects);
else {
VERIFY (m_client);
m_client->feel_vision_get (m_visible_objects);
}
STOP_PROFILE
START_PROFILE("Memory Manager/visuals/update/make_invisible")
{
xr_vector<CVisibleObject>::iterator I = m_objects->begin();
xr_vector<CVisibleObject>::iterator E = m_objects->end();
for ( ; I != E; ++I)
if ((*I).m_level_time + current_state().m_still_visible_time < Device.dwTimeGlobal)
(*I).visible (mask,false);
}
STOP_PROFILE
START_PROFILE("Memory Manager/visuals/update/add_visibles")
{
xr_vector<CObject*>::const_iterator I = m_visible_objects.begin();
xr_vector<CObject*>::const_iterator E = m_visible_objects.end();
for ( ; I != E; ++I)
add_visible_object (*I,time_delta);
}
STOP_PROFILE
START_PROFILE("Memory Manager/visuals/update/make_not_yet_visible")
{
xr_vector<CNotYetVisibleObject>::iterator I = m_not_yet_visible_objects.begin();
xr_vector<CNotYetVisibleObject>::iterator E = m_not_yet_visible_objects.end();
for ( ; I != E; ++I)
if ((*I).m_update_time < Device.dwTimeGlobal)
(*I).m_value = 0.f;
}
STOP_PROFILE
START_PROFILE("Memory Manager/visuals/update/removing_offline")
// verifying if object is online
{
m_objects->erase (
std::remove_if(
m_objects->begin(),
m_objects->end(),
SRemoveOfflinePredicate()
),
m_objects->end()
);
}
// verifying if object is online
{
m_not_yet_visible_objects.erase (
std::remove_if(
m_not_yet_visible_objects.begin(),
m_not_yet_visible_objects.end(),
SRemoveOfflinePredicate()
),
m_not_yet_visible_objects.end()
);
}
STOP_PROFILE
#if 0//def DEBUG
if (m_stalker) {
CAgentMemberManager::MEMBER_STORAGE::const_iterator I = m_stalker->agent_manager().member().members().begin();
CAgentMemberManager::MEMBER_STORAGE::const_iterator E = m_stalker->agent_manager().member().members().end();
for ( ; I != E; ++I)
(*I)->object().memory().visual().check_visibles();
}
#endif
if (m_object && g_actor && m_object->is_relation_enemy(Actor())) {
xr_vector<CNotYetVisibleObject>::iterator I = std::find_if(
m_not_yet_visible_objects.begin(),
m_not_yet_visible_objects.end(),
CNotYetVisibleObjectPredicate(Actor())
);
if (I != m_not_yet_visible_objects.end()) {
Actor()->SetActorVisibility (
m_object->ID(),
clampr(
(*I).m_value/visibility_threshold(),
0.f,
1.f
)
);
}
else
Actor()->SetActorVisibility (m_object->ID(),0.f);
}
STOP_PROFILE
}
void CVisualMemoryManager::save (NET_Packet &packet) const
{
if (m_client)
return;
if (!m_object->g_Alive())
return;
packet.w_u8 ((u8)objects().size());
VISIBLES::const_iterator I = objects().begin();
VISIBLES::const_iterator E = objects().end();
for ( ; I != E; ++I) {
VERIFY ((*I).m_object);
packet.w_u16 ((*I).m_object->ID());
// object params
packet.w_u32 ((*I).m_object_params.m_level_vertex_id);
packet.w_vec3 ((*I).m_object_params.m_position);
#ifdef USE_ORIENTATION
packet.w_float ((*I).m_object_params.m_orientation.yaw);
packet.w_float ((*I).m_object_params.m_orientation.pitch);
packet.w_float ((*I).m_object_params.m_orientation.roll);
#endif // USE_ORIENTATION
// self params
packet.w_u32 ((*I).m_self_params.m_level_vertex_id);
packet.w_vec3 ((*I).m_self_params.m_position);
#ifdef USE_ORIENTATION
packet.w_float ((*I).m_self_params.m_orientation.yaw);
packet.w_float ((*I).m_self_params.m_orientation.pitch);
packet.w_float ((*I).m_self_params.m_orientation.roll);
#endif // USE_ORIENTATION
#ifdef USE_LEVEL_TIME
packet.w_u32 ((Device.dwTimeGlobal >= (*I).m_level_time) ? (Device.dwTimeGlobal - (*I).m_level_time) : 0);
#endif // USE_LAST_LEVEL_TIME
#ifdef USE_LEVEL_TIME
packet.w_u32 ((Device.dwTimeGlobal >= (*I).m_level_time) ? (Device.dwTimeGlobal - (*I).m_last_level_time) : 0);
#endif // USE_LAST_LEVEL_TIME
#ifdef USE_FIRST_LEVEL_TIME
packet.w_u32 ((Device.dwTimeGlobal >= (*I).m_level_time) ? (Device.dwTimeGlobal - (*I).m_first_level_time) : 0);
#endif // USE_FIRST_LEVEL_TIME
packet.w_u32 ((*I).m_visible.flags);
}
}
void CVisualMemoryManager::load (IReader &packet)
{
if (m_client)
return;
if (!m_object->g_Alive())
return;
typedef CClientSpawnManager::CALLBACK_TYPE CALLBACK_TYPE;
CALLBACK_TYPE callback;
callback.bind (&m_object->memory(),&CMemoryManager::on_requested_spawn);
int count = packet.r_u8();
for (int i=0; i<count; ++i) {
CDelayedVisibleObject delayed_object;
delayed_object.m_object_id = packet.r_u16();
CVisibleObject &object = delayed_object.m_visible_object;
object.m_object = smart_cast<CGameObject*>(Level().Objects.net_Find(delayed_object.m_object_id));
// object params
object.m_object_params.m_level_vertex_id = packet.r_u32();
packet.r_fvector3 (object.m_object_params.m_position);
#ifdef USE_ORIENTATION
packet.r_float (object.m_object_params.m_orientation.yaw);
packet.r_float (object.m_object_params.m_orientation.pitch);
packet.r_float (object.m_object_params.m_orientation.roll);
#endif
// self params
object.m_self_params.m_level_vertex_id = packet.r_u32();
packet.r_fvector3 (object.m_self_params.m_position);
#ifdef USE_ORIENTATION
packet.r_float (object.m_self_params.m_orientation.yaw);
packet.r_float (object.m_self_params.m_orientation.pitch);
packet.r_float (object.m_self_params.m_orientation.roll);
#endif
#ifdef USE_LEVEL_TIME
VERIFY (Device.dwTimeGlobal >= object.m_level_time);
object.m_level_time = packet.r_u32();
object.m_level_time += Device.dwTimeGlobal;
#endif // USE_LEVEL_TIME
#ifdef USE_LAST_LEVEL_TIME
VERIFY (Device.dwTimeGlobal >= object.m_last_level_time);
object.m_last_level_time = packet.r_u32();
object.m_last_level_time += Device.dwTimeGlobal;
#endif // USE_LAST_LEVEL_TIME
#ifdef USE_FIRST_LEVEL_TIME
VERIFY (Device.dwTimeGlobal >= (*I).m_first_level_time);
object.m_first_level_time = packet.r_u32();
object.m_first_level_time += Device.dwTimeGlobal;
#endif // USE_FIRST_LEVEL_TIME
object.m_visible.assign (packet.r_u32());
if (object.m_object) {
add_visible_object (object);
continue;
}
m_delayed_objects.push_back (delayed_object);
const CClientSpawnManager::CSpawnCallback *spawn_callback = Level().client_spawn_manager().callback(delayed_object.m_object_id,m_object->ID());
if (!spawn_callback || !spawn_callback->m_object_callback)
if(!g_dedicated_server)
Level().client_spawn_manager().add (delayed_object.m_object_id,m_object->ID(),callback);
#ifdef DEBUG
else {
if (spawn_callback && spawn_callback->m_object_callback) {
VERIFY (spawn_callback->m_object_callback == callback);
}
}
#endif // DEBUG
}
}
void CVisualMemoryManager::clear_delayed_objects()
{
if (m_client)
return;
if (m_delayed_objects.empty())
return;
CClientSpawnManager &manager = Level().client_spawn_manager();
DELAYED_VISIBLE_OBJECTS::const_iterator I = m_delayed_objects.begin();
DELAYED_VISIBLE_OBJECTS::const_iterator E = m_delayed_objects.end();
for ( ; I != E; ++I)
manager.remove ((*I).m_object_id,m_object->ID());
m_delayed_objects.clear ();
}
void CVisualMemoryManager::on_requested_spawn (CObject *object)
{
DELAYED_VISIBLE_OBJECTS::iterator I = m_delayed_objects.begin();
DELAYED_VISIBLE_OBJECTS::iterator E = m_delayed_objects.end();
for ( ; I != E; ++I) {
if ((*I).m_object_id != object->ID())
continue;
if (m_object->g_Alive()) {
(*I).m_visible_object.m_object = smart_cast<CGameObject*>(object);
VERIFY ((*I).m_visible_object.m_object);
add_visible_object ((*I).m_visible_object);
}
m_delayed_objects.erase (I);
return;
}
}
| [
"kdementev@gmail.com"
] | kdementev@gmail.com |
15eb571bdfb1a4d9ae52c8260496c134d155cf3a | 607066c66f84520792159cc48c0b6fe54d365f7c | /UPCScanner Hash/UPCScanner/BarcodeBSTScanner.cpp | 195f3214a094fcbedfa26fbb5599b79943d7c528 | [] | no_license | billythemoose/CS300 | 89fa90f0ed319e1c5391c811390f32a5aa8644a4 | 90b490f810bf5170d38515fc5e8d8804ebebbdbf | refs/heads/master | 2020-03-31T03:53:59.619734 | 2018-12-03T01:32:27 | 2018-12-03T01:32:27 | 151,883,266 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,267 | cpp |
#include "BarcodeBSTScanner.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <codecvt>
// initialize BST
void BarcodeBSTScanner::initialize()
{
scanner = new BinarySearchTree<UPC>();
}
// BST constructor base
BarcodeBSTScanner::BarcodeBSTScanner()
{
initialize();
}
// BST destructor
BarcodeBSTScanner::~BarcodeBSTScanner()
{
delete scanner;
}
// search BST for provided code
void BarcodeBSTScanner::find(int64_t& code)
{
UPC temp = UPC(code);
UPC result = scanner->find(temp);
cout << result;
}
// load UPC information from CSV file into BST
void BarcodeBSTScanner::loadFromFile(std::string& filePath)
{
try
{
ifstream file;
file.open(filePath);
file.imbue(locale());
string placeholderLine;
// dump column header line
getline(file, placeholderLine);
// loop through file and load UPC
while(getline(file, placeholderLine))
{
// int key;
int64_t key;
string value;
string placeholderKey;
istringstream st(placeholderLine);
getline(st, placeholderKey, ',');
getline(st, value);
istringstream stNum(placeholderKey);
stNum >> key;
UPC* add = new UPC(key, value);
scanner->insert(*add);
}
file.close();
}
catch (std::exception& e)
{
std::cout << e.what() << endl;
}
} | [
"mdiegothomas@outlook.com"
] | mdiegothomas@outlook.com |
8fdfdb4be7f8b584e15b0dfcec16a976a70fd6d4 | b45af136dec39636d6c98f0cae5938b49da9538f | /threads_examples/thread_guard.h | 44c1b335dc1b9402350205f8d31aa6d2fd3b70ca | [
"Apache-2.0"
] | permissive | carlosb1/examples-c14 | d7647c9913e6782eabe96c64d5cd076500c8fa9c | 1db742781a6bfcc5d50cfbd1fed16678399dfcce | refs/heads/master | 2020-12-12T11:53:14.934728 | 2019-03-14T16:57:39 | 2019-03-14T16:57:39 | 42,791,871 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 331 | h | #include <thread>
#ifndef THREADGUARD
#define THREADGUARD
class ThreadGuard
{
std::thread& t;
public:
explicit ThreadGuard(std::thread& t_):
t(t_)
{}
~ThreadGuard(){
if (t.joinable()){
t.join();
}
}
ThreadGuard(ThreadGuard const&)=delete;
ThreadGuard& operator=(ThreadGuard const&)=delete;
};
#endif
| [
"carlos.baezruiz@gmail.com"
] | carlos.baezruiz@gmail.com |
5ca88f0689ca41d765d5da6960159a1fdb8e1174 | ad465fee1da7eb36b1c65fd097f6849eb26c0588 | /software/arduino/mailbox/mailbox_client/mailbox_client.ino | 34d05bfb88b90d74102958c97480862a2c1ca55d | [] | no_license | ermo32/NRF905_sensor | c0065455e1950fe51b6857d795788790fe9b6071 | a11c37b7050f3621d1dc7802b4e13fe605b3113e | refs/heads/master | 2020-03-14T08:09:58.937917 | 2018-07-14T19:53:45 | 2018-07-14T19:53:45 | 131,518,903 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,694 | ino | /*
* Project: nRF905 AVR/Arduino Library/Driver (Low power ping client example)
* Author: Zak Kemble, contact@zakkemble.co.uk
* Copyright: (C) 2017 by Zak Kemble
* License: GNU GPL v3 (see License.txt)
* Web: http://blog.zakkemble.co.uk/nrf905-avrarduino-librarydriver/
*/
/*
* Similar to the ping client example
* Power up the nRF905 to transmit some data, wait for a reply, turn off and wait for a second.
* Output power is set to the lowest setting, receive sensitivity is lowered and uses the power up/down feature of the nRF905.
*
* 7 -> CE
* 8 -> PWR
* 9 -> TXE
* 4 -> CD
* 3 -> DR
* 2 -> AM
* 10 -> CSN
* 12 -> SO
* 11 -> SI
* 13 -> SCK
*
* 5 -> power detect 1 (mail set)
* 6 -> power detect 2 (mail reset)
*
* Powerconsumption @Vcc = 8.3 Volt:
* TX + RX on = 28.3 mA
* Sleep NRF905 = 16.0 mA
* Sleep NRF905 + Arduino = 12.8 mA
*/
#include <nRF905.h>
#include <avr/sleep.h>
#define RXADDR 0xFE4CA6E5 // Address of this device
#define TXADDR 0x586F2E10 // Address of device to send to
#define TIMEOUT 1000 // 1 second ping timeout
#define PACKET_NONE 0
#define PACKET_OK 1
#define PACKET_INVALID 2
static volatile uint8_t packetStatus;
void NRF905_CB_RXCOMPLETE(void)
{
packetStatus = PACKET_OK;
}
void NRF905_CB_RXINVALID(void)
{
packetStatus = PACKET_INVALID;
}
void setup()
{
Serial.begin(115200);
Serial.println(F("Client started"));
pinMode(A5, OUTPUT); // LED
pinMode( 5, INPUT_PULLUP); // Switch mail set
pinMode( 6, INPUT_PULLUP); // Switch mail set
// Start up
nRF905_init();
// Set address of this device
nRF905_setListenAddress(RXADDR);
// Lowest transmit level -10db
nRF905_setTransmitPower(NRF905_PWR_10);
// Reduce receive sensitivity to save a few mA
//nRF905_setLowRxPower(NRF905_LOW_RX_ENABLE);
}
void loop()
{
static uint8_t counter;
static uint32_t sent;
static uint8_t payload_size;
static uint16_t state1, state2;
while(sent<11)
{
payload_size = 1;
// Make data
char data[1] = {0};
sprintf(data, "A");
counter++;
packetStatus = PACKET_NONE;
Serial.print(F("Sending data: "));
Serial.println(data);
// Send the data (send fails if other transmissions are going on, keep trying until success) and enter RX mode on completion
// If the radio is powered down then this function will take an additional 3ms to complete
while(!nRF905_TX(TXADDR, data, sizeof(data), NRF905_NEXTMODE_RX));
sent++;
Serial.println(F("Data sent, waiting for reply..."));
uint8_t success;
while(1)
{
success = packetStatus;
if(success != PACKET_NONE)
break;
}
if(success == PACKET_INVALID)
{
Serial.println(F("Invalid packet!"));
}
else
{
// If success toggle LED and send ping time over UART
static uint8_t ledState;
digitalWrite(A5, ledState ? HIGH : LOW);
ledState = !ledState;
// Get the ping data
uint8_t replyData[1];
nRF905_read(replyData, sizeof(replyData));
// Print out ping contents
Serial.print(F("Data from server: "));
Serial.write(replyData,sizeof(replyData));
Serial.println();
state1 = digitalRead(5);
state2 = digitalRead(6);
Serial.print(F("Status inputs: "));
Serial.print(state1+65);
Serial.print(state2+65);
Serial.println();
}
Serial.print(F("Totals: "));
Serial.print(sent);
Serial.println(F("------"));
delay(100);
}
// Turn off module
nRF905_powerDown();
set_sleep_mode(SLEEP_MODE_PWR_DOWN); // sleep mode is set here
sleep_enable(); //saves 3.2 mA
sleep_mode();
while(1);
}
| [
"erik@moddejonge.com"
] | erik@moddejonge.com |
1325ea3a7a99198279fff6c595e36a55a6fb055d | 7723ca535274cb071407ccd59ad357ae2029610c | /Count_and_Say/Count_and_Say.cpp | d0e08976446a46843edc9dda488cbd12439cb066 | [] | no_license | u-shannne/Leetcode-Practice | 11962c4195cbcad098233978fe3d0113eb511fe1 | c4544733bcb063f98d73eda695e93ce49c11e50c | refs/heads/master | 2023-05-22T19:26:19.308789 | 2021-06-14T15:38:18 | 2021-06-14T15:38:18 | 371,708,970 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 742 | cpp | #include <iostream>
#include <string>
#include <vector>
#include <math.h>
using namespace std;
string process(string s = "1")
{
int times = 0;
char sign;
string _s;
int i = 0;
while (i < s.size())
{
times = 0;
sign = s[i];
while (s[i] == sign)
{
times++;
i++;
}
// printf("i:%d time:%d sign:%c\n", i, times, sign);
_s.push_back('0' + times);
_s.push_back(sign);
}
return _s;
}
string countAndSay(int n)
{
string s = "1";
for (int i = 1; i < n; i++)
{
s = process(s);
cout << s << endl;
}
printf("\n\n");
return s;
}
int main()
{
cout << countAndSay(4) << endl;
return 0;
} | [
"ccushane115@alum.ccu.edu.tw"
] | ccushane115@alum.ccu.edu.tw |
2ecdce336354f4896a47d6e218a626c786912334 | f12fba78fbe3ea306766cb32e27d16a693418203 | /ACM-Codebook/Book1 - Graph Theory/spanning-tree/ratio.cpp | aab48ffbe6b5f68c94b74e9dc7dc8d2348d21a7f | [] | no_license | wx-csy/ACM-Code-Library | ffb51f965d84116c8c749428070be951a62a6484 | 9c0e4d1c434801fae799469add43730a6605da6a | refs/heads/master | 2021-01-20T05:37:18.682370 | 2018-10-16T07:14:50 | 2018-10-16T07:14:50 | 89,795,537 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 429 | cpp | double k;
struct edge{
int u, v;
double cost, dist;
double w(return cost - dist * w);
bool operator < (const edge& rhs) const {
return w() < rhs.w();
}
};
double mst(){
// return sum(dist[e])/sum(cost[e]) for all e in mst
}
double solve(){
k = 1e5; // initial k estimate
double nxt;
while (fabs((nxt = mst()) - k)) > 1e-8){ // admissible error
k = nxt;
}
return k;
}
| [
"sy_chen@smail.nju.edu.cn"
] | sy_chen@smail.nju.edu.cn |
abae6ba8b9cfd842f0c8928ba23846fe6861d8b9 | b0bfa899191d57adc5599d3bf3d1df5776bf6e9e | /notes/Monday - 0614/asdf/main.cpp | 21f0ae3fae0e5b72243bd6c61b864bcefde41a90 | [] | no_license | chris-womack/dataStructures | 2e71cc6e0ee9baf43825c83a90bff2f5fe5d221d | 717d50a767287643da08d8693d57ed368bd5125c | refs/heads/master | 2021-01-01T16:40:02.517650 | 2014-09-14T00:59:14 | 2014-09-14T00:59:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,526 | cpp | #include <iostream>
#include "LinkedListNotes.h"
//#include "LinkedListNotes.cpp"
using namespace std;
struct node{
int x;
node *next; // this will be an address
};
int main()
{
int a[4];
for(int i = 0; i < 4; i++)
cout << "address of a " << &a[i] << endl;
// dynamic memory allocation
int *iArray;
iArray = new int[5]; //
for(int z = 0; z < 5; z++){
cout << iArray[z] << endl;
}
node *root;
node *head;
root = new node;
// head and root point to the same place
head = root;
root->x = 5; // this will allows us to get to x. if not it woud be root.x
// allocate memory for next node
node *n1;
n1 = new node; // give me space for something the size node.
root->next = n1;
cout << "address of n1 " << n1 << endl;
cout << "address of root->next " << root->next << endl;
int i = 0;
while(i < 5){
root = root->next;
node *n2 = new node;
n2->x = i+2; // this sets value of x in struct n2
n2->next = 0; // this sets value of next in struct n2
root->next = n2;
i++;
}
root = head;
for(int j = 0; j < 5; j++){
cout << root-> x << endl;
root = root->next;
}
// header files
CNode *classNode;
classNode = new CNode(0);
CNode *cHead;
cHead = classNode; // store the starting location
CNode *next;
next = new CNode(1);
classNode->setNext(next);
i = 0;
while(i < 5){
CNode *next;
next = new CNode(i+2);
classNode = classNode->getNext();
classNode->setNext(next);
cout << classNode->getX() << endl;
i++;
}
return 0;
}
| [
"RedBeard@Chriss-MacBook-Air.local"
] | RedBeard@Chriss-MacBook-Air.local |
713ba34c2756d89ba55ea65d544c69f0c5c0bf8c | 152f13462437d042efab568e514d4ab6c1e182ee | /Baselib/MsgObjectMgr.cpp | c82957f3024843f1cb0e9f4e470d9bed8aacaedb | [] | no_license | ZhouchaoAlbert/MiniQQ | fc900290482e700dd2908529b37cd44f2e28ed1d | 387540f24ec7467c3908cadd6445acf91365e97b | refs/heads/master | 2020-09-16T22:03:40.879243 | 2018-02-25T09:46:43 | 2018-02-25T09:46:43 | 66,358,640 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,172 | cpp | #include "MsgObjectMgr.h"
CMsgObjectMgr::CMsgObjectMgr()
{
}
CMsgObjectMgr::~CMsgObjectMgr()
{
}
void CMsgObjectMgr::Register(CMsgBase* pMsgBase)
{
map<CMsgBase*, CMsgObject*>::iterator iter = m_mapMsgObject.find(pMsgBase);
if (iter == m_mapMsgObject.end())
{
CMsgObject* pMsgObject = new CMsgObject;
ATLASSERT(pMsgObject);
m_mapMsgObject[pMsgBase] = pMsgObject;
}
}
void CMsgObjectMgr::UnRegister(CMsgBase* pMsgBase)
{
map<CMsgBase*, CMsgObject*>::iterator iter = m_mapMsgObject.find(pMsgBase);
if (iter != m_mapMsgObject.end())
{
CMsgObject* pMsgObject = iter->second;
m_mapMsgObject.erase(iter);
pMsgObject->Destroy();
}
}
void CMsgObjectMgr::AddMsg(CMsgBase* pMsgBase, UINT32 uMsgID)
{
CMsgObject* pMsgObject = FindMsgBase(pMsgBase);
if (pMsgObject)
{
pMsgObject->AddMsg(uMsgID);
}
}
void CMsgObjectMgr::DeleteMsg(CMsgBase* pMsgBase, UINT32 uMsgID)
{
CMsgObject* pMsgObject = FindMsgBase(pMsgBase);
if (pMsgObject)
{
pMsgObject->DeleteMsg(uMsgID);
}
}
void CMsgObjectMgr::Start(CMsgBase* pMsgBase)
{
CMsgObject* pMsgObject = FindMsgBase(pMsgBase);
if (pMsgObject)
{
pMsgObject->Start();
}
}
void CMsgObjectMgr::Stop(CMsgBase* pMsgBase)
{
CMsgObject* pMsgObject = FindMsgBase(pMsgBase);
if (pMsgObject)
{
pMsgObject->Stop();
}
}
HWND CMsgObjectMgr::GetMsgWnd(CMsgBase* pMsgBase)
{
CMsgObject* pMsgObject = FindMsgBase(pMsgBase);
if (pMsgObject)
{
return pMsgObject->GetMsgWnd();
}
return NULL;
}
CMsgObject* CMsgObjectMgr::FindMsgBase(CMsgBase* pMsgBase)
{
map<CMsgBase*, CMsgObject*>::iterator iter = m_mapMsgObject.find(pMsgBase);
if (iter != m_mapMsgObject.end())
{
return iter->second;
}
return NULL;
}
void CMsgObjectMgr::OnMessage(CMsgObject* pMsgObject, UINT32 uMsgID, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
for (map<CMsgBase*, CMsgObject*>::iterator iter = m_mapMsgObject.begin(); iter != m_mapMsgObject.end();iter++)
{
if (iter->second == pMsgObject)
{
CMsgBase* pMsgBase = iter->first;
pMsgBase->OnMessage(uMsgID, wParam, lParam, bHandled);
break;
}
}
} | [
"838944042@qq.com"
] | 838944042@qq.com |
a329a61f568060b6daa168ed4af576a93d6e591e | b3439873c106d69b6ae8110c36bcd77264e8c5a7 | /server/Common/Packets/CGShopSell.h | 455d23bf795122f796c08aeca5126cd6fcedbb8d | [] | no_license | cnsuhao/web-pap | b41356411dc8dad0e42a11e62a27a1b4336d91e2 | 7c9b1f49d9ba8d8e40f8fddae829c2e414ccfeca | refs/heads/master | 2021-05-28T01:01:18.122567 | 2013-11-19T06:49:41 | 2013-11-19T06:49:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,821 | h | // CGShopSell.h
//
// 客户端通知服务器要卖什么东西
//
//////////////////////////////////////////////////////
#ifndef __CGSHOPSELL_H__
#define __CGSHOPSELL_H__
#include "Type.h"
#include "Packet.h"
#include "PacketFactory.h"
#include "DB_Struct.h"
namespace Packets
{
class CGShopSell : public Packet
{
public:
CGShopSell( )
{
m_nBagIndex = 0;
m_UniqueID = 0;
};
virtual ~CGShopSell( ){};
//公用继承接口
virtual BOOL Read( SocketInputStream& iStream ) ;
virtual BOOL Write( SocketOutputStream& oStream )const ;
virtual UINT Execute( Player* pPlayer ) ;
virtual PacketID_t GetPacketID()const { return PACKET_CG_SHOPSELL ; }
virtual UINT GetPacketSize()const { return sizeof(BYTE)+sizeof(UINT);}
public:
BYTE GetBagIndex(VOID) const {return m_nBagIndex;};
VOID SetBagIndex(BYTE nNumber) {m_nBagIndex = nNumber;};
VOID SetUniqueID(UINT id) { m_UniqueID = id; }
UINT GetUniqueID(void) { return m_UniqueID; }
private:
BYTE m_nBagIndex; //格子索引
UINT m_UniqueID;
};
class CGShopSellFactory : public PacketFactory
{
public:
Packet* CreatePacket() { return new CGShopSell() ; }
PacketID_t GetPacketID()const { return PACKET_CG_SHOPSELL; };
UINT GetPacketMaxSize()const { return sizeof(BYTE)+sizeof(UINT);};
};
class CGShopSellHandler
{
public:
static UINT Execute( CGShopSell* pPacket, Player* pPlayer ) ;
};
}
using namespace Packets;
#endif
| [
"viticm@126.com"
] | viticm@126.com |
a17a0212e63f52329a5d1b5260155b6b183ac841 | 45546c170f5786f52925c34e5cde68e51af119ee | /bluetooth/test.cpp | d76f88b458ffe22bd1209ce0c7375a0e3c48a9da | [] | no_license | Yukariko/raspberry | f0f23cd090bdbf3b2697e7f9a5110f82e40248a5 | c3a962b203baeb14c777290aa1122fd2c9288e99 | refs/heads/master | 2020-03-10T17:54:51.770046 | 2018-04-14T11:50:33 | 2018-04-14T11:50:33 | 129,512,066 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,033 | cpp | #include <stdio.h>
#include <string.h>
#include <errno.h>
#include <wiringPi.h>
#include <wiringSerial.h>
#include <pthread.h>
pthread_t Run_thread;
char Data_in[10];
int fd, rcv_cnt=0, rcv_flag=99;
void *Thread1(void *pArg)
{
int i=0;
for(;;) {
if(serialDataAvail(fd) && (Data_in[i] = serialGetchar(fd)) > 0) {
printf("receive = %c hex=0x%x int %d\n", Data_in[i], Data_in[i], i);
fflush(stdout);
rcv_cnt=i++;
rcv_flag = 1;
}
else
i = 0;
delay(200);
}
return 0;
}
int main(void)
{
setbuf(stdout, NULL);
if(wiringPiSetupGpio() == -1)
return -1;
if((fd = serialOpen("/dev/ttyS0", 9600)) < 0) {
perror("serialOpen");
return -1;
}
pthread_create(&Run_thread, NULL, Thread1, NULL);
serialPuts(fd, "connect bluetooth\r\n");
for(int i=0;;) {
if(rcv_cnt > i && rcv_flag == 1) {
printf("send data = %x \n", Data_in[i]);
serialPutchar(fd, Data_in[i++]);
if(rcv_cnt == i) {
rcv_flag = rcv_cnt = 0;
} else {
i = 0;
fflush(stdin);
}
delay(1000);
}
}
return 0;
}
| [
"yukariko@github.com"
] | yukariko@github.com |
9c1a0b6bbdda11f5974075543e5fb3505efbb910 | 7fc8fb0260617667635a04589dda0b4e5cf021b5 | /Custom Factions/OPFOR/SLA/opfor_standard.hpp | 8fa6e7955b81ceb7ba93ba4f1495e3ec50bda867 | [] | no_license | The-Slime/missions | e41ca709b017028bbe80bf5f3b4e71b201715571 | 55de729d3fa25f1976a59bb51b5517fe7fb3317d | refs/heads/master | 2021-01-21T04:37:19.590423 | 2016-05-02T23:41:51 | 2016-05-02T23:41:51 | 35,856,046 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,170 | hpp | //Author:
//Description: OPFOR (CSAT) Standard
class opf_f {
//Rifle
#define EAST_RIFLE "rhs_weap_akm"
#define EAST_RIFLE_MAG "rhs_30Rnd_762x39mm:8","rhs_30Rnd_762x39mm_tracer:2"
//GL Rifle
#define EAST_GLRIFLE "rhs_weap_akm_gp25"
#define EAST_GLRIFLE_MAG "rhs_30Rnd_762x39mm:8","rhs_30Rnd_762x39mm_tracer:2"
#define EAST_GLRIFLE_MAG_SMOKE "rhs_GRD40_White:4","rhs_GRD40_Green:2","rhs_GRD40_Red:3"
#define EAST_GLRIFLE_MAG_HE "rhs_VOG25P:8"
#define EAST_GLRIFLE_MAG_FLARE "rhs_VG40OP_white:2","rhs_VG40OP_red:2"
//Carbine
#define EAST_CARBINE "rhs_weap_akms"
#define EAST_CARBINE_MAG "rhs_30Rnd_762x39mm:8","rhs_30Rnd_762x39mm_tracer:2"
//Diver
#define SDAR "arifle_SDAR_F"
#define SDAR_MAG "20Rnd_556x45_UW_mag:6"
// AR
#define EAST_AR "rhs_weap_pkm"
#define EAST_AR_MAG "rhs_100Rnd_762x54mmR:9"
#define EAST_AR_MAG2 "rhs_100Rnd_762x54mmR_green:5"
// AT
#define EAST_AT "ibr_rpg7v"
#define EAST_AT_MAG "ibr_pg7v:3"
// MMG
#define EAST_MMG "rhs_weap_pkm"
#define EAST_MMG_MAG "rhs_100Rnd_762x54mmR:5"
// MAT
#define EAST_MAT "ibr_rpg7v"
#define EAST_MAT_MAG "ibr_pg7v:1","ibr_og7:2"
// SAM
#define EAST_SAM "rhs_weap_igla"
#define EAST_SAM_MAG "rhs_mag_9k38_rocket:2"
// Sniper Rifle
#define EAST_SNIPER "rhs_weap_svdp_pso1"
#define EAST_SNIPER_MAG "rhs_10Rnd_762x54mmR_7N1:8"
// Spotter Rifle
#define EAST_SPOTTER "hlc_rifle_aek971"
#define EAST_SPOTTER_MAG "hlc_30Rnd_545x39_B_AK:8"
// SMG
#define EAST_SMG "rhs_weap_ak74m"
#define EAST_SMG_MAG "rhs_30Rnd_545x39_AK:6"
// Pistol
#define EAST_PISTOL "rhsusf_weap_m1911a1"
#define EAST_PISTOL_MAG "rhsusf_mag_7x45acp_MHP:4"
// Grenades, Smoke and Frag
#define EAST_GRENADE "rhs_mag_m67:2"
#define EAST_SMOKE_WHITE "rhs_mag_an_m8hc:2"
#define EAST_SMOKE_GREEN "rhs_mag_m18_green"
#define EAST_SMOKE_RED "rhs_mag_m18_red"
// ====================================================================================
class Car {
TransportMagazines[] = {EAST_RIFLE_MAG,EAST_RIFLE_MAG,EAST_CARBINE_MAG,EAST_AR_MAG,EAST_AR_MAG,EAST_GLRIFLE_MAG_HE,EAST_AT_MAG};
TransportItems[] = {"MEDICAL_VEHICLE"};
};
class Tank {
TransportMagazines[] = {EAST_RIFLE_MAG,EAST_RIFLE_MAG,EAST_CARBINE_MAG,EAST_AR_MAG,EAST_AR_MAG,EAST_GLRIFLE_MAG_HE,EAST_AT_MAG};
TransportItems[] = {"MEDICAL_VEHICLE"};
};
class Helicopter {
TransportMagazines[] = {};
};
class Plane {
TransportMagazines[] = {};
};
class Ship_F {
TransportMagazines[] = {};
};
// ====================================================================================
// Leadership INF and Groupies
class O_Soldier_F { // rifleman
uniform[] = {"LOP_U_SLA_Fatigue_01"}; /// randomized
vest[] = {"LOP_V_6Sh92_OLV","rhs_6sh92_digi"}; /// randomized
headgear[] = {"LOP_H_SSh68Helmet_OLV","LOP_H_SSh68Helmet_BLK"}; /// randomized
backpack[] = {"B_Kitbag_sgg"}; /// randomized
backpackItems[] = {"MEDICAL_STANDARD","ACE_IR_Strobe_item"};
weapons[] = {EAST_RIFLE}; /// randomized
launchers[] = {}; /// randomized
handguns[] = {}; /// randomized
magazines[] = {EAST_RIFLE_MAG,EAST_GRENADE,EAST_SMOKE_WHITE};
items[] = {"ACRE_PRC343"};
linkedItems[] = {"ItemMap","ItemCompass","ItemWatch"};
attachments[] = {""};
};
class O_officer_F: O_Soldier_F { // CO and DC
weapons[] = {EAST_GLRIFLE};
//vest[] = {"rhsusf_iotv_ocp_Grenadier"}; /// randomized
//headgear[] = {"rhsusf_ach_helmet_headset_ocp"}; /// randomized
magazines[] = {EAST_GLRIFLE_MAG,EAST_GLRIFLE_MAG_HE,EAST_GLRIFLE_MAG_SMOKE,EAST_GLRIFLE_MAG_FLARE,EAST_PISTOL_MAG,EAST_GRENADE,EAST_SMOKE_WHITE};
handguns[] = {EAST_PISTOL}; /// randomized
linkedItems[] += {"ItemGPS","Binocular"};
backpackItems[] += {"ACE_key_east","ACRE_PRC117F"};
items[] = {"ACE_MapTools", "ACRE_PRC148"};
};
class O_soldier_SL_F: O_Officer_F { // SL
linkedItems[] = {"ItemMap","ItemCompass","ItemWatch","ACRE_PRC343","NVGoggles","ItemGPS","Binocular"};
items[] = {"ACE_MapTools","ACRE_PRC148", "ACRE_PRC343"};
backpackItems[] = {"MEDICAL_LEADER","ACE_IR_Strobe_item"};
};
class O_soldier_UAV_F: O_Soldier_F {
backpack[] = {"O_UAV_01_backpack_F"}; /// randomized
linkedItems[] += {"O_uavterminal"};
};
// ====================================================================================
// Grunt Infantry
class O_Soldier_TL_F: O_Soldier_F {// FTL
weapons[] = {EAST_GLRIFLE};
//headgear[] = {"rhsusf_ach_helmet_headset_ess_ocp"}; /// randomized
magazines[] = {EAST_GLRIFLE_MAG,EAST_GLRIFLE_MAG_HE,EAST_GLRIFLE_MAG_SMOKE,EAST_GLRIFLE_MAG_FLARE,EAST_GRENADE,EAST_SMOKE_WHITE};
linkedItems[] += {"ItemGPS","Binocular"};
backpackItems[] += {"ACE_key_east"};
};
class O_soldier_GL_F: O_Soldier_TL_F { // SL
};
class O_Soldier_AR_F: O_Soldier_F {// AR
//vest[] = {"rhsusf_iotv_ocp_SAW"}; /// randomized
weapons[] = {EAST_AR};
magazines[] = {EAST_AR_MAG,EAST_PISTOL_MAG,EAST_GRENADE,EAST_SMOKE_WHITE};
handguns[] = {EAST_PISTOL}; /// randomized
attachments[] = {};
};
class O_Soldier_AAR_F: O_Soldier_F {// AAR
backpackItems[] += {EAST_AR_MAG2};
attachments[] = {""};
linkedItems[] += {"Binocular"};
};
class O_Soldier_A_F: O_Soldier_AAR_F {// AAR
};
class O_Soldier_LAT_F: O_Soldier_F {// RAT
weapons[] = {EAST_CARBINE};
magazines[] = {EAST_CARBINE_MAG,EAST_AT_MAG,EAST_GRENADE,EAST_SMOKE_WHITE};
launchers[] = {EAST_AT}; /// randomized
};
class O_medic_F: O_Soldier_F {// Medic
//vest[] = {"rhsusf_iotv_ocp_medic"}; /// randomized
backpack[] = {"B_Carryall_oli","B_Carryall_mcamo"};
weapons[] = {EAST_CARBINE};
magazines[] = {EAST_CARBINE_MAG,EAST_SMOKE_WHITE};
backpackItems[] = {"MEDICAL_MEDIC"};
};
// ====================================================================================
// Support Infantry
class O_support_MG_F: O_Soldier_F {// MMG
weapons[] = {EAST_MMG};
backpack[] = {"B_Carryall_oli","B_Carryall_mcamo"};
magazines[] = {EAST_MMG_MAG,EAST_PISTOL_MAG,EAST_GRENADE,EAST_SMOKE_WHITE};
handguns[] = {EAST_PISTOL}; /// randomized
};
class O_Support_AMG_F: O_Soldier_F {// MMG Spotter/Ammo Bearer
backpack[] = {"B_Carryall_oli","B_Carryall_mcamo"};
backpackItems[] += {EAST_MMG_MAG};
linkedItems[] += {"ACE_Vector"};
items[] += {"ACRE_PRC148"};
};
class O_soldier_AT_F: O_Soldier_F {// MAT Gunner
weapons[] = {EAST_CARBINE};
backpack[] = {"rhs_rpg_empty"};
magazines[] = {EAST_CARBINE_MAG,EAST_GRENADE,EAST_SMOKE_WHITE};
launchers[] = {EAST_MAT}; /// randomized
backpackItems[] += {EAST_MAT_MAG};
attachments[] = {"rhs_acc_1p63","rhs_acc_pgo7v","rhs_acc_dtk"};
};
class O_Soldier_AAT_F: O_Soldier_F {// MAT Spotter/Ammo Bearer
backpack[] = {"rhs_rpg_empty"};
backpackItems[] += {EAST_MAT_MAG};
linkedItems[] += {"ACE_Vector"};
items[] += {"ACRE_PRC148"};
};
class O_soldier_AA_F: O_Soldier_F {// SAM Gunner
weapons[] = {EAST_CARBINE};
backpack[] = {"B_Carryall_oli","B_Carryall_mcamo"};
magazines[] = {EAST_CARBINE_MAG,EAST_GRENADE,EAST_SMOKE_WHITE};
launchers[] = {EAST_SAM}; /// randomized
backpackItems[] += {EAST_SAM_MAG};
};
class O_Soldier_AAA_F: O_Soldier_F {// SAM Spotter/Ammo Bearer
backpack[] = {"B_Carryall_oli","B_Carryall_mcamo"};
backpackItems[] += {EAST_SAM_MAG};
linkedItems[] += {"ACE_Vector"};
items[] += {"ACRE_PRC148"};
};
class O_support_Mort_F: O_Soldier_F {// Mortar Gunner
weapons[] = {EAST_CARBINE};
magazines[] = {EAST_CARBINE_MAG,EAST_GRENADE,EAST_SMOKE_WHITE};
items[] = {"MEDICAL_STANDARD"};
backpack[] = {"O_Mortar_01_weapon_F"}; /// randomized
};
class O_support_AMort_F: O_Soldier_F {// Assistant Mortar
backpack[] = {"O_Mortar_01_support_F"}; /// randomized
items[] = {"MEDICAL_STANDARD", "ACRE_PRC148"};
linkedItems[] += {"ACE_Vector"};
};
class O_spotter_F {// Spotter
headgear[] = {"H_Bandanna_khk"}; /// randomized
//uniform[] = {"U_O_GhillieSuit"}; /// randomized
//vest[] = {"V_Chestrig_khk"}; /// randomized
weapons[] = {EAST_SPOTTER}; /// randomized
magazines[] = {EAST_SPOTTER_MAG,EAST_SMOKE_WHITE};
items[] = {"MEDICAL_STANDARD", "ACRE_PRC343"};
linkedItems[] = {"ItemMap","ItemCompass","ItemWatch","itemGPS","LaserDesignator"};
attachments[] = {"HLC_Optic_1p29"};
};
class O_sniper_F {// Sniper
headgear[] = {"H_Bandanna_khk"}; /// randomized
//uniform[] = {"U_O_GhillieSuit"}; /// randomized
//vest[] = {"V_Chestrig_khk"}; /// randomized
weapons[] = {EAST_SNIPER}; /// randomized
magazines[] = {EAST_SNIPER_MAG,EAST_SMOKE_WHITE};
items[] = {"MEDICAL_STANDARD", "ACRE_PRC343"};
linkedItems[] = {"ItemMap","ItemCompass","ItemWatch","itemGPS"};
attachments[] = {"rhs_acc_pso1m2"};
};
// ====================================================================================
// Vehicle Infantry
class O_Helipilot_F {// Pilot
//uniform[] = {"U_O_PilotCoveralls"}; /// randomized
//vest[] = {"V_TacVest_blk"}; /// randomized
headgear[] = {"H_PilotHelmetHeli_O"}; /// randomized
//backpack[] = {"B_AssaultPack_rgr"};
weapons[] = {EAST_SMG}; /// randomized
magazines[] = {EAST_SMG_MAG,EAST_SMOKE_WHITE};
items[] = {"MEDICAL_STANDARD","ACRE_PRC148"};
backpackItems[] = {"ACRE_PRC117F"};
linkedItems[] = {"ItemMap","ItemCompass","ItemWatch","itemGPS","NVgoggles"};
attachments[] = {};
};
class O_helicrew_F: O_Helipilot_F { // Pilot
};
class O_Pilot_F: O_Helipilot_F { // Pilot
uniform[] = {"U_O_PilotCoveralls"}; /// randomized
headgear[] = {"H_PilotHelmetFighter_O"}; /// randomized
};
class O_crew_F {// Crew
headgear[] = {"H_HelmetCrew_O"}; /// randomized
//uniform[] = {"U_O_SpecopsUniform_ocamo"}; /// randomized
//vest[] = {"V_BandollierB_khk"}; /// randomized
//backpack[] = {"B_Carryall_mcamo"};
weapons[] = {EAST_CARBINE}; /// randomized
magazines[] = {EAST_CARBINE_MAG,EAST_SMOKE_WHITE};
items[] = {};
backpackItems[] = {"ACRE_PRC117F", "ACE_fieldDressing:3","ACE_morphine","ACRE_PRC148"};
linkedItems[] = {"ItemMap","ItemCompass","ItemWatch","itemGPS"};
attachments[] = {};
};
class O_soldier_repair_F: O_crew_F {// Repair Specialist
backpack[] = {"B_Carryall_oli","B_Carryall_mcamo"};
backpackItems[] = {"Toolkit", "ACE_fieldDressing:3","ACE_morphine","ACRE_PRC148"};
items[] = {"ACRE_PRC343"};
//vest[] = {"V_HarnessO_brn"}; /// randomized
linkedItems[] = {"ItemMap","ItemCompass","ItemWatch"};
attachments[] = {};
};
class O_soldier_exp_F: O_soldier_repair_F {// Mines Specialist
backpack[] = {"B_Carryall_oli","B_Carryall_mcamo"};
backpackItems[] = {"Toolkit","ACE_DefusalKit","ACE_Clacker","MineDetector"};
magazines[] = {EAST_CARBINE_MAG,"ATMine_Range_Mag:2","APERSBoundingMine_Range_Mag:2","APERSMine_Range_Mag:2"};
attachments[] = {};
};
class O_engineer_F: O_soldier_repair_F {// Explosive Specialist
backpack[] = {"B_Carryall_oli","B_Carryall_mcamo"};
backpackItems[] = {"Toolkit","ACE_DefusalKit","ACE_Clacker","MineDetector"};
magazines[] = {EAST_CARBINE_MAG,"DemoCharge_Remote_Mag:3","SatchelCharge_Remote_Mag:2"};
attachments[] = {};
};
// ====================================================================================
// Special Infantry
class O_diver_TL_F: O_Soldier_TL_F {// Diver TL
weapons[] = {SDAR};
magazines[] = {SDAR_MAG,EAST_CARBINE_MAG,EAST_GRENADE,EAST_SMOKE_WHITE};
uniform[] = {"U_O_Wetsuit"}; /// randomized
vest[] = {"V_RebreatherIR"}; /// randomized
backpack[] = {"B_Carryall_mcamo"};
headgear[] = {};
backpackItems[] += {/*"U_O_CombatUniform_ocamo","V_HarnessO_brn","H_HelmetO_ocamo"*/EAST_CARBINE};
linkedItems[] += {"G_O_Diving"};
};
class O_diver_F: O_Soldier_F {// Diver
weapons[] = {SDAR};
magazines[] = {SDAR_MAG,EAST_CARBINE_MAG,EAST_GRENADE,EAST_SMOKE_WHITE};
uniform[] = {"U_O_Wetsuit"}; /// randomized
vest[] = {"V_RebreatherIR"}; /// randomized
backpack[] = {"B_Carryall_mcamo"};
headgear[] = {};
backpackItems[] += {/*"U_O_CombatUniform_ocamo","V_HarnessO_brn","H_HelmetO_ocamo"*/EAST_CARBINE};
linkedItems[] += {"G_O_Diving"};
};
};
| [
"muchopug@gmail.com"
] | muchopug@gmail.com |
f13d30135aaef2fb2f5d07b9be7209038f11c46f | fbeaf1efd36bcb937c31e417bc61bc6804fdb5a2 | /src/TrajectoryGenerator.cpp | 9038ee34edc63799638515f265f795716eb2e89a | [] | no_license | anupriyachhabra/CarND-Path-Planning | c78fc20dd94a4219a1f9df825db40b1f25976beb | c499c81e76666125a75ac99b280048bb9fa6af76 | refs/heads/master | 2020-12-30T10:50:57.337195 | 2017-08-14T12:48:03 | 2017-08-14T12:48:03 | 98,832,630 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,976 | cpp | //
// Created by Anupriya Chhabra on 7/31/17.
//
#include "TrajectoryGenerator.h"
#include "utils/spline.h"
vector<vector<double>> TrajectoryGenerator::generateTrajectories(vector<double> car_state, vector<double> previous_path_x,
vector<double> previous_path_y, int target_lane,
double target_vel) {
//lets have 3 values for next car_d (L, R, C)
vector<double> next_d = {2.0, 6.0, 10.0};
double timestep = 0.2;
vector<vector<double>> trajectory;
double ref_x = car_state[0];
double ref_y = car_state[1];
double ref_yaw = helper.deg2rad(car_state[4]);
int prev_size = previous_path_x.size();
vector<double> ptsx;
vector<double> ptsy;
if (prev_size < 2) {
// As previous path is very small we try to generate points by going back in time
// We need to generate points as spline needs minimum of 3 points to function properly
double prev_car_x = car_state[0] - cos(car_state[4]);
double prev_car_y = car_state[1] - sin(car_state[4]);
ptsx.push_back(prev_car_x);
ptsx.push_back(car_state[0]);
ptsy.push_back(prev_car_y);
ptsy.push_back(car_state[1]);
} else {
// use previous paths end point as reference if it is present, this is better for creating smoother trajectories
ref_x = previous_path_x[prev_size-1];
ref_y = previous_path_y[prev_size-1];
double ref_x_prev = previous_path_x[prev_size-2];
double ref_y_prev = previous_path_y[prev_size-2];
ref_yaw = atan2(ref_y - ref_y_prev, ref_x - ref_x_prev);
ptsx.push_back(ref_x_prev);
ptsx.push_back(ref_x);
ptsy.push_back(ref_y_prev);
ptsy.push_back(ref_y);
}
//ADD more points in frenet spaced 30 m apart
for (int i =0; i <3 ; i ++) {
vector<double> next_point = helper.getXY(car_state[2]+30*(i+1), 2+4*(target_lane) ,
road.map_waypoints_s, road.map_waypoints_x, road.map_waypoints_y);
ptsx.push_back(next_point[0]);
ptsy.push_back(next_point[1]);
}
// transform coordinates to vehicle's to make the math easier
helper.transformToVehicleCoord(ptsx, ptsy, ref_x, ref_y, ref_yaw);
//Generate Path
// Add previous_path for smoothing- use only 10 previous points
cout << "previous path size " << previous_path_x.size() << endl;
int previous_points = min((int)previous_path_x.size(), 50);
for (int i = 0; i < previous_points; i++){
vector<double> path { previous_path_x[i], previous_path_y[i] };
trajectory.push_back(path);
}
tk::spline s;
s.set_points(ptsx, ptsy);
// Break spline points so that we travel at reference velocity
// We chooose 30m as target below to calculate at some not so far distance in future
double target_x = 30.0;
double target_y = s(target_x);
double target_dist = sqrt((target_x*target_x)+(target_y*target_y));
double x_add_on = 0;
double vel_increment = (target_vel - car_state[5])/(50- previous_points);
double vel = car_state[5] + vel_increment;
//fill up rest of the trajectory making sure that the new generated points dont make the target_velocity go high
for (int i = 0; i < 50-previous_points; i++) {
double N = (target_dist/(0.02*vel/2.24));
double x_point = x_add_on+(target_x)/N;
double y_point = s(x_point);
x_add_on = x_point; // we want future points to be greater than the point already generated
double x_ref = x_point;
double y_ref = y_point;
// rotate to vehicle coordinates before adding to trajectory
x_point = (x_ref*cos(ref_yaw) - y_ref*sin(ref_yaw));
y_point = (x_ref*sin(ref_yaw) + y_ref*cos(ref_yaw));
x_point += ref_x;
y_point += ref_y;
vector<double> path { x_point, y_point };
//cout << "x_point" << x_point << endl;
trajectory.push_back(path);
vel += vel_increment;
if (vel > road.speed_limit) vel = road.speed_limit;
}
return trajectory;
}
| [
"achhabra@stayz.com.au"
] | achhabra@stayz.com.au |
b663b83f60235023344dd0eb30fcdf280d559844 | dda21f4378e37cf448d17b720da4a1c9eb2b24d7 | /SDK/SB_BP_Puddle_Shock_functions.cpp | d5cb3e722c13b29d0422cee17e4dfd76e8781bc0 | [] | no_license | zH4x/SpellBreak-FULL-SDK | ef45d77b63494c8771554a5d0e017cc297d8dbca | cca46d4a13f0e8a56ab8ae0fae778dd389d3b404 | refs/heads/master | 2020-09-12T17:25:58.697408 | 2018-12-09T22:49:03 | 2018-12-09T22:49:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 373 | cpp | // SpellBreak By Respecter (0.15.340) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "SB_BP_Puddle_Shock_parameters.hpp"
namespace SpellSDK
{
//---------------------------------------------------------------------------
//Functions
//---------------------------------------------------------------------------
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"45327951+realrespecter@users.noreply.github.com"
] | 45327951+realrespecter@users.noreply.github.com |
bfd56411da78100f3702ad6f9ac122d5fa974b47 | 0df201774f0f454d13ab46a574cd1cc6c4480da3 | /src/HeadingProvider.cpp | 3a04038426380a4917a59d49d6d6a29706af9dfe | [] | no_license | PedroHRPBS/positioning_system | b312c46f744bffa6cab132d577e74c349ab7cd87 | ddaff3ab756fcd46fd4c40656462f9cfd5e9572b | refs/heads/master | 2020-08-30T22:32:46.729178 | 2019-10-30T11:12:51 | 2019-10-30T11:12:51 | 218,508,399 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 113 | cpp | #include "HeadingProvider.hpp"
HeadingProvider::HeadingProvider() {
}
HeadingProvider::~HeadingProvider() {
} | [
"pedro.silva@ku.ac.ae"
] | pedro.silva@ku.ac.ae |
903014516cbb84388abe2b62bb8849f27cddaa36 | d0d1d920d675eecd86898f369f5c29846674d278 | /src/core/alien.cc | bf4ac5c230f638aac163c91ba1899a728567718c | [] | no_license | VSarabudla/spaceships-and-aliens | a243791e4ba22316a3e547dd86d3fabe922a449b | 784b2991ec8d6528d105cd4f1130caa2a36e437e | refs/heads/main | 2023-01-30T06:22:17.377881 | 2020-12-14T02:41:04 | 2020-12-14T02:41:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,003 | cc | #include "core/alien.h"
shooter::Alien::Alien(const glm::vec2& position, float radius,
float movement_speed, int health_points,
const ci::Color& bullet_color,
float bullet_movement_speed)
: Character(position, radius, movement_speed, health_points),
bullet_color_(bullet_color),
bullet_movement_speed_(bullet_movement_speed) {
}
shooter::Bullet shooter::Alien::ShootBullet(const glm::vec2& player_position) {
return shooter::Bullet(
position_,
bullet_movement_speed_ * glm::normalize(player_position - position_),
bullet_movement_speed_, bullet_color_);
}
void shooter::Alien::MoveTowardsPlayer(const glm::vec2& player_position) {
if (player_position.x - position_.x > 0) {
MoveRight();
} else if (player_position.x - position_.x < 0) {
MoveLeft();
}
if (player_position.y - position_.y > 0) {
MoveDown();
} else if (player_position.y - position_.y < 0) {
MoveUp();
}
}
| [
"woodsofnarnia@gail.com"
] | woodsofnarnia@gail.com |
4ab2db2cda16dfef5a6c526dc9de5f1e41f3d3b3 | 6828f3e02ae9935161c3ef4183be012a9216fd0f | /OnlineJudge/BOJ/BOJ/edit algorithm.cpp | bf0a643a71b5e8c620218afa87f51bec74669716 | [] | no_license | JungwooKim92/Algorithm | b02ce176daf16fce1a57b5a0b223874f3923793d | b600af27d8b8bf46160bca0c5c0f77e43124372a | refs/heads/master | 2020-12-30T16:58:32.411108 | 2017-07-03T00:48:04 | 2017-07-03T00:48:04 | 91,040,678 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 652 | cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
using namespace std;
int dp[8][8];
int editDistDP(string str1, string str2, int m, int n)
{
for (int i = 0; i <= m; i++)
{
for (int j = 0; j <= m; j++)
{
if (i == 0) dp[i][j] = j;
else if (j == 0) dp[i][j] = i;
else if (str1[i - 1] == str2[j - 1]) dp[i][j] = dp[i - 1][j - 1];
else
dp[i][j] = 1 + min(dp[i][j - 1], min(dp[i - 1][j], dp[i - 1][j - 1]));
}
}
return dp[m][n];
}
int main()
{
string a = "writers";
string b = "vintner";
int m = a.length();
int n = b.length();
int ans = editDistDP(a, b, m, n);
printf("%d\n", ans);
return 0;
} | [
"kimwoo0002@naver.com"
] | kimwoo0002@naver.com |
079a4d5a2a54f63bdf3486bcff967d24f2444b7a | 52ca17dca8c628bbabb0f04504332c8fdac8e7ea | /boost/iostreams/detail/select_by_size.hpp | d429095f06ddce623fb84cec42bb716920f727dd | [] | no_license | qinzuoyan/thirdparty | f610d43fe57133c832579e65ca46e71f1454f5c4 | bba9e68347ad0dbffb6fa350948672babc0fcb50 | refs/heads/master | 2021-01-16T17:47:57.121882 | 2015-04-21T06:59:19 | 2015-04-21T06:59:19 | 33,612,579 | 0 | 0 | null | 2015-04-08T14:39:51 | 2015-04-08T14:39:51 | null | UTF-8 | C++ | false | false | 77 | hpp | #include "thirdparty/boost_1_58_0/boost/iostreams/detail/select_by_size.hpp"
| [
"qinzuoyan@xiaomi.com"
] | qinzuoyan@xiaomi.com |
aa575fc7169ea743d8a9d88f557663b2b991413a | b677894966f2ae2d0585a31f163a362e41a3eae0 | /ns3/ns-3.26/src/stats/model/omnet-data-output.cc | 106d85cb36d1c8faef48fd32b02d62abcbc0f563 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown",
"GPL-2.0-only"
] | permissive | cyliustack/clusim | 667a9eef2e1ea8dad1511fd405f3191d150a04a8 | cbedcf671ba19fded26e4776c0e068f81f068dfd | refs/heads/master | 2022-10-06T20:14:43.052930 | 2022-10-01T19:42:19 | 2022-10-01T19:42:19 | 99,692,344 | 7 | 3 | Apache-2.0 | 2018-07-04T10:09:24 | 2017-08-08T12:51:33 | Python | UTF-8 | C++ | false | false | 8,043 | cc | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2008 Drexel University
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Joe Kopena (tjkopena@cs.drexel.edu)
*/
#include <fstream>
#include <cstdlib>
#include "ns3/log.h"
#include "ns3/nstime.h"
#include "data-collector.h"
#include "data-calculator.h"
#include "omnet-data-output.h"
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("OmnetDataOutput");
//--------------------------------------------------------------
//----------------------------------------------
OmnetDataOutput::OmnetDataOutput()
{
NS_LOG_FUNCTION (this);
m_filePrefix = "data";
}
OmnetDataOutput::~OmnetDataOutput()
{
NS_LOG_FUNCTION (this);
}
/* static */
TypeId
OmnetDataOutput::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::OmnetDataOutput")
.SetParent<DataOutputInterface> ()
.SetGroupName ("Stats")
.AddConstructor<OmnetDataOutput> ()
;
return tid;
}
void
OmnetDataOutput::DoDispose ()
{
NS_LOG_FUNCTION (this);
DataOutputInterface::DoDispose ();
// end OmnetDataOutput::DoDispose
}
//----------------------------------------------
inline bool isNumeric (const std::string& s) {
bool decimalPtSeen = false;
bool exponentSeen = false;
char last = '\0';
for (std::string::const_iterator it = s.begin (); it != s.end (); it++)
{
if ((*it == '.') && (decimalPtSeen))
return false;
else if (*it == '.')
decimalPtSeen = true;
else if ((*it == 'e') && exponentSeen)
return false;
else if (*it == 'e')
{
exponentSeen = true;
decimalPtSeen = false;
}
else if (*it == '-' && it != s.begin () && last != 'e')
return false;
last = *it;
}
return true;
}
void
OmnetDataOutput::Output (DataCollector &dc)
{
NS_LOG_FUNCTION (this << &dc);
std::ofstream scalarFile;
std::string fn = m_filePrefix +"-"+dc.GetRunLabel ()+ ".sca";
scalarFile.open (fn.c_str (), std::ios_base::out);
/// \todo add timestamp to the runlevel
scalarFile << "run " << dc.GetRunLabel () << std::endl;
scalarFile << "attr experiment \"" << dc.GetExperimentLabel ()
<< "\"" << std::endl;
scalarFile << "attr strategy \"" << dc.GetStrategyLabel ()
<< "\"" << std::endl;
scalarFile << "attr measurement \"" << dc.GetInputLabel ()
<< "\"" << std::endl;
scalarFile << "attr description \"" << dc.GetDescription ()
<< "\"" << std::endl;
for (MetadataList::iterator i = dc.MetadataBegin ();
i != dc.MetadataEnd (); i++) {
std::pair<std::string, std::string> blob = (*i);
scalarFile << "attr \"" << blob.first << "\" \"" << blob.second << "\""
<< std::endl;
}
scalarFile << std::endl;
if (isNumeric (dc.GetInputLabel ())) {
scalarFile << "scalar . measurement \"" << dc.GetInputLabel ()
<< "\"" << std::endl;
}
for (MetadataList::iterator i = dc.MetadataBegin ();
i != dc.MetadataEnd (); i++) {
std::pair<std::string, std::string> blob = (*i);
if (isNumeric (blob.second)) {
scalarFile << "scalar . \"" << blob.first << "\" \"" << blob.second << "\""
<< std::endl;
}
}
OmnetOutputCallback callback (&scalarFile);
for (DataCalculatorList::iterator i = dc.DataCalculatorBegin ();
i != dc.DataCalculatorEnd (); i++) {
(*i)->Output (callback);
}
scalarFile << std::endl << std::endl;
scalarFile.close ();
// end OmnetDataOutput::Output
}
OmnetDataOutput::OmnetOutputCallback::OmnetOutputCallback
(std::ostream *scalar) :
m_scalar (scalar)
{
NS_LOG_FUNCTION (this << scalar);
}
void
OmnetDataOutput::OmnetOutputCallback::OutputStatistic (std::string context,
std::string name,
const StatisticalSummary *statSum)
{
NS_LOG_FUNCTION (this << context << name << statSum);
if (context == "")
context = ".";
if (name == "")
name = "\"\"";
(*m_scalar) << "statistic " << context << " " << name << std::endl;
if (!isNaN (statSum->getCount ()))
(*m_scalar) << "field count " << statSum->getCount () << std::endl;
if (!isNaN (statSum->getSum ()))
(*m_scalar) << "field sum " << statSum->getSum () << std::endl;
if (!isNaN (statSum->getMean ()))
(*m_scalar) << "field mean " << statSum->getMean () << std::endl;
if (!isNaN (statSum->getMin ()))
(*m_scalar) << "field min " << statSum->getMin () << std::endl;
if (!isNaN (statSum->getMax ()))
(*m_scalar) << "field max " << statSum->getMax () << std::endl;
if (!isNaN (statSum->getSqrSum ()))
(*m_scalar) << "field sqrsum " << statSum->getSqrSum () << std::endl;
if (!isNaN (statSum->getStddev ()))
(*m_scalar) << "field stddev " << statSum->getStddev () << std::endl;
}
void
OmnetDataOutput::OmnetOutputCallback::OutputSingleton (std::string context,
std::string name,
int val)
{
NS_LOG_FUNCTION (this << context << name << val);
if (context == "")
context = ".";
if (name == "")
name = "\"\"";
(*m_scalar) << "scalar " << context << " " << name << " " << val << std::endl;
// end OmnetDataOutput::OmnetOutputCallback::OutputSingleton
}
void
OmnetDataOutput::OmnetOutputCallback::OutputSingleton (std::string context,
std::string name,
uint32_t val)
{
NS_LOG_FUNCTION (this << context << name << val);
if (context == "")
context = ".";
if (name == "")
name = "\"\"";
(*m_scalar) << "scalar " << context << " " << name << " " << val << std::endl;
// end OmnetDataOutput::OmnetOutputCallback::OutputSingleton
}
void
OmnetDataOutput::OmnetOutputCallback::OutputSingleton (std::string context,
std::string name,
double val)
{
NS_LOG_FUNCTION (this << context << name << val);
if (context == "")
context = ".";
if (name == "")
name = "\"\"";
(*m_scalar) << "scalar " << context << " " << name << " " << val << std::endl;
// end OmnetDataOutput::OmnetOutputCallback::OutputSingleton
}
void
OmnetDataOutput::OmnetOutputCallback::OutputSingleton (std::string context,
std::string name,
std::string val)
{
NS_LOG_FUNCTION (this << context << name << val);
if (context == "")
context = ".";
if (name == "")
name = "\"\"";
(*m_scalar) << "scalar " << context << " " << name << " " << val << std::endl;
// end OmnetDataOutput::OmnetOutputCallback::OutputSingleton
}
void
OmnetDataOutput::OmnetOutputCallback::OutputSingleton (std::string context,
std::string name,
Time val)
{
NS_LOG_FUNCTION (this << context << name << val);
if (context == "")
context = ".";
if (name == "")
name = "\"\"";
(*m_scalar) << "scalar " << context << " " << name << " " << val.GetTimeStep () << std::endl;
// end OmnetDataOutput::OmnetOutputCallback::OutputSingleton
}
| [
"you@example.com"
] | you@example.com |
8cb5927090b36397fe16372564ca16f50e65e4ee | 66ed3b3bd1f43c5cfed2b2cf0e8343a0bd168e24 | /Practica1/codigo/permutacion/codigo/src/pruebapermutacion.cpp | 01e751aa4886f4c1ca728370a2022db469347ce9 | [] | no_license | matl1995/ALG | f34af5691d118cc690d99e7f39b50921ba50e5e1 | 275b1e2966bab8e39d5404c70a971c04644459f8 | refs/heads/master | 2021-03-28T15:17:54.109822 | 2018-06-02T16:34:29 | 2018-06-02T16:34:29 | 123,285,930 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,381 | cpp | #include <iostream>
#include "permutacion.h"
#include <string>
#include <chrono>// Recursos para medir tiempos
using namespace std::chrono;
template <class T>
ostream & operator<<(ostream &os, const vector<T> & d){
for (int i=0;i<d.size();i++)
os<<d[i]<<" ";
os<<endl;
return os;
}
void MuestraPermutaciones(const Permutacion & P){
Permutacion::const_iterator it;
int cnt=1;
for (it=P.begin();it!=P.end();++it,++cnt)
cout<<cnt<<"->"<<*it<<endl;
}
void ImprimeCadena(const string &c,const Permutacion &P){
const vector<unsigned int> s= (*(P.begin()));
for (unsigned int i=0;i<s.size();i++)
cout<<c[s[i]-1];
cout<<endl;
}
void sintaxis()
{
cerr << "Sintaxis:" << endl;
cerr << " TAM: Tamaño del vector (>0)" << endl;
cerr << " VMAX: Valor máximo (>0)" << endl;
cerr << "Se genera un vector de tamaño TAM con elementos aleatorios en [0,VMAX[" << endl;
exit(EXIT_FAILURE);
}
int main(int argc, char * argv[]){
/*
int n;
cout<<"Dime el tamaño de las permutaciones:";
cin>>n;
Permutacion P(n);
cout<<"El numero total de permutaciones: "<<P.NumeroPermutacionesPosibles()<<endl;
MuestraPermutaciones(P);
*/
// Lectura de parámetros
if (argc!=3)
sintaxis();
int tam=atoi(argv[1]); // Tamaño del vector
int vmax=100; // Valor máximo
if (tam<=0 || vmax<=0)
sintaxis();
/*
// Generación del vector aleatorio
int *v=new int[tam]; // Reserva de memoria
srand(time(0)); // Inicialización del generador de números pseudoaleatorios
for (int i=0; i<tam; i++) // Recorrer vector
v[i] = rand() % vmax; // Generar aleatorio [0,vmax[
*/
/*
// Generación del vector caso peor
int *v=new int[tam]; // Reserva de memoria
for (int i=0; i<tam; i++) // Recorrer vector
v[i] = tam-i;
*/
// Generación del vector caso mejor
int *v=new int[tam]; // Reserva de memoria
for (int i=0; i<tam; i++) // Recorrer vector
v[i] = i;
Permutacion P(tam);
bool ordenado=false;
bool primeravez=true;
//Para no tener almacenadas todas las permutaciones solo la acutal
high_resolution_clock::time_point start,//punto de inicio
end; //punto de fin
duration<double> tiempo_transcurrido; //objeto para medir la duracion de end // y start
start = high_resolution_clock::now(); //iniciamos el punto de inicio
while(ordenado==false)
{
ordenado=true;
if(primeravez==false)
P.GeneraSiguiente(); //Genero la permutacion siguiente
else
primeravez=false;
vector<unsigned int> perm=*P.begin();
for(unsigned int i=1;i<perm.size() && ordenado;i++)
{
if(v[perm[i-1]-1]>v[perm[i]-1])
{
ordenado=false;
}
}
}
end = high_resolution_clock::now(); //anotamos el punto de de fin
//el tiempo transcurrido es
tiempo_transcurrido = duration_cast<duration<double> >(end - start);
// Mostramos resultados
cout << tam << "\t" <<tiempo_transcurrido.count() << endl;
delete [] v; // Liberamos memoria dinámica
/*
//Leemos una cadena y generamos todas sus permutaciones
string cad;
cout<<"Dime una palabra:";
cin>>cad;
Permutacion Otra(cad.size(),1);
int cnt=1;
do{
cout<<cnt<<"-->";
ImprimeCadena(cad,Otra);
cnt++;
}while(Otra.GeneraSiguiente());
*/
}
| [
"matl1995@correo.ugr.es"
] | matl1995@correo.ugr.es |
62fff0c1ab4691c8a91513498c63cef6c2496371 | 0637909f5b230f9d2907dd8a3031d648cc6cbce1 | /mex/armadillo_bits/spdiagview_meat.hpp | cc1c3da37b1df5006db316d387d2bbacaf6cb40a | [
"Apache-2.0"
] | permissive | davidakelley/MFSS | ebcbad0b29e22ed6cffa604fbd8a80ac261616dc | 3f7718f6403db69575adff997a05d21d452acbf9 | refs/heads/master | 2022-11-06T14:57:33.449813 | 2022-10-31T17:41:42 | 2022-10-31T17:41:42 | 165,262,685 | 12 | 10 | NOASSERTION | 2020-05-28T05:25:40 | 2019-01-11T15:08:34 | MATLAB | UTF-8 | C++ | false | false | 19,487 | hpp | // Copyright (C) 2015-2016 National ICT Australia (NICTA)
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// -------------------------------------------------------------------
//
// Written by Conrad Sanderson - http://conradsanderson.id.au
//! \addtogroup spdiagview
//! @{
template<typename eT>
inline
spdiagview<eT>::~spdiagview()
{
arma_extra_debug_sigprint();
}
template<typename eT>
arma_inline
spdiagview<eT>::spdiagview(const SpMat<eT>& in_m, const uword in_row_offset, const uword in_col_offset, const uword in_len)
: m(in_m)
, row_offset(in_row_offset)
, col_offset(in_col_offset)
, n_rows(in_len)
, n_elem(in_len)
{
arma_extra_debug_sigprint();
}
//! set a diagonal of our matrix using a diagonal from a foreign matrix
template<typename eT>
inline
void
spdiagview<eT>::operator= (const spdiagview<eT>& x)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
arma_debug_check( (d.n_elem != x.n_elem), "spdiagview: diagonals have incompatible lengths");
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const SpMat<eT>& x_m = x.m;
if(&d_m != &x_m)
{
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const uword x_row_offset = x.row_offset;
const uword x_col_offset = x.col_offset;
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) = x_m.at(i + x_row_offset, i + x_col_offset);
}
}
else
{
const Mat<eT> tmp = x;
(*this).operator=(tmp);
}
}
template<typename eT>
inline
void
spdiagview<eT>::operator+=(const eT val)
{
arma_extra_debug_sigprint();
SpMat<eT>& t_m = const_cast< SpMat<eT>& >(m);
const uword t_n_elem = n_elem;
const uword t_row_offset = row_offset;
const uword t_col_offset = col_offset;
for(uword i=0; i < t_n_elem; ++i)
{
t_m.at(i + t_row_offset, i + t_col_offset) += val;
}
}
template<typename eT>
inline
void
spdiagview<eT>::operator-=(const eT val)
{
arma_extra_debug_sigprint();
SpMat<eT>& t_m = const_cast< SpMat<eT>& >(m);
const uword t_n_elem = n_elem;
const uword t_row_offset = row_offset;
const uword t_col_offset = col_offset;
for(uword i=0; i < t_n_elem; ++i)
{
t_m.at(i + t_row_offset, i + t_col_offset) -= val;
}
}
template<typename eT>
inline
void
spdiagview<eT>::operator*=(const eT val)
{
arma_extra_debug_sigprint();
SpMat<eT>& t_m = const_cast< SpMat<eT>& >(m);
const uword t_n_elem = n_elem;
const uword t_row_offset = row_offset;
const uword t_col_offset = col_offset;
for(uword i=0; i < t_n_elem; ++i)
{
t_m.at(i + t_row_offset, i + t_col_offset) *= val;
}
}
template<typename eT>
inline
void
spdiagview<eT>::operator/=(const eT val)
{
arma_extra_debug_sigprint();
SpMat<eT>& t_m = const_cast< SpMat<eT>& >(m);
const uword t_n_elem = n_elem;
const uword t_row_offset = row_offset;
const uword t_col_offset = col_offset;
for(uword i=0; i < t_n_elem; ++i)
{
t_m.at(i + t_row_offset, i + t_col_offset) /= val;
}
}
//! set a diagonal of our matrix using data from a foreign object
template<typename eT>
template<typename T1>
inline
void
spdiagview<eT>::operator= (const Base<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const Proxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) )
{
const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q);
const Mat<eT>& x = tmp.M;
const eT* x_mem = x.memptr();
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) = x_mem[i];
}
}
else
{
typename Proxy<T1>::ea_type Pea = P.get_ea();
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) = Pea[i];
}
}
}
template<typename eT>
template<typename T1>
inline
void
spdiagview<eT>::operator+=(const Base<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const Proxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) )
{
const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q);
const Mat<eT>& x = tmp.M;
const eT* x_mem = x.memptr();
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) += x_mem[i];
}
}
else
{
typename Proxy<T1>::ea_type Pea = P.get_ea();
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) += Pea[i];
}
}
}
template<typename eT>
template<typename T1>
inline
void
spdiagview<eT>::operator-=(const Base<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const Proxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) )
{
const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q);
const Mat<eT>& x = tmp.M;
const eT* x_mem = x.memptr();
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) -= x_mem[i];
}
}
else
{
typename Proxy<T1>::ea_type Pea = P.get_ea();
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) -= Pea[i];
}
}
}
template<typename eT>
template<typename T1>
inline
void
spdiagview<eT>::operator%=(const Base<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const Proxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) )
{
const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q);
const Mat<eT>& x = tmp.M;
const eT* x_mem = x.memptr();
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) *= x_mem[i];
}
}
else
{
typename Proxy<T1>::ea_type Pea = P.get_ea();
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) *= Pea[i];
}
}
}
template<typename eT>
template<typename T1>
inline
void
spdiagview<eT>::operator/=(const Base<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const Proxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) )
{
const unwrap<typename Proxy<T1>::stored_type> tmp(P.Q);
const Mat<eT>& x = tmp.M;
const eT* x_mem = x.memptr();
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) /= x_mem[i];
}
}
else
{
typename Proxy<T1>::ea_type Pea = P.get_ea();
for(uword i=0; i < d_n_elem; ++i)
{
d_m.at(i + d_row_offset, i + d_col_offset) /= Pea[i];
}
}
}
//! set a diagonal of our matrix using data from a foreign object
template<typename eT>
template<typename T1>
inline
void
spdiagview<eT>::operator= (const SpBase<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const SpProxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( SpProxy<T1>::use_iterator || P.is_alias(d_m) )
{
const SpMat<eT> tmp(P.Q);
if(tmp.n_cols == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) = tmp.at(i,0); }
}
else
if(tmp.n_rows == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) = tmp.at(0,i); }
}
}
else
{
if(P.get_n_cols() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) = P.at(i,0); }
}
else
if(P.get_n_rows() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) = P.at(0,i); }
}
}
}
template<typename eT>
template<typename T1>
inline
void
spdiagview<eT>::operator+=(const SpBase<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const SpProxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( SpProxy<T1>::use_iterator || P.is_alias(d_m) )
{
const SpMat<eT> tmp(P.Q);
if(tmp.n_cols == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) += tmp.at(i,0); }
}
else
if(tmp.n_rows == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) += tmp.at(0,i); }
}
}
else
{
if(P.get_n_cols() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) += P.at(i,0); }
}
else
if(P.get_n_rows() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) += P.at(0,i); }
}
}
}
template<typename eT>
template<typename T1>
inline
void
spdiagview<eT>::operator-=(const SpBase<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const SpProxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( SpProxy<T1>::use_iterator || P.is_alias(d_m) )
{
const SpMat<eT> tmp(P.Q);
if(tmp.n_cols == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) -= tmp.at(i,0); }
}
else
if(tmp.n_rows == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) -= tmp.at(0,i); }
}
}
else
{
if(P.get_n_cols() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) -= P.at(i,0); }
}
else
if(P.get_n_rows() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) -= P.at(0,i); }
}
}
}
template<typename eT>
template<typename T1>
inline
void
spdiagview<eT>::operator%=(const SpBase<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const SpProxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( SpProxy<T1>::use_iterator || P.is_alias(d_m) )
{
const SpMat<eT> tmp(P.Q);
if(tmp.n_cols == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) *= tmp.at(i,0); }
}
else
if(tmp.n_rows == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) *= tmp.at(0,i); }
}
}
else
{
if(P.get_n_cols() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) *= P.at(i,0); }
}
else
if(P.get_n_rows() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) *= P.at(0,i); }
}
}
}
template<typename eT>
template<typename T1>
inline
void
spdiagview<eT>::operator/=(const SpBase<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const SpProxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( SpProxy<T1>::use_iterator || P.is_alias(d_m) )
{
const SpMat<eT> tmp(P.Q);
if(tmp.n_cols == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) /= tmp.at(i,0); }
}
else
if(tmp.n_rows == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) /= tmp.at(0,i); }
}
}
else
{
if(P.get_n_cols() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) /= P.at(i,0); }
}
else
if(P.get_n_rows() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) /= P.at(0,i); }
}
}
}
//! extract a diagonal and store it as a dense column vector
template<typename eT>
inline
void
spdiagview<eT>::extract(Mat<eT>& out, const spdiagview<eT>& in)
{
arma_extra_debug_sigprint();
// NOTE: we're assuming that the 'out' matrix has already been set to the correct size;
// size setting is done by either the Mat contructor or Mat::operator=()
const SpMat<eT>& in_m = in.m;
const uword in_n_elem = in.n_elem;
const uword in_row_offset = in.row_offset;
const uword in_col_offset = in.col_offset;
eT* out_mem = out.memptr();
for(uword i=0; i < in_n_elem; ++i)
{
out_mem[i] = in_m.at(i + in_row_offset, i + in_col_offset );
}
}
template<typename eT>
inline
eT
spdiagview<eT>::at_alt(const uword i) const
{
return m.at(i+row_offset, i+col_offset);
}
template<typename eT>
inline
SpValProxy< SpMat<eT> >
spdiagview<eT>::operator[](const uword i)
{
return (const_cast< SpMat<eT>& >(m)).at(i+row_offset, i+col_offset);
}
template<typename eT>
inline
eT
spdiagview<eT>::operator[](const uword i) const
{
return m.at(i+row_offset, i+col_offset);
}
template<typename eT>
inline
SpValProxy< SpMat<eT> >
spdiagview<eT>::at(const uword i)
{
return (const_cast< SpMat<eT>& >(m)).at(i+row_offset, i+col_offset);
}
template<typename eT>
inline
eT
spdiagview<eT>::at(const uword i) const
{
return m.at(i+row_offset, i+col_offset);
}
template<typename eT>
inline
SpValProxy< SpMat<eT> >
spdiagview<eT>::operator()(const uword i)
{
arma_debug_check( (i >= n_elem), "spdiagview::operator(): out of bounds" );
return (const_cast< SpMat<eT>& >(m)).at(i+row_offset, i+col_offset);
}
template<typename eT>
inline
eT
spdiagview<eT>::operator()(const uword i) const
{
arma_debug_check( (i >= n_elem), "spdiagview::operator(): out of bounds" );
return m.at(i+row_offset, i+col_offset);
}
template<typename eT>
inline
SpValProxy< SpMat<eT> >
spdiagview<eT>::at(const uword row, const uword)
{
return (const_cast< SpMat<eT>& >(m)).at(row+row_offset, row+col_offset);
}
template<typename eT>
inline
eT
spdiagview<eT>::at(const uword row, const uword) const
{
return m.at(row+row_offset, row+col_offset);
}
template<typename eT>
inline
SpValProxy< SpMat<eT> >
spdiagview<eT>::operator()(const uword row, const uword col)
{
arma_debug_check( ((row >= n_elem) || (col > 0)), "spdiagview::operator(): out of bounds" );
return (const_cast< SpMat<eT>& >(m)).at(row+row_offset, row+col_offset);
}
template<typename eT>
inline
eT
spdiagview<eT>::operator()(const uword row, const uword col) const
{
arma_debug_check( ((row >= n_elem) || (col > 0)), "spdiagview::operator(): out of bounds" );
return m.at(row+row_offset, row+col_offset);
}
template<typename eT>
inline
void
spdiagview<eT>::fill(const eT val)
{
arma_extra_debug_sigprint();
SpMat<eT>& x = const_cast< SpMat<eT>& >(m);
const uword local_n_elem = n_elem;
for(uword i=0; i < local_n_elem; ++i)
{
x.at(i+row_offset, i+col_offset) = val;
}
}
template<typename eT>
inline
void
spdiagview<eT>::zeros()
{
arma_extra_debug_sigprint();
(*this).fill(eT(0));
}
template<typename eT>
inline
void
spdiagview<eT>::ones()
{
arma_extra_debug_sigprint();
(*this).fill(eT(1));
}
template<typename eT>
inline
void
spdiagview<eT>::randu()
{
arma_extra_debug_sigprint();
SpMat<eT>& x = const_cast< SpMat<eT>& >(m);
const uword local_n_elem = n_elem;
for(uword i=0; i < local_n_elem; ++i)
{
x.at(i+row_offset, i+col_offset) = eT(arma_rng::randu<eT>());
}
}
template<typename eT>
inline
void
spdiagview<eT>::randn()
{
arma_extra_debug_sigprint();
SpMat<eT>& x = const_cast< SpMat<eT>& >(m);
const uword local_n_elem = n_elem;
for(uword i=0; i < local_n_elem; ++i)
{
x.at(i+row_offset, i+col_offset) = eT(arma_rng::randn<eT>());
}
}
//! @}
| [
"dkelley@frbchi.org"
] | dkelley@frbchi.org |
7d6b85a71ac064c38c05d8f726689b6e79aef204 | 877fff5bb313ccd23d1d01bf23b1e1f2b13bb85a | /app/src/main/cpp/dir521/dir3871/dir5864/dir6285/dir6632/dir6633/file6802.cpp | dac292fe72b0a50348426cb4cc313edca51a3867 | [] | no_license | tgeng/HugeProject | 829c3bdfb7cbaf57727c41263212d4a67e3eb93d | 4488d3b765e8827636ce5e878baacdf388710ef2 | refs/heads/master | 2022-08-21T16:58:54.161627 | 2020-05-28T01:54:03 | 2020-05-28T01:54:03 | 267,468,475 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 111 | cpp | #ifndef file6802
#error "macro file6802 must be defined"
#endif
static const char* file6802String = "file6802"; | [
"tgeng@google.com"
] | tgeng@google.com |
f217bb12412570ff11ac2da724612df3079839f8 | a57efa8fb3aba5e27f9115cc56948fe2b2fd1758 | /include/recognition/recog_cdnn.h | 05b03f7267b9952cb54a182763edae23df8ed3c8 | [] | no_license | zc911/lfstmp | dc4fa8f7c086705fcdd51675a4b1acaa231dc4ee | 2817cfdf99f4e77bb186d9a2308934e510d51da6 | refs/heads/master | 2022-01-19T13:00:32.681388 | 2017-02-15T02:42:03 | 2017-02-15T02:42:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 673 | h | #ifndef _dgfacesdk_recognition_cdnn_h_
#define _dgfacesdk_recognition_cdnn_h_
#include <string>
#include <recognition.h>
#include "ExtractMPMetricFeature.h"
namespace DGFace{
class CdnnRecog: public Recognition {
public:
CdnnRecog(std::string configPath, std::string modelDir, bool multi_thread, bool is_encrypt);
CdnnRecog(const std::string& model_dir, bool multi_thread, bool is_encrypt);
virtual ~CdnnRecog();
void recog_impl(const std::vector<cv::Mat>& faces,
const std::vector<AlignResult>& alignment,
std::vector<RecogResult>& results);
private:
Cdnn::MPMetricFeature::ExtractMPMetricFeature _extractor;
bool _multi_thread;
};
}
#endif
| [
"dell@ubuntu.ubuntu"
] | dell@ubuntu.ubuntu |
2e7c5ced280940bb1293e459e39639b571f2c9c0 | 46671ad91f97e9745c9ba9577de88d12cdcbbcf6 | /src/bitcoinrpc.cpp | b8a1d7d1471678f4ce86b3d6fd3c824e6bf47384 | [
"MIT"
] | permissive | midnight109/XPP-PennyPinchers | 53f8d44e599a4d7b6455d73b5c14289dd2a493b0 | 7d97fbc1cec4b0c5f6453a6a4b6780df2f4dc5d7 | refs/heads/master | 2016-09-05T16:59:38.286226 | 2014-12-13T08:11:09 | 2014-12-13T08:11:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 48,601 | cpp | // Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "init.h"
#include "util.h"
#include "sync.h"
#include "ui_interface.h"
#include "base58.h"
#include "bitcoinrpc.h"
#include "db.h"
#include <boost/asio.hpp>
#include <boost/asio/ip/v6_only.hpp>
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/shared_ptr.hpp>
#include <list>
using namespace std;
using namespace boost;
using namespace boost::asio;
using namespace json_spirit;
static std::string strRPCUserColonPass;
// These are created by StartRPCThreads, destroyed in StopRPCThreads
static asio::io_service* rpc_io_service = NULL;
static ssl::context* rpc_ssl_context = NULL;
static boost::thread_group* rpc_worker_group = NULL;
static inline unsigned short GetDefaultRPCPort()
{
return GetBoolArg("-testnet", false) ? 5745 : 21035;
}
Object JSONRPCError(int code, const string& message)
{
Object error;
error.push_back(Pair("code", code));
error.push_back(Pair("message", message));
return error;
}
void RPCTypeCheck(const Array& params,
const list<Value_type>& typesExpected,
bool fAllowNull)
{
unsigned int i = 0;
BOOST_FOREACH(Value_type t, typesExpected)
{
if (params.size() <= i)
break;
const Value& v = params[i];
if (!((v.type() == t) || (fAllowNull && (v.type() == null_type))))
{
string err = strprintf("Expected type %s, got %s",
Value_type_name[t], Value_type_name[v.type()]);
throw JSONRPCError(RPC_TYPE_ERROR, err);
}
i++;
}
}
void RPCTypeCheck(const Object& o,
const map<string, Value_type>& typesExpected,
bool fAllowNull)
{
BOOST_FOREACH(const PAIRTYPE(string, Value_type)& t, typesExpected)
{
const Value& v = find_value(o, t.first);
if (!fAllowNull && v.type() == null_type)
throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Missing %s", t.first.c_str()));
if (!((v.type() == t.second) || (fAllowNull && (v.type() == null_type))))
{
string err = strprintf("Expected type %s for %s, got %s",
Value_type_name[t.second], t.first.c_str(), Value_type_name[v.type()]);
throw JSONRPCError(RPC_TYPE_ERROR, err);
}
}
}
int64 AmountFromValue(const Value& value)
{
double dAmount = value.get_real();
if (dAmount <= 0.0 || dAmount > 16800000000)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
int64 nAmount = roundint64(dAmount * COIN);
if (!MoneyRange(nAmount))
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
return nAmount;
}
Value ValueFromAmount(int64 amount)
{
return (double)amount / (double)COIN;
}
std::string HexBits(unsigned int nBits)
{
union {
int32_t nBits;
char cBits[4];
} uBits;
uBits.nBits = htonl((int32_t)nBits);
return HexStr(BEGIN(uBits.cBits), END(uBits.cBits));
}
///
/// Note: This interface may still be subject to change.
///
string CRPCTable::help(string strCommand) const
{
string strRet;
set<rpcfn_type> setDone;
for (map<string, const CRPCCommand*>::const_iterator mi = mapCommands.begin(); mi != mapCommands.end(); ++mi)
{
const CRPCCommand *pcmd = mi->second;
string strMethod = mi->first;
// We already filter duplicates, but these deprecated screw up the sort order
if (strMethod.find("label") != string::npos)
continue;
if (strCommand != "" && strMethod != strCommand)
continue;
if (pcmd->reqWallet && !pwalletMain)
continue;
try
{
Array params;
rpcfn_type pfn = pcmd->actor;
if (setDone.insert(pfn).second)
(*pfn)(params, true);
}
catch (std::exception& e)
{
// Help text is returned in an exception
string strHelp = string(e.what());
if (strCommand == "")
if (strHelp.find('\n') != string::npos)
strHelp = strHelp.substr(0, strHelp.find('\n'));
strRet += strHelp + "\n";
}
}
if (strRet == "")
strRet = strprintf("help: unknown command: %s\n", strCommand.c_str());
strRet = strRet.substr(0,strRet.size()-1);
return strRet;
}
Value help(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"help [command]\n"
"List commands, or get help for a command.");
string strCommand;
if (params.size() > 0)
strCommand = params[0].get_str();
return tableRPC.help(strCommand);
}
Value stop(const Array& params, bool fHelp)
{
// Accept the deprecated and ignored 'detach' boolean argument
if (fHelp || params.size() > 1)
throw runtime_error(
"stop\n"
"Stop Pennypincher server.");
// Shutdown will take long enough that the response should get back
StartShutdown();
return "Pennypincher server stopping";
}
//
// Call Table
//
static const CRPCCommand vRPCCommands[] =
{ // name actor (function) okSafeMode threadSafe reqWallet
// ------------------------ ----------------------- ---------- ---------- ---------
{ "help", &help, true, true, false },
{ "stop", &stop, true, true, false },
{ "getblockcount", &getblockcount, true, false, false },
{ "getbestblockhash", &getbestblockhash, true, false, false },
{ "getconnectioncount", &getconnectioncount, true, false, false },
{ "getpeerinfo", &getpeerinfo, true, false, false },
{ "addnode", &addnode, true, true, false },
{ "getaddednodeinfo", &getaddednodeinfo, true, true, false },
{ "getdifficulty", &getdifficulty, true, false, false },
{ "getnetworkhashps", &getnetworkhashps, true, false, false },
{ "getgenerate", &getgenerate, true, false, false },
{ "setgenerate", &setgenerate, true, false, true },
{ "gethashespersec", &gethashespersec, true, false, false },
{ "getinfo", &getinfo, true, false, false },
{ "getmininginfo", &getmininginfo, true, false, false },
{ "getnewaddress", &getnewaddress, true, false, true },
{ "getaccountaddress", &getaccountaddress, true, false, true },
{ "setaccount", &setaccount, true, false, true },
{ "getaccount", &getaccount, false, false, true },
{ "getaddressesbyaccount", &getaddressesbyaccount, true, false, true },
{ "sendtoaddress", &sendtoaddress, false, false, true },
{ "getreceivedbyaddress", &getreceivedbyaddress, false, false, true },
{ "getreceivedbyaccount", &getreceivedbyaccount, false, false, true },
{ "listreceivedbyaddress", &listreceivedbyaddress, false, false, true },
{ "listreceivedbyaccount", &listreceivedbyaccount, false, false, true },
{ "backupwallet", &backupwallet, true, false, true },
{ "keypoolrefill", &keypoolrefill, true, false, true },
{ "walletpassphrase", &walletpassphrase, true, false, true },
{ "walletpassphrasechange", &walletpassphrasechange, false, false, true },
{ "walletlock", &walletlock, true, false, true },
{ "encryptwallet", &encryptwallet, false, false, true },
{ "validateaddress", &validateaddress, true, false, false },
{ "getbalance", &getbalance, false, false, true },
{ "move", &movecmd, false, false, true },
{ "sendfrom", &sendfrom, false, false, true },
{ "sendmany", &sendmany, false, false, true },
{ "addmultisigaddress", &addmultisigaddress, false, false, true },
{ "createmultisig", &createmultisig, true, true , false },
{ "getrawmempool", &getrawmempool, true, false, false },
{ "getblock", &getblock, false, false, false },
{ "getblockhash", &getblockhash, false, false, false },
{ "gettransaction", &gettransaction, false, false, true },
{ "listtransactions", &listtransactions, false, false, true },
{ "listaddressgroupings", &listaddressgroupings, false, false, true },
{ "signmessage", &signmessage, false, false, true },
{ "verifymessage", &verifymessage, false, false, false },
{ "getwork", &getwork, true, false, true },
{ "getworkex", &getworkex, true, false, true },
{ "listaccounts", &listaccounts, false, false, true },
{ "settxfee", &settxfee, false, false, true },
{ "getblocktemplate", &getblocktemplate, true, false, false },
{ "submitblock", &submitblock, false, false, false },
{ "setmininput", &setmininput, false, false, false },
{ "listsinceblock", &listsinceblock, false, false, true },
{ "dumpprivkey", &dumpprivkey, true, false, true },
{ "importprivkey", &importprivkey, false, false, true },
{ "listunspent", &listunspent, false, false, true },
{ "getrawtransaction", &getrawtransaction, false, false, false },
{ "createrawtransaction", &createrawtransaction, false, false, false },
{ "decoderawtransaction", &decoderawtransaction, false, false, false },
{ "signrawtransaction", &signrawtransaction, false, false, false },
{ "sendrawtransaction", &sendrawtransaction, false, false, false },
{ "gettxoutsetinfo", &gettxoutsetinfo, true, false, false },
{ "gettxout", &gettxout, true, false, false },
{ "lockunspent", &lockunspent, false, false, true },
{ "listlockunspent", &listlockunspent, false, false, true },
{ "verifychain", &verifychain, true, false, false },
};
CRPCTable::CRPCTable()
{
unsigned int vcidx;
for (vcidx = 0; vcidx < (sizeof(vRPCCommands) / sizeof(vRPCCommands[0])); vcidx++)
{
const CRPCCommand *pcmd;
pcmd = &vRPCCommands[vcidx];
mapCommands[pcmd->name] = pcmd;
}
}
const CRPCCommand *CRPCTable::operator[](string name) const
{
map<string, const CRPCCommand*>::const_iterator it = mapCommands.find(name);
if (it == mapCommands.end())
return NULL;
return (*it).second;
}
//
// HTTP protocol
//
// This ain't Apache. We're just using HTTP header for the length field
// and to be compatible with other JSON-RPC implementations.
//
string HTTPPost(const string& strMsg, const map<string,string>& mapRequestHeaders)
{
ostringstream s;
s << "POST / HTTP/1.1\r\n"
<< "User-Agent: pennypincher-json-rpc/" << FormatFullVersion() << "\r\n"
<< "Host: 127.0.0.1\r\n"
<< "Content-Type: application/json\r\n"
<< "Content-Length: " << strMsg.size() << "\r\n"
<< "Connection: close\r\n"
<< "Accept: application/json\r\n";
BOOST_FOREACH(const PAIRTYPE(string, string)& item, mapRequestHeaders)
s << item.first << ": " << item.second << "\r\n";
s << "\r\n" << strMsg;
return s.str();
}
string rfc1123Time()
{
char buffer[64];
time_t now;
time(&now);
struct tm* now_gmt = gmtime(&now);
string locale(setlocale(LC_TIME, NULL));
setlocale(LC_TIME, "C"); // we want POSIX (aka "C") weekday/month strings
strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S +0000", now_gmt);
setlocale(LC_TIME, locale.c_str());
return string(buffer);
}
static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
{
if (nStatus == HTTP_UNAUTHORIZED)
return strprintf("HTTP/1.0 401 Authorization Required\r\n"
"Date: %s\r\n"
"Server: pennypincher-json-rpc/%s\r\n"
"WWW-Authenticate: Basic realm=\"jsonrpc\"\r\n"
"Content-Type: text/html\r\n"
"Content-Length: 296\r\n"
"\r\n"
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n"
"\"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\r\n"
"<HTML>\r\n"
"<HEAD>\r\n"
"<TITLE>Error</TITLE>\r\n"
"<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>\r\n"
"</HEAD>\r\n"
"<BODY><H1>401 Unauthorized.</H1></BODY>\r\n"
"</HTML>\r\n", rfc1123Time().c_str(), FormatFullVersion().c_str());
const char *cStatus;
if (nStatus == HTTP_OK) cStatus = "OK";
else if (nStatus == HTTP_BAD_REQUEST) cStatus = "Bad Request";
else if (nStatus == HTTP_FORBIDDEN) cStatus = "Forbidden";
else if (nStatus == HTTP_NOT_FOUND) cStatus = "Not Found";
else if (nStatus == HTTP_INTERNAL_SERVER_ERROR) cStatus = "Internal Server Error";
else cStatus = "";
return strprintf(
"HTTP/1.1 %d %s\r\n"
"Date: %s\r\n"
"Connection: %s\r\n"
"Content-Length: %"PRIszu"\r\n"
"Content-Type: application/json\r\n"
"Server: pennypincher-json-rpc/%s\r\n"
"\r\n"
"%s",
nStatus,
cStatus,
rfc1123Time().c_str(),
keepalive ? "keep-alive" : "close",
strMsg.size(),
FormatFullVersion().c_str(),
strMsg.c_str());
}
bool ReadHTTPRequestLine(std::basic_istream<char>& stream, int &proto,
string& http_method, string& http_uri)
{
string str;
getline(stream, str);
// HTTP request line is space-delimited
vector<string> vWords;
boost::split(vWords, str, boost::is_any_of(" "));
if (vWords.size() < 2)
return false;
// HTTP methods permitted: GET, POST
http_method = vWords[0];
if (http_method != "GET" && http_method != "POST")
return false;
// HTTP URI must be an absolute path, relative to current host
http_uri = vWords[1];
if (http_uri.size() == 0 || http_uri[0] != '/')
return false;
// parse proto, if present
string strProto = "";
if (vWords.size() > 2)
strProto = vWords[2];
proto = 0;
const char *ver = strstr(strProto.c_str(), "HTTP/1.");
if (ver != NULL)
proto = atoi(ver+7);
return true;
}
int ReadHTTPStatus(std::basic_istream<char>& stream, int &proto)
{
string str;
getline(stream, str);
vector<string> vWords;
boost::split(vWords, str, boost::is_any_of(" "));
if (vWords.size() < 2)
return HTTP_INTERNAL_SERVER_ERROR;
proto = 0;
const char *ver = strstr(str.c_str(), "HTTP/1.");
if (ver != NULL)
proto = atoi(ver+7);
return atoi(vWords[1].c_str());
}
int ReadHTTPHeaders(std::basic_istream<char>& stream, map<string, string>& mapHeadersRet)
{
int nLen = 0;
loop
{
string str;
std::getline(stream, str);
if (str.empty() || str == "\r")
break;
string::size_type nColon = str.find(":");
if (nColon != string::npos)
{
string strHeader = str.substr(0, nColon);
boost::trim(strHeader);
boost::to_lower(strHeader);
string strValue = str.substr(nColon+1);
boost::trim(strValue);
mapHeadersRet[strHeader] = strValue;
if (strHeader == "content-length")
nLen = atoi(strValue.c_str());
}
}
return nLen;
}
int ReadHTTPMessage(std::basic_istream<char>& stream, map<string,
string>& mapHeadersRet, string& strMessageRet,
int nProto)
{
mapHeadersRet.clear();
strMessageRet = "";
// Read header
int nLen = ReadHTTPHeaders(stream, mapHeadersRet);
if (nLen < 0 || nLen > (int)MAX_SIZE)
return HTTP_INTERNAL_SERVER_ERROR;
// Read message
if (nLen > 0)
{
vector<char> vch(nLen);
stream.read(&vch[0], nLen);
strMessageRet = string(vch.begin(), vch.end());
}
string sConHdr = mapHeadersRet["connection"];
if ((sConHdr != "close") && (sConHdr != "keep-alive"))
{
if (nProto >= 1)
mapHeadersRet["connection"] = "keep-alive";
else
mapHeadersRet["connection"] = "close";
}
return HTTP_OK;
}
bool HTTPAuthorized(map<string, string>& mapHeaders)
{
string strAuth = mapHeaders["authorization"];
if (strAuth.substr(0,6) != "Basic ")
return false;
string strUserPass64 = strAuth.substr(6); boost::trim(strUserPass64);
string strUserPass = DecodeBase64(strUserPass64);
return TimingResistantEqual(strUserPass, strRPCUserColonPass);
}
//
// JSON-RPC protocol. Bitcoin speaks version 1.0 for maximum compatibility,
// but uses JSON-RPC 1.1/2.0 standards for parts of the 1.0 standard that were
// unspecified (HTTP errors and contents of 'error').
//
// 1.0 spec: http://json-rpc.org/wiki/specification
// 1.2 spec: http://groups.google.com/group/json-rpc/web/json-rpc-over-http
// http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx
//
string JSONRPCRequest(const string& strMethod, const Array& params, const Value& id)
{
Object request;
request.push_back(Pair("method", strMethod));
request.push_back(Pair("params", params));
request.push_back(Pair("id", id));
return write_string(Value(request), false) + "\n";
}
Object JSONRPCReplyObj(const Value& result, const Value& error, const Value& id)
{
Object reply;
if (error.type() != null_type)
reply.push_back(Pair("result", Value::null));
else
reply.push_back(Pair("result", result));
reply.push_back(Pair("error", error));
reply.push_back(Pair("id", id));
return reply;
}
string JSONRPCReply(const Value& result, const Value& error, const Value& id)
{
Object reply = JSONRPCReplyObj(result, error, id);
return write_string(Value(reply), false) + "\n";
}
void ErrorReply(std::ostream& stream, const Object& objError, const Value& id)
{
// Send error reply from json-rpc error object
int nStatus = HTTP_INTERNAL_SERVER_ERROR;
int code = find_value(objError, "code").get_int();
if (code == RPC_INVALID_REQUEST) nStatus = HTTP_BAD_REQUEST;
else if (code == RPC_METHOD_NOT_FOUND) nStatus = HTTP_NOT_FOUND;
string strReply = JSONRPCReply(Value::null, objError, id);
stream << HTTPReply(nStatus, strReply, false) << std::flush;
}
bool ClientAllowed(const boost::asio::ip::address& address)
{
// Make sure that IPv4-compatible and IPv4-mapped IPv6 addresses are treated as IPv4 addresses
if (address.is_v6()
&& (address.to_v6().is_v4_compatible()
|| address.to_v6().is_v4_mapped()))
return ClientAllowed(address.to_v6().to_v4());
if (address == asio::ip::address_v4::loopback()
|| address == asio::ip::address_v6::loopback()
|| (address.is_v4()
// Check whether IPv4 addresses match 127.0.0.0/8 (loopback subnet)
&& (address.to_v4().to_ulong() & 0xff000000) == 0x7f000000))
return true;
const string strAddress = address.to_string();
const vector<string>& vAllow = mapMultiArgs["-rpcallowip"];
BOOST_FOREACH(string strAllow, vAllow)
if (WildcardMatch(strAddress, strAllow))
return true;
return false;
}
//
// IOStream device that speaks SSL but can also speak non-SSL
//
template <typename Protocol>
class SSLIOStreamDevice : public iostreams::device<iostreams::bidirectional> {
public:
SSLIOStreamDevice(asio::ssl::stream<typename Protocol::socket> &streamIn, bool fUseSSLIn) : stream(streamIn)
{
fUseSSL = fUseSSLIn;
fNeedHandshake = fUseSSLIn;
}
void handshake(ssl::stream_base::handshake_type role)
{
if (!fNeedHandshake) return;
fNeedHandshake = false;
stream.handshake(role);
}
std::streamsize read(char* s, std::streamsize n)
{
handshake(ssl::stream_base::server); // HTTPS servers read first
if (fUseSSL) return stream.read_some(asio::buffer(s, n));
return stream.next_layer().read_some(asio::buffer(s, n));
}
std::streamsize write(const char* s, std::streamsize n)
{
handshake(ssl::stream_base::client); // HTTPS clients write first
if (fUseSSL) return asio::write(stream, asio::buffer(s, n));
return asio::write(stream.next_layer(), asio::buffer(s, n));
}
bool connect(const std::string& server, const std::string& port)
{
ip::tcp::resolver resolver(stream.get_io_service());
ip::tcp::resolver::query query(server.c_str(), port.c_str());
ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
ip::tcp::resolver::iterator end;
boost::system::error_code error = asio::error::host_not_found;
while (error && endpoint_iterator != end)
{
stream.lowest_layer().close();
stream.lowest_layer().connect(*endpoint_iterator++, error);
}
if (error)
return false;
return true;
}
private:
bool fNeedHandshake;
bool fUseSSL;
asio::ssl::stream<typename Protocol::socket>& stream;
};
class AcceptedConnection
{
public:
virtual ~AcceptedConnection() {}
virtual std::iostream& stream() = 0;
virtual std::string peer_address_to_string() const = 0;
virtual void close() = 0;
};
template <typename Protocol>
class AcceptedConnectionImpl : public AcceptedConnection
{
public:
AcceptedConnectionImpl(
asio::io_service& io_service,
ssl::context &context,
bool fUseSSL) :
sslStream(io_service, context),
_d(sslStream, fUseSSL),
_stream(_d)
{
}
virtual std::iostream& stream()
{
return _stream;
}
virtual std::string peer_address_to_string() const
{
return peer.address().to_string();
}
virtual void close()
{
_stream.close();
}
typename Protocol::endpoint peer;
asio::ssl::stream<typename Protocol::socket> sslStream;
private:
SSLIOStreamDevice<Protocol> _d;
iostreams::stream< SSLIOStreamDevice<Protocol> > _stream;
};
void ServiceConnection(AcceptedConnection *conn);
// Forward declaration required for RPCListen
template <typename Protocol, typename SocketAcceptorService>
static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
ssl::context& context,
bool fUseSSL,
AcceptedConnection* conn,
const boost::system::error_code& error);
/**
* Sets up I/O resources to accept and handle a new connection.
*/
template <typename Protocol, typename SocketAcceptorService>
static void RPCListen(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
ssl::context& context,
const bool fUseSSL)
{
// Accept connection
AcceptedConnectionImpl<Protocol>* conn = new AcceptedConnectionImpl<Protocol>(acceptor->get_io_service(), context, fUseSSL);
acceptor->async_accept(
conn->sslStream.lowest_layer(),
conn->peer,
boost::bind(&RPCAcceptHandler<Protocol, SocketAcceptorService>,
acceptor,
boost::ref(context),
fUseSSL,
conn,
boost::asio::placeholders::error));
}
/**
* Accept and handle incoming connection.
*/
template <typename Protocol, typename SocketAcceptorService>
static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
ssl::context& context,
const bool fUseSSL,
AcceptedConnection* conn,
const boost::system::error_code& error)
{
// Immediately start accepting new connections, except when we're cancelled or our socket is closed.
if (error != asio::error::operation_aborted && acceptor->is_open())
RPCListen(acceptor, context, fUseSSL);
AcceptedConnectionImpl<ip::tcp>* tcp_conn = dynamic_cast< AcceptedConnectionImpl<ip::tcp>* >(conn);
// TODO: Actually handle errors
if (error)
{
delete conn;
}
// Restrict callers by IP. It is important to
// do this before starting client thread, to filter out
// certain DoS and misbehaving clients.
else if (tcp_conn && !ClientAllowed(tcp_conn->peer.address()))
{
// Only send a 403 if we're not using SSL to prevent a DoS during the SSL handshake.
if (!fUseSSL)
conn->stream() << HTTPReply(HTTP_FORBIDDEN, "", false) << std::flush;
delete conn;
}
else {
ServiceConnection(conn);
conn->close();
delete conn;
}
}
void StartRPCThreads()
{
strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"];
if ((mapArgs["-rpcpassword"] == "") ||
(mapArgs["-rpcuser"] == mapArgs["-rpcpassword"]))
{
unsigned char rand_pwd[32];
RAND_bytes(rand_pwd, 32);
string strWhatAmI = "To use pennypincherd";
if (mapArgs.count("-server"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-server\"");
else if (mapArgs.count("-daemon"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-daemon\"");
uiInterface.ThreadSafeMessageBox(strprintf(
_("%s, you must set a rpcpassword in the configuration file:\n"
"%s\n"
"It is recommended you use the following random password:\n"
"rpcuser=pennypincherrpc\n"
"rpcpassword=%s\n"
"(you do not need to remember this password)\n"
"The username and password MUST NOT be the same.\n"
"If the file does not exist, create it with owner-readable-only file permissions.\n"
"It is also recommended to set alertnotify so you are notified of problems;\n"
"for example: alertnotify=echo %%s | mail -s \"pennypincher Alert\" admin@foo.com\n"),
strWhatAmI.c_str(),
GetConfigFile().string().c_str(),
EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()),
"", CClientUIInterface::MSG_ERROR);
StartShutdown();
return;
}
assert(rpc_io_service == NULL);
rpc_io_service = new asio::io_service();
rpc_ssl_context = new ssl::context(*rpc_io_service, ssl::context::sslv23);
const bool fUseSSL = GetBoolArg("-rpcssl");
if (fUseSSL)
{
rpc_ssl_context->set_options(ssl::context::no_sslv2);
filesystem::path pathCertFile(GetArg("-rpcsslcertificatechainfile", "server.cert"));
if (!pathCertFile.is_complete()) pathCertFile = filesystem::path(GetDataDir()) / pathCertFile;
if (filesystem::exists(pathCertFile)) rpc_ssl_context->use_certificate_chain_file(pathCertFile.string());
else printf("ThreadRPCServer ERROR: missing server certificate file %s\n", pathCertFile.string().c_str());
filesystem::path pathPKFile(GetArg("-rpcsslprivatekeyfile", "server.pem"));
if (!pathPKFile.is_complete()) pathPKFile = filesystem::path(GetDataDir()) / pathPKFile;
if (filesystem::exists(pathPKFile)) rpc_ssl_context->use_private_key_file(pathPKFile.string(), ssl::context::pem);
else printf("ThreadRPCServer ERROR: missing server private key file %s\n", pathPKFile.string().c_str());
string strCiphers = GetArg("-rpcsslciphers", "TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH");
SSL_CTX_set_cipher_list(rpc_ssl_context->impl(), strCiphers.c_str());
}
// Try a dual IPv6/IPv4 socket, falling back to separate IPv4 and IPv6 sockets
const bool loopback = !mapArgs.count("-rpcallowip");
asio::ip::address bindAddress = loopback ? asio::ip::address_v6::loopback() : asio::ip::address_v6::any();
ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", GetDefaultRPCPort()));
boost::system::error_code v6_only_error;
boost::shared_ptr<ip::tcp::acceptor> acceptor(new ip::tcp::acceptor(*rpc_io_service));
bool fListening = false;
std::string strerr;
try
{
acceptor->open(endpoint.protocol());
acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
// Try making the socket dual IPv6/IPv4 (if listening on the "any" address)
acceptor->set_option(boost::asio::ip::v6_only(loopback), v6_only_error);
acceptor->bind(endpoint);
acceptor->listen(socket_base::max_connections);
RPCListen(acceptor, *rpc_ssl_context, fUseSSL);
fListening = true;
}
catch(boost::system::system_error &e)
{
strerr = strprintf(_("An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s"), endpoint.port(), e.what());
}
try {
// If dual IPv6/IPv4 failed (or we're opening loopback interfaces only), open IPv4 separately
if (!fListening || loopback || v6_only_error)
{
bindAddress = loopback ? asio::ip::address_v4::loopback() : asio::ip::address_v4::any();
endpoint.address(bindAddress);
acceptor.reset(new ip::tcp::acceptor(*rpc_io_service));
acceptor->open(endpoint.protocol());
acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
acceptor->bind(endpoint);
acceptor->listen(socket_base::max_connections);
RPCListen(acceptor, *rpc_ssl_context, fUseSSL);
fListening = true;
}
}
catch(boost::system::system_error &e)
{
strerr = strprintf(_("An error occurred while setting up the RPC port %u for listening on IPv4: %s"), endpoint.port(), e.what());
}
if (!fListening) {
uiInterface.ThreadSafeMessageBox(strerr, "", CClientUIInterface::MSG_ERROR);
StartShutdown();
return;
}
rpc_worker_group = new boost::thread_group();
for (int i = 0; i < GetArg("-rpcthreads", 4); i++)
rpc_worker_group->create_thread(boost::bind(&asio::io_service::run, rpc_io_service));
}
void StopRPCThreads()
{
if (rpc_io_service == NULL) return;
rpc_io_service->stop();
rpc_worker_group->join_all();
delete rpc_worker_group; rpc_worker_group = NULL;
delete rpc_ssl_context; rpc_ssl_context = NULL;
delete rpc_io_service; rpc_io_service = NULL;
}
class JSONRequest
{
public:
Value id;
string strMethod;
Array params;
JSONRequest() { id = Value::null; }
void parse(const Value& valRequest);
};
void JSONRequest::parse(const Value& valRequest)
{
// Parse request
if (valRequest.type() != obj_type)
throw JSONRPCError(RPC_INVALID_REQUEST, "Invalid Request object");
const Object& request = valRequest.get_obj();
// Parse id now so errors from here on will have the id
id = find_value(request, "id");
// Parse method
Value valMethod = find_value(request, "method");
if (valMethod.type() == null_type)
throw JSONRPCError(RPC_INVALID_REQUEST, "Missing method");
if (valMethod.type() != str_type)
throw JSONRPCError(RPC_INVALID_REQUEST, "Method must be a string");
strMethod = valMethod.get_str();
if (strMethod != "getwork" && strMethod != "getworkex" && strMethod != "getblocktemplate")
printf("ThreadRPCServer method=%s\n", strMethod.c_str());
// Parse params
Value valParams = find_value(request, "params");
if (valParams.type() == array_type)
params = valParams.get_array();
else if (valParams.type() == null_type)
params = Array();
else
throw JSONRPCError(RPC_INVALID_REQUEST, "Params must be an array");
}
static Object JSONRPCExecOne(const Value& req)
{
Object rpc_result;
JSONRequest jreq;
try {
jreq.parse(req);
Value result = tableRPC.execute(jreq.strMethod, jreq.params);
rpc_result = JSONRPCReplyObj(result, Value::null, jreq.id);
}
catch (Object& objError)
{
rpc_result = JSONRPCReplyObj(Value::null, objError, jreq.id);
}
catch (std::exception& e)
{
rpc_result = JSONRPCReplyObj(Value::null,
JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id);
}
return rpc_result;
}
static string JSONRPCExecBatch(const Array& vReq)
{
Array ret;
for (unsigned int reqIdx = 0; reqIdx < vReq.size(); reqIdx++)
ret.push_back(JSONRPCExecOne(vReq[reqIdx]));
return write_string(Value(ret), false) + "\n";
}
void ServiceConnection(AcceptedConnection *conn)
{
bool fRun = true;
while (fRun)
{
int nProto = 0;
map<string, string> mapHeaders;
string strRequest, strMethod, strURI;
// Read HTTP request line
if (!ReadHTTPRequestLine(conn->stream(), nProto, strMethod, strURI))
break;
// Read HTTP message headers and body
ReadHTTPMessage(conn->stream(), mapHeaders, strRequest, nProto);
if (strURI != "/") {
conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush;
break;
}
// Check authorization
if (mapHeaders.count("authorization") == 0)
{
conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush;
break;
}
if (!HTTPAuthorized(mapHeaders))
{
printf("ThreadRPCServer incorrect password attempt from %s\n", conn->peer_address_to_string().c_str());
/* Deter brute-forcing short passwords.
If this results in a DOS the user really
shouldn't have their RPC port exposed.*/
if (mapArgs["-rpcpassword"].size() < 20)
MilliSleep(250);
conn->stream() << HTTPReply(HTTP_UNAUTHORIZED, "", false) << std::flush;
break;
}
if (mapHeaders["connection"] == "close")
fRun = false;
JSONRequest jreq;
try
{
// Parse request
Value valRequest;
if (!read_string(strRequest, valRequest))
throw JSONRPCError(RPC_PARSE_ERROR, "Parse error");
string strReply;
// singleton request
if (valRequest.type() == obj_type) {
jreq.parse(valRequest);
Value result = tableRPC.execute(jreq.strMethod, jreq.params);
// Send reply
strReply = JSONRPCReply(result, Value::null, jreq.id);
// array of requests
} else if (valRequest.type() == array_type)
strReply = JSONRPCExecBatch(valRequest.get_array());
else
throw JSONRPCError(RPC_PARSE_ERROR, "Top-level object parse error");
conn->stream() << HTTPReply(HTTP_OK, strReply, fRun) << std::flush;
}
catch (Object& objError)
{
ErrorReply(conn->stream(), objError, jreq.id);
break;
}
catch (std::exception& e)
{
ErrorReply(conn->stream(), JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id);
break;
}
}
}
json_spirit::Value CRPCTable::execute(const std::string &strMethod, const json_spirit::Array ¶ms) const
{
// Find method
const CRPCCommand *pcmd = tableRPC[strMethod];
if (!pcmd)
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found");
if (pcmd->reqWallet && !pwalletMain)
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found (disabled)");
// Observe safe mode
string strWarning = GetWarnings("rpc");
if (strWarning != "" && !GetBoolArg("-disablesafemode") &&
!pcmd->okSafeMode)
throw JSONRPCError(RPC_FORBIDDEN_BY_SAFE_MODE, string("Safe mode: ") + strWarning);
try
{
// Execute
Value result;
{
if (pcmd->threadSafe)
result = pcmd->actor(params, false);
else if (!pwalletMain) {
LOCK(cs_main);
result = pcmd->actor(params, false);
} else {
LOCK2(cs_main, pwalletMain->cs_wallet);
result = pcmd->actor(params, false);
}
}
return result;
}
catch (std::exception& e)
{
throw JSONRPCError(RPC_MISC_ERROR, e.what());
}
}
Object CallRPC(const string& strMethod, const Array& params)
{
if (mapArgs["-rpcuser"] == "" && mapArgs["-rpcpassword"] == "")
throw runtime_error(strprintf(
_("You must set rpcpassword=<password> in the configuration file:\n%s\n"
"If the file does not exist, create it with owner-readable-only file permissions."),
GetConfigFile().string().c_str()));
// Connect to localhost
bool fUseSSL = GetBoolArg("-rpcssl");
asio::io_service io_service;
ssl::context context(io_service, ssl::context::sslv23);
context.set_options(ssl::context::no_sslv2);
asio::ssl::stream<asio::ip::tcp::socket> sslStream(io_service, context);
SSLIOStreamDevice<asio::ip::tcp> d(sslStream, fUseSSL);
iostreams::stream< SSLIOStreamDevice<asio::ip::tcp> > stream(d);
if (!d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(GetDefaultRPCPort()))))
throw runtime_error("couldn't connect to server");
// HTTP basic authentication
string strUserPass64 = EncodeBase64(mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"]);
map<string, string> mapRequestHeaders;
mapRequestHeaders["Authorization"] = string("Basic ") + strUserPass64;
// Send request
string strRequest = JSONRPCRequest(strMethod, params, 1);
string strPost = HTTPPost(strRequest, mapRequestHeaders);
stream << strPost << std::flush;
// Receive HTTP reply status
int nProto = 0;
int nStatus = ReadHTTPStatus(stream, nProto);
// Receive HTTP reply message headers and body
map<string, string> mapHeaders;
string strReply;
ReadHTTPMessage(stream, mapHeaders, strReply, nProto);
if (nStatus == HTTP_UNAUTHORIZED)
throw runtime_error("incorrect rpcuser or rpcpassword (authorization failed)");
else if (nStatus >= 400 && nStatus != HTTP_BAD_REQUEST && nStatus != HTTP_NOT_FOUND && nStatus != HTTP_INTERNAL_SERVER_ERROR)
throw runtime_error(strprintf("server returned HTTP error %d", nStatus));
else if (strReply.empty())
throw runtime_error("no response from server");
// Parse reply
Value valReply;
if (!read_string(strReply, valReply))
throw runtime_error("couldn't parse reply from server");
const Object& reply = valReply.get_obj();
if (reply.empty())
throw runtime_error("expected reply to have result, error and id properties");
return reply;
}
template<typename T>
void ConvertTo(Value& value, bool fAllowNull=false)
{
if (fAllowNull && value.type() == null_type)
return;
if (value.type() == str_type)
{
// reinterpret string as unquoted json value
Value value2;
string strJSON = value.get_str();
if (!read_string(strJSON, value2))
throw runtime_error(string("Error parsing JSON:")+strJSON);
ConvertTo<T>(value2, fAllowNull);
value = value2;
}
else
{
value = value.get_value<T>();
}
}
// Convert strings to command-specific RPC representation
Array RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams)
{
Array params;
BOOST_FOREACH(const std::string ¶m, strParams)
params.push_back(param);
int n = params.size();
//
// Special case non-string parameter types
//
if (strMethod == "stop" && n > 0) ConvertTo<bool>(params[0]);
if (strMethod == "getaddednodeinfo" && n > 0) ConvertTo<bool>(params[0]);
if (strMethod == "setgenerate" && n > 0) ConvertTo<bool>(params[0]);
if (strMethod == "setgenerate" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "getnetworkhashps" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "getnetworkhashps" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "sendtoaddress" && n > 1) ConvertTo<double>(params[1]);
if (strMethod == "settxfee" && n > 0) ConvertTo<double>(params[0]);
if (strMethod == "setmininput" && n > 0) ConvertTo<double>(params[0]);
if (strMethod == "getreceivedbyaddress" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "getreceivedbyaccount" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "listreceivedbyaddress" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "listreceivedbyaddress" && n > 1) ConvertTo<bool>(params[1]);
if (strMethod == "listreceivedbyaccount" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "listreceivedbyaccount" && n > 1) ConvertTo<bool>(params[1]);
if (strMethod == "getbalance" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "getblockhash" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "move" && n > 2) ConvertTo<double>(params[2]);
if (strMethod == "move" && n > 3) ConvertTo<boost::int64_t>(params[3]);
if (strMethod == "sendfrom" && n > 2) ConvertTo<double>(params[2]);
if (strMethod == "sendfrom" && n > 3) ConvertTo<boost::int64_t>(params[3]);
if (strMethod == "listtransactions" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "listtransactions" && n > 2) ConvertTo<boost::int64_t>(params[2]);
if (strMethod == "listaccounts" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "walletpassphrase" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "getblocktemplate" && n > 0) ConvertTo<Object>(params[0]);
if (strMethod == "listsinceblock" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "sendmany" && n > 1) ConvertTo<Object>(params[1]);
if (strMethod == "sendmany" && n > 2) ConvertTo<boost::int64_t>(params[2]);
if (strMethod == "addmultisigaddress" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "addmultisigaddress" && n > 1) ConvertTo<Array>(params[1]);
if (strMethod == "createmultisig" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "createmultisig" && n > 1) ConvertTo<Array>(params[1]);
if (strMethod == "listunspent" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "listunspent" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "listunspent" && n > 2) ConvertTo<Array>(params[2]);
if (strMethod == "getblock" && n > 1) ConvertTo<bool>(params[1]);
if (strMethod == "getrawtransaction" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "createrawtransaction" && n > 0) ConvertTo<Array>(params[0]);
if (strMethod == "createrawtransaction" && n > 1) ConvertTo<Object>(params[1]);
if (strMethod == "signrawtransaction" && n > 1) ConvertTo<Array>(params[1], true);
if (strMethod == "signrawtransaction" && n > 2) ConvertTo<Array>(params[2], true);
if (strMethod == "gettxout" && n > 1) ConvertTo<boost::int64_t>(params[1]);
if (strMethod == "gettxout" && n > 2) ConvertTo<bool>(params[2]);
if (strMethod == "lockunspent" && n > 0) ConvertTo<bool>(params[0]);
if (strMethod == "lockunspent" && n > 1) ConvertTo<Array>(params[1]);
if (strMethod == "importprivkey" && n > 2) ConvertTo<bool>(params[2]);
if (strMethod == "verifychain" && n > 0) ConvertTo<boost::int64_t>(params[0]);
if (strMethod == "verifychain" && n > 1) ConvertTo<boost::int64_t>(params[1]);
return params;
}
int CommandLineRPC(int argc, char *argv[])
{
string strPrint;
int nRet = 0;
try
{
// Skip switches
while (argc > 1 && IsSwitchChar(argv[1][0]))
{
argc--;
argv++;
}
// Method
if (argc < 2)
throw runtime_error("too few parameters");
string strMethod = argv[1];
// Parameters default to strings
std::vector<std::string> strParams(&argv[2], &argv[argc]);
Array params = RPCConvertValues(strMethod, strParams);
// Execute
Object reply = CallRPC(strMethod, params);
// Parse reply
const Value& result = find_value(reply, "result");
const Value& error = find_value(reply, "error");
if (error.type() != null_type)
{
// Error
strPrint = "error: " + write_string(error, false);
int code = find_value(error.get_obj(), "code").get_int();
nRet = abs(code);
}
else
{
// Result
if (result.type() == null_type)
strPrint = "";
else if (result.type() == str_type)
strPrint = result.get_str();
else
strPrint = write_string(result, true);
}
}
catch (boost::thread_interrupted) {
throw;
}
catch (std::exception& e) {
strPrint = string("error: ") + e.what();
nRet = 87;
}
catch (...) {
PrintException(NULL, "CommandLineRPC()");
}
if (strPrint != "")
{
fprintf((nRet == 0 ? stdout : stderr), "%s\n", strPrint.c_str());
}
return nRet;
}
#ifdef TEST
int main(int argc, char *argv[])
{
#ifdef _MSC_VER
// Turn off Microsoft heap dump noise
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, CreateFile("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0));
#endif
setbuf(stdin, NULL);
setbuf(stdout, NULL);
setbuf(stderr, NULL);
try
{
if (argc >= 2 && string(argv[1]) == "-server")
{
printf("server ready\n");
ThreadRPCServer(NULL);
}
else
{
return CommandLineRPC(argc, argv);
}
}
catch (boost::thread_interrupted) {
throw;
}
catch (std::exception& e) {
PrintException(&e, "main()");
} catch (...) {
PrintException(NULL, "main()");
}
return 0;
}
#endif
const CRPCTable tableRPC;
| [
"peacemakers109@gmail.com"
] | peacemakers109@gmail.com |
160562f71f0418a5cdc478a49f25ca36a32a228a | 948f4e13af6b3014582909cc6d762606f2a43365 | /testcases/juliet_test_suite/testcases/CWE197_Numeric_Truncation_Error/s01/CWE197_Numeric_Truncation_Error__int_fscanf_to_char_84_bad.cpp | 43f1b7a6f6dac031358853c57d0c2ee985a9233c | [] | no_license | junxzm1990/ASAN-- | 0056a341b8537142e10373c8417f27d7825ad89b | ca96e46422407a55bed4aa551a6ad28ec1eeef4e | refs/heads/master | 2022-08-02T15:38:56.286555 | 2022-06-16T22:19:54 | 2022-06-16T22:19:54 | 408,238,453 | 74 | 13 | null | 2022-06-16T22:19:55 | 2021-09-19T21:14:59 | null | UTF-8 | C++ | false | false | 1,392 | cpp | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE197_Numeric_Truncation_Error__int_fscanf_to_char_84_bad.cpp
Label Definition File: CWE197_Numeric_Truncation_Error__int.label.xml
Template File: sources-sink-84_bad.tmpl.cpp
*/
/*
* @description
* CWE: 197 Numeric Truncation Error
* BadSource: fscanf Read data from the console using fscanf()
* GoodSource: Less than CHAR_MAX
* Sinks: to_char
* BadSink : Convert data to a char
* Flow Variant: 84 Data flow: data passed to class constructor and destructor by declaring the class object on the heap and deleting it after use
*
* */
#ifndef OMITBAD
#include "std_testcase.h"
#include "CWE197_Numeric_Truncation_Error__int_fscanf_to_char_84.h"
namespace CWE197_Numeric_Truncation_Error__int_fscanf_to_char_84
{
CWE197_Numeric_Truncation_Error__int_fscanf_to_char_84_bad::CWE197_Numeric_Truncation_Error__int_fscanf_to_char_84_bad(int dataCopy)
{
data = dataCopy;
/* POTENTIAL FLAW: Read data from the console using fscanf() */
fscanf(stdin, "%d", &data);
}
CWE197_Numeric_Truncation_Error__int_fscanf_to_char_84_bad::~CWE197_Numeric_Truncation_Error__int_fscanf_to_char_84_bad()
{
{
/* POTENTIAL FLAW: Convert data to a char, possibly causing a truncation error */
char charData = (char)data;
printHexCharLine(charData);
}
}
}
#endif /* OMITBAD */
| [
"yzhang0701@gmail.com"
] | yzhang0701@gmail.com |
99a4c7d4b45cb2f4fde41fed40012aae79e4829d | 06bed8ad5fd60e5bba6297e9870a264bfa91a71d | /Tables/audiotableframe.cpp | 85c6438effc9bbbce7980cac0954b745cc761f5f | [] | no_license | allenck/DecoderPro_app | 43aeb9561fe3fe9753684f7d6d76146097d78e88 | 226c7f245aeb6951528d970f773776d50ae2c1dc | refs/heads/master | 2023-05-12T07:36:18.153909 | 2023-05-10T21:17:40 | 2023-05-10T21:17:40 | 61,044,197 | 4 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 2,545 | cpp | #include "audiotableframe.h"
#include "audiotablepanel.h"
#include <QBoxLayout>
#include <QMenu>
#include <QMenuBar>
#include "savemenu.h"
//AudioTableFrame::AudioTableFrame(QWidget *parent) :
// BeanTableFrame(parent)
//{
//}
/**
*
* <hr>
* This file is part of JMRI.
* <P>
* JMRI is free software; you can redistribute it and/or modify it under the
* terms of version 2 of the GNU General Public License as published by the Free
* Software Foundation. See the "COPYING" file for a copy of this license.
* <P>
* JMRI 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.
* <P>
*
* @author Bob Jacobsen Copyright (C) 2003
* @author Matthew Harris copyright (c) 2009
* @version $Revision: 28746 $
*/
// /*public*/ class AudioTableFrame extends BeanTableFrame {
//static final ResourceBundle rba = ResourceBundle.getBundle("jmri.jmrit.audio.swing.AudioTableBundle");
/**
*
*/
// private static final long serialVersionUID = -92682823885444455L;
/*public*/ AudioTableFrame::AudioTableFrame(AudioTablePanel* panel,
QString helpTarget, QWidget *parent) :
BeanTableFrame(parent)
{
//super();
audioPanel = panel;
setFrameRef(getClassName());
// general GUI config
//getContentPane()->setLayout(new QVBoxLayout);//(getContentPane(), BoxLayout.Y_AXIS));
QVBoxLayout* centralWidgetLayout;
if(getContentPane(true) == NULL)
{
QWidget* centralWidget = new QWidget;
centralWidget->setLayout(centralWidgetLayout = new QVBoxLayout);
setCentralWidget(centralWidget);
}
else
centralWidgetLayout = (QVBoxLayout*)centralWidget()->layout();
// add save menu item
QMenuBar* menuBar = new QMenuBar();
QMenu* fileMenu = new QMenu(tr("File"));
menuBar->addMenu(fileMenu);
fileMenu->addMenu(new SaveMenu());
//fileMenu.add(panel.getPrintItem());
setMenuBar(menuBar);
addHelpMenu(helpTarget, true);
// install items in GUI
//getContentPane().add(audioPanel);
centralWidgetLayout->addWidget(audioPanel);
// bottomBox = Box.createHorizontalBox();
// bottomBox.add(Box.createHorizontalGlue()); // stays at end of box
bottomBoxIndex = 0;
//getContentPane().add(bottomBox);
centralWidgetLayout->addWidget(bottomBox);
// add extras, if desired by subclass
extras();
}
//@Override
/*public*/ void AudioTableFrame::dispose() {
if (audioPanel != NULL) {
audioPanel->dispose();
}
BeanTableFrame::dispose();
}
| [
"allenck@windstream.net"
] | allenck@windstream.net |
befc19a887e3166f065c0fdeda0cfc42faf23887 | 70ed73fa6cd01661d9cd3f9874a7571ffac4d006 | /inc/KMRlum.h | 32c16c22a64cc46840eab97346628b430171ee80 | [] | no_license | zleba/mcExclusive | 87177c3e538dee0e378aab169286c219c97e84ea | cb5f83f0de53a8575625e3dbbb153ff6448f6255 | refs/heads/master | 2021-09-04T18:51:04.432644 | 2018-01-21T09:26:26 | 2018-01-21T09:26:26 | 109,682,766 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,281 | h | #ifndef _KMRlum_
#define _KMRlum_
#include "Basics.h"
#include <iostream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <complex>
#include "Pythia8/Pythia.h"
using namespace std;
class Vec2;
struct STATUS;
class KMRlum {
public:
KMRlum(Double sqrtS, Double qMin, Double alphaS, Double mc, Double mb, Pythia8::BeamParticle *_beamPtr );
static Double Uniform(Double a, Double b);
Double gluon(Double x, Double q2 ) const;
pair<Double,Double> gluonPairChic(Double x, Double q) const;
Double LeifGluonChicUnintegrated(Double x, Double q, Double y, Double Int) const;
vector< complex<Double> > LumSqrtRandom(Double M, Double y, Double Mju, Double MjuLoop, const Vec2 &p1, const Vec2 &p2);
void LuminosityRand(Double M, Double y, Double Mju, Double MjuLoop, Vec2 &p1, Vec2 &p2, complex<Double> lum[], complex<Double> lumC[] );
Double LuminosityInc(Double M, Double y, Double Mju);
Double SplittingAlphaS(Double LnScale2) const;
Double alphaStrong(Double LnScale2) const;
Double Splitting(Double Kt) const;
Double InsideSudakov(Double LnQ2, Double LnM2) const;
Double NoEmProbability(Double _x1, Double _x2, Double LnQ2, Double LnM2, bool backward=true);
Double integral( Double (KMRlum::*func)(Double x) const, Double xmin, Double xmax, Double &err ) const;
void SaveIntegral(STATUS &st, Double xmin, Double xmax, Double Int) const;
static void GetYint(Double x, Double &y, Double &Int);
private:
Double Lambda5QCD, LnFreeze2;
Double MinQt2;
Double bSlope;
Double LnCharmMass2, LnBottomMass2;
Double CharmMass, BottomMass;
Double x1,x2,s;
Pythia8::BeamParticle *beamPtr;
static Pythia8::Rndm *rndmPtr;
};
inline bool close(double a, double b)
{
return abs(a - b) < 1e-12;
}
struct DATA {
Double xmin, xmax, Int;
DATA(Double _xmin, Double _xmax, Double _Int)
: xmin(_xmin), xmax(_xmax), Int(_Int) {}
inline bool isSame(Double _xmin, Double _xmax)
{ return ( close(xmin,_xmin) && close(xmax,_xmax) ); }
};
struct STATUS {
Double Mred;
vector<DATA> points;
void print() {
cout << "Start" << endl;
for(unsigned int i=0; i < points.size(); ++i)
cout << points[i].xmin<<" "<<points[i].xmax<<" : "<< points[i].Int << endl;
cout << "End" << endl;
}
};
class Vec2 {
public:
Vec2(Double xIn = 0., Double yIn = 0.)
: xx(xIn), yy(yIn) { }
Vec2(const Vec2& v) : xx(v.xx), yy(v.yy) { }
void setRPhi(Double r, Double phi )
{ xx=r*cos(phi); yy=r*sin(phi); }
void setXY(Double x, Double y )
{ xx=x; yy=y; }
void x(Double xIn) {xx = xIn;}
void y(Double yIn) {yy = yIn;}
Double x() const {return xx;}
Double y() const {return yy;}
Double px() const {return xx;}
Double py() const {return yy;}
Double norm() const {return sqrt(xx*xx+yy*yy);}
Double norm2() const {return (xx*xx+yy*yy);}
Vec2 operator-()
{ return Vec2(-xx,-yy);}
Vec2& operator+=(const Vec2& v)
{xx += v.xx; yy += v.yy; return *this;}
Vec2& operator-=(const Vec2& v)
{xx -= v.xx; yy -= v.yy; return *this;}
Vec2& operator*=(Double f)
{xx *= f; yy *= f; return *this;}
Vec2& operator/=(Double f)
{xx /= f; yy /= f; return *this;}
// Operator overloading with friends
friend Vec2 operator+(const Vec2& v1, const Vec2& v2);
friend Vec2 operator-(const Vec2& v1, const Vec2& v2);
friend Vec2 operator*(Double f, const Vec2& v1);
friend Vec2 operator*(const Vec2& v1, Double f);
friend Vec2 operator/(const Vec2& v1, Double f);
friend Double operator*(const Vec2& v1, const Vec2& v2);
friend Double cross(const Vec2& v1, const Vec2& v2);
private:
Double xx, yy;
};
inline Vec2 operator+(const Vec2& v1, const Vec2& v2)
{Vec2 v = v1 ; return v += v2;}
inline Vec2 operator-(const Vec2& v1, const Vec2& v2)
{Vec2 v = v1 ; return v -= v2;}
inline Vec2 operator*(Double f, const Vec2& v1)
{Vec2 v = v1; return v *= f;}
inline Vec2 operator*(const Vec2& v1, Double f)
{Vec2 v = v1; return v *= f;}
inline Vec2 operator/(const Vec2& v1, Double f)
{Vec2 v = v1; return v /= f;}
inline Double operator*(const Vec2& v1, const Vec2& v2)
{return v1.xx*v2.xx + v1.yy*v2.yy;}
inline Double cross(const Vec2& v1, const Vec2& v2)
{return v1.xx*v2.yy - v1.yy*v2.xx;}
#endif
| [
"radek.zlebcik@cern.ch"
] | radek.zlebcik@cern.ch |
ad5346e467cab8dd6b8e89f964ee4332c7699a1b | ad0940e1d7bdc25a9c49d71a498e5b6fe34cbfb3 | /TrianglePainting/GA.h | 6392b27f08b0d201092224dc253ab04752da2a91 | [] | no_license | Radostinaa/GeneticDrawing | 6c7bb7144cece8b2d813c7dfbce3dc255c54e462 | 321721400071add2e11614346c56f5b5670dd0cc | refs/heads/master | 2020-04-05T23:15:13.986115 | 2016-06-30T09:17:01 | 2016-06-30T09:17:01 | 60,121,469 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 672 | h | #pragma once
#include "Image.h"
#include "Vector.h"
#include <SDL.h>
#include "Random.h"
class GA
{
public:
GA(const int _trianglesCount, const SDL_Surface* _original) : trianglesCount(_trianglesCount)
{
this->originalPixels = (Uint32 *)_original->pixels;
}
void fitness(Image& image);
Image cross(const Image& mother, const Image& fother, std::vector<Triangle>& used);
void mutate(Image& image);
private:
int trianglesCount;
Uint32 * originalPixels;
const SDL_Surface* original;
Random rnd;
bool isOnRightTriangle(const Triangle& tr, const Vector2& p1, const Vector2& p2);
bool isOnRightPint(const Vector2& p1, const Vector2& p2, const Vector2& p3);
}; | [
"radostina.dimovaa@gmail.com"
] | radostina.dimovaa@gmail.com |
485785e0818e991bd04b0e5260c60cff2274a283 | 5d83739af703fb400857cecc69aadaf02e07f8d1 | /Archive2/86/013655330eb340/main.cpp | bfc79b3736b07a8195a69cfe6a06364687ba4eb2 | [] | no_license | WhiZTiM/coliru | 3a6c4c0bdac566d1aa1c21818118ba70479b0f40 | 2c72c048846c082f943e6c7f9fa8d94aee76979f | refs/heads/master | 2021-01-01T05:10:33.812560 | 2015-08-24T19:09:22 | 2015-08-24T19:09:22 | 56,789,706 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 414 | cpp |
#include <sstream>
#include <map>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
class Bar;
class Foo{
public:
Foo() : i(99) {}
friend class Bar;
private:
int i;
};
class Bar {
static void Test(Foo foo){
std::cout << foo.i;
}
};
int main(void)
{
Foo foo;
Bar::Test(foo);
}
| [
"francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df"
] | francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df |
23ba8c2e3c3ea824e580bcc6675079483ce0b983 | c9607c45fbffb58e76bc292210b96841329a3893 | /SensorOrientation/QuaternionOrientation/QuaternionOrientation.ino | 8cd0823b7907f1954733653b83fba6a93489a302 | [] | no_license | tanmoyAtb/winger | 089ea052de18a5d7407731921239a7c8ad85818f | 98add64d3c39021de11dea7173768ccdbbc04595 | refs/heads/master | 2021-06-07T09:14:48.911213 | 2016-10-23T10:45:43 | 2016-10-23T10:45:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,135 | ino | /* ==================================================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2012 Jeff Rowberg
J_RPM: modified to suit reading with PROCESSING 2
=====================================================================
*/
// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
// for both classes must be in the include path of your project
#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"
//#include "MPU6050.h" // not necessary if using MotionApps include file
// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
// is used in I2Cdev.h
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
#include "Wire.h"
#endif
// class default I2C address is 0x68
// specific I2C addresses may be passed as a parameter here
// AD0 low = 0x68 (default for SparkFun breakout and InvenSense evaluation board)
// AD0 high = 0x69
MPU6050 mpu;
//MPU6050 mpu(0x69); // <-- use for AD0 high
/* =========================================================================
MPU6050 - ARDUINO UNO
SDA - A4
SCL - A5
AD0 - GND (AD0 low = 0x68 / AD0 high = 0x69)
INT - PIN2
VCC - 3.3V
GND - GND
* ========================================================================= */
// uncomment "OUTPUT_READABLE_QUATERNION" if you want to see the actual
// quaternion components in a [w, x, y, z] format (not best for parsing
// on a remote host such as Processing or something though)
#define OUTPUT_READABLE_QUATERNION
#define LED_PIN 13 // (LED Arduino en PIN 13)
bool blinkState = false;
// MPU control/status vars
bool dmpReady = false; // set true if DMP init was successful
uint8_t mpuIntStatus; // holds actual interrupt status byte from MPU
uint8_t devStatus; // return status after each device operation (0 = success, !0 = error)
uint16_t packetSize; // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount; // count of all bytes currently in FIFO
uint8_t fifoBuffer[64]; // FIFO storage buffer
// orientation/motion vars
Quaternion q; // [w, x, y, z] quaternion container
//VectorInt16 aa; // [x, y, z] accel sensor measurements
//VectorInt16 aaReal; // [x, y, z] gravity-free accel sensor measurements
//VectorInt16 aaWorld; // [x, y, z] world-frame accel sensor measurements
//VectorFloat gravity; // [x, y, z] gravity vector
//float euler[3]; // [psi, theta, phi] Euler angle container
//float ypr[3]; // [yaw, pitch, roll] yaw/pitch/roll container and gravity vector
// packet structure for InvenSense teapot demo
//uint8_t teapotPacket[14] = { '$', 0x02, 0,0, 0,0, 0,0, 0,0, 0x00, 0x00, '\r', '\n' };
// ================================================================
// === INTERRUPT DETECTION ROUTINE ===
// ================================================================
volatile bool mpuInterrupt = false; // indicates whether MPU interrupt pin has gone high
void dmpDataReady() {
mpuInterrupt = true;
}
// ================================================================
// === INITIAL SETUP ===
// ================================================================
void setup() {
// join I2C bus (I2Cdev library doesn't do this automatically)
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
Wire.begin();
TWBR = 24; // 400kHz I2C clock (200kHz if CPU is 8MHz)
#elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
Fastwire::setup(400, true);
#endif
// initialize serial communication
// (115200 chosen because it is required for Teapot Demo output, but it's
// really up to you depending on your project)
Serial.begin(115200);
while (!Serial); // wait for Leonardo enumeration, others continue immediately
// initialize device
//Serial.println(F("Initializing I2C devices..."));
mpu.initialize();
// verify connection
///Serial.println(F("Testing device connections..."));
///Serial.println(mpu.testConnection() ? F("MPU6050 connection successful") : F("MPU6050 connection failed"));
// ELIMINATED, to start without pressing a key [J_RPM]
/*
// wait for ready
Serial.println(F("\nSend any character to begin DMP programming and demo: "));
while (Serial.available() && Serial.read()); // empty buffer
while (!Serial.available()); // wait for data
while (Serial.available() && Serial.read()); // empty buffer again
*/
// load and configure the DMP
///Serial.println(F("Initializing DMP..."));
devStatus = mpu.dmpInitialize();
// ================================================================
// Example, calibration data made with: MPU_6050_calibration
// ================================================================
/*
Sensor readings with offsets: -6 -7 16379 1 -1 2
Your offsets: -89 1027 1453 104 -40 20
// 2137 447 2039 39 65 -26
Data is printed as: acelX acelY acelZ giroX giroY giroZ
Check that your sensor readings are close to 0 0 16384 0 0 0
If calibration was succesful write down your offsets so you can set them in your projects using something similar to mpu.setXAccelOffset(youroffset)
// ================================================================
// Commented on: Information from previous calibration [J_RPM]
// ================================================================
// supply your own gyro offsets here, scaled for min sensitivity
mpu.setXGyroOffset(220);
mpu.setYGyroOffset(76);
mpu.setZGyroOffset(-85);
mpu.setZAccelOffset(1788); // 1688 factory default for my test chip
*/
// ================================================================
// The current calibration data [J_RPM]
// ================================================================
// supply your own gyro offsets here, scaled for min sensitivity
mpu.setXGyroOffset(39);
mpu.setYGyroOffset(65);
mpu.setZGyroOffset(-26);
mpu.setZAccelOffset(2039); // 16391 factory default for my test chip
// make sure it worked (returns 0 if so)
if (devStatus == 0) {
// turn on the DMP, now that it's ready
////Serial.println(F("Enabling DMP..."));
mpu.setDMPEnabled(true);
// enable Arduino interrupt detection
////Serial.println(F("Enabling interrupt detection (Arduino external interrupt 0)..."));
attachInterrupt(0, dmpDataReady, RISING);
mpuIntStatus = mpu.getIntStatus();
// set our DMP Ready flag so the main loop() function knows it's okay to use it
///Serial.println(F("DMP ready! Waiting for first interrupt..."));
dmpReady = true;
// get expected DMP packet size for later comparison
packetSize = mpu.dmpGetFIFOPacketSize();
} else {
// ERROR!
// 1 = initial memory load failed
// 2 = DMP configuration updates failed
// (if it's going to break, usually the code will be 1)
Serial.print(F("DMP Initialization failed (code "));
Serial.print(devStatus);
Serial.println(F(")"));
}
// configure LED for output
pinMode(LED_PIN, OUTPUT);
}
// ================================================================
// === MAIN PROGRAM LOOP ===
// ================================================================
void loop() {
/////////////////////////////////////////////////////////////////////
// === Delay to adjust the speed of the PC with PROCESSING 2 === [J_RPM]
// ...if the processor in your PC is fast, you can eliminate this delay
/////////////////////////////////////////////////////////////////////
delay(200);
mpu.resetFIFO();
delay(50);
/////////////////////////////////////////////////////////////////////
// if programming failed, don't try to do anything
if (!dmpReady) return;
// wait for MPU interrupt or extra packet(s) available
while (!mpuInterrupt && fifoCount < packetSize) {
// other program behavior stuff here
// .
// .
// .
// if you are really paranoid you can frequently test in between other
// stuff to see if mpuInterrupt is true, and if so, "break;" from the
// while() loop to immediately process the MPU data
// .
// .
// .
}
// reset interrupt flag and get INT_STATUS byte
mpuInterrupt = false;
mpuIntStatus = mpu.getIntStatus();
// get current FIFO count
fifoCount = mpu.getFIFOCount();
// check for overflow (this should never happen unless our code is too inefficient)
if ((mpuIntStatus & 0x10) || fifoCount == 1024) {
// reset so we can continue cleanly
mpu.resetFIFO();
Serial.println(F("FIFO overflow!"));
// otherwise, check for DMP data ready interrupt (this should happen frequently)
} else if (mpuIntStatus & 0x02) {
// wait for correct available data length, should be a VERY short wait
while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();
// read a packet from FIFO
mpu.getFIFOBytes(fifoBuffer, packetSize);
// track FIFO count here in case there is > 1 packet available
// (this lets us immediately read more without waiting for an interrupt)
fifoCount -= packetSize;
// New protocol for sending data [J_RPM]
#ifdef OUTPUT_READABLE_QUATERNION
// display quaternion values in easy matrix form: w x y z
mpu.dmpGetQuaternion(&q, fifoBuffer);
Serial.print(q.w);
Serial.print(",");
Serial.print(q.x);
Serial.print(",");
Serial.print(q.y);
Serial.print(",");
Serial.print(q.z);
Serial.println(",");
#endif
// blink LED to indicate activity
blinkState = !blinkState;
digitalWrite(LED_PIN, blinkState);
}
}
| [
"tanmoy.buet12@gmail.com"
] | tanmoy.buet12@gmail.com |
d2d4738be231fffe4c5c3c3d411be9d0be2adede | fb0187e10f0a6834015bd427ee89c34d3c40e3bb | /Arduino/libraries/ros_lib/concert_msgs/AllocateSoftware.h | fad9d089abfa6b3afa8afc3c0ab68aa5523bbb66 | [] | no_license | lmgarciagoncalves/nboat | 53a40068f82a55a09dfef8c66c73727ff7e3d6cf | 1329bb6a8ec4f9be984be62ee9946cc8141ba46a | refs/heads/master | 2023-08-24T11:56:43.525177 | 2021-10-23T18:41:52 | 2021-10-23T18:41:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,289 | h | #ifndef _ROS_SERVICE_AllocateSoftware_h
#define _ROS_SERVICE_AllocateSoftware_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
#include "rocon_std_msgs/KeyValue.h"
namespace concert_msgs
{
static const char ALLOCATESOFTWARE[] = "concert_msgs/AllocateSoftware";
class AllocateSoftwareRequest : public ros::Msg
{
public:
typedef const char* _user_type;
_user_type user;
typedef const char* _software_type;
_software_type software;
typedef bool _allocate_type;
_allocate_type allocate;
uint32_t parameters_length;
typedef rocon_std_msgs::KeyValue _parameters_type;
_parameters_type st_parameters;
_parameters_type * parameters;
AllocateSoftwareRequest():
user(""),
software(""),
allocate(0),
parameters_length(0), parameters(NULL)
{
}
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
uint32_t length_user = strlen(this->user);
varToArr(outbuffer + offset, length_user);
offset += 4;
memcpy(outbuffer + offset, this->user, length_user);
offset += length_user;
uint32_t length_software = strlen(this->software);
varToArr(outbuffer + offset, length_software);
offset += 4;
memcpy(outbuffer + offset, this->software, length_software);
offset += length_software;
union {
bool real;
uint8_t base;
} u_allocate;
u_allocate.real = this->allocate;
*(outbuffer + offset + 0) = (u_allocate.base >> (8 * 0)) & 0xFF;
offset += sizeof(this->allocate);
*(outbuffer + offset + 0) = (this->parameters_length >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (this->parameters_length >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (this->parameters_length >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (this->parameters_length >> (8 * 3)) & 0xFF;
offset += sizeof(this->parameters_length);
for( uint32_t i = 0; i < parameters_length; i++){
offset += this->parameters[i].serialize(outbuffer + offset);
}
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
uint32_t length_user;
arrToVar(length_user, (inbuffer + offset));
offset += 4;
for(unsigned int k= offset; k< offset+length_user; ++k){
inbuffer[k-1]=inbuffer[k];
}
inbuffer[offset+length_user-1]=0;
this->user = (char *)(inbuffer + offset-1);
offset += length_user;
uint32_t length_software;
arrToVar(length_software, (inbuffer + offset));
offset += 4;
for(unsigned int k= offset; k< offset+length_software; ++k){
inbuffer[k-1]=inbuffer[k];
}
inbuffer[offset+length_software-1]=0;
this->software = (char *)(inbuffer + offset-1);
offset += length_software;
union {
bool real;
uint8_t base;
} u_allocate;
u_allocate.base = 0;
u_allocate.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
this->allocate = u_allocate.real;
offset += sizeof(this->allocate);
uint32_t parameters_lengthT = ((uint32_t) (*(inbuffer + offset)));
parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
offset += sizeof(this->parameters_length);
if(parameters_lengthT > parameters_length)
this->parameters = (rocon_std_msgs::KeyValue*)realloc(this->parameters, parameters_lengthT * sizeof(rocon_std_msgs::KeyValue));
parameters_length = parameters_lengthT;
for( uint32_t i = 0; i < parameters_length; i++){
offset += this->st_parameters.deserialize(inbuffer + offset);
memcpy( &(this->parameters[i]), &(this->st_parameters), sizeof(rocon_std_msgs::KeyValue));
}
return offset;
}
const char * getType(){ return ALLOCATESOFTWARE; };
const char * getMD5(){ return "0f1b14f8151c193001d66c288668a7a4"; };
};
class AllocateSoftwareResponse : public ros::Msg
{
public:
typedef bool _success_type;
_success_type success;
uint32_t parameters_length;
typedef rocon_std_msgs::KeyValue _parameters_type;
_parameters_type st_parameters;
_parameters_type * parameters;
typedef const char* _namespace_type;
_namespace_type namespace;
typedef const char* _error_message_type;
_error_message_type error_message;
AllocateSoftwareResponse():
success(0),
parameters_length(0), parameters(NULL),
namespace(""),
error_message("")
{
}
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
union {
bool real;
uint8_t base;
} u_success;
u_success.real = this->success;
*(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF;
offset += sizeof(this->success);
*(outbuffer + offset + 0) = (this->parameters_length >> (8 * 0)) & 0xFF;
*(outbuffer + offset + 1) = (this->parameters_length >> (8 * 1)) & 0xFF;
*(outbuffer + offset + 2) = (this->parameters_length >> (8 * 2)) & 0xFF;
*(outbuffer + offset + 3) = (this->parameters_length >> (8 * 3)) & 0xFF;
offset += sizeof(this->parameters_length);
for( uint32_t i = 0; i < parameters_length; i++){
offset += this->parameters[i].serialize(outbuffer + offset);
}
uint32_t length_namespace = strlen(this->namespace);
varToArr(outbuffer + offset, length_namespace);
offset += 4;
memcpy(outbuffer + offset, this->namespace, length_namespace);
offset += length_namespace;
uint32_t length_error_message = strlen(this->error_message);
varToArr(outbuffer + offset, length_error_message);
offset += 4;
memcpy(outbuffer + offset, this->error_message, length_error_message);
offset += length_error_message;
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
union {
bool real;
uint8_t base;
} u_success;
u_success.base = 0;
u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
this->success = u_success.real;
offset += sizeof(this->success);
uint32_t parameters_lengthT = ((uint32_t) (*(inbuffer + offset)));
parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
parameters_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
offset += sizeof(this->parameters_length);
if(parameters_lengthT > parameters_length)
this->parameters = (rocon_std_msgs::KeyValue*)realloc(this->parameters, parameters_lengthT * sizeof(rocon_std_msgs::KeyValue));
parameters_length = parameters_lengthT;
for( uint32_t i = 0; i < parameters_length; i++){
offset += this->st_parameters.deserialize(inbuffer + offset);
memcpy( &(this->parameters[i]), &(this->st_parameters), sizeof(rocon_std_msgs::KeyValue));
}
uint32_t length_namespace;
arrToVar(length_namespace, (inbuffer + offset));
offset += 4;
for(unsigned int k= offset; k< offset+length_namespace; ++k){
inbuffer[k-1]=inbuffer[k];
}
inbuffer[offset+length_namespace-1]=0;
this->namespace = (char *)(inbuffer + offset-1);
offset += length_namespace;
uint32_t length_error_message;
arrToVar(length_error_message, (inbuffer + offset));
offset += 4;
for(unsigned int k= offset; k< offset+length_error_message; ++k){
inbuffer[k-1]=inbuffer[k];
}
inbuffer[offset+length_error_message-1]=0;
this->error_message = (char *)(inbuffer + offset-1);
offset += length_error_message;
return offset;
}
const char * getType(){ return ALLOCATESOFTWARE; };
const char * getMD5(){ return "67cae1e35a4f8ba23ce1548c86cbaed7"; };
};
class AllocateSoftware {
public:
typedef AllocateSoftwareRequest Request;
typedef AllocateSoftwareResponse Response;
};
}
#endif
| [
"davihenriqueds@gmail.com"
] | davihenriqueds@gmail.com |
880dce88993ab90f9a4fc16941b7bcbb438edefb | a3d6556180e74af7b555f8d47d3fea55b94bcbda | /ash/metrics/stylus_metrics_recorder.cc | a648c04e4970cb8cb0fcf9265947dd2b7db18f41 | [
"BSD-3-Clause"
] | permissive | chromium/chromium | aaa9eda10115b50b0616d2f1aed5ef35d1d779d6 | a401d6cf4f7bf0e2d2e964c512ebb923c3d8832c | refs/heads/main | 2023-08-24T00:35:12.585945 | 2023-08-23T22:01:11 | 2023-08-23T22:01:11 | 120,360,765 | 17,408 | 7,102 | BSD-3-Clause | 2023-09-10T23:44:27 | 2018-02-05T20:55:32 | null | UTF-8 | C++ | false | false | 5,160 | cc | // Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/metrics/stylus_metrics_recorder.h"
#include "ash/shell.h"
#include "base/logging.h"
/* Emit metrics related to stylus utilization:
* StylusDetachedFromGarageSession
* StylusDetachedFromDockSession
* StylusDetachedFromGarageOrDockSession
* TODO(kenalba):
* + Usage of stylus (interacting with screen) while stylus is docked (only
* once a day).
* + Usage of stylus (interacting with screen) while stylus is attached (only
* once a day).
* + Usage of stylus (interacting with screen) while stylus is undocked (only
* once a day).
* + Usage of stylus (interacting with screen) while stylus is unattached
* (only once a day).
* + Usage of stylus (interacting with screen) while stylus is
* undocked/unattached (only once a day).
*
* Not currently possible with SFUL:
* Length of 'failed' vs. 'successful', aka a session
* where the pen was used vs. one where it was not.
* This is not possible as failed sessions don't have
* usetime, and the failure/success of a session
* needs to be known at the beginning of the session.
*
* Math between different metrics, hence several combinations
* need to be emitted in multiple metrics.
*/
namespace ash {
namespace {
bool IsStylusOnCharge(const PeripheralBatteryListener::BatteryInfo& battery) {
return (
battery.charge_status !=
PeripheralBatteryListener::BatteryInfo::ChargeStatus::kUnknown &&
battery.charge_status !=
PeripheralBatteryListener::BatteryInfo::ChargeStatus::kDischarging);
}
} // namespace
StylusSessionMetricsDelegate::StylusSessionMetricsDelegate(
const std::string& feature_name)
: metrics_(feature_name, this) {}
StylusSessionMetricsDelegate::~StylusSessionMetricsDelegate() = default;
bool StylusSessionMetricsDelegate::IsEligible() const {
return capable_;
}
bool StylusSessionMetricsDelegate::IsEnabled() const {
return capable_;
}
void StylusSessionMetricsDelegate::SetState(bool now_capable, bool in_session) {
if (active_ && (!in_session || !now_capable)) {
metrics_.StopSuccessfulUsage();
active_ = false;
}
capable_ = now_capable;
if (!active_ && in_session && now_capable) {
metrics_.RecordUsage(true);
metrics_.StartSuccessfulUsage();
active_ = true;
}
}
StylusMetricsRecorder::StylusMetricsRecorder() {
UpdateStylusState();
DCHECK(Shell::HasInstance());
DCHECK(Shell::Get()->peripheral_battery_listener());
Shell::Get()->peripheral_battery_listener()->AddObserver(this);
}
StylusMetricsRecorder::~StylusMetricsRecorder() {
Shell::Get()->peripheral_battery_listener()->RemoveObserver(this);
}
void StylusMetricsRecorder::OnAddingBattery(
const PeripheralBatteryListener::BatteryInfo& battery) {
if (battery.type == PeripheralBatteryListener::BatteryInfo::PeripheralType::
kStylusViaCharger) {
// Record the presence of the specific charger type; the API does
// not imply they are exclusive.
// TODO(kenalba): Avoid hard-coding this key
if (battery.key == "garaged-stylus-charger")
stylus_garage_present_ = true;
else
stylus_dock_present_ = true;
UpdateStylusState();
}
}
void StylusMetricsRecorder::OnRemovingBattery(
const PeripheralBatteryListener::BatteryInfo& battery) {
if (battery.type == PeripheralBatteryListener::BatteryInfo::PeripheralType::
kStylusViaCharger) {
// TODO(kenalba): Avoid hard-coding this key
if (battery.key == "garaged-stylus-charger")
stylus_garage_present_ = false;
else
stylus_dock_present_ = false;
stylus_on_charge_.reset();
UpdateStylusState();
}
}
void StylusMetricsRecorder::OnUpdatedBatteryLevel(
const PeripheralBatteryListener::BatteryInfo& battery) {
if (battery.type == PeripheralBatteryListener::BatteryInfo::PeripheralType::
kStylusViaCharger) {
stylus_on_charge_ = IsStylusOnCharge(battery);
UpdateStylusState();
}
}
void StylusMetricsRecorder::UpdateStylusState() {
/* Sessions are recorded when we know the device is capable of
* having a stylus garaged or docked, and the stylus is not on charge,
* and therefore not currently garaged or docked.
*/
const bool stylus_off_charge =
stylus_on_charge_.has_value() && *stylus_on_charge_ == false;
const bool stylus_detached_from_garage =
stylus_garage_present_ && stylus_off_charge;
const bool stylus_detached_from_dock =
stylus_dock_present_ && stylus_off_charge;
stylus_detached_from_garage_session_metrics_delegate_.SetState(
stylus_garage_present_, stylus_detached_from_garage);
stylus_detached_from_dock_session_metrics_delegate_.SetState(
stylus_dock_present_, stylus_detached_from_dock);
stylus_detached_from_garage_or_dock_session_metrics_delegate_.SetState(
stylus_garage_present_ || stylus_dock_present_,
stylus_detached_from_garage || stylus_detached_from_dock);
}
} // namespace ash
| [
"chromium-scoped@luci-project-accounts.iam.gserviceaccount.com"
] | chromium-scoped@luci-project-accounts.iam.gserviceaccount.com |
2c1ab0b2735c6cd01e5355cf84637875b6c324aa | 091afb7001e86146209397ea362da70ffd63a916 | /inst/include/boost/simd/ieee/include/functions/ulpdist.hpp | 194c4ceef498f7c957eb09738669bec0ec70f9ce | [] | no_license | RcppCore/RcppNT2 | f156b58c08863243f259d1e609c9a7a8cf669990 | cd7e548daa2d679b6ccebe19744b9a36f1e9139c | refs/heads/master | 2021-01-10T16:15:16.861239 | 2016-02-02T22:18:25 | 2016-02-02T22:18:25 | 50,460,545 | 15 | 1 | null | 2019-11-15T22:08:50 | 2016-01-26T21:29:34 | C++ | UTF-8 | C++ | false | false | 301 | hpp | #ifndef BOOST_SIMD_IEEE_INCLUDE_FUNCTIONS_ULPDIST_HPP_INCLUDED
#define BOOST_SIMD_IEEE_INCLUDE_FUNCTIONS_ULPDIST_HPP_INCLUDED
#include <boost/simd/ieee/functions/ulpdist.hpp>
#include <boost/simd/ieee/functions/scalar/ulpdist.hpp>
#include <boost/simd/ieee/functions/simd/common/ulpdist.hpp>
#endif
| [
"kevinushey@gmail.com"
] | kevinushey@gmail.com |
efe40142c86f47c86d84d4b073bc106e67473147 | b8623613a8b1af55c60aed34d5bb6133e7ff5753 | /College/TicTacToeConFunciones.cpp | b3367cb6b55d2ae1f6838a081351509547f0398e | [] | no_license | alexjr2001/Free | ace5e75b1043de5c951d82a0f5f6ded58bcf5fea | db1f2bc23347b381d89f8f03b3e70be8be9a0fda | refs/heads/master | 2023-04-13T12:39:59.922478 | 2023-04-11T21:40:55 | 2023-04-11T21:40:55 | 298,112,913 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 9,144 | cpp | #include <iostream>
//TicTacToe con funciones y play again
int jugadores = 0;
std::string player1 = "X";
std::string player2 = "O";
int a; //Random quien va a comenzar
char lugar[100] = "\nLugares: \n 1) __| 2) |__| 3) |__ \n 4) __| 5) |__| 6) |__ \n 7) | 8) | | 9) |\n\n"; //Leyenda del tablero
std::string v1 = " ", v2 = " ", v3 = " ", v4 = " ", v5 = " ", v6 = " ", v7 = " ", v8 = " ", v9 = " ";
bool cas1 = false, cas2 = false, cas3 = false, cas4 = false, cas5 = false, cas6 = false, cas7 = false, cas8 = false, cas9 = false;
bool find = false; //Si la PC encontro el valor
bool win = false;
int comienza = 1;
void tabla() {
char tabla1[50] = "\t\t\t\t|\t|\t\n\t\t\t "; //Partes de la tabla
char tabla2[50] = " | ";
char tabla3[50] = "\t\t\t________|_______|________\n\t\t\t\t|\t|\t\n\t\t\t ";
char tabla4[50] = "\t\t\t\t|\t|\t\n\t\t\t";
std::cout << lugar;
std::cout << "\t\t\t\tTRES EN RAYA\n\n";
std::cout << tabla1 << v1 << tabla2 << v2 << tabla2 << v3 << "\n" << tabla3 << v4 << tabla2 << v5 << tabla2 << v6 << "\n" << tabla3 << v7 << tabla2 << v8 << tabla2 << v9 << "\n" << tabla4;
return;
}
void bienvenida() {
std::cout << "BIENVENIDO A TRES EN RAYA\n\n"; //Menú
std::cout << "¿Cuantos jugadores (1 o 2)?: ";
std::cin >> jugadores;
std::cout << "Ingrese su signo jugador 1\n";
std::cin >> player1;
if (jugadores == 1) {
if (a == 1) {
std::cout << "\nUsted comienza\n";
tabla();
}
comienza = a;
}
else if (jugadores == 2) { //Multijugador
std::cout << "Ingrese su signo jugador 2\n";
std::cin >> player2;
std::cout << "\nComienza el jugador " << a << "\n";
tabla();
}
return;
}
void signosDiferentes() {
if (player1 == player2) { //Para que signos no sean iguales
player2 = "X";
if (player2 == player1) {
player2 = "O";
}
}
return;
}
void dosJugadores(int &numcasilla) {
std::cout << "\nJugador 1: " << player1 << "\nJugador 2: " << player2 << "\n";
std::cout << "\nLe toca a jugador " << 2 - (a % 2);
std::cout << "\nIngrese la casilla (numero): ";
std::cin >> numcasilla;
system("cls");
return;
}
void juegaUsuario(int& numcasilla) {
std::cout << "\nEs su turno (" << player1 << ")\n";
std::cout << "\nIngrese la casilla (numero): ";
std::cin >> numcasilla;
return;
}
void juegaPC(int& numcasilla, int &i) {
if (cas5) {
numcasilla = 1;
}
else {
numcasilla = 5;
}
i += 1;
return;
}
int ia2(bool cas, int numero, std::string v1, std::string v2, std::string v3, std::string v4, int& numcasilla) {
if (cas == false && (v1 == player2 && v1 == v2 || v3 == player2 && v3 == v4)) {
numcasilla = numero;
find = true;
win = true;
}
else if (cas == false) {
numcasilla = numero;
find = true;
}
return numcasilla;
}
int ia3(bool cas, int numero, std::string v1, std::string v2, std::string v3, std::string v4, std::string v5, std::string v6, int& numcasilla) {
if (cas == false && (v1 == v2 && v2 == player2 || v3 == v4 && v3 == player2 || v5 == v6 && v5 == player2)) {
numcasilla = numero;
find = true;
win = true;
}
else if (cas == false) {
numcasilla = numero;
find = true;
}
return numcasilla;
}
void dibujarSigno(int &numcasilla) {
switch (numcasilla) { //Coloca el signo correspondiente en el lugar indicado "casilla"
case 1:
if (cas1 == false) {
if (a % 2 == 1) {
v1 = player1;
}
else {
v1 = player2;
}
cas1 = true;
}
else {
std::cout << "Ya está ese valor, intentelo de nuevo";
a -= 1;
}
break;
case 2:
if (cas2 == false) {
if (a % 2 == 1) {
v2 = player1;
}
else {
v2 = player2;
}
cas2 = true;
}
else {
std::cout << "Ya está ese valor, intentelo de nuevo";
a -= 1;
}
break;
case 3:
if (cas3 == false) {
if (a % 2 == 1) {
v3 = player1;
}
else {
v3 = player2;
}
cas3 = true;
}
else {
std::cout << "Ya está ese valor, intentelo de nuevo";
a -= 1;
}
break;
case 4:
if (cas4 == false) {
if (a % 2 == 1) {
v4 = player1;
}
else {
v4 = player2;
}
cas4 = true;
}
else {
std::cout << "Ya está ese valor, intentelo de nuevo";
a -= 1;
}
break;
case 5:
if (cas5 == false) {
if (a % 2 == 1) {
v5 = player1;
}
else {
v5 = player2;
}
cas5 = true;
}
else {
std::cout << "Ya está ese valor, intentelo de nuevo";
a -= 1;
}
break;
case 6:
if (cas6 == false) {
if (a % 2 == 1) {
v6 = player1;
}
else {
v6 = player2;
}
cas6 = true;
}
else {
std::cout << "Ya está ese valor, intentelo de nuevo";
a -= 1;
}
break;
case 7:
if (cas7 == false) {
if (a % 2 == 1) {
v7 = player1;
}
else {
v7 = player2;
}
cas7 = true;
}
else {
std::cout << "Ya está ese valor, intentelo de nuevo";
a -= 1;
}
break;
case 8:
if (cas8 == false) {
if (a % 2 == 1) {
v8 = player1;
}
else {
v8 = player2;
}
cas8 = true;
}
else {
std::cout << "Ya está ese valor, intentelo de nuevo";
a -= 1;
}
break;
case 9:
if (cas9 == false) {
if (a % 2 == 1) {
v9 = player1;
}
else {
v9 = player2;
}
cas9 = true;
}
else {
std::cout << "Ya está ese valor, intentelo de nuevo";
a -= 1;
}
break;
default:
std::cout << "Ingresaste dato incorrecto, intenta otra vez";
a -= 1;
break;
}
return;
}
int main() {
playAgain:
system("CLS");
bool play = true;
int casilla = 0; //Lugar ingresado
int i = 1; //N° TURNO DE LA PC
int jj = 0;
int list[] = { 1,3,5,7,2,6,8 };
int list2[] = { 4,6,8,3,7,9,1,2 };
a = rand() % 2;
bienvenida();
signosDiferentes();
while (play) {
if (jugadores == 2) {
dosJugadores(casilla);
}
//CONTRA LA PC
//Imposible ganar
else if (jugadores == 1) { //PC nunca perderá
if (a % 2 == 1) {
juegaUsuario(casilla);
}
else if (i == 1) { //Primer turno de la pc
juegaPC(casilla,i);
}
else if (i > 1) { //Los demás turnos de la PC para que no pierda
if ((v7 == v9 && cas7 || v2 == v5 && cas2) && win == false) {
ia2(cas8, 8, v2, v5, v7, v9, casilla);
}
if ((v1 == v3 && cas1 || v5 == v8 && cas5) && win == false) {
ia2(cas2, 2, v1, v3, v5, v8, casilla);
}
if ((v3 == v9 && cas3 || v4 == v5 && cas4) && win == false) {
ia2(cas6, 6, v3, v9, v4, v5, casilla);
}
if ((v1 == v7 && cas1 || v6 == v5 && cas5) && win == false) {
ia2(cas4, 4, v1, v7, v5, v6, casilla);
}
if ((v3 == v2 && cas3 || v7 == v4 && cas4 || v5 == v9 && cas5) && win == false) {
ia3(cas1, 1, v2, v3, v4, v7, v5, v9, casilla);
}
if ((v3 == v6 && cas3 || v7 == v8 && cas8 || v1 == v5 && cas1) && win == false) {
ia3(cas9, 9, v3, v6, v7, v8, v1, v5, casilla);
}
if ((v8 == v9 && cas8 || v1 == v4 && cas1 || v3 == v5 && cas3) && win == false) {
ia3(cas7, 7, v8, v9, v1, v4, v3, v5, casilla);
}
if ((v1 == v2 && cas1 || v9 == v6 && cas6 || v5 == v7 && cas5) && win == false) {
ia3(cas3, 3, v1, v2, v5, v7, v6, v9, casilla);
}
if (v5 == v9 && cas1 && cas5 && i == 2 && find == false) {
if (cas3 == false) {
casilla = 3;
find = true;
}
}
if (find == false) {
if (comienza == 1) {
casilla = list2[jj];
jj++;
if (jj > 7) {
jj = 0;
}
}
else {
casilla = list[jj];
jj++;
if (jj > 7) {
jj = 0;
}
}
}
i += 1;
}
system("CLS");
}
dibujarSigno(casilla);
find = false; //Prepara el siguiente turno de la PC
win = false;
tabla();
//Verificar si alguien ganó
if (cas1 == true && v1 == v2 && v2 == v3 || cas1 == true && v1 == v5 && v5 == v9 || cas1 == true && v1 == v4 && v1 == v7 || cas2 == true && v2 == v5 && v5 == v8 || cas6 == true && v3 == v6 && v6 == v9 || cas3 == true && v3 == v5 && v5 == v7 || cas7 == true && v7 == v8 && v8 == v9 || cas5 == true && v4 == v5 && v5 == v6) {
if (jugadores == 1) {
if (a % 2 == 1) {
std::cout << "Ganó jugador 1";
}
else {
std::cout << "Ganó PC";
}
}
else {
if (a % 2 == 1) {
std::cout << "Ganó jugador 1";
}
else {
std::cout << "Ganó jugador 2";
}
}
play = false;
std::cout << "\nPlay Again? Si(1) No(0): "; //Para jugar de nuevo
std::cin >> play;
if (play) {
v1 = " ", v2 = " ", v3 = " ", v4 = " ", v5 = " ", v6 = " ", v7 = " ", v8 = " ", v9 = " ";
cas1 = false, cas2 = false, cas3 = false, cas4 = false, cas5 = false, cas6 = false, cas7 = false, cas8 = false, cas9 = false;
goto playAgain;
}
}
else if (cas1 == true && cas2 == true && cas3 == true && cas4 == true && cas5 == true && cas6 == true && cas7 == true && cas8 == true && cas9 == true) {
std::cout << "Empate";
play = false;
std::cout << "\nPlay Again? Si(1) No(0): "; //Para jugar de nuevo
std::cin >> play;
if (play) {
v1 = " ", v2 = " ", v3 = " ", v4 = " ", v5 = " ", v6 = " ", v7 = " ", v8 = " ", v9 = " ";
cas1 = false, cas2 = false, cas3 = false, cas4 = false, cas5 = false, cas6 = false, cas7 = false, cas8 = false, cas9 = false;
goto playAgain;
}
}
a += 1;
}
return 0;
} | [
"alexander.gomez@ucsp.edu.pe"
] | alexander.gomez@ucsp.edu.pe |
73a5fde4381fbee18dddeb7cbe6ab35d2a1a0c4e | 1702be86fb699140f05db0dc153368c19e59e1cc | /vtkm/BinaryOperators.h | 99303c966e294425df65e2e492cc6eaf5e6b5f67 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | yisyuanliou/vtk-m-v1.5.0 | 7377e5ef962032aec0977a7248605958a562caf0 | 66e5fb7aa78ac327c2154b1a2ace7f88566358f2 | refs/heads/main | 2023-03-28T09:44:08.181818 | 2021-04-02T11:34:55 | 2021-04-02T11:34:55 | 329,729,614 | 0 | 0 | NOASSERTION | 2021-04-02T11:34:55 | 2021-01-14T20:42:29 | C++ | UTF-8 | C++ | false | false | 4,643 | h | //============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt 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 vtk_m_BinaryOperators_h
#define vtk_m_BinaryOperators_h
#include <vtkm/Math.h>
#include <vtkm/internal/ExportMacros.h>
namespace vtkm
{
// Disable conversion warnings for Sum and Product on GCC only.
// GCC creates false positive warnings for signed/unsigned char* operations.
// This occurs because the values are implicitly casted up to int's for the
// operation, and than casted back down to char's when return.
// This causes a false positive warning, even when the values is within
// the value types range
#if (defined(VTKM_GCC) || defined(VTKM_CLANG))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif // gcc || clang
/// Binary Predicate that takes two arguments argument \c x, and \c y and
/// returns sum (addition) of the two values.
/// Note: Requires Type \p T implement the + operator.
struct Sum
{
template <typename T>
VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{
return x + y;
}
};
/// Binary Predicate that takes two arguments argument \c x, and \c y and
/// returns product (multiplication) of the two values.
/// Note: Requires Type \p T implement the * operator.
struct Product
{
template <typename T>
VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{
return x * y;
}
};
#if (defined(VTKM_GCC) || defined(VTKM_CLANG))
#pragma GCC diagnostic pop
#endif // gcc || clang
/// Binary Predicate that takes two arguments argument \c x, and \c y and
/// returns the \c x if x > y otherwise returns \c y.
/// Note: Requires Type \p T implement the < operator.
//needs to be full length to not clash with vtkm::math function Max.
struct Maximum
{
template <typename T>
VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{
return x < y ? y : x;
}
};
/// Binary Predicate that takes two arguments argument \c x, and \c y and
/// returns the \c x if x < y otherwise returns \c y.
/// Note: Requires Type \p T implement the < operator.
//needs to be full length to not clash with vtkm::math function Min.
struct Minimum
{
template <typename T>
VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{
return x < y ? x : y;
}
};
/// Binary Predicate that takes two arguments argument \c x, and \c y and
/// returns a vtkm::Vec<T,2> that represents the minimum and maximum values
/// Note: Requires Type \p T implement the vtkm::Min and vtkm::Max functions.
template <typename T>
struct MinAndMax
{
VTKM_EXEC_CONT
vtkm::Vec<T, 2> operator()(const T& a) const { return vtkm::make_Vec(a, a); }
VTKM_EXEC_CONT
vtkm::Vec<T, 2> operator()(const T& a, const T& b) const
{
return vtkm::make_Vec(vtkm::Min(a, b), vtkm::Max(a, b));
}
VTKM_EXEC_CONT
vtkm::Vec<T, 2> operator()(const vtkm::Vec<T, 2>& a, const vtkm::Vec<T, 2>& b) const
{
return vtkm::make_Vec(vtkm::Min(a[0], b[0]), vtkm::Max(a[1], b[1]));
}
VTKM_EXEC_CONT
vtkm::Vec<T, 2> operator()(const T& a, const vtkm::Vec<T, 2>& b) const
{
return vtkm::make_Vec(vtkm::Min(a, b[0]), vtkm::Max(a, b[1]));
}
VTKM_EXEC_CONT
vtkm::Vec<T, 2> operator()(const vtkm::Vec<T, 2>& a, const T& b) const
{
return vtkm::make_Vec(vtkm::Min(a[0], b), vtkm::Max(a[1], b));
}
};
/// Binary Predicate that takes two arguments argument \c x, and \c y and
/// returns the bitwise operation <tt>x&y</tt>
/// Note: Requires Type \p T implement the & operator.
struct BitwiseAnd
{
template <typename T>
VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{
return x & y;
}
};
/// Binary Predicate that takes two arguments argument \c x, and \c y and
/// returns the bitwise operation <tt>x|y</tt>
/// Note: Requires Type \p T implement the | operator.
struct BitwiseOr
{
template <typename T>
VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{
return x | y;
}
};
/// Binary Predicate that takes two arguments argument \c x, and \c y and
/// returns the bitwise operation <tt>x^y</tt>
/// Note: Requires Type \p T implement the ^ operator.
struct BitwiseXor
{
template <typename T>
VTKM_EXEC_CONT T operator()(const T& x, const T& y) const
{
return x ^ y;
}
};
} // namespace vtkm
#endif //vtk_m_BinaryOperators_h
| [
"yisyuan@liuyixuandeMacBook-Pro.local"
] | yisyuan@liuyixuandeMacBook-Pro.local |
e76d6bdcf43f4aac2f0158c158dc0ed8be16c0a1 | 4e643c06d258850b9392dac96b63fa92acacca5e | /160.相交链表.cpp | 7351720d7b1ab1978b85d8d9508ce44d27708150 | [] | no_license | Mrxiangquan/Leetcode | edeec19ad6b6754ffc97489d909f63dab227723f | f08e1e8421ee1487a0f2b9ed4c36cf16310211c0 | refs/heads/main | 2023-06-24T19:54:55.521184 | 2021-07-28T13:16:38 | 2021-07-28T13:16:38 | 306,583,042 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,238 | cpp | /*
* @lc app=leetcode.cn id=160 lang=cpp
*
* [160] 相交链表
*/
// @lc code=start
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
/*
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
if(!headA||!headB) return nullptr;
unordered_map<ListNode*,bool> hashtable;
ListNode *A=headA,*B=headB;
while(A!=nullptr||B!=nullptr){
if(A!=nullptr){
if(hashtable[A]) return A;
hashtable[A]=true;
A=A->next;
}
if(B!=nullptr){
if(hashtable[B]) return B;
hashtable[B]=true;
B=B->next;
}
}
return nullptr;
}
};*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
if(!headA||!headB) return nullptr;
ListNode *A=headA,*B=headB;
while(A!=B){
if(A!=nullptr) A=A->next;
else A=headB;
if(B!=nullptr) B=B->next;
else B=headA;
}
return A;
}
}
// @lc code=end
| [
"13297949626@163.com"
] | 13297949626@163.com |
f2831cc96cd72a534d68bd6345837413b4b5347e | 670af94f93e7c7ef680dcc63b770a9bb7bf5071b | /libs/guicore/pre/grid/grid2d.h | 2542bcee8276818bf3f62995f15a0b49efea92a6 | [] | no_license | Leon-Zhang/prepost-gui | ef2e570bed88bd3232253cfd99e89b3eadfc661f | bff4db57df6a282f6e76e3942dbb02d66fbb5d9e | refs/heads/master | 2021-01-01T19:05:10.124321 | 2017-07-27T04:36:47 | 2017-07-27T04:36:47 | 98,504,251 | 0 | 0 | null | 2017-07-27T07:00:00 | 2017-07-27T07:00:00 | null | UTF-8 | C++ | false | false | 665 | h | #ifndef GRID2D_H
#define GRID2D_H
#include "../../guicore_global.h"
#include "grid.h"
class QVector2D;
/// Absract class to store two-dimensional grids.
class GUICOREDLL_EXPORT Grid2D : public Grid
{
public:
Grid2D(vtkPointSet* ps, SolverDefinitionGridType::GridType type, ProjectDataItem* parent);
Grid2D(vtkPointSet* ps, const std::string& zonename, SolverDefinitionGridType::GridType type, ProjectDataItem* parent);
virtual ~Grid2D();
virtual unsigned int vertexCount() const = 0;
virtual QVector2D vertex(unsigned int index) const = 0;
virtual void setVertex(unsigned int index, const QVector2D& v) = 0;
};
#endif // GRID2D_H
| [
"kinoue@2cc7cdd0-1db9-4218-aa4a-1d8dad43e0f0"
] | kinoue@2cc7cdd0-1db9-4218-aa4a-1d8dad43e0f0 |
fa421b183f5bdceaa77cb229f94080af30d9f4ed | 96730d79a4f1e874944869458cf76c38d5926bbf | /src/rpcdump.cpp | 94567f9b42b7617313316932fa47c33f650403e3 | [
"MIT"
] | permissive | HorseCoinProject/Horsecoin | ae40225796570af2211da20d4af07adab101f46f | 057bdf236c1d71d5986be469e1f197f345d3bc0c | refs/heads/master | 2016-08-06T16:58:33.284292 | 2014-03-08T14:57:55 | 2014-03-08T14:57:55 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,757 | cpp | // Copyright (c) 2009-2012 Bitcoin Developers
// Copyright (c) 2011-2012 Litecoin Developers
// Copyright (c) 2013 HorseCoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "init.h" // for pwalletMain
#include "bitcoinrpc.h"
#include "ui_interface.h"
#include "base58.h"
#include <boost/lexical_cast.hpp>
#define printf OutputDebugStringF
using namespace json_spirit;
using namespace std;
class CTxDump
{
public:
CBlockIndex *pindex;
int64 nValue;
bool fSpent;
CWalletTx* ptx;
int nOut;
CTxDump(CWalletTx* ptx = NULL, int nOut = -1)
{
pindex = NULL;
nValue = 0;
fSpent = false;
this->ptx = ptx;
this->nOut = nOut;
}
};
Value importprivkey(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"importprivkey <HorseCoinprivkey> [label]\n"
"Adds a private key (as returned by dumpprivkey) to your wallet.");
string strSecret = params[0].get_str();
string strLabel = "";
if (params.size() > 1)
strLabel = params[1].get_str();
CBitcoinSecret vchSecret;
bool fGood = vchSecret.SetString(strSecret);
if (!fGood) throw JSONRPCError(-5,"Invalid private key");
CKey key;
bool fCompressed;
CSecret secret = vchSecret.GetSecret(fCompressed);
key.SetSecret(secret, fCompressed);
CKeyID vchAddress = key.GetPubKey().GetID();
{
LOCK2(cs_main, pwalletMain->cs_wallet);
pwalletMain->MarkDirty();
pwalletMain->SetAddressBookName(vchAddress, strLabel);
if (!pwalletMain->AddKey(key))
throw JSONRPCError(-4,"Error adding key to wallet");
pwalletMain->ScanForWalletTransactions(pindexGenesisBlock, true);
pwalletMain->ReacceptWalletTransactions();
}
return Value::null;
}
Value dumpprivkey(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"dumpprivkey <HorseCoinaddress>\n"
"Reveals the private key corresponding to <HorseCoinaddress>.");
string strAddress = params[0].get_str();
CBitcoinAddress address;
if (!address.SetString(strAddress))
throw JSONRPCError(-5, "Invalid HorseCoin address");
CKeyID keyID;
if (!address.GetKeyID(keyID))
throw JSONRPCError(-3, "Address does not refer to a key");
CSecret vchSecret;
bool fCompressed;
if (!pwalletMain->GetSecret(keyID, vchSecret, fCompressed))
throw JSONRPCError(-4,"Private key for address " + strAddress + " is not known");
return CBitcoinSecret(vchSecret, fCompressed).ToString();
}
| [
"jack@jack-desktop.(none)"
] | jack@jack-desktop.(none) |
a6a04f496ab69fd9b1fedb6bb9bcdfc82fe43338 | e9ebdfd1bbe907ac20dc93bb447648e7db3fd793 | /System/Library/PrivateFrameworks/AXMediaUtilities.framework/AXMediaUtilities-Structs.h | 89e2bdbe88a156fefe7ef627c05ed9fec6724535 | [
"MIT"
] | permissive | lechium/tvOS144Headers | ebf9c2b63dc0f497a2173ad7536c46b60170e3cc | e22dcf52662ae03002e3a6d57273f54e74013cb0 | refs/heads/master | 2023-04-11T05:40:03.461549 | 2021-04-14T23:52:15 | 2021-04-14T23:52:15 | 358,069,450 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,317 | h | /*
* This header is generated by classdump-dyld 1.5
* on Wednesday, April 14, 2021 at 2:25:53 PM Mountain Standard Time
* Operating System: Version 14.4 (Build 18K802)
* Image Source: /System/Library/PrivateFrameworks/AXMediaUtilities.framework/AXMediaUtilities
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley.
*/
typedef struct __IOSurface* IOSurfaceRef;
typedef struct CGPoint {
double x;
double y;
} CGPoint;
typedef struct CGSize {
double width;
double height;
} CGSize;
typedef struct CGRect {
CGPoint origin;
CGSize size;
} CGRect;
typedef struct _NSZone* NSZoneRef;
typedef struct __CVBuffer* CVBufferRef;
typedef struct {
long long field1;
int field2;
unsigned field3;
long long field4;
} SCD_Struct_AX6;
typedef struct os_unfair_lock_s {
unsigned _os_unfair_lock_opaque;
} os_unfair_lock_s;
typedef struct {
[4 columns];
} SCD_Struct_AX8;
typedef struct CGColorSpace* CGColorSpaceRef;
typedef struct CGImage* CGImageRef;
typedef struct _LXLexicon* LXLexiconRef;
typedef struct CGAffineTransform {
double a;
double b;
double c;
double d;
double tx;
double ty;
} CGAffineTransform;
typedef struct CVNLPCaptionHandler* CVNLPCaptionHandlerRef;
typedef struct {
void plan;
int network_index;
} SCD_Struct_AX14;
typedef struct _compressed_pair<std::__1::shared_ptr<espresso_buffer_t> *, std::__1::allocator<std::__1::shared_ptr<espresso_buffer_t> > > {
shared_ptr<espresso_buffer_t> __value_;
} compressed_pair<std::__1::shared_ptr<espresso_buffer_t> *, std::__1::allocator<std::__1::shared_ptr<espresso_buffer_t> > >;
typedef struct vector<std::__1::shared_ptr<espresso_buffer_t>, std::__1::allocator<std::__1::shared_ptr<espresso_buffer_t> > > {
shared_ptr<espresso_buffer_t> __begin_;
shared_ptr<espresso_buffer_t> __end_;
compressed_pair<std::__1::shared_ptr<espresso_buffer_t> *, std::__1::allocator<std::__1::shared_ptr<espresso_buffer_t> > > __end_cap_;
} vector<std::__1::shared_ptr<espresso_buffer_t>, std::__1::allocator<std::__1::shared_ptr<espresso_buffer_t> > >;
typedef struct _compressed_pair<int *, std::__1::allocator<int> > {
int __value_;
} compressed_pair<int *, std::__1::allocator<int> >;
typedef struct vector<int, std::__1::allocator<int> > {
int __begin_;
int __end_;
compressed_pair<int *, std::__1::allocator<int> > __end_cap_;
} vector<int, std::__1::allocator<int> >;
typedef struct _compressed_pair<NSString *__strong *, std::__1::allocator<NSString *> > {
id __value_;
} compressed_pair<NSString *__strong *, std::__1::allocator<NSString *> >;
typedef struct vector<NSString *, std::__1::allocator<NSString *> > {
id __begin_;
id __end_;
compressed_pair<NSString *__strong *, std::__1::allocator<NSString *> > __end_cap_;
} vector<NSString *, std::__1::allocator<NSString *> >;
typedef struct _compressed_pair<float *, std::__1::allocator<float> > {
float __value_;
} compressed_pair<float *, std::__1::allocator<float> >;
typedef struct vector<float, std::__1::allocator<float> > {
float __begin_;
float __end_;
compressed_pair<float *, std::__1::allocator<float> > __end_cap_;
} vector<float, std::__1::allocator<float> >;
| [
"kevin.w.bradley@me.com"
] | kevin.w.bradley@me.com |
7a48ea1d54191b1c896a4ee958a4b01ac88e7186 | 937e5fa6f458c070273d5ca6e86929f0130ed538 | /src/screens/setup.cpp | b6e9a3b6daeaa17225006dc623359874073315a3 | [] | no_license | ivgiuliani/inkframe | 80758ee7fe0181c1998d0fee2caf059a22688b14 | 03dc9ca8914c062819dbbdb55130d2f1a6db3020 | refs/heads/master | 2023-05-29T18:48:56.793308 | 2021-06-08T19:49:23 | 2021-06-08T19:49:23 | 367,615,931 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 319 | cpp | #include <Arduino.h>
#include "screens/setup.h"
#include "fonts/UbuntuMonoBold20pt8b.h"
#include "ui.h"
void Screen::Setup::setup(Display *display) {
UIRoot root(display);
auto setup_header = root.insert_relative<UITextBox>(300, 220);
setup_header->set("Welcome", &UbuntuMonoBold20pt8b);
root.render();
}
| [
"giuliani.v@gmail.com"
] | giuliani.v@gmail.com |
6b6c622365c5cd57087fcbe9e239aee0a4029d83 | 855446a66887b383017b8c34aa5305c0e0ee3f2c | /vahan/circle/circleMain.cpp | b5818574ceb617921bf6c573383aac0308e81cbc | [] | no_license | hamletgrigoryan/training | 448c7923e03e9662c209398a1b67d1ccd261146f | 7893425c09a42c9d46bd2bb49221e413fe1b7c0e | refs/heads/master | 2021-01-01T20:35:04.366547 | 2015-06-04T19:47:17 | 2015-06-04T19:47:17 | 34,216,981 | 0 | 0 | null | 2019-04-30T11:31:50 | 2015-04-19T17:43:22 | C++ | UTF-8 | C++ | false | false | 727 | cpp | #include <iostream>
#include "circle.h"
/*
int main()
{
double x, y, radius;
std::cout << "Input coordinates of circle's center" << "\nx = ";
std::cin >> x;
std::cout <<"\ny = ";
std::cin >> y;
Point center(x, y);
std::cout << "\nInput the radius" << "\nradius = ";
std::cin >> radius;
Circle circle(center, radius);
std::cout << "Input a point to check if it is in the circle " << "\nx =";
std::cin >> x;
std::cout <<"\ny = ";
std::cin >> y;
std::cout << "point = " << "(" << x << "," << y << ")" << std::endl;
Point p1(x,y);
if (isInnerPoint(circle, p1))
{
std::cout << "the point is in the circle...";
}
else {
std::cout << "The point is out of circle!";
}
double a;std::cin >> a;
return 0;
}
*/ | [
"vahan@example.com"
] | vahan@example.com |
8477dffd0d9c41ccd90d4d69673cca0d3e6d134e | 536e32946c26427a24dda02bec4f33639fbdad91 | /robot_sem.h | 7153b2ec1117d192868180a60910cf7ed70b6246 | [] | no_license | iksanov/concurrent-computing | c8ff8c50f39f78a45ad50c7a1c3e46740129874b | 7d834148330e25296252dff67476136690159e7b | refs/heads/master | 2021-09-12T22:10:08.601259 | 2018-04-21T14:57:32 | 2018-04-21T14:57:32 | 111,940,152 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,202 | h | #pragma once
#include <iostream>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <vector>
#include <memory>
class Semaphore {
public:
Semaphore(unsigned long long _cnt = 0): cnt_(_cnt) {};
void signal() {
std::unique_lock<std::mutex> lock(mutex_);
if (cnt_.fetch_add(1) == 0) {
not_empty_cv_.notify_all();
}
}
void wait() {
std::unique_lock<std::mutex> lock(mutex_);
while (cnt_.load() <= 0) {
not_empty_cv_.wait(lock);
}
cnt_.fetch_sub(1);
}
private:
std::atomic<unsigned long long> cnt_;
std::mutex mutex_;
std::condition_variable not_empty_cv_;
};
class Robot {
public:
Robot() {
left_sem_ = std::make_unique<Semaphore>(1);
right_sem_ = std::make_unique<Semaphore>(0);
}
void StepLeft() {
left_sem_->wait();
std::cout << "left" << std::endl;
right_sem_->signal();
}
void StepRight() {
right_sem_->wait();
std::cout << "right" << std::endl;
left_sem_->signal();
}
private:
std::unique_ptr<Semaphore> left_sem_;
std::unique_ptr<Semaphore> right_sem_;
};
| [
"iksanov@yahoo.com"
] | iksanov@yahoo.com |
93b05bbebb471379586c92729f4ab9a182d3d6ae | ef94bb6da6f93eadca46b30ff78dcd7d2e4beee3 | /Juki_PCB/Software/pc/NSL_Picky/Pickobear/videoInput0.1995/videoInputSrcAndDemos/VC2005-videoInputDemoWithLib/src/simpleApp.h | dfd389d227d73c1266b1292040266288bbadd36e | [] | no_license | glocklueng/032 | 10cf69ef5604f993d42f787011642f62261c4473 | 69bb94e002867f14048c0c9907ce5731bfab5f15 | refs/heads/master | 2021-01-13T09:47:20.395124 | 2017-01-27T07:00:07 | 2017-01-27T07:00:07 | 80,231,375 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 574 | h | #ifndef _SIMPLE_APP
#define _SIMPLE_APP
#include <stdio.h>
#include "glfw.h"
#define PI 3.141592654
#include <math.h>
class simpleApp{
public:
simpleApp();
void printYo();
virtual void idle();
virtual void init();
virtual void draw();
virtual void keyDown (char c);
virtual void mouseMove( float x, float y );
virtual void mouseDrag( float x, float y );
virtual void mouseDown( float x, float y, int button );
virtual void mouseUp ( float x, float y, int button );
void setupScreen();
};
#endif // _SIMPLE_APP | [
"charliex@47c6005b-331e-4be2-8628-a174f3e7207f"
] | charliex@47c6005b-331e-4be2-8628-a174f3e7207f |
58e35eec7334111eb1b9f1eb46699f4acc9008ab | 3d86cbbe918712d461025018e130f779dfab3f2b | /cpp/test/transfer_returned_uptr_to_sptr.cpp | 8e8491026f03f5e300d1e209443b9631a320fc89 | [] | no_license | xiaotdl/Sandbox | 89a9632b01f92bb7e2b0acf2dbe2988af6c4a57d | 653d33345d8493264b4d5bba4361274ff86cc961 | refs/heads/master | 2022-12-21T06:56:51.771378 | 2019-04-23T01:43:35 | 2019-04-23T01:43:35 | 48,220,817 | 0 | 0 | null | 2022-12-08T02:18:51 | 2015-12-18T07:26:08 | HTML | UTF-8 | C++ | false | false | 755 | cpp | #include <iostream>
using namespace std;
class Klass {
public:
Klass() {
cout << "constructed" << endl;
cout << this << endl;
}
Klass(const Klass& kls) {
cout << "copy constructed" << endl;
}
};
std::unique_ptr<Klass> makeKlass() {
return make_unique<Klass>();
// return nullptr;
}
// To Run: !g++ -std=c++14 -Wall % && ./a.out
int main() {
// std::unique_ptr<Klass> up = makeKlass(); // can't pass into shared_ptr if explicitly constructed unique_ptr
std::shared_ptr<Klass> sp(makeKlass());
cout << sp.get() << endl;
if (sp) {
// if makeKlass() return make_unique<Klass>();
cout << "sp!!" << endl;;
} else {
// if makeKlass() return nullptr
cout << "NA!!" << endl;;
}
cout << "EOP" << endl;
}
| [
"xiaotdl@gmail.com"
] | xiaotdl@gmail.com |
98bdd0eda968f4c4804b2484677c4537d252d02a | 1384ca8daf96ab8a0c2ee55887a0a76024dcc6cf | /Advection/Advection/Source.cpp | adcf49b7e322c9a7fd69c1aa3538fe07d9a8cb8c | [] | no_license | AwakeHateYou/Advection | f336011bb9bd7bfee09609f7f7b193ac81c523d6 | 3084ff15507e095d471b40d21e14c5c2970c986a | refs/heads/master | 2016-09-01T09:41:08.324710 | 2016-04-11T08:15:53 | 2016-04-11T08:15:53 | 55,619,939 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,377 | cpp | #include <fstream>
#include <iostream>
#include <complex>
#include <math.h>
#include <omp.h>
#define M_PI 3.14159265358979323846
#define N 20
#define D 1.0
#define D1 1.0
#define D2 -3.0
#define W 1.0
#define C 1.0
#define M 1.0
#define P 1.0
using namespace std;
complex<double> matrixInitialization(double x, double y) {
return cos(P * M_PI * x) + cos(M * M_PI * y);
}
complex<double> GinzburgLandauFunction(
complex<double> cur,
complex<double> east,
complex<double> south,
complex<double> west,
complex<double> north,
double DX, double DY, double DT) {
return cur + DT * (-D * complex<double>(1, W) * (((north - 2.0 * cur + south) / (DX * DX) + (east - 2.0 * cur + west) / (DY * DY))) +
(D1 * ((west - cur) / DX)) + (D2 * ((north - cur) / DY))
+ cur + complex<double>(-1, C) * abs(pow(cur, 2.0))* cur);
}
complex<double> funcWithoutY(
complex<double> cur,
complex<double> east,
complex<double> south,
complex<double> west,
complex<double> north,
double DX, double DY, double DT) {
return cur + DT * (-D * complex<double>(1, W) * ((north - 2.0 * cur + south) / (DX * DX)) +
(D1 * ((west - cur) / DX)) + D2
+ cur + complex<double>(-1, C) * abs(pow(cur, 2.0))* cur);
}
void printMatrix(complex<double> *mass) {
ofstream fout;
fout.open("output.txt");
//fout.precision(3);
for (int i = 0; i < N*N; i++) {
if ((i % N == 0) && (i != 0))
fout << std::endl;
fout << '{' << real(mass[i]) << ',' << imag(mass[i]) << "} ";
}
fout.close();
}
void printGNU(complex<double> *mass, double dx, double dy, char* filename) {
ofstream fout;
fout.open(filename);
//fout.precision(3);
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
fout << dx*i << ' ' << dy*j << ' ' << real(mass[i*N + j]) << endl;
//fout << dx*i << ' ' << dy*j << " {" << real(mass[i*N + j]) << ',' << imag(mass[i*N + j]) << '}' << endl;
}
fout << endl;
}
fout.close();
}
int main(int argc, char** argv) {
int i, j, K;
complex<double> *currentMatrix, *nextMatrix, *swap;
double t1, t2, DT, DX, DY;
currentMatrix = new complex<double>[N*N];
nextMatrix = new complex<double>[N*N];
DX = 1.0 / N;
DT = 0.025 * DX * DX;
DY = DX;
K = 1 / DT;
cout << "K = " << K << endl;
cout << "DT = " << DT << endl;
cout << "DX = " << DX << endl;
cout << "DY = " << DY << endl;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++) {
currentMatrix[i*N + j] = complex< double >(0.0, 0);
nextMatrix[i*N + j] = complex< double >(0.0, 0);
}
for (i = 1; i < N-1; i++)
for (j = 1; j < N-1; j++) {
currentMatrix[i*N + j] = matrixInitialization(i*DX, j*DY);
nextMatrix[i*N + j] = matrixInitialization(i*DX, j*DY);
}
t1 = omp_get_wtime();
for (int k = 0; k < K; k++) {
for (i = 1; i < N - 1; i++)
#pragma omp parallel for
for (j = 1; j < N - 1; j++) {
nextMatrix[i*N + j] = GinzburgLandauFunction(
currentMatrix[i*N + j],
currentMatrix[i*N + j - 1],
currentMatrix[i*N + N],
currentMatrix[i*N + j + 1],
currentMatrix[i*N + j - N],
DX, DY, DT);
}
swap = currentMatrix;
currentMatrix = nextMatrix;
nextMatrix = swap;
}
t2 = omp_get_wtime();
cout << "Time: " << t2 - t1 << endl;
printMatrix(currentMatrix);
printGNU(currentMatrix, DX, DY, "outputGNU.txt");
return 0;
}
| [
"eterente94@gmail.com"
] | eterente94@gmail.com |
629d9571d22b5fe33dd3b199f145262104f348de | 3ea34c23f90326359c3c64281680a7ee237ff0f2 | /Data/3649/E | 74144421c29f483766fad88151d54aa05b5fea0e | [] | no_license | lcnbr/EM | c6b90c02ba08422809e94882917c87ae81b501a2 | aec19cb6e07e6659786e92db0ccbe4f3d0b6c317 | refs/heads/master | 2023-04-28T20:25:40.955518 | 2020-02-16T23:14:07 | 2020-02-16T23:14:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 80,837 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "Data/3649";
object E;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField nonuniform List<vector>
4096
(
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-220003.356748406,116922.385050745,103080.971697661)
(-232733.8148992,112135.177695283,223679.608901576)
(-262188.434669475,102133.764983393,383734.278587653)
(-317804.778084542,86349.207052308,615189.8496199)
(-418019.74258739,65023.7417446072,968185.85046268)
(-597839.495883169,40487.953016097,1525537.39332976)
(-923334.132225957,18186.171820842,2430685.3537349)
(-1511531.73726093,4480.13765353686,3937736.9533423)
(-2493055.94874148,-50.3191294969412,6430843.22121324)
(-3473630.70719395,-394.539898139808,9904868.4683054)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-232757.608096037,251418.100129261,98261.8930175203)
(-245617.374531886,242376.208067317,213638.237177372)
(-275540.031842089,223337.943509593,367974.09049326)
(-332439.275766763,192878.751212536,593883.822099794)
(-435416.470676714,150681.059665344,943642.97485577)
(-619543.732172787,100475.335198971,1503199.32484567)
(-948636.840161726,52998.4088495906,2417023.92797864)
(-1534616.06323004,22906.3393843471,3933213.78947781)
(-2508452.29266503,11141.2219535302,6430474.54105989)
(-3480813.5636604,5686.77836430231,9905206.78645774)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-261919.666422217,424171.133602555,89166.6329489225)
(-274972.130720043,412007.524126973,194507.447609313)
(-305813.527772397,386185.105920529,337473.81297078)
(-365548.987506083,344139.520907097,551762.030782302)
(-475112.596845753,284052.791786771,893502.895506614)
(-670649.306930432,208898.262076347,1455729.27555968)
(-1011070.5872902,132810.154272967,2386988.11742652)
(-1592114.27521202,80580.9298482694,3921427.80217456)
(-2545492.91671732,53106.0743655698,6424955.86647988)
(-3497597.73367167,28800.7726433329,9899439.60587258)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-316140.738919777,663360.49242752,76951.3800948116)
(-329413.052773645,649816.469736804,168555.487258627)
(-361441.166579015,620858.191742633,295323.56801553)
(-425294.266298284,573089.525396679,491667.82982422)
(-545718.736921733,503009.071795857,818430.286736884)
(-763167.748783733,410783.977487696,1379712.32010926)
(-1130599.88720232,308358.515433427,2334763.8461511)
(-1703268.68406857,224785.450488254,3893828.00957967)
(-2613299.03944955,159754.572070243,6400478.55132448)
(-3527173.14997413,85974.057415578,9870478.4165266)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-413327.105742099,1013370.80333628,63316.7948333309)
(-426524.481920391,1000194.47024279,139463.27624774)
(-459170.105487591,972022.738831865,247468.834646101)
(-526479.29832728,925474.828825958,421562.829544104)
(-658113.404431177,856401.388651,726283.917120132)
(-902705.083021958,762408.394120086,1277364.58350969)
(-1312615.0557774,647187.984858769,2251150.16986175)
(-1872461.05515489,519797.039850693,3828599.63565422)
(-2711780.4002238,373659.749791518,6326474.85815685)
(-3569894.16727235,198063.176659834,9784279.90618495)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-588699.992838283,1552035.6133169,50035.1828576679)
(-601237.793521165,1540279.08118168,111188.365439934)
(-632802.355451736,1515154.20002396,200859.259699572)
(-699421.677431952,1473253.65700955,352502.108947923)
(-832430.798508658,1408991.09310676,632343.203000838)
(-1081670.64675258,1314231.86900863,1162190.37486488)
(-1492829.86670287,1178436.5771558,2123771.64927072)
(-2027279.60726126,988478.30915684,3682369.98722585)
(-2818487.30099708,723793.13612954,6150723.90188493)
(-3623656.17191029,386397.773820301,9586045.47663471)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-910528.057894296,2424385.20493184,38178.4662793602)
(-921648.684527214,2414169.40435688,85936.8276313895)
(-949998.62658765,2392257.92469406,158831.729548941)
(-1010838.00539313,2354835.08207668,288088.309874939)
(-1134348.48534975,2293977.47417888,537450.414152564)
(-1368524.85154206,2193863.99590089,1026343.13880238)
(-1754396.4022029,2025389.46044662,1933786.65771446)
(-2240396.19806777,1745045.11522669,3417616.04971237)
(-2977539.60152194,1305691.5014686,5813257.28589524)
(-3711388.92932474,711433.498981543,9199610.49005881)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1499085.64969823,3895505.08995069,27965.7646793626)
(-1507992.79064925,3886165.25296135,63962.706724134)
(-1530843.27942582,3865769.56377594,121294.347068086)
(-1580320.91877921,3829363.87824271,227086.469681253)
(-1681820.05079367,3765631.49746807,437252.49718573)
(-1876469.62396778,3649709.89599094,857876.221063436)
(-2199604.33545926,3429400.39499495,1653469.62197432)
(-2593062.90821979,3013223.62781223,2978354.01760861)
(-3266269.53079022,2331168.58498723,5219146.46488019)
(-3879147.67289637,1321359.88389625,8488367.75286181)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2484600.80985575,6361366.63101301,18739.2687934276)
(-2490682.41885426,6351990.75737216,43596.1832368698)
(-2506208.34721168,6330723.86052994,84850.2336945095)
(-2539478.49592671,6290352.29813351,163340.309730402)
(-2606538.19522474,6214137.94691422,321372.055509015)
(-2732496.3573871,6065965.46818127,637612.840705807)
(-2944001.18737601,5773626.19320893,1237388.22986784)
(-3258283.11799101,5212432.3825417,2296462.59312942)
(-3798790.60916602,4216896.50834453,4209525.27893801)
(-4171741.0895192,2535446.35104434,7167179.90130912)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-3469709.40717535,9821536.57880852,9539.45937982763)
(-3472761.95283556,9811830.18328915,22461.9862983498)
(-3480483.82400121,9789166.51457115,44503.1562583469)
(-3496826.31587872,9744554.01185667,87127.7584139573)
(-3529298.78205194,9657314.56347235,173249.923907789)
(-3589969.23358263,9483878.75422995,345305.871441679)
(-3695815.32493015,9138412.93665132,676334.452929437)
(-3874192.45210375,8461876.29395984,1301082.99361499)
(-4170785.60366637,7160543.33218422,2528221.77344159)
(-4200365.6078115,4632118.32590443,4631915.40639307)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(32576755.9291419,104230.125847666,90422.64712809)
(32555453.0993373,99324.2355615939,194323.556196189)
(32506489.7969721,88857.3856929866,328199.997727622)
(32415020.4777651,71759.9838898646,515026.816854096)
(32252368.9610891,47638.4819784961,788411.690065173)
(31963218.6816405,18757.53928456,1200008.03212291)
(31432815.1000618,-7136.19354053364,1842407.0522416)
(30384728.4056687,-18550.2421269705,2956109.21030498)
(28019802.058865,-15389.2234844621,5450052.48504909)
(21597337.0962569,-7543.49543853596,13378040.235903)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(32555032.7793429,222389.080347329,85462.7169275114)
(32533679.7171998,213103.275243,183798.644380549)
(32484275.0120977,193108.458415893,311144.586583905)
(32391110.4362119,159802.323788095,490964.593573148)
(32224013.217746,111024.009852543,759561.436142484)
(31926734.617846,49374.7094716854,1174077.97480268)
(31388189.8169296,-9439.28423862412,1830966.46727564)
(30344460.5803651,-34523.7175278311,2959275.35794742)
(27994789.0651282,-25833.0866993923,5457889.92223495)
(21586414.6069921,-11050.9302486058,13385581.2452584)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(32505755.8375559,369991.166114291,76134.4691208569)
(32484364.1203252,357596.096697262,163717.455487394)
(32434035.2111761,330583.757291788,277805.47652919)
(32336823.9297187,284399.471861443,442247.470097288)
(32158127.2964626,213457.281181728,697986.364325835)
(31836471.0259883,116368.774317003,1115284.02542799)
(31267078.314011,13245.6139644554,1805862.28478979)
(30233287.2504373,-30578.0857046301,2967927.1861834)
(27930126.1466721,-14703.4501888648,5472590.54514934)
(21559585.4296192,-776.197480735035,13396544.7079566)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(32415312.6052113,566263.143986899,63686.7368623928)
(32393936.5635363,552762.777168274,136582.498947549)
(32342409.3553549,523168.868487642,231558.924683826)
(32238870.8987328,471910.352213695,371294.938166623)
(32038860.401514,390614.077221338,600971.062557381)
(31662109.1889696,271250.233777399,1012224.72420976)
(30998006.1774283,126308.86820884,1761967.46420085)
(29980371.8056191,55529.5551147338,2983631.39255993)
(27799554.0281511,61201.9271007119,5486285.00653563)
(21509443.416195,43211.4135669731,13397092.888185)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(32256133.1924055,838115.789329201,50099.1153761738)
(32235290.9060025,825590.145936421,106868.417551096)
(32183535.1258341,798463.284858406,180280.828724857)
(32074587.5524258,752529.673572282,290006.715479171)
(31850187.5715355,682061.745594675,481670.130005329)
(31390830.3304596,583433.70441241,867363.304754962)
(30514358.1720942,466944.047386298,1691166.95657196)
(29511561.1330492,364938.170875025,2989148.21147378)
(27594982.3784692,266896.84725201,5468102.57149541)
(21434898.9410712,144261.959129757,13353670.9764551)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(31973068.4296427,1230271.22425397,37488.2014601857)
(31953652.2612043,1219948.25879611,79652.0927410588)
(31904370.0350424,1198042.75030648,134312.295665)
(31797434.0049993,1161857.57423037,219540.771441921)
(31570479.973423,1107032.49434173,383071.309629178)
(31098002.4268909,1027307.28438368,750936.714880433)
(30210482.42539,916789.38573223,1589191.14330788)
(29251974.2122613,775299.7396256,2890987.81390085)
(27420832.0799209,564704.575903062,5345272.76319794)
(21349468.8872292,298642.469366283,13209179.2526879)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(31448179.6963975,1835888.20884767,27087.3199805666)
(31431252.400011,1827898.682701,57647.8704035912)
(31387579.1145653,1811470.76096659,98054.1774567319)
(31290538.161879,1785345.7574687,164601.885812275)
(31078983.7230793,1746459.0399584,303255.190632667)
(30627221.3840323,1685817.48413569,640410.814172386)
(29766486.0612917,1580042.01660568,1447687.77867025)
(28901487.4333895,1392227.03890216,2680288.90680256)
(27162908.9880227,1016850.25330796,5079106.69871891)
(21203674.6120105,543617.536616272,12910480.1489998)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(30399114.2018112,2909983.13598141,19117.280222902)
(30385754.3545683,2903487.12977819,41193.7467941517)
(30350975.7835996,2890379.77795856,71877.7256428554)
(30272593.3253795,2870100.31186332,125620.98595551)
(30098304.9130174,2840784.31344386,242582.807525032)
(29715135.8184377,2793525.98504447,534680.923077)
(28961823.1162855,2684788.28205617,1259919.26474783)
(28397756.1703999,2347780.91203994,2304958.3718563)
(26642549.3732093,1798445.93110848,4605955.84892236)
(20866172.6459429,1028650.97869518,12367014.1468703)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(28028087.7956546,5376004.19518321,12702.394154008)
(28019084.5439931,5369700.60804938,28134.0119015181)
(27995855.2669655,5356236.66066476,51625.5738841282)
(27944591.6342973,5332736.41865904,96331.3957303656)
(27835509.7443173,5291070.89685167,195408.931646484)
(27613652.3551777,5208162.56516765,426035.697824734)
(27213779.1984223,5021434.99656047,923020.656388271)
(26652005.691506,4596161.4117768,1755763.4060206)
(25065960.1005863,3844594.64111339,3836276.04512948)
(19839496.9622394,2506631.07197436,11338469.9589577)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(21600401.2862636,13290800.4651277,6505.09548253104)
(21595923.961716,13284160.9923139,14770.8555323375)
(21584516.9311307,13269227.9745674,28190.8453639046)
(21559890.4976342,13240922.6101658,54699.8992104717)
(21509186.5290646,13186107.1214671,112590.422344634)
(21409492.0654036,13073284.1249129,239419.622479285)
(21224932.8623725,12833612.3956583,497906.094944921)
(20871415.7366202,12335488.5514692,1004382.82539478)
(19840277.6499935,11330859.8884403,2498466.38327408)
(16131929.0680126,8832201.17315429,8832013.66513611)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-566440.215521826,82606.9119556915,69177.1738419716)
(-589943.992691707,77642.7461385725,145519.460866213)
(-643102.713531679,66735.5293812876,236964.383122712)
(-739832.479255371,47907.0813051509,352498.199972044)
(-905147.982030337,19317.7572749807,499285.326950448)
(-1180777.75058425,-17696.6749841562,669566.375293377)
(-1631465.85974739,-51731.7568096599,794167.033046268)
(-2344731.51906226,-58780.7726057051,590995.671516911)
(-3367437.74229614,-40384.5060890963,-972792.080098971)
(-4127989.78702218,-18468.5801708864,-8220408.67551503)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-591301.481993004,173357.636512546,64171.4779129351)
(-614414.746079083,163962.286371737,134534.342092522)
(-667028.880336187,142984.876174383,218176.828867264)
(-763810.517121439,105598.755209426,323994.049430194)
(-931636.559460365,45237.273798666,462312.251246795)
(-1214767.66580572,-40796.1273004925,635501.928348733)
(-1676044.55504246,-130479.835418561,787072.320063519)
(-2382397.84404577,-145608.247871546,609346.160874158)
(-3386294.36053803,-90426.0660931411,-950940.912321377)
(-4134621.22852928,-37830.2466822577,-8201955.46915458)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-646838.989775931,279756.973921669,54783.4310567754)
(-669151.847831095,267363.435816326,113486.190902438)
(-720773.125451568,239110.660263544,180756.684574753)
(-818449.072846459,186546.082532675,263670.300950444)
(-994972.595708171,94260.9134978428,376334.494555943)
(-1307306.42717104,-57937.0696279706,545840.831176546)
(-1825070.49080599,-255796.261341394,771894.003050288)
(-2512823.5171711,-283461.753439092,664446.217360114)
(-3443525.36864933,-145255.132688884,-898485.259588602)
(-4152981.01976019,-50904.8115246686,-8164256.30423288)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-746001.267277361,407293.680903052,42365.1066411938)
(-767148.484953096,394264.145914764,85137.3861660375)
(-817288.945372898,364393.511578042,128140.776713286)
(-916923.026571656,307694.872712235,171373.85297205)
(-1113082.03838245,201974.605367618,224190.542132638)
(-1511073.67540759,-1.45571837229822,348025.733734148)
(-2287955.33371194,-357334.167750704,744113.092417579)
(-2939532.995907,-413308.901784663,802452.983423144)
(-3586833.71365338,-143405.231973564,-804421.234353607)
(-4192319.82530985,-31343.0253238786,-8113631.83791576)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-912436.245116807,555197.441175322,29253.6183839612)
(-931824.445625908,544070.612246703,55150.444814467)
(-979153.056864425,519380.013795966,71440.0664288442)
(-1078789.44405919,475411.035827691,65688.8409323956)
(-1298174.68469415,402343.804986717,22269.8386767842)
(-1859647.81347625,290576.877692489,-9242.40966441631)
(-3694772.52775171,163029.850524175,688112.213040516)
(-4382553.7835342,105307.611129048,1072198.55784406)
(-3867758.59215247,92705.3107004936,-692583.073074294)
(-4256743.3377567,58818.3785738925,-8082514.25701016)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1186642.1168027,705442.30290879,18053.6258460006)
(-1203617.29134496,697604.467425553,30377.2643503797)
(-1246026.88370398,681293.942371369,27448.1956552045)
(-1338691.15639035,654956.788640483,-7384.45463419533)
(-1551969.29335515,615471.366058481,-89474.8077937736)
(-2112024.65339905,556434.944786156,-136717.853463499)
(-3857750.3254751,472704.361929201,630428.32713031)
(-4487892.01665181,424741.230784789,1059448.87752151)
(-3998421.56110026,306721.468569762,-726725.698192756)
(-4321057.08635807,152810.810897185,-8141604.21579476)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1634791.26249353,786824.435762561,10176.7671711844)
(-1648787.81860796,782395.835138468,14013.5592111041)
(-1684460.42122727,774845.672937229,1089.30557158792)
(-1765219.76728195,767327.067809252,-46935.1033022321)
(-1961008.43798195,765648.957556378,-148532.592604985)
(-2509438.51794987,773543.529712681,-220393.334415422)
(-4330232.29721931,775161.883428982,582455.443729902)
(-4912311.92205443,888278.508445464,941305.462647084)
(-4195997.77817509,496308.774698417,-880787.136149652)
(-4427222.23206907,206006.377213151,-8294497.91725216)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2350077.37845196,538819.686323729,5784.27083591811)
(-2360619.31562026,536695.61821869,6446.09907826237)
(-2387837.6366729,535128.995451035,-6435.86202913661)
(-2451196.03364119,541897.3624227,-48628.8564878944)
(-2613226.34955678,577717.490450346,-140578.18567371)
(-3116340.05059209,691698.688545389,-218669.53434283)
(-5105077.27118223,936323.963675563,695656.714012254)
(-4160731.00691317,601641.439363028,549368.901541723)
(-4353651.72147813,221535.116988163,-1171068.40492659)
(-4591660.5290961,1781.0825197163,-8500421.99406021)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-3376057.88016488,-1052167.84013508,3721.14341214569)
(-3382915.28637404,-1053913.23527325,4917.76840521036)
(-3400357.38035196,-1055556.45735196,403.809659673654)
(-3439333.48101364,-1052484.87873629,-12700.8927363623)
(-3528597.51074911,-1035863.54800835,-26424.6580772429)
(-3741910.15776837,-996690.67538799,26115.1599359691)
(-4208145.14261291,-968145.406284719,361096.812065375)
(-4360945.46932926,-1185109.65145989,169387.004857333)
(-4762146.34797478,-1381636.27192545,-1390747.21653403)
(-4837441.92028532,-1201276.48462579,-8502162.82572986)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4134557.40905711,-8310667.78938795,2046.585707569)
(-4137904.32519527,-8312832.47999647,3382.0584759888)
(-4146266.63535464,-8316398.86097324,3595.96971656518)
(-4164286.25345044,-8320158.91285189,4034.69605056739)
(-4202629.51577149,-8324348.25220214,12923.3862143373)
(-4282971.74246507,-8337556.43481158,54840.894640454)
(-4431399.62362321,-8392697.52275661,144313.438241997)
(-4596619.12393066,-8537258.35251249,-26915.0590207984)
(-4838913.20943047,-8510575.31712381,-1210197.21326457)
(-4669713.55526079,-7300537.79749611,-7300705.33598698)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-670017.860674281,57859.1955847637,45718.4495676919)
(-690011.216610407,53282.7512992209,92502.9221871724)
(-734003.687517963,42906.7296213678,140497.166552091)
(-810691.178788253,23980.4662985842,187375.39978639)
(-934305.085095632,-7129.50507135943,223662.007923047)
(-1124251.23516809,-51635.2464073293,218770.738914215)
(-1397210.51678928,-96248.6778513513,80764.0738074565)
(-1735653.24692435,-96418.92858978,-431895.269740674)
(-2006337.13719199,-59255.3407800088,-1733740.53406477)
(-1743473.98225956,-25136.1545849094,-4093120.18424245)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-692618.430475011,118044.888520438,41131.2555463288)
(-711479.70700807,109405.759348978,82073.2084255626)
(-753019.921815975,89363.3048686035,121607.674658118)
(-825614.343149772,51045.4383345792,156346.528650448)
(-943615.752625684,-18006.7523532835,179202.969097686)
(-1128111.54341975,-133228.944262217,174140.54456661)
(-1399327.03623969,-279389.514979466,80563.862891954)
(-1727491.03343439,-275954.585021788,-394807.291287425)
(-1993050.95827827,-147607.991508785,-1699698.04281839)
(-1735283.62013191,-56159.6982761254,-4068012.10752463)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-742155.132190975,180839.189918969,32521.841016516)
(-758814.578707634,169618.164686516,61972.1665555156)
(-795484.682543745,142804.061917606,83242.9665986869)
(-859705.135351858,88235.1447190063,87309.3227196566)
(-965953.582280917,-23731.8536979886,64015.4106371055)
(-1142947.50765983,-261569.80743143,27997.354295094)
(-1441889.85108722,-718529.574122736,83956.7737195952)
(-1728196.77404025,-710048.837618161,-266575.716814899)
(-1960824.83032037,-288484.103738889,-1608400.14291377)
(-1715347.46460978,-90205.3284552939,-4011988.06788504)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-827508.438973518,241067.112806494,21279.248808642)
(-841123.327818252,229775.843564982,35096.4127953393)
(-870682.86427102,202655.29211817,28639.101492901)
(-921326.416015989,145929.831625091,-24652.1959688487)
(-1004627.38618878,16955.3282832765,-173794.030143784)
(-1169009.44768359,-348483.699358577,-428944.365940643)
(-1763716.39918669,-1764030.71417703,92317.8395884069)
(-1855832.27291167,-1856228.51133439,154796.790309285)
(-1885847.51750755,-424271.980662677,-1410401.52891276)
(-1675103.92181506,-95753.8337642345,-3922068.9270987)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-962359.455795354,281097.107766119,9893.21571892192)
(-972419.913989223,272378.895544556,7885.63210266701)
(-993088.518018361,252579.773268486,-28103.3878937039)
(-1022943.80901891,215579.93517733,-153599.126486221)
(-1044186.20396399,148571.234636311,-539203.513569423)
(-941031.793699744,38177.0856905978,-1844480.3183951)
(6.7869133641638e-06,1.68969703209495e-06,-4.2788362146819e-06)
(719.001834501808,-46.8123847137566,1586557.00008923)
(-1585354.59075043,-37971.4275244727,-1082147.55445106)
(-1602532.32945045,-5516.93998168927,-3826595.45653986)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1163924.43374399,257302.468760931,1076.95594647511)
(-1170598.48989819,252440.849264813,-12003.7992205514)
(-1183133.39579296,242844.811581635,-65162.3254447122)
(-1196050.39608453,228397.059523515,-220620.210096717)
(-1180799.9847921,206327.405379658,-649545.689403133)
(-999711.253127016,158862.615813345,-1882544.61979791)
(6.31334281023962e-06,3.29496201599703e-06,-4.77277941238108e-06)
(770.824299271451,190.403238297349,1548439.66992681)
(-1547033.23858006,109055.920659186,-1049976.00077706)
(-1601741.17418278,46583.4933112861,-3821392.34624521)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1445164.70400313,71488.8867223382,-3812.97645179873)
(-1449016.16881947,70499.8474072858,-21643.6243827645)
(-1454985.46043781,71359.0663432028,-79632.8399337824)
(-1454986.31695331,81231.4580582184,-242700.688797126)
(-1413688.84073987,113253.203894771,-696946.084554322)
(-1172648.61749189,166368.716919089,-2041242.08611804)
(1.51644835243354e-05,-4.90785516573697e-06,-3.28041953693832e-06)
(748.545220904086,1639613.53676856,1657109.46576576)
(-1655674.41088731,338491.651506005,-1112649.63236883)
(-1666632.71009549,41473.0300246326,-3868128.69105579)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1786506.70288831,-487309.548635261,-4772.24020606347)
(-1788366.45645829,-485737.326714774,-20787.9252459693)
(-1789990.90669821,-477546.212876649,-69729.3760008081)
(-1782647.85309623,-446441.076546438,-210605.021941116)
(-1728975.86589625,-337920.913443077,-643681.388263806)
(-1451970.00277155,65790.2121820805,-2207472.93134733)
(776.5762036161,1832858.59435634,1639716.06851398)
(-1638547.17469359,401117.05780239,356028.715260556)
(-2062287.7393683,-187183.317501522,-1409660.29784175)
(-1806173.35958675,-244132.599410094,-3909541.83791642)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2049212.36031866,-1811018.59779369,-3136.4706877812)
(-2050026.34491494,-1809233.2626971,-12529.4761645339)
(-2050125.6795985,-1801805.3227336,-38502.0670610195)
(-2044537.4172314,-1777840.20049213,-101899.006897559)
(-2018299.23319787,-1710392.26634098,-239725.931550887)
(-1937354.16668453,-1538317.61677523,-440174.093677422)
(-1831605.26631602,-1191986.19640284,208130.820784849)
(-2098275.82690396,-1421310.77177122,-232110.992066831)
(-2256107.15662532,-1458829.83999627,-1466503.66092152)
(-1848925.2343518,-1033793.55704064,-3665359.38922455)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1767627.68159263,-4176666.93282307,-1281.39243507323)
(-1767955.07656897,-4175499.42801803,-4964.47574042889)
(-1767913.24063538,-4170745.52315747,-14377.670035816)
(-1765698.78965666,-4156538.63847891,-34266.6958427893)
(-1757440.45125453,-4122452.46553182,-67395.5611689207)
(-1739701.70054611,-4055392.75014306,-93590.469720071)
(-1733897.00454339,-3962112.50356902,-20966.7816336848)
(-1828161.08039024,-3941396.01763941,-269339.579305909)
(-1853574.48386733,-3672280.44627215,-1041227.69859315)
(-1482200.9259697,-2631182.19382148,-2631351.69110338)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-731163.806040317,35309.7146697122,25836.2306963262)
(-744707.350517734,31834.4437586052,48697.9208450524)
(-773222.417922673,23889.5065526787,64027.1446970776)
(-819587.844169371,9027.55654015469,63896.2535380399)
(-887688.565981026,-16444.530934509,33724.265357941)
(-980756.81504799,-55470.6884791743,-54299.4662829907)
(-1095349.83305555,-98330.9180359676,-257829.23198075)
(-1202440.2824978,-88244.2425105699,-702797.953896731)
(-1191935.11457032,-45980.1710682588,-1471219.80545016)
(-847663.476288617,-16957.094425107,-2350073.21699598)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-748320.891028334,68660.2962483343,22351.8789747015)
(-760150.287174094,62156.8956652255,40700.0072340971)
(-784571.606348816,46935.5186083635,49205.6797112511)
(-822839.191767459,16963.9402880349,38494.1445810644)
(-875973.343825965,-40327.4358945408,-5265.35925862586)
(-943698.635381095,-147998.639518974,-97150.3162574768)
(-1025229.35664213,-321839.132046376,-247739.78184462)
(-1126282.09022225,-276593.667643011,-660599.299924306)
(-1141989.77631561,-115367.02720393,-1442273.62575132)
(-825169.544841042,-36203.1084812851,-2333141.68698597)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-785074.213504869,95688.6753812661,15890.7021809622)
(-793662.359393228,87483.1885729628,25412.1899588246)
(-810072.73134094,67745.4965642443,19190.2608001422)
(-831513.959321943,26744.7039350439,-18781.6788767759)
(-849824.364926049,-62292.7835926667,-112945.548533517)
(-845422.246455892,-287474.076990138,-270995.37226628)
(-792056.838438794,-1040150.43919244,-202517.077768634)
(-870304.208385255,-837526.664784114,-499476.64628253)
(-998998.071051637,-213414.116157248,-1363256.31659796)
(-767841.180640611,-49905.2308222434,-2297060.47822618)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-845853.80595729,106353.985006582,7680.05735845604)
(-850176.775567635,98599.0643013076,5617.62937948714)
(-855769.747449282,80322.6391615527,-21872.6300395587)
(-853005.291558542,44385.5310328491,-107834.581594815)
(-814120.44826299,-22496.3626358296,-338137.940477454)
(-650632.688424704,-120324.468621061,-1023664.30810542)
(2.02278976072707e-06,6.15631250085986e-07,-6.46823086336057e-07)
(144.444672411746,528.164777343383,124457.935607295)
(-651151.414293948,-123645.49692317,-1200006.78684038)
(-654459.258095388,-23130.3790100378,-2247426.30237227)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-935422.015785091,79558.7508685541,-142.205872232854)
(-935448.467817838,74227.9581550239,-12742.5458973425)
(-930218.219916649,62589.1374623989,-57879.3422999055)
(-904232.531988959,42538.4142231811,-174743.502520192)
(-817463.762115514,12006.8398504276,-435969.146854918)
(-573536.796761382,-20453.4526160209,-903335.159798293)
(-5.831867881809e-07,-9.89215453115539e-08,8.37483110561521e-06)
(6.61554763000901e-06,2.44964574161336e-06,-1.26469629518674e-07)
(572.310083670751,411.819938104031,-1099805.01768585)
(-496149.632231012,-4684.75173781709,-2224633.3421775)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1054777.53503413,-24009.1328879515,-5579.01495335397)
(-1051408.32457943,-26039.9286471247,-24501.2934699635)
(-1037989.97892831,-29035.6251238026,-78019.9477484172)
(-995670.469732263,-30570.0816814005,-205291.3781961)
(-879072.589578404,-26639.0692077973,-468372.864351557)
(-591647.215770861,-14147.3836767555,-882742.970646968)
(-6.90823309436959e-08,1.79657227156338e-07,6.41240188988093e-06)
(5.15612532116648e-06,3.87574592610834e-06,-1.93862114730714e-07)
(257.796931802963,355.029125550133,-1105223.65334977)
(-473063.239363073,-18327.0737770449,-2220259.26613026)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1191505.03748271,-270003.438103203,-7665.36130516483)
(-1186157.38616572,-268989.999859418,-27574.0727466171)
(-1168229.70106359,-263794.643818104,-79570.8134265427)
(-1117269.3273466,-246542.457716983,-201315.426997662)
(-983706.417892754,-202168.121470507,-455768.797582069)
(-660956.732901604,-113222.813879028,-868385.251970102)
(6.95552596666108e-07,8.17549930862339e-06,6.82627505441303e-06)
(9.11078305722125e-06,5.24813086453826e-07,1.44620838256671e-06)
(223.296475044564,-68265.5563085805,-1124137.23049113)
(-508895.716195815,-98129.5001806001,-2202071.79798726)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1299622.05913118,-750248.618497287,-6639.46336305739)
(-1293995.06954546,-747599.998216534,-22400.8519187851)
(-1275981.16712705,-737897.606085934,-62307.6292221005)
(-1226115.05800171,-708550.059252229,-156832.822781369)
(-1093887.52427369,-627495.258078772,-366594.027795648)
(-757105.027692062,-419922.110657075,-754759.706097095)
(1.10371105099511e-05,-1.1477758450876e-06,-9.12088892214633e-07)
(273.259799747811,-58907.3672719442,-68135.6938958474)
(-663520.542763656,-381162.509299182,-1154005.93750988)
(-667474.808389373,-286960.497133478,-2103873.4917544)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1265816.17065494,-1529727.69834674,-3917.10981426921)
(-1261469.92933915,-1527455.95377407,-12617.5698325327)
(-1247880.55210293,-1519900.53920398,-32859.7642100625)
(-1211034.10114964,-1499339.75130061,-75573.3882434383)
(-1112693.01110315,-1449942.61650734,-158732.251909586)
(-840407.634597234,-1341118.95164246,-334481.943011492)
(334.467359406091,-1094756.14309368,-58723.6673645867)
(-674084.305240539,-1151615.92096103,-390206.635338928)
(-911164.337172617,-1056617.90361063,-1059694.06048018)
(-711458.175800221,-667253.362028859,-1816868.25413639)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-886365.972925998,-2409422.60085206,-1566.80616132894)
(-884112.493318627,-2407956.25107746,-4909.09210830325)
(-877306.583445725,-2403268.31563689,-12147.972865048)
(-859903.538941312,-2391303.60887938,-25979.3660016306)
(-818200.687182291,-2365526.76869068,-49634.9778905048)
(-726413.729747105,-2316231.59968586,-87810.3006461134)
(-572399.083095558,-2228752.04401257,-115312.321175067)
(-686484.623360745,-2113713.72078636,-294890.978379244)
(-715944.021853351,-1819063.87863274,-670075.465371121)
(-520937.490454314,-1149181.68645705,-1149410.57645832)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-761684.051172569,18140.3297852197,12379.9153470375)
(-768946.816889916,16347.693523077,20271.6881961424)
(-783137.726080357,12454.1142001325,17732.8821536923)
(-803362.110912843,5682.11800669908,-4174.96910953771)
(-827734.644583237,-4797.8401080492,-59331.0503992772)
(-852649.859531507,-18485.198576653,-168952.8073391)
(-870981.40780923,-28276.9866958403,-365044.24588959)
(-862917.931497765,-12096.9049508924,-692469.691938734)
(-761226.550731114,3971.31267146712,-1127149.56844938)
(-477737.721032049,5539.26574171269,-1502614.58944773)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-772704.294830904,31940.9404915514,10582.7930962407)
(-778229.958729557,28656.3921071393,16353.7660676454)
(-788169.37391679,21393.2009958271,11012.446839931)
(-799808.488350014,8230.68049379923,-14566.819064617)
(-808158.745041398,-14219.7840974076,-72959.4738598215)
(-806689.206229231,-49743.6097808213,-178710.491807519)
(-794695.831583883,-88645.5245557198,-348875.479005888)
(-790225.497553774,-20564.1429597063,-676464.833665548)
(-716492.585795923,27660.330994261,-1125651.04250801)
(-458234.903057513,21136.70513791,-1508183.12368774)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-795483.050758597,35018.726166245,7331.05157903907)
(-797775.590045943,31053.3137756557,9047.36056323922)
(-799551.692277392,22090.6401433339,-2171.11764781369)
(-793727.661428327,5264.4514541987,-36991.1865018338)
(-765953.679152997,-26590.6944423071,-108490.961929988)
(-693390.832635867,-92650.0440067698,-217615.941524075)
(-569474.254134876,-247997.999718354,-280846.050665361)
(-576370.392763128,33024.9932841778,-628369.002531373)
(-601898.798938346,134515.074976989,-1132323.0186274)
(-413086.653090399,63524.2131420555,-1529465.05418174)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-831060.871384609,16870.8828827569,3354.90871080383)
(-829241.158460986,13426.7286883971,45.8766914186339)
(-820503.08550923,5937.55549120444,-19067.7005965063)
(-791096.736253103,-6809.36336825247,-68902.4410794921)
(-709250.845797761,-25769.476182535,-174593.261804491)
(-501770.981742718,-43141.6400803701,-372963.372412876)
(1.75589552011076e-06,1.43237210689789e-06,-4.51983490129811e-07)
(-241.112502757021,621.299480181291,-527119.233947627)
(-368405.509986892,528212.598342249,-1203562.66161995)
(-336490.210292154,135240.326385205,-1593247.82266632)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-878577.391744767,-39816.1256812434,-157.615476318762)
(-872935.559790402,-41727.7582197152,-7516.03659563989)
(-854760.014870739,-45151.9517191589,-31884.7344311879)
(-806121.377798036,-48873.9733636416,-87931.2786267238)
(-689639.785253252,-49560.1175741076,-191964.614097412)
(-440402.367948869,-38531.1968719065,-329709.48611839)
(-4.87197657245593e-07,-2.68503401409576e-08,1.45452267331149e-06)
(6.91822338288635e-06,1.58119553707957e-06,-3.86070980996983e-07)
(206.543201654703,154.614195563737,-1596903.36170375)
(-247401.292307088,18450.8110432162,-1728862.18628568)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-931523.435294748,-160874.906382847,-2195.31903778397)
(-923327.827122063,-160916.515144416,-11087.0595704518)
(-899142.456299421,-159382.329691144,-35704.2042273572)
(-839319.63030579,-152266.506340498,-88662.5106769741)
(-705045.000708575,-131347.310832187,-180902.906288722)
(-436558.412438728,-83474.5131782247,-291048.393314539)
(-3.59112399611326e-08,4.63398972956186e-08,-2.66589121143383e-11)
(4.20861605713105e-06,1.84948282303744e-06,6.7919531916619e-07)
(232.510615784805,297.469902064393,-1578896.88874524)
(-231713.308315603,-54176.7238800538,-1747619.28486944)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-971658.444988505,-378414.452130652,-2307.04674641387)
(-962652.627167561,-377073.715558489,-9654.60533050173)
(-936873.777980958,-371776.824499985,-28616.0336042891)
(-874861.526060635,-355569.756068487,-67720.585162262)
(-737320.358582502,-312485.65468479,-132968.300619912)
(-460560.789384305,-209466.700642294,-207372.05667314)
(5.10889453635188e-07,2.84157733994629e-07,-3.14988719016846e-11)
(5.938156810357e-06,1.206111940272e-06,3.8159656307588e-06)
(397.746266169476,-732123.186811686,-1633573.2098847)
(-246312.02399914,-256759.87500067,-1693573.75096078)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-960256.038563891,-716830.526332076,-949.946365862808)
(-952242.108588434,-715402.936849266,-4373.6860321047)
(-929637.951300673,-710082.867795635,-12410.85856284)
(-875794.996763901,-693737.191307886,-24563.4845612485)
(-754609.710245149,-646557.752744411,-29769.2005301764)
(-495277.903499977,-503480.892975331,2417.86761077789)
(7.80586953116982e-06,3.08891957154799e-06,3.3806904206609e-07)
(120.811445247913,-733501.282092413,-732155.513864009)
(-340637.348471144,-628925.687480471,-1158236.20748773)
(-314740.915313636,-330986.01738198,-1436743.95818214)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-832615.335548349,-1150563.88184829,532.520409627844)
(-826942.137364063,-1150413.73980651,1015.5313917828)
(-811314.268866203,-1149643.59446511,4009.97482452205)
(-775018.472063257,-1148537.97881309,22795.1332433593)
(-694208.226699775,-1155802.69516903,113555.291264609)
(-509081.869746015,-1227475.00720691,506223.640644967)
(176.000304486401,-1667850.27785601,-733266.874052373)
(-349105.78110149,-1164324.6882898,-627421.991994025)
(-445704.13816975,-861607.453072467,-860200.425404897)
(-320125.608100656,-476837.329234904,-1105681.68125156)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-514316.446961127,-1523358.49413716,745.086324014893)
(-511486.080012314,-1524217.49352187,1922.42673305811)
(-503900.691562438,-1526375.82103918,5248.7614238453)
(-487066.551301454,-1531838.9105885,15712.7055593833)
(-452644.137768121,-1547771.07848174,42124.5394579265)
(-387741.246605039,-1590190.73755473,66167.7866636659)
(-287939.516604775,-1656692.75670192,-229449.300981197)
(-328324.258793813,-1427511.73441306,-324422.619424866)
(-323448.94251771,-1103317.44919993,-475207.702633042)
(-215976.928107734,-628361.789808974,-628643.804405559)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-773971.50482015,7102.45048617216,5185.00316139912)
(-776999.494474602,7047.30647520316,6190.37427087868)
(-781960.193021552,7374.44005163882,-2361.59883956084)
(-786488.315839741,9173.55975306368,-28408.9536657208)
(-786694.910649939,14706.5162216192,-84155.20382064)
(-776835.882570121,27367.7889667792,-187336.969748807)
(-749166.095337898,47918.5164562198,-357070.798676351)
(-689679.250020546,60555.0495130611,-590864.52966663)
(-557031.189038879,48667.7050327479,-843727.596391624)
(-321522.688452909,25022.1169293254,-1024964.74590007)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-779775.391030221,9057.58277081198,5115.9639146769)
(-781605.205081844,9042.58235408579,6495.9343880797)
(-783701.657081263,9940.08756862718,-537.429964443794)
(-782605.239816709,14241.5322399559,-22808.6509846407)
(-772745.286696222,27912.6207184236,-71428.2138266243)
(-747499.682898281,63474.7711273555,-166724.719318158)
(-705587.42230876,136512.460437235,-344427.072574308)
(-664602.218414127,193282.77916966,-602778.081370566)
(-545430.880437783,142251.220795444,-867423.302491412)
(-316878.752125715,66279.0655995425,-1050036.40209341)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-790941.59010879,-549.483805578949,5065.60592657693)
(-790562.455141926,-404.718182543509,7299.77155918135)
(-787167.714969452,1156.57968060448,3699.30213926133)
(-774556.821561749,7903.5136896277,-9133.51917699095)
(-741402.81249411,30100.2591294779,-35872.024246936)
(-671103.165807516,98988.8869711024,-93673.8069190311)
(-560400.995547504,321461.137472932,-287695.742542105)
(-626065.605605049,609217.198917999,-653934.949448525)
(-538094.330340904,368061.012928474,-943549.210178983)
(-314019.3242832,140148.071351086,-1116485.54473772)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-806201.818041192,-30561.4527034298,5152.9155544305)
(-803068.441300228,-30202.4168813773,8777.89709250208)
(-792622.841158498,-28270.6740119138,10324.9064342894)
(-764055.489841324,-21790.0477283398,12977.2214404819)
(-693065.847771161,-6080.07615583167,32972.5586992001)
(-516988.702312961,18332.1339805255,128847.032260021)
(-1.30841023202256e-06,3.62692476636621e-06,-1.28384196423376e-07)
(-725506.752561791,1068.7406359687,-895328.435814105)
(-620924.154602782,896955.238692094,-1171704.01696183)
(-335557.316337678,224373.417000247,-1256862.25656545)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-821800.855461863,-92779.7967173177,5441.80773098054)
(-816197.835063332,-92121.7542639783,10623.4203865196)
(-799572.925974832,-89540.5224948011,16706.179973503)
(-757736.964636597,-82061.5515440391,28593.2706277688)
(-659648.383740666,-64894.0746368315,57415.867596175)
(-440891.039325744,-34618.4583000549,110855.131253631)
(1.49145447351264e-06,1.06985621786977e-07,1.40993693632663e-06)
(3.99711066061616e-06,1.48363554382349e-06,2.80443172183843e-06)
(-1132709.8047951,263.344750304384,-1844685.49827909)
(-420286.96885008,34182.4835351538,-1481608.88827099)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-829177.154573483,-201123.742216841,5997.66477826177)
(-822230.866866606,-200298.387693046,13077.3379518798)
(-802524.46131165,-197177.422882251,24096.2433515594)
(-755120.252074134,-187855.618376302,45690.9319521624)
(-648355.998078272,-163624.693141402,87732.5478264308)
(-421653.402587422,-107464.414985789,145673.49466086)
(-5.12875075560368e-08,-7.58623287062877e-08,2.02669640342392e-12)
(3.32323271566091e-06,7.92514551382751e-07,1.5765063606073e-06)
(-1073160.51792427,492.743153561459,-1811070.08170326)
(-423726.523068948,-68768.6159546033,-1516105.76746015)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-812234.415855953,-367310.301553501,6762.53020411764)
(-805425.099616189,-366898.378857834,16134.9938175278)
(-786569.449132232,-364747.447251722,33400.689338274)
(-742582.655191211,-356659.226293666,69925.4263862101)
(-645079.07897578,-329884.190779185,143943.644417272)
(-433198.631486061,-244252.268239023,253369.339772257)
(2.93264735559367e-07,-9.89076787812298e-08,-2.2913975657239e-12)
(4.41655146043444e-06,1.6872497693681e-06,6.26867840539056e-07)
(-1176824.10100162,-1073212.25670013,-1880518.02211395)
(-422906.704970118,-325213.366604293,-1447478.59049329)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-745221.419510401,-589527.368165374,7182.44755839198)
(-739839.917730032,-590416.355848688,18298.2336908507)
(-725564.477310713,-592015.120585865,41492.4330350308)
(-694526.720731853,-593180.458269541,96745.388978855)
(-631090.241300385,-586356.407044911,229698.136299814)
(-490220.899591666,-517475.5836337,497864.447786178)
(4.94544129972178e-06,2.30660294716182e-06,1.67777700040926e-07)
(-865697.293743309,-1082883.25821408,-1073045.10956126)
(-620302.024944554,-734082.970904274,-1132509.71888371)
(-313856.153722575,-336387.735307353,-1122220.11177172)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-595938.954995227,-832504.969874647,6301.22115614435)
(-592571.809531679,-835216.152732042,16730.6902071124)
(-584479.514806382,-842493.422849934,40374.2384113617)
(-570657.94408199,-860861.409054624,103694.661215177)
(-561084.25626254,-914536.298965673,298750.582698706)
(-636908.676709446,-1106434.4901153,1015536.29614372)
(-1317173.32958937,-1956245.41389612,-1082559.6895323)
(-646681.96213139,-1143802.89125874,-724063.875457725)
(-429551.956547943,-739554.291465766,-734744.736518052)
(-232729.932804019,-372776.306124116,-785751.840997921)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-341193.695950905,-1009256.30014344,3628.57925857919)
(-339641.361997359,-1013002.78169901,9570.4902105974)
(-336143.564165517,-1022808.73310857,22128.673072316)
(-330845.194131912,-1045131.97244817,50177.8792963239)
(-328550.887183924,-1095492.00858481,107040.338331252)
(-350375.299773087,-1202743.07241728,165982.973801281)
(-439378.739405965,-1369000.97756681,-269822.239726827)
(-322956.96994632,-1099432.96076813,-319559.459064928)
(-234652.281766106,-780100.114183248,-367810.297099045)
(-131269.887732819,-412502.814959679,-412790.828638398)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-777395.655848149,1241.36436131563,2182.78666668977)
(-778434.170886032,2400.52158172877,1216.9414963913)
(-779398.731159679,5584.70354349137,-6929.2239089785)
(-777807.787457957,13007.0632644274,-28616.8155551915)
(-769570.009784995,28605.6072090849,-74347.32362922)
(-748147.226439927,56650.9353047128,-159686.91506413)
(-702791.25912561,91484.7229227929,-297546.474199215)
(-614672.009371529,85638.1572471545,-458191.872095377)
(-467246.238079401,60240.5053300332,-608217.328384897)
(-255896.141482761,29636.4602730032,-703480.33562804)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-779572.089897315,-2242.70946130096,3280.77268970622)
(-780294.918877095,-8.69518658588884,4379.70325327455)
(-780657.776413735,6392.64096597006,527.885163271338)
(-778345.540184088,22241.9613346994,-12966.7125396247)
(-770128.034751994,59249.1976551765,-46227.5549299409)
(-752180.427703017,139880.826462511,-124776.701282998)
(-717228.994610928,281715.750773919,-303366.156831955)
(-630647.042171877,231877.830179725,-483561.00600676)
(-479571.773931571,149640.020667731,-638819.627850671)
(-262083.523268486,69156.7213841068,-733135.117819005)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-782754.286234218,-15837.890221844,5407.87688597457)
(-782910.211118559,-12906.3523420307,10653.2900180527)
(-782151.664879058,-4244.78803441846,16274.6689280555)
(-778505.004186207,18478.5814430266,23986.2314441935)
(-771101.852420404,78544.0948567789,34390.3741688862)
(-767127.013989002,253240.10446329,17054.9443495942)
(-790267.373247987,881897.989788141,-353260.916964136)
(-691466.497726583,509909.243814967,-565891.438477841)
(-520258.264467063,285324.283029406,-719411.766713361)
(-280466.790497328,118647.313037024,-802454.892152149)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-784189.925673951,-46098.541646854,8248.75905777451)
(-783652.335014053,-43277.4162762842,19203.7167058604)
(-781376.438291781,-35155.1794377558,38867.7052424823)
(-775276.857376668,-15387.329060497,83954.9832813415)
(-767135.309043124,27523.9907110475,209044.548699031)
(-795215.13189685,94818.8350350907,645692.247711113)
(-1172094.20621491,1159.09534366988,-725387.84102431)
(-877275.64298541,726971.516591486,-790681.223377209)
(-625344.623096346,385350.896850292,-886287.368704544)
(-321571.663607283,139687.897821203,-921313.606219103)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-778768.726786241,-100148.276202295,11017.6058798198)
(-777593.38635909,-98122.9371282685,27258.6780275548)
(-773577.433219855,-92454.3527687785,58562.3586035916)
(-761930.758755936,-79394.5826647003,126763.406327127)
(-728210.80730408,-53452.5781147522,276302.398716351)
(-606657.476802061,-15164.7450061317,552052.416233884)
(1.76498751572907e-06,1.8840253932313e-06,-2.74617091703979e-06)
(-1160895.11948825,304.532121897865,-1132658.13686798)
(-807738.644087166,59991.2175762763,-1132269.61830189)
(-382334.803260785,30802.9981975769,-1061336.88426756)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-758072.155554299,-184237.606537905,12984.3313164238)
(-756758.958942406,-183472.030836445,32861.5171003997)
(-752491.375028916,-181201.544663364,71575.6227122529)
(-740262.571903417,-175281.527730198,152604.887607033)
(-703538.004115985,-160270.151123386,314604.466653379)
(-570827.062891419,-118940.840990504,567554.222941746)
(4.02279065074302e-06,-7.17775508684725e-07,-1.92430485918031e-06)
(-1091986.92595574,245.033258124189,-1073248.29181437)
(-821643.782738182,-103063.888394425,-1161709.92102974)
(-394272.78007745,-67909.206447847,-1092451.45937582)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-709716.418441123,-300461.52514354,13705.9211907986)
(-708874.990978774,-301443.100690875,35126.8824078099)
(-706254.586357663,-303873.759366481,77484.2343363561)
(-699254.119568807,-308711.938794856,167586.109778604)
(-677809.940213513,-315960.570748558,356007.390641504)
(-581656.91474777,-301336.334070619,686861.166983336)
(3.55404181157186e-06,-2.0894669392926e-06,-2.38896712601223e-06)
(-1203306.9433771,-865803.041803008,-1176767.15652607)
(-813290.189136394,-516706.80334509,-1126658.15344063)
(-376653.851506974,-216161.24944254,-1024658.96390908)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-618009.773640104,-440391.991925891,12718.8209120494)
(-617960.520458377,-443339.063812717,32735.3867622347)
(-618217.751500651,-451124.36882715,72639.2704128393)
(-621409.105336397,-469496.173089699,160305.889312227)
(-640927.814343423,-516501.002006914,370683.893613625)
(-744877.59764305,-664329.085551562,988333.343145957)
(-1345783.89276302,-1317445.73024769,-865616.548113913)
(-905458.27685777,-864014.604825627,-827644.001976836)
(-595122.135382593,-543403.262168266,-826127.432715609)
(-292371.937254993,-255284.715198991,-808488.183426747)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-468239.581472851,-577866.730916055,9775.36546778855)
(-468688.781910884,-582445.020767275,24998.2948015487)
(-470572.17628324,-594364.938575361,54331.526026623)
(-477904.102619266,-621286.475519763,113367.986993967)
(-504934.088449221,-682251.380535596,222968.197709327)
(-593484.691738456,-820159.594309409,335374.72149619)
(-808535.669710906,-1078725.4735722,-411983.195057767)
(-595403.571188476,-820338.043541524,-506938.147284787)
(-397032.700664522,-544865.176402036,-537995.488934431)
(-201372.106169666,-271459.195392587,-553178.835375176)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-256082.801363123,-668211.056592908,5233.43108907227)
(-256469.850515356,-673568.203787179,13185.1026269716)
(-257899.166787364,-686958.753745475,27534.5204189262)
(-262507.988787809,-714625.458842351,52536.2983974123)
(-276190.959059205,-767290.048569723,85215.0383068318)
(-309664.495339676,-852671.15936557,77015.7989295852)
(-357840.042319115,-929900.927395634,-153347.444333837)
(-288596.039565113,-776777.174641924,-231269.243614642)
(-200571.407575933,-545727.832923577,-264487.461283275)
(-104170.293348786,-281425.524800899,-281620.726259004)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-777531.450254012,-960.763487467459,1096.55789332394)
(-778043.359777495,505.473217252252,200.27356753203)
(-778063.834215998,4299.86629240515,-5434.48966854543)
(-775218.133261729,12458.1848855584,-20482.3287503391)
(-765077.027797691,28048.3998728433,-53023.7106104876)
(-739537.574857624,52641.5819955759,-114274.944188356)
(-684897.392328493,77103.6594533307,-209272.470438802)
(-583049.071667472,69707.2421813034,-310602.65032416)
(-429009.124629395,47931.4898596769,-396771.253633841)
(-228624.197314566,23453.3370511696,-447496.53485321)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-777623.884201147,-5400.51613030525,2491.54694667016)
(-778639.755332731,-2609.77815814528,3951.63477770036)
(-780048.578522471,4912.64425326479,2729.65892557772)
(-780405.350959528,22133.8483788894,-4886.19379230976)
(-776960.064642619,58386.6548363019,-28392.4188651467)
(-763233.860738818,125076.293322005,-89773.69715578)
(-722057.17548431,208817.49223309,-216659.349062154)
(-616423.747112724,171176.479562449,-332351.881502462)
(-451810.27156499,109034.128666042,-421216.0226754)
(-239731.170244063,50804.6579779698,-470919.696626628)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-776163.203882048,-17179.8919754647,5188.29349298993)
(-778154.739191519,-13548.3644736119,11371.4078814183)
(-782371.515936194,-3342.5525988094,19846.4557906254)
(-789654.169284519,21869.4842438299,31259.9850239919)
(-802447.925626268,82741.0965403969,38251.6165257606)
(-823161.701280764,225432.287970568,-6069.69083103769)
(-833490.124627379,500332.022123665,-254361.469342222)
(-704417.168881527,324320.181971151,-394554.500595994)
(-506626.175105125,180358.399290358,-479510.860582249)
(-264895.187519075,77589.8093928497,-521867.614975375)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-769575.191927306,-40556.3228616735,8761.69713956575)
(-772848.604951338,-37097.0045454162,21506.607148651)
(-780933.233348,-27236.0642048806,44956.9138109379)
(-798587.015063273,-1883.43666521145,92019.9924065925)
(-839962.063779395,66704.9704261311,180882.873257131)
(-941442.359750413,283765.253834146,268777.135247129)
(-1146241.71478123,1173721.80222862,-430465.1362915)
(-888524.804456922,443751.363834165,-538647.156682992)
(-604412.467666333,203192.631522653,-582413.544345309)
(-305763.929542336,79009.8570107958,-599641.326028202)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-752146.651741649,-79378.9406967262,12200.5427904586)
(-756653.516319653,-77183.929299977,31347.5975055835)
(-768465.957635289,-71267.0803098653,70267.1380260071)
(-796460.706170468,-57600.2891484394,160513.937923764)
(-870332.986307816,-28543.0874271571,397884.174780788)
(-1104810.02332425,21103.8321437109,1158698.1429934)
(-2038763.23706931,1028.12288055647,-1160566.69232394)
(-1168032.33461244,69707.7305620553,-779385.843927632)
(-723491.149033315,46360.5318512296,-706801.239310056)
(-350174.716391481,18981.8533895017,-678933.322558073)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-715937.914112225,-135870.457048416,14357.2749096201)
(-721311.85489691,-135533.528011673,37259.7695758174)
(-735514.254275401,-134911.540708988,83927.1092214229)
(-769220.219738146,-134202.671063773,189487.138971486)
(-855693.649032666,-134423.069255035,447522.765716044)
(-1111321.57955708,-129581.839485894,1138702.95401132)
(-1997690.94198482,620.06905947414,-1091972.76436816)
(-1200616.87607845,-110767.189090975,-802867.894592397)
(-749267.915566252,-94545.9442189238,-734337.285694203)
(-361218.022954119,-50209.8401939633,-698200.349234064)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-651445.183866924,-208800.239258364,14658.5476357521)
(-657088.173074733,-210584.597105966,37922.7988260057)
(-671966.009715323,-215917.25474404,84639.9362187166)
(-707094.658143272,-230938.542674194,189216.34640361)
(-796294.755770206,-279130.45803601,452408.550741277)
(-1063202.5312063,-464674.660283568,1269046.9879975)
(-2078178.80877988,-1346151.08013002,-1203415.90798899)
(-1162792.52002914,-567977.522727402,-786719.997700543)
(-706009.297077924,-298511.60849308,-690035.225484869)
(-336975.647400344,-131852.0073099,-648071.262475557)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-549053.132646393,-290635.364958578,12878.4847065031)
(-554184.628976342,-294138.675054022,32656.671172524)
(-567496.462714753,-303591.004705543,69609.1323481287)
(-597561.075857764,-326122.170669254,140944.730864554)
(-665372.385382809,-380621.153108857,266879.996976792)
(-817289.630371008,-513064.538242061,387681.907663239)
(-1098714.14603035,-780379.285772276,-425159.633427167)
(-827309.768523257,-554046.807874552,-517238.856614539)
(-542110.809144294,-345370.007968916,-523391.783377011)
(-267064.390261162,-164321.827723149,-516229.509957586)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-402623.542828751,-365670.87223289,9419.46863021505)
(-406476.609348744,-370237.982943511,23306.603957564)
(-416283.790741421,-381747.666080116,47174.8797903183)
(-437357.098072132,-405982.550059147,86488.2546330742)
(-479946.427596689,-453635.327005397,134514.76767708)
(-556004.657010905,-536507.51326384,120477.707971303)
(-641517.351395533,-628224.041740454,-198695.854375908)
(-525899.558575045,-513733.658353778,-308513.016510106)
(-359974.489127241,-348584.373703854,-342356.862312441)
(-181737.665163473,-174390.031043017,-351923.099998769)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-214536.634998807,-412117.894550635,4900.85595342891)
(-216576.554246076,-417117.22538671,11886.8021273478)
(-221673.12298805,-429138.74693487,23051.839182788)
(-232111.962462084,-452264.918034493,38938.1808324069)
(-251346.035267033,-491298.791259991,51756.7212948272)
(-280125.379251097,-543196.685567955,28906.7775103565)
(-300902.339387981,-572245.259148603,-84009.7080126253)
(-254687.612174035,-488420.394214054,-143231.399543429)
(-178902.608034269,-345381.079134337,-168103.49365461)
(-91748.4744965243,-177411.610947128,-177503.732602759)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-777123.225298478,-964.683135720412,556.458180187162)
(-777611.18335733,-12.5884314925651,136.87019152515)
(-777658.983125533,2400.56306758389,-2668.54396652741)
(-774826.620789701,7358.02885528457,-10418.0852938406)
(-764226.023802648,16253.5314514802,-27522.620740357)
(-736592.053901056,29039.5716240401,-59507.7133209695)
(-677223.185729995,39998.2534763905,-107180.173395864)
(-570307.982231789,36358.0145351245,-156279.277366676)
(-414303.17046313,25162.707230543,-196147.938763478)
(-218442.771742534,12374.055156014,-218703.419491529)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-776266.602105525,-3787.48231076693,1465.51707942733)
(-777720.88860852,-1970.16316725394,2504.22509097777)
(-780189.481669981,2773.75329183182,2271.93801423946)
(-782318.266598164,13079.7194301384,-1536.83692198224)
(-780613.828004306,33094.7476250991,-14724.2897339133)
(-765761.836062324,65361.485320568,-48518.2281069309)
(-717301.742236141,97542.0877869949,-110817.495665699)
(-606701.927608497,83292.2044446248,-167473.505079427)
(-439521.271263755,54307.1118184012,-208906.909968516)
(-230905.775884921,25689.0188767251,-231047.268048364)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-772739.638089149,-10426.7437764727,3215.69567280448)
(-776021.868491032,-8070.4789993691,7183.14080443574)
(-783252.120320236,-1678.83403170232,12516.3325120118)
(-795675.080787284,13217.9478511213,18399.0155937974)
(-813980.850408302,45530.4997179985,17496.1882829367)
(-831426.239328854,107482.524617538,-16360.3129659445)
(-815091.417724964,187888.239140502,-125105.171221867)
(-690180.88235655,140457.277039353,-196506.530341563)
(-493979.280924033,82708.9310086823,-237555.243712948)
(-256709.555549194,36773.8296444103,-256825.686450512)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-762573.012484483,-22958.8060708657,5529.88285156867)
(-768197.361460019,-20732.4845001218,13540.6448610027)
(-781868.580871609,-14554.0413439316,27351.199696847)
(-809207.801802409,548.986193807157,50640.9480932938)
(-859854.810033846,36654.4256306235,79409.7684351169)
(-939310.028083114,120745.502222887,64014.4591624643)
(-1003354.63689228,281591.782077327,-172576.161663298)
(-830933.730894889,164614.770991088,-254324.729177061)
(-576835.421643955,84361.1219184673,-283553.966109236)
(-293541.63191088,34711.2371908534,-293713.671287134)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-739771.473028692,-43081.4881659306,7747.5033821116)
(-747621.117516746,-41729.2189846462,19711.8390637307)
(-767550.868344718,-38163.7936936899,42406.5021229238)
(-810068.174818032,-30132.1056169899,86695.0625812841)
(-896826.565302263,-13637.9232741818,163480.990480537)
(-1060385.68362649,14947.4997359242,224854.653269746)
(-1285319.03943178,42604.3018219534,-289602.064112434)
(-995885.023259861,37540.2116001795,-334674.816074074)
(-661378.759853394,20890.0011853568,-333316.084520884)
(-328316.110996863,8114.87178734692,-328578.324511991)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-696779.093537633,-71324.1200042868,9083.81126376516)
(-705989.396924293,-71238.073283016,23270.2075895192)
(-729522.674703353,-71287.4398142764,50402.2741380532)
(-780109.214802029,-71986.7843649711,103145.947949916)
(-883350.758442071,-74905.7532261288,192070.887311269)
(-1075544.69508922,-81298.3031788331,252539.805758164)
(-1328243.20397782,-79576.2925818026,-294727.337845083)
(-1033704.16407353,-72701.1262281059,-351398.712021707)
(-682490.422281107,-51113.3708419677,-346172.833279537)
(-336573.924211204,-25850.5227540597,-336851.537481051)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-625509.474890433,-106396.709637162,9136.88065637867)
(-634757.6751122,-107678.475182259,23246.7845930929)
(-658230.093153403,-111467.915022879,49691.3432397762)
(-708125.629592371,-121451.171934761,100186.702258665)
(-808457.821622271,-148255.211490793,185699.226375392)
(-994320.9822379,-218800.452094204,254319.82632235)
(-1248829.81854932,-366718.577731749,-287886.878758238)
(-961125.610465196,-232432.985387912,-329821.929162375)
(-631496.075724936,-134542.297232405,-320906.224124923)
(-310825.019800263,-61884.9308169589,-311022.443662109)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-519117.711941175,-144190.79957364,7858.6692312586)
(-527050.831316033,-146460.539770379,19506.9361590731)
(-546711.922814225,-152447.568279607,39702.0495152758)
(-586616.699095022,-166022.688548614,73329.1893663861)
(-660156.120138099,-195307.199420622,115164.912051511)
(-775521.812159235,-251870.055045631,106466.696791165)
(-882154.122617483,-323248.114448552,-153563.789904895)
(-728784.189494603,-252622.1460676,-231900.208253846)
(-497089.140374588,-163213.559277615,-248250.614978356)
(-249047.45016017,-78996.3091620172,-249156.176734286)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-374897.99048366,-177555.250343768,5638.89842503305)
(-380564.332910545,-180328.333189911,13594.4154063671)
(-394210.052288633,-187119.304482868,26192.4131568402)
(-420510.397654523,-200737.41870586,44060.4428964753)
(-464758.830793475,-225084.420840481,58650.0675131229)
(-523634.769851047,-260750.474503143,35160.5998107792)
(-558978.466776848,-287747.583166659,-82878.816089798)
(-476316.600400247,-242616.593843843,-142467.326488356)
(-334027.316890721,-167586.035410072,-164042.02259242)
(-170131.578224329,-84461.1801570339,-170183.238536547)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-197419.116325699,-197565.878576986,2893.10956011076)
(-200337.391009852,-200507.191915144,6832.80504911994)
(-207205.142485478,-207392.960193938,12638.4802576149)
(-219885.448399091,-220093.919932798,19768.4674215598)
(-239759.825868106,-239957.419363016,23055.2565451686)
(-262933.062451138,-263129.705182608,8242.1704246774)
(-271297.429471817,-271441.334445666,-37668.9882124768)
(-233765.643399703,-233825.342283888,-67382.2085467651)
(-166468.517193781,-166521.58641455,-80880.7483827745)
(-85680.4249450632,-85696.0663648777,-85713.911726393)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
)
;
boundaryField
{
fuel
{
type fixedValue;
value uniform (0.1 0 0);
}
air
{
type fixedValue;
value uniform (-0.1 0 0);
}
outlet
{
type zeroGradient;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //
| [
"huberlulu@gmail.com"
] | huberlulu@gmail.com | |
dabfa9bc829e4c8725cd0e47108c2da4d2bd3b72 | 6b1e2035a7a3d0e556417ee3b984ecd057f4b63a | /include/zephyr/QueueLoop.h | c35d2a122059c2c34cde297c8e10a45330e3bc39 | [
"MIT"
] | permissive | DeonPoncini/zephyr | 282c557803988e64144bcb641bfcdb4d61f2f6a0 | b95616444b44229e5473be13a56d55a04cad0f63 | refs/heads/master | 2021-01-23T18:50:39.198407 | 2015-01-31T23:24:36 | 2015-01-31T23:24:36 | 28,121,736 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,556 | h | #ifndef ZEPHYR_QUEUELOOP_H
#define ZEPHYR_QUEUELOOP_H
#include <condition_variable>
#include <deque>
#include <mutex>
#include <utility>
namespace zephyr
{
template <typename T>
class QueueLoop
{
public:
QueueLoop();
~QueueLoop();
bool shouldExit();
void terminate();
bool more() const;
void write(T&& t);
T read();
private:
bool mExit;
bool mWaitVar;
std::deque<T> mQueue;
mutable std::mutex mReadMutex;
std::mutex mMutex;
std::condition_variable mCondVar;
};
template <typename T>
QueueLoop<T>::QueueLoop() :
mExit(false),
mWaitVar(false)
{
}
template <typename T>
QueueLoop<T>::~QueueLoop()
{
terminate();
}
template <typename T>
bool QueueLoop<T>::shouldExit()
{
std::unique_lock<std::mutex> l(mMutex);
mCondVar.wait(l,[&](){return mWaitVar;});
mWaitVar = false;
return mExit;
}
template <typename T>
void QueueLoop<T>::terminate()
{
mExit = true;
mWaitVar = true;
mCondVar.notify_all();
}
template <typename T>
bool QueueLoop<T>::more() const
{
std::unique_lock<std::mutex> l(mReadMutex);
return !mQueue.empty();
}
template <typename T>
void QueueLoop<T>::write(T&& t)
{
std::unique_lock<std::mutex> l(mReadMutex);
mQueue.emplace_back(std::move(t));
// notify the waiting thread to continue
mWaitVar = true;
mCondVar.notify_all();
}
template <typename T>
T QueueLoop<T>::read()
{
std::unique_lock<std::mutex> l(mReadMutex);
auto t = std::move(mQueue.front());
mQueue.pop_front();
return t;
}
}
#endif
| [
"dex1337@gmail.com"
] | dex1337@gmail.com |
71754530478ddb2451ebf7d3d981b66ad9d2e754 | cdfc9d6fa555dd60f8b5a7c51c187ffb0335cad1 | /DiningPhilosophers/DiningPhilosophers-Order/philosopher.h | ea990c091fcf5ca5ed743aa4ed4e93e084262d8d | [
"Apache-2.0"
] | permissive | mexuaz/Concurrency | 09867c4f852b90e387e8f5422acec9c02593587e | e7025dc0fa2b95f66ff608ff7eba5cdef837a7d4 | refs/heads/master | 2020-03-30T17:39:12.925855 | 2018-10-16T16:22:05 | 2018-10-16T16:22:05 | 151,464,374 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,165 | h | #ifndef PHILOSOPHER_H
#define PHILOSOPHER_H
#include "fork.h"
#include "spaghetti_bowl.h"
#include <chrono>
#include <random>
#include <atomic>
class philosopher
{
size_t m_id;
fork* mp_leftFork;
fork* mp_rightFork;
spaghetti_bowl* mp_bowl;
bool m_left_first = true;
static std::atomic<int> s_concurrentDining; // To keep number of concurrent philosphers dining at least one fork in hand
std::mt19937 m_gen;
std::uniform_int_distribution<size_t> m_dist_think; // duration for think in miliseconds
std::uniform_int_distribution<size_t> m_dist_eat; // duration for eat in milisconds
std::chrono::duration<size_t, std::nano> m_dining_duration = std::chrono::duration<size_t, std::nano>::zero();
size_t m_dining_number = 0;
void think();
/*!
* \brief dine
* \return The amount of time spend on dining
*/
std::chrono::nanoseconds dine();
public:
philosopher(size_t id, fork* leftFork, fork* rightFrok, spaghetti_bowl* bowl,
bool left_first = true,
size_t max_think = 5, size_t max_eat = 20000);
void operator()();
};
#endif // PHILOSOPHER_H
| [
"mehrafsa@live.com"
] | mehrafsa@live.com |
2d2d13a8db20dea9de0209d4c18a5430ac7d8a5a | 970f176b715614aec2a0569de4ee7c3836a2764f | /PC2/SerialCommandDisposer.cpp | 190cc4b13bb9931818570dd02a41db0180e9ada3 | [] | no_license | spmno/PC2CPP | 9f915eec63cf24f053af1a302edf42ee4f7b18c6 | 0ba0cfb823a23082c2f3b5358fb662ff1293299d | refs/heads/master | 2020-05-20T01:45:01.388028 | 2015-04-27T03:17:03 | 2015-04-27T03:17:03 | 30,697,143 | 1 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 801 | cpp | #include <memory>
#include <mutex>
#include "SerialCommandDisposer.h"
#include "PartFactory.h"
#include "NetServer.h"
#include "SerialPortManager.h"
#include "MXLogger.h"
namespace mxnavi {
SerialCommandDisposer::SerialCommandDisposer(void)
{
}
SerialCommandDisposer::~SerialCommandDisposer(void)
{
}
void SerialCommandDisposer::dispose(const unsigned char* command)
{
PartFactory &part_factory = PartFactory::get_instance();
unsigned char part = command[4];
std::shared_ptr<Part> &part_ptr = part_factory.createPart(part);
if (!part_ptr) {
//MessageBox(NULL, L"´íÎó´®¿ÚÊý¾Ý", NULL, MB_OK|MB_TOPMOST);
return;
ExitProcess(-1);
}
std::mutex mu;
std::lock_guard<std::mutex> lock(mu);
unsigned int command_section = command[7];
part_ptr->do_reply(command_section);
}
} | [
"sunqingpeng@hotmail.com"
] | sunqingpeng@hotmail.com |
34da6ee3c5be327caffc7ec9d28346f05f072b09 | dfb7297f114bbff7a89fea86cb9b8e0e16243d01 | /TTS/TTS/L1-015.cpp | beb86259a84e6718da84f7ad764425349eea674a | [] | no_license | rainingapple/algorithm-competition-code | c06bd549d44e14c64e808d7026a0204d285f1fb3 | 809bff5cdf092568de47def7d24d36edef8d0c1e | refs/heads/main | 2023-03-30T13:11:23.359366 | 2021-04-09T01:29:18 | 2021-04-09T01:29:18 | 343,407,072 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 243 | cpp | //#include<iostream>
//using namespace std;
//int main() {
// int n;
// char c;
// cin >> n >> c;
// for (int i = 0;i < (n+1) / 2;i++) {
// for (int j = 0;j < n;j++) {
// cout << c;
// }
// cout << endl;
// }
// return 0;
//} | [
"825140645@qq.com"
] | 825140645@qq.com |
016be5626fe947ed7afa268fcf11fef0923f0bd1 | f3a729d3588f6c31975d44b37f1b3a29c01db3cd | /1075B.cpp | dd74379dc894c0a129067136eeafb2eaf9f04e84 | [] | no_license | yongwhan/codeforces | 887e7cca0b47aa2ba65b1133300c63a808a15590 | aa8fa27ca1a07fcb7f9dac5b1ce908b7bfcd49e2 | refs/heads/master | 2020-11-28T01:47:52.239077 | 2019-12-23T04:16:29 | 2019-12-23T04:16:29 | 229,671,486 | 0 | 0 | null | 2019-12-23T04:05:28 | 2019-12-23T03:43:38 | C++ | UTF-8 | C++ | false | false | 825 | cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
int main() {
cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
int n,m; cin>>n>>m;
vector<int> x(n+m), t(n+m);
for (int i=0; i<n+m; i++) cin>>x[i];
for (int i=0; i<n+m; i++) cin>>t[i];
set<int> taxi;
int j=0;
map<int,int> idx;
for (int i=0; i<n+m; i++)
if(t[i])
taxi.insert(x[i]), idx[x[i]]=j++;
vector<int> ret(m,0);
for (int i=0; i<n+m; i++) {
if(!t[i]) {
auto right=taxi.upper_bound(x[i]);
if(right==taxi.end()) {
ret[m-1]+=n+m-i; break;
}
else if(right==taxi.begin()) {
ret[0]++;
} else {
auto left=right; left--;
if(x[i]-*left<=*right-x[i]) ret[idx[*left]]++;
else ret[idx[*right]]++;
}
}
}
for (auto it : ret)
cout << it << " ";
cout << endl;
return 0;
}
| [
"yongwhan@yongwhan-macbookpro.roam.corp.google.com"
] | yongwhan@yongwhan-macbookpro.roam.corp.google.com |
fc6b060a5ec6b6909284866ee432fb38365da9b4 | 7140863b91f7e85916ce394a9836c82acd40e11e | /game/server/hl2mp/hl2mp_client.cpp | 56acd5ee72ffd613786b7758371788d38b5bc702 | [] | no_license | newroob/bg2-2007 | 7e7f7bdd79ef232ca32228fec8a01e7469cbe57f | 220c3f3d33840804e0520c37c225e4f6a2748e5e | refs/heads/master | 2016-09-06T06:02:41.180887 | 2013-07-11T17:26:27 | 2013-07-11T17:26:27 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 6,267 | cpp | //========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
/*
===== tf_client.cpp ========================================================
HL2 client/server game specific stuff
*/
#include "cbase.h"
#include "hl2mp_player.h"
#include "hl2mp_gamerules.h"
#include "gamerules.h"
#include "teamplay_gamerules.h"
#include "entitylist.h"
#include "physics.h"
#include "game.h"
#include "player_resource.h"
#include "engine/IEngineSound.h"
#include "team.h"
#include "viewport_panel_names.h"
#include "tier0/vprof.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
void ClientKill( edict_t *pEdict );
void Host_Say( edict_t *pEdict, bool teamonly );
extern CBaseEntity* FindPickerEntityClass( CBasePlayer *pPlayer, char *classname );
extern bool g_fGameOver;
void FinishClientPutInServer( CHL2MP_Player *pPlayer )
{
pPlayer->InitialSpawn();
pPlayer->Spawn();
char sName[128];
Q_strncpy( sName, pPlayer->GetPlayerName(), sizeof( sName ) );
// First parse the name and remove any %'s
for ( char *pApersand = sName; pApersand != NULL && *pApersand != 0; pApersand++ )
{
// Replace it with a space
if ( *pApersand == '%' )
*pApersand = ' ';
}
// notify other clients of player joining the game
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, "#Game_connected", sName[0] != 0 ? sName : "<unconnected>" );
//ClientPrint( pPlayer, HUD_PRINTTALK, "You are on team %s1\n", pPlayer->GetTeam()->GetName() ); //BG2 - Don't need this. -HairyPotter
const ConVar *hostname = cvar->FindVar( "hostname" );
const char *title = (hostname) ? hostname->GetString() : "MESSAGE OF THE DAY";
KeyValues *data = new KeyValues("data");
data->SetString( "title", title ); // info panel title
data->SetString( "type", "1" ); // show userdata from stringtable entry
data->SetString( "msg", "motd" ); // use this stringtable entry
pPlayer->ShowViewPortPanel( PANEL_INFO, true, data );
data->deleteThis();
}
/*
===========
ClientPutInServer
called each time a player is spawned into the game
============
*/
void ClientPutInServer( edict_t *pEdict, const char *playername )
{
// Allocate a CBaseTFPlayer for pev, and call spawn
CHL2MP_Player *pPlayer = CHL2MP_Player::CreatePlayer( "player", pEdict );
pPlayer->SetPlayerName( playername );
}
void ClientActive( edict_t *pEdict, bool bLoadGame )
{
// Can't load games in CS!
Assert( !bLoadGame );
CHL2MP_Player *pPlayer = ToHL2MPPlayer( CBaseEntity::Instance( pEdict ) );
FinishClientPutInServer( pPlayer );
}
/*
===============
const char *GetGameDescription()
Returns the descriptive name of this .dll. E.g., Half-Life, or Team Fortress 2
===============
*/
const char *GetGameDescription()
{
if ( g_pGameRules ) // this function may be called before the world has spawned, and the game rules initialized
return g_pGameRules->GetGameDescription();
else
//BG2 - Tjoppen
//return "Half-Life 2 Deathmatch";
return "Battle Grounds 2";
}
//-----------------------------------------------------------------------------
// Purpose: Given a player and optional name returns the entity of that
// classname that the player is nearest facing
//
// Input :
// Output :
//-----------------------------------------------------------------------------
CBaseEntity* FindEntity( edict_t *pEdict, char *classname)
{
// If no name was given set bits based on the picked
if (FStrEq(classname,""))
{
return (FindPickerEntityClass( static_cast<CBasePlayer*>(GetContainingEntity(pEdict)), classname ));
}
return NULL;
}
//-----------------------------------------------------------------------------
// Purpose: Precache game-specific models & sounds
//-----------------------------------------------------------------------------
void ClientGamePrecache( void )
{
CBaseEntity::PrecacheModel("models/player.mdl");
CBaseEntity::PrecacheModel( "models/gibs/agibs.mdl" );
CBaseEntity::PrecacheModel ("models/weapons/v_hands.mdl");
//BG2 - Tjoppen - this seems like a good place to precache the musket ball model
CBaseEntity::PrecacheModel( "models/game/musket_ball.mdl");
//
//BG2 - Tjoppen - no "doot doot"-sound
/*CBaseEntity::PrecacheScriptSound( "HUDQuickInfo.LowAmmo" );
CBaseEntity::PrecacheScriptSound( "HUDQuickInfo.LowHealth" );*/
CBaseEntity::PrecacheScriptSound( "FX_AntlionImpact.ShellImpact" );
CBaseEntity::PrecacheScriptSound( "Missile.ShotDown" );
CBaseEntity::PrecacheScriptSound( "Bullets.DefaultNearmiss" );
/* //BG2 - Useless anyway. -HairyPotter
CBaseEntity::PrecacheScriptSound( "Bullets.GunshipNearmiss" );
CBaseEntity::PrecacheScriptSound( "Bullets.StriderNearmiss" );
CBaseEntity::PrecacheScriptSound( "Geiger.BeepHigh" );
CBaseEntity::PrecacheScriptSound( "Geiger.BeepLow" );
*/
}
// called by ClientKill and DeadThink
void respawn( CBaseEntity *pEdict, bool fCopyCorpse )
{
/*CHL2MP_Player *pPlayer = ToHL2MPPlayer( pEdict );
if ( pPlayer )
{
if ( gpGlobals->curtime > pPlayer->GetDeathTime() + DEATH_ANIMATION_TIME )
{
// respawn player
pPlayer->Spawn();
}
else
{
pPlayer->SetNextThink( gpGlobals->curtime + 0.1f );
}
}*/
CHL2MP_Player *pPlayer = ToHL2MPPlayer( pEdict );
if ( pPlayer )
{
//BG2 - Draco - Start(this is the part that supresses respawns when mp_respawnstyle != 0)
//if ( gpGlobals->curtime > pPlayer->GetDeathTime() + DEATH_ANIMATION_TIME )
//BG2 - Tjoppen - assume this function only gets called if we're allowed to respawn/spawn
// respawn player
pPlayer->Spawn();
}
}
void GameStartFrame( void )
{
VPROF("GameStartFrame()");
if ( g_fGameOver )
return;
//gpGlobals->teamplay = (teamplay.GetInt() != 0);
}
//=========================================================
// instantiate the proper game rules object
//=========================================================
void InstallGameRules()
{
// vanilla deathmatch
CreateGameRulesObject( "CHL2MPRules" );
}
| [
"bgmod@d519a5cf-78fe-0310-83d0-8aec7336fec8"
] | bgmod@d519a5cf-78fe-0310-83d0-8aec7336fec8 |
402787296975a36267f52e22e1854177c843e155 | b92919b31f053842ffcd2cb80724e2c5fe14fa46 | /!_32bit_Stride_ADD_STRIGNS/marc/marc_INIT.cpp | 0fbb67a75c1ff0978c92c2149462a5bf558f354d | [] | no_license | marcclintdion/6_PERSPECTIVE_SHADOW_CONFIG_07 | 40159088466509ce2ad052a8ad080cc9ed682b2a | 8bd02b33946bedcc81e4162475c14442b2c7edee | refs/heads/master | 2020-05-22T13:58:21.453173 | 2015-09-18T11:20:11 | 2015-09-18T11:20:11 | 42,717,232 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,299 | cpp | //------------------------------------------------------------------------------------------
#ifdef __APPLE__
//---------------
filePathName = [[NSBundle mainBundle] pathForResource:@"marc_DOT3.png"];
if(filePathName != nil)
{
image = imgLoadImage([filePathName cStringUsingEncoding:NSASCIIStringEncoding]);
glGenTextures(1, &marc_NORMALMAP);
glBindTexture(GL_TEXTURE_2D, marc_NORMALMAP);
ConfigureAndLoadTexture(image->data, image->width, image->height );
imgDestroyImage(image);
filePathName = nil;
}else
{
//add error file output here
}
//---------------------
filePathName = [[NSBundle mainBundle] pathForResource:@"marc" ofType:@"png"];
if(filePathName != nil)
{
image = imgLoadImage([filePathName cStringUsingEncoding:NSASCIIStringEncoding]);
glGenTextures(1, &marc_TEXTUREMAP);
glBindTexture(GL_TEXTURE_2D, marc_TEXTUREMAP);
ConfigureAndLoadTexture(image->data, image->width, image->height );
imgDestroyImage(image);
filePathName = nil;
}else
{
//add error file output here
}
//---------------
#endif
//========================================================================
#ifdef __APPLE__
//--------------
spriteImage = [UIImage imageNamed:@"marc_DOT3.png"].CGImage;
width = CGImageGetWidth(spriteImage);
height = CGImageGetHeight(spriteImage);
spriteData = (GLubyte *) calloc(width*height*4, sizeof(GLubyte));
spriteContext = CGBitmapContextCreate(spriteData, width, height, 8, width * 4, CGImageGetColorSpace(spriteImage), kCGImageAlphaNoneSkipLast);
CGContextSetBlendMode(spriteContext, kCGBlendModeCopy);
CGContextTranslateCTM (spriteContext, 0, (float)height);//--FLIP_Y_AXIS
CGContextScaleCTM (spriteContext, 1.0, -1.0); //--FLIP_Y_AXIS
CGContextDrawImage(spriteContext, CGRectMake(0, 0, width, height), spriteImage);
CGContextRelease(spriteContext);
//---------
glGenTextures(1, &marc_NORMALMAP);
glBindTexture(GL_TEXTURE_2D, marc_NORMALMAP);
ConfigureAndLoadTexture(spriteData, width, height);
if(spriteData != NULL)
{
free(spriteData);
}
//----------------------------------------------------------------------------------------------------------
spriteImage = [UIImage imageNamed:@"marc.png"].CGImage;
width = CGImageGetWidth(spriteImage);
height = CGImageGetHeight(spriteImage);
spriteData = (GLubyte *) calloc(width*height*4, sizeof(GLubyte));
spriteContext = CGBitmapContextCreate(spriteData, width, height, 8, width * 4, CGImageGetColorSpace(spriteImage), kCGImageAlphaNoneSkipLast);
CGContextSetBlendMode(spriteContext, kCGBlendModeCopy);
CGContextTranslateCTM (spriteContext, 0, (float)height);//--FLIP_Y_AXIS
CGContextScaleCTM (spriteContext, 1.0, -1.0); //--FLIP_Y_AXIS
CGContextDrawImage(spriteContext, CGRectMake(0, 0, width, height), spriteImage);
CGContextRelease(spriteContext);
//---------
glGenTextures(1, &marc_TEXTUREMAP);
glBindTexture(GL_TEXTURE_2D, marc_TEXTUREMAP);
ConfigureAndLoadTexture(spriteData, width, height);
if(spriteData != NULL)
{
free(spriteData);
}
//----
#endif
//========================================================================
//------------------------------------------------------------------------------------------
#ifdef WIN32
loadTexture("_MODEL_FOLDERS_/marc/marc_DOT3.png", marc_NORMALMAP);
loadTexture("_MODEL_FOLDERS_/marc/marc.png", marc_TEXTUREMAP);
#endif
//------------------------------------------------------------------------------------------------------------//___LOAD_VBO
#include "marc.cpp"
glGenBuffers(1, &marc_VBO);
glBindBuffer(GL_ARRAY_BUFFER, marc_VBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(marc), marc, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
//------------------------------------------------------------------------------------------------------------
#include "marc_INDICES.cpp"
glGenBuffers(1, &marc_INDICES_VBO);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, marc_INDICES_VBO);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(marc_INDICES), marc_INDICES, GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
//------------------------------------------------------------------------------------------------------------
//====================================================================================
marc_boundingBox[0] = -0.262148;
marc_boundingBox[1] = 0.270252;
marc_boundingBox[2] = -0.89838;
marc_boundingBox[3] = 0.902014;
marc_boundingBox[4] = -1.12603;
marc_boundingBox[5] = 0;
//====================================================================================
collisionBoxArray[boxCount][0] = -0.262148;
collisionBoxArray[boxCount][1] = 0.270252;
collisionBoxArray[boxCount][2] = -0.89838;
collisionBoxArray[boxCount][3] = 0.902014;
collisionBoxArray[boxCount][4] = -1.12603;
collisionBoxArray[boxCount][5] = 0;
collisionBoxArray[boxCount][6] = boxCount;
// boxCount++;
| [
"marcclintdion@Marcs-iMac.local"
] | marcclintdion@Marcs-iMac.local |
b5af6f60d2ad3ab439a95e18fc72e7285ecf96d4 | c32ee8ade268240a8064e9b8efdbebfbaa46ddfa | /Libraries/m2sdk/C_XFactoryWorker_TPL_5B2EB7D5.h | d4c37a0c77e1813db18b5b5bb9759d9d358a1a04 | [] | no_license | hopk1nz/maf2mp | 6f65bd4f8114fdeb42f9407a4d158ad97f8d1789 | 814cab57dc713d9ff791dfb2a2abeb6af0e2f5a8 | refs/heads/master | 2021-03-12T23:56:24.336057 | 2015-08-22T13:53:10 | 2015-08-22T13:53:10 | 41,209,355 | 19 | 21 | null | 2015-08-31T05:28:13 | 2015-08-22T13:56:04 | C++ | UTF-8 | C++ | false | false | 494 | h | // auto-generated file (rttidump-exporter by h0pk1nz)
#pragma once
#include <C_XFactory_TPL_0D55566A.h>
/** C_XFactoryWorker<C_StealableAmmoActorAction,int,C_XFactory<C_ActorAction,int,0,X_FactoryLess<int>>> (VTable=0x01E524C8) */
class C_XFactoryWorker_TPL_5B2EB7D5 : public C_XFactory_TPL_0D55566A::C_XFactoryWorkerBase
{
public:
virtual void vfn_0001_D2794E43() = 0;
virtual void vfn_0002_D2794E43() = 0;
virtual void vfn_0003_D2794E43() = 0;
virtual void vfn_0004_D2794E43() = 0;
};
| [
"hopk1nz@gmail.com"
] | hopk1nz@gmail.com |
c3e74be72c2522fcdd2d27756f95bb7552c6affe | 164e709dcf03ce4769c3ba8f874da0666c35bc03 | /RtTpsProtoLib/rt_ms_importfromfile.pb.cc | 0200f35b9e312ec2cf510a1a0619b96bf8fbe15d | [] | no_license | liq07lzucn/tps | b343894bcfd59a71be48bd47d6eff6e010464457 | a3be6dc50c5f9a2ff448ecff3f5df1956e26ad4f | refs/heads/master | 2021-06-23T16:35:01.349523 | 2017-08-30T08:09:02 | 2017-08-30T08:09:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | true | 94,564 | cc | // Generated by the protocol buffer compiler. DO NOT EDIT!
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "rt_ms_importfromfile.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
namespace ms {
namespace proto {
namespace {
const ::google::protobuf::Descriptor* RT_MS_ImportFromFileList_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
RT_MS_ImportFromFileList_reflection_ = NULL;
const ::google::protobuf::Descriptor* RT_MS_ImportFromFileInfo_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
RT_MS_ImportFromFileInfo_reflection_ = NULL;
const ::google::protobuf::Descriptor* RT_MS_CoodrinatePoint_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
RT_MS_CoodrinatePoint_reflection_ = NULL;
const ::google::protobuf::Descriptor* RT_MS_ErrorResult_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
RT_MS_ErrorResult_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_rt_5ftps_5fimportfromfile_2eproto() {
protobuf_AddDesc_rt_5ftps_5fimportfromfile_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"rt_tps_importfromfile.proto");
GOOGLE_CHECK(file != NULL);
RT_MS_ImportFromFileList_descriptor_ = file->message_type(0);
static const int RT_MS_ImportFromFileList_offsets_[10] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, commissionuid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, depth_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, isnormaldepth_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, algtype_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, minaxisx_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, maxaxisx_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, minaxisy_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, maxaxisy_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, objectoperationtype_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, importfromfilelist_),
};
RT_MS_ImportFromFileList_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
RT_MS_ImportFromFileList_descriptor_,
RT_MS_ImportFromFileList::default_instance_,
RT_MS_ImportFromFileList_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileList, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(RT_MS_ImportFromFileList));
RT_MS_ImportFromFileInfo_descriptor_ = file->message_type(1);
static const int RT_MS_ImportFromFileInfo_offsets_[22] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, uid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, isdisplay_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, fieldsize_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, offsetx_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, offsety_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, depth_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, modulation_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, wedgeaccid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, iswedgeaccid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, status_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, algtype_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, parentuid_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, pointlist_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, calpointlist_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, normpointlist_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, normcalpointlist_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, fieldsizex_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, fieldsizey_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, errorresultlist_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, degree_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, wedgeuid_),
};
RT_MS_ImportFromFileInfo_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
RT_MS_ImportFromFileInfo_descriptor_,
RT_MS_ImportFromFileInfo::default_instance_,
RT_MS_ImportFromFileInfo_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ImportFromFileInfo, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(RT_MS_ImportFromFileInfo));
RT_MS_CoodrinatePoint_descriptor_ = file->message_type(2);
static const int RT_MS_CoodrinatePoint_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_CoodrinatePoint, x_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_CoodrinatePoint, y_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_CoodrinatePoint, z_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_CoodrinatePoint, dose_),
};
RT_MS_CoodrinatePoint_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
RT_MS_CoodrinatePoint_descriptor_,
RT_MS_CoodrinatePoint::default_instance_,
RT_MS_CoodrinatePoint_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_CoodrinatePoint, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_CoodrinatePoint, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(RT_MS_CoodrinatePoint));
RT_MS_ErrorResult_descriptor_ = file->message_type(3);
static const int RT_MS_ErrorResult_offsets_[5] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ErrorResult, errorname_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ErrorResult, averageerror_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ErrorResult, maxerror_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ErrorResult, errorlimit_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ErrorResult, failurepoits_),
};
RT_MS_ErrorResult_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
RT_MS_ErrorResult_descriptor_,
RT_MS_ErrorResult::default_instance_,
RT_MS_ErrorResult_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ErrorResult, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RT_MS_ErrorResult, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(RT_MS_ErrorResult));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_rt_5ftps_5fimportfromfile_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
RT_MS_ImportFromFileList_descriptor_, &RT_MS_ImportFromFileList::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
RT_MS_ImportFromFileInfo_descriptor_, &RT_MS_ImportFromFileInfo::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
RT_MS_CoodrinatePoint_descriptor_, &RT_MS_CoodrinatePoint::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
RT_MS_ErrorResult_descriptor_, &RT_MS_ErrorResult::default_instance());
}
} // namespace
void protobuf_ShutdownFile_rt_5ftps_5fimportfromfile_2eproto() {
delete RT_MS_ImportFromFileList::default_instance_;
delete RT_MS_ImportFromFileList_reflection_;
delete RT_MS_ImportFromFileInfo::default_instance_;
delete RT_MS_ImportFromFileInfo_reflection_;
delete RT_MS_CoodrinatePoint::default_instance_;
delete RT_MS_CoodrinatePoint_reflection_;
delete RT_MS_ErrorResult::default_instance_;
delete RT_MS_ErrorResult_reflection_;
}
void protobuf_AddDesc_rt_5ftps_5fimportfromfile_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\033rt_tps_importfromfile.proto\022\010ms.proto\""
"\215\002\n\030RT_MS_ImportFromFileList\022\025\n\rcommissi"
"onUID\030\001 \001(\t\022\r\n\005depth\030\002 \001(\002\022\025\n\risNormalDe"
"pth\030\003 \001(\010\022\017\n\007algType\030\004 \001(\005\022\020\n\010minAxisX\030\005"
" \001(\002\022\020\n\010maxAxisX\030\006 \001(\002\022\020\n\010minAxisY\030\007 \001(\002"
"\022\020\n\010maxAxisY\030\010 \001(\002\022\033\n\023objectoperationtyp"
"e\030\t \001(\t\022>\n\022ImportFromFileList\030\n \003(\0132\".ms"
".proto.RT_MS_ImportFromFileInfo\"\334\004\n\030RT_M"
"S_ImportFromFileInfo\022\013\n\003uID\030\001 \001(\t\022\021\n\tisD"
"isplay\030\002 \001(\010\022\021\n\tfieldSize\030\003 \001(\t\022\014\n\004type\030"
"\004 \001(\005\022\017\n\007offsetX\030\005 \001(\002\022\017\n\007offsetY\030\006 \001(\002\022"
"\r\n\005depth\030\007 \001(\002\022\022\n\nmodulation\030\010 \001(\005\022\022\n\nwe"
"dgeACCID\030\t \001(\t\022\024\n\014isWedgeACCID\030\n \001(\010\022\016\n\006"
"status\030\013 \001(\005\022\017\n\007algType\030\014 \001(\005\022\021\n\tparentu"
"id\030\r \001(\t\0222\n\tpointList\030\016 \003(\0132\037.ms.proto.R"
"T_MS_CoodrinatePoint\0225\n\014calpointList\030\017 \003"
"(\0132\037.ms.proto.RT_MS_CoodrinatePoint\0226\n\rn"
"ormpointList\030\020 \003(\0132\037.ms.proto.RT_MS_Cood"
"rinatePoint\0229\n\020normcalpointList\030\021 \003(\0132\037."
"ms.proto.RT_MS_CoodrinatePoint\022\022\n\nfields"
"izex\030\022 \001(\002\022\022\n\nfieldsizey\030\023 \001(\002\0224\n\017errorR"
"esultList\030\024 \003(\0132\033.ms.proto.RT_MS_ErrorRe"
"sult\022\016\n\006degree\030\025 \001(\002\022\020\n\010wedgeUid\030\026 \001(\t\"F"
"\n\025RT_MS_CoodrinatePoint\022\t\n\001x\030\001 \001(\002\022\t\n\001y\030"
"\002 \001(\002\022\t\n\001z\030\003 \001(\002\022\014\n\004dose\030\004 \001(\002\"x\n\021RT_MS_"
"ErrorResult\022\021\n\terrorName\030\001 \001(\t\022\024\n\014averag"
"eerror\030\002 \001(\002\022\020\n\010maxerror\030\003 \001(\002\022\022\n\nerrorl"
"imit\030\004 \001(\002\022\024\n\014failurepoits\030\005 \001(\002", 1112);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"rt_tps_importfromfile.proto", &protobuf_RegisterTypes);
RT_MS_ImportFromFileList::default_instance_ = new RT_MS_ImportFromFileList();
RT_MS_ImportFromFileInfo::default_instance_ = new RT_MS_ImportFromFileInfo();
RT_MS_CoodrinatePoint::default_instance_ = new RT_MS_CoodrinatePoint();
RT_MS_ErrorResult::default_instance_ = new RT_MS_ErrorResult();
RT_MS_ImportFromFileList::default_instance_->InitAsDefaultInstance();
RT_MS_ImportFromFileInfo::default_instance_->InitAsDefaultInstance();
RT_MS_CoodrinatePoint::default_instance_->InitAsDefaultInstance();
RT_MS_ErrorResult::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_rt_5ftps_5fimportfromfile_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_rt_5ftps_5fimportfromfile_2eproto {
StaticDescriptorInitializer_rt_5ftps_5fimportfromfile_2eproto() {
protobuf_AddDesc_rt_5ftps_5fimportfromfile_2eproto();
}
} static_descriptor_initializer_rt_5ftps_5fimportfromfile_2eproto_;
// ===================================================================
#ifndef _MSC_VER
const int RT_MS_ImportFromFileList::kCommissionUIDFieldNumber;
const int RT_MS_ImportFromFileList::kDepthFieldNumber;
const int RT_MS_ImportFromFileList::kIsNormalDepthFieldNumber;
const int RT_MS_ImportFromFileList::kAlgTypeFieldNumber;
const int RT_MS_ImportFromFileList::kMinAxisXFieldNumber;
const int RT_MS_ImportFromFileList::kMaxAxisXFieldNumber;
const int RT_MS_ImportFromFileList::kMinAxisYFieldNumber;
const int RT_MS_ImportFromFileList::kMaxAxisYFieldNumber;
const int RT_MS_ImportFromFileList::kObjectoperationtypeFieldNumber;
const int RT_MS_ImportFromFileList::kImportFromFileListFieldNumber;
#endif // !_MSC_VER
RT_MS_ImportFromFileList::RT_MS_ImportFromFileList()
: ::google::protobuf::Message() {
SharedCtor();
}
void RT_MS_ImportFromFileList::InitAsDefaultInstance() {
}
RT_MS_ImportFromFileList::RT_MS_ImportFromFileList(const RT_MS_ImportFromFileList& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void RT_MS_ImportFromFileList::SharedCtor() {
_cached_size_ = 0;
commissionuid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
depth_ = 0;
isnormaldepth_ = false;
algtype_ = 0;
minaxisx_ = 0;
maxaxisx_ = 0;
minaxisy_ = 0;
maxaxisy_ = 0;
objectoperationtype_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
RT_MS_ImportFromFileList::~RT_MS_ImportFromFileList() {
SharedDtor();
}
void RT_MS_ImportFromFileList::SharedDtor() {
if (commissionuid_ != &::google::protobuf::internal::kEmptyString) {
delete commissionuid_;
}
if (objectoperationtype_ != &::google::protobuf::internal::kEmptyString) {
delete objectoperationtype_;
}
if (this != default_instance_) {
}
}
void RT_MS_ImportFromFileList::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RT_MS_ImportFromFileList::descriptor() {
protobuf_AssignDescriptorsOnce();
return RT_MS_ImportFromFileList_descriptor_;
}
const RT_MS_ImportFromFileList& RT_MS_ImportFromFileList::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_rt_5ftps_5fimportfromfile_2eproto(); return *default_instance_;
}
RT_MS_ImportFromFileList* RT_MS_ImportFromFileList::default_instance_ = NULL;
RT_MS_ImportFromFileList* RT_MS_ImportFromFileList::New() const {
return new RT_MS_ImportFromFileList;
}
void RT_MS_ImportFromFileList::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (has_commissionuid()) {
if (commissionuid_ != &::google::protobuf::internal::kEmptyString) {
commissionuid_->clear();
}
}
depth_ = 0;
isnormaldepth_ = false;
algtype_ = 0;
minaxisx_ = 0;
maxaxisx_ = 0;
minaxisy_ = 0;
maxaxisy_ = 0;
}
if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
if (has_objectoperationtype()) {
if (objectoperationtype_ != &::google::protobuf::internal::kEmptyString) {
objectoperationtype_->clear();
}
}
}
importfromfilelist_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool RT_MS_ImportFromFileList::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional string commissionUID = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_commissionuid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->commissionuid().data(), this->commissionuid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(21)) goto parse_depth;
break;
}
// optional float depth = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_depth:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &depth_)));
set_has_depth();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(24)) goto parse_isNormalDepth;
break;
}
// optional bool isNormalDepth = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_isNormalDepth:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &isnormaldepth_)));
set_has_isnormaldepth();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(32)) goto parse_algType;
break;
}
// optional int32 algType = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_algType:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &algtype_)));
set_has_algtype();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(45)) goto parse_minAxisX;
break;
}
// optional float minAxisX = 5;
case 5: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_minAxisX:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &minaxisx_)));
set_has_minaxisx();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(53)) goto parse_maxAxisX;
break;
}
// optional float maxAxisX = 6;
case 6: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_maxAxisX:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &maxaxisx_)));
set_has_maxaxisx();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(61)) goto parse_minAxisY;
break;
}
// optional float minAxisY = 7;
case 7: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_minAxisY:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &minaxisy_)));
set_has_minaxisy();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(69)) goto parse_maxAxisY;
break;
}
// optional float maxAxisY = 8;
case 8: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_maxAxisY:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &maxaxisy_)));
set_has_maxaxisy();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(74)) goto parse_objectoperationtype;
break;
}
// optional string objectoperationtype = 9;
case 9: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_objectoperationtype:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_objectoperationtype()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->objectoperationtype().data(), this->objectoperationtype().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(82)) goto parse_ImportFromFileList;
break;
}
// repeated .ms.proto.RT_MS_ImportFromFileInfo ImportFromFileList = 10;
case 10: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_ImportFromFileList:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_importfromfilelist()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(82)) goto parse_ImportFromFileList;
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void RT_MS_ImportFromFileList::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// optional string commissionUID = 1;
if (has_commissionuid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->commissionuid().data(), this->commissionuid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
1, this->commissionuid(), output);
}
// optional float depth = 2;
if (has_depth()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->depth(), output);
}
// optional bool isNormalDepth = 3;
if (has_isnormaldepth()) {
::google::protobuf::internal::WireFormatLite::WriteBool(3, this->isnormaldepth(), output);
}
// optional int32 algType = 4;
if (has_algtype()) {
::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->algtype(), output);
}
// optional float minAxisX = 5;
if (has_minaxisx()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->minaxisx(), output);
}
// optional float maxAxisX = 6;
if (has_maxaxisx()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->maxaxisx(), output);
}
// optional float minAxisY = 7;
if (has_minaxisy()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->minaxisy(), output);
}
// optional float maxAxisY = 8;
if (has_maxaxisy()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(8, this->maxaxisy(), output);
}
// optional string objectoperationtype = 9;
if (has_objectoperationtype()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->objectoperationtype().data(), this->objectoperationtype().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
9, this->objectoperationtype(), output);
}
// repeated .ms.proto.RT_MS_ImportFromFileInfo ImportFromFileList = 10;
for (int i = 0; i < this->importfromfilelist_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
10, this->importfromfilelist(i), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* RT_MS_ImportFromFileList::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// optional string commissionUID = 1;
if (has_commissionuid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->commissionuid().data(), this->commissionuid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->commissionuid(), target);
}
// optional float depth = 2;
if (has_depth()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->depth(), target);
}
// optional bool isNormalDepth = 3;
if (has_isnormaldepth()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->isnormaldepth(), target);
}
// optional int32 algType = 4;
if (has_algtype()) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->algtype(), target);
}
// optional float minAxisX = 5;
if (has_minaxisx()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->minaxisx(), target);
}
// optional float maxAxisX = 6;
if (has_maxaxisx()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->maxaxisx(), target);
}
// optional float minAxisY = 7;
if (has_minaxisy()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->minaxisy(), target);
}
// optional float maxAxisY = 8;
if (has_maxaxisy()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(8, this->maxaxisy(), target);
}
// optional string objectoperationtype = 9;
if (has_objectoperationtype()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->objectoperationtype().data(), this->objectoperationtype().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
9, this->objectoperationtype(), target);
}
// repeated .ms.proto.RT_MS_ImportFromFileInfo ImportFromFileList = 10;
for (int i = 0; i < this->importfromfilelist_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
10, this->importfromfilelist(i), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int RT_MS_ImportFromFileList::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// optional string commissionUID = 1;
if (has_commissionuid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->commissionuid());
}
// optional float depth = 2;
if (has_depth()) {
total_size += 1 + 4;
}
// optional bool isNormalDepth = 3;
if (has_isnormaldepth()) {
total_size += 1 + 1;
}
// optional int32 algType = 4;
if (has_algtype()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->algtype());
}
// optional float minAxisX = 5;
if (has_minaxisx()) {
total_size += 1 + 4;
}
// optional float maxAxisX = 6;
if (has_maxaxisx()) {
total_size += 1 + 4;
}
// optional float minAxisY = 7;
if (has_minaxisy()) {
total_size += 1 + 4;
}
// optional float maxAxisY = 8;
if (has_maxaxisy()) {
total_size += 1 + 4;
}
}
if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
// optional string objectoperationtype = 9;
if (has_objectoperationtype()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->objectoperationtype());
}
}
// repeated .ms.proto.RT_MS_ImportFromFileInfo ImportFromFileList = 10;
total_size += 1 * this->importfromfilelist_size();
for (int i = 0; i < this->importfromfilelist_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->importfromfilelist(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void RT_MS_ImportFromFileList::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const RT_MS_ImportFromFileList* source =
::google::protobuf::internal::dynamic_cast_if_available<const RT_MS_ImportFromFileList*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void RT_MS_ImportFromFileList::MergeFrom(const RT_MS_ImportFromFileList& from) {
GOOGLE_CHECK_NE(&from, this);
importfromfilelist_.MergeFrom(from.importfromfilelist_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_commissionuid()) {
set_commissionuid(from.commissionuid());
}
if (from.has_depth()) {
set_depth(from.depth());
}
if (from.has_isnormaldepth()) {
set_isnormaldepth(from.isnormaldepth());
}
if (from.has_algtype()) {
set_algtype(from.algtype());
}
if (from.has_minaxisx()) {
set_minaxisx(from.minaxisx());
}
if (from.has_maxaxisx()) {
set_maxaxisx(from.maxaxisx());
}
if (from.has_minaxisy()) {
set_minaxisy(from.minaxisy());
}
if (from.has_maxaxisy()) {
set_maxaxisy(from.maxaxisy());
}
}
if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
if (from.has_objectoperationtype()) {
set_objectoperationtype(from.objectoperationtype());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void RT_MS_ImportFromFileList::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RT_MS_ImportFromFileList::CopyFrom(const RT_MS_ImportFromFileList& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RT_MS_ImportFromFileList::IsInitialized() const {
return true;
}
void RT_MS_ImportFromFileList::Swap(RT_MS_ImportFromFileList* other) {
if (other != this) {
std::swap(commissionuid_, other->commissionuid_);
std::swap(depth_, other->depth_);
std::swap(isnormaldepth_, other->isnormaldepth_);
std::swap(algtype_, other->algtype_);
std::swap(minaxisx_, other->minaxisx_);
std::swap(maxaxisx_, other->maxaxisx_);
std::swap(minaxisy_, other->minaxisy_);
std::swap(maxaxisy_, other->maxaxisy_);
std::swap(objectoperationtype_, other->objectoperationtype_);
importfromfilelist_.Swap(&other->importfromfilelist_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata RT_MS_ImportFromFileList::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = RT_MS_ImportFromFileList_descriptor_;
metadata.reflection = RT_MS_ImportFromFileList_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int RT_MS_ImportFromFileInfo::kUIDFieldNumber;
const int RT_MS_ImportFromFileInfo::kIsDisplayFieldNumber;
const int RT_MS_ImportFromFileInfo::kFieldSizeFieldNumber;
const int RT_MS_ImportFromFileInfo::kTypeFieldNumber;
const int RT_MS_ImportFromFileInfo::kOffsetXFieldNumber;
const int RT_MS_ImportFromFileInfo::kOffsetYFieldNumber;
const int RT_MS_ImportFromFileInfo::kDepthFieldNumber;
const int RT_MS_ImportFromFileInfo::kModulationFieldNumber;
const int RT_MS_ImportFromFileInfo::kWedgeACCIDFieldNumber;
const int RT_MS_ImportFromFileInfo::kIsWedgeACCIDFieldNumber;
const int RT_MS_ImportFromFileInfo::kStatusFieldNumber;
const int RT_MS_ImportFromFileInfo::kAlgTypeFieldNumber;
const int RT_MS_ImportFromFileInfo::kParentuidFieldNumber;
const int RT_MS_ImportFromFileInfo::kPointListFieldNumber;
const int RT_MS_ImportFromFileInfo::kCalpointListFieldNumber;
const int RT_MS_ImportFromFileInfo::kNormpointListFieldNumber;
const int RT_MS_ImportFromFileInfo::kNormcalpointListFieldNumber;
const int RT_MS_ImportFromFileInfo::kFieldsizexFieldNumber;
const int RT_MS_ImportFromFileInfo::kFieldsizeyFieldNumber;
const int RT_MS_ImportFromFileInfo::kErrorResultListFieldNumber;
const int RT_MS_ImportFromFileInfo::kDegreeFieldNumber;
const int RT_MS_ImportFromFileInfo::kWedgeUidFieldNumber;
#endif // !_MSC_VER
RT_MS_ImportFromFileInfo::RT_MS_ImportFromFileInfo()
: ::google::protobuf::Message() {
SharedCtor();
}
void RT_MS_ImportFromFileInfo::InitAsDefaultInstance() {
}
RT_MS_ImportFromFileInfo::RT_MS_ImportFromFileInfo(const RT_MS_ImportFromFileInfo& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void RT_MS_ImportFromFileInfo::SharedCtor() {
_cached_size_ = 0;
uid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
isdisplay_ = false;
fieldsize_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
type_ = 0;
offsetx_ = 0;
offsety_ = 0;
depth_ = 0;
modulation_ = 0;
wedgeaccid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
iswedgeaccid_ = false;
status_ = 0;
algtype_ = 0;
parentuid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
fieldsizex_ = 0;
fieldsizey_ = 0;
degree_ = 0;
wedgeuid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
RT_MS_ImportFromFileInfo::~RT_MS_ImportFromFileInfo() {
SharedDtor();
}
void RT_MS_ImportFromFileInfo::SharedDtor() {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
delete uid_;
}
if (fieldsize_ != &::google::protobuf::internal::kEmptyString) {
delete fieldsize_;
}
if (wedgeaccid_ != &::google::protobuf::internal::kEmptyString) {
delete wedgeaccid_;
}
if (parentuid_ != &::google::protobuf::internal::kEmptyString) {
delete parentuid_;
}
if (wedgeuid_ != &::google::protobuf::internal::kEmptyString) {
delete wedgeuid_;
}
if (this != default_instance_) {
}
}
void RT_MS_ImportFromFileInfo::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RT_MS_ImportFromFileInfo::descriptor() {
protobuf_AssignDescriptorsOnce();
return RT_MS_ImportFromFileInfo_descriptor_;
}
const RT_MS_ImportFromFileInfo& RT_MS_ImportFromFileInfo::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_rt_5ftps_5fimportfromfile_2eproto(); return *default_instance_;
}
RT_MS_ImportFromFileInfo* RT_MS_ImportFromFileInfo::default_instance_ = NULL;
RT_MS_ImportFromFileInfo* RT_MS_ImportFromFileInfo::New() const {
return new RT_MS_ImportFromFileInfo;
}
void RT_MS_ImportFromFileInfo::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (has_uid()) {
if (uid_ != &::google::protobuf::internal::kEmptyString) {
uid_->clear();
}
}
isdisplay_ = false;
if (has_fieldsize()) {
if (fieldsize_ != &::google::protobuf::internal::kEmptyString) {
fieldsize_->clear();
}
}
type_ = 0;
offsetx_ = 0;
offsety_ = 0;
depth_ = 0;
modulation_ = 0;
}
if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
if (has_wedgeaccid()) {
if (wedgeaccid_ != &::google::protobuf::internal::kEmptyString) {
wedgeaccid_->clear();
}
}
iswedgeaccid_ = false;
status_ = 0;
algtype_ = 0;
if (has_parentuid()) {
if (parentuid_ != &::google::protobuf::internal::kEmptyString) {
parentuid_->clear();
}
}
}
if (_has_bits_[17 / 32] & (0xffu << (17 % 32))) {
fieldsizex_ = 0;
fieldsizey_ = 0;
degree_ = 0;
if (has_wedgeuid()) {
if (wedgeuid_ != &::google::protobuf::internal::kEmptyString) {
wedgeuid_->clear();
}
}
}
pointlist_.Clear();
calpointlist_.Clear();
normpointlist_.Clear();
normcalpointlist_.Clear();
errorresultlist_.Clear();
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool RT_MS_ImportFromFileInfo::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional string uID = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_uid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(16)) goto parse_isDisplay;
break;
}
// optional bool isDisplay = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_isDisplay:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &isdisplay_)));
set_has_isdisplay();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(26)) goto parse_fieldSize;
break;
}
// optional string fieldSize = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_fieldSize:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_fieldsize()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->fieldsize().data(), this->fieldsize().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(32)) goto parse_type;
break;
}
// optional int32 type = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_type:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &type_)));
set_has_type();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(45)) goto parse_offsetX;
break;
}
// optional float offsetX = 5;
case 5: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_offsetX:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &offsetx_)));
set_has_offsetx();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(53)) goto parse_offsetY;
break;
}
// optional float offsetY = 6;
case 6: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_offsetY:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &offsety_)));
set_has_offsety();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(61)) goto parse_depth;
break;
}
// optional float depth = 7;
case 7: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_depth:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &depth_)));
set_has_depth();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(64)) goto parse_modulation;
break;
}
// optional int32 modulation = 8;
case 8: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_modulation:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &modulation_)));
set_has_modulation();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(74)) goto parse_wedgeACCID;
break;
}
// optional string wedgeACCID = 9;
case 9: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_wedgeACCID:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_wedgeaccid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->wedgeaccid().data(), this->wedgeaccid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(80)) goto parse_isWedgeACCID;
break;
}
// optional bool isWedgeACCID = 10;
case 10: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_isWedgeACCID:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
input, &iswedgeaccid_)));
set_has_iswedgeaccid();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(88)) goto parse_status;
break;
}
// optional int32 status = 11;
case 11: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_status:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &status_)));
set_has_status();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(96)) goto parse_algType;
break;
}
// optional int32 algType = 12;
case 12: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_algType:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
input, &algtype_)));
set_has_algtype();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(106)) goto parse_parentuid;
break;
}
// optional string parentuid = 13;
case 13: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_parentuid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_parentuid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->parentuid().data(), this->parentuid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(114)) goto parse_pointList;
break;
}
// repeated .ms.proto.RT_MS_CoodrinatePoint pointList = 14;
case 14: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_pointList:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_pointlist()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(114)) goto parse_pointList;
if (input->ExpectTag(122)) goto parse_calpointList;
break;
}
// repeated .ms.proto.RT_MS_CoodrinatePoint calpointList = 15;
case 15: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_calpointList:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_calpointlist()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(122)) goto parse_calpointList;
if (input->ExpectTag(130)) goto parse_normpointList;
break;
}
// repeated .ms.proto.RT_MS_CoodrinatePoint normpointList = 16;
case 16: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_normpointList:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_normpointlist()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(130)) goto parse_normpointList;
if (input->ExpectTag(138)) goto parse_normcalpointList;
break;
}
// repeated .ms.proto.RT_MS_CoodrinatePoint normcalpointList = 17;
case 17: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_normcalpointList:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_normcalpointlist()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(138)) goto parse_normcalpointList;
if (input->ExpectTag(149)) goto parse_fieldsizex;
break;
}
// optional float fieldsizex = 18;
case 18: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_fieldsizex:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &fieldsizex_)));
set_has_fieldsizex();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(157)) goto parse_fieldsizey;
break;
}
// optional float fieldsizey = 19;
case 19: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_fieldsizey:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &fieldsizey_)));
set_has_fieldsizey();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(162)) goto parse_errorResultList;
break;
}
// repeated .ms.proto.RT_MS_ErrorResult errorResultList = 20;
case 20: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_errorResultList:
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, add_errorresultlist()));
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(162)) goto parse_errorResultList;
if (input->ExpectTag(173)) goto parse_degree;
break;
}
// optional float degree = 21;
case 21: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_degree:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, °ree_)));
set_has_degree();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(178)) goto parse_wedgeUid;
break;
}
// optional string wedgeUid = 22;
case 22: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
parse_wedgeUid:
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_wedgeuid()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->wedgeuid().data(), this->wedgeuid().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void RT_MS_ImportFromFileInfo::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// optional string uID = 1;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
1, this->uid(), output);
}
// optional bool isDisplay = 2;
if (has_isdisplay()) {
::google::protobuf::internal::WireFormatLite::WriteBool(2, this->isdisplay(), output);
}
// optional string fieldSize = 3;
if (has_fieldsize()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->fieldsize().data(), this->fieldsize().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->fieldsize(), output);
}
// optional int32 type = 4;
if (has_type()) {
::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->type(), output);
}
// optional float offsetX = 5;
if (has_offsetx()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->offsetx(), output);
}
// optional float offsetY = 6;
if (has_offsety()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(6, this->offsety(), output);
}
// optional float depth = 7;
if (has_depth()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(7, this->depth(), output);
}
// optional int32 modulation = 8;
if (has_modulation()) {
::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->modulation(), output);
}
// optional string wedgeACCID = 9;
if (has_wedgeaccid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->wedgeaccid().data(), this->wedgeaccid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
9, this->wedgeaccid(), output);
}
// optional bool isWedgeACCID = 10;
if (has_iswedgeaccid()) {
::google::protobuf::internal::WireFormatLite::WriteBool(10, this->iswedgeaccid(), output);
}
// optional int32 status = 11;
if (has_status()) {
::google::protobuf::internal::WireFormatLite::WriteInt32(11, this->status(), output);
}
// optional int32 algType = 12;
if (has_algtype()) {
::google::protobuf::internal::WireFormatLite::WriteInt32(12, this->algtype(), output);
}
// optional string parentuid = 13;
if (has_parentuid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->parentuid().data(), this->parentuid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
13, this->parentuid(), output);
}
// repeated .ms.proto.RT_MS_CoodrinatePoint pointList = 14;
for (int i = 0; i < this->pointlist_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
14, this->pointlist(i), output);
}
// repeated .ms.proto.RT_MS_CoodrinatePoint calpointList = 15;
for (int i = 0; i < this->calpointlist_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
15, this->calpointlist(i), output);
}
// repeated .ms.proto.RT_MS_CoodrinatePoint normpointList = 16;
for (int i = 0; i < this->normpointlist_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
16, this->normpointlist(i), output);
}
// repeated .ms.proto.RT_MS_CoodrinatePoint normcalpointList = 17;
for (int i = 0; i < this->normcalpointlist_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
17, this->normcalpointlist(i), output);
}
// optional float fieldsizex = 18;
if (has_fieldsizex()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(18, this->fieldsizex(), output);
}
// optional float fieldsizey = 19;
if (has_fieldsizey()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(19, this->fieldsizey(), output);
}
// repeated .ms.proto.RT_MS_ErrorResult errorResultList = 20;
for (int i = 0; i < this->errorresultlist_size(); i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
20, this->errorresultlist(i), output);
}
// optional float degree = 21;
if (has_degree()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(21, this->degree(), output);
}
// optional string wedgeUid = 22;
if (has_wedgeuid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->wedgeuid().data(), this->wedgeuid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
22, this->wedgeuid(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* RT_MS_ImportFromFileInfo::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// optional string uID = 1;
if (has_uid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->uid().data(), this->uid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->uid(), target);
}
// optional bool isDisplay = 2;
if (has_isdisplay()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->isdisplay(), target);
}
// optional string fieldSize = 3;
if (has_fieldsize()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->fieldsize().data(), this->fieldsize().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
3, this->fieldsize(), target);
}
// optional int32 type = 4;
if (has_type()) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->type(), target);
}
// optional float offsetX = 5;
if (has_offsetx()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->offsetx(), target);
}
// optional float offsetY = 6;
if (has_offsety()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(6, this->offsety(), target);
}
// optional float depth = 7;
if (has_depth()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(7, this->depth(), target);
}
// optional int32 modulation = 8;
if (has_modulation()) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->modulation(), target);
}
// optional string wedgeACCID = 9;
if (has_wedgeaccid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->wedgeaccid().data(), this->wedgeaccid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
9, this->wedgeaccid(), target);
}
// optional bool isWedgeACCID = 10;
if (has_iswedgeaccid()) {
target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->iswedgeaccid(), target);
}
// optional int32 status = 11;
if (has_status()) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(11, this->status(), target);
}
// optional int32 algType = 12;
if (has_algtype()) {
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(12, this->algtype(), target);
}
// optional string parentuid = 13;
if (has_parentuid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->parentuid().data(), this->parentuid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
13, this->parentuid(), target);
}
// repeated .ms.proto.RT_MS_CoodrinatePoint pointList = 14;
for (int i = 0; i < this->pointlist_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
14, this->pointlist(i), target);
}
// repeated .ms.proto.RT_MS_CoodrinatePoint calpointList = 15;
for (int i = 0; i < this->calpointlist_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
15, this->calpointlist(i), target);
}
// repeated .ms.proto.RT_MS_CoodrinatePoint normpointList = 16;
for (int i = 0; i < this->normpointlist_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
16, this->normpointlist(i), target);
}
// repeated .ms.proto.RT_MS_CoodrinatePoint normcalpointList = 17;
for (int i = 0; i < this->normcalpointlist_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
17, this->normcalpointlist(i), target);
}
// optional float fieldsizex = 18;
if (has_fieldsizex()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(18, this->fieldsizex(), target);
}
// optional float fieldsizey = 19;
if (has_fieldsizey()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(19, this->fieldsizey(), target);
}
// repeated .ms.proto.RT_MS_ErrorResult errorResultList = 20;
for (int i = 0; i < this->errorresultlist_size(); i++) {
target = ::google::protobuf::internal::WireFormatLite::
WriteMessageNoVirtualToArray(
20, this->errorresultlist(i), target);
}
// optional float degree = 21;
if (has_degree()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(21, this->degree(), target);
}
// optional string wedgeUid = 22;
if (has_wedgeuid()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->wedgeuid().data(), this->wedgeuid().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
22, this->wedgeuid(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int RT_MS_ImportFromFileInfo::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// optional string uID = 1;
if (has_uid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->uid());
}
// optional bool isDisplay = 2;
if (has_isdisplay()) {
total_size += 1 + 1;
}
// optional string fieldSize = 3;
if (has_fieldsize()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->fieldsize());
}
// optional int32 type = 4;
if (has_type()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->type());
}
// optional float offsetX = 5;
if (has_offsetx()) {
total_size += 1 + 4;
}
// optional float offsetY = 6;
if (has_offsety()) {
total_size += 1 + 4;
}
// optional float depth = 7;
if (has_depth()) {
total_size += 1 + 4;
}
// optional int32 modulation = 8;
if (has_modulation()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->modulation());
}
}
if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
// optional string wedgeACCID = 9;
if (has_wedgeaccid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->wedgeaccid());
}
// optional bool isWedgeACCID = 10;
if (has_iswedgeaccid()) {
total_size += 1 + 1;
}
// optional int32 status = 11;
if (has_status()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->status());
}
// optional int32 algType = 12;
if (has_algtype()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::Int32Size(
this->algtype());
}
// optional string parentuid = 13;
if (has_parentuid()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->parentuid());
}
}
if (_has_bits_[17 / 32] & (0xffu << (17 % 32))) {
// optional float fieldsizex = 18;
if (has_fieldsizex()) {
total_size += 2 + 4;
}
// optional float fieldsizey = 19;
if (has_fieldsizey()) {
total_size += 2 + 4;
}
// optional float degree = 21;
if (has_degree()) {
total_size += 2 + 4;
}
// optional string wedgeUid = 22;
if (has_wedgeuid()) {
total_size += 2 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->wedgeuid());
}
}
// repeated .ms.proto.RT_MS_CoodrinatePoint pointList = 14;
total_size += 1 * this->pointlist_size();
for (int i = 0; i < this->pointlist_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->pointlist(i));
}
// repeated .ms.proto.RT_MS_CoodrinatePoint calpointList = 15;
total_size += 1 * this->calpointlist_size();
for (int i = 0; i < this->calpointlist_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->calpointlist(i));
}
// repeated .ms.proto.RT_MS_CoodrinatePoint normpointList = 16;
total_size += 2 * this->normpointlist_size();
for (int i = 0; i < this->normpointlist_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->normpointlist(i));
}
// repeated .ms.proto.RT_MS_CoodrinatePoint normcalpointList = 17;
total_size += 2 * this->normcalpointlist_size();
for (int i = 0; i < this->normcalpointlist_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->normcalpointlist(i));
}
// repeated .ms.proto.RT_MS_ErrorResult errorResultList = 20;
total_size += 2 * this->errorresultlist_size();
for (int i = 0; i < this->errorresultlist_size(); i++) {
total_size +=
::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
this->errorresultlist(i));
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void RT_MS_ImportFromFileInfo::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const RT_MS_ImportFromFileInfo* source =
::google::protobuf::internal::dynamic_cast_if_available<const RT_MS_ImportFromFileInfo*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void RT_MS_ImportFromFileInfo::MergeFrom(const RT_MS_ImportFromFileInfo& from) {
GOOGLE_CHECK_NE(&from, this);
pointlist_.MergeFrom(from.pointlist_);
calpointlist_.MergeFrom(from.calpointlist_);
normpointlist_.MergeFrom(from.normpointlist_);
normcalpointlist_.MergeFrom(from.normcalpointlist_);
errorresultlist_.MergeFrom(from.errorresultlist_);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_uid()) {
set_uid(from.uid());
}
if (from.has_isdisplay()) {
set_isdisplay(from.isdisplay());
}
if (from.has_fieldsize()) {
set_fieldsize(from.fieldsize());
}
if (from.has_type()) {
set_type(from.type());
}
if (from.has_offsetx()) {
set_offsetx(from.offsetx());
}
if (from.has_offsety()) {
set_offsety(from.offsety());
}
if (from.has_depth()) {
set_depth(from.depth());
}
if (from.has_modulation()) {
set_modulation(from.modulation());
}
}
if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
if (from.has_wedgeaccid()) {
set_wedgeaccid(from.wedgeaccid());
}
if (from.has_iswedgeaccid()) {
set_iswedgeaccid(from.iswedgeaccid());
}
if (from.has_status()) {
set_status(from.status());
}
if (from.has_algtype()) {
set_algtype(from.algtype());
}
if (from.has_parentuid()) {
set_parentuid(from.parentuid());
}
}
if (from._has_bits_[17 / 32] & (0xffu << (17 % 32))) {
if (from.has_fieldsizex()) {
set_fieldsizex(from.fieldsizex());
}
if (from.has_fieldsizey()) {
set_fieldsizey(from.fieldsizey());
}
if (from.has_degree()) {
set_degree(from.degree());
}
if (from.has_wedgeuid()) {
set_wedgeuid(from.wedgeuid());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void RT_MS_ImportFromFileInfo::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RT_MS_ImportFromFileInfo::CopyFrom(const RT_MS_ImportFromFileInfo& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RT_MS_ImportFromFileInfo::IsInitialized() const {
return true;
}
void RT_MS_ImportFromFileInfo::Swap(RT_MS_ImportFromFileInfo* other) {
if (other != this) {
std::swap(uid_, other->uid_);
std::swap(isdisplay_, other->isdisplay_);
std::swap(fieldsize_, other->fieldsize_);
std::swap(type_, other->type_);
std::swap(offsetx_, other->offsetx_);
std::swap(offsety_, other->offsety_);
std::swap(depth_, other->depth_);
std::swap(modulation_, other->modulation_);
std::swap(wedgeaccid_, other->wedgeaccid_);
std::swap(iswedgeaccid_, other->iswedgeaccid_);
std::swap(status_, other->status_);
std::swap(algtype_, other->algtype_);
std::swap(parentuid_, other->parentuid_);
pointlist_.Swap(&other->pointlist_);
calpointlist_.Swap(&other->calpointlist_);
normpointlist_.Swap(&other->normpointlist_);
normcalpointlist_.Swap(&other->normcalpointlist_);
std::swap(fieldsizex_, other->fieldsizex_);
std::swap(fieldsizey_, other->fieldsizey_);
errorresultlist_.Swap(&other->errorresultlist_);
std::swap(degree_, other->degree_);
std::swap(wedgeuid_, other->wedgeuid_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata RT_MS_ImportFromFileInfo::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = RT_MS_ImportFromFileInfo_descriptor_;
metadata.reflection = RT_MS_ImportFromFileInfo_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int RT_MS_CoodrinatePoint::kXFieldNumber;
const int RT_MS_CoodrinatePoint::kYFieldNumber;
const int RT_MS_CoodrinatePoint::kZFieldNumber;
const int RT_MS_CoodrinatePoint::kDoseFieldNumber;
#endif // !_MSC_VER
RT_MS_CoodrinatePoint::RT_MS_CoodrinatePoint()
: ::google::protobuf::Message() {
SharedCtor();
}
void RT_MS_CoodrinatePoint::InitAsDefaultInstance() {
}
RT_MS_CoodrinatePoint::RT_MS_CoodrinatePoint(const RT_MS_CoodrinatePoint& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void RT_MS_CoodrinatePoint::SharedCtor() {
_cached_size_ = 0;
x_ = 0;
y_ = 0;
z_ = 0;
dose_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
RT_MS_CoodrinatePoint::~RT_MS_CoodrinatePoint() {
SharedDtor();
}
void RT_MS_CoodrinatePoint::SharedDtor() {
if (this != default_instance_) {
}
}
void RT_MS_CoodrinatePoint::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RT_MS_CoodrinatePoint::descriptor() {
protobuf_AssignDescriptorsOnce();
return RT_MS_CoodrinatePoint_descriptor_;
}
const RT_MS_CoodrinatePoint& RT_MS_CoodrinatePoint::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_rt_5ftps_5fimportfromfile_2eproto(); return *default_instance_;
}
RT_MS_CoodrinatePoint* RT_MS_CoodrinatePoint::default_instance_ = NULL;
RT_MS_CoodrinatePoint* RT_MS_CoodrinatePoint::New() const {
return new RT_MS_CoodrinatePoint;
}
void RT_MS_CoodrinatePoint::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
x_ = 0;
y_ = 0;
z_ = 0;
dose_ = 0;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool RT_MS_CoodrinatePoint::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional float x = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &x_)));
set_has_x();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(21)) goto parse_y;
break;
}
// optional float y = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_y:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &y_)));
set_has_y();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(29)) goto parse_z;
break;
}
// optional float z = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_z:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &z_)));
set_has_z();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(37)) goto parse_dose;
break;
}
// optional float dose = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_dose:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &dose_)));
set_has_dose();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void RT_MS_CoodrinatePoint::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// optional float x = 1;
if (has_x()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(1, this->x(), output);
}
// optional float y = 2;
if (has_y()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->y(), output);
}
// optional float z = 3;
if (has_z()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->z(), output);
}
// optional float dose = 4;
if (has_dose()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->dose(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* RT_MS_CoodrinatePoint::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// optional float x = 1;
if (has_x()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(1, this->x(), target);
}
// optional float y = 2;
if (has_y()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->y(), target);
}
// optional float z = 3;
if (has_z()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->z(), target);
}
// optional float dose = 4;
if (has_dose()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->dose(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int RT_MS_CoodrinatePoint::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// optional float x = 1;
if (has_x()) {
total_size += 1 + 4;
}
// optional float y = 2;
if (has_y()) {
total_size += 1 + 4;
}
// optional float z = 3;
if (has_z()) {
total_size += 1 + 4;
}
// optional float dose = 4;
if (has_dose()) {
total_size += 1 + 4;
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void RT_MS_CoodrinatePoint::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const RT_MS_CoodrinatePoint* source =
::google::protobuf::internal::dynamic_cast_if_available<const RT_MS_CoodrinatePoint*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void RT_MS_CoodrinatePoint::MergeFrom(const RT_MS_CoodrinatePoint& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_x()) {
set_x(from.x());
}
if (from.has_y()) {
set_y(from.y());
}
if (from.has_z()) {
set_z(from.z());
}
if (from.has_dose()) {
set_dose(from.dose());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void RT_MS_CoodrinatePoint::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RT_MS_CoodrinatePoint::CopyFrom(const RT_MS_CoodrinatePoint& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RT_MS_CoodrinatePoint::IsInitialized() const {
return true;
}
void RT_MS_CoodrinatePoint::Swap(RT_MS_CoodrinatePoint* other) {
if (other != this) {
std::swap(x_, other->x_);
std::swap(y_, other->y_);
std::swap(z_, other->z_);
std::swap(dose_, other->dose_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata RT_MS_CoodrinatePoint::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = RT_MS_CoodrinatePoint_descriptor_;
metadata.reflection = RT_MS_CoodrinatePoint_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
const int RT_MS_ErrorResult::kErrorNameFieldNumber;
const int RT_MS_ErrorResult::kAverageerrorFieldNumber;
const int RT_MS_ErrorResult::kMaxerrorFieldNumber;
const int RT_MS_ErrorResult::kErrorlimitFieldNumber;
const int RT_MS_ErrorResult::kFailurepoitsFieldNumber;
#endif // !_MSC_VER
RT_MS_ErrorResult::RT_MS_ErrorResult()
: ::google::protobuf::Message() {
SharedCtor();
}
void RT_MS_ErrorResult::InitAsDefaultInstance() {
}
RT_MS_ErrorResult::RT_MS_ErrorResult(const RT_MS_ErrorResult& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void RT_MS_ErrorResult::SharedCtor() {
_cached_size_ = 0;
errorname_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
averageerror_ = 0;
maxerror_ = 0;
errorlimit_ = 0;
failurepoits_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
RT_MS_ErrorResult::~RT_MS_ErrorResult() {
SharedDtor();
}
void RT_MS_ErrorResult::SharedDtor() {
if (errorname_ != &::google::protobuf::internal::kEmptyString) {
delete errorname_;
}
if (this != default_instance_) {
}
}
void RT_MS_ErrorResult::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RT_MS_ErrorResult::descriptor() {
protobuf_AssignDescriptorsOnce();
return RT_MS_ErrorResult_descriptor_;
}
const RT_MS_ErrorResult& RT_MS_ErrorResult::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_rt_5ftps_5fimportfromfile_2eproto(); return *default_instance_;
}
RT_MS_ErrorResult* RT_MS_ErrorResult::default_instance_ = NULL;
RT_MS_ErrorResult* RT_MS_ErrorResult::New() const {
return new RT_MS_ErrorResult;
}
void RT_MS_ErrorResult::Clear() {
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (has_errorname()) {
if (errorname_ != &::google::protobuf::internal::kEmptyString) {
errorname_->clear();
}
}
averageerror_ = 0;
maxerror_ = 0;
errorlimit_ = 0;
failurepoits_ = 0;
}
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool RT_MS_ErrorResult::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// optional string errorName = 1;
case 1: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
input, this->mutable_errorname()));
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->errorname().data(), this->errorname().length(),
::google::protobuf::internal::WireFormat::PARSE);
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(21)) goto parse_averageerror;
break;
}
// optional float averageerror = 2;
case 2: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_averageerror:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &averageerror_)));
set_has_averageerror();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(29)) goto parse_maxerror;
break;
}
// optional float maxerror = 3;
case 3: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_maxerror:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &maxerror_)));
set_has_maxerror();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(37)) goto parse_errorlimit;
break;
}
// optional float errorlimit = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_errorlimit:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &errorlimit_)));
set_has_errorlimit();
} else {
goto handle_uninterpreted;
}
if (input->ExpectTag(45)) goto parse_failurepoits;
break;
}
// optional float failurepoits = 5;
case 5: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
parse_failurepoits:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
input, &failurepoits_)));
set_has_failurepoits();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true;
break;
}
default: {
handle_uninterpreted:
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
break;
}
}
}
return true;
#undef DO_
}
void RT_MS_ErrorResult::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// optional string errorName = 1;
if (has_errorname()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->errorname().data(), this->errorname().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
::google::protobuf::internal::WireFormatLite::WriteString(
1, this->errorname(), output);
}
// optional float averageerror = 2;
if (has_averageerror()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(2, this->averageerror(), output);
}
// optional float maxerror = 3;
if (has_maxerror()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(3, this->maxerror(), output);
}
// optional float errorlimit = 4;
if (has_errorlimit()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->errorlimit(), output);
}
// optional float failurepoits = 5;
if (has_failurepoits()) {
::google::protobuf::internal::WireFormatLite::WriteFloat(5, this->failurepoits(), output);
}
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* RT_MS_ErrorResult::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
// optional string errorName = 1;
if (has_errorname()) {
::google::protobuf::internal::WireFormat::VerifyUTF8String(
this->errorname().data(), this->errorname().length(),
::google::protobuf::internal::WireFormat::SERIALIZE);
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->errorname(), target);
}
// optional float averageerror = 2;
if (has_averageerror()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(2, this->averageerror(), target);
}
// optional float maxerror = 3;
if (has_maxerror()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(3, this->maxerror(), target);
}
// optional float errorlimit = 4;
if (has_errorlimit()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->errorlimit(), target);
}
// optional float failurepoits = 5;
if (has_failurepoits()) {
target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(5, this->failurepoits(), target);
}
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int RT_MS_ErrorResult::ByteSize() const {
int total_size = 0;
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
// optional string errorName = 1;
if (has_errorname()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::StringSize(
this->errorname());
}
// optional float averageerror = 2;
if (has_averageerror()) {
total_size += 1 + 4;
}
// optional float maxerror = 3;
if (has_maxerror()) {
total_size += 1 + 4;
}
// optional float errorlimit = 4;
if (has_errorlimit()) {
total_size += 1 + 4;
}
// optional float failurepoits = 5;
if (has_failurepoits()) {
total_size += 1 + 4;
}
}
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void RT_MS_ErrorResult::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const RT_MS_ErrorResult* source =
::google::protobuf::internal::dynamic_cast_if_available<const RT_MS_ErrorResult*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void RT_MS_ErrorResult::MergeFrom(const RT_MS_ErrorResult& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_errorname()) {
set_errorname(from.errorname());
}
if (from.has_averageerror()) {
set_averageerror(from.averageerror());
}
if (from.has_maxerror()) {
set_maxerror(from.maxerror());
}
if (from.has_errorlimit()) {
set_errorlimit(from.errorlimit());
}
if (from.has_failurepoits()) {
set_failurepoits(from.failurepoits());
}
}
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void RT_MS_ErrorResult::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void RT_MS_ErrorResult::CopyFrom(const RT_MS_ErrorResult& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool RT_MS_ErrorResult::IsInitialized() const {
return true;
}
void RT_MS_ErrorResult::Swap(RT_MS_ErrorResult* other) {
if (other != this) {
std::swap(errorname_, other->errorname_);
std::swap(averageerror_, other->averageerror_);
std::swap(maxerror_, other->maxerror_);
std::swap(errorlimit_, other->errorlimit_);
std::swap(failurepoits_, other->failurepoits_);
std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata RT_MS_ErrorResult::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = RT_MS_ErrorResult_descriptor_;
metadata.reflection = RT_MS_ErrorResult_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace proto
} // namespace ms
// @@protoc_insertion_point(global_scope)
| [
"genius52@qq.com"
] | genius52@qq.com |
44af0d187be01f302c65553e0fd9e34dd7300296 | cd3006b1d0970a2f27ac9d9a4040936b64349dbd | /project/1106/imgTool.cpp | 3b307372b19fa1f8ea0386c5a5529a0efb9d4e95 | [] | no_license | jrvstw/homework | 2528194a1b917d290b338bf31fe3a5515a7bf02d | fea8f724465283aec911f4084cd640fa8e3efa5a | refs/heads/master | 2021-01-20T10:21:31.027181 | 2018-11-23T08:21:29 | 2018-11-23T08:21:29 | 90,347,870 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 6,942 | cpp | #include "imgTool.h"
using namespace std;
const QRgb black = 0xFF000000;
const QRgb white = 0xFFFFFFFF;
const QRgb label = 0xFFFFFFFE;
const double pi = 3.1415926;
QImage dwt(QImage source, int level, int width, int height)
{
QImage copy = source.scaled(width, height, Qt::IgnoreAspectRatio);
int m[1024][1024];
for (int y = 0; y < height; y++)
for (int x = 0; x < width; x++)
m[y][x] = qGray(copy.pixel(x, y));
int k = 0;
int a, b, c, d;
for (int i = 0; i < level; i++) {
k = (k == 0)? 1: (k << 1);
for (int y = 0; y < height; y += (k << 1))
for (int x = 0; x < width; x += (k << 1)) {
a = m[y ][x ];
b = m[y ][x + k];
c = m[y + k][x ];
d = m[y + k][x + k];
m[y ][x ] = a + b + c + d;
m[y ][x + k] = a - b + c - d;
m[y + k][x ] = a + b - c - d;
m[y + k][x + k] = a - b - c + d;
}
}
for (int y = 0; y < height; y += (k << 1))
for (int x = 0; x < width; x += (k << 1)) {
m[y ][x ] = 0;
//m[y ][x + k] *= 2;
//m[y + k][x ] *= 2;
//m[y + k][x + k] *= 2;
}
for (int i = 0; i < level; i++) {
for (int y = 0; y < height; y+= (k << 1))
for (int x = 0; x < width; x += (k << 1)) {
a = m[y ][x ];
b = m[y ][x + k];
c = m[y + k][x ];
d = m[y + k][x + k];
m[y ][x ] = (a + b + c + d) >> 2;
m[y ][x + k] = (a - b + c - d) >> 2;
m[y + k][x ] = (a + b - c - d) >> 2;
m[y + k][x + k] = (a - b - c + d) >> 2;
}
k >>= 1;
}
for (int y = 0; y < height; y++)
for (int x = 0; x < width; x++) {
if (-255 <= m[y][x] && m[y][x] <= 0)
m[y][x] = -m[y][x];
else
m[y][x] = 0;
copy.setPixel(x, y, QColor(m[y][x], m[y][x], m[y][x]).rgb());
}
return copy;
}
QImage toBinary(QImage source, float threshold)
{
QImage copy = source;
int thre = (int)(threshold * 255);
for (int y = 0; y < copy.height(); y++)
for (int x = 0; x < copy.width(); x++) {
if (qGray(copy.pixel(x, y)) >= thre)
copy.setPixel(x, y, white);
else
copy.setPixel(x, y, black);
}
return copy;
}
float autoThreshold(QImage source)
{
int histogram[256] = {0};
for (int y = 0; y < source.height(); y++)
for (int x = 0; x < source.width(); x++) {
histogram[ qGray(source.pixel(x, y)) ]++;
}
int threshold = 255;
while(histogram[threshold] == 0)
threshold--;
return threshold * 0.4 / 255;
}
QImage erode(QImage source, int d)
{
QImage extended(source.width() + 2 * d, source.height() + 2 * d,
source.format());
extended.fill(Qt::white);
for (int y = 0; y < source.height(); y++)
for (int x = 0; x < source.width(); x++)
extended.setPixel(x + d, y + d, source.pixel(x, y));
QImage output(source);
output.fill(Qt::white);
for (int y = d; y < source.height() + d; y++)
for (int x = d; x < source.width() + d; x++) {
if (extended.pixel(x , y ) == black ||
extended.pixel(x - 1, y ) == black ||
extended.pixel(x , y - 1) == black ||
extended.pixel(x + 1, y ) == black ||
extended.pixel(x , y + 1) == black)
output.setPixel(x - d, y - d, black);
}
return output;
}
QImage dilate(QImage source, int d)
{
QImage tmp(source);
for (int y = 0; y < source.height(); y++)
for (int x = 0; x < source.width(); x++)
tmp.setPixel(x, y, 0xFFFFFFFF - (0x00FFFFFF & source.pixel(x, y)));
tmp = erode(tmp, d);
for (int y = 0; y < source.height(); y++)
for (int x = 0; x < source.width(); x++)
tmp.setPixel(x, y, 0xFFFFFFFF - (0x00FFFFFF & tmp.pixel(x, y)));
return tmp;
}
void analyze(int x0, int y0, QImage *src, int *area, int *perimeter,
QRect *bBox)
{
queue<QPoint> obj;
obj.push(QPoint(x0, y0));
src->setPixel(x0, y0, black);
while (obj.size() > 0) {
visit(-1, 0, &obj, src, area, perimeter, bBox);
visit( 1, 0, &obj, src, area, perimeter, bBox);
visit( 0, -1, &obj, src, area, perimeter, bBox);
visit( 0, 1, &obj, src, area, perimeter, bBox);
visit(-1, -1, &obj, src, area, perimeter, bBox);
visit(-1, 1, &obj, src, area, perimeter, bBox);
visit( 1, -1, &obj, src, area, perimeter, bBox);
visit( 1, 1, &obj, src, area, perimeter, bBox);
visit( 2, 0, &obj, src, area, perimeter, bBox);
visit( 0, 2, &obj, src, area, perimeter, bBox);
visit(-2, 0, &obj, src, area, perimeter, bBox);
visit( 0, -2, &obj, src, area, perimeter, bBox);
visit( 3, 0, &obj, src, area, perimeter, bBox);
visit( 2, 1, &obj, src, area, perimeter, bBox);
visit( 1, 2, &obj, src, area, perimeter, bBox);
visit( 0, 3, &obj, src, area, perimeter, bBox);
visit(-1, 2, &obj, src, area, perimeter, bBox);
visit(-2, 1, &obj, src, area, perimeter, bBox);
visit(-3, 0, &obj, src, area, perimeter, bBox);
visit(-2, -1, &obj, src, area, perimeter, bBox);
visit(-1, -2, &obj, src, area, perimeter, bBox);
visit( 0, -3, &obj, src, area, perimeter, bBox);
visit( 1, -2, &obj, src, area, perimeter, bBox);
visit( 2, -1, &obj, src, area, perimeter, bBox);
obj.pop();
}
}
void visit(int dx, int dy, queue<QPoint> *obj, QImage *src, int *area,
int *perimeter, QRect *bBox)
{
QPoint p(obj->front().x() + dx,
obj->front().y() + dy);
if (src->rect().contains(p) && src->pixel(p) != black) {
*area = *area + 1;
if (src->pixel(p) == label)
*perimeter = *perimeter + 1;
*bBox = bBox->united(QRect(p, p));
obj->push(p);
src->setPixel(p, black);
}
}
defectType getDefectType(int area, int perimeter, QRect bBox)
{
if (area < 100 ||
bBox.width() > bBox.height() * 3)
return normal;
if (true &&
//area < bBox.width() * bBox.height() * 0.5 &&
perimeter * perimeter > 4 * pi * area * 2
)
return impact;
return normal;
}
void scaleCoords(QRect *bBox, QRect after, QRect before)
{
bBox->setCoords(bBox->left() * after.width() / before.width(),
bBox->top() * after.height() / before.height(),
bBox->right() * after.width() / before.width(),
bBox->bottom() * after.height() / before.height());
}
| [
"ye.jia.wei@outlook.com"
] | ye.jia.wei@outlook.com |
c850b5370227c0ed313289b9935104192b776aa1 | 72278efb45375cff45a253a53e74dc27c7fe6575 | /caffe/include/caffe/layers/filter_layer.hpp | 88f8bd80fc843f06edb76dc85944c6b3133f4155 | [
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"BSD-2-Clause-Views"
] | permissive | psnewer/caffe_openGLES31 | acae523f2d166fb3f8c718f7868491b9dd48a2e9 | f734d6defe8318ced2858739b359eee8de8ef9bc | refs/heads/master | 2021-01-11T12:27:18.971726 | 2016-12-19T11:35:27 | 2016-12-19T11:35:27 | 76,653,182 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,808 | hpp | #ifndef CAFFE_FILTER_LAYER_HPP_
#define CAFFE_FILTER_LAYER_HPP_
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/layer.hpp"
#include "caffe/proto/caffe.pb.h"
namespace caffe {
/**
* @brief Takes two+ Blobs, interprets last Blob as a selector and
* filter remaining Blobs accordingly with selector data (0 means that
* the corresponding item has to be filtered, non-zero means that corresponding
* item needs to stay).
*/
template <typename Dtype>
class FilterLayer : public Layer<Dtype> {
public:
explicit FilterLayer(const LayerParameter& param)
: Layer<Dtype>(param) {}
virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual inline const char* type() const { return "Filter"; }
virtual inline int MinBottomBlobs() const { return 2; }
virtual inline int MinTopBlobs() const { return 1; }
protected:
/**
* @param bottom input Blob vector (length 2+)
* -# @f$ (N \times C \times H \times W) @f$
* the inputs to be filtered @f$ x_1 @f$
* -# ...
* -# @f$ (N \times C \times H \times W) @f$
* the inputs to be filtered @f$ x_K @f$
* -# @f$ (N \times 1 \times 1 \times 1) @f$
* the selector blob
* @param top output Blob vector (length 1+)
* -# @f$ (S \times C \times H \times W) @f$ ()
* the filtered output @f$ x_1 @f$
* where S is the number of items
* that haven't been filtered
* @f$ (S \times C \times H \times W) @f$
* the filtered output @f$ x_K @f$
* where S is the number of items
* that haven't been filtered
*/
virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual void Forward_shader(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {}
virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
/**
* @brief Computes the error gradient w.r.t. the forwarded inputs.
*
* @param top output Blob vector (length 1+), providing the error gradient with
* respect to the outputs
* @param propagate_down see Layer::Backward.
* @param bottom input Blob vector (length 2+), into which the top error
* gradient is copied
*/
virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
bool first_reshape_;
vector<int> indices_to_forward_;
};
} // namespace caffe
#endif // CAFFE_FILTER_LAYER_HPP_
| [
"adnewer@gmail.com"
] | adnewer@gmail.com |
c58339df8d431ed6fb99f95943cd359141309965 | cefd6c17774b5c94240d57adccef57d9bba4a2e9 | /WebKit/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceValue.cpp | 19c6cf003bee840ee1e343734ade5a3615a011a5 | [
"BSD-2-Clause",
"LGPL-2.0-only",
"LGPL-2.1-only",
"BSL-1.0"
] | permissive | adzhou/oragle | 9c054c25b24ff0a65cb9639bafd02aac2bcdce8b | 5442d418b87d0da161429ffa5cb83777e9b38e4d | refs/heads/master | 2022-11-01T05:04:59.368831 | 2014-03-12T15:50:08 | 2014-03-12T15:50:08 | 17,238,063 | 0 | 1 | BSL-1.0 | 2022-10-18T04:23:53 | 2014-02-27T05:39:44 | C++ | UTF-8 | C++ | false | false | 4,870 | cpp | /*
* Copyright (C) 2011, 2012 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "WebKitAccessibleInterfaceValue.h"
#if HAVE(ACCESSIBILITY)
#include "AccessibilityObject.h"
#include "HTMLNames.h"
#include "WebKitAccessibleUtil.h"
#include "WebKitAccessibleWrapperAtk.h"
using namespace WebCore;
static AccessibilityObject* core(AtkValue* value)
{
if (!WEBKIT_IS_ACCESSIBLE(value))
return 0;
return webkitAccessibleGetAccessibilityObject(WEBKIT_ACCESSIBLE(value));
}
static void webkitAccessibleValueGetCurrentValue(AtkValue* value, GValue* gValue)
{
g_return_if_fail(ATK_VALUE(value));
returnIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(value));
memset(gValue, 0, sizeof(GValue));
g_value_init(gValue, G_TYPE_FLOAT);
g_value_set_float(gValue, core(value)->valueForRange());
}
static void webkitAccessibleValueGetMaximumValue(AtkValue* value, GValue* gValue)
{
g_return_if_fail(ATK_VALUE(value));
returnIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(value));
memset(gValue, 0, sizeof(GValue));
g_value_init(gValue, G_TYPE_FLOAT);
g_value_set_float(gValue, core(value)->maxValueForRange());
}
static void webkitAccessibleValueGetMinimumValue(AtkValue* value, GValue* gValue)
{
g_return_if_fail(ATK_VALUE(value));
returnIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(value));
memset(gValue, 0, sizeof(GValue));
g_value_init(gValue, G_TYPE_FLOAT);
g_value_set_float(gValue, core(value)->minValueForRange());
}
static gboolean webkitAccessibleValueSetCurrentValue(AtkValue* value, const GValue* gValue)
{
g_return_val_if_fail(ATK_VALUE(value), FALSE);
returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(value), FALSE);
double newValue;
if (G_VALUE_HOLDS_DOUBLE(gValue))
newValue = g_value_get_double(gValue);
else if (G_VALUE_HOLDS_FLOAT(gValue))
newValue = g_value_get_float(gValue);
else if (G_VALUE_HOLDS_INT64(gValue))
newValue = g_value_get_int64(gValue);
else if (G_VALUE_HOLDS_INT(gValue))
newValue = g_value_get_int(gValue);
else if (G_VALUE_HOLDS_LONG(gValue))
newValue = g_value_get_long(gValue);
else if (G_VALUE_HOLDS_ULONG(gValue))
newValue = g_value_get_ulong(gValue);
else if (G_VALUE_HOLDS_UINT64(gValue))
newValue = g_value_get_uint64(gValue);
else if (G_VALUE_HOLDS_UINT(gValue))
newValue = g_value_get_uint(gValue);
else
return FALSE;
AccessibilityObject* coreObject = core(value);
if (!coreObject->canSetValueAttribute())
return FALSE;
// Check value against range limits
newValue = std::max(static_cast<double>(coreObject->minValueForRange()), newValue);
newValue = std::min(static_cast<double>(coreObject->maxValueForRange()), newValue);
coreObject->setValue(String::number(newValue));
return TRUE;
}
static void webkitAccessibleValueGetMinimumIncrement(AtkValue* value, GValue* gValue)
{
g_return_if_fail(ATK_VALUE(value));
returnIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(value));
memset(gValue, 0, sizeof(GValue));
g_value_init(gValue, G_TYPE_FLOAT);
AccessibilityObject* coreObject = core(value);
if (!coreObject->getAttribute(HTMLNames::stepAttr).isEmpty()) {
g_value_set_float(gValue, coreObject->stepValueForRange());
return;
}
// If 'step' attribute is not defined, WebCore assumes a 5% of the
// range between minimum and maximum values. Implicit value of step should be one or larger.
float step = (coreObject->maxValueForRange() - coreObject->minValueForRange()) * 0.05;
g_value_set_float(gValue, step < 1 ? 1 : step);
}
void webkitAccessibleValueInterfaceInit(AtkValueIface* iface)
{
iface->get_current_value = webkitAccessibleValueGetCurrentValue;
iface->get_maximum_value = webkitAccessibleValueGetMaximumValue;
iface->get_minimum_value = webkitAccessibleValueGetMinimumValue;
iface->set_current_value = webkitAccessibleValueSetCurrentValue;
iface->get_minimum_increment = webkitAccessibleValueGetMinimumIncrement;
}
#endif
| [
"adzhou@hp.com"
] | adzhou@hp.com |
b12679d92872b36d613f1a51dfca095aa976f911 | 8f05bdf65aef32496a64b29142c67a233a1c1be9 | /Amazon/mostCommonWord.cpp | b6d7b7086d3668323c287d7e1ed139f67f317b51 | [] | no_license | someshgupta41/leetcode | c3c29f574a4476ad057367718312decb8332c8ca | 0c7bcbfd4217645bbf250c4a13c76cbef36221fa | refs/heads/master | 2020-04-08T04:01:12.892336 | 2019-03-20T03:25:53 | 2019-03-20T03:25:53 | 158,999,051 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 518 | cpp | class Solution {
public:
string mostCommonWord(string p, vector<string>& banned) {
unordered_set<string> ban(banned.begin(), banned.end());
unordered_map<string, int> count;
for (auto & c: p) c = isalpha(c) ? tolower(c) : ' ';
istringstream iss(p);
string w;
pair<string, int> res ("", 0);
while (iss >> w)
if (ban.find(w) == ban.end() && ++count[w] > res.second)
res = make_pair(w, count[w]);
return res.first;
}
}; | [
"someshgupta41@hotmail.com"
] | someshgupta41@hotmail.com |
d6fb8ce6e1ec38cdfa50aa7f39e0788983a6fd51 | 1302a788aa73d8da772c6431b083ddd76eef937f | /WORKING_DIRECTORY/system/tpm/tpm_manager/server/mock_tpm_nvram.cc | 1cc6a7798821623dc75d1d77568a909f9c8ee574 | [
"Apache-2.0"
] | permissive | rockduan/androidN-android-7.1.1_r28 | b3c1bcb734225aa7813ab70639af60c06d658bf6 | 10bab435cd61ffa2e93a20c082624954c757999d | refs/heads/master | 2021-01-23T03:54:32.510867 | 2017-03-30T07:17:08 | 2017-03-30T07:17:08 | 86,135,431 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,212 | cc | //
// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "tpm_manager/server/mock_tpm_nvram.h"
namespace tpm_manager {
using testing::_;
using testing::Invoke;
using testing::Return;
MockTpmNvram::MockTpmNvram() {
ON_CALL(*this, DefineNvram(_, _))
.WillByDefault(Invoke(this, &MockTpmNvram::FakeDefineNvram));
ON_CALL(*this, DestroyNvram(_))
.WillByDefault(Invoke(this, &MockTpmNvram::FakeDestroyNvram));
ON_CALL(*this, WriteNvram(_, _))
.WillByDefault(Invoke(this, &MockTpmNvram::FakeWriteNvram));
ON_CALL(*this, ReadNvram(_, _))
.WillByDefault(Invoke(this, &MockTpmNvram::FakeReadNvram));
ON_CALL(*this, IsNvramDefined(_, _))
.WillByDefault(Invoke(this, &MockTpmNvram::FakeIsNvramDefined));
ON_CALL(*this, IsNvramLocked(_, _))
.WillByDefault(Invoke(this, &MockTpmNvram::FakeIsNvramLocked));
ON_CALL(*this, GetNvramSize(_, _))
.WillByDefault(Invoke(this, &MockTpmNvram::FakeGetNvramSize));
}
MockTpmNvram::~MockTpmNvram() {}
bool MockTpmNvram::FakeDefineNvram(uint32_t index, size_t length) {
if (length == 0) {
return false;
}
NvSpace ns;
ns.data.resize(length, '\xff');
ns.written = false;
nvram_map_[index] = ns;
return true;
}
bool MockTpmNvram::FakeDestroyNvram(uint32_t index) {
auto it = nvram_map_.find(index);
if (it == nvram_map_.end()) {
return false;
}
nvram_map_.erase(it);
return true;
}
bool MockTpmNvram::FakeWriteNvram(uint32_t index, const std::string& data) {
auto it = nvram_map_.find(index);
if (it == nvram_map_.end()) {
return false;
}
NvSpace& nv = it->second;
if (nv.written || nv.data.size() < data.size()) {
return false;
}
nv.data.replace(0, data.size(), data);
nv.written = true;
return true;
}
bool MockTpmNvram::FakeReadNvram(uint32_t index, std::string* data) {
auto it = nvram_map_.find(index);
if (it == nvram_map_.end()) {
return false;
}
const NvSpace& nv = it->second;
if (!nv.written) {
return false;
}
data->assign(nv.data);
return true;
}
bool MockTpmNvram::FakeIsNvramDefined(uint32_t index, bool* defined) {
*defined = (nvram_map_.find(index) != nvram_map_.end());
return true;
}
bool MockTpmNvram::FakeIsNvramLocked(uint32_t index, bool* locked) {
bool defined;
if (!IsNvramDefined(index, &defined) || !defined) {
return false;
}
*locked = nvram_map_[index].written;
return true;
}
bool MockTpmNvram::FakeGetNvramSize(uint32_t index, size_t* size) {
bool defined;
if (!IsNvramDefined(index, &defined) || !defined) {
return false;
}
*size = nvram_map_[index].data.size();
return true;
}
} // namespace tpm_manager
| [
"duanliangsilence@gmail.com"
] | duanliangsilence@gmail.com |
fa939a20e8c7cd9b0631c135806b14211eedf8a5 | a6dd777dc6092146f22af27e835c33b68b6f7a21 | /Scan.cpp | 4c690baa882671e014d636eb8378016ecc0ce39e | [
"MIT"
] | permissive | Jin02/HeroRPG | 0fe41a59ba8344781f0c4221bd50736587f11b68 | bcf686ce9d57843e2e29eb495636c42f28b6ebe1 | refs/heads/master | 2021-05-05T09:11:06.177375 | 2018-01-28T11:16:44 | 2018-01-28T11:16:44 | 119,251,400 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,246 | cpp | #include "MyInclude.h"
#include "MyExtern.h"
SCAN Scan;
void ScanDraw1()
{
for(int l=0; l<8; l++)
{
if(Monster2[l].Hp<1)
{
Monster2[l].blsDead=false;
Filed.blsDead2=true;
Hero.blsDead2=true;
Hero.exp+=90;
Hero.money+=800;
if(Hero.exp>Hero.expmax)
{
if(Skill.blsDead1)
Skill.Health+=20;
if(Skill.blsDead2)
Skill.Brain+=10;
Hero.expmax+=50+Hero.levelup;
Hero.exp=0;
Hero.levelup+=10;
Hero.hpmax+=Hero.levelup+Skill.Health;
Hero.mpmax+=Hero.levelup+Skill.Brain;
Hero.hp+=Hero.levelup+Skill.Health;
Hero.mp+=Hero.levelup+Skill.Brain;
Shop1.AttackUp+=10;
Shop2.defenseup+=5;
Hero.attack=Shop1.weapon+Shop1.AttackUp;
Hero.defense=Shop2.defense+Shop2.defenseup;
}
}
}
}
void ScanDraw2()
{
for(int l=0; l<5; l++)
{
if(Monster[l].Hp<1)
{
Monster[l].blsDead=false;
Filed.blsDead2=true;
Hero.blsDead2=true;
Hero.exp+=50;
Hero.money+=300;
if(Hero.exp>Hero.expmax)
{
if(Skill.blsDead1)
Skill.Health+=20;
if(Skill.blsDead2)
Skill.Brain+=10;
Hero.expmax+=50+Hero.levelup;
Hero.exp=0;
Hero.levelup+=10;
Hero.hpmax+=Hero.levelup+Skill.Health;
Hero.mpmax+=Hero.levelup+Skill.Brain;
Hero.hp+=Hero.levelup+Skill.Health;
Hero.mp+=Hero.levelup+Skill.Brain;
Shop1.AttackUp+=10;
Shop2.defenseup+=5;
Hero.attack=Shop1.weapon+Shop1.AttackUp;
Hero.defense=Shop2.defense+Shop2.defenseup;
}
}
}
}
void ScanDraw3()
{
for(int l=0; l<12; l++)
{
if(Monster3[l].Hp<1)
{
Monster3[l].blsDead=false;
Filed.blsDead2=true;
Hero.blsDead2=true;
Hero.exp+=280;
Hero.money+=2300;
if(Hero.exp>Hero.expmax)
{
if(Skill.blsDead1)
Skill.Health+=20;
if(Skill.blsDead2)
Skill.Brain+=10;
Hero.expmax+=50+Hero.levelup;
Hero.exp=0;
Hero.levelup+=10;
Hero.hpmax+=Hero.levelup+Skill.Health;
Hero.mpmax+=Hero.levelup+Skill.Brain;
Hero.hp+=Hero.levelup+Skill.Health;
Hero.mp+=Hero.levelup+Skill.Brain;
Shop1.AttackUp+=10;
Shop2.defenseup+=5;
Hero.attack=Shop1.weapon+Shop1.AttackUp;
Hero.defense=Shop2.defense+Shop2.defenseup;
for(int o=0; o<13; o++)
Monster3[o].Troll++;
}
}
}
}
void ScanDraw4()
{
for(int l=0; l<12; l++)
{
if(Monster4[l].Hp<1)
{
Monster3[l].blsDead=false;
Filed.blsDead2=true;
Hero.blsDead2=true;
Hero.exp+=580;
Hero.money+=5600;
if(Hero.exp>Hero.expmax)
{
if(Skill.blsDead1)
Skill.Health+=20;
if(Skill.blsDead2)
Skill.Brain+=10;
Hero.expmax+=50+Hero.levelup;
Hero.exp=0;
Hero.levelup+=10;
Hero.hpmax+=Hero.levelup+Skill.Health;
Hero.mpmax+=Hero.levelup+Skill.Brain;
Hero.hp+=Hero.levelup+Skill.Health;
Hero.mp+=Hero.levelup+Skill.Brain;
Shop1.AttackUp+=10;
Shop2.defenseup+=5;
Hero.attack=Shop1.weapon+Shop1.AttackUp;
Hero.defense=Shop2.defense+Shop2.defenseup;
}
}
}
}
| [
"quaggan02@gmail.com"
] | quaggan02@gmail.com |
c5f4e75aa68c9fc513cc27ad3b33aa6547997730 | 45b3191a339e696da2e215e765cd3463b78d0d25 | /CS370-Shared/homework/ResistanceMatcher/resistancematcher.cpp | cae4175301200daa7165039c6cfa9f0021e41015 | [] | no_license | ericaltenburg/cs370 | aa9cddc8979d770ce2905e4fd8dbaca3ea742e98 | 053761826974ad5a1f91b1f9622529b4038a3508 | refs/heads/main | 2023-05-13T14:46:34.873662 | 2021-06-06T04:20:24 | 2021-06-06T04:20:24 | 321,582,151 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,100 | cpp | /*******************************************************************************
* Name : resistancematcher.cpp
* Author : Eric Altenburg, Hamzah Nizami, Constance Xu
* Date : April 7th, 2020
* Description : Program to match the resistance that the user seeks
* Pledge : I pledge my honor that I have abided by the Stevens Honor System.
******************************************************************************/
#include <algorithm>
#include <iostream>
#include <fstream>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string>
#include <utility>
#include <vector>
#include <iomanip>
#include <map>
#include <functional>
#include <iterator>
using namespace std;
double min_fit = 100;
struct sols{ //if you go with this, you'll need to change output function and you'll need to make a create_solution function
double best_fit;
double sol_error;
int num_resistors;
vector<float> resistors;
sols(double _best_fit, double _sol_error, int _num_resistors) : best_fit(_best_fit), sol_error(_sol_error), num_resistors(_num_resistors) { }
bool operator<(const sols& sol) const{
if(abs(sol_error - sol.sol_error) < 0.001){
return num_resistors < sol.num_resistors;
}
// cout << "Comparing: " << sol_error << " with: " << sol.sol_error << " RESULT: " << isless(sol_error, sol.sol_error) << endl;
return isless(sol_error, sol.sol_error);
}
friend ostream& operator <<(ostream &out, const sols &s);
};
ostream& operator<< (ostream &out, const sols &s){ //you can now just do cout << <sol object>
out << "Solution{BEST-FIT: " << s.best_fit << "; ERROR: " << s.sol_error << "; NUMBER_OF_RESISTORS: " << s.num_resistors << ";}";
return out;
}
double percent_error(float target, double best_fit){
return fabs((best_fit - target) / target) * 100; //returns it as a raw percent. Need to do / 100 for computation
}
pair<double, double> calculate_bounds(double error, float target){
if(error == 0.0) return make_pair((double)target, (double)target);
pair<double, double> bounds = make_pair(target - (target * (error / 100)), target + (target * (error / 100))); //first is lower, second is higher
return bounds;
}
vector<float> process_file(string file_name, double lower_bound){
ifstream file(file_name);
if(file.fail()){ //does the file exist?
cerr << "Error: Input file '" << file_name << "' not found." << endl;
exit(EXIT_FAILURE);
}
if(file.peek() == EOF){ //Empty?
cerr << "Error: File '" << file_name << "' is empty." << endl;
exit(EXIT_FAILURE);
}
vector<float> inputs; //put all of our inputs from the file here
inputs.push_back(-1);
int line_count = 1;
string line;
while(getline(file, line)){
float val; //same structure as the error checking we do in the main file.
try{
val = stof(line);
if(val <= 0){
cerr << "Error: Invalid value '" << line << "' on line " << line_count << "." << endl;
exit(EXIT_FAILURE);
}
} catch(invalid_argument){
cerr << "Error: Invalid value '" << line << "' on line " << line_count << "." << endl;
exit(EXIT_FAILURE);
}
line_count++;
if(val < lower_bound) continue;
inputs.push_back(val);
}
return inputs;
}
// Calculates the ohms
double parallel_formula (vector<float> resistors) {
double sum = 0;
for (int i = 0; i < resistors.size(); ++i) {
sum += 1 / resistors.at(i);
}
return 1 / sum;
}
void inline_vector_print(vector<float> v){ //inline printing of a vector. Just to pass the test cases.
if(v.empty()){
cout << "not possible.";
return;
}
cout << "possible with ";
cout << "[";
for(int i = 0; i < v.size(); i++){
cout << v.at(i);
if(i != v.size() - 1){
cout << ", ";
}
}
cout << (v.size() != 1 ? "] ohm resistors." : "] ohm resistor."); //Dr. B likes grammar
}
void output(int max_r, float tolerance, vector<float> resistors, float target, double best_fit, string print_target){
//outputting everything to exactly how the test script wants it.
cout << "Max resistors in parallel: " << max_r << endl;
cout.precision(1);
cout << "Tolerance: " << fixed << tolerance << " %" << endl;
cout << "Target resistance of " << print_target << " ohms is ";
inline_vector_print(resistors);
cout << endl;
if(resistors.empty()) exit(EXIT_SUCCESS);
cout.precision(4);
cout << "Best fit: " << fixed << best_fit << " ohms" << endl;
cout.precision(2);
cout << "Percent error: " << percent_error(target, best_fit) << setprecision(2) << " %" << endl;
exit(EXIT_SUCCESS);
}
void findDuplicates(vector<float> &vecOfElements, map<float, int> & countMap) {
// Iterate over the vector and store the frequency of each element in map
for (auto & elem : vecOfElements)
{
auto result = countMap.insert(pair<float, int>(elem, 1));
if (result.second == false)
result.first->second++;
}
// Remove the elements from Map which has 1 frequency count
for (auto it = countMap.begin() ; it != countMap.end() ;)
{
if (it->second == 1)
it = countMap.erase(it);
else
it++;
}
}
vector<sols> backtracking (vector < vector < bool > > &mat, vector<float> &resistor_vals, long last_row_index, long upperBound, long lowerBound, int num_r, float target, float tolerance){
vector<float> temp_solution;
vector<sols> solution;
long i = resistor_vals.size()-1;
long j = last_row_index;
while (i > 0 && j > 0) {
if (mat.at(i-1).at(j)) { // Cell above is true, then move up one
i = i-1;
} else { // Cell above is false, move to the left by the amount of the resistor and add it to the temp solutions
j = j-((1/resistor_vals.at(i))*1000000);
temp_solution.push_back(resistor_vals.at(i));
}
}
// // Find duplicates and see if they can be replaced with doubled resistors
// vector<float> inv_resistor_vals;
// for (int a = 0; a < resistor_vals.size(); a++) {
// inv_resistor_vals.push_back(1/resistor_vals.at(i));
// }
// map<float, int> countMap;
// findDuplicates(temp_solution, countMap);
// for (auto & elem : countMap) {
// for (int i = elem.second; i > 1; --i) {
// float temp_x = (1/elem.first)*(float)i;
// // float temp = elem.first * i;
// vector<float>::iterator it = find(inv_resistor_vals.begin(), inv_resistor_vals.end(), temp_x);
// if (it != resistor_vals.end()) {
// sort(temp_solution.begin(), temp_solution.end()); // sort items
// vector<float>::iterator it2 = find(temp_solution.begin(), temp_solution.end(), elem.first);
// temp_solution.erase(temp_solution.begin()+distance(temp_solution.begin(), it2), temp_solution.begin()+distance(temp_solution.begin()+i, it2));
// temp_solution.push_back(1/temp_x);
// break;
// }
// }
// }
if (temp_solution.size() <= num_r) { // temp solution does not use too many resistors
sort(temp_solution.begin(), temp_solution.end());
double best_fit = parallel_formula(temp_solution);
double perror = percent_error(target, best_fit);
if (perror <= tolerance) {
sols psol(best_fit, perror, temp_solution.size());
psol.resistors = temp_solution;
solution.push_back(psol);
return solution;
}
}
return solution;
}
sols populate (vector<float> &resistor_vals, float tolerance, int num_r, float target) {
// Upper and lower bound for the target inverses and move decimal by 8, then place into a vector for easy mapping values between matrix
double temp_UB = (1/(target-(target*(tolerance/100)))); // 3007
long upperBound = temp_UB * 1000000;
double temp_LB = (1/(target+(target*(tolerance/100)))); // 2721
long lowerBound = temp_LB * 1000000;
vector <long> map_inverse_resistances;
map_inverse_resistances.push_back(-1);
for (long i = upperBound; i>=0; --i) { // MIGHT NEED TO PUT THE WHOLE INDIVIDUAL INCREMENTS IN THE MAT TO MAKE SURE THE TABLE IS FILLED OUT PROPERLY
map_inverse_resistances.push_back(i);
}
// Make the matrix used for dp and fill up top row with false and the left with true excluding index 0
vector < vector < bool > > mat;
vector <bool> temp_vect;
temp_vect.resize(upperBound+1, false);
for (long i = 0; i < resistor_vals.size(); ++i) { // Push all arrays to the matrix
mat.push_back(temp_vect);
}
mat.at(0).resize(upperBound+1, false); //top row to false. possible bug fix: upperBound+1
for (long i = 0; i < resistor_vals.size(); ++i) {
mat.at(i).at(0) = true;
}
for (long i = 1; i < resistor_vals.size(); ++i) {
for (long j = 1; j < upperBound+1; ++j) {
mat.at(i).at(j) = false;
}
}
// Make vector for the inverse of the resistor values
// Traverse through the matrix and fill with bool vals as to whether or not it can make a specific sum
for (long i = 1; i < mat.size(); ++i) { // resistor values
for (long j = 1; j < upperBound+1; ++j) { // inverse resistance values
// int inv_of_curr_resistor = (int)((1/resistor_vals.at(i)) * 10000000000);
long resistor_big = (long)((1/resistor_vals.at(i))*1000000); // 26315
// j = 26315
if (j < resistor_big) { // If the resistance value at the current spot is less than the computed "
mat.at(i).at(j) = mat.at(i-1).at(j); // set it to the value above itself
continue;
}
float x = 1/(map_inverse_resistances.at(j)/1000000.0);
float y = resistor_vals.at(i);
if (fmodf(x,y) == 0) { // Evenly divides
mat.at(i).at(j) = true;
continue;
}
if (mat.at(i-1).at(j)) { // One above is true
mat.at(i).at(j) = true;
continue;
} else { // One above is false
mat.at(i).at(j) = mat.at(i).at(j-resistor_big);
continue;
}
}
}
vector<sols> potential_sols;
vector<float> useless;
sols invalid(-1, -1, -1);
invalid.resistors = useless;
potential_sols.push_back(invalid);
long inv_target = (long)((1/target)*1000000);
for (long i = inv_target; i < upperBound+1; ++i) { // start at the target_inv
if (mat.at(mat.size()-1).at(i)) { // if it's true then back track and see if valid by size
vector <sols> purgatory = backtracking(mat, resistor_vals, i, upperBound, lowerBound, num_r, target, tolerance);
if (purgatory.empty()) { // over num_r
continue;
} else { // gud then quit
potential_sols.push_back(purgatory.at(0));
break;
}
}
}
for (long i = inv_target-1; i > 0; --i) {
if (mat.at(mat.size()-1).at(i)) {
vector <sols> purgatory1 = backtracking(mat, resistor_vals, i, upperBound, lowerBound, num_r, target, tolerance);
if (purgatory1.empty()) {
continue;
} else {
potential_sols.push_back(purgatory1.at(0));
// cout << purgatory1.at(0) << endl;
break;
}
}
}
// Sort by the perror
sort(potential_sols.begin(), potential_sols.end());
return (potential_sols.size() > 1 ? potential_sols.at(1) : potential_sols.at(0)); //invalid is always at the zero index
}
int main(int argc, char * const argv[]){
if(argc != 5){ //Check if there are five args
cerr << "./resistancematcher <target> <tolerance %> <num resistors> <input file>";
return 1;
}
//Check the validity of each input one at a time.
float target;
float tolerance;
int num_r;
//process target value
try {
target = stof(argv[1]);
if(target <= 0){
cerr << "Error: Invalid target value '" << argv[1] << "'." << endl;
return 1;
}
} catch (invalid_argument){
cerr << "Error: Invalid target value '" << argv[1] << "'." << endl;
return 1;
}
//process the tolerance percantage value.
try{
tolerance = stof(argv[2]);
if(tolerance < 0){
cerr << "Error: Invalid tolerance value '" << argv[2] << "'." << endl;
return 1;
}
} catch (invalid_argument){
cerr << "Error: Invalid tolerance value '" << argv[2] << "'." << endl;
return 1;
}
//process the number of resistors value
try{
num_r = stoi(argv[3]);
if(num_r <= 0 || num_r > 10){
cerr << "Error: Invalid number of resistors '" << argv[3] << "'." << endl;
return 1;
}
} catch (invalid_argument){
cerr << "Error: Invalid number of resistors '" << argv[3] << "'." << endl;
return 1;
}
//now we need to check the file and then parse for validity.
pair<double, double> error_bounds = calculate_bounds(tolerance, target);
vector<float> resistor_vals = process_file(argv[4], error_bounds.second);
if(resistor_vals.empty()){
output(num_r, tolerance, resistor_vals, target, 0, argv[1]);
}
sort(resistor_vals.begin(), resistor_vals.end()); //for binary search
// Find out how much r begin used
sols possible_ans = populate(resistor_vals, tolerance, num_r, target);
output(num_r, tolerance, possible_ans.resistors, target, possible_ans.best_fit, argv[1]);
return 0;
} | [
"ealtenbu@stevens.edu"
] | ealtenbu@stevens.edu |
267fda4859b7ccf610ab7447039490feaf708d40 | 307dee9f6f5e90f4cbd0fd58022b244f5b6288c1 | /MQO/MQO/MQO/DebugGraphOverlapQG.h | 9606a0979cff035ee8b8704206ef0e08572e47fe | [] | no_license | anhlt18vn/ESSIso | a85bc1210d6eb0fb3591befc1bf3bb66b68e22ea | 1ab55fb1f5af9fb0e357cdc6d74f5a6e2e8f2c8e | refs/heads/master | 2023-06-05T05:17:28.369905 | 2021-06-22T13:56:41 | 2021-06-22T13:56:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 699 | h | #pragma once
#ifndef DEBUG_GRAPH_OVERLAP_QG_H
#define DEBUG_GRAPH_OVERLAP_QG_H
#include"AdjacenceListsGraph.h"
#include<fstream>
/*
* Temparary query generator for debugging purpose
*/
class DebugGraphOverlapQG {
private:
AdjacenceListsGRAPH * dataGraph;
std::ofstream * resultFile;
std::ofstream * resultFile2;
int queryGraphIndex;
public:
DebugGraphOverlapQG(AdjacenceListsGRAPH * pDataGraph, std::ofstream * pResultFile, std::ofstream * pResultFile2);
DebugGraphOverlapQG(AdjacenceListsGRAPH * pDataGraph, std::ofstream * pResultFile);
void generateQueries();
private:
void outputQuery(std::vector<int> & vertexIdVector, std::vector<int> & vertexLabelVector);
};
#endif | [
"hoangdzung@github.com"
] | hoangdzung@github.com |
9d97fb296807362b1dbbdaa5ae85b9a616d9271a | 7925aeb2fda7314a487774e82f2bea63ae75e0d3 | /chapter_twelve/practise12-23.cpp | b4d58aef65404da533ccfa90db95b6108ec66629 | [] | no_license | zkx349113864/c-_primer_5th | ab3dcb431c7c4634c3f83af1e13affc3523d73ed | b3fd7c3d3dd9f57b8e8033e79d09876edb5e0293 | refs/heads/master | 2022-02-18T22:55:05.898786 | 2019-10-07T11:53:24 | 2019-10-07T11:53:24 | 192,095,363 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 844 | cpp | #include <iostream>
#include <string>
#include <new>
#include <string.h>
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main()
{
char c1[7] = "hello";
char c2[8] = "world!";
char c3[15];
strcat(c3, c1);
strcat(c3, c2);
char *cp1 = new char[15];
for (int i = 0; i != 15; ++i)
{
*(cp1 + i) = c3[i];
}
for(int i = 0; i != 15; ++i)
{
cout << c3[i];
}
cout << endl;
delete [] cp1;
string s1 = "hello";
string s2 = "world";
string s3 = "";
s3 = s1 + s2;
char *cp = new char[s3.length()];
for (auto i = 0; i != s3.length(); ++i)
{
*(cp + i) = s3[i];
}
for(auto i = 0; i != s3.length(); ++i)
{
cout << *(cp + i);
}
cout << endl;
delete []cp;
system("pause");
return 0;
} | [
"zhang349113864@gmail.com"
] | zhang349113864@gmail.com |
9919d77b0f41a2074ce98a8366f6420a98f51ad2 | ff048f7cbe35ae81c8ec4765a3fa29b829adf782 | /Galerkin/src/IO/Segy/SegySeismo.inl | cc7bae5806503f32dbdd7206d864949ccd186c19 | [] | no_license | lzhw1991/CNN-for-inverse-problems-in-wave-dynamics | 2366911c06d695ebbe16697f71a172a2ece0af59 | 3d0154cec845e5779891254da4d9bf858d8233df | refs/heads/master | 2022-04-02T16:13:57.223232 | 2020-02-12T20:04:36 | 2020-02-12T20:04:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,447 | inl | #include <vector>
#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
#include <climits>
#include <algorithm>
#include <math.h>
#include "../../Utils/Utils.h"
std::vector<std::string> getNextLineAndSplitIntoTokens(std::istream& str, char delim = ';')
{
std::vector<std::string> result;
std::string line;
std::getline(str,line);
std::stringstream lineStream(line);
std::string cell;
while(std::getline(lineStream,cell, delim))
{
result.push_back(cell);
}
return result;
}
// |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \\
// |||||||||||||||||||||||| Seismogramm ||||||||||||||||||||||||||||||||||| \\
// |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \\
template <typename Scalar>
void Seismogramm<Scalar>::swap_header_endian()
{
::swap_endian<uint32>(header_data.job_id);
::swap_endian<uint32>(header_data.line_num);
::swap_endian<uint32>(header_data.reel_num);
::swap_endian<uint16>(header_data.num_of_traces_per_record);
::swap_endian<uint16>(header_data.num_of_auxiliary_traces_per_record);
::swap_endian<uint16>(header_data.sample_interval_reel);
::swap_endian<uint16>(header_data.sample_interval);
::swap_endian<uint16>(header_data.samples_per_trace_reel);
::swap_endian<uint16>(header_data.samples_per_trace);
::swap_endian<uint16>(header_data.data_sample_format);
}
template<typename Scalar>
void Seismogramm<Scalar>::swap_trace_header_endian(struct segy_trace_header * ptr_header)
{
::swap_endian<uint32>(ptr_header->trace_seq_num_line);
::swap_endian<uint32>(ptr_header->trace_seq_num_reel);
::swap_endian<uint32>(ptr_header->field_record_num);
::swap_endian<uint32>(ptr_header->trace_num_reel);
::swap_endian<uint16>(ptr_header->trace_id_code);
::swap_endian<uint32>(ptr_header->source_x);
::swap_endian<uint32>(ptr_header->source_y);
::swap_endian<uint32>(ptr_header->receiver_x);
::swap_endian<uint32>(ptr_header->receiver_y);
::swap_endian<uint16>(ptr_header->units_id);
::swap_endian<uint16>(ptr_header->num_of_samples);
::swap_endian<uint16>(ptr_header->sample_interval);
::swap_endian<uint32>(ptr_header->distance_from_source);
::swap_endian<uint16>(ptr_header->num_of_verticaly_summed_traces);
::swap_endian<uint16>(ptr_header->num_of_horizotally_summed_traces);
::swap_endian<uint16>(ptr_header->data_use);
}
template<typename Scalar>
void Seismogramm<Scalar>::swap_all_trace_headers_endian()
{
for (IndexType i = 0; i < trace_header_data.size(); i++)
swap_trace_header_endian(&trace_header_data[i]);
}
template<typename Scalar>
void Seismogramm<Scalar>::swap_data_endian()
{
for (IndexType i = 0; i < data.size(); i++)
for (IndexType j = 0; j < data[i].size(); j++)
{
::swap_endian(data[i][j]);
}
}
template<typename Scalar>
void Seismogramm<Scalar>::LoadSegY(const std::string& path, std::vector<Scalar>& times)
{
std::ifstream inf;
inf.open(path.data(), std::ios::binary);
if (!inf)
{
std::cout << "Error in reading SEG-Y file." << std::endl;
std::cout << "There is no such file: " << path << std::endl;
std::exit(1);
}
char text_header[3200];
inf.read(text_header, 3200);
inf.read(reinterpret_cast<char*>(&header_data), sizeof(header_data));
swap_header_endian();
data.resize(header_data.num_of_traces_per_record);
for (int i = 0; i < header_data.num_of_traces_per_record; i++)
data[i].resize(header_data.samples_per_trace);
//struct segy_trace_header trace_header_data;
for (int i = 0; i < header_data.num_of_traces_per_record; i++)
{
inf.read(reinterpret_cast<char*>(&trace_header_data[i]), sizeof(trace_header_data[i]));
inf.read(reinterpret_cast<char*>(data[i].data()), sizeof(float) * header_data.samples_per_trace);
}
swap_data_endian();
times.resize(header_data.samples_per_trace);
for (int i = 0; i < header_data.samples_per_trace; i++)
{
times[i] = header_data.sample_interval * Scalar(0.000001) * i;
}
}
template<typename Scalar>
void Seismogramm<Scalar>::SaveSegY(const std::string& path, const std::vector<Scalar>& times)
{
std::ofstream outf (path.data(), std::ios::out | std::ios::binary);
if (!outf)
{
std::cout << "Error in writing SEG-Y file.\n";
std::exit(1);
}
char text_header[3200];
for (int i = 0; i < 3200; i++)
text_header[i] = 0;
outf.write(text_header, 3200);
swap_header_endian();
outf.write(reinterpret_cast<char*>(&header_data), sizeof(header_data));
swap_header_endian();
swap_all_trace_headers_endian();
swap_data_endian();
for (uint32 i = 0; i < header_data.num_of_traces_per_record; i++)
{
outf.write(reinterpret_cast<char*>(&trace_header_data.at(i)), sizeof(trace_header_data.at(i)));
outf.write(reinterpret_cast<char*>(data.at(i).data()), sizeof(float) * data.at(i).size());
}
swap_all_trace_headers_endian();
swap_data_endian();
outf.close();
}
template<typename Scalar>
void Seismogramm<Scalar>::AddValue(const Sample& value, IndexType detectorIndex)
{
data[detectorIndex].push_back(value);
}
// |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \\
// |||||||||||||||||||||||| CombinedSeismogramm ||||||||||||||||||||||||||||||||||| \\
// |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \\
template <typename Scalar, int dims>
void CombinedSeismogramm<Scalar, dims>::Load(SeismoType type, std::vector<std::string> paths, const CombinedSeismogramm<Scalar, dims> *compatibleSeismogram)
{
seismogramms.resize(componentInfos.size());
if (type == SEG_Y)
{
for (IndexType p = 0; p < paths.size(); ++p)
{
seismogramms[p].LoadSegY(paths[p], times);
}
}
else if (type == CSV)
{
seismogramms.resize(paths.size() * dims);
for (IndexType path_index = 0; path_index < paths.size(); path_index++)
{
// Calculating number of time steps and number of traces
// ///////////////////////////////////////
std::string filename = paths[path_index];
IndexType num_of_times = -1;
IndexType num_of_all_traces = 0;
IndexType num_of_receivers;
std::ifstream ifs0;
ifs0.open(filename.c_str());
if (!ifs0)
{
std::cout << "Error in reading CSV file." << std::endl;
std::cout << "There is no such file: " << filename << std::endl;
std::exit(1);
}
std::vector<std::string> line = getNextLineAndSplitIntoTokens(ifs0);
num_of_all_traces = line.size() - 1;
num_of_receivers = num_of_all_traces / dims;
if (line.back() == "\r") num_of_all_traces -= 1;
while (line.size() >= num_of_all_traces + 1)
{
line = getNextLineAndSplitIntoTokens(ifs0);
num_of_times++;
}
ifs0.close();
// Reading data
// ///////////////////////////////////////
std::ifstream ifs;
ifs.open(filename.c_str());
::getNextLineAndSplitIntoTokens(ifs);
line = getNextLineAndSplitIntoTokens(ifs);
for (int k = 0; k < dims; k++)
seismogramms.at(dims * path_index + k).data.resize((line.size()-1)/dims);
for (IndexType trace_i = 0; trace_i < num_of_receivers; trace_i++)
{
for (int k = 0; k < dims; k++)
seismogramms.at(dims * path_index + k).data[trace_i].resize(num_of_times);
}
times.resize(num_of_times);
IndexType time_i = 0;
while (line.size() >= num_of_all_traces + 1)
{
times[time_i] = Scalar(::atof(line[0].c_str()));
for (IndexType trace_i = 0; trace_i < num_of_receivers; trace_i++)
{
seismogramms.at(dims * path_index + 0).data[trace_i][time_i] = Scalar(::atof(line[1 + trace_i * dims].c_str()));
seismogramms.at(dims * path_index + 1).data[trace_i][time_i] = Scalar(::atof(line[2 + trace_i * dims].c_str()));
if (dims >= 3)
seismogramms.at(dims * path_index + 2).data[trace_i][time_i] = Scalar(::atof(line[3 + trace_i * dims].c_str()));
}
line = getNextLineAndSplitIntoTokens(ifs);
time_i++;
}
// Interpolating results on eqidistant time grid
// ///////////////////////////////////////
assert(path_index < compatibleSeismogram->interpolationIntervals.size());
interpolationIntervals.resize(path_index + 1);
if(compatibleSeismogram)
this->interpolationIntervals[path_index] = compatibleSeismogram->interpolationIntervals[path_index];
else
{
Scalar averageStep = (times[num_of_times-1] - times[0]) / (std::min(num_of_times, IndexType(65535)) - 1);
Scalar roundedStep = std::max(floor(interpolation_multiplier * averageStep * 1e6 + 1.0) / 1e6, 1e-6);
this->interpolationIntervals[path_index] = roundedStep;
}
std::cout << "interval: " << this->interpolationIntervals[path_index] << std::endl;
interpolate_data_on_equal_time_intervals(this->interpolationIntervals[path_index]);
num_of_times = times.size();
std::cout << "num_of_times: " << num_of_times << std::endl;
this->interpolationIntervals[path_index] = times[1] - times[0];
std::cout << "interval: " << this->interpolationIntervals[path_index] << std::endl;
// Set binary header data
// ///////////////////////////////////////
struct segy_bin_header_data header_data;
header_data.sample_interval = static_cast<uint32>(floor(this->interpolationIntervals[path_index] * 1e6 + 0.5));
header_data.sample_interval_reel = header_data.sample_interval;
header_data.job_id = 1;
header_data.line_num = 1;
header_data.reel_num = 1;
header_data.num_of_traces_per_record = static_cast<uint16>(num_of_receivers);
header_data.num_of_auxiliary_traces_per_record = 0;
header_data.data_sample_format = 5;
header_data.reel_num = 1;
header_data.samples_per_trace = static_cast<uint16>(num_of_times);
header_data.samples_per_trace_reel = header_data.samples_per_trace;
for (int i = 0; i < 17; i++)
header_data.other[i] = 0;
for (int i = 0; i < 170; i++)
header_data.reserve[i] = 0;
for (IndexType k = 0; k < dims; k++)
{
seismogramms[dims*path_index + k].header_data = header_data;
}
// Set trace header data
// ///////////////////////////////////////
// Reading receivers data
std::string filename_rec = paths[path_index] + ".receivers.csv";
std::ifstream ifs_rec;
ifs_rec.open(filename_rec.c_str());
std::vector<Scalar> rec_x;
std::vector<Scalar> rec_y;
if (ifs_rec)
{
for (IndexType i = 0; i < num_of_receivers; i++)
{
std::vector<std::string> v = getNextLineAndSplitIntoTokens(ifs_rec);
if (v.size() < 2)
{
std::cout << "Error while reading receivers data" << std::endl;
}
else
{
rec_x.push_back(Scalar(::atof(v.at(0).c_str())));
rec_y.push_back(Scalar(::atof(v.at(1).c_str())));
}
}
}
else
{
std::cout << "Warning: no csv receivers data found" << std::endl;
std::cout << " All receivers positions have been set to (0.0, 0.0)" << std::endl;
for (IndexType i = 0; i < num_of_receivers; i++)
{
rec_x.push_back(0.0);
rec_y.push_back(0.0);
}
}
// Reading source data
std::string filename_source = paths[path_index] + ".source.csv";
std::ifstream ifs_source;
ifs_source.open(filename_source.c_str());
Scalar source_x;
Scalar source_y;
if (ifs_source)
{
std::vector<std::string> v = getNextLineAndSplitIntoTokens(ifs_source);
if (v.size() < 2)
{
std::cout << "Error while reading source data" << std::endl;
}
else
{
source_x = Scalar(::atof(v.at(0).c_str()));
source_y = Scalar(::atof(v.at(1).c_str()));
}
}
else
{
std::cout << "Warning: no csv source data found" << std::endl;
std::cout << " Source position has been set to (0.0, 0.0)" << std::endl;
source_x = 0.0;
source_y = 0.0;
}
// Setting trace headers data
for (IndexType k = 0; k < dims; k++)
{
seismogramms[dims*path_index + k].trace_header_data.resize(num_of_receivers);
for (IndexType i = 0; i < num_of_receivers; i++)
{
seismogramms[dims*path_index + k].trace_header_data[i].trace_seq_num_line = i;
seismogramms[dims*path_index + k].trace_header_data[i].trace_seq_num_reel = i;
seismogramms[dims*path_index + k].trace_header_data[i].trace_id_code = static_cast<uint16>(i);
seismogramms[dims*path_index + k].trace_header_data[i].receiver_x = uint32(rec_x[i]); // because of precision equals 1m %)
seismogramms[dims*path_index + k].trace_header_data[i].receiver_y = uint32(rec_y[i]);
seismogramms[dims*path_index + k].trace_header_data[i].source_x = uint32(source_x);
seismogramms[dims*path_index + k].trace_header_data[i].source_y = uint32(source_y);
seismogramms[dims*path_index + k].trace_header_data[i].field_record_num = 1;
seismogramms[dims*path_index + k].trace_header_data[i].num_of_samples = header_data.samples_per_trace;
seismogramms[dims*path_index + k].trace_header_data[i].sample_interval = header_data.sample_interval;
seismogramms[dims*path_index + k].trace_header_data[i].trace_num_reel = 1;
seismogramms[dims*path_index + k].trace_header_data[i].units_id = 1;
seismogramms[dims*path_index + k].trace_header_data[i].distance_from_source =
uint32(sqrt(Scalar((rec_x[i]-source_x)*(rec_x[i]-source_x) + (rec_y[i]-source_y)*(rec_y[i]-source_y)) + 0.5));
}
}
}
}
}
template <typename Scalar, int dims>
void CombinedSeismogramm<Scalar, dims>::interpolate_data_on_equal_time_intervals(Scalar time_interval)
{
for (IndexType seism_i = 0; seism_i < seismogramms.size(); seism_i++)
{
for (IndexType trace_i = 0; trace_i < seismogramms[seism_i].data.size(); trace_i++)
{
Scalar cur_time = times[0];
IndexType cur_index = 1;
typename Seismogramm<Scalar>::Trace temp_trace;
while (cur_time < times.back())
{
while (cur_index < seismogramms[seism_i].data[trace_i].size() && cur_time > times[cur_index])
cur_index++;
// Linear approx:
temp_trace.push_back(
((cur_time - times[cur_index-1])*seismogramms[seism_i].data[trace_i][cur_index] +
(times[cur_index] - cur_time) *seismogramms[seism_i].data[trace_i][cur_index-1]) /
(times[cur_index] - times[cur_index-1]));
cur_time += time_interval;
}
seismogramms[seism_i].data[trace_i].resize(temp_trace.size());
for (IndexType time_i = 0; time_i < temp_trace.size(); time_i++)
{
seismogramms[seism_i].data[trace_i][time_i] = temp_trace[time_i];
}
}
seismogramms[seism_i].header_data.sample_interval = uint16(time_interval * 1000000);
}
times.resize(seismogramms[0].data[0].size());
for (IndexType i = 1; i < times.size(); i++)
times[i] = times[0] + time_interval * i;
}
template <typename Scalar, int dims>
void CombinedSeismogramm<Scalar, dims>::Save(SeismoType type, std::vector<std::string> paths)
{
if (type == SEG_Y)
{
if (paths.size()> seismogramms.size())
{
std::cout << "Too many Seg-Y files to save!" << std::endl;
std::exit(1);
}
for (IndexType i = 0; i < paths.size(); ++i)
{
seismogramms[i].SaveSegY(paths[i].data(), times);
}
}
else if (type == CSV)
{
if (paths.size() * dims > 3 * seismogramms.size())
{
std::cout << "Too many Csv files to save!" << std::endl;
std::exit(1);
}
for (IndexType path_index = 0; path_index < paths.size()/3; path_index++)
{
// Saving data
std::ofstream outf (paths[3*path_index].c_str(), std::ios::out);
outf << "Time;";
for (IndexType i = 0; i < seismogramms[0].data.size(); i++)
{
outf << "Vx (edge = " << i + 1 << ");";
outf << "Vy (edge = " << i + 1 << ");";
if (dims >= 3)
outf << "Vz (edge = " << i + 1 << ");";
}
outf << "\n";
for (IndexType i = 0; i < seismogramms[dims*path_index].data[0].size(); i++)
{
outf << times[i] << ";";
for (IndexType j = 0; j < seismogramms[dims*path_index].data.size(); j++)
{
outf << seismogramms[dims*path_index + 0].data[j][i] << ";";
outf << seismogramms[dims*path_index + 1].data[j][i] << ";";
if (dims >= 3)
outf << seismogramms[dims*path_index + 2].data[j][i] << ";";
}
outf << "\n";
}
outf.close();
// Saving receivers
std::ofstream outf_res (paths[3*path_index+1].c_str(), std::ios::out);
for (IndexType i = 0; i < seismogramms[dims*path_index].trace_header_data.size(); i++)
{
outf_res << seismogramms[dims*path_index].trace_header_data[i].receiver_x << " " <<
seismogramms[dims*path_index].trace_header_data[i].receiver_y << "\n";
}
outf_res.close();
// Saving explosion coords
std::ofstream outf_expl (paths[3*path_index+2].c_str(), std::ios::out);
outf_expl << seismogramms[dims*path_index].trace_header_data[0].source_x << " " <<
seismogramms[dims*path_index].trace_header_data[0].source_y << "\n";
outf_expl.close();
}
}
}
template <typename Scalar, int dims>
void CombinedSeismogramm<Scalar, dims>::Save(SeismoType type)
{
std::vector<std::string> paths;
for (IndexType k = 0; k < componentInfos.size(); k++)
paths.push_back(componentInfos[k].path);
Save(type, paths);
}
template <typename Scalar, int dims>
void CombinedSeismogramm<Scalar, dims>::AddValue(Scalar time, const Elastic& elastic, IndexType detectorIndex)
{
times.push_back(time);
for (IndexType i = 0; i < componentInfos.size(); ++i)
{
seismogramms[i].AddValue(componentInfos[i].getter->GetValue(elastic), detectorIndex);
}
}
template <typename Scalar, int dims>
void CombinedSeismogramm<Scalar, dims>::AddComponent(const std::string& path, ValueGetter<Elastic, dims>* getter)
{
componentInfos.push_back(ComponentInfo(path, getter));
}
template <typename Scalar, int dims>
CombinedSeismogramm<Scalar, dims> &CombinedSeismogramm<Scalar, dims>::operator -=(const CombinedSeismogramm<Scalar, dims> & other)
{
assert(seismogramms.size() == other.seismogramms.size());
for (IndexType seism_i = 0; seism_i < seismogramms.size(); seism_i++)
{
assert(seismogramms[seism_i].data.size() == other.seismogramms[seism_i].data.size());
for (IndexType trace_i = 0; trace_i < seismogramms[seism_i].data.size(); trace_i++)
{
IndexType minTime = std::min(seismogramms[seism_i].data[trace_i].size(), other.seismogramms[seism_i].data[trace_i].size());
for (IndexType time_i = 0; time_i < minTime; time_i++)
{
seismogramms[seism_i].data[trace_i][time_i] -= other.seismogramms[seism_i].data[trace_i][time_i];
}
}
}
return *this;
}
| [
"stankevich.as@phystech.edu"
] | stankevich.as@phystech.edu |
dfd0169fae7c379daf94bb0721dec250ea653588 | 7faf50fcbe2bb69f93210864a7970cf33d276679 | /Easy/ArrayPartitionI.hpp | 16dda56a9591cdf2a8b873b0856ab53109d4d0dd | [] | no_license | Skifary/leetcode | 7e76188aa2e5989d410f06a1e64865486e586710 | 880462cdeb887ab7b0ca3ff8f4099b8e79d7d13a | refs/heads/master | 2021-03-12T20:36:02.751215 | 2017-07-15T07:36:37 | 2017-07-15T07:36:37 | 91,458,735 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 624 | hpp | //
// ArrayPartitionI.hpp
// LeetCode
//
// Created by Skifary on 20/05/2017.
// Copyright © 2017 Skifary. All rights reserved.
//
/*
* 561. Array Partition I
*
* Given an array of 2n integers, your task is to group these integers into n pairs of integer,
*
* say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possible.
*
*/
#ifndef ArrayPartitionI_hpp
#define ArrayPartitionI_hpp
#include <stdio.h>
#include <vector>
using namespace std;
namespace LeetCode {
int arrayPairSum(vector<int>& nums);
}
#endif /* ArrayPartitionI_hpp */
| [
"376512563@qq.com"
] | 376512563@qq.com |
f8b953711742e0891f25f56060de97c4399ae39f | fab77712e8dfd19aea9716b74314f998093093e2 | /Utility/ShareResource.cpp | 0159c442b8cc969b737b2524f68c3512f6008511 | [] | no_license | alandigi/tsfriend | 95f98b123ae52f1f515ab4a909de9af3724b138d | b8f246a51f01afde40a352248065a6a42f0bcbf8 | refs/heads/master | 2016-08-12T07:09:23.928793 | 2011-11-13T15:12:54 | 2011-11-13T15:12:54 | 45,849,814 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,271 | cpp | #include "StdAfx.h"
#include "include.h"
CShareResource::CShareResource(u8 IntSem )
{
/*
CSemaphore(
LONG lInitialCount = 1,
LONG lMaxCount = 1,
LPCTSTR pstrName = NULL,
LPSECURITY_ATTRIBUTES lpsaAttributes = NULL
);
*/
ptrSemaphore=new CSemaphore(IntSem,1);
/*
explicit CSingleLock(
CSyncObject* pObject,
BOOL bInitialLock = FALSE
);
*/
pSignalLock1 = new CSingleLock(ptrSemaphore);
pSignalLock2 = new CSingleLock(ptrSemaphore);
}
CShareResource::~CShareResource()
{
delete pSignalLock1;
delete pSignalLock2;
delete ptrSemaphore;
}
/*
Calls the Win32 function EnterCriticalSection, which waits until the thread can take ownership of the critical section object contained in the m_sec data member.
Returns S_OK on success, E_OUTOFMEMORY or E_FAIL on failure.
*/
BOOL CShareResource::Lock1()
{
return pSignalLock1->Lock();
}
BOOL CShareResource::UnLock1()
{
return pSignalLock1->Unlock();
}
BOOL CShareResource::IsLocked1()
{
return pSignalLock1->IsLocked();
}
BOOL CShareResource::Lock2()
{
return pSignalLock2->Lock();
}
BOOL CShareResource::UnLock2()
{
return pSignalLock2->Unlock();
}
BOOL CShareResource::IsLocked2()
{
return pSignalLock2->IsLocked();
}
| [
"soupyman@gmail.com"
] | soupyman@gmail.com |
f854a392a7ecd1aaaff1a991e160c62f741e1ee5 | 07168407ae9a8ac5856b1ba17d56e222fae9ed23 | /Max/model1_output/arduivis_MaxMSP_model1_output/arduivis_MaxMSP_model1_output.ino | 1f7b3eded3d9e010b19121b3be025450a4f95bdf | [] | no_license | cskonopka/arduivis | 67d7ef1957d60b94b47cbc5f9a8a63408fe859ea | b309f364de29ca71829937a50cb250ecf4c35f7d | refs/heads/master | 2020-04-15T23:51:46.836524 | 2020-02-10T04:26:30 | 2020-02-10T04:26:30 | 20,000,617 | 47 | 16 | null | null | null | null | UTF-8 | C++ | false | false | 1,253 | ino | /*
~~~~~~~ arduivis - MaxMSP ~~~~~~~
~~~~~~~~ model#1: output ~~~~~~~~
MaxMSP: arduivis_Max7_model1_MaxMSP_output.maxpat
This is an example of how to send data from
an Arduino and read it in MaxMSP via
a serial buffer.
This code is in the public domain
written by Christopher Konopka
http://cskonopka.github.io/arduivis/
http://christopherkonopka.com/
*/
void setup()
{
// Create/open serial port
Serial.begin(9600);
// Define LED mode
// PWM LED
pinMode(3, OUTPUT);
}
void loop()
{
// Loop variables
int lp = 0;
// Loop #1
// Incremental Loop
for(lp = 0; lp<=255; lp++) // Create incremental loop
{
// Incremental loop values to LED
// Controls PWM fade
analogWrite(3,lp);
// Incremental loop values to serial buffer
// [serial] object
// to MaxMSP, from Arduino
Serial.println(lp);
delay(10);
}
// Loop #2
// Decremental Loop
for(lp = 255; lp>=0; lp--) // Create decremental loop
{
// Deremental loop values to LED
// Controls PWM fade
analogWrite(3,lp);
// Decremental loop values to serial buffer
// [serial] object
// to MaxMSP, from Arduino
Serial.println(lp);
delay(10);
}
}
| [
"cskonopka@gmail.com"
] | cskonopka@gmail.com |
9b5f653bc8b763b3b2ae9b1ed41f49af15394b4a | 33c8b0c3d7428fb6f8eb47c4e745a441c53059d5 | /tmp/Code/Runtime/BerserkCore/Strings/Unicode.cpp | 5251fe6a40c7ea4e3da8aa6f0d531859ca936acb | [
"MIT"
] | permissive | EgorOrachyov/Berserk | be8d084d8f536d3fb8fa0502e597cdaf84a0e521 | 13972d73df813e7c2de6a680f3c100171d7be5e7 | refs/heads/master | 2022-01-12T22:30:31.124909 | 2021-12-31T17:14:21 | 2021-12-31T17:14:21 | 134,462,378 | 44 | 4 | null | 2019-01-22T23:21:32 | 2018-05-22T19:00:04 | C++ | UTF-8 | C++ | false | false | 49,380 | cpp | /**********************************************************************************/
/* This file is part of Berserk Engine project */
/* https://github.com/EgorOrachyov/Berserk */
/**********************************************************************************/
/* MIT License */
/* */
/* Copyright (c) 2018 - 2021 Egor Orachyov */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining a copy */
/* of this software and associated documentation files (the "Software"), to deal */
/* in the Software without restriction, including without limitation the rights */
/* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell */
/* copies of the Software, and to permit persons to whom the Software is */
/* furnished to do so, subject to the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be included in all */
/* copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
/* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
/* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
/* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
/* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
/* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
/* SOFTWARE. */
/**********************************************************************************/
#include <BerserkCore/Strings/Unicode.hpp>
namespace Berserk {
static const uint32 TO_UPPER_MAP_LEN = 666;
static const uint32 TO_LOWER_MAP_LEN = 665;
static const Unicode::Char32u TO_UPPER_MAP_TABLE[TO_UPPER_MAP_LEN][2] = {
{ 0x0061, 0x0041 },
{ 0x0062, 0x0042 },
{ 0x0063, 0x0043 },
{ 0x0064, 0x0044 },
{ 0x0065, 0x0045 },
{ 0x0066, 0x0046 },
{ 0x0067, 0x0047 },
{ 0x0068, 0x0048 },
{ 0x0069, 0x0049 },
{ 0x006A, 0x004A },
{ 0x006B, 0x004B },
{ 0x006C, 0x004C },
{ 0x006D, 0x004D },
{ 0x006E, 0x004E },
{ 0x006F, 0x004F },
{ 0x0070, 0x0050 },
{ 0x0071, 0x0051 },
{ 0x0072, 0x0052 },
{ 0x0073, 0x0053 },
{ 0x0074, 0x0054 },
{ 0x0075, 0x0055 },
{ 0x0076, 0x0056 },
{ 0x0077, 0x0057 },
{ 0x0078, 0x0058 },
{ 0x0079, 0x0059 },
{ 0x007A, 0x005A },
{ 0x00E0, 0x00C0 },
{ 0x00E1, 0x00C1 },
{ 0x00E2, 0x00C2 },
{ 0x00E3, 0x00C3 },
{ 0x00E4, 0x00C4 },
{ 0x00E5, 0x00C5 },
{ 0x00E6, 0x00C6 },
{ 0x00E7, 0x00C7 },
{ 0x00E8, 0x00C8 },
{ 0x00E9, 0x00C9 },
{ 0x00EA, 0x00CA },
{ 0x00EB, 0x00CB },
{ 0x00EC, 0x00CC },
{ 0x00ED, 0x00CD },
{ 0x00EE, 0x00CE },
{ 0x00EF, 0x00CF },
{ 0x00F0, 0x00D0 },
{ 0x00F1, 0x00D1 },
{ 0x00F2, 0x00D2 },
{ 0x00F3, 0x00D3 },
{ 0x00F4, 0x00D4 },
{ 0x00F5, 0x00D5 },
{ 0x00F6, 0x00D6 },
{ 0x00F8, 0x00D8 },
{ 0x00F9, 0x00D9 },
{ 0x00FA, 0x00DA },
{ 0x00FB, 0x00DB },
{ 0x00FC, 0x00DC },
{ 0x00FD, 0x00DD },
{ 0x00FE, 0x00DE },
{ 0x00FF, 0x0178 },
{ 0x0101, 0x0100 },
{ 0x0103, 0x0102 },
{ 0x0105, 0x0104 },
{ 0x0107, 0x0106 },
{ 0x0109, 0x0108 },
{ 0x010B, 0x010A },
{ 0x010D, 0x010C },
{ 0x010F, 0x010E },
{ 0x0111, 0x0110 },
{ 0x0113, 0x0112 },
{ 0x0115, 0x0114 },
{ 0x0117, 0x0116 },
{ 0x0119, 0x0118 },
{ 0x011B, 0x011A },
{ 0x011D, 0x011C },
{ 0x011F, 0x011E },
{ 0x0121, 0x0120 },
{ 0x0123, 0x0122 },
{ 0x0125, 0x0124 },
{ 0x0127, 0x0126 },
{ 0x0129, 0x0128 },
{ 0x012B, 0x012A },
{ 0x012D, 0x012C },
{ 0x012F, 0x012E },
{ 0x0131, 0x0049 },
{ 0x0133, 0x0132 },
{ 0x0135, 0x0134 },
{ 0x0137, 0x0136 },
{ 0x013A, 0x0139 },
{ 0x013C, 0x013B },
{ 0x013E, 0x013D },
{ 0x0140, 0x013F },
{ 0x0142, 0x0141 },
{ 0x0144, 0x0143 },
{ 0x0146, 0x0145 },
{ 0x0148, 0x0147 },
{ 0x014B, 0x014A },
{ 0x014D, 0x014C },
{ 0x014F, 0x014E },
{ 0x0151, 0x0150 },
{ 0x0153, 0x0152 },
{ 0x0155, 0x0154 },
{ 0x0157, 0x0156 },
{ 0x0159, 0x0158 },
{ 0x015B, 0x015A },
{ 0x015D, 0x015C },
{ 0x015F, 0x015E },
{ 0x0161, 0x0160 },
{ 0x0163, 0x0162 },
{ 0x0165, 0x0164 },
{ 0x0167, 0x0166 },
{ 0x0169, 0x0168 },
{ 0x016B, 0x016A },
{ 0x016D, 0x016C },
{ 0x016F, 0x016E },
{ 0x0171, 0x0170 },
{ 0x0173, 0x0172 },
{ 0x0175, 0x0174 },
{ 0x0177, 0x0176 },
{ 0x017A, 0x0179 },
{ 0x017C, 0x017B },
{ 0x017E, 0x017D },
{ 0x0183, 0x0182 },
{ 0x0185, 0x0184 },
{ 0x0188, 0x0187 },
{ 0x018C, 0x018B },
{ 0x0192, 0x0191 },
{ 0x0199, 0x0198 },
{ 0x01A1, 0x01A0 },
{ 0x01A3, 0x01A2 },
{ 0x01A5, 0x01A4 },
{ 0x01A8, 0x01A7 },
{ 0x01AD, 0x01AC },
{ 0x01B0, 0x01AF },
{ 0x01B4, 0x01B3 },
{ 0x01B6, 0x01B5 },
{ 0x01B9, 0x01B8 },
{ 0x01BD, 0x01BC },
{ 0x01C6, 0x01C4 },
{ 0x01C9, 0x01C7 },
{ 0x01CC, 0x01CA },
{ 0x01CE, 0x01CD },
{ 0x01D0, 0x01CF },
{ 0x01D2, 0x01D1 },
{ 0x01D4, 0x01D3 },
{ 0x01D6, 0x01D5 },
{ 0x01D8, 0x01D7 },
{ 0x01DA, 0x01D9 },
{ 0x01DC, 0x01DB },
{ 0x01DF, 0x01DE },
{ 0x01E1, 0x01E0 },
{ 0x01E3, 0x01E2 },
{ 0x01E5, 0x01E4 },
{ 0x01E7, 0x01E6 },
{ 0x01E9, 0x01E8 },
{ 0x01EB, 0x01EA },
{ 0x01ED, 0x01EC },
{ 0x01EF, 0x01EE },
{ 0x01F3, 0x01F1 },
{ 0x01F5, 0x01F4 },
{ 0x01FB, 0x01FA },
{ 0x01FD, 0x01FC },
{ 0x01FF, 0x01FE },
{ 0x0201, 0x0200 },
{ 0x0203, 0x0202 },
{ 0x0205, 0x0204 },
{ 0x0207, 0x0206 },
{ 0x0209, 0x0208 },
{ 0x020B, 0x020A },
{ 0x020D, 0x020C },
{ 0x020F, 0x020E },
{ 0x0211, 0x0210 },
{ 0x0213, 0x0212 },
{ 0x0215, 0x0214 },
{ 0x0217, 0x0216 },
{ 0x0253, 0x0181 },
{ 0x0254, 0x0186 },
{ 0x0257, 0x018A },
{ 0x0258, 0x018E },
{ 0x0259, 0x018F },
{ 0x025B, 0x0190 },
{ 0x0260, 0x0193 },
{ 0x0263, 0x0194 },
{ 0x0268, 0x0197 },
{ 0x0269, 0x0196 },
{ 0x026F, 0x019C },
{ 0x0272, 0x019D },
{ 0x0275, 0x019F },
{ 0x0283, 0x01A9 },
{ 0x0288, 0x01AE },
{ 0x028A, 0x01B1 },
{ 0x028B, 0x01B2 },
{ 0x0292, 0x01B7 },
{ 0x03AC, 0x0386 },
{ 0x03AD, 0x0388 },
{ 0x03AE, 0x0389 },
{ 0x03AF, 0x038A },
{ 0x03B1, 0x0391 },
{ 0x03B2, 0x0392 },
{ 0x03B3, 0x0393 },
{ 0x03B4, 0x0394 },
{ 0x03B5, 0x0395 },
{ 0x03B6, 0x0396 },
{ 0x03B7, 0x0397 },
{ 0x03B8, 0x0398 },
{ 0x03B9, 0x0399 },
{ 0x03BA, 0x039A },
{ 0x03BB, 0x039B },
{ 0x03BC, 0x039C },
{ 0x03BD, 0x039D },
{ 0x03BE, 0x039E },
{ 0x03BF, 0x039F },
{ 0x03C0, 0x03A0 },
{ 0x03C1, 0x03A1 },
{ 0x03C3, 0x03A3 },
{ 0x03C4, 0x03A4 },
{ 0x03C5, 0x03A5 },
{ 0x03C6, 0x03A6 },
{ 0x03C7, 0x03A7 },
{ 0x03C8, 0x03A8 },
{ 0x03C9, 0x03A9 },
{ 0x03CA, 0x03AA },
{ 0x03CB, 0x03AB },
{ 0x03CC, 0x038C },
{ 0x03CD, 0x038E },
{ 0x03CE, 0x038F },
{ 0x03E3, 0x03E2 },
{ 0x03E5, 0x03E4 },
{ 0x03E7, 0x03E6 },
{ 0x03E9, 0x03E8 },
{ 0x03EB, 0x03EA },
{ 0x03ED, 0x03EC },
{ 0x03EF, 0x03EE },
{ 0x0430, 0x0410 },
{ 0x0431, 0x0411 },
{ 0x0432, 0x0412 },
{ 0x0433, 0x0413 },
{ 0x0434, 0x0414 },
{ 0x0435, 0x0415 },
{ 0x0436, 0x0416 },
{ 0x0437, 0x0417 },
{ 0x0438, 0x0418 },
{ 0x0439, 0x0419 },
{ 0x043A, 0x041A },
{ 0x043B, 0x041B },
{ 0x043C, 0x041C },
{ 0x043D, 0x041D },
{ 0x043E, 0x041E },
{ 0x043F, 0x041F },
{ 0x0440, 0x0420 },
{ 0x0441, 0x0421 },
{ 0x0442, 0x0422 },
{ 0x0443, 0x0423 },
{ 0x0444, 0x0424 },
{ 0x0445, 0x0425 },
{ 0x0446, 0x0426 },
{ 0x0447, 0x0427 },
{ 0x0448, 0x0428 },
{ 0x0449, 0x0429 },
{ 0x044A, 0x042A },
{ 0x044B, 0x042B },
{ 0x044C, 0x042C },
{ 0x044D, 0x042D },
{ 0x044E, 0x042E },
{ 0x044F, 0x042F },
{ 0x0451, 0x0401 },
{ 0x0452, 0x0402 },
{ 0x0453, 0x0403 },
{ 0x0454, 0x0404 },
{ 0x0455, 0x0405 },
{ 0x0456, 0x0406 },
{ 0x0457, 0x0407 },
{ 0x0458, 0x0408 },
{ 0x0459, 0x0409 },
{ 0x045A, 0x040A },
{ 0x045B, 0x040B },
{ 0x045C, 0x040C },
{ 0x045E, 0x040E },
{ 0x045F, 0x040F },
{ 0x0461, 0x0460 },
{ 0x0463, 0x0462 },
{ 0x0465, 0x0464 },
{ 0x0467, 0x0466 },
{ 0x0469, 0x0468 },
{ 0x046B, 0x046A },
{ 0x046D, 0x046C },
{ 0x046F, 0x046E },
{ 0x0471, 0x0470 },
{ 0x0473, 0x0472 },
{ 0x0475, 0x0474 },
{ 0x0477, 0x0476 },
{ 0x0479, 0x0478 },
{ 0x047B, 0x047A },
{ 0x047D, 0x047C },
{ 0x047F, 0x047E },
{ 0x0481, 0x0480 },
{ 0x0491, 0x0490 },
{ 0x0493, 0x0492 },
{ 0x0495, 0x0494 },
{ 0x0497, 0x0496 },
{ 0x0499, 0x0498 },
{ 0x049B, 0x049A },
{ 0x049D, 0x049C },
{ 0x049F, 0x049E },
{ 0x04A1, 0x04A0 },
{ 0x04A3, 0x04A2 },
{ 0x04A5, 0x04A4 },
{ 0x04A7, 0x04A6 },
{ 0x04A9, 0x04A8 },
{ 0x04AB, 0x04AA },
{ 0x04AD, 0x04AC },
{ 0x04AF, 0x04AE },
{ 0x04B1, 0x04B0 },
{ 0x04B3, 0x04B2 },
{ 0x04B5, 0x04B4 },
{ 0x04B7, 0x04B6 },
{ 0x04B9, 0x04B8 },
{ 0x04BB, 0x04BA },
{ 0x04BD, 0x04BC },
{ 0x04BF, 0x04BE },
{ 0x04C2, 0x04C1 },
{ 0x04C4, 0x04C3 },
{ 0x04C8, 0x04C7 },
{ 0x04CC, 0x04CB },
{ 0x04D1, 0x04D0 },
{ 0x04D3, 0x04D2 },
{ 0x04D5, 0x04D4 },
{ 0x04D7, 0x04D6 },
{ 0x04D9, 0x04D8 },
{ 0x04DB, 0x04DA },
{ 0x04DD, 0x04DC },
{ 0x04DF, 0x04DE },
{ 0x04E1, 0x04E0 },
{ 0x04E3, 0x04E2 },
{ 0x04E5, 0x04E4 },
{ 0x04E7, 0x04E6 },
{ 0x04E9, 0x04E8 },
{ 0x04EB, 0x04EA },
{ 0x04EF, 0x04EE },
{ 0x04F1, 0x04F0 },
{ 0x04F3, 0x04F2 },
{ 0x04F5, 0x04F4 },
{ 0x04F9, 0x04F8 },
{ 0x0561, 0x0531 },
{ 0x0562, 0x0532 },
{ 0x0563, 0x0533 },
{ 0x0564, 0x0534 },
{ 0x0565, 0x0535 },
{ 0x0566, 0x0536 },
{ 0x0567, 0x0537 },
{ 0x0568, 0x0538 },
{ 0x0569, 0x0539 },
{ 0x056A, 0x053A },
{ 0x056B, 0x053B },
{ 0x056C, 0x053C },
{ 0x056D, 0x053D },
{ 0x056E, 0x053E },
{ 0x056F, 0x053F },
{ 0x0570, 0x0540 },
{ 0x0571, 0x0541 },
{ 0x0572, 0x0542 },
{ 0x0573, 0x0543 },
{ 0x0574, 0x0544 },
{ 0x0575, 0x0545 },
{ 0x0576, 0x0546 },
{ 0x0577, 0x0547 },
{ 0x0578, 0x0548 },
{ 0x0579, 0x0549 },
{ 0x057A, 0x054A },
{ 0x057B, 0x054B },
{ 0x057C, 0x054C },
{ 0x057D, 0x054D },
{ 0x057E, 0x054E },
{ 0x057F, 0x054F },
{ 0x0580, 0x0550 },
{ 0x0581, 0x0551 },
{ 0x0582, 0x0552 },
{ 0x0583, 0x0553 },
{ 0x0584, 0x0554 },
{ 0x0585, 0x0555 },
{ 0x0586, 0x0556 },
{ 0x10D0, 0x10A0 },
{ 0x10D1, 0x10A1 },
{ 0x10D2, 0x10A2 },
{ 0x10D3, 0x10A3 },
{ 0x10D4, 0x10A4 },
{ 0x10D5, 0x10A5 },
{ 0x10D6, 0x10A6 },
{ 0x10D7, 0x10A7 },
{ 0x10D8, 0x10A8 },
{ 0x10D9, 0x10A9 },
{ 0x10DA, 0x10AA },
{ 0x10DB, 0x10AB },
{ 0x10DC, 0x10AC },
{ 0x10DD, 0x10AD },
{ 0x10DE, 0x10AE },
{ 0x10DF, 0x10AF },
{ 0x10E0, 0x10B0 },
{ 0x10E1, 0x10B1 },
{ 0x10E2, 0x10B2 },
{ 0x10E3, 0x10B3 },
{ 0x10E4, 0x10B4 },
{ 0x10E5, 0x10B5 },
{ 0x10E6, 0x10B6 },
{ 0x10E7, 0x10B7 },
{ 0x10E8, 0x10B8 },
{ 0x10E9, 0x10B9 },
{ 0x10EA, 0x10BA },
{ 0x10EB, 0x10BB },
{ 0x10EC, 0x10BC },
{ 0x10ED, 0x10BD },
{ 0x10EE, 0x10BE },
{ 0x10EF, 0x10BF },
{ 0x10F0, 0x10C0 },
{ 0x10F1, 0x10C1 },
{ 0x10F2, 0x10C2 },
{ 0x10F3, 0x10C3 },
{ 0x10F4, 0x10C4 },
{ 0x10F5, 0x10C5 },
{ 0x1E01, 0x1E00 },
{ 0x1E03, 0x1E02 },
{ 0x1E05, 0x1E04 },
{ 0x1E07, 0x1E06 },
{ 0x1E09, 0x1E08 },
{ 0x1E0B, 0x1E0A },
{ 0x1E0D, 0x1E0C },
{ 0x1E0F, 0x1E0E },
{ 0x1E11, 0x1E10 },
{ 0x1E13, 0x1E12 },
{ 0x1E15, 0x1E14 },
{ 0x1E17, 0x1E16 },
{ 0x1E19, 0x1E18 },
{ 0x1E1B, 0x1E1A },
{ 0x1E1D, 0x1E1C },
{ 0x1E1F, 0x1E1E },
{ 0x1E21, 0x1E20 },
{ 0x1E23, 0x1E22 },
{ 0x1E25, 0x1E24 },
{ 0x1E27, 0x1E26 },
{ 0x1E29, 0x1E28 },
{ 0x1E2B, 0x1E2A },
{ 0x1E2D, 0x1E2C },
{ 0x1E2F, 0x1E2E },
{ 0x1E31, 0x1E30 },
{ 0x1E33, 0x1E32 },
{ 0x1E35, 0x1E34 },
{ 0x1E37, 0x1E36 },
{ 0x1E39, 0x1E38 },
{ 0x1E3B, 0x1E3A },
{ 0x1E3D, 0x1E3C },
{ 0x1E3F, 0x1E3E },
{ 0x1E41, 0x1E40 },
{ 0x1E43, 0x1E42 },
{ 0x1E45, 0x1E44 },
{ 0x1E47, 0x1E46 },
{ 0x1E49, 0x1E48 },
{ 0x1E4B, 0x1E4A },
{ 0x1E4D, 0x1E4C },
{ 0x1E4F, 0x1E4E },
{ 0x1E51, 0x1E50 },
{ 0x1E53, 0x1E52 },
{ 0x1E55, 0x1E54 },
{ 0x1E57, 0x1E56 },
{ 0x1E59, 0x1E58 },
{ 0x1E5B, 0x1E5A },
{ 0x1E5D, 0x1E5C },
{ 0x1E5F, 0x1E5E },
{ 0x1E61, 0x1E60 },
{ 0x1E63, 0x1E62 },
{ 0x1E65, 0x1E64 },
{ 0x1E67, 0x1E66 },
{ 0x1E69, 0x1E68 },
{ 0x1E6B, 0x1E6A },
{ 0x1E6D, 0x1E6C },
{ 0x1E6F, 0x1E6E },
{ 0x1E71, 0x1E70 },
{ 0x1E73, 0x1E72 },
{ 0x1E75, 0x1E74 },
{ 0x1E77, 0x1E76 },
{ 0x1E79, 0x1E78 },
{ 0x1E7B, 0x1E7A },
{ 0x1E7D, 0x1E7C },
{ 0x1E7F, 0x1E7E },
{ 0x1E81, 0x1E80 },
{ 0x1E83, 0x1E82 },
{ 0x1E85, 0x1E84 },
{ 0x1E87, 0x1E86 },
{ 0x1E89, 0x1E88 },
{ 0x1E8B, 0x1E8A },
{ 0x1E8D, 0x1E8C },
{ 0x1E8F, 0x1E8E },
{ 0x1E91, 0x1E90 },
{ 0x1E93, 0x1E92 },
{ 0x1E95, 0x1E94 },
{ 0x1EA1, 0x1EA0 },
{ 0x1EA3, 0x1EA2 },
{ 0x1EA5, 0x1EA4 },
{ 0x1EA7, 0x1EA6 },
{ 0x1EA9, 0x1EA8 },
{ 0x1EAB, 0x1EAA },
{ 0x1EAD, 0x1EAC },
{ 0x1EAF, 0x1EAE },
{ 0x1EB1, 0x1EB0 },
{ 0x1EB3, 0x1EB2 },
{ 0x1EB5, 0x1EB4 },
{ 0x1EB7, 0x1EB6 },
{ 0x1EB9, 0x1EB8 },
{ 0x1EBB, 0x1EBA },
{ 0x1EBD, 0x1EBC },
{ 0x1EBF, 0x1EBE },
{ 0x1EC1, 0x1EC0 },
{ 0x1EC3, 0x1EC2 },
{ 0x1EC5, 0x1EC4 },
{ 0x1EC7, 0x1EC6 },
{ 0x1EC9, 0x1EC8 },
{ 0x1ECB, 0x1ECA },
{ 0x1ECD, 0x1ECC },
{ 0x1ECF, 0x1ECE },
{ 0x1ED1, 0x1ED0 },
{ 0x1ED3, 0x1ED2 },
{ 0x1ED5, 0x1ED4 },
{ 0x1ED7, 0x1ED6 },
{ 0x1ED9, 0x1ED8 },
{ 0x1EDB, 0x1EDA },
{ 0x1EDD, 0x1EDC },
{ 0x1EDF, 0x1EDE },
{ 0x1EE1, 0x1EE0 },
{ 0x1EE3, 0x1EE2 },
{ 0x1EE5, 0x1EE4 },
{ 0x1EE7, 0x1EE6 },
{ 0x1EE9, 0x1EE8 },
{ 0x1EEB, 0x1EEA },
{ 0x1EED, 0x1EEC },
{ 0x1EEF, 0x1EEE },
{ 0x1EF1, 0x1EF0 },
{ 0x1EF3, 0x1EF2 },
{ 0x1EF5, 0x1EF4 },
{ 0x1EF7, 0x1EF6 },
{ 0x1EF9, 0x1EF8 },
{ 0x1F00, 0x1F08 },
{ 0x1F01, 0x1F09 },
{ 0x1F02, 0x1F0A },
{ 0x1F03, 0x1F0B },
{ 0x1F04, 0x1F0C },
{ 0x1F05, 0x1F0D },
{ 0x1F06, 0x1F0E },
{ 0x1F07, 0x1F0F },
{ 0x1F10, 0x1F18 },
{ 0x1F11, 0x1F19 },
{ 0x1F12, 0x1F1A },
{ 0x1F13, 0x1F1B },
{ 0x1F14, 0x1F1C },
{ 0x1F15, 0x1F1D },
{ 0x1F20, 0x1F28 },
{ 0x1F21, 0x1F29 },
{ 0x1F22, 0x1F2A },
{ 0x1F23, 0x1F2B },
{ 0x1F24, 0x1F2C },
{ 0x1F25, 0x1F2D },
{ 0x1F26, 0x1F2E },
{ 0x1F27, 0x1F2F },
{ 0x1F30, 0x1F38 },
{ 0x1F31, 0x1F39 },
{ 0x1F32, 0x1F3A },
{ 0x1F33, 0x1F3B },
{ 0x1F34, 0x1F3C },
{ 0x1F35, 0x1F3D },
{ 0x1F36, 0x1F3E },
{ 0x1F37, 0x1F3F },
{ 0x1F40, 0x1F48 },
{ 0x1F41, 0x1F49 },
{ 0x1F42, 0x1F4A },
{ 0x1F43, 0x1F4B },
{ 0x1F44, 0x1F4C },
{ 0x1F45, 0x1F4D },
{ 0x1F51, 0x1F59 },
{ 0x1F53, 0x1F5B },
{ 0x1F55, 0x1F5D },
{ 0x1F57, 0x1F5F },
{ 0x1F60, 0x1F68 },
{ 0x1F61, 0x1F69 },
{ 0x1F62, 0x1F6A },
{ 0x1F63, 0x1F6B },
{ 0x1F64, 0x1F6C },
{ 0x1F65, 0x1F6D },
{ 0x1F66, 0x1F6E },
{ 0x1F67, 0x1F6F },
{ 0x1F80, 0x1F88 },
{ 0x1F81, 0x1F89 },
{ 0x1F82, 0x1F8A },
{ 0x1F83, 0x1F8B },
{ 0x1F84, 0x1F8C },
{ 0x1F85, 0x1F8D },
{ 0x1F86, 0x1F8E },
{ 0x1F87, 0x1F8F },
{ 0x1F90, 0x1F98 },
{ 0x1F91, 0x1F99 },
{ 0x1F92, 0x1F9A },
{ 0x1F93, 0x1F9B },
{ 0x1F94, 0x1F9C },
{ 0x1F95, 0x1F9D },
{ 0x1F96, 0x1F9E },
{ 0x1F97, 0x1F9F },
{ 0x1FA0, 0x1FA8 },
{ 0x1FA1, 0x1FA9 },
{ 0x1FA2, 0x1FAA },
{ 0x1FA3, 0x1FAB },
{ 0x1FA4, 0x1FAC },
{ 0x1FA5, 0x1FAD },
{ 0x1FA6, 0x1FAE },
{ 0x1FA7, 0x1FAF },
{ 0x1FB0, 0x1FB8 },
{ 0x1FB1, 0x1FB9 },
{ 0x1FD0, 0x1FD8 },
{ 0x1FD1, 0x1FD9 },
{ 0x1FE0, 0x1FE8 },
{ 0x1FE1, 0x1FE9 },
{ 0x24D0, 0x24B6 },
{ 0x24D1, 0x24B7 },
{ 0x24D2, 0x24B8 },
{ 0x24D3, 0x24B9 },
{ 0x24D4, 0x24BA },
{ 0x24D5, 0x24BB },
{ 0x24D6, 0x24BC },
{ 0x24D7, 0x24BD },
{ 0x24D8, 0x24BE },
{ 0x24D9, 0x24BF },
{ 0x24DA, 0x24C0 },
{ 0x24DB, 0x24C1 },
{ 0x24DC, 0x24C2 },
{ 0x24DD, 0x24C3 },
{ 0x24DE, 0x24C4 },
{ 0x24DF, 0x24C5 },
{ 0x24E0, 0x24C6 },
{ 0x24E1, 0x24C7 },
{ 0x24E2, 0x24C8 },
{ 0x24E3, 0x24C9 },
{ 0x24E4, 0x24CA },
{ 0x24E5, 0x24CB },
{ 0x24E6, 0x24CC },
{ 0x24E7, 0x24CD },
{ 0x24E8, 0x24CE },
{ 0x24E9, 0x24CF },
{ 0xFF41, 0xFF21 },
{ 0xFF42, 0xFF22 },
{ 0xFF43, 0xFF23 },
{ 0xFF44, 0xFF24 },
{ 0xFF45, 0xFF25 },
{ 0xFF46, 0xFF26 },
{ 0xFF47, 0xFF27 },
{ 0xFF48, 0xFF28 },
{ 0xFF49, 0xFF29 },
{ 0xFF4A, 0xFF2A },
{ 0xFF4B, 0xFF2B },
{ 0xFF4C, 0xFF2C },
{ 0xFF4D, 0xFF2D },
{ 0xFF4E, 0xFF2E },
{ 0xFF4F, 0xFF2F },
{ 0xFF50, 0xFF30 },
{ 0xFF51, 0xFF31 },
{ 0xFF52, 0xFF32 },
{ 0xFF53, 0xFF33 },
{ 0xFF54, 0xFF34 },
{ 0xFF55, 0xFF35 },
{ 0xFF56, 0xFF36 },
{ 0xFF57, 0xFF37 },
{ 0xFF58, 0xFF38 },
{ 0xFF59, 0xFF39 },
{ 0xFF5A, 0xFF3A },
};
static const Unicode::Char32u TO_LOWER_MAP_TABLE[TO_LOWER_MAP_LEN][2] = {
{ 0x0041, 0x0061 },
{ 0x0042, 0x0062 },
{ 0x0043, 0x0063 },
{ 0x0044, 0x0064 },
{ 0x0045, 0x0065 },
{ 0x0046, 0x0066 },
{ 0x0047, 0x0067 },
{ 0x0048, 0x0068 },
{ 0x0049, 0x0069 },
// { 0x0049, 0x0131 }, // dotless I
{ 0x004A, 0x006A },
{ 0x004B, 0x006B },
{ 0x004C, 0x006C },
{ 0x004D, 0x006D },
{ 0x004E, 0x006E },
{ 0x004F, 0x006F },
{ 0x0050, 0x0070 },
{ 0x0051, 0x0071 },
{ 0x0052, 0x0072 },
{ 0x0053, 0x0073 },
{ 0x0054, 0x0074 },
{ 0x0055, 0x0075 },
{ 0x0056, 0x0076 },
{ 0x0057, 0x0077 },
{ 0x0058, 0x0078 },
{ 0x0059, 0x0079 },
{ 0x005A, 0x007A },
{ 0x00C0, 0x00E0 },
{ 0x00C1, 0x00E1 },
{ 0x00C2, 0x00E2 },
{ 0x00C3, 0x00E3 },
{ 0x00C4, 0x00E4 },
{ 0x00C5, 0x00E5 },
{ 0x00C6, 0x00E6 },
{ 0x00C7, 0x00E7 },
{ 0x00C8, 0x00E8 },
{ 0x00C9, 0x00E9 },
{ 0x00CA, 0x00EA },
{ 0x00CB, 0x00EB },
{ 0x00CC, 0x00EC },
{ 0x00CD, 0x00ED },
{ 0x00CE, 0x00EE },
{ 0x00CF, 0x00EF },
{ 0x00D0, 0x00F0 },
{ 0x00D1, 0x00F1 },
{ 0x00D2, 0x00F2 },
{ 0x00D3, 0x00F3 },
{ 0x00D4, 0x00F4 },
{ 0x00D5, 0x00F5 },
{ 0x00D6, 0x00F6 },
{ 0x00D8, 0x00F8 },
{ 0x00D9, 0x00F9 },
{ 0x00DA, 0x00FA },
{ 0x00DB, 0x00FB },
{ 0x00DC, 0x00FC },
{ 0x00DD, 0x00FD },
{ 0x00DE, 0x00FE },
{ 0x0100, 0x0101 },
{ 0x0102, 0x0103 },
{ 0x0104, 0x0105 },
{ 0x0106, 0x0107 },
{ 0x0108, 0x0109 },
{ 0x010A, 0x010B },
{ 0x010C, 0x010D },
{ 0x010E, 0x010F },
{ 0x0110, 0x0111 },
{ 0x0112, 0x0113 },
{ 0x0114, 0x0115 },
{ 0x0116, 0x0117 },
{ 0x0118, 0x0119 },
{ 0x011A, 0x011B },
{ 0x011C, 0x011D },
{ 0x011E, 0x011F },
{ 0x0120, 0x0121 },
{ 0x0122, 0x0123 },
{ 0x0124, 0x0125 },
{ 0x0126, 0x0127 },
{ 0x0128, 0x0129 },
{ 0x012A, 0x012B },
{ 0x012C, 0x012D },
{ 0x012E, 0x012F },
{ 0x0132, 0x0133 },
{ 0x0134, 0x0135 },
{ 0x0136, 0x0137 },
{ 0x0139, 0x013A },
{ 0x013B, 0x013C },
{ 0x013D, 0x013E },
{ 0x013F, 0x0140 },
{ 0x0141, 0x0142 },
{ 0x0143, 0x0144 },
{ 0x0145, 0x0146 },
{ 0x0147, 0x0148 },
{ 0x014A, 0x014B },
{ 0x014C, 0x014D },
{ 0x014E, 0x014F },
{ 0x0150, 0x0151 },
{ 0x0152, 0x0153 },
{ 0x0154, 0x0155 },
{ 0x0156, 0x0157 },
{ 0x0158, 0x0159 },
{ 0x015A, 0x015B },
{ 0x015C, 0x015D },
{ 0x015E, 0x015F },
{ 0x0160, 0x0161 },
{ 0x0162, 0x0163 },
{ 0x0164, 0x0165 },
{ 0x0166, 0x0167 },
{ 0x0168, 0x0169 },
{ 0x016A, 0x016B },
{ 0x016C, 0x016D },
{ 0x016E, 0x016F },
{ 0x0170, 0x0171 },
{ 0x0172, 0x0173 },
{ 0x0174, 0x0175 },
{ 0x0176, 0x0177 },
{ 0x0178, 0x00FF },
{ 0x0179, 0x017A },
{ 0x017B, 0x017C },
{ 0x017D, 0x017E },
{ 0x0181, 0x0253 },
{ 0x0182, 0x0183 },
{ 0x0184, 0x0185 },
{ 0x0186, 0x0254 },
{ 0x0187, 0x0188 },
{ 0x018A, 0x0257 },
{ 0x018B, 0x018C },
{ 0x018E, 0x0258 },
{ 0x018F, 0x0259 },
{ 0x0190, 0x025B },
{ 0x0191, 0x0192 },
{ 0x0193, 0x0260 },
{ 0x0194, 0x0263 },
{ 0x0196, 0x0269 },
{ 0x0197, 0x0268 },
{ 0x0198, 0x0199 },
{ 0x019C, 0x026F },
{ 0x019D, 0x0272 },
{ 0x019F, 0x0275 },
{ 0x01A0, 0x01A1 },
{ 0x01A2, 0x01A3 },
{ 0x01A4, 0x01A5 },
{ 0x01A7, 0x01A8 },
{ 0x01A9, 0x0283 },
{ 0x01AC, 0x01AD },
{ 0x01AE, 0x0288 },
{ 0x01AF, 0x01B0 },
{ 0x01B1, 0x028A },
{ 0x01B2, 0x028B },
{ 0x01B3, 0x01B4 },
{ 0x01B5, 0x01B6 },
{ 0x01B7, 0x0292 },
{ 0x01B8, 0x01B9 },
{ 0x01BC, 0x01BD },
{ 0x01C4, 0x01C6 },
{ 0x01C7, 0x01C9 },
{ 0x01CA, 0x01CC },
{ 0x01CD, 0x01CE },
{ 0x01CF, 0x01D0 },
{ 0x01D1, 0x01D2 },
{ 0x01D3, 0x01D4 },
{ 0x01D5, 0x01D6 },
{ 0x01D7, 0x01D8 },
{ 0x01D9, 0x01DA },
{ 0x01DB, 0x01DC },
{ 0x01DE, 0x01DF },
{ 0x01E0, 0x01E1 },
{ 0x01E2, 0x01E3 },
{ 0x01E4, 0x01E5 },
{ 0x01E6, 0x01E7 },
{ 0x01E8, 0x01E9 },
{ 0x01EA, 0x01EB },
{ 0x01EC, 0x01ED },
{ 0x01EE, 0x01EF },
{ 0x01F1, 0x01F3 },
{ 0x01F4, 0x01F5 },
{ 0x01FA, 0x01FB },
{ 0x01FC, 0x01FD },
{ 0x01FE, 0x01FF },
{ 0x0200, 0x0201 },
{ 0x0202, 0x0203 },
{ 0x0204, 0x0205 },
{ 0x0206, 0x0207 },
{ 0x0208, 0x0209 },
{ 0x020A, 0x020B },
{ 0x020C, 0x020D },
{ 0x020E, 0x020F },
{ 0x0210, 0x0211 },
{ 0x0212, 0x0213 },
{ 0x0214, 0x0215 },
{ 0x0216, 0x0217 },
{ 0x0386, 0x03AC },
{ 0x0388, 0x03AD },
{ 0x0389, 0x03AE },
{ 0x038A, 0x03AF },
{ 0x038C, 0x03CC },
{ 0x038E, 0x03CD },
{ 0x038F, 0x03CE },
{ 0x0391, 0x03B1 },
{ 0x0392, 0x03B2 },
{ 0x0393, 0x03B3 },
{ 0x0394, 0x03B4 },
{ 0x0395, 0x03B5 },
{ 0x0396, 0x03B6 },
{ 0x0397, 0x03B7 },
{ 0x0398, 0x03B8 },
{ 0x0399, 0x03B9 },
{ 0x039A, 0x03BA },
{ 0x039B, 0x03BB },
{ 0x039C, 0x03BC },
{ 0x039D, 0x03BD },
{ 0x039E, 0x03BE },
{ 0x039F, 0x03BF },
{ 0x03A0, 0x03C0 },
{ 0x03A1, 0x03C1 },
{ 0x03A3, 0x03C3 },
{ 0x03A4, 0x03C4 },
{ 0x03A5, 0x03C5 },
{ 0x03A6, 0x03C6 },
{ 0x03A7, 0x03C7 },
{ 0x03A8, 0x03C8 },
{ 0x03A9, 0x03C9 },
{ 0x03AA, 0x03CA },
{ 0x03AB, 0x03CB },
{ 0x03E2, 0x03E3 },
{ 0x03E4, 0x03E5 },
{ 0x03E6, 0x03E7 },
{ 0x03E8, 0x03E9 },
{ 0x03EA, 0x03EB },
{ 0x03EC, 0x03ED },
{ 0x03EE, 0x03EF },
{ 0x0401, 0x0451 },
{ 0x0402, 0x0452 },
{ 0x0403, 0x0453 },
{ 0x0404, 0x0454 },
{ 0x0405, 0x0455 },
{ 0x0406, 0x0456 },
{ 0x0407, 0x0457 },
{ 0x0408, 0x0458 },
{ 0x0409, 0x0459 },
{ 0x040A, 0x045A },
{ 0x040B, 0x045B },
{ 0x040C, 0x045C },
{ 0x040E, 0x045E },
{ 0x040F, 0x045F },
{ 0x0410, 0x0430 },
{ 0x0411, 0x0431 },
{ 0x0412, 0x0432 },
{ 0x0413, 0x0433 },
{ 0x0414, 0x0434 },
{ 0x0415, 0x0435 },
{ 0x0416, 0x0436 },
{ 0x0417, 0x0437 },
{ 0x0418, 0x0438 },
{ 0x0419, 0x0439 },
{ 0x041A, 0x043A },
{ 0x041B, 0x043B },
{ 0x041C, 0x043C },
{ 0x041D, 0x043D },
{ 0x041E, 0x043E },
{ 0x041F, 0x043F },
{ 0x0420, 0x0440 },
{ 0x0421, 0x0441 },
{ 0x0422, 0x0442 },
{ 0x0423, 0x0443 },
{ 0x0424, 0x0444 },
{ 0x0425, 0x0445 },
{ 0x0426, 0x0446 },
{ 0x0427, 0x0447 },
{ 0x0428, 0x0448 },
{ 0x0429, 0x0449 },
{ 0x042A, 0x044A },
{ 0x042B, 0x044B },
{ 0x042C, 0x044C },
{ 0x042D, 0x044D },
{ 0x042E, 0x044E },
{ 0x042F, 0x044F },
{ 0x0460, 0x0461 },
{ 0x0462, 0x0463 },
{ 0x0464, 0x0465 },
{ 0x0466, 0x0467 },
{ 0x0468, 0x0469 },
{ 0x046A, 0x046B },
{ 0x046C, 0x046D },
{ 0x046E, 0x046F },
{ 0x0470, 0x0471 },
{ 0x0472, 0x0473 },
{ 0x0474, 0x0475 },
{ 0x0476, 0x0477 },
{ 0x0478, 0x0479 },
{ 0x047A, 0x047B },
{ 0x047C, 0x047D },
{ 0x047E, 0x047F },
{ 0x0480, 0x0481 },
{ 0x0490, 0x0491 },
{ 0x0492, 0x0493 },
{ 0x0494, 0x0495 },
{ 0x0496, 0x0497 },
{ 0x0498, 0x0499 },
{ 0x049A, 0x049B },
{ 0x049C, 0x049D },
{ 0x049E, 0x049F },
{ 0x04A0, 0x04A1 },
{ 0x04A2, 0x04A3 },
{ 0x04A4, 0x04A5 },
{ 0x04A6, 0x04A7 },
{ 0x04A8, 0x04A9 },
{ 0x04AA, 0x04AB },
{ 0x04AC, 0x04AD },
{ 0x04AE, 0x04AF },
{ 0x04B0, 0x04B1 },
{ 0x04B2, 0x04B3 },
{ 0x04B4, 0x04B5 },
{ 0x04B6, 0x04B7 },
{ 0x04B8, 0x04B9 },
{ 0x04BA, 0x04BB },
{ 0x04BC, 0x04BD },
{ 0x04BE, 0x04BF },
{ 0x04C1, 0x04C2 },
{ 0x04C3, 0x04C4 },
{ 0x04C7, 0x04C8 },
{ 0x04CB, 0x04CC },
{ 0x04D0, 0x04D1 },
{ 0x04D2, 0x04D3 },
{ 0x04D4, 0x04D5 },
{ 0x04D6, 0x04D7 },
{ 0x04D8, 0x04D9 },
{ 0x04DA, 0x04DB },
{ 0x04DC, 0x04DD },
{ 0x04DE, 0x04DF },
{ 0x04E0, 0x04E1 },
{ 0x04E2, 0x04E3 },
{ 0x04E4, 0x04E5 },
{ 0x04E6, 0x04E7 },
{ 0x04E8, 0x04E9 },
{ 0x04EA, 0x04EB },
{ 0x04EE, 0x04EF },
{ 0x04F0, 0x04F1 },
{ 0x04F2, 0x04F3 },
{ 0x04F4, 0x04F5 },
{ 0x04F8, 0x04F9 },
{ 0x0531, 0x0561 },
{ 0x0532, 0x0562 },
{ 0x0533, 0x0563 },
{ 0x0534, 0x0564 },
{ 0x0535, 0x0565 },
{ 0x0536, 0x0566 },
{ 0x0537, 0x0567 },
{ 0x0538, 0x0568 },
{ 0x0539, 0x0569 },
{ 0x053A, 0x056A },
{ 0x053B, 0x056B },
{ 0x053C, 0x056C },
{ 0x053D, 0x056D },
{ 0x053E, 0x056E },
{ 0x053F, 0x056F },
{ 0x0540, 0x0570 },
{ 0x0541, 0x0571 },
{ 0x0542, 0x0572 },
{ 0x0543, 0x0573 },
{ 0x0544, 0x0574 },
{ 0x0545, 0x0575 },
{ 0x0546, 0x0576 },
{ 0x0547, 0x0577 },
{ 0x0548, 0x0578 },
{ 0x0549, 0x0579 },
{ 0x054A, 0x057A },
{ 0x054B, 0x057B },
{ 0x054C, 0x057C },
{ 0x054D, 0x057D },
{ 0x054E, 0x057E },
{ 0x054F, 0x057F },
{ 0x0550, 0x0580 },
{ 0x0551, 0x0581 },
{ 0x0552, 0x0582 },
{ 0x0553, 0x0583 },
{ 0x0554, 0x0584 },
{ 0x0555, 0x0585 },
{ 0x0556, 0x0586 },
{ 0x10A0, 0x10D0 },
{ 0x10A1, 0x10D1 },
{ 0x10A2, 0x10D2 },
{ 0x10A3, 0x10D3 },
{ 0x10A4, 0x10D4 },
{ 0x10A5, 0x10D5 },
{ 0x10A6, 0x10D6 },
{ 0x10A7, 0x10D7 },
{ 0x10A8, 0x10D8 },
{ 0x10A9, 0x10D9 },
{ 0x10AA, 0x10DA },
{ 0x10AB, 0x10DB },
{ 0x10AC, 0x10DC },
{ 0x10AD, 0x10DD },
{ 0x10AE, 0x10DE },
{ 0x10AF, 0x10DF },
{ 0x10B0, 0x10E0 },
{ 0x10B1, 0x10E1 },
{ 0x10B2, 0x10E2 },
{ 0x10B3, 0x10E3 },
{ 0x10B4, 0x10E4 },
{ 0x10B5, 0x10E5 },
{ 0x10B6, 0x10E6 },
{ 0x10B7, 0x10E7 },
{ 0x10B8, 0x10E8 },
{ 0x10B9, 0x10E9 },
{ 0x10BA, 0x10EA },
{ 0x10BB, 0x10EB },
{ 0x10BC, 0x10EC },
{ 0x10BD, 0x10ED },
{ 0x10BE, 0x10EE },
{ 0x10BF, 0x10EF },
{ 0x10C0, 0x10F0 },
{ 0x10C1, 0x10F1 },
{ 0x10C2, 0x10F2 },
{ 0x10C3, 0x10F3 },
{ 0x10C4, 0x10F4 },
{ 0x10C5, 0x10F5 },
{ 0x1E00, 0x1E01 },
{ 0x1E02, 0x1E03 },
{ 0x1E04, 0x1E05 },
{ 0x1E06, 0x1E07 },
{ 0x1E08, 0x1E09 },
{ 0x1E0A, 0x1E0B },
{ 0x1E0C, 0x1E0D },
{ 0x1E0E, 0x1E0F },
{ 0x1E10, 0x1E11 },
{ 0x1E12, 0x1E13 },
{ 0x1E14, 0x1E15 },
{ 0x1E16, 0x1E17 },
{ 0x1E18, 0x1E19 },
{ 0x1E1A, 0x1E1B },
{ 0x1E1C, 0x1E1D },
{ 0x1E1E, 0x1E1F },
{ 0x1E20, 0x1E21 },
{ 0x1E22, 0x1E23 },
{ 0x1E24, 0x1E25 },
{ 0x1E26, 0x1E27 },
{ 0x1E28, 0x1E29 },
{ 0x1E2A, 0x1E2B },
{ 0x1E2C, 0x1E2D },
{ 0x1E2E, 0x1E2F },
{ 0x1E30, 0x1E31 },
{ 0x1E32, 0x1E33 },
{ 0x1E34, 0x1E35 },
{ 0x1E36, 0x1E37 },
{ 0x1E38, 0x1E39 },
{ 0x1E3A, 0x1E3B },
{ 0x1E3C, 0x1E3D },
{ 0x1E3E, 0x1E3F },
{ 0x1E40, 0x1E41 },
{ 0x1E42, 0x1E43 },
{ 0x1E44, 0x1E45 },
{ 0x1E46, 0x1E47 },
{ 0x1E48, 0x1E49 },
{ 0x1E4A, 0x1E4B },
{ 0x1E4C, 0x1E4D },
{ 0x1E4E, 0x1E4F },
{ 0x1E50, 0x1E51 },
{ 0x1E52, 0x1E53 },
{ 0x1E54, 0x1E55 },
{ 0x1E56, 0x1E57 },
{ 0x1E58, 0x1E59 },
{ 0x1E5A, 0x1E5B },
{ 0x1E5C, 0x1E5D },
{ 0x1E5E, 0x1E5F },
{ 0x1E60, 0x1E61 },
{ 0x1E62, 0x1E63 },
{ 0x1E64, 0x1E65 },
{ 0x1E66, 0x1E67 },
{ 0x1E68, 0x1E69 },
{ 0x1E6A, 0x1E6B },
{ 0x1E6C, 0x1E6D },
{ 0x1E6E, 0x1E6F },
{ 0x1E70, 0x1E71 },
{ 0x1E72, 0x1E73 },
{ 0x1E74, 0x1E75 },
{ 0x1E76, 0x1E77 },
{ 0x1E78, 0x1E79 },
{ 0x1E7A, 0x1E7B },
{ 0x1E7C, 0x1E7D },
{ 0x1E7E, 0x1E7F },
{ 0x1E80, 0x1E81 },
{ 0x1E82, 0x1E83 },
{ 0x1E84, 0x1E85 },
{ 0x1E86, 0x1E87 },
{ 0x1E88, 0x1E89 },
{ 0x1E8A, 0x1E8B },
{ 0x1E8C, 0x1E8D },
{ 0x1E8E, 0x1E8F },
{ 0x1E90, 0x1E91 },
{ 0x1E92, 0x1E93 },
{ 0x1E94, 0x1E95 },
{ 0x1EA0, 0x1EA1 },
{ 0x1EA2, 0x1EA3 },
{ 0x1EA4, 0x1EA5 },
{ 0x1EA6, 0x1EA7 },
{ 0x1EA8, 0x1EA9 },
{ 0x1EAA, 0x1EAB },
{ 0x1EAC, 0x1EAD },
{ 0x1EAE, 0x1EAF },
{ 0x1EB0, 0x1EB1 },
{ 0x1EB2, 0x1EB3 },
{ 0x1EB4, 0x1EB5 },
{ 0x1EB6, 0x1EB7 },
{ 0x1EB8, 0x1EB9 },
{ 0x1EBA, 0x1EBB },
{ 0x1EBC, 0x1EBD },
{ 0x1EBE, 0x1EBF },
{ 0x1EC0, 0x1EC1 },
{ 0x1EC2, 0x1EC3 },
{ 0x1EC4, 0x1EC5 },
{ 0x1EC6, 0x1EC7 },
{ 0x1EC8, 0x1EC9 },
{ 0x1ECA, 0x1ECB },
{ 0x1ECC, 0x1ECD },
{ 0x1ECE, 0x1ECF },
{ 0x1ED0, 0x1ED1 },
{ 0x1ED2, 0x1ED3 },
{ 0x1ED4, 0x1ED5 },
{ 0x1ED6, 0x1ED7 },
{ 0x1ED8, 0x1ED9 },
{ 0x1EDA, 0x1EDB },
{ 0x1EDC, 0x1EDD },
{ 0x1EDE, 0x1EDF },
{ 0x1EE0, 0x1EE1 },
{ 0x1EE2, 0x1EE3 },
{ 0x1EE4, 0x1EE5 },
{ 0x1EE6, 0x1EE7 },
{ 0x1EE8, 0x1EE9 },
{ 0x1EEA, 0x1EEB },
{ 0x1EEC, 0x1EED },
{ 0x1EEE, 0x1EEF },
{ 0x1EF0, 0x1EF1 },
{ 0x1EF2, 0x1EF3 },
{ 0x1EF4, 0x1EF5 },
{ 0x1EF6, 0x1EF7 },
{ 0x1EF8, 0x1EF9 },
{ 0x1F08, 0x1F00 },
{ 0x1F09, 0x1F01 },
{ 0x1F0A, 0x1F02 },
{ 0x1F0B, 0x1F03 },
{ 0x1F0C, 0x1F04 },
{ 0x1F0D, 0x1F05 },
{ 0x1F0E, 0x1F06 },
{ 0x1F0F, 0x1F07 },
{ 0x1F18, 0x1F10 },
{ 0x1F19, 0x1F11 },
{ 0x1F1A, 0x1F12 },
{ 0x1F1B, 0x1F13 },
{ 0x1F1C, 0x1F14 },
{ 0x1F1D, 0x1F15 },
{ 0x1F28, 0x1F20 },
{ 0x1F29, 0x1F21 },
{ 0x1F2A, 0x1F22 },
{ 0x1F2B, 0x1F23 },
{ 0x1F2C, 0x1F24 },
{ 0x1F2D, 0x1F25 },
{ 0x1F2E, 0x1F26 },
{ 0x1F2F, 0x1F27 },
{ 0x1F38, 0x1F30 },
{ 0x1F39, 0x1F31 },
{ 0x1F3A, 0x1F32 },
{ 0x1F3B, 0x1F33 },
{ 0x1F3C, 0x1F34 },
{ 0x1F3D, 0x1F35 },
{ 0x1F3E, 0x1F36 },
{ 0x1F3F, 0x1F37 },
{ 0x1F48, 0x1F40 },
{ 0x1F49, 0x1F41 },
{ 0x1F4A, 0x1F42 },
{ 0x1F4B, 0x1F43 },
{ 0x1F4C, 0x1F44 },
{ 0x1F4D, 0x1F45 },
{ 0x1F59, 0x1F51 },
{ 0x1F5B, 0x1F53 },
{ 0x1F5D, 0x1F55 },
{ 0x1F5F, 0x1F57 },
{ 0x1F68, 0x1F60 },
{ 0x1F69, 0x1F61 },
{ 0x1F6A, 0x1F62 },
{ 0x1F6B, 0x1F63 },
{ 0x1F6C, 0x1F64 },
{ 0x1F6D, 0x1F65 },
{ 0x1F6E, 0x1F66 },
{ 0x1F6F, 0x1F67 },
{ 0x1F88, 0x1F80 },
{ 0x1F89, 0x1F81 },
{ 0x1F8A, 0x1F82 },
{ 0x1F8B, 0x1F83 },
{ 0x1F8C, 0x1F84 },
{ 0x1F8D, 0x1F85 },
{ 0x1F8E, 0x1F86 },
{ 0x1F8F, 0x1F87 },
{ 0x1F98, 0x1F90 },
{ 0x1F99, 0x1F91 },
{ 0x1F9A, 0x1F92 },
{ 0x1F9B, 0x1F93 },
{ 0x1F9C, 0x1F94 },
{ 0x1F9D, 0x1F95 },
{ 0x1F9E, 0x1F96 },
{ 0x1F9F, 0x1F97 },
{ 0x1FA8, 0x1FA0 },
{ 0x1FA9, 0x1FA1 },
{ 0x1FAA, 0x1FA2 },
{ 0x1FAB, 0x1FA3 },
{ 0x1FAC, 0x1FA4 },
{ 0x1FAD, 0x1FA5 },
{ 0x1FAE, 0x1FA6 },
{ 0x1FAF, 0x1FA7 },
{ 0x1FB8, 0x1FB0 },
{ 0x1FB9, 0x1FB1 },
{ 0x1FD8, 0x1FD0 },
{ 0x1FD9, 0x1FD1 },
{ 0x1FE8, 0x1FE0 },
{ 0x1FE9, 0x1FE1 },
{ 0x24B6, 0x24D0 },
{ 0x24B7, 0x24D1 },
{ 0x24B8, 0x24D2 },
{ 0x24B9, 0x24D3 },
{ 0x24BA, 0x24D4 },
{ 0x24BB, 0x24D5 },
{ 0x24BC, 0x24D6 },
{ 0x24BD, 0x24D7 },
{ 0x24BE, 0x24D8 },
{ 0x24BF, 0x24D9 },
{ 0x24C0, 0x24DA },
{ 0x24C1, 0x24DB },
{ 0x24C2, 0x24DC },
{ 0x24C3, 0x24DD },
{ 0x24C4, 0x24DE },
{ 0x24C5, 0x24DF },
{ 0x24C6, 0x24E0 },
{ 0x24C7, 0x24E1 },
{ 0x24C8, 0x24E2 },
{ 0x24C9, 0x24E3 },
{ 0x24CA, 0x24E4 },
{ 0x24CB, 0x24E5 },
{ 0x24CC, 0x24E6 },
{ 0x24CD, 0x24E7 },
{ 0x24CE, 0x24E8 },
{ 0x24CF, 0x24E9 },
{ 0xFF21, 0xFF41 },
{ 0xFF22, 0xFF42 },
{ 0xFF23, 0xFF43 },
{ 0xFF24, 0xFF44 },
{ 0xFF25, 0xFF45 },
{ 0xFF26, 0xFF46 },
{ 0xFF27, 0xFF47 },
{ 0xFF28, 0xFF48 },
{ 0xFF29, 0xFF49 },
{ 0xFF2A, 0xFF4A },
{ 0xFF2B, 0xFF4B },
{ 0xFF2C, 0xFF4C },
{ 0xFF2D, 0xFF4D },
{ 0xFF2E, 0xFF4E },
{ 0xFF2F, 0xFF4F },
{ 0xFF30, 0xFF50 },
{ 0xFF31, 0xFF51 },
{ 0xFF32, 0xFF52 },
{ 0xFF33, 0xFF53 },
{ 0xFF34, 0xFF54 },
{ 0xFF35, 0xFF55 },
{ 0xFF36, 0xFF56 },
{ 0xFF37, 0xFF57 },
{ 0xFF38, 0xFF58 },
{ 0xFF39, 0xFF59 },
{ 0xFF3A, 0xFF5A },
};
template<uint32 Size>
static Unicode::Char32u Search(Unicode::Char32u ch, const Unicode::Char32u table[Size][2]) {
int32 low = 0;
int32 high = Size - 1;
while (low <= high) {
int32 middle = (low + high) / 2;
if (ch < table[middle][0]) {
high = middle - 1; //search low end of array
} else if (table[middle][0] < ch) {
low = middle + 1; //search high end of array
} else {
return table[middle][1];
}
}
return ch;
}
Unicode::Char32u Unicode::ToLower(Unicode::Char32u ch) {
return Search<TO_LOWER_MAP_LEN>(ch, TO_LOWER_MAP_TABLE);
}
Unicode::Char32u Unicode::ToUpper(Unicode::Char32u ch) {
return Search<TO_UPPER_MAP_LEN>(ch, TO_UPPER_MAP_TABLE);
}
bool Unicode::Utf32toUtf8(Unicode::Char32u ch, Unicode::Char8u *out, uint32 &len) {
if (ch <= 0x7f) {
out[0] = 0b00000000u | (ch & 0b01111111u);
len = 1;
}
else if (ch <= 0x7FF) {
out[1] = 0b10000000u | (ch & 0b00111111u); ch >>= 6u;
out[0] = 0b11000000u | (ch & 0b00011111u);
len = 2;
}
else if (ch <= 0xFFFF) {
out[2] = 0b10000000u | (ch & 0b00111111u); ch >>= 6u;
out[1] = 0b10000000u | (ch & 0b00111111u); ch >>= 6u;
out[0] = 0b11100000u | (ch & 0b00001111u);
len = 3;
}
else if (ch <= 0x10FFFF) {
out[3] = 0b10000000u | (ch & 0b00111111u); ch >>= 6u;
out[2] = 0b10000000u | (ch & 0b00111111u); ch >>= 6u;
out[1] = 0b10000000u | (ch & 0b00111111u); ch >>= 6u;
out[0] = 0b11110000u | (ch & 0b00000111u);
len = 4;
}
else {
len = 0;
return false;
}
return true;
}
bool Unicode::Utf8toUtf32(const Unicode::Char8u *in, uint32& len, Unicode::Char32u &out) {
if ((in[0] & 0b11111000u) == 0b11110000u && len >= 4) {
out =
((in[3] & 0b00111111u) ) |
((in[2] & 0b00111111u) << 6u ) |
((in[1] & 0b00111111u) << 12u) |
((in[0] & 0b00000111u) << 18u);
len = 4;
}
else if ((in[0] & 0b11110000u) == 0b11100000u && len >= 3) {
out =
((in[2] & 0b00111111u) ) |
((in[1] & 0b00111111u) << 6u) |
((in[0] & 0b00001111u) << 12u);
len = 3;
}
else if ((in[0] & 0b11100000u) == 0b11000000u && len >= 2) {
out =
((in[1] & 0b00111111u) ) |
((in[0] & 0b00011111u) << 6u);
len = 2;
}
else if ((in[0] & 0b10000000u) == 0b00000000u && len >= 1) {
out =
((in[0] & 0b01111111u));
len = 1;
}
else {
len = 0;
return false;
}
return true;
}
bool Unicode::Utf32ToUtf16(Unicode::Char32u ch, Unicode::Char16u *out, uint32 &outLen) {
if (ch <= 0xffff) {
out[0] = static_cast<Char16u>(ch);
outLen = 1;
}
else {
ch -= 0x10000;
Char32u lower = ch & 0b1111111111; ch >>= 10u;
Char32u upper = ch & 0b1111111111;
out[0] = static_cast<Char16u>(0xd800 + upper);
out[1] = static_cast<Char16u>(0xdc00 + lower);
outLen = 2;
}
return true;
}
bool Unicode::Utf16ToUtf32(const Unicode::Char16u *in, uint32 &len, Unicode::Char32u &out) {
if (0xd800 <= in[0] && in[0] <= 0xdbff) {
if (len >= 2 && 0xdc00 <= in[1] && in[1] <= 0xdfff) {
out = (in[0] - 0xd800) << 10u;
out += (in[1] - 0xdc00);
out += 0x10000;
len = 2;
}
else {
len = 0;
out = 0;
return true;
}
}
else {
len = 1;
out = in[0];
return true;
}
return false;
}
} | [
"egororachyov5@gmail.com"
] | egororachyov5@gmail.com |
60e3ab3294973b032592c75145a4581f19cc768a | 8ddcc457419e800810c6601060a55c9357140b13 | /include/BrownianPointAnimation.h | 52d45ccd7c55f2443dae1517f8ed34ef08d85f03 | [] | no_license | kimpekoy/Pixel-Effect | 3348ad26bcc75147834c0ba7026dda3aa118a332 | 80450da0b9c8f1264876e2d4d57b2a959366e777 | refs/heads/master | 2021-01-01T04:31:07.161042 | 2016-05-26T05:48:45 | 2016-05-26T05:48:45 | 59,594,728 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 688 | h | #pragma once
#include "VertexConnectionAnimation.h"
class BrownianPointAnimation : public VertexConnectionAnimation
{
public:
void readConfig(Bit::JsonTree* tree);
void readParams(Bit::JsonTree* tree, Bit::ParamsRef params);
void setup();
void update();
void draw();
void reset();
std::string getConfigName(){ return "Floating_Animation"; }
std::string getParamsName(){ return "Floating_Animation"; }
private:
void toggleMultiColor() { useMultiColor_ = !useMultiColor_; };
float windowWidth_;
float windowHeight_;
float maxVelocity_;
float minVelocity_;
int numPoints_;
float pointRadiusMin_;
float pointRadiusMax_;
bool useMultiColor_;
ci::Color pointsColor_;
}; | [
"kimpekoy@hotmail.com"
] | kimpekoy@hotmail.com |
1c90c9a202841dbd8b24cae75afd086c289f5bc9 | a9ab72c3dd7fdfe8b6e0b1b5e296bf4c39b9989d | /google_list/leetcode354.cpp | 6d4a14bf8775908f4f73bdf9995864d8926679c0 | [] | no_license | keqhe/leetcode | cd82fc3d98b7fc71a9a08c5e438aa1f82737d76f | 86b2a453255c909f94f9ea3be7f2a97a6680a854 | refs/heads/master | 2020-12-24T06:38:15.444432 | 2016-12-07T19:15:02 | 2016-12-07T19:15:02 | 48,405,123 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 947 | cpp |
bool myCmp(const pair<int, int> & p1, const pair<int, int> & p2) {
if (p1.first != p2.first)
return p1.first < p2.first;
else
return p1.second > p2.second;
}
int LIS(vector<int> & nums) {
if (nums.empty())
return 0;
int size = nums.size();
//dp[i] denotes the LIS ending at nums[i];
vector<int> dp(size, 1);
int maxLen = 1;
for (int i = 1; i < size; i ++) {
for (int j = 0; j < i; j ++) {
if (nums[j] < nums[i])
dp[i] = max(dp[i], dp[j] + 1);
}
maxLen = max(maxLen, dp[i]);
}
return maxLen;
}
class Solution {
public:
int maxEnvelopes(vector<pair<int, int>>& envelopes) {
if (envelopes.empty())
return 0;
sort(envelopes.begin(), envelopes.end(), myCmp);
vector<int> nums;
for (auto e : envelopes) {
nums.push_back(e.second);
}
return LIS(nums);
}
};
| [
"keqhe@cs.wisc.edu"
] | keqhe@cs.wisc.edu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.