blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
201
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
85
| license_type
stringclasses 2
values | repo_name
stringlengths 7
100
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 260
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 11.4k
681M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 80
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 8
9.86M
| extension
stringclasses 52
values | content
stringlengths 8
9.86M
| authors
listlengths 1
1
| author
stringlengths 0
119
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00e44376da4edcbf2ad2a0320d76e539893a5750
|
2696b7ec7228cea17ceead518c5a6cecfe9716d3
|
/745-C/745-C-23113571.cpp
|
1424eb414afc3512d8c88f677548fb16197ea0b1
|
[] |
no_license
|
flapy/Codeforces-Practice
|
93176dbc1db2e21eca23c5d6fd8b52a9a32dee92
|
d05adae0da364a0675a360840822e27a7916a372
|
refs/heads/master
| 2021-01-12T05:33:49.519447 | 2016-12-29T19:13:12 | 2016-12-29T19:13:12 | 77,128,270 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,307 |
cpp
|
// Approach 2 using DSU
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
list <int> adj[1004];
int visit[1004];
int parent[1004];
int rnk[1004];
void init(int n)
{
for (int i = 1; i <= n; i++)
{
parent[i] = i;
rnk[i] = 1;
}
}
void merge(int u,int v)
{
if (rnk[u] > rnk[v])
parent[v] = u;
else
parent[u] = v;
if (rnk[u] == rnk[v])
rnk[u]++;
}
int find(int u)
{
if (u != parent[u])
{
parent[u] = find(parent[u]);
}
return parent[u];
}
int countAllEdges(int k)
{
return ((k * (k - 1)) / 2);
}
int main()
{
ios_base :: sync_with_stdio(false);
int t = 1;
while (t--)
{
int n, m , k;
cin >> n >> m >> k;
int arr[k + 2];
for (int i = 0; i < k; i++)
{
cin >> arr[i];
}
init(n);
int u, v;
int store = m;
int compSize[1004] = {0};
while (m--)
{
int u, v;
cin >> u >> v;
merge(find(u),find(v));
}
for (int i = 1; i <= n; i++)
compSize[find(i)]++;
m = store;
int ans = 0;
int maxCompSize = INT_MIN;
int notGov = n;
for (int i = 0 ; i < k; i++)
{
int siz = compSize[find(arr[i])];
maxCompSize = max(maxCompSize,siz);
ans += countAllEdges(siz);
notGov -= siz;
}
ans -= countAllEdges(maxCompSize);
ans += countAllEdges(maxCompSize + notGov);
ans -= m;
cout << ans << endl;
}
return 0;
}
|
[
"[email protected]"
] | |
8932fcf0ebb62b08d5f3c915279bc13b302d92d5
|
ab8f3125aa7dd26f272fadd233bd639f367f4005
|
/ext/imgui-1.51/examples/sdl_opengl2_example/main.cpp
|
53e428ba3b5e0aa535f469f9d46cd18c0413b0f2
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] |
permissive
|
phoekz/voxed
|
07958b3da331df481adc17e6e0195756b8ffcab2
|
b825328159c3cd220d1affc9d2170d2121fc32b8
|
refs/heads/master
| 2020-06-03T07:44:36.471518 | 2019-02-16T23:26:17 | 2019-02-21T22:56:09 | 94,122,408 | 2 | 0 |
MIT
| 2019-02-21T22:56:10 | 2017-06-12T17:27:06 |
HTML
|
UTF-8
|
C++
| false | false | 4,010 |
cpp
|
// ImGui - standalone example application for SDL2 + OpenGL
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
#include <imgui.h>
#include "imgui_impl_sdl.h"
#include <stdio.h>
#include <SDL.h>
#include <SDL_opengl.h>
int main(int, char**)
{
// Setup SDL
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) != 0)
{
printf("Error: %s\n", SDL_GetError());
return -1;
}
// Setup window
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
SDL_DisplayMode current;
SDL_GetCurrentDisplayMode(0, ¤t);
SDL_Window *window = SDL_CreateWindow("ImGui SDL2+OpenGL example", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE);
SDL_GLContext glcontext = SDL_GL_CreateContext(window);
// Setup ImGui binding
ImGui_ImplSdl_Init(window);
// Load Fonts
// (there is a default font, this is only if you want to change it. see extra_fonts/README.txt for more details)
//ImGuiIO& io = ImGui::GetIO();
//io.Fonts->AddFontDefault();
//io.Fonts->AddFontFromFileTTF("../../extra_fonts/Cousine-Regular.ttf", 15.0f);
//io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
//io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f);
//io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f);
//io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
bool show_test_window = true;
bool show_another_window = false;
ImVec4 clear_color = ImColor(114, 144, 154);
// Main loop
bool done = false;
while (!done)
{
SDL_Event event;
while (SDL_PollEvent(&event))
{
ImGui_ImplSdl_ProcessEvent(&event);
if (event.type == SDL_QUIT)
done = true;
}
ImGui_ImplSdl_NewFrame(window);
// 1. Show a simple window
// Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug"
{
static float f = 0.0f;
ImGui::Text("Hello, world!");
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
ImGui::ColorEdit3("clear color", (float*)&clear_color);
if (ImGui::Button("Test Window")) show_test_window ^= 1;
if (ImGui::Button("Another Window")) show_another_window ^= 1;
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
}
// 2. Show another simple window, this time using an explicit Begin/End pair
if (show_another_window)
{
ImGui::SetNextWindowSize(ImVec2(200,100), ImGuiCond_FirstUseEver);
ImGui::Begin("Another Window", &show_another_window);
ImGui::Text("Hello");
ImGui::End();
}
// 3. Show the ImGui test window. Most of the sample code is in ImGui::ShowTestWindow()
if (show_test_window)
{
ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
ImGui::ShowTestWindow(&show_test_window);
}
// Rendering
glViewport(0, 0, (int)ImGui::GetIO().DisplaySize.x, (int)ImGui::GetIO().DisplaySize.y);
glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w);
glClear(GL_COLOR_BUFFER_BIT);
//glUseProgram(0); // You may want this if using this code in an OpenGL 3+ context where shaders may be bound
ImGui::Render();
SDL_GL_SwapWindow(window);
}
// Cleanup
ImGui_ImplSdl_Shutdown();
SDL_GL_DeleteContext(glcontext);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
|
[
"[email protected]"
] | |
cdb12062a6fa851d305fbddc1f6797a1a8a8e393
|
622a4ff3400db164d881ffae68e5a7e8ee508b13
|
/src/Engine/Rendering/RHI/IModel.hpp
|
00556b3f80bd5acfdef971e6a54797c49e83c9ee
|
[
"Apache-2.0",
"MIT"
] |
permissive
|
kaclok/TmingEngine
|
efea1186f95b818d14aef05e0e24121254dedd35
|
4455ff88c6169acfbc98caf52e6f09db223ee472
|
refs/heads/master
| 2022-12-08T18:56:23.921885 | 2020-09-08T01:21:01 | 2020-09-08T01:21:01 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 2,021 |
hpp
|
/*
This file is part of:
TmingEngine
https://github.com/xiaomingfun/TmingEngine
Copyright 2018 - 2020 TmingEngine
File creator: littleblue
TmingEngine is open-source software and you can redistribute it and/or modify
it under the terms of the License; besides, anyone who use this file/software must include this copyright announcement.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef IMODEL_H
#define IMODEL_H
#include "assimp/Importer.hpp"
#include "assimp/scene.h"
#include "assimp/postprocess.h"
#include "Rendering/RHI/ITexture.hpp"
#include "Rendering/RHI/IMesh.hpp"
#include "Rendering/RHI/IShader.hpp"
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <map>
#include <vector>
using namespace std;
namespace TmingEngine
{
class IModel
{
public:
vector<ITexture*> textures_loaded;
vector<IMesh*> meshes;
string directory;
bool gammaCorrection;
IModel()
{
gammaCorrection = false;
}
IModel(string const& path, bool gamma = false)
{
gammaCorrection = gamma;
Init(path);
}
virtual void Init(string const& path) = 0;
virtual void Draw(IShader* shader) = 0;
private:
virtual void loadModel(string const& path) = 0;
virtual void processNode(aiNode* node, const aiScene* scene) = 0;
virtual IMesh* processMesh(aiMesh* mesh, const aiScene* scene) = 0;
virtual vector<ITexture*> loadMaterialTextures(aiMaterial* mat, aiTextureType type, string typeName) = 0;
};
} // namespace TmingEngine
#endif
|
[
"[email protected]"
] | |
5f00b3f6635db38bec7ab1e25bedacba816a3dc3
|
62669fbaa3d9b52bd34a8ab8bf781f2d18b3778b
|
/dlib/media/ffmpeg_muxer.h
|
ddf2c2363ea14afe30a1dadcfe83eb35d82df8b3
|
[
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
davisking/dlib
|
05c04e5c73c8b92526c77431e9bb622974ffe3f2
|
f6c58c2d21a49d84967e48ffa33e7d1c783ae671
|
refs/heads/master
| 2023-09-06T08:22:13.063202 | 2023-08-26T23:55:59 | 2023-08-26T23:55:59 | 16,331,291 | 13,118 | 3,600 |
BSL-1.0
| 2023-09-10T12:50:42 | 2014-01-29T00:45:33 |
C++
|
UTF-8
|
C++
| false | false | 60,330 |
h
|
// Copyright (C) 2023 Davis E. King ([email protected])
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_VIDEO_MUXER
#define DLIB_VIDEO_MUXER
#include <queue>
#include <functional>
#include <unordered_map>
#include "ffmpeg_utils.h"
#include "../functional.h"
#include "../constexpr_if.h"
namespace dlib
{
namespace ffmpeg
{
// ---------------------------------------------------------------------------------------------------
struct encoder_image_args : resizing_args
{
/*!
WHAT THIS OBJECT REPRESENTS
This class groups a set of arguments passed to the encoder and muxer classes.
These must be set to non-zero or non-trivial values as they are used to configure
the underlying codec and optionally, an internal image scaler.
Any frame that is pushed to encoder or muxer instances is resized to the codec's
pre-configured settings if their dimensions or pixel format don't match.
For example, if the codec is configured to use height 512, width 384 and RGB format,
using the variables below, and the frames already have these settings when pushed,
then no resizing is performed. If however they don't, then they are first resized.
!*/
// Target framerate of codec/muxer
int framerate{0};
};
// ---------------------------------------------------------------------------------------------------
struct encoder_audio_args : resampling_args
{
/*!
WHAT THIS OBJECT REPRESENTS
This class groups a set of arguments passed to the encoder and muxer classes.
These must be set to non-zero or non-trivial values as they are used to configure
the underlying codec and optionally, an internal audio resampler.
Any frame that is pushed to encoder or muxer instances is resampled to the codec's
pre-configured settings if their sample format, sample rate or channel layout, don't match.
!*/
};
// ---------------------------------------------------------------------------------------------------
struct encoder_codec_args
{
/*!
WHAT THIS OBJECT REPRESENTS
This class groups a set of arguments passed to the encoder and muxer classes.
Some of these must be set to non-zero or non-trivial values as they are used
to configure the underlying codec. Others will only be used if non-zero or
non-trivial.
!*/
// Codec ID used to configure the encoder. Either codec or codec_name MUST be set.
AVCodecID codec{AV_CODEC_ID_NONE};
// Codec name used to configure the encoder. This is used if codec == AV_CODEC_ID_NONE.
std::string codec_name;
// A dictionary of AVCodecContext and codec-private options. Used by "avcodec_open2()"
std::unordered_map<std::string, std::string> codec_options;
// Sets AVCodecContext::bit_rate if non-negative.
int64_t bitrate{-1};
// Sets AVCodecContext::gop_size if non-negative.
int gop_size{-1};
// OR-ed with AVCodecContext::flags if non-negative.
int flags{0};
};
// ---------------------------------------------------------------------------------------------------
class encoder
{
public:
/*!
WHAT THIS OBJECT REPRESENTS
This class is a libavcodec wrapper which encodes video or audio to raw memory.
Note, if you are creating a media file, it is easier to use the muxer object
as it also works with raw codec files like .h264 files.
This class is suitable for example if you need to send raw packets over a socket
or interface with another library that requires encoded data, not raw images
or raw audio samples.
!*/
struct args
{
/*!
WHAT THIS OBJECT REPRESENTS
This holds constructor arguments for encoder.
!*/
encoder_codec_args args_codec;
encoder_image_args args_image;
encoder_audio_args args_audio;
};
encoder() = default;
/*!
ensures
- is_open() == false
!*/
encoder(const args& a);
/*!
requires
- a.args_codec.codec or a.args_codec.codec_name are set
- Either a.args_image or a.args_audio is fully set
ensures
- Constructs encoder from args and sink
- is_open() == true
!*/
bool is_open() const noexcept;
/*!
ensures
- Returns true if the codec is open and user may call push()
!*/
bool is_image_encoder() const noexcept;
/*!
ensures
- Returns true if the codec is an image encoder.
!*/
bool is_audio_encoder() const noexcept;
/*!
ensures
- Returns true if the codec is an audio encoder.
!*/
AVCodecID get_codec_id() const noexcept;
/*!
requires
- is_open() == true
ensures
- returns the codec id. See ffmpeg documentation or libavcodec/codec_id.h
!*/
std::string get_codec_name() const noexcept;
/*!
requires
- is_open() == true
ensures
- returns string representation of codec id.
!*/
int height() const noexcept;
/*!
requires
- is_image_encoder() == true
ensures
- returns the height of the configured codec, not necessarily the
height of frames passed to push(frame)
!*/
int width() const noexcept;
/*!
requires
- is_image_encoder() == true
ensures
- returns the width of the configured codec, not necessarily the
width of frames passed to push(frame)
!*/
AVPixelFormat pixel_fmt() const noexcept;
/*!
requires
- is_image_encoder() == true
ensures
- returns the pixel format of the configured codec, not necessarily the
pixel format of frames passed to push(frame)
!*/
int fps() const noexcept;
/*!
requires
- is_image_encoder() == true
ensures
- returns the configured framerate of the codec.
!*/
int sample_rate() const noexcept;
/*!
requires
- is_audio_encoder() == true
ensures
- returns the sample rate of the configured codec, not necessarily the
sample rate of frames passed to push(frame)
!*/
uint64_t channel_layout() const noexcept;
/*!
requires
- is_audio_encoder() == true
ensures
- returns the channel layout of the configured codec, not necessarily the
channel layout of frames passed to push(frame).
e.g. AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_MONO etc.
!*/
AVSampleFormat sample_fmt() const noexcept;
/*!
requires
- is_audio_encoder() == true
ensures
- returns the sample format of the configured codec, not necessarily the
sample format of frames passed to push(frame)
!*/
int nchannels() const noexcept;
/*!
requires
- is_audio_encoder() == true
ensures
- returns the number of audio channels in the configured codec.
!*/
template <class Callback>
bool push (
frame f,
Callback&& sink
);
/*!
requires
- if is_image_encoder() == true, then f.is_image() == true
- if is_audio_encoder() == true, then f.is_audio() == true
- sink is set to a valid callback with signature bool(size_t, const char*)
for writing packet data. dlib/media/sink.h contains callback wrappers for
different buffer types.
- sink does not call encoder::push() or encoder::flush(),
i.e., the callback does not create a recursive loop.
ensures
- If f does not have matching settings to the codec, it is either
resized or resampled before being pushed to the codec and encoded.
- The sink callback may or may not be invoked as the underlying resampler,
audio fifo and codec all have their own buffers.
- Returns true if successfully encoded, even if sink wasn't invoked.
- Returns false if either EOF, i.e. flush() has been previously called,
or an error occurred, in which case is_open() == false.
!*/
template <
class image_type,
class Callback,
is_image_check<image_type> = true
>
bool push (
const image_type& img,
Callback&& sink
);
/*!
requires
- is_image_encoder() == true
- sink is set to a valid callback with signature bool(size_t, const char*)
for writing packet data. dlib/media/sink.h contains callback wrappers for
different buffer types.
- sink does not call encoder::push() or encoder::flush(),
i.e., the callback does not create a recursive loop.
ensures
- Encodes img using the constructor arguments, which may incur a resizing
operation if the image dimensions and pixel type don't match the codec.
- The sink callback may or may not be invoked as the underlying codec
can buffer if necessary.
- Returns true if successfully encoded, even if sink wasn't invoked.
- Returns false if either EOF, i.e. flush() has been previously called,
or an error occurred, in which case is_open() == false.
!*/
template <class Callback>
void flush (
Callback&& sink
);
/*!
requires
- sink is set to a valid callback with signature bool(size_t, const char*)
for writing packet data. dlib/media/sink.h contains callback wrappers for
different buffer types.
- sink does not call encoder::push() or encoder::flush(),
i.e., the callback does not create a recursive loop.
ensures
- Flushes the codec. This must be called when there are no more frames to be encoded.
- sink will likely be invoked.
- is_open() == false
- Becomes a no-op after the first time you call this.
!*/
private:
friend class muxer;
bool open();
args args_;
bool open_{false};
bool encoding{false};
details::av_ptr<AVCodecContext> pCodecCtx;
details::av_ptr<AVPacket> packet;
int next_pts{0};
details::resizer resizer_image;
details::resampler resizer_audio;
details::audio_fifo fifo;
};
// ---------------------------------------------------------------------------------------------------
class muxer
{
public:
/*!
WHAT THIS OBJECT REPRESENTS
This class is a libavformat wrapper which muxes video and/or audio streams to file.
It is analogous to OpenCV's cv::VideoWriter class but is more configurable, supports audio,
devices (X11, speaker, ...) and network streams such as RTSP, HTTP, and more.
Note that a video file, e.g. MP4, can contain multiple streams: video, audio, subtitles, etc.
This class can encode both video and audio at the same time.
!*/
struct args
{
/*!
WHAT THIS OBJECT REPRESENTS
This holds constructor arguments for muxer.
!*/
args() = default;
/*!
ensures
- Default constructor.
!*/
args(const std::string& filepath);
/*!
ensures
- this->filepath = filepath
!*/
// Filepath, URL or device this object will write data to.
std::string filepath;
// Output format hint. e.g. 'rtsp', 'X11', 'alsa', etc. 99% of the time, users are not required to specify this as libavformat tries to guess it.
std::string output_format;
// A dictionary filled with AVFormatContext and muxer-private options. Used by "avformat_write_header()"".
// Please see libavformat documentation for more details
std::unordered_map<std::string, std::string> format_options;
// An AVDictionary filled with protocol-private options. Used by avio_open2()
std::unordered_map<std::string, std::string> protocol_options;
// See documentation for AVFormatContext::max_delay
int max_delay{-1};
// Only relevant to network muxers such as RTSP, HTTP etc.
// Connection/listening timeout.
std::chrono::milliseconds connect_timeout{std::chrono::milliseconds::max()};
// Only relevant to network muxers such as RTSP, HTTP etc
// Read timeout.
std::chrono::milliseconds read_timeout{std::chrono::milliseconds::max()};
// Only relevant to network muxers such as RTSP, HTTP etc
// Connection/listening interruption callback.
// The constructor periodically calls interrupter() while waiting on the network. If it returns true, then
// the connection is aborted and the muxer is closed.
// So user may use this in conjunction with some thread-safe shared state to signal an abort/interrupt.
std::function<bool()> interrupter;
// Video stream arguments
struct : encoder_codec_args, encoder_image_args{} args_image;
// Audio stream arguments
struct : encoder_codec_args, encoder_audio_args{} args_audio;
// Whether or not to encode video stream.
bool enable_image{true};
// Whether or not to encode audio stream.
bool enable_audio{true};
};
muxer() = default;
/*!
ensures
- is_open() == false
!*/
muxer(const args& a);
/*!
ensures
- Constructs muxer using args
!*/
muxer(muxer&& other) noexcept;
/*!
ensures
- Move constructor
- After move, other.is_open() == false
!*/
muxer& operator=(muxer&& other) noexcept;
/*!
ensures
- Move assignment
- After move, other.is_open() == false
!*/
~muxer();
/*!
ensures
- Calls flush() if not already called
- Closes the underlying file/socket
!*/
bool is_open() const noexcept;
/*!
ensures
- Returns true if underlying container and codecs are open
- User may call push()
!*/
bool audio_enabled() const noexcept;
/*!
requires
- args.enable_audio == true
ensures
- returns true if is_open() == true and an audio stream is available and open
!*/
bool video_enabled() const noexcept;
/*!
requires
- args.enable_video == true
ensures
- returns true if is_open() == true and a video stream is available and open
!*/
int height() const noexcept;
/*!
ensures
- if (video_enabled())
- returns the height of the configured codec, not necessarily the height of
frames passed to push(frame).
- else
- returns 0
!*/
int width() const noexcept;
/*!
ensures
- if (video_enabled())
- returns the width of the configured codec, not necessarily the
width of frames passed to push(frame).
- else
- returns 0
!*/
AVPixelFormat pixel_fmt() const noexcept;
/*!
ensures
- if (video_enabled())
- returns the pixel format of the configured codec, not necessarily the
pixel format of frames passed to push(frame).
- else
- returns AV_PIX_FMT_NONE
!*/
float fps() const noexcept;
/*!
ensures
- if (video_enabled())
- returns the framerate of the configured codec
- else
- returns 0
!*/
int estimated_nframes() const noexcept;
/*!
ensures
- returns ffmpeg's estimation of how many video frames are in the file without reading any frames
- See ffmpeg's documentation for AVStream::nb_frames
- Note, this is known to not always work with ffmpeg v3 with certain files. Most of the time it does
Do not make your code rely on this
!*/
AVCodecID get_video_codec_id() const noexcept;
/*!
ensures
- if (video_enabled())
- returns codec ID of video stream
- else
- returns AV_CODEC_ID_NONE
!*/
std::string get_video_codec_name() const noexcept;
/*!
ensures
- if (video_enabled())
- returns codec name of video stream
- else
- returns ""
!*/
int sample_rate() const noexcept;
/*!
ensures
- if (audio_enabled())
- returns the sample rate of the configured codec, not necessarily the
sample rate of frames passed to push(frame).
- else
- returns 0
!*/
uint64_t channel_layout() const noexcept;
/*!
ensures
- if (audio_enabled())
- returns the channel layout of the configured codec, not necessarily the
channel layout of frames passed to push(frame).
- else
- returns 0
!*/
int nchannels() const noexcept;
/*!
ensures
- if (audio_enabled())
- returns the number of audio channels in the configured codec, not necessarily the
number of channels in frames passed to push(frame).
- else
- returns 0
!*/
AVSampleFormat sample_fmt() const noexcept;
/*!
ensures
- if (audio_enabled())
- returns the sample format of the configured codec, not necessarily the
sample format of frames passed to push(frame).
- else
- returns AV_SAMPLE_FMT_NONE
!*/
int estimated_total_samples() const noexcept;
/*!
ensures
- if (audio_enabled())
- returns an estimation fo the total number of audio samples in the audio stream
- else
- returns 0
!*/
AVCodecID get_audio_codec_id() const noexcept;
/*!
ensures
- if (audio_enabled())
- returns codec ID of audio stream
- else
- returns AV_CODEC_ID_NONE
!*/
std::string get_audio_codec_name() const noexcept;
/*!
ensures
- if (audio_enabled())
- returns codec name of audio stream
- else
- returns ""
!*/
bool push(frame f);
/*!
requires
- if is_image_encoder() == true, then f.is_image() == true
- if is_audio_encoder() == true, then f.is_audio() == true
ensures
- If f does not have matching settings to the codec, it is either
resized or resampled before being pushed to the muxer.
- Encodes and writes the encoded data to file/socket
- Returns true if successfully encoded.
- Returns false if either EOF, i.e. flush() has been previously called,
or an error occurred, in which case is_open() == false.
!*/
template <
class image_type,
is_image_check<image_type> = true
>
bool push(const image_type& img);
/*!
requires
- is_image_encoder() == true
ensures
- Encodes img using the constructor arguments, which may incur a resizing
operation if the image dimensions and pixel type don't match the codec.
- Encodes and writes the encoded data to file/socket
- Returns true if successfully encoded.
- Returns false if either EOF, i.e. flush() has been previously called,
or an error occurred, in which case is_open() == false.
!*/
void flush();
/*!
ensures
- Flushes the file.
- is_open() == false
!*/
private:
bool open(const args& a);
bool interrupt_callback();
struct {
args args_;
details::av_ptr<AVFormatContext> pFormatCtx;
encoder encoder_image;
encoder encoder_audio;
int stream_id_video{-1};
int stream_id_audio{-1};
std::chrono::system_clock::time_point connecting_time{};
std::chrono::system_clock::time_point connected_time{};
std::chrono::system_clock::time_point last_read_time{};
} st;
};
// ---------------------------------------------------------------------------------------------------
template <
class image_type,
is_image_check<image_type> = true
>
void save_frame(
const image_type& image,
const std::string& file_name,
const std::unordered_map<std::string, std::string>& codec_options = {}
);
/*!
requires
- image_type must be a type conforming to the generic image interface.
ensures
- encodes the image into the file pointed by file_name using options described in codec_options.
!*/
// ---------------------------------------------------------------------------------------------------
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////// DEFINITIONS ////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
namespace dlib
{
namespace ffmpeg
{
namespace details
{
// ---------------------------------------------------------------------------------------------------
inline bool operator==(const AVRational& a, const AVRational& b) {return a.num == b.num && a.den == b.den;}
inline bool operator!=(const AVRational& a, const AVRational& b) {return !(a == b);}
inline bool operator==(const AVRational& a, int framerate) {return a.den > 0 && (a.num / a.den) == framerate;}
inline bool operator!=(const AVRational& a, int framerate) {return !(a == framerate);}
inline int to_int(const AVRational& a) {return a.num / a.den;}
inline AVRational inv(const AVRational& a) {return {a.den, a.num};}
// ---------------------------------------------------------------------------------------------------
inline void check_properties(
const AVCodec* pCodec,
AVCodecContext* pCodecCtx
)
{
// Video properties
if (pCodec->supported_framerates && pCodecCtx->framerate != 0)
{
bool framerate_supported = false;
for (int i = 0 ; pCodec->supported_framerates[i] != AVRational{0,0} ; i++)
{
if (pCodecCtx->framerate == pCodec->supported_framerates[i])
{
framerate_supported = true;
break;
}
}
if (!framerate_supported)
{
logger_dlib_wrapper() << LINFO
<< "Requested framerate "
<< pCodecCtx->framerate.num / pCodecCtx->framerate.den
<< " not supported. Changing to default "
<< pCodec->supported_framerates[0].num / pCodec->supported_framerates[0].den;
pCodecCtx->framerate = pCodec->supported_framerates[0];
}
}
if (pCodec->pix_fmts)
{
bool pix_fmt_supported = false;
for (int i = 0 ; pCodec->pix_fmts[i] != AV_PIX_FMT_NONE ; i++)
{
if (pCodecCtx->pix_fmt == pCodec->pix_fmts[i])
{
pix_fmt_supported = true;
break;
}
}
if (!pix_fmt_supported)
{
logger_dlib_wrapper() << LINFO
<< "Requested pixel format "
<< av_get_pix_fmt_name(pCodecCtx->pix_fmt)
<< " not supported. Changing to default "
<< av_get_pix_fmt_name(pCodec->pix_fmts[0]);
pCodecCtx->pix_fmt = pCodec->pix_fmts[0];
}
}
// Audio properties
if (pCodec->supported_samplerates)
{
bool sample_rate_supported = false;
for (int i = 0 ; pCodec->supported_samplerates[i] != 0 ; i++)
{
if (pCodecCtx->sample_rate == pCodec->supported_samplerates[i])
{
sample_rate_supported = true;
break;
}
}
if (!sample_rate_supported)
{
logger_dlib_wrapper() << LINFO
<< "Requested sample rate "
<< pCodecCtx->sample_rate
<< " not supported. Changing to default "
<< pCodec->supported_samplerates[0];
pCodecCtx->sample_rate = pCodec->supported_samplerates[0];
}
}
if (pCodec->sample_fmts)
{
bool sample_fmt_supported = false;
for (int i = 0 ; pCodec->sample_fmts[i] != AV_SAMPLE_FMT_NONE ; i++)
{
if (pCodecCtx->sample_fmt == pCodec->sample_fmts[i])
{
sample_fmt_supported = true;
break;
}
}
if (!sample_fmt_supported)
{
logger_dlib_wrapper() << LINFO
<< "Requested sample format "
<< av_get_sample_fmt_name(pCodecCtx->sample_fmt)
<< " not supported. Changing to default "
<< av_get_sample_fmt_name(pCodec->sample_fmts[0]);
pCodecCtx->sample_fmt = pCodec->sample_fmts[0];
}
}
#if FF_API_OLD_CHANNEL_LAYOUT
if (pCodec->ch_layouts)
{
bool channel_layout_supported = false;
for (int i = 0 ; av_channel_layout_check(&pCodec->ch_layouts[i]) ; ++i)
{
if (av_channel_layout_compare(&pCodecCtx->ch_layout, &pCodec->ch_layouts[i]) == 0)
{
channel_layout_supported = true;
break;
}
}
if (!channel_layout_supported)
{
logger_dlib_wrapper() << LINFO
<< "Channel layout "
<< details::get_channel_layout_str(pCodecCtx)
<< " not supported. Changing to default "
<< details::get_channel_layout_str(pCodec->ch_layouts[0]);
av_channel_layout_copy(&pCodecCtx->ch_layout, &pCodec->ch_layouts[0]);
}
}
#else
if (pCodec->channel_layouts)
{
bool channel_layout_supported = false;
for (int i = 0 ; pCodec->channel_layouts[i] != 0 ; i++)
{
if (pCodecCtx->channel_layout == pCodec->channel_layouts[i])
{
channel_layout_supported = true;
break;
}
}
if (!channel_layout_supported)
{
logger_dlib_wrapper() << LINFO
<< "Channel layout "
<< details::get_channel_layout_str(pCodecCtx)
<< " not supported. Changing to default "
<< dlib::ffmpeg::get_channel_layout_str(pCodec->channel_layouts[0]);
pCodecCtx->channel_layout = pCodec->channel_layouts[0];
}
}
#endif
}
// ---------------------------------------------------------------------------------------------------
inline bool check_codecs (
const bool is_video,
const std::string& filename,
const AVOutputFormat* oformat,
encoder::args& args
)
{
// Check the codec is supported by this muxer
const auto supported_codecs = list_codecs_for_muxer(oformat);
const auto codec_supported = [&](AVCodecID id, const std::string& name)
{
return std::find_if(begin(supported_codecs), end(supported_codecs), [&](const auto& supported) {
return id != AV_CODEC_ID_NONE ? id == supported.codec_id : name == supported.codec_name;
}) != end(supported_codecs);
};
if (codec_supported(args.args_codec.codec, args.args_codec.codec_name))
return true;
logger_dlib_wrapper() << LWARN
<< "Codec " << avcodec_get_name(args.args_codec.codec) << " or " << args.args_codec.codec_name
<< " cannot be stored in this file";
// Pick codec based on file extension
args.args_codec.codec = pick_codec_from_filename(filename);
if (codec_supported(args.args_codec.codec, ""))
{
logger_dlib_wrapper() << LWARN << "Picking codec " << avcodec_get_name(args.args_codec.codec);
return true;
}
// Pick the default codec as suggested by FFmpeg
args.args_codec.codec = is_video ? oformat->video_codec : oformat->audio_codec;
if (args.args_codec.codec != AV_CODEC_ID_NONE)
{
logger_dlib_wrapper() << LWARN << "Picking default codec " << avcodec_get_name(args.args_codec.codec);
return true;
}
logger_dlib_wrapper() << LWARN
<< "List of supported codecs for muxer " << oformat->name << " in this installation of ffmpeg:";
for (const auto& supported : supported_codecs)
logger_dlib_wrapper() << LWARN << " " << supported.codec_name;
return false;
}
// ---------------------------------------------------------------------------------------------------
}
inline encoder::encoder(
const args& a
) : args_(a)
{
if (!open())
pCodecCtx = nullptr;
}
inline bool encoder::open()
{
using namespace details;
register_ffmpeg();
packet = make_avpacket();
const AVCodec* pCodec = nullptr;
if (args_.args_codec.codec != AV_CODEC_ID_NONE)
pCodec = avcodec_find_encoder(args_.args_codec.codec);
else if (!args_.args_codec.codec_name.empty())
pCodec = avcodec_find_encoder_by_name(args_.args_codec.codec_name.c_str());
if (!pCodec)
return fail("Codec ", avcodec_get_name(args_.args_codec.codec), " or ", args_.args_codec.codec_name, " not found");
pCodecCtx.reset(avcodec_alloc_context3(pCodec));
if (!pCodecCtx)
return fail("AV : failed to allocate codec context for ", pCodec->name, " : likely ran out of memory");
if (args_.args_codec.bitrate > 0)
pCodecCtx->bit_rate = args_.args_codec.bitrate;
if (args_.args_codec.gop_size > 0)
pCodecCtx->gop_size = args_.args_codec.gop_size;
if (args_.args_codec.flags > 0)
pCodecCtx->flags |= args_.args_codec.flags;
if (pCodec->type == AVMEDIA_TYPE_VIDEO)
{
if (args_.args_image.h <= 0 ||
args_.args_image.w <= 0 ||
args_.args_image.fmt == AV_PIX_FMT_NONE ||
args_.args_image.framerate <= 0)
{
return fail(pCodec->name, " is an image codec. height, width, fmt (pixel format) and framerate must be set");
}
pCodecCtx->height = args_.args_image.h;
pCodecCtx->width = args_.args_image.w;
pCodecCtx->pix_fmt = args_.args_image.fmt;
pCodecCtx->framerate = AVRational{args_.args_image.framerate, 1};
check_properties(pCodec, pCodecCtx.get());
pCodecCtx->time_base = inv(pCodecCtx->framerate);
}
else if (pCodec->type == AVMEDIA_TYPE_AUDIO)
{
if (args_.args_audio.sample_rate <= 0 ||
args_.args_audio.channel_layout <= 0 ||
args_.args_audio.fmt == AV_SAMPLE_FMT_NONE)
{
return fail(pCodec->name, " is an audio codec. sample_rate, channel_layout and fmt (sample format) must be set");
}
pCodecCtx->sample_rate = args_.args_audio.sample_rate;
pCodecCtx->sample_fmt = args_.args_audio.fmt;
set_layout(pCodecCtx.get(), args_.args_audio.channel_layout);
check_properties(pCodec, pCodecCtx.get());
pCodecCtx->time_base = AVRational{ 1, pCodecCtx->sample_rate };
if (pCodecCtx->codec_id == AV_CODEC_ID_AAC) {
pCodecCtx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
}
}
av_dict opt = args_.args_codec.codec_options;
const int ret = avcodec_open2(pCodecCtx.get(), pCodec, opt.get());
if (ret < 0)
return fail("avcodec_open2() failed : ", get_av_error(ret));
if (pCodec->type == AVMEDIA_TYPE_AUDIO)
{
fifo = audio_fifo(pCodecCtx->frame_size,
pCodecCtx->sample_fmt,
get_nchannels(pCodecCtx.get()));
}
open_ = true;
return open_;
}
inline bool encoder::is_open() const noexcept { return pCodecCtx != nullptr && open_; }
inline bool encoder::is_image_encoder() const noexcept { return pCodecCtx && pCodecCtx->codec_type == AVMEDIA_TYPE_VIDEO; }
inline bool encoder::is_audio_encoder() const noexcept { return pCodecCtx && pCodecCtx->codec_type == AVMEDIA_TYPE_AUDIO; }
inline AVCodecID encoder::get_codec_id() const noexcept { return pCodecCtx ? pCodecCtx->codec_id : AV_CODEC_ID_NONE; }
inline std::string encoder::get_codec_name() const noexcept { return pCodecCtx ? avcodec_get_name(pCodecCtx->codec_id) : "NONE"; }
inline int encoder::fps() const noexcept { return pCodecCtx ? details::to_int(pCodecCtx->framerate) : 0; }
inline int encoder::height() const noexcept { return pCodecCtx ? pCodecCtx->height : 0; }
inline int encoder::width() const noexcept { return pCodecCtx ? pCodecCtx->width : 0; }
inline AVPixelFormat encoder::pixel_fmt() const noexcept { return pCodecCtx ? pCodecCtx->pix_fmt : AV_PIX_FMT_NONE; }
inline int encoder::sample_rate() const noexcept { return pCodecCtx ? pCodecCtx->sample_rate : 0; }
inline AVSampleFormat encoder::sample_fmt() const noexcept { return pCodecCtx ? pCodecCtx->sample_fmt : AV_SAMPLE_FMT_NONE; }
inline uint64_t encoder::channel_layout() const noexcept { return details::get_layout(pCodecCtx.get()); }
inline int encoder::nchannels() const noexcept { return details::get_nchannels(pCodecCtx.get()); }
enum encoding_state
{
ENCODE_SEND_FRAME,
ENCODE_READ_PACKET_THEN_DONE,
ENCODE_READ_PACKET_THEN_SEND_FRAME,
ENCODE_DONE,
ENCODE_ERROR = -1
};
template <class Callback>
inline bool encoder::push (
frame f_,
Callback&& clb
)
{
using namespace std::chrono;
using namespace details;
if (!is_open())
return false;
DLIB_ASSERT(!encoding, "Recursion in push() not supported");
encoding = true;
std::vector<frame> frames;
// Resize if image. Resample if audio. Push through audio fifo if necessary (some audio codecs requires fixed size frames)
if (f_.is_image())
{
resizer_image.resize(f_, pCodecCtx->height, pCodecCtx->width, pCodecCtx->pix_fmt, f_);
frames.push_back(std::move(f_));
}
else if (f_.is_audio())
{
resizer_audio.resize(f_, pCodecCtx->sample_rate, get_layout(pCodecCtx.get()), pCodecCtx->sample_fmt, f_);
frames = fifo.push_pull(std::move(f_));
}
else
{
// FLUSH
frames.push_back(std::move(f_));
}
// Set pts based on tracked state. Ignore timestamps for now
for (auto& f : frames)
{
if (f.f)
{
f.f->pts = next_pts;
next_pts += (f.is_image() ? 1 : f.nsamples());
}
}
const auto send_frame = [&](encoding_state& state, frame& f)
{
const int ret = avcodec_send_frame(pCodecCtx.get(), f.f.get());
if (ret >= 0) {
state = ENCODE_READ_PACKET_THEN_DONE;
} else if (ret == AVERROR(EAGAIN)) {
state = ENCODE_READ_PACKET_THEN_SEND_FRAME;
} else if (ret == AVERROR_EOF) {
open_ = false;
state = ENCODE_DONE;
} else {
open_ = false;
state = ENCODE_ERROR;
logger_dlib_wrapper() << LERROR << "avcodec_send_frame() failed : " << get_av_error(ret);
}
};
const auto recv_packet = [&](encoding_state& state, bool resend)
{
const int ret = avcodec_receive_packet(pCodecCtx.get(), packet.get());
if (ret == AVERROR(EAGAIN) && resend)
state = ENCODE_SEND_FRAME;
else if (ret == AVERROR(EAGAIN))
state = ENCODE_DONE;
else if (ret == AVERROR_EOF) {
open_ = false;
state = ENCODE_DONE;
}
else if (ret < 0)
{
open_ = false;
state = ENCODE_ERROR;
logger_dlib_wrapper() << LERROR << "avcodec_receive_packet() failed : " << get_av_error(ret);
}
else
{
if (!switch_(bools(dlib::is_invocable_r<bool, Callback, std::size_t, const char*>{},
dlib::is_invocable_r<bool, Callback, AVCodecContext*, AVPacket*>{}),
[&](true_t, false_t, auto _) {
return _(clb)(packet->size, (const char*)packet->data);
},
[&](false_t, true_t, auto _) {
return _(clb)(pCodecCtx.get(), packet.get());
},
[&](false_t, false_t, auto _) {
static_assert(_(false), "Callback is a bad callback type");
return false;
}
))
{
open_ = false;
state = ENCODE_ERROR;
}
}
};
encoding_state state = ENCODE_SEND_FRAME;
for (size_t i = 0 ; i < frames.size() && is_open() ; ++i)
{
state = ENCODE_SEND_FRAME;
while (state != ENCODE_DONE && state != ENCODE_ERROR)
{
switch(state)
{
case ENCODE_SEND_FRAME: send_frame(state, frames[i]); break;
case ENCODE_READ_PACKET_THEN_DONE: recv_packet(state, false); break;
case ENCODE_READ_PACKET_THEN_SEND_FRAME: recv_packet(state, true); break;
default: break;
}
}
}
encoding = false;
return state != ENCODE_ERROR;
}
template <
class image_type,
class Callback,
is_image_check<image_type>
>
inline bool encoder::push (
const image_type& img,
Callback&& sink
)
{
// Unfortunately, FFmpeg assumes all data is over-aligned, and therefore,
// even though the API has facilities to convert img directly to a frame object,
// we cannot use it because it assumes the data in img is over-aligned, and of
// course, it is not. Shame. At some point, I'll more digging to see if we
// can get around this without doing a brute force copy like below.
using namespace details;
frame f;
convert(img, f);
return push(std::move(f), std::forward<Callback>(sink));
}
template <class Callback>
inline void encoder::flush(Callback&& clb)
{
push(frame{}, std::forward<Callback>(clb));
}
// ---------------------------------------------------------------------------------------------------
namespace details
{
inline auto muxer_sink(AVFormatContext* pFormatCtx, int stream_id)
{
return [=](AVCodecContext* pCodecCtx, AVPacket* pkt)
{
AVStream* stream = pFormatCtx->streams[stream_id];
av_packet_rescale_ts(pkt, pCodecCtx->time_base, stream->time_base);
pkt->stream_index = stream_id;
int ret = av_interleaved_write_frame(pFormatCtx, pkt);
if (ret < 0)
logger_dlib_wrapper() << LERROR << "av_interleaved_write_frame() failed : " << get_av_error(ret);
return ret == 0;
};
}
}
inline muxer::muxer(const args &a)
{
if (!open(a))
st.pFormatCtx = nullptr;
}
inline muxer::muxer(muxer &&other) noexcept
: st{std::move(other.st)}
{
if (st.pFormatCtx)
st.pFormatCtx->opaque = this;
}
inline muxer& muxer::operator=(muxer &&other) noexcept
{
if (this != &other)
{
flush();
st = std::move(other.st);
if (st.pFormatCtx)
st.pFormatCtx->opaque = this;
}
return *this;
}
inline muxer::~muxer()
{
flush();
}
inline bool muxer::open(const args& a)
{
using namespace std::chrono;
using namespace details;
st = {};
st.args_ = a;
if (!st.args_.enable_audio && !st.args_.enable_image)
return fail("You need to set at least one of `enable_audio` or `enable_image`");
{
st.connecting_time = system_clock::now();
st.connected_time = system_clock::time_point::max();
const char* const format_name = st.args_.output_format.empty() ? nullptr : st.args_.output_format.c_str();
const char* const filename = st.args_.filepath.empty() ? nullptr : st.args_.filepath.c_str();
AVFormatContext* pFormatCtx = nullptr;
int ret = avformat_alloc_output_context2(&pFormatCtx, nullptr, format_name, filename);
if (ret < 0)
return fail("avformat_alloc_output_context2() failed : ", get_av_error(ret));
st.pFormatCtx.reset(pFormatCtx);
}
int stream_counter{0};
const auto setup_stream = [&](bool is_video)
{
// Setup encoder for this stream
auto& enc = is_video ? st.encoder_image : st.encoder_audio;
int& stream_id = is_video ? st.stream_id_video : st.stream_id_audio;
encoder::args args;
if (is_video)
{
args.args_codec = st.args_.args_image;
args.args_image = st.args_.args_image;
}
else
{
args.args_codec = st.args_.args_audio;
args.args_audio = st.args_.args_audio;
}
if (st.pFormatCtx->oformat->flags & AVFMT_GLOBALHEADER)
args.args_codec.flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
if (!check_codecs(is_video, st.args_.filepath, st.pFormatCtx->oformat, args))
return false;
// Codec is supported by muxer, so create encoder
enc = encoder(args);
if (!enc.is_open())
return false;
AVStream* stream = avformat_new_stream(st.pFormatCtx.get(), enc.pCodecCtx->codec);
if (!stream)
return fail("avformat_new_stream() failed");
stream_id = stream_counter;
stream->id = stream_counter;
stream->time_base = enc.pCodecCtx->time_base;
++stream_counter;
int ret = avcodec_parameters_from_context(stream->codecpar, enc.pCodecCtx.get());
if (ret < 0)
return fail("avcodec_parameters_from_context() failed : ", get_av_error(ret));
return true;
};
if (st.args_.enable_image && !setup_stream(true))
return false;
if (st.args_.enable_audio && !setup_stream(false))
return false;
st.pFormatCtx->opaque = this;
st.pFormatCtx->interrupt_callback.opaque = st.pFormatCtx.get();
st.pFormatCtx->interrupt_callback.callback = [](void* ctx) -> int {
AVFormatContext* pFormatCtx = (AVFormatContext*)ctx;
muxer* me = (muxer*)pFormatCtx->opaque;
return me->interrupt_callback();
};
if (st.args_.max_delay > 0)
st.pFormatCtx->max_delay = st.args_.max_delay;
if ((st.pFormatCtx->oformat->flags & AVFMT_NOFILE) == 0)
{
av_dict opt = st.args_.protocol_options;
int ret = avio_open2(&st.pFormatCtx->pb, st.args_.filepath.c_str(), AVIO_FLAG_WRITE, &st.pFormatCtx->interrupt_callback, opt.get());
if (ret < 0)
return fail("avio_open2() failed : ", get_av_error(ret));
}
av_dict opt = st.args_.format_options;
int ret = avformat_write_header(st.pFormatCtx.get(), opt.get());
if (ret < 0)
return fail("avformat_write_header() failed : ", get_av_error(ret));
st.connected_time = system_clock::now();
return true;
}
inline bool muxer::interrupt_callback()
{
const auto now = std::chrono::system_clock::now();
if (st.args_.connect_timeout < std::chrono::milliseconds::max() && // check there is a timeout
now < st.connected_time && // we haven't already connected
now > (st.connecting_time + st.args_.connect_timeout) // we've timed-out
)
return true;
if (st.args_.read_timeout < std::chrono::milliseconds::max() && // check there is a timeout
now > (st.last_read_time + st.args_.read_timeout) // we've timed-out
)
return true;
if (st.args_.interrupter && st.args_.interrupter()) // check user-specified callback
return true;
return false;
}
inline bool muxer::push(frame f)
{
using namespace details;
if (!is_open())
return false;
if (f.is_image())
{
if (!st.encoder_image.is_open())
return fail("frame is an image type but image encoder is not initialized");
return st.encoder_image.push(std::move(f), muxer_sink(st.pFormatCtx.get(), st.stream_id_video));
}
else if (f.is_audio())
{
if (!st.encoder_audio.is_open())
return fail("frame is of audio type but audio encoder is not initialized");
return st.encoder_audio.push(std::move(f), muxer_sink(st.pFormatCtx.get(), st.stream_id_audio));
}
return false;
}
template <
class image_type,
is_image_check<image_type>
>
bool muxer::push(const image_type& img)
{
using namespace details;
return is_open() &&
st.encoder_image.is_open() &&
st.encoder_image.push(img, muxer_sink(st.pFormatCtx.get(), st.stream_id_video));
}
inline void muxer::flush()
{
using namespace details;
if (!is_open())
return;
// Flush the encoder but don't actually close the underlying AVCodecContext
st.encoder_image.flush(muxer_sink(st.pFormatCtx.get(), st.stream_id_video));
st.encoder_audio.flush(muxer_sink(st.pFormatCtx.get(), st.stream_id_audio));
const int ret = av_write_trailer(st.pFormatCtx.get());
if (ret < 0)
logger_dlib_wrapper() << LERROR << "av_write_trailer() failed : " << details::get_av_error(ret);
if ((st.pFormatCtx->oformat->flags & AVFMT_NOFILE) == 0)
avio_closep(&st.pFormatCtx->pb);
st.pFormatCtx = nullptr;
st.encoder_image = {};
st.encoder_audio = {};
}
inline bool muxer::is_open() const noexcept { return video_enabled() || audio_enabled(); }
inline bool muxer::video_enabled() const noexcept { return st.pFormatCtx != nullptr && st.encoder_image.is_image_encoder(); }
inline bool muxer::audio_enabled() const noexcept { return st.pFormatCtx != nullptr && st.encoder_audio.is_audio_encoder(); }
inline int muxer::height() const noexcept { return st.encoder_image.height(); }
inline int muxer::width() const noexcept { return st.encoder_image.width(); }
inline AVPixelFormat muxer::pixel_fmt() const noexcept { return st.encoder_image.pixel_fmt(); }
inline AVCodecID muxer::get_video_codec_id() const noexcept { return st.encoder_image.get_codec_id(); }
inline std::string muxer::get_video_codec_name() const noexcept { return st.encoder_image.get_codec_name(); }
inline int muxer::sample_rate() const noexcept { return st.encoder_audio.sample_rate(); }
inline uint64_t muxer::channel_layout() const noexcept { return st.encoder_audio.channel_layout(); }
inline int muxer::nchannels() const noexcept { return st.encoder_audio.nchannels(); }
inline AVSampleFormat muxer::sample_fmt() const noexcept { return st.encoder_audio.sample_fmt(); }
inline AVCodecID muxer::get_audio_codec_id() const noexcept { return st.encoder_audio.get_codec_id(); }
inline std::string muxer::get_audio_codec_name() const noexcept { return st.encoder_audio.get_codec_name(); }
// ---------------------------------------------------------------------------------------------------
template <
class image_type,
is_image_check<image_type>
>
inline void save_frame(
const image_type& image,
const std::string& file_name,
const std::unordered_map<std::string, std::string>& codec_options
)
{
muxer writer([&] {
muxer::args args;
args.filepath = file_name;
args.enable_image = true;
args.enable_audio = false;
args.args_image.h = num_rows(image);
args.args_image.w = num_columns(image);
args.args_image.framerate = 1;
args.args_image.fmt = pix_traits<pixel_type_t<image_type>>::fmt;
args.args_image.codec_options = codec_options;
args.format_options["update"] = "1";
return args;
}());
if (!writer.push(image))
throw error(EIMAGE_SAVE, "ffmpeg::save_frame: error while saving " + file_name);
}
// ---------------------------------------------------------------------------------------------------
}
}
#endif //DLIB_VIDEO_MUXER
|
[
"[email protected]"
] | |
5da36a8a063c60d8987dfa10ceee747c0b03aec7
|
8c59e7602354267836ce4df60ee97d9503da1ca5
|
/libs/include/gzip.hpp
|
9b9e2ec59b1d9210cf36fe377c8690f14cb8b542
|
[
"MIT"
] |
permissive
|
hybrid-ray/sulfur
|
416fcfc47da7d30cc925885f011a05f54e525b61
|
9553ed26e7a971b1b756d7709c203e25baa7ff54
|
refs/heads/master
| 2023-07-04T23:52:48.573158 | 2021-08-15T14:29:36 | 2021-08-15T14:29:36 | 394,246,630 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 948 |
hpp
|
#ifndef __GZIP_HPP__
#define __GZIP_HPP__
#include <sstream>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/gzip.hpp>
class Gzip {
public:
static std::string compress(const std::string& data)
{
namespace bio = boost::iostreams;
std::stringstream compressed;
std::stringstream origin(data);
bio::filtering_streambuf<bio::input> out;
out.push(bio::gzip_compressor(bio::gzip_params(bio::gzip::best_compression)));
out.push(origin);
bio::copy(out, compressed);
return compressed.str();
}
static std::string decompress(const std::string& data)
{
namespace bio = boost::iostreams;
std::stringstream compressed(data);
std::stringstream decompressed;
bio::filtering_streambuf<bio::input> out;
out.push(bio::gzip_decompressor());
out.push(compressed);
bio::copy(out, decompressed);
return decompressed.str();
}
};
#endif // __GZIP_HPP__
|
[
"[email protected]"
] | |
2201b97e6396ecd88e5cdb09ec9be65c4f7fc590
|
8a57eb0993bdd61746246c815faae725b22e9547
|
/src/policy/feerate.h
|
6ff7adbe5fa19ccb08a39fcaeb5e2e4f39696e33
|
[
"MIT"
] |
permissive
|
bastiencaillot/BitcoinCloud
|
1596b9be8c8a3a5afba852dfbcc2d1dc89282978
|
c519c4e87e80330fa23eb68d63c6a2d387507261
|
refs/heads/master
| 2022-02-13T23:21:16.217680 | 2019-07-23T12:52:20 | 2019-07-23T12:52:20 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 2,404 |
h
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOINCLOUD_POLICY_FEERATE_H
#define BITCOINCLOUD_POLICY_FEERATE_H
#include <amount.h>
#include <serialize.h>
#include <string>
extern const std::string CURRENCY_UNIT;
/**
* Fee rate in satoshis per kilobyte: CAmount / kB
*/
class CFeeRate
{
private:
CAmount nSatoshisPerK; // unit is satoshis-per-1,000-bytes
public:
/** Fee rate of 0 satoshis per kB */
CFeeRate() : nSatoshisPerK(0) {}
template <typename I>
CFeeRate(const I _nSatoshisPerK) : nSatoshisPerK(_nSatoshisPerK)
{
// We've previously had bugs creep in from silent double->int conversion...
static_assert(std::is_integral<I>::value, "CFeeRate should be used without floats");
}
/** Constructor for a fee rate in satoshis per kB. The size in bytes must not exceed (2^63 - 1)*/
CFeeRate(const CAmount& nFeePaid, size_t nBytes);
/**
* Return the fee in satoshis for the given size in bytes.
*/
CAmount GetFee(size_t nBytes) const;
/**
* Return the fee in satoshis for a size of 1000 bytes
*/
CAmount GetFeePerK() const { return GetFee(1000); }
friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; }
friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; }
friend bool operator==(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK == b.nSatoshisPerK; }
friend bool operator<=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK <= b.nSatoshisPerK; }
friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; }
friend bool operator!=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK != b.nSatoshisPerK; }
CFeeRate& operator+=(const CFeeRate& a)
{
nSatoshisPerK += a.nSatoshisPerK;
return *this;
}
std::string ToString() const;
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action)
{
READWRITE(nSatoshisPerK);
}
};
#endif // BITCOINCLOUD_POLICY_FEERATE_H
|
[
"[email protected]"
] | |
11286f225b3249d74219f2aa8e9c69d0016ebee5
|
4de849dbfcbbd7b8d23714d19bd675215bbf4151
|
/NpcController.cpp
|
050c0852f2ebabf1cd333bb9c2a000b2acd50d3e
|
[] |
no_license
|
csusbdt/steering
|
4a11fde3711a18fb910ae4f641291709fc4361e5
|
d2311aaa88c8b4f5955f72214e1b013333ea438a
|
refs/heads/master
| 2021-01-20T23:18:08.499344 | 2014-08-22T07:52:48 | 2014-08-22T07:52:48 | 23,217,473 | 3 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,501 |
cpp
|
#include "NpcController.h"
#include "Pawn.h"
#include "GameObject.h"
#include <cassert>
#include <iostream>
void NpcController::setPawn(Pawn * pawn)
{
Controller::setPawn(pawn);
seekBehavior.setPawn(pawn);
arriveBehavior.setPawn(pawn);
lookWhereYoureGoingBehavior.setPawn(pawn);
followPathBehavior.setPawn(pawn);
}
void NpcController::tick(float dt)
{
assert(pawn != 0);
switch (state)
{
case idle:
tickIdle(dt);
break;
case seeking:
tickSeeking(dt);
break;
case arriving:
tickArriving(dt);
break;
case pathFollowing:
tickPathFollowing(dt);
break;
default:
assert(false);
}
}
void NpcController::tickSeeking(float dt)
{
assert(pawn->target != 0);
assert(state == seeking);
seekBehavior.seek(dt, pawn->target->position);
}
void NpcController::tickArriving(float dt)
{
assert(pawn->target != 0);
assert(state == arriving);
bool arrived = arriveBehavior.arrive(dt, pawn->target->position);
if (arrived)
{
state = idle;
}
else
{
lookWhereYoureGoingBehavior.look(dt);
}
}
void NpcController::tickPathFollowing(float dt)
{
assert(state == pathFollowing);
followPathBehavior.follow(dt);
lookWhereYoureGoingBehavior.look(dt);
}
void NpcController::tickIdle(float dt)
{
if (pawn->target != 0)
{
float distanceToTarget = (pawn->position - pawn->target->position).length();
if (distanceToTarget > pawn->arriveSatisfactionRadius)
{
state = arriving;
}
}
}
|
[
"[email protected]"
] | |
69a86e164a1ee37c60a18c27350c829f75fd05b2
|
d657e6161bb4b4c603d1deba4e0bcd871eb9031c
|
/matlab_code/jjcao_code-head/toolbox/jjcao_mesh/geodesic/mex/gw/gw_geodesic/GW_VoronoiMesh.h
|
be11abddd2fbdde2f04ead37186876058dbc6670
|
[
"MIT"
] |
permissive
|
joycewangsy/normals_pointnet
|
84c508b7b5f96cb0c8fdbfd1d5a2bcac4e68772a
|
fc74a8ed1a009b18785990b1b4c20eda0549721c
|
refs/heads/main
| 2023-01-05T23:12:30.500115 | 2020-11-09T12:29:56 | 2020-11-09T12:29:56 | 311,324,467 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 9,027 |
h
|
/*------------------------------------------------------------------------------*/
/**
* \file GW_VoronoiMesh.h
* \brief Definition of class \c GW_VoronoiMesh
* \author Gabriel Peyr?
* \date 4-12-2003
*/
/*------------------------------------------------------------------------------*/
#ifndef _GW_VORONOIMESHBUILDER_H_
#define _GW_VORONOIMESHBUILDER_H_
#include "../gw_core/GW_Config.h"
#include "GW_GeodesicMesh.h"
#include "GW_GeodesicPath.h"
#include "GW_VoronoiVertex.h"
#include "../gw_core/GW_ProgressBar.h"
namespace GW {
/*------------------------------------------------------------------------------*/
/** \name a map of GW_U32 */
/*------------------------------------------------------------------------------*/
//@{
typedef std::map<GW_U32, GW_U32> T_VertNbr2ArrayNbr;
typedef T_VertNbr2ArrayNbr::iterator IT_VertNbr2ArrayNbr;
typedef T_VertNbr2ArrayNbr::reverse_iterator RIT_VertNbr2ArrayNbr;
typedef T_VertNbr2ArrayNbr::const_iterator CIT_VertNbr2ArrayNbr;
typedef T_VertNbr2ArrayNbr::const_reverse_iterator CRIT_VertNbr2ArrayNbr;
//@}
/*------------------------------------------------------------------------------*/
/** \name a map of T_GeodesicVertexList */
/*------------------------------------------------------------------------------*/
//@{
typedef std::map<GW_U32, T_GeodesicVertexList*> T_VertexPathMap;
typedef T_VertexPathMap::iterator IT_VertexPathMap;
typedef T_VertexPathMap::reverse_iterator RIT_VertexPathMap;
typedef T_VertexPathMap::const_iterator CIT_VertexPathMap;
typedef T_VertexPathMap::const_reverse_iterator CRIT_VertexPathMap;
//@}
/*------------------------------------------------------------------------------*/
/** \name a multimap of T_GeodesicVertexList */
/*------------------------------------------------------------------------------*/
//@{
typedef std::multimap<GW_U32, T_GeodesicVertexList*> T_VertexPathMultiMap;
typedef T_VertexPathMultiMap::iterator IT_VertexPathMultiMultiMap;
typedef T_VertexPathMultiMap::reverse_iterator RIT_VertexPathMultiMap;
typedef T_VertexPathMultiMap::const_iterator CIT_VertexPathMultiMap;
typedef T_VertexPathMultiMap::const_reverse_iterator CRIT_VertexPathMultiMap;
//@}
/*------------------------------------------------------------------------------*/
/**
* \class GW_VoronoiMesh
* \brief Iterate an algorithm wich find base vertex at Voronoy crossing points.
* \author Gabriel Peyr?
* \date 4-12-2003
*
* Remesh the resulting point in a Delaunay fashion.
*/
/*------------------------------------------------------------------------------*/
class GW_VoronoiMesh: public GW_Mesh
{
public:
/*------------------------------------------------------------------------------*/
/** \name Constructor and destructor */
/*------------------------------------------------------------------------------*/
//@{
GW_VoronoiMesh();
virtual ~GW_VoronoiMesh();
//@}
//-------------------------------------------------------------------------
/** \name Base mesh construction */
//-------------------------------------------------------------------------
//@{
static GW_U32 AddFurthestPoint( T_GeodesicVertexList& VertList, GW_GeodesicMesh& Mesh, GW_Bool bUseRandomStartVertex = GW_False );
static GW_U32 AddFurthestPointsIterate( T_GeodesicVertexList& VertList, GW_GeodesicMesh& Mesh, GW_U32 nNbrIteration, GW_Bool bUseRandomStartVertex = GW_False, GW_Bool bUseProgressBar = GW_True );
void BuildMesh( GW_GeodesicMesh& OriginalMesh, GW_Bool bFixHole = GW_True );
//@}
//-------------------------------------------------------------------------
/** \name Parametrization construction. */
//-------------------------------------------------------------------------
//@{
void BuildGeodesicBoundaries( GW_GeodesicMesh& Mesh );
void BuildGeodesicParametrization( GW_GeodesicMesh& Mesh );
//@}
void Reset();
T_GeodesicVertexList& GetBaseVertexList();
GW_U32 GetNbrBasePoints();
T_VertexPathMap& GetGeodesicBoundariesMap();
void InterpolatePosition( GW_GeodesicMesh& Mesh, GW_Vector3D& Position,
GW_VoronoiVertex& v0, GW_VoronoiVertex& v1, GW_VoronoiVertex& v2,
GW_Float a, GW_Float b, GW_Float c );
void InterpolatePositionExhaustiveSearch( GW_GeodesicMesh& Mesh, GW_Vector3D& Position,
GW_VoronoiVertex& v0, GW_VoronoiVertex& v1, GW_VoronoiVertex& v2,
GW_Float a, GW_Float b, GW_Float c );
//-------------------------------------------------------------------------
/** \name Surface flattening. */
//-------------------------------------------------------------------------
//@{
void GetNaturalNeighborWeights( T_FloatMap& Weights, GW_GeodesicMesh& Mesh, GW_GeodesicVertex& Vert );
void FlattenBasePoints( GW_GeodesicMesh& Mesh, T_Vector2DMap& FlatteningMap );
void GetReciprocicalDistanceWeights( T_FloatMap& Weights, GW_GeodesicMesh& Mesh, GW_GeodesicVertex& Vert );
//@}
//-------------------------------------------------------------------------
/** \name Class factory methods. */
//-------------------------------------------------------------------------
//@{
virtual GW_Vertex& CreateNewVertex();
virtual GW_Face& CreateNewFace();
//@}
/* \todo Should be private */
void PerformLocalFastMarching( GW_GeodesicMesh& Mesh, GW_VoronoiVertex& Vert );
static GW_Bool FastMarchingCallbackFunction_Parametrization( GW_GeodesicVertex& CurVert );
static GW_VoronoiVertex* pCurrentVoronoiVertex_;
static void PerformFastMarching( GW_GeodesicMesh& OriginalMesh, T_GeodesicVertexList& VertList );
/** helpers for furthest point building */
static GW_Bool FastMarchingCallbackFunction_VertexInsersion( GW_GeodesicVertex& CurVert, GW_Float rNewDist );
static void ResetOnlyVertexState( GW_GeodesicMesh& Mesh );
/** helper for natural neighbor interpolation */
class GW_GeodesicInformationDuplicata: public GW_SmartCounter
{
public:
GW_GeodesicInformationDuplicata( GW_GeodesicVertex& vert )
:GW_SmartCounter(),
rDistance_ ( vert.GetDistance() ),
pFront_ ( vert.GetFront() )
{ vert.SetUserData(this); }
GW_Float rDistance_;
GW_GeodesicVertex* pFront_;
};
/** intermediate variable for boundaries bulding */
static T_VertexPathMultiMap BoundaryEdgeMap_;
static void AddPathToMeshVertex( GW_GeodesicMesh& Mesh, GW_GeodesicPath& GeodesicPath, T_GeodesicVertexList& VertexPath );
private:
static GW_Face* FindMaxFace( GW_GeodesicVertex& Vert );
static GW_GeodesicVertex* FindMaxVertex( GW_GeodesicMesh& Mesh );
void CreateVoronoiVertex();
/** list of current base vertex */
T_GeodesicVertexList BaseVertexList_;
/** list all geodesic distance */
T_FloatMap GeodesicDistanceMap_;
/** helpers for mesh building */
static T_VoronoiVertexMap VoronoiVertexMap_;
static void FastMarchingCallbackFunction_MeshBuilding( GW_GeodesicVertex& CurVert );
static GW_VoronoiVertex* GetVoronoiFromGeodesic( GW_GeodesicVertex& Vert );
static GW_Bool TestManifoldStructure( GW_VoronoiVertex& Vert1, GW_VoronoiVertex& Vert2 );
void FixHole();
/** helper for parametrization building */
static T_VoronoiVertexList CurrentTargetVertex_;
static GW_Bool FastMarchingCallbackFunction_Boundaries( GW_GeodesicVertex& CurVert );
T_VertexPathMap VertexPathMap_;
void ComputeVertexParameters( GW_GeodesicMesh& Mesh );
/** helper for interpolation */
T_GeodesicVertexMap CentralParameterMap_;
static GW_Bool GetParameterVertex( GW_GeodesicVertex& Vert, GW_Float& a, GW_Float& b, GW_Float& c,
const GW_VoronoiVertex& ParamV0, const GW_VoronoiVertex& ParamV1, const GW_VoronoiVertex& ParamV2 );
static GW_Float NaturalNeighborContribution( GW_Face& Face, GW_GeodesicVertex& Vert, T_FloatMap& Weights );
GW_Bool bInterpolationPreparationDone_;
static GW_Float DistributeContribution( GW_Face& Face, T_FloatMap& Weights,
GW_GeodesicVertex* pVert[3], GW_Vector2D VertPos[3],
T_Vector2DList* pPolyContrib );
public:
static GW_Bool FastMarchingCallbackFunction_VertexInsersionNN( GW_GeodesicVertex& CurVert, GW_Float rNewDist );
static void PrepareInterpolation( GW_GeodesicMesh& Mesh );
/** helpers for reciprocical distance interpolation */
static GW_U32 nNbrBaseVertex_RD_;
static T_FloatMap* pCurWeights_;
static GW_Bool FastMarchingCallbackFunction_VertexInsersionRD1( GW_GeodesicVertex& CurVert, GW_Float rNewDist );
static GW_Bool FastMarchingCallbackFunction_VertexInsersionRD2( GW_GeodesicVertex& CurVert, GW_Float rNewDist );
static GW_Bool FastMarchingCallbackFunction_ForceStopRD( GW_GeodesicVertex& Vert );
};
} // End namespace GW
#ifdef GW_USE_INLINE
#include "GW_VoronoiMesh.inl"
#endif
#endif // _GW_VORONOIMESHBUILDER_H_
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) Gabriel Peyr?
///////////////////////////////////////////////////////////////////////////////
// END OF FILE //
///////////////////////////////////////////////////////////////////////////////
|
[
"[email protected]"
] | |
1e25d5847c4cb3d18516df28a3ce0c88b1a6b378
|
9c16d6b984c9a22c219bd2a20a02db21a51ba8d7
|
/components/proximity_auth/proximity_monitor_impl.cc
|
432485c906599b3230477873863d3a755ebb8f89
|
[
"BSD-3-Clause"
] |
permissive
|
nv-chromium/chromium-crosswalk
|
fc6cc201cb1d6a23d5f52ffd3a553c39acd59fa7
|
b21ec2ffe3a13b6a8283a002079ee63b60e1dbc5
|
refs/heads/nv-crosswalk-17
| 2022-08-25T01:23:53.343546 | 2019-01-16T21:35:23 | 2019-01-16T21:35:23 | 63,197,891 | 0 | 0 |
NOASSERTION
| 2019-01-16T21:38:06 | 2016-07-12T22:58:43 | null |
UTF-8
|
C++
| false | false | 9,281 |
cc
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/proximity_auth/proximity_monitor_impl.h"
#include <math.h>
#include "base/bind.h"
#include "base/location.h"
#include "base/thread_task_runner_handle.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "components/proximity_auth/logging/logging.h"
#include "components/proximity_auth/metrics.h"
#include "components/proximity_auth/proximity_monitor_observer.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
using device::BluetoothDevice;
namespace proximity_auth {
// The time to wait, in milliseconds, between proximity polling iterations.
const int kPollingTimeoutMs = 250;
// The RSSI threshold below which we consider the remote device to not be in
// proximity.
const int kRssiThreshold = -5;
// The weight of the most recent RSSI sample.
const double kRssiSampleWeight = 0.3;
ProximityMonitorImpl::ProximityMonitorImpl(const RemoteDevice& remote_device,
scoped_ptr<base::TickClock> clock,
ProximityMonitorObserver* observer)
: remote_device_(remote_device),
observer_(observer),
strategy_(Strategy::NONE),
remote_device_is_in_proximity_(false),
is_active_(false),
clock_(clock.Pass()),
polling_weak_ptr_factory_(this),
weak_ptr_factory_(this) {
if (device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable()) {
device::BluetoothAdapterFactory::GetAdapter(
base::Bind(&ProximityMonitorImpl::OnAdapterInitialized,
weak_ptr_factory_.GetWeakPtr()));
} else {
PA_LOG(ERROR) << "[Proximity] Proximity monitoring unavailable: "
<< "Bluetooth is unsupported on this platform.";
}
// TODO(isherman): Test prefs to set the strategy. Need to read from "Local
// State" prefs on the sign-in screen, and per-user prefs on the lock screen.
// TODO(isherman): Unlike in the JS app, destroy and recreate the proximity
// monitor when the connection state changes.
}
ProximityMonitorImpl::~ProximityMonitorImpl() {
}
void ProximityMonitorImpl::Start() {
is_active_ = true;
UpdatePollingState();
}
void ProximityMonitorImpl::Stop() {
is_active_ = false;
ClearProximityState();
UpdatePollingState();
}
ProximityMonitor::Strategy ProximityMonitorImpl::GetStrategy() const {
return strategy_;
}
bool ProximityMonitorImpl::IsUnlockAllowed() const {
return strategy_ == Strategy::NONE || remote_device_is_in_proximity_;
}
bool ProximityMonitorImpl::IsInRssiRange() const {
return (strategy_ != Strategy::NONE && rssi_rolling_average_ &&
*rssi_rolling_average_ > kRssiThreshold);
}
void ProximityMonitorImpl::RecordProximityMetricsOnAuthSuccess() {
double rssi_rolling_average = rssi_rolling_average_
? *rssi_rolling_average_
: metrics::kUnknownProximityValue;
int last_transmit_power_delta =
last_transmit_power_reading_
? (last_transmit_power_reading_->transmit_power -
last_transmit_power_reading_->max_transmit_power)
: metrics::kUnknownProximityValue;
// If no zero RSSI value has been read, then record an overflow.
base::TimeDelta time_since_last_zero_rssi;
if (last_zero_rssi_timestamp_)
time_since_last_zero_rssi = clock_->NowTicks() - *last_zero_rssi_timestamp_;
else
time_since_last_zero_rssi = base::TimeDelta::FromDays(100);
std::string remote_device_model = metrics::kUnknownDeviceModel;
if (remote_device_.name != remote_device_.bluetooth_address)
remote_device_model = remote_device_.name;
metrics::RecordAuthProximityRollingRssi(round(rssi_rolling_average));
metrics::RecordAuthProximityTransmitPowerDelta(last_transmit_power_delta);
metrics::RecordAuthProximityTimeSinceLastZeroRssi(time_since_last_zero_rssi);
metrics::RecordAuthProximityRemoteDeviceModelHash(remote_device_model);
}
void ProximityMonitorImpl::SetStrategy(Strategy strategy) {
if (strategy_ == strategy)
return;
strategy_ = strategy;
CheckForProximityStateChange();
UpdatePollingState();
}
ProximityMonitorImpl::TransmitPowerReading::TransmitPowerReading(
int transmit_power,
int max_transmit_power)
: transmit_power(transmit_power), max_transmit_power(max_transmit_power) {
}
bool ProximityMonitorImpl::TransmitPowerReading::IsInProximity() const {
return transmit_power < max_transmit_power;
}
void ProximityMonitorImpl::OnAdapterInitialized(
scoped_refptr<device::BluetoothAdapter> adapter) {
bluetooth_adapter_ = adapter;
UpdatePollingState();
}
void ProximityMonitorImpl::UpdatePollingState() {
if (ShouldPoll()) {
// If there is a polling iteration already scheduled, wait for it.
if (polling_weak_ptr_factory_.HasWeakPtrs())
return;
// Polling can re-entrantly call back into this method, so make sure to
// schedule the next polling iteration prior to executing the current one.
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
base::Bind(&ProximityMonitorImpl::PerformScheduledUpdatePollingState,
polling_weak_ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromMilliseconds(kPollingTimeoutMs));
Poll();
} else {
polling_weak_ptr_factory_.InvalidateWeakPtrs();
remote_device_is_in_proximity_ = false;
}
}
void ProximityMonitorImpl::PerformScheduledUpdatePollingState() {
polling_weak_ptr_factory_.InvalidateWeakPtrs();
UpdatePollingState();
}
bool ProximityMonitorImpl::ShouldPoll() const {
// Note: We poll even if the strategy is NONE so we can record measurements.
return is_active_ && bluetooth_adapter_;
}
void ProximityMonitorImpl::Poll() {
DCHECK(ShouldPoll());
BluetoothDevice* device =
bluetooth_adapter_->GetDevice(remote_device_.bluetooth_address);
if (!device) {
PA_LOG(ERROR) << "Unknown Bluetooth device with address "
<< remote_device_.bluetooth_address;
ClearProximityState();
return;
}
if (!device->IsConnected()) {
PA_LOG(ERROR) << "Bluetooth device with address "
<< remote_device_.bluetooth_address << " is not connected.";
ClearProximityState();
return;
}
device->GetConnectionInfo(base::Bind(&ProximityMonitorImpl::OnConnectionInfo,
weak_ptr_factory_.GetWeakPtr()));
}
void ProximityMonitorImpl::OnConnectionInfo(
const BluetoothDevice::ConnectionInfo& connection_info) {
if (!is_active_) {
PA_LOG(INFO) << "[Proximity] Got connection info after stopping";
return;
}
if (connection_info.rssi != BluetoothDevice::kUnknownPower &&
connection_info.transmit_power != BluetoothDevice::kUnknownPower &&
connection_info.max_transmit_power != BluetoothDevice::kUnknownPower) {
AddSample(connection_info);
} else {
PA_LOG(WARNING) << "[Proximity] Unkown values received from API: "
<< connection_info.rssi << " "
<< connection_info.transmit_power << " "
<< connection_info.max_transmit_power;
rssi_rolling_average_.reset();
last_transmit_power_reading_.reset();
CheckForProximityStateChange();
}
}
void ProximityMonitorImpl::ClearProximityState() {
if (is_active_ && remote_device_is_in_proximity_)
observer_->OnProximityStateChanged();
remote_device_is_in_proximity_ = false;
rssi_rolling_average_.reset();
last_transmit_power_reading_.reset();
last_zero_rssi_timestamp_.reset();
}
void ProximityMonitorImpl::AddSample(
const BluetoothDevice::ConnectionInfo& connection_info) {
double weight = kRssiSampleWeight;
if (!rssi_rolling_average_) {
rssi_rolling_average_.reset(new double(connection_info.rssi));
} else {
*rssi_rolling_average_ =
weight * connection_info.rssi + (1 - weight) * (*rssi_rolling_average_);
}
last_transmit_power_reading_.reset(new TransmitPowerReading(
connection_info.transmit_power, connection_info.max_transmit_power));
// It's rare but possible for the RSSI to be positive briefly.
if (connection_info.rssi >= 0)
last_zero_rssi_timestamp_.reset(new base::TimeTicks(clock_->NowTicks()));
CheckForProximityStateChange();
}
void ProximityMonitorImpl::CheckForProximityStateChange() {
if (strategy_ == Strategy::NONE)
return;
bool is_now_in_proximity = false;
switch (strategy_) {
case Strategy::NONE:
return;
case Strategy::CHECK_RSSI:
is_now_in_proximity = IsInRssiRange();
break;
case Strategy::CHECK_TRANSMIT_POWER:
is_now_in_proximity = (last_transmit_power_reading_ &&
last_transmit_power_reading_->IsInProximity());
break;
}
if (remote_device_is_in_proximity_ != is_now_in_proximity) {
PA_LOG(INFO) << "[Proximity] Updated proximity state: "
<< (is_now_in_proximity ? "proximate" : "distant");
remote_device_is_in_proximity_ = is_now_in_proximity;
observer_->OnProximityStateChanged();
}
}
} // namespace proximity_auth
|
[
"[email protected]"
] | |
f0a2be5e2d48408ede946840a7350ecb17229743
|
56e7d6b20f4d2f11912b6b22c7e96b9178c5a3d6
|
/sorted range/set_intersection,difference,symmetric_difference.cpp
|
64f7644e442127fa4e02d3728c4a4ba630ebb82f
|
[] |
no_license
|
MinuLoL/Algorithm
|
660697b1c7ee2b13596f69cb1cce9fa00a9df3a7
|
d6e22b130ad947599ae75f8456f17408cb2652eb
|
refs/heads/master
| 2022-11-18T15:40:14.804893 | 2020-07-21T04:42:55 | 2020-07-21T04:42:55 | 280,018,389 | 0 | 0 | null | null | null | null |
UHC
|
C++
| false | false | 1,030 |
cpp
|
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
vector<int>v1;
v1.push_back(10);
v1.push_back(20);
v1.push_back(30);
v1.push_back(40);
v1.push_back(50);
vector<int> v2;
v2.push_back(20);
v2.push_back(30);
v2.push_back(60);
vector<int> v3(10);
vector<int>::iterator iter_end;
iter_end=set_intersection(v1.begin(),v1.end(),v2.begin(),v2.end(),v3.begin());
cout<<"교집합[v3.begin(),iter_end): ";
for(vector<int>::iterator iter=v3.begin();iter!=iter_end;++iter)
cout<<*iter<<" ";
cout<<endl;
iter_end=set_difference(v1.begin(),v1.end(),v2.begin(),v2.end(),v3.begin());
cout<<"차집합[v3.begin(),iter_end): ";
for(vector<int>::iterator iter=v3.begin();iter!=iter_end;++iter)
cout<<*iter<<" ";
cout<<endl;
iter_end=set_symmetric_difference(v1.begin(),v1.end(),v2.begin(),v2.end(),v3.begin());
cout<<"대칭 차집합[v3.begin(),iter_end): ";
for(vector<int>::iterator iter=v3.begin();iter!=iter_end;++iter)
cout<<*iter<<" ";
cout<<endl;
return 0;
}
|
[
"[email protected]"
] | |
2a812d6dd1d45f956bfb59ec8fb6a726504e6cce
|
654bda06ac98563f63b74601ebcba179b52b2a5d
|
/func/mpi/mpi_put.cpp
|
19c589bd718b793cf11f4d21b05cdf2caa4b666b
|
[
"Apache-2.0"
] |
permissive
|
n-krueger/cpp
|
d6404e10b97970e223b061ba6031a848750b13a4
|
8090952fc39a6c2a67f9e444831241b936a9f25a
|
refs/heads/master
| 2023-04-29T19:37:44.620385 | 2021-04-21T06:51:33 | 2021-04-21T06:51:33 | 366,135,569 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,456 |
cpp
|
#include <faasm/compare.h>
#include <faasm/faasm.h>
#include <mpi.h>
#include <stdio.h>
#define NUM_ELEMENT 4
int main(int argc, char* argv[])
{
MPI_Init(NULL, NULL);
int rank;
int worldSize;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &worldSize);
size_t elemSize = sizeof(int);
int* sharedData;
MPI_Alloc_mem(elemSize * NUM_ELEMENT, MPI_INFO_NULL, &sharedData);
MPI_Win window;
MPI_Win_create(sharedData,
NUM_ELEMENT * elemSize,
1,
MPI_INFO_NULL,
MPI_COMM_WORLD,
&window);
MPI_Win_fence(0, window);
// Put values from rank 1 to rank 0
int putData[NUM_ELEMENT];
if (rank == 1) {
for (int i = 0; i < NUM_ELEMENT; i++) {
putData[i] = 10 + i;
}
MPI_Put(
putData, NUM_ELEMENT, MPI_INT, 0, 0, NUM_ELEMENT, MPI_INT, window);
}
MPI_Win_fence(0, window);
// Check expectation on rank 1
if (rank == 0) {
int expected[NUM_ELEMENT];
for (int i = 0; i < NUM_ELEMENT; i++) {
expected[i] = 10 + i;
}
bool asExpected =
faasm::compareArrays<int>(sharedData, expected, NUM_ELEMENT);
if (!asExpected) {
return 1;
}
printf("Rank %i - MPI_Put as expected\n", rank);
}
MPI_Win_free(&window);
MPI_Finalize();
return 0;
}
|
[
"[email protected]"
] | |
3cc5c759ab1938d72db52ce873f4d945d090612a
|
d0fb46aecc3b69983e7f6244331a81dff42d9595
|
/paifeaturestore/src/model/DeleteDatasourceResult.cc
|
2e607e9515094fcf9b7b51dac17e904d3f03ec53
|
[
"Apache-2.0"
] |
permissive
|
aliyun/aliyun-openapi-cpp-sdk
|
3d8d051d44ad00753a429817dd03957614c0c66a
|
e862bd03c844bcb7ccaa90571bceaa2802c7f135
|
refs/heads/master
| 2023-08-29T11:54:00.525102 | 2023-08-29T03:32:48 | 2023-08-29T03:32:48 | 115,379,460 | 104 | 82 |
NOASSERTION
| 2023-09-14T06:13:33 | 2017-12-26T02:53:27 |
C++
|
UTF-8
|
C++
| false | false | 1,255 |
cc
|
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/paifeaturestore/model/DeleteDatasourceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::PaiFeatureStore;
using namespace AlibabaCloud::PaiFeatureStore::Model;
DeleteDatasourceResult::DeleteDatasourceResult() :
ServiceResult()
{}
DeleteDatasourceResult::DeleteDatasourceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteDatasourceResult::~DeleteDatasourceResult()
{}
void DeleteDatasourceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}
|
[
"[email protected]"
] | |
71a322444ee9edd1af264b7e2a70f83af77b033b
|
538331b12d4cb20a469185f1db371db0f6244d4d
|
/project2/assn-2-six-degrees/imdb-utils.h
|
69e9cd7f0f0fd37fb30a181cf70cf552616c0f59
|
[] |
no_license
|
PBhandari99/Programming_paradigms
|
69764b0bfb0ebaaad9cff6b6fc467805548f225d
|
2ba55c9f9cc5a98b2d94020e786beaf22a427a4f
|
refs/heads/master
| 2021-03-19T13:33:58.663490 | 2018-10-16T23:30:23 | 2018-10-16T23:30:23 | 115,310,843 | 0 | 0 | null | 2018-10-16T23:30:24 | 2017-12-25T06:03:26 |
C
|
UTF-8
|
C++
| false | false | 2,360 |
h
|
#ifndef __imdb_utils__
#define __imdb_utils__
#include <string>
#include <strings.h>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
/**
* Convenience struct: film
* ------------------------
* Bundles the name of a film and the year it was made
* into a single struct. It is a true struct in that the
* client is free to access both fields and change them at will
* without issue. operator== and operator< are implemented
* so that films can be stored in STL containers requiring
* such methods.
*/
struct film {
string title;
int year;
/**
* Methods: operator==
* operator<
* -------------------
* Compares the two films for equality, where films are considered to be equal
* if and only if they share the same name and appeared in the same year.
* film is considered to be less than another film if its title is
* lexicographically less than the second title, or if their titles are the same
* but the first's year is precedes the second's.
*
* @param rhs the film to which the receiving film is being compared.
* @return boolean value which is true if and only if the required constraints
* between receiving object and argument are met.
*/
bool operator==(const film& rhs) const {
return this->title == rhs.title && (this->year == rhs.year);
}
bool operator<(const film& rhs) const {
return this->title < rhs.title ||
(this->title == rhs.title && this->year < rhs.year);
}
};
/**
* Quick, UNIX-dependent function to determine whether or not the
* the resident OS is Linux or Solaris. For our purposes, this
* tells us whether the machine is big-endian or little-endian, and
* the endiannees tells us which set of raw binary data files we should
* be using.
*
* @return one of two data paths.
*/
inline const char *determinePathToData(const char *userSelectedPath = NULL)
{
if (userSelectedPath != NULL) return userSelectedPath;
return "/home/pb/Desktop/workspace/Programming_paradigms/project2/assn-2-six-degrees-data/little-endian/";
// if (strcasecmp(ostype, "solaris") == 0)
// return "/home/pb/Desktop/workspace/Programming_paradigms/project2/assn-2-six-degrees-data/big-endian/";
// cerr << "Unsupported OS... bailing" << endl;
// exit(1);
// return NULL;
}
#endif
|
[
"[email protected]"
] | |
64a2a2f5f1adf65fc4c1afd174a4613d612b2c56
|
232743e092f954e62254a7f0ee40f19e49cff5ff
|
/lab2/task1/vector/vector.cpp
|
051a45823714d4212234ef3a4cec1c3a0855bfcf
|
[] |
no_license
|
crispero/oop
|
25e83d8a6b17a22521c2916964592c4321ced359
|
8345ebac488c2ae9c04381f38f15a47dad1bacd3
|
refs/heads/master
| 2020-04-22T12:06:31.242886 | 2019-06-14T19:22:26 | 2019-06-14T19:22:26 | 170,362,013 | 1 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 742 |
cpp
|
#include "pch.h"
#include "Vector.h"
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <string>
void ReadVector(numbers& vf)
{
while (!std::cin.eof())
{
float number;
if (std::cin >> number)
{
vf.push_back(number);
}
else
{
break;
}
}
}
void ProcessVector(numbers& vf)
{
std::vector<float>::iterator result = std::min_element(vf.begin(), vf.end());
float minElement = *result;
for (int i = 0; i < vf.size(); i++)
{
vf[i] *= minElement;
}
}
void PrintVector(numbers& vf)
{
for (int i = 0; i < vf.size(); i++)
{
std::cout << vf[i] << " ";
}
}
int main()
{
numbers vf;
ReadVector(vf);
sort(vf.begin(), vf.end());
ProcessVector(vf);
PrintVector(vf);
return 0;
}
|
[
"[email protected]"
] | |
f2acc75e49c36a5b2bfdc3bca440f20fbc4a2b59
|
e80c39cb4eed4c0f74e7cb73f57c9d56e365eadd
|
/fastBilateral.hpp
|
8b2f9badce39c4a163b58524edb7d0b497ee186a
|
[
"MIT"
] |
permissive
|
Fitzclutchington/spt_mask
|
24ec0604e6b2835ef96dc0b421e4925fd5f64343
|
ed8ed4c081405ebc7f5bf73b0903b4a7a925d555
|
refs/heads/master
| 2021-01-20T02:25:26.735930 | 2017-08-25T23:18:29 | 2017-08-25T23:18:29 | 101,321,209 | 1 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 7,521 |
hpp
|
/**
This sofrware and program is distributed under MIT License.
Original alogorithm : http://people.csail.mit.edu/sparis/bf/
Please cite above paper for research purpose.
The MIT License (MIT)
Copyright (c) 2015 Yuichi Takeda
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef __FAST_BILATERAL__
#define __FAST_BILATERAL__
#include <opencv2/opencv.hpp>
namespace cv_extend {
void bilateralFilter(cv::InputArray src, cv::OutputArray dst,
double sigmaColor, double sigmaSpace);
void bilateralFilterImpl(cv::Mat1d src, cv::Mat1d dst,
double sigmaColor, double sigmaSpace);
template<typename T, typename T_, typename T__>
inline
T clamp(const T_ min, const T__ max, const T x)
{
return
( x < static_cast<T>(min) ) ? static_cast<T>(min) :
( x < static_cast<T>(max) ) ? static_cast<T>(x) :
static_cast<T>(max);
}
template<typename T>
inline
T
trilinear_interpolation( const cv::Mat mat,
const double y,
const double x,
const double z)
{
const size_t height = mat.size[0];
const size_t width = mat.size[1];
const size_t depth = mat.size[2];
const size_t y_index = clamp(0, height-1, static_cast<size_t>(y));
const size_t yy_index = clamp(0, height-1, y_index+1);
const size_t x_index = clamp(0, width-1, static_cast<size_t>(x));
const size_t xx_index = clamp(0, width-1, x_index+1);
const size_t z_index = clamp(0, depth-1, static_cast<size_t>(z));
const size_t zz_index = clamp(0, depth-1, z_index+1);
const double y_alpha = y - y_index;
const double x_alpha = x - x_index;
const double z_alpha = z - z_index;
return
(1.0-y_alpha) * (1.0-x_alpha) * (1.0-z_alpha) * mat.at<T>(y_index, x_index, z_index) +
(1.0-y_alpha) * x_alpha * (1.0-z_alpha) * mat.at<T>(y_index, xx_index, z_index) +
y_alpha * (1.0-x_alpha) * (1.0-z_alpha) * mat.at<T>(yy_index, x_index, z_index) +
y_alpha * x_alpha * (1.0-z_alpha) * mat.at<T>(yy_index, xx_index, z_index) +
(1.0-y_alpha) * (1.0-x_alpha) * z_alpha * mat.at<T>(y_index, x_index, zz_index) +
(1.0-y_alpha) * x_alpha * z_alpha * mat.at<T>(y_index, xx_index, zz_index) +
y_alpha * (1.0-x_alpha) * z_alpha * mat.at<T>(yy_index, x_index, zz_index) +
y_alpha * x_alpha * z_alpha * mat.at<T>(yy_index, xx_index, zz_index);
}
/**
* Implementation
*/
void bilateralFilter(cv::InputArray _src, cv::OutputArray _dst,
double sigmaColor, double sigmaSpace)
{
cv::Mat src = _src.getMat();
CV_Assert(src.channels() == 1);
// bilateralFilterImpl runs with double depth, single channel
if ( src.depth() != CV_64FC1 ) {
src = cv::Mat(_src.size(), CV_64FC1);
_src.getMat().convertTo(src, CV_64FC1);
}
cv::Mat dst_tmp = cv::Mat(_src.size(), CV_64FC1);
bilateralFilterImpl(src, dst_tmp, sigmaColor, sigmaSpace);
_dst.create(dst_tmp.size(), _src.type());
dst_tmp.convertTo(_dst.getMat(), _src.type());
}
void bilateralFilterImpl(cv::Mat1d src, cv::Mat1d dst,
double sigma_color, double sigma_space)
{
using namespace cv;
const size_t height = src.rows, width = src.cols;
const size_t padding_xy = 2, padding_z = 2;
double src_min, src_max;
cv::minMaxLoc(src, &src_min, &src_max);
const size_t small_height = static_cast<size_t>((height-1)/sigma_space) + 1 + 2 * padding_xy;
const size_t small_width = static_cast<size_t>((width-1)/sigma_space) + 1 + 2 * padding_xy;
const size_t small_depth = static_cast<size_t>((src_max-src_min)/sigma_color) + 1 + 2 * padding_xy;
int data_size[] = {(int)small_height, (int)small_width, (int)small_depth};
cv::Mat data(3, data_size, CV_64FC2);
data.setTo(0);
// down sample
for ( int y = 0; y < (int)height; ++y ) {
for ( int x = 0; x < (int)width; ++x) {
const size_t small_x = static_cast<size_t>( x/sigma_space + 0.5) + padding_xy;
const size_t small_y = static_cast<size_t>( y/sigma_space + 0.5) + padding_xy;
const double z = src.at<double>(y,x) - src_min;
const size_t small_z = static_cast<size_t>( z/sigma_color + 0.5 ) + padding_z;
cv::Vec2d v = data.at<cv::Vec2d>(small_y, small_x, small_z);
v[0] += src.at<double>(y,x);
v[1] += 1.0;
data.at<cv::Vec2d>(small_y, small_x, small_z) = v;
}
}
// convolution
cv::Mat buffer(3, data_size, CV_64FC2);
buffer.setTo(0);
int offset[3];
offset[0] = &(data.at<cv::Vec2d>(1,0,0)) - &(data.at<cv::Vec2d>(0,0,0));
offset[1] = &(data.at<cv::Vec2d>(0,1,0)) - &(data.at<cv::Vec2d>(0,0,0));
offset[2] = &(data.at<cv::Vec2d>(0,0,1)) - &(data.at<cv::Vec2d>(0,0,0));
for ( int dim = 0; dim < 3; ++dim ) { // dim = 3 stands for x, y, and depth
const int off = offset[dim];
for ( int ittr = 0; ittr < 2; ++ittr ) {
cv::swap(data, buffer);
for ( int y = 1; y < (int)(small_height-1); ++y ) {
for ( int x = 1; x < (int)(small_width-1); ++x ) {
cv::Vec2d *d_ptr = &(data.at<cv::Vec2d>(y,x,1));
cv::Vec2d *b_ptr = &(buffer.at<cv::Vec2d>(y,x,1));
for ( int z = 1; z < (int)(small_depth-1); ++z, ++d_ptr, ++b_ptr ) {
cv::Vec2d b_prev = *(b_ptr-off), b_curr = *b_ptr, b_next = *(b_ptr+off);
*d_ptr = (b_prev + b_next + 2.0 * b_curr) / 4.0;
} // z
} // x
} // y
} // ittr
} // dim
// upsample
for ( cv::MatIterator_<cv::Vec2d> d = data.begin<cv::Vec2d>(); d != data.end<cv::Vec2d>(); ++d )
{
(*d)[0] /= (*d)[1] != 0 ? (*d)[1] : 1;
}
for ( int y = 0; y < (int)height; ++y ) {
for ( int x = 0; x < (int)width; ++x ) {
const double z = src.at<double>(y,x) - src_min;
const double px = static_cast<double>(x) / sigma_space + padding_xy;
const double py = static_cast<double>(y) / sigma_space + padding_xy;
const double pz = static_cast<double>(z) / sigma_color + padding_z;
dst.at<double>(y,x) = trilinear_interpolation<cv::Vec2d>(data, py, px, pz)[0];
}
}
}
} // end of namespace cv_extend
#endif
|
[
"[email protected]"
] | |
9a8c88fbbfd75f0ec419611918f50e30ab88ca0f
|
53d2e1ffa89b13c883bff1bedc994b0206a5676a
|
/Invoice.main.cpp
|
ac5139b8b8860e973d86173287733d2042c2f47d
|
[] |
no_license
|
dwiariprayogo/.Pemograman-Berorientasi-Obyek
|
9bea80ab7820e262c34a8a97b2b682b6438e6ff8
|
a12397b0fb6fc5a34dbcb83eab7fc171efb7d92c
|
refs/heads/main
| 2023-02-13T11:04:12.573241 | 2021-01-07T00:55:28 | 2021-01-07T00:55:28 | 302,342,859 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 3,148 |
cpp
|
#include<iostream>
#include <string>
using namespace std;
class Invoice
{
public:
Invoice( string, string, int, int );
void setPartNumber( string );
string getPartNumber();
void setPartDescription(string);
string getPartDescription();
void setItemQuantity(int);
int getItemQuantity();
void setItemPrice(int);
int getItemPrice();
int getInvoiceAmount();
private:
string partNumber;
string partDescription;
int itemQuantity;
int itemPrice;
};
Invoice::Invoice( string number, string description, int quantity, int price )
{
partNumber=number;
partDescription=description;
if(quantity>0)
itemQuantity=quantity;
else
{
itemQuantity=0;
cout<<"Initial quantity was invalid."<<endl;
}
if(price>0)
itemPrice=price;
else
{
itemPrice=0;
cout<<"Initial price was invalid."<<endl;
}
}
void Invoice::setPartNumber( string number)
{
if ( number.length() <= 25 )
partNumber = number;
if ( number.length() > 25 )
{
partNumber = number.substr( 0, 25 );
cout << "Name \"" << number << endl;
}
}
void Invoice::setPartDescription(string description )
{
if ( description.length() <= 25 )
partDescription = description;
if ( description.length() > 25 )
{
partDescription = description.substr( 0, 25 );
cout << "Name \"" << description << endl;
}
}
void Invoice::setItemQuantity(int quantity )
{
if(quantity>0)
itemQuantity=quantity;
else
{
itemQuantity=0;
cout<<"Initial quantity was invalid."<<endl;
}
}
void Invoice::setItemPrice(int price )
{
if(price>0)
itemPrice=price;
else
{
itemPrice=0;
cout<<"Initial price was invalid."<<endl;
}
}
string Invoice::getPartNumber() {
return partNumber;
}
string Invoice::getPartDescription() {
return partDescription;
}
int Invoice::getItemQuantity() {
return itemQuantity;
}
int Invoice::getItemPrice() {
return itemPrice;
}
int Invoice::getInvoiceAmount() {
return itemQuantity*itemPrice;
}
int main() {
cout << " Nama : Dwi Ari Prayogo" <<endl;
cout << " NIM : 19051397072" <<endl;
cout << " Prodi : D4 RPL 2019" <<endl<<endl;
cout << " " <<endl;
cout << " HARGA BARANG " <<endl;
cout <<"" <<endl<<endl;
Invoice Invoice1("19023","Sabun Muka",7,0000);
cout << " Code Invoice 1 : "<< Invoice1.getPartNumber() <<endl;
cout << " Deskripsi : "<< Invoice1.getPartDescription() <<endl;
cout << " Total Item : "<< Invoice1.getItemQuantity() <<endl;
cout << " HARGA per Item : Rp. "<< Invoice1.getItemPrice()<<",-" <<endl;
cout << " HARGA TOTAL INVOICE 1 adalah Rp. "<<Invoice1.getInvoiceAmount()<<",-" <<endl<<endl;
Invoice Invoice2("129873","Buku Tulis",50,000);
cout << " Code Invoice 2 : "<< Invoice2.getPartNumber() <<endl;
cout << " Deskripsi : "<< Invoice2.getPartDescription() <<endl;
cout << " Total Item : "<< Invoice2.getItemQuantity() <<endl;
cout << " HARGA per Item : Rp. "<< Invoice2.getItemPrice()<<",-" <<endl;
cout << " HARGA TOTAL INVOICE 1 adalah Rp. "<< Invoice1.getInvoiceAmount()<<",-" <<endl<<endl;
}
|
[
"[email protected]"
] | |
25d38d835aaf941bf76c442cfd09df81daaf5217
|
90d1cd28f85a2df99e0720a60a4f706d3dba266e
|
/t.cpp
|
15aa35e6a42e680ac233f0f3249a3b50166dddae
|
[] |
no_license
|
bblarney/iotproject
|
b802a5213e56cca7e650563f162557d420cc26c1
|
8f42530b8bb3ae950df0283ec35ce82785f88486
|
refs/heads/master
| 2021-07-08T10:16:06.411833 | 2017-10-06T00:15:18 | 2017-10-06T00:15:18 | 104,124,610 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 2,884 |
cpp
|
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "util.h"
#include "t.h"
using namespace std;
Task::Task() {
}
Task::Task(vector<string> &line) {
/*for (auto & field : line) {
cout << "%" << field << "%";
}
cout << "\n";*/
switch (line.size()) {
case 4:
if (validTaskName(line[3]))
taskFail = line[3];
else
throw string("Expected fail task name, found: ") + line[3];
case 3:
if (validTaskName(line[2]))
taskPass = line[2];
else
throw string("Expected pass task name, found: ") + line[2];
case 2:
if (validSlots(line[1]))
taskSlots = line[1];
else
throw string("Expected slots field, found: ") + line[1];
case 1:
if (validTaskName(line[0]))
taskName = line[0];
else
throw string("Expected task name, found: ") + line[0];
default:
throw string("Expected 1, 2, 3, or 4 fields, found ") + to_string(line.size());
break;
}
}
void Task::print() {
cout << "name = " << taskName << ", ";
cout << "slots = " << taskSlots << ", ";
cout << "pass = " << taskPass << ", ";
cout << "fail = " << taskFail;
cout << "\n";
}
void Task::graph(fstream& gv) {
if (!taskPass.empty()) {
gv << '"' << taskName << '"';
gv << "->";
gv << '"' << taskPass << '"';
gv << "[color=green];\n";
}
if (!taskFail.empty()) {
gv << '"' << taskName << '"';
gv << "->";
gv << '"' << taskFail << '"';
gv << "[color=red];\n";
}
if (taskPass.empty() && taskFail.empty()) {
gv << '"' << taskName << '"';
gv << ";\n";
}
}
TaskManager::TaskManager() {
}
TaskManager::TaskManager(vector<vector<string>> & csvDataTask) {
for (auto & line : csvDataTask) {
try {
taskList.push_back(Task(line));
}
catch (string& e) {
cerr << e << "\n";
}
}
}
void TaskManager::print() {
for (auto& t : taskList) {
t.print();
}
}
void TaskManager::graph(string& f) {
fstream gv(f + ".gv", ios::out | ios::trunc);
if (gv.is_open()) {
gv << "digraph taskgraph {\n";
for (auto& t : taskList) {
t.graph(gv);
}
gv << "}\n";
gv.close();
/*auto running the graph command
string cmd = "dot";
cmd += " -Tpng " + f + ".gv" + " > " + f + ".gv.png";
cout << cmd << "\n";
system(cmd.c_str());*/
}
}
bool TaskManager::validate() {
int errors = 0;
for (auto& task : taskList) {
string pass = task.pass();
if (!pass.empty() && find(pass) == nullptr) {
errors++;
cerr << "Cannot find pass task " << pass << "\n";
}
string fail = task.fail();
if (!fail.empty() && find(fail) == nullptr) {
errors++;
cerr << "Cannot find pass task " << fail << "\n";
}
}
return errors == 0;
}
Task* TaskManager::find(string& t) {
for (size_t i = 0; i < taskList.size(); i++) {
if (taskList[i].name() == t)
return &taskList[i];
return nullptr;
}
}
|
[
"[email protected]"
] | |
acc087acf2941fe7bd8eabdcc65679da29b9cc9b
|
a6e0dac05610177331c0413112ea92d0b1d5866b
|
/ProjectFR/FRClient/CharacterParameter.cpp
|
757cafc56c40fb3c52525f9a7123f9ef17b3c399
|
[] |
no_license
|
wwr1977/SJ-Studio
|
11c64f4bed95d53eefc2fe2198c17a419dcb0cf4
|
9da71a796fa6636f260b77694b51be828ce1a891
|
refs/heads/master
| 2020-05-18T03:46:24.014589 | 2019-04-29T22:35:19 | 2019-04-29T22:35:19 | 184,147,071 | 0 | 0 | null | null | null | null |
WINDOWS-1252
|
C++
| false | false | 3,032 |
cpp
|
#include "Precom.h"
#include "CharacterParameter.h"
CCharacterParameter::CCharacterParameter()
:m_fRadius(30.0f)
{
m_vecParameterBack.clear();
for (size_t i = 0; i < MAXPARAMETER; i++)
m_fCurParameter[i] = 3.0f;
}
CCharacterParameter::~CCharacterParameter()
{
m_vecParameterBack.clear();
}
void CCharacterParameter::Init()
{
for (size_t i = 0; i < 5; ++i)
{
m_vecParameterBack.push_back(ACTOR->CreateCom<CFixRenderer>(RENDATA(LAYER_UIBACK, 0.74f - 0.06f*i, true)));
m_vecParameterBack[i]->SetSprite(_T("ParameterBack"));
m_vecParameterBack[i]->SetCustomSize({ 300.f - 60.f*i,300.0f - 60.f*i });
}
m_vecPoint.push_back(Vec2{ 1.0f,0.0f });
m_vecPoint.push_back(Vec2{ ROOTTWO * 0.5f,ROOTTWO *0.5f });
m_vecPoint.push_back(Vec2{ 0.0f,1.0f });
m_vecPoint.push_back(Vec2{ ROOTTWO * -0.5f,ROOTTWO *0.5f });
m_vecPoint.push_back(Vec2{ -1.0f,0.0f });
m_vecPoint.push_back(Vec2{ ROOTTWO * -0.5f,ROOTTWO *-0.5f });
m_vecPoint.push_back(Vec2{ 0.0f,-1.0f });
m_vecPoint.push_back(Vec2{ ROOTTWO * 0.5f,ROOTTWO *-0.5f });
m_vecParameterName.push_back(_T("HP"));
m_vecParameterName.push_back(_T("MP"));
m_vecParameterName.push_back(_T("Str"));
m_vecParameterName.push_back(_T("Dex"));
m_vecParameterName.push_back(_T("Int"));
m_vecParameterName.push_back(_T("Luk"));
m_vecParameterName.push_back(_T("Demage"));
m_vecParameterName.push_back(_T("Def"));
}
void CCharacterParameter::Update()
{
}
void CCharacterParameter::UIFontRender()
{
float R = 165.0f;
Vec3 MiddlePoint = TRANS->GetPos();
Vec2 MidPos = Vec2{ MiddlePoint.x,MiddlePoint.y };
for (size_t i = 0; i < m_vecPoint.size(); i++)
{
Vec3 FontDrawPos = MiddlePoint + Vec3{ 10.0f,-5.0f,0.0f } +Vec3{ R*m_vecPoint[i].x,R*m_vecPoint[i].y,90.0f };
COMRESMGR->DrawFont(_T("±¼¸²"), m_vecParameterName[i], FontDrawPos, 1.5f, D3DXCOLOR(1.0f, 1.0f, 0.0f, 1.0f));
}
for (int i = 0; i < MAXPARAMETER; i++)
{
int TriIndex1, TriIndex2;
TriIndex1 = (i + 1) % MAXPARAMETER;
TriIndex2 = i % MAXPARAMETER;
Vec2 TriPos1 = MidPos +(m_fRadius * m_fCurParameter[TriIndex1] * m_vecPoint[TriIndex1]);
Vec2 TriPos2 = MidPos + (m_fRadius * m_fCurParameter[TriIndex2] * m_vecPoint[TriIndex2]);
COMRESMGR->DrawTriangle(MidPos, TriPos1, TriPos2, D3DXCOLOR(0.2f, 0.2f, 1.0f, 0.7f));
}
}
void CCharacterParameter::SetChangeParameter(const CharacterIndex& _Index)
{
if (_Index >= MAXBATTLECHARACTER)
return;
tstring CharName = CClientGlobal::CharacterName[_Index].UnitName;
STATPARAMETERDATA Para = CClientGlobal::CharacterParameter[CharName];
m_fCurParameter[0] = Para.HpPara;
m_fCurParameter[1] = Para.MpPara;
m_fCurParameter[2] = Para.StrPara;
m_fCurParameter[3] = Para.DexPara;
m_fCurParameter[4] = Para.IntPara;
m_fCurParameter[5] = Para.LuckPara;
m_fCurParameter[6] = Para.DamagePara;
m_fCurParameter[7] = Para.DefPara;
}
void CCharacterParameter::SetPos(const Vec3& _Pos)
{
TRANS->SetPos(_Pos);
}
void CCharacterParameter::ParameterOn()
{
ACTOR->On();
}
void CCharacterParameter::ParameterOff()
{
ACTOR->Off();
}
|
[
"[email protected]"
] | |
bd6190c5bd7dac2e1416f5899c4daa1c11f6d1fc
|
8a42ec79fc702af19ff366b5c53c58ce92c9a5ce
|
/CompareTheTriplet.cpp
|
164f80a3127c50e23544a301e31091ba440fe26b
|
[] |
no_license
|
Nikitapande/Hackerrank_Algorithm
|
034d4b5709ae505448180f699d6a6bb087a9fbcb
|
8e1e4945611d67dab77aac04445dade027bbd22b
|
refs/heads/master
| 2021-07-09T18:18:09.830997 | 2019-09-23T17:08:50 | 2019-09-23T17:08:50 | 193,709,386 | 1 | 1 | null | 2021-10-06T07:01:16 | 2019-06-25T13:06:13 |
C++
|
UTF-8
|
C++
| false | false | 988 |
cpp
|
/*
Alice and Bob each created one problem for HackerRank Compare the Triplets.
A reviewer rates the two challenges, awarding points on a scale from 1 to 100 for three categories:
problem clarity, originality, and difficulty.
We define the rating for Alice’s challenge to be the triplet A=(a0,a1,a2), and the rating for Bob’s challenge
to be the triplet B=(b0,b1,b2).
*/
#include<iostream>
using namespace std;
int main()
{
int aliceResult = 0;
int bobResult = 0;
int alicePoints[3],bobPoints[3];
for(int i = 0;i<3;i++){
cin>>alicePoints[i];
}
for(int i = 0;i<3;i++){
cin>>bobPoints[i];
}
for(int i = 0;i<3;i++){
if(alicePoints[i]>bobPoints[i]){
aliceResult++;
}else if(alicePoints[i]<bobPoints[i]){
bobResult++;
}
}
cout<<aliceResult<<" "<<bobResult;
return 0;
}
|
[
"[email protected]"
] | |
5ebc103d4c1f55cb47d937034a3078345fcacd9e
|
7cddd418f09223d71dd5758559f133921ad878ac
|
/2018/test0420/test01.h
|
4eebd44acffd4f44cf58490a0176ac1d1d01414e
|
[] |
no_license
|
lijuni/allCPPTest
|
599b946eae46da919f1e4a5aba2b5ea1c1425688
|
9c3b23e61d12bc911cb1f9c3eb0a5cccabec6967
|
refs/heads/master
| 2020-03-19T09:19:42.551206 | 2018-06-06T05:42:01 | 2018-06-06T05:42:01 | 136,278,615 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,224 |
h
|
//P405 shared_ptr
#ifndef TEST01_H
#define TEST01_H
#include<iostream>
#include<string>
#include<vector>
#include<memory>
#include<list>
#include<initializer_list>
using namespace std;
class StrBlob{
public:
typedef vector<string>::size_type size_type;
StrBlob();
StrBlob( initializer_list<string> li);
size_type size() const { return data->size(); }
bool empty() const { return data->empty(); }
void push_back( const string &s ) { data->push_back(s); }
void pop_back();
string &front();
string &back();
private:
std::shared_ptr<vector<string>> data;
void check( size_type i, const string &msg ) const;
};
StrBlob::StrBlob()
{
data = make_shared<vector<string>>() ;
}
//StrBlob::StrBlob() : data( make_shared<vector<string>>() ) {}
StrBlob::StrBlob(initializer_list<string> li) : data( make_shared<vector<string>>(li) ) {}
void StrBlob::pop_back()
{
check(0, "pop_back");
data->pop_back();
}
string &StrBlob::front()
{
check(0, "front");
return data->front();
}
string &StrBlob::back()
{
check(0, "back");
return data->back();
}
void StrBlob::check( size_type i, const string &s) const
{
if( data->size() <= i)
throw out_of_range(s);
}
#endif
|
[
"[email protected]"
] | |
1d4dae0602153eb3c98efca1e753b2754e953ae2
|
77ad94490985e37f992f84c9cf5742280ab45f4f
|
/Common/DataModel/vtkBezierQuadrilateral.cxx
|
c35a93f77ea5cd2a5b772789bace3b1d2c377f73
|
[
"BSD-3-Clause"
] |
permissive
|
martijnkoopman/VTK
|
e78bf7f56d532776e9e28d8dfed59a1c46c6f027
|
7fb393e4512ad0f152fac489c78cd9f6dd713ba2
|
refs/heads/master
| 2023-03-08T12:32:10.386828 | 2021-02-24T19:38:54 | 2021-02-24T19:38:59 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 6,922 |
cxx
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkBezierQuadrilateral.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkBezierQuadrilateral.h"
#include "vtkBezierCurve.h"
#include "vtkBezierInterpolation.h"
#include "vtkCellData.h"
#include "vtkDataSet.h"
#include "vtkDoubleArray.h"
#include "vtkIdList.h"
#include "vtkMath.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkPoints.h"
#include "vtkQuad.h"
#include "vtkTriangle.h"
#include "vtkVector.h"
#include "vtkVectorOperators.h"
vtkStandardNewMacro(vtkBezierQuadrilateral);
vtkBezierQuadrilateral::vtkBezierQuadrilateral()
: vtkHigherOrderQuadrilateral()
{
}
vtkBezierQuadrilateral::~vtkBezierQuadrilateral() = default;
void vtkBezierQuadrilateral::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
vtkCell* vtkBezierQuadrilateral::GetEdge(int edgeId)
{
vtkBezierCurve* result = EdgeCell;
if (this->GetRationalWeights()->GetNumberOfTuples() > 0)
{
const auto set_number_of_ids_and_points = [&](const vtkIdType& npts) -> void {
result->Points->SetNumberOfPoints(npts);
result->PointIds->SetNumberOfIds(npts);
result->GetRationalWeights()->SetNumberOfTuples(npts);
};
const auto set_ids_and_points = [&](
const vtkIdType& edge_id, const vtkIdType& face_id) -> void {
result->Points->SetPoint(edge_id, this->Points->GetPoint(face_id));
result->PointIds->SetId(edge_id, this->PointIds->GetId(face_id));
result->GetRationalWeights()->SetValue(
edge_id, this->GetRationalWeights()->GetValue(face_id));
};
this->SetEdgeIdsAndPoints(edgeId, set_number_of_ids_and_points, set_ids_and_points);
}
else
{
const auto set_number_of_ids_and_points = [&](const vtkIdType& npts) -> void {
result->Points->SetNumberOfPoints(npts);
result->PointIds->SetNumberOfIds(npts);
result->GetRationalWeights()->Reset();
};
const auto set_ids_and_points = [&](
const vtkIdType& edge_id, const vtkIdType& face_id) -> void {
result->Points->SetPoint(edge_id, this->Points->GetPoint(face_id));
result->PointIds->SetId(edge_id, this->PointIds->GetId(face_id));
};
this->SetEdgeIdsAndPoints(edgeId, set_number_of_ids_and_points, set_ids_and_points);
}
return result;
}
/**\brief EvaluateLocation Given a point_id. This is required by Bezier because the interior points
* are non-interpolatory .
*/
void vtkBezierQuadrilateral::EvaluateLocationProjectedNode(
int& subId, const vtkIdType point_id, double x[3], double* weights)
{
this->vtkHigherOrderQuadrilateral::SetParametricCoords();
double pcoords[3];
this->PointParametricCoordinates->GetPoint(this->PointIds->FindIdLocation(point_id), pcoords);
this->vtkHigherOrderQuadrilateral::EvaluateLocation(subId, pcoords, x, weights);
}
/**\brief Populate the linear quadrilateral returned by GetApprox() with point-data from one
* voxel-like interval of this cell.
*
* Ensure that you have called GetOrder() before calling this method
* so that this->Order is up to date. This method does no checking
* before using it to map connectivity-array offsets.
*/
vtkQuad* vtkBezierQuadrilateral::GetApproximateQuad(
int subId, vtkDataArray* scalarsIn, vtkDataArray* scalarsOut)
{
vtkQuad* approx = this->GetApprox();
bool doScalars = (scalarsIn && scalarsOut);
if (doScalars)
{
scalarsOut->SetNumberOfTuples(4);
}
int i, j, k;
if (!this->SubCellCoordinatesFromId(i, j, k, subId))
{
vtkErrorMacro("Invalid subId " << subId);
return nullptr;
}
// Get the point ids (and optionally scalars) for each of the 4 corners
// in the approximating quadrilateral spanned by (i, i+1) x (j, j+1):
for (vtkIdType ic = 0; ic < 4; ++ic)
{
const vtkIdType corner =
this->PointIndexFromIJK(i + ((((ic + 1) / 2) % 2) ? 1 : 0), j + (((ic / 2) % 2) ? 1 : 0), 0);
vtkVector3d cp;
// Only the first four corners are interpolatory, we need to project the value of the other
// nodes
if (corner < 4)
{
this->Points->GetPoint(corner, cp.GetData());
}
else
{
this->SetParametricCoords();
double pcoords[3];
this->PointParametricCoordinates->GetPoint(corner, pcoords);
int subIdtps;
std::vector<double> weights(this->Points->GetNumberOfPoints());
this->vtkHigherOrderQuadrilateral::EvaluateLocation(
subIdtps, pcoords, cp.GetData(), weights.data());
}
approx->Points->SetPoint(ic, cp.GetData());
approx->PointIds->SetId(ic, doScalars ? corner : this->PointIds->GetId(corner));
if (doScalars)
{
scalarsOut->SetTuple(ic, scalarsIn->GetTuple(corner));
}
}
return approx;
}
void vtkBezierQuadrilateral::InterpolateFunctions(const double pcoords[3], double* weights)
{
vtkBezierInterpolation::Tensor2ShapeFunctions(this->GetOrder(), pcoords, weights);
// If the unit cell has rational weigths: weights_i = weights_i * rationalWeights / sum( weights_i
// * rationalWeights )
const bool has_rational_weights = RationalWeights->GetNumberOfTuples() > 0;
if (has_rational_weights)
{
vtkIdType nPoints = this->GetPoints()->GetNumberOfPoints();
double w = 0;
for (vtkIdType idx = 0; idx < nPoints; ++idx)
{
weights[idx] *= RationalWeights->GetTuple1(idx);
w += weights[idx];
}
const double one_over_rational_weight = 1. / w;
for (vtkIdType idx = 0; idx < nPoints; ++idx)
weights[idx] *= one_over_rational_weight;
}
}
void vtkBezierQuadrilateral::InterpolateDerivs(const double pcoords[3], double* derivs)
{
vtkBezierInterpolation::Tensor2ShapeDerivatives(this->GetOrder(), pcoords, derivs);
}
/**\brief Set the rational weight of the cell, given a vtkDataSet
*/
void vtkBezierQuadrilateral::SetRationalWeightsFromPointData(
vtkPointData* point_data, const vtkIdType numPts)
{
vtkDataArray* v = point_data->GetRationalWeights();
if (v)
{
this->GetRationalWeights()->SetNumberOfTuples(numPts);
for (vtkIdType i = 0; i < numPts; i++)
{
this->GetRationalWeights()->SetValue(i, v->GetTuple1(this->PointIds->GetId(i)));
}
}
else
this->GetRationalWeights()->Reset();
}
vtkDoubleArray* vtkBezierQuadrilateral::GetRationalWeights()
{
return RationalWeights.Get();
}
vtkHigherOrderCurve* vtkBezierQuadrilateral::GetEdgeCell()
{
return EdgeCell;
}
|
[
"[email protected]"
] | |
8e514e02d7b87343a1f9bacc817585e71c276f55
|
0764c823e1b594fc3ec5db2c28436bab6e345f4d
|
/Baekjoon/unranked/기초/수학1/1011.cpp
|
3f7064b2823dcdfa58985a92e9e59df7ac625a79
|
[] |
no_license
|
BTOCC24/Algorithm
|
ecf5b94bf31aa69549be4aa73ff1d4874243e696
|
24a6c3c6d8cf62d14b60dbc12c7d5fa4c4d80f31
|
refs/heads/master
| 2023-04-10T22:02:41.435820 | 2021-04-15T15:09:30 | 2021-04-15T15:09:30 | 231,168,262 | 1 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 589 |
cpp
|
//20/1/2 11:34 1011
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int T, x, y;
cin >> T;
for (int i = 0; i < T; i++) {
cin >> x >> y;
x = y - x;
if (abs(pow((int)sqrt(x), 2) - x) == 0)
cout << 2 * (int)sqrt(x) - 1 << endl;
else if (x - abs(pow((int)sqrt(x), 2)) > abs(pow((int)sqrt(x) + 1, 2) - x))
cout << 2 * (int)sqrt(x) + 1 << endl;
else
cout << 2 * (int)sqrt(x) << endl;
}
}
/*
1
11
111
121
1121 1
1221
11221
12221
12321
122221
123221
123321
1223221
1233221
1233321
1234321
1 1
121 4
12321 9
1234321 16
123454321 25
n^2
*/
|
[
"[email protected]"
] | |
76018012355d77303a0712275cc1420b15ab398b
|
b588cb851a14eb6d594c21e8e88469af0247a199
|
/engine/WHAbstractScene.h
|
1947b51deb97dd90ad922f922c2065784af8371a
|
[] |
no_license
|
Egor2001/whirl
|
cd94a155870998923cb8fa58edefb5f64d49c5f1
|
e4bc65f6e62838b296f7caab242a19140170a1cc
|
refs/heads/master
| 2021-01-23T01:18:50.400397 | 2017-09-06T04:46:46 | 2017-09-06T04:46:46 | 85,899,839 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 13,099 |
h
|
#pragma once
#include <memory>
#include "memory/WHEvent.h"
#include "memory/WHMemoryManager.h"
#include "render/WHRay.h"
#include "render/WHCamera.h"
#include "render/WHGraphicObject.h"
#include "render/WHLight.h"
#include "render/math/WHVector.h"
namespace whirl {
template<class... ObjectTypes> struct WHObjectBuffer;
template<class... ObjectTypes> class WHVolume;
class WHLightStrategy;
template<class VolumeType, class LightStrategyType> class WHScene;
template<class... ObjectTypes>
__device__ void wh_device_get_light_properties(const typename WHObjectBuffer<ObjectTypes...>::NearestObjectData* nearest_object_data_ptr,
const WHVector3& position, WHNormal3* normal_ptr_ret, WHMaterial* material_ptr_ret, float min_distance/* = FLT_MAX*/);
template<class... ObjectTypes>
__device__ float wh_device_distance_function(const WHObjectBuffer<ObjectTypes...>* object_buffer_ptr, const WHVector3& position,
typename WHObjectBuffer<ObjectTypes...>::NearestObjectData* nearest_object_data_ptr_ret);
template<class... ObjectTypes>
__device__ float wh_device_step(const WHVolume<ObjectTypes...>::SGpuData* volume_ptr, WHRay* ray_ptr, WHNormal3* normal_ptr_ret, WHMaterial* material_ptr_ret);
__device__ WHColor wh_device_get_color(const WHLightStrategy::SGpuData* light_strategy_ptr, const WHMaterial& material,
const WHNormal3& normal, const WHRay& ray);
template<class VolumeType, class LightStrategyType>
__device__ WHColor wh_device_trace_ray(const VolumeType::SGpuData* volume_ptr, const LightStrategyType::SGpuData* light_strategy_ptr, WHRay* ray_ptr);
template<class... ObjectTypes>
struct WHObjectBuffer: public WHObjectBuffer<ObjectTypes>...
{
struct NearestObjectData : public WHObjectBuffer<ObjectTypes>::NearestObjectData...
{
float min_distance;
};
template<class ExtractObjectType>
__host__ __device__ size_t get_buffer_size() const { return WHObjectBuffer<ExtractObjectType>::buffer_size; }
template<class ExtractObjectType> __host__ __device__ ExtractObjectType* get_buffer() { return WHObjectBuffer<ExtractObjectType>::buffer; }
template<class ExtractObjectType> __host__ __device__ const ExtractObjectType* get_buffer() const { return WHObjectBuffer<ExtractObjectType>::buffer; }
};
template<class ObjectType>
struct WHObjectBuffer<ObjectType>
{
struct NearestObjectData
{
ObjectType* object_ptr;
float distance;
};
template<class ExtractObjectType>//ExtractObjectType must be same to ObjectType
__host__ __device__ size_t get_buffer_size() const { return WHObjectBuffer<ExtractObjectType>::buffer_size; }
template<class ExtractObjectType> __host__ __device__ ExtractObjectType* get_buffer() { return WHObjectBuffer<ExtractObjectType>::buffer; }
template<class ExtractObjectType> __host__ __device__ const ExtractObjectType* get_buffer() const { return WHObjectBuffer<ExtractObjectType>::buffer; }
size_t buffer_size;
ObjectType* buffer;
};
template<class... ObjectTypes>
__device__ void wh_device_get_light_properties(const typename WHObjectBuffer<ObjectTypes...>::NearestObjectData* nearest_object_data_ptr,
const WHVector3& position, WHNormal3* normal_ptr_ret, WHMaterial* material_ptr_ret, float min_distance = FLT_MAX)
{
float min_distance = nearest_object_data_ptr->min_distance;
wh_device_get_light_properties<ObjectTypes>(dynamic_cast<const typename WHObjectBuffer<ObjectTypes>::NearestObjectData*>(nearest_object_data_ptr),
position, normal_ptr_ret, material_ptr_ret, min_distance)...;
}
template<class ObjectType>
__device__ void wh_device_get_light_properties<ObjectType>(typename const WHObjectBuffer<ObjectType>::NearestObjectData* nearest_object_data_ptr,
const WHVector3& position, WHNormal3* normal_ptr_ret, WHMaterial* material_ptr_ret, float min_distance = FLT_MAX)
{
if (nearest_object_data_ptr->distance > min_distance)
return;
*normal_ptr_ret = nearest_object_data_ptr->object_ptr->get_normal(position);
*material_ptr_ret = nearest_object_data_ptr->object_ptr->get_material();
}
template<class... ObjectTypes>
class WHVolume
{
public:
struct SGpuData
{
WHObjectBuffer<ObjectTypes...> object_buffer_;
WHVector3 bounds_;
size_t max_iter_;
};
public:
WHVolume() = default;
WHVolume(size_t object_buffer_sizes_set[sizeof...(ObjectTypes)], WHVector3 bounds_set, size_t max_iter_set = 64u):
memory_manager_(std::dynamic_pointer_cast<WHAbstractMemoryManager>(WHMemoryManager<WHAllocType::PINNED>::instance())),
gpu_data_ptr_ {static_cast<SGpuData*>(memory_manager_->allocate(sizeof(SGpuData), cudaHostAllocMapped))}
{
size_t index = 0u;
gpu_data_ptr_->object_buffer_.WHObjectBuffer<ObjectTypes>>::buffer_size = object_buffer_sizes_set[index++]...;
gpu_data_ptr_->object_buffer_.WHObjectBuffer<ObjectTypes>>::buffer = static_cast<ObjectTypes*>
(memory_manager_->allocate(gpu_data_ptr_->object_buffer_.WHObjectBuffer<ObjectTypes>>::buffer_size * sizeof(ObjectTypes),
cudaHostAllocMapped))...;
gpu_data_ptr_->bounds_ = bounds_set;
gpu_data_ptr_->max_iter_ = max_iter_set;
}
virtual ~WHVolume()
{
if (gpu_data_ptr)
{
memory_manager_->deallocate(gpu_data_ptr_->object_buffer_.WHObjectBuffer<ObjectTypes>::buffer)...;
*gpu_data_ptr_ = {};
memory_manager_->deallocate(gpu_data_ptr_);
}
gpu_data_ptr = nullptr;
}
std::shared_ptr<WHAbstractMemoryManager> get_memory_manager() const { return memory_manager_; }
const SGpuData* get_gpu_data_ptr() const { return get_gpu_data_ptr_; }
SGpuData* get_gpu_data_ptr() { return get_gpu_data_ptr_; }
private:
std::shared_ptr<WHAbstractMemoryManager> memory_manager_;
SGpuData* gpu_data_ptr_;
};
template<class... ObjectTypes>
__device__ float wh_device_distance_function(const WHObjectBuffer<ObjectTypes...>* object_buffer_ptr, const WHVector3& position,
typename WHObjectBuffer<ObjectTypes...>::NearestObjectData* nearest_object_data_ptr_ret)
{
float result = FLT_MAX;
float dist_array[sizeof...(ObjectTypes)] =
{ wh_device_distance_function<ObjectTypes>(dynamic_cast<const WHObjectBuffer<ObjectTypes>*>(object_buffer_ptr), position,
dynamic_cast<typename WHObjectBuffer<ObjectTypes>::NearestObjectData*>(nearest_object_data_ptr_ret))... };
for (size_t i = 0u; i < sizeof...(ObjectTypes); i++)
{
if (result > dist_array[i])
result = dist_array[i];
}
nearest_object_data_ptr_ret->min_distance = result;
return result;
}
template<class ObjectType>
__device__ float wh_device_distance_function<ObjectType>(const WHObjectBuffer<ObjectType>* object_buffer_ptr, const WHVector3& position,
typename WHObjectBuffer<ObjectType>::NearestObjectData* nearest_object_data_ptr_ret)
{
float result = FLT_MAX, cur_dist = FLT_MAX;
for (size_t i = 0u; i < object_buffer_ptr->object_buffer_size_; i++)
{
cur_dist = object_buffer_ptr->object_buffer_[i].device_distance_function(position);
if (cur_dist < result)
{
result = cur_dist;
nearest_object_data_ptr_ret->object_ptr = &(object_buffer_ptr->object_buffer_[i]);
}
}
nearest_object_data_ptr_ret->distance = result;
return result;
}
template<class... ObjectTypes>
__device__ float wh_device_step(const WHVolume<ObjectTypes...>::SGpuData* volume_ptr, WHRay* ray_ptr, WHNormal3* normal_ptr_ret, WHMaterial* material_ptr_ret)
{
typename WHObjectBuffer<ObjectTypes...>::NearestObjectData nearest_object_data;
float result = 0.0f, incr = fabs(wh_device_distance_function(volume_ptr->object_buffer_, ray_ptr->position, &nearest_object_data));
for (size_t i = 0u; incr > result*FLT_EPSILON && i < volume_ptr->max_iter_; i++)
{
result += incr;
ray_ptr->step(incr);
incr = wh_device_distance_function(volume_ptr->object_buffer_, ray_ptr->position, &nearest_object_data);
if (!is_inside(ray_ptr->position, volume_ptr->bounds_)) return 0.0f;
}
wh_device_get_light_properties(&nearest_object_data, ray_ptr->position, normal_ptr_ret, material_ptr_ret);
return result;
}
class WHLightStrategy
{
public:
struct SGpuData
{
size_t lighters_buffer_size_;
WHLight* lighters_buffer_;
};
public:
WHLightStrategy() = default;
WHLightStrategy(size_t lighters_buffer_size_set):
memory_manager_(std::dynamic_pointer_cast<WHAbstractMemoryManager>(WHMemoryManager<WHAllocType::PINNED>::instance())),
gpu_data_ptr_ {static_cast<SGpuData*>(memory_manager_->allocate(sizeof(SGpuData), cudaHostAllocMapped))}
{
gpu_data_ptr_->lighters_buffer_size_ = lighters_buffer_size_set;
gpu_data_ptr_->lighters_buffer_ = static_cast<WHLight*>(memory_manager_->allocate(gpu_data_ptr_->lighters_buffer_size_ * sizeof(WHLight),
cudaHostAllocMapped));
}
~WHLightStrategy()
{
if (gpu_data_ptr_)
{
if (gpu_data_ptr_->lighters_buffer_)
memory_manager_->deallocate(gpu_data_ptr_->lighters_buffer_);
gpu_data_ptr_->lighters_buffer_ = nullptr;
gpu_data_ptr_->lighters_buffer_size_ = {};
memory_manager_->deallocate(gpu_data_ptr_);
}
gpu_data_ptr_ = nullptr;
}
const SGpuData* get_gpu_data_ptr() const { return gpu_data_ptr_; }
SGpuData* get_gpu_data_ptr() { return gpu_data_ptr_; }
private:
std::shared_ptr<WHAbstractMemoryManager> memory_manager_;//TODO: create memory strategies for mapped and managed alloc types
SGpuData* gpu_data_ptr_;
};
__device__ WHColor wh_device_get_color(const WHLightStrategy::SGpuData* light_strategy_ptr, const WHMaterial& material,
const WHNormal3& normal, const WHRay& ray)
{
WHColor result = WH_BLACK;
for (size_t i = 0u; i < light_strategy_ptr->lighters_buffer_size_; i++)
result += light_strategy_ptr->lighters_buffer_[i].get_point_color(material, normal, ray);
result.w = 1.0f;
truncate(result);
return result;
}
template<class VolumeType, class LightStrategyType>
class WHScene : private VolumeType, private LightStrategyType
{
public:
WHScene() = default;
WHScene(const VolumeType& volume_set, const LightStrategyType& light_strategy_set, const std::shared_ptr<WHEvent>& synchronizer_set,
const std::shared_ptr<WHAbstractMemoryManager>& memory_manager_set, unsigned int alloc_flags,
const std::shared_ptr<WHCamera>& camera_set):
VolumeType(volume_set), LightStrategyType(light_strategy_set),
synchronizer_(synchronizer_set), memory_manager_(memory_manager_set),
camera_(camera_set) {}
virtual ~WHScene() = default;
size_t get_light_source_buffer_size() const { return light_source_buffer_size_; }
const WHGraphicObject* get_light_source_buffer_() const { return light_source_buffer_; }
WHGraphicObject* get_light_source_buffer_() { return light_source_buffer_; }
protected:
std::shared_ptr<WHEvent> synchronizer_;
std::shared_ptr<WHAbstractMemoryManager> memory_manager_;
std::shared_ptr<WHCamera> camera_;
};
template<class VolumeType, class LightStrategyType>
__device__ WHColor wh_device_trace_ray(const VolumeType::SGpuData* volume_ptr, const LightStrategyType::SGpuData* light_strategy_ptr, WHRay* ray_ptr)
{
WHColor result_color = WH_BLACK;
WHGraphicObject* collision_object_ptr = nullptr;
float cur_factor = 1.0f;
WHNormal3 cur_normal;
WHMaterial cur_material;
while (is_inside(ray_ptr->position, VolumeType::get_bounds()))
{
float step_len = wh_device_step(volume_ptr, &ray_ptr, &cur_normal, &cur_material);
if (step_len == 0.0f) break;
if (cur_material.mat_transparency < 1.0f - cur_color.w) break;
result_color += wh_device_get_color(light_strategy_ptr, cur_material, cur_normal, *ray_ptr) * cur_factor;//must return normalized
cur_factor *= collision_object_ptr->cur_material.mat_transparency;
ray_ptr->refract(cur_material, cur_normal);
ray_ptr->step(4*step_len*FLT_EPSILON);
}
normalize(result_color);
return result_color;
}
}//namespace whirl
|
[
"[email protected]"
] | |
1657f4ff033357cad434d77deac674ea40181316
|
dee25a9d518640f21148900cd16af45d24ffcf2d
|
/Skechs/fourKeyKeyboard/fourKeyKeyboard.ino
|
524197167347b85fd4698de3ebe0b514e0a4bcae
|
[] |
no_license
|
shingokawaue/arduinoSketch
|
49ff218c38818bb23363db136d252e7a19521c96
|
9c89856edcf0e2846982d1a36b6ee2beb1f56c58
|
refs/heads/master
| 2020-07-24T05:13:41.085476 | 2019-09-11T13:20:15 | 2019-09-11T13:20:15 | 207,811,805 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 2,201 |
ino
|
#include "Keyboard.h"
const int outputNum = 2;//キーマトリックス用 outputの頭数
const int inputNum = 5;//キーマトリックス用 inputの頭数
const int outputPin[outputNum] = { 2, 3 };//キーマトリクス用 outputポート番号配列
const int inputPin[inputNum] = { 6, 7, 8, 9 ,10};//キーマトリクス用 inputポート番号配列
const byte keyMap[outputNum][inputNum] = {
{ 0x61, 0x62 , 0x63, 0x64, 0x65},
{ 0x66, 0x67 ,0x68,0x69,0x6a}
};//ASCII文字コード
bool currentState[outputNum][inputNum];//現在のloopで押されているかどうか
bool beforeState[outputNum][inputNum];//1loop前に押されていたかどうか
int i,j;//汎用
void setup() {//初期化。1回のみ実行
for( i = 0; i < outputNum; i++){
pinMode(outputPin[i],OUTPUT);
}
for( i = 0; i < inputNum; i++){
pinMode(inputPin[i],INPUT_PULLUP);//アクティブロー回路でいくので、PULLUP
//arduinoに内臓されたプルアップ抵抗を使うので、自分で抵抗を組み込む必要なし
}//ボタン押したときにLOWになる回路
for( i = 0; i < outputNum; i++){
for( j = 0; j < inputNum; j++){
currentState[i][j] = HIGH;
beforeState[i][j] = HIGH;
}
digitalWrite(outputPin[i],HIGH);
}
Serial.begin(9600);//9600bpsでシリアルポートを開く(USBの線で通信開始)
Keyboard.begin();
}
void loop() {
for( i = 0; i < outputNum; i++){
digitalWrite( outputPin[i], LOW );
for( j = 0; j < inputNum; j++){
currentState[i][j] = digitalRead(inputPin[j]);//inputポート1巡読み取り
if ( currentState[i][j] != beforeState[i][j] ){//もし状態が変わってたら!
Serial.print("key(");
Serial.print(i);
Serial.print(",");
Serial.print(j);
Serial.print(")");
if ( currentState[i][j] == LOW){
Serial.println(" 押したっっ!!");
Keyboard.press( keyMap[i][j] );
} else {
Serial.println(" 離したっっ!!");
Keyboard.release( keyMap[i][j] );
}
beforeState[i][j] = currentState[i][j];
}
}
digitalWrite( outputPin[i], HIGH );
}
}
|
[
"[email protected]"
] | |
aa9b03bb95bd140796e0456c8f9996d12fdb19d5
|
e10f9aebff08879b68fbefdc9bf9afc481ba4d4d
|
/Driver/W25Q64.h
|
9a86b3b36cddb70739c81f4e3c09d016042fac03
|
[] |
no_license
|
jangocheng/STM32F103ZET6_ogistics_handling_robot
|
3058b1e1e00913aff357e84af2c1f374b76363ca
|
ac20d3affae47d557d49c2d428cc2ae1da179157
|
refs/heads/master
| 2021-09-26T00:37:20.687459 | 2018-09-17T15:09:26 | 2018-09-17T15:09:33 | null | 0 | 0 | null | null | null | null |
GB18030
|
C++
| false | false | 1,971 |
h
|
#ifndef __W25Q64__H__
#define __W25Q64__H__
#include "stm32f10x.h" // Device header
#include "spi.h"
#include "gpio.h"
//W25Q64 SCK <--->PA5 MISO<--->PA6 MOSI<--->PA7 CS <--->PC0
//写/读小数
// Write/Read((void*)double_buffer, FLASH_PageSize*1, sizeof(double_buffer));
#define W25Q64_ID 0XEF4017 //W25Q64 ID
#define FLASH_PageSize 256 //每页占的字节数
//8MByte分为128Bolck,1Bolck分为16个扇区,1个扇区16页
//256Byte * 16页 * 16 扇区 *128块 =8388608 Byte = 8 *2^10 KB =8MB
//2048个扇区 1个扇区占4096Byte
struct W25Q64_Gpio
{
GPIO *SCK;
GPIO *MISO;
GPIO *MOSI;
GPIO *CS;
};
class W25Q64
{
public:
W25Q64(W25Q64_Gpio *W25Q64_GPIO);
void Init();
void SectorErase(uint32_t SectorAddr); //擦除扇区
void BulkErase(); //整片擦除
void Write(uint8_t* p_Data,uint32_t WriteAddr,uint16_t Data_Length); //向WriteAddr写入Data_Length个字节,先擦除扇区
void Read(uint8_t* p_Data,uint32_t ReadAddr,uint16_t Data_Length); //向ReadAddr读取Data_Length个字节存储到*p_Data
void PowerDown_Mode(FunctionalState ok); //掉电模式设置
void Get_DeviceID( uint8_t* ID); //查询设备ID
void Get_ID( uint32_t* ID); //查询ID,可用于检测W25Q64是否正常
private:
W25Q64_Gpio *gpio;
void Init_Gpio();
inline void CS_Set();
inline void CS_Reset();
void Init_SPI3();
void Enable_Write();
void Wait_WriteEnd();
void PageWrite(uint8_t* p_Data,uint32_t WriteAddr,uint16_t Data_Length); //按页写入数据, Data_Length不大于SPI_FLASH_PerWritePageSize
};
extern "C" void Get_ID();
#endif
|
[
"[email protected]"
] | |
3d3e301db4e8acd8dad8c10b55997495771b1ced
|
9030ce2789a58888904d0c50c21591632eddffd7
|
/SDK/ARKSurvivalEvolved_DroppedItemGeneric_FertilizedEgg_CrystalWyvern_functions.cpp
|
1d54c5a4387898806cd7d75d8621c7276be7984e
|
[
"MIT"
] |
permissive
|
2bite/ARK-SDK
|
8ce93f504b2e3bd4f8e7ced184980b13f127b7bf
|
ce1f4906ccf82ed38518558c0163c4f92f5f7b14
|
refs/heads/master
| 2022-09-19T06:28:20.076298 | 2022-09-03T17:21:00 | 2022-09-03T17:21:00 | 232,411,353 | 14 | 5 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,932 |
cpp
|
// ARKSurvivalEvolved (332.8) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "ARKSurvivalEvolved_DroppedItemGeneric_FertilizedEgg_CrystalWyvern_parameters.hpp"
namespace sdk
{
//---------------------------------------------------------------------------
//Functions
//---------------------------------------------------------------------------
// Function DroppedItemGeneric_FertilizedEgg_CrystalWyvern.DroppedItemGeneric_FertilizedEgg_CrystalWyvern_C.UserConstructionScript
// ()
void ADroppedItemGeneric_FertilizedEgg_CrystalWyvern_C::UserConstructionScript()
{
static auto fn = UObject::FindObject<UFunction>("Function DroppedItemGeneric_FertilizedEgg_CrystalWyvern.DroppedItemGeneric_FertilizedEgg_CrystalWyvern_C.UserConstructionScript");
ADroppedItemGeneric_FertilizedEgg_CrystalWyvern_C_UserConstructionScript_Params params;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
// Function DroppedItemGeneric_FertilizedEgg_CrystalWyvern.DroppedItemGeneric_FertilizedEgg_CrystalWyvern_C.ExecuteUbergraph_DroppedItemGeneric_FertilizedEgg_CrystalWyvern
// ()
// Parameters:
// int EntryPoint (Parm, ZeroConstructor, IsPlainOldData)
void ADroppedItemGeneric_FertilizedEgg_CrystalWyvern_C::ExecuteUbergraph_DroppedItemGeneric_FertilizedEgg_CrystalWyvern(int EntryPoint)
{
static auto fn = UObject::FindObject<UFunction>("Function DroppedItemGeneric_FertilizedEgg_CrystalWyvern.DroppedItemGeneric_FertilizedEgg_CrystalWyvern_C.ExecuteUbergraph_DroppedItemGeneric_FertilizedEgg_CrystalWyvern");
ADroppedItemGeneric_FertilizedEgg_CrystalWyvern_C_ExecuteUbergraph_DroppedItemGeneric_FertilizedEgg_CrystalWyvern_Params params;
params.EntryPoint = EntryPoint;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
|
[
"[email protected]"
] | |
9ab58f6e7a61dd535d5598c7fcf007251781002d
|
36662ba6c5d515a953227c3fe70b960bd003dd6d
|
/main.cpp
|
c7d44d9d5d96dd2c22d2797412240c761b01e50d
|
[] |
no_license
|
hiepnm/filter_ip_to_loc_file
|
fc62dbdadf4ab2595b0eac6c56f7f356ec87efa1
|
d53987f609e57d0fe0150648c9af53b7c59ce710
|
refs/heads/master
| 2021-04-09T16:45:26.042723 | 2014-10-31T10:24:42 | 2014-10-31T10:24:42 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 3,332 |
cpp
|
/*
* main.cpp
*
* Created on: May 9, 2014
* Author: hiepnm
*/
#include <map>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cerrno>
struct location_t {
int regnum;
char regid[3];
char regname[57];
};
typedef struct location_t location;
std::map<std::string, location> loc_map;
int collect_data_old_file(const char* file_name, char** sz_error) {
sz_error = NULL;
FILE* fptr = fopen(file_name, "r");
if (!fptr) {
// *sz_error = (char*)malloc(strlen(strerror(errno)) + 1);
// strcpy(*sz_error, strerror(errno));
return -1;
}
char line_buffer[BUFSIZ]; /* BUFSIZ is defined if you include stdio.h */
while (fgets(line_buffer, sizeof(line_buffer), fptr)) {
location* l = (location*)malloc(sizeof(location));
sscanf(line_buffer, "%c%c\t%d\t%s", &l->regid[0], &l->regid[1], &l->regnum, l->regname);
l->regid[2] = '\0';
loc_map.insert(std::pair<std::string, location>(std::string(l->regid), *l));
}
fclose(fptr);
return 0;
}
static int count = 101;
int collect_data_new_file(const char* file_name, char** sz_error) {
sz_error = NULL;
FILE* fptr = fopen(file_name, "r");
if (!fptr) {
*sz_error = (char*)malloc(strlen(strerror(errno)) + 1);
strcpy(*sz_error, strerror(errno));
return -1;
}
char line_buffer[BUFSIZ]; /* BUFSIZ is defined if you include stdio.h */
char name[57];
int l1,l2,l3,l4,u1,u2,u3,u4;
unsigned int lower, upper;
while (fgets(line_buffer, sizeof(line_buffer), fptr)) {
char regid[3];
sscanf(line_buffer, "%d.%d.%d.%d,%d.%d.%d.%d,%d,%d,%c%c,%[0-9a-zA-Z ,\"]", &l1,&l2,&l3,&l4, &u1,&u2,&u3,&u4, &lower, &upper, ®id[0], ®id[1], name);
regid[2]='\0';
std::string key(regid);
if (loc_map.find(key) == loc_map.end()) {
location* l = (location*)malloc(sizeof(location));
count++;
l->regnum = count;
strcpy(l->regid, regid);
strcpy(l->regname, name);
loc_map.insert(std::pair<std::string, location> (key, *l));
} else {
}
}
fclose(fptr);
return 0;
}
int flush_data(const char* file_name, char** sz_error) {
sz_error = NULL;
FILE* fptr = fopen(file_name, "w");
if (!fptr) {
*sz_error = (char*)malloc(strlen(strerror(errno)) + 1);
strcpy(*sz_error, strerror(errno));
return -1;
}
std::map<std::string, location>::iterator it;
for(it = loc_map.begin(); it != loc_map.end(); it++) {
fprintf(fptr, "%c%c,%d,%s\n", it->second.regid[0], it->second.regid[1], it->second.regnum, it->second.regname);
}
fclose(fptr);
return 0;
}
/**
* argv[1]: old file: %c%c\t%d\t%s
* argv[2]: file has new data
* argv[3]: new file
*/
int main(int argc, char **argv) {
//doc argv[1] => insert vao map
//doc argv[2] => insert vao map
//ghi ra argv[3]
if (argc < 4) {
fprintf(stderr, "Usage: %s <old_file> <new_file_data> <flush_file> \n", argv[0]);
return -1;
}
char* sz_error = NULL;
int rc = collect_data_old_file(argv[1], &sz_error);
if (rc == -1 && sz_error != NULL) {
fprintf(stderr, "%s", sz_error);
free(sz_error);
}
char* sz_error2 = NULL;
rc = collect_data_new_file(argv[2], &sz_error2);
if (rc == -1 && sz_error2 != NULL) {
fprintf(stderr, "%s", sz_error2);
free(sz_error2);
return -1;
}
char* sz_error3 = NULL;
rc = flush_data(argv[3], &sz_error3);
if (rc == -1 && sz_error3 != NULL) {
fprintf(stderr, "%s", sz_error3);
free(sz_error3);
return -1;
}
}
|
[
"[email protected]"
] | |
07b67653804ddfcf8274435997c806a78082ae4b
|
06bed8ad5fd60e5bba6297e9870a264bfa91a71d
|
/libPr3/logixng/digitalmany.h
|
e933508418b36e077e6f6a1954b93c398f66dff2
|
[] |
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 | 4,259 |
h
|
#ifndef DIGITALMANY_H
#define DIGITALMANY_H
#include "abstractdigitalaction.h"
#include "femaledigitalactionsocket.h"
#include "femalesocketlistener.h"
class DigitalMany : public AbstractDigitalAction, public FemaleSocketListener
{
Q_OBJECT
Q_INTERFACES(FemaleSocketListener)
/*private*/ /*static*/ class ActionEntry {
/*private*/ QString _socketSystemName;
/*private*/ /*final*/ FemaleDigitalActionSocket* _socket;
/*private*/ ActionEntry(FemaleDigitalActionSocket* socket, QString socketSystemName) {
_socketSystemName = socketSystemName;
_socket = socket;
}
/*private*/ ActionEntry(FemaleDigitalActionSocket* socket) {
this->_socket = socket;
}
friend class DigitalMany;
};
public:
explicit DigitalMany(QString sys, QString user, QObject *parent = nullptr);
/*public*/ DigitalMany(QString sys, QString user, QList<QMap<QString, QString>> actionSystemNames, QObject* parent=nullptr);
/*public*/ Base* getDeepCopy(QMap<QString, QString> *systemNames, QMap<QString, QString> *userNames) /*throws JmriException*/;
/*public*/ QString getActionSystemName(int index);
/*public*/ void setup()override;
/*public*/ Category getCategory()override;
/*public*/ void execute() override;
/*public*/ FemaleSocket* getChild(int index) /*throws IllegalArgumentException, UnsupportedOperationException */override;
/*public*/ int getChildCount()override;
/*public*/ bool isSocketOperationAllowed(int index, FemaleSocketOperation::TYPES oper)override;
/*public*/ void doSocketOperation(int index, FemaleSocketOperation::TYPES oper)override;
/*public*/ void connected(FemaleSocket* socket)override;
/*public*/ void disconnected(FemaleSocket* socket)override;
/*public*/ QString getShortDescription(QLocale locale)override;
/*public*/ QString getLongDescription(QLocale locale)override;
/*public*/ void registerListenersForThisClass()override;
/*public*/ void unregisterListenersForThisClass()override;
/*public*/ void disposeMe()override;
/*public*/ QString getClass()const override {return "jmri.jmrit.logixng.tools.debugger.DigitalMany";}
QObject* self() override {return (QObject*)this;}
QObject* bself() override {return (QObject*)this;}
/*public*/ virtual void addPropertyChangeListener(/*@Nonnull*/ PropertyChangeListener* listener, QString name, QString listenerRef)override{
AbstractNamedBean::addPropertyChangeListener(listener, name,listenerRef);
}
/*public*/ void addPropertyChangeListener(/*@Nonnull*/ QString propertyName, /*@Nonnull*/ PropertyChangeListener* listener,
QString name, QString listenerRef) override {
AbstractNamedBean::addPropertyChangeListener(propertyName, listener, name, listenerRef);
}
/*public*/ void updateListenerRef(PropertyChangeListener* l, QString newName) override {AbstractNamedBean::updateListenerRef(l, newName);}
/*public*/ void vetoableChange(/*@Nonnull*/ PropertyChangeEvent* evt) override {AbstractNamedBean::vetoableChange(evt);}
/*public*/ QString getListenerRef(/*@Nonnull*/ PropertyChangeListener* l) override {return AbstractNamedBean::getListenerRef(l);}
/*public*/ QList<QString> getListenerRefs() override {return AbstractNamedBean::getListenerRefs();}
/*public*/ int getNumPropertyChangeListeners() override {return AbstractNamedBean::getNumPropertyChangeListeners();}
/*public*/ QVector<PropertyChangeListener*> getPropertyChangeListenersByReference(/*@Nonnull*/ QString name)override {
return AbstractNamedBean::getPropertyChangeListenersByReference(name);
}
void addPropertyChangeListener(PropertyChangeListener* l) override {AbstractNamedBean::addPropertyChangeListener(l);}
private:
static Logger* log;
/*private*/ /*final*/ QList<ActionEntry*> _actionEntries = QList<ActionEntry*>();
/*private*/ bool disableCheckForUnconnectedSocket = false;
/*private*/ void setActionSystemNames(QList<QMap<QString, QString> > systemNames);
/*private*/ void setNumSockets(int num);
/*private*/ void checkFreeSocket();
/*private*/ void insertNewSocket(int index);
/*private*/ void removeSocket(int index);
/*private*/ void moveSocketDown(int index);
};
#endif // DIGITALMANY_H
|
[
"[email protected]"
] | |
8e5e811e59579d94fe36493cf93b0ea3ba40b110
|
364a2c824284c41b2de5690d9c1e960cea79faad
|
/SPOJ/totient.cpp
|
aee94aa1672711fa357a99e40a3d652bf63b9e9c
|
[] |
no_license
|
jsanyam/Codes
|
7cb5a96d6f4bdb89ac8d1e1c6a09db0006ab0d25
|
30aa151ba2675b1ca295826cf3f122dd9c8d77fa
|
refs/heads/master
| 2021-01-10T09:20:50.792499 | 2016-08-23T17:51:18 | 2016-08-23T17:51:18 | 49,881,010 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 417 |
cpp
|
#include<iostream>
using namespace std;
int fi(int n)
{
int result = n;
for(int i = 2; i*i<=n; i++)
{
if(n%i == 0)
result -= result/i;
while(n%i == 0)
n /= i;
}
if(n>1)
result -= result/n;
return result;
}
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
cout<<fi(n)<<endl;
}
return 0;
}
|
[
"[email protected]"
] | |
0b36efe26a7780347527d28cc74e7669f5f3c277
|
5e9bc1fcb691960adda799357144ea01c219d44f
|
/assignments/c++ ProgrammingSolutions/Program4.cpp
|
4be2ad4512bc5c8bec402f5f6231684e3a4d5946
|
[] |
no_license
|
alvas-education-foundation/spoorti_daroji
|
3a1f3c6751f6e9d784e14250d386b621a3f7c3ef
|
29462fa46f966ca80dbac02dafb765a900ef4b6d
|
refs/heads/master
| 2022-12-05T19:17:07.962049 | 2020-08-10T12:47:51 | 2020-08-10T12:47:51 | 265,741,049 | 0 | 1 | null | null | null | null |
UTF-8
|
C++
| false | false | 940 |
cpp
|
/*C++ program to enter the details of students and display them using class and object. The details should be private in nature and use public membersfunction to access the private members.(Define the member function outside the class)*/
#include<iostream.h>
using namespace std;
class student
{
private: char name[10],reg[10],sem[10],branch[10],sec[10];
public:void input();
public:void display();
};
void student::input()
{
cout<<"ENTER STUDENT DETAILS: "<<endl;
cout<<"Enter Name: ";
cin>>name;
cout<<"Enter Register Number: ";
cin>>reg;
cout<<"Enter Sem: ";
cin>>sem;
cout<<"Enter Branch: ";
cin>>branch;
cout<<"Enter Section: ";
cin>>sec;
cout<<endl;
}
void student::display()
{
cout<<"ENTERED STUDENT DETAILS IS: ";
cout<<"\nName: "<<name;
cout<<"\nReg No: "<<reg;
cout<<"\nSem: "<<sem;
cout<<"\nBranch: "<<branch;
cout<<"\nSection: "<<sec;
}
int main()
{
student s;
s.input();
s.display();
}
|
[
"[email protected]"
] | |
7bf7d91a62ef144b1b8be7855fe4a62ba6cecc6b
|
b410ee97a1d662708413a3e54fb8b53a1388896c
|
/PathTracer/NoiseTexture.h
|
3403a412795b7fed745a33142c433a506d423b29
|
[] |
no_license
|
Shylie/MCPT-GPU
|
2af1c4afb297aeb9f88e66641b5dd341ac2d99ce
|
06a748dafeef49561d16d58d96dfb54700a96f79
|
refs/heads/master
| 2023-03-23T06:28:43.186472 | 2021-03-19T18:28:55 | 2021-03-19T18:28:55 | 205,578,138 | 2 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,048 |
h
|
#ifndef NOISE_TEXTURE_H
#define NOISE_TEXTURE_H
#include "Texture.h"
class API NoiseTexture : public Texture
{
public:
__host__ NoiseTexture(int tiles);
__device__ NoiseTexture(int tiles, Vec3* randv_d, int* permX_d, int* permY_d, int* permZ_d);
__host__ __device__ ~NoiseTexture();
__host__ __device__ NoiseTexture(const NoiseTexture&) = delete;
__host__ __device__ NoiseTexture& operator=(const NoiseTexture&) = delete;
__host__ __device__ Vec3 Value(unsigned int* seed, float u, float v, const Vec3& pos) const override;
protected:
int tiles;
Vec3* randv{ nullptr };
int* permX{ nullptr };
int* permY{ nullptr };
int* permZ{ nullptr };
Vec3* randv_d{ nullptr };
int* permX_d{ nullptr };
int* permY_d{ nullptr };
int* permZ_d{ nullptr };
__host__ __device__ float Noise(unsigned int* seed, float u, float v, const Vec3& pos) const;
__host__ __device__ float Turb(unsigned int* seed, float u, float v, const Vec3& pos, int depth) const;
__host__ void constructEnvironment();
__host__ void destroyEnvironment();
};
#endif
|
[
"[email protected]"
] | |
6dd00ad58fd6a4bae914919ac09d84dbb5ee50d2
|
e76ea38dbe5774fccaf14e1a0090d9275cdaee08
|
/src/components/autofill/content/renderer/password_autofill_agent.cc
|
ce2f1031844cf0f582c32be523841057e09e4ebd
|
[
"BSD-3-Clause"
] |
permissive
|
eurogiciel-oss/Tizen_Crosswalk
|
efc424807a5434df1d5c9e8ed51364974643707d
|
a68aed6e29bd157c95564e7af2e3a26191813e51
|
refs/heads/master
| 2021-01-18T19:19:04.527505 | 2014-02-06T13:43:21 | 2014-02-06T13:43:21 | 16,070,101 | 1 | 3 | null | null | null | null |
UTF-8
|
C++
| false | false | 28,297 |
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 "components/autofill/content/renderer/password_autofill_agent.h"
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/content/renderer/form_autofill_util.h"
#include "components/autofill/content/renderer/password_form_conversion_utils.h"
#include "components/autofill/core/common/autofill_messages.h"
#include "components/autofill/core/common/form_field_data.h"
#include "components/autofill/core/common/password_form.h"
#include "components/autofill/core/common/password_form_fill_data.h"
#include "content/public/renderer/render_view.h"
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebAutofillClient.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebFormElement.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebNode.h"
#include "third_party/WebKit/public/web/WebNodeList.h"
#include "third_party/WebKit/public/web/WebSecurityOrigin.h"
#include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "ui/events/keycodes/keyboard_codes.h"
namespace autofill {
namespace {
// The size above which we stop triggering autocomplete.
static const size_t kMaximumTextSizeForAutocomplete = 1000;
// Maps element names to the actual elements to simplify form filling.
typedef std::map<base::string16, WebKit::WebInputElement>
FormInputElementMap;
// Utility struct for form lookup and autofill. When we parse the DOM to look up
// a form, in addition to action and origin URL's we have to compare all
// necessary form elements. To avoid having to look these up again when we want
// to fill the form, the FindFormElements function stores the pointers
// in a FormElements* result, referenced to ensure they are safe to use.
struct FormElements {
WebKit::WebFormElement form_element;
FormInputElementMap input_elements;
};
typedef std::vector<FormElements*> FormElementsList;
// Helper to search the given form element for the specified input elements
// in |data|, and add results to |result|.
static bool FindFormInputElements(WebKit::WebFormElement* fe,
const FormData& data,
FormElements* result) {
// Loop through the list of elements we need to find on the form in order to
// autofill it. If we don't find any one of them, abort processing this
// form; it can't be the right one.
for (size_t j = 0; j < data.fields.size(); j++) {
WebKit::WebVector<WebKit::WebNode> temp_elements;
fe->getNamedElements(data.fields[j].name, temp_elements);
// Match the first input element, if any.
// |getNamedElements| may return non-input elements where the names match,
// so the results are filtered for input elements.
// If more than one match is made, then we have ambiguity (due to misuse
// of "name" attribute) so is it considered not found.
bool found_input = false;
for (size_t i = 0; i < temp_elements.size(); ++i) {
if (temp_elements[i].to<WebKit::WebElement>().hasTagName("input")) {
// Check for a non-unique match.
if (found_input) {
found_input = false;
break;
}
// Only fill saved passwords into password fields and usernames into
// text fields.
WebKit::WebInputElement input_element =
temp_elements[i].to<WebKit::WebInputElement>();
if (input_element.isPasswordField() !=
(data.fields[j].form_control_type == "password"))
continue;
// This element matched, add it to our temporary result. It's possible
// there are multiple matches, but for purposes of identifying the form
// one suffices and if some function needs to deal with multiple
// matching elements it can get at them through the FormElement*.
// Note: This assignment adds a reference to the InputElement.
result->input_elements[data.fields[j].name] = input_element;
found_input = true;
}
}
// A required element was not found. This is not the right form.
// Make sure no input elements from a partially matched form in this
// iteration remain in the result set.
// Note: clear will remove a reference from each InputElement.
if (!found_input) {
result->input_elements.clear();
return false;
}
}
return true;
}
// Helper to locate form elements identified by |data|.
void FindFormElements(WebKit::WebView* view,
const FormData& data,
FormElementsList* results) {
DCHECK(view);
DCHECK(results);
WebKit::WebFrame* main_frame = view->mainFrame();
if (!main_frame)
return;
GURL::Replacements rep;
rep.ClearQuery();
rep.ClearRef();
// Loop through each frame.
for (WebKit::WebFrame* f = main_frame; f; f = f->traverseNext(false)) {
WebKit::WebDocument doc = f->document();
if (!doc.isHTMLDocument())
continue;
GURL full_origin(doc.url());
if (data.origin != full_origin.ReplaceComponents(rep))
continue;
WebKit::WebVector<WebKit::WebFormElement> forms;
doc.forms(forms);
for (size_t i = 0; i < forms.size(); ++i) {
WebKit::WebFormElement fe = forms[i];
GURL full_action(f->document().completeURL(fe.action()));
if (full_action.is_empty()) {
// The default action URL is the form's origin.
full_action = full_origin;
}
// Action URL must match.
if (data.action != full_action.ReplaceComponents(rep))
continue;
scoped_ptr<FormElements> curr_elements(new FormElements);
if (!FindFormInputElements(&fe, data, curr_elements.get()))
continue;
// We found the right element.
// Note: this assignment adds a reference to |fe|.
curr_elements->form_element = fe;
results->push_back(curr_elements.release());
}
}
}
bool IsElementEditable(const WebKit::WebInputElement& element) {
return element.isEnabled() && !element.isReadOnly();
}
void FillForm(FormElements* fe, const FormData& data) {
if (!fe->form_element.autoComplete())
return;
std::map<base::string16, base::string16> data_map;
for (size_t i = 0; i < data.fields.size(); i++)
data_map[data.fields[i].name] = data.fields[i].value;
for (FormInputElementMap::iterator it = fe->input_elements.begin();
it != fe->input_elements.end(); ++it) {
WebKit::WebInputElement element = it->second;
// Don't fill a form that has pre-filled values distinct from the ones we
// want to fill with.
if (!element.value().isEmpty() && element.value() != data_map[it->first])
return;
// Don't fill forms with uneditable fields or fields with autocomplete
// disabled.
if (!IsElementEditable(element) || !element.autoComplete())
return;
}
for (FormInputElementMap::iterator it = fe->input_elements.begin();
it != fe->input_elements.end(); ++it) {
WebKit::WebInputElement element = it->second;
// TODO(tkent): Check maxlength and pattern.
element.setValue(data_map[it->first]);
element.setAutofilled(true);
element.dispatchFormControlChangeEvent();
}
}
void SetElementAutofilled(WebKit::WebInputElement* element, bool autofilled) {
if (element->isAutofilled() == autofilled)
return;
element->setAutofilled(autofilled);
// Notify any changeEvent listeners.
element->dispatchFormControlChangeEvent();
}
bool DoUsernamesMatch(const base::string16& username1,
const base::string16& username2,
bool exact_match) {
if (exact_match)
return username1 == username2;
return StartsWith(username1, username2, true);
}
} // namespace
////////////////////////////////////////////////////////////////////////////////
// PasswordAutofillAgent, public:
PasswordAutofillAgent::PasswordAutofillAgent(content::RenderView* render_view)
: content::RenderViewObserver(render_view),
usernames_usage_(NOTHING_TO_AUTOFILL),
web_view_(render_view->GetWebView()),
weak_ptr_factory_(this) {
}
PasswordAutofillAgent::~PasswordAutofillAgent() {
}
bool PasswordAutofillAgent::TextFieldDidEndEditing(
const WebKit::WebInputElement& element) {
LoginToPasswordInfoMap::const_iterator iter =
login_to_password_info_.find(element);
if (iter == login_to_password_info_.end())
return false;
const PasswordFormFillData& fill_data =
iter->second.fill_data;
// If wait_for_username is false, we should have filled when the text changed.
if (!fill_data.wait_for_username)
return false;
WebKit::WebInputElement password = iter->second.password_field;
if (!IsElementEditable(password))
return false;
WebKit::WebInputElement username = element; // We need a non-const.
// Do not set selection when ending an editing session, otherwise it can
// mess with focus.
FillUserNameAndPassword(&username, &password, fill_data, true, false);
return true;
}
bool PasswordAutofillAgent::TextDidChangeInTextField(
const WebKit::WebInputElement& element) {
LoginToPasswordInfoMap::const_iterator iter =
login_to_password_info_.find(element);
if (iter == login_to_password_info_.end())
return false;
// The input text is being changed, so any autofilled password is now
// outdated.
WebKit::WebInputElement username = element; // We need a non-const.
WebKit::WebInputElement password = iter->second.password_field;
SetElementAutofilled(&username, false);
if (password.isAutofilled()) {
password.setValue(base::string16());
SetElementAutofilled(&password, false);
}
// If wait_for_username is true we will fill when the username loses focus.
if (iter->second.fill_data.wait_for_username)
return false;
if (!IsElementEditable(element) ||
!element.isText() ||
!element.autoComplete()) {
return false;
}
// Don't inline autocomplete if the user is deleting, that would be confusing.
// But refresh the popup. Note, since this is ours, return true to signal
// no further processing is required.
if (iter->second.backspace_pressed_last) {
ShowSuggestionPopup(iter->second.fill_data, username);
return true;
}
WebKit::WebString name = element.nameForAutofill();
if (name.isEmpty())
return false; // If the field has no name, then we won't have values.
// Don't attempt to autofill with values that are too large.
if (element.value().length() > kMaximumTextSizeForAutocomplete)
return false;
// The caret position should have already been updated.
PerformInlineAutocomplete(element, password, iter->second.fill_data);
return true;
}
bool PasswordAutofillAgent::TextFieldHandlingKeyDown(
const WebKit::WebInputElement& element,
const WebKit::WebKeyboardEvent& event) {
// If using the new Autofill UI that lives in the browser, it will handle
// keypresses before this function. This is not currently an issue but if
// the keys handled there or here change, this issue may appear.
LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(element);
if (iter == login_to_password_info_.end())
return false;
int win_key_code = event.windowsKeyCode;
iter->second.backspace_pressed_last =
(win_key_code == ui::VKEY_BACK || win_key_code == ui::VKEY_DELETE);
return true;
}
bool PasswordAutofillAgent::DidAcceptAutofillSuggestion(
const WebKit::WebNode& node,
const WebKit::WebString& value) {
WebKit::WebInputElement input;
PasswordInfo password;
if (!FindLoginInfo(node, &input, &password))
return false;
// Set the incoming |value| in the text field and |FillUserNameAndPassword|
// will do the rest.
input.setValue(value, true);
return FillUserNameAndPassword(&input, &password.password_field,
password.fill_data, true, true);
}
bool PasswordAutofillAgent::DidClearAutofillSelection(
const WebKit::WebNode& node) {
WebKit::WebInputElement input;
PasswordInfo password;
return FindLoginInfo(node, &input, &password);
}
bool PasswordAutofillAgent::ShowSuggestions(
const WebKit::WebInputElement& element) {
LoginToPasswordInfoMap::const_iterator iter =
login_to_password_info_.find(element);
if (iter == login_to_password_info_.end())
return false;
return ShowSuggestionPopup(iter->second.fill_data, element);
}
bool PasswordAutofillAgent::OriginCanAccessPasswordManager(
const WebKit::WebSecurityOrigin& origin) {
return origin.canAccessPasswordManager();
}
void PasswordAutofillAgent::OnDynamicFormsSeen(WebKit::WebFrame* frame) {
SendPasswordForms(frame, false /* only_visible */);
}
void PasswordAutofillAgent::SendPasswordForms(WebKit::WebFrame* frame,
bool only_visible) {
// Make sure that this security origin is allowed to use password manager.
WebKit::WebSecurityOrigin origin = frame->document().securityOrigin();
if (!OriginCanAccessPasswordManager(origin))
return;
// Checks whether the webpage is a redirect page or an empty page.
if (IsWebpageEmpty(frame))
return;
WebKit::WebVector<WebKit::WebFormElement> forms;
frame->document().forms(forms);
std::vector<PasswordForm> password_forms;
for (size_t i = 0; i < forms.size(); ++i) {
const WebKit::WebFormElement& form = forms[i];
// If requested, ignore non-rendered forms, e.g. those styled with
// display:none.
if (only_visible && !IsWebNodeVisible(form))
continue;
scoped_ptr<PasswordForm> password_form(CreatePasswordForm(form));
if (password_form.get())
password_forms.push_back(*password_form);
}
if (password_forms.empty() && !only_visible) {
// We need to send the PasswordFormsRendered message regardless of whether
// there are any forms visible, as this is also the code path that triggers
// showing the infobar.
return;
}
if (only_visible) {
Send(new AutofillHostMsg_PasswordFormsRendered(routing_id(),
password_forms));
} else {
Send(new AutofillHostMsg_PasswordFormsParsed(routing_id(), password_forms));
}
}
bool PasswordAutofillAgent::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PasswordAutofillAgent, message)
IPC_MESSAGE_HANDLER(AutofillMsg_FillPasswordForm, OnFillPasswordForm)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
void PasswordAutofillAgent::DidStartLoading() {
if (usernames_usage_ != NOTHING_TO_AUTOFILL) {
UMA_HISTOGRAM_ENUMERATION("PasswordManager.OtherPossibleUsernamesUsage",
usernames_usage_, OTHER_POSSIBLE_USERNAMES_MAX);
usernames_usage_ = NOTHING_TO_AUTOFILL;
}
}
void PasswordAutofillAgent::DidFinishDocumentLoad(WebKit::WebFrame* frame) {
// The |frame| contents have been parsed, but not yet rendered. Let the
// PasswordManager know that forms are loaded, even though we can't yet tell
// whether they're visible.
SendPasswordForms(frame, false);
}
void PasswordAutofillAgent::DidFinishLoad(WebKit::WebFrame* frame) {
// The |frame| contents have been rendered. Let the PasswordManager know
// which of the loaded frames are actually visible to the user. This also
// triggers the "Save password?" infobar if the user just submitted a password
// form.
SendPasswordForms(frame, true);
}
void PasswordAutofillAgent::FrameDetached(WebKit::WebFrame* frame) {
FrameClosing(frame);
}
void PasswordAutofillAgent::FrameWillClose(WebKit::WebFrame* frame) {
FrameClosing(frame);
}
void PasswordAutofillAgent::WillSendSubmitEvent(
WebKit::WebFrame* frame,
const WebKit::WebFormElement& form) {
// Some login forms have onSubmit handlers that put a hash of the password
// into a hidden field and then clear the password (http://crbug.com/28910).
// This method gets called before any of those handlers run, so save away
// a copy of the password in case it gets lost.
provisionally_saved_forms_[frame].reset(CreatePasswordForm(form).release());
}
void PasswordAutofillAgent::WillSubmitForm(WebKit::WebFrame* frame,
const WebKit::WebFormElement& form) {
scoped_ptr<PasswordForm> submitted_form = CreatePasswordForm(form);
// If there is a provisionally saved password, copy over the previous
// password value so we get the user's typed password, not the value that
// may have been transformed for submit.
// TODO(gcasto): Do we need to have this action equality check? Is it trying
// to prevent accidentally copying over passwords from a different form?
if (submitted_form) {
if (provisionally_saved_forms_[frame].get() &&
submitted_form->action == provisionally_saved_forms_[frame]->action) {
submitted_form->password_value =
provisionally_saved_forms_[frame]->password_value;
}
// Some observers depend on sending this information now instead of when
// the frame starts loading. If there are redirects that cause a new
// RenderView to be instantiated (such as redirects to the WebStore)
// we will never get to finish the load.
Send(new AutofillHostMsg_PasswordFormSubmitted(routing_id(),
*submitted_form));
// Remove reference since we have already submitted this form.
provisionally_saved_forms_.erase(frame);
}
}
void PasswordAutofillAgent::DidStartProvisionalLoad(WebKit::WebFrame* frame) {
if (!frame->parent()) {
// If the navigation is not triggered by a user gesture, e.g. by some ajax
// callback, then inherit the submitted password form from the previous
// state. This fixes the no password save issue for ajax login, tracked in
// [http://crbug/43219]. Note that there are still some sites that this
// fails for because they use some element other than a submit button to
// trigger submission (which means WillSendSubmitEvent will not be called).
if (!WebKit::WebUserGestureIndicator::isProcessingUserGesture() &&
provisionally_saved_forms_[frame].get()) {
Send(new AutofillHostMsg_PasswordFormSubmitted(
routing_id(),
*provisionally_saved_forms_[frame]));
provisionally_saved_forms_.erase(frame);
}
// Clear the whole map during main frame navigation.
provisionally_saved_forms_.clear();
}
}
void PasswordAutofillAgent::OnFillPasswordForm(
const PasswordFormFillData& form_data) {
if (usernames_usage_ == NOTHING_TO_AUTOFILL) {
if (form_data.other_possible_usernames.size())
usernames_usage_ = OTHER_POSSIBLE_USERNAMES_PRESENT;
else if (usernames_usage_ == NOTHING_TO_AUTOFILL)
usernames_usage_ = OTHER_POSSIBLE_USERNAMES_ABSENT;
}
FormElementsList forms;
// We own the FormElements* in forms.
FindFormElements(render_view()->GetWebView(), form_data.basic_data, &forms);
FormElementsList::iterator iter;
for (iter = forms.begin(); iter != forms.end(); ++iter) {
scoped_ptr<FormElements> form_elements(*iter);
// If wait_for_username is true, we don't want to initially fill the form
// until the user types in a valid username.
if (!form_data.wait_for_username)
FillForm(form_elements.get(), form_data.basic_data);
// Attach autocomplete listener to enable selecting alternate logins.
// First, get pointers to username element.
WebKit::WebInputElement username_element =
form_elements->input_elements[form_data.basic_data.fields[0].name];
// Get pointer to password element. (We currently only support single
// password forms).
WebKit::WebInputElement password_element =
form_elements->input_elements[form_data.basic_data.fields[1].name];
// We might have already filled this form if there are two <form> elements
// with identical markup.
if (login_to_password_info_.find(username_element) !=
login_to_password_info_.end())
continue;
PasswordInfo password_info;
password_info.fill_data = form_data;
password_info.password_field = password_element;
login_to_password_info_[username_element] = password_info;
FormData form;
FormFieldData field;
FindFormAndFieldForInputElement(
username_element, &form, &field, REQUIRE_NONE);
Send(new AutofillHostMsg_AddPasswordFormMapping(
routing_id(),
field,
form_data));
}
}
////////////////////////////////////////////////////////////////////////////////
// PasswordAutofillAgent, private:
void PasswordAutofillAgent::GetSuggestions(
const PasswordFormFillData& fill_data,
const base::string16& input,
std::vector<base::string16>* suggestions,
std::vector<base::string16>* realms) {
if (StartsWith(fill_data.basic_data.fields[0].value, input, false)) {
suggestions->push_back(fill_data.basic_data.fields[0].value);
realms->push_back(UTF8ToUTF16(fill_data.preferred_realm));
}
for (PasswordFormFillData::LoginCollection::const_iterator iter =
fill_data.additional_logins.begin();
iter != fill_data.additional_logins.end(); ++iter) {
if (StartsWith(iter->first, input, false)) {
suggestions->push_back(iter->first);
realms->push_back(UTF8ToUTF16(iter->second.realm));
}
}
for (PasswordFormFillData::UsernamesCollection::const_iterator iter =
fill_data.other_possible_usernames.begin();
iter != fill_data.other_possible_usernames.end(); ++iter) {
for (size_t i = 0; i < iter->second.size(); ++i) {
if (StartsWith(iter->second[i], input, false)) {
usernames_usage_ = OTHER_POSSIBLE_USERNAME_SHOWN;
suggestions->push_back(iter->second[i]);
realms->push_back(UTF8ToUTF16(iter->first.realm));
}
}
}
}
bool PasswordAutofillAgent::ShowSuggestionPopup(
const PasswordFormFillData& fill_data,
const WebKit::WebInputElement& user_input) {
WebKit::WebFrame* frame = user_input.document().frame();
if (!frame)
return false;
WebKit::WebView* webview = frame->view();
if (!webview)
return false;
std::vector<base::string16> suggestions;
std::vector<base::string16> realms;
GetSuggestions(fill_data, user_input.value(), &suggestions, &realms);
DCHECK_EQ(suggestions.size(), realms.size());
FormData form;
FormFieldData field;
FindFormAndFieldForInputElement(
user_input, &form, &field, REQUIRE_NONE);
WebKit::WebInputElement selected_element = user_input;
gfx::Rect bounding_box(selected_element.boundsInViewportSpace());
float scale = web_view_->pageScaleFactor();
gfx::RectF bounding_box_scaled(bounding_box.x() * scale,
bounding_box.y() * scale,
bounding_box.width() * scale,
bounding_box.height() * scale);
Send(new AutofillHostMsg_ShowPasswordSuggestions(routing_id(),
field,
bounding_box_scaled,
suggestions,
realms));
return !suggestions.empty();
}
bool PasswordAutofillAgent::FillUserNameAndPassword(
WebKit::WebInputElement* username_element,
WebKit::WebInputElement* password_element,
const PasswordFormFillData& fill_data,
bool exact_username_match,
bool set_selection) {
base::string16 current_username = username_element->value();
// username and password will contain the match found if any.
base::string16 username;
base::string16 password;
// Look for any suitable matches to current field text.
if (DoUsernamesMatch(fill_data.basic_data.fields[0].value, current_username,
exact_username_match)) {
username = fill_data.basic_data.fields[0].value;
password = fill_data.basic_data.fields[1].value;
} else {
// Scan additional logins for a match.
PasswordFormFillData::LoginCollection::const_iterator iter;
for (iter = fill_data.additional_logins.begin();
iter != fill_data.additional_logins.end(); ++iter) {
if (DoUsernamesMatch(iter->first, current_username,
exact_username_match)) {
username = iter->first;
password = iter->second.password;
break;
}
}
// Check possible usernames.
if (username.empty() && password.empty()) {
for (PasswordFormFillData::UsernamesCollection::const_iterator iter =
fill_data.other_possible_usernames.begin();
iter != fill_data.other_possible_usernames.end(); ++iter) {
for (size_t i = 0; i < iter->second.size(); ++i) {
if (DoUsernamesMatch(iter->second[i], current_username,
exact_username_match)) {
usernames_usage_ = OTHER_POSSIBLE_USERNAME_SELECTED;
username = iter->second[i];
password = iter->first.password;
break;
}
}
if (!username.empty() && !password.empty())
break;
}
}
}
if (password.empty())
return false; // No match was found.
// Input matches the username, fill in required values.
username_element->setValue(username);
if (set_selection) {
username_element->setSelectionRange(current_username.length(),
username.length());
}
SetElementAutofilled(username_element, true);
if (IsElementEditable(*password_element))
password_element->setValue(password);
SetElementAutofilled(password_element, true);
return true;
}
void PasswordAutofillAgent::PerformInlineAutocomplete(
const WebKit::WebInputElement& username_input,
const WebKit::WebInputElement& password_input,
const PasswordFormFillData& fill_data) {
DCHECK(!fill_data.wait_for_username);
// We need non-const versions of the username and password inputs.
WebKit::WebInputElement username = username_input;
WebKit::WebInputElement password = password_input;
// Don't inline autocomplete if the caret is not at the end.
// TODO(jcivelli): is there a better way to test the caret location?
if (username.selectionStart() != username.selectionEnd() ||
username.selectionEnd() != static_cast<int>(username.value().length())) {
return;
}
// Show the popup with the list of available usernames.
ShowSuggestionPopup(fill_data, username);
#if !defined(OS_ANDROID)
// Fill the user and password field with the most relevant match. Android
// only fills in the fields after the user clicks on the suggestion popup.
FillUserNameAndPassword(&username, &password, fill_data, false, true);
#endif
}
void PasswordAutofillAgent::FrameClosing(const WebKit::WebFrame* frame) {
for (LoginToPasswordInfoMap::iterator iter = login_to_password_info_.begin();
iter != login_to_password_info_.end();) {
if (iter->first.document().frame() == frame)
login_to_password_info_.erase(iter++);
else
++iter;
}
}
bool PasswordAutofillAgent::FindLoginInfo(const WebKit::WebNode& node,
WebKit::WebInputElement* found_input,
PasswordInfo* found_password) {
if (!node.isElementNode())
return false;
WebKit::WebElement element = node.toConst<WebKit::WebElement>();
if (!element.hasTagName("input"))
return false;
WebKit::WebInputElement input = element.to<WebKit::WebInputElement>();
LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input);
if (iter == login_to_password_info_.end())
return false;
*found_input = input;
*found_password = iter->second;
return true;
}
} // namespace autofill
|
[
"[email protected]"
] | |
7a1d8dd42fdc9fdce9c94a9195f0d9e2f24da748
|
0b702dbf2674d5b39dc218378e0e3c0b2a387a32
|
/src/Source/Hospital/HospitalGameModeBase.cpp
|
8976f73cacc8ab21ca46bc996e6087ce560505d4
|
[] |
no_license
|
Rohan-Deshamudre/Drone-navigation
|
ebb73069094d8a73e389e2236c1895947da055b7
|
e688538fead8f5bbf7141604cd1196240e71e505
|
refs/heads/master
| 2022-12-18T19:42:47.679025 | 2020-09-27T13:21:25 | 2020-09-27T13:21:25 | 292,067,554 | 0 | 1 | null | null | null | null |
UTF-8
|
C++
| false | false | 88 |
cpp
|
// Copyright Epic Games, Inc. All Rights Reserved.
#include "HospitalGameModeBase.h"
|
[
"[email protected]"
] | |
2be296f611f2ee2d12fb5847675161436c67f295
|
07b3a26be5f0c7a69b6aa4f5d1f58b376b35109e
|
/inside_rect.cpp
|
9dcd9b8fbd2efc225e12fd1eee0ed951a348c59e
|
[] |
no_license
|
milindl/acpr
|
226c491e52017383e64e8281f5af24c1b3cd471b
|
01c933dc0f0ad2e5322eb5d9b42303cc566d056a
|
refs/heads/master
| 2021-01-10T06:39:55.535914 | 2015-12-07T08:29:24 | 2015-12-07T08:29:24 | 54,714,241 | 2 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 735 |
cpp
|
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <sstream>
using namespace cv;
using namespace std;
bool inside_rect(RotatedRect, Point2f);
int main() {
RotatedRect r1(Point2f(0,0), Size2f(3,4), -55);
Point2f p1(0,0);
Point2f p2(5,5);
cout<<inside_rect(r1,p1)<<endl;
cout<<inside_rect(r1,p2)<<endl;
}
bool inside_rect(RotatedRect r, Point2f p) {
//Check if point lies inside the boundaries of the rectangle.
Point2f temp_array[4];
r.points(temp_array);
vector<Point2f> rect_points(temp_array, temp_array+4);
double result = pointPolygonTest(rect_points, p, false);
return result>0?true:false;
}
|
[
"[email protected]"
] | |
94b2f5fd9d896b7c29727f960eff775f46c741da
|
52507f7928ba44b7266eddf0f1a9bf6fae7322a4
|
/SDK/BP_BackslickMale02_classes.h
|
d9c1d54e9fb3d9584a34ad958f548faff783be66
|
[] |
no_license
|
LuaFan2/mordhau-sdk
|
7268c9c65745b7af511429cfd3bf16aa109bc20c
|
ab10ad70bc80512e51a0319c2f9b5effddd47249
|
refs/heads/master
| 2022-11-30T08:14:30.825803 | 2020-08-13T16:31:27 | 2020-08-13T16:31:27 | 287,329,560 | 1 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 647 |
h
|
#pragma once
// Name: Mordhau, Version: 1.0.0
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
namespace SDK
{
//---------------------------------------------------------------------------
// Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass BP_BackslickMale02.BP_BackslickMale02_C
// 0x0000 (0x0070 - 0x0070)
class UBP_BackslickMale02_C : public UCharacterHair
{
public:
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("BlueprintGeneratedClass BP_BackslickMale02.BP_BackslickMale02_C");
return ptr;
}
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
|
[
"[email protected]"
] | |
a99111a1b2b3fc109de6c42c0120e613d12a6f99
|
c2a3876d2a3d2ab3083c6b5d76179d0ec2c2fa7d
|
/3 курс/AMO/S½ÑF¬á ña«ínº¬¿/ÇîÄ2014-15/èé-23/âapFÑ¡¬«/5/main.cpp
|
72a0d03cc37e455e11f7dd41ad90f1723ae53bf4
|
[] |
no_license
|
IvanHorpynych/Politech
|
d9fd5c419f2be9108c15303feca16b08c225a79d
|
167fdb6d9b278b9cce409e6feb2873b1d2b6b883
|
refs/heads/master
| 2023-04-27T23:58:57.917256 | 2020-06-03T14:41:33 | 2020-06-03T14:41:33 | 268,886,134 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 315 |
cpp
|
#include <iostream>
#include <math.h>
#include "Approx_Legendre.h"
using namespace std;
double f(double x){
return 0.7*x*x*sin(x);
}
int main(){
double a = 2;
double b = 17;
double eps = 10e-2;
cout << "Calculating..." << endl;
AnswerLegendre(f, a, b, eps);
cout << "Ok" << endl;
getchar();
return 0;
}
|
[
"[email protected]"
] | |
a497426acf4bf35c187e1ea0a59bd1e46afd522e
|
c275d7e762e3a440b2df8fb78382a31b1d392d3f
|
/solutions/W5_hash_tables/A_set.cpp
|
0c549019e465c3ec751a91fb7f62addc08287cb4
|
[] |
no_license
|
munraito/made-algo
|
dd333a12f665254612435314198bcbe62da804c3
|
15e7d11644f376d9715647c9bfb986b78dddb98c
|
refs/heads/main
| 2023-02-14T00:57:57.642341 | 2021-01-10T16:22:25 | 2021-01-10T16:22:25 | 322,673,067 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,648 |
cpp
|
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
// prime constants for hashing and memory
const int M = 1049219;
const int P = 1052083;
class Set {
public:
int h(int x) {
int res = (2 * x % P) % M;
if (x < 0) {
return -res;
} else {
return res;
}
}
void insert(int x) {
i = h(x);
while ((arr[i].state != 0) && (arr[i].val != x)) {
i = (i + 1) % M;
}
arr[i].val = x;
arr[i].state = 1; // ok
}
void remove(int x) {
i = h(x);
while (arr[i].state != 0) {
if (arr[i].val == x) {
arr[i].state = 2; // rip
break;
}
i = (i + 1) % M;
}
}
string exists(int x) {
i = h(x);
while (arr[i].state != 0) {
if ((arr[i].val == x) && (arr[i].state != 2)) {
return "true";
}
i = (i + 1) % M;
}
return "false";
}
private:
struct element {
int val;
int state = 0;
};
element arr[M];
int i;
};
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
Set s;
// input
string line;
while (getline(cin, line)) {
istringstream iss(line);
string q[2];
iss >> q[0];
iss >> q[1];
if (q[0] == "insert") {
s.insert(stoi(q[1]));
} else if (q[0] == "delete") {
s.remove(stoi(q[1]));
} else if (q[0] == "exists") {
cout << s.exists(stoi(q[1])) << "\n";
}
}
return 0;
}
|
[
"[email protected]"
] | |
739357e6fa81659c5a6e570f8ff239bcc986e44a
|
d49ef2467d8dd9239376cf65f7ec9470a9e54fd5
|
/optimize/Range_Random.cpp
|
e0f3c869141a9f8d9ab821491e859c21ff5a3f30
|
[] |
no_license
|
Gaofei244617/optimize
|
439e9a297936c55988d582ac395403ccdffc1e52
|
c9a1764cfafd2dfad961ac4965dcb396ded76e05
|
refs/heads/master
| 2020-03-24T08:05:48.930008 | 2019-01-23T14:11:51 | 2019-01-23T14:11:51 | 142,585,281 | 2 | 0 | null | null | null | null |
GB18030
|
C++
| false | false | 619 |
cpp
|
#include "range_random.h"
#include <random>
#include <ctime>
namespace opt
{
// 随机数引擎,用于生成一个随机的unsigned整数
// 该引擎对象重载了()运算符
static std::default_random_engine rand_eng((unsigned int)time(NULL));
// 生成区间[min, max)内的 double 类型的随机数
double random_real(const double min, const double max)
{
return std::uniform_real_distribution<double>(min, max)(rand_eng);
}
// 生成区间[min, max]内的 int 类型的随机数
int random_int(const int min, const int max)
{
return std::uniform_int_distribution<int>(min, max)(rand_eng);
}
}
|
[
"[email protected]"
] | |
edcbc629424ae2c3d7ddd13e28bbf8916978fe56
|
a2e04e4eac1cf93bb4c1d429e266197152536a87
|
/Cpp/SDK/BP_FishingFish_WildSplash_05_Colour_02_Sandy_functions.cpp
|
b40dd267bcedc6604a5959e1f2e61e02c05d503c
|
[] |
no_license
|
zH4x-SDK/zSoT-SDK
|
83a4b9fcdf628637613197cf644b7f4d101bb0cb
|
61af221bee23701a5df5f60091f96f2cf929846e
|
refs/heads/main
| 2023-07-16T18:23:41.914014 | 2021-08-27T15:44:23 | 2021-08-27T15:44:23 | 400,555,804 | 1 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,030 |
cpp
|
// Name: SoT, Version: 2.2.1.1
#include "../pch.h"
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Functions
//---------------------------------------------------------------------------
// Function BP_FishingFish_WildSplash_05_Colour_02_Sandy.BP_FishingFish_WildSplash_05_Colour_02_Sandy_C.UserConstructionScript
// (Event, Public, BlueprintCallable, BlueprintEvent)
void ABP_FishingFish_WildSplash_05_Colour_02_Sandy_C::UserConstructionScript()
{
static UFunction* fn = UObject::FindObject<UFunction>("Function BP_FishingFish_WildSplash_05_Colour_02_Sandy.BP_FishingFish_WildSplash_05_Colour_02_Sandy_C.UserConstructionScript");
ABP_FishingFish_WildSplash_05_Colour_02_Sandy_C_UserConstructionScript_Params params;
auto flags = fn->FunctionFlags;
UObject::ProcessEvent(fn, ¶ms);
fn->FunctionFlags = flags;
}
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
|
[
"[email protected]"
] | |
3c806fd066654a1545721d86dd74583db7a95b10
|
0ffd0c702dd5df0bbb0ce50ed01ee47accef6bfc
|
/AREA 51/codeINO/matriz-led-v2/matriz-led-v2.ino
|
682ecfcb6c2a0da899e9a8a412b72a8210c46ba5
|
[
"MIT"
] |
permissive
|
higo-ricardo/ARDUINO
|
6831e49578bae38594a7fa806eb10e5fdc3f9eb7
|
d0f2b3edf0d17bd5bdc8961925ac2828e5efc257
|
refs/heads/master
| 2023-04-13T11:57:29.475345 | 2021-05-05T03:03:50 | 2021-05-05T03:03:50 | 256,534,220 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,809 |
ino
|
#include <MD_MAX72xx.h> // Numero de modulos utilizados
//Quantidade de Matrizes
#define MAX_DEVICES 4 // Ligacoes ao Arduino
//Portais Digitais
#define DATA_PIN 4
#define CS_PIN 5
#define CLK_PIN 6
//Definação de objetos
MD_MAX72XX mx = MD_MAX72XX(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
// Velocidade do scroll
#define SCROLL_DELAY 120
// Colunas entre cada caracter
#define CHAR_SPACING 1
#define BUF_SIZE 75
char curMessage[BUF_SIZE];
char newMessage[BUF_SIZE];
uint8_t scrollDataSource(uint8_t dev, MD_MAX72XX::transformType_t t )
{
static char *p = curMessage;
static uint8_t state = 0;
static uint8_t curLen, showLen;
static uint8_t cBuf[8];
uint8_t colData;
switch (state)
{
case 0:
showLen = mx.getChar(*p++, sizeof(cBuf)/uf);
curLen = 0;
state++;
if (*p == '\0')
{
p = curMessage;
}
case 1:
colData = cBuf[curLen++];
if (curLen == showLen)
{
showLen = CHAR_SPACING;
curLen = 0;
state = 2;
}
break;
case 2:
colData = 0;
curLen++;
if (curLen == showLen)
{
state = 0;
break;
default:
state = 0;
}
return
(colData);
}
void scrollText(void)
{
static uint32_t prevTime = 0;
if (millis() - prevTime >= SCROLL_DELAY)
{
mx.transform(MD_MAX72XX::TSL);
prevTime = millis();
}
}
void setup()
{
mx.begin();
mx.setShiftDataInCallback(scrollDataSource);
// Define o nivel de luminosidade
mx.control(MD_MAX72XX::INTENSITY, 4);
// Mensagem a ser exibida
strcpy(curMessage, " Arduino e Cia ");
newMessage[0] = '\0';
}
void loop()
{
scrollText();
}
}
|
[
"[email protected]"
] | |
034c14bf4d2ba91308528fb429e87d973ee611e2
|
5d83739af703fb400857cecc69aadaf02e07f8d1
|
/Archive2/68/a653ae84df80f3/main.cpp
|
3aeae06a51192cfc923d03e6c6256504633b23b4
|
[] |
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 | 22 |
cpp
|
1 i\
#!/usr/bin/python
|
[
"francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df"
] |
francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df
|
7fbc9c24c96a864932e8d90cc6bed5ed34e4adee
|
a8f0f67e5c6fca324515553082ff4217e534f4db
|
/Sein/Sein/Direct3D12/direct3d12_shader.h
|
4f32de02b581ddcaaf4a19c95fab4dca99085f7b
|
[] |
no_license
|
kkllPreciel/Sein
|
90f228be5f39e88da92925052109cae9ddaba11a
|
2caabd498145de8ec3145802dd2f1e874988e35e
|
refs/heads/master
| 2021-01-11T22:18:55.140678 | 2018-07-07T14:17:42 | 2018-07-07T14:17:42 | 78,946,017 | 0 | 0 | null | null | null | null |
SHIFT_JIS
|
C++
| false | false | 1,572 |
h
|
/**
* @file shader.h
* @brief シェーダーに関するヘッダファイル
* @author kkllPreciel
* @date 2018/03/20
* @version 1.0
*/
#pragma once
// include
#include <memory>
#include <string>
#include <d3d12.h>
namespace Sein
{
namespace Direct3D12
{
/**
* @brief シェーダー用インターフェイス
*/
class IShader
{
public:
/**
* @brief コンストラクタ
*/
IShader() = default;
/**
* @brief デストラクタ
*/
virtual ~IShader() = default;
/**
* @brief シェーダーを取得する
* @return シェーダー
*/
virtual const D3D12_SHADER_BYTECODE& Get() const = 0;
/**
* @brief シェーダーを開放する
*/
virtual void Release() noexcept = 0;
/**
* @brief コピーコンストラクタ
* @param other:コピー元のインスタンス
*/
IShader(const IShader& other) = delete;
/**
* @brief 代入演算子オペレータ
* @param other:代入元のインスタンス
* @return 代入後のインスタンス
*/
IShader& operator = (const IShader& other) = delete;
/**
* @brief シェーダーを作成する
* @param shader_file_path:シェーダーファイルのパス
* @return シェーダーへのシェアードポインタ
*/
static std::shared_ptr<IShader> Create(const std::string& shader_file_path);
};
};
};
|
[
"[email protected]"
] | |
b9ec3bac09197447528b06f0bbce80a0d30c88f8
|
3ea34c23f90326359c3c64281680a7ee237ff0f2
|
/Data/1852/H
|
069722bbccdab5bccc73c4d7a2e9802a22bb357e
|
[] |
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 | 92,522 |
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source Cstd::filesystem::create_directory();FD |
| \\ / 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/1852";
object H;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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)
(-3.10678914422847e-12,-1.25651417820113e-11,1.63398722622742e-11)
(-3.67835158123643e-12,-2.6614804138643e-11,1.53801305007177e-11)
(-4.05342535947078e-12,-4.64526294699642e-11,1.41065119625207e-11)
(-3.57681704833528e-12,-7.59643225241423e-11,1.20060111402895e-11)
(-2.11006158137084e-12,-1.19121994000353e-10,9.14215023969741e-12)
(2.55599729487235e-14,-1.8675517457346e-10,6.37288738849817e-12)
(1.80524002144524e-12,-2.95955029561159e-10,3.98381520559027e-12)
(3.13846319877094e-12,-4.76908109520524e-10,2.46417457239453e-12)
(3.82559786502654e-12,-7.76432773071707e-10,1.53936676640969e-12)
(2.60786013180323e-12,-1.19480818330818e-09,1.02302290516704e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-5.33965149397479e-12,-1.20358221667343e-11,3.40391418831603e-11)
(-7.64089897753094e-12,-2.58824108662089e-11,3.24415121269261e-11)
(-8.49661289878156e-12,-4.54017518139754e-11,2.99316835035647e-11)
(-7.45020922283713e-12,-7.39259137662804e-11,2.58487849261844e-11)
(-4.56499195988137e-12,-1.16652570549739e-10,2.04928933156697e-11)
(-6.99711119680911e-13,-1.84814245248098e-10,1.4677752130156e-11)
(2.45864862116607e-12,-2.95111301034034e-10,9.20643551748316e-12)
(4.59004224189434e-12,-4.7660961600882e-10,5.27581891114428e-12)
(6.04925398034069e-12,-7.76270666259954e-10,2.87450982701658e-12)
(5.20135788816805e-12,-1.1943756229278e-09,1.55678994865287e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.86810939369015e-12,-1.11732698431383e-11,5.5299841246974e-11)
(-1.10638789222202e-11,-2.43327690400387e-11,5.31749504970294e-11)
(-1.26610006846908e-11,-4.26665567498092e-11,4.9871386890117e-11)
(-1.25509824472293e-11,-6.96182679595361e-11,4.44970197583008e-11)
(-8.94810845790842e-12,-1.1143497746722e-10,3.69156192494539e-11)
(-4.00973107013424e-12,-1.79576587519049e-10,2.81111898055155e-11)
(2.75377316541107e-15,-2.9156369019094e-10,1.95188267832614e-11)
(3.81168922388127e-12,-4.74923096320858e-10,1.29810847549881e-11)
(6.79155182540032e-12,-7.75434060567158e-10,8.33127005597327e-12)
(7.22177970234683e-12,-1.19376737957309e-09,4.31885498915718e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.19326251765578e-12,-9.91012131020932e-12,8.40841202191312e-11)
(-1.37397574250301e-11,-2.188288928672e-11,8.1681288482956e-11)
(-1.59654319519099e-11,-3.83863806507982e-11,7.80178717383224e-11)
(-1.64445887868823e-11,-6.31789492751852e-11,7.23689090535018e-11)
(-1.39499705015822e-11,-1.02964981513613e-10,6.4049165778121e-11)
(-9.69069897605125e-12,-1.70383046352697e-10,5.3370677610032e-11)
(-4.25044251529059e-12,-2.84844666778007e-10,4.1887342045295e-11)
(1.73529990118811e-12,-4.71586333432173e-10,3.14198671843195e-11)
(6.10123503613032e-12,-7.72852085375616e-10,2.1566506501495e-11)
(7.39233195444369e-12,-1.19095558563362e-09,1.12307776138217e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.97039335723131e-12,-8.26770370971432e-12,1.26741566819653e-10)
(-1.56405371549555e-11,-1.86103832456279e-11,1.24692966325195e-10)
(-1.82892090714016e-11,-3.2800211375409e-11,1.20905778324862e-10)
(-1.9105398779766e-11,-5.48114211515224e-11,1.15404979519024e-10)
(-1.79525514256916e-11,-9.13979689356647e-11,1.07567553446832e-10)
(-1.44771493735687e-11,-1.57323798505566e-10,9.71795834744557e-11)
(-7.70821420366004e-12,-2.73621067905103e-10,8.4287547566382e-11)
(-1.08961418743465e-12,-4.63787294850954e-10,6.68437037394114e-11)
(2.9661917239469e-12,-7.64758932698744e-10,4.73298123303758e-11)
(3.88004714640306e-12,-1.1815314098335e-09,2.50898862703333e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-9.58504024966606e-12,-6.49266323882631e-12,1.91827621753719e-10)
(-1.7799620033608e-11,-1.45530818983383e-11,1.90299612174681e-10)
(-2.10509207731345e-11,-2.607673808879e-11,1.87219266427895e-10)
(-2.17819112875703e-11,-4.5243043482093e-11,1.82227994780161e-10)
(-2.06117793265062e-11,-7.85230986625194e-11,1.74894700493701e-10)
(-1.78908130636513e-11,-1.42291877255866e-10,1.64660174184963e-10)
(-1.30613053089697e-11,-2.59017671867385e-10,1.48626646620993e-10)
(-7.54345466078346e-12,-4.47542422008974e-10,1.23648435633416e-10)
(-3.59459894234095e-12,-7.45294248658586e-10,8.98029013621001e-11)
(-2.16994837928218e-12,-1.15919898802719e-09,4.78290615847815e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.75780622908445e-12,-5.16981726440242e-12,2.97355762736524e-10)
(-1.66790067456808e-11,-1.13374714667553e-11,2.96020130496159e-10)
(-2.10733186126462e-11,-1.99374313122844e-11,2.93388185031119e-10)
(-2.26315381861706e-11,-3.58399008620425e-11,2.89312843448794e-10)
(-2.18398444130006e-11,-6.55577053033021e-11,2.82922989023016e-10)
(-2.00645049504861e-11,-1.24438678536809e-10,2.71945359914281e-10)
(-1.89419276777289e-11,-2.36244177931209e-10,2.50172604360995e-10)
(-1.53815747698171e-11,-4.16428425785933e-10,2.1510151361775e-10)
(-1.25287845874747e-11,-7.05647422879155e-10,1.60446849934457e-10)
(-1.1208844995531e-11,-1.11356528595433e-09,8.71883902456252e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.96545686508233e-12,-3.79796892276043e-12,4.73563744096285e-10)
(-1.43772108489724e-11,-8.39532486529065e-12,4.72829280658995e-10)
(-1.98359940376479e-11,-1.50307037900797e-11,4.70651743676906e-10)
(-2.27008253587667e-11,-2.8262424799892e-11,4.66917962291332e-10)
(-2.37897392769258e-11,-5.41480305608726e-11,4.60223136663981e-10)
(-2.32366724844362e-11,-1.05673549918347e-10,4.47097569717006e-10)
(-2.29807719150411e-11,-2.02777484604388e-10,4.19848216662055e-10)
(-2.18181881468807e-11,-3.63305843608849e-10,3.68887645058567e-10)
(-2.02218258359105e-11,-6.33909161223917e-10,2.85072257823897e-10)
(-1.93203653724793e-11,-1.02792637096699e-09,1.61237034844929e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-5.48891473098571e-12,-2.67826701178707e-12,7.69137967296404e-10)
(-1.24076431241121e-11,-5.50469506987381e-12,7.68474563285206e-10)
(-1.7447391486777e-11,-1.02957220405886e-11,7.66345960937458e-10)
(-2.11747737363953e-11,-2.03031950462377e-11,7.62439630878275e-10)
(-2.42964172617227e-11,-4.00061513711999e-11,7.54653914968031e-10)
(-2.54865493445286e-11,-7.87196448039875e-11,7.37778147594117e-10)
(-2.59286852167617e-11,-1.51869632578369e-10,7.02278826653183e-10)
(-2.65559516111093e-11,-2.79979787136823e-10,6.33754551661928e-10)
(-2.56424954568045e-11,-5.10826235604413e-10,5.12146915554549e-10)
(-2.44589111399664e-11,-8.67696123005794e-10,3.07488367084263e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-3.63636278380141e-12,-1.43578173854662e-12,1.18441691368993e-09)
(-9.74983185398503e-12,-2.73153847918953e-12,1.18395330674778e-09)
(-1.56465651211221e-11,-5.17699060672284e-12,1.18202160426112e-09)
(-2.07964590885918e-11,-1.06666953350651e-11,1.17778899007724e-09)
(-2.40398303888214e-11,-2.15805702014417e-11,1.1688480462087e-09)
(-2.57971753023084e-11,-4.25210766654575e-11,1.14938035930836e-09)
(-2.71677277911962e-11,-8.29153630914594e-11,1.10808708064244e-09)
(-2.87199074795939e-11,-1.58565880923035e-10,1.02577136770971e-09)
(-2.82149070519909e-11,-3.06607848680831e-10,8.67360870273211e-10)
(-2.62969937854704e-11,-5.60517954079884e-10,5.60461834754116e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.67636699795247e-12,-2.2715099355633e-11,2.97848379617482e-11)
(-3.13712631547486e-12,-4.9630020010461e-11,2.81621916304469e-11)
(-3.00380219325169e-12,-8.6189734455972e-11,2.54361990817514e-11)
(-2.75136490560672e-12,-1.38668545684892e-10,2.170114805673e-11)
(-1.8102221808275e-12,-2.1568325646851e-10,1.60981306163492e-11)
(4.73702830521536e-13,-3.32674077491153e-10,9.60993944446243e-12)
(2.48115212758279e-12,-5.18454308688573e-10,3.84906497853243e-12)
(3.76477749287674e-12,-8.32742066059046e-10,1.27874254450025e-12)
(4.17983491421563e-12,-1.43309180188813e-09,1.05208279403944e-12)
(3.19832265612453e-12,-2.80814251254065e-09,1.16217454138867e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4.6045740613354e-12,-2.21592762637849e-11,6.18675069581962e-11)
(-6.68071218033673e-12,-4.81530697193609e-11,5.90412292183579e-11)
(-7.14890938555794e-12,-8.37533582880238e-11,5.37318556950339e-11)
(-6.40196341907117e-12,-1.34312438211545e-10,4.6118503242433e-11)
(-3.9674438568917e-12,-2.10270831943578e-10,3.53115899290101e-11)
(-4.66052236072708e-13,-3.28127744052629e-10,2.22840087273202e-11)
(2.84165438431696e-12,-5.16850879928198e-10,9.90081055260513e-12)
(5.30483163826309e-12,-8.33418320189882e-10,3.64062120026895e-12)
(6.53036816629331e-12,-1.43390410259089e-09,1.83566863406213e-12)
(6.14990448238417e-12,-2.80805280883638e-09,1.20379168087695e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.00636717667386e-12,-2.08035837940869e-11,1.00620091452068e-10)
(-1.02101950686217e-11,-4.4710172820268e-11,9.67907713138423e-11)
(-1.15668096518688e-11,-7.79060751214818e-11,8.99822945183298e-11)
(-1.14089006227314e-11,-1.25108428215378e-10,7.94392168621903e-11)
(-8.61367496762977e-12,-1.98413009940017e-10,6.37623095855797e-11)
(-4.61090921423793e-12,-3.16887362529036e-10,4.3836397108338e-11)
(-1.78527611478155e-13,-5.11727123082921e-10,2.38913803451022e-11)
(5.12474103409654e-12,-8.3378063350986e-10,1.39013398239854e-11)
(8.2219917004106e-12,-1.43533469535408e-09,9.35138918417454e-12)
(8.72884075183999e-12,-2.80904765686593e-09,5.13979428456289e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.43284838197629e-12,-1.84025633657832e-11,1.53519684307463e-10)
(-1.33488467214913e-11,-3.94668147766549e-11,1.49071423081332e-10)
(-1.59026385424868e-11,-6.88075823797561e-11,1.41597742504532e-10)
(-1.64923736351606e-11,-1.11002100839495e-10,1.29782271602124e-10)
(-1.48384949114475e-11,-1.78984249156238e-10,1.11671365479026e-10)
(-1.12666112584301e-11,-2.96219880834849e-10,8.73901752174107e-11)
(-5.00656652723683e-12,-5.00292190398151e-10,6.1420228622581e-11)
(3.78962200285653e-12,-8.32304522881658e-10,4.52585740042042e-11)
(8.34381124737081e-12,-1.43472444866219e-09,3.21330127126734e-11)
(9.19893376893712e-12,-2.807017040593e-09,1.71631325871336e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.69683333366145e-12,-1.49172916547201e-11,2.29928592934499e-10)
(-1.59106505019137e-11,-3.26458341357694e-11,2.25973566392443e-10)
(-1.95118835521839e-11,-5.72277731001553e-11,2.18693184124638e-10)
(-2.08363503770051e-11,-9.28108491923702e-11,2.07158306017591e-10)
(-2.04394517264525e-11,-1.52306901625767e-10,1.90633353687901e-10)
(-1.66170347152069e-11,-2.64038121850554e-10,1.70349621508745e-10)
(-4.8677664144033e-12,-4.74792355457126e-10,1.51468538126999e-10)
(2.1794043798195e-12,-8.23304344459803e-10,1.16589941721413e-10)
(5.74143374380895e-12,-1.42489651913044e-09,8.13679104600425e-11)
(6.63751161006761e-12,-2.7938759877239e-09,4.271349975653e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-9.37987664505136e-12,-1.11683652130598e-11,3.42568100902293e-10)
(-1.79348847184061e-11,-2.50045982844243e-11,3.39867029838887e-10)
(-2.21989559019103e-11,-4.43130187682565e-11,3.34070700291424e-10)
(-2.3851759621154e-11,-7.32087974929478e-11,3.24404928809804e-10)
(-2.33426463769724e-11,-1.24669059792943e-10,3.10964794300758e-10)
(-1.9710484218772e-11,-2.32092347829715e-10,2.93356006191035e-10)
(-1.08565882575153e-11,-4.52558511697227e-10,2.68972503887799e-10)
(-4.81191661248869e-12,-7.98958748112561e-10,2.22447194951954e-10)
(-1.26758494458463e-12,-1.39323667003937e-09,1.59498828438136e-10)
(2.54111327613115e-14,-2.75633050867732e-09,8.40377662308557e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.79402233036293e-12,-7.93404102268201e-12,5.20625459038854e-10)
(-1.69892078821043e-11,-1.82135475767047e-11,5.18680113100487e-10)
(-2.19047045525253e-11,-3.2542032278647e-11,5.14408189355626e-10)
(-2.38191598225475e-11,-5.5390558102916e-11,5.07937378115814e-10)
(-2.22718900466735e-11,-9.89818740480489e-11,4.99462887978008e-10)
(-1.7056878015637e-11,-1.95447503701518e-10,4.84627049919642e-10)
(-1.73375302612574e-11,-4.13093600944592e-10,4.43830912734229e-10)
(-1.38494932637746e-11,-7.44617220387629e-10,3.87105640348595e-10)
(-1.10085865541822e-11,-1.32334514960598e-09,2.85241289607044e-10)
(-9.65936973661118e-12,-2.67618150377648e-09,1.53505308047268e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.3506953387659e-12,-4.94005871339299e-12,8.24735504770164e-10)
(-1.50903036622996e-11,-1.23205601764135e-11,8.24092161580858e-10)
(-2.08371944015618e-11,-2.39060894910502e-11,8.21280536774813e-10)
(-2.39652294850705e-11,-4.40342946500336e-11,8.16236232591155e-10)
(-2.48060515196494e-11,-8.46167669124838e-11,8.0822288615361e-10)
(-2.29412245438179e-11,-1.74058369049136e-10,7.91166943412063e-10)
(-2.29280523375484e-11,-3.58192682172692e-10,7.47571839609936e-10)
(-2.13288573844053e-11,-6.45541789269608e-10,6.55606555298342e-10)
(-1.94695284762865e-11,-1.19402283624961e-09,5.04392803960865e-10)
(-1.83135784893433e-11,-2.52469961317301e-09,2.8648975628651e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.06799599302803e-12,-3.05110016310224e-12,1.41648780769816e-09)
(-1.30521973670473e-11,-7.71805074854554e-12,1.41599847104112e-09)
(-1.86597928614581e-11,-1.65222348898455e-11,1.41347932900347e-09)
(-2.30255575373199e-11,-3.26782696629234e-11,1.40782265541031e-09)
(-2.58462310575532e-11,-6.53616600072802e-11,1.39686412021432e-09)
(-2.61857965421458e-11,-1.33740408228351e-10,1.37133264567388e-09)
(-2.63586797124133e-11,-2.66252813448701e-10,1.31248366967559e-09)
(-2.63622217175272e-11,-4.94853005238467e-10,1.19207226609358e-09)
(-2.52023339101256e-11,-9.76797802654221e-10,9.78597264990423e-10)
(-2.41487129814882e-11,-2.23914127975074e-09,6.11167231032842e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4.60853758019303e-12,-1.68335222249093e-12,2.78671290030466e-09)
(-1.05496678465174e-11,-4.01487483794944e-12,2.78615065119068e-09)
(-1.65909415439707e-11,-8.61140490900965e-12,2.78349490675182e-09)
(-2.25222105551127e-11,-1.75509474230498e-11,2.77677459674298e-09)
(-2.6152713689935e-11,-3.60119761708065e-11,2.76285594912195e-09)
(-2.70249733018516e-11,-7.30472920311452e-11,2.73095006357007e-09)
(-2.77673779499411e-11,-1.44474132239328e-10,2.6608686593045e-09)
(-2.88752909660813e-11,-2.8130032097065e-10,2.5181688199489e-09)
(-2.79237202137257e-11,-6.0962037450789e-10,2.23723688294991e-09)
(-2.63531131111427e-11,-1.62781525519055e-09,1.62732405651894e-09)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.60954375852311e-12,-3.1060293984288e-11,3.91594122783743e-11)
(-1.88808405812676e-12,-6.8144970599242e-11,3.74182346015577e-11)
(-1.70512733555289e-12,-1.1710551447858e-10,3.36894020847443e-11)
(-1.50445493844593e-12,-1.83381512605308e-10,2.77999830515565e-11)
(-7.34455534113245e-13,-2.76742975037322e-10,1.88403333552084e-11)
(1.68824385814656e-12,-4.12955920750507e-10,7.88188127527935e-12)
(3.44804580080381e-12,-6.11919873503016e-10,-1.73603084123598e-12)
(4.66769137412029e-12,-9.0012880930261e-10,-4.66715127078895e-12)
(4.88204386973672e-12,-1.31091145147603e-09,-3.11184781469199e-12)
(4.27079349309089e-12,-1.81168162326546e-09,-9.08896190872983e-13)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-3.13398879143249e-12,-2.98105515380736e-11,8.15564837909372e-11)
(-4.81423555676166e-12,-6.48676199240382e-11,7.81516780151945e-11)
(-5.38284010060796e-12,-1.11620513591832e-10,7.06488398632169e-11)
(-4.79906010079011e-12,-1.75263938561644e-10,5.8696564288226e-11)
(-2.79768465888792e-12,-2.67379119194606e-10,4.08692734629043e-11)
(6.76764415066304e-13,-4.05234202623319e-10,1.78536106104104e-11)
(3.97808689029193e-12,-6.10872682069614e-10,-4.25107731558099e-12)
(7.4720975257793e-12,-9.03764266921524e-10,-1.00390190298432e-11)
(8.59283788257867e-12,-1.31460648213219e-09,-6.88847685970722e-12)
(8.34854419296724e-12,-1.81375255196027e-09,-2.78126211866584e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4.57806746871232e-12,-2.71683189859964e-11,1.332167084599e-10)
(-8.64507631569052e-12,-5.8552697237211e-11,1.28300425247711e-10)
(-1.01222247368706e-11,-1.00961513257126e-10,1.1815864971072e-10)
(-9.83832072256592e-12,-1.59108585164683e-10,1.01054153148492e-10)
(-8.1165232741696e-12,-2.46665551275781e-10,7.42989756565352e-11)
(-5.3333741452554e-12,-3.86294048198555e-10,3.64901508547876e-11)
(-1.62341977422726e-12,-6.08519356115403e-10,-5.2704965327381e-12)
(8.19858104477709e-12,-9.12130643607723e-10,-1.06611567927189e-11)
(1.1823339909059e-11,-1.32269970911887e-09,-4.10050144415708e-12)
(1.18380187627636e-11,-1.81922131627475e-09,-1.05681701689525e-13)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.46985886761095e-12,-2.32892728814646e-11,2.02267211513008e-10)
(-1.26961467843553e-11,-4.97849670394831e-11,1.96168892609819e-10)
(-1.56669769202975e-11,-8.5535226428944e-11,1.84535853536083e-10)
(-1.65727191599241e-11,-1.34579469268637e-10,1.64613101274417e-10)
(-1.72346521795229e-11,-2.11070241070966e-10,1.32656672937746e-10)
(-1.74784236485544e-11,-3.46643975871376e-10,8.38506971771844e-11)
(-1.43447468496548e-11,-6.00689525416873e-10,1.89035961143619e-11)
(7.91500487296953e-12,-9.27530648174358e-10,1.67730781724366e-11)
(1.34857618414533e-11,-1.333818983102e-09,2.02253869905612e-11)
(1.32210134863446e-11,-1.82411528073804e-09,1.37853134664655e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.49073323357478e-12,-1.78604252109881e-11,2.961896735279e-10)
(-1.62715040844609e-11,-3.89571373629165e-11,2.90719878208803e-10)
(-2.08917597783345e-11,-6.65301500480731e-11,2.79770932145747e-10)
(-2.39134497465221e-11,-1.03074166728531e-10,2.6110171231863e-10)
(-2.7793561379188e-11,-1.60067105552562e-10,2.3350881084118e-10)
(-2.96817253552053e-11,-2.70187502209115e-10,2.00970713816087e-10)
(7.77698623035877e-12,-5.33071170522907e-10,2.07732834533278e-10)
(1.30558392940068e-11,-9.43228897564224e-10,1.34070851060241e-10)
(1.27359953578144e-11,-1.33839913525395e-09,9.10809514717547e-11)
(1.18055323195295e-11,-1.81748587562156e-09,4.81554112398647e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-9.91312977140664e-12,-1.24416924443759e-11,4.26328257596862e-10)
(-1.89296058789664e-11,-2.80479243978235e-11,4.22593125759454e-10)
(-2.4304170910153e-11,-4.72616715846527e-11,4.14134788512516e-10)
(-2.82298645009354e-11,-7.15656751590604e-11,4.00320274901126e-10)
(-3.14210440130578e-11,-1.11949266002688e-10,3.81718723467995e-10)
(-3.19718260436769e-11,-2.12330089968021e-10,3.58837742258428e-10)
(-3.79619007380926e-12,-5.36759446860194e-10,3.54373655070917e-10)
(3.79492217561421e-12,-9.30964934193278e-10,2.80612687310981e-10)
(4.3019568300491e-12,-1.30863944887272e-09,1.95765343941105e-10)
(3.91417246184996e-12,-1.77648046386368e-09,1.01393924291929e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-9.84265870076248e-12,-8.27169714931692e-12,6.14032160752498e-10)
(-1.8610271538177e-11,-1.89547770282544e-11,6.11519292897055e-10)
(-2.40698361000778e-11,-3.13244064120185e-11,6.06193094834121e-10)
(-2.67009331376395e-11,-4.5555806351575e-11,6.00363347719052e-10)
(-2.18011591235339e-11,-6.71289153600088e-11,5.99063917630938e-10)
(2.35012451710809e-12,-1.28782549554949e-10,6.03861339714007e-10)
(-1.55131766473907e-11,-4.91145821962762e-10,5.2194270541716e-10)
(-1.10605736407109e-11,-8.68964687091144e-10,5.00754082804986e-10)
(-8.59491835038612e-12,-1.22401429817927e-09,3.48187069073817e-10)
(-7.63595229229249e-12,-1.68005674046819e-09,1.79301336232151e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.59631069933975e-12,-5.19518202221106e-12,8.88446700287481e-10)
(-1.68811882840629e-11,-1.24054047645935e-11,8.87464157552531e-10)
(-2.31767448199683e-11,-2.22469478955943e-11,8.84678090442832e-10)
(-2.73079080332361e-11,-3.69325192821065e-11,8.82109384518603e-10)
(-2.70052156840641e-11,-6.90888921861511e-11,8.82719604500206e-10)
(-1.96640815622187e-11,-1.64908730480772e-10,8.8569058441357e-10)
(-2.29026367499991e-11,-4.46594501296406e-10,8.615498194467e-10)
(-2.08038900792198e-11,-7.1824659990461e-10,7.32800184234733e-10)
(-1.87915143968798e-11,-1.05762252279934e-09,5.33968946174683e-10)
(-1.73821556245254e-11,-1.50255635324665e-09,2.87922994325892e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.94640727663097e-12,-3.37235815045521e-12,1.28809561536905e-09)
(-1.42362312401911e-11,-7.90616765010524e-12,1.28754349284502e-09)
(-2.09139492485629e-11,-1.60080798884499e-11,1.28560193357971e-09)
(-2.7194344581011e-11,-3.0411681039558e-11,1.28174816005051e-09)
(-2.9664440353288e-11,-6.29658410113389e-11,1.27468950201746e-09)
(-2.80299367412644e-11,-1.43319436345321e-10,1.25654711277957e-09)
(-2.77259573400083e-11,-3.13006093062441e-10,1.20036186876275e-09)
(-2.64399048832383e-11,-5.18697912171011e-10,1.05379355750272e-09)
(-2.49497280981001e-11,-8.11608071701512e-10,8.14837242275037e-10)
(-2.43075065089611e-11,-1.21496204421968e-09,4.67686333960785e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-5.72964068934811e-12,-1.83398829694524e-12,1.78201587529224e-09)
(-1.19087982459018e-11,-4.21817623685895e-12,1.78127747864609e-09)
(-1.84820364437199e-11,-8.812991398808e-12,1.77900954955356e-09)
(-2.61545103575634e-11,-1.75754353126888e-11,1.77322049742415e-09)
(-3.02588043084517e-11,-3.74140523842985e-11,1.76028626064041e-09)
(-2.99908610678774e-11,-8.09103698346539e-11,1.72823419516623e-09)
(-2.95416708332996e-11,-1.62825954577682e-10,1.65216484910929e-09)
(-2.92436749389444e-11,-2.7918176670614e-10,1.49199298233779e-09)
(-2.76312682901056e-11,-4.64582255754516e-10,1.21282234927998e-09)
(-2.6844311782109e-11,-7.47363381088139e-10,7.47751883539563e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.11810852790606e-12,-3.57762830853006e-11,4.50227435534285e-11)
(-1.43660221654015e-12,-7.8485952507224e-11,4.30392275094688e-11)
(-1.30070918909765e-12,-1.33226813386587e-10,3.82932986058494e-11)
(-6.62379285750991e-13,-2.04313765842424e-10,3.02456026883624e-11)
(8.60140703099269e-13,-3.00788806516626e-10,1.78146535694217e-11)
(3.58443784748908e-12,-4.35706414850145e-10,2.03040466737572e-12)
(5.33197479695334e-12,-6.16475614029284e-10,-1.22972653055874e-11)
(6.74784553692624e-12,-8.41248408590314e-10,-1.47423991943778e-11)
(6.37412290201702e-12,-1.09498822496074e-09,-9.85352443697998e-12)
(5.43282599699892e-12,-1.31101316414807e-09,-4.32201557580775e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.37141556776258e-12,-3.39991304829949e-11,9.47050934170986e-11)
(-3.62632009160043e-12,-7.41025753569172e-11,9.03617845745428e-11)
(-4.08956486034785e-12,-1.25696986826269e-10,8.05633777480081e-11)
(-3.12712267238581e-12,-1.93169632972914e-10,6.41476532520276e-11)
(-4.95589725241741e-13,-2.8707477597911e-10,3.84513405078354e-11)
(3.84129791631221e-12,-4.23786856481415e-10,2.23625593919291e-12)
(7.41270265032521e-12,-6.17298759045731e-10,-3.672389934263e-11)
(1.26879320418938e-11,-8.49044320824353e-10,-3.80715616226931e-11)
(1.25788501282507e-11,-1.10242732402117e-09,-2.32336030810331e-11)
(1.10360463887053e-11,-1.3162430143405e-09,-9.69928053390469e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-3.54083036106005e-12,-3.05087925129251e-11,1.53241468088192e-10)
(-7.2710309764438e-12,-6.57438035398177e-11,1.46809122175897e-10)
(-8.44401500282425e-12,-1.11008709758041e-10,1.33080292250397e-10)
(-7.61225912663931e-12,-1.69978397509363e-10,1.09133075323744e-10)
(-5.90300867723536e-12,-2.5504469200354e-10,6.93740687206008e-11)
(-3.22279908500802e-12,-3.92225486389971e-10,2.79129359167083e-12)
(-4.06259021264451e-12,-6.27221141317257e-10,-9.7333500289914e-11)
(1.70379302627054e-11,-8.73189753450598e-10,-7.58810257507389e-11)
(1.89477941496178e-11,-1.12120475902654e-09,-3.59322878203177e-11)
(1.66263015247587e-11,-1.32878478209678e-09,-1.19683169193765e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-5.80038763485976e-12,-2.52432027702442e-11,2.28496921599323e-10)
(-1.18909373871815e-11,-5.42013788840673e-11,2.20625063462832e-10)
(-1.47493010395072e-11,-8.9723645524611e-11,2.04519512501385e-10)
(-1.61215933633825e-11,-1.34080629852392e-10,1.76444245918865e-10)
(-1.94318119373611e-11,-1.96960607140763e-10,1.27522755902511e-10)
(-2.89877962479993e-11,-3.13672095120945e-10,2.78312111824912e-11)
(-7.98325838016554e-11,-6.84737875714144e-10,-2.50573656821983e-10)
(2.01609454445643e-11,-9.40091755625726e-10,-1.06244726370132e-10)
(2.45059875175797e-11,-1.15676634351796e-09,-2.60573791913939e-11)
(2.03769218361318e-11,-1.34631678497626e-09,-1.28617878032018e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.43967068109106e-12,-1.84800435247691e-11,3.25886420001859e-10)
(-1.6231770986492e-11,-4.04746208612807e-11,3.18650062764902e-10)
(-2.14910184146536e-11,-6.48420804302955e-11,3.03574635553633e-10)
(-2.78290398385533e-11,-9.00616497737623e-11,2.77190708508536e-10)
(-4.33733039039381e-11,-1.12339106947167e-10,2.3269667699091e-10)
(-9.43012583135378e-11,-1.03782908198599e-10,1.51848019526857e-10)
(8.51272460407072e-11,-1.29844572311929e-09,-2.22444373722154e-17)
(4.37817755114987e-11,-1.10400191763063e-09,9.28093187840808e-11)
(2.59018492084674e-11,-1.20317679181258e-09,6.89227202100079e-11)
(1.89555318018213e-11,-1.35558433229932e-09,3.98752546351186e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.03479932290279e-11,-1.20649975371662e-11,4.52129184224791e-10)
(-1.95644160016052e-11,-2.69337058895733e-11,4.46996101314273e-10)
(-2.64269224713687e-11,-4.03707699437751e-11,4.35624142539264e-10)
(-3.56381818753123e-11,-4.72580683659074e-11,4.16655071421706e-10)
(-5.33604134461966e-11,-3.76636739197106e-11,3.86390780915175e-10)
(-1.11055279269265e-10,6.19866978418804e-12,3.17971445172511e-10)
(2.43511527887e-11,-1.30612776037106e-09,-2.81788557336542e-16)
(2.66420184434153e-11,-1.12722271744688e-09,2.76657260960417e-10)
(1.40482257857936e-11,-1.1883717204047e-09,1.94588324371467e-10)
(8.8843733580418e-12,-1.32064114647494e-09,1.0066885169585e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.04063059723739e-11,-7.62019696001943e-12,6.17903165868396e-10)
(-1.98334457389343e-11,-1.62793490799618e-11,6.14741639624474e-10)
(-2.73175475014165e-11,-2.08268745622542e-11,6.08650630358351e-10)
(-3.40247901189874e-11,-1.08177275426471e-11,6.04425432547708e-10)
(-2.46386043805693e-11,5.20427948349301e-11,6.22377383757611e-10)
(1.20394939739826e-10,3.59218394369452e-10,7.68381261941872e-10)
(-3.88758747014068e-11,-1.55843414882945e-09,1.69327017459824e-09)
(-9.21164709616385e-12,-1.10415961639399e-09,7.30755170725948e-10)
(-6.10096088871121e-12,-1.10603749283024e-09,3.92941588185456e-10)
(-5.83500328156936e-12,-1.22295323483873e-09,1.84158718152607e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-9.43659183612112e-12,-4.65310439939472e-12,8.26652284325434e-10)
(-1.85943582888802e-11,-9.51274931786354e-12,8.25435518866562e-10)
(-2.68469069028462e-11,-1.24445947016558e-11,8.2333097953621e-10)
(-3.44389662575356e-11,-8.98537841675684e-12,8.24751665438362e-10)
(-3.60992467720958e-11,2.78820473634659e-12,8.43217237527767e-10)
(-1.71126107310237e-11,-2.56214619603506e-11,9.15115690010719e-10)
(-2.7741409771813e-11,-6.34795063650145e-10,1.07955332308516e-09)
(-2.15213397528273e-11,-7.72411530227346e-10,7.90338422040536e-10)
(-1.87600136457596e-11,-8.97409098767057e-10,5.15695214731545e-10)
(-1.70534703258744e-11,-1.03852122215073e-09,2.6001242637511e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.93265460623078e-12,-3.18945800491117e-12,1.06785179324738e-09)
(-1.59826633880924e-11,-6.08811972495617e-12,1.06729666080094e-09)
(-2.42552642089069e-11,-9.99834998092086e-12,1.06632318992294e-09)
(-3.2971932274921e-11,-1.53750359253267e-11,1.06588823395712e-09)
(-3.707383974248e-11,-3.22415656428957e-11,1.06859342546557e-09)
(-3.4253759235169e-11,-1.03684615801855e-10,1.07686890135209e-09)
(-3.13377845647826e-11,-3.40976455094768e-10,1.06383834739289e-09)
(-2.69997351203064e-11,-4.96339165032593e-10,8.88894134743886e-10)
(-2.48246357309068e-11,-6.4029723660476e-10,6.4321075452871e-10)
(-2.4219835679749e-11,-7.77443777917881e-10,3.45163071203888e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.82523234014516e-12,-1.90356054074163e-12,1.27748938993976e-09)
(-1.3859045390234e-11,-3.55114674158644e-12,1.27654742688383e-09)
(-2.15059757131089e-11,-6.43350048766666e-12,1.27469233266748e-09)
(-3.0795708886511e-11,-1.20003988776449e-11,1.27142843701471e-09)
(-3.56207912185747e-11,-2.74842910083831e-11,1.26377081616588e-09)
(-3.48318848455083e-11,-6.98599284412779e-11,1.24244270688129e-09)
(-3.21957586396618e-11,-1.61492484375432e-10,1.17979530049573e-09)
(-2.92548085871023e-11,-2.49125326872199e-10,1.02133576846285e-09)
(-2.71430583043508e-11,-3.41525684646564e-10,7.73454552044366e-10)
(-2.64558093306038e-11,-4.32020093728538e-10,4.32308227470063e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-9.11745086243841e-13,-3.88929483179104e-11,4.87514211716534e-11)
(-1.07405046321627e-12,-8.36117270153552e-11,4.66924136780405e-11)
(-7.82839831934415e-13,-1.38652593630198e-10,4.13297292874899e-11)
(6.24436963690824e-13,-2.08635558445502e-10,3.17830952870699e-11)
(2.93035906762451e-12,-3.00500569062311e-10,1.71344844738308e-11)
(5.99254945173753e-12,-4.2216123592288e-10,-2.43456259338317e-12)
(8.60025370216675e-12,-5.75942597483363e-10,-2.19852851446543e-11)
(9.65488301356964e-12,-7.46903312041336e-10,-2.4382207412537e-11)
(8.28171310127529e-12,-9.10002437072209e-10,-1.61700073720268e-11)
(6.34066061367891e-12,-1.02059691957249e-09,-7.31986506914011e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.51844469524138e-12,-3.67309772301961e-11,1.02002703539956e-10)
(-2.1866850821829e-12,-7.84242660478303e-11,9.71364856336968e-11)
(-2.36211743258375e-12,-1.29719674401296e-10,8.62670569854824e-11)
(-6.22045391776741e-13,-1.94964275170028e-10,6.72165075195196e-11)
(3.68941086787668e-12,-2.81995981983655e-10,3.6349101385154e-11)
(1.1240083106701e-11,-4.03790012990554e-10,-1.06017385968115e-11)
(1.86827472019414e-11,-5.75827521014358e-10,-7.08016232648669e-11)
(2.19954061263761e-11,-7.56373112413507e-10,-6.82865867250418e-11)
(1.78219625865491e-11,-9.19024445798116e-10,-3.9988181110135e-11)
(1.38785336111091e-11,-1.02761924293726e-09,-1.65559883780766e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.37407419147372e-12,-3.23607351297685e-11,1.63369638718211e-10)
(-5.08462570666794e-12,-6.85121028462726e-11,1.56064990345121e-10)
(-5.7818623095904e-12,-1.12109317282826e-10,1.40575210490131e-10)
(-3.75102018052389e-12,-1.66208430682549e-10,1.13190103046407e-10)
(2.59568158889649e-12,-2.37801337008383e-10,6.61250050323081e-11)
(1.83486035275969e-11,-3.4760788812757e-10,-2.02311010207631e-11)
(3.20016696451497e-11,-5.87589285238413e-10,-2.16482416985563e-10)
(4.39911945073811e-11,-7.89621232338718e-10,-1.66358227747615e-10)
(3.05454077400464e-11,-9.43938335870305e-10,-7.43167118979826e-11)
(2.21899874849708e-11,-1.0445350867084e-09,-2.52485589759295e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4.6916887438527e-12,-2.61469710920992e-11,2.38661642749395e-10)
(-9.51214444850848e-12,-5.51927774215175e-11,2.29892997854282e-10)
(-1.15555995512863e-11,-8.72437442732217e-11,2.11493728972208e-10)
(-1.12190834256472e-11,-1.22386287706252e-10,1.80265209249491e-10)
(-4.36176741093975e-12,-1.55987264061776e-10,1.2968947756496e-10)
(3.95278848340776e-11,-1.57918332541885e-10,5.48077207546791e-11)
(3.89546333151638e-10,-6.73551870559537e-10,8.43433898006973e-17)
(1.03883760270768e-10,-8.94924044996835e-10,-3.92767919438651e-10)
(4.61452354010551e-11,-9.96414277719375e-10,-9.98953130336816e-11)
(2.83582903786325e-11,-1.07033170143794e-09,-2.16159873648518e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.61835943174018e-12,-1.89486218314688e-11,3.30814782912141e-10)
(-1.46972587469387e-11,-3.98106332394664e-11,3.22523384920501e-10)
(-1.95784018560796e-11,-5.98103633679702e-11,3.04340397277693e-10)
(-2.61385897287885e-11,-7.67946064245275e-11,2.73181304246346e-10)
(-3.7200079467335e-11,-8.50503459767998e-11,2.2052825447572e-10)
(-5.24347945249693e-11,-7.73254382770813e-11,1.32121340941159e-10)
(-5.77360429661339e-17,3.49054702282984e-16,-1.41293488185708e-17)
(9.08891739018187e-11,-1.205260665858e-09,2.8704474735159e-17)
(4.01442433754636e-11,-1.07682783310159e-09,2.31274288744178e-11)
(2.38876006126533e-11,-1.09088143189811e-09,2.3760223259804e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-9.65971089565947e-12,-1.23618939649449e-11,4.43058534460632e-10)
(-1.8846814036195e-11,-2.49785023165229e-11,4.36855034159461e-10)
(-2.7001746735353e-11,-3.36615368529596e-11,4.22136446349096e-10)
(-4.18142321920152e-11,-3.23729276383541e-11,3.95976879945305e-10)
(-7.46475464581878e-11,-1.22692563179429e-11,3.47583544687799e-10)
(-1.46103276893379e-10,2.66928316581128e-11,2.42971963812798e-10)
(-1.5018812679751e-18,2.64177888866477e-16,-2.58558598875805e-17)
(8.56478539793817e-11,-1.17894469487298e-09,-1.28662036643943e-16)
(2.56334708870134e-11,-1.06440771693803e-09,1.32660093164193e-10)
(1.18653134175778e-11,-1.06103546506115e-09,8.34569579640171e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.02118722890939e-11,-7.95229437604616e-12,5.79170644192728e-10)
(-2.05090362348747e-11,-1.36343678904947e-11,5.74953474024617e-10)
(-3.14746295513772e-11,-1.26392160475404e-11,5.65830286896173e-10)
(-5.38090904548066e-11,6.18342463186625e-12,5.52060979146937e-10)
(-1.21387892466237e-10,6.66420136836361e-11,5.29043672179499e-10)
(-4.19654116586833e-10,1.97999625166754e-10,4.54980352517792e-10)
(4.39917100787941e-17,3.63334777892827e-16,-4.48476958448359e-16)
(-3.14615072235588e-12,-1.25440090786931e-09,7.89816204681146e-10)
(-5.9464849189955e-12,-9.98063849864792e-10,3.81510005601744e-10)
(-6.1082978170299e-12,-9.7014096233567e-10,1.70390993875692e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-9.68347277181445e-12,-4.6295891023902e-12,7.31564955152808e-10)
(-1.99144485513674e-11,-6.50817997256862e-12,7.29630687837901e-10)
(-3.07138375257875e-11,-2.43208612940186e-12,7.26245828314341e-10)
(-4.65148808383223e-11,2.02172259681236e-11,7.25333753503376e-10)
(-7.29679288758378e-11,9.9531664075943e-11,7.41697302196221e-10)
(-1.03487089963941e-10,3.86530773581246e-10,8.33843027412898e-10)
(-3.23451172824941e-11,-7.8981626197544e-10,1.27736855828955e-09)
(-2.29504976386745e-11,-7.83820930489088e-10,7.94933834355205e-10)
(-2.01890874516077e-11,-7.69640809728582e-10,4.73242311599262e-10)
(-1.81184881835101e-11,-7.92766546698207e-10,2.26452198135246e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.6634196239525e-12,-2.987023901888e-12,8.80584941486031e-10)
(-1.75461654935064e-11,-3.91599102011657e-12,8.79363492500457e-10)
(-2.73851577362824e-11,-2.88902523492466e-12,8.7778659960601e-10)
(-3.90517608310988e-11,2.95310060240898e-12,8.7765083667467e-10)
(-5.01065902635054e-11,1.17372117252515e-11,8.8472352977181e-10)
(-5.50478926365641e-11,-1.21308965803066e-11,9.1144645209153e-10)
(-3.58775426351066e-11,-3.37597558256241e-10,9.54910484122632e-10)
(-2.85301930655095e-11,-4.55211611851769e-10,7.59981661570884e-10)
(-2.55485043642585e-11,-5.17672778461207e-10,5.20361083238565e-10)
(-2.4480448665175e-11,-5.62976210410332e-10,2.66589352372539e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.78682982495503e-12,-1.90851956652819e-12,9.85801956599828e-10)
(-1.55550979154714e-11,-2.5335648252241e-12,9.84092674369254e-10)
(-2.46755805480019e-11,-2.95317674487353e-12,9.81859902679069e-10)
(-3.51384869153259e-11,-3.98794006782502e-12,9.7932626297255e-10)
(-4.17769729423761e-11,-1.18171962390009e-11,9.75411798461953e-10)
(-4.20444069012251e-11,-4.52788501829336e-11,9.64486974936481e-10)
(-3.52287109822097e-11,-1.46481023130218e-10,9.2192889216105e-10)
(-3.04989190408174e-11,-2.15064129471719e-10,7.74474443617351e-10)
(-2.75224183765867e-11,-2.62821717335512e-10,5.58714026384905e-10)
(-2.6167675589122e-11,-2.95759735118905e-10,2.95860030417755e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.01470868033547e-12,-3.82022704266431e-11,4.98717167163241e-11)
(-8.98827040194156e-13,-8.34485706635519e-11,4.81375251124527e-11)
(-1.69125060408785e-13,-1.37936951512412e-10,4.31477203172321e-11)
(1.60176450144731e-12,-2.03758376439212e-10,3.37728235006327e-11)
(3.99481905618967e-12,-2.86596297069018e-10,1.93053530380542e-11)
(7.17204907065837e-12,-3.91697024887701e-10,-9.48079565490232e-13)
(1.08820995011014e-11,-5.19540207578124e-10,-2.16524420079527e-11)
(1.0912483345148e-11,-6.51215157811658e-10,-2.47641553691151e-11)
(8.45357952436236e-12,-7.63963699680054e-10,-1.64342671548737e-11)
(6.04311890934901e-12,-8.30442592365569e-10,-7.57837028687243e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.02246888939323e-12,-3.6476771565124e-11,1.04838026713352e-10)
(-1.22941963554505e-12,-7.85015923715118e-11,1.00370205266036e-10)
(-9.21925085076128e-13,-1.28567045741898e-10,8.98400696256572e-11)
(1.48951625509169e-12,-1.88896535450018e-10,7.06877202231091e-11)
(6.4456058745766e-12,-2.65848335600763e-10,3.99804113129216e-11)
(1.52578429117481e-11,-3.69918566830819e-10,-7.64654863687114e-12)
(2.79294748861474e-11,-5.14603451423721e-10,-6.96365368254603e-11)
(2.6945120436713e-11,-6.57168685950378e-10,-6.95108524520215e-11)
(1.93036599265872e-11,-7.70710833203183e-10,-4.10785493208708e-11)
(1.42383890042276e-11,-8.36485791721927e-10,-1.72703240591314e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.28318985604894e-12,-3.22045523982969e-11,1.6616562570738e-10)
(-2.91417127642456e-12,-6.83007946991241e-11,1.59167610304684e-10)
(-3.26232787548164e-12,-1.09742476615518e-10,1.43816788762339e-10)
(-5.08065142714703e-13,-1.58353586184762e-10,1.1636238061632e-10)
(7.13771469531293e-12,-2.18334188203974e-10,7.00659188167556e-11)
(2.49103639067233e-11,-3.06545857730609e-10,-1.44630582385365e-11)
(6.78400657283325e-11,-5.11118782763078e-10,-2.05864552964461e-10)
(5.72524913157841e-11,-6.80320290144276e-10,-1.68029812541899e-10)
(3.39531966670562e-11,-7.9027829612532e-10,-7.72561041292275e-11)
(2.27380432383984e-11,-8.50658061198871e-10,-2.68891992100404e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-3.12139310935282e-12,-2.59520311894041e-11,2.38160733155161e-10)
(-6.49501974848554e-12,-5.46935431948127e-11,2.29678910987285e-10)
(-7.76046073378926e-12,-8.43944141884752e-11,2.11297641982861e-10)
(-6.23503302284524e-12,-1.14139939029044e-10,1.80154482598418e-10)
(-4.16928685627984e-13,-1.35719251180682e-10,1.31657324185187e-10)
(1.37426269805587e-11,-1.15302488561899e-10,6.3579022480169e-11)
(1.08762117319441e-10,-5.47739014545148e-10,4.78986648070268e-17)
(1.21347774726971e-10,-7.60967883075655e-10,-3.82075621587598e-10)
(4.82794651144716e-11,-8.32808343816499e-10,-1.0437167267953e-10)
(2.72920334739913e-11,-8.71688907338047e-10,-2.45383516415242e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-5.91368930664728e-12,-1.90662181954916e-11,3.22111963753407e-10)
(-1.13464020270579e-11,-3.94599340441807e-11,3.13923678064818e-10)
(-1.45681353397674e-11,-5.7479871430837e-11,2.95141845184288e-10)
(-1.79072187443108e-11,-7.12113685552864e-11,2.63012865199003e-10)
(-2.15742555916557e-11,-7.54288558133707e-11,2.09912630000382e-10)
(-2.43317093896673e-11,-6.65899361297703e-11,1.24417136825862e-10)
(-1.5693053103356e-17,1.76025367524045e-16,-1.32424695164369e-17)
(4.1445802746849e-11,-1.01820458020297e-09,3.33172189524593e-17)
(2.7091332826542e-11,-8.9836471395138e-10,1.48479705986153e-11)
(1.78018570355047e-11,-8.86865226086517e-10,1.82961256844846e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.86581018336703e-12,-1.29855959375604e-11,4.1852878401217e-10)
(-1.54723606518939e-11,-2.50603088468481e-11,4.12070989681119e-10)
(-2.18645011369301e-11,-3.23255787502713e-11,3.95943682239945e-10)
(-3.19772492048056e-11,-3.00169947177107e-11,3.66870160553708e-10)
(-4.89472355847546e-11,-1.22194291169567e-11,3.13323487585445e-10)
(-7.44380807333604e-11,1.7430175115701e-11,2.0702221118453e-10)
(2.14740646203692e-18,1.04161799631325e-16,-2.19605435289596e-17)
(2.84438451494906e-11,-9.74175277680096e-10,-9.49230001888304e-17)
(8.49273901394245e-12,-8.80218867067737e-10,1.11647997187953e-10)
(4.42776865608643e-12,-8.57084926194101e-10,7.1383981789541e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-9.31740739467343e-12,-8.61429612695839e-12,5.2887388768993e-10)
(-1.85120370243257e-11,-1.36889135787255e-11,5.23925886031407e-10)
(-2.79124517202633e-11,-1.18825062087233e-11,5.12655642459232e-10)
(-4.48255848236239e-11,6.49089589605003e-12,4.93084216374683e-10)
(-8.02142231968589e-11,5.70101534972846e-11,4.55650576122569e-10)
(-1.53204464006601e-10,1.49706463985722e-10,3.56712404040379e-10)
(1.61438241030151e-17,1.67525578952588e-16,-2.24930646644661e-16)
(-6.54199290232099e-11,-1.03449036655771e-09,6.70542843350141e-10)
(-2.3250513329146e-11,-8.20472986042422e-10,3.28403863944669e-10)
(-1.30917195787968e-11,-7.75825498095172e-10,1.46885861822752e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-9.39177065740575e-12,-5.11036399132671e-12,6.40992026669325e-10)
(-1.91217779802785e-11,-6.30159226793372e-12,6.38129289238781e-10)
(-2.93448236092976e-11,-6.48919811155502e-13,6.32854672518112e-10)
(-4.56143041654309e-11,2.54174430850457e-11,6.27350566731611e-10)
(-7.73192017418298e-11,1.10223338347747e-10,6.33341535852336e-10)
(-1.48350950678985e-10,3.9615843828997e-10,7.02927380902359e-10)
(-2.12909706735675e-12,-6.70542893517194e-10,1.09192554615344e-09)
(-2.98682935200693e-11,-6.59796168156126e-10,6.7983117810034e-10)
(-2.53670052549156e-11,-6.27998200520601e-10,4.01479965008034e-10)
(-2.14566263361796e-11,-6.23325082318151e-10,1.89996316850921e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.52047497367075e-12,-3.12349219878895e-12,7.38377103043935e-10)
(-1.7351698793939e-11,-3.69947447276012e-12,7.3638038033652e-10)
(-2.71852432950929e-11,-1.00498606758309e-12,7.33297057653594e-10)
(-3.91834132579983e-11,8.64933622941532e-12,7.30343412090092e-10)
(-5.32751046189617e-11,2.47204632120428e-11,7.33240698104843e-10)
(-6.53639710650634e-11,1.45456756633752e-11,7.5417627224865e-10)
(-3.20652552093649e-11,-2.83571983064434e-10,7.94247629400724e-10)
(-2.90570971132444e-11,-3.8024653285601e-10,6.26086099453544e-10)
(-2.66278346239251e-11,-4.14643379333755e-10,4.20834806367697e-10)
(-2.51075715839986e-11,-4.31784634737207e-10,2.11547513773334e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.98606716091006e-12,-1.83562403165231e-12,7.99847596182363e-10)
(-1.58558910505101e-11,-2.31846121266862e-12,7.97607178673176e-10)
(-2.50951175863555e-11,-1.80687921943031e-12,7.94321446455343e-10)
(-3.52119624725539e-11,-6.83917348211441e-13,7.8967460662144e-10)
(-4.26693456559041e-11,-4.41080852942866e-12,7.8398317415596e-10)
(-4.47651743087296e-11,-3.10969063999357e-11,7.73590278363566e-10)
(-3.42552855687286e-11,-1.2220574631667e-10,7.37307949215384e-10)
(-2.98026312800899e-11,-1.77133903842841e-10,6.10856566499799e-10)
(-2.74901397449475e-11,-2.06232882047249e-10,4.30661785250267e-10)
(-2.60673802902997e-11,-2.2104067170881e-10,2.22632242807541e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.00601593791841e-12,-3.80288415189822e-11,5.04250959870053e-11)
(-8.56000537043045e-13,-8.19637929474331e-11,4.82473025751783e-11)
(-1.64134014325172e-13,-1.33077582748969e-10,4.34191635219722e-11)
(1.20739397482085e-12,-1.93484888257326e-10,3.51815376045868e-11)
(3.50029019147992e-12,-2.68276890417986e-10,2.27530006962875e-11)
(6.09795345623946e-12,-3.58988956832936e-10,5.88415830057996e-12)
(9.05705670784037e-12,-4.64983300040098e-10,-1.1150679633041e-11)
(8.53612326964752e-12,-5.68728850992175e-10,-1.52376523145987e-11)
(6.3448161795216e-12,-6.52259139954702e-10,-1.03556615601455e-11)
(4.50794797886693e-12,-6.98384485885118e-10,-4.62080799901187e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.26866608903313e-13,-3.65391830607504e-11,1.04200829448253e-10)
(-9.00081667574461e-13,-7.77210968318524e-11,9.99563928877439e-11)
(-5.94144808883186e-13,-1.24835807956322e-10,9.03941809881729e-11)
(1.65387590002549e-12,-1.80147308465319e-10,7.35874708292447e-11)
(6.55841842756526e-12,-2.49441942112354e-10,4.74238691727639e-11)
(1.38751220001027e-11,-3.38431411623545e-10,8.8600974174416e-12)
(2.4319121852067e-11,-4.55500191782884e-10,-3.91034777314302e-11)
(2.16644214994555e-11,-5.69296469630503e-10,-4.3518134860666e-11)
(1.50628975869839e-11,-6.55292662849066e-10,-2.60821990015912e-11)
(1.11403344218953e-11,-7.01522863829404e-10,-1.08219893047821e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-5.37695662252198e-13,-3.26999277355772e-11,1.62868077024031e-10)
(-1.17060123839465e-12,-6.85353974395089e-11,1.56747493979967e-10)
(-1.15598215649508e-12,-1.07748279907249e-10,1.43130734544291e-10)
(1.57474950112608e-12,-1.52648766962549e-10,1.19293715592709e-10)
(9.05175472734443e-12,-2.07548627794864e-10,8.08384745607738e-11)
(2.50684894638994e-11,-2.8176240032418e-10,1.56621487230391e-11)
(6.66255570878618e-11,-4.32234268467718e-10,-1.19590149680656e-10)
(4.71263758344954e-11,-5.72974883011502e-10,-1.04113043896673e-10)
(2.61163394391307e-11,-6.62774068178025e-10,-4.77130147939426e-11)
(1.68796901675373e-11,-7.0774834620094e-10,-1.59343289398251e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.52538393539066e-12,-2.6847569690816e-11,2.29781963561032e-10)
(-3.34735989467904e-12,-5.59806435139275e-11,2.22416398041654e-10)
(-3.53184410702031e-12,-8.50327136858743e-11,2.06344438417938e-10)
(-6.66445083337253e-13,-1.14091934503646e-10,1.79646491571444e-10)
(7.37097765205659e-12,-1.37896902857523e-10,1.39366243720427e-10)
(2.86090491299138e-11,-1.2610558642798e-10,8.82987798068285e-11)
(-5.69014037648124e-11,-3.73755319115641e-10,8.14172463032214e-11)
(1.00880522946214e-10,-5.90529629716908e-10,-2.2600999371795e-10)
(3.40025142113533e-11,-6.77856704429776e-10,-5.68103201292093e-11)
(1.79300005809119e-11,-7.14678752212178e-10,-1.05409901027326e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-3.80602587602792e-12,-2.02785449071472e-11,3.06172166365639e-10)
(-6.96419434383622e-12,-4.19750822095755e-11,2.99016899027213e-10)
(-7.59344803503582e-12,-6.12905749168172e-11,2.82604271676851e-10)
(-6.00135738326668e-12,-7.67369540926214e-11,2.54686856612789e-10)
(7.11810886449617e-13,-8.55857386916456e-11,2.09385396770375e-10)
(1.60653294332097e-11,-8.91121122896481e-11,1.36411110701432e-10)
(9.61082632046847e-18,1.78433212527081e-16,-4.8266125000636e-17)
(-1.74314370574146e-11,-6.51004114408035e-10,6.88086499109374e-11)
(5.49733085708578e-12,-6.95092920281573e-10,4.03466781402952e-11)
(6.31768282765734e-12,-7.12378200479344e-10,2.511044740646e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-5.77931566293654e-12,-1.4394484650666e-11,3.90176666159107e-10)
(-1.07164484788263e-11,-2.86906014277569e-11,3.8426162107426e-10)
(-1.32340519922673e-11,-3.87978390030869e-11,3.69615239201697e-10)
(-1.49384668502655e-11,-4.09535532565807e-11,3.43607750455729e-10)
(-1.18755417980947e-11,-3.23604173363686e-11,2.97188917150767e-10)
(3.0786354168644e-13,-1.31654690958274e-11,2.06665490292153e-10)
(1.17460838006439e-17,1.19718513762477e-16,-6.46583457176529e-17)
(-2.28891580838478e-11,-6.13217224707285e-10,1.21408038100574e-10)
(-1.09891266129001e-11,-6.66911795066334e-10,1.21859203255369e-10)
(-5.44767765332033e-12,-6.78104098261715e-10,6.7608399853991e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.87333787181973e-12,-9.94378126977762e-12,4.80635644441978e-10)
(-1.4629114762937e-11,-1.77282205095313e-11,4.75445951744938e-10)
(-1.95746120332647e-11,-2.00289599908793e-11,4.64177611767897e-10)
(-2.6318491760529e-11,-9.79449846884987e-12,4.44575198766701e-10)
(-3.44892359651081e-11,2.10158704408166e-11,4.08530268952836e-10)
(-4.29438093398392e-11,8.0122564442136e-11,3.19522219633338e-10)
(8.90580797622466e-18,1.4964720217578e-16,-2.0515398790818e-16)
(-9.79751480193046e-11,-5.94272887164684e-10,4.4632968544391e-10)
(-3.4207296729124e-11,-6.05729625071966e-10,2.57225917531566e-10)
(-1.87062735330819e-11,-6.05562528830337e-10,1.21108072304344e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-8.51590501940106e-12,-6.43857789701322e-12,5.66513036492221e-10)
(-1.64492790547868e-11,-1.03962499007405e-11,5.62649000480543e-10)
(-2.348465156635e-11,-8.68029092247944e-12,5.55533661731646e-10)
(-3.48371664305588e-11,7.29217643506705e-12,5.45622370587965e-10)
(-6.1402171656136e-11,5.88539602645488e-11,5.37299162679835e-10)
(-1.55736353303483e-10,2.27418453790699e-10,5.46952428008839e-10)
(2.29943605330043e-11,-3.97615316389653e-10,6.42952791508315e-10)
(-3.10667157278941e-11,-4.59518358858774e-10,4.91825455770534e-10)
(-2.72381782846829e-11,-4.78368469952771e-10,3.14854483091305e-10)
(-2.30007570662757e-11,-4.85428097461579e-10,1.53316189492631e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.81162043339339e-12,-4.18570544272859e-12,6.36814036190517e-10)
(-1.5649389371091e-11,-6.97535485178019e-12,6.33654920257807e-10)
(-2.34297045797606e-11,-6.2758515575351e-12,6.27702576270117e-10)
(-3.27474456951368e-11,-8.0599797912864e-13,6.19785905839243e-10)
(-4.5079407021276e-11,7.01952636793379e-12,6.12347986617891e-10)
(-5.97927461538323e-11,-7.38241864480344e-12,6.08275413086533e-10)
(-2.5269962009996e-11,-2.05403231593492e-10,5.99187497719082e-10)
(-2.69184330405724e-11,-2.87906410414419e-10,4.8730036723582e-10)
(-2.57510393160693e-11,-3.21310829467031e-10,3.33303710126022e-10)
(-2.43040208390326e-11,-3.34883680149354e-10,1.68254397026144e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.5812736833754e-12,-2.19475268663783e-12,6.78482143767978e-10)
(-1.4888620045346e-11,-3.7781532206887e-12,6.75216688854913e-10)
(-2.22551569718821e-11,-4.1156679493247e-12,6.69096533196897e-10)
(-3.02044473552855e-11,-4.18866375267045e-12,6.59824156791147e-10)
(-3.66872583929389e-11,-8.25828504930287e-12,6.47273296002812e-10)
(-3.95797515604833e-11,-3.00139004821036e-11,6.27690645260549e-10)
(-3.00096491698136e-11,-9.58291505402241e-11,5.84724535681008e-10)
(-2.67417538733967e-11,-1.3827559667553e-10,4.82756736293663e-10)
(-2.56934793494889e-11,-1.60238055037259e-10,3.39243151007632e-10)
(-2.44758091915782e-11,-1.70138416729565e-10,1.74338469929148e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-3.17880984272023e-13,-3.91298448123054e-11,4.99874216907136e-11)
(-2.70557599472223e-13,-8.04155833118081e-11,4.77761632205873e-11)
(-1.68282889543662e-13,-1.28869187214691e-10,4.37325934424224e-11)
(2.9835109109869e-13,-1.86190736885698e-10,3.703387053253e-11)
(1.53418428154828e-12,-2.55228226647012e-10,2.70632725804262e-11)
(2.57524618046692e-12,-3.352910835977e-10,1.42971464599122e-11)
(3.66092113215766e-12,-4.2332944673946e-10,1.7139765553898e-12)
(4.22175115356016e-12,-5.06348195735211e-10,-3.45612222875535e-12)
(3.6434855127143e-12,-5.72073801683967e-10,-2.97350579966809e-12)
(3.02551792413675e-12,-6.08058483808524e-10,-1.29813348666168e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4.21685373551072e-13,-3.72463102908311e-11,1.02451828367027e-10)
(-5.23569160334335e-13,-7.67898087313261e-11,9.88068362886266e-11)
(-8.74962699060031e-13,-1.22363979376017e-10,9.10958489584252e-11)
(3.1893605374233e-13,-1.75715096025766e-10,7.75403859894973e-11)
(3.22887586541174e-12,-2.41084170163911e-10,5.68833398231874e-11)
(5.16968584959427e-12,-3.20563550521026e-10,2.89940415661673e-11)
(5.46785566615299e-12,-4.15405571093095e-10,-1.26663264287042e-12)
(7.90689902137342e-12,-5.0422749169568e-10,-1.00240748075585e-11)
(7.28409321917459e-12,-5.71663112022012e-10,-6.47519897530841e-12)
(6.54382748867538e-12,-6.07299632031001e-10,-2.58943454157959e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.6947066293933e-13,-3.39003967199688e-11,1.59089985424382e-10)
(-1.08595728306241e-13,-6.95593335688087e-11,1.53951280399295e-10)
(-3.45294262627093e-14,-1.09035576235812e-10,1.42713549474167e-10)
(1.47315807418525e-12,-1.54412650025104e-10,1.23505796237617e-10)
(4.57635562770111e-12,-2.10952836899555e-10,9.38133113066128e-11)
(4.66397397137924e-12,-2.86082963465257e-10,4.87423053439179e-11)
(-7.33049804818619e-12,-4.01140014758652e-10,-1.54492294470767e-11)
(8.28109343715018e-12,-5.01431413827924e-10,-2.14175597884672e-11)
(9.42028983675903e-12,-5.70599013006021e-10,-8.41236205070864e-12)
(7.87576723892449e-12,-6.05861550293635e-10,-1.31945197830273e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.28843199692162e-13,-2.91816002573177e-11,2.22716393761834e-10)
(-1.28096157532743e-12,-5.90211534560092e-11,2.16117804146676e-10)
(-5.76036029567977e-13,-9.03354714626621e-11,2.02810886929567e-10)
(2.25882235664094e-12,-1.24217238238102e-10,1.81135947680628e-10)
(6.1272773997902e-12,-1.63044610352476e-10,1.47858121488584e-10)
(-1.50289150481122e-12,-2.1673657009876e-10,9.27941889459276e-11)
(-1.23229661292442e-10,-3.95713325617357e-10,-4.34434278858569e-11)
(-7.84466595137462e-12,-5.05253254538539e-10,-1.94358228039549e-11)
(4.96940003664419e-12,-5.70158498515581e-10,5.61729063927292e-12)
(5.08845874531218e-12,-6.01768907149954e-10,8.73100295984397e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.53481879407828e-12,-2.31440029401426e-11,2.93692404446114e-10)
(-3.83604777531111e-12,-4.65891930381308e-11,2.8708119593448e-10)
(-2.16876888470608e-12,-6.94068098279965e-11,2.73614729881008e-10)
(3.51670162310484e-12,-9.06651926533255e-11,2.52085249051921e-10)
(2.04607756001259e-11,-1.05061503482123e-10,2.22010203794575e-10)
(7.65298452069619e-11,-7.94734686146586e-11,1.91916227258411e-10)
(-6.88086298515375e-11,-5.14148050243165e-10,2.18513587673424e-10)
(-2.6756354987563e-11,-5.27870615294134e-10,1.11516993530317e-10)
(-7.44756362443926e-12,-5.65580600851457e-10,6.8593937096604e-11)
(-2.8459719834886e-12,-5.87288115418681e-10,3.56333579401449e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4.31497395901984e-12,-1.76337720939057e-11,3.69846838211237e-10)
(-7.0324475244593e-12,-3.48945225310049e-11,3.63933945186259e-10)
(-5.99544225850176e-12,-4.96327944245895e-11,3.51228357263916e-10)
(3.21311666969838e-13,-6.04896385223171e-11,3.3140312437164e-10)
(2.52715972833275e-11,-6.41465934000558e-11,3.05013877040902e-10)
(1.13685384954246e-10,-4.39209666740693e-11,2.82121952253853e-10)
(-1.21408120941524e-10,-4.53872405455858e-10,3.1172006591472e-10)
(-4.22846607812526e-11,-4.95668283972461e-10,2.03379422836103e-10)
(-1.79204932058172e-11,-5.31899033947436e-10,1.34299129135729e-10)
(-1.03808472306895e-11,-5.49392171516043e-10,6.77595052213955e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.18884854754477e-12,-1.31925807519752e-11,4.46595647919391e-10)
(-1.06927453947475e-11,-2.46579005617706e-11,4.40739284567475e-10)
(-1.1320868100435e-11,-3.27386602003449e-11,4.29696623643375e-10)
(-7.36023685058325e-12,-3.52171771380886e-11,4.13746944709728e-10)
(1.66807235306769e-11,-2.74812678650935e-11,3.95938866457952e-10)
(1.29282726098931e-10,1.68214718333554e-11,3.97320264663318e-10)
(-4.87144156552194e-11,-4.39991582968015e-10,5.54167153464566e-10)
(-4.36259084129067e-11,-4.47752985424193e-10,3.43825575977649e-10)
(-2.54506066210885e-11,-4.70515073562023e-10,2.11599145111151e-10)
(-1.77326325975334e-11,-4.82637012582965e-10,1.0258531969507e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.90474146199339e-12,-9.237892298538e-12,5.15292864607864e-10)
(-1.27548353549033e-11,-1.6863037326664e-11,5.10451509456033e-10)
(-1.59777997875651e-11,-2.11770911341046e-11,5.01610312057282e-10)
(-1.8415784108265e-11,-2.14003405559293e-11,4.89270432806005e-10)
(-1.92210030885167e-11,-1.8965555028034e-11,4.76295955079477e-10)
(-1.69358443674678e-11,-3.42049712976639e-11,4.71251089033795e-10)
(-1.80903885253344e-11,-2.630941240924e-10,4.84320348272719e-10)
(-2.57076914930242e-11,-3.38768187227073e-10,3.77407831355123e-10)
(-2.2757525171731e-11,-3.71058756321681e-10,2.51272529425782e-10)
(-2.02289848858524e-11,-3.8441923378879e-10,1.25138305904018e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.64345725674717e-12,-6.40794893679639e-12,5.70599707421068e-10)
(-1.28942470144905e-11,-1.19101581560271e-11,5.65910829046847e-10)
(-1.76732177570926e-11,-1.48293654236758e-11,5.56772020367813e-10)
(-2.19268607002504e-11,-1.73185875862096e-11,5.44218407079153e-10)
(-2.5729022072688e-11,-2.56120437917048e-11,5.28637120650374e-10)
(-2.80733489491198e-11,-5.84644194249293e-11,5.09283532272235e-10)
(-2.29569125799561e-11,-1.61134365818121e-10,4.76032021556282e-10)
(-2.25525896696563e-11,-2.21883650012751e-10,3.87053166815193e-10)
(-2.17745006459714e-11,-2.52056746067907e-10,2.68151877043127e-10)
(-2.07948872326715e-11,-2.64957413247263e-10,1.36438532143944e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-6.51057145694846e-12,-3.51132979512493e-12,6.01856242794463e-10)
(-1.25466176080179e-11,-6.33655489850652e-12,5.96720244671443e-10)
(-1.7098448515457e-11,-8.07059567496569e-12,5.87181889689078e-10)
(-2.18422503196208e-11,-1.07421740435772e-11,5.73618958491299e-10)
(-2.53628926999794e-11,-1.83105255928601e-11,5.54356982209177e-10)
(-2.66275424630505e-11,-3.8622694123563e-11,5.25947944947879e-10)
(-2.38710003226945e-11,-7.94117540930528e-11,4.77086437057026e-10)
(-2.15037652628979e-11,-1.09648022060167e-10,3.90186950751502e-10)
(-2.10268533082781e-11,-1.26757410539671e-10,2.74020302124293e-10)
(-2.02757559919991e-11,-1.34498257941335e-10,1.4051204130455e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(9.84296440004071e-15,-4.06737050424176e-11,5.02832622232316e-11)
(1.47237598214551e-13,-8.17329789472323e-11,4.83947296950399e-11)
(2.52321816640666e-14,-1.29641027403176e-10,4.51123655295394e-11)
(-2.06691816722009e-13,-1.8432747073891e-10,3.9369337917605e-11)
(1.56253918945561e-13,-2.47322193308739e-10,3.10169182329225e-11)
(4.30883008353006e-13,-3.19201453270394e-10,2.11919942760173e-11)
(9.07144269940081e-13,-3.95309770826701e-10,1.12939920801268e-11)
(1.6184306848939e-12,-4.65229352367776e-10,5.31773234828354e-12)
(1.55742353776589e-12,-5.1925770742383e-10,2.59032066166446e-12)
(9.68532659982306e-13,-5.48268085551675e-10,1.2580579959483e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.22606866018661e-13,-3.87760067773376e-11,1.02222360789473e-10)
(-4.30569926706453e-14,-7.84505364804052e-11,9.90799268876973e-11)
(-6.47902870332597e-13,-1.23986631924413e-10,9.27197294742074e-11)
(-3.26463780587536e-13,-1.75954725602572e-10,8.12441841296311e-11)
(9.86840858065413e-13,-2.37153272375021e-10,6.46055419580061e-11)
(9.49773002841411e-13,-3.08961716023671e-10,4.45752360332916e-11)
(-4.02585035577664e-14,-3.88794103730956e-10,2.41604689108638e-11)
(1.56194532135139e-12,-4.61601748336101e-10,1.26989737539386e-11)
(2.33422976945119e-12,-5.16840554970486e-10,7.54787162842311e-12)
(2.51631120975513e-12,-5.45649139398088e-10,3.49307713825996e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(1.50437899494871e-13,-3.54594852426658e-11,1.56913288118361e-10)
(5.9095508402243e-13,-7.18685049640854e-11,1.52801201099659e-10)
(4.73119037148045e-13,-1.12588420782243e-10,1.43658279589244e-10)
(9.70231218176553e-13,-1.59176536460314e-10,1.2780184601685e-10)
(1.73913504330798e-12,-2.16269143495275e-10,1.05167464590684e-10)
(-4.90884604086718e-13,-2.87735495160548e-10,7.53328588408634e-11)
(-6.78885684820421e-12,-3.76974692198289e-10,4.13996271282585e-11)
(-9.02263589922982e-13,-4.55072344146561e-10,2.45376426361366e-11)
(1.88686527390654e-12,-5.10960891569945e-10,1.67208267538011e-11)
(2.46367211693527e-12,-5.39859103105457e-10,8.74126122505637e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.67850901730614e-13,-3.11188438490267e-11,2.1836708127384e-10)
(-4.06004776091085e-13,-6.24165966904324e-11,2.12909479099126e-10)
(1.70241584738013e-13,-9.65566466930745e-11,2.01966775263878e-10)
(1.98460296391838e-12,-1.35903728264831e-10,1.84025053365524e-10)
(3.2081030720594e-12,-1.8518557290882e-10,1.58751288613799e-10)
(-2.52837615714443e-12,-2.53594780349898e-10,1.23553478749621e-10)
(-2.88025417485352e-11,-3.6408935528779e-10,7.62477947648499e-11)
(-1.02804186390321e-11,-4.46952230203123e-10,5.38490829140019e-11)
(-2.72220994808737e-12,-5.00926850693285e-10,3.86155294453059e-11)
(-6.6133002609444e-13,-5.28761542911317e-10,2.08059571586186e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.43384112868526e-12,-2.56947821949179e-11,2.86577438210262e-10)
(-2.06425222896842e-12,-5.17626972205543e-11,2.80651339076517e-10)
(-4.13303459012382e-13,-7.86857056725973e-11,2.68901336534309e-10)
(3.41619274942653e-12,-1.09578366559522e-10,2.50959495779554e-10)
(9.63984205422609e-12,-1.48132381997741e-10,2.27321095483385e-10)
(1.43799828514016e-11,-2.0759896669383e-10,2.00551310224654e-10)
(-2.20876804957632e-11,-3.62974895885871e-10,1.75988961020275e-10)
(-1.60356298754856e-11,-4.37178828694872e-10,1.25807717615991e-10)
(-8.16855137190245e-12,-4.83145305645898e-10,8.28730881396088e-11)
(-5.10855794599376e-12,-5.07008924103158e-10,4.21000375816589e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.84327227594583e-12,-2.04086283442057e-11,3.57815442577783e-10)
(-4.56348157135053e-12,-4.11124798642045e-11,3.52023780329473e-10)
(-3.06434359047402e-12,-6.12776639833097e-11,3.39971819374053e-10)
(1.43809761348936e-12,-8.4339546256508e-11,3.22635554208412e-10)
(1.14981965354171e-11,-1.15125695056464e-10,3.01118937767253e-10)
(2.33448327859632e-11,-1.70843295296039e-10,2.79579382439178e-10)
(-2.69483003507208e-11,-3.27915665922167e-10,2.60627482579787e-10)
(-2.1119665629223e-11,-4.03277483212848e-10,1.97459169788568e-10)
(-1.27648296768777e-11,-4.45900440401704e-10,1.32062117114408e-10)
(-9.37650094232446e-12,-4.66987753131757e-10,6.65559168603139e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4.28717364910671e-12,-1.57589662255299e-11,4.27031173503761e-10)
(-7.4449477057394e-12,-3.09816596274505e-11,4.20730001520438e-10)
(-6.9327582330417e-12,-4.52911155107315e-11,4.08834285566559e-10)
(-3.36899518097855e-12,-6.17239485776609e-11,3.92718093777323e-10)
(6.78361248828687e-12,-8.52832825083453e-11,3.74263225288924e-10)
(2.346228042869e-11,-1.32469188019685e-10,3.59660323944759e-10)
(-1.52702970438596e-11,-2.84418056907247e-10,3.55966474864731e-10)
(-2.03842757434955e-11,-3.50543684989054e-10,2.71324138225921e-10)
(-1.58930984453468e-11,-3.86973133121537e-10,1.80396169865844e-10)
(-1.33650916966561e-11,-4.04875370984774e-10,9.0165668335847e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4.89332967188175e-12,-1.1497525606296e-11,4.86109807315591e-10)
(-8.86651712680676e-12,-2.25813223966713e-11,4.7999997867628e-10)
(-9.9856462467e-12,-3.24664032363926e-11,4.68842948177209e-10)
(-9.52305935145984e-12,-4.46915585359615e-11,4.53719464534586e-10)
(-7.52964827916314e-12,-6.49632939967827e-11,4.3527364237487e-10)
(-5.7456554790405e-12,-1.08518706286787e-10,4.14320493304718e-10)
(-1.31376298821043e-11,-2.0944076960275e-10,3.84749590564482e-10)
(-1.64569267779902e-11,-2.71604512795409e-10,3.07335725590284e-10)
(-1.56253119037386e-11,-3.05199367955502e-10,2.10474724110935e-10)
(-1.45524995233653e-11,-3.21262948658663e-10,1.06684706609384e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4.85119802420301e-12,-7.83294901231316e-12,5.32263578741196e-10)
(-9.32904159296465e-12,-1.58226360797494e-11,5.26300153830751e-10)
(-1.18783742171379e-11,-2.23752124806247e-11,5.14389347087663e-10)
(-1.29219878140958e-11,-3.14436677083424e-11,4.98095720978128e-10)
(-1.36769518934347e-11,-4.81467061167322e-11,4.76848187035942e-10)
(-1.46635635345492e-11,-8.1513202606908e-11,4.47661591671416e-10)
(-1.57006695638835e-11,-1.3911913696122e-10,4.02046109407169e-10)
(-1.58869278501834e-11,-1.8333850846459e-10,3.24811604242962e-10)
(-1.53604912750038e-11,-2.09048791869601e-10,2.2621299414898e-10)
(-1.48155103946521e-11,-2.21661363897124e-10,1.16095175436535e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-4.88590312905409e-12,-4.07632491775906e-12,5.57654870887543e-10)
(-9.34481752415915e-12,-8.26965567820334e-12,5.51642043404305e-10)
(-1.16061129926436e-11,-1.16605599648404e-11,5.39254964110405e-10)
(-1.33224480810743e-11,-1.67906589564695e-11,5.22012627394122e-10)
(-1.52643810315402e-11,-2.62054766646527e-11,4.98101377934801e-10)
(-1.63887286957578e-11,-4.37091118673848e-11,4.63854716100969e-10)
(-1.63832681102293e-11,-6.99457668196581e-11,4.11529582328468e-10)
(-1.49851386958527e-11,-9.23090404378237e-11,3.33078138406569e-10)
(-1.42760030282157e-11,-1.06103896089145e-10,2.33254006986532e-10)
(-1.42619726287985e-11,-1.12775361610539e-10,1.19987481896353e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(6.77227536707036e-16,-4.08879142159669e-11,5.14233311883794e-11)
(1.47159296877194e-13,-8.25968024895322e-11,4.95059024315905e-11)
(1.13864314830063e-13,-1.31093403580614e-10,4.62974340787113e-11)
(-2.27017268356672e-13,-1.84977973792258e-10,4.09157492401713e-11)
(-1.87743057888859e-13,-2.44277379908273e-10,3.32014249976246e-11)
(8.9147957531521e-14,-3.12148841352889e-10,2.47623300378259e-11)
(3.67736906026714e-13,-3.8228774271625e-10,1.63650119426578e-11)
(7.18238339844848e-13,-4.45977362461717e-10,1.06176877297904e-11)
(4.72533750119032e-13,-4.94396711696175e-10,6.75276619739338e-12)
(-3.92355497663677e-13,-5.1894756935446e-10,3.55924400759068e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.96694498921953e-13,-3.89698082316247e-11,1.04022642652423e-10)
(-2.64891095472978e-13,-7.92411748397711e-11,1.00695567604573e-10)
(-5.70568667905527e-13,-1.25597854427289e-10,9.45303835559788e-11)
(-4.66010751261952e-13,-1.7749066681804e-10,8.39431108993217e-11)
(1.3301790304664e-13,-2.36026028006356e-10,6.91404316096658e-11)
(1.38319262140782e-13,-3.0366237530016e-10,5.29154705251188e-11)
(-3.98174879312885e-13,-3.76172681597385e-10,3.66973207118088e-11)
(1.83643257329118e-13,-4.4139420258947e-10,2.45690860935859e-11)
(5.09360859065156e-13,-4.9073065575625e-10,1.58984079553414e-11)
(2.19352055398733e-13,-5.15780680844531e-10,7.80986017144948e-12)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.8116475409011e-14,-3.59394276827017e-11,1.57994895947044e-10)
(2.81968320779588e-13,-7.33408818866439e-11,1.53938354927249e-10)
(2.97778520334497e-13,-1.15581150438532e-10,1.45590980503263e-10)
(3.31804448867947e-13,-1.63153998279637e-10,1.31533155372865e-10)
(4.9017020667799e-13,-2.19668049018761e-10,1.12235093809307e-10)
(-6.98367702133897e-13,-2.8730590622473e-10,8.89630165994966e-11)
(-2.81220926656213e-12,-3.64442621858476e-10,6.38977626699726e-11)
(-1.20556165105041e-12,-4.32539881193889e-10,4.42506107134762e-11)
(-1.6761007401213e-13,-4.82132747113289e-10,2.93886457635233e-11)
(1.07373147849598e-13,-5.07751468617686e-10,1.46517840285419e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.34310381109143e-13,-3.19610031383273e-11,2.18647691195792e-10)
(-1.17200410742758e-13,-6.47115391418637e-11,2.1351737017486e-10)
(2.41022462636781e-13,-1.01225546787808e-10,2.03384755739921e-10)
(9.3300601034591e-13,-1.43524132267205e-10,1.87209005047963e-10)
(1.3527220251647e-12,-1.95905801602281e-10,1.65796576379433e-10)
(-1.2185058284279e-12,-2.6293901999733e-10,1.38776028687464e-10)
(-7.51828929954192e-12,-3.47607679168545e-10,1.0714986486709e-10)
(-4.82026667864394e-12,-4.18883477894989e-10,7.8727038213109e-11)
(-2.69418270877502e-12,-4.6756349545232e-10,5.30582202787596e-11)
(-1.60799167563785e-12,-4.92992311441301e-10,2.67174209769634e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-7.93895845613683e-13,-2.69649924984969e-11,2.85477743448055e-10)
(-9.64467043101687e-13,-5.46961251176662e-11,2.79557997751789e-10)
(1.20495606407374e-13,-8.48087736332269e-11,2.68029947229235e-10)
(1.81577274259984e-12,-1.21178697588314e-10,2.51400505142823e-10)
(3.40294037168391e-12,-1.67532531885145e-10,2.29910541226089e-10)
(2.18666065798547e-12,-2.32531362005389e-10,2.03851264851115e-10)
(-6.96566705517375e-12,-3.26703141814133e-10,1.72593221931011e-10)
(-7.00234588119785e-12,-3.98034926639242e-10,1.31381485184752e-10)
(-4.64036605814846e-12,-4.43916878859313e-10,8.82772905488259e-11)
(-3.02969133573192e-12,-4.67882882139982e-10,4.43651165100148e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-1.70127214630548e-12,-2.18391426478502e-11,3.53367396111706e-10)
(-2.64234085268423e-12,-4.41325416382284e-11,3.47266274298405e-10)
(-1.71462689739731e-12,-6.80588359404003e-11,3.34953498425448e-10)
(3.39116375787032e-13,-9.78729609289613e-11,3.17979854778996e-10)
(3.19533931535184e-12,-1.38070315138504e-10,2.96428022006829e-10)
(3.92262536898555e-12,-1.99086658427273e-10,2.71327936341344e-10)
(-7.27759657439575e-12,-2.92457072123056e-10,2.39769121705031e-10)
(-8.45641117881836e-12,-3.61933077884528e-10,1.88139630816463e-10)
(-6.18593670297651e-12,-4.04645070878635e-10,1.27773908863368e-10)
(-4.93296622904443e-12,-4.26547456965698e-10,6.45975653194018e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.24744228500066e-12,-1.74392929808596e-11,4.18248387525818e-10)
(-3.9495689826421e-12,-3.44621066179437e-11,4.11478526429967e-10)
(-3.64127871810705e-12,-5.27998191913549e-11,3.98760737421595e-10)
(-1.94651673431501e-12,-7.5982011781017e-11,3.81378311354179e-10)
(1.06652532089203e-12,-1.09774890157629e-10,3.60211852927552e-10)
(3.20564777586243e-12,-1.63605218422009e-10,3.35481971779507e-10)
(-5.60524770963286e-12,-2.48105177808852e-10,3.0292666976046e-10)
(-8.39547957707475e-12,-3.10023767110277e-10,2.40721296302918e-10)
(-7.43636208134403e-12,-3.47654664037635e-10,1.64592675721028e-10)
(-6.81184568692476e-12,-3.66882857875339e-10,8.32860703439851e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.448077626518e-12,-1.29168741700018e-11,4.73580743325209e-10)
(-4.46817294468153e-12,-2.56938865922125e-11,4.66318431384415e-10)
(-4.95335335983716e-12,-3.90586718420368e-11,4.53363202616008e-10)
(-4.32512801936239e-12,-5.67620700886977e-11,4.35845158052882e-10)
(-3.39308708907026e-12,-8.39784836886705e-11,4.13735758999824e-10)
(-3.18025641869803e-12,-1.27844268627158e-10,3.84630571954381e-10)
(-6.04539754941508e-12,-1.91505052060921e-10,3.42724163463376e-10)
(-7.86192962948322e-12,-2.42290626105457e-10,2.7524829276486e-10)
(-7.98587048808988e-12,-2.73784420741923e-10,1.90648054913297e-10)
(-7.46937767553002e-12,-2.90408633218277e-10,9.72492326220927e-11)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.64439720831417e-12,-8.10263985571535e-12,5.15343544441201e-10)
(-4.97121525141516e-12,-1.72068307685094e-11,5.08293583075509e-10)
(-6.29940062338982e-12,-2.64939806387325e-11,4.94812470197076e-10)
(-6.32746262379458e-12,-3.89777990550011e-11,4.75949148964876e-10)
(-6.43158598099017e-12,-5.82663837322973e-11,4.5114361811681e-10)
(-6.85217200981144e-12,-8.9118116554864e-11,4.16659400673548e-10)
(-7.63953454124266e-12,-1.30074578911833e-10,3.66600945461038e-10)
(-8.31778578295932e-12,-1.65552317883364e-10,2.94867484403519e-10)
(-8.18756834301234e-12,-1.8837146893881e-10,2.05472251617739e-10)
(-7.60633724470087e-12,-2.00628778271709e-10,1.05579710073256e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(-2.94940056357532e-12,-3.69707569832509e-12,5.37636565815522e-10)
(-5.22739390846444e-12,-8.69693314149323e-12,5.30990089553622e-10)
(-6.02433624119927e-12,-1.39300600299155e-11,5.17065762503664e-10)
(-6.20185757822199e-12,-2.04997308307315e-11,4.97111366232549e-10)
(-7.22319586235845e-12,-3.02137522700466e-11,4.70409777823596e-10)
(-7.77270679064974e-12,-4.59118333521431e-11,4.3297282969119e-10)
(-7.87759100798059e-12,-6.59806523955654e-11,3.79288289548398e-10)
(-7.47004771363838e-12,-8.4474870880546e-11,3.05430046144852e-10)
(-7.11337402718379e-12,-9.6666495737338e-11,2.13485127550667e-10)
(-7.04985234298827e-12,-1.02655405443157e-10,1.09705257786145e-10)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(0,0,0)
(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;
}
}
// ************************************************************************* //
|
[
"[email protected]"
] | ||
f790bdd83f4f07f657007d9bd8e9be1d302f0c10
|
bf96898a40eb0d2692dffbb9cca67a4b7c8763d7
|
/src/image_cuda_array.hpp
|
c843a1607ace551ae07caf66b9c9c554ad1df3e7
|
[
"BSD-3-Clause"
] |
permissive
|
mpiatka/gpustitch
|
bd619d4b557640726e163cd76b9c3a76c0fb70bd
|
be5520b440d44aa45df3e2bdb66969561a091462
|
refs/heads/master
| 2023-02-12T13:51:47.775448 | 2021-01-06T12:35:40 | 2021-01-06T12:35:40 | 287,005,102 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 651 |
hpp
|
#ifndef IMAGE_CUDA_ARRAY_HPP
#define IMAGE_CUDA_ARRAY_HPP
#include "image.hpp"
namespace gpustitch{
class Image_cuda_array : public Image{
public:
Image_cuda_array();
~Image_cuda_array();
Image_cuda_array(size_t width, size_t height, size_t pitch = 0);
Image_cuda_array(const Image_cuda_array&) = delete;
Image_cuda_array(Image_cuda_array&& o);
Image_cuda_array& operator=(const Image_cuda_array&) = delete;
Image_cuda_array& operator=(Image_cuda_array&&);
cudaArray_t get_array(){ return cuda_array; }
cudaTextureObject_t get_tex_obj(){ return tex_obj; }
private:
cudaArray_t cuda_array;
cudaTextureObject_t tex_obj;
};
}
#endif
|
[
"[email protected]"
] | |
93637614770eb08114e5da99cac9a50001ee4b90
|
900f58248c037ee881d268a7e882cb1d4c43f3f3
|
/ActionRPG/Intermediate/Build/Win64/UE4Editor/Inc/ActionRPG/RPGCharacterBase.generated.h
|
519c01e26c72fb99977f25eba09383664a9d4fbe
|
[] |
no_license
|
thomas-mahon/TestProgramming11082020
|
539cea397310b9a3b81e426af93412796f659fd6
|
89f8ab6462f3d77fdfc9dcf67ada7baa8c230d62
|
refs/heads/main
| 2023-01-06T16:24:34.140888 | 2020-11-08T21:34:36 | 2020-11-08T21:34:36 | 311,159,368 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 8,446 |
h
|
// Copyright Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
===========================================================================*/
#include "UObject/ObjectMacros.h"
#include "UObject/ScriptMacros.h"
PRAGMA_DISABLE_DEPRECATION_WARNINGS
struct FGameplayTagContainer;
class URPGGameplayAbility;
struct FRPGItemSlot;
struct FHitResult;
class ARPGCharacterBase;
class AActor;
#ifdef ACTIONRPG_RPGCharacterBase_generated_h
#error "RPGCharacterBase.generated.h already included, missing '#pragma once' in RPGCharacterBase.h"
#endif
#define ACTIONRPG_RPGCharacterBase_generated_h
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_SPARSE_DATA
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_RPC_WRAPPERS \
\
DECLARE_FUNCTION(execGetCooldownRemainingForTag); \
DECLARE_FUNCTION(execGetActiveAbilitiesWithTags); \
DECLARE_FUNCTION(execActivateAbilitiesWithTags); \
DECLARE_FUNCTION(execGetActiveAbilitiesWithItemSlot); \
DECLARE_FUNCTION(execActivateAbilitiesWithItemSlot); \
DECLARE_FUNCTION(execSetCharacterLevel); \
DECLARE_FUNCTION(execGetCharacterLevel); \
DECLARE_FUNCTION(execGetMoveSpeed); \
DECLARE_FUNCTION(execGetMaxMana); \
DECLARE_FUNCTION(execGetMana); \
DECLARE_FUNCTION(execGetMaxHealth); \
DECLARE_FUNCTION(execGetHealth);
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_RPC_WRAPPERS_NO_PURE_DECLS \
\
DECLARE_FUNCTION(execGetCooldownRemainingForTag); \
DECLARE_FUNCTION(execGetActiveAbilitiesWithTags); \
DECLARE_FUNCTION(execActivateAbilitiesWithTags); \
DECLARE_FUNCTION(execGetActiveAbilitiesWithItemSlot); \
DECLARE_FUNCTION(execActivateAbilitiesWithItemSlot); \
DECLARE_FUNCTION(execSetCharacterLevel); \
DECLARE_FUNCTION(execGetCharacterLevel); \
DECLARE_FUNCTION(execGetMoveSpeed); \
DECLARE_FUNCTION(execGetMaxMana); \
DECLARE_FUNCTION(execGetMana); \
DECLARE_FUNCTION(execGetMaxHealth); \
DECLARE_FUNCTION(execGetHealth);
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_EVENT_PARMS \
struct RPGCharacterBase_eventOnDamaged_Parms \
{ \
float DamageAmount; \
FHitResult HitInfo; \
FGameplayTagContainer DamageTags; \
ARPGCharacterBase* InstigatorCharacter; \
AActor* DamageCauser; \
}; \
struct RPGCharacterBase_eventOnHealthChanged_Parms \
{ \
float DeltaValue; \
FGameplayTagContainer EventTags; \
}; \
struct RPGCharacterBase_eventOnManaChanged_Parms \
{ \
float DeltaValue; \
FGameplayTagContainer EventTags; \
}; \
struct RPGCharacterBase_eventOnMoveSpeedChanged_Parms \
{ \
float DeltaValue; \
FGameplayTagContainer EventTags; \
};
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_CALLBACK_WRAPPERS
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_INCLASS_NO_PURE_DECLS \
private: \
static void StaticRegisterNativesARPGCharacterBase(); \
friend struct Z_Construct_UClass_ARPGCharacterBase_Statics; \
public: \
DECLARE_CLASS(ARPGCharacterBase, ACharacter, COMPILED_IN_FLAGS(0 | CLASS_Config), CASTCLASS_None, TEXT("/Script/ActionRPG"), NO_API) \
DECLARE_SERIALIZER(ARPGCharacterBase) \
virtual UObject* _getUObject() const override { return const_cast<ARPGCharacterBase*>(this); } \
enum class ENetFields_Private : uint16 \
{ \
NETFIELD_REP_START=(uint16)((int32)Super::ENetFields_Private::NETFIELD_REP_END + (int32)1), \
CharacterLevel=NETFIELD_REP_START, \
NETFIELD_REP_END=CharacterLevel }; \
NO_API virtual void ValidateGeneratedRepEnums(const TArray<struct FRepRecord>& ClassReps) const override;
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_INCLASS \
private: \
static void StaticRegisterNativesARPGCharacterBase(); \
friend struct Z_Construct_UClass_ARPGCharacterBase_Statics; \
public: \
DECLARE_CLASS(ARPGCharacterBase, ACharacter, COMPILED_IN_FLAGS(0 | CLASS_Config), CASTCLASS_None, TEXT("/Script/ActionRPG"), NO_API) \
DECLARE_SERIALIZER(ARPGCharacterBase) \
virtual UObject* _getUObject() const override { return const_cast<ARPGCharacterBase*>(this); } \
enum class ENetFields_Private : uint16 \
{ \
NETFIELD_REP_START=(uint16)((int32)Super::ENetFields_Private::NETFIELD_REP_END + (int32)1), \
CharacterLevel=NETFIELD_REP_START, \
NETFIELD_REP_END=CharacterLevel }; \
NO_API virtual void ValidateGeneratedRepEnums(const TArray<struct FRepRecord>& ClassReps) const override;
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_STANDARD_CONSTRUCTORS \
/** Standard constructor, called after all reflected properties have been initialized */ \
NO_API ARPGCharacterBase(const FObjectInitializer& ObjectInitializer); \
DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL(ARPGCharacterBase) \
DECLARE_VTABLE_PTR_HELPER_CTOR(NO_API, ARPGCharacterBase); \
DEFINE_VTABLE_PTR_HELPER_CTOR_CALLER(ARPGCharacterBase); \
private: \
/** Private move- and copy-constructors, should never be used */ \
NO_API ARPGCharacterBase(ARPGCharacterBase&&); \
NO_API ARPGCharacterBase(const ARPGCharacterBase&); \
public:
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_ENHANCED_CONSTRUCTORS \
private: \
/** Private move- and copy-constructors, should never be used */ \
NO_API ARPGCharacterBase(ARPGCharacterBase&&); \
NO_API ARPGCharacterBase(const ARPGCharacterBase&); \
public: \
DECLARE_VTABLE_PTR_HELPER_CTOR(NO_API, ARPGCharacterBase); \
DEFINE_VTABLE_PTR_HELPER_CTOR_CALLER(ARPGCharacterBase); \
DEFINE_DEFAULT_CONSTRUCTOR_CALL(ARPGCharacterBase)
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_PRIVATE_PROPERTY_OFFSET \
FORCEINLINE static uint32 __PPO__CharacterLevel() { return STRUCT_OFFSET(ARPGCharacterBase, CharacterLevel); } \
FORCEINLINE static uint32 __PPO__GameplayAbilities() { return STRUCT_OFFSET(ARPGCharacterBase, GameplayAbilities); } \
FORCEINLINE static uint32 __PPO__DefaultSlottedAbilities() { return STRUCT_OFFSET(ARPGCharacterBase, DefaultSlottedAbilities); } \
FORCEINLINE static uint32 __PPO__PassiveGameplayEffects() { return STRUCT_OFFSET(ARPGCharacterBase, PassiveGameplayEffects); } \
FORCEINLINE static uint32 __PPO__AbilitySystemComponent() { return STRUCT_OFFSET(ARPGCharacterBase, AbilitySystemComponent); } \
FORCEINLINE static uint32 __PPO__AttributeSet() { return STRUCT_OFFSET(ARPGCharacterBase, AttributeSet); } \
FORCEINLINE static uint32 __PPO__InventorySource() { return STRUCT_OFFSET(ARPGCharacterBase, InventorySource); } \
FORCEINLINE static uint32 __PPO__bAbilitiesInitialized() { return STRUCT_OFFSET(ARPGCharacterBase, bAbilitiesInitialized); } \
FORCEINLINE static uint32 __PPO__SlottedAbilities() { return STRUCT_OFFSET(ARPGCharacterBase, SlottedAbilities); }
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_18_PROLOG \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_EVENT_PARMS
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_GENERATED_BODY_LEGACY \
PRAGMA_DISABLE_DEPRECATION_WARNINGS \
public: \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_PRIVATE_PROPERTY_OFFSET \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_SPARSE_DATA \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_RPC_WRAPPERS \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_CALLBACK_WRAPPERS \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_INCLASS \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_STANDARD_CONSTRUCTORS \
public: \
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#define ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_GENERATED_BODY \
PRAGMA_DISABLE_DEPRECATION_WARNINGS \
public: \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_PRIVATE_PROPERTY_OFFSET \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_SPARSE_DATA \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_RPC_WRAPPERS_NO_PURE_DECLS \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_CALLBACK_WRAPPERS \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_INCLASS_NO_PURE_DECLS \
ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h_21_ENHANCED_CONSTRUCTORS \
private: \
PRAGMA_ENABLE_DEPRECATION_WARNINGS
template<> ACTIONRPG_API UClass* StaticClass<class ARPGCharacterBase>();
#undef CURRENT_FILE_ID
#define CURRENT_FILE_ID ActionRPG_Source_ActionRPG_Public_RPGCharacterBase_h
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
[
"[email protected]"
] | |
f1ea5e18771576f702c2acd3fac06200decb8055
|
51ff338833118587bdc70828d21e8c9777341f36
|
/Source/ArenaBattle/Public/ABGameMode.h
|
add3f394cda0efb5a589792068678d1d4e893dbf
|
[] |
no_license
|
bb2002/UE4-ArenaBattle
|
5c55b1c51d0760136b57702ae5ea72c95fcc539f
|
a69b6d97e5d9e46353655736f5d74fbcf3528fb5
|
refs/heads/master
| 2020-06-22T13:21:53.830920 | 2019-07-19T07:13:24 | 2019-07-19T07:13:24 | 197,721,086 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 607 |
h
|
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "ArenaBattle.h"
#include "GameFramework/GameModeBase.h"
#include "ABGameMode.generated.h"
/**
*
*/
UCLASS()
class ARENABATTLE_API AABGameMode : public AGameModeBase
{
GENERATED_BODY()
AABGameMode();
public:
virtual void PostLogin(APlayerController* NewPlayer) override;
virtual void PostInitializeComponents() override;
void AddScore(class AABPlayerController* Player);
int32 GetScore() const;
private:
UPROPERTY()
class AABGameState* ABGameState;
UPROPERTY()
int32 ScoreToClear;
};
|
[
"[email protected]"
] | |
4af6c450c1767d48f1608ef2591b68c07f824939
|
7b9b620c6b949a39983d28a224db1d914b44161b
|
/tests/ikaruga/core/objects/enemy/test_enemy_type.cc
|
e64df6eb999769803953158712a5ebe53f73eff6
|
[] |
no_license
|
rishisek/cinder-engine
|
8aa7bc3c0c5c108ae0f612aa6a4207cd0a52d950
|
ec8016d62219ed96b92a9c874659fe3d65496c62
|
refs/heads/main
| 2023-08-30T02:12:38.564754 | 2021-05-05T03:19:05 | 2021-05-05T03:19:05 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,718 |
cc
|
//
// Created by rishi on 26-04-2021.
//
#include <catch2/catch.hpp>
#include <serialization_utils/vec2_json.h>
#include <ikaruga/core/objects/enemy/enemy_type.h>
#include <ikaruga/core/objects/enemy/movement/patterns.h>
#include <ikaruga/core/objects/projectile/projectile_factory.h>
namespace ikaruga::objects::enemy {
TEST_CASE("Enemy type serialization", "[serialization]") {
SECTION("Serialization") {
std::vector<projectile::ProjectileType *> projectile_types = {
new projectile::ProjectileType("type1", 5, ci::Color("blue"), 7, 1)
};
EnemyType enemy_type
("id", 10,
2,
movement::Pattern::kSineLine,
projectile_types,
ci::Color("red"),
glm::vec2(1, 2));
nlohmann::json json = enemy_type;
REQUIRE(json["max_health"] == 10);
REQUIRE(json["kill_score"] == 2);
REQUIRE(json["pattern"] == movement::Pattern::kSineLine);
REQUIRE(json["projectile_types"] == std::vector<std::string>{"type1"});
REQUIRE(json["color"] == ci::Color("red"));
REQUIRE(json["shoot_offset"] == glm::vec2(1, 2));
}
SECTION("Deserialization") {
projectile::ProjectileFactory::AddProjectileType(new projectile::ProjectileType(
"type1",
5,
ci::Color("blue"),
7,
1));
std::vector<projectile::ProjectileType *> projectile_types =
projectile::ProjectileFactory::GetTypesById({"type1"});
EnemyType enemy_type1
("id", 10,
2,
movement::Pattern::kSineLine,
projectile_types,
ci::Color("red"),
glm::vec2(1, 2));
nlohmann::json json = enemy_type1;
EnemyType enemy_type2 = json;
REQUIRE(enemy_type1 == enemy_type2);
}
}
}
|
[
"[email protected]"
] | |
d32eddf00948c612cc1c2e8293902ad195ba1e94
|
5a53ff0b000ab2c9838b5348fc98e8acd2ff8b2a
|
/src/Asserv.Nucleo/motorController/MotorController.h
|
f275d4251c0984ecc619fa1ef4cd34c648d02a8f
|
[] |
no_license
|
pmrobotix/PMX
|
809a89cd5f0ff9d670ea18256d225adf15f011a5
|
adb2315446358df1f39ca406d0d1d9ba44d07b4d
|
refs/heads/master
| 2023-07-05T16:26:04.470256 | 2022-12-18T21:52:38 | 2022-12-18T21:52:38 | 39,129,652 | 4 | 2 | null | 2016-10-13T21:09:43 | 2015-07-15T10:00:38 |
C++
|
UTF-8
|
C++
| false | false | 445 |
h
|
#ifndef SRC_MOTORCONTROLLER_MOTORCONTROLLER_H_
#define SRC_MOTORCONTROLLER_MOTORCONTROLLER_H_
class MotorController
{
public:
virtual ~MotorController()
{
}
virtual void setMotorRightSpeed(float percentage) = 0;
virtual void setMotorLeftSpeed(float percentage) = 0;
virtual float getMotorRightSpeed() const = 0;
virtual float getMotorLeftSpeed() const = 0;
};
#endif /* SRC_MOTORCONTROLLER_MOTORCONTROLLER_H_ */
|
[
"[email protected]"
] | |
0c1289ff13261569c166a35dc56cbd575f4c4667
|
96a66e011b2e8694c03c16bbab2188a15318f4c1
|
/chrome/browser/chromeos/login/ui/login_display_host_views.h
|
c5d4ffaf1c92d7cd8deb7138086721b715963733
|
[
"BSD-3-Clause"
] |
permissive
|
adblockplus/chromium
|
7e1da0afd5fcd4ff6ee20aa70bc9c13bba54124e
|
313b9afa5d39b9d8cc9cf3801b6a07a5af6eb0ae
|
refs/heads/abp
| 2023-03-17T21:12:33.811234 | 2018-06-19T11:19:00 | 2018-06-19T11:19:00 | 141,696,173 | 3 | 1 |
NOASSERTION
| 2018-11-18T10:53:10 | 2018-07-20T10:02:34 | null |
UTF-8
|
C++
| false | false | 3,121 |
h
|
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_VIEWS_H_
#define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_VIEWS_H_
#include <memory>
#include <string>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
#include "chrome/browser/ui/ash/login_screen_client.h"
#include "chromeos/login/auth/auth_status_consumer.h"
namespace chromeos {
class ExistingUserController;
// A LoginDisplayHost instance that sends requests to the views-based signin
// screen.
class LoginDisplayHostViews : public LoginDisplayHost,
public LoginScreenClient::Delegate,
public AuthStatusConsumer {
public:
LoginDisplayHostViews();
~LoginDisplayHostViews() override;
// LoginDisplayHost:
LoginDisplay* CreateLoginDisplay(LoginDisplay::Delegate* delegate) override;
gfx::NativeWindow GetNativeWindow() const override;
OobeUI* GetOobeUI() const override;
WebUILoginView* GetWebUILoginView() const override;
void BeforeSessionStart() override;
void Finalize(base::OnceClosure completion_callback) override;
void SetStatusAreaVisible(bool visible) override;
void StartWizard(OobeScreen first_screen) override;
WizardController* GetWizardController() override;
void StartUserAdding(base::OnceClosure completion_callback) override;
void CancelUserAdding() override;
void OnStartSignInScreen(const LoginScreenContext& context) override;
void OnPreferencesChanged() override;
void OnStartAppLaunch() override;
void OnStartArcKiosk() override;
void StartVoiceInteractionOobe() override;
bool IsVoiceInteractionOobe() override;
// LoginScreenClient::Delegate:
void HandleAuthenticateUser(
const AccountId& account_id,
const std::string& hashed_password,
const password_manager::SyncPasswordData& sync_password_data,
bool authenticated_by_pin,
AuthenticateUserCallback callback) override;
void HandleAttemptUnlock(const AccountId& account_id) override;
void HandleHardlockPod(const AccountId& account_id) override;
void HandleRecordClickOnLockIcon(const AccountId& account_id) override;
void HandleOnFocusPod(const AccountId& account_id) override;
void HandleOnNoPodFocused() override;
bool HandleFocusLockScreenApps(bool reverse) override;
void HandleLoginAsGuest() override;
// AuthStatusConsumer:
void OnAuthFailure(const AuthFailure& error) override;
void OnAuthSuccess(const UserContext& user_context) override;
private:
// Callback that should be executed the authentication result is available.
AuthenticateUserCallback on_authenticated_;
std::unique_ptr<ExistingUserController> existing_user_controller_;
base::WeakPtrFactory<LoginDisplayHostViews> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(LoginDisplayHostViews);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_HOST_VIEWS_H_
|
[
"[email protected]"
] | |
58f3918047e1c990208d82e9afbfe8b74134097c
|
46534e9ca931f6a92988741ac3e7321ea85de441
|
/wejsciowkaPO_lab12/wejsciowka12/wejsciowka_12.cpp
|
1072e920dfcf56689d96657b5f9e306d8d2c4172
|
[] |
no_license
|
Bajgiel/PO
|
5000382fc1e39c489e38c3f88b740279ac8f0fc8
|
0c00d3d015556b455852a8d0893cc50945fa7189
|
refs/heads/main
| 2023-04-15T18:56:24.967578 | 2021-03-31T13:17:29 | 2021-03-31T13:17:29 | 326,254,327 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 4,741 |
cpp
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
class SilnikSamochodowy{
public:
SilnikSamochodowy();
SilnikSamochodowy(int, int);
SilnikSamochodowy(SilnikSamochodowy& );
void setPower(int n) { moc = n; }
int getPower() { return moc; }
void setSize(int n) { wymiary = n; }
int getSize() { return wymiary; }
void printOut();
SilnikSamochodowy* nast;
void setNext(SilnikSamochodowy* s) { nast = s; }
SilnikSamochodowy* getNext() { return nast; }
protected:
int moc;
int wymiary;
};
SilnikSamochodowy::SilnikSamochodowy(){
moc = 1;
wymiary = 1;
nast = NULL;
}
SilnikSamochodowy::SilnikSamochodowy(int Pow, int Siz) {
moc = Pow;
wymiary = Siz;
nast = NULL;
}
SilnikSamochodowy::SilnikSamochodowy(SilnikSamochodowy &kss) {
moc = kss.moc;
wymiary = kss.wymiary;
nast = kss.nast;
}
class Samochod {
public:
Samochod();
Samochod(int,const char*);
Samochod(Samochod&);
void setPrice(int n) { cena = n; }
int getPrice() { return cena; }
void setEngineType(const char* type) { strcpy(rodzaj_silnika, type); }
char* getEngineType() { return rodzaj_silnika; }
void printOut();
Samochod* nast;
void setNext(Samochod* m) { nast = m; }
Samochod* getNext() { return nast; }
protected:
int cena;
char rodzaj_silnika[25];
};
Samochod::Samochod(){
cena = 1;
strcpy(rodzaj_silnika, "brak");
nast = NULL;
}
Samochod::Samochod(int pric,const char* type){
cena = pric;
rodzaj_silnika, type;
nast = NULL;
}
Samochod::Samochod(Samochod& ks) {
cena = ks.cena;
strcpy(rodzaj_silnika, ks.rodzaj_silnika);
nast = ks.nast;
}
class UrzadzenieOptyczne {
public:
UrzadzenieOptyczne();
UrzadzenieOptyczne(int, int);
UrzadzenieOptyczne(UrzadzenieOptyczne&);
void setZoom(int n) { zoom = n; }
int getZoom() { return zoom; }
void setWeight(int n) { waga = n; }
int getWeight() { return waga; }
void printOut();
UrzadzenieOptyczne* nast;
void setNext(UrzadzenieOptyczne* k) { nast = k; }
UrzadzenieOptyczne* getNext() { return nast; }
protected:
int zoom;
int waga;
};
UrzadzenieOptyczne::UrzadzenieOptyczne(){
zoom = 1;
waga = 1;
nast = NULL;
}
UrzadzenieOptyczne::UrzadzenieOptyczne(int zo, int we) {
zoom = zo;
waga = we;
nast = NULL;
}
UrzadzenieOptyczne::UrzadzenieOptyczne(UrzadzenieOptyczne &kuo) {
zoom = kuo.zoom;
waga = kuo.waga;
nast = kuo.nast;
}
class OsobaNaUczelni {
public:
OsobaNaUczelni();
OsobaNaUczelni(const char*, const char*, const char*);
OsobaNaUczelni(OsobaNaUczelni& );
void setName1(char* n) { strcpy(imie, n); }
char* getName1() { return imie; }
void setName2(char* n) { strcpy(nazwisko, n); }
char* getName2() { return nazwisko; }
void setEmail(char* n) { strcpy(email, n); }
char* getEmail() { return email; }
void printOut();
OsobaNaUczelni* nast;
void setNext(OsobaNaUczelni* o) { nast = o; }
OsobaNaUczelni* getNext() { return nast; }
protected:
char imie[25];
char nazwisko[30];
char email[40];
};
OsobaNaUczelni::OsobaNaUczelni(){
strcpy(imie, "brak");
strcpy(nazwisko, "brak");
strcpy(email, "brak");
nast = NULL;
}
OsobaNaUczelni::OsobaNaUczelni(const char* name, const char* name2, const char* mail) {
strcpy(imie, name);
strcpy(nazwisko, name2);
strcpy(email, mail);
nast = NULL;
}
OsobaNaUczelni::OsobaNaUczelni(OsobaNaUczelni &ko) {
strcpy(imie, ko.imie);
strcpy(nazwisko, ko.nazwisko);
strcpy(email, ko.email);
nast = ko.nast;
}
int main() {
SilnikSamochodowy* si = NULL, *ptrsi = NULL;
Samochod* sa = NULL, *ptrsa = NULL;
UrzadzenieOptyczne* uo = NULL, *ptruo=NULL;
OsobaNaUczelni* on = NULL, *ptron=NULL;
for (int i = 0; i < 4; i++){
ptrsi->setNext(new SilnikSamochodowy);
ptrsi = ptrsi->getNext();
ptrsa->setNext(new Samochod);
ptrsa = ptrsa->getNext();
ptruo->setNext(new UrzadzenieOptyczne);
ptruo = ptruo->getNext();
ptron->setNext(new OsobaNaUczelni);
ptron = ptron->getNext();
}
while (si) {
si->printOut();
si = si->getNext();
}
while (sa) {
sa->printOut();
sa = sa->getNext();
}
while (uo) {
uo->printOut();
uo = uo->getNext();
}
while (on) {
on->printOut();
on = on->getNext();
}
delete on;
delete ptron;
delete si;
delete ptrsi;
delete sa;
delete ptrsa;
delete uo;
delete ptruo;
}
void SilnikSamochodowy::printOut(){
printf("Moc: %d\n", SilnikSamochodowy::moc);
printf("Wymiary: %d\n", SilnikSamochodowy::wymiary);
}
void Samochod::printOut(){
printf("Cena: %d\n", Samochod::cena);
printf("Rodzaj silnika: %s\n", Samochod::rodzaj_silnika);
}
void UrzadzenieOptyczne::printOut(){
printf("Zoom: %d\n", UrzadzenieOptyczne::zoom);
printf("Waga: %d\n", UrzadzenieOptyczne::waga);
}
void OsobaNaUczelni::printOut() {
printf("%s\n", OsobaNaUczelni::imie);
printf("%s\n", OsobaNaUczelni::nazwisko);
printf("%s\n", OsobaNaUczelni::email);
}
|
[
"[email protected]"
] | |
3faf4f434d610e176753dac4ed2551ee90dee058
|
600df3590cce1fe49b9a96e9ca5b5242884a2a70
|
/content/common/sandbox_linux/android/sandbox_bpf_base_policy_android.h
|
79a5d44044b56ae05cdb9473b6b8ad78884c8b94
|
[
"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 | 1,147 |
h
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_COMMON_SANDBOX_LINUX_ANDROID_SANDBOX_BPF_BASE_POLICY_ANDROID_H_
#define CONTENT_COMMON_SANDBOX_LINUX_ANDROID_SANDBOX_BPF_BASE_POLICY_ANDROID_H_
#include <sys/types.h>
#include "base/macros.h"
#include "content/common/sandbox_linux/sandbox_bpf_base_policy_linux.h"
namespace content {
// This class builds on top of the generic Linux baseline policy to reduce
// Linux kernel attack surface. It augments the list of allowed syscalls to
// allow ones required by the Android runtime.
class SandboxBPFBasePolicyAndroid : public SandboxBPFBasePolicy {
public:
SandboxBPFBasePolicyAndroid();
~SandboxBPFBasePolicyAndroid() override;
// sandbox::SandboxBPFPolicy:
sandbox::bpf_dsl::ResultExpr EvaluateSyscall(
int system_call_number) const override;
private:
const pid_t pid_;
DISALLOW_COPY_AND_ASSIGN(SandboxBPFBasePolicyAndroid);
};
} // namespace content
#endif // CONTENT_COMMON_SANDBOX_LINUX_ANDROID_SANDBOX_BPF_BASE_POLICY_ANDROID_H_
|
[
"[email protected]"
] | |
599dcc208f1af445d0d1455a90869c890c87e1c1
|
bd6e0833eb1373b1e0c9ef05836cbeb5f8de69d7
|
/src/nanoFramework.Hardware.Esp32.Bluetooth/Stubs/nanoFramework.Hardware.Esp32.Bluetooth/nanoFramework_Hardware_Esp32_Bluetooth.cpp
|
65963db74b649994a9206a61246f7220b45655f1
|
[] |
no_license
|
josesimoes/lib-nanoFramework.Hardware.Esp32.Bluetooth
|
34b102be284f6237e01c97be68e22f35fb18a582
|
b62a246c44c223772f98655ac9beda0fd378ea4e
|
refs/heads/master
| 2022-07-17T22:28:10.302294 | 2020-05-13T21:10:28 | 2020-05-13T21:10:28 | 263,750,698 | 0 | 0 | null | 2020-05-13T21:50:08 | 2020-05-13T21:50:07 | null |
UTF-8
|
C++
| false | false | 1,493 |
cpp
|
#include "nanoFramework_Hardware_Esp32_Bluetooth.h"
static const CLR_RT_MethodHandler method_lookup[] =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
Library_nanoFramework_Hardware_Esp32_Bluetooth_nanoFramework_Hardware_Esp32_Bluetooth_BluetoothHost::NativePrepareGatt___STATIC__VOID__I4__I4,
Library_nanoFramework_Hardware_Esp32_Bluetooth_nanoFramework_Hardware_Esp32_Bluetooth_BluetoothHost::NativeInitializeDevice___STATIC__VOID__STRING__nanoFrameworkHardwareEsp32BluetoothBluetoothMode__I4,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};
const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Hardware_Esp32_Bluetooth =
{
"nanoFramework.Hardware.Esp32.Bluetooth",
0x47CACCA5,
method_lookup,
{ 1, 0, 0, 0 }
};
|
[
"[email protected]"
] | |
38c5c90695771b162c54a203964e92c750b0ad9b
|
157c466d9577b48400bd00bf4f3c4d7a48f71e20
|
/Source/ProjectR/Private/DamageFloater_PS.cpp
|
243ba116922088ea50b5fad3d218ed7d103d12e1
|
[] |
no_license
|
SeungyulOh/OverlordSource
|
55015d357297393c7315c798f6813a9daba28b15
|
2e2339183bf847663d8f1722ed0f932fed6c7516
|
refs/heads/master
| 2020-04-19T16:00:25.346619 | 2019-01-30T06:41:12 | 2019-01-30T06:41:12 | 168,291,223 | 8 | 1 | null | null | null | null |
UTF-8
|
C++
| false | false | 14,144 |
cpp
|
// Fill out your copyright notice in the Description page of Project Settings.
#include "ProjectR.h"
#include "DamageFloater_PS.h"
#include "Paper2DClasses.h"
#include "Global/TableManager.h"
#include "Table/ResourceParticleTableInfo.h"
#include "UtilFunctionIntegrated.h"
#include "ProjectRGameMode.h"
#include "Particles/ParticleLODLevel.h"
#include "Particles/ParticleModuleRequired.h"
#include "Particles/Event/ParticleModuleEventReceiverBase.h"
#include "Particles/Spawn/ParticleModuleSpawn.h"
const int32 MaxCount = 5;
const int32 LifeTime = 1.f;
const int32 White = 0;
const int32 White_Dark = 1;
const int32 Yello = 2;
const int32 Yello_Dark = 3;
const int32 Red = 4;
const int32 Red_Dark = 5;
const int32 Green = 6;
const int32 Green_Dark = 7;
const int32 NumberInterval = 30;
// Sets default values
ADamageFloater_PS::ADamageFloater_PS()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
RootComponent = RootComp = CreateDefaultSubobject<USceneComponent>(FName(TEXT("RootComp")));
DamagePSC = CreateDefaultSubobject<UParticleSystemComponent>(FName(TEXT("ParticleSystemComponent")));
DamagePSC->SetupAttachment(RootComp);
DamagePSC->bAutoActivate = true;
}
// Called when the game starts or when spawned
void ADamageFloater_PS::BeginPlay()
{
Super::BeginPlay();
FResourceParticleTableInfo* TableInfo = UTableManager::GetInstancePtr()->GetResourceParticleRow(TEXT("Floater"));
if (TableInfo)
{
if (TableInfo->Asset.IsValid())
{
UParticleSystem* PS = Cast<UParticleSystem>(TableInfo->Asset.Get());
if (PS)
{
DamagePSC->SetTemplate(PS);
}
}
#ifdef WITH_EDITOR
else
{
UParticleSystem* PS = TableInfo->Asset.LoadSynchronous();
if (PS)
{
DamagePSC->SetTemplate(PS);
}
}
#endif
}
URGameInstance* RGameInst = RGAMEINSTANCE(this);
APlayerCameraManager* PCM = UGameplayStatics::GetPlayerCameraManager(RGameInst->GetWorld(), 0);
FVector RightVector = PCM->ViewTarget.Target->GetActorRightVector();
int32 NumberCount = 0;
if (FinalDamage / 10000 > 0)
NumberCount = MaxCount;
else if (FinalDamage / 1000 > 0)
NumberCount = MaxCount - 1;
else if (FinalDamage / 100 > 0)
NumberCount = MaxCount - 2;
else if (FinalDamage / 10 > 0)
NumberCount = MaxCount - 3;
else if (FinalDamage != 0)
NumberCount = MaxCount - 4;
else
NumberCount = 0;
for (size_t i = 0; i < MaxCount; ++i)
{
if (i + NumberCount < MaxCount)
continue;
int32 iNum = FMath::Pow(10, MaxCount - i - 1);
int32 iClippedDamage = FinalDamage % (iNum * 10);
DamageNumberArray.Emplace(iClippedDamage / iNum);
}
// if (DamageResultEnum == EBattleDamageResultEnum::VE_Hit)
// else if (DamageResultEnum == EBattleDamageResultEnum::VE_Critical)
// else if (DamageResultEnum == EBattleDamageResultEnum::VE_ReceiveHit || DamageResultEnum == EBattleDamageResultEnum::VE_ReceiveCritical)
// else if (DamageResultEnum == EBattleDamageResultEnum::VE_Heal)
for (size_t i = 1; i <= MaxCount; ++i)
{
if (i <= NumberCount)
{
FParticleEmitterInstance* PEI = DamagePSC->EmitterInstances[i - 1];
UMaterialInstanceDynamic* MID = UMaterialInstanceDynamic::Create(PEI->CurrentMaterial, PEI->Component);
FVector LeftStart = RightVector * NumberInterval * -0.5f * NumberCount;
FVector NewOffSet = LeftStart + RightVector * NumberInterval * (i - 1);
UParticleLODLevel* LODLevel = PEI->SpriteTemplate->GetCurrentLODLevel(PEI);
if (LODLevel)
{
UParticleModuleRequired* RM = LODLevel->RequiredModule;
RM->EmitterOrigin = NewOffSet;
}
UParticleSystemComponent* PSC = UGameplayStatics::SpawnEmitterAttached(SmokePS, RootComp, NAME_None, NewOffSet);
if(IsValid(PSC))
{
PSC->OnSystemFinished.RemoveDynamic(this, &ADamageFloater_PS::DestroyThisActor);
PSC->OnSystemFinished.AddDynamic(this, &ADamageFloater_PS::DestroyThisActor);
}
int32 DamageNum = 0;
if (DamageNumberArray.IsValidIndex(i - 1))
DamageNum = DamageNumberArray[i - 1];
if (NumberArray.IsValidIndex(DamageNum))
{
if (MID)
{
MID->SetTextureParameterValue(FName(TEXT("DiffuseTexture")), NumberArray[DamageNum]);
DamagePSC->SetMaterial(i - 1, MID);
}
}
continue;
}
else
{
FString EmitterStr = TEXT("Damage") + FString::FromInt(i);
DamagePSC->SetEmitterEnable(FName(*EmitterStr), false);
}
}
if (TextTexture)
{
int32 ElementIdx = DamagePSC->EmitterInstances.Num() - 1;
FParticleEmitterInstance* PEI = DamagePSC->EmitterInstances[ElementIdx];
UMaterialInstanceDynamic* MID = UMaterialInstanceDynamic::Create(PEI->CurrentMaterial, PEI->Component);
if (MID)
{
MID->SetTextureParameterValue(FName(TEXT("DiffuseTexture")), TextTexture);
DamagePSC->SetMaterial(ElementIdx, MID);
}
if (IsValid(DamagePSC))
{
DamagePSC->OnSystemFinished.RemoveDynamic(this, &ADamageFloater_PS::DestroyThisActor);
DamagePSC->OnSystemFinished.AddDynamic(this, &ADamageFloater_PS::DestroyThisActor);
}
}
else
DamagePSC->SetEmitterEnable(FName(TEXT("Text")), false);
if(OwnerActor.IsValid() && FromActor.IsValid())
{
if (IsValid(FromActor.Get()))
{
InitialPowerDirection = OwnerActor.Get()->GetActorLocation() - FromActor.Get()->GetActorLocation();
InitialPowerDirection.Normalize();
}
}
InitialUpPowerIntensity = InitialPowerIntensity = FMath::Pow(base, NumberCount) * InitialPowerOffSet;
decelerationIntensity = Coefficient * InitialUpPowerIntensity;
}
// Called every frame
void ADamageFloater_PS::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (IsPendingKill())
return;
InitialUpPowerIntensity -= decelerationIntensity * DeltaTime;
FVector TargetLocation = GetActorLocation() + InitialPowerDirection * DeltaTime * InitialPowerIntensity + FVector(0.f,0.f,1.f) * InitialUpPowerIntensity * DeltaTime;
SetActorLocation(TargetLocation);
}
void ADamageFloater_PS::Initialize(AActor* InFromActor, AActor* InOwnerActor, float Damage, EBattleDamageResultEnum DamageResultType)
{
FromActor = InFromActor;
OwnerActor = InOwnerActor;
FinalDamage = FMath::Abs<float>(Damage);
DamageResultEnum = DamageResultType;
AProjectRGameMode* RGameMode = UUtilFunctionLibrary::GetGamePlayMode();
if (RGameMode && RGameMode->DamageFloaterMgr)
{
int32 MyGroupKey = Cast<IEntityBaseProperty>(InOwnerActor)->GetGroupKey();
bool isEnemy = MyGroupKey == GroupKey_SINGLE_ENEMY ? true : false;
NumberArray = RGameMode->DamageFloaterMgr->GetCorrespondingNumberArray(DamageResultType, isEnemy);
SmokePS = RGameMode->DamageFloaterMgr->GetCorrespondingPS(DamageResultType, isEnemy);
if (FinalDamage == 0)
DamageResultType = isEnemy == true ? EBattleDamageResultEnum::VE_Miss : EBattleDamageResultEnum::VE_Dodge;
if (DamageResultType == EBattleDamageResultEnum::VE_Critical || DamageResultType == EBattleDamageResultEnum::VE_Miss || DamageResultType==EBattleDamageResultEnum::VE_Dodge)
TextTexture = RGameMode->DamageFloaterMgr->GetCorrespondingTextTexture(DamageResultType);
}
}
void ADamageFloater_PS::DestroyThisActor(UParticleSystemComponent* PSC)
{
if (IsValidLowLevel() && !IsPendingKill() && PSC->GetActiveParticleNum() == 0)
Destroy();
}
UDamageFloaterManager::UDamageFloaterManager()
{
}
void UDamageFloaterManager::Init()
{
UTableManager* TableManager = UTableManager::GetInstancePtr();
if (!TableManager)
return;
WhiteSpriteArray.Empty();
for (int32 i = 0; i < 10; ++i)
{
TArray<FStringFormatArg> Args;
Args.Empty();
Args.Push(FString::FromInt(i));
FString Path1 = FString::Format(TEXT("White{0}"), Args);
FResourceTexture2DTableInfo* TableInfo = TableManager->GetResourceDamageFloaterTex2DRow(FName(*Path1));
if (TableInfo)
{
if (TableInfo->Asset.IsValid())
{
UTexture2D* Tex = Cast<UTexture2D>(TableInfo->Asset.Get());
if (Tex)
{
WhiteSpriteArray.Emplace(Tex);
}
}
#ifdef WITH_EDITOR
else
{
UTexture2D* Tex = TableInfo->Asset.LoadSynchronous();
if (Tex)
{
WhiteSpriteArray.Emplace(Tex);
}
}
#endif
}
}
YelloSpriteArray.Empty();
for (int32 i = 0; i < 10; ++i)
{
TArray<FStringFormatArg> Args;
Args.Empty();
Args.Push(FString::FromInt(i));
FString Path1 = FString::Format(TEXT("Yello{0}"), Args);
FResourceTexture2DTableInfo* TableInfo = TableManager->GetResourceDamageFloaterTex2DRow(FName(*Path1));
if (TableInfo)
{
if (TableInfo->Asset.IsValid())
{
UTexture2D* Tex = Cast<UTexture2D>(TableInfo->Asset.Get());
if (Tex)
{
YelloSpriteArray.Emplace(Tex);
}
}
#ifdef WITH_EDITOR
else
{
UTexture2D* Tex = TableInfo->Asset.LoadSynchronous();
if (Tex)
{
YelloSpriteArray.Emplace(Tex);
}
}
#endif
}
}
RedSpriteArray.Empty();
for (int32 i = 0; i < 10; ++i)
{
TArray<FStringFormatArg> Args;
Args.Empty();
Args.Push(FString::FromInt(i));
FString Path1 = FString::Format(TEXT("Red{0}"), Args);
FResourceTexture2DTableInfo* TableInfo = TableManager->GetResourceDamageFloaterTex2DRow(FName(*Path1));
if (TableInfo)
{
if (TableInfo->Asset.IsValid())
{
UTexture2D* Tex = Cast<UTexture2D>(TableInfo->Asset.Get());
if (Tex)
{
RedSpriteArray.Emplace(Tex);
}
}
#ifdef WITH_EDITOR
else
{
UTexture2D* Tex = TableInfo->Asset.LoadSynchronous();
if (Tex)
{
RedSpriteArray.Emplace(Tex);
}
}
#endif
}
}
GreenSpriteArray.Empty();
for (int32 i = 0; i < 10; ++i)
{
TArray<FStringFormatArg> Args;
Args.Empty();
Args.Push(FString::FromInt(i));
FString Path1 = FString::Format(TEXT("Green{0}"), Args);
FResourceTexture2DTableInfo* TableInfo = TableManager->GetResourceDamageFloaterTex2DRow(FName(*Path1));
if (TableInfo)
{
if (TableInfo->Asset.IsValid())
{
UTexture2D* Tex = Cast<UTexture2D>(TableInfo->Asset.Get());
if (Tex)
{
GreenSpriteArray.Emplace(Tex);
}
}
#ifdef WITH_EDITOR
else
{
UTexture2D* Tex = TableInfo->Asset.LoadSynchronous();
if (Tex)
{
GreenSpriteArray.Emplace(Tex);
}
}
#endif
}
}
FResourceTexture2DTableInfo* TableInfo = TableManager->GetResourceDamageFloaterTex2DRow(TEXT("Miss"));
if (TableInfo)
{
if (TableInfo->Asset.IsValid())
{
UTexture2D* Tex = Cast<UTexture2D>(TableInfo->Asset.Get());
if (Tex)
{
MissSprite = Tex;
}
}
#ifdef WITH_EDITOR
else
{
UTexture2D* Tex = TableInfo->Asset.LoadSynchronous();
if (Tex)
{
MissSprite = Tex;
}
}
#endif
}
FResourceTexture2DTableInfo* TableInfo1 = TableManager->GetResourceDamageFloaterTex2DRow(TEXT("Critical"));
if (TableInfo1)
{
if (TableInfo1->Asset.IsValid())
{
UTexture2D* Tex = Cast<UTexture2D>(TableInfo1->Asset.Get());
if (Tex)
{
CritSprite = Tex;
}
}
#ifdef WITH_EDITOR
else
{
UTexture2D* Tex = TableInfo1->Asset.LoadSynchronous();
if (Tex)
{
CritSprite = Tex;
}
}
#endif
}
FResourceParticleTableInfo* TableInfo2 = TableManager->GetResourceParticleRow(TEXT("Floater0"));
if (TableInfo2)
{
if (TableInfo2->Asset.IsValid())
{
UParticleSystem* PS = Cast<UParticleSystem>(TableInfo2->Asset.Get());
if (PS)
{
WhitePS = PS;
}
}
#ifdef WITH_EDITOR
else
{
UParticleSystem* PS = TableInfo2->Asset.LoadSynchronous();
if (PS)
{
WhitePS = PS;
}
}
#endif
}
TableInfo2 = TableManager->GetResourceParticleRow(TEXT("Floater1"));
if (TableInfo2)
{
if (TableInfo2->Asset.IsValid())
{
UParticleSystem* PS = Cast<UParticleSystem>(TableInfo2->Asset.Get());
if (PS)
{
YelloPS = PS;
}
}
#ifdef WITH_EDITOR
else
{
UParticleSystem* PS = TableInfo2->Asset.LoadSynchronous();
if (PS)
{
YelloPS = PS;
}
}
#endif
}
TableInfo2 = TableManager->GetResourceParticleRow(TEXT("Floater2"));
if (TableInfo2)
{
if (TableInfo2->Asset.IsValid())
{
UParticleSystem* PS = Cast<UParticleSystem>(TableInfo2->Asset.Get());
if (PS)
{
RedPS = PS;
}
}
#ifdef WITH_EDITOR
else
{
UParticleSystem* PS = TableInfo2->Asset.LoadSynchronous();
if (PS)
{
RedPS = PS;
}
}
#endif
}
TableInfo2 = TableManager->GetResourceParticleRow(TEXT("Floater3"));
if (TableInfo2)
{
if (TableInfo2->Asset.IsValid())
{
UParticleSystem* PS = Cast<UParticleSystem>(TableInfo2->Asset.Get());
if (PS)
{
GreenPS = PS;
}
}
#ifdef WITH_EDITOR
else
{
UParticleSystem* PS = TableInfo2->Asset.LoadSynchronous();
if (PS)
{
GreenPS = PS;
}
}
#endif
}
}
TArray<UTexture2D*>& UDamageFloaterManager::GetCorrespondingNumberArray(EBattleDamageResultEnum DamageResultType, bool isEnemy)
{
if (DamageResultType == EBattleDamageResultEnum::VE_Hit)
return WhiteSpriteArray;
else if (DamageResultType == EBattleDamageResultEnum::VE_Critical)
return YelloSpriteArray;
else if (DamageResultType == EBattleDamageResultEnum::VE_ReceiveHit || DamageResultType == EBattleDamageResultEnum::VE_ReceiveCritical)
{
if(isEnemy)
return WhiteSpriteArray;
else
return RedSpriteArray;
}
else if (DamageResultType == EBattleDamageResultEnum::VE_Heal)
return GreenSpriteArray;
else
return WhiteSpriteArray;
}
UTexture2D* UDamageFloaterManager::GetCorrespondingTextTexture(EBattleDamageResultEnum DamageResultType)
{
if (DamageResultType == EBattleDamageResultEnum::VE_Miss || DamageResultType == EBattleDamageResultEnum::VE_Dodge)
return MissSprite;
else if (DamageResultType == EBattleDamageResultEnum::VE_Critical)
return CritSprite;
else
return nullptr;
}
UParticleSystem* UDamageFloaterManager::GetCorrespondingPS(EBattleDamageResultEnum DamageResultType, bool isEnemy)
{
if (DamageResultType == EBattleDamageResultEnum::VE_Hit)
return WhitePS;
else if (DamageResultType == EBattleDamageResultEnum::VE_Critical)
return YelloPS;
else if (DamageResultType == EBattleDamageResultEnum::VE_ReceiveHit || DamageResultType == EBattleDamageResultEnum::VE_ReceiveCritical)
{
if (isEnemy)
return WhitePS;
else
return RedPS;
}
else if (DamageResultType == EBattleDamageResultEnum::VE_Heal)
return GreenPS;
else
return nullptr;
}
|
[
"[email protected]"
] | |
448cf7f672a5fa93e90bcc9d2cdeacff9e9f1986
|
f144446b9660095176feef1dfb4ca14d11dd0904
|
/src/Components/TextLabelComponent.h
|
fcca246d00a12f4f5afe06ec156686cc32d3a62c
|
[
"MIT"
] |
permissive
|
marxzeder55/projects
|
8a04aba74053394b91d0ed2b57bf1ef44712881c
|
e1714321e18132fed2d4660abc5400506224a8a4
|
refs/heads/master
| 2020-09-26T08:41:49.217028 | 2019-12-06T19:46:55 | 2019-12-06T19:46:55 | 226,219,600 | 0 | 0 |
MIT
| 2019-12-06T01:19:51 | 2019-12-06T01:19:50 | null |
UTF-8
|
C++
| false | false | 1,263 |
h
|
#ifndef TEXTLABELCOMPONENT_H
#define TEXTLABELCOMPONENT_H
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include "../FontManager.h"
#include "../EntityManager.h"
#include "../AssetManager.h"
#include "../Game.h"
class TextLabelComponent: public Component {
private:
SDL_Rect position;
std::string text;
std::string fontFamily;
SDL_Color color;
SDL_Texture* texture;
public:
TextLabelComponent(int x, int y, std::string text, std::string fontFamily, const SDL_Color& color) {
this->position.x = x;
this->position.y = y;
this->text = text;
this->fontFamily = fontFamily;
this->color = color;
SetLabelText(text, fontFamily);
}
void SetLabelText(std::string text, std::string fontFamily) {
SDL_Surface* surface = TTF_RenderText_Blended(Game::assetManager->GetFont(fontFamily), text.c_str(), color);
texture = SDL_CreateTextureFromSurface(Game::renderer, surface);
SDL_FreeSurface(surface);
SDL_QueryTexture(texture, NULL, NULL, &position.w, &position.h);
}
void Render() override {
FontManager::Draw(texture, position);
}
};
#endif
|
[
"[email protected]"
] | |
6ea1b2c79ac1fa26292200d5e60f021db20d44f2
|
8bb338def9ac6c55dcd99b0f0ab084c224e7bd7a
|
/nubscript/nu_string_tool.cc
|
6bcbd185c6b653d815632f343fd9a5fdfa725190
|
[
"MIT"
] |
permissive
|
eantcal/nubscript
|
cbe6b8261e4d3e8ef33bbddf90b8e34d83c5d9c3
|
02f738770a14cb476ad39338b3aa4f6f9de01c32
|
refs/heads/master
| 2021-01-12T11:15:50.572424 | 2017-11-15T18:37:56 | 2017-11-15T18:37:56 | 72,884,683 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 595 |
cc
|
//
// This file is part of nuBScript Project
// Copyright (c) Antonino Calderone ([email protected])
// All rights reserved.
// Licensed under the MIT License.
// See COPYING file in the project root for full license information.
//
/* -------------------------------------------------------------------------- */
#include "nu_string_tool.h"
/* -------------------------------------------------------------------------- */
#if __MINGW32__
#include <algorithm>
#include <strings.h>
#endif
/* -------------------------------------------------------------------------- */
|
[
"[email protected]"
] | |
677d1cec79aa303d5ab284a80e264b7925e7079b
|
957cddafb18ab4f689b9eb56117fc48bb4f29bee
|
/newman conway sequnce dp.cpp
|
c3a3347b88eb84ef1a7f0a22c6246a15692046e0
|
[] |
no_license
|
woke5176/competitive-programmig
|
8e75b9e780146d3a40264f2bd50316bb038b7ed0
|
158d34d3f92b9d0fc162f453b65742dab380384f
|
refs/heads/master
| 2022-12-19T20:00:36.710966 | 2020-10-15T12:12:54 | 2020-10-15T12:12:54 | 295,110,899 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 233 |
cpp
|
#include <bits/stdc++.h>
using namespace std;
int main(){
// element to be printed
int n;cin>>n;
int dp[n+1];
dp[0] = 0;
dp[1] = dp[2] = 1;
for(int i=3;i<=n;i++)
dp[i] = dp[dp[i-1]] + dp[i-dp[i-1]];
cout<<dp[n];
}
|
[
"[email protected]"
] | |
01a29109f36daaf956a8966eea8784870269fbf3
|
b3e4a298b96a3dfd549205a25d5656c7775ff0a3
|
/Lab Programs/week7_d.cpp
|
aa109c0fc765669f0bcccee0c164d2e60a444031
|
[] |
no_license
|
VasireddyGanesh/Cpp-Basic-Programs
|
d658de4a41dada6c9f073d1fbbebe33fa1bc3374
|
01f11d875566ee22f965fd2dca450a89e428a6dc
|
refs/heads/main
| 2023-06-04T20:47:49.081555 | 2021-06-24T13:23:41 | 2021-06-24T13:23:41 | 379,928,226 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 413 |
cpp
|
//Hierarchical Inheritence.
#include<iostream>
using namespace std;
class X{
public :
X(){
cout<<"X Class Constructor is called"<<endl;
}
};
class Y : public X{
public :
Y(){
cout<<"Y Class Constructor is called"<<endl;
}
};
class Z:public X{
public :
Z(){
cout<<"Z Class Constructor is called"<<endl;
}
};
int main()
{
Z obj1;
Y obj2;
return 0;
}
|
[
"[email protected]"
] | |
f0f45925b522da0459d0321b3ec86796082f87ce
|
9eb699ddea818dd338fd6f20c8496f091f4f855a
|
/malloc예제연습.cpp
|
65ab686eaeda6c3f071eaa970abeec5a330952e5
|
[] |
no_license
|
dhkdwk1130/practice
|
aa15bef207c4f5349ac44a73d18dbf670b27cd6c
|
5a6f0370a4a4d9fe50c1359515717b91c0e840a0
|
refs/heads/master
| 2021-07-03T15:07:08.162868 | 2019-03-21T00:06:07 | 2019-03-21T00:06:07 | 114,850,118 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 158 |
cpp
|
#include<stdio.h>
int main()
{
int lcd, q, p, r;
scanf("%d %d", &q, &p);
while (r != 0)
{
//
r = p % q;
p = q;
q = r;
}
printf("lcd : %d", q);
}
|
[
"[email protected]"
] | |
3ab9c38a39bea6e8a5865458865fce2df32a3470
|
bb6ebff7a7f6140903d37905c350954ff6599091
|
/third_party/skia/src/gpu/GrInOrderDrawBuffer.cpp
|
deea72b90d961197fb148a4f0bf5090078122d34
|
[
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] |
permissive
|
PDi-Communication-Systems-Inc/lollipop_external_chromium_org
|
faa6602bd6bfd9b9b6277ce3cd16df0bd26e7f2f
|
ccadf4e63dd34be157281f53fe213d09a8c66d2c
|
refs/heads/master
| 2022-12-23T18:07:04.568931 | 2016-04-11T16:03:36 | 2016-04-11T16:03:36 | 53,677,925 | 0 | 1 |
BSD-3-Clause
| 2022-12-09T23:46:46 | 2016-03-11T15:49:07 |
C++
|
UTF-8
|
C++
| false | false | 36,452 |
cpp
|
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "GrInOrderDrawBuffer.h"
#include "GrBufferAllocPool.h"
#include "GrDrawTargetCaps.h"
#include "GrTextStrike.h"
#include "GrGpu.h"
#include "GrIndexBuffer.h"
#include "GrPath.h"
#include "GrRenderTarget.h"
#include "GrTemplates.h"
#include "GrTexture.h"
#include "GrVertexBuffer.h"
GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrGpu* gpu,
GrVertexBufferAllocPool* vertexPool,
GrIndexBufferAllocPool* indexPool)
: GrDrawTarget(gpu->getContext())
, fDstGpu(gpu)
, fClipSet(true)
, fClipProxyState(kUnknown_ClipProxyState)
, fVertexPool(*vertexPool)
, fIndexPool(*indexPool)
, fFlushing(false)
, fDrawID(0) {
fDstGpu->ref();
fCaps.reset(SkRef(fDstGpu->caps()));
SkASSERT(NULL != vertexPool);
SkASSERT(NULL != indexPool);
GeometryPoolState& poolState = fGeoPoolStateStack.push_back();
poolState.fUsedPoolVertexBytes = 0;
poolState.fUsedPoolIndexBytes = 0;
#ifdef SK_DEBUG
poolState.fPoolVertexBuffer = (GrVertexBuffer*)~0;
poolState.fPoolStartVertex = ~0;
poolState.fPoolIndexBuffer = (GrIndexBuffer*)~0;
poolState.fPoolStartIndex = ~0;
#endif
this->reset();
}
GrInOrderDrawBuffer::~GrInOrderDrawBuffer() {
this->reset();
// This must be called by before the GrDrawTarget destructor
this->releaseGeometry();
fDstGpu->unref();
}
////////////////////////////////////////////////////////////////////////////////
namespace {
void get_vertex_bounds(const void* vertices,
size_t vertexSize,
int vertexCount,
SkRect* bounds) {
SkASSERT(vertexSize >= sizeof(SkPoint));
SkASSERT(vertexCount > 0);
const SkPoint* point = static_cast<const SkPoint*>(vertices);
bounds->fLeft = bounds->fRight = point->fX;
bounds->fTop = bounds->fBottom = point->fY;
for (int i = 1; i < vertexCount; ++i) {
point = reinterpret_cast<SkPoint*>(reinterpret_cast<intptr_t>(point) + vertexSize);
bounds->growToInclude(point->fX, point->fY);
}
}
}
namespace {
extern const GrVertexAttrib kRectPosColorUVAttribs[] = {
{kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding},
{kVec4ub_GrVertexAttribType, sizeof(SkPoint), kColor_GrVertexAttribBinding},
{kVec2f_GrVertexAttribType, sizeof(SkPoint)+sizeof(GrColor),
kLocalCoord_GrVertexAttribBinding},
};
extern const GrVertexAttrib kRectPosUVAttribs[] = {
{kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding},
{kVec2f_GrVertexAttribType, sizeof(SkPoint), kLocalCoord_GrVertexAttribBinding},
};
static void set_vertex_attributes(GrDrawState* drawState,
bool hasColor, bool hasUVs,
int* colorOffset, int* localOffset) {
*colorOffset = -1;
*localOffset = -1;
// Using per-vertex colors allows batching across colors. (A lot of rects in a row differing
// only in color is a common occurrence in tables). However, having per-vertex colors disables
// blending optimizations because we don't know if the color will be solid or not. These
// optimizations help determine whether coverage and color can be blended correctly when
// dual-source blending isn't available. This comes into play when there is coverage. If colors
// were a stage it could take a hint that every vertex's color will be opaque.
if (hasColor && hasUVs) {
*colorOffset = sizeof(SkPoint);
*localOffset = sizeof(SkPoint) + sizeof(GrColor);
drawState->setVertexAttribs<kRectPosColorUVAttribs>(3);
} else if (hasColor) {
*colorOffset = sizeof(SkPoint);
drawState->setVertexAttribs<kRectPosColorUVAttribs>(2);
} else if (hasUVs) {
*localOffset = sizeof(SkPoint);
drawState->setVertexAttribs<kRectPosUVAttribs>(2);
} else {
drawState->setVertexAttribs<kRectPosUVAttribs>(1);
}
}
};
enum {
kTraceCmdBit = 0x80,
kCmdMask = 0x7f,
};
static uint8_t add_trace_bit(uint8_t cmd) {
return cmd | kTraceCmdBit;
}
static uint8_t strip_trace_bit(uint8_t cmd) {
return cmd & kCmdMask;
}
static bool cmd_has_trace_marker(uint8_t cmd) {
return SkToBool(cmd & kTraceCmdBit);
}
void GrInOrderDrawBuffer::onDrawRect(const SkRect& rect,
const SkMatrix* matrix,
const SkRect* localRect,
const SkMatrix* localMatrix) {
GrDrawState::AutoColorRestore acr;
GrDrawState* drawState = this->drawState();
GrColor color = drawState->getColor();
int colorOffset, localOffset;
set_vertex_attributes(drawState,
this->caps()->dualSourceBlendingSupport() || drawState->hasSolidCoverage(),
NULL != localRect,
&colorOffset, &localOffset);
if (colorOffset >= 0) {
// We set the draw state's color to white here. This is done so that any batching performed
// in our subclass's onDraw() won't get a false from GrDrawState::op== due to a color
// mismatch. TODO: Once vertex layout is owned by GrDrawState it should skip comparing the
// constant color in its op== when the kColor layout bit is set and then we can remove
// this.
acr.set(drawState, 0xFFFFFFFF);
}
AutoReleaseGeometry geo(this, 4, 0);
if (!geo.succeeded()) {
GrPrintf("Failed to get space for vertices!\n");
return;
}
// Go to device coords to allow batching across matrix changes
SkMatrix combinedMatrix;
if (NULL != matrix) {
combinedMatrix = *matrix;
} else {
combinedMatrix.reset();
}
combinedMatrix.postConcat(drawState->getViewMatrix());
// When the caller has provided an explicit source rect for a stage then we don't want to
// modify that stage's matrix. Otherwise if the effect is generating its source rect from
// the vertex positions then we have to account for the view matrix change.
GrDrawState::AutoViewMatrixRestore avmr;
if (!avmr.setIdentity(drawState)) {
return;
}
size_t vsize = drawState->getVertexSize();
geo.positions()->setRectFan(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vsize);
combinedMatrix.mapPointsWithStride(geo.positions(), vsize, 4);
SkRect devBounds;
// since we already computed the dev verts, set the bounds hint. This will help us avoid
// unnecessary clipping in our onDraw().
get_vertex_bounds(geo.vertices(), vsize, 4, &devBounds);
if (localOffset >= 0) {
SkPoint* coords = GrTCast<SkPoint*>(GrTCast<intptr_t>(geo.vertices()) + localOffset);
coords->setRectFan(localRect->fLeft, localRect->fTop,
localRect->fRight, localRect->fBottom,
vsize);
if (NULL != localMatrix) {
localMatrix->mapPointsWithStride(coords, vsize, 4);
}
}
if (colorOffset >= 0) {
GrColor* vertColor = GrTCast<GrColor*>(GrTCast<intptr_t>(geo.vertices()) + colorOffset);
for (int i = 0; i < 4; ++i) {
*vertColor = color;
vertColor = (GrColor*) ((intptr_t) vertColor + vsize);
}
}
this->setIndexSourceToBuffer(this->getContext()->getQuadIndexBuffer());
this->drawIndexedInstances(kTriangles_GrPrimitiveType, 1, 4, 6, &devBounds);
// to ensure that stashing the drawState ptr is valid
SkASSERT(this->drawState() == drawState);
}
bool GrInOrderDrawBuffer::quickInsideClip(const SkRect& devBounds) {
if (!this->getDrawState().isClipState()) {
return true;
}
if (kUnknown_ClipProxyState == fClipProxyState) {
SkIRect rect;
bool iior;
this->getClip()->getConservativeBounds(this->getDrawState().getRenderTarget(), &rect, &iior);
if (iior) {
// The clip is a rect. We will remember that in fProxyClip. It is common for an edge (or
// all edges) of the clip to be at the edge of the RT. However, we get that clipping for
// free via the viewport. We don't want to think that clipping must be enabled in this
// case. So we extend the clip outward from the edge to avoid these false negatives.
fClipProxyState = kValid_ClipProxyState;
fClipProxy = SkRect::Make(rect);
if (fClipProxy.fLeft <= 0) {
fClipProxy.fLeft = SK_ScalarMin;
}
if (fClipProxy.fTop <= 0) {
fClipProxy.fTop = SK_ScalarMin;
}
if (fClipProxy.fRight >= this->getDrawState().getRenderTarget()->width()) {
fClipProxy.fRight = SK_ScalarMax;
}
if (fClipProxy.fBottom >= this->getDrawState().getRenderTarget()->height()) {
fClipProxy.fBottom = SK_ScalarMax;
}
} else {
fClipProxyState = kInvalid_ClipProxyState;
}
}
if (kValid_ClipProxyState == fClipProxyState) {
return fClipProxy.contains(devBounds);
}
SkPoint originOffset = {SkIntToScalar(this->getClip()->fOrigin.fX),
SkIntToScalar(this->getClip()->fOrigin.fY)};
SkRect clipSpaceBounds = devBounds;
clipSpaceBounds.offset(originOffset);
return this->getClip()->fClipStack->quickContains(clipSpaceBounds);
}
int GrInOrderDrawBuffer::concatInstancedDraw(const DrawInfo& info) {
SkASSERT(info.isInstanced());
const GeometrySrcState& geomSrc = this->getGeomSrc();
const GrDrawState& drawState = this->getDrawState();
// we only attempt to concat the case when reserved verts are used with a client-specified index
// buffer. To make this work with client-specified VBs we'd need to know if the VB was updated
// between draws.
if (kReserved_GeometrySrcType != geomSrc.fVertexSrc ||
kBuffer_GeometrySrcType != geomSrc.fIndexSrc) {
return 0;
}
// Check if there is a draw info that is compatible that uses the same VB from the pool and
// the same IB
if (kDraw_Cmd != strip_trace_bit(fCmds.back())) {
return 0;
}
DrawRecord* draw = &fDraws.back();
GeometryPoolState& poolState = fGeoPoolStateStack.back();
const GrVertexBuffer* vertexBuffer = poolState.fPoolVertexBuffer;
if (!draw->isInstanced() ||
draw->verticesPerInstance() != info.verticesPerInstance() ||
draw->indicesPerInstance() != info.indicesPerInstance() ||
draw->fVertexBuffer != vertexBuffer ||
draw->fIndexBuffer != geomSrc.fIndexBuffer) {
return 0;
}
// info does not yet account for the offset from the start of the pool's VB while the previous
// draw record does.
int adjustedStartVertex = poolState.fPoolStartVertex + info.startVertex();
if (draw->startVertex() + draw->vertexCount() != adjustedStartVertex) {
return 0;
}
SkASSERT(poolState.fPoolStartVertex == draw->startVertex() + draw->vertexCount());
// how many instances can be concat'ed onto draw given the size of the index buffer
int instancesToConcat = this->indexCountInCurrentSource() / info.indicesPerInstance();
instancesToConcat -= draw->instanceCount();
instancesToConcat = SkTMin(instancesToConcat, info.instanceCount());
// update the amount of reserved vertex data actually referenced in draws
size_t vertexBytes = instancesToConcat * info.verticesPerInstance() *
drawState.getVertexSize();
poolState.fUsedPoolVertexBytes = SkTMax(poolState.fUsedPoolVertexBytes, vertexBytes);
draw->adjustInstanceCount(instancesToConcat);
// update last fGpuCmdMarkers to include any additional trace markers that have been added
if (this->getActiveTraceMarkers().count() > 0) {
if (cmd_has_trace_marker(fCmds.back())) {
fGpuCmdMarkers.back().addSet(this->getActiveTraceMarkers());
} else {
fGpuCmdMarkers.push_back(this->getActiveTraceMarkers());
fCmds.back() = add_trace_bit(fCmds.back());
}
}
return instancesToConcat;
}
class AutoClipReenable {
public:
AutoClipReenable() : fDrawState(NULL) {}
~AutoClipReenable() {
if (NULL != fDrawState) {
fDrawState->enableState(GrDrawState::kClip_StateBit);
}
}
void set(GrDrawState* drawState) {
if (drawState->isClipState()) {
fDrawState = drawState;
drawState->disableState(GrDrawState::kClip_StateBit);
}
}
private:
GrDrawState* fDrawState;
};
void GrInOrderDrawBuffer::onDraw(const DrawInfo& info) {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
const GrDrawState& drawState = this->getDrawState();
AutoClipReenable acr;
if (drawState.isClipState() &&
NULL != info.getDevBounds() &&
this->quickInsideClip(*info.getDevBounds())) {
acr.set(this->drawState());
}
if (this->needsNewClip()) {
this->recordClip();
}
if (this->needsNewState()) {
this->recordState();
}
DrawRecord* draw;
if (info.isInstanced()) {
int instancesConcated = this->concatInstancedDraw(info);
if (info.instanceCount() > instancesConcated) {
draw = this->recordDraw(info);
draw->adjustInstanceCount(-instancesConcated);
} else {
return;
}
} else {
draw = this->recordDraw(info);
}
switch (this->getGeomSrc().fVertexSrc) {
case kBuffer_GeometrySrcType:
draw->fVertexBuffer = this->getGeomSrc().fVertexBuffer;
break;
case kReserved_GeometrySrcType: // fallthrough
case kArray_GeometrySrcType: {
size_t vertexBytes = (info.vertexCount() + info.startVertex()) *
drawState.getVertexSize();
poolState.fUsedPoolVertexBytes = SkTMax(poolState.fUsedPoolVertexBytes, vertexBytes);
draw->fVertexBuffer = poolState.fPoolVertexBuffer;
draw->adjustStartVertex(poolState.fPoolStartVertex);
break;
}
default:
SkFAIL("unknown geom src type");
}
draw->fVertexBuffer->ref();
if (info.isIndexed()) {
switch (this->getGeomSrc().fIndexSrc) {
case kBuffer_GeometrySrcType:
draw->fIndexBuffer = this->getGeomSrc().fIndexBuffer;
break;
case kReserved_GeometrySrcType: // fallthrough
case kArray_GeometrySrcType: {
size_t indexBytes = (info.indexCount() + info.startIndex()) * sizeof(uint16_t);
poolState.fUsedPoolIndexBytes = SkTMax(poolState.fUsedPoolIndexBytes, indexBytes);
draw->fIndexBuffer = poolState.fPoolIndexBuffer;
draw->adjustStartIndex(poolState.fPoolStartIndex);
break;
}
default:
SkFAIL("unknown geom src type");
}
draw->fIndexBuffer->ref();
} else {
draw->fIndexBuffer = NULL;
}
}
GrInOrderDrawBuffer::StencilPath::StencilPath() {}
GrInOrderDrawBuffer::DrawPath::DrawPath() {}
GrInOrderDrawBuffer::DrawPaths::DrawPaths() {}
GrInOrderDrawBuffer::DrawPaths::~DrawPaths() {
if (fTransforms) {
SkDELETE_ARRAY(fTransforms);
}
for (int i = 0; i < fPathCount; ++i) {
fPaths[i]->unref();
}
SkDELETE_ARRAY(fPaths);
}
void GrInOrderDrawBuffer::onStencilPath(const GrPath* path, SkPath::FillType fill) {
if (this->needsNewClip()) {
this->recordClip();
}
// Only compare the subset of GrDrawState relevant to path stenciling?
if (this->needsNewState()) {
this->recordState();
}
StencilPath* sp = this->recordStencilPath();
sp->fPath.reset(path);
path->ref();
sp->fFill = fill;
}
void GrInOrderDrawBuffer::onDrawPath(const GrPath* path,
SkPath::FillType fill, const GrDeviceCoordTexture* dstCopy) {
if (this->needsNewClip()) {
this->recordClip();
}
// TODO: Only compare the subset of GrDrawState relevant to path covering?
if (this->needsNewState()) {
this->recordState();
}
DrawPath* cp = this->recordDrawPath();
cp->fPath.reset(path);
path->ref();
cp->fFill = fill;
if (NULL != dstCopy) {
cp->fDstCopy = *dstCopy;
}
}
void GrInOrderDrawBuffer::onDrawPaths(int pathCount, const GrPath** paths,
const SkMatrix* transforms,
SkPath::FillType fill,
SkStrokeRec::Style stroke,
const GrDeviceCoordTexture* dstCopy) {
SkASSERT(pathCount);
if (this->needsNewClip()) {
this->recordClip();
}
if (this->needsNewState()) {
this->recordState();
}
DrawPaths* dp = this->recordDrawPaths();
dp->fPathCount = pathCount;
dp->fPaths = SkNEW_ARRAY(const GrPath*, pathCount);
memcpy(dp->fPaths, paths, sizeof(GrPath*) * pathCount);
for (int i = 0; i < pathCount; ++i) {
dp->fPaths[i]->ref();
}
dp->fTransforms = SkNEW_ARRAY(SkMatrix, pathCount);
memcpy(dp->fTransforms, transforms, sizeof(SkMatrix) * pathCount);
dp->fFill = fill;
dp->fStroke = stroke;
if (NULL != dstCopy) {
dp->fDstCopy = *dstCopy;
}
}
void GrInOrderDrawBuffer::clear(const SkIRect* rect, GrColor color,
bool canIgnoreRect, GrRenderTarget* renderTarget) {
SkIRect r;
if (NULL == renderTarget) {
renderTarget = this->drawState()->getRenderTarget();
SkASSERT(NULL != renderTarget);
}
if (NULL == rect) {
// We could do something smart and remove previous draws and clears to
// the current render target. If we get that smart we have to make sure
// those draws aren't read before this clear (render-to-texture).
r.setLTRB(0, 0, renderTarget->width(), renderTarget->height());
rect = &r;
}
Clear* clr = this->recordClear();
GrColorIsPMAssert(color);
clr->fColor = color;
clr->fRect = *rect;
clr->fCanIgnoreRect = canIgnoreRect;
clr->fRenderTarget = renderTarget;
renderTarget->ref();
}
void GrInOrderDrawBuffer::discard(GrRenderTarget* renderTarget) {
if (!this->caps()->discardRenderTargetSupport()) {
return;
}
if (NULL == renderTarget) {
renderTarget = this->drawState()->getRenderTarget();
SkASSERT(NULL != renderTarget);
}
Clear* clr = this->recordClear();
clr->fColor = GrColor_ILLEGAL;
clr->fRenderTarget = renderTarget;
renderTarget->ref();
}
void GrInOrderDrawBuffer::reset() {
SkASSERT(1 == fGeoPoolStateStack.count());
this->resetVertexSource();
this->resetIndexSource();
int numDraws = fDraws.count();
for (int d = 0; d < numDraws; ++d) {
// we always have a VB, but not always an IB
SkASSERT(NULL != fDraws[d].fVertexBuffer);
fDraws[d].fVertexBuffer->unref();
SkSafeUnref(fDraws[d].fIndexBuffer);
}
fCmds.reset();
fDraws.reset();
fStencilPaths.reset();
fDrawPath.reset();
fDrawPaths.reset();
fStates.reset();
fClears.reset();
fVertexPool.reset();
fIndexPool.reset();
fClips.reset();
fClipOrigins.reset();
fCopySurfaces.reset();
fGpuCmdMarkers.reset();
fClipSet = true;
}
void GrInOrderDrawBuffer::flush() {
if (fFlushing) {
return;
}
this->getContext()->getFontCache()->updateTextures();
SkASSERT(kReserved_GeometrySrcType != this->getGeomSrc().fVertexSrc);
SkASSERT(kReserved_GeometrySrcType != this->getGeomSrc().fIndexSrc);
int numCmds = fCmds.count();
if (0 == numCmds) {
return;
}
GrAutoTRestore<bool> flushRestore(&fFlushing);
fFlushing = true;
fVertexPool.unmap();
fIndexPool.unmap();
GrDrawTarget::AutoClipRestore acr(fDstGpu);
AutoGeometryAndStatePush agasp(fDstGpu, kPreserve_ASRInit);
GrDrawState playbackState;
GrDrawState* prevDrawState = fDstGpu->drawState();
prevDrawState->ref();
fDstGpu->setDrawState(&playbackState);
GrClipData clipData;
int currState = 0;
int currClip = 0;
int currClear = 0;
int currDraw = 0;
int currStencilPath = 0;
int currDrawPath = 0;
int currDrawPaths = 0;
int currCopySurface = 0;
int currCmdMarker = 0;
fDstGpu->saveActiveTraceMarkers();
for (int c = 0; c < numCmds; ++c) {
GrGpuTraceMarker newMarker("", -1);
if (cmd_has_trace_marker(fCmds[c])) {
SkString traceString = fGpuCmdMarkers[currCmdMarker].toString();
newMarker.fMarker = traceString.c_str();
fDstGpu->addGpuTraceMarker(&newMarker);
++currCmdMarker;
}
switch (strip_trace_bit(fCmds[c])) {
case kDraw_Cmd: {
const DrawRecord& draw = fDraws[currDraw];
fDstGpu->setVertexSourceToBuffer(draw.fVertexBuffer);
if (draw.isIndexed()) {
fDstGpu->setIndexSourceToBuffer(draw.fIndexBuffer);
}
fDstGpu->executeDraw(draw);
++currDraw;
break;
}
case kStencilPath_Cmd: {
const StencilPath& sp = fStencilPaths[currStencilPath];
fDstGpu->stencilPath(sp.fPath.get(), sp.fFill);
++currStencilPath;
break;
}
case kDrawPath_Cmd: {
const DrawPath& cp = fDrawPath[currDrawPath];
fDstGpu->executeDrawPath(cp.fPath.get(), cp.fFill,
NULL != cp.fDstCopy.texture() ? &cp.fDstCopy : NULL);
++currDrawPath;
break;
}
case kDrawPaths_Cmd: {
DrawPaths& dp = fDrawPaths[currDrawPaths];
const GrDeviceCoordTexture* dstCopy =
NULL != dp.fDstCopy.texture() ? &dp.fDstCopy : NULL;
fDstGpu->executeDrawPaths(dp.fPathCount, dp.fPaths,
dp.fTransforms, dp.fFill, dp.fStroke,
dstCopy);
++currDrawPaths;
break;
}
case kSetState_Cmd:
fStates[currState].restoreTo(&playbackState);
++currState;
break;
case kSetClip_Cmd:
clipData.fClipStack = &fClips[currClip];
clipData.fOrigin = fClipOrigins[currClip];
fDstGpu->setClip(&clipData);
++currClip;
break;
case kClear_Cmd:
if (GrColor_ILLEGAL == fClears[currClear].fColor) {
fDstGpu->discard(fClears[currClear].fRenderTarget);
} else {
fDstGpu->clear(&fClears[currClear].fRect,
fClears[currClear].fColor,
fClears[currClear].fCanIgnoreRect,
fClears[currClear].fRenderTarget);
}
++currClear;
break;
case kCopySurface_Cmd:
fDstGpu->copySurface(fCopySurfaces[currCopySurface].fDst.get(),
fCopySurfaces[currCopySurface].fSrc.get(),
fCopySurfaces[currCopySurface].fSrcRect,
fCopySurfaces[currCopySurface].fDstPoint);
++currCopySurface;
break;
}
if (cmd_has_trace_marker(fCmds[c])) {
fDstGpu->removeGpuTraceMarker(&newMarker);
}
}
fDstGpu->restoreActiveTraceMarkers();
// we should have consumed all the states, clips, etc.
SkASSERT(fStates.count() == currState);
SkASSERT(fClips.count() == currClip);
SkASSERT(fClipOrigins.count() == currClip);
SkASSERT(fClears.count() == currClear);
SkASSERT(fDraws.count() == currDraw);
SkASSERT(fCopySurfaces.count() == currCopySurface);
SkASSERT(fGpuCmdMarkers.count() == currCmdMarker);
fDstGpu->setDrawState(prevDrawState);
prevDrawState->unref();
this->reset();
++fDrawID;
}
bool GrInOrderDrawBuffer::onCopySurface(GrSurface* dst,
GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint) {
if (fDstGpu->canCopySurface(dst, src, srcRect, dstPoint)) {
CopySurface* cs = this->recordCopySurface();
cs->fDst.reset(SkRef(dst));
cs->fSrc.reset(SkRef(src));
cs->fSrcRect = srcRect;
cs->fDstPoint = dstPoint;
return true;
} else {
return false;
}
}
bool GrInOrderDrawBuffer::onCanCopySurface(GrSurface* dst,
GrSurface* src,
const SkIRect& srcRect,
const SkIPoint& dstPoint) {
return fDstGpu->canCopySurface(dst, src, srcRect, dstPoint);
}
void GrInOrderDrawBuffer::initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* desc) {
fDstGpu->initCopySurfaceDstDesc(src, desc);
}
void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(int vertexCount,
int indexCount) {
// We use geometryHints() to know whether to flush the draw buffer. We
// can't flush if we are inside an unbalanced pushGeometrySource.
// Moreover, flushing blows away vertex and index data that was
// previously reserved. So if the vertex or index data is pulled from
// reserved space and won't be released by this request then we can't
// flush.
bool insideGeoPush = fGeoPoolStateStack.count() > 1;
bool unreleasedVertexSpace =
!vertexCount &&
kReserved_GeometrySrcType == this->getGeomSrc().fVertexSrc;
bool unreleasedIndexSpace =
!indexCount &&
kReserved_GeometrySrcType == this->getGeomSrc().fIndexSrc;
// we don't want to finalize any reserved geom on the target since
// we don't know that the client has finished writing to it.
bool targetHasReservedGeom = fDstGpu->hasReservedVerticesOrIndices();
int vcount = vertexCount;
int icount = indexCount;
if (!insideGeoPush &&
!unreleasedVertexSpace &&
!unreleasedIndexSpace &&
!targetHasReservedGeom &&
this->geometryHints(&vcount, &icount)) {
this->flush();
}
}
bool GrInOrderDrawBuffer::geometryHints(int* vertexCount,
int* indexCount) const {
// we will recommend a flush if the data could fit in a single
// preallocated buffer but none are left and it can't fit
// in the current buffer (which may not be prealloced).
bool flush = false;
if (NULL != indexCount) {
int32_t currIndices = fIndexPool.currentBufferIndices();
if (*indexCount > currIndices &&
(!fIndexPool.preallocatedBuffersRemaining() &&
*indexCount <= fIndexPool.preallocatedBufferIndices())) {
flush = true;
}
*indexCount = currIndices;
}
if (NULL != vertexCount) {
size_t vertexSize = this->getDrawState().getVertexSize();
int32_t currVertices = fVertexPool.currentBufferVertices(vertexSize);
if (*vertexCount > currVertices &&
(!fVertexPool.preallocatedBuffersRemaining() &&
*vertexCount <= fVertexPool.preallocatedBufferVertices(vertexSize))) {
flush = true;
}
*vertexCount = currVertices;
}
return flush;
}
bool GrInOrderDrawBuffer::onReserveVertexSpace(size_t vertexSize,
int vertexCount,
void** vertices) {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
SkASSERT(vertexCount > 0);
SkASSERT(NULL != vertices);
SkASSERT(0 == poolState.fUsedPoolVertexBytes);
*vertices = fVertexPool.makeSpace(vertexSize,
vertexCount,
&poolState.fPoolVertexBuffer,
&poolState.fPoolStartVertex);
return NULL != *vertices;
}
bool GrInOrderDrawBuffer::onReserveIndexSpace(int indexCount, void** indices) {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
SkASSERT(indexCount > 0);
SkASSERT(NULL != indices);
SkASSERT(0 == poolState.fUsedPoolIndexBytes);
*indices = fIndexPool.makeSpace(indexCount,
&poolState.fPoolIndexBuffer,
&poolState.fPoolStartIndex);
return NULL != *indices;
}
void GrInOrderDrawBuffer::releaseReservedVertexSpace() {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
const GeometrySrcState& geoSrc = this->getGeomSrc();
// If we get a release vertex space call then our current source should either be reserved
// or array (which we copied into reserved space).
SkASSERT(kReserved_GeometrySrcType == geoSrc.fVertexSrc ||
kArray_GeometrySrcType == geoSrc.fVertexSrc);
// When the caller reserved vertex buffer space we gave it back a pointer
// provided by the vertex buffer pool. At each draw we tracked the largest
// offset into the pool's pointer that was referenced. Now we return to the
// pool any portion at the tail of the allocation that no draw referenced.
size_t reservedVertexBytes = geoSrc.fVertexSize * geoSrc.fVertexCount;
fVertexPool.putBack(reservedVertexBytes -
poolState.fUsedPoolVertexBytes);
poolState.fUsedPoolVertexBytes = 0;
poolState.fPoolVertexBuffer = NULL;
poolState.fPoolStartVertex = 0;
}
void GrInOrderDrawBuffer::releaseReservedIndexSpace() {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
const GeometrySrcState& geoSrc = this->getGeomSrc();
// If we get a release index space call then our current source should either be reserved
// or array (which we copied into reserved space).
SkASSERT(kReserved_GeometrySrcType == geoSrc.fIndexSrc ||
kArray_GeometrySrcType == geoSrc.fIndexSrc);
// Similar to releaseReservedVertexSpace we return any unused portion at
// the tail
size_t reservedIndexBytes = sizeof(uint16_t) * geoSrc.fIndexCount;
fIndexPool.putBack(reservedIndexBytes - poolState.fUsedPoolIndexBytes);
poolState.fUsedPoolIndexBytes = 0;
poolState.fPoolIndexBuffer = NULL;
poolState.fPoolStartIndex = 0;
}
void GrInOrderDrawBuffer::onSetVertexSourceToArray(const void* vertexArray,
int vertexCount) {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
SkASSERT(0 == poolState.fUsedPoolVertexBytes);
#ifdef SK_DEBUG
bool success =
#endif
fVertexPool.appendVertices(this->getVertexSize(),
vertexCount,
vertexArray,
&poolState.fPoolVertexBuffer,
&poolState.fPoolStartVertex);
GR_DEBUGASSERT(success);
}
void GrInOrderDrawBuffer::onSetIndexSourceToArray(const void* indexArray,
int indexCount) {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
SkASSERT(0 == poolState.fUsedPoolIndexBytes);
#ifdef SK_DEBUG
bool success =
#endif
fIndexPool.appendIndices(indexCount,
indexArray,
&poolState.fPoolIndexBuffer,
&poolState.fPoolStartIndex);
GR_DEBUGASSERT(success);
}
void GrInOrderDrawBuffer::releaseVertexArray() {
// When the client provides an array as the vertex source we handled it
// by copying their array into reserved space.
this->GrInOrderDrawBuffer::releaseReservedVertexSpace();
}
void GrInOrderDrawBuffer::releaseIndexArray() {
// When the client provides an array as the index source we handled it
// by copying their array into reserved space.
this->GrInOrderDrawBuffer::releaseReservedIndexSpace();
}
void GrInOrderDrawBuffer::geometrySourceWillPush() {
GeometryPoolState& poolState = fGeoPoolStateStack.push_back();
poolState.fUsedPoolVertexBytes = 0;
poolState.fUsedPoolIndexBytes = 0;
#ifdef SK_DEBUG
poolState.fPoolVertexBuffer = (GrVertexBuffer*)~0;
poolState.fPoolStartVertex = ~0;
poolState.fPoolIndexBuffer = (GrIndexBuffer*)~0;
poolState.fPoolStartIndex = ~0;
#endif
}
void GrInOrderDrawBuffer::geometrySourceWillPop(
const GeometrySrcState& restoredState) {
SkASSERT(fGeoPoolStateStack.count() > 1);
fGeoPoolStateStack.pop_back();
GeometryPoolState& poolState = fGeoPoolStateStack.back();
// we have to assume that any slack we had in our vertex/index data
// is now unreleasable because data may have been appended later in the
// pool.
if (kReserved_GeometrySrcType == restoredState.fVertexSrc ||
kArray_GeometrySrcType == restoredState.fVertexSrc) {
poolState.fUsedPoolVertexBytes = restoredState.fVertexSize * restoredState.fVertexCount;
}
if (kReserved_GeometrySrcType == restoredState.fIndexSrc ||
kArray_GeometrySrcType == restoredState.fIndexSrc) {
poolState.fUsedPoolIndexBytes = sizeof(uint16_t) *
restoredState.fIndexCount;
}
}
bool GrInOrderDrawBuffer::needsNewState() const {
return fStates.empty() || !fStates.back().isEqual(this->getDrawState());
}
bool GrInOrderDrawBuffer::needsNewClip() const {
SkASSERT(fClips.count() == fClipOrigins.count());
if (this->getDrawState().isClipState()) {
if (fClipSet &&
(fClips.empty() ||
fClips.back() != *this->getClip()->fClipStack ||
fClipOrigins.back() != this->getClip()->fOrigin)) {
return true;
}
}
return false;
}
void GrInOrderDrawBuffer::addToCmdBuffer(uint8_t cmd) {
SkASSERT(!cmd_has_trace_marker(cmd));
const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers();
if (activeTraceMarkers.count() > 0) {
fCmds.push_back(add_trace_bit(cmd));
fGpuCmdMarkers.push_back(activeTraceMarkers);
} else {
fCmds.push_back(cmd);
}
}
void GrInOrderDrawBuffer::recordClip() {
fClips.push_back(*this->getClip()->fClipStack);
fClipOrigins.push_back() = this->getClip()->fOrigin;
fClipSet = false;
this->addToCmdBuffer(kSetClip_Cmd);
}
void GrInOrderDrawBuffer::recordState() {
fStates.push_back().saveFrom(this->getDrawState());
this->addToCmdBuffer(kSetState_Cmd);
}
GrInOrderDrawBuffer::DrawRecord* GrInOrderDrawBuffer::recordDraw(const DrawInfo& info) {
this->addToCmdBuffer(kDraw_Cmd);
return &fDraws.push_back(info);
}
GrInOrderDrawBuffer::StencilPath* GrInOrderDrawBuffer::recordStencilPath() {
this->addToCmdBuffer(kStencilPath_Cmd);
return &fStencilPaths.push_back();
}
GrInOrderDrawBuffer::DrawPath* GrInOrderDrawBuffer::recordDrawPath() {
this->addToCmdBuffer(kDrawPath_Cmd);
return &fDrawPath.push_back();
}
GrInOrderDrawBuffer::DrawPaths* GrInOrderDrawBuffer::recordDrawPaths() {
this->addToCmdBuffer(kDrawPaths_Cmd);
return &fDrawPaths.push_back();
}
GrInOrderDrawBuffer::Clear* GrInOrderDrawBuffer::recordClear() {
this->addToCmdBuffer(kClear_Cmd);
return &fClears.push_back();
}
GrInOrderDrawBuffer::CopySurface* GrInOrderDrawBuffer::recordCopySurface() {
this->addToCmdBuffer(kCopySurface_Cmd);
return &fCopySurfaces.push_back();
}
void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) {
INHERITED::clipWillBeSet(newClipData);
fClipSet = true;
fClipProxyState = kUnknown_ClipProxyState;
}
|
[
"[email protected]"
] | |
12a59952d2ab7224735c8edb0079f02139e59924
|
41ee2d69b6af0a3200178d7930e74e58cc43b742
|
/src/function/functionbase.h
|
cae9f0bd90ce3f6b9b81406abd93185f269fdf1e
|
[] |
no_license
|
jylc/TSTL
|
a54efe5db6bf4b8f816c09a7512319f69540c80f
|
a3445bc4976d9b5fc0b5947e1e092cf2077149d2
|
refs/heads/master
| 2022-12-11T16:20:11.925921 | 2020-08-31T02:49:43 | 2020-08-31T02:49:43 | 288,062,242 | 0 | 0 | null | null | null | null |
GB18030
|
C++
| false | false | 859 |
h
|
#pragma once
#ifndef _FUNCTIONBASE_H_
#define _FUNCTIONBASE_H_
namespace TSTL
{
//仿函数
/*
* unary_function 用来呈现一元函数的参数类型和返回值类型
* TL 规定,每一个 adaptable unaty function 都应该继承 unary_function
*/
template <typename _Arg,typename _Result>
struct unary_function
{
typedef _Arg argument_type;
typedef _Result result_type;
};
/*
* binary_function 用来呈现二元函数的第一个参数类型、第二个参数类型、返回值类型
* STL 规定,每一个 adaptable binary function 都应该继承 binary_function
*/
template<typename _Arg1,typename _Arg2,typename _Result>
struct binary_function
{
typedef _Arg1 first_argument_type;
typedef _Arg2 second_argument_type;
typedef _Result result_type;
};
}
#endif // !_FUNCTIONBASE_H_
|
[
"[email protected]"
] | |
9ef9ab483b5afcbe8668a1caeca8b9db9c4cb437
|
258266ae9f3858ee0fb66a3049d0044b970c4428
|
/design.cpp
|
60b7f83d72e38e4dc4051959834cbecbb12c540b
|
[] |
no_license
|
mcchu/firmware-initializer
|
01924c63e99bbd81b2715140b2357b01c4d011dd
|
71fb6067b8dbcddf48327068b1c31f85bef8065b
|
refs/heads/master
| 2021-01-13T03:57:56.948072 | 2017-01-06T02:35:32 | 2017-01-06T02:35:32 | 78,158,721 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 13,148 |
cpp
|
#include <ostream>
#include <vector>
#include <map>
#include <string>
#include "gates.h"
#include "net.h"
#include "design.h"
using namespace std;
// Constructor @param[in] n module name of the design
Design::Design(string n) : desname(n) { }
//Destructor
Design::~Design()
{
// dealloc memory from maps
map<string, Net*>::iterator it;
for (it = designNets.begin(); it != designNets.end(); ++it)
{
delete it->second;
designNets.erase(it);
}
map<string, Gate*>::iterator it1;
for (it1 = designGates.begin(); it1 != designGates.end(); ++it1)
{
delete it1->second;
designGates.erase(it1);
}
// dealloc pointer to vectors <<------????
}
// Returns the name of the Design
// @return module name of the design
string Design::name()
{
return desname;
}
//Adds the primary input with the given name to the internal database @param[in] n name of the PI
void Design::addPI(string n)
{
pis.push_back(n);
}
//Adds the primary output with the given name to the internal database @param[in] n name of the PI
void Design::addPO(string n)
{
pos.push_back(n); // <<-----valgrind error: at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
}
// Returns a pointer to the net with the given name or NULL if that net doesn't exist
// @param[in] net_name name of the Net to find
// @return Pointer to a Net object or NULL
Net* Design::findNet(string net_name)
{
if (designNets.find(net_name) != designNets.end())
{
return (designNets.find(net_name))->second;
}
return NULL;
}
// Returns a pointer to the gate with the given name or NULL if that gate doesn't exist
// @param[in] inst_name name of the Gate instance to find
// @return Pointer to a Gate object or NULL
Gate* Design::findGate(string inst_name)
{
if (designGates.find(inst_name) != designGates.end())
{
return (designGates.find(inst_name))->second;
}
return NULL;
}
//Checks if a Net with the given name exists already, returning a pointer to it if it does.
//It not, it creates a new Net object and returns a pointer to that new object
// @param[in] n Name of the gate to find/create
// @return Pointer to the Net object
Net* Design::addFindNet(string n)
{
//map<string, Net*>::iterator it;
if (designNets.find(n) == designNets.end())
{
Net* net = new Net(n); // <<--------how to dealloc???
designNets.insert(make_pair(n, net));
return net;
}
return designNets.find(n)->second;
}
// Checks if a gate with the given instance name exists already, returning a pointer to it if it does.
// It not, it creates a new Gate object of the given type and name and returns a pointer to that new object
// @param[in] gtype Integer/Enumeration value of the type of gate to create
// @param[in] g Instance name of the gate to find/create
// @return Pointer to the Gate object
Gate* Design::addFindGate(int gtype, string g)
{
if (designGates.find(g) == designGates.end())
{
/*type gt;
string val = gt(gtype);
gt(gtype)* gate = new (gt(gtype)(g));
designGates.insert(make_pair(g, gate));
return gate;*/
//type gtype = static_cast<type>(gtype);
if (gtype == AND)
{
And* a = new And(g,1);
designGates.insert(make_pair(g, a));
return a;
}
if (gtype == OR)
{
Or* b = new Or(g,1);
designGates.insert(make_pair(g, b));
return b;
}
if (gtype == NAND)
{
Nand* c = new Nand(g,1);
designGates.insert(make_pair(g, c));
return c;
}
if (gtype == NOR)
{
Nor* d = new Nor(g,1);
designGates.insert(make_pair(g, d));
return d;
}
if (gtype == XOR)
{
Xor* e = new Xor(g,1);
designGates.insert(make_pair(g, e));
return e;
}
if (gtype == NOT)
{
Not* f = new Not(g,1);
designGates.insert(make_pair(g, f));
return f;
}
}
return designGates.find(g)->second;
}
// Same as addFindGate above but if a gate is created the delay value provided will be used
// @param[in] gtype Integer/Enumeration value of the type of gate to create @param[in] g Instance name of the gate to find/create
// @param[in] d Delay value @return Pointer to a Gate object
Gate* Design::addFindGate(int gtype, string g, int d)
{
if (designGates.find(g) == designGates.end())
{
/*type gt;
gtype* gate = new Gate(g, d);
designGates.insert(make_pair(g, gate));
return gate;*/
if (gtype == AND)
{
And* a = new And(g,d);
designGates.insert(make_pair(g, a));
return a;
}
if (gtype == OR)
{
Or* b = new Or(g,d);
designGates.insert(make_pair(g, b));
return b;
}
if (gtype == NAND)
{
Nand* c = new Nand(g,d);
designGates.insert(make_pair(g, c));
return c;
}
if (gtype == NOR)
{
Nor* x = new Nor(g,d);
designGates.insert(make_pair(g, x));
return x;
}
if (gtype == XOR)
{
Xor* e = new Xor(g,d);
designGates.insert(make_pair(g, e));
return e;
}
if (gtype == NOT)
{
Not* f = new Not(g,d);
designGates.insert(make_pair(g, f));
return f;
}
}
return designGates.find(g)->second;
}
// Dynamically allocates a new vector and adds pointers to all Nets that correspond to primary inputs into the vector and then
// returns a pointer to the vector
// @return Pointer to a new vector storing Net pointers
vector<Net *>* Design::getPINets()
{
vector<Net *>* PINet = new vector<Net *>;
for (unsigned int i = 0; i < pis.size(); i++)
{
PINet->push_back(addFindNet(pis[i])); //addFindNet or findNet? not sure about implementation
}
return PINet;
}
// Dynamically allocates a new vector and adds pointers to all Nets that correspond to primary
// outputs into the vector and then returns a pointer to the vector @return Pointer to a new vector storing Net pointers
vector<Net *> * Design::getPONets()
{
vector <Net * >* PONet = new vector < Net*> ;
for (unsigned int i = 0; i < pos.size(); i++)
{
PONet->push_back(addFindNet(pos[i]));
}
return PONet;
}
// Dynamically allocates a new vector and adds pointers to all Nets that correspond to internal wires into the vector
// and then returns a pointer to the vector @return Pointer to a new vector storing Net pointers
vector<Net *> * Design::getWireNets()
{
vector <Net* > * WIRENet = new vector <Net*>;
map<string, Net *>::iterator it;
for(it = designNets.begin(); it != designNets.end(); ++it)
{
bool flag = true;
bool flag1 = true;
for(unsigned int i = 0; i < pis.size(); i++)
{
//cout << "not PIS" <<endl;
//if(findNet(it->first) == NULL)
if(it->first == pis[i] && flag && flag1) //if Net* IS an input...
{
flag = false;
}
//cout << pis[i] << endl;
}
for(unsigned int i = 0; i < pos.size(); i++)
{
//cout << "not POS " << endl;
//if(findNet(pos[i]) == NULL)
if(it->first == pos[i] && flag1 && flag)
{
flag1 = false;
}
//cout << pos[i] << endl;
}
if(flag && flag1)
{
//Net* wire_net = new Net(it->first); // <<----
WIRENet->push_back(it->second);
}
}
return WIRENet;
}
// Dynamically allocates a new vector and adds pointers to all Nets (PI, PO, internal wire) into the vector and then
// returns a pointer to the vector @return Pointer to a new vector storing Net pointers
vector<Net *> * Design::allNets()
{
vector <Net* >* allNet = new vector <Net* >;
vector<Net* >::iterator it0, it1, it2; //vector<Net*>*?
vector<Net *> *a = getPINets(); // <<--------need to delete?!?
vector<Net *> *b = getPONets();
vector<Net *> *w = getWireNets();
for(it0 = a->begin() ; it0 != a->end(); ++it0)
{
allNet->push_back(*it0);
}
for(it1 = b->begin(); it1 != b->end(); ++it1)
{
allNet->push_back(*it1);
}
for(it2 = w->begin(); it2 != w->end(); ++it2)
{
allNet->push_back(*it2);
}
delete a;
delete b;
delete w;
return allNet;
}
// Dynamically allocates a new vector and adds pointers to all Gates into the vector and then returns a pointer to the vector
//@return Pointer to a new vector storing Gate pointers
vector<Gate *> *Design::allGates()
{
vector<Gate *>* allgates = new vector<Gate *>;
map<string, Gate*>::iterator it;
for (it = designGates.begin(); it != designGates.end(); ++it)
{
allgates->push_back(it->second);
}
return allgates;
}
/**
* To be implemented in Part 2. For Part 1 just return NULL
*
* Performs a topological sorting of the nets in the design
* and returns a dynamically allocated vector with pointers
* to Net objects in a satisfactory topological order
*
* @return Pointer to a new vector storing Net pointers
*/
vector<Net *> * Design::toposort()
{
map<string, int> colormap;
vector<Net*>* temp = allNets(); //pointer to a net*
vector<Net*>::iterator it;
for (it = temp->begin(); it != temp->end(); ++it)
{
colormap.insert(make_pair(((*it)->name()), 0)); //sets all to white
}
vector<Net*>* finish = new vector<Net*>;
for(it = temp->begin(); it != temp->end(); ++it)
{
if(colormap[((*it)->name())] == 0)
{
dfs_visit(*it, finish, colormap);
}
}
delete temp;
return finish;
}
//Recreates the Verilog description of the design dumping it to the provided ostream
// @param[in] os Ostream representing a file, stdout, or stringstream to which the Verilog description should be output
void Design::dump(ostream &os)
{
//module name (inputs, outputs)
os << "module " << name() <<"(";
for (unsigned int i = 0; i < pis.size(); i++)
{
os << pis[i] << ",";
}
for (unsigned int i = 0; i < pos.size(); i++)
{
if( i < pos.size()-1 ) os << pos[i] << ",";
else os << pos[i];
}
os << ");" << endl;
//input NAME
for(unsigned int i = 0; i < pis.size(); i++)
{
os << "\tinput " << pis[i] << ";" << endl;
}
//OUTPUT NAME
for(unsigned int i = 0; i < pos.size(); i++)
{
os << "\toutput " << pos[i]<< ";" << endl;
}
os << endl;
//wire NAME
vector <Net* > *w = getWireNets();
for(unsigned int i = 0; i < w->size(); i++)
{
os << "\twire " << (w->at(i))->name() << ";" << endl;
}
os << endl;
// dealloc getWireNets()
/*vector <Net* >*::iterator v;
for (v = w->begin(); v != w->end(); ++v)
{
delete *v;
}*/
delete w;
//vector<Net*>::iterator it0;
//vector<Gate*>::iterator it1;
/*
for(it0 = allNets()->begin(); it0 != allNets()->end(); ++it0) //<---??
{
os << (*it0)->name();
os << endl;
}*/
// GATES DUMP
map<string, Gate*>::iterator it;
for (it = designGates.begin(); it != designGates.end(); ++it)
{
os << "\t";
(it->second)->dump(os);
}
//os << endl;
os << "endmodule";
/*for(it1 = allGates()->begin(); it1 != allGates()->end(); ++it1)
{
//os << (*it1)->name();
//os << endl;
it1->dump();
}*/
}
//Checks if the given Net object represents a primary input
//@param[in] n Pointer to the Net
//@return true if the Net is a primary input, false otherwise
bool Design::isPI(Net *n)
{
vector<Net*>::iterator it; //vector<Net*> *??
vector<Net *> *a = getPINets();
for(it = a->begin() ; it != a->end(); ++it)
{
if (n == *it)
{
return true;
}
}
delete a;
return false;
}
// Checks if the given Net object represents a primary output @param[in] n Pointer to the Net
// @return true if the Net is a primary output, false otherwise
bool Design::isPO(Net *n)
{
vector<Net* >::iterator it;
vector<Net *> *b = getPONets();
for(it = b->begin() ; it != b->end(); ++it)
{
if (n == *it)
{
return true;
}
}
delete b;
return false;
}
/**
* To be implemented in Part 2. For Part 1 just return
*
* Recursive helper function to perform the depth-first search
* of nets
*
* @param[in] n Pointer to the current Net on which the DFS is visiting
* @param[out] flist Stores the Nets as they are finished...this is the
* ordering after the topological sort finishes
* @param[inout] colormap Maps the net name to its visited color
*/
void Design::dfs_visit(Net *n, vector<Net *> *flist, map<string, int> &colormap)
{
colormap[n->name()] = 1; //initialize to gray
vector<Gate*>::iterator it;
vector<Gate*>* temp = n->getDrivers(); // returns drivers of this net (pointer to a vector)
//for(it = (n->temp).begin(); it != (n->temp).end(); ++it)
for(it = temp->begin(); it != temp->end(); ++it)
{
//cout << (*it)->name() << endl; // debug gate name
/*if (colormap[((*it)->getOutput())->name()] == 0) //if adj is white
{
cout << colormap[((*it)->getOutput())->name()] << endl; // debug
dfs_visit(((*it)->getOutput()), flist, colormap); //call recursively
}*/
vector<Net *> *get_ins = (*it)->getInputs();
vector<Net*>::iterator jt;
for(jt = get_ins->begin(); jt != get_ins->end(); ++jt)
{
if (colormap[(*jt)->name()] == 0) //if adj is white
{
dfs_visit(*jt, flist, colormap); //call recursively
}
}
delete get_ins;
}
colormap[n->name()] = 2; //changes color to black
flist->push_back(n); //adds to our finished list
delete temp;
}
|
[
"[email protected]"
] | |
803414c254094bbc4a63335744c3053a5a00078d
|
46fe0f55257e00fe75c3a1ebfc72c011735ca8f0
|
/src/Application/ImageKitPlugins/ImageKitEffects/ImageKitEffectsPlugin.cpp
|
9213c2c33f28f5b483f6901cfbcf6701e65e62bc
|
[] |
no_license
|
Stepdan/ImageKit
|
45b26c85145b2d8ffc06b398ce04245b8a4152f2
|
44ffe1f93d0493432b1e5e2d17f3ca7c08850a63
|
refs/heads/master
| 2020-06-07T14:12:04.566877 | 2019-06-25T10:40:17 | 2019-06-25T10:40:17 | 193,039,325 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,593 |
cpp
|
#include <QPointer>
#include <QToolButton>
#include <QWidget>
#include "src/Application/ImageKitPlugins/Interfaces/ImageKitAction.h"
#include "src/Application/ImageKitPlugins/ImageKitUtil/UI/PluginButton.h"
#include "UI/ImageKitEffectsWidget.h"
#include "ImageKitEffectsPlugin.h"
namespace ImageKit{
class ImageKitEffectsPlugin::Impl : public QObject
{
Q_OBJECT
public:
Impl(QWidget* parent = nullptr)
: m_widget(new ImageKitEffectsWidget(parent))
, m_button(new PluginButton(PluginType::Effects, parent))
{}
QToolButton* GetButton() const { return m_button; }
QWidget* GetWidget() const { return m_widget; }
private:
QPointer<QWidget> m_widget;
QPointer<QToolButton> m_button;
};
//.............................................................................
ImageKitEffectsPlugin::ImageKitEffectsPlugin(QWidget* parent)
: m_impl(new Impl(parent))
{
}
//.............................................................................
ImageKitEffectsPlugin::~ImageKitEffectsPlugin() = default;
//.............................................................................
PluginType ImageKitEffectsPlugin::GetPluginType() const noexcept
{
return PluginType::Effects;
}
//.............................................................................
QWidget* ImageKitEffectsPlugin::GetPluginWidget() const
{
return m_impl ? m_impl->GetWidget() : nullptr;
}
//.............................................................................
QToolButton* ImageKitEffectsPlugin::GetPluginButton() const
{
return m_impl ? m_impl->GetButton() : nullptr;
}
}
|
[
"[email protected]"
] | |
5ff85d5f6da70db347e49379c125b077f65cc502
|
c1a2befc19abff0cb476618e33004a2c8ed3b01f
|
/tensorflow/core/lib/io/zlib_inputstream.cc
|
b13931c440213b5619c2e398cf43af56ed0d535d
|
[
"Apache-2.0"
] |
permissive
|
SatishGitHubs/TensorFlow
|
842ede88c31157ab886c8e01b91f3170c38d5395
|
422b17b34f4f1380d2e487b3509bb97ff726edca
|
refs/heads/master
| 2022-10-20T05:14:39.748631 | 2016-09-20T13:19:29 | 2016-09-20T13:19:29 | 68,717,129 | 0 | 1 |
Apache-2.0
| 2022-09-30T19:31:40 | 2016-09-20T13:55:53 |
C++
|
UTF-8
|
C++
| false | false | 6,433 |
cc
|
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/core/lib/io/zlib_inputstream.h"
#include "tensorflow/core/lib/strings/strcat.h"
#include "tensorflow/core/platform/logging.h"
namespace tensorflow {
namespace io {
ZlibInputStream::ZlibInputStream(
InputStreamInterface* input_stream,
size_t input_buffer_bytes, // size of z_stream.next_in buffer
size_t output_buffer_bytes, // size of z_stream.next_out buffer
const ZlibCompressionOptions& zlib_options)
: input_stream_(input_stream),
input_buffer_capacity_(input_buffer_bytes),
output_buffer_capacity_(output_buffer_bytes),
z_stream_input_(new Bytef[input_buffer_capacity_]),
z_stream_output_(new Bytef[output_buffer_capacity_]),
zlib_options_(zlib_options),
z_stream_(new z_stream) {
memset(z_stream_.get(), 0, sizeof(z_stream));
z_stream_->zalloc = Z_NULL;
z_stream_->zfree = Z_NULL;
z_stream_->opaque = Z_NULL;
z_stream_->next_in = Z_NULL;
z_stream_->avail_in = 0;
int status = inflateInit2(z_stream_.get(), zlib_options_.window_bits);
if (status != Z_OK) {
LOG(FATAL) << "inflateInit failed with status " << status;
z_stream_.reset(NULL);
} else {
z_stream_->next_in = z_stream_input_.get();
z_stream_->next_out = z_stream_output_.get();
next_unread_byte_ = reinterpret_cast<char*>(z_stream_output_.get());
z_stream_->avail_in = 0;
z_stream_->avail_out = output_buffer_capacity_;
}
}
ZlibInputStream::~ZlibInputStream() {
if (z_stream_.get()) {
inflateEnd(z_stream_.get());
}
}
Status ZlibInputStream::ReadFromStream() {
int bytes_to_read = input_buffer_capacity_;
char* read_location = reinterpret_cast<char*>(z_stream_input_.get());
// If there are unread bytes in the input stream we move them to the head
// of the stream to maximize the space available to read new data into.
if (z_stream_->avail_in > 0) {
uLong read_bytes = z_stream_->next_in - z_stream_input_.get();
// Remove `read_bytes` from the head of the input stream.
// Move unread bytes to the head of the input stream.
if (read_bytes > 0) {
memmove(z_stream_input_.get(), z_stream_->next_in, z_stream_->avail_in);
}
bytes_to_read -= z_stream_->avail_in;
read_location += z_stream_->avail_in;
}
string data;
// Try to read enough data to fill up z_stream_input_.
// TODO(rohanj): Add a char* version of ReadNBytes to InputStreamInterface
// and use that instead to make this more efficient.
Status s = input_stream_->ReadNBytes(bytes_to_read, &data);
memcpy(read_location, data.data(), data.size());
// Since we moved unread data to the head of the input stream we can point
// next_in to the head of the input stream.
z_stream_->next_in = z_stream_input_.get();
// Note: data.size() could be different from bytes_to_read.
z_stream_->avail_in += data.size();
if (!s.ok() && !errors::IsOutOfRange(s)) {
return s;
}
// We throw OutOfRange error iff no new data has been read from stream.
// Since we never check how much data is remaining in the stream, it is
// possible that on the last read there isn't enough data in the stream to
// fill up the buffer in which case input_stream_->ReadNBytes would return an
// OutOfRange error.
if (data.size() == 0) {
return errors::OutOfRange("EOF reached");
}
if (errors::IsOutOfRange(s)) {
return Status::OK();
}
return s;
}
size_t ZlibInputStream::ReadBytesFromCache(size_t bytes_to_read,
string* result) {
size_t unread_bytes =
reinterpret_cast<char*>(z_stream_->next_out) - next_unread_byte_;
size_t can_read_bytes = std::min(bytes_to_read, unread_bytes);
if (can_read_bytes > 0) {
result->append(next_unread_byte_, can_read_bytes);
next_unread_byte_ += can_read_bytes;
}
return can_read_bytes;
}
size_t ZlibInputStream::NumUnreadBytes() const {
size_t read_bytes =
next_unread_byte_ - reinterpret_cast<char*>(z_stream_output_.get());
return output_buffer_capacity_ - z_stream_->avail_out - read_bytes;
}
Status ZlibInputStream::ReadNBytes(int64 bytes_to_read, string* result) {
result->clear();
// Read as many bytes as possible from cache.
bytes_to_read -= ReadBytesFromCache(bytes_to_read, result);
while (bytes_to_read > 0) {
// At this point we can be sure that cache has been emptied.
DCHECK_EQ(NumUnreadBytes(), 0);
// Now that the cache is empty we need to inflate more data.
// Step 1. Fill up input buffer.
// We read from stream only after the previously read contents have been
// completely consumed. This is an optimization and can be removed if
// it causes problems. `ReadFromStream` is capable of handling partially
// filled up buffers.
if (z_stream_->avail_in == 0) {
TF_RETURN_IF_ERROR(ReadFromStream());
}
// Step 2. Setup output stream.
z_stream_->next_out = z_stream_output_.get();
next_unread_byte_ = reinterpret_cast<char*>(z_stream_output_.get());
z_stream_->avail_out = output_buffer_capacity_;
// Step 3. Inflate Inflate Inflate!
TF_RETURN_IF_ERROR(Inflate());
bytes_to_read -= ReadBytesFromCache(bytes_to_read, result);
}
return Status::OK();
}
// TODO(srbs): Implement this.
int64 ZlibInputStream::Tell() const { return -1; }
Status ZlibInputStream::Inflate() {
int error = inflate(z_stream_.get(), zlib_options_.flush_mode);
if (error != Z_OK && error != Z_STREAM_END) {
string error_string =
strings::StrCat("inflate() failed with error ", error);
if (z_stream_->msg != NULL) {
strings::StrAppend(&error_string, ": ", z_stream_->msg);
}
return errors::DataLoss(error_string);
}
return Status::OK();
}
} // namespace io
} // namespace tensorflow
|
[
"[email protected]"
] | |
16e43a4c59068befda231a435b33e3ee9990939b
|
8d349418e75216a70592b90bd13cdc7eb7448cc4
|
/constructor/singleton.cc
|
f724f99439839e262662902078ce37dcc0257691
|
[] |
no_license
|
wenjinwong/designPattern
|
d324353b18fe3ffdc7cd2a6a7309ae9194981052
|
309c8d47eab240e2fb34ffffc71d9d1975a79753
|
refs/heads/master
| 2020-09-02T02:00:46.434615 | 2019-11-04T12:51:31 | 2019-11-04T12:51:31 | 219,108,843 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 375 |
cc
|
#include<iostream>
class singleton {
public:
static singleton *instance() {
if(!_instance) {
_instance = new singleton;
}
return _instance;
}
protected:
singleton() {}
private:
static singleton *_instance;
};
singleton *singleton::_instance = 0;
// if not exist, then create it.
int
main()
{
std::cout << singleton::instance();
}
|
[
"[email protected]"
] | |
a4b302731f3960f893e371dbe7f38536accc706a
|
156fd1d7888faa8b72cff025201641182f8e23a9
|
/src/qt/sendcoinsentry.cpp
|
4c236a60bf631cd7cb5f65aa28f6bffc3c73429d
|
[
"MIT"
] |
permissive
|
GilmorHappy/Roguecoin
|
32da432ed1316a6542db52bd6bc8de1a7eb3ec9a
|
a292d742f76b92cb5d076e543494428d6ea6182f
|
refs/heads/master
| 2021-05-11T21:59:56.396743 | 2018-01-15T02:05:22 | 2018-01-15T02:05:22 | 117,479,809 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 4,617 |
cpp
|
// Copyright (c) 2011-2013 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 "sendcoinsentry.h"
#include "ui_sendcoinsentry.h"
#include "guiutil.h"
#include "bitcoinunits.h"
#include "addressbookpage.h"
#include "walletmodel.h"
#include "optionsmodel.h"
#include "addresstablemodel.h"
#include <QApplication>
#include <QClipboard>
SendCoinsEntry::SendCoinsEntry(QWidget *parent) :
QFrame(parent),
ui(new Ui::SendCoinsEntry),
model(0)
{
ui->setupUi(this);
#ifdef Q_OS_MAC
ui->payToLayout->setSpacing(4);
#endif
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book"));
ui->payTo->setPlaceholderText(tr("Enter a Roguecoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)"));
#endif
setFocusPolicy(Qt::TabFocus);
setFocusProxy(ui->payTo);
GUIUtil::setupAddressWidget(ui->payTo, this);
}
SendCoinsEntry::~SendCoinsEntry()
{
delete ui;
}
void SendCoinsEntry::on_pasteButton_clicked()
{
// Paste text from clipboard into recipient field
ui->payTo->setText(QApplication::clipboard()->text());
}
void SendCoinsEntry::on_addressBookButton_clicked()
{
if(!model)
return;
AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab, this);
dlg.setModel(model->getAddressTableModel());
if(dlg.exec())
{
ui->payTo->setText(dlg.getReturnValue());
ui->payAmount->setFocus();
}
}
void SendCoinsEntry::on_payTo_textChanged(const QString &address)
{
if(!model)
return;
// Fill in label from address book, if address has an associated label
QString associatedLabel = model->getAddressTableModel()->labelForAddress(address);
if(!associatedLabel.isEmpty())
ui->addAsLabel->setText(associatedLabel);
}
void SendCoinsEntry::setModel(WalletModel *model)
{
this->model = model;
if(model && model->getOptionsModel())
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
connect(ui->payAmount, SIGNAL(textChanged()), this, SIGNAL(payAmountChanged()));
clear();
}
void SendCoinsEntry::setRemoveEnabled(bool enabled)
{
ui->deleteButton->setEnabled(enabled);
}
void SendCoinsEntry::clear()
{
ui->payTo->clear();
ui->addAsLabel->clear();
ui->payAmount->clear();
ui->payTo->setFocus();
// update the display unit, to not use the default ("BTC")
updateDisplayUnit();
}
void SendCoinsEntry::on_deleteButton_clicked()
{
emit removeEntry(this);
}
bool SendCoinsEntry::validate()
{
// Check input validity
bool retval = true;
if(!ui->payAmount->validate())
{
retval = false;
}
else
{
if(ui->payAmount->value() <= 0)
{
// Cannot send 0 coins or less
ui->payAmount->setValid(false);
retval = false;
}
}
if(!ui->payTo->hasAcceptableInput() ||
(model && !model->validateAddress(ui->payTo->text())))
{
ui->payTo->setValid(false);
retval = false;
}
return retval;
}
SendCoinsRecipient SendCoinsEntry::getValue()
{
SendCoinsRecipient rv;
rv.address = ui->payTo->text();
rv.label = ui->addAsLabel->text();
rv.amount = ui->payAmount->value();
return rv;
}
QWidget *SendCoinsEntry::setupTabChain(QWidget *prev)
{
QWidget::setTabOrder(prev, ui->payTo);
QWidget::setTabOrder(ui->payTo, ui->addressBookButton);
QWidget::setTabOrder(ui->addressBookButton, ui->pasteButton);
QWidget::setTabOrder(ui->pasteButton, ui->deleteButton);
QWidget::setTabOrder(ui->deleteButton, ui->addAsLabel);
return ui->payAmount->setupTabChain(ui->addAsLabel);
}
void SendCoinsEntry::setValue(const SendCoinsRecipient &value)
{
ui->payTo->setText(value.address);
ui->addAsLabel->setText(value.label);
ui->payAmount->setValue(value.amount);
}
void SendCoinsEntry::setAddress(const QString &address)
{
ui->payTo->setText(address);
ui->payAmount->setFocus();
}
bool SendCoinsEntry::isClear()
{
return ui->payTo->text().isEmpty();
}
void SendCoinsEntry::setFocus()
{
ui->payTo->setFocus();
}
void SendCoinsEntry::updateDisplayUnit()
{
if(model && model->getOptionsModel())
{
// Update payAmount with the current unit
ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
}
}
|
[
"[email protected]"
] | |
6b4d3b172202f172b9987a3826a02266abff2ef5
|
97c3a0cdc0894e08d2afebbd1a6e86e3233312d2
|
/data/okao_client/src/legacy/past/people_recog_info3.cpp
|
a1820c4ed554fe8522d206149e9f3a968b922ad8
|
[
"MIT",
"BSD-2-Clause"
] |
permissive
|
elbaum/phys
|
139c17d9e4a5ed257657be9e5a3b4c580c460448
|
6ac580323493a5c6bb6846d039ae51e9ed1ec8b6
|
refs/heads/master
| 2020-03-21T13:25:09.513340 | 2018-06-24T21:05:43 | 2018-06-24T21:05:43 | 138,604,505 | 0 | 0 |
MIT
| 2018-06-25T14:15:26 | 2018-06-25T14:15:26 | null |
UTF-8
|
C++
| false | false | 8,274 |
cpp
|
/*
2015.4.18-------------------------------
とりあえずUnknown処理
どういうアルゴリズムで?
2015.4.6--------------------------------
persons[0]の内部を埋めたい
そのためには、okao_idとname, grade, laboratoryを結びつけておく必要がある
2015.3.5--------------------------------
一位と二位の投票数を使って
人物信頼度の比を求める
信頼度投票指標 = 一位の投票数/二位の投票数
信頼度投票指標が2以上なら、確定
*/
#include <ros/ros.h>
#include <message_filters/subscriber.h>
#include <message_filters/synchronizer.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <humans_msgs/Humans.h>
#include "MsgToMsg.hpp"
using namespace std;
#define OKAO_MAX 30
#define OKAO 3
#define BODY_MAX 6
#define HEAD 3
#define THRESHOLD 1.8
#define HIST_THRESHOLD 10
#define NUM_THRESHOLD 5
int d_id = 0;
class RecogInfo
{
private:
ros::NodeHandle nh;
ros::Publisher recog_pub_;
ros::Publisher path_pub_;
map<long, int> tracking_id_buf;
map<int, map<int, int> > hist;
map<int, humans_msgs::Person> prop_buf;
map<long long, map<int, double> > id_bind_magni;
map<long long, int> id_num;
typedef message_filters::Subscriber<
humans_msgs::Humans > HumansSubscriber;
HumansSubscriber okao_sub, okaoNot_sub;
typedef message_filters::sync_policies::ApproximateTime<
humans_msgs::Humans, humans_msgs::Humans
> MySyncPolicy;
message_filters::Synchronizer< MySyncPolicy > sync;
public:
RecogInfo() :
okao_sub( nh, "/humans/okao_server", 100 ),
okaoNot_sub( nh, "/humans/okao_server_not", 100 ),
sync( MySyncPolicy( 100 ), okao_sub, okaoNot_sub )
{
sync.registerCallback( boost::bind( &RecogInfo::callback, this, _1, _2 ) );
recog_pub_ =
nh.advertise<humans_msgs::Humans>("/humans/recog_info", 1);
humans_msgs::Person unknown;
unknown.okao_id = 0;
unknown.name = "Unknown";
unknown.laboratory = "Unknown";
unknown.grade = "Unknown";
prop_buf[ 0 ] = unknown;
}
~RecogInfo()
{
tracking_id_buf.clear();
hist.clear();
id_bind_magni.clear();
id_num.clear();
}
void histogram(int d_id, int *o_id, int *o_conf, int *maxOkaoId,
int *maxHist, double *magni, long long tracking_id)
{
id_num[tracking_id] = id_num[tracking_id] + 1;
for(int i = 0; i < OKAO; ++i)
{
hist[d_id][o_id[i]]
= hist[d_id][o_id[i]] + o_conf[i]/100;
}
//最大値のヒストグラムとそのOKAO_IDを出力
vector<int> hist_pool;
map<int,int> hist_to_okao;
for(int i = 0; i < OKAO_MAX; ++i)
{
hist_pool.push_back( hist[d_id][i] );
hist_to_okao[hist[d_id][i]] = i;
}
//投票結果のソート
sort( hist_pool.begin(), hist_pool.end(),
greater<int>() );
//一位と二位の倍率を出力
*maxOkaoId = hist_to_okao[hist_pool[0]];
*maxHist = hist_pool[0];
*magni = (double)hist_pool[0]/(double)hist_pool[1];
}
//人物の認識についての処理
void personRecogProcess(long long tracking_id, int *okao_id,
int hist, double magni)
{
if( id_bind_magni[ tracking_id ][ *okao_id ] < magni )
id_bind_magni[ tracking_id ][ *okao_id ] = magni;
//もし閾値より小さいなら,unknown処理
/*
if( (id_bind_magni[ tracking_id ][ *okao_id ] < THRESHOLD)
|| (id_num[ tracking_id ] < NUM_THRESHOLD) )
{
*okao_id = 0;
}
*/
if( (id_bind_magni[ tracking_id ][ *okao_id ] < THRESHOLD)
|| (hist < HIST_THRESHOLD) )
{
*okao_id = 0;
}
}
void okaoProcess(humans_msgs::Human src, humans_msgs::Humans *dst,
std_msgs::Header src_header)
{
long long tracking_id = src.body.tracking_id;
if( tracking_id )
{
map< long, int >::iterator tracking_id_find
= tracking_id_buf.find( tracking_id );
//tracking_idを過去に見ていたかどうかを調べる(d_id)
if( tracking_id_find != tracking_id_buf.end())
{
//キーの取得(d_id)
d_id = tracking_id_find->second;
}
else
{
++d_id;
tracking_id_buf[tracking_id] = d_id;
}
int o_id[OKAO] = {0}, o_conf[OKAO] = {0};
//メッセージ内にある一人の人物につき、一位から三位までの個人情報を取得する。
for(int i = 0; i < OKAO; ++i)
{
o_id[i]
= src.face.persons[i].okao_id;
o_conf[i]
= src.face.persons[i].conf;
}
//personの保持
humans_msgs::Person ps;
ps = src.face.persons[0];
prop_buf[ ps.okao_id ] = ps;
int maxOkaoId = 0, maxHist = 0;
double magni = 0.0;
histogram( (d_id) , o_id, o_conf, &maxOkaoId, &maxHist, &magni, tracking_id );
personRecogProcess( tracking_id, &maxOkaoId, maxHist, magni );
cout <<"face found[ " << ros::Time::now()
<< " ], d_id: "<<d_id << ", tracking_id: "
<< tracking_id << " ---> max id: "
<< maxOkaoId <<", max hist: " << maxHist << ", magni: " << magni << endl;
humans_msgs::Human h;
//h = src;
ros::Time t = src_header.stamp;
h.body.joints = src.body.joints;
h.body.tracking_id = src.body.tracking_id;
h.body.is_tracked = src.body.is_tracked;
h.body.left_hand_state = src.body.left_hand_state;
h.body.right_hand_state = src.body.right_hand_state;
h.d_id = d_id;
h.max_okao_id = maxOkaoId;
h.max_hist = maxHist;
h.magni = magni;
h.header.stamp = t;
h.header.frame_id = src_header.frame_id;
h.p = src.body.joints[ HEAD ].position;
h.face.persons.push_back( prop_buf[ maxOkaoId ] );
h.face.persons.push_back( prop_buf[ maxOkaoId ] );
h.face.persons.push_back( prop_buf[ maxOkaoId ] );
dst->human.push_back( h );
}
}
void okaoNotProcess(humans_msgs::Human src, humans_msgs::Humans *dst,
std_msgs::Header src_header)
{
long long tracking_id = src.body.tracking_id;
if( tracking_id )
{
map< long, int >::iterator tracking_id_find
= tracking_id_buf.find( tracking_id );
if( tracking_id_find != tracking_id_buf.end())
{
//キーの取得(d_id)
d_id = tracking_id_find->second;
//人物情報の取得
int o_id[OKAO] = {0}, o_conf[OKAO] = {0};
int maxOkaoId = 0, maxHist = 0;
double magni = 0.0;
histogram( (d_id) , o_id, o_conf, &maxOkaoId, &maxHist, &magni, tracking_id );
personRecogProcess( tracking_id, &maxOkaoId, maxHist, magni );
cout <<"face not found[ " << ros::Time::now()
<< " ], d_id: "<<d_id << ", tracking_id: "
<< tracking_id << " ---> max id: "
<< maxOkaoId <<", max hist: " << maxHist << ", magni: " << magni << endl;
ros::Time t = src_header.stamp;
humans_msgs::Human h;
h.body.joints = src.body.joints;
h.body.tracking_id = src.body.tracking_id;
h.body.is_tracked = src.body.is_tracked;
h.body.left_hand_state = src.body.left_hand_state;
h.body.right_hand_state = src.body.right_hand_state;
h.d_id = d_id;
h.max_okao_id = maxOkaoId;
h.max_hist = maxHist;
h.magni = magni;
h.header.stamp = t;
h.header.frame_id = src_header.frame_id;
h.p = src.body.joints[ HEAD ].position;
h.face.persons.push_back( prop_buf[ maxOkaoId ] );
h.face.persons.push_back( prop_buf[ maxOkaoId ] );
h.face.persons.push_back( prop_buf[ maxOkaoId ] );
dst->human.push_back( h );
}
}
}
void callback(
const humans_msgs::HumansConstPtr& okao,
const humans_msgs::HumansConstPtr& okaoNot
)
{
humans_msgs::Humans recog;
//okaoについての処理
for( int p_i = 0; p_i < okao->human.size(); ++p_i )
{
okaoProcess(okao->human[p_i], &recog, okao->header);
}
//okaoNotについての処理
for( int p_i = 0; p_i < okaoNot->human.size(); ++p_i )
{
okaoNotProcess(okaoNot->human[p_i], &recog, okaoNot->header);
}
//magniについての処理
recog.num = recog.human.size();
recog.header.stamp = ros::Time::now();
recog.header.frame_id = "recog";
recog_pub_.publish( recog );
}
};
int main(int argc, char** argv)
{
ros::init(argc, argv, "people_recog_info");
RecogInfo RIObject;
ros::spin();
return 0;
}
|
[
"[email protected]"
] | |
4ca879afb0cf250cc331f5bfcc47a9cf75d1573d
|
01adbc467131df4c6c54c6a6a30d863983d24224
|
/proiectpoocomun/proiectpoocomun/StudentRole.cpp
|
e29eb2f8821b360384989f8d65c8d6aa25e0c4a6
|
[] |
no_license
|
Motostivuitor/proiectpoocomun
|
040451ca6238f453c6631d30a5f860907e041cb4
|
36fc1deed66171ba2c19bf7f6f72eff267d4de17
|
refs/heads/master
| 2020-04-11T03:39:15.625170 | 2018-12-12T12:22:43 | 2018-12-12T12:22:43 | 161,484,129 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 88 |
cpp
|
#include "StudentRole.h"
StudentRole::StudentRole()
: Role(Role::STUDENT_ROLE)
{}
|
[
"[email protected]"
] | |
ebae71c5fd778e60ee4458b60fec4637e75f55c1
|
ae956d4076e4fc03b632a8c0e987e9ea5ca89f56
|
/SDK/TBP_ContextualHelp_Diablerie_classes.h
|
48ae51d8d7f962ad7d78612926e97e28758b77e9
|
[] |
no_license
|
BrownBison/Bloodhunt-BASE
|
5c79c00917fcd43c4e1932bee3b94e85c89b6bc7
|
8ae1104b748dd4b294609717142404066b6bc1e6
|
refs/heads/main
| 2023-08-07T12:04:49.234272 | 2021-10-02T15:13:42 | 2021-10-02T15:13:42 | 638,649,990 | 1 | 0 | null | 2023-05-09T20:02:24 | 2023-05-09T20:02:23 | null |
UTF-8
|
C++
| false | false | 1,463 |
h
|
#pragma once
// Name: bbbbbbbbbbbbbbbbbbbbbbblod, Version: 1
/*!!DEFINE!!*/
/*!!HELPER_DEF!!*/
/*!!HELPER_INC!!*/
#ifdef _MSC_VER
#pragma pack(push, 0x01)
#endif
namespace CG
{
//---------------------------------------------------------------------------
// Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass TBP_ContextualHelp_Diablerie.TBP_ContextualHelp_Diablerie_C
// 0x000C (FullSize[0x00D0] - InheritedSize[0x00C4])
class UTBP_ContextualHelp_Diablerie_C : public UTBP_ContextualHelpBase_C
{
public:
unsigned char UnknownData_3YIY[0x4]; // 0x00C4(0x0004) MISSED OFFSET (FIX SPACE BETWEEN PREVIOUS PROPERTY)
struct FPointerToUberGraphFrame UberGraphFrame; // 0x00C8(0x0008) (ZeroConstructor, Transient, DuplicateTransient)
static UClass* StaticClass()
{
static UClass* ptr = UObject::FindClass("BlueprintGeneratedClass TBP_ContextualHelp_Diablerie.TBP_ContextualHelp_Diablerie_C");
return ptr;
}
void SetupTriggerConditions(const struct FTigerContextualHelpContext& InContext);
void OnClientDownedEnemyPlayer(class ATigerPlayer* InPlayer);
void OnEnemyLifeStatusChanged(Tiger_ETigerPlayerLifeStatus NewLifeStatus);
void ExecuteUbergraph_TBP_ContextualHelp_Diablerie(int EntryPoint);
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
|
[
"[email protected]"
] | |
5376497c9a13481f2cf7f06e0f81d988e2234169
|
7d6cc729c26e66ae1b63822d29d38fbd41161f1d
|
/catkin_ws/src/dam_driver/firmware/Dam.h
|
ff058e2fdf2cc73b20e04ad51f8069257b8dd9e7
|
[
"MIT"
] |
permissive
|
NUMarsIce/NU-PRISMM
|
189c699c6917cf386cf7e24a0b3e98c52bf8da97
|
58441faedbe8d9f55dac666ea4b294d8319b112b
|
refs/heads/master
| 2022-11-27T23:20:53.565217 | 2020-08-02T14:55:28 | 2020-08-02T14:55:28 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 3,595 |
h
|
#ifndef _DAM_H_
#define _DAM_H_
//includes
#include <ACS712.h>
#include <ACS712_AC.h>
#include <AccelStepper.h>
#include <HX711.h>
#include <ros.h>
#include <prismm_msgs/dam_data.h>
#include <prismm_msgs/getBool.h>
#include <MovingAverageFilter.h>
#include <Servo.h>
//
#define STP_Y_ACCEL 2000
#define STP_X_ACCEL 800
#define STEPS_PER_REV 800
// Probe Servo
#define SERVO_ROT_PIN 9
#define SERVO_EXT_PIN 10
// X Steppers
#define STP_X_STEP_PIN 5
#define STP_X_DIR_PIN 4
#define STP_X_HOME_PIN 32
// Probe Stepper
#define STP_PROBE_STEP_PIN 3
#define STP_PROBE_DIR_PIN 2
#define STP_PROBE_HOME_PIN 34
//Drill stepper
#define STP_DRILL_STEP_PIN 7
#define STP_DRILL_DIR_PIN 6
#define STP_DRILL_HOME_PIN 33
#define STP_DRILL_CURRENT_PIN A0
//Switches
#define PROBE_LIMMIT_PIN 31
class Dam {
public:
Dam(ros::NodeHandle nh);
enum DamState{
E_STOP = -1,
DEFAULT_STATE = 0,
HOMED = 1,
HOMING = 2,
HOMING_DRILL = 3,
HOMING_PROBE = 4,
DRILLING = 5,
BOWL = 6,
};
bool update();// Should be run in loop and do iterative processes
DamState getState();
bool startDrilling();// Return false if probe not homed
bool stopDrilling();
bool homeProbe();
bool gotoProbeRot(int angle);
bool gotoProbeExt(int angle);
bool setProbeSpeed(int max_speed);
bool homeX();// Return false if drill and probe not homed
bool gotoX(int pos); // Return false if distance is out of bounds
bool setXSpeed(int max_speed);
bool homeDrill();
bool gotoDrill(int pos); // Return false if distance is out of bounds
bool setDrillSpeed(int max_speed);
//bool startRockwell(double max_pressure);// Press probe down and melt ice (or just heat)
bool startBowl(float speed = 1.0);// Return false if homed (or we know we aren't near ice)
bool stopBowl();
bool gotoProbe(int pos); // Return false if distance is out of bounds
bool probeNotHomed();
prismm_msgs::dam_data getData();
bool eStop();
bool resume();// Continue drilling or moving with motors after e stop
bool reset();// Resume processing but reset motor movements and state
private:
ros::NodeHandle nh;
const prismm_msgs::getBoolRequest probe_srv_req;
prismm_msgs::getBoolResponse probe_srv_resp;
bool tool_is_drill = true;
bool e_stopped = false;
float bowl_speed = 1.0;
int bowl_direction = 1;
float rot_pos = 0;
float ext_pos = 0;
DamState last_state = DEFAULT_STATE;
DamState state = DEFAULT_STATE;
prismm_msgs::dam_data data_out;
float probe_step_per_mm = -800/2.54;
float drill_step_per_mm = 800/2.54;
float x_step_per_mm = 800/100;
float probe_home_speed = 200.0;//currently in steps per second
float drill_home_speed = 200.0;
float x_home_speed = 200.0;
float probe_max_speed = 800.0;//currently in steps per second
float drill_max_speed = 800.0;
float x_max_speed = 800.0;
ACS712 stp_drill_current_sensor;
Servo servo_ext;
Servo servo_rot;
AccelStepper stp_x;
AccelStepper stp_drill;
AccelStepper stp_probe;
MovingAverageFilter drill_current_avg;
void iterateBowl();
void incrementProbeHome();
void incrementDrillHome();
void incrementXHome();
};
#endif /** _Dam_H_ **/
|
[
"[email protected]"
] | |
082940c55c4831367dfeed5b92e08bc75337a056
|
6f5657ec5ff03481acf8f9737c82cc066f9a5f3d
|
/main.cpp
|
6e794d44eb73d1ad84934f991a5f85645956cff5
|
[] |
no_license
|
ParkHeeseung/OpenGl-PS-TM
|
ba6567de20ace478822f884771cfe672d41fc8f7
|
e67d5055975c2d6848dd11264e97a188a93d267f
|
refs/heads/master
| 2020-05-22T07:34:43.597258 | 2019-05-12T14:55:30 | 2019-05-12T14:55:30 | 186,268,104 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 10,073 |
cpp
|
// Defines the entry point for the console application.
//
#include <GL/glew.h>
#include <GL/freeglut.h>
#include <iostream>
#include <string>
#include <fstream>
#include <chrono>
#include "transform.hpp"
#include "Shader.h"
#include "vec.hpp"
#include "mat.hpp"
#include "transform.hpp"
#include "SOIL.h"
void init();
void display();
void reshape(int, int);
void idle();
GLuint program;
GLint loc_a_vertex;
GLint loc_u_pvm_matrix;
//Texture
GLint loc_a_texcoord;
GLint loc_u_texid;
GLint loc_u_texid_frame;
GLuint texid;
GLuint texid_frame;
//Phong_Shading
GLint loc_a_normal;
GLint loc_u_view_matrix;
GLint loc_u_model_matrix;
GLint loc_u_normal_matrix;
GLint loc_u_light_vector;
GLint loc_u_light_ambient;
GLint loc_u_light_diffuse;
GLint loc_u_light_specular;
GLint loc_u_material_ambient;
GLint loc_u_material_diffuse;
GLint loc_u_material_specular;
GLint loc_u_material_shininess;
float model_scale = 1.0f;
float model_angle = 0.0f;
kmuvcl::math::mat4x4f mat_PVM;
kmuvcl::math::mat3x3f mat_Normal;
GLfloat vertices[] = {
// front
-1, 1, 1, 1, 1, 1, 1,-1, 1, -1,-1, 1,
// back
1, 1, -1, -1, 1, -1, -1,-1, -1, 1,-1, -1,
// top
-1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1,
// bottom
-1,-1, 1, 1,-1, 1, 1,-1, -1, -1,-1, -1,
// right
1, 1, 1, 1, 1, -1, 1,-1, -1, 1,-1, 1,
// left
-1, 1, -1, -1, 1, 1, -1,-1, 1, -1,-1, -1,
};
GLfloat normals[] = {
// front
0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1,
// back
0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1,
// top
0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
// bottom
0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0,
// right
1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0,
// left
-1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0,
};
GLfloat texcoords[] = {
// front
0,1, 1,1, 1,0, 0,0,
// back
0,1, 1,1, 1,0, 0,0,
// top
0,1, 1,1, 1,0, 0,0,
// bottom
0,1, 1,1, 1,0, 0,0,
// right
0,1, 1,1, 1,0, 0,0,
// left
0,1, 1,1, 1,0, 0,0,
};
GLushort indices[] = {
//front
0, 3, 2, 2, 1, 0,
//back
4, 7, 6, 6, 5, 4,
// top
8,11,10, 10, 9, 8,
// bottom
12,15,14, 14,13,12,
//right
16,19,18, 18,17,16,
//left
20,23,22, 22,21,20,
};
kmuvcl::math::vec4f light_vector = kmuvcl::math::vec4f(10.0f, 10.0f, 10.0f);
kmuvcl::math::vec4f light_ambient = kmuvcl::math::vec4f(1.0f, 1.0f, 1.0f, 1.0f);
kmuvcl::math::vec4f light_diffuse = kmuvcl::math::vec4f(1.0f, 1.0f, 1.0f, 1.0f);
kmuvcl::math::vec4f light_specular = kmuvcl::math::vec4f(1.0f, 1.0f, 1.0f, 1.0f);
kmuvcl::math::vec4f material_ambient = kmuvcl::math::vec4f(0.464f, 0.393f, 0.094f, 1.0f); // 주변광
kmuvcl::math::vec4f material_diffuse = kmuvcl::math::vec4f(1.464f, 1.393f, 1.094f, 1.0f); // 난반사
kmuvcl::math::vec4f material_specular = kmuvcl::math::vec4f(10.0f, 10.0f, 10.0f, 1.0f); //정반사
float material_shininess= 50.0f;
std::chrono::time_point<std::chrono::system_clock> prev, curr;
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(100, 100);
glutInitWindowSize(640, 640);
glutCreateWindow("Modeling & Navigating Your Studio");
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutIdleFunc(idle);
if (glewInit() != GLEW_OK)
{
std::cerr << "failed to initialize glew" << std::endl;
return -1;
}
init();
glutMainLoop();
return 0;
}
void init()
{
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glFrontFace(GL_CCW);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); // for wireframe rendering
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glEnable(GL_DEPTH_TEST);
program = Shader::create_program("./shader/texture_vert.glsl", "./shader/texture_frag.glsl");
// TODO: get shader variable locations"
loc_u_pvm_matrix = glGetUniformLocation(program, "u_pvm_matrix");
loc_u_texid = glGetUniformLocation(program, "u_texid");
loc_u_texid_frame= glGetUniformLocation(program, "u_texid_frame");
loc_a_vertex = glGetAttribLocation(program, "a_vertex");
loc_a_texcoord = glGetAttribLocation(program, "a_texcoord");
loc_u_view_matrix = glGetUniformLocation(program, "u_view_matrix");
loc_u_model_matrix = glGetUniformLocation(program, "u_model_matrix");
loc_u_normal_matrix = glGetUniformLocation(program, "u_normal_matrix");
loc_u_light_vector = glGetUniformLocation(program, "u_light_vector");
loc_u_light_ambient = glGetUniformLocation(program, "u_light_ambient");
loc_u_light_diffuse = glGetUniformLocation(program, "u_light_diffuse");
loc_u_light_specular = glGetUniformLocation(program, "u_light_specular");
loc_u_material_ambient = glGetUniformLocation(program, "u_material_ambient");
loc_u_material_diffuse = glGetUniformLocation(program, "u_material_diffuse");
loc_u_material_specular = glGetUniformLocation(program, "u_material_specular");
loc_u_material_shininess = glGetUniformLocation(program, "u_material_shininess");
loc_a_normal = glGetAttribLocation(program, "a_normal");
int width, height, channels;
unsigned char* image = SOIL_load_image("tex.jpg",
&width, &height, &channels, SOIL_LOAD_RGB);
// TODO: generate texture
glGenTextures(1, &texid);
glBindTexture(GL_TEXTURE_2D, texid);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, image);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
SOIL_free_image_data(image);
unsigned char* frame = SOIL_load_image("frame.jpg",
&width, &height, &channels, SOIL_LOAD_RGB);
glGenTextures(1, &texid_frame);
glBindTexture(GL_TEXTURE_2D, texid_frame);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, frame);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
SOIL_free_image_data(frame);
prev = curr = std::chrono::system_clock::now();
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glUseProgram(program);
// Camera setting
kmuvcl::math::mat4x4f mat_Proj, mat_View_inv, mat_Model;
kmuvcl::math::mat4x4f mat_R_X, mat_R_Y, mat_R_Z;
// camera intrinsic param
mat_Proj = kmuvcl::math::perspective(60.0f, 1.0f, 0.001f, 10000.0f);
// camera extrinsic param
mat_View_inv = kmuvcl::math::lookAt(
0.0f, 0.0f, 5.0f,
0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f);
mat_Model = kmuvcl::math::scale (model_scale, model_scale, model_scale);
mat_R_Z = kmuvcl::math::rotate(model_angle*0.7f, 0.0f, 0.0f, 1.0f);
mat_R_Y = kmuvcl::math::rotate(model_angle, 0.0f, 1.0f, 0.0f);
mat_R_X = kmuvcl::math::rotate(model_angle*0.5f, 1.0f, 0.0f, 0.0f);
mat_Model = mat_R_X*mat_R_Y*mat_R_Z*mat_Model;
mat_PVM = mat_Proj*mat_View_inv*mat_Model;
// TODO: normal matrix, view matrix
mat_Normal(0, 0) = mat_Model(0, 0);
mat_Normal(0, 1) = mat_Model(0, 1);
mat_Normal(0, 2) = mat_Model(0, 2);
mat_Normal(1, 0) = mat_Model(1, 0);
mat_Normal(1, 1) = mat_Model(1, 1);
mat_Normal(1, 2) = mat_Model(1, 2);
mat_Normal(2, 0) = mat_Model(2, 0);
mat_Normal(2, 1) = mat_Model(2, 1);
mat_Normal(2, 2) = mat_Model(2, 2);
kmuvcl::math::mat4x4f mat_View = kmuvcl::math::inverse(mat_View_inv);
glUniformMatrix4fv(loc_u_pvm_matrix, 1, false, mat_PVM);
glUniformMatrix4fv(loc_u_model_matrix, 1, false, mat_Model);
glUniformMatrix4fv(loc_u_view_matrix, 1, false, mat_View);
glUniformMatrix3fv(loc_u_normal_matrix, 1, false, mat_Normal);
glUniform3fv(loc_u_light_vector, 1, light_vector);
glUniform4fv(loc_u_light_ambient, 1, light_ambient);
glUniform4fv(loc_u_light_diffuse, 1, light_diffuse);
glUniform4fv(loc_u_light_specular, 1, light_specular);
glUniform4fv(loc_u_material_ambient, 1, material_ambient);
glUniform4fv(loc_u_material_diffuse, 1, material_diffuse);
glUniform4fv(loc_u_material_specular, 1, material_specular);
glUniform1f(loc_u_material_shininess, material_shininess);
// TODO: using texture
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texid);
glUniform1i(loc_u_texid, 0);
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, texid_frame);
glUniform1i(loc_u_texid_frame, 1);
// TODO: send gpu texture coordinate
glVertexAttribPointer(loc_a_vertex, 3, GL_FLOAT, GL_FALSE, 0, vertices);
glVertexAttribPointer(loc_a_normal, 3, GL_FLOAT, GL_FALSE, 0, normals);
glVertexAttribPointer(loc_a_texcoord, 2, GL_FLOAT, GL_FALSE, 0, texcoords);
glEnableVertexAttribArray(loc_a_vertex);
glEnableVertexAttribArray(loc_a_normal);
glEnableVertexAttribArray(loc_a_texcoord);
glDrawElements(GL_TRIANGLES, sizeof(indices)/sizeof(GLushort), GL_UNSIGNED_SHORT, indices);
glDisableVertexAttribArray(loc_a_vertex);
glDisableVertexAttribArray(loc_a_texcoord);
glUseProgram(0);
Shader::check_gl_error("draw");
glutSwapBuffers();
}
void reshape(int width, int height)
{
glViewport(0, 0, width, height);
}
void idle()
{
curr = std::chrono::system_clock::now();
std::chrono::duration<float> elaped_seconds = (curr - prev);
model_angle += 20 * elaped_seconds.count();
prev = curr;
glutPostRedisplay();
}
void Cross_Product(const GLfloat v1[], const GLfloat v2[]){
}
|
[
"[email protected]"
] | |
ae0dce854d11b3c29215e6a442da1b3c4c7cacd8
|
20c6dfeb514a785aeca643081d50fa66c5f0a630
|
/TEST/GRADER/PLUS.cpp
|
0faa8a1b7f89a227bc1cfe740a0be9381246e361
|
[] |
no_license
|
tluan97/Competitive-programming-code
|
d0f96f0eca81d3ec8fa685c4deb2d04330354d6c
|
91fd693805b5fe33951b740d84c74cebea882b14
|
refs/heads/master
| 2021-06-22T23:30:44.273949 | 2020-11-14T02:22:37 | 2020-11-14T02:22:37 | 134,262,360 | 2 | 1 | null | null | null | null |
UTF-8
|
C++
| false | false | 360 |
cpp
|
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const string TEST_NAME = "PLUS";
void luan(){
LL a,b;
cin>>a>>b;
cout<<a+b;
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
freopen((TEST_NAME+".INP").c_str(),"r",stdin);
freopen((TEST_NAME+".OUT").c_str(),"w",stdout);
luan();
return 0;
}
|
[
"[email protected]"
] | |
df66e2eb9223a57dde6a803d581e8d168ddcfc8e
|
8e36b81dee6a5d10a805a70429c88a10b738ccc2
|
/Assignment4/Node.cpp
|
b621472993c0180cb29bcfe355c68ff71e73173d
|
[] |
no_license
|
tevans24/CS-360
|
a5c9f8ecdc2b703a0916b8f8bf08482dec80e923
|
7625420ad3454b32ba8da2d73d2d0bedea04c777
|
refs/heads/master
| 2020-03-08T21:43:48.527540 | 2018-06-08T18:55:36 | 2018-06-08T18:55:36 | 128,413,106 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 2,041 |
cpp
|
/**********************************************************
Taylor Evans
CS 360
Assignment 4
This file is the .cpp file for the Node class.
This file contains the constructor for creating a
node, a destructor to delete the node, a getValue
method, and get left and right node and a set left
and right node.
***********************************************************/
#include "Node.h"
#include <cstdlib>
#include <iostream>
using namespace std;
//Constructor that creates a node and sets its left and right to null
Node::Node(int val)
{
value = val;
left = NULL;
right = NULL;
}
//Destructor that deletes the left and right nodes
Node::~Node()
{
delete left;
delete right;
}
/**************************************************
getValue
This function returns the value of the node
Parameters: None
Return: int
**************************************************/
int Node::getValue()
{
return value;
}
/**************************************************
getLeft
This function returns the left child of a parent node
Parameters: None
Return: Node*
**************************************************/
Node* Node::getLeft()
{
return left;
}
/**************************************************
getRight
This function returns the right child of a parent node
Parameters: None
Return: Node*
**************************************************/
Node* Node::getRight()
{
return right;
}
/**************************************************
setLeft
This function sets the left child of a parent node
Parameters: Node*
Return: none
**************************************************/
void Node::setLeft(Node* l)
{
left = l;
}
/**************************************************
setRight
This function sets the right child of a parent node
Parameters: Node*
Return: none
**************************************************/
void Node::setRight(Node* r)
{
right = r;
}
|
[
"[email protected]"
] | |
d53f3e5033fb5ba8a882bd666093295a0b0bc2a0
|
c07a44016da3ae7920d581754ea07cab54d4e6e9
|
/13- Linked Lists/count_occurrence_of_no.cpp
|
f444d908094cb247d0a77b4a052892d16cdc7a83
|
[
"MIT"
] |
permissive
|
zee-bit/C-plus-plus-Algorithms
|
4f8cced9695bb9e430a789767bd56dcebc6a7caf
|
e8351f6b54aebf6e61cbf7869fd40d19ab3b370e
|
refs/heads/master
| 2023-02-04T05:39:05.769862 | 2020-10-02T09:22:25 | 2020-10-02T09:22:25 | 300,564,794 | 0 | 0 |
MIT
| 2020-12-25T19:16:55 | 2020-10-02T09:27:02 | null |
UTF-8
|
C++
| false | false | 700 |
cpp
|
#include<iostream>
using namespace std;
class node{
public:
int data;
node*next;
node(int d){
data=d;
next=NULL;
}
};
void insert(node*&head,int data){
if(head==NULL){
head= new node(data);
return;
}
else{
node*tail= head;
while(tail->next!=NULL){
tail= tail->next;
}
return;
}
}
void buildList(node*&head){
int data;cin>>data;
while(data!=-1)
{
insert(head,data);
cin>>data;
}
}
int occurrence(node*&head,int key){
int count=0;
while(head!=NULL){
if(head->data==key){
count++;
}
head= head->next;
}
return count;
}
int main()
{
node*head= NULL;
buildList(head);
int key;cin>>key;
cout<<occurrence(head,key);
}
|
[
"[email protected]"
] | |
9135dd1f158f6c755c79160acdac9ba5719dc39a
|
e5a8bb042f94d2442a38f0d07aee8e1edc2b8183
|
/src/device_trezor/trezor/messages_map.hpp
|
be7e90c8e1412c2ff99a8b32192b89c648c7fafc
|
[
"BSD-3-Clause",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
ahmyi/Torque
|
ffdf8262ff844e76c7631b904adf1923c1368509
|
0f537c3bef7560018988d618d6354f277f6aa138
|
refs/heads/master
| 2022-11-27T01:19:59.034710 | 2022-11-14T17:20:57 | 2022-11-14T17:20:57 | 136,060,620 | 1 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 3,733 |
hpp
|
// Copyright (c) 2017-2019, The Monero Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#ifndef SCALA_MESSAGES_MAP_H
#define SCALA_MESSAGES_MAP_H
#include <string>
#include <type_traits>
#include <memory>
#include "exceptions.hpp"
#include "trezor_defs.hpp"
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/generated_enum_reflection.h>
#include "google/protobuf/descriptor.pb.h"
#include "messages/messages.pb.h"
namespace hw {
namespace trezor {
class MessageMapper{
public:
MessageMapper() {
}
static ::google::protobuf::Message * get_message(int wire_number);
static ::google::protobuf::Message * get_message(messages::MessageType);
static ::google::protobuf::Message * get_message(const std::string & msg_name);
static messages::MessageType get_message_wire_number(const google::protobuf::Message * msg);
static messages::MessageType get_message_wire_number(const google::protobuf::Message & msg);
static messages::MessageType get_message_wire_number(const std::string & msg_name);
template<class t_message=google::protobuf::Message>
static messages::MessageType get_message_wire_number() {
BOOST_STATIC_ASSERT(boost::is_base_of<google::protobuf::Message, t_message>::value);
return get_message_wire_number(t_message::default_instance().GetDescriptor()->name());
}
};
template<class t_message=google::protobuf::Message>
std::shared_ptr<t_message> message_ptr_retype(std::shared_ptr<google::protobuf::Message> & in){
BOOST_STATIC_ASSERT(boost::is_base_of<google::protobuf::Message, t_message>::value);
if (!in){
return nullptr;
}
return std::dynamic_pointer_cast<t_message>(in);
}
template<class t_message=google::protobuf::Message>
std::shared_ptr<t_message> message_ptr_retype_static(std::shared_ptr<google::protobuf::Message> & in){
BOOST_STATIC_ASSERT(boost::is_base_of<google::protobuf::Message, t_message>::value);
if (!in){
return nullptr;
}
return std::static_pointer_cast<t_message>(in);
}
}}
#endif //SCALA_MESSAGES_MAP_H
|
[
"[email protected]"
] | |
f73096e8f510115e3c96e8ffe749e7378f434046
|
0ff46001ffdfe6fd7dee3abcc16ab5709e2d357e
|
/include/TradeRecord.h
|
dd28681b7df8e764abf0a4aa4e87961262da7471
|
[] |
no_license
|
ajayms1980/SimpleStockMarket
|
0752c438f7cd0f5e42a18e284863f5d340b70f6a
|
568df6869fb448c82d4959549e458502215cb427
|
refs/heads/master
| 2021-04-12T02:57:33.131261 | 2018-03-21T23:11:22 | 2018-03-21T23:11:22 | 125,759,795 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,426 |
h
|
/*
* File: TradeRecord.h
* Author: ajay.kumar
*
* Created on 11 March 2018, 08:34
*/
#ifndef TRADERECORD_H
#define TRADERECORD_H
#include <iostream>
#include "StaticData.h"
class TradeRecord
{
public:
TradeRecord(const std::string& epic,
const std::string& tradeId,
double quantity,
double price,
BS_IND bs_ind,
long long tradeTimeStamp);
~TradeRecord();
inline std::string& getEpic()
{
return _epic;
}
inline std::string& getTradeId()
{
return _tradeId;
}
inline double getQuantity()
{
return _quantity;
}
inline double getPrice()
{
return _price;
}
inline BS_IND getBuySellInd()
{
return _bs_ind;
}
inline long long getTradeTimeStamp()
{
return _tradeTimeStamp;
}
// inline void setEpic(std::string& epic)
// {
// _epic = epic;
// }
//
// inline void setTradeId(std::string& tradeId)
// {
// _tradeId = tradeId;
// }
//
// inline void setQuantity(double quantity)
// {
// _quantity = quantity;
// }
//
// inline void setPrice(double price)
// {
// _price = price;
// }
//
// inline void setBuySellInd(BS_IND bs_ind)
// {
// _bs_ind = bs_ind;
// }
//
// inline void setTradeTimeStamp(long long tradeTimeStamp)
// {
// _tradeTimeStamp = tradeTimeStamp;
// }
private:
std::string _epic;
std::string _tradeId;
double _quantity;
double _price;
BS_IND _bs_ind;
long long _tradeTimeStamp;
} ;
#endif /* TRADERECORD_H */
|
[
"[email protected]"
] | |
ae08de5eaec25eec4b507fabcc0525c03ff5c772
|
1514454af85889e6e6e7648f84a8e16510cb974a
|
/GenKey_c.cpp
|
719e0bf86f56c15a49650f542b9abb88cd1ff3ba
|
[] |
no_license
|
massimo299/inner-product-db
|
118b318bfeccdb77ae97b0a12d6ffed0501a7236
|
277138743e40aaaab6b24bfa715eba352181cc42
|
refs/heads/master
| 2020-05-21T12:29:04.563624 | 2017-08-02T10:35:02 | 2017-08-02T10:35:02 | 49,062,054 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,042 |
cpp
|
#include <iostream>
#include <chrono>
#include <string>
#include <sstream>
#include <fstream>
#include "pairing_3.h"
#include "aoe-const.h"
#include <sys/timeb.h>
#define VERBOSE
int getMilliCount(){
timeb tb;
ftime(&tb);
int nCount = tb.millitm + (tb.time & 0xfffff) * 1000;
return nCount;
}
int getMilliSpan(int nTimeStart){
int nSpan = getMilliCount() - nTimeStart;
if(nSpan < 0)
nSpan += 0x100000 * 1000;
return nSpan;
}
main(int argc, char *argv[]){
/** Check the number of parameters */
if (argc < 3) {
/** Tell the user how to run the program */
cerr << "Usage: " << argv[0] << " num_col key_file" << endl;
return 1;
}
mr_init_threading();
PFC pfc(AES_SECURITY);
SecureSelectConst *db=NULL;
int m=atoi(argv[1]);
string key_name(argv[2]);
db = new SecureSelectConst(m,&pfc,pfc.order());
#ifdef VERBOSE
int start = getMilliCount();
#endif
db->KeyGen(key_name);
#ifdef VERBOSE
int milliSecondsElapsed = getMilliSpan(start);
cout << "\texec time " << milliSecondsElapsed << endl;
#endif
}
|
[
"[email protected]"
] | |
da411a598c8d5f0fdae514c4d59444f28d39842c
|
eb8b5cde971573668800146b3632e43ed6e493d2
|
/oneflow/core/kernel/tick_kernel.h
|
603debb8acc14bd72eecd5766d8d8fade00abfde
|
[
"Apache-2.0"
] |
permissive
|
big-data-ai/oneflow
|
16f167f7fb7fca2ce527d6e3383c577a90829e8a
|
b1c67df42fb9c5ab1335008441b0273272d7128d
|
refs/heads/master
| 2023-07-08T21:21:41.136387 | 2021-08-21T11:31:14 | 2021-08-21T11:31:14 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 1,155 |
h
|
/*
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef ONEFLOW_CORE_KERNEL_TICK_KERNEL_H_
#define ONEFLOW_CORE_KERNEL_TICK_KERNEL_H_
#include "oneflow/core/kernel/kernel.h"
namespace oneflow {
template<DeviceType device_type>
class TickKernel final : public KernelIf<device_type> {
public:
OF_DISALLOW_COPY_AND_MOVE(TickKernel);
TickKernel() = default;
~TickKernel() = default;
private:
void ForwardDataContent(
const KernelCtx& ctx,
const std::function<Blob*(const std::string&)>& BnInOp2Blob) const override {}
};
} // namespace oneflow
#endif // ONEFLOW_CORE_KERNEL_TICK_KERNEL_H_
|
[
"[email protected]"
] | |
a1db3b7d57bde1e5ab2e81c18b3d3b3f4c6693d6
|
71df92c09fd1a0aba0230296132c2d92a9d7043c
|
/interp1/interp_initialize.cpp
|
09ec151dd497dbf99cea82fd5e8a527aa780f029
|
[] |
no_license
|
fengjianngu/czt
|
9474f6b6ff3a3ec53100f96c82679cc79452af92
|
26ee175fcd22436d63f23a3385ad74e08471390c
|
refs/heads/master
| 2020-04-11T05:58:13.908254 | 2018-12-13T01:23:01 | 2018-12-13T01:23:01 | 161,449,291 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 454 |
cpp
|
//
// File: interp_initialize.cpp
//
// MATLAB Coder version : 3.0
// C/C++ source code generated on : 01-Sep-2018 12:06:13
//
// Include Files
#include "rt_nonfinite.h"
#include "interp.h"
#include "interp_initialize.h"
// Function Definitions
//
// Arguments : void
// Return Type : void
//
void interp_initialize()
{
rt_InitInfAndNaN(8U);
}
//
// File trailer for interp_initialize.cpp
//
// [EOF]
//
|
[
"[email protected]"
] | |
27af477852d811cac2f7f25ef9602d7296ebf458
|
083ffdcf34904173720959b89a43be93161cbdd0
|
/Conch/source/conch/JCPublicCmdDispath.cpp
|
2d1694c44c00b749762c0a52902b38184ec9ef24
|
[] |
no_license
|
bearocean/LayaNative1.0
|
1c58f52884d482b961573ca991979ce9e7ed6b1f
|
c9b2cd6c0b6c68bfc108eb96e05e3647822d7228
|
refs/heads/main
| 2023-03-19T18:31:51.118756 | 2021-03-09T04:15:48 | 2021-03-09T04:15:48 | null | 0 | 0 | null | null | null | null |
GB18030
|
C++
| false | false | 23,364 |
cpp
|
/**
@file JCPublicCmdDispath.cpp
@brief
@author James
@version 1.0
@date 2016_5_27
*/
#include "JCPublicCmdDispath.h"
#include <util/Log.h>
#include "WebGLRender/JCWebGLRender.h"
#include "JCCmdDispatchManager.h"
#include "Html5Render/JCHtml5Render.h"
#include "JCConchRender.h"
#include "JCConch.h"
#include <Node/JCGraphicsCmdDispath.h>
#include <Node/JCNode2DCmdDispath.h>
#include <Particle2D/JCParticleTemplate2DCmdDispath.h>
#include "./3DRS/JCShaderDefine.h"
extern int g_nInnerWidth;
extern int g_nInnerHeight;
//------------------------------------------------------------------------------
namespace laya
{
JCPublicCmdDispath::JCPublicCmdDispath(JCCmdDispathManager* pCmdDispathManager)
{
m_pCmdDispathManager = pCmdDispathManager;
m_nID = 0;
}
JCPublicCmdDispath::~JCPublicCmdDispath()
{
}
bool JCPublicCmdDispath::dispatchRenderCmd(JCMemClass& pRenderCmd,int nFrameCount)
{
static const ProcFunction g_svProcFunctions[] =
{
&JCPublicCmdDispath::_rendercmd_startJSThread,
&JCPublicCmdDispath::_rendercmd_createImage,
&JCPublicCmdDispath::_rendercmd_deleteImage,
&JCPublicCmdDispath::_rendercmd_createHtml5Context,
&JCPublicCmdDispath::_rendercmd_deleteHtml5Context,
&JCPublicCmdDispath::_rendercmd_createWebGLContext,
&JCPublicCmdDispath::_rendercmd_deleteWebGLContext,
&JCPublicCmdDispath::_rendercmd_createNode,
&JCPublicCmdDispath::_rendercmd_deleteNode,
&JCPublicCmdDispath::_rendercmd_setContextType,
&JCPublicCmdDispath::_rendercmd_setHtml5CanvasSize,
&JCPublicCmdDispath::_rendercmd_createVetexBuffer,
&JCPublicCmdDispath::_rendercmd_createShader,
&JCPublicCmdDispath::_rendercmd_createGraphics,
&JCPublicCmdDispath::_rendercmd_deleteGraphics,
&JCPublicCmdDispath::_rendercmd_setRootNode,
&JCPublicCmdDispath::_rendercmd_setMainCanvasScaleInfo,
&JCPublicCmdDispath::_rendercmd_setMemoryCanvasClip,
&JCPublicCmdDispath::_rendercmd_setFPSNode,
&JCPublicCmdDispath::_rendercmd_setLoadingViewNode,
&JCPublicCmdDispath::_rendercmd_createParticalTemplate2D,
&JCPublicCmdDispath::_rendercmd_deleteParticalTemplate2D,
&JCPublicCmdDispath::_rendercmd_registShaderDefine,
&JCPublicCmdDispath::_rendercmd_setTransparentMode,
&JCPublicCmdDispath::_rendercmd_setImageReleaseSpaceTime,
&JCPublicCmdDispath::_rendercmd_PerfAddData,
&JCPublicCmdDispath::_rendercmd_PerfUpdateDt,
&JCPublicCmdDispath::_rendercmd_ImageEnableMerageInAtlas,
&JCPublicCmdDispath::_rendercmd_ImageReleaseTexture,
&JCPublicCmdDispath::_rendercmd_deleteVetexBuffer,
};
static const int nFuncs = sizeof(g_svProcFunctions) / sizeof(g_svProcFunctions[0]);
char* pData = pRenderCmd.getReadPtr();
if (pData)
{
int nFunctionID = *(int*)pData;
if (nFunctionID >= 0 && nFunctionID < nFuncs)
{
if ((this->*g_svProcFunctions[nFunctionID])(pRenderCmd) == false)
{
LOGE("JCPublicCmdDispath::dispatchRenderCmd Fail to execute public command : %d ", nFunctionID);
return false;
}
}
else
{
LOGE("JCPublicCmdDispath::dispatchRenderCmd Wrong public command number!,cmd=%d", nFunctionID);
}
}
return true;
}
bool JCPublicCmdDispath::dispatchRenderCmdWhenLostedDevice(JCMemClass& pRenderCmd, int nFrameCount)
{
return dispatchRenderCmd(pRenderCmd, nFrameCount);
}
bool JCPublicCmdDispath::restartJSThread()
{
return true;
}
bool JCPublicCmdDispath::_rendercmd_startJSThread(JCMemClass& pRenderCmd)
{
int* pFuncID = pRenderCmd.popp<int>();
//TODO 如果以后没有用,就可以删除掉了
for ( JCCmdDispathManager::VectorCmdDispath::iterator iter = m_pCmdDispathManager->m_vCmdDispaths.begin(); iter != m_pCmdDispathManager->m_vCmdDispaths.end(); iter++)
{
JCICmdDispatch* pCmdDispath = *iter;
if (pCmdDispath)
{
pCmdDispath->restartJSThread();
}
}
//清空所有数据,包括显卡,内存中的
JCConch::s_pConchRender->clearAllData();
return true;
}
bool JCPublicCmdDispath::_rendercmd_createImage(JCMemClass& pRenderCmd)
{
ParamCreateImage* pParam = pRenderCmd.popp<ParamCreateImage>();
if (pParam)
{
JCImage* pImage = (JCImage*)(pParam->imagePtr);
if (m_pCmdDispathManager->m_pImageManager)
{
m_pCmdDispathManager->m_pImageManager->setImage(pParam->imageID, pImage);
}
return true;
}
return false;
}
bool JCPublicCmdDispath::_rendercmd_deleteImage(JCMemClass& pRenderCmd)
{
ParamDeleteImage* pParam = pRenderCmd.popp<ParamDeleteImage>();
if (pParam)
{
if (m_pCmdDispathManager->m_pImageManager)
{
m_pCmdDispathManager->m_pImageManager->deleteImage(pParam->imageID);
}
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_createHtml5Context(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCHtml5Render* pHtml5Render = new JCHtml5Render(pParam->nID, m_pCmdDispathManager->m_pTextureManager, m_pCmdDispathManager->m_pImageManager, m_pCmdDispathManager->m_p2DShaderManager, m_pCmdDispathManager->m_pHtml5RenderManager, m_pCmdDispathManager->m_pTextManager, m_pCmdDispathManager->m_pFontManager, m_pCmdDispathManager->m_pBufferManager, m_pCmdDispathManager->m_pShaderManager, &m_pCmdDispathManager->m_vCmdDispaths);
m_pCmdDispathManager->pushCmdDispaths(pHtml5Render->m_nID, pHtml5Render);
m_pCmdDispathManager->m_pHtml5RenderManager->pushHtml5Render(pHtml5Render);
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_deleteHtml5Context(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCHtml5Render* pHtml5Render = (JCHtml5Render*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
m_pCmdDispathManager->m_pHtml5RenderManager->removeHtml5Render(pParam->nID);
m_pCmdDispathManager->deleteCmdDispaths(pParam->nID);
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_createWebGLContext(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCWebGLRender* pWebGLRender = new JCWebGLRender(pParam->nID,m_pCmdDispathManager->m_pImageManager, m_pCmdDispathManager->m_pTextMemoryCanvas,m_pCmdDispathManager->m_pWebGLContext );
m_pCmdDispathManager->pushCmdDispaths(pWebGLRender->m_nID, pWebGLRender);
JCConch::s_pConchRender->m_pWebGLRender = pWebGLRender;
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_deleteWebGLContext(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCWebGLRender* pWebGLRender = (JCWebGLRender*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
if (JCConch::s_pConchRender->m_pWebGLRender == pWebGLRender)
{
JCConch::s_pConchRender->m_pWebGLRender = NULL;
}
m_pCmdDispathManager->deleteCmdDispaths(pParam->nID);
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_createNode(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCNode2DCmdDispath* pNode2DCmdDispath = new JCNode2DCmdDispath(pParam->nID, m_pCmdDispathManager->m_pTextureManager, m_pCmdDispathManager->m_pImageManager, m_pCmdDispathManager->m_p2DShaderManager, m_pCmdDispathManager->m_pHtml5RenderManager, m_pCmdDispathManager->m_pTextManager, m_pCmdDispathManager->m_pFontManager, m_pCmdDispathManager->m_pBufferManager, m_pCmdDispathManager->m_pShaderManager,&m_pCmdDispathManager->m_vCmdDispaths);
m_pCmdDispathManager->pushCmdDispaths(pParam->nID, pNode2DCmdDispath);
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_deleteNode(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCNode2DCmdDispath* pNode2DCmdDispath = (JCNode2DCmdDispath*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
if (JCConch::s_pConchRender->m_pRootNode && pParam->nID == JCConch::s_pConchRender->m_pRootNode->m_nID)
{
JCConch::s_pConchRender->m_pRootNode = NULL;
}
m_pCmdDispathManager->deleteCmdDispaths(pParam->nID);
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_setContextType(JCMemClass& pRenderCmd)
{
ParamInt2* pParam = pRenderCmd.popp<ParamInt2>();
if (pParam)
{
if (pParam->nID < m_pCmdDispathManager->m_vCmdDispaths.size())
{
JCHtml5Render* pHtml5Render = (JCHtml5Render*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
pHtml5Render->setCanvasType( (CANVAS_TYPE)pParam->nType );
if( pParam->nType == CANVAS_TYPE_MAIN )
{
JCConch::s_pConchRender->m_pRootHtml5Render = pHtml5Render;
}
}
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_setHtml5CanvasSize(JCMemClass& pRenderCmd)
{
ParamSetCanvasSize* pParam = pRenderCmd.popp<ParamSetCanvasSize>();
if (pParam)
{
JCHtml5Render* pHtml5Render = (JCHtml5Render*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
if (pHtml5Render)
{
pHtml5Render->setCanvasSize(pParam->nWidth, pParam->nHeight);
}
return true;
}
return false;
}
bool JCPublicCmdDispath::_rendercmd_createVetexBuffer(JCMemClass& pRenderCmd)
{
ParamInt2 * pParm= pRenderCmd.popp<ParamInt2>();
char * p_sBuffer =(char *)pRenderCmd.readBuffer(pParm->nType);
if (m_pCmdDispathManager->m_pBufferManager)
{
m_pCmdDispathManager->m_pBufferManager->createOrUpdateBuffer(pParm->nID, pParm->nType, p_sBuffer);
}
else
{
LOGE("JCPublicCmdDispath::_rendercmd_createVetexBuffer m_pBufferManager is NULL");
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_createShader(JCMemClass& pRenderCmd)
{
ParamInt2 * pParm = pRenderCmd.popp<ParamInt2>();
char * p_sVs = pRenderCmd.readBuffer(pParm->nType);
std::string strVS;
strVS.append(p_sVs, pParm->nType);
int nPsLength =*(int*)pRenderCmd.readBuffer(4);
char * p_sPs = pRenderCmd.readBuffer(nPsLength);
std::string strPS;
strPS.append(p_sPs, nPsLength);
if (m_pCmdDispathManager->m_pShaderManager)
{
m_pCmdDispathManager->m_pShaderManager->createOrUpdateShader(pParm->nID, (char*)strPS.c_str(),
(char*)strVS.c_str());
}
else
{
LOGE("JCPublicCmdDispath::_rendercmd_createShader m_pShaderManager is NULL");
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_createGraphics(JCMemClass& pRenderCmd)
{
ParamInt2* pParam = pRenderCmd.popp<ParamInt2>();
if (pParam)
{
JCGraphicsCmdDispath* pGraphicsCmdDispath = new JCGraphicsCmdDispath(pParam->nID,m_pCmdDispathManager->m_pTextureManager, m_pCmdDispathManager->m_pImageManager, m_pCmdDispathManager->m_p2DShaderManager, m_pCmdDispathManager->m_pHtml5RenderManager, m_pCmdDispathManager->m_pTextManager, m_pCmdDispathManager->m_pFontManager, m_pCmdDispathManager->m_pBufferManager, m_pCmdDispathManager->m_pShaderManager, (TEXT_BASE_LINE_TYPE)pParam->nType);
m_pCmdDispathManager->pushCmdDispaths(pParam->nID, pGraphicsCmdDispath);
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_deleteGraphics(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCGraphicsCmdDispath* pGraphicsCmdDispath = (JCGraphicsCmdDispath*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
m_pCmdDispathManager->deleteCmdDispaths(pParam->nID);
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_setRootNode(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCNode2DCmdDispath* pNode2DDispath = (JCNode2DCmdDispath*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
if(JCConch::s_pConchRender->m_pRootNode == NULL )
{
JCConch::s_pConchRender->m_pRootNode = pNode2DDispath->m_pNode2D;
}
else
{
LOGE("JCPublicCmdDispath::_rendercmd_setRootNode you already set root node");
}
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_setMainCanvasScaleInfo(JCMemClass& pRenderCmd) {
int fid;
float sx, sy, tx, ty;
pRenderCmd.popv(fid);
pRenderCmd.popv(sx);
pRenderCmd.popv(sy);
pRenderCmd.popv(tx);
pRenderCmd.popv(ty);
if (JCConch::s_pConchRender &&
JCConch::s_pConchRender->m_pRootHtml5Render &&
JCConch::s_pConchRender->m_pRootHtml5Render->m_pContext) {
JCHtml5Context* pCtx = JCConch::s_pConchRender->m_pRootHtml5Render->m_pContext;
pCtx->m_fScaleX = sx;
pCtx->m_fScaleY = sy;
pCtx->m_fTx = tx;
pCtx->m_fTy = ty;
//pCtx->setCanvasSize(g_nInnerWidth/sx, g_nInnerHeight/sy); 不用了,用实际大小
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_setMemoryCanvasClip(JCMemClass& pRenderCmd)
{
ParamInt2* pParam = pRenderCmd.popp<ParamInt2>();
if (pParam)
{
if (pParam->nID < m_pCmdDispathManager->m_vCmdDispaths.size())
{
JCHtml5Render* pHtml5Render = (JCHtml5Render*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
pHtml5Render->setMemoryCanvasClip( pParam->nType != 0 );
}
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_setFPSNode(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCNode2DCmdDispath* pNode2DDispath = (JCNode2DCmdDispath*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
if (JCConch::s_pConchRender->m_pFPSNode2D == NULL)
{
JCConch::s_pConchRender->m_pFPSNode2D = pNode2DDispath->m_pNode2D;
}
else
{
LOGE("JCPublicCmdDispath::_rendercmd_setFPSNode you already set fps node");
}
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_setLoadingViewNode(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCNode2DCmdDispath* pNode2DDispath = (JCNode2DCmdDispath*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
if (JCConch::s_pConchRender->m_pLoadingViewNode2D == NULL)
{
JCConch::s_pConchRender->m_pLoadingViewNode2D = pNode2DDispath->m_pNode2D;
}
else
{
JCConch::s_pConchRender->m_pLoadingViewNode2D = NULL;
}
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_createParticalTemplate2D(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCParticleTemplate2DCmdDispath* pParticleTemplate2DCmdDispath = new JCParticleTemplate2DCmdDispath(pParam->nID);
m_pCmdDispathManager->pushCmdDispaths(pParam->nID, pParticleTemplate2DCmdDispath);
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_deleteParticalTemplate2D(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCParticleTemplate2DCmdDispath* pParticleTemplate2DCmdDispath = (JCParticleTemplate2DCmdDispath*)(m_pCmdDispathManager->m_vCmdDispaths[pParam->nID]);
m_pCmdDispathManager->deleteCmdDispaths(pParam->nID);
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_registShaderDefine(JCMemClass& pRenderCmd)
{
ParamInt* pParam= pRenderCmd.popp<ParamInt>();
char* name = pRenderCmd.readBuffer(pParam->nID);
long long nID = *(pRenderCmd.popp<long long>());
JCShaderDefine::registShaderDefine(name, nID);
return true;
}
bool JCPublicCmdDispath::_rendercmd_setTransparentMode(JCMemClass& pRenderCmd)
{
ParamFloat* pParam = pRenderCmd.popp<ParamFloat>();
if (pParam)
{
JCConch::s_pConchRender->setTransparentMode(pParam->value);
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_setImageReleaseSpaceTime(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
JCConch::s_pConchRender->m_pImageManager->setReleaseSpaceTime(pParam->nID);
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_PerfAddData(JCMemClass& pRenderCmd)
{
ParamPerfAddData* pParam = pRenderCmd.popp<ParamPerfAddData>();
if (pParam)
{
JCPerfHUD::addData(pParam->nID, pParam->nColor, pParam->fScale, pParam->fAlert);
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_PerfUpdateDt(JCMemClass& pRenderCmd)
{
PerfUpdateDt* pParam = pRenderCmd.popp<PerfUpdateDt>();
if (pParam)
{
JCPerfHUD::updateData(pParam->nID, pParam->fTimeSpace);
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_ImageEnableMerageInAtlas(JCMemClass& pRenderCmd)
{
ParamInt2* pParam = pRenderCmd.popp<ParamInt2>();
if (pParam)
{
if (m_pCmdDispathManager->m_pImageManager)
{
JCImage* pImage = m_pCmdDispathManager->m_pImageManager->getImage(pParam->nID);
pImage->m_bEnableMerageInAtlas = (pParam->nType > 0);
}
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_ImageReleaseTexture(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
if (m_pCmdDispathManager->m_pImageManager)
{
JCImage* pImage = m_pCmdDispathManager->m_pImageManager->getImage(pParam->nID);
pImage->releaseTexture();
}
return true;
}
return true;
}
bool JCPublicCmdDispath::_rendercmd_deleteVetexBuffer(JCMemClass& pRenderCmd)
{
ParamInt* pParam = pRenderCmd.popp<ParamInt>();
if (pParam)
{
if (m_pCmdDispathManager->m_pBufferManager)
{
m_pCmdDispathManager->m_pBufferManager->deleteBuffer(pParam->nID);
}
return true;
}
return true;
}
}
//------------------------------------------------------------------------------
//-----------------------------END FILE--------------------------------
|
[
"[email protected]"
] | |
4bfcf312c26e384cdb85135bf0d4e4182b7d12bb
|
118962a80e25d768eb3bff284af2a4bbee4fd234
|
/task1/task1.cpp
|
d735e1779472dc6d063c256d4ca05e18a498bbac
|
[] |
no_license
|
vd28/course1_lab_3Cpp
|
9596e492aaddfbd0d68fcac8a4239920db24a0ca
|
03f8c5189e0fb3c877ec28c89c335b5dc10e2117
|
refs/heads/master
| 2020-03-31T14:52:00.960689 | 2018-10-09T20:15:37 | 2018-10-09T20:15:37 | 152,312,641 | 0 | 0 | null | null | null | null |
WINDOWS-1251
|
C++
| false | false | 1,395 |
cpp
|
/*
Какого типа переменные подойдут для хранения следующей информации:
• Возраст человека Население города Число звезд в галактике
• Один байт ОЗУ Средняя зарплата за год Сведения курит или нет
• Цвет фигуры Длина в мм. Длина в см.
Объявите и проинициализируйте эти переменные, дав имен смысловые имена. Вывести
на экран.
author : Dubina Vlad
created : 09.10.2018
uppdated : 09.10.2018
*/
#include <iostream>
using namespace std;
int main() {
int age = 17;
long population = 456234;
unsigned long long nOfS = 2342357567;
char bite = '$';
double averageSalary = 3589.34;
bool smoke = false;
char colour[256] = "Blue";
double lengthmm = 35.23;
double lengthsm = 62.42;
cout << "Age: " << age << endl;
cout << "Poulation: " << population << endl;
cout << "Number of stars: " << nOfS << endl;
cout << "One bite simbol: " << bite << endl;
cout << "Average salary per year: " << averageSalary << endl;
cout << "Smoke: " << smoke << endl;
cout << "Figure color: " << colour << endl;
cout << "Length in mm: " << lengthmm << endl;
cout << "Length in sm: " << lengthsm << endl;
cin.get();
return 0;
}
|
[
"[email protected]"
] | |
d7bb6540908d30a72b134cadbfd877f37b8a2451
|
4503b4ec29e9a30d26c433bac376f2bddaefd9e5
|
/XtreamToolkit/v16.4.0/Source/SkinFramework/XTPSkinImage.h
|
224ae32408d38763afd2c87f3e9ecf2053fd06fc
|
[] |
no_license
|
SwunZH/ecocommlibs
|
0a872e0bbecbb843a0584fb787cf0c5e8a2a270b
|
4cff09ff1e479f5f519f207262a61ee85f543b3a
|
refs/heads/master
| 2021-01-25T12:02:39.067444 | 2018-02-23T07:04:43 | 2018-02-23T07:04:43 | 123,447,012 | 1 | 0 | null | 2018-03-01T14:37:53 | 2018-03-01T14:37:53 | null |
UTF-8
|
C++
| false | false | 9,177 |
h
|
// XTPSkinImage.h: interface for the CXTPSkinImage class.
//
// This file is a part of the XTREME SKINFRAMEWORK MFC class library.
// (c)1998-2013 Codejock Software, All Rights Reserved.
//
// THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
// RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
// CONSENT OF CODEJOCK SOFTWARE.
//
// THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
// IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
// YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
// SINGLE COMPUTER.
//
// CONTACT INFORMATION:
// [email protected]
// http://www.codejock.com
//
/////////////////////////////////////////////////////////////////////////////
//{{AFX_CODEJOCK_PRIVATE
#if !defined(__XTPSKINIMAGE_H__)
#define __XTPSKINIMAGE_H__
//}}AFX_CODEJOCK_PRIVATE
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CXTPSkinManagerResourceFile;
//===========================================================================
// Summary:
// CXTPSkinImage class represents simple bitmap holder and draw operations for Skin Framework
//===========================================================================
class _XTP_EXT_CLASS CXTPSkinImage : public CXTPSynchronized
{
private:
struct SOLIDRECT
{
RECT rc;
COLORREF clr;
};
public:
//-----------------------------------------------------------------------
// Summary:
// Constructs a CXTPSkinImage object.
//-----------------------------------------------------------------------
CXTPSkinImage();
//-----------------------------------------------------------------------
// Summary:
// Destroys a CXTPSkinImage object, handles cleanup and deallocation.
//-----------------------------------------------------------------------
virtual ~CXTPSkinImage();
public:
//-----------------------------------------------------------------------
// Summary:
// This method is called to load bitmap from dll using its name identifier
// Parameters:
// hModule - Module handle
// lpszBitmapFileName - Bitmap file name
// lpszFileName - File name on disk to load
// Returns:
// TRUE if successful, otherwise returns FALSE
//-----------------------------------------------------------------------
BOOL LoadFile(LPCTSTR lpszFileName);
BOOL LoadFile(HMODULE hModule, LPCTSTR lpszBitmapFileName); //<COMBINE CXTPSkinImage::LoadFile@LPCTSTR>
//-----------------------------------------------------------------------
// Summary:
// Call this method to assign bitmap handle to CXTPSkinImage class
// Parameters:
// hBitmap - Bitmap handle
// bAlpha - TRUE if bitmap contains alpha pixels
//-----------------------------------------------------------------------
void SetBitmap(HBITMAP hBitmap, BOOL bAlpha = FALSE);
//-----------------------------------------------------------------------
// Summary:
// Draws the image in specified location.
// Parameters:
// pDC - Destination device context.
// rcDest - Specifies the location of the destination rectangle
// rcSrc - Specifies the location of the source rectangle
// rcSizingMargins - Specifies sizing margins
// nSizingType - Stretch type
// bBorderOnly - TRUE to draw only borders
// clrTransparent - Transparent color
//-----------------------------------------------------------------------
void DrawImage(CDC* pDC, const CRect& rcDest, const CRect& rcSrc, const CRect& rcSizingMargins, int nSizingType, BOOL bBorderOnly);
void DrawImage(CDC* pDC, const CRect& rcDest, const CRect& rcSrc, const CRect& rcSizingMargins, COLORREF clrTransparent, int nSizingType, BOOL bBorderOnly); // <combine CXTPSkinImage::DrawImage@CDC*@const CRect&@const CRect&@const CRect&@int@BOOL>
//-----------------------------------------------------------------------
// Summary:
// Retrieves height of the bitmap
//-----------------------------------------------------------------------
DWORD GetHeight() const;
//-----------------------------------------------------------------------
// Summary:
// Retrieves width of the bitmap
//-----------------------------------------------------------------------
DWORD GetWidth() const;
//-----------------------------------------------------------------------
// Summary:
// Retrieves extent of the bitmap
//-----------------------------------------------------------------------
CSize GetExtent() const;
//-----------------------------------------------------------------------
// Summary:
// Determines if bitmap has alpha pixels
//-----------------------------------------------------------------------
BOOL IsAlphaImage() const;
//-----------------------------------------------------------------------
// Summary:
// Calculates position of image
// Parameters:
// nState - Image index to retrieve
// nCount - Total image count
// Returns: Position of specified image
//-----------------------------------------------------------------------
CRect GetSource(int nState = 0, int nCount = 1) const;
//-----------------------------------------------------------------------
// Summary:
// Helper method that splits image to solid rectangles for faster drawing.
// Parameters:
// nBitmaps - Image identifier
// bHorizontalImage - TRUE if images aranged horizontaly
// rcSizingMargins - Sizong margins
// Returns: Position of specified image
//-----------------------------------------------------------------------
void CreateSolidRectArray(int nBitmaps, BOOL bHorizontalImage, const CRect& rcSizingMargins);
private:
void DrawImageInternal(CDC* pDC, const CRect& rcDest, const CRect& rcSrc, const CRect& rcSizingMargins, int nSizingType, BOOL bBorderOnly, COLORREF clrTransparent = COLORREF_NULL);
BOOL DrawImagePart(CDC* pDCDest, const CRect& rcDest,
CDC* pDCSrc, const CRect& rcSrc) const;
BOOL DrawImageTile(CDC* pDCDest, const CRect& rcDest,
CDC* pDCSrc, const CRect& rcSrc, BOOL bTile, COLORREF clrTransparent = COLORREF_NULL) const;
void FilterImage(COLORREF clrTransparent);
void InvertBitmap();
BOOL FindSolidRect(const CRect& rcSrc, SOLIDRECT& sr) const;
CSize _GetExtent() const;
BOOL CheckBitmapRect(LPBYTE pBits, CRect rcCheck, CSize sz);
public:
BOOL m_bMirrorImage; // TRUE to Invert image in RTL mode
protected:
HBITMAP m_hBitmap; // Bitmap handle
BOOL m_bAlpha; // TRUE if bitmap has alpha pixels
BOOL m_bFiltered; // TRUE if image was filtered
BOOL m_bInvert; // TRUE if image is inverted for RTL mode
BOOL m_bOptimized; // TRUE if image is splited to solid parts
CSize m_szBitmap; // Bitmaps size of image
CArray<SOLIDRECT, SOLIDRECT&> m_arrSolidRects; // Solid parts of image
};
//===========================================================================
// Summary:
// CXTPSkinImages represents cashed collection of CXTPSkinImage classes
//===========================================================================
class _XTP_EXT_CLASS CXTPSkinImages : public CXTPSynchronized
{
public:
//-----------------------------------------------------------------------
// Summary:
// Constructs a CXTPSkinImages object.
//-----------------------------------------------------------------------
CXTPSkinImages();
//-----------------------------------------------------------------------
// Summary:
// Destroys a CXTPSkinImages object, handles cleanup and deallocation.
//-----------------------------------------------------------------------
~CXTPSkinImages();
public:
//-----------------------------------------------------------------------
// Summary:
// Call this method to remove all images
//-----------------------------------------------------------------------
void RemoveAll();
//-----------------------------------------------------------------------
// Summary:
// Call this method to load image from resource file
// Parameters:
// pResourceFile - Resource file pointer
// lpszImageFile - Path to Image
// Returns:
// New CXTPSkinImage object if successful, otherwise returns NULL
//-----------------------------------------------------------------------
CXTPSkinImage* LoadFile(CXTPSkinManagerResourceFile* pResourceFile, LPCTSTR lpszImageFile);
//-----------------------------------------------------------------------
// Summary:
// Call this method to get extent of image in resource file.
// Parameters:
// pResourceFile - Resource file pointer
// lpszImageFile - Path to Image
// Returns:
// Extent of image.
//-----------------------------------------------------------------------
CSize GetExtent(CXTPSkinManagerResourceFile* pResourceFile, LPCTSTR lpszImageFile);
protected:
CMapStringToPtr m_mapImages; // Collection of images
};
#endif // !defined(__XTPSKINIMAGE_H__)
|
[
"kwkang@3e9e098e-e079-49b3-9d2b-ee27db7392fb"
] |
kwkang@3e9e098e-e079-49b3-9d2b-ee27db7392fb
|
cd699334be973f497044cf3e144ed6f400688750
|
d34f3c73c4ed804f48fbed476f22013e5d951daa
|
/c++/list/add_element.cpp
|
e09cb114f892c5d9674dcc2aaa84df28c92fb000
|
[] |
no_license
|
brxue/sandbox
|
7ad7ea76130f0edc2ff9fc62c192131fce1242d1
|
a9cc9edd9e2233b1b90c822edd43c3c480385c58
|
refs/heads/master
| 2021-06-18T17:14:18.698560 | 2017-06-19T15:25:53 | 2017-06-19T15:25:53 | 13,215,820 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 734 |
cpp
|
#include <list>
#include <vector>
#include <cassert>
#include <string>
using namespace std;
void add_element()
{
list<int> a; // An empty list
assert(a.size() == 0);
a.push_back(0); // Push value 0 to the end
a.push_back(1); // Push value 1 to the end
a.push_front(-1); // Push value -1 to the front
assert(a.size() == 3);
// a is now [-1, 0, 1]
assert(a.front() == -1);
assert(*(a.begin()) == -1);
assert(*(++a.begin()) == 0);
assert(a.back() == 1);
assert(*(--a.end()) == 1);
a.push_front(-2); // Push value -2 to the front
// a is now [-2, -1, 0, 1]
int j = -2;
for(list<int>::const_iterator i = a.begin(); i != a.end(); ++i, ++j)
assert(*i == j);
}
int main()
{
add_element();
return 0;
}
|
[
"[email protected]"
] | |
92764d03078d5b6bb4a3a0c078985903981f90d7
|
37cca16f12e7b1d4d01d6f234da6d568c318abee
|
/src/rice/p2p/replication/ReplicationImpl.hpp
|
22380eb19daa240469dffae9243ddb190764a450
|
[] |
no_license
|
subhash1-0/thirstyCrow
|
e48155ce68fc886f2ee8e7802567c1149bc54206
|
78b7e4e3d2b9a9530ad7d66b44eacfe73ceea582
|
refs/heads/master
| 2016-09-06T21:25:54.075724 | 2015-09-21T17:21:15 | 2015-09-21T17:21:15 | 42,881,521 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 3,178 |
hpp
|
// Generated from /pastry-2.1/src/rice/p2p/replication/ReplicationImpl.java
#pragma once
#include <fwd-pastry-2.1.hpp>
#include <java/lang/fwd-pastry-2.1.hpp>
#include <rice/environment/fwd-pastry-2.1.hpp>
#include <rice/environment/logging/fwd-pastry-2.1.hpp>
#include <rice/p2p/commonapi/fwd-pastry-2.1.hpp>
#include <rice/p2p/replication/fwd-pastry-2.1.hpp>
#include <java/lang/Object.hpp>
#include <rice/p2p/replication/Replication.hpp>
#include <rice/p2p/commonapi/Application.hpp>
#include <rice/Destructable.hpp>
struct default_init_tag;
class rice::p2p::replication::ReplicationImpl
: public virtual ::java::lang::Object
, public virtual Replication
, public virtual ::rice::p2p::commonapi::Application
, public virtual ::rice::Destructable
{
public:
typedef ::java::lang::Object super;
int32_t MAINTENANCE_INTERVAL { };
int32_t MAX_KEYS_IN_MESSAGE { };
public: /* protected */
::rice::p2p::commonapi::Endpoint* endpoint { };
::rice::p2p::commonapi::NodeHandle* handle { };
::rice::p2p::commonapi::IdFactory* factory { };
ReplicationClient* client { };
ReplicationPolicy* policy { };
int32_t replicationFactor { };
::java::lang::String* instance { };
public: /* package */
::rice::environment::Environment* environment { };
::rice::environment::logging::Logger* logger { };
protected:
void ctor(::rice::p2p::commonapi::Node* node, ReplicationClient* client, int32_t replicationFactor, ::java::lang::String* instance);
void ctor(::rice::p2p::commonapi::Node* node, ReplicationClient* client, int32_t replicationFactor, ::java::lang::String* instance, ReplicationPolicy* policy);
public:
static ::rice::p2p::commonapi::IdSet* merge(::rice::p2p::commonapi::IdFactory* factory, ::rice::p2p::commonapi::IdSet* a, ::rice::p2p::commonapi::IdSet* b);
public: /* protected */
virtual ::rice::p2p::commonapi::IdRange* getTotalRange();
private:
void updateClient();
public:
void replicate() override;
bool forward(::rice::p2p::commonapi::RouteMessage* message) override;
void deliver(::rice::p2p::commonapi::Id* id, ::rice::p2p::commonapi::Message* message) override;
void update(::rice::p2p::commonapi::NodeHandle* handle, bool joined) override;
public: /* protected */
bool destroyed { };
public:
void destroy() override;
// Generated
ReplicationImpl(::rice::p2p::commonapi::Node* node, ReplicationClient* client, int32_t replicationFactor, ::java::lang::String* instance);
ReplicationImpl(::rice::p2p::commonapi::Node* node, ReplicationClient* client, int32_t replicationFactor, ::java::lang::String* instance, ReplicationPolicy* policy);
protected:
ReplicationImpl(const ::default_init_tag&);
public:
static ::java::lang::Class *class_();
private:
void init();
virtual ::java::lang::Class* getClass0();
friend class ReplicationImpl_ReplicationImpl_1;
friend class ReplicationImpl_replicate_2;
friend class ReplicationImpl_replicate_2_receiveResult_2_1;
friend class ReplicationImpl_deliver_3;
friend class ReplicationImpl_deliver_4;
friend class ReplicationImpl_BloomFilterExecutable;
};
|
[
"[email protected]"
] | |
c8ce31a63312875aa10e8189cefd2ac03b2bdc1a
|
1a8a4b9697ce2699d441cc5380c181d2a9997db7
|
/qtango/utils/tpropertylabel.h
|
1c476c64fa01169b10edd69ef4a85c58fce3ed78
|
[] |
no_license
|
HighwayStar/qtango
|
598c7817f6e6be2874d7a062844f02a27b520f9c
|
52aca8ab69e0b54d26c6418999df4bb9f3ae39e1
|
refs/heads/master
| 2021-07-07T09:30:18.396096 | 2017-10-04T03:04:11 | 2017-10-04T03:58:27 | 105,730,068 | 1 | 0 | null | 2017-10-04T04:01:23 | 2017-10-04T04:01:23 | null |
UTF-8
|
C++
| false | false | 1,782 |
h
|
#ifndef TPROPERTYLABEL_H
#define TPROPERTYLABEL_H
#include <QLabel>
class TPropertyLabelPrivate;
class PropertyReader;
/** \brief A QLabel which sets its text according to a device or class property value
*
* This widget is a QLabel which sets its text according to a device or class property value.
*
* \par Description
* This class is a QLabel. It is configurable by means of the source property, which defines
* a device or class property to be read from the Tango database.
* According to the form of the source, the type of property (device or class) to be
* retrieved is automatically detected.
*
* \par Reading device properties
* If the source is of type tango/device/name/devicePropertyName, then the devicePropertyName
* device property is obtained from the device tango/device/name and its value is set as
* text on the label.
*
* \par Reading class properties
* If the source is of type ClassName/propertyName, then the class property having propertyName
* as name is read from the tango database and its value is set as text in the label.
*
* @see source
* @see setSource
*
* A designer plugin is provided in order to drag and drop a TPropertyLabel into a
* designer widget
*
*/
class TPropertyLabel : public QLabel
{
Q_PROPERTY(QString source READ source WRITE setSource DESIGNABLE false)
Q_OBJECT
public:
virtual ~TPropertyLabel();
explicit TPropertyLabel(QWidget *parent);
QString source() const;
PropertyReader *propertyReader() const;
signals:
public slots:
void setSource(const QString& src);
private slots:
void setError(const QString& mess);
private:
TPropertyLabelPrivate *d_ptr;
Q_DECLARE_PRIVATE(TPropertyLabel)
};
#endif // PROPERTYLABEL_H
|
[
"[email protected]"
] | |
b4f10dcd2638b1d8ab9694c05f5b83e797b4330b
|
865dd28f318c61533c3df0453dadf176c0fd6258
|
/loginwindow.h
|
4ac2848f8926d22fe0914712285b43da98e7a561
|
[] |
no_license
|
ZweiBein/QtLogin
|
26b6ad9a232279198ec9bdb71f595448b553fb18
|
0031dd560eba0a652a0dfa55e3cfe5e849ac4b08
|
refs/heads/master
| 2020-06-23T02:51:34.716439 | 2019-07-31T12:32:29 | 2019-07-31T12:32:29 | 198,483,840 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 920 |
h
|
#ifndef LOGINWINDOW_H
#define LOGINWINDOW_H
#include <QWidget>
//#include <QMessageBox>
#include <QJsonObject>
#include <QTranslator>
#include "browserwindow.h"
namespace Ui {
class LoginWindow;
}
class LoginWindow : public QWidget
{
Q_OBJECT
public:
explicit LoginWindow(QWidget *parent = nullptr);
~LoginWindow();
private slots:
void on_pushButtonCancel_clicked();
void on_pushButtonOk_clicked();
void on_comboBoxLocales_currentIndexChanged(const QString &arg1);
private:
Ui::LoginWindow *ui;
QTranslator *translator;
BrowserWindow *browser;
void HandleLanguageChange(QString selectedLocale);
void HandleLogin(QString user, QString password);
void DisplayMessageBox(QString, QString buttonMessage = "Close");
bool ValidateCredentials(QString, QString);
QJsonObject LoadCredentialsJSON();
};
#endif // LOGINWINDOW_H
|
[
"[email protected]"
] | |
fbf9a13ac8659f9d212dd59c6e46a3cb7c069248
|
3370485557718dc37d42da0b7b2ed7d866987658
|
/LCard/lusbapi 3.4/E14-140/Examples/MicroSoft Visual C++ 6.0/MultiModules/MultiModules.cpp
|
356aa420fa9614e6fa04eef437ddd97bf0742c3c
|
[] |
no_license
|
shybzzz/Vector
|
b750ba2b2bdf1275e4374f7cebf2597fb9b13846
|
fcf11586010726e19927c60697766051452bd76b
|
refs/heads/master
| 2021-01-18T20:08:56.409713 | 2016-07-01T04:43:15 | 2016-07-01T04:43:15 | 62,362,867 | 0 | 0 | null | null | null | null |
WINDOWS-1251
|
C++
| false | false | 17,351 |
cpp
|
//******************************************************************************
// Модуль E14-140.
// Консольная программа организует потоковый ввод данных одновременно
// с нескольких модулей.
//******************************************************************************
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include "Lusbapi.h"
// аварийный выход из программы
void AbortProgram(char *ErrorString, bool AbortionFlag = true);
// функция потока ввода данных
DWORD WINAPI ServiceReadThread(PVOID ThreadIndex);
// ожидание завершения асинхронного запроса на ввод данных
BOOL WaitingForIoRequestCompleted(OVERLAPPED *ReadOv, DWORD ThreadTid);
//
void SetXY(COORD * const Coord);
void GetXY(COORD * const Coord);
// максимально возможное кол-во опрашиваемых виртуальных слотов
const WORD MaxVirtualSoltsQuantity = 0x7;
// кол-во опрашиваемых каналов для каждого модуля
const WORD ADC_CHANNELS_QUANTITY = 0x4;
// частота работы АЦП при сборе данных
const double AdcRate = 2500.0;
// идентификаторы потока
HANDLE ReadThreadHandle[MaxVirtualSoltsQuantity];
DWORD ReadThreadIndex[MaxVirtualSoltsQuantity];
DWORD ReadThreadTid[MaxVirtualSoltsQuantity];
// массив указателей на интерфейс модулей типа E14-140
ILE140 *pModules[MaxVirtualSoltsQuantity];
// версия библиотеки
DWORD DllVersion;
// дескриптор устройства
HANDLE ModuleHandle;
// название модуля
char ModuleName[7];
// скорость работы шины USB
BYTE UsbSpeed;
// структура с полной информацией о модуле
MODULE_DESCRIPTION_E140 ModuleDescription;
// структура параметров работы АЦП модуля
ADC_PARS_E140 ap;
// кол-во реально обнаруженных модулей типа E14-140
WORD ModulesQuantity;
// размер запроса сбора данных
DWORD DataStep = 64*1024;
// массив буферов для получаемых данных
SHORT *Buffer[MaxVirtualSoltsQuantity];
// флажок-признак аварийного завершения соответствующего потока
bool IsReadThreadTerminated[MaxVirtualSoltsQuantity];
// номер ошибки каждого из потоков
WORD ReadThreadErrorNumber[MaxVirtualSoltsQuantity];
// номер ошибки выполнения основной программы
WORD MainErrorNumber;
// экранные координаты вывода значения счётчиков
COORD Coord;
// счетчик потоков
WORD Counter[MaxVirtualSoltsQuantity];
// критическая секция
CRITICAL_SECTION cs;
// Дескриптор стандартного устройства вывода компьютера - дисплей
HANDLE OutputConsoleHandle;
//------------------------------------------------------------------------
// основная программа
//------------------------------------------------------------------------
void main(void)
{
WORD i, j;
// инициализация критической секции
InitializeCriticalSection(&cs);
// Получаем дескриптор стандартного устройства вывода компьютера - экран
OutputConsoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
// проинициализируем указатели и переменные
for(i = 0x0; i < MaxVirtualSoltsQuantity; i++)
{
// обнулим указатель на интерфейс
pModules[i] = NULL;
// сбросим флажок прерывания потока сбора данных
IsReadThreadTerminated[i] = false;
// пока ничего не выделено под буфер данных
Buffer[i] = NULL;
// пока не создан поток ввода данных
ReadThreadHandle[i] = NULL;
// сбросим флаг ошибок потока ввода данных
ReadThreadErrorNumber[i] = 0x0;
}
// зачищаем экран монитора
system("cls");
printf(" ***********************************\n");
printf(" Module E14-140 \n");
printf(" Console example for Multi Modules \n");
printf(" ***********************************\n\n");
// проверим версию используемой библиотеки Lusbapi.dll
if((DllVersion = GetDllVersion()) != CURRENT_VERSION_LUSBAPI)
{
char String[128];
sprintf(String, " Lusbapi.dll Version Error!!!\n Current: %1u.%1u. Required: %1u.%1u",
DllVersion >> 0x10, DllVersion & 0xFFFF,
CURRENT_VERSION_LUSBAPI >> 0x10, CURRENT_VERSION_LUSBAPI & 0xFFFF);
AbortProgram(String);
}
else printf(" Lusbapi.dll Version --> OK\n");
printf("\n E14-140 modules List:\n");
// обнуляем счётчик обнаруженных модулей
ModulesQuantity = 0x0;
// Сканируем первые MaxVirtualSoltsQuantity виртуальных слотов в поисках модулей типа E14-140
for(i = 0x0; i < MaxVirtualSoltsQuantity; i++)
{
// получим указатель на интерфейс
pModules[i] = static_cast<ILE140 *>(CreateLInstance("e140"));
if(!pModules[i]) AbortProgram(" Module Interface --> Bad\n");
// попробуем обнаружить модуль типа E14-140 в соответствующем виртуальном слоте
else if(!pModules[i]->OpenLDevice(i)) { pModules[i]->ReleaseLInstance(); pModules[i] = NULL; continue; }
// прочитаем название модуля в нулевом виртуальном слоте
else if(!pModules[i]->GetModuleName(ModuleName)) AbortProgram(" GetModuleName() --> Bad\n");
// убедимся, что это E14-140
else if(strcmp(ModuleName, "E140")) AbortProgram(" The detected module is not E14-140. The appication is terminated.\n");
// попробуем узнать скорость USB для текущего модуля
else if(!pModules[i]->GetUsbSpeed(&UsbSpeed)) AbortProgram(" GetUsbSpeed() --> Bad\n");
// получим информацию из ППЗУ модуля
else if(!pModules[i]->GET_MODULE_DESCRIPTION(&ModuleDescription)) AbortProgram(" GET_MODULE_DESCRIPTION() --> Bad\n");
// проверим прошивку MCU модуля
else if((ModuleDescription.Module.Revision == REVISIONS_E140[REVISION_B_E140]) &&
(strtod((char *)ModuleDescription.Mcu.Version.Version, NULL) < 3.05)) AbortProgram(" For module E14-140(Rev.'B') firmware version must be 3.05 or above --> !!! ERROR !!!\n");
// получим текущие параметры работы АЦП
if(!pModules[i]->GET_ADC_PARS(&ap)) AbortProgram(" GET_ADC_PARS() --> Bad\n");
// установим желаемые параметры АЦП
ap.ClkSource = INT_ADC_CLOCK_E140; // внутренний запуск АЦП
ap.EnableClkOutput = ADC_CLOCK_TRANS_DISABLED_E140; // без трансляции тактовых импульсо АЦП
ap.InputMode = NO_SYNC_E140; // без синхронизации ввода данных
ap.ChannelsQuantity = ADC_CHANNELS_QUANTITY; // кол-во активных каналов
for(j = 0x0; j < ADC_CHANNELS_QUANTITY; j++) ap.ControlTable[j] = (WORD)(j | (ADC_INPUT_RANGE_2500mV_E140 << 0x6));
ap.AdcRate = AdcRate; // частота работы АЦП в кГц
ap.InterKadrDelay = 0.0; // межкадровая задержка в мс
// передадим требуемые параметры работы АЦП в модуль
if(!pModules[i]->SET_ADC_PARS(&ap)) AbortProgram(" SET_ADC_PARS() --> Bad\n");
// выделим память под двойной буфер
Buffer[i] = new SHORT[2*DataStep];
if(!Buffer[i]) AbortProgram(" Cannot allocate buffer memory.\n");
// инкрементируем счётчик обнаруженных модулей
ModulesQuantity++;
printf(" %2u. Virtual Slot %2u. Module (S/N %s, %s) is ready ... \n", ModulesQuantity, i, ModuleDescription.Module.SerialNumber, UsbSpeed ? "HIGH-SPEED (480 Mbit/s)" : "FULL-SPEED (12 Mbit/s)");
}
// проверим: мы нашли хоть какой-нибудь модуль?
if(!ModulesQuantity) { printf(" Empty...\n"); AbortProgram("\n Can't detect any E14-140 module :(((\n"); }
// запомним текущие координаты курсора
GetXY(&Coord); Coord.Y += (WORD)0x3;
// попробуем запустить поток сбора данных для каждого из обнаруженных модуля
MainErrorNumber = 0x0;
for(i = 0x0; i < MaxVirtualSoltsQuantity; i++)
{
// создаем и запускаем потоки сбора данных
if(!pModules[i]) continue;
ReadThreadIndex[i] = i;
ReadThreadHandle[i] = CreateThread(0, 0x2000, ServiceReadThread, &ReadThreadIndex[i], 0, &ReadThreadTid[i]);
if(!ReadThreadHandle[i]) AbortProgram("\n CreateThread() --> Bad\n");
}
// ждем завершения работы потоков по факту нажатия любой клавиши клавиатуры
printf("\n Press any key to terminate the program ...\n\n");
while(true)
{
if(kbhit()) { MainErrorNumber = 0x1; break; }
Sleep(20);
}
// если программа была злобно прервана, предъявим ноту протеста
if(MainErrorNumber == 0x1) AbortProgram(" The program was terminated successfully!\n", false);
else AbortProgram(" The program was completed successfully!!!\n", false);
}
//------------------------------------------------------------------------
// Поток сбора данных с модуля E14-140
//------------------------------------------------------------------------
DWORD WINAPI ServiceReadThread(PVOID ThreadIndex)
{
WORD i;
// номер запроса
WORD RequestNumber;
// номер текущего потока
DWORD ti = *(DWORD *)ThreadIndex;
// локальная структура координат курсора
COORD LocCoord;
// массив OVERLAPPED структур
OVERLAPPED ReadOv[2];
// массив структур с параметрами запроса на ввод/вывод данных
IO_REQUEST_LUSBAPI IoReq[2];
// остановим работу АЦП и одновременно сбросим USB-канал чтения данных
if(pModules[ti]->STOP_ADC())
{
// формируем необходимые для сбора данных структуры
for(i = 0x0; i < 0x2; i++)
{
// инициализация структуры типа OVERLAPPED
ZeroMemory(&ReadOv[i], sizeof(OVERLAPPED));
// создаём событие для асинхронного запроса
ReadOv[i].hEvent = CreateEvent(NULL, FALSE , FALSE, NULL);
// формируем структуру IoReq
IoReq[i].Buffer = Buffer[ti] + i*DataStep;
IoReq[i].NumberOfWordsToPass = DataStep;
IoReq[i].NumberOfWordsPassed = 0x0;
IoReq[i].Overlapped = &ReadOv[i];
IoReq[i].TimeOut = (DWORD)(DataStep/ap.AdcRate + 1000);
}
// координаты курсора текущего потока
EnterCriticalSection(&cs);
// gotoxy(XCoordCounter, YCoordCounter + 1*ti);
LocCoord.X = Coord.X; LocCoord.Y = Coord.Y + (WORD)(1*ti); SetXY(&LocCoord);
printf(" Counter[%2u]: %8u", ti/*+0x1*/, Counter[ti] = 0x0);
LeaveCriticalSection(&cs);
// делаем предварительный запрос на ввод данных
RequestNumber = 0x0;
if(!pModules[ti]->ReadData(&IoReq[RequestNumber])) { ReadThreadErrorNumber[ti] = 0x2; goto ReadThreadFinish; }
// теперь запускаем ввод данных
if(pModules[ti]->START_ADC())
{
// цикл сбора данных
while(!IsReadThreadTerminated[ti])
{
// сделаем запрос на очередную порции данных
RequestNumber ^= 0x1;
if(!pModules[ti]->ReadData(&IoReq[RequestNumber])) { ReadThreadErrorNumber[ti] = 0x2; break; }
if(IsReadThreadTerminated[ti]) break;
// ждём завершения операции сбора предыдущей порции данных
if(!WaitingForIoRequestCompleted(IoReq[RequestNumber^0x1].Overlapped, ti)) break;
// if(WaitForSingleObject(ReadOv[RequestNumber^0x1].hEvent, IoReq[RequestNumber^0x1].TimeOut) == WAIT_TIMEOUT) { /*ReadThreadErrorNumber = 0x3;*/ break; }
if(IsReadThreadTerminated[ti]) break;
// инкремент счётчика текущего потока
Counter[ti]++;
// отобразим состояние счётчика данного потока при отсутствии ошибок
if(!IsReadThreadTerminated[ti] && !ReadThreadErrorNumber[ti])
{
EnterCriticalSection(&cs);
// gotoxy(XCoordCounter, YCoordCounter + 1*ti);
LocCoord.X = Coord.X; LocCoord.Y = Coord.Y + (WORD)(1*ti); SetXY(&LocCoord);
printf(" Counter[%2u]: %8u", ti/*+0x1*/, Counter[ti]);
LeaveCriticalSection(&cs);
}
// была ли какая-нибудь ошибка в работе данного потока
if(IsReadThreadTerminated[ti]) break;
else if(ReadThreadErrorNumber[ti]) break;
else Sleep(20);
}
}
else ReadThreadErrorNumber[ti] = 0x4;
}
else ReadThreadErrorNumber[ti] = 0x6;
ReadThreadFinish:
// остановим ввод данных
if(!pModules[ti]->STOP_ADC()) ReadThreadErrorNumber[ti] = 0x6;
// прервём, если нужно, асинхронный запрос
if(!CancelIo(pModules[ti]->GetModuleHandle())) ReadThreadErrorNumber[ti] = 0x7;
// освободим все идентификаторы событий
for(i = 0x0; i < 0x2; i++) CloseHandle(IoReq[i].Overlapped->hEvent);
// отобразим состояние счётчика данного потока при наличии ошибок
if(ReadThreadErrorNumber[ti])
{
EnterCriticalSection(&cs);
// gotoxy(XCoordCounter, YCoordCounter + 1*ti);
LocCoord.X = Coord.X; LocCoord.Y = Coord.Y + (WORD)(1*ti); SetXY(&LocCoord);
printf(" Counter[%2u]: Thread Error!", ti/*+0x1*/, Counter[ti]);
LeaveCriticalSection(&cs);
}
// теперь спокойно можно выйти из потока
return 0x0;
}
//---------------------------------------------------------------------------
//
//---------------------------------------------------------------------------
BOOL WaitingForIoRequestCompleted(OVERLAPPED *ReadOv, DWORD ThreadTid)
{
// ждём завершения очередного запроса
while(!IsReadThreadTerminated[ThreadTid])
{
if(HasOverlappedIoCompleted(ReadOv)) break;
else if(IsReadThreadTerminated[ThreadTid]) break;
else Sleep(20);
}
return TRUE;
}
//------------------------------------------------------------------------
// вывод сообщения об ошибке
//------------------------------------------------------------------------
void AbortProgram(char *ErrorString, bool AbortionFlag)
{
WORD i;
// подчистим за собой
for(i = 0x0; i < MaxVirtualSoltsQuantity; i++)
{
if(ReadThreadHandle[i] != NULL)
{
// прервем данный поток
IsReadThreadTerminated[i] = true;
// ждём окончания работы данного потока
WaitForSingleObject(ReadThreadHandle[i], INFINITE);
// освободим идентификатор данного потока
CloseHandle(ReadThreadHandle[i]);
}
// освободим память буфера
if(Buffer[i]) { delete[] Buffer[i]; Buffer[i] = NULL; }
// освободим модуль
if(pModules[i]) { pModules[i]->ReleaseLInstance(); pModules[i] = NULL; }
}
// освободим критической секции
DeleteCriticalSection(&cs);
// выставим положение курсора
// if(ModulesQuantity) gotoxy(XCoordCounter, YCoordCounter + ModulesQuantity + 0x2);
if(ModulesQuantity) { Coord.Y += ModulesQuantity + 0x2; SetXY(&Coord); }
else printf("\n\n");
// выводим текст сообщения
if(ErrorString) printf(ErrorString);
// если нужно - аварийно завершаем программу
if(AbortionFlag) exit(0x1);
else return;
}
//------------------------------------------------------------------------------
// Установка курсора в координаты X, Y
//------------------------------------------------------------------------------
void SetXY(COORD * const Coord)
{
SetConsoleCursorPosition(OutputConsoleHandle, *Coord);
}
//---------------------------------------------------------------------------
// Чтение текущих координаты X, Y курсора
//---------------------------------------------------------------------------
void GetXY(COORD * const Coord)
{
CONSOLE_SCREEN_BUFFER_INFO Csi;
GetConsoleScreenBufferInfo(OutputConsoleHandle, &Csi);
*Coord = Csi.dwCursorPosition;
}
|
[
"[email protected]"
] | |
e0efefd471a6624fbc7632bdbc9bb076f3f68f9e
|
0eff74b05b60098333ad66cf801bdd93becc9ea4
|
/second/download/rsync/gumtree/rsync_new_log_729.cpp
|
9d1934ce8a316817c3541e0fa6bf41e97a8bd7ae
|
[] |
no_license
|
niuxu18/logTracker-old
|
97543445ea7e414ed40bdc681239365d33418975
|
f2b060f13a0295387fe02187543db124916eb446
|
refs/heads/master
| 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 49 |
cpp
|
flist_new(WITH_HLINK, "create_flist_from_batch");
|
[
"[email protected]"
] | |
6a8ce7ce2341a4abe3f9c5322d9f96ec85b69f64
|
376e1818d427b5e4d32fa6dd6c7b71e9fd88afdb
|
/comms/estic/patches/patch-spunk_str.cc
|
38059de8855aa5840b184be9f5b2876dd6ede8c7
|
[] |
no_license
|
NetBSD/pkgsrc
|
a0732c023519650ef821ab89c23ab6ab59e25bdb
|
d042034ec4896cc5b47ed6f2e5b8802d9bc5c556
|
refs/heads/trunk
| 2023-09-01T07:40:12.138283 | 2023-09-01T05:25:19 | 2023-09-01T05:25:19 | 88,439,572 | 321 | 138 | null | 2023-07-12T22:34:14 | 2017-04-16T20:04:15 | null |
UTF-8
|
C++
| false | false | 247 |
cc
|
$NetBSD: patch-spunk_str.cc,v 1.1 2012/11/16 00:37:47 joerg Exp $
--- spunk/str.cc.orig 1996-12-01 11:23:50.000000000 +0000
+++ spunk/str.cc
@@ -31,6 +31,7 @@
#include "stream.h"
#include "streamid.h"
+#undef CS
// Register class String
|
[
"[email protected]"
] | |
5f416ddd605bd821da26fd978ffd5c02c610600c
|
873aae9ee43308cc91d6c925d1fcead3b9c0a97b
|
/Solutions/Numbers/PowerPrimeFactors.cpp
|
4ee7447acaf2528eb21a689ce5651090cc18bb9b
|
[
"MIT"
] |
permissive
|
gourishbiradar/Projects
|
09d3fd79231978f314842a02e240e8745879d70e
|
453bfcf08adb4de14daba1f6e21c9ef75102bbdb
|
refs/heads/master
| 2021-09-04T19:06:19.307551 | 2018-01-21T13:55:24 | 2018-01-21T13:55:24 | 117,327,679 | 0 | 0 | null | 2018-01-13T08:34:02 | 2018-01-13T08:34:01 | null |
UTF-8
|
C++
| false | false | 1,085 |
cpp
|
#include <iostream>
#include <vector>
#include <utility>
#include <string.h> //to use memset
using namespace std;
void LPF(int N, int s[])
{
memset(s,0,N);
s[1]=1;
s[2]=2;
for(int i=4;i<=N;i+=2)
{
s[i]=2;
}
for(int i=3;i<=N;i+=2)
{
if(s[i]==0)
{
s[i]=i;
for(int j=2*i;j<=N;j+=i)
{
if(s[j]==0)
s[j]=i;
}
}
}
}
void PowersOfN(int N,vector< pair<int,int> > PrimeFactors)
{
int* s = new int[N+1];
LPF(N,s);
int curr = s[N];
int power = 1;
while(N>1)
{
N/=s[N];
if(curr==s[N])
{
power++;
continue;
}
cout<<curr<<" "<<power<<endl;
PrimeFactors.push_back(make_pair(curr,power));
curr = s[N];
power=1;
}
}
int main()
{
int n;
vector< pair<int,int> > PrimeFactors;
cout<<"Enter a number:";
cin>>n;
cout<<"The prime factors with corresponding powers are:\n";
PowersOfN(n,PrimeFactors);
return 0;
}
|
[
"[email protected]"
] | |
32d5c3330507308cf4ca15108b40b22ad55d4602
|
799d451f51052cc1f9a5433d65b5da358f0cba11
|
/proptree.h
|
4bc06ad68a827bb5d2a55b49086b8fd5e627edef
|
[] |
no_license
|
GeeveGeorge/Intellidetect
|
d5f7db859209d2a6be491181da16f4fd65af3c41
|
eb02bda6fbb3b66af723b17ac603bdb00c9edc01
|
refs/heads/master
| 2021-01-09T20:08:06.853190 | 2017-02-04T03:40:37 | 2017-02-04T03:40:37 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 4,323 |
h
|
#ifndef PROPTREE_H
#define PROPTREE_H
#include <constants.h>
struct propertyTree{
string data;
vector< pair<string, propertyTree> > childNodes;
public:
bool load(string);
string getProperty(string);
void setProperty(string,string);
void setPropertyIfNotSet(string,string);
bool isSet(string);
string toString(int);
};
bool propertyTree::load(string path){
childNodes.clear();
fstream prop;
prop.open(path,ios::in);
if(!prop)
return false;
cout<<"\nopened file"<<endl;
string line;
vector<string> prevProps;
unsigned int level = 0;
do{
getline(prop, line);
if(line[0]=='/' && line[1] == '/')
continue;
else if(line[0] == '\t' || line[0] == ' ')
++level;
string propName,value;
bool flag = false;
for(unsigned int i=0;i<line.length();++i){
if(line[i]==' ') continue;
if(line[i]== '='){
flag = true;
continue;
}
if(flag)
value.append(&line[i],1);
else if(line[i]!='\t')
propName.append(&line[i],1);
}
if(!value.length())
if(level>=prevProps.size())
prevProps.push_back(propName);
else
prevProps[level] = propName;
else{
for(unsigned int i=level-1;i<prevProps.size();--i)
propName = (prevProps[i]+string(".")+propName);
if(!propName.compare("version"))
data = value;
else
setProperty(propName,value);
level=0;
}
}while(!prop.eof());
prop.close();
return true;
}
void propertyTree::setProperty(string property, string value){
bool flag=false;
string nodeName(""),propName("");
for(unsigned int i=0;i<property.length();++i){
if(property[i]=='.'){
flag=true;
++i;
}
if(flag)
propName.append(&property[i],1);
else
nodeName.append(&property[i],1);
}
for(unsigned int i=0;i<childNodes.size();++i){
if(!get<0>(childNodes[i]).compare(nodeName)){
if(propName.length())
get<1>(childNodes[i]).setProperty(propName,value);
else
get<1>(childNodes[i]).data = value;
return;
}
}
childNodes.push_back(make_pair(nodeName,*(new propertyTree)));
if(propName.length())
get<1>(childNodes.back()).setProperty(propName,value);
else
get<1>(childNodes.back()).data = value;
}
void propertyTree::setPropertyIfNotSet(string property, string value){
if(!isSet(property))
setProperty(property,value);
}
string propertyTree::getProperty(string property){
bool flag=false;
string nodeName,propName;
for(unsigned int i=0;i<property.length();++i){
if(property[i]=='.'){
flag=true;
++i;
}
if(flag)
propName.append(&property[i],1);
else
nodeName.append(&property[i],1);
}
for(auto prop: childNodes){
if(!get<0>(prop).compare(nodeName)){
return get<1>(prop).getProperty(propName);
}
}
return data;
}
bool propertyTree::isSet(string property){
bool flag=false;
string nodeName,propName;
for(unsigned int i=0;i<property.length();++i){
if(property[i]=='.'){
flag=true;
++i;
}
if(flag)
propName.append(&property[i],1);
else
nodeName.append(&property[i],1);
}
for(auto prop: childNodes){
if(!get<0>(prop).compare(nodeName)){
if(propName.length())
return get<1>(prop).isSet(propName);
else
return true;
}
}
return false;
}
string propertyTree::toString(int level=0){
string strRep("");
if(!level){
strRep+=string("version = ");
}
strRep+=(data+string("\n"));
for(auto prop: childNodes){
for(int i=0;i<level;++i)
strRep+=string("\t");
strRep+=(get<0>(prop) + string(" = ") + get<1>(prop).toString(level+1));
}
return strRep;
}
#endif // PROPTREE_H
|
[
"[email protected]"
] | |
fd1738132628c2edd7ba11c3fb263009e1e0b6a5
|
740fdf1cca74bdb8f930a7907a48f9bdd9b5fbd3
|
/content/browser/devtools/render_frame_devtools_agent_host.h
|
df0f47fc9f3377517feea8dce6421bcc5372d36c
|
[
"BSD-3-Clause"
] |
permissive
|
hefen1/chromium
|
a1384249e2bb7669df189235a1ff49ac11fc5790
|
52f0b6830e000ca7c5e9aa19488af85be792cc88
|
refs/heads/master
| 2016-09-05T18:20:24.971432 | 2015-03-23T14:53:29 | 2015-03-23T14:53:29 | 32,579,801 | 0 | 2 | null | null | null | null |
UTF-8
|
C++
| false | false | 5,064 |
h
|
// 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.
#ifndef CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_
#define CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_
#include <map>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "content/browser/devtools/ipc_devtools_agent_host.h"
#include "content/common/content_export.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
namespace cc {
class CompositorFrameMetadata;
}
namespace content {
class BrowserContext;
class DevToolsFrameTraceRecorder;
class DevToolsProtocolHandler;
class RenderFrameHost;
class RenderFrameHostImpl;
#if defined(OS_ANDROID)
class PowerSaveBlockerImpl;
#endif
namespace devtools {
namespace dom { class DOMHandler; }
namespace input { class InputHandler; }
namespace inspector { class InspectorHandler; }
namespace network { class NetworkHandler; }
namespace page { class PageHandler; }
namespace power { class PowerHandler; }
namespace tracing { class TracingHandler; }
}
class CONTENT_EXPORT RenderFrameDevToolsAgentHost
: public IPCDevToolsAgentHost,
private WebContentsObserver,
public NotificationObserver {
public:
static void OnCancelPendingNavigation(RenderFrameHost* pending,
RenderFrameHost* current);
void SynchronousSwapCompositorFrame(
const cc::CompositorFrameMetadata& frame_metadata);
bool HasRenderFrameHost(RenderFrameHost* host);
// DevTooolsAgentHost overrides.
void DisconnectWebContents() override;
void ConnectWebContents(WebContents* web_contents) override;
BrowserContext* GetBrowserContext() override;
WebContents* GetWebContents() override;
Type GetType() override;
std::string GetTitle() override;
GURL GetURL() override;
bool Activate() override;
bool Close() override;
private:
friend class DevToolsAgentHost;
explicit RenderFrameDevToolsAgentHost(RenderFrameHost*);
~RenderFrameDevToolsAgentHost() override;
// IPCDevToolsAgentHost overrides.
void DispatchProtocolMessage(const std::string& message) override;
void SendMessageToAgent(IPC::Message* msg) override;
void OnClientAttached() override;
void OnClientDetached() override;
// WebContentsObserver overrides.
void AboutToNavigateRenderFrame(RenderFrameHost* old_host,
RenderFrameHost* new_host) override;
void RenderFrameHostChanged(RenderFrameHost* old_host,
RenderFrameHost* new_host) override;
void RenderFrameDeleted(RenderFrameHost* rvh) override;
void RenderProcessGone(base::TerminationStatus status) override;
bool OnMessageReceived(const IPC::Message& message,
RenderFrameHost* render_frame_host) override;
bool OnMessageReceived(const IPC::Message& message) override;
void DidAttachInterstitialPage() override;
void DidDetachInterstitialPage() override;
void TitleWasSet(NavigationEntry* entry, bool explicit_set) override;
void NavigationEntryCommitted(
const LoadCommittedDetails& load_details) override;
// NotificationObserver overrides:
void Observe(int type,
const NotificationSource& source,
const NotificationDetails& details) override;
void DisconnectRenderFrameHost();
void ConnectRenderFrameHost(RenderFrameHost* rvh);
void ReattachToRenderFrameHost(RenderFrameHost* rvh);
void SetRenderFrameHost(RenderFrameHost* rvh);
void ClearRenderFrameHost();
void RenderFrameCrashed();
void OnSwapCompositorFrame(const IPC::Message& message);
bool OnSetTouchEventEmulationEnabled(const IPC::Message& message);
void OnDispatchOnInspectorFrontend(const DevToolsMessageChunk& message);
void DispatchOnInspectorFrontend(const std::string& message);
void ClientDetachedFromRenderer();
void InnerOnClientAttached();
void InnerClientDetachedFromRenderer();
RenderFrameHostImpl* render_frame_host_;
scoped_ptr<devtools::dom::DOMHandler> dom_handler_;
scoped_ptr<devtools::input::InputHandler> input_handler_;
scoped_ptr<devtools::inspector::InspectorHandler> inspector_handler_;
scoped_ptr<devtools::network::NetworkHandler> network_handler_;
scoped_ptr<devtools::page::PageHandler> page_handler_;
scoped_ptr<devtools::power::PowerHandler> power_handler_;
scoped_ptr<devtools::tracing::TracingHandler> tracing_handler_;
scoped_ptr<DevToolsProtocolHandler> protocol_handler_;
scoped_ptr<DevToolsFrameTraceRecorder> frame_trace_recorder_;
#if defined(OS_ANDROID)
scoped_ptr<PowerSaveBlockerImpl> power_save_blocker_;
#endif
NotificationRegistrar registrar_;
bool reattaching_;
DISALLOW_COPY_AND_ASSIGN(RenderFrameDevToolsAgentHost);
};
} // namespace content
#endif // CONTENT_BROWSER_DEVTOOLS_RENDER_FRAME_DEVTOOLS_AGENT_HOST_H_
|
[
"[email protected]"
] | |
40a13a786c862b00a5eb5f0e5872e1a10f117879
|
6420c5a67ba01d85ba56e82f7cff2604199a24d4
|
/Exercise06B/Exercise06B/main.cpp
|
04058c47eb3ab5f589b73c30c1576c5ee0fef8e9
|
[] |
no_license
|
gentigashi/Cplusplus-tasks
|
84366a02ababd333e44006b450ac0b3eaf1d3e91
|
f29bec67610187b03c021a19035fd8ba731d5559
|
refs/heads/main
| 2023-01-24T18:46:21.307214 | 2020-12-15T12:08:55 | 2020-12-15T12:08:55 | 314,282,986 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 2,255 |
cpp
|
//
// main.cpp
// Exercise06B
//
// Created by Genti Gashi on 15.11.2020.
// Copyright © 2020 Genti Gashi. All rights reserved.
//
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <iomanip> // std::setiosflags
#include "Day.h"
#include "Time.h"
using namespace std;
int main()
{
ifstream inputFile("calendar.txt");
if (!inputFile.is_open()) {
cout << "Unable to open file" << endl;
return 1;
}
string line;
vector<Day> cal;
Day day;
while (getline(inputFile, line)) {
if (day.from_str(line)) {
cal.push_back(day);
}
}
cout << "Calendar" << endl;
for (auto& e : cal) {
cout << e.to_str() << endl;
}
// DST shift
for (auto& e : cal) {
e.dst(1);
}
cout << "DST" << endl;
for (auto& e : cal) {
cout << e.to_str() << endl;
}
cout << "End" << endl;
return 0;
}
Day::Day() {
day = 1;
month = "January";
list.clear();
}
bool Day::from_str(const string& line) {
int ret =0;
string temp;
istringstream sin(line);
bool loop = false;
*this = Day();
Time t;
while (ret <= 1 && sin >> temp) {
if (ret == 0) {
day = stoi(temp);
ret++;
}
else if (ret == 1) {
month = temp;
ret++;
loop = true;
}
}
while (sin >> t)
{
list.push_back(t);
}
return loop;
}
string Day::to_str() {
ostringstream out;
out << day << " " << month;
for (auto t : list)
{
out << " " << t.to_str();
}
return out.str();
}
void Day::dst(int offset) {
for (auto& s : list) {
s.dst();
}
}
Time::Time(int hh, int mm)
:hour(hh), min(mm) { //
}
Time& Time::dst() {
hour++;
hour = hour % 24;
return *this;
}
string Time::to_str() {
ostringstream out;
out << setiosflags(ios::right) << setfill('0') << setw(2) << hour << ":" << setfill('0') << setw(2) << min; // 00:00
return out.str();
}
istream& operator>>(istream& in, Time& output)
{
char s = ':';
in >> output.hour >> s >>output.min;
return in;
}
|
[
"[email protected]"
] | |
c27a6f5353a09abe56e2ec8cb08bb1d418b13b12
|
fb28c10f8255ded7982f6a2bbeb4453ddedad589
|
/exampleB2b-TBB-granular.cc
|
f2e5ed7eb1ddda4c6d891b6e53a83766ef85c5cb
|
[] |
no_license
|
makortel/B2b-TBB-granular
|
b2bc07a9d9513a27bc0f5855e26ea3112dc0416b
|
bfea26a4b99c4dd5c7de7416202ba5c30f88a0f0
|
refs/heads/master
| 2020-12-25T04:54:00.828207 | 2014-06-11T08:38:34 | 2014-06-11T08:38:34 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 6,638 |
cc
|
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: exampleB2b-TBB-granular.cc 80806 2014-05-12 15:01:12Z japost $
//
/// \file exampleB2b.cc
/// \brief Main program of the B2b example
#include "B2bDetectorConstruction.hh"
#include "B2ActionInitialization.hh"
//G4-TBB interfaces
#include "tbbUserWorkerInitialization.hh"
#include "tbbMasterRunManager.hh"
#include "G4Threading.hh"
#include "G4UImanager.hh"
#include "FTFP_BERT.hh"
#include "G4StepLimiterPhysics.hh"
#include "Randomize.hh"
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#ifdef G4UI_USE
#include "G4UIExecutive.hh"
#endif
//TBB includes
#include <tbb/task_scheduler_init.h>
#include <tbb/task.h>
#include "SimEventModule.hh"
#include "tbbMasterRunManager.hh"
//This function is very simple: it just start tbb work.
//This is done in a seperate thread, because for G4 the
//master cannot live in the same thread where workers are
//Starting tbb work in a thread guarantees that no workers
//are created where the master lives (the main thread)
//Clearly a separate solution is to create and configure master
//in a separate thread. But this is much simpler.
G4ThreadFunReturnType startWork(G4ThreadFunArgType arg)
{
tbb::task_list* tasks = static_cast<tbb::task_list*>(arg);
//We assume at least one /run/beamOn was executed, thus the tasklist is now filled,
//lets start TBB
try {
std::cout<<"Now calling 'tbb::task::spawn_work_and_wait' "<<std::endl;
tbb::task::spawn_root_and_wait( *tasks );
} catch(std::exception& e) {
std::cerr<<"Error occurred. Error info is:\""<<e.what()<<"\""<<std::endl;
}
return static_cast<G4ThreadFunReturnType>(0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc,char** argv)
{
// Choose the Random engine
G4Random::setTheEngine(new CLHEP::RanecuEngine);
unsigned int numCoresAvailable= G4Threading::G4GetNumberOfCores();
unsigned int numberOfCoresToUse= (numCoresAvailable > 1 ) ? 2 : 1 ;
//=== TBB engine initialization
// tbb::task_scheduler_init init( numberOfCoresToUse );
// tbb::task_list tasks;
// Simple example for using TBB scheduler:
// From http://www.ibm.com/developerworks/aix/library/au-intelthreadbuilding/index.html?ca=dat
// task_scheduler_init init(task_scheduler_init::automatic);
// first_task& f1 = *new(tbb::task::allocate_root()) first_task( );
// tbb::task::spawn_root_and_wait(f1);
// tbbMasterRunManager* runManager = new tbbMasterRunManager;
SimEventModule* simEventMdl= new SimEventModule( numberOfCoresToUse );
// Must be instantiated in the main program -- the tasks require it to do the work
// simEventMdl= SimEventModule->GetInstance();
tbbMasterRunManager* runManager = simEventMdl->GetMasterRunManager();
//Set TBB specific data to run-manager, 1 event per tbb::task (e.g. Nevents == N tasks)
//Note that a /run/beamOn command will just create tasks and add them to tasks
runManager->SetNumberEventsPerTask(1); //Not needed since 1 is default
runManager->SetTaskList(&tasks);
//Set user-initialization that specify threading model, in this case TBB.
//This overwrote default that used pthreads
runManager->SetUserInitialization(new tbbUserWorkerInitialization );
//==== Geant4 specific stuff, from now up to END-G4 comment is copy from MT example
// Set mandatory initialization classes
runManager->SetUserInitialization(new B2bDetectorConstruction());
G4VModularPhysicsList* physicsList = new FTFP_BERT;
physicsList->RegisterPhysics(new G4StepLimiterPhysics());
runManager->SetUserInitialization(physicsList);
// Set user action classes
runManager->SetUserInitialization(new B2ActionInitialization());
simEventMdl->Initialize();
// Will Initialize the G4 kernel ie call runManager->Initialize();
// Get the pointer to the User Interface manager
G4UImanager* UImanager = G4UImanager::GetUIpointer();
if (argc!=1) // batch mode
{
G4String command = "/control/execute ";
G4String fileName = argv[1];
UImanager->ApplyCommand(command+fileName);
}
else
{ // interactive mode : define UI session
#if 1
G4int nEvents= 50;
runManager->BeamOn(nEvents);
#else
#ifdef G4UI_USE
G4UIExecutive* ui = new G4UIExecutive(argc, argv);
UImanager->ApplyCommand("/control/execute init.mac");
if (ui->IsGUI())
UImanager->ApplyCommand("/control/execute gui.mac");
ui->SessionStart();
delete ui;
#endif
#endif
}
//END-G4
#if 1
runManager->CreateTasks();
runManager->CreateAndStartWorkers();
#else
G4Thread aThread;
G4THREADCREATE(&aThread,startWork,static_cast<G4ThreadFunArgType>(&tasks));
//Wait for work to be finised
G4THREADJOIN(aThread);
#endif
// delete runManager;
delete simEventMdl; // This should delete the runManager
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
[
"[email protected]"
] | |
1720263ec19a23207da60179cc300bfc634e0800
|
ae992a865457d5f0563618a1a19332cf60426645
|
/include/operators/GlobalLpPool.h
|
fb45c44875402b97183845e7e85d4859a9a076fc
|
[
"Apache-2.0"
] |
permissive
|
Rodio346/dnnc-operators
|
c948a1d0b15e85b30bb17595d415f4b868ea2c2e
|
c0a3f55b79fd3b4dc7fa5ae1dc4a11d5afd17fd7
|
refs/heads/master
| 2020-07-08T18:01:19.345702 | 2019-08-22T07:15:46 | 2019-08-22T07:15:46 | 202,743,304 | 0 | 0 | null | 2019-08-16T14:35:21 | 2019-08-16T14:35:20 | null |
UTF-8
|
C++
| false | false | 2,611 |
h
|
// Copyright 2018 The AITS DNNC Authors.All Rights Reserved.
//
// Licensed to the Apache Software Foundation(ASF) under one
// or more contributor license agreements.See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.See the License for the
// specific language governing permissionsand limitations
// under the License.
//
// This file is part of AITS DNN compiler maintained at
// https://github.com/ai-techsystems/dnnCompiler
//
#pragma once
#include "operators/baseOperator.h"
#include <string>
#include <math.h>
using namespace Eigen;
namespace dnnc {
template <typename T> class GlobalLpPool : public baseOperator<T> {
protected:
int p = 2;
public:
GlobalLpPool(std::string name = "opGlobalLpPool",int p = 2)
: baseOperator<T>(opGlobalLpPool, name) {
this->p = p;
}
bool getAttribute(OPATTR attrName,int& obj)
{
if (attrName == attr_p) {
obj = p;
return true;
}
return false;
}
void setAttribute(OPATTR attrName,int& obj)
{
if(attrName == attr_p) {
p = obj;
}
}
static bool compare()
{
return ( (typeid(T) == typeid(float))||(typeid(T) == typeid(double)) );
}
tensor<T> compute(tensor<T>& a)
{
if(!compare() )
throw std::invalid_argument("Constrain input and output types to float tensors.");
//Reshaping the tensor to 3D.
size_t axis_left=1;
for(int i = 2; i < int(a.rank()) ;i++)
{
axis_left *= a.shape()[i];
}
std::vector<size_t> shape{a.shape()[0],a.shape()[1],axis_left};
a.reshape(shape);
int cummulation = axis_left;
tensor<T> result(a.shape()[0],a.shape()[1]);
int j = 0;
double sum = 0;
for (size_t i = 0; i < a.length();i++)
{
sum += pow(abs(a[i]),p);
if (!((i+1)%cummulation))
{
result[j++] = T(pow(sum,pow(p,-1)));
sum = 0;
}
}
return result;
}
};
} // namespace dnnc
|
[
"[email protected]"
] | |
2d80da414668b74abc76081187b0604927c348db
|
7951bff8115c96cae40634dfca8520964cdd68e2
|
/chapter4/classdefine.cpp
|
73746b3f12180511af6ab0d9da82b513393d47ff
|
[] |
no_license
|
profding-bh/C_Plus_Plus
|
b764fab6a4e02019e875904b3dac30be858cfdf6
|
d87e8adefacbf46c7b3047b66d800ee64544a877
|
refs/heads/master
| 2021-06-16T08:18:52.398079 | 2017-04-27T10:53:30 | 2017-04-27T10:53:30 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 513 |
cpp
|
/*
http://cdn2.ime.sogou.com/dl/index/1475147394/sogoupinyin_2.1.0.0082_amd64.deb?st=y26oHG-dX1iyE7443HF1cw&e=1491277141&fn=sogoupinyin_2.1.0.0082_amd64.deb
结构体和类都可以用来定义新的类型,
区别:
结构体,在默认情况下,成员(数据成员&成员函数) 是public的。
而 类,在默认情况下,成员(数据成员&成员函数) 是private的。
*/
class 类名{
private:
私有数据成员&私有成员函数
public:
公有数据成员&公有成员函数
};
|
[
"[email protected]"
] | |
e88ac1bf64273964da547a013a56fcd0a0c71af4
|
c8f3e47d118a2cbb5230ab8e7fafa65a5f071123
|
/exercises/session2/quad_reg/MovingQuadReg.cpp
|
a691a97ad0a8d6ff25087c318000ec0cd3e18f0b
|
[] |
no_license
|
RyanCargan/CMakeTraining
|
f0e82bc81328246b032e10d311cbed9cf82204df
|
6628538e506e49eec50cb1e500aff0b67728a40e
|
refs/heads/master
| 2022-10-11T05:33:39.789005 | 2020-06-14T09:49:20 | 2020-06-14T09:49:20 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 3,327 |
cpp
|
// MovingQuadReg.cpp
// Author: Ian Heidenberger
//
// MovingQuadReg calculates an n-deep sliding quadratic regression.
#include "MovingQuadReg.h"
#include <limits>
MovingQuadReg::MovingQuadReg(size_t size):
maxSize(size)
{
}
void MovingQuadReg::addPoint(float t, float y)
{
if(tvals.size() == maxSize)
{
// remove a point
t_sum -= tvals.front();
y_sum -= yvals.front();
tvals.pop_front();
yvals.pop_front();
}
// add the new point
t_sum += t;
y_sum += y;
tvals.push_back(t);
yvals.push_back(y);
}
void MovingQuadReg::update()
{
if(tvals.size() < 3)
{
// not enough data to fully constrain a parabola
return;
}
//Calculate our sums matrix and the LSQ vector
float a = 0.0f,b = 0.0f,c = 0.0f,d = 0.0f,e = 0.0f, z1 = 0.0f,z2 = 0.0f,z3 = 0.0f;
float point_t = 0.0f, point_y = 0.0f,sq = 0.0f;
for(size_t j = 0; j<tvals.size(); j++){
point_t = tvals[j];
point_y = yvals[j];
sq = point_t*point_t;
a += sq*sq;
b += sq*point_t;
c += sq;
d += point_t;
z1 += sq*point_y;
z2 += point_t*point_y;
}
e = tvals.size();
z3 = y_sum;
//Invert the sums matrix
float M11 = 0.0f,M12 = 0.0f,M13 = 0.0f,M22 = 0.0f,M23 = 0.0f,M33 = 0.0f,k = 0.0f;
float tmp1 = (a*(c*e-d*d)-b*b*e+2*b*c*d-c*c*c);
if (tmp1 == 0.0f) return;
k = 1/tmp1;
M11 = c*e - d*d;
M12 = c*d - b*e;
M13 = b*d - c*c;
M22 = a*e - c*c;
M23 = b*c - a*d;
M33 = a*c - b*b;
A = k*(M11*z1+M12*z2+M13*z3);
B = k*(M12*z1+M22*z2+M23*z3);
C = k*(M13*z1+M23*z2+M33*z3);
// calculate R squared, AKA coefficient of determination.
// Info on this can be found here: https://en.wikipedia.org/wiki/Coefficient_of_determination
float sumSquaredResiduals = 0.0f, sumSquaredTotal = 0.0f, error = 0.0f;
for(size_t j = 0; j<tvals.size() ;j++){
point_t = tvals[j];
point_y = yvals[j];
error = point_y - (A*point_t*point_t + B*point_t + C);
sumSquaredResiduals += error*error;
error = point_y - (y_sum / tvals.size());
sumSquaredTotal += error*error;
}
if (sumSquaredTotal == 0.0f)
{
RSQ = std::numeric_limits<float>::min();
}
else
{
RSQ = 1 - (sumSquaredResiduals/sumSquaredTotal);
}
}
float MovingQuadReg::getDerivative(){
return (2*A*tvals.back() + B);
}
float MovingQuadReg::getRSQ(){
return RSQ;
}
float MovingQuadReg::getA(){
return A;
}
float MovingQuadReg::getB(){
return B;
}
float MovingQuadReg::getC(){
return C;
}
void MovingQuadReg::clear()
{
// clear data points
tvals.clear();
yvals.clear();
t_sum = 0;
y_sum = 0;
// reset constants
A = 0;
B = 0;
C = 0;
RSQ = 0;
}
GPSQuadReg::GPSQuadReg(size_t maxSize) : MovingQuadReg(maxSize)
{
}
bool GPSQuadReg::shouldDeploy()
{
// These values determined experimentally through testing on the Deja Vu data
// using the QuadraticRegret test harness.
// Conceptually, what we're doing is pretty simple: we just wait until
// we have a reasonable confidence in our flight path and
// that flight path shows we're going downward.
return getRSQ() > 0.8 && getDerivative() < -10;
}
|
[
"[email protected]"
] | |
09b2e2d057741511e25ac09792423e54134ddb4d
|
dbc5fd6f0b741d07aca08cff31fe88d2f62e8483
|
/tools/clang/test/OpenMP/teams_distribute_shared_messages.cpp
|
bda88b8d9f7daa436444a5064a4a42cc958b3310
|
[
"LicenseRef-scancode-unknown-license-reference",
"NCSA"
] |
permissive
|
yrnkrn/zapcc
|
647246a2ed860f73adb49fa1bd21333d972ff76b
|
c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50
|
refs/heads/master
| 2023-03-08T22:55:12.842122 | 2020-07-21T10:21:59 | 2020-07-21T10:21:59 | 137,340,494 | 1,255 | 88 |
NOASSERTION
| 2020-07-21T10:22:01 | 2018-06-14T10:00:31 |
C++
|
UTF-8
|
C++
| false | false | 4,209 |
cpp
|
// RUN: %clang_cc1 -verify -fopenmp %s
// RUN: %clang_cc1 -verify -fopenmp-simd %s
void foo() {
}
bool foobool(int argc) {
return argc;
}
struct S1; // expected-note {{declared here}}
extern S1 a;
class S2 {
mutable int a;
public:
S2():a(0) { }
S2(S2 &s2):a(s2.a) { }
};
const S2 b;
const S2 ba[5];
class S3 {
int a;
public:
S3():a(0) { }
S3(S3 &s3):a(s3.a) { }
};
const S3 c;
const S3 ca[5];
extern const int f;
class S4 {
int a;
S4();
S4(const S4 &s4);
public:
S4(int v):a(v) { }
};
class S5 {
int a;
S5():a(0) {}
S5(const S5 &s5):a(s5.a) { }
public:
S5(int v):a(v) { }
};
S3 h;
#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}}
namespace A {
double x;
#pragma omp threadprivate(x) // expected-note {{defined as threadprivate or thread local}}
}
namespace B {
using A::x;
}
int main(int argc, char **argv) {
const int d = 5;
const int da[5] = { 0 };
S4 e(4);
S5 g(5);
int i;
int &j = i;
#pragma omp target
#pragma omp teams distribute shared // expected-error {{expected '(' after 'shared'}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared () // expected-error {{expected expression}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared (argc)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared (S1) // expected-error {{'S1' does not refer to a value}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared (a, b, c, d, f) // expected-error {{incomplete type 'S1' where a complete type is required}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared (argv[1]) // expected-error {{expected variable name}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared(ba)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared(ca)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared(da)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared(e, g)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be shared}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}}
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute private(i)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared(i)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared(j)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute firstprivate(i)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared(i)
for (int j=0; j<100; j++) foo();
#pragma omp target
#pragma omp teams distribute shared(j)
for (int j=0; j<100; j++) foo();
return 0;
}
|
[
"[email protected]"
] | |
b742140e3e87af39e8bf88d880f5ed34b76149b9
|
5e8be2ac3fefbdb980b2b107c3f74b32aea300e2
|
/src/vt/registry/auto/collection/auto_registry_collection.h
|
14c6d625d5a7bc7faa44c87e441f5c537b3ecaa8
|
[
"BSD-3-Clause"
] |
permissive
|
YouCannotBurnMyShadow/vt
|
23b73b531f0b9bdfcea41eb5b73c903805bd5170
|
8bbcce879f6dd5e125cf8908b41baded077dfcbe
|
refs/heads/master
| 2023-03-18T22:16:32.288410 | 2021-01-11T20:37:31 | 2021-01-11T20:37:31 | null | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 3,562 |
h
|
/*
//@HEADER
// *****************************************************************************
//
// auto_registry_collection.h
// DARMA Toolkit v. 1.0.0
// DARMA/vt => Virtual Transport
//
// Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the name of the copyright holder nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact [email protected]
//
// *****************************************************************************
//@HEADER
*/
#if !defined INCLUDED_REGISTRY_AUTO_COLLECTION_AUTO_REGISTRY_COLLECTION_H
#define INCLUDED_REGISTRY_AUTO_COLLECTION_AUTO_REGISTRY_COLLECTION_H
#include "vt/config.h"
#include "vt/registry/auto/auto_registry_common.h"
#include "vt/registry/auto/auto_registry_general.h"
#include "vt/registry/registry.h"
#include "vt/activefn/activefn.h"
#include "vt/vrt/collection/active/active_funcs.h"
namespace vt { namespace auto_registry {
using namespace ::vt::vrt::collection;
AutoActiveCollectionType getAutoHandlerCollection(HandlerType const& handler);
template <typename ColT, typename MsgT, ActiveColTypedFnType<MsgT, ColT>* f>
HandlerType makeAutoHandlerCollection(MsgT* const msg);
AutoActiveCollectionMemType getAutoHandlerCollectionMem(
HandlerType const& handler
);
template <
typename ColT, typename MsgT, ActiveColMemberTypedFnType<MsgT, ColT> f
>
HandlerType makeAutoHandlerCollectionMem(MsgT* const msg);
template <typename ColT, typename MsgT, ActiveColTypedFnType<MsgT, ColT>* f>
void setHandlerTraceNameColl(std::string const& name, std::string const& parent = "");
template <typename ColT, typename MsgT, ActiveColMemberTypedFnType<MsgT, ColT> f>
void setHandlerTraceNameCollMem(std::string const& name, std::string const& parent = "");
}} /* end namespace vt::auto_registry */
#include "vt/registry/auto/collection/auto_registry_collection.impl.h"
#endif /*INCLUDED_REGISTRY_AUTO_COLLECTION_AUTO_REGISTRY_COLLECTION_H*/
|
[
"[email protected]"
] | |
3c556104e7a59925572199f9935543468a5fdce1
|
9a488a219a4f73086dc704c163d0c4b23aabfc1f
|
/branches/action-system-branch/src/ToolbarHandler.cc
|
4a8ff3d7f0e269d1b05732edda277d089714a4da
|
[
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] |
permissive
|
BackupTheBerlios/fluxbox-svn
|
47b8844b562f56d02b211fd4323c2a761b473d5b
|
3ac62418ccf8ffaddbf3c181f28d2f652543f83f
|
refs/heads/master
| 2016-09-05T14:55:27.249504 | 2007-12-14T23:27:57 | 2007-12-14T23:27:57 | 40,667,038 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 6,440 |
cc
|
// ToolbarHandler for fluxbox
// Copyright (c) 2003 Simon Bowden (rathnor at fluxbox.org)
// and Henrik Kinnunen (fluxgen at fluxbox.org)
//
// 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.
// $Id: ToolbarHandler.cc,v 1.29 2003/10/06 06:22:43 rathnor Exp $
/**
* The ToolbarHandler class acts as a rough interface to the toolbar.
* It deals with whether it should be there or not, so anything that
* always needs to be accessible must come through the handler.
*/
#include "ToolbarHandler.hh"
#include "Window.hh"
#include "Screen.hh"
#include "Workspace.hh"
#include "MenuItem.hh"
#include "FbMenu.hh"
#include "FbCommands.hh"
#include "RefCount.hh"
#include "SimpleCommand.hh"
#include "MacroCommand.hh"
#include "IntResMenuItem.hh"
#include "BoolMenuItem.hh"
#include <string>
using namespace std;
ToolbarHandler::ToolbarHandler(BScreen &screen)
: m_screen(screen),
// no need to lock since only one resource
m_toolbar(0),
m_current_workspace(0),
m_modemenu(*screen.menuTheme(),
screen.screenNumber(), screen.imageControl(),
*screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())),
m_toolbarmenu(*screen.menuTheme(),
screen.screenNumber(), screen.imageControl(),
*screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())) {
m_modemenu.setInternalMenu();
m_toolbarmenu.setInternalMenu();
m_mode = WORKSPACE;
m_toolbar.reset(new Toolbar(m_screen,
*m_screen.layerManager().getLayer(Fluxbox::instance()->getNormalLayer()),
m_toolbarmenu));
// now add this to the config menus for the screen
// (we only want it done once, so it can't go in initforscreen)
screen.addConfigMenu("Toolbar", m_toolbarmenu);
enableUpdate();
}
void ToolbarHandler::setMode(ToolbarMode newmode, bool initialise) {
if (newmode < 0 || newmode >= LASTMODE)
return;
if (newmode == OFF) {
m_toolbarmenu.removeAll();
//TODO: nls
m_toolbarmenu.insert("Mode...", &m_modemenu);
m_toolbar.reset(0);
m_toolbarmenu.update();
return;
} else if (!m_toolbar.get()) {
m_toolbarmenu.removeAll();
m_toolbar.reset(new Toolbar(m_screen,
*m_screen.layerManager().getLayer(Fluxbox::instance()->getNormalLayer()), m_toolbarmenu));
m_toolbar->reconfigure();
m_toolbarmenu.insert("Mode...", &m_modemenu);
m_toolbarmenu.update();
}
if (newmode == NONE) {
//!! TODO disable iconbar
} else {
// rebuild it
// be sure the iconbar is on
//!! TODO enable iconbar
}
if (initialise)
initForScreen(m_screen);
}
void ToolbarHandler::initForScreen(BScreen &screen) {
if (&m_screen != &screen)
return;
switch (mode()) {
case OFF:
break;
case NONE:
break;
case ALLWINDOWS:
//!! TODO: change iconbar mode
// fall through and add icons
case LASTMODE:
case ICONS:
//!! TODO: update iconbar mode
break;
case WORKSPACE:
//!! TODO: update iconbar mode
// fall through and add icons for this workspace
case WORKSPACEICONS:
//!! TODO: update iconbar mode
break;
}
}
void ToolbarHandler::setupFrame(FluxboxWindow &win) {
if (&win.screen() != &m_screen)
return;
switch (mode()) {
case OFF:
case NONE:
break;
case WORKSPACE:
break;
case WORKSPACEICONS:
break;
// else fall through and add the icon
case LASTMODE:
case ICONS:
break;
case ALLWINDOWS:
break;
}
}
void ToolbarHandler::updateFrameClose(FluxboxWindow &win) {
if (&win.screen() != &m_screen)
return;
// check status of window (in current workspace, etc) and remove if necessary
switch (mode()) {
case OFF:
case NONE:
break;
case WORKSPACEICONS:
if (win.workspaceNumber() != m_current_workspace)
break;
// else fall through and remove the icon
case LASTMODE:
case ICONS:
break;
case WORKSPACE:
break;
case ALLWINDOWS:
break;
}
}
void ToolbarHandler::updateState(FluxboxWindow &win) {
if (&win.screen() != &m_screen)
return;
// this function only relevant for icons
switch (mode()) {
case OFF:
case NONE:
case WORKSPACE:
case ALLWINDOWS:
break;
case WORKSPACEICONS:
if (win.workspaceNumber() != m_current_workspace)
break;
// else fall through and do the same as icons (knowing it is the right ws)
case LASTMODE:
case ICONS:
break;
}
}
void ToolbarHandler::updateWorkspace(FluxboxWindow &win) {
if (&win.screen() != &m_screen)
return;
// don't care about current workspace except if in workspace mode
if (!(mode() == WORKSPACE ||
(mode() == WORKSPACEICONS && win.isIconic())))
return;
if (win.workspaceNumber() == m_current_workspace) {
} else {
}
}
void ToolbarHandler::updateCurrentWorkspace(BScreen &screen) {
if (&screen != &m_screen || mode() == OFF)
return;
if (mode() != NONE)
initForScreen(m_screen);
}
|
[
"(no author)@54ec5f11-9ae8-0310-9a2b-99d706b22625"
] |
(no author)@54ec5f11-9ae8-0310-9a2b-99d706b22625
|
1a0e0aeac5b7dc14f57c5ef9baeb87c09d4fa35f
|
77094e040e71eba08dd09c230d7300633cd38258
|
/install/nav2_msgs/include/nav2_msgs/msg/detail/particle__rosidl_typesupport_fastrtps_cpp.hpp
|
3d41dd3f0bcd52a120ac3e21b464433ff2765f14
|
[] |
no_license
|
adas598/ros2_ws
|
b810c3cf53afaf1f297914c4393e96f4b72219b7
|
cbbdae46766870bbe5e5195629f1c3589e22e62a
|
refs/heads/master
| 2023-08-06T14:43:55.326617 | 2021-09-17T03:46:39 | 2021-09-17T03:46:39 | 407,172,894 | 0 | 0 | null | null | null | null |
UTF-8
|
C++
| false | false | 2,043 |
hpp
|
// generated from rosidl_typesupport_fastrtps_cpp/resource/idl__rosidl_typesupport_fastrtps_cpp.hpp.em
// with input from nav2_msgs:msg/Particle.idl
// generated code does not contain a copyright notice
#ifndef NAV2_MSGS__MSG__DETAIL__PARTICLE__ROSIDL_TYPESUPPORT_FASTRTPS_CPP_HPP_
#define NAV2_MSGS__MSG__DETAIL__PARTICLE__ROSIDL_TYPESUPPORT_FASTRTPS_CPP_HPP_
#include "rosidl_runtime_c/message_type_support_struct.h"
#include "rosidl_typesupport_interface/macros.h"
#include "nav2_msgs/msg/rosidl_typesupport_fastrtps_cpp__visibility_control.h"
#include "nav2_msgs/msg/detail/particle__struct.hpp"
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-parameter"
# ifdef __clang__
# pragma clang diagnostic ignored "-Wdeprecated-register"
# pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
# endif
#endif
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif
#include "fastcdr/Cdr.h"
namespace nav2_msgs
{
namespace msg
{
namespace typesupport_fastrtps_cpp
{
bool
ROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_nav2_msgs
cdr_serialize(
const nav2_msgs::msg::Particle & ros_message,
eprosima::fastcdr::Cdr & cdr);
bool
ROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_nav2_msgs
cdr_deserialize(
eprosima::fastcdr::Cdr & cdr,
nav2_msgs::msg::Particle & ros_message);
size_t
ROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_nav2_msgs
get_serialized_size(
const nav2_msgs::msg::Particle & ros_message,
size_t current_alignment);
size_t
ROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_nav2_msgs
max_serialized_size_Particle(
bool & full_bounded,
size_t current_alignment);
} // namespace typesupport_fastrtps_cpp
} // namespace msg
} // namespace nav2_msgs
#ifdef __cplusplus
extern "C"
{
#endif
ROSIDL_TYPESUPPORT_FASTRTPS_CPP_PUBLIC_nav2_msgs
const rosidl_message_type_support_t *
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME(rosidl_typesupport_fastrtps_cpp, nav2_msgs, msg, Particle)();
#ifdef __cplusplus
}
#endif
#endif // NAV2_MSGS__MSG__DETAIL__PARTICLE__ROSIDL_TYPESUPPORT_FASTRTPS_CPP_HPP_
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.