blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905
values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 115
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9d375302ab744be57fce2bfcaec5d1f033e16c6e | 9af03a8eff0ee646f46b44ea7302be4460f60bae | /simulation/algorithms/Type2/C++/Qt/Type2/main.cpp | 6788b8a16e86a70f499871d2bd381cd3529bcabf | [
"MIT"
] | permissive | motchy869/Distributed-ThompthonSampling | cdea40f6afe6c9c62c74dc69d6ca214a9292f4f1 | 17bb11f789ccc410e12c99347decc09c836dd708 | refs/heads/master | 2021-09-06T21:41:39.093518 | 2018-02-12T01:47:49 | 2018-02-12T01:47:49 | 120,056,483 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,548 | cpp | /*
* 分散強調型Banditのシミュレーションプログラム。
* コンソールから呼び出して使う。
* 呼び出し例 : Type2 --env "env.json" --prior "prior.json" --graph "graph.json" --T 1000 --rep 10 --save "./save/"
* 起動後、自動的にシミュレーションが始まり、プレイ時間が終了したら結果をセーブして終了する。
* セーブするファイル名の規則 : result_yyyy-MM-dd-hh:mm:ss:zzz.json
*/
#include "common.h"
#include "Simulator.h"
#include "MainWindow.h"
#include <QApplication>
#include <QCommandLineParser>
#include <QDir>
#include <QFileInfo>
#include <QStringList>
#include <QTextStream>
#include <QtGlobal>
//ファイル,ディレクトリのパス
QDir app_dir; //実行ファイルのパス
QString env_file_path; //環境
QString prior_file_path; //事前分布
QString graph_file_path; //グラフ
QString save_dir_path; //出力保存先ディレクトリ
int T; //ゲーム時間
int repetition_num; //実験繰り返し回数
void cmdLineAnalysis(int argc, char *_argv[]);
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app_dir = QCoreApplication::applicationDirPath();
cmdLineAnalysis(argc, argv);
MainWindow w(nullptr);
w.show();
return app.exec();
}
void cmdLineAnalysis(int argc, char *_argv[]) { //コマンドライン引数の解析。(参考: http://kengosawa2.hatenablog.com/entry/2014/12/16/135101)
QStringList argv; for (int i=0; i<argc; ++i) {argv.append(_argv[i]);}
QCommandLineParser parser;
parser.addHelpOption(); //--help,-hをQCommandLineParserで自動で処理するように依頼
//オプションの情報設定
QCommandLineOption envOpt(QStringList() << "env", //オプション文字列
"Environment setting file path.", //ヘルプ表示の際のオプション説明
"env.json", //オプション指定例
""); //デフォルトの指定
QCommandLineOption priorOpt(QStringList() << "prior", "Prior distribusion setting file path.", "prior.json", "");
QCommandLineOption graphOpt(QStringList() << "graph", "Graph setting file path.", "graph.json", "");
QCommandLineOption TOpt(QStringList() << "T", "game length.", "1000", "");
QCommandLineOption repOpt(QStringList() << "rep", "Number of repetition.", "30", "1");
QCommandLineOption saveOpt(QStringList() << "save", "Result save destination.", "./save/", "");
//設定したオプション情報をparserに追加
parser.addOption(envOpt);
parser.addOption(priorOpt);
parser.addOption(graphOpt);
parser.addOption(TOpt);
parser.addOption(repOpt);
parser.addOption(saveOpt);
//コマンドラインの事前解析
//実際のパース処理を行うprocess()では情報設定済以外のオプションが存在すると内部でexit()をコールしてしまうため、事前にparse()してチェックしておく。
if (!parser.parse(argv)) { //不明なオプションが設定されている場合
QString error_str("Unknown option --");
for (int i=0; i<parser.unknownOptionNames().count(); ++i) {
error_str.append("\"" + parser.unknownOptionNames().at(i) + "\"");
}
QTextStream(stderr) << error_str << endl;
exit(EXIT_FAILURE);
}
parser.process(argv); //解析実行
//各オプションの取得
QFileInfo fi;
if (parser.isSet(envOpt)) {
fi.setFile(app_dir.absoluteFilePath(parser.value(envOpt)));
env_file_path = fi.absoluteFilePath();
} else {
QTextStream(stderr) << "Option --env must be set." << endl; exit(EXIT_FAILURE);
}
if (parser.isSet(priorOpt)) {
fi.setFile(app_dir.absoluteFilePath(parser.value(priorOpt)));
prior_file_path = fi.absoluteFilePath();
} else {
QTextStream(stderr) << "Option --prior must be set." << endl; exit(EXIT_FAILURE);
}
if (parser.isSet(graphOpt)) {
fi.setFile(app_dir.absoluteFilePath(parser.value(graphOpt)));
graph_file_path = fi.absoluteFilePath();
} else {
QTextStream(stderr) << "Option --graph must be set." << endl; exit(EXIT_FAILURE);
}
if (parser.isSet(TOpt)) {
T = parser.value(TOpt).toInt();
} else {
QTextStream(stderr) << "Option --T must be set." << endl; exit(EXIT_FAILURE);
}
if (parser.isSet(repOpt)) {
repetition_num = parser.value(repOpt).toInt();
} else {repetition_num = 1;}
if (parser.isSet(saveOpt)) {
fi.setFile(app_dir.absoluteFilePath(parser.value(saveOpt)) + "/"); //念の為"/"を付けて万全にしておく
save_dir_path = fi.absolutePath();
} else {
QTextStream(stderr) << "Option --save must be set." << endl; exit(EXIT_FAILURE);
}
}
| [
"motchy869@gmail.com"
] | motchy869@gmail.com |
38fb10fd757ae640880fb031d679782f586571cb | 2c148e207664a55a5809a3436cbbd23b447bf7fb | /src/headless/lib/browser/headless_web_contents_impl.cc | 09fd7e47c82b5237429c1ee39fd39f1cee01f67b | [
"BSD-3-Clause"
] | permissive | nuzumglobal/Elastos.Trinity.Alpha.Android | 2bae061d281ba764d544990f2e1b2419b8e1e6b2 | 4c6dad6b1f24d43cadb162fb1dbec4798a8c05f3 | refs/heads/master | 2020-05-21T17:30:46.563321 | 2018-09-03T05:16:16 | 2018-09-03T05:16:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 25,512 | 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 "headless/lib/browser/headless_web_contents_impl.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/bind.h"
#include "base/memory/weak_ptr.h"
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "base/values.h"
#include "components/security_state/content/content_utils.h"
#include "components/security_state/core/security_state.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_termination_info.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/bindings_policy.h"
#include "content/public/common/origin_util.h"
#include "content/public/common/renderer_preferences.h"
#include "headless/lib/browser/headless_browser_context_impl.h"
#include "headless/lib/browser/headless_browser_impl.h"
#include "headless/lib/browser/headless_browser_main_parts.h"
#include "headless/lib/browser/headless_tab_socket_impl.h"
#include "headless/lib/browser/protocol/headless_handler.h"
#include "headless/public/internal/headless_devtools_client_impl.h"
#include "printing/buildflags/buildflags.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/compositor/compositor.h"
#include "ui/gfx/switches.h"
#if BUILDFLAG(ENABLE_PRINTING)
#include "headless/lib/browser/headless_print_manager.h"
#endif
namespace headless {
// static
HeadlessWebContentsImpl* HeadlessWebContentsImpl::From(
HeadlessWebContents* web_contents) {
// This downcast is safe because there is only one implementation of
// HeadlessWebContents.
return static_cast<HeadlessWebContentsImpl*>(web_contents);
}
// static
HeadlessWebContentsImpl* HeadlessWebContentsImpl::From(
HeadlessBrowser* browser,
content::WebContents* contents) {
return HeadlessWebContentsImpl::From(
browser->GetWebContentsForDevToolsAgentHostId(
content::DevToolsAgentHost::GetOrCreateFor(contents)->GetId()));
}
class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate {
public:
explicit Delegate(HeadlessWebContentsImpl* headless_web_contents)
: headless_web_contents_(headless_web_contents) {}
#if !defined(CHROME_MULTIPLE_DLL_CHILD)
// Return the security style of the given |web_contents|, populating
// |security_style_explanations| to explain why the SecurityStyle was chosen.
blink::WebSecurityStyle GetSecurityStyle(
content::WebContents* web_contents,
content::SecurityStyleExplanations* security_style_explanations)
override {
security_state::SecurityInfo security_info;
security_state::GetSecurityInfo(
security_state::GetVisibleSecurityState(web_contents),
false /* used_policy_installed_certificate */,
base::Bind(&content::IsOriginSecure), &security_info);
return security_state::GetSecurityStyle(security_info,
security_style_explanations);
}
#endif // !defined(CHROME_MULTIPLE_DLL_CHILD)
void ActivateContents(content::WebContents* contents) override {
contents->GetRenderViewHost()->GetWidget()->Focus();
}
void CloseContents(content::WebContents* source) override {
auto* const headless_contents =
HeadlessWebContentsImpl::From(browser(), source);
DCHECK(headless_contents);
headless_contents->DelegateRequestsClose();
}
void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_rect,
bool user_gesture,
bool* was_blocked) override {
DCHECK(new_contents->GetBrowserContext() ==
headless_web_contents_->browser_context());
std::unique_ptr<HeadlessWebContentsImpl> child_contents =
HeadlessWebContentsImpl::CreateForChildContents(
headless_web_contents_, std::move(new_contents));
HeadlessWebContentsImpl* raw_child_contents = child_contents.get();
headless_web_contents_->browser_context()->RegisterWebContents(
std::move(child_contents));
headless_web_contents_->browser_context()->NotifyChildContentsCreated(
headless_web_contents_, raw_child_contents);
const gfx::Rect default_rect(
headless_web_contents_->browser()->options()->window_size);
const gfx::Rect rect = initial_rect.IsEmpty() ? default_rect : initial_rect;
raw_child_contents->SetBounds(rect);
}
content::WebContents* OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) override {
DCHECK_EQ(source, headless_web_contents_->web_contents());
content::WebContents* target = nullptr;
switch (params.disposition) {
case WindowOpenDisposition::CURRENT_TAB:
target = source;
break;
case WindowOpenDisposition::NEW_POPUP:
case WindowOpenDisposition::NEW_WINDOW:
case WindowOpenDisposition::NEW_BACKGROUND_TAB:
case WindowOpenDisposition::NEW_FOREGROUND_TAB: {
HeadlessWebContentsImpl* child_contents = HeadlessWebContentsImpl::From(
headless_web_contents_->browser_context()
->CreateWebContentsBuilder()
.SetAllowTabSockets(
!!headless_web_contents_->GetHeadlessTabSocket())
.SetWindowSize(source->GetContainerBounds().size())
.Build());
headless_web_contents_->browser_context()->NotifyChildContentsCreated(
headless_web_contents_, child_contents);
target = child_contents->web_contents();
break;
}
// TODO(veluca): add support for other disposition types.
case WindowOpenDisposition::SINGLETON_TAB:
case WindowOpenDisposition::OFF_THE_RECORD:
case WindowOpenDisposition::SAVE_TO_DISK:
case WindowOpenDisposition::IGNORE_ACTION:
default:
return nullptr;
}
content::NavigationController::LoadURLParams load_url_params(params.url);
load_url_params.source_site_instance = params.source_site_instance;
load_url_params.transition_type = params.transition;
load_url_params.frame_tree_node_id = params.frame_tree_node_id;
load_url_params.referrer = params.referrer;
load_url_params.redirect_chain = params.redirect_chain;
load_url_params.extra_headers = params.extra_headers;
load_url_params.is_renderer_initiated = params.is_renderer_initiated;
load_url_params.should_replace_current_entry =
params.should_replace_current_entry;
if (params.uses_post) {
load_url_params.load_type =
content::NavigationController::LOAD_TYPE_HTTP_POST;
load_url_params.post_data = params.post_data;
}
target->GetController().LoadURLWithParams(load_url_params);
return target;
}
bool ShouldCreateWebContents(
content::WebContents* web_contents,
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
int32_t route_id,
int32_t main_frame_route_id,
int32_t main_frame_widget_route_id,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
content::SessionStorageNamespace* session_storage_namespace) override {
return !headless_web_contents_->browser_context()
->options()
->block_new_web_contents();
}
private:
HeadlessBrowserImpl* browser() { return headless_web_contents_->browser(); }
HeadlessWebContentsImpl* headless_web_contents_; // Not owned.
DISALLOW_COPY_AND_ASSIGN(Delegate);
};
namespace {
void CreateTabSocketMojoServiceForContents(
HeadlessWebContents* web_contents,
mojo::ScopedMessagePipeHandle handle) {
HeadlessWebContentsImpl::From(web_contents)
->CreateTabSocketMojoService(std::move(handle));
}
} // namespace
struct HeadlessWebContentsImpl::PendingFrame {
public:
PendingFrame() = default;
~PendingFrame() = default;
bool MaybeRunCallback() {
if (wait_for_copy_result || !display_did_finish_frame)
return false;
std::move(callback).Run(has_damage, std::move(bitmap));
return true;
}
uint64_t sequence_number = 0;
bool wait_for_copy_result = false;
bool display_did_finish_frame = false;
bool has_damage = false;
std::unique_ptr<SkBitmap> bitmap;
FrameFinishedCallback callback;
private:
DISALLOW_COPY_AND_ASSIGN(PendingFrame);
};
// static
std::unique_ptr<HeadlessWebContentsImpl> HeadlessWebContentsImpl::Create(
HeadlessWebContents::Builder* builder) {
content::WebContents::CreateParams create_params(builder->browser_context_,
nullptr);
create_params.initial_size = builder->window_size_;
std::unique_ptr<HeadlessWebContentsImpl> headless_web_contents =
base::WrapUnique(new HeadlessWebContentsImpl(
content::WebContents::Create(create_params),
builder->browser_context_));
if (builder->tab_sockets_allowed_) {
headless_web_contents->headless_tab_socket_ =
std::make_unique<HeadlessTabSocketImpl>(
headless_web_contents->web_contents_.get());
headless_web_contents->inject_mojo_services_into_isolated_world_ = true;
builder->mojo_services_.emplace_back(
TabSocket::Name_, base::Bind(&CreateTabSocketMojoServiceForContents));
}
headless_web_contents->mojo_services_ = std::move(builder->mojo_services_);
headless_web_contents->begin_frame_control_enabled_ =
builder->enable_begin_frame_control_ ||
headless_web_contents->browser()->options()->enable_begin_frame_control;
headless_web_contents->InitializeWindow(gfx::Rect(builder->window_size_));
if (!headless_web_contents->OpenURL(builder->initial_url_))
return nullptr;
return headless_web_contents;
}
// static
std::unique_ptr<HeadlessWebContentsImpl>
HeadlessWebContentsImpl::CreateForChildContents(
HeadlessWebContentsImpl* parent,
std::unique_ptr<content::WebContents> child_contents) {
auto child = base::WrapUnique(new HeadlessWebContentsImpl(
std::move(child_contents), parent->browser_context()));
// Child contents have their own root window and inherit the BeginFrameControl
// setting.
child->begin_frame_control_enabled_ = parent->begin_frame_control_enabled_;
child->InitializeWindow(child->web_contents_->GetContainerBounds());
// Copy mojo services and tab socket settings from parent.
child->mojo_services_ = parent->mojo_services_;
if (parent->headless_tab_socket_) {
child->headless_tab_socket_ =
std::make_unique<HeadlessTabSocketImpl>(child->web_contents_.get());
child->inject_mojo_services_into_isolated_world_ =
parent->inject_mojo_services_into_isolated_world_;
}
// There may already be frames, so make sure they also have our services.
for (content::RenderFrameHost* frame_host :
child->web_contents_->GetAllFrames())
child->RenderFrameCreated(frame_host);
return child;
}
void HeadlessWebContentsImpl::InitializeWindow(
const gfx::Rect& initial_bounds) {
static int window_id = 1;
window_id_ = window_id++;
window_state_ = "normal";
browser()->PlatformInitializeWebContents(this);
SetBounds(initial_bounds);
if (begin_frame_control_enabled_) {
ui::Compositor* compositor = browser()->PlatformGetCompositor(this);
DCHECK(compositor);
compositor->SetExternalBeginFrameClient(this);
}
}
void HeadlessWebContentsImpl::SetBounds(const gfx::Rect& bounds) {
browser()->PlatformSetWebContentsBounds(this, bounds);
}
HeadlessWebContentsImpl::HeadlessWebContentsImpl(
std::unique_ptr<content::WebContents> web_contents,
HeadlessBrowserContextImpl* browser_context)
: content::WebContentsObserver(web_contents.get()),
web_contents_delegate_(new HeadlessWebContentsImpl::Delegate(this)),
web_contents_(std::move(web_contents)),
agent_host_(
content::DevToolsAgentHost::GetOrCreateFor(web_contents_.get())),
inject_mojo_services_into_isolated_world_(false),
browser_context_(browser_context),
render_process_host_(web_contents_->GetMainFrame()->GetProcess()),
weak_ptr_factory_(this) {
#if BUILDFLAG(ENABLE_PRINTING) && !defined(CHROME_MULTIPLE_DLL_CHILD)
HeadlessPrintManager::CreateForWebContents(web_contents_.get());
// TODO(weili): Add support for printing OOPIFs.
#endif
web_contents_->GetMutableRendererPrefs()->accept_languages =
browser_context->options()->accept_language();
web_contents_->GetMutableRendererPrefs()->hinting =
browser_context->options()->font_render_hinting();
web_contents_->SetDelegate(web_contents_delegate_.get());
render_process_host_->AddObserver(this);
agent_host_->AddObserver(this);
}
HeadlessWebContentsImpl::~HeadlessWebContentsImpl() {
agent_host_->RemoveObserver(this);
if (render_process_host_)
render_process_host_->RemoveObserver(this);
if (begin_frame_control_enabled_) {
ui::Compositor* compositor = browser()->PlatformGetCompositor(this);
DCHECK(compositor);
compositor->SetExternalBeginFrameClient(nullptr);
}
}
void HeadlessWebContentsImpl::CreateTabSocketMojoService(
mojo::ScopedMessagePipeHandle handle) {
headless_tab_socket_->CreateMojoService(TabSocketRequest(std::move(handle)));
}
void HeadlessWebContentsImpl::CreateMojoService(
const MojoService::ServiceFactoryCallback& service_factory,
mojo::ScopedMessagePipeHandle handle) {
service_factory.Run(this, std::move(handle));
}
void HeadlessWebContentsImpl::RenderFrameCreated(
content::RenderFrameHost* render_frame_host) {
for (const MojoService& service : mojo_services_) {
registry_.AddInterface(
service.service_name,
base::Bind(&HeadlessWebContentsImpl::CreateMojoService,
base::Unretained(this), service.service_factory),
browser()->BrowserMainThread());
}
browser_context_->SetDevToolsFrameToken(
render_frame_host->GetProcess()->GetID(),
render_frame_host->GetRoutingID(),
render_frame_host->GetDevToolsFrameToken(),
render_frame_host->GetFrameTreeNodeId());
if (headless_tab_socket_)
headless_tab_socket_->RenderFrameCreated(render_frame_host);
}
void HeadlessWebContentsImpl::OnInterfaceRequestFromFrame(
content::RenderFrameHost* render_frame_host,
const std::string& interface_name,
mojo::ScopedMessagePipeHandle* interface_pipe) {
registry_.TryBindInterface(interface_name, interface_pipe);
}
void HeadlessWebContentsImpl::RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) {
if (headless_tab_socket_)
headless_tab_socket_->RenderFrameDeleted(render_frame_host);
browser_context_->RemoveDevToolsFrameToken(
render_frame_host->GetProcess()->GetID(),
render_frame_host->GetRoutingID(),
render_frame_host->GetFrameTreeNodeId());
}
void HeadlessWebContentsImpl::RenderViewReady() {
DCHECK(web_contents()->GetMainFrame()->IsRenderFrameLive());
if (devtools_target_ready_notification_sent_)
return;
for (auto& observer : observers_)
observer.DevToolsTargetReady();
devtools_target_ready_notification_sent_ = true;
}
int HeadlessWebContentsImpl::GetMainFrameRenderProcessId() const {
if (!web_contents() || !web_contents()->GetMainFrame())
return -1;
return web_contents()->GetMainFrame()->GetProcess()->GetID();
}
int HeadlessWebContentsImpl::GetMainFrameTreeNodeId() const {
if (!web_contents() || !web_contents()->GetMainFrame())
return -1;
return web_contents()->GetMainFrame()->GetFrameTreeNodeId();
}
std::string HeadlessWebContentsImpl::GetMainFrameDevToolsId() const {
if (!web_contents() || !web_contents()->GetMainFrame())
return "";
return web_contents()->GetMainFrame()->GetDevToolsFrameToken().ToString();
}
bool HeadlessWebContentsImpl::OpenURL(const GURL& url) {
if (!url.is_valid())
return false;
content::NavigationController::LoadURLParams params(url);
params.transition_type = ui::PageTransitionFromInt(
ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
web_contents_->GetController().LoadURLWithParams(params);
web_contents_delegate_->ActivateContents(web_contents_.get());
web_contents_->Focus();
return true;
}
void HeadlessWebContentsImpl::Close() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (quit_closure_)
return;
if (!render_process_exited_) {
web_contents_->ClosePage();
base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed);
quit_closure_ = run_loop.QuitClosure();
run_loop.Run();
}
browser_context()->DestroyWebContents(this);
}
void HeadlessWebContentsImpl::DelegateRequestsClose() {
if (quit_closure_) {
quit_closure_.Run();
quit_closure_ = base::Closure();
} else {
browser_context()->DestroyWebContents(this);
}
}
std::string HeadlessWebContentsImpl::GetDevToolsAgentHostId() {
return agent_host_->GetId();
}
void HeadlessWebContentsImpl::AddObserver(Observer* observer) {
observers_.AddObserver(observer);
}
void HeadlessWebContentsImpl::RemoveObserver(Observer* observer) {
observers_.RemoveObserver(observer);
}
void HeadlessWebContentsImpl::DevToolsAgentHostAttached(
content::DevToolsAgentHost* agent_host) {
for (auto& observer : observers_)
observer.DevToolsClientAttached();
}
void HeadlessWebContentsImpl::DevToolsAgentHostDetached(
content::DevToolsAgentHost* agent_host) {
for (auto& observer : observers_)
observer.DevToolsClientDetached();
}
void HeadlessWebContentsImpl::RenderProcessExited(
content::RenderProcessHost* host,
const content::ChildProcessTerminationInfo& info) {
DCHECK_EQ(render_process_host_, host);
render_process_exited_ = true;
for (auto& observer : observers_)
observer.RenderProcessExited(info.status, info.exit_code);
}
void HeadlessWebContentsImpl::RenderProcessHostDestroyed(
content::RenderProcessHost* host) {
DCHECK_EQ(render_process_host_, host);
render_process_host_ = nullptr;
}
HeadlessDevToolsTarget* HeadlessWebContentsImpl::GetDevToolsTarget() {
return web_contents()->GetMainFrame()->IsRenderFrameLive() ? this : nullptr;
}
bool HeadlessWebContentsImpl::AttachClient(HeadlessDevToolsClient* client) {
return HeadlessDevToolsClientImpl::From(client)->AttachToHost(
agent_host_.get());
}
void HeadlessWebContentsImpl::ForceAttachClient(
HeadlessDevToolsClient* client) {
HeadlessDevToolsClientImpl::From(client)->ForceAttachToHost(
agent_host_.get());
}
void HeadlessWebContentsImpl::DetachClient(HeadlessDevToolsClient* client) {
DCHECK(agent_host_);
HeadlessDevToolsClientImpl::From(client)->DetachFromHost(agent_host_.get());
}
bool HeadlessWebContentsImpl::IsAttached() {
DCHECK(agent_host_);
return agent_host_->IsAttached();
}
content::WebContents* HeadlessWebContentsImpl::web_contents() const {
return web_contents_.get();
}
HeadlessBrowserImpl* HeadlessWebContentsImpl::browser() const {
return browser_context_->browser();
}
HeadlessBrowserContextImpl* HeadlessWebContentsImpl::browser_context() const {
return browser_context_;
}
HeadlessTabSocket* HeadlessWebContentsImpl::GetHeadlessTabSocket() const {
return headless_tab_socket_.get();
}
void HeadlessWebContentsImpl::OnDisplayDidFinishFrame(
const viz::BeginFrameAck& ack) {
TRACE_EVENT2("headless", "HeadlessWebContentsImpl::OnDisplayDidFinishFrame",
"source_id", ack.source_id, "sequence_number",
ack.sequence_number);
auto it = pending_frames_.begin();
while (it != pending_frames_.end()) {
if (begin_frame_source_id_ == ack.source_id &&
(*it)->sequence_number <= ack.sequence_number) {
(*it)->has_damage = ack.has_damage;
(*it)->display_did_finish_frame = true;
if ((*it)->MaybeRunCallback()) {
it = pending_frames_.erase(it);
} else {
++it;
}
} else {
++it;
}
}
}
void HeadlessWebContentsImpl::OnNeedsExternalBeginFrames(
bool needs_begin_frames) {
protocol::HeadlessHandler::OnNeedsBeginFrames(this, needs_begin_frames);
TRACE_EVENT1("headless",
"HeadlessWebContentsImpl::OnNeedsExternalBeginFrames",
"needs_begin_frames", needs_begin_frames);
needs_external_begin_frames_ = needs_begin_frames;
}
void HeadlessWebContentsImpl::PendingFrameReadbackComplete(
HeadlessWebContentsImpl::PendingFrame* pending_frame,
const SkBitmap& bitmap) {
TRACE_EVENT2("headless",
"HeadlessWebContentsImpl::PendingFrameReadbackComplete",
"sequence_number", pending_frame->sequence_number, "success",
!bitmap.drawsNothing());
if (bitmap.drawsNothing()) {
LOG(WARNING) << "Readback from surface failed.";
} else {
pending_frame->bitmap = std::make_unique<SkBitmap>(bitmap);
}
pending_frame->wait_for_copy_result = false;
// Run callback if the frame was already finished by the display.
if (pending_frame->MaybeRunCallback()) {
base::EraseIf(pending_frames_,
[pending_frame](const std::unique_ptr<PendingFrame>& frame) {
return frame.get() == pending_frame;
});
}
}
void HeadlessWebContentsImpl::BeginFrame(
const base::TimeTicks& frame_timeticks,
const base::TimeTicks& deadline,
const base::TimeDelta& interval,
bool animate_only,
bool capture_screenshot,
FrameFinishedCallback frame_finished_callback) {
DCHECK(begin_frame_control_enabled_);
TRACE_EVENT2("headless", "HeadlessWebContentsImpl::BeginFrame", "frame_time",
frame_timeticks, "capture_screenshot", capture_screenshot);
uint64_t sequence_number = begin_frame_sequence_number_++;
auto pending_frame = std::make_unique<PendingFrame>();
pending_frame->sequence_number = sequence_number;
pending_frame->callback = std::move(frame_finished_callback);
// Note: It's important to move |pending_frame| into |pending_frames_| now
// since the CopyFromSurface() call below can run its result callback
// synchronously on certain platforms/environments.
auto* const pending_frame_raw_ptr = pending_frame.get();
pending_frames_.emplace_back(std::move(pending_frame));
if (capture_screenshot) {
content::RenderWidgetHostView* view =
web_contents()->GetRenderWidgetHostView();
if (view && view->IsSurfaceAvailableForCopy()) {
pending_frame_raw_ptr->wait_for_copy_result = true;
view->CopyFromSurface(
gfx::Rect(), gfx::Size(),
base::BindOnce(&HeadlessWebContentsImpl::PendingFrameReadbackComplete,
weak_ptr_factory_.GetWeakPtr(),
pending_frame_raw_ptr));
} else {
LOG(WARNING) << "Surface not ready for screenshot.";
}
}
ui::Compositor* compositor = browser()->PlatformGetCompositor(this);
DCHECK(compositor);
auto args = viz::BeginFrameArgs::Create(
BEGINFRAME_FROM_HERE, begin_frame_source_id_, sequence_number,
frame_timeticks, deadline, interval, viz::BeginFrameArgs::NORMAL);
args.animate_only = animate_only;
compositor->IssueExternalBeginFrame(args);
}
HeadlessWebContents::Builder::Builder(
HeadlessBrowserContextImpl* browser_context)
: browser_context_(browser_context),
window_size_(browser_context->options()->window_size()) {}
HeadlessWebContents::Builder::~Builder() = default;
HeadlessWebContents::Builder::Builder(Builder&&) = default;
HeadlessWebContents::Builder& HeadlessWebContents::Builder::SetInitialURL(
const GURL& initial_url) {
initial_url_ = initial_url;
return *this;
}
HeadlessWebContents::Builder& HeadlessWebContents::Builder::SetWindowSize(
const gfx::Size& size) {
window_size_ = size;
return *this;
}
HeadlessWebContents::Builder& HeadlessWebContents::Builder::SetAllowTabSockets(
bool tab_sockets_allowed) {
tab_sockets_allowed_ = tab_sockets_allowed;
return *this;
}
HeadlessWebContents::Builder&
HeadlessWebContents::Builder::SetEnableBeginFrameControl(
bool enable_begin_frame_control) {
enable_begin_frame_control_ = enable_begin_frame_control;
return *this;
}
HeadlessWebContents* HeadlessWebContents::Builder::Build() {
return browser_context_->CreateWebContents(this);
}
HeadlessWebContents::Builder::MojoService::MojoService() = default;
HeadlessWebContents::Builder::MojoService::MojoService(
const MojoService& other) = default;
HeadlessWebContents::Builder::MojoService::MojoService(
const std::string& service_name,
const ServiceFactoryCallback& service_factory)
: service_name(service_name), service_factory(service_factory) {}
HeadlessWebContents::Builder::MojoService::~MojoService() = default;
} // namespace headless
| [
"jiawang.yu@spreadtrum.com"
] | jiawang.yu@spreadtrum.com |
1c3282aa9021be35d54b9cf7efe3d6385321f742 | 53b9ed8fe5d3da380ef23a5aedf7557f1c2e82fe | /Dynamic Programming/Dynamic Programming - Optimal Game Strategy.cpp | ad0542b959a44e79393a02824d52fa82c0a24af8 | [] | no_license | BhuwaneshNainwal/DSA | 37cada454c4c139e6f3a345b33ea18683a498eff | f75b91aa70701c3bef9dd38f75a2970ef2d9985e | refs/heads/master | 2023-07-09T05:57:42.459007 | 2021-08-16T16:27:51 | 2021-08-16T16:27:51 | 355,267,090 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 360 | cpp | /*
1> Each player can pick a number from either end.
2> Both are smart / equally wise or plays optimally.
3> Maximum margin by which he can win.
Recurrence relation:
Let the player be A,
f(i , j) = max(a[i] + min( f(i + 2 , j) , f(i + 1 , j - 1)) ,
a[j] + min( f(i, j - 2) , f(i + 1 , j - 1))
Base case : if i > j => return 0
*/ | [
"harshitnainwal38@gmail.com"
] | harshitnainwal38@gmail.com |
2ed9473ac07480b091e50377238e762d09eb10a7 | ae33344a3ef74613c440bc5df0c585102d403b3b | /SDK/SOT_BP_female_makeup_asian_02_Desc_classes.hpp | 9f8d9f8c53100e0535a0181e68f444951b1b5afd | [] | no_license | ThePotato97/SoT-SDK | bd2d253e811359a429bd8cf0f5dfff73b25cecd9 | d1ff6182a2d09ca20e9e02476e5cb618e57726d3 | refs/heads/master | 2020-03-08T00:48:37.178980 | 2018-03-30T12:23:36 | 2018-03-30T12:23:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 743 | hpp | #pragma once
// SOT: Sea of Thieves (1.0) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x4)
#endif
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass BP_female_makeup_asian_02_Desc.BP_female_makeup_asian_02_Desc_C
// 0x0000 (0x00C0 - 0x00C0)
class UBP_female_makeup_asian_02_Desc_C : public UClothingDesc
{
public:
static UClass* StaticClass()
{
static UClass* ptr = 0;
if(ptr == 0) { ptr = UObject::FindClass(_xor_("BlueprintGeneratedClass BP_female_makeup_asian_02_Desc.BP_female_makeup_asian_02_Desc_C")); }
return ptr;
}
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"antoniohermano@gmail.com"
] | antoniohermano@gmail.com |
da570bd0fcd209b77ad33ebc04042767ccc3b424 | 1f7974bf7bd5b5c91998e2022828f3a277ff7556 | /洛谷/省选-/CF812C.cc | ea20ed6dbbfcebff17f27ccceb0cbbfabb9ce1f5 | [
"MIT"
] | permissive | gkishard-workingboy/Algorithm-challenger | 1eda8a5d2ab567a1494a21c90ac750e1f559eae4 | 43336871a5e48f8804d6e737c813d9d4c0dc2731 | refs/heads/master | 2022-11-18T05:14:24.904034 | 2020-07-14T13:42:43 | 2020-07-14T13:42:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,130 | cc | /*
* Author : OFShare
* E-mail : OFShare@outlook.com
* Created Time : 2020-04-26 14:43:43 PM
* File Name : CF812C.cc
*/
#include <bits/stdc++.h>
#define ll long long
void debug() {
#ifdef Acui
freopen("data.in", "r", stdin);
freopen("data.out", "w", stdout);
#endif
}
const int N = 1e5 + 5;
ll n, S, A[N];
bool check(ll k) {
std::vector<ll> vec;
for (int i = 1; i <= n; ++i) {
vec.push_back(A[i] + i * k);
}
std::sort(vec.begin(), vec.end());
ll ans = 0;
for (int i = 0; i < k; ++i) {
ans += vec[i];
}
return ans <= S;
}
int main() {
scanf("%lld %lld", &n, &S);
for (int i = 1; i <= n; ++i) {
scanf("%lld", &A[i]);
}
// 二分选取的物品的件数, [L, R)
ll L = 0, R = n + 1;
for (int i = 0; i <= 50; ++i) {
ll mid = L + (R -L) / 2;
if (check(mid)) L = mid;
else R = mid;
}
ll k = L;
std::vector<ll> vec;
for (int i = 1; i <= n; ++i) {
vec.push_back(A[i] + i * k);
}
std::sort(vec.begin(), vec.end());
ll ans = 0;
for (int i = 0; i < k; ++i) {
ans += vec[i];
}
printf("%lld %lld\n", k, ans);
return 0;
}
| [
"OFShare@outlook.com"
] | OFShare@outlook.com |
aed812526703df9c6833f04921bd5c2e086055e2 | 7f4dffea2997b4222cc719a63d4ea02372f58bb7 | /Religion/csys.cpp | 0977de3431dff9343741b020a977bb7ac90cc0f0 | [] | no_license | kamera25/Religion-Old | bb08b845377ac292140e91ff710319f17455f79d | fde68fa688fb34348030d5284f64d1b8264886b0 | refs/heads/master | 2016-09-06T12:28:39.095550 | 2014-12-07T05:57:59 | 2014-12-07T05:57:59 | null | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 18,594 | cpp | /*ここでは、初期化・終了・プロージャーに渡すという行為を行うクラスコードファイルです。
//
*/
#include <easy3d.h>//Easy3Dを使うためのヘッダを読み込みます。
#include <crtdbg.h>//エラーチェックが出来るようにするためのヘッダファイル
#include "csys.h"//開始・終了・プロージャーなどシステム周りのクラスヘッダ
#include "cWeapon_head.h"// 武器統括に関することのクラスヘッダファイル
#include "csys_statics.h"// システムクラスの静動変数・関数周りをまとめたヘッダファイル
// コンストラクタ:Easy3Dの処理を開始するよ。
System::System( const HINSTANCE chInst, const HWND chwnd){
/*変数の*/
int ech = 0;//エラーチェック用の変数宣言
int index = 0;//何文字目か
char loadname[256] = "";//ロードするファイル名の文字列配列
char *p;//ポインタ、後ろから
char ch = '\\' ;//検索する文字
char szpath[256] = "";//実行中のパスを入れる文字列変数
//パスの取得
GetModuleFileName( chInst, szpath, 256);//実行中のファイル名を取得
p = strrchr(szpath,ch);//最後の\がつく文字列を探す。
index = p - szpath;//最後に\がついたところまで文字数を検索
strncpy_s(path, szpath, index);//path変数にszpath変数から最後の\までの文字を取得
/* ******* */
ech = E3DEnableDbgFile();//デバッグテキスト出力準備
_ASSERT( ech != 1 );//エラーチェック
ech = E3DInit( chInst, chwnd, 0, 16, 0, 1, 1, 1, 0, &scid1);//Easy3Dの初期化をする。
_ASSERT( ech != 1 );//エラーチェック
ech = E3DSetProjection( 120.0, 100000.0, 60.0);//プロジェクションの設定を行います
_ASSERT( ech != 1 );//エラーチェック
PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE);//メッセージループに処理を返す(おまじない)
//変数操作
hInst = chInst;
hwnd = chwnd;
/*キー取得命令のためのキー配列その1*/
/*キー取得命令のためのキー配列その2*/
/*マウスを使うために初期化します*/
MousePos.x = 0;
MousePos.y = 0;
BeforeMousePos.x = 0;//X座標初期化
BeforeMousePos.y = 0;//Y座標初期化
KeyQuickEnd = 0;//フラグ変数を初期化する
UpdataSoundflag = 0;//音声情報を更新しない(デフォルト)
/*変数の初期化*/
for(int i=0; i<3; i++){
for(int j=0; j<3; j++){
KeyQuickPush[i][j] = 0;
}
}
/* **************
// スワップチェインを作成する
// **************
*/
ech = E3DCreateSwapChain( chwnd, &scid2);
_ASSERT( ech != 1 );//エラーチェック
/* **************
// 最低限必要な画像のロードを行います
// **************
*/
// メニュー画面での上部白いバーをロードします。
wsprintf( loadname, "%s\\data\\img\\sys\\loading.png", path);
ech = E3DCreateSprite( loadname, 0, 0, &SpriteID[0]);
_ASSERT( ech != 1 );//エラーチェック
// 画面全体を暗くするための、黒画像
wsprintf( loadname, "%s\\data\\img\\oth\\black.png", System::path);
ech = E3DCreateSprite( loadname, 0, 0, &SpriteID[1]);
_ASSERT( ech != 1 );//エラーチェック
};
// デストラクタ:Easy3Dの終了処理を行うよ。
System::~System(){
/* 変数の初期化 */
int ech = 0;//エラーチェック用の変数宣言
/* 画像の破棄を行います */
for(int i=0; i<2; i++){
ech = E3DDestroySprite( SpriteID[i]);
_ASSERT( ech != 1 );//エラーチェック
}
/* スワップチェインを削除 */
ech = E3DDestroySwapChain(scid2);
_ASSERT( ech != 1 );//エラーチェック
/* Easy3D終了処理 */
ech = E3DBye();
_ASSERT( ech != 1 );//エラーチェック
};
/* メッセージのループ処理 */
int System::MsgQ( const int fps){
/*初期化をする*/
int ech = 0;//エラーチェック用の変数宣言
int rfps = 0;//いらないFPS計測用の変数。
MouseWhole = 0;//マウスホイールの移動量を初期化する
/* メッセージループの処理 */
do{
GotMes = PeekMessage( &msg, NULL, 0, 0, PM_REMOVE);
if( msg.message == WM_QUIT){
return 0;
}
if( GotMes != 0){//メッセージが来たら
DispatchMessage(&msg);
TranslateMessage(&msg);
GetWindowRect( hwnd, &rewin);
}
}while( GotMes != NULL );// メッセージが来ていなかったら、ループを抜ける
ech = E3DWaitbyFPS( fps, &rfps);
_ASSERT( ech != 1 );//エラーチェック
/**/
//音声情報を更新するor無視
/**/
if( UpdataSoundflag != 0){
/*リスナーの位置(カメラ位置)を設定*/
ech = E3DSet3DSoundListenerMovement( -1);
_ASSERT( ech != 1 );//エラーチェック
/*音情報の更新を行います*/
ech = E3DUpdateSound();
_ASSERT( ech != 1 );//エラーチェック
}
return 0;//ここの数字で終了処理を決めろ。
};
/* 連続押しを検知します */
int System::ChkKeyDoublePush( bool PushKey, int Count, int Element){
/* 初期化 */
const int BEFOREKEY = 0; // 配列の要素 "0" は「前回のキー状態」を格納します
const int KEYCOUNT = 1; // 配列の要素 "1" は「二回押しキーの残りカウント」を格納します。
const int DOUBKEPUSH = 2; // 配列の要素 "2" は「二回押しが有効になっているか」を格納します。
/* ///////////////////// */
/* これから、連続押しを検知します
/* ///////////////////// */
//キーが押されてなく、前回は押されていなかったとき
if( PushKey == false && KeyQuickPush[Element][BEFOREKEY] == 1 ){
KeyQuickPush[Element][KEYCOUNT] = Count;// 変数"Count"を、セットする
}
// カウント時間内なら
if( 0 < KeyQuickPush[Element][KEYCOUNT] ){
KeyQuickPush[Element][KEYCOUNT] = KeyQuickPush[Element][KEYCOUNT] - 1;// 毎秒ごとに、ループ容赦回数を減らす
if( PushKey == true){//その間で、キーが押されているなら
KeyQuickPush[Element][DOUBKEPUSH] = 1;//ダッシュフラグをオンにする
}
}
// ダッシュフラグが"オン"で、キーが離されたら
if( PushKey == false && KeyQuickPush[Element][DOUBKEPUSH] == 1 ){
KeyQuickPush[Element][DOUBKEPUSH] = 0;//ダッシュキーが押されてない状態にする
}
KeyQuickPush[Element][BEFOREKEY] = PushKey;//前回のキーを代入します(次ループで使用)
return 0;
}
/* 要素を選択して、二回連続キーの設定リセットを行います。 */
int System::ResetKeyDoublePush( int Element){
KeyQuickPush[Element][0] = 0;
KeyQuickPush[Element][1] = 0;
KeyQuickPush[Element][2] = 0;
return 0;
}
/* 要素を渡して、連続押しかどうかチェックします */
int System::Get_DoublePush( int Element){
return KeyQuickPush[Element][2];
}
/* キー情報を更新する関数 */
int System::KeyRenewal( const int SelectMode){
/* 初期化 & 宣言を行います*/
static int KeyBox[30][2][2];// 動的に取得したキー情報を入れる配列
int imput[2] = { 0 , 0 };
const int KeyTrigger[3][2] = // トリガーとなるキー番号をそれぞれの状況で指定したconst変数
{
{ 0 , 0 }, // メニュー中
{ (1<<10)+(1<<13)+(1<<28)+(1<<8) , (1<<2) }, // ゲーム中,連続不可
{ (1<<7)+(1<<10)+(1<<13)+(1<<28)+(1<<8) , (1<<2) } // ゲーム中,連続可
};
const int KeyData[2][30] = {// キーの番号を格納した変数
{
0x25,//左キー 0
0x26,//上キー 1
0x27,//右キー 2
0x28,//下キー 3
0x20,//スペース 4
0x0D,//エンターキー 5
0x11,//コントロールキー 6
0x01,//左クリック 7
0x02,//右クリック 8
0x09,//TAB 9
0x41,//Aキー 10
0x42,//Bキー 11
0x43,//Cキー 12
0x44,//Dキー 13
0x45,//Eキー 14
0x46,//Fキー 15
0x47,//Gキー 16
0x48,//Hキー 17
0x49,//Iキー 18
0x4A,//Jキー 19
0x4B,//Kキー 20
0x4C,//Lキー 21
0x4D,//Mキー 22
0x4E,//Nキー 23
0x4F,//Oキー 24
0x50,//Pキー 25
0x51,//Qキー 26
0x52,//Rキー 27
0x53,//Sキー 28
0x54,//Tキー 29
},
{
0x55,//Uキー 0
0x56,//Vキー 1
0x57,//Wキー 2
0x58,//Xキー 3
0x59,//Yキー 4
0x5A,//Zキー 5
0x30,//メイン0キー 6
0x31,//メイン1キー 7
0x32,//メイン2キー 8
0x33,//メイン3キー 9
0x34,//メイン4キー 10
0x35,//メイン5キー 11
0x36,//メイン6キー 12
0x37,//メイン7キー 13
0x38,//メイン8キー 14
0x39,//メイン9キー 15
0x1B,//ESCキー 16
0x04,//マウス真ん中 17
0x10,//シフトキー 18
0x08,//バックスペース 19
0x12,//ALTキー 20
0x09,//TABキー 21
0x70,//F1 22
0x71,//F2 23
0x72,//F3 24
0x73,//F4 25
0x74,//F5 26
0x75,//F6 27
0x76,//F7 28
0x77,//F8 39
}
};
const int ModeKeyCheck[3][2][20] =
{
{// もしメニューでの検出なら
{ 0, 1, 0, 0, 0, 0, -1},/* 高速押し */
{ 1<<5, 1<<19, 1<<0, 1<<1, 1<<2, 1<<3, -1}
},
{// もしゲーム中での検出なら(連続不可)
{ 0, 1, 0, 0, 0, 0, 0, 1, 1, 0,
0, 0, 0, 1, 1, 1, 0, -1},
{ 1<<5, 1<<2, 1<<13,1<<28, 1<<27, 1<<14, 1<<10, 1<<5, 1<<18, 1<<7,
1<<8, 1<<4, 1<<10, 1<<1, 1<<17, 1<<16, 1<<15, -1},
},
{// もしゲーム中での検出なら(連続化)
{ 0, 1, 0, 0, 0, 0, 0, 1, 1, 0,
0, 0, 0, 1, 1, 1, 0, -1},
{ 1<<5, 1<<2, 1<<13,1<<28, 1<<27, 1<<14, 1<<10, 1<<5, 1<<18, 1<<7,
1<<8, 1<<4, 1<<10, 1<<1, 1<<17, 1<<16, 1<<15, -1},
}
};
/* 初期化します */
for(int i=0; i < 20; i++){
keyin[i] = false;
}
for( int i=0; i < 30; i++ ){
for( int j=0; j < 2; j++ ){
KeyBox[i][0][j] = 0;
}
}
/* 初期化 & 宣言はここまで */
for(int i = 0; i < 30; i++){
/* 変数の初期化 */
const int NowBitShiftNum = 1<<i;
for( int j=0; j<2; j++){
if(KeyTrigger[SelectMode][j] & (1<<i)){
KeyBox[i][0][j] = 1;
};
/* キー押し判定 */
if(GetAsyncKeyState( KeyData[j][i] ) & 0x8000){//キーが押されていたら
imput[j] = imput[j] + NowBitShiftNum ;
if( (KeyBox[i][0][j] == 0) && (KeyBox[i][1][j] == 1) ){
imput[j] = imput[j] - NowBitShiftNum ;
}
KeyBox[i][1][j] = 1;
}
else{
KeyBox[i][1][j] = 0;
}
}
}
/*
//上記で押されたキー情報を元にゲーム本編で使うデータを組み立てます
*/
for( int i=0; i<20; i++){
const int NowImputNo = ModeKeyCheck[SelectMode][0][i];
const int NowBitShiftNum = ModeKeyCheck[SelectMode][1][i];
if( NowImputNo == -1) break;// ModeKeyCheck変数が最後なら、ループ脱出
if( imput[NowImputNo] & NowBitShiftNum){// キーが押されているかチェックします
keyin[i] = true;
}
}
/* ////////// */
// !! メモ !!
/* ////////// */
/* もしメニューでの検出なら [SelectMode == 1] */
//エンター 0
//バックスペース 1
//← 2
//↑ 3
//→ 4
//↓ 5
/* もしゲーム中での検出なら( 連続不可 / 連続化 ) [SelectMode == 1 OR 2] */
//エンターキー(調べる) 0
//Wキー(前進する)1
//Dキー(右へ移動)2
//Sキー(後退する)3
//Rキー(リロード)4
//Eキー(肩撃ち位置変え) 5
//Qキー(セレ切り替え) 6
//Zキー(装備使用) 7
//シフトキー(姿勢切り替え)8
//左クリック(銃を撃つ) 9
//右クリック(グレネード) 10
//スペース(格闘攻撃) 11
//Aキー(左へ移動)12
//Vキー(特殊能力) 13
//ホイールクリック(視点変え)14
//ESCキー 15
//Fキー 16
/*
//短いタイミングでキーをおしたかどうかの検出を行います
*/
if(( SelectMode == 1) || ( SelectMode == 2)){//もしゲーム中での検出なら
ChkKeyDoublePush( GetKeyData( System::KEY_W), 5, 0);// Wキーが短い間で押されているか検出します。
ChkKeyDoublePush( GetKeyData( System::KEY_D), 5, 1);// Dキーが短い間で押されているか検出します。
ChkKeyDoublePush( GetKeyData( System::KEY_A), 5, 2);// Aキーが短い間で押されているか検出します。
}
/*if(( SelectMode == 1) || ( SelectMode == 2)){//もしゲーム中での検出なら
for(int i=0; i<3; i++){//A・W・Dキーで3回繰り返す
if( (keyin[i] == false) && (KeyQuickPush[i][0] == 1) ){//キーが押されてなく、前回は押されていたとき
KeyQuickPush[i][1] = 5;//7ループ後までカウントする
}
if( KeyQuickPush[i][1] > 0){//7ループ内で
KeyQuickPush[i][1] = KeyQuickPush[i][1] - 1;//ループ容赦回数を減らす
if( keyin[i] == 1){//その中でキーが押されているなら
KeyQuickPush[i][2] = 1;//ダッシュフラグをオンにする
}
}
if( KeyQuickPush[i][2] == 1){//ダッシュフラグがオンなら
keyinQuick[i] = 1;//ゲームダッシュフラグをオンにする
if( keyin[i] == false){//もし、「ダッシュフラグがオンになっているキーが押されてない」なら
KeyQuickPush[i][2] = 0;//ダッシュキーが押されてない状態にする
keyinQuick[i] = 0;//ゲームダッシュフラグをオフにする
}
}
KeyQuickPush[i][0] = keyin[i];//前回のキーを代入します(次ループで使用)
}
}*/
/*
//次にマウス座標を取得します。
*/
GetCursorPos( &MousePos);//マウス座標を格納します
MousePos.x = MousePos.x - rewin.left;//ウィンドウX座標の取得
MousePos.y = MousePos.y - rewin.top;//ウィンドウY座標の取得
return 0;
}
/* ロード画面を描画する関数 */
int System::WaitRender(){
int ech = 0;//エラーチェック変数
D3DXVECTOR3 SpritePos1( 0.0, -25.0, 0.0);//背景の位置
//POINT TextPos;//テキストの座標変数
/*描画準備を行います*/
E3DBeginScene( scid1, 1, -1);
E3DBeginSprite();
ech = E3DRenderSprite( SpriteID[0], 640.0/1024.0, 480.0/512.0, SpritePos1);//背景
_ASSERT( ech != 1 );//エラーチェック
/*ここで、描画完了*/
E3DEndSprite();
/*文字"バックパック"の描画を行います*/
//TextPos.x = 440;/**/TextPos.y = 5;
//E3DDrawTextByFontID( System::scid1, TextID[0], TextPos, "バックパック", NormalColor1);
E3DEndScene();
E3DPresent(scid1);
return 0;
}
/* キー情報を入手するための関数 */
/*int System::GetKeyData( int *KeyDataArray){
//キーが押されたかの情報を格納します
for( int i=0; i<20; i++){
*(KeyDataArray + i) = keyin[i];
}
return 0;
}*/
/* 音声情報を更新するかどうかの関数 */
int System::SetUpdataSoundSys( const int Soundflag){
UpdataSoundflag = Soundflag;
return 0;
}
/* 画像をフェードアウトさせる処理の関数 */
int System::SetFadeOutOfScid( const int FadeTime){
/*変数の初期化*/
int ech = 0;
D3DXVECTOR3 MainSpritePos( 0.0, -28.0, 0.0);// 背景の位置
E3DCOLOR4UC BlackColor = { 0,255,255,255};// 黒背景の色構造体
/* **********
// 直前までレンダリングしていた画面をスワップチェイン(scid2)にコピー
// **********
*/
ech = E3DBeginScene( scid2, 1, -1);
_ASSERT( ech != 1 );//エラーチェック
ech = E3DEndScene();
_ASSERT( ech != 1 );//エラーチェック
/* 処理終了 */
/* 繰り返しの処理(ブラックフェードアウトする)*/
for( int i=0; i<FadeTime; i++){
MsgQ(30);//メッセージループ
/* 透明度を更新(iカウンタで変位) */
BlackColor.a = i * (255 / FadeTime);
/*黒画像の透明度を指定する*/
ech = E3DSetSpriteARGB( SpriteID[1], BlackColor);
_ASSERT( ech != 1 );//エラーチェック
/* 透明度を更新(iカウンタで変位) */
BlackColor.a = i * (255 / FadeTime);
/*黒画像の透明度を指定する*/
ech = E3DSetSpriteARGB( SpriteID[1], BlackColor);
_ASSERT( ech != 1 );//エラーチェック
/* **********
// 元画面(scid2)を先にレンダリングします
// **********
*/
ech = E3DBeginScene( scid2, 0, -1);
_ASSERT( ech != 1 );//エラーチェック
ech = E3DEndScene();
_ASSERT( ech != 1 );//エラーチェック
/* 処理終了 */
/* **********
// scid2の上に黒画像(scid1による)をレンダリングします
// **********
*/
ech = E3DBeginScene( scid1, 1, -1);
_ASSERT( ech != 1 );//エラーチェック
ech = E3DBeginSprite();//スプライト描画の開始
_ASSERT( ech != 1 );//エラーチェック
/* **************************************** */
/* スプライト(透過付き黒画像)をレンダリング */
/* **************************************** */
ech = E3DRenderSprite( SpriteID[1], 1.0f, 1.0f, MainSpritePos);//黒背景
_ASSERT( ech != 1 );//エラーチェック
ech = E3DEndSprite();//スプライト描画の終了
_ASSERT( ech != 1 );//エラーチェック
/* 処理終了 */
ech = E3DEndScene();
_ASSERT( ech != 1 );//エラーチェック
ech = E3DPresent( System::scid1);
_ASSERT( ech != 1 );//エラーチェック
}
return 0;
}
/* 銃クラスを元にキー情報の取得を変更する関数 */
int System::KeyRenewalFromWp( const Weapon_Head *Wpn, const int Equipment){
if( Equipment == -1){// 装備なしなら
System::KeyRenewal(1);
}
else if( Equipment == 2){// サポート武器なら
System::KeyRenewal(2);
}
else if( Wpn->Get_WeaponPointer(Equipment)->Get_NowAmmo() != 0){// 武器を所持しているなら
System::KeyRenewal( Wpn->Get_WeaponPointer(Equipment)->Get_RapidFire() + 1);
}
else{// それ以外なら
System::KeyRenewal(1);
}
return 0;
}
/* マウス座標をセットする関数 */
int System::SetMouseCursol( const int X, const int Y){
SetCursorPos( System::rewin.left + X, System::rewin.top + Y);
return 0;
}
/* 現在のマウス座標をBeforeMousePosにセットする関数 */
int System::SetMouseBeforePos(){
/* 変数の初期化 */
POINT BeforeMousePoseAddRewin;
GetCursorPos( &BeforeMousePoseAddRewin);
System::BeforeMousePos.x = BeforeMousePoseAddRewin.x - System::rewin.left;
System::BeforeMousePos.y = BeforeMousePoseAddRewin.y - System::rewin.top;
return 0;
}
/* キーインプットを取得する関数 */
bool System::GetKeyData( const int KeyNum){
return keyin[ KeyNum ];
} | [
"giraffe_rakugaki@yahoo.co.jp"
] | giraffe_rakugaki@yahoo.co.jp |
1f75482b77b6c2e76da3e95d27664a684536da09 | fd755cced5aad8b2d1d87dbe422e546cf15fc616 | /Chapter 3/ex3.31.cc | ab83fadee9fa3c7ede73c452a43078bc83920f6e | [] | no_license | konmos/cpp-primer | 95683824766ff14b45e8fd17ff065a5bb0133ddf | 4acdc35b75377d9e47f0c68acc0b9f6eec305598 | refs/heads/master | 2020-08-21T22:46:47.873856 | 2019-10-19T20:16:42 | 2019-10-19T20:16:42 | 216,265,065 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 240 | cc | #include <iostream>
using std::cout;
using std::endl;
int main()
{
constexpr unsigned sz = 10;
int arr[sz] = {};
for (int ix = 0; ix < sz; ++ix) arr[ix] = ix;
for (auto x : arr) cout << x << endl;
return 0;
} | [
"32582880+konmos@users.noreply.github.com"
] | 32582880+konmos@users.noreply.github.com |
263587fc662948215ab93cad96deb5aea930b83f | b22588340d7925b614a735bbbde1b351ad657ffc | /athena/PhysicsAnalysis/TauID/TauTrackEvent/TauTrackEvent/TauJetTruthMap.h | 3a73ca42d4adaddf535eaa91fbef5a34d4103258 | [] | no_license | rushioda/PIXELVALID_athena | 90befe12042c1249cbb3655dde1428bb9b9a42ce | 22df23187ef85e9c3120122c8375ea0e7d8ea440 | refs/heads/master | 2020-12-14T22:01:15.365949 | 2020-01-19T03:59:35 | 2020-01-19T03:59:35 | 234,836,993 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 965 | h | /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TAUTRACKEVENT_TAUJETTRUTHMAP_H
#define TAUTRACKEVENT_TAUJETTRUTHMAP_H
#include <map>
//#include "TauTrackEvent/TruthTau.h"
//#include "tauEvent/TauJet.h"
namespace Analysis {
class TauJet;
}
namespace TauID {
class TruthTau;
/**
* @brief Map between Analysis::TauJet and TauID::TruthTau used for truth matching
*
* TauJets without truth match are mapped to NULL.
* This is a multimap even though one TauJet should be matched to exactly one
* TruthTau. Multimap is needed, because all TruthTaus without matched TauJet
* (missing reconstructed taus) are matched to NULL, i.e. several NULL TauJet pointer
* may exist which map to different TruthTaus.
*
* @author Sebastian Fleischmann
*/
typedef std::multimap<const Analysis::TauJet*, const TauID::TruthTau*> TauJetTruthMap;
}
#endif //TAUTRACKEVENT_TAUJETTRUTHMAP_H
| [
"rushioda@lxplus754.cern.ch"
] | rushioda@lxplus754.cern.ch |
9f05a49784c5dd73289a1975a15403b10ca30214 | f83ac63b344644596d74fff4d529562164651a29 | /factorial.cpp | 7a1ff3773fa85218b6a0317b53d09f9249905c12 | [] | no_license | Tejas281/Program_CodeForces | 61a00e7c248a42556ef8198972cc7b16032cff93 | 801ce2cf0b09d0b965b5209877035428620b5f43 | refs/heads/master | 2022-12-11T15:47:01.699755 | 2020-09-15T12:25:49 | 2020-09-15T12:25:49 | 295,720,139 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 202 | cpp | #include<stdio.h>
#include<conio.h>
#include<iostream>
int fac(int n)
{
if(n>1)
{
return n*(fac(n-1));
}
}
int main()
{
printf("%d",fac(6));
}
| [
"tejas1188245@gmail.com"
] | tejas1188245@gmail.com |
38be860a78f0a1e06ec1112800d2e7b7603a6d69 | 3e7ae0d825853090372e5505f103d8f3f39dce6d | /AutMarine v4.2.0/AutLib/Mesh/Tools/MeshCondition/Mesh_LaplacianSmoothingInfo.cxx | 4ae72c3efd831482cdae39eb4785bd6456010a13 | [] | no_license | amir5200fx/AutMarine-v4.2.0 | bba1fe1aa1a14605c22a389c1bd3b48d943dc228 | 6beedbac1a3102cd1f212381a9800deec79cb31a | refs/heads/master | 2020-11-27T05:04:27.397790 | 2019-12-20T17:59:03 | 2019-12-20T17:59:03 | 227,961,590 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,077 | cxx | #include <Mesh_LaplacianSmoothingInfo.hxx>
static const Standard_Integer DEFAULT_MAX_LEVELS = 3;
static const Standard_Real DEFAULT_UNDER_RELAXATION = 0.8;
AutLib::MeshLib::Mesh_LaplacianSmoothingInfo::Mesh_LaplacianSmoothingInfo()
: theMaxLevels_(DEFAULT_MAX_LEVELS)
, theUnderRelaxation_(DEFAULT_UNDER_RELAXATION)
, BeApply_(Standard_False)
{
}
Standard_Integer AutLib::MeshLib::Mesh_LaplacianSmoothingInfo::MaxLevels() const
{
return theMaxLevels_;
}
Standard_Real AutLib::MeshLib::Mesh_LaplacianSmoothingInfo::UnderRelaxation() const
{
return theUnderRelaxation_;
}
Standard_Boolean AutLib::MeshLib::Mesh_LaplacianSmoothingInfo::beApply() const
{
return BeApply_;
}
void AutLib::MeshLib::Mesh_LaplacianSmoothingInfo::SetMaxLevels(const Standard_Integer MaxLevels)
{
theMaxLevels_ = MaxLevels;
}
void AutLib::MeshLib::Mesh_LaplacianSmoothingInfo::SetUnderRelaxation(const Standard_Real UnderRelaxation)
{
theUnderRelaxation_ = UnderRelaxation;
}
void AutLib::MeshLib::Mesh_LaplacianSmoothingInfo::SetApply(const Standard_Boolean Apply)
{
BeApply_ = Apply;
} | [
"aasoleimani86@gmail.com"
] | aasoleimani86@gmail.com |
f99276af751d05326d7d9e0054557d47e0ea6990 | a06a8814125294390da6efe695485a5b11cbf834 | /Idaten/src/SandStorm/SandStrom.cpp | 9c6076a15a2d716ae3fb96f9c16a669e70f913a6 | [] | no_license | TeamYoshikawa/IdatenChacker | 91cfff6575f9352d46c75917a2dd906559524962 | 9cc5fa2eb229b966dc9845275e6062a7a07af13f | refs/heads/master | 2021-03-12T22:11:00.277150 | 2016-01-25T01:29:54 | 2016-01-25T01:29:54 | 39,057,277 | 0 | 2 | null | null | null | null | SHIFT_JIS | C++ | false | false | 1,689 | cpp | #include "SandStrom.h"
#include <iostream>
const int SandStrom::m_scale = 3;
SandStrom::SandStrom() :
m_isStart(false),
m_random(1)
{
}
SandStrom::~SandStrom()
{
}
void SandStrom::Initialize(HDC buffer,const int windowWidth,const int windowHeight){
m_window={ 0, 0, windowWidth, windowHeight };
m_sand.reset(new unsigned char[m_window.right*m_window.bottom * m_scale]);
HDC hdc;
hdc = ::CreateCompatibleDC(buffer);
HBITMAP hbit;
hbit = ::CreateCompatibleBitmap(buffer, windowWidth, windowHeight);
m_bitInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
m_bitInfo.bmiHeader.biWidth = windowWidth;
m_bitInfo.bmiHeader.biHeight = windowHeight;
m_bitInfo.bmiHeader.biPlanes = 1;
m_bitInfo.bmiHeader.biBitCount = 24;
m_bitInfo.bmiHeader.biCompression = BI_RGB;
// 正確なBITMAPINFOを取得
::GetDIBits(hdc, (HBITMAP)hbit, m_window.left, m_window.bottom, 0, &this->m_bitInfo, DIB_RGB_COLORS);
::DeleteObject((HBITMAP)hbit);
::DeleteDC(hdc);
this->m_isStart = true;
}
void SandStrom::Start(HDC buffer){
if (!m_isStart) return;
const int width = m_window.right;
const int height = m_window.bottom;
const int scale = m_scale*m_scale;
// なんとなくわかって
for (int i = 0; i < width * height * m_scale; i+=3) {
m_sand.get()[i] = m_sand.get()[i + 1] = m_sand.get()[i + 1] =
m_sand.get()[i + 2] = m_sand.get()[i + 2] = m_random >> 20;
// 疑似乱数の生成
m_random = (m_random * scale );
}
SetDIBitsToDevice(buffer, 0, 0, width, height, 0, 0, 0, height, m_sand.get(), &m_bitInfo, DIB_RGB_COLORS);
}
//
/// 終了処理
void SandStrom::End(){
m_sand.reset();
(m_bitInfo);
m_sand = nullptr;
m_isStart = false;
} | [
"iwgm14cyancle@gmail.com"
] | iwgm14cyancle@gmail.com |
4b58a495dec8a4389784a7250a6ba3a3613ca0fd | 5d79ab4b3229a273a850fda89f775d235abf09cf | /assessment_1/src/Node.h | 0f9984ca6c617a185a4f9e78deb50a5c8b6f0686 | [] | no_license | clungzta/SENG1120_2016 | 62f3f821ed62df968e6af39e3d45878204dcbb55 | 68e235b216750e458d5ecad6c6a7aabcddbbdb7a | refs/heads/master | 2021-10-08T12:36:29.338259 | 2016-11-04T00:58:05 | 2016-11-04T00:58:05 | 66,327,310 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,668 | h | /**
SENG1120 Assignment 1
Created by Alex McClung
Semester 2 2016
**/
#ifndef Node_H
#define Node_H
#include <string>
namespace alex_m
{
class Node //For a doubly linked list
{
public:
typedef std::string value_type;
// Constructor
// Precondition: None
// Postcondition: A new node instance is created
// @initial_data: Initial data to be stored in the node. Default Empty value_type
// @initial_prev_link: Initial pointer to the previous node in the list. Default NULL
// @initial_next_link: Initial pointer to the next node in the list. Default NULL
Node(const value_type& initial_data = value_type(), Node* initial_prev_link = NULL, Node* initial_next_link = NULL);
// Destructor
// Precondition: None
// Postcondition: The node instance is deleted
~Node();
// Precondition: None
// Postcondition: The data stored within the node is set to @param new_data
void set_data(const value_type& new_data);
// Precondition: None
// Postcondition: The next_link pointer is set to @param new_link
void set_next_link(Node* new_link);
// Precondition: None
// Postcondition: The prev_link pointer is set to @param new_link
void set_prev_link(Node* new_link);
//Data stored in the node
value_type data() const;
//Points to the next node in the list
Node* next_link() const;
//Points to the previous node in the list
Node* prev_link() const;
private:
value_type d;
Node* prev;
Node* next;
};
}
#endif | [
"alex.mcclung@hotmail.com"
] | alex.mcclung@hotmail.com |
b2050aa39f9189fdb93253487eea535de61810ea | 34ca93c61beac16e54d7bfd116546e5b0089a625 | /pta_work/2017/L1-7.cpp | 81ee875b763e9ca0b65d4b3b107ed6e1f8b9635f | [] | no_license | CaoMingAAA/PTA | b048305708666f4021d5217c2a53bb7268143ef9 | 132e4cc0a616e9d7578c87eedda658432942b218 | refs/heads/master | 2021-01-26T02:38:32.707196 | 2020-02-26T14:42:28 | 2020-02-26T14:42:28 | 243,277,089 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 594 | cpp | #include "pch.h"
#include"../pch.h"
#include <iostream>
#include <vector>
#include <string>
using namespace std;
/*
int main()
{
int n;
cin >> n;
string s;
getchar();
getline(cin,s);
int len = s.length();
vector<vector<char>> v(n);
int row = 0;
int max = 0;
for (int i = 0; i < len; i++)
{
v[row].push_back(s[i]);
max = max < v[row].size() ? v[row].size() : max;
row++;
if (row >= n)
row = 0;
}
for (int i = 0; i < n; i++)
v[i].resize(max, ' ');
for (int i = 0; i < n; i++)
{
for (int j = max - 1; j >= 0; j--)
{
cout << v[i][j];
}
cout << endl;
}
}*/ | [
"1705218030@qq.com"
] | 1705218030@qq.com |
51e7d700d60314b75df5f37e10149d6cc25e20b2 | c67721034507e6205cbc8c0bf369222460cd9b15 | /GCJ/2020D/D_Locked-Doors-BinarySearch_RMQ.cpp | ef08715a0867b3bf09bc355ad3e83b5f19b4d158 | [] | no_license | vimday/HappyLearning | 8cc2aa6bbdeb75faf6f86f76281d0494dee62105 | f3238fa0f234bde8cb79ab626a59053b15f869f6 | refs/heads/master | 2023-01-18T19:36:15.604355 | 2020-12-04T06:51:15 | 2020-12-04T06:51:15 | 305,049,614 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,899 | cpp | /*
* @Author :vimday
* @Desc :https://doowzs.com/blog/2020-07-15-ks-2020-d/
* @Url :https://codingcompetitions.withgoogle.com/kickstart/submissions/000000000019ff08/YmVldC5haXp1
* @File Name :D_Locked-Doors.cpp
* @Created Time:2020-10-18 16:06:23
* @E-mail :lwftx@outlook.com
* @GitHub :https://github.com/vimday
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
// #include <ext/rope>
// using namespace __gnu_cxx;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef ll key_type;
// typedef null_mapped_type value_type;
// typedef tree<key_type, value_type, less<key_type>, rb_tree_tag, tree_order_statistics_node_update> rbtree;
// typedef __gnu_pbds::priority_queue<pi,greater<pi>,pairing_heap_tag > heap;
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// int rnd(int l,int r){return l+rng()%(r-l+1);}
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fr(x) freopen(x, "r", stdin)
#define fw(x) freopen(x, "w", stdout)
#define iout(x) printf("%d\n", x)
#define lout(x) printf("%lld\n", x)
#define REP(x, l, u) for (ll x = l; x < u; x++)
#define RREP(x, l, u) for (ll x = l; x >= u; x--)
#define complete_unique(a) a.erase(unique(a.begin(), a.end()), a.end())
#define mst(x, a) memset(x, a, sizeof(x))
#define all(a) begin(a), end(a)
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define MP make_pair
#define lowbit(x) ((x) & (-(x)))
#define ls (ind << 1)
#define rs (ind << 1 | 1)
#define mid ((l + r) >> 1)
#define lson l, mid, ls
#define rson mid + 1, r, rs
#define se second
#define fi first
#define sz(x) ((int)x.size())
#define EX0 exit(0);
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef vector<ll> VLL;
typedef vector<int> VI;
typedef complex<ll> point;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
namespace HELP {
ull twop(ll x) { return 1ULL << x; }
ll MOD(ll a, ll m) {
a %= m;
if (a < 0) a += m;
return a;
}
ll inverse(ll a, ll m) {
a = MOD(a, m);
if (a <= 1) return a;
return MOD((1 - inverse(m, a) * m) / a, m);
}
template <typename T>
T sqr(T x) { return x * x; }
ll gcd(ll a, ll b) {
while (b != 0) {
a %= b;
swap(a, b);
}
return abs(a);
}
ll fast(ll a, ll b, ll mod) {
if (b < 0) a = inverse(a, mod), b = -b;
ll ans = 1;
while (b) {
if (b & 1) {
b--;
ans = ans * a % mod;
} else {
a = a * a % mod;
b /= 2;
}
}
return ans % mod;
}
//int tr[60][26];
//int fail[60];
//int n;
//void calcNext(string s) {
// n = sz(s);
// s = " " + s;
// fail[0] = 0;
// REP(i, 0, 26) {
// if (s[1] == i) {
// tr[0][i] = 1;
// } else {
// tr[0][i] = 0;
// }
// }
// fail[1] = 0;
// REP(i, 1, n) {
// REP(j, 0, 26) {
// if (s[i + 1] == j) {
// tr[i][j] = i + 1;
// fail[i + 1] = tr[fail[i]][j];
// } else {
// tr[i][j] = tr[fail[i]][j];
// }
// }
// }
//}
// ll qp(ll a, ll b) {
// ll res = 1;
// a %= MOD;
// assert(b >= 0);
// while(b){
// if(b&1)
// res = res * a % MOD;
// a = a * a % MOD;
// b >>= 1;
// }
// return res;
// }
// ll inv(ll x) {return qp(x, MOD - 2);}
// ll factor[N], finv[N];
// void init() {
// factor[0]=1;
// for(int i=1; i<N; i++) factor[i] = factor[i-1] * i % MOD;
// finv[N-1] = qp(factor[N-1], MOD - 2);
// for(int i=N-2; i>=0; i--) finv[i] = finv[i+1] * (i+1) % MOD;
// }
// ll c(ll n, ll m) {
// return factor[n] * finv[m] % MOD * finv[n-m] % MOD;
// }
// #define fore(_, __) for(int _=head[__]; _; _=e[_].nxt)
// int head[N], tot = 1;
// struct Edge {
// int v, nxt;
// Edge(){}
// Edge(int _v, int _nxt):v(_v), nxt(_nxt) {}
// }e[M << 1];
// void addedge(int u, int v) {
// e[tot] = Edge(v, head[u]); head[u] = tot++;
// e[tot] = Edge(u, head[v]); head[v] = tot++;
// }
template <typename T, typename S>
inline bool upmin(T &a, const S &b) { return a > b ? a = b, 1 : 0; }
template <typename T, typename S>
inline bool upmax(T &a, const S &b) { return a < b ? a = b, 1 : 0; }
}; // namespace HELP
namespace IO {
template <typename T>
inline void in(T &x) {
x = 0;
T f = 1;
char ch = getchar();
while (!isdigit(ch)) {
if (ch == '-') f = -1;
ch = getchar();
}
while (isdigit(ch)) {
x = x * 10 + ch - '0';
ch = getchar();
}
x *= f;
}
template <typename T, typename... Tail>
inline void in(T &x, Tail &... y) {
in(x);
in(y...);
}
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) +
+to_string(p.second) + ")"; }
template <typename Num>
string to_string(Num n) {
return std::to_string(n);
}
template <typename A>
string to_string(vector<A> v) {
bool first = true;
string res = "{";
for (const auto &x : v) {
if (!first) {
res += ", ";
}
first = false;
res += to_string(x);
}
res += "}";
return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
cerr << " " << to_string(H);
debug_out(T...);
}
bool REOF = 1; //为0表示文件结尾
inline char nc() {
static char buf[1 << 20], *p1 = buf, *p2 = buf;
return p1 == p2 && REOF && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2) ? (REOF = 0, EOF) : *p1++;
}
template <typename T>
inline bool read(T &x) {
char c = nc();
bool f = 0;
x = 0;
while (c < '0' || c > '9') c == '-' && (f = 1), c = nc();
while (c >= '0' && c <= '9') x = (x << 3) + (x << 1) + (c ^ 48), c = nc();
if (f) x = -x;
return REOF;
}
template <typename T>
inline void write(T x) {
if (x > 9) write(x / 10);
putchar('0' + x % 10);
}
template <typename T, typename... T2>
inline bool read(T &x, T2 &... rest) {
read(x);
return read(rest...);
}
// inline bool need(char &c) { return (c == '.') || (c == '#');}
inline bool need(char &c) { return ((c >= 'a') && (c <= 'z')) || ((c >= '0') && (c <= '9')) || ((c >= 'A') && (c <= 'Z')); }
// inline bool need(char &c) { return ((c >= 'a') && (c <= 'z')) || ((c >= '0') && (c <= '9')) || ((c >= 'A') && (c <= 'Z')) || c==' ');}
inline bool read_str(char *a) {
while ((*a = nc()) && need(*a) && REOF) ++a;
*a = '\0';
return REOF;
}
inline bool read_db(double &x) {
bool f = 0;
char ch = nc();
x = 0;
while (ch < '0' || ch > '9') {
f |= (ch == '-');
ch = nc();
}
while (ch >= '0' && ch <= '9') {
x = x * 10.0 + (ch ^ 48);
ch = nc();
}
if (ch == '.') {
double tmp = 1;
ch = nc();
while (ch >= '0' && ch <= '9') {
tmp = tmp / 10.0;
x = x + tmp * (ch ^ 48);
ch = nc();
}
}
if (f) x = -x;
return REOF;
}
template <typename TH>
inline void _dbg(const char *sdbg, TH h) { cerr << sdbg << '=' << h << endl; }
template <class TH, class... TA>
inline void _dbg(const char *sdbg, TH h, TA... a) {
while (*sdbg != ',') cerr << *sdbg++;
cerr << '=' << h << ',' << ' ';
_dbg(sdbg + 1, a...);
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> V) {
os << "[";
for (auto vv : V) os << vv << ",";
return os << "]";
}
template <typename T>
ostream &operator<<(ostream &os, set<T> V) {
os << "[";
for (auto vv : V) os << vv << ",";
return os << "]";
}
template <typename T>
ostream &operator<<(ostream &os, map<T, T> V) {
os << "[";
for (auto vv : V) os << vv << ",";
return os << "]";
}
template <typename L, typename R>
ostream &operator<<(ostream &os, pair<L, R> P) {
return os << "(" << P.fi << "," << P.se << ")";
}
#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...)
#endif
} // namespace IO
using namespace IO;
using namespace HELP;
inline void debug_Init() {
#ifdef LOCAL
freopen("E:\\Cpp\\in.txt", "r", stdin);
freopen("E:\\Cpp\\out.txt", "w", stdout);
#endif
}
const int MXN = 100005;
const int LN = 21;
int f[MXN][LN], logn[MXN];
int n, q, s, k;
int d[MXN];
void initLog() {
logn[1] = 0;
for (int i = 2; i < MXN; i++)
logn[i] = logn[i >> 1] + 1;
}
void initST() {
for (int i = 0; i <= n; ++i)
f[i][0] = d[i];
for (int j = 1; j <= LN; ++j)
for (int i = 1; i + (1 << j) - 1 <= n; ++i)
f[i][j] = max(f[i][j - 1], f[i + (1 << (j - 1))][j - 1]);
}
int querry(int l, int r) {
int ss = logn[r - l + 1];
return max(f[l][ss], f[r - (1 << ss) + 1][ss]);
}
bool can(int mi) {
int l = mi;
int r = s + (k - (s - l));
int ml = querry(l, s - 1), mr = querry(s, r);
return ml < mr;
}
int solve() {
read(s, k);
if (k == 1)
return s;
k -= 2;
int l = max(1, s - k), h = min(s, s - (k - (n - s)));
while (l < h) {
int mi = l + (h - l >> 1);
can(mi) ? h = mi : l = mi + 1;
}
int r = s + (k - (s - l));
return d[l - 1] < d[r] ? l - 1 : r + 1;
}
void printAns(int caseNum) {
printf("Case #%d: ", caseNum);
read(n, q);
d[0] = d[n] = INT_MAX;
for (int i = 1; i < n; ++i)
read(d[i]);
initST();
while (q--)
printf("%d ", solve());
printf("\n");
}
int main() {
debug_Init();
int T;
read(T);
initLog();
for (int i = 0; i < T;)
printAns(++i);
return 0;
}
// #include <algorithm>
// #include <cstdio>
// #include <cstring>
// #include <iostream>
// #include <vector>
// using namespace std;
// class Node {
// public:
// int l, r;
// int val;
// };
// int n = 0, q = 0;
// int d[100005] = {};
// Node t[400020] = {};
// void build(int cur, int l, int r) {
// t[cur].l = l;
// t[cur].r = r;
// if (l == r) {
// t[cur].val = d[l];
// return;
// }
// int m = (l + r) / 2;
// build(cur << 1, l, m);
// build(cur << 1 | 1, m + 1, r);
// t[cur].val = max(t[cur << 1].val, t[cur << 1 | 1].val);
// }
// int query(int cur, int l, int r) {
// if (t[cur].l == l && t[cur].r == r) {
// return t[cur].val;
// }
// if (t[cur << 1].r >= r) {
// return query(cur << 1, l, r);
// } else if (t[cur << 1 | 1].l <= l) {
// return query(cur << 1 | 1, l, r);
// } else {
// return max(query(cur << 1, l, t[cur << 1].r),
// query(cur << 1 | 1, t[cur << 1 | 1].l, r));
// }
// }
// bool check(int s, int k, int step) {
// // go left 'step' steps ok?
// int farL = s - step, farR = s + (k - step);
// int maxL = query(1, farL, s - 1);
// int maxR = query(1, s, farR);
// return maxL < maxR;
// }
// int solve(int s, int k) {
// int step = 0, l = max(1, k - (n - s)), r = min(s - 1, k);
// while (l <= r) {
// int mid = (l + r) / 2;
// if (check(s, k, mid)) {
// step = mid;
// l = mid + 1;
// } else {
// r = mid - 1;
// }
// }
// int ansL = s - step - 1;
// int ansR = s + (k - step) + 1;
// return d[ansL] < d[ansR - 1] ? ansL : ansR;
// }
// int main() {
// int T = 0;
// scanf("%d", &T);
// for (int t = 1; t <= T; ++t) {
// scanf("%d %d", &n, &q);
// d[0] = d[n] = 0x3f3f3f3f;
// for (int i = 1; i < n; ++i) {
// scanf("%d", d + i);
// }
// build(1, 0, n);
// printf("Case #%d: ", t);
// for (int i = 1; i <= q; ++i) {
// int s = 0, k = 0;
// scanf("%d %d", &s, &k);
// printf("%d ", k == 1 ? s : solve(s, k - 2));
// }
// printf("\n");
// }
// return 0;
// }
// #include <bits/stdc++.h>
// using namespace std;
// template <typename T1, typename T2>
// inline void chmin(T1 &a, T2 b) {
// if (a > b) a = b;
// }
// template <typename T1, typename T2>
// inline void chmax(T1 &a, T2 b) {
// if (a < b) a = b;
// }
// using Int = long long;
// const char newl = '\n';
// struct UnionFind {
// Int num;
// vector<Int> rs, ps;
// UnionFind() {}
// UnionFind(Int n) : num(n), rs(n, 1), ps(n, 0) { iota(ps.begin(), ps.end(), 0); }
// Int find(Int x) {
// return (x == ps[x] ? x : ps[x] = find(ps[x]));
// }
// bool same(Int x, Int y) {
// return find(x) == find(y);
// }
// void unite(Int x, Int y) {
// x = find(x);
// y = find(y);
// if (x == y) return;
// if (rs[x] < rs[y]) swap(x, y);
// rs[x] += rs[y];
// ps[y] = x;
// num--;
// }
// Int size(Int x) {
// return rs[find(x)];
// }
// Int count() const {
// return num;
// }
// };
// //INSERT ABOVE HERE
// signed solve() {
// Int n, q;
// cin >> n >> q;
// vector<Int> ds(n - 1);
// for (Int i = 0; i < n - 1; i++) cin >> ds[i];
// vector<Int> ss(q), ks(q);
// for (Int i = 0; i < q; i++) cin >> ss[i] >> ks[i], ss[i]--;
// using P = pair<Int, Int>;
// vector<P> vp;
// for (Int i = 0; i < n - 1; i++)
// vp.emplace_back(ds[i], i);
// sort(vp.begin(), vp.end());
// vector<Int> ord(n - 1);
// for (Int i = 0; i < n - 1; i++)
// ord[i] = vp[i].second;
// // check(ls[i]) = false
// // check(rs[i]) = true
// vector<Int> ls(q, -1), rs(q, n - 1);
// while (1) {
// Int flg = 0;
// vector<vector<Int>> G(n);
// for (Int i = 0; i < q; i++) {
// if (ls[i] + 1 < rs[i]) {
// Int mid = (ls[i] + rs[i]) >> 1;
// G[mid].emplace_back(i);
// flg = 1;
// }
// }
// if (!flg) break;
// UnionFind uf(n);
// for (Int i = 0; i < n - 1; i++) {
// uf.unite(ord[i], ord[i] + 1);
// for (Int k : G[i]) {
// if (uf.size(ss[k]) >= ks[k])
// rs[k] = i;
// else
// ls[k] = i;
// }
// }
// }
// vector<Int> ans(q);
// vector<vector<Int>> G(n + 1);
// for (Int i = 0; i < q; i++) {
// assert(rs[i] < n - 1);
// if (ks[i] == 1) {
// ans[i] = ss[i];
// } else {
// G[rs[i]].emplace_back(i);
// }
// }
// UnionFind uf(n);
// for (Int i = 0; i < n - 1; i++) {
// // [xL, xR] [yL, yR]
// Int xR = ord[i];
// Int xL = xR - (uf.size(xR) - 1);
// assert(uf.same(xL, xR));
// Int yL = ord[i] + 1;
// Int yR = yL + (uf.size(yL) - 1);
// assert(uf.same(yL, yR));
// for (Int k : G[i]) {
// assert(uf.size(ss[k]) < ks[k]);
// if (uf.same(xL, ss[k])) {
// ans[k] = yL + (ks[k] - (uf.size(ss[k]) + 1));
// } else {
// ans[k] = xR - (ks[k] - (uf.size(ss[k]) + 1));
// }
// }
// uf.unite(ord[i], ord[i] + 1);
// }
// for (Int i = 0; i < q; i++) cout << ' ' << ans[i] + 1;
// cout << newl;
// return 0;
// }
// signed main() {
// cin.tie(0);
// ios::sync_with_stdio(0);
// Int T;
// cin >> T;
// for (Int t = 1; t <= T; t++) {
// cout << "Case #" << t << ":";
// solve();
// }
// return 0;
// }
| [
"lwfplus@gmail.com"
] | lwfplus@gmail.com |
4cf1256fdf07c51a4e98d62b9df63616b6d3f7a2 | d960c0c39cd4ab9f054887d4b73c25d6abc07b93 | /ShootingArena/include/sMaterial.hpp | 2b59d95835dddf4b882bb2c967605bca4743e8f6 | [] | no_license | chicofranchico/cg-finalproject | b3ffa9de86fad37ce990bbed0a76ede35260e7c1 | 0527c0e3c0876e09895d72d930fb8219aef81ebe | refs/heads/master | 2020-04-01T18:29:02.167742 | 2010-06-02T17:26:44 | 2010-06-02T17:26:44 | 32,141,088 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,273 | hpp | /**
* material.hpp
* Modified version of Fatih Erol material and color classes
* By JuanPi Carbajal carbajal@ifi.uzh.ch
* 05.2010
*/
#ifndef S_MATERIAL_HPP
#define S_MATERIAL_HPP
#include "GlutStuffs.h"
/** Structure for RGBA color */
struct Color
{
/** Red, green, blue and alpha components of the color */
float &r, &g, &b, &a; // Reference to array elements for r, g, b, a
float array[4]; // Actual array to hold data
/**
* Constructor.
* A color is represented by its red, green and blue components. The alpha value
* is usually used for representing transparency, where 1.0 means a totally opaque
* color and 0.0 means a totally transparent color.
*
* @param[in] r_ Red component of the color
* @param[in] g_ Green component of the color
* @param[in] b_ Blue component of the color
* @param[in] r_ Alpha component of the color
*/
Color( float r_ = 0.0f, float g_ = 0.0f, float b_ = 0.0f, float a_ = 1.0 );
/**
* Copy constructor.
*
* @param[in] other Color object to copy from
*/
Color( const Color &other );
/**
* Assignment operator.
*
* @param[in] other Color object to copy values from
*
* @return New Color object with same content as other object
*/
Color &operator=( const Color &other );
/**
* Check if two Color objects have the same values
*
* @param[in] other Color object to compare to
*
* @return True if they have same values, false otherwise
*/
bool operator==( const Color &other );
// Static Color objects to define basic colors
static const Color &WHITE;
static const Color &BLACK;
static const Color &GRAY;
static const Color &RED;
static const Color &GREEN;
static const Color &BLUE;
static const Color &YELLOW;
static const Color &BROWN;
}; // struct Color
/** Class to set up surface material */
class sMaterial
{
public:
/** Constructor */
sMaterial();
/** Destructor */
~sMaterial();
/**
* Set the material as active
*
* @param[in] face Face to apply the material to
*/
void setActive( GLenum face = GL_FRONT_AND_BACK ) const;
// Material properties
const Color &getAmbient() const { return _ambient; }
void setAmbient( const Color &ambient ) { _ambient = ambient; }
const Color &getDiffuse() const { return _diffuse; }
void setDiffuse( const Color &diffuse ) { _diffuse = diffuse; }
const Color &getSpecular() const { return _specular; }
void setSpecular( const Color &specular ) { _specular = specular; }
const Color &getEmission() const { return _emission; }
void setEmission( const Color &emission ) { _emission = emission; }
const float getShininess() const { return _shininess; }
void setShininess( const float shininess ) { _shininess = shininess; }
private:
// Properties of the material
Color _ambient;
Color _diffuse;
Color _specular;
Color _emission;
float _shininess;
}; // class Material
#endif // S_MATERIAL_HPP
| [
"ajuanpi@2b03051f-00de-373a-db7d-3385a0bcc09a"
] | ajuanpi@2b03051f-00de-373a-db7d-3385a0bcc09a |
e629ec6a67a745d03f12ebb7d1c062e8c3426a45 | b012b15ec5edf8a52ecf3d2f390adc99633dfb82 | /releases/moos-ivp-15.5.1beta/ivp/src/lib_geometry/XYSegList.cpp | 144df45ad29155213d44fef8671414a8bb5d01aa | [] | no_license | crosslore/moos-ivp-aro | cbe697ba3a842961d08b0664f39511720102342b | cf2f1abe0e27ccedd0bbc66e718be950add71d9b | refs/heads/master | 2022-12-06T08:14:18.641803 | 2020-08-18T06:39:14 | 2020-08-18T06:39:14 | 263,586,714 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,664 | cpp | /*****************************************************************/
/* NAME: Michael Benjamin, Henrik Schmidt, and John Leonard */
/* ORGN: Dept of Mechanical Eng / CSAIL, MIT Cambridge MA */
/* FILE: XYSegList.cpp */
/* DATE: Apr 20th, 2005 */
/* */
/* This file is part of MOOS-IvP */
/* */
/* MOOS-IvP is free software: you can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation, either version */
/* 3 of the License, or (at your option) any later version. */
/* */
/* MOOS-IvP is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty */
/* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See */
/* the GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public */
/* License along with MOOS-IvP. If not, see */
/* <http://www.gnu.org/licenses/>. */
/*****************************************************************/
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "XYSegList.h"
#include "MBUtils.h"
#include "GeomUtils.h"
#include "AngleUtils.h"
using namespace std;
//---------------------------------------------------------------
// Procedure: add_vertex
void XYSegList::add_vertex(double x, double y, double z, string vprop)
{
m_vx.push_back(x);
m_vy.push_back(y);
m_vz.push_back(z);
m_vprop.push_back(vprop);
}
//---------------------------------------------------------------
// Procedure: add_vertex
void XYSegList::add_vertex(const XYPoint &pt, string vprop)
{
m_vx.push_back(pt.x());
m_vy.push_back(pt.y());
m_vz.push_back(pt.z());
m_vprop.push_back(vprop);
}
//---------------------------------------------------------------
// Procedure: alter_vertex
// Purpose: Given a new vertex, find the existing vertex that is
// closest, and replace it with the new one.
void XYSegList::alter_vertex(double x, double y, double z, string vprop)
{
unsigned int vsize = m_vx.size();
if(vsize == 0)
return;
unsigned int ix = closest_vertex(x, y);
m_vx[ix] = x;
m_vy[ix] = y;
m_vz[ix] = z;
m_vprop[ix] = vprop;
}
//---------------------------------------------------------------
// Procedure: delete_vertex
// Purpose: Given a new vertex, find the existing vertex that is
// closest, and delete it.
void XYSegList::delete_vertex(double x, double y)
{
unsigned int vsize = m_vx.size();
if(vsize == 0)
return;
unsigned int ix = closest_vertex(x, y);
delete_vertex(ix);
}
//---------------------------------------------------------------
// Procedure: delete_vertex
// Purpose: Given a valid vertex index, delete that vertex from
// the SegList.
void XYSegList::delete_vertex(unsigned int ix)
{
unsigned int vsize = m_vx.size();
if(ix >= vsize)
return;
vector<double> new_x;
vector<double> new_y;
vector<double> new_z;
for(unsigned int i=0; i<ix; i++) {
new_x.push_back(m_vx[i]);
new_y.push_back(m_vy[i]);
new_z.push_back(m_vz[i]);
}
for(unsigned int i=ix+1; i<vsize; i++) {
new_x.push_back(m_vx[i]);
new_y.push_back(m_vy[i]);
new_z.push_back(m_vz[i]);
}
m_vx = new_x;
m_vy = new_y;
m_vz = new_z;
}
//---------------------------------------------------------------
// Procedure: insert_vertex
// Purpose: Given a new vertex, find the existing segment that is
// closest, and add the vertex between points
void XYSegList::insert_vertex(double x, double y, double z, string vprop)
{
unsigned int vsize = m_vx.size();
if(vsize <= 1)
return(add_vertex(x,y));
unsigned int i, ix = closest_segment(x, y);
vector<double> new_x;
vector<double> new_y;
vector<double> new_z;
vector<string> new_p;
for(i=0; i<=ix; i++) {
new_x.push_back(m_vx[i]);
new_y.push_back(m_vy[i]);
new_z.push_back(m_vz[i]);
new_p.push_back(m_vprop[i]);
}
new_x.push_back(x);
new_y.push_back(y);
new_z.push_back(z);
new_p.push_back(vprop);
for(i=ix+1; i<vsize; i++) {
new_x.push_back(m_vx[i]);
new_y.push_back(m_vy[i]);
new_z.push_back(m_vz[i]);
new_p.push_back(m_vprop[i]);
}
m_vx = new_x;
m_vy = new_y;
m_vz = new_z;
m_vprop = new_p;
}
//---------------------------------------------------------------
// Procedure: clear
void XYSegList::clear()
{
XYObject::clear();
m_vx.clear();
m_vy.clear();
m_vz.clear();
m_vprop.clear();
}
//---------------------------------------------------------------
// Procedure: shift_horz
void XYSegList::shift_horz(double shift_val)
{
unsigned int i, vsize = m_vx.size();
for(i=0; i<vsize; i++)
m_vx[i] += shift_val;
}
//---------------------------------------------------------------
// Procedure: shift_vert
void XYSegList::shift_vert(double shift_val)
{
unsigned int i, vsize = m_vy.size();
for(i=0; i<vsize; i++)
m_vy[i] += shift_val;
}
//---------------------------------------------------------------
// Procedure: grow_by_pct
void XYSegList::grow_by_pct(double pct)
{
double cx = get_centroid_x();
double cy = get_centroid_y();
unsigned int i, vsize = m_vy.size();
for(i=0; i<vsize; i++)
grow_pt_by_pct(pct, cx, cy, m_vx[i], m_vy[i]);
}
//---------------------------------------------------------------
// Procedure: grow_by_amt
void XYSegList::grow_by_amt(double amt)
{
double cx = get_centroid_x();
double cy = get_centroid_y();
unsigned int i, vsize = m_vy.size();
for(i=0; i<vsize; i++)
grow_pt_by_amt(amt, cx, cy, m_vx[i], m_vy[i]);
}
//---------------------------------------------------------------
// Procedure: rotate
void XYSegList::rotate(double degval, double cx, double cy)
{
unsigned int i, vsize = m_vy.size();
for(i=0; i<vsize; i++)
rotate_pt(degval, cx, cy, m_vx[i], m_vy[i]);
}
//---------------------------------------------------------------
// Procedure: rotate
void XYSegList::rotate(double degval)
{
double cx = get_centroid_x();
double cy = get_centroid_y();
rotate(degval, cx, cy);
}
//---------------------------------------------------------------
// Procedure: apply_snap
void XYSegList::apply_snap(double snapval)
{
unsigned int i, vsize = m_vy.size();
for(i=0; i<vsize; i++) {
m_vx[i] = snapToStep(m_vx[i], snapval);
m_vy[i] = snapToStep(m_vy[i], snapval);
}
}
//---------------------------------------------------------------
// Procedure: reverse
void XYSegList::reverse()
{
vector<double> new_x;
vector<double> new_y;
vector<double> new_z;
vector<string> new_p;
unsigned int i, vsize = m_vy.size();
for(i=0; i<vsize; i++) {
new_x.push_back(m_vx[(vsize-1)-i]);
new_y.push_back(m_vy[(vsize-1)-i]);
new_z.push_back(m_vz[(vsize-1)-i]);
new_p.push_back(m_vprop[(vsize-1)-i]);
}
m_vx = new_x;
m_vy = new_y;
m_vz = new_z;
m_vprop = new_p;
}
//---------------------------------------------------------------
// Procedure: new_center
void XYSegList::new_center(double new_cx, double new_cy)
{
double diff_x = new_cx - get_center_x();
double diff_y = new_cy - get_center_y();
shift_horz(diff_x);
shift_vert(diff_y);
}
//---------------------------------------------------------------
// Procedure: new_centroid
void XYSegList::new_centroid(double new_cx, double new_cy)
{
double diff_x = new_cx - get_centroid_x();
double diff_y = new_cy - get_centroid_y();
shift_horz(diff_x);
shift_vert(diff_y);
}
//---------------------------------------------------------------
// Procedure: valid
bool XYSegList::valid() const
{
if((m_vx.size() == 0) && active())
return(false);
return(true);
}
//---------------------------------------------------------------
// Procedure: get_vx
double XYSegList::get_vx(unsigned int i) const
{
if(i<m_vx.size())
return(m_vx[i]);
else
return(0);
}
//---------------------------------------------------------------
// Procedure: get_vy
double XYSegList::get_vy(unsigned int i) const
{
if(i<m_vy.size())
return(m_vy[i]);
else
return(0);
}
//---------------------------------------------------------------
// Procedure: get_vz
double XYSegList::get_vz(unsigned int i) const
{
if(i<m_vz.size())
return(m_vz[i]);
else
return(0);
}
//---------------------------------------------------------------
// Procedure: get_vprop
string XYSegList::get_vprop(unsigned int i) const
{
if(i<m_vprop.size())
return(m_vprop[i]);
else
return("");
}
//---------------------------------------------------------------
// Procedure: get_center_x
// Purpose: Return the mid point between the extreme x low, high
double XYSegList::get_center_x() const
{
unsigned int i, vsize = m_vx.size();
if(vsize == 0)
return(0.0);
double x_high = m_vx[0];
double x_low = m_vx[0];
for(i=1; i<vsize; i++) {
if(m_vx[i] > x_high)
x_high = m_vx[i];
if(m_vx[i] < x_low)
x_low = m_vx[i];
}
return((x_high + x_low) / 2.0);
}
//---------------------------------------------------------------
// Procedure: get_center_y
// Purpose: Return the mid point between the extreme y low, high
double XYSegList::get_center_y() const
{
unsigned int i, vsize = m_vy.size();
if(vsize == 0)
return(0.0);
double y_high = m_vy[0];
double y_low = m_vy[0];
for(i=1; i<vsize; i++) {
if(m_vy[i] > y_high)
y_high = m_vy[i];
if(m_vy[i] < y_low)
y_low = m_vy[i];
}
return((y_high + y_low) / 2.0);
}
//---------------------------------------------------------------
// Procedure: get_centroid_x
// Purpose: Return the x center of mass of all points
double XYSegList::get_centroid_x() const
{
unsigned int i, vsize = m_vx.size();
if(vsize == 0)
return(0);
double total = 0;
for(i=0; i<vsize; i++)
total += m_vx[i];
return(total / ((double)(vsize)));
}
//---------------------------------------------------------------
// Procedure: get_centroid_y
// Purpose: Return the y center of mass of all points
double XYSegList::get_centroid_y() const
{
unsigned int i, vsize = m_vy.size();
if(vsize == 0)
return(0);
double total = 0;
for(i=0; i<vsize; i++)
total += m_vy[i];
return(total / ((double)(vsize)));
}
//---------------------------------------------------------------
// Procedure: get_min_x
// Purpose: Return the min of the x values
double XYSegList::get_min_x() const
{
unsigned int i, vsize = m_vx.size();
if(vsize == 0)
return(0);
double x_min = m_vx[0];
for(i=1; i<vsize; i++)
if(m_vx[i] < x_min)
x_min = m_vx[i];
return(x_min);
}
//---------------------------------------------------------------
// Procedure: get_max_x
// Purpose: Return the max of the x values
double XYSegList::get_max_x() const
{
unsigned int i, vsize = m_vx.size();
if(vsize == 0)
return(0);
double x_max = m_vx[0];
for(i=1; i<vsize; i++)
if(m_vx[i] > x_max)
x_max = m_vx[i];
return(x_max);
}
//---------------------------------------------------------------
// Procedure: get_min_y
// Purpose: Return the min of the y values
double XYSegList::get_min_y() const
{
unsigned int i, vsize = m_vy.size();
if(vsize == 0)
return(0.0);
double y_min = m_vy[0];
for(i=1; i<vsize; i++)
if(m_vy[i] < y_min)
y_min = m_vy[i];
return(y_min);
}
//---------------------------------------------------------------
// Procedure: get_max_y
// Purpose: Return the max of the x values
double XYSegList::get_max_y() const
{
unsigned int i, vsize = m_vy.size();
if(vsize == 0)
return(0.0);
double y_max = m_vy[0];
for(i=1; i<vsize; i++)
if(m_vy[i] > y_max)
y_max = m_vy[i];
return(y_max);
}
//---------------------------------------------------------------
// Procedure: get_avg_x
// Purpose: Return the avg of the x values
double XYSegList::get_avg_x() const
{
unsigned int i, vsize = m_vx.size();
if(vsize == 0)
return(0.0);
double x_total = 0.0;
for(i=0; i<vsize; i++)
x_total += m_vx[i];
return(x_total / (double)(vsize));
}
//---------------------------------------------------------------
// Procedure: get_avg_y
// Purpose: Return the avg of the y values
double XYSegList::get_avg_y() const
{
unsigned int i, vsize = m_vy.size();
if(vsize == 0)
return(0.0);
double y_total = 0.0;
for(i=0; i<vsize; i++)
y_total += m_vy[i];
return(y_total / (double)(vsize));
}
//---------------------------------------------------------------
// Procedure: dist_to_ctr
// Purpose:
double XYSegList::dist_to_ctr(double x, double y) const
{
double ctr_x = get_center_x();
double ctr_y = get_center_y();
double dist = hypot((ctr_x-x), (ctr_y-y));
return(dist);
}
//---------------------------------------------------------------
// Procedure: max_dist_to_ctr
// Purpose: Return the maximum distance between the center and
// any one of the vertices in the SegList.
double XYSegList::max_dist_to_ctr() const
{
double ctr_x = get_center_x();
double ctr_y = get_center_y();
double max_dist = 0;
unsigned int i, vsize = m_vx.size();
for(i=0; i<vsize; i++) {
double dist = hypot((ctr_x - m_vx[i]),
(ctr_y - m_vy[i]));
if(dist > max_dist)
max_dist = dist;
}
return(max_dist);
}
//---------------------------------------------------------------
// Procedure: segs_cross
// Purpose: Determine if any two segments intersect one another
// We exclude from consideration any two segments that
// share a vertex. If the result is false, then this set
// of line segments should form a polygon, although not
// necessarily a convex polygon.
//
// (implied line segment)
// 0 o ~~~~~~~~~~~~~~~~~~~~~~~~~ o 7 vsize = 8
// | |
// | 3 o--------o 4 | last pair of edges considered:
// | | | | 5-6 with 7-0 (loop==true)
// | | | | 4-5 with 6-7 (loop==false)
// | | | |
// 1 o---------o 2 5 o--------o 6
bool XYSegList::segs_cross(bool loop) const
{
unsigned int i, j, vsize = m_vx.size();
if(vsize <= 3)
return(false);
unsigned int limit = vsize-1;
if(loop)
limit = vsize;
for(i=0; i<limit; i++) {
double x1 = m_vx[i];
double y1 = m_vy[i];
double x2 = m_vx[i+1];
double y2 = m_vy[i+1];
for(j=i+2; j<limit; j++) {
double x3 = m_vx[j];
double y3 = m_vy[j];
unsigned int k = j+1;
// Check if we're at the end and considering the last implied
// segment made by connecting the last vertex to the first
// vertex. This will not be reached if loop==false
if(k >= vsize)
k = 0;
if(!((k==0)&&(i==0))) {
double x4 = m_vx[k];
double y4 = m_vy[k];
if(segmentsCross(x1, y1, x2, y2, x3, y3, x4, y4))
return(true);
}
}
}
return(false);
}
//---------------------------------------------------------------
// Procedure: length
// Purpose: Determine the overall length between the first and
// the last point - distance in the X-Y Plane only
double XYSegList::length()
{
unsigned int i, vsize = m_vx.size();
if(vsize == 0)
return(0);
double prev_x = m_vx[0];
double prev_y = m_vy[0];
double total_length = 0;
for(i=1; i<vsize; i++) {
double x = m_vx[i];
double y = m_vy[i];
total_length += hypot(x-prev_x, y-prev_y);
prev_x = x;
prev_y = y;
}
return(total_length);
}
//---------------------------------------------------------------
// Procedure: get_spec
string XYSegList::get_spec(unsigned int precision) const
{
return(get_spec(precision, ""));
}
//---------------------------------------------------------------
// Procedure: get_spec
string XYSegList::get_spec(string param) const
{
return(get_spec(1, param));
}
//---------------------------------------------------------------
// Procedure: get_spec
// Purpose: Get a string specification of the seglist. We set
// the vertex precision to be at the integer by default.
string XYSegList::get_spec(unsigned int precision, string param) const
{
string spec;
// Clip the precision to be at most 6
if(precision > 6)
precision = 6;
unsigned int i, vsize = m_vx.size();
if(vsize > 0)
spec += "pts={";
for(i=0; i<vsize; i++) {
spec += doubleToStringX(m_vx[i],precision);
spec += ",";
spec += doubleToStringX(m_vy[i],precision);
if((m_vz[i] != 0) || (m_vprop[i] != ""))
spec += "," + doubleToStringX(m_vz[i], precision);
if(m_vprop[i] != "")
spec += "," + m_vprop[i];
if(i != vsize-1)
spec += ":";
else
spec += "}";
}
string obj_spec = XYObject::get_spec(param);
if(obj_spec != "") {
if(spec != "")
spec += ",";
spec += obj_spec;
}
return(spec);
}
//---------------------------------------------------------------
// Procedure: get_spec_pts
// Purpose: Get a string specification of the just the points. We set
// the vertex precision to be at the integer by default.
string XYSegList::get_spec_pts(unsigned int precision) const
{
string spec;
// Clip the precision to be at most 6
if(precision > 6)
precision = 6;
unsigned int i, vsize = m_vx.size();
if(vsize > 0)
spec += "pts={";
for(i=0; i<vsize; i++) {
spec += doubleToStringX(m_vx[i],precision);
spec += ",";
spec += doubleToStringX(m_vy[i],precision);
if((m_vz[i] != 0) || (m_vprop[i] != ""))
spec += "," + doubleToStringX(m_vz[i], precision);
if(m_vprop[i] != "")
spec += "," + m_vprop[i];
if(i != vsize-1)
spec += ":";
else
spec += "}";
}
return(spec);
}
//---------------------------------------------------------------
// Procedure: closest_vertex
// Purpose: Find the existing vertex that is closest to the
// given point.
unsigned int XYSegList::closest_vertex(double x, double y) const
{
unsigned int vsize = m_vx.size();
if(vsize == 0)
return(0);
double dist = distPointToPoint(m_vx[0], m_vy[0], x, y);
unsigned int i, ix = 0;
for(i=1; i<vsize; i++) {
double idist = distPointToPoint(m_vx[i], m_vy[i], x, y);
if(idist < dist) {
dist = idist;
ix = i;
}
}
return(ix);
}
//---------------------------------------------------------------
// Procedure: closest_segment
// Purpose: Find the existing segment that is closest to the
// given point.
// Note: Returns the "leading" index of the segment.
unsigned int XYSegList::closest_segment(double x, double y,
bool check_implied_seg) const
{
unsigned int vsize = m_vx.size();
if(vsize <= 1)
return(0);
// Use the distance to the first segment as initial "best-so-far"
double dist = distPointToSeg(m_vx[0], m_vy[0],
m_vx[1], m_vy[1], x, y);
unsigned int i, ix = 0;
for(i=1; i<vsize-1; i++) {
double idist = distPointToSeg(m_vx[i], m_vy[i],
m_vx[i+1], m_vy[i+1], x, y);
if(idist < dist) {
dist = idist;
ix = i;
}
}
// Check the "implied" segment from vertex n-1 to vertex zero.
if(check_implied_seg) {
double edist = distPointToSeg(m_vx[vsize-1], m_vy[vsize-1],
m_vx[0], m_vy[0], x, y);
if(edist < dist)
ix = vsize-1;
}
return(ix);
}
//---------------------------------------------------------------
// Procedure: grow_pt_by_pct |
// o (px, py) |
// \ |
// \ |
// o (px, py) \ |
// \ \ |
// \ \ |
// \ \ |
// \ \ |
// o (cx,cy) o (cx, cy) |
//
void XYSegList::grow_pt_by_pct(double pct, double cx, double cy,
double &px, double &py)
{
px += ((px - cx) * pct);
py += ((py - cy) * pct);
}
//---------------------------------------------------------------
// Procedure: grow_pt_by_amt |
// o (px, py) |
// \ |
// \ |
// o (px, py) \ |
// \ \ |
// \ \ |
// \ \ |
// \ \ |
// o (cx,cy) o (cx, cy) |
//
void XYSegList::grow_pt_by_amt(double amt, double cx, double cy,
double &px, double &py)
{
double angle = relAng(cx, cy, px, py);
projectPoint(angle, amt, px, py, px, py);
}
//---------------------------------------------------------------
// Procedure: rotate_pt
void XYSegList::rotate_pt(double deg, double cx, double cy,
double &px, double &py)
{
//cout << "Rotate_pt: " << endl;
//cout << "cx: " << cx << " cy: " << cy << endl;
//cout << "px: " << px << " py: " << py << endl;
double curr_dist = hypot((cx-px), (cy-py));
double curr_angle = relAng(cx, cy, px, py);
double new_angle = curr_angle + deg;
double nx, ny;
projectPoint(new_angle, curr_dist, cx, cy, nx, ny);
//cout << "dist: " << curr_dist << endl;
//cout << "deg: " << deg << endl;
//cout << "cang: " << curr_angle << endl;
//cout << "nang: " << new_angle << endl;
//cout << "nx: " << nx << " ny: " << ny << endl;
px = nx;
py = ny;
}
| [
"zouxueson@hotmail.com"
] | zouxueson@hotmail.com |
46b5ac11ddb3bfb6133578459e3413394c96298e | c0caed81b5b3e1498cbca4c1627513c456908e38 | /src/protocols/simple_moves/oop/OopMover.fwd.hh | b5d7d6104281463df80fe167cc4f18a4c67c8a63 | [] | no_license | malaifa/source | 5b34ac0a4e7777265b291fc824da8837ecc3ee84 | fc0af245885de0fb82e0a1144422796a6674aeae | refs/heads/master | 2021-01-19T22:10:22.942155 | 2017-04-19T14:13:07 | 2017-04-19T14:13:07 | 88,761,668 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,210 | hh | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
// (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
/// @file protocols/simple_moves/oop/OopMover.fwd.hh
/// @brief OopMover forward declarations header
/// @author Kevin Drew, kdrew@nyu.edu
#ifndef INCLUDED_protocols_simple_moves_oop_OopMover_fwd_hh
#define INCLUDED_protocols_simple_moves_oop_OopMover_fwd_hh
// Utility headers
#include <utility/pointer/owning_ptr.hh>
namespace protocols {
namespace simple_moves {
namespace oop {
//Forwards and OP typedefs
class OopMover;
typedef utility::pointer::shared_ptr< OopMover > OopMoverOP;
typedef utility::pointer::shared_ptr< OopMover const > OopMoverCOP;
}//oop
}//simple_moves
}//protocols
#endif //INCLUDED_protocols_simple_moves_oop_OopMover_fwd_hh
| [
"malaifa@yahoo.com"
] | malaifa@yahoo.com |
645cbeeb190ba4fcc44975efd8583d0df33c1cd1 | 424d9d65e27cd204cc22e39da3a13710b163f4e7 | /ash/style/ash_color_provider.h | 42cb4e5a0743cf940b63f16b639a171800f99d88 | [
"BSD-3-Clause"
] | permissive | bigben0123/chromium | 7c5f4624ef2dacfaf010203b60f307d4b8e8e76d | 83d9cd5e98b65686d06368f18b4835adbab76d89 | refs/heads/master | 2023-01-10T11:02:26.202776 | 2020-10-30T09:47:16 | 2020-10-30T09:47:16 | 275,543,782 | 0 | 0 | BSD-3-Clause | 2020-10-30T09:47:18 | 2020-06-28T08:45:11 | null | UTF-8 | C++ | false | false | 8,586 | h | // Copyright 2019 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 ASH_STYLE_ASH_COLOR_PROVIDER_H_
#define ASH_STYLE_ASH_COLOR_PROVIDER_H_
#include "ash/ash_export.h"
#include "ash/public/cpp/session/session_observer.h"
#include "base/observer_list.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/vector_icon_types.h"
class PrefChangeRegistrar;
class PrefRegistrySimple;
class PrefService;
namespace views {
class ImageButton;
class LabelButton;
} // namespace views
namespace ash {
class ColorModeObserver;
// The color provider for system UI. It provides colors for Shield layer, Base
// layer, Controls layer and Content layer. Shield layer is a combination of
// color, opacity and blur which may change depending on the context, it is
// usually a fullscreen layer. e.g, PowerButtoneMenuScreenView for power button
// menu. Base layer is the bottom layer of any UI displayed on top of all other
// UIs. e.g, the ShelfView that contains all the shelf items. Controls layer is
// where components such as icons and inkdrops lay on, it may also indicate the
// state of an interactive element (active/inactive states). Content layer means
// the UI elements, e.g., separator, text, icon. The color of an element in
// system UI will be the combination of the colors of the four layers.
class ASH_EXPORT AshColorProvider : public SessionObserver {
public:
// Types of Shield layer. Number at the end of each type indicates the alpha
// value.
enum class ShieldLayerType {
kShield20 = 0,
kShield40,
kShield60,
kShield80,
kShield90,
};
// Blur sigma for system UI layers.
enum class LayerBlurSigma {
kBlurDefault = 30, // Default blur sigma is 30.
kBlurSigma20 = 20,
kBlurSigma10 = 10,
};
// Types of Base layer.
enum class BaseLayerType {
// Number at the end of each transparent type indicates the alpha value.
kTransparent20 = 0,
kTransparent40,
kTransparent60,
kTransparent80,
kTransparent90,
// Base layer is opaque.
kOpaque,
};
// Types of Controls layer.
enum class ControlsLayerType {
kHairlineBorderColor,
kControlBackgroundColorActive,
kControlBackgroundColorInactive,
kControlBackgroundColorAlert,
kControlBackgroundColorWarning,
kControlBackgroundColorPositive,
kFocusAuraColor,
kFocusRingColor,
};
enum class ContentLayerType {
kSeparatorColor,
kTextColorPrimary,
kTextColorSecondary,
kTextColorAlert,
kTextColorWarning,
kTextColorPositive,
kIconColorPrimary,
kIconColorSecondary,
kIconColorAlert,
kIconColorWarning,
kIconColorPositive,
// Color for prominent icon, e.g, "Add connection" icon button inside
// VPN detailed view.
kIconColorProminent,
// The default color for button labels.
kButtonLabelColor,
kButtonLabelColorPrimary,
// Color for blue button labels, e.g, 'Retry' button of the system toast.
kButtonLabelColorBlue,
kButtonIconColor,
kButtonIconColorPrimary,
// Color for app state indicator.
kAppStateIndicatorColor,
kAppStateIndicatorColorInactive,
// Color for the shelf drag handle in tablet mode.
kShelfHandleColor,
// Color for slider.
kSliderColorActive,
kSliderColorInactive,
// Color for radio button.
kRadioColorActive,
kRadioColorInactive,
// Color for current active desk's border.
kCurrentDeskColor,
};
// Attributes of ripple, includes the base color, opacity of inkdrop and
// highlight.
struct RippleAttributes {
RippleAttributes(SkColor color,
float opacity_of_inkdrop,
float opacity_of_highlight)
: base_color(color),
inkdrop_opacity(opacity_of_inkdrop),
highlight_opacity(opacity_of_highlight) {}
const SkColor base_color;
const float inkdrop_opacity;
const float highlight_opacity;
};
AshColorProvider();
AshColorProvider(const AshColorProvider& other) = delete;
AshColorProvider operator=(const AshColorProvider& other) = delete;
~AshColorProvider() override;
static AshColorProvider* Get();
// Gets the disabled color on |enabled_color|. It can be disabled background,
// an disabled icon, etc.
static SkColor GetDisabledColor(SkColor enabled_color);
// Gets the color of second tone on the given |color_of_first_tone|. e.g,
// power status icon inside status area is a dual tone icon.
static SkColor GetSecondToneColor(SkColor color_of_first_tone);
static void RegisterProfilePrefs(PrefRegistrySimple* registry);
// SessionObserver:
void OnActiveUserPrefServiceChanged(PrefService* prefs) override;
SkColor GetShieldLayerColor(ShieldLayerType type) const;
SkColor GetBaseLayerColor(BaseLayerType type) const;
SkColor GetControlsLayerColor(ControlsLayerType type) const;
SkColor GetContentLayerColor(ContentLayerType type) const;
// Gets the attributes of ripple on |bg_color|. |bg_color| is the background
// color of the UI element that wants to show inkdrop. Applies the color from
// GetBackgroundColor if |bg_color| is not given. This means the background
// color of the UI element is from Shiled or Base layer. See
// GetShieldLayerColor and GetBaseLayerColor.
RippleAttributes GetRippleAttributes(
SkColor bg_color = gfx::kPlaceholderColor) const;
// Gets the background color that can be applied on any layer. The returned
// color will be different based on color mode and color theme (see
// |is_themed_|).
SkColor GetBackgroundColor() const;
// Helpers to style different types of buttons. Depending on the type may
// style text, icon and background colors for both enabled and disabled
// states. May overwrite an prior styles on |button|.
void DecoratePillButton(views::LabelButton* button,
const gfx::VectorIcon* icon);
void DecorateCloseButton(views::ImageButton* button,
int button_size,
const gfx::VectorIcon& icon);
void DecorateIconButton(views::ImageButton* button,
const gfx::VectorIcon& icon,
bool toggled,
int icon_size);
void DecorateFloatingIconButton(views::ImageButton* button,
const gfx::VectorIcon& icon);
void AddObserver(ColorModeObserver* observer);
void RemoveObserver(ColorModeObserver* observer);
// True if pref |kDarkModeEnabled| is true, which means the current color mode
// is dark.
bool IsDarkModeEnabled() const;
// Whether the system color mode is themed, by default is true. If true, the
// background color will be calculated based on extracted wallpaper color.
bool IsThemed() const;
// Toggles pref |kDarkModeEnabled|.
void ToggleColorMode();
// Updates pref |kColorModeThemed| to |is_themed|.
void UpdateColorModeThemed(bool is_themed);
// Gets the background base color for login screen.
SkColor GetLoginBackgroundBaseColor() const;
private:
friend class ScopedLightModeAsDefault;
// Gets the background default color.
SkColor GetBackgroundDefaultColor() const;
// Gets the background themed color that's calculated based on the color
// extracted from wallpaper. For dark mode, it will be dark muted wallpaper
// prominent color + SK_ColorBLACK 50%. For light mode, it will be light
// muted wallpaper prominent color + SK_ColorWHITE 75%.
SkColor GetBackgroundThemedColor() const;
// Notifies all the observers on |kDarkModeEnabled|'s change.
void NotifyDarkModeEnabledPrefChange();
// Notifies all the observers on |kColorModeThemed|'s change.
void NotifyColorModeThemedPrefChange();
// Default color mode is dark, which is controlled by pref |kDarkModeEnabled|
// currently. But we can also override it to light through
// ScopedLightModeAsDefault. This is done to help keeping some of the UI
// elements as light by default before launching dark/light mode. Overriding
// only if the kDarkLightMode feature is disabled. This variable will be
// removed once enabled dark/light mode.
bool override_light_mode_as_default_ = false;
base::ObserverList<ColorModeObserver> observers_;
std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_;
PrefService* active_user_pref_service_ = nullptr; // Not owned.
};
} // namespace ash
#endif // ASH_STYLE_ASH_COLOR_PROVIDER_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
64cfc9fb79f1d1f18f82d5fd9a07aeaf54159f55 | 18d6e76f0a4ecf8336a91dd5346185ed9e8b879e | /build-WFC-Desktop_Qt_5_9_1_clang_64bit-Debug/ui_mainwindow.h | 98147283a41a1c0434c04e8f67a2eee4968f5586 | [] | no_license | clach/WFC | 3fb321d2b217f3009e17d82e7fe2dd778599556a | 6850e8e682a50a59afed991516f8ef5722f1e771 | refs/heads/master | 2021-07-08T06:57:48.244816 | 2020-09-02T05:24:55 | 2020-09-02T05:24:55 | 172,017,206 | 4 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 11,004 | h | /********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
** Created by: Qt User Interface Compiler version 5.9.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QListWidget>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QRadioButton>
#include <QtWidgets/QSpinBox>
#include <QtWidgets/QWidget>
#include "mygl.h"
QT_BEGIN_NAMESPACE
class Ui_MainWindow
{
public:
QAction *actionQuit;
QAction *actionCamera_Controls;
QWidget *centralWidget;
MyGL *mygl;
QLabel *dimLabel;
QLabel *dimXLabel;
QLabel *dimYLabel;
QLabel *dimZLabel;
QSpinBox *dimX;
QSpinBox *dimY;
QSpinBox *dimZ;
QLabel *tilesetLabel;
QPushButton *runWFCButton;
QListWidget *tilesetList;
QPushButton *clearButton;
QLabel *tileLabel;
QListWidget *tileList;
QPushButton *clearNonUserTilesButton;
QLabel *boundaryConditionsLabel;
QLabel *errorLabel;
QRadioButton *periodicRadioButton;
QRadioButton *cleanRadioButton;
QRadioButton *noneRadioButton;
QCheckBox *buildModeCheckBox;
QCheckBox *showPreviewCheckBox;
QPushButton *runIterButton;
QMenuBar *menuBar;
QMenu *menuFile;
QMenu *menuHelp;
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QStringLiteral("MainWindow"));
MainWindow->resize(1087, 727);
actionQuit = new QAction(MainWindow);
actionQuit->setObjectName(QStringLiteral("actionQuit"));
actionCamera_Controls = new QAction(MainWindow);
actionCamera_Controls->setObjectName(QStringLiteral("actionCamera_Controls"));
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QStringLiteral("centralWidget"));
mygl = new MyGL(centralWidget);
mygl->setObjectName(QStringLiteral("mygl"));
mygl->setGeometry(QRect(11, 11, 711, 681));
mygl->setFocusPolicy(Qt::ClickFocus);
dimLabel = new QLabel(centralWidget);
dimLabel->setObjectName(QStringLiteral("dimLabel"));
dimLabel->setGeometry(QRect(750, 70, 81, 16));
dimXLabel = new QLabel(centralWidget);
dimXLabel->setObjectName(QStringLiteral("dimXLabel"));
dimXLabel->setGeometry(QRect(750, 90, 16, 16));
dimYLabel = new QLabel(centralWidget);
dimYLabel->setObjectName(QStringLiteral("dimYLabel"));
dimYLabel->setGeometry(QRect(750, 120, 16, 16));
dimZLabel = new QLabel(centralWidget);
dimZLabel->setObjectName(QStringLiteral("dimZLabel"));
dimZLabel->setGeometry(QRect(750, 150, 16, 16));
dimX = new QSpinBox(centralWidget);
dimX->setObjectName(QStringLiteral("dimX"));
dimX->setGeometry(QRect(770, 90, 48, 24));
dimX->setMinimum(1);
dimX->setMaximum(30);
dimX->setValue(2);
dimY = new QSpinBox(centralWidget);
dimY->setObjectName(QStringLiteral("dimY"));
dimY->setGeometry(QRect(770, 120, 48, 24));
dimY->setMinimum(1);
dimY->setMaximum(30);
dimY->setValue(2);
dimZ = new QSpinBox(centralWidget);
dimZ->setObjectName(QStringLiteral("dimZ"));
dimZ->setGeometry(QRect(770, 150, 48, 24));
dimZ->setMinimum(1);
dimZ->setMaximum(30);
dimZ->setValue(2);
tilesetLabel = new QLabel(centralWidget);
tilesetLabel->setObjectName(QStringLiteral("tilesetLabel"));
tilesetLabel->setGeometry(QRect(740, 220, 60, 16));
runWFCButton = new QPushButton(centralWidget);
runWFCButton->setObjectName(QStringLiteral("runWFCButton"));
runWFCButton->setGeometry(QRect(910, 580, 141, 32));
tilesetList = new QListWidget(centralWidget);
tilesetList->setObjectName(QStringLiteral("tilesetList"));
tilesetList->setGeometry(QRect(740, 240, 141, 121));
clearButton = new QPushButton(centralWidget);
clearButton->setObjectName(QStringLiteral("clearButton"));
clearButton->setEnabled(true);
clearButton->setGeometry(QRect(742, 580, 141, 32));
tileLabel = new QLabel(centralWidget);
tileLabel->setObjectName(QStringLiteral("tileLabel"));
tileLabel->setGeometry(QRect(740, 390, 60, 16));
tileList = new QListWidget(centralWidget);
tileList->setObjectName(QStringLiteral("tileList"));
tileList->setGeometry(QRect(740, 410, 141, 121));
clearNonUserTilesButton = new QPushButton(centralWidget);
clearNonUserTilesButton->setObjectName(QStringLiteral("clearNonUserTilesButton"));
clearNonUserTilesButton->setEnabled(true);
clearNonUserTilesButton->setGeometry(QRect(740, 620, 141, 32));
boundaryConditionsLabel = new QLabel(centralWidget);
boundaryConditionsLabel->setObjectName(QStringLiteral("boundaryConditionsLabel"));
boundaryConditionsLabel->setGeometry(QRect(900, 70, 131, 16));
errorLabel = new QLabel(centralWidget);
errorLabel->setObjectName(QStringLiteral("errorLabel"));
errorLabel->setGeometry(QRect(930, 670, 131, 16));
QPalette palette;
QBrush brush(QColor(252, 0, 9, 255));
brush.setStyle(Qt::SolidPattern);
palette.setBrush(QPalette::Active, QPalette::WindowText, brush);
QBrush brush1(QColor(252, 0, 6, 255));
brush1.setStyle(Qt::SolidPattern);
palette.setBrush(QPalette::Active, QPalette::Text, brush1);
palette.setBrush(QPalette::Inactive, QPalette::WindowText, brush);
palette.setBrush(QPalette::Inactive, QPalette::Text, brush1);
QBrush brush2(QColor(127, 127, 127, 255));
brush2.setStyle(Qt::SolidPattern);
palette.setBrush(QPalette::Disabled, QPalette::WindowText, brush2);
palette.setBrush(QPalette::Disabled, QPalette::Text, brush2);
errorLabel->setPalette(palette);
QFont font;
font.setBold(true);
font.setWeight(75);
errorLabel->setFont(font);
periodicRadioButton = new QRadioButton(centralWidget);
periodicRadioButton->setObjectName(QStringLiteral("periodicRadioButton"));
periodicRadioButton->setGeometry(QRect(910, 120, 100, 20));
cleanRadioButton = new QRadioButton(centralWidget);
cleanRadioButton->setObjectName(QStringLiteral("cleanRadioButton"));
cleanRadioButton->setGeometry(QRect(910, 90, 100, 20));
cleanRadioButton->setChecked(true);
noneRadioButton = new QRadioButton(centralWidget);
noneRadioButton->setObjectName(QStringLiteral("noneRadioButton"));
noneRadioButton->setGeometry(QRect(910, 150, 100, 20));
buildModeCheckBox = new QCheckBox(centralWidget);
buildModeCheckBox->setObjectName(QStringLiteral("buildModeCheckBox"));
buildModeCheckBox->setGeometry(QRect(740, 30, 101, 20));
showPreviewCheckBox = new QCheckBox(centralWidget);
showPreviewCheckBox->setObjectName(QStringLiteral("showPreviewCheckBox"));
showPreviewCheckBox->setGeometry(QRect(910, 180, 171, 20));
showPreviewCheckBox->setAutoFillBackground(false);
runIterButton = new QPushButton(centralWidget);
runIterButton->setObjectName(QStringLiteral("runIterButton"));
runIterButton->setGeometry(QRect(910, 620, 141, 32));
MainWindow->setCentralWidget(centralWidget);
menuBar = new QMenuBar(MainWindow);
menuBar->setObjectName(QStringLiteral("menuBar"));
menuBar->setGeometry(QRect(0, 0, 1087, 22));
menuFile = new QMenu(menuBar);
menuFile->setObjectName(QStringLiteral("menuFile"));
menuHelp = new QMenu(menuBar);
menuHelp->setObjectName(QStringLiteral("menuHelp"));
MainWindow->setMenuBar(menuBar);
menuBar->addAction(menuFile->menuAction());
menuBar->addAction(menuHelp->menuAction());
menuFile->addAction(actionQuit);
menuHelp->addAction(actionCamera_Controls);
retranslateUi(MainWindow);
QMetaObject::connectSlotsByName(MainWindow);
} // setupUi
void retranslateUi(QMainWindow *MainWindow)
{
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "OpenGLDemo", Q_NULLPTR));
actionQuit->setText(QApplication::translate("MainWindow", "Quit", Q_NULLPTR));
#ifndef QT_NO_SHORTCUT
actionQuit->setShortcut(QApplication::translate("MainWindow", "Ctrl+Q", Q_NULLPTR));
#endif // QT_NO_SHORTCUT
actionCamera_Controls->setText(QApplication::translate("MainWindow", "Camera Controls", Q_NULLPTR));
dimLabel->setText(QApplication::translate("MainWindow", "Dimensions", Q_NULLPTR));
dimXLabel->setText(QApplication::translate("MainWindow", "x", Q_NULLPTR));
dimYLabel->setText(QApplication::translate("MainWindow", "y", Q_NULLPTR));
dimZLabel->setText(QApplication::translate("MainWindow", "z", Q_NULLPTR));
tilesetLabel->setText(QApplication::translate("MainWindow", "Tileset", Q_NULLPTR));
runWFCButton->setText(QApplication::translate("MainWindow", "Run WFC", Q_NULLPTR));
clearButton->setText(QApplication::translate("MainWindow", "Clear", Q_NULLPTR));
tileLabel->setText(QApplication::translate("MainWindow", "Tiles", Q_NULLPTR));
clearNonUserTilesButton->setText(QApplication::translate("MainWindow", "Clear non-user tiles", Q_NULLPTR));
boundaryConditionsLabel->setText(QApplication::translate("MainWindow", "Boundary Conditions", Q_NULLPTR));
errorLabel->setText(QString());
periodicRadioButton->setText(QApplication::translate("MainWindow", "Periodic", Q_NULLPTR));
cleanRadioButton->setText(QApplication::translate("MainWindow", "Clean", Q_NULLPTR));
noneRadioButton->setText(QApplication::translate("MainWindow", "None", Q_NULLPTR));
buildModeCheckBox->setText(QApplication::translate("MainWindow", "Build mode", Q_NULLPTR));
showPreviewCheckBox->setText(QApplication::translate("MainWindow", "Repeat structure", Q_NULLPTR));
runIterButton->setText(QApplication::translate("MainWindow", "Run Iterative WFC", Q_NULLPTR));
menuFile->setTitle(QApplication::translate("MainWindow", "File", Q_NULLPTR));
menuHelp->setTitle(QApplication::translate("MainWindow", "Help", Q_NULLPTR));
} // retranslateUi
};
namespace Ui {
class MainWindow: public Ui_MainWindow {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MAINWINDOW_H
| [
"clach@seas.upenn.edu"
] | clach@seas.upenn.edu |
bc7fb8775aa7b250d9bc26255f350c81873ae23f | 09af8e25c6948e187bdf05f4f620ab5f2e7aeb71 | /examples/auto_future_graphics_design_delta/fbx_import/RCPtr.h | f3a2c510906127e89d28a1348aafbf42bef500e7 | [] | no_license | rlalance/my_imgui | 1a8d501758c25ac2bb8eff28d2cd7deb8720bbd0 | a74d712611aae0448bc68cb93aafe68b19727944 | refs/heads/master | 2022-07-21T18:27:50.762261 | 2019-01-10T07:53:43 | 2019-01-10T07:53:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,791 | h | #pragma once
#include "FBXImporterCommon.h"
#include <atomic>
namespace FBXImporterUnmanaged
{
#pragma warning( disable: 4251 )
typedef std::atomic_int32_t aint32;
class RCObject
{
aint32 counter;
protected:
virtual inline void deleteMethod( RCObject* object )
{
assert( counter == 0 );
delete object;
}
public:
RCObject() : counter( 0 ) {}
virtual ~RCObject() { assert( counter == 0 ); }
inline void addReference()
{
++counter;
}
inline void removeReference()
{
assert( counter > 0 );
--counter;
if( counter == 0 )
{
deleteMethod( this );
}
}
inline int getReferenceCount() { return counter; }
};
template<typename T>
class RCPtr
{
T* data;
public:
RCPtr()
: data( 0 )
{
}
RCPtr( T* p )
: data( p )
{
if( data )
{
data->addReference();
}
}
RCPtr( const RCPtr& other )
: data( other.data )
{
if( data )
{
data->addReference();
}
}
virtual ~RCPtr()
{
if( data )
{
data->removeReference();
}
}
RCPtr& operator=( T* p )
{
if( p )
{
p->addReference();
}
if( data )
{
data->removeReference();
}
data = p;
return *this;
}
RCPtr& operator=( const RCPtr& rhs )
{
return *this = rhs.data;
}
T* get() const
{
return data;
}
T* operator->( ) const { return data; }
T& operator*( ) const { return *data; }
operator T*( ) const { return data; }
operator bool() const { return data != 0; }
bool IsNull() const { return data == 0; }
static RCPtr<T> Null;
};
template<typename T>
RCPtr<T> RCPtr<T>::Null = RCPtr<T>();
template<typename T>
bool operator==( const RCPtr<T>& lhs, RCPtr<T>& rhs )
{
return lhs.get() == rhs.get();
}
template<typename T>
bool operator!=( const RCPtr<T>& lhs, RCPtr<T>& rhs )
{
return lhs.get() != rhs.get();
}
template<typename T>
bool operator==( const T* lhs, const RCPtr<T>& rhs )
{
return lhs == rhs.get();
}
template<typename T>
bool operator!=( const T* lhs, const RCPtr<T>& rhs )
{
return lhs != rhs.get();
}
template<typename T>
bool operator==( const RCPtr<T>& lhs, const T* rhs )
{
return lhs.get() == rhs;
}
template<typename T>
bool operator!=( const RCPtr<T>& lhs, const T* rhs )
{
return lhs.get() != rhs;
}
template<typename T, typename U>
RCPtr<T> DynamicCast( const RCPtr<U> p )
{
T* r = dynamic_cast<T*>( p.get() );
return r != 0 ? RCPtr<T>( r ) : RCPtr<T>();
}
template<typename T, typename U>
RCPtr<T> StaticCast( const RCPtr<U> p )
{
T* r = static_cast<T*>( p.get() );
return r != 0 ? RCPtr<T>( r ) : RCPtr<T>();
}
template<typename T, typename U>
RCPtr<T> ReinterpretCast( const RCPtr<U> p )
{
T* r = reinterpret_cast<T*>( p.get() );
return RCPtr<T>( r );
}
} | [
"zhangjiusheng@auto-future.com"
] | zhangjiusheng@auto-future.com |
e7bd93273ce07153f488e318d7f0f29d4b57a33b | 544a465731b44638ad61a4afa4f341aecf66f3cd | /src/libivk/utility/AbstractProgressListener.h | feeea624a7f26f8ca403afb8be13649257c26071 | [] | no_license | skempken/interverdikom | e13cbe592aa6dc5b67d8b2fbb4182bcb2b8bc15b | dde091ee71dc1d88bbedb5162771623f3ab8a6f4 | refs/heads/master | 2020-05-29T15:29:18.076702 | 2014-01-03T10:10:03 | 2014-01-03T10:10:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,007 | h | #ifndef ABSTRACTPROGRESSLISTENER_H_
#define ABSTRACTPROGRESSLISTENER_H_
#include <string>
namespace ivk
{
class AbstractProgressListener
{
protected:
AbstractProgressListener();
virtual ~AbstractProgressListener();
public:
/// Sets the text describing the current task.
/**
* \param text Text describing the current task.
*/
virtual void updateProgressText(const std::string &text) = 0;
/// Sets the number of steps required for the current task.
/**
* \param max Number of steps required for the current task.
*/
virtual void updateProgressMax(const int &max) = 0;
/// Sets the number of the current step of the current task.
/**
* \param value Number of the current step of the current task.
*/
virtual void updateProgressValue(const int &value) = 0;
/// Sets the number of seconds remaining for the current task.
/**
* \param value Number of seconds remaining.
*/
virtual void updateProgressETA(const int &eta) = 0;
};
}
#endif /*ABSTRACTPROGRESSLISTENER_H_*/
| [
"sebastian@ivk-virtualbox.(none)"
] | sebastian@ivk-virtualbox.(none) |
725105a264786dba34abb557969b46f2f74876f5 | 76171660651f1c680d5b5a380c07635de5b2367c | /SH6_76mps/0.09/p | 01eb80e3071706c38f24ec36e4a3ca63ab586882 | [] | no_license | lisegaAM/SH_Paper1 | 3cd0cac0d95cc60d296268e65e2dd6fed4cc6127 | 12ceadba5c58c563ccac236b965b4b917ac47551 | refs/heads/master | 2021-04-27T19:44:19.527187 | 2018-02-21T16:16:50 | 2018-02-21T16:16:50 | 122,360,661 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 162,713 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 3.0.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.09";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField nonuniform List<scalar>
13800
(
1.80342e+07
1.80341e+07
1.80338e+07
1.80335e+07
1.80332e+07
1.80329e+07
1.80326e+07
1.80322e+07
1.80318e+07
1.80314e+07
1.8031e+07
1.80305e+07
1.803e+07
1.80294e+07
1.80287e+07
1.80281e+07
1.80273e+07
1.80265e+07
1.80257e+07
1.80248e+07
1.80239e+07
1.80229e+07
1.80219e+07
1.8021e+07
1.802e+07
1.8019e+07
1.80181e+07
1.80172e+07
1.80163e+07
1.80155e+07
1.80148e+07
1.8014e+07
1.80134e+07
1.80128e+07
1.80122e+07
1.80117e+07
1.80112e+07
1.80108e+07
1.80105e+07
1.80101e+07
1.80099e+07
1.80096e+07
1.80094e+07
1.80092e+07
1.8009e+07
1.80089e+07
1.80088e+07
1.80087e+07
1.80086e+07
1.80085e+07
1.80085e+07
1.80084e+07
1.80084e+07
1.80083e+07
1.80083e+07
1.80083e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80082e+07
1.80082e+07
1.80083e+07
1.80083e+07
1.80084e+07
1.80086e+07
1.80087e+07
1.80089e+07
1.80092e+07
1.80094e+07
1.80098e+07
1.80102e+07
1.80107e+07
1.80113e+07
1.80119e+07
1.80126e+07
1.80135e+07
1.80144e+07
1.80154e+07
1.80164e+07
1.80176e+07
1.80188e+07
1.802e+07
1.80212e+07
1.80225e+07
1.80236e+07
1.80248e+07
1.80258e+07
1.80267e+07
1.80275e+07
1.80281e+07
1.80286e+07
1.80289e+07
1.80289e+07
1.80289e+07
1.80286e+07
1.80283e+07
1.80277e+07
1.80271e+07
1.80263e+07
1.80255e+07
1.80246e+07
1.80237e+07
1.80228e+07
1.80219e+07
1.80211e+07
1.80204e+07
1.80197e+07
1.80191e+07
1.80186e+07
1.80182e+07
1.80178e+07
1.80176e+07
1.80173e+07
1.80172e+07
1.8017e+07
1.80169e+07
1.80169e+07
1.80168e+07
1.80168e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80166e+07
1.80166e+07
1.80166e+07
1.80165e+07
1.80165e+07
1.80164e+07
1.80164e+07
1.80164e+07
1.80163e+07
1.80163e+07
1.80163e+07
1.80162e+07
1.80163e+07
1.80166e+07
1.80182e+07
1.80229e+07
1.80342e+07
1.80341e+07
1.80338e+07
1.80335e+07
1.80332e+07
1.80329e+07
1.80326e+07
1.80322e+07
1.80318e+07
1.80314e+07
1.8031e+07
1.80305e+07
1.803e+07
1.80294e+07
1.80287e+07
1.80281e+07
1.80273e+07
1.80265e+07
1.80257e+07
1.80248e+07
1.80239e+07
1.80229e+07
1.80219e+07
1.8021e+07
1.802e+07
1.8019e+07
1.80181e+07
1.80172e+07
1.80163e+07
1.80155e+07
1.80148e+07
1.8014e+07
1.80134e+07
1.80128e+07
1.80122e+07
1.80117e+07
1.80112e+07
1.80108e+07
1.80105e+07
1.80101e+07
1.80099e+07
1.80096e+07
1.80094e+07
1.80092e+07
1.8009e+07
1.80089e+07
1.80088e+07
1.80087e+07
1.80086e+07
1.80085e+07
1.80085e+07
1.80084e+07
1.80084e+07
1.80083e+07
1.80083e+07
1.80083e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80082e+07
1.80082e+07
1.80083e+07
1.80083e+07
1.80084e+07
1.80086e+07
1.80087e+07
1.80089e+07
1.80092e+07
1.80094e+07
1.80098e+07
1.80102e+07
1.80107e+07
1.80113e+07
1.80119e+07
1.80126e+07
1.80135e+07
1.80144e+07
1.80154e+07
1.80164e+07
1.80176e+07
1.80188e+07
1.802e+07
1.80212e+07
1.80225e+07
1.80236e+07
1.80248e+07
1.80258e+07
1.80267e+07
1.80275e+07
1.80281e+07
1.80286e+07
1.80289e+07
1.80289e+07
1.80289e+07
1.80286e+07
1.80283e+07
1.80277e+07
1.80271e+07
1.80263e+07
1.80255e+07
1.80246e+07
1.80237e+07
1.80228e+07
1.80219e+07
1.80211e+07
1.80204e+07
1.80197e+07
1.80191e+07
1.80186e+07
1.80182e+07
1.80178e+07
1.80176e+07
1.80173e+07
1.80172e+07
1.8017e+07
1.80169e+07
1.80169e+07
1.80168e+07
1.80168e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80166e+07
1.80166e+07
1.80166e+07
1.80165e+07
1.80165e+07
1.80164e+07
1.80164e+07
1.80164e+07
1.80163e+07
1.80163e+07
1.80163e+07
1.80162e+07
1.80163e+07
1.80166e+07
1.80181e+07
1.80228e+07
1.80342e+07
1.80341e+07
1.80338e+07
1.80335e+07
1.80332e+07
1.80329e+07
1.80326e+07
1.80322e+07
1.80318e+07
1.80314e+07
1.8031e+07
1.80305e+07
1.803e+07
1.80294e+07
1.80287e+07
1.80281e+07
1.80273e+07
1.80265e+07
1.80257e+07
1.80248e+07
1.80239e+07
1.80229e+07
1.80219e+07
1.8021e+07
1.802e+07
1.8019e+07
1.80181e+07
1.80172e+07
1.80163e+07
1.80155e+07
1.80148e+07
1.8014e+07
1.80134e+07
1.80128e+07
1.80122e+07
1.80117e+07
1.80112e+07
1.80108e+07
1.80105e+07
1.80101e+07
1.80099e+07
1.80096e+07
1.80094e+07
1.80092e+07
1.8009e+07
1.80089e+07
1.80088e+07
1.80087e+07
1.80086e+07
1.80085e+07
1.80085e+07
1.80084e+07
1.80084e+07
1.80083e+07
1.80083e+07
1.80083e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80082e+07
1.80082e+07
1.80083e+07
1.80083e+07
1.80084e+07
1.80086e+07
1.80087e+07
1.80089e+07
1.80092e+07
1.80094e+07
1.80098e+07
1.80102e+07
1.80107e+07
1.80113e+07
1.80119e+07
1.80126e+07
1.80135e+07
1.80144e+07
1.80154e+07
1.80164e+07
1.80176e+07
1.80188e+07
1.802e+07
1.80212e+07
1.80225e+07
1.80236e+07
1.80248e+07
1.80258e+07
1.80267e+07
1.80275e+07
1.80281e+07
1.80286e+07
1.80289e+07
1.80289e+07
1.80289e+07
1.80286e+07
1.80283e+07
1.80277e+07
1.80271e+07
1.80263e+07
1.80255e+07
1.80246e+07
1.80237e+07
1.80228e+07
1.80219e+07
1.80211e+07
1.80204e+07
1.80197e+07
1.80191e+07
1.80186e+07
1.80182e+07
1.80178e+07
1.80176e+07
1.80173e+07
1.80172e+07
1.8017e+07
1.80169e+07
1.80169e+07
1.80168e+07
1.80168e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80166e+07
1.80166e+07
1.80166e+07
1.80165e+07
1.80165e+07
1.80164e+07
1.80164e+07
1.80164e+07
1.80163e+07
1.80163e+07
1.80163e+07
1.80162e+07
1.80163e+07
1.80166e+07
1.80181e+07
1.80227e+07
1.80342e+07
1.80341e+07
1.80338e+07
1.80335e+07
1.80332e+07
1.80329e+07
1.80326e+07
1.80322e+07
1.80318e+07
1.80314e+07
1.8031e+07
1.80305e+07
1.803e+07
1.80294e+07
1.80287e+07
1.80281e+07
1.80273e+07
1.80265e+07
1.80257e+07
1.80248e+07
1.80239e+07
1.80229e+07
1.80219e+07
1.8021e+07
1.802e+07
1.8019e+07
1.80181e+07
1.80172e+07
1.80163e+07
1.80155e+07
1.80148e+07
1.8014e+07
1.80134e+07
1.80128e+07
1.80122e+07
1.80117e+07
1.80112e+07
1.80108e+07
1.80105e+07
1.80101e+07
1.80099e+07
1.80096e+07
1.80094e+07
1.80092e+07
1.8009e+07
1.80089e+07
1.80088e+07
1.80087e+07
1.80086e+07
1.80085e+07
1.80085e+07
1.80084e+07
1.80084e+07
1.80083e+07
1.80083e+07
1.80083e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80082e+07
1.80082e+07
1.80083e+07
1.80083e+07
1.80084e+07
1.80086e+07
1.80087e+07
1.80089e+07
1.80092e+07
1.80094e+07
1.80098e+07
1.80102e+07
1.80107e+07
1.80113e+07
1.80119e+07
1.80126e+07
1.80135e+07
1.80144e+07
1.80154e+07
1.80164e+07
1.80176e+07
1.80188e+07
1.802e+07
1.80212e+07
1.80225e+07
1.80236e+07
1.80248e+07
1.80258e+07
1.80267e+07
1.80275e+07
1.80281e+07
1.80286e+07
1.80289e+07
1.80289e+07
1.80289e+07
1.80286e+07
1.80283e+07
1.80277e+07
1.80271e+07
1.80263e+07
1.80255e+07
1.80246e+07
1.80237e+07
1.80228e+07
1.80219e+07
1.80211e+07
1.80204e+07
1.80197e+07
1.80191e+07
1.80186e+07
1.80182e+07
1.80178e+07
1.80176e+07
1.80173e+07
1.80172e+07
1.8017e+07
1.80169e+07
1.80169e+07
1.80168e+07
1.80168e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80166e+07
1.80166e+07
1.80166e+07
1.80165e+07
1.80165e+07
1.80164e+07
1.80164e+07
1.80164e+07
1.80163e+07
1.80163e+07
1.80163e+07
1.80162e+07
1.80163e+07
1.80165e+07
1.80179e+07
1.80218e+07
1.80342e+07
1.80341e+07
1.80338e+07
1.80335e+07
1.80332e+07
1.80329e+07
1.80326e+07
1.80322e+07
1.80318e+07
1.80314e+07
1.8031e+07
1.80305e+07
1.803e+07
1.80294e+07
1.80287e+07
1.80281e+07
1.80273e+07
1.80265e+07
1.80257e+07
1.80248e+07
1.80239e+07
1.80229e+07
1.80219e+07
1.8021e+07
1.802e+07
1.8019e+07
1.80181e+07
1.80172e+07
1.80163e+07
1.80155e+07
1.80148e+07
1.8014e+07
1.80134e+07
1.80128e+07
1.80122e+07
1.80117e+07
1.80112e+07
1.80108e+07
1.80105e+07
1.80101e+07
1.80099e+07
1.80096e+07
1.80094e+07
1.80092e+07
1.8009e+07
1.80089e+07
1.80088e+07
1.80087e+07
1.80086e+07
1.80085e+07
1.80085e+07
1.80084e+07
1.80084e+07
1.80083e+07
1.80083e+07
1.80083e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80082e+07
1.80082e+07
1.80083e+07
1.80083e+07
1.80084e+07
1.80086e+07
1.80087e+07
1.80089e+07
1.80092e+07
1.80094e+07
1.80098e+07
1.80102e+07
1.80107e+07
1.80113e+07
1.80119e+07
1.80126e+07
1.80135e+07
1.80144e+07
1.80154e+07
1.80164e+07
1.80176e+07
1.80188e+07
1.802e+07
1.80212e+07
1.80225e+07
1.80236e+07
1.80248e+07
1.80258e+07
1.80267e+07
1.80275e+07
1.80281e+07
1.80286e+07
1.80289e+07
1.80289e+07
1.80289e+07
1.80286e+07
1.80283e+07
1.80277e+07
1.80271e+07
1.80263e+07
1.80255e+07
1.80246e+07
1.80237e+07
1.80228e+07
1.80219e+07
1.80211e+07
1.80204e+07
1.80197e+07
1.80191e+07
1.80186e+07
1.80182e+07
1.80178e+07
1.80176e+07
1.80173e+07
1.80172e+07
1.8017e+07
1.80169e+07
1.80169e+07
1.80168e+07
1.80168e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80166e+07
1.80166e+07
1.80166e+07
1.80165e+07
1.80165e+07
1.80164e+07
1.80164e+07
1.80164e+07
1.80163e+07
1.80163e+07
1.80163e+07
1.80162e+07
1.80162e+07
1.80163e+07
1.80169e+07
1.80184e+07
1.80342e+07
1.80341e+07
1.80338e+07
1.80335e+07
1.80332e+07
1.80329e+07
1.80326e+07
1.80322e+07
1.80318e+07
1.80314e+07
1.8031e+07
1.80305e+07
1.803e+07
1.80294e+07
1.80287e+07
1.80281e+07
1.80273e+07
1.80265e+07
1.80257e+07
1.80248e+07
1.80239e+07
1.80229e+07
1.80219e+07
1.8021e+07
1.802e+07
1.8019e+07
1.80181e+07
1.80172e+07
1.80163e+07
1.80155e+07
1.80148e+07
1.8014e+07
1.80134e+07
1.80128e+07
1.80122e+07
1.80117e+07
1.80112e+07
1.80108e+07
1.80105e+07
1.80101e+07
1.80099e+07
1.80096e+07
1.80094e+07
1.80092e+07
1.8009e+07
1.80089e+07
1.80088e+07
1.80087e+07
1.80086e+07
1.80085e+07
1.80085e+07
1.80084e+07
1.80084e+07
1.80083e+07
1.80083e+07
1.80083e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80082e+07
1.80082e+07
1.80083e+07
1.80083e+07
1.80084e+07
1.80086e+07
1.80087e+07
1.80089e+07
1.80092e+07
1.80094e+07
1.80098e+07
1.80102e+07
1.80107e+07
1.80113e+07
1.80119e+07
1.80126e+07
1.80135e+07
1.80144e+07
1.80154e+07
1.80164e+07
1.80176e+07
1.80188e+07
1.802e+07
1.80212e+07
1.80225e+07
1.80236e+07
1.80248e+07
1.80258e+07
1.80267e+07
1.80275e+07
1.80281e+07
1.80286e+07
1.80289e+07
1.80289e+07
1.80289e+07
1.80286e+07
1.80283e+07
1.80277e+07
1.80271e+07
1.80263e+07
1.80255e+07
1.80246e+07
1.80237e+07
1.80228e+07
1.80219e+07
1.80211e+07
1.80204e+07
1.80197e+07
1.80191e+07
1.80186e+07
1.80182e+07
1.80178e+07
1.80176e+07
1.80173e+07
1.80172e+07
1.8017e+07
1.80169e+07
1.80169e+07
1.80168e+07
1.80168e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80166e+07
1.80166e+07
1.80166e+07
1.80165e+07
1.80165e+07
1.80164e+07
1.80164e+07
1.80164e+07
1.80163e+07
1.80163e+07
1.80163e+07
1.80162e+07
1.80162e+07
1.8016e+07
1.80156e+07
1.80139e+07
1.80342e+07
1.80341e+07
1.80338e+07
1.80335e+07
1.80332e+07
1.80329e+07
1.80326e+07
1.80322e+07
1.80318e+07
1.80314e+07
1.8031e+07
1.80305e+07
1.803e+07
1.80294e+07
1.80287e+07
1.80281e+07
1.80273e+07
1.80265e+07
1.80257e+07
1.80248e+07
1.80239e+07
1.80229e+07
1.80219e+07
1.8021e+07
1.802e+07
1.8019e+07
1.80181e+07
1.80172e+07
1.80163e+07
1.80155e+07
1.80148e+07
1.8014e+07
1.80134e+07
1.80128e+07
1.80122e+07
1.80117e+07
1.80112e+07
1.80108e+07
1.80105e+07
1.80101e+07
1.80099e+07
1.80096e+07
1.80094e+07
1.80092e+07
1.8009e+07
1.80089e+07
1.80088e+07
1.80087e+07
1.80086e+07
1.80085e+07
1.80085e+07
1.80084e+07
1.80084e+07
1.80083e+07
1.80083e+07
1.80083e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80082e+07
1.80082e+07
1.80083e+07
1.80083e+07
1.80084e+07
1.80086e+07
1.80087e+07
1.80089e+07
1.80092e+07
1.80094e+07
1.80098e+07
1.80102e+07
1.80107e+07
1.80113e+07
1.80119e+07
1.80126e+07
1.80135e+07
1.80144e+07
1.80154e+07
1.80164e+07
1.80176e+07
1.80188e+07
1.802e+07
1.80212e+07
1.80225e+07
1.80236e+07
1.80248e+07
1.80258e+07
1.80267e+07
1.80275e+07
1.80281e+07
1.80286e+07
1.80289e+07
1.80289e+07
1.80289e+07
1.80286e+07
1.80283e+07
1.80277e+07
1.80271e+07
1.80263e+07
1.80255e+07
1.80246e+07
1.80237e+07
1.80228e+07
1.80219e+07
1.80211e+07
1.80204e+07
1.80197e+07
1.80191e+07
1.80186e+07
1.80182e+07
1.80178e+07
1.80176e+07
1.80173e+07
1.80172e+07
1.8017e+07
1.80169e+07
1.80169e+07
1.80168e+07
1.80168e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80166e+07
1.80166e+07
1.80166e+07
1.80165e+07
1.80165e+07
1.80164e+07
1.80164e+07
1.80164e+07
1.80163e+07
1.80163e+07
1.80162e+07
1.80162e+07
1.80161e+07
1.80158e+07
1.80143e+07
1.80097e+07
1.80342e+07
1.80341e+07
1.80338e+07
1.80335e+07
1.80332e+07
1.80329e+07
1.80326e+07
1.80322e+07
1.80318e+07
1.80314e+07
1.8031e+07
1.80305e+07
1.803e+07
1.80294e+07
1.80287e+07
1.80281e+07
1.80273e+07
1.80265e+07
1.80257e+07
1.80248e+07
1.80239e+07
1.80229e+07
1.80219e+07
1.8021e+07
1.802e+07
1.8019e+07
1.80181e+07
1.80172e+07
1.80163e+07
1.80155e+07
1.80148e+07
1.8014e+07
1.80134e+07
1.80128e+07
1.80122e+07
1.80117e+07
1.80112e+07
1.80108e+07
1.80105e+07
1.80101e+07
1.80099e+07
1.80096e+07
1.80094e+07
1.80092e+07
1.8009e+07
1.80089e+07
1.80088e+07
1.80087e+07
1.80086e+07
1.80085e+07
1.80085e+07
1.80084e+07
1.80084e+07
1.80083e+07
1.80083e+07
1.80083e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80082e+07
1.80082e+07
1.80083e+07
1.80083e+07
1.80084e+07
1.80086e+07
1.80087e+07
1.80089e+07
1.80092e+07
1.80094e+07
1.80098e+07
1.80102e+07
1.80107e+07
1.80113e+07
1.80119e+07
1.80126e+07
1.80135e+07
1.80144e+07
1.80154e+07
1.80164e+07
1.80176e+07
1.80188e+07
1.802e+07
1.80212e+07
1.80225e+07
1.80236e+07
1.80248e+07
1.80258e+07
1.80267e+07
1.80275e+07
1.80281e+07
1.80286e+07
1.80289e+07
1.80289e+07
1.80289e+07
1.80286e+07
1.80283e+07
1.80277e+07
1.80271e+07
1.80263e+07
1.80255e+07
1.80246e+07
1.80237e+07
1.80228e+07
1.80219e+07
1.80211e+07
1.80204e+07
1.80197e+07
1.80191e+07
1.80186e+07
1.80182e+07
1.80178e+07
1.80176e+07
1.80173e+07
1.80172e+07
1.8017e+07
1.80169e+07
1.80169e+07
1.80168e+07
1.80168e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80166e+07
1.80166e+07
1.80166e+07
1.80165e+07
1.80165e+07
1.80164e+07
1.80164e+07
1.80164e+07
1.80163e+07
1.80163e+07
1.80162e+07
1.80162e+07
1.80161e+07
1.80157e+07
1.80139e+07
1.80089e+07
1.80342e+07
1.80341e+07
1.80338e+07
1.80335e+07
1.80332e+07
1.80329e+07
1.80326e+07
1.80322e+07
1.80318e+07
1.80314e+07
1.8031e+07
1.80305e+07
1.803e+07
1.80294e+07
1.80287e+07
1.80281e+07
1.80273e+07
1.80265e+07
1.80257e+07
1.80248e+07
1.80239e+07
1.80229e+07
1.80219e+07
1.8021e+07
1.802e+07
1.8019e+07
1.80181e+07
1.80172e+07
1.80163e+07
1.80155e+07
1.80148e+07
1.8014e+07
1.80134e+07
1.80128e+07
1.80122e+07
1.80117e+07
1.80112e+07
1.80108e+07
1.80105e+07
1.80101e+07
1.80099e+07
1.80096e+07
1.80094e+07
1.80092e+07
1.8009e+07
1.80089e+07
1.80088e+07
1.80087e+07
1.80086e+07
1.80085e+07
1.80085e+07
1.80084e+07
1.80084e+07
1.80083e+07
1.80083e+07
1.80083e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80082e+07
1.80082e+07
1.80083e+07
1.80083e+07
1.80084e+07
1.80086e+07
1.80087e+07
1.80089e+07
1.80092e+07
1.80094e+07
1.80098e+07
1.80102e+07
1.80107e+07
1.80113e+07
1.80119e+07
1.80126e+07
1.80135e+07
1.80144e+07
1.80154e+07
1.80164e+07
1.80176e+07
1.80188e+07
1.802e+07
1.80212e+07
1.80225e+07
1.80236e+07
1.80248e+07
1.80258e+07
1.80267e+07
1.80275e+07
1.80281e+07
1.80286e+07
1.80289e+07
1.80289e+07
1.80289e+07
1.80286e+07
1.80283e+07
1.80277e+07
1.80271e+07
1.80263e+07
1.80255e+07
1.80246e+07
1.80237e+07
1.80228e+07
1.80219e+07
1.80211e+07
1.80204e+07
1.80197e+07
1.80191e+07
1.80186e+07
1.80182e+07
1.80178e+07
1.80176e+07
1.80173e+07
1.80172e+07
1.8017e+07
1.80169e+07
1.80169e+07
1.80168e+07
1.80168e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80166e+07
1.80166e+07
1.80166e+07
1.80165e+07
1.80165e+07
1.80164e+07
1.80164e+07
1.80164e+07
1.80163e+07
1.80163e+07
1.80162e+07
1.80162e+07
1.80161e+07
1.80157e+07
1.80138e+07
1.80088e+07
1.80342e+07
1.80341e+07
1.80338e+07
1.80335e+07
1.80332e+07
1.80329e+07
1.80326e+07
1.80322e+07
1.80318e+07
1.80314e+07
1.8031e+07
1.80305e+07
1.803e+07
1.80294e+07
1.80287e+07
1.80281e+07
1.80273e+07
1.80265e+07
1.80257e+07
1.80248e+07
1.80239e+07
1.80229e+07
1.80219e+07
1.8021e+07
1.802e+07
1.8019e+07
1.80181e+07
1.80172e+07
1.80163e+07
1.80155e+07
1.80148e+07
1.8014e+07
1.80134e+07
1.80128e+07
1.80122e+07
1.80117e+07
1.80112e+07
1.80108e+07
1.80105e+07
1.80101e+07
1.80099e+07
1.80096e+07
1.80094e+07
1.80092e+07
1.8009e+07
1.80089e+07
1.80088e+07
1.80087e+07
1.80086e+07
1.80085e+07
1.80085e+07
1.80084e+07
1.80084e+07
1.80083e+07
1.80083e+07
1.80083e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80082e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.8008e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80081e+07
1.80082e+07
1.80082e+07
1.80083e+07
1.80083e+07
1.80084e+07
1.80086e+07
1.80087e+07
1.80089e+07
1.80092e+07
1.80094e+07
1.80098e+07
1.80102e+07
1.80107e+07
1.80113e+07
1.80119e+07
1.80126e+07
1.80135e+07
1.80144e+07
1.80154e+07
1.80164e+07
1.80176e+07
1.80188e+07
1.802e+07
1.80212e+07
1.80225e+07
1.80236e+07
1.80248e+07
1.80258e+07
1.80267e+07
1.80275e+07
1.80281e+07
1.80286e+07
1.80289e+07
1.80289e+07
1.80289e+07
1.80286e+07
1.80283e+07
1.80277e+07
1.80271e+07
1.80263e+07
1.80255e+07
1.80246e+07
1.80237e+07
1.80228e+07
1.80219e+07
1.80211e+07
1.80204e+07
1.80197e+07
1.80191e+07
1.80186e+07
1.80182e+07
1.80178e+07
1.80176e+07
1.80173e+07
1.80172e+07
1.8017e+07
1.80169e+07
1.80169e+07
1.80168e+07
1.80168e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80167e+07
1.80166e+07
1.80166e+07
1.80166e+07
1.80165e+07
1.80165e+07
1.80164e+07
1.80164e+07
1.80164e+07
1.80163e+07
1.80163e+07
1.80162e+07
1.80162e+07
1.80161e+07
1.80157e+07
1.80138e+07
1.80087e+07
1.8055e+07
1.80704e+07
1.8076e+07
1.8077e+07
1.8077e+07
1.8077e+07
1.80769e+07
1.80766e+07
1.80761e+07
1.80755e+07
1.80748e+07
1.80741e+07
1.80733e+07
1.80723e+07
1.8071e+07
1.80693e+07
1.8067e+07
1.80638e+07
1.80592e+07
1.80518e+07
1.80529e+07
1.80662e+07
1.80716e+07
1.80725e+07
1.80726e+07
1.80726e+07
1.80725e+07
1.80722e+07
1.80717e+07
1.80711e+07
1.80704e+07
1.80697e+07
1.80689e+07
1.80679e+07
1.80666e+07
1.80649e+07
1.80626e+07
1.80594e+07
1.80548e+07
1.80475e+07
1.80509e+07
1.80643e+07
1.80705e+07
1.80719e+07
1.8072e+07
1.80721e+07
1.80721e+07
1.80717e+07
1.80712e+07
1.80706e+07
1.80699e+07
1.80692e+07
1.80683e+07
1.80672e+07
1.80659e+07
1.80641e+07
1.80616e+07
1.80581e+07
1.80531e+07
1.80454e+07
1.80426e+07
1.80501e+07
1.80525e+07
1.80524e+07
1.80519e+07
1.80517e+07
1.80514e+07
1.80509e+07
1.80503e+07
1.80498e+07
1.80492e+07
1.80486e+07
1.80478e+07
1.80469e+07
1.80456e+07
1.80441e+07
1.80421e+07
1.80392e+07
1.80349e+07
1.8029e+07
1.80297e+07
1.80348e+07
1.80387e+07
1.80414e+07
1.80434e+07
1.80446e+07
1.80451e+07
1.80452e+07
1.8045e+07
1.80446e+07
1.80439e+07
1.80429e+07
1.80414e+07
1.80398e+07
1.80379e+07
1.80355e+07
1.80325e+07
1.80293e+07
1.80257e+07
1.80216e+07
1.8007e+07
1.80033e+07
1.7999e+07
1.79948e+07
1.79909e+07
1.79878e+07
1.79855e+07
1.79838e+07
1.79825e+07
1.79815e+07
1.79809e+07
1.79806e+07
1.79808e+07
1.7981e+07
1.79812e+07
1.79816e+07
1.79822e+07
1.7983e+07
1.7984e+07
1.79856e+07
1.79815e+07
1.79736e+07
1.7971e+07
1.79714e+07
1.7972e+07
1.79721e+07
1.79721e+07
1.7972e+07
1.79718e+07
1.79714e+07
1.79707e+07
1.797e+07
1.79692e+07
1.79685e+07
1.79678e+07
1.79676e+07
1.79679e+07
1.79692e+07
1.7972e+07
1.79764e+07
1.79505e+07
1.79284e+07
1.79115e+07
1.79002e+07
1.78927e+07
1.7887e+07
1.78826e+07
1.78796e+07
1.78778e+07
1.78771e+07
1.78772e+07
1.7878e+07
1.78797e+07
1.78824e+07
1.78865e+07
1.78917e+07
1.78983e+07
1.79069e+07
1.79177e+07
1.7931e+07
1.79411e+07
1.79173e+07
1.79019e+07
1.78929e+07
1.78869e+07
1.78822e+07
1.78785e+07
1.78759e+07
1.78743e+07
1.78736e+07
1.78736e+07
1.78744e+07
1.78759e+07
1.78784e+07
1.7882e+07
1.78868e+07
1.78931e+07
1.79011e+07
1.79117e+07
1.79252e+07
1.79322e+07
1.7899e+07
1.78789e+07
1.78678e+07
1.78603e+07
1.78545e+07
1.78502e+07
1.78472e+07
1.78455e+07
1.78449e+07
1.78451e+07
1.78462e+07
1.78482e+07
1.78513e+07
1.78557e+07
1.78615e+07
1.78689e+07
1.78784e+07
1.78906e+07
1.79065e+07
1.80223e+07
1.80066e+07
1.80024e+07
1.80013e+07
1.8001e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80017e+07
1.8002e+07
1.80024e+07
1.80028e+07
1.80033e+07
1.80038e+07
1.80044e+07
1.80051e+07
1.80058e+07
1.80066e+07
1.80075e+07
1.80084e+07
1.80094e+07
1.80104e+07
1.80115e+07
1.80126e+07
1.80137e+07
1.80148e+07
1.80159e+07
1.80169e+07
1.80179e+07
1.80188e+07
1.80196e+07
1.80204e+07
1.8021e+07
1.80216e+07
1.80221e+07
1.80224e+07
1.80226e+07
1.80228e+07
1.80228e+07
1.80227e+07
1.80225e+07
1.80222e+07
1.80217e+07
1.80212e+07
1.80206e+07
1.802e+07
1.80193e+07
1.80186e+07
1.80179e+07
1.80172e+07
1.80164e+07
1.80158e+07
1.80151e+07
1.80145e+07
1.80139e+07
1.80134e+07
1.8013e+07
1.80125e+07
1.80122e+07
1.80119e+07
1.80116e+07
1.80114e+07
1.80112e+07
1.80111e+07
1.8011e+07
1.80109e+07
1.80108e+07
1.80108e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80105e+07
1.80105e+07
1.80105e+07
1.80104e+07
1.80104e+07
1.80104e+07
1.80103e+07
1.80103e+07
1.80103e+07
1.80102e+07
1.80102e+07
1.80101e+07
1.80101e+07
1.801e+07
1.801e+07
1.801e+07
1.80099e+07
1.80099e+07
1.80099e+07
1.80098e+07
1.80098e+07
1.80098e+07
1.80097e+07
1.80097e+07
1.80097e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80092e+07
1.80086e+07
1.8006e+07
1.79989e+07
1.80209e+07
1.80063e+07
1.80022e+07
1.80012e+07
1.8001e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80017e+07
1.8002e+07
1.80024e+07
1.80028e+07
1.80033e+07
1.80038e+07
1.80044e+07
1.80051e+07
1.80058e+07
1.80066e+07
1.80075e+07
1.80084e+07
1.80094e+07
1.80104e+07
1.80115e+07
1.80126e+07
1.80137e+07
1.80148e+07
1.80159e+07
1.80169e+07
1.80179e+07
1.80188e+07
1.80197e+07
1.80204e+07
1.8021e+07
1.80216e+07
1.80221e+07
1.80224e+07
1.80226e+07
1.80228e+07
1.80228e+07
1.80227e+07
1.80225e+07
1.80222e+07
1.80217e+07
1.80212e+07
1.80206e+07
1.802e+07
1.80193e+07
1.80186e+07
1.80179e+07
1.80172e+07
1.80164e+07
1.80158e+07
1.80151e+07
1.80145e+07
1.80139e+07
1.80134e+07
1.8013e+07
1.80125e+07
1.80122e+07
1.80119e+07
1.80116e+07
1.80114e+07
1.80112e+07
1.80111e+07
1.8011e+07
1.80109e+07
1.80108e+07
1.80108e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80105e+07
1.80105e+07
1.80105e+07
1.80104e+07
1.80104e+07
1.80104e+07
1.80103e+07
1.80103e+07
1.80103e+07
1.80102e+07
1.80102e+07
1.80101e+07
1.80101e+07
1.801e+07
1.801e+07
1.801e+07
1.80099e+07
1.80099e+07
1.80099e+07
1.80098e+07
1.80098e+07
1.80098e+07
1.80097e+07
1.80097e+07
1.80097e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80092e+07
1.80086e+07
1.8006e+07
1.7999e+07
1.80212e+07
1.8007e+07
1.80026e+07
1.80014e+07
1.80011e+07
1.80011e+07
1.80012e+07
1.80014e+07
1.80017e+07
1.8002e+07
1.80024e+07
1.80028e+07
1.80033e+07
1.80038e+07
1.80044e+07
1.80051e+07
1.80058e+07
1.80066e+07
1.80075e+07
1.80084e+07
1.80094e+07
1.80104e+07
1.80115e+07
1.80126e+07
1.80137e+07
1.80148e+07
1.80159e+07
1.80169e+07
1.80179e+07
1.80188e+07
1.80196e+07
1.80204e+07
1.8021e+07
1.80216e+07
1.80221e+07
1.80224e+07
1.80226e+07
1.80228e+07
1.80228e+07
1.80227e+07
1.80225e+07
1.80222e+07
1.80217e+07
1.80212e+07
1.80206e+07
1.802e+07
1.80193e+07
1.80186e+07
1.80179e+07
1.80172e+07
1.80164e+07
1.80158e+07
1.80151e+07
1.80145e+07
1.80139e+07
1.80134e+07
1.8013e+07
1.80125e+07
1.80122e+07
1.80119e+07
1.80116e+07
1.80114e+07
1.80112e+07
1.80111e+07
1.8011e+07
1.80109e+07
1.80108e+07
1.80108e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80105e+07
1.80105e+07
1.80105e+07
1.80104e+07
1.80104e+07
1.80104e+07
1.80103e+07
1.80103e+07
1.80103e+07
1.80102e+07
1.80102e+07
1.80101e+07
1.80101e+07
1.801e+07
1.801e+07
1.801e+07
1.80099e+07
1.80099e+07
1.80099e+07
1.80098e+07
1.80098e+07
1.80098e+07
1.80097e+07
1.80097e+07
1.80097e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80092e+07
1.80086e+07
1.80061e+07
1.79992e+07
1.80122e+07
1.80024e+07
1.8e+07
1.8e+07
1.80004e+07
1.80008e+07
1.80011e+07
1.80014e+07
1.80017e+07
1.8002e+07
1.80024e+07
1.80028e+07
1.80033e+07
1.80038e+07
1.80044e+07
1.80051e+07
1.80058e+07
1.80066e+07
1.80074e+07
1.80084e+07
1.80093e+07
1.80103e+07
1.80114e+07
1.80125e+07
1.80136e+07
1.80147e+07
1.80158e+07
1.80169e+07
1.80179e+07
1.80188e+07
1.80196e+07
1.80204e+07
1.80211e+07
1.80216e+07
1.80221e+07
1.80224e+07
1.80227e+07
1.80228e+07
1.80228e+07
1.80227e+07
1.80225e+07
1.80222e+07
1.80217e+07
1.80212e+07
1.80206e+07
1.802e+07
1.80193e+07
1.80186e+07
1.80179e+07
1.80172e+07
1.80164e+07
1.80158e+07
1.80151e+07
1.80145e+07
1.80139e+07
1.80134e+07
1.8013e+07
1.80125e+07
1.80122e+07
1.80119e+07
1.80116e+07
1.80114e+07
1.80112e+07
1.80111e+07
1.8011e+07
1.80109e+07
1.80108e+07
1.80108e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80105e+07
1.80105e+07
1.80105e+07
1.80104e+07
1.80104e+07
1.80104e+07
1.80103e+07
1.80103e+07
1.80103e+07
1.80102e+07
1.80102e+07
1.80101e+07
1.80101e+07
1.801e+07
1.801e+07
1.801e+07
1.80099e+07
1.80099e+07
1.80099e+07
1.80098e+07
1.80098e+07
1.80098e+07
1.80097e+07
1.80097e+07
1.80097e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80092e+07
1.80087e+07
1.80067e+07
1.80006e+07
1.80117e+07
1.80079e+07
1.80055e+07
1.80034e+07
1.80021e+07
1.80016e+07
1.80015e+07
1.80016e+07
1.80018e+07
1.80021e+07
1.80024e+07
1.80028e+07
1.80033e+07
1.80038e+07
1.80044e+07
1.80051e+07
1.80058e+07
1.80066e+07
1.80075e+07
1.80084e+07
1.80094e+07
1.80104e+07
1.80115e+07
1.80126e+07
1.80137e+07
1.80148e+07
1.80159e+07
1.80169e+07
1.80179e+07
1.80188e+07
1.80196e+07
1.80204e+07
1.8021e+07
1.80216e+07
1.8022e+07
1.80224e+07
1.80226e+07
1.80227e+07
1.80227e+07
1.80227e+07
1.80225e+07
1.80221e+07
1.80217e+07
1.80212e+07
1.80206e+07
1.802e+07
1.80193e+07
1.80186e+07
1.80179e+07
1.80172e+07
1.80164e+07
1.80158e+07
1.80151e+07
1.80145e+07
1.80139e+07
1.80134e+07
1.8013e+07
1.80125e+07
1.80122e+07
1.80119e+07
1.80116e+07
1.80114e+07
1.80112e+07
1.80111e+07
1.8011e+07
1.80109e+07
1.80108e+07
1.80108e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80105e+07
1.80105e+07
1.80105e+07
1.80104e+07
1.80104e+07
1.80104e+07
1.80103e+07
1.80103e+07
1.80103e+07
1.80102e+07
1.80102e+07
1.80101e+07
1.80101e+07
1.801e+07
1.801e+07
1.801e+07
1.80099e+07
1.80099e+07
1.80099e+07
1.80098e+07
1.80098e+07
1.80098e+07
1.80097e+07
1.80097e+07
1.80097e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80092e+07
1.80086e+07
1.80064e+07
1.79892e+07
1.79934e+07
1.7996e+07
1.79982e+07
1.79996e+07
1.80004e+07
1.80009e+07
1.80013e+07
1.80017e+07
1.8002e+07
1.80024e+07
1.80028e+07
1.80033e+07
1.80038e+07
1.80044e+07
1.80051e+07
1.80058e+07
1.80066e+07
1.80075e+07
1.80084e+07
1.80094e+07
1.80104e+07
1.80115e+07
1.80125e+07
1.80137e+07
1.80148e+07
1.80158e+07
1.80169e+07
1.80179e+07
1.80188e+07
1.80197e+07
1.80204e+07
1.80211e+07
1.80217e+07
1.80221e+07
1.80224e+07
1.80227e+07
1.80228e+07
1.80228e+07
1.80227e+07
1.80225e+07
1.80222e+07
1.80217e+07
1.80212e+07
1.80206e+07
1.802e+07
1.80193e+07
1.80186e+07
1.80179e+07
1.80172e+07
1.80164e+07
1.80158e+07
1.80151e+07
1.80145e+07
1.80139e+07
1.80134e+07
1.8013e+07
1.80125e+07
1.80122e+07
1.80119e+07
1.80116e+07
1.80114e+07
1.80112e+07
1.80111e+07
1.8011e+07
1.80109e+07
1.80108e+07
1.80108e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80105e+07
1.80105e+07
1.80105e+07
1.80104e+07
1.80104e+07
1.80104e+07
1.80103e+07
1.80103e+07
1.80103e+07
1.80102e+07
1.80102e+07
1.80101e+07
1.80101e+07
1.801e+07
1.801e+07
1.801e+07
1.80099e+07
1.80099e+07
1.80099e+07
1.80098e+07
1.80098e+07
1.80098e+07
1.80097e+07
1.80097e+07
1.80097e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80095e+07
1.80095e+07
1.80098e+07
1.80106e+07
1.80126e+07
1.79926e+07
1.80014e+07
1.80026e+07
1.8002e+07
1.80015e+07
1.80014e+07
1.80014e+07
1.80016e+07
1.80018e+07
1.80021e+07
1.80024e+07
1.80028e+07
1.80033e+07
1.80038e+07
1.80044e+07
1.80051e+07
1.80059e+07
1.80067e+07
1.80076e+07
1.80085e+07
1.80095e+07
1.80105e+07
1.80116e+07
1.80127e+07
1.80138e+07
1.80148e+07
1.80159e+07
1.8017e+07
1.80179e+07
1.80189e+07
1.80197e+07
1.80204e+07
1.80211e+07
1.80216e+07
1.80221e+07
1.80224e+07
1.80226e+07
1.80228e+07
1.80228e+07
1.80227e+07
1.80225e+07
1.80221e+07
1.80217e+07
1.80212e+07
1.80206e+07
1.802e+07
1.80193e+07
1.80186e+07
1.80179e+07
1.80172e+07
1.80164e+07
1.80158e+07
1.80151e+07
1.80145e+07
1.80139e+07
1.80134e+07
1.8013e+07
1.80125e+07
1.80122e+07
1.80119e+07
1.80116e+07
1.80114e+07
1.80112e+07
1.80111e+07
1.8011e+07
1.80109e+07
1.80108e+07
1.80108e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80105e+07
1.80105e+07
1.80105e+07
1.80104e+07
1.80104e+07
1.80104e+07
1.80103e+07
1.80103e+07
1.80103e+07
1.80102e+07
1.80102e+07
1.80101e+07
1.80101e+07
1.801e+07
1.801e+07
1.801e+07
1.80099e+07
1.80099e+07
1.80099e+07
1.80098e+07
1.80098e+07
1.80098e+07
1.80097e+07
1.80097e+07
1.80097e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80095e+07
1.80095e+07
1.80097e+07
1.80102e+07
1.80121e+07
1.80172e+07
1.79765e+07
1.7994e+07
1.79987e+07
1.80003e+07
1.80009e+07
1.80011e+07
1.80013e+07
1.80015e+07
1.80018e+07
1.80021e+07
1.80024e+07
1.80028e+07
1.80033e+07
1.80038e+07
1.80044e+07
1.80051e+07
1.80059e+07
1.80067e+07
1.80076e+07
1.80085e+07
1.80095e+07
1.80105e+07
1.80116e+07
1.80127e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.8017e+07
1.8018e+07
1.80189e+07
1.80197e+07
1.80205e+07
1.80211e+07
1.80217e+07
1.80221e+07
1.80224e+07
1.80227e+07
1.80228e+07
1.80228e+07
1.80227e+07
1.80225e+07
1.80222e+07
1.80217e+07
1.80212e+07
1.80206e+07
1.802e+07
1.80193e+07
1.80186e+07
1.80179e+07
1.80172e+07
1.80164e+07
1.80158e+07
1.80151e+07
1.80145e+07
1.80139e+07
1.80134e+07
1.8013e+07
1.80125e+07
1.80122e+07
1.80119e+07
1.80116e+07
1.80114e+07
1.80112e+07
1.80111e+07
1.8011e+07
1.80109e+07
1.80108e+07
1.80108e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80105e+07
1.80105e+07
1.80105e+07
1.80104e+07
1.80104e+07
1.80104e+07
1.80103e+07
1.80103e+07
1.80103e+07
1.80102e+07
1.80102e+07
1.80101e+07
1.80101e+07
1.801e+07
1.801e+07
1.801e+07
1.80099e+07
1.80099e+07
1.80099e+07
1.80098e+07
1.80098e+07
1.80098e+07
1.80097e+07
1.80097e+07
1.80097e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80095e+07
1.80095e+07
1.80097e+07
1.80103e+07
1.80124e+07
1.80184e+07
1.79779e+07
1.79954e+07
1.79994e+07
1.80006e+07
1.8001e+07
1.80012e+07
1.80013e+07
1.80015e+07
1.80018e+07
1.80021e+07
1.80024e+07
1.80028e+07
1.80033e+07
1.80038e+07
1.80044e+07
1.80051e+07
1.80059e+07
1.80067e+07
1.80076e+07
1.80085e+07
1.80095e+07
1.80105e+07
1.80116e+07
1.80127e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.8017e+07
1.8018e+07
1.80189e+07
1.80197e+07
1.80205e+07
1.80211e+07
1.80217e+07
1.80221e+07
1.80224e+07
1.80227e+07
1.80228e+07
1.80228e+07
1.80227e+07
1.80225e+07
1.80222e+07
1.80217e+07
1.80212e+07
1.80206e+07
1.802e+07
1.80193e+07
1.80186e+07
1.80179e+07
1.80172e+07
1.80164e+07
1.80158e+07
1.80151e+07
1.80145e+07
1.80139e+07
1.80134e+07
1.8013e+07
1.80125e+07
1.80122e+07
1.80119e+07
1.80116e+07
1.80114e+07
1.80112e+07
1.80111e+07
1.8011e+07
1.80109e+07
1.80108e+07
1.80108e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80105e+07
1.80105e+07
1.80105e+07
1.80104e+07
1.80104e+07
1.80104e+07
1.80103e+07
1.80103e+07
1.80103e+07
1.80102e+07
1.80102e+07
1.80101e+07
1.80101e+07
1.801e+07
1.801e+07
1.801e+07
1.80099e+07
1.80099e+07
1.80099e+07
1.80098e+07
1.80098e+07
1.80098e+07
1.80097e+07
1.80097e+07
1.80097e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80095e+07
1.80095e+07
1.80097e+07
1.80103e+07
1.80125e+07
1.80186e+07
1.79748e+07
1.79947e+07
1.79991e+07
1.80005e+07
1.80009e+07
1.80011e+07
1.80013e+07
1.80015e+07
1.80018e+07
1.80021e+07
1.80024e+07
1.80028e+07
1.80033e+07
1.80038e+07
1.80044e+07
1.80051e+07
1.80059e+07
1.80067e+07
1.80076e+07
1.80085e+07
1.80095e+07
1.80105e+07
1.80116e+07
1.80127e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.8017e+07
1.8018e+07
1.80189e+07
1.80197e+07
1.80205e+07
1.80211e+07
1.80217e+07
1.80221e+07
1.80224e+07
1.80227e+07
1.80228e+07
1.80228e+07
1.80227e+07
1.80225e+07
1.80222e+07
1.80217e+07
1.80212e+07
1.80206e+07
1.802e+07
1.80193e+07
1.80186e+07
1.80179e+07
1.80172e+07
1.80164e+07
1.80158e+07
1.80151e+07
1.80145e+07
1.80139e+07
1.80134e+07
1.8013e+07
1.80125e+07
1.80122e+07
1.80119e+07
1.80116e+07
1.80114e+07
1.80112e+07
1.80111e+07
1.8011e+07
1.80109e+07
1.80108e+07
1.80108e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80107e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80106e+07
1.80105e+07
1.80105e+07
1.80105e+07
1.80104e+07
1.80104e+07
1.80104e+07
1.80103e+07
1.80103e+07
1.80103e+07
1.80102e+07
1.80102e+07
1.80101e+07
1.80101e+07
1.801e+07
1.801e+07
1.801e+07
1.80099e+07
1.80099e+07
1.80099e+07
1.80098e+07
1.80098e+07
1.80098e+07
1.80097e+07
1.80097e+07
1.80097e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80096e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80095e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80094e+07
1.80095e+07
1.80095e+07
1.80097e+07
1.80103e+07
1.80125e+07
1.80187e+07
1.79308e+07
1.78965e+07
1.78757e+07
1.78639e+07
1.78557e+07
1.78495e+07
1.78448e+07
1.78416e+07
1.78398e+07
1.7839e+07
1.78392e+07
1.78402e+07
1.78422e+07
1.78453e+07
1.78497e+07
1.78556e+07
1.78631e+07
1.78726e+07
1.7885e+07
1.79011e+07
1.7939e+07
1.79143e+07
1.78982e+07
1.78886e+07
1.7882e+07
1.78769e+07
1.7873e+07
1.78701e+07
1.78684e+07
1.78676e+07
1.78676e+07
1.78683e+07
1.78698e+07
1.78723e+07
1.78759e+07
1.78808e+07
1.78872e+07
1.78953e+07
1.7906e+07
1.79196e+07
1.79478e+07
1.79253e+07
1.79078e+07
1.7896e+07
1.78878e+07
1.78817e+07
1.78771e+07
1.78739e+07
1.7872e+07
1.78711e+07
1.78711e+07
1.7872e+07
1.78736e+07
1.78764e+07
1.78804e+07
1.78857e+07
1.78923e+07
1.79011e+07
1.7912e+07
1.79254e+07
1.79765e+07
1.79684e+07
1.79654e+07
1.79656e+07
1.79661e+07
1.79661e+07
1.7966e+07
1.79658e+07
1.79655e+07
1.7965e+07
1.79644e+07
1.79637e+07
1.79629e+07
1.79621e+07
1.79615e+07
1.79613e+07
1.79616e+07
1.7963e+07
1.79659e+07
1.79704e+07
1.80009e+07
1.79974e+07
1.79932e+07
1.79889e+07
1.79849e+07
1.79816e+07
1.79793e+07
1.79776e+07
1.79762e+07
1.79753e+07
1.79747e+07
1.79744e+07
1.79746e+07
1.79748e+07
1.79751e+07
1.79754e+07
1.79761e+07
1.79769e+07
1.7978e+07
1.79796e+07
1.80223e+07
1.80275e+07
1.80315e+07
1.80344e+07
1.80366e+07
1.80379e+07
1.80385e+07
1.80387e+07
1.80385e+07
1.80381e+07
1.80373e+07
1.80364e+07
1.8035e+07
1.80333e+07
1.80314e+07
1.80291e+07
1.80262e+07
1.80229e+07
1.80194e+07
1.80153e+07
1.8035e+07
1.80426e+07
1.80453e+07
1.80454e+07
1.80451e+07
1.80449e+07
1.80447e+07
1.80443e+07
1.80438e+07
1.80432e+07
1.80427e+07
1.80421e+07
1.80413e+07
1.80404e+07
1.80392e+07
1.80377e+07
1.80357e+07
1.80328e+07
1.80286e+07
1.80228e+07
1.80429e+07
1.80566e+07
1.80631e+07
1.80648e+07
1.80651e+07
1.80653e+07
1.80653e+07
1.8065e+07
1.80645e+07
1.80639e+07
1.80633e+07
1.80625e+07
1.80617e+07
1.80606e+07
1.80593e+07
1.80575e+07
1.8055e+07
1.80516e+07
1.80466e+07
1.8039e+07
1.80449e+07
1.80584e+07
1.80641e+07
1.80654e+07
1.80656e+07
1.80657e+07
1.80657e+07
1.80654e+07
1.80649e+07
1.80644e+07
1.80638e+07
1.80631e+07
1.80623e+07
1.80613e+07
1.806e+07
1.80584e+07
1.80561e+07
1.80529e+07
1.80483e+07
1.80411e+07
1.80471e+07
1.80627e+07
1.80686e+07
1.80699e+07
1.807e+07
1.80701e+07
1.80701e+07
1.80698e+07
1.80693e+07
1.80687e+07
1.80681e+07
1.80674e+07
1.80666e+07
1.80656e+07
1.80643e+07
1.80627e+07
1.80604e+07
1.80573e+07
1.80527e+07
1.80453e+07
1.79684e+07
1.79884e+07
1.79929e+07
1.79944e+07
1.79949e+07
1.79951e+07
1.79953e+07
1.79955e+07
1.79957e+07
1.7996e+07
1.79964e+07
1.79968e+07
1.79972e+07
1.79978e+07
1.79983e+07
1.7999e+07
1.79997e+07
1.80005e+07
1.80013e+07
1.80022e+07
1.80032e+07
1.80042e+07
1.80052e+07
1.80063e+07
1.80074e+07
1.80085e+07
1.80096e+07
1.80106e+07
1.80116e+07
1.80126e+07
1.80135e+07
1.80143e+07
1.8015e+07
1.80156e+07
1.80161e+07
1.80165e+07
1.80168e+07
1.8017e+07
1.80171e+07
1.80171e+07
1.80169e+07
1.80167e+07
1.80164e+07
1.80159e+07
1.80154e+07
1.80148e+07
1.80141e+07
1.80134e+07
1.80126e+07
1.80119e+07
1.80111e+07
1.80104e+07
1.80097e+07
1.8009e+07
1.80083e+07
1.80077e+07
1.80072e+07
1.80067e+07
1.80063e+07
1.80059e+07
1.80056e+07
1.80053e+07
1.80051e+07
1.80049e+07
1.80048e+07
1.80047e+07
1.80046e+07
1.80045e+07
1.80045e+07
1.80045e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80043e+07
1.80043e+07
1.80043e+07
1.80042e+07
1.80042e+07
1.80041e+07
1.80041e+07
1.8004e+07
1.8004e+07
1.80039e+07
1.80039e+07
1.80038e+07
1.80038e+07
1.80037e+07
1.80036e+07
1.80036e+07
1.80035e+07
1.80035e+07
1.80034e+07
1.80033e+07
1.8003e+07
1.80022e+07
1.79995e+07
1.79921e+07
1.79715e+07
1.79891e+07
1.79932e+07
1.79945e+07
1.79949e+07
1.79951e+07
1.79953e+07
1.79955e+07
1.79957e+07
1.7996e+07
1.79964e+07
1.79968e+07
1.79972e+07
1.79978e+07
1.79983e+07
1.7999e+07
1.79997e+07
1.80005e+07
1.80013e+07
1.80022e+07
1.80032e+07
1.80042e+07
1.80052e+07
1.80063e+07
1.80074e+07
1.80085e+07
1.80096e+07
1.80106e+07
1.80116e+07
1.80126e+07
1.80135e+07
1.80143e+07
1.8015e+07
1.80156e+07
1.80161e+07
1.80165e+07
1.80168e+07
1.8017e+07
1.80171e+07
1.80171e+07
1.80169e+07
1.80167e+07
1.80164e+07
1.80159e+07
1.80154e+07
1.80148e+07
1.80141e+07
1.80134e+07
1.80126e+07
1.80119e+07
1.80111e+07
1.80104e+07
1.80097e+07
1.8009e+07
1.80083e+07
1.80077e+07
1.80072e+07
1.80067e+07
1.80063e+07
1.80059e+07
1.80056e+07
1.80053e+07
1.80051e+07
1.80049e+07
1.80048e+07
1.80047e+07
1.80046e+07
1.80045e+07
1.80045e+07
1.80045e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80043e+07
1.80043e+07
1.80043e+07
1.80042e+07
1.80042e+07
1.80041e+07
1.80041e+07
1.8004e+07
1.8004e+07
1.80039e+07
1.80039e+07
1.80038e+07
1.80038e+07
1.80037e+07
1.80036e+07
1.80036e+07
1.80035e+07
1.80035e+07
1.80034e+07
1.80033e+07
1.8003e+07
1.80022e+07
1.79995e+07
1.79921e+07
1.79701e+07
1.79877e+07
1.79925e+07
1.79942e+07
1.79948e+07
1.7995e+07
1.79952e+07
1.79955e+07
1.79957e+07
1.7996e+07
1.79964e+07
1.79968e+07
1.79972e+07
1.79978e+07
1.79983e+07
1.7999e+07
1.79997e+07
1.80005e+07
1.80013e+07
1.80022e+07
1.80032e+07
1.80042e+07
1.80052e+07
1.80063e+07
1.80074e+07
1.80085e+07
1.80096e+07
1.80106e+07
1.80116e+07
1.80126e+07
1.80135e+07
1.80143e+07
1.8015e+07
1.80156e+07
1.80161e+07
1.80165e+07
1.80168e+07
1.8017e+07
1.80171e+07
1.80171e+07
1.80169e+07
1.80167e+07
1.80164e+07
1.80159e+07
1.80154e+07
1.80148e+07
1.80141e+07
1.80134e+07
1.80126e+07
1.80119e+07
1.80111e+07
1.80104e+07
1.80097e+07
1.8009e+07
1.80083e+07
1.80077e+07
1.80072e+07
1.80067e+07
1.80063e+07
1.80059e+07
1.80056e+07
1.80053e+07
1.80051e+07
1.80049e+07
1.80048e+07
1.80047e+07
1.80046e+07
1.80045e+07
1.80045e+07
1.80045e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80043e+07
1.80043e+07
1.80043e+07
1.80042e+07
1.80042e+07
1.80041e+07
1.80041e+07
1.8004e+07
1.8004e+07
1.80039e+07
1.80039e+07
1.80038e+07
1.80038e+07
1.80037e+07
1.80036e+07
1.80036e+07
1.80035e+07
1.80035e+07
1.80034e+07
1.80033e+07
1.8003e+07
1.80023e+07
1.79996e+07
1.79924e+07
1.79863e+07
1.79952e+07
1.79965e+07
1.79959e+07
1.79955e+07
1.79954e+07
1.79954e+07
1.79955e+07
1.79957e+07
1.7996e+07
1.79964e+07
1.79968e+07
1.79972e+07
1.79978e+07
1.79983e+07
1.7999e+07
1.79997e+07
1.80005e+07
1.80013e+07
1.80022e+07
1.80032e+07
1.80042e+07
1.80052e+07
1.80063e+07
1.80074e+07
1.80084e+07
1.80095e+07
1.80106e+07
1.80116e+07
1.80126e+07
1.80134e+07
1.80142e+07
1.8015e+07
1.80156e+07
1.80161e+07
1.80165e+07
1.80168e+07
1.8017e+07
1.80171e+07
1.80171e+07
1.80169e+07
1.80167e+07
1.80163e+07
1.80159e+07
1.80154e+07
1.80148e+07
1.80141e+07
1.80134e+07
1.80126e+07
1.80119e+07
1.80111e+07
1.80104e+07
1.80097e+07
1.8009e+07
1.80083e+07
1.80077e+07
1.80072e+07
1.80067e+07
1.80063e+07
1.80059e+07
1.80056e+07
1.80053e+07
1.80051e+07
1.80049e+07
1.80048e+07
1.80047e+07
1.80046e+07
1.80045e+07
1.80045e+07
1.80045e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80043e+07
1.80043e+07
1.80043e+07
1.80042e+07
1.80042e+07
1.80041e+07
1.80041e+07
1.8004e+07
1.8004e+07
1.80039e+07
1.80039e+07
1.80038e+07
1.80038e+07
1.80037e+07
1.80036e+07
1.80036e+07
1.80035e+07
1.80035e+07
1.80034e+07
1.80033e+07
1.80031e+07
1.80024e+07
1.80002e+07
1.79938e+07
1.79831e+07
1.79872e+07
1.79898e+07
1.7992e+07
1.79935e+07
1.79943e+07
1.79949e+07
1.79952e+07
1.79956e+07
1.7996e+07
1.79963e+07
1.79968e+07
1.79972e+07
1.79977e+07
1.79983e+07
1.79989e+07
1.79997e+07
1.80004e+07
1.80013e+07
1.80022e+07
1.80031e+07
1.80041e+07
1.80051e+07
1.80062e+07
1.80072e+07
1.80083e+07
1.80094e+07
1.80105e+07
1.80115e+07
1.80125e+07
1.80134e+07
1.80142e+07
1.8015e+07
1.80156e+07
1.80161e+07
1.80165e+07
1.80168e+07
1.8017e+07
1.80171e+07
1.80171e+07
1.80169e+07
1.80167e+07
1.80164e+07
1.80159e+07
1.80154e+07
1.80148e+07
1.80141e+07
1.80134e+07
1.80126e+07
1.80119e+07
1.80111e+07
1.80104e+07
1.80097e+07
1.8009e+07
1.80083e+07
1.80077e+07
1.80072e+07
1.80067e+07
1.80063e+07
1.80059e+07
1.80056e+07
1.80053e+07
1.80051e+07
1.80049e+07
1.80048e+07
1.80047e+07
1.80046e+07
1.80045e+07
1.80045e+07
1.80045e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80043e+07
1.80043e+07
1.80043e+07
1.80042e+07
1.80042e+07
1.80041e+07
1.80041e+07
1.8004e+07
1.8004e+07
1.80039e+07
1.80039e+07
1.80038e+07
1.80038e+07
1.80037e+07
1.80036e+07
1.80036e+07
1.80035e+07
1.80035e+07
1.80034e+07
1.80033e+07
1.80032e+07
1.80029e+07
1.80022e+07
1.79999e+07
1.80058e+07
1.80019e+07
1.79996e+07
1.79975e+07
1.79962e+07
1.79956e+07
1.79955e+07
1.79956e+07
1.79958e+07
1.7996e+07
1.79964e+07
1.79968e+07
1.79972e+07
1.79977e+07
1.79983e+07
1.79989e+07
1.79996e+07
1.80004e+07
1.80013e+07
1.80022e+07
1.80031e+07
1.80041e+07
1.80052e+07
1.80062e+07
1.80073e+07
1.80084e+07
1.80095e+07
1.80105e+07
1.80116e+07
1.80125e+07
1.80134e+07
1.80142e+07
1.80149e+07
1.80155e+07
1.8016e+07
1.80165e+07
1.80168e+07
1.8017e+07
1.80171e+07
1.8017e+07
1.80169e+07
1.80167e+07
1.80163e+07
1.80159e+07
1.80154e+07
1.80147e+07
1.80141e+07
1.80134e+07
1.80126e+07
1.80119e+07
1.80111e+07
1.80104e+07
1.80097e+07
1.8009e+07
1.80083e+07
1.80077e+07
1.80072e+07
1.80067e+07
1.80063e+07
1.80059e+07
1.80056e+07
1.80053e+07
1.80051e+07
1.80049e+07
1.80048e+07
1.80047e+07
1.80046e+07
1.80045e+07
1.80045e+07
1.80045e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80043e+07
1.80043e+07
1.80043e+07
1.80042e+07
1.80042e+07
1.80041e+07
1.80041e+07
1.8004e+07
1.8004e+07
1.80039e+07
1.80039e+07
1.80038e+07
1.80038e+07
1.80037e+07
1.80036e+07
1.80036e+07
1.80035e+07
1.80035e+07
1.80034e+07
1.80034e+07
1.80034e+07
1.80035e+07
1.80043e+07
1.80063e+07
1.80065e+07
1.79966e+07
1.7994e+07
1.79939e+07
1.79943e+07
1.79947e+07
1.7995e+07
1.79953e+07
1.79956e+07
1.7996e+07
1.79963e+07
1.79968e+07
1.79972e+07
1.79977e+07
1.79983e+07
1.79989e+07
1.79996e+07
1.80004e+07
1.80012e+07
1.80021e+07
1.8003e+07
1.8004e+07
1.8005e+07
1.80061e+07
1.80072e+07
1.80083e+07
1.80094e+07
1.80105e+07
1.80115e+07
1.80125e+07
1.80134e+07
1.80142e+07
1.80149e+07
1.80155e+07
1.80161e+07
1.80165e+07
1.80168e+07
1.8017e+07
1.80171e+07
1.80171e+07
1.80169e+07
1.80167e+07
1.80164e+07
1.80159e+07
1.80154e+07
1.80148e+07
1.80141e+07
1.80134e+07
1.80126e+07
1.80119e+07
1.80111e+07
1.80104e+07
1.80097e+07
1.8009e+07
1.80083e+07
1.80077e+07
1.80072e+07
1.80067e+07
1.80063e+07
1.80059e+07
1.80056e+07
1.80053e+07
1.80051e+07
1.80049e+07
1.80048e+07
1.80047e+07
1.80046e+07
1.80045e+07
1.80045e+07
1.80045e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80043e+07
1.80043e+07
1.80043e+07
1.80042e+07
1.80042e+07
1.80041e+07
1.80041e+07
1.8004e+07
1.8004e+07
1.80039e+07
1.80039e+07
1.80038e+07
1.80038e+07
1.80037e+07
1.80036e+07
1.80036e+07
1.80035e+07
1.80035e+07
1.80034e+07
1.80034e+07
1.80035e+07
1.8004e+07
1.80058e+07
1.8011e+07
1.80155e+07
1.80012e+07
1.79967e+07
1.79954e+07
1.7995e+07
1.7995e+07
1.79952e+07
1.79954e+07
1.79957e+07
1.7996e+07
1.79964e+07
1.79968e+07
1.79972e+07
1.79977e+07
1.79983e+07
1.79989e+07
1.79996e+07
1.80004e+07
1.80012e+07
1.80021e+07
1.80031e+07
1.80041e+07
1.80051e+07
1.80062e+07
1.80073e+07
1.80084e+07
1.80095e+07
1.80105e+07
1.80116e+07
1.80125e+07
1.80134e+07
1.80142e+07
1.80149e+07
1.80155e+07
1.80161e+07
1.80165e+07
1.80168e+07
1.8017e+07
1.80171e+07
1.80171e+07
1.80169e+07
1.80167e+07
1.80164e+07
1.80159e+07
1.80154e+07
1.80148e+07
1.80141e+07
1.80134e+07
1.80126e+07
1.80119e+07
1.80111e+07
1.80104e+07
1.80097e+07
1.8009e+07
1.80083e+07
1.80077e+07
1.80072e+07
1.80067e+07
1.80063e+07
1.80059e+07
1.80056e+07
1.80053e+07
1.80051e+07
1.80049e+07
1.80048e+07
1.80047e+07
1.80046e+07
1.80045e+07
1.80045e+07
1.80045e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80043e+07
1.80043e+07
1.80043e+07
1.80042e+07
1.80042e+07
1.80041e+07
1.80041e+07
1.8004e+07
1.8004e+07
1.80039e+07
1.80039e+07
1.80038e+07
1.80038e+07
1.80037e+07
1.80036e+07
1.80036e+07
1.80035e+07
1.80035e+07
1.80034e+07
1.80034e+07
1.80036e+07
1.80041e+07
1.80062e+07
1.80123e+07
1.80153e+07
1.80005e+07
1.79962e+07
1.79951e+07
1.79949e+07
1.7995e+07
1.79951e+07
1.79954e+07
1.79957e+07
1.7996e+07
1.79963e+07
1.79968e+07
1.79972e+07
1.79977e+07
1.79983e+07
1.79989e+07
1.79996e+07
1.80004e+07
1.80012e+07
1.80021e+07
1.80031e+07
1.80041e+07
1.80051e+07
1.80062e+07
1.80073e+07
1.80084e+07
1.80095e+07
1.80105e+07
1.80116e+07
1.80125e+07
1.80134e+07
1.80142e+07
1.80149e+07
1.80155e+07
1.80161e+07
1.80165e+07
1.80168e+07
1.8017e+07
1.80171e+07
1.80171e+07
1.80169e+07
1.80167e+07
1.80164e+07
1.80159e+07
1.80154e+07
1.80148e+07
1.80141e+07
1.80134e+07
1.80126e+07
1.80119e+07
1.80111e+07
1.80104e+07
1.80097e+07
1.8009e+07
1.80083e+07
1.80077e+07
1.80072e+07
1.80067e+07
1.80063e+07
1.80059e+07
1.80056e+07
1.80053e+07
1.80051e+07
1.80049e+07
1.80048e+07
1.80047e+07
1.80046e+07
1.80045e+07
1.80045e+07
1.80045e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80043e+07
1.80043e+07
1.80043e+07
1.80042e+07
1.80042e+07
1.80041e+07
1.80041e+07
1.8004e+07
1.8004e+07
1.80039e+07
1.80039e+07
1.80038e+07
1.80038e+07
1.80037e+07
1.80036e+07
1.80036e+07
1.80035e+07
1.80035e+07
1.80034e+07
1.80034e+07
1.80036e+07
1.80041e+07
1.80063e+07
1.80125e+07
1.80167e+07
1.80009e+07
1.79964e+07
1.79952e+07
1.79949e+07
1.7995e+07
1.79952e+07
1.79954e+07
1.79957e+07
1.7996e+07
1.79964e+07
1.79968e+07
1.79972e+07
1.79977e+07
1.79983e+07
1.79989e+07
1.79996e+07
1.80004e+07
1.80012e+07
1.80021e+07
1.80031e+07
1.80041e+07
1.80051e+07
1.80062e+07
1.80073e+07
1.80084e+07
1.80095e+07
1.80105e+07
1.80116e+07
1.80125e+07
1.80134e+07
1.80142e+07
1.80149e+07
1.80155e+07
1.80161e+07
1.80165e+07
1.80168e+07
1.8017e+07
1.80171e+07
1.80171e+07
1.80169e+07
1.80167e+07
1.80164e+07
1.80159e+07
1.80154e+07
1.80148e+07
1.80141e+07
1.80134e+07
1.80126e+07
1.80119e+07
1.80111e+07
1.80104e+07
1.80097e+07
1.8009e+07
1.80083e+07
1.80077e+07
1.80072e+07
1.80067e+07
1.80063e+07
1.80059e+07
1.80056e+07
1.80053e+07
1.80051e+07
1.80049e+07
1.80048e+07
1.80047e+07
1.80046e+07
1.80045e+07
1.80045e+07
1.80045e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80044e+07
1.80043e+07
1.80043e+07
1.80043e+07
1.80042e+07
1.80042e+07
1.80041e+07
1.80041e+07
1.8004e+07
1.8004e+07
1.80039e+07
1.80039e+07
1.80038e+07
1.80038e+07
1.80037e+07
1.80036e+07
1.80036e+07
1.80035e+07
1.80035e+07
1.80034e+07
1.80034e+07
1.80036e+07
1.80041e+07
1.80063e+07
1.80126e+07
1.79252e+07
1.7891e+07
1.78701e+07
1.78583e+07
1.78501e+07
1.78438e+07
1.78391e+07
1.78359e+07
1.7834e+07
1.78331e+07
1.78332e+07
1.78342e+07
1.78361e+07
1.78391e+07
1.78435e+07
1.78492e+07
1.78566e+07
1.78659e+07
1.78781e+07
1.78939e+07
1.79333e+07
1.79086e+07
1.78925e+07
1.78829e+07
1.78762e+07
1.78711e+07
1.78671e+07
1.78642e+07
1.78624e+07
1.78616e+07
1.78615e+07
1.78621e+07
1.78636e+07
1.7866e+07
1.78695e+07
1.78743e+07
1.78805e+07
1.78885e+07
1.7899e+07
1.79124e+07
1.7942e+07
1.79195e+07
1.79021e+07
1.78902e+07
1.78819e+07
1.78758e+07
1.78712e+07
1.78679e+07
1.7866e+07
1.78651e+07
1.7865e+07
1.78658e+07
1.78674e+07
1.787e+07
1.7874e+07
1.78791e+07
1.78856e+07
1.78943e+07
1.7905e+07
1.79182e+07
1.79704e+07
1.79623e+07
1.79592e+07
1.79593e+07
1.79598e+07
1.79597e+07
1.79595e+07
1.79593e+07
1.7959e+07
1.79585e+07
1.79578e+07
1.7957e+07
1.79562e+07
1.79554e+07
1.79547e+07
1.79544e+07
1.79547e+07
1.7956e+07
1.79588e+07
1.79632e+07
1.79945e+07
1.7991e+07
1.79868e+07
1.79825e+07
1.79784e+07
1.79752e+07
1.79728e+07
1.7971e+07
1.79697e+07
1.79687e+07
1.79681e+07
1.79678e+07
1.79678e+07
1.7968e+07
1.79682e+07
1.79685e+07
1.79691e+07
1.79699e+07
1.79709e+07
1.79724e+07
1.80157e+07
1.80208e+07
1.80247e+07
1.80277e+07
1.80298e+07
1.80311e+07
1.80317e+07
1.80318e+07
1.80316e+07
1.80311e+07
1.80303e+07
1.80292e+07
1.80279e+07
1.80262e+07
1.80242e+07
1.80218e+07
1.80189e+07
1.80157e+07
1.80121e+07
1.8008e+07
1.80282e+07
1.80358e+07
1.80385e+07
1.80385e+07
1.80382e+07
1.80381e+07
1.80378e+07
1.80374e+07
1.80368e+07
1.80362e+07
1.80356e+07
1.8035e+07
1.80342e+07
1.80333e+07
1.8032e+07
1.80304e+07
1.80284e+07
1.80255e+07
1.80213e+07
1.80154e+07
1.80361e+07
1.80497e+07
1.80562e+07
1.80579e+07
1.80582e+07
1.80583e+07
1.80583e+07
1.80579e+07
1.80574e+07
1.80568e+07
1.80561e+07
1.80553e+07
1.80544e+07
1.80533e+07
1.80519e+07
1.80501e+07
1.80476e+07
1.80441e+07
1.80392e+07
1.80315e+07
1.80381e+07
1.80515e+07
1.80572e+07
1.80585e+07
1.80587e+07
1.80588e+07
1.80587e+07
1.80584e+07
1.80579e+07
1.80573e+07
1.80566e+07
1.80559e+07
1.8055e+07
1.8054e+07
1.80527e+07
1.8051e+07
1.80487e+07
1.80454e+07
1.80408e+07
1.80336e+07
1.80403e+07
1.80558e+07
1.80617e+07
1.80629e+07
1.80631e+07
1.80631e+07
1.80631e+07
1.80627e+07
1.80622e+07
1.80616e+07
1.80609e+07
1.80602e+07
1.80593e+07
1.80583e+07
1.8057e+07
1.80553e+07
1.8053e+07
1.80498e+07
1.80452e+07
1.80378e+07
1.79619e+07
1.7981e+07
1.79849e+07
1.79859e+07
1.79859e+07
1.79856e+07
1.79851e+07
1.79847e+07
1.79842e+07
1.79837e+07
1.79832e+07
1.79827e+07
1.79822e+07
1.79817e+07
1.79812e+07
1.79807e+07
1.79802e+07
1.79797e+07
1.79793e+07
1.79789e+07
1.79785e+07
1.79782e+07
1.7978e+07
1.79778e+07
1.79776e+07
1.79775e+07
1.79775e+07
1.79776e+07
1.79777e+07
1.79778e+07
1.7978e+07
1.79783e+07
1.79786e+07
1.7979e+07
1.79795e+07
1.798e+07
1.79806e+07
1.79812e+07
1.79819e+07
1.79825e+07
1.79832e+07
1.7984e+07
1.79847e+07
1.79854e+07
1.79861e+07
1.79868e+07
1.79875e+07
1.79881e+07
1.79888e+07
1.79894e+07
1.799e+07
1.79905e+07
1.7991e+07
1.79915e+07
1.7992e+07
1.79924e+07
1.79929e+07
1.79932e+07
1.79936e+07
1.79939e+07
1.79942e+07
1.79944e+07
1.79947e+07
1.79949e+07
1.79951e+07
1.79952e+07
1.79954e+07
1.79955e+07
1.79956e+07
1.79957e+07
1.79958e+07
1.79959e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79956e+07
1.79956e+07
1.79956e+07
1.79955e+07
1.79955e+07
1.79955e+07
1.79956e+07
1.79962e+07
1.79983e+07
1.80044e+07
1.79649e+07
1.79817e+07
1.79852e+07
1.7986e+07
1.79859e+07
1.79856e+07
1.79852e+07
1.79847e+07
1.79842e+07
1.79837e+07
1.79832e+07
1.79827e+07
1.79822e+07
1.79817e+07
1.79812e+07
1.79807e+07
1.79802e+07
1.79797e+07
1.79793e+07
1.79789e+07
1.79785e+07
1.79782e+07
1.7978e+07
1.79778e+07
1.79776e+07
1.79775e+07
1.79775e+07
1.79776e+07
1.79777e+07
1.79778e+07
1.7978e+07
1.79783e+07
1.79786e+07
1.7979e+07
1.79795e+07
1.798e+07
1.79806e+07
1.79812e+07
1.79819e+07
1.79825e+07
1.79832e+07
1.7984e+07
1.79847e+07
1.79854e+07
1.79861e+07
1.79868e+07
1.79875e+07
1.79881e+07
1.79888e+07
1.79894e+07
1.799e+07
1.79905e+07
1.7991e+07
1.79915e+07
1.7992e+07
1.79924e+07
1.79929e+07
1.79932e+07
1.79936e+07
1.79939e+07
1.79942e+07
1.79944e+07
1.79947e+07
1.79949e+07
1.79951e+07
1.79952e+07
1.79954e+07
1.79955e+07
1.79956e+07
1.79957e+07
1.79958e+07
1.79959e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79956e+07
1.79956e+07
1.79956e+07
1.79955e+07
1.79955e+07
1.79955e+07
1.79956e+07
1.79962e+07
1.79982e+07
1.80043e+07
1.79635e+07
1.79803e+07
1.79845e+07
1.79857e+07
1.79858e+07
1.79855e+07
1.79851e+07
1.79847e+07
1.79842e+07
1.79837e+07
1.79832e+07
1.79827e+07
1.79822e+07
1.79817e+07
1.79812e+07
1.79807e+07
1.79802e+07
1.79797e+07
1.79793e+07
1.79789e+07
1.79785e+07
1.79782e+07
1.7978e+07
1.79778e+07
1.79776e+07
1.79775e+07
1.79775e+07
1.79776e+07
1.79777e+07
1.79778e+07
1.7978e+07
1.79783e+07
1.79786e+07
1.7979e+07
1.79795e+07
1.798e+07
1.79806e+07
1.79812e+07
1.79819e+07
1.79825e+07
1.79832e+07
1.7984e+07
1.79847e+07
1.79854e+07
1.79861e+07
1.79868e+07
1.79875e+07
1.79881e+07
1.79888e+07
1.79894e+07
1.799e+07
1.79905e+07
1.7991e+07
1.79915e+07
1.7992e+07
1.79924e+07
1.79929e+07
1.79932e+07
1.79936e+07
1.79939e+07
1.79942e+07
1.79944e+07
1.79947e+07
1.79949e+07
1.79951e+07
1.79952e+07
1.79954e+07
1.79955e+07
1.79956e+07
1.79957e+07
1.79958e+07
1.79959e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79956e+07
1.79956e+07
1.79956e+07
1.79955e+07
1.79955e+07
1.79955e+07
1.79956e+07
1.79962e+07
1.79982e+07
1.80041e+07
1.79793e+07
1.79876e+07
1.79883e+07
1.79873e+07
1.79865e+07
1.79858e+07
1.79853e+07
1.79848e+07
1.79843e+07
1.79838e+07
1.79832e+07
1.79827e+07
1.79822e+07
1.79817e+07
1.79812e+07
1.79806e+07
1.79802e+07
1.79797e+07
1.79793e+07
1.79789e+07
1.79785e+07
1.79782e+07
1.79779e+07
1.79777e+07
1.79776e+07
1.79775e+07
1.79775e+07
1.79775e+07
1.79776e+07
1.79778e+07
1.7978e+07
1.79783e+07
1.79786e+07
1.7979e+07
1.79795e+07
1.798e+07
1.79806e+07
1.79812e+07
1.79819e+07
1.79825e+07
1.79832e+07
1.7984e+07
1.79847e+07
1.79854e+07
1.79861e+07
1.79868e+07
1.79875e+07
1.79881e+07
1.79888e+07
1.79894e+07
1.799e+07
1.79905e+07
1.7991e+07
1.79915e+07
1.7992e+07
1.79924e+07
1.79929e+07
1.79932e+07
1.79936e+07
1.79939e+07
1.79942e+07
1.79944e+07
1.79947e+07
1.79949e+07
1.79951e+07
1.79952e+07
1.79954e+07
1.79955e+07
1.79956e+07
1.79957e+07
1.79958e+07
1.79959e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79956e+07
1.79956e+07
1.79956e+07
1.79955e+07
1.79955e+07
1.79955e+07
1.79956e+07
1.79961e+07
1.79978e+07
1.80029e+07
1.79759e+07
1.79797e+07
1.79819e+07
1.79836e+07
1.79846e+07
1.79849e+07
1.79848e+07
1.79845e+07
1.79841e+07
1.79837e+07
1.79832e+07
1.79827e+07
1.79822e+07
1.79816e+07
1.79811e+07
1.79806e+07
1.79801e+07
1.79796e+07
1.79792e+07
1.79788e+07
1.79784e+07
1.79781e+07
1.79778e+07
1.79776e+07
1.79775e+07
1.79774e+07
1.79774e+07
1.79775e+07
1.79776e+07
1.79777e+07
1.7978e+07
1.79783e+07
1.79786e+07
1.7979e+07
1.79795e+07
1.798e+07
1.79806e+07
1.79812e+07
1.79819e+07
1.79826e+07
1.79833e+07
1.7984e+07
1.79847e+07
1.79854e+07
1.79861e+07
1.79868e+07
1.79875e+07
1.79881e+07
1.79888e+07
1.79894e+07
1.799e+07
1.79905e+07
1.7991e+07
1.79915e+07
1.7992e+07
1.79924e+07
1.79929e+07
1.79932e+07
1.79936e+07
1.79939e+07
1.79942e+07
1.79944e+07
1.79947e+07
1.79949e+07
1.79951e+07
1.79952e+07
1.79954e+07
1.79955e+07
1.79956e+07
1.79957e+07
1.79958e+07
1.79959e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79956e+07
1.79956e+07
1.79956e+07
1.79955e+07
1.79955e+07
1.79955e+07
1.79955e+07
1.79956e+07
1.79963e+07
1.79983e+07
1.79982e+07
1.7994e+07
1.79913e+07
1.79888e+07
1.79871e+07
1.7986e+07
1.79854e+07
1.79848e+07
1.79843e+07
1.79838e+07
1.79832e+07
1.79827e+07
1.79822e+07
1.79817e+07
1.79811e+07
1.79806e+07
1.79801e+07
1.79796e+07
1.79792e+07
1.79788e+07
1.79785e+07
1.79781e+07
1.79779e+07
1.79777e+07
1.79775e+07
1.79775e+07
1.79774e+07
1.79775e+07
1.79776e+07
1.79777e+07
1.79779e+07
1.79782e+07
1.79785e+07
1.79789e+07
1.79794e+07
1.798e+07
1.79805e+07
1.79812e+07
1.79818e+07
1.79825e+07
1.79832e+07
1.7984e+07
1.79847e+07
1.79854e+07
1.79861e+07
1.79868e+07
1.79875e+07
1.79881e+07
1.79888e+07
1.79894e+07
1.799e+07
1.79905e+07
1.7991e+07
1.79915e+07
1.7992e+07
1.79924e+07
1.79929e+07
1.79932e+07
1.79936e+07
1.79939e+07
1.79942e+07
1.79944e+07
1.79947e+07
1.79949e+07
1.79951e+07
1.79952e+07
1.79954e+07
1.79955e+07
1.79956e+07
1.79957e+07
1.79958e+07
1.79959e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79956e+07
1.79956e+07
1.79956e+07
1.79955e+07
1.79955e+07
1.79954e+07
1.79953e+07
1.79951e+07
1.79944e+07
1.79921e+07
1.79987e+07
1.79887e+07
1.79859e+07
1.79855e+07
1.79854e+07
1.79852e+07
1.79849e+07
1.79846e+07
1.79842e+07
1.79837e+07
1.79832e+07
1.79827e+07
1.79822e+07
1.79816e+07
1.79811e+07
1.79806e+07
1.79801e+07
1.79796e+07
1.79791e+07
1.79787e+07
1.79784e+07
1.7978e+07
1.79778e+07
1.79776e+07
1.79775e+07
1.79774e+07
1.79774e+07
1.79774e+07
1.79775e+07
1.79777e+07
1.79779e+07
1.79782e+07
1.79786e+07
1.7979e+07
1.79795e+07
1.798e+07
1.79806e+07
1.79812e+07
1.79819e+07
1.79825e+07
1.79833e+07
1.7984e+07
1.79847e+07
1.79854e+07
1.79861e+07
1.79868e+07
1.79875e+07
1.79881e+07
1.79888e+07
1.79894e+07
1.799e+07
1.79905e+07
1.7991e+07
1.79915e+07
1.7992e+07
1.79924e+07
1.79929e+07
1.79932e+07
1.79936e+07
1.79939e+07
1.79942e+07
1.79944e+07
1.79947e+07
1.79949e+07
1.79951e+07
1.79952e+07
1.79954e+07
1.79955e+07
1.79956e+07
1.79957e+07
1.79958e+07
1.79959e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79956e+07
1.79956e+07
1.79956e+07
1.79955e+07
1.79955e+07
1.79954e+07
1.79952e+07
1.79946e+07
1.79925e+07
1.79862e+07
1.80074e+07
1.79931e+07
1.79884e+07
1.79868e+07
1.7986e+07
1.79855e+07
1.79851e+07
1.79846e+07
1.79842e+07
1.79837e+07
1.79832e+07
1.79827e+07
1.79822e+07
1.79816e+07
1.79811e+07
1.79806e+07
1.79801e+07
1.79796e+07
1.79792e+07
1.79788e+07
1.79784e+07
1.79781e+07
1.79778e+07
1.79776e+07
1.79775e+07
1.79774e+07
1.79774e+07
1.79775e+07
1.79776e+07
1.79777e+07
1.79779e+07
1.79782e+07
1.79785e+07
1.7979e+07
1.79795e+07
1.798e+07
1.79806e+07
1.79812e+07
1.79819e+07
1.79825e+07
1.79832e+07
1.7984e+07
1.79847e+07
1.79854e+07
1.79861e+07
1.79868e+07
1.79875e+07
1.79881e+07
1.79888e+07
1.79894e+07
1.799e+07
1.79905e+07
1.7991e+07
1.79915e+07
1.7992e+07
1.79924e+07
1.79929e+07
1.79932e+07
1.79936e+07
1.79939e+07
1.79942e+07
1.79944e+07
1.79947e+07
1.79949e+07
1.79951e+07
1.79952e+07
1.79954e+07
1.79955e+07
1.79956e+07
1.79957e+07
1.79958e+07
1.79959e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79956e+07
1.79956e+07
1.79956e+07
1.79955e+07
1.79955e+07
1.79954e+07
1.79951e+07
1.79944e+07
1.79919e+07
1.79848e+07
1.80072e+07
1.79924e+07
1.7988e+07
1.79866e+07
1.79859e+07
1.79854e+07
1.7985e+07
1.79846e+07
1.79842e+07
1.79837e+07
1.79832e+07
1.79827e+07
1.79822e+07
1.79816e+07
1.79811e+07
1.79806e+07
1.79801e+07
1.79796e+07
1.79792e+07
1.79788e+07
1.79784e+07
1.79781e+07
1.79778e+07
1.79776e+07
1.79775e+07
1.79774e+07
1.79774e+07
1.79775e+07
1.79776e+07
1.79777e+07
1.79779e+07
1.79782e+07
1.79785e+07
1.7979e+07
1.79795e+07
1.798e+07
1.79806e+07
1.79812e+07
1.79819e+07
1.79825e+07
1.79832e+07
1.7984e+07
1.79847e+07
1.79854e+07
1.79861e+07
1.79868e+07
1.79875e+07
1.79881e+07
1.79888e+07
1.79894e+07
1.799e+07
1.79905e+07
1.7991e+07
1.79915e+07
1.7992e+07
1.79924e+07
1.79929e+07
1.79932e+07
1.79936e+07
1.79939e+07
1.79942e+07
1.79944e+07
1.79947e+07
1.79949e+07
1.79951e+07
1.79952e+07
1.79954e+07
1.79955e+07
1.79956e+07
1.79957e+07
1.79958e+07
1.79959e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79956e+07
1.79956e+07
1.79956e+07
1.79955e+07
1.79955e+07
1.79954e+07
1.79951e+07
1.79944e+07
1.79918e+07
1.79846e+07
1.80086e+07
1.79928e+07
1.79882e+07
1.79867e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79846e+07
1.79842e+07
1.79837e+07
1.79832e+07
1.79827e+07
1.79822e+07
1.79816e+07
1.79811e+07
1.79806e+07
1.79801e+07
1.79796e+07
1.79792e+07
1.79788e+07
1.79784e+07
1.79781e+07
1.79778e+07
1.79776e+07
1.79775e+07
1.79774e+07
1.79774e+07
1.79775e+07
1.79776e+07
1.79777e+07
1.79779e+07
1.79782e+07
1.79785e+07
1.7979e+07
1.79795e+07
1.798e+07
1.79806e+07
1.79812e+07
1.79819e+07
1.79825e+07
1.79832e+07
1.7984e+07
1.79847e+07
1.79854e+07
1.79861e+07
1.79868e+07
1.79875e+07
1.79881e+07
1.79888e+07
1.79894e+07
1.799e+07
1.79905e+07
1.7991e+07
1.79915e+07
1.7992e+07
1.79924e+07
1.79929e+07
1.79932e+07
1.79936e+07
1.79939e+07
1.79942e+07
1.79944e+07
1.79947e+07
1.79949e+07
1.79951e+07
1.79952e+07
1.79954e+07
1.79955e+07
1.79956e+07
1.79957e+07
1.79958e+07
1.79959e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79963e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79962e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.79961e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.7996e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79959e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79958e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79957e+07
1.79956e+07
1.79956e+07
1.79956e+07
1.79955e+07
1.79955e+07
1.79954e+07
1.79951e+07
1.79944e+07
1.79918e+07
1.79846e+07
1.80327e+07
1.80483e+07
1.80542e+07
1.80554e+07
1.80556e+07
1.80556e+07
1.80555e+07
1.80552e+07
1.80546e+07
1.8054e+07
1.80534e+07
1.80526e+07
1.80518e+07
1.80507e+07
1.80495e+07
1.80478e+07
1.80456e+07
1.80425e+07
1.8038e+07
1.80308e+07
1.80305e+07
1.80441e+07
1.80497e+07
1.8051e+07
1.80511e+07
1.80512e+07
1.80511e+07
1.80508e+07
1.80503e+07
1.80497e+07
1.8049e+07
1.80483e+07
1.80474e+07
1.80464e+07
1.80452e+07
1.80435e+07
1.80412e+07
1.80381e+07
1.80336e+07
1.80266e+07
1.80286e+07
1.80422e+07
1.80487e+07
1.80504e+07
1.80506e+07
1.80507e+07
1.80507e+07
1.80504e+07
1.80498e+07
1.80492e+07
1.80485e+07
1.80477e+07
1.80468e+07
1.80458e+07
1.80444e+07
1.80426e+07
1.80402e+07
1.80368e+07
1.80319e+07
1.80245e+07
1.80206e+07
1.80282e+07
1.80309e+07
1.80309e+07
1.80306e+07
1.80304e+07
1.80301e+07
1.80297e+07
1.80291e+07
1.80285e+07
1.80279e+07
1.80273e+07
1.80265e+07
1.80256e+07
1.80244e+07
1.80228e+07
1.80209e+07
1.8018e+07
1.8014e+07
1.80083e+07
1.80079e+07
1.8013e+07
1.8017e+07
1.80199e+07
1.80221e+07
1.80234e+07
1.80239e+07
1.8024e+07
1.80238e+07
1.80233e+07
1.80226e+07
1.80216e+07
1.80202e+07
1.80185e+07
1.80166e+07
1.80143e+07
1.80114e+07
1.80082e+07
1.80047e+07
1.80008e+07
1.79865e+07
1.79829e+07
1.79788e+07
1.79744e+07
1.79703e+07
1.79671e+07
1.79647e+07
1.79629e+07
1.79615e+07
1.79605e+07
1.79599e+07
1.79596e+07
1.79596e+07
1.79598e+07
1.796e+07
1.79603e+07
1.79609e+07
1.79617e+07
1.79628e+07
1.79644e+07
1.79621e+07
1.7954e+07
1.79509e+07
1.7951e+07
1.79515e+07
1.79515e+07
1.79513e+07
1.79511e+07
1.79507e+07
1.79502e+07
1.79495e+07
1.79488e+07
1.79479e+07
1.79471e+07
1.79463e+07
1.7946e+07
1.79462e+07
1.79474e+07
1.795e+07
1.79542e+07
1.79333e+07
1.79108e+07
1.78933e+07
1.78814e+07
1.78732e+07
1.78671e+07
1.78624e+07
1.78591e+07
1.78571e+07
1.78562e+07
1.78561e+07
1.78568e+07
1.78583e+07
1.78608e+07
1.78646e+07
1.78695e+07
1.78757e+07
1.78838e+07
1.7894e+07
1.79066e+07
1.79245e+07
1.78998e+07
1.78837e+07
1.78741e+07
1.78674e+07
1.78622e+07
1.78582e+07
1.78554e+07
1.78536e+07
1.78527e+07
1.78525e+07
1.78531e+07
1.78544e+07
1.78567e+07
1.78601e+07
1.78646e+07
1.78705e+07
1.78781e+07
1.78879e+07
1.79006e+07
1.79164e+07
1.7882e+07
1.78611e+07
1.78493e+07
1.78411e+07
1.78348e+07
1.78301e+07
1.78269e+07
1.78249e+07
1.7824e+07
1.78241e+07
1.7825e+07
1.78268e+07
1.78297e+07
1.78338e+07
1.78392e+07
1.78463e+07
1.78552e+07
1.78666e+07
1.78813e+07
1.79965e+07
1.79828e+07
1.79796e+07
1.79783e+07
1.79776e+07
1.7977e+07
1.79764e+07
1.79758e+07
1.79752e+07
1.79745e+07
1.79738e+07
1.79732e+07
1.79725e+07
1.79719e+07
1.79713e+07
1.79708e+07
1.79704e+07
1.79701e+07
1.79699e+07
1.79698e+07
1.79697e+07
1.79698e+07
1.797e+07
1.79703e+07
1.79706e+07
1.79711e+07
1.79717e+07
1.79724e+07
1.79731e+07
1.79739e+07
1.79748e+07
1.79757e+07
1.79766e+07
1.79775e+07
1.79784e+07
1.79793e+07
1.79802e+07
1.7981e+07
1.79818e+07
1.79826e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79851e+07
1.79856e+07
1.7986e+07
1.79864e+07
1.79868e+07
1.79871e+07
1.79873e+07
1.79876e+07
1.79878e+07
1.79879e+07
1.79881e+07
1.79882e+07
1.79883e+07
1.79883e+07
1.79884e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79884e+07
1.79884e+07
1.79884e+07
1.79883e+07
1.79882e+07
1.79882e+07
1.7988e+07
1.79879e+07
1.79878e+07
1.79876e+07
1.79873e+07
1.79871e+07
1.79867e+07
1.79864e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79844e+07
1.79838e+07
1.79832e+07
1.79825e+07
1.79818e+07
1.79811e+07
1.79804e+07
1.79797e+07
1.79791e+07
1.79785e+07
1.79779e+07
1.79774e+07
1.7977e+07
1.79767e+07
1.79765e+07
1.79764e+07
1.79764e+07
1.79765e+07
1.79768e+07
1.79772e+07
1.79777e+07
1.79783e+07
1.79789e+07
1.79797e+07
1.79804e+07
1.79813e+07
1.79821e+07
1.7983e+07
1.79839e+07
1.79847e+07
1.79856e+07
1.79864e+07
1.79872e+07
1.7988e+07
1.79887e+07
1.79894e+07
1.799e+07
1.79906e+07
1.79911e+07
1.79915e+07
1.79919e+07
1.79923e+07
1.79926e+07
1.79929e+07
1.79932e+07
1.79934e+07
1.79936e+07
1.79937e+07
1.79938e+07
1.79939e+07
1.7994e+07
1.79941e+07
1.79942e+07
1.79942e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79941e+07
1.79941e+07
1.79941e+07
1.7994e+07
1.7994e+07
1.79939e+07
1.79938e+07
1.79938e+07
1.79936e+07
1.79935e+07
1.79933e+07
1.79931e+07
1.79928e+07
1.79925e+07
1.79922e+07
1.79917e+07
1.79913e+07
1.79908e+07
1.79902e+07
1.79896e+07
1.79889e+07
1.79883e+07
1.79876e+07
1.79868e+07
1.79861e+07
1.79854e+07
1.79848e+07
1.79841e+07
1.79836e+07
1.79831e+07
1.79827e+07
1.79824e+07
1.79821e+07
1.7982e+07
1.7982e+07
1.79822e+07
1.79824e+07
1.79828e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79852e+07
1.7986e+07
1.79868e+07
1.79877e+07
1.79885e+07
1.79894e+07
1.79903e+07
1.79911e+07
1.79919e+07
1.79927e+07
1.79935e+07
1.79942e+07
1.79949e+07
1.79955e+07
1.7996e+07
1.79966e+07
1.7997e+07
1.79974e+07
1.79978e+07
1.79981e+07
1.79984e+07
1.79987e+07
1.79989e+07
1.79991e+07
1.79992e+07
1.79994e+07
1.79995e+07
1.79996e+07
1.79997e+07
1.79997e+07
1.79998e+07
1.79998e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80002e+07
1.80002e+07
1.80002e+07
1.80003e+07
1.80004e+07
1.80004e+07
1.80005e+07
1.80006e+07
1.80007e+07
1.80009e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80016e+07
1.80019e+07
1.80022e+07
1.80025e+07
1.80028e+07
1.80032e+07
1.80036e+07
1.80041e+07
1.80046e+07
1.80051e+07
1.80057e+07
1.80063e+07
1.8007e+07
1.80077e+07
1.80084e+07
1.80092e+07
1.801e+07
1.80109e+07
1.80118e+07
1.80128e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.80171e+07
1.80183e+07
1.80196e+07
1.80208e+07
1.80222e+07
1.80236e+07
1.8025e+07
1.80265e+07
1.8028e+07
1.80296e+07
1.80312e+07
1.80329e+07
1.80346e+07
1.80364e+07
1.80382e+07
1.80401e+07
1.8042e+07
1.8044e+07
1.8046e+07
1.80481e+07
1.80502e+07
1.80523e+07
1.80545e+07
1.80568e+07
1.80591e+07
1.80615e+07
1.80639e+07
1.80663e+07
1.80688e+07
1.80714e+07
1.8074e+07
1.80767e+07
1.80794e+07
1.80821e+07
1.80849e+07
1.80878e+07
1.80907e+07
1.80936e+07
1.80966e+07
1.80997e+07
1.81028e+07
1.81059e+07
1.81091e+07
1.81124e+07
1.81157e+07
1.81191e+07
1.81225e+07
1.81259e+07
1.81294e+07
1.8133e+07
1.81366e+07
1.81402e+07
1.81439e+07
1.81477e+07
1.81515e+07
1.81553e+07
1.81592e+07
1.81632e+07
1.81672e+07
1.81712e+07
1.81753e+07
1.81794e+07
1.81836e+07
1.81879e+07
1.81922e+07
1.81965e+07
1.82009e+07
1.82053e+07
1.82098e+07
1.82144e+07
1.82189e+07
1.82236e+07
1.82282e+07
1.8233e+07
1.82377e+07
1.82426e+07
1.82474e+07
1.82523e+07
1.82573e+07
1.82623e+07
1.82674e+07
1.82725e+07
1.82776e+07
1.82828e+07
1.8288e+07
1.82933e+07
1.82987e+07
1.8304e+07
1.83094e+07
1.83149e+07
1.83204e+07
1.8326e+07
1.83316e+07
1.83372e+07
1.83429e+07
1.83486e+07
1.83544e+07
1.83602e+07
1.83661e+07
1.8372e+07
1.83779e+07
1.83839e+07
1.83899e+07
1.8396e+07
1.84021e+07
1.84083e+07
1.84145e+07
1.84207e+07
1.8427e+07
1.84333e+07
1.84396e+07
1.8446e+07
1.84525e+07
1.84589e+07
1.84654e+07
1.8472e+07
1.84786e+07
1.84852e+07
1.84919e+07
1.84986e+07
1.85053e+07
1.85121e+07
1.85189e+07
1.85257e+07
1.85326e+07
1.85395e+07
1.85464e+07
1.85534e+07
1.85604e+07
1.85675e+07
1.85746e+07
1.85817e+07
1.85889e+07
1.8596e+07
1.86033e+07
1.86105e+07
1.86178e+07
1.86251e+07
1.86324e+07
1.86398e+07
1.86472e+07
1.86546e+07
1.86621e+07
1.86696e+07
1.86771e+07
1.86846e+07
1.86922e+07
1.86998e+07
1.87074e+07
1.87151e+07
1.87228e+07
1.87305e+07
1.87382e+07
1.8746e+07
1.87538e+07
1.87616e+07
1.87694e+07
1.87772e+07
1.87851e+07
1.8793e+07
1.8801e+07
1.88089e+07
1.88169e+07
1.88249e+07
1.88329e+07
1.88409e+07
1.8849e+07
1.8857e+07
1.88651e+07
1.88732e+07
1.88814e+07
1.88895e+07
1.88977e+07
1.89059e+07
1.89141e+07
1.89223e+07
1.89305e+07
1.89388e+07
1.8947e+07
1.89553e+07
1.89636e+07
1.89719e+07
1.89802e+07
1.79954e+07
1.79826e+07
1.79795e+07
1.79783e+07
1.79776e+07
1.7977e+07
1.79764e+07
1.79758e+07
1.79752e+07
1.79745e+07
1.79738e+07
1.79732e+07
1.79725e+07
1.79719e+07
1.79713e+07
1.79708e+07
1.79704e+07
1.79701e+07
1.79699e+07
1.79698e+07
1.79697e+07
1.79698e+07
1.797e+07
1.79703e+07
1.79706e+07
1.79711e+07
1.79717e+07
1.79724e+07
1.79731e+07
1.79739e+07
1.79748e+07
1.79757e+07
1.79766e+07
1.79775e+07
1.79784e+07
1.79793e+07
1.79802e+07
1.7981e+07
1.79818e+07
1.79826e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79851e+07
1.79856e+07
1.7986e+07
1.79864e+07
1.79868e+07
1.79871e+07
1.79873e+07
1.79876e+07
1.79878e+07
1.79879e+07
1.79881e+07
1.79882e+07
1.79883e+07
1.79883e+07
1.79884e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79884e+07
1.79884e+07
1.79884e+07
1.79883e+07
1.79882e+07
1.79882e+07
1.7988e+07
1.79879e+07
1.79878e+07
1.79876e+07
1.79873e+07
1.79871e+07
1.79867e+07
1.79864e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79844e+07
1.79838e+07
1.79832e+07
1.79825e+07
1.79818e+07
1.79811e+07
1.79804e+07
1.79797e+07
1.79791e+07
1.79785e+07
1.79779e+07
1.79774e+07
1.7977e+07
1.79767e+07
1.79765e+07
1.79764e+07
1.79764e+07
1.79765e+07
1.79768e+07
1.79772e+07
1.79777e+07
1.79783e+07
1.79789e+07
1.79797e+07
1.79804e+07
1.79813e+07
1.79821e+07
1.7983e+07
1.79839e+07
1.79847e+07
1.79856e+07
1.79864e+07
1.79872e+07
1.7988e+07
1.79887e+07
1.79894e+07
1.799e+07
1.79906e+07
1.79911e+07
1.79915e+07
1.79919e+07
1.79923e+07
1.79926e+07
1.79929e+07
1.79932e+07
1.79934e+07
1.79936e+07
1.79937e+07
1.79938e+07
1.79939e+07
1.7994e+07
1.79941e+07
1.79942e+07
1.79942e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79941e+07
1.79941e+07
1.79941e+07
1.7994e+07
1.7994e+07
1.79939e+07
1.79938e+07
1.79938e+07
1.79936e+07
1.79935e+07
1.79933e+07
1.79931e+07
1.79928e+07
1.79925e+07
1.79922e+07
1.79917e+07
1.79913e+07
1.79908e+07
1.79902e+07
1.79896e+07
1.79889e+07
1.79883e+07
1.79876e+07
1.79868e+07
1.79861e+07
1.79854e+07
1.79848e+07
1.79841e+07
1.79836e+07
1.79831e+07
1.79827e+07
1.79824e+07
1.79821e+07
1.7982e+07
1.7982e+07
1.79822e+07
1.79824e+07
1.79828e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79852e+07
1.7986e+07
1.79868e+07
1.79877e+07
1.79885e+07
1.79894e+07
1.79903e+07
1.79911e+07
1.79919e+07
1.79927e+07
1.79935e+07
1.79942e+07
1.79949e+07
1.79955e+07
1.7996e+07
1.79966e+07
1.7997e+07
1.79974e+07
1.79978e+07
1.79981e+07
1.79984e+07
1.79987e+07
1.79989e+07
1.79991e+07
1.79992e+07
1.79994e+07
1.79995e+07
1.79996e+07
1.79997e+07
1.79997e+07
1.79998e+07
1.79998e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80002e+07
1.80002e+07
1.80002e+07
1.80003e+07
1.80004e+07
1.80004e+07
1.80005e+07
1.80006e+07
1.80007e+07
1.80009e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80016e+07
1.80019e+07
1.80022e+07
1.80025e+07
1.80028e+07
1.80032e+07
1.80036e+07
1.80041e+07
1.80046e+07
1.80051e+07
1.80057e+07
1.80063e+07
1.8007e+07
1.80077e+07
1.80084e+07
1.80092e+07
1.801e+07
1.80109e+07
1.80118e+07
1.80128e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.80171e+07
1.80183e+07
1.80196e+07
1.80208e+07
1.80222e+07
1.80236e+07
1.8025e+07
1.80265e+07
1.8028e+07
1.80296e+07
1.80312e+07
1.80329e+07
1.80346e+07
1.80364e+07
1.80382e+07
1.80401e+07
1.8042e+07
1.8044e+07
1.8046e+07
1.80481e+07
1.80502e+07
1.80523e+07
1.80545e+07
1.80568e+07
1.80591e+07
1.80615e+07
1.80639e+07
1.80663e+07
1.80688e+07
1.80714e+07
1.8074e+07
1.80767e+07
1.80794e+07
1.80821e+07
1.80849e+07
1.80878e+07
1.80907e+07
1.80936e+07
1.80966e+07
1.80997e+07
1.81028e+07
1.81059e+07
1.81091e+07
1.81124e+07
1.81157e+07
1.81191e+07
1.81225e+07
1.81259e+07
1.81294e+07
1.8133e+07
1.81366e+07
1.81402e+07
1.81439e+07
1.81477e+07
1.81515e+07
1.81553e+07
1.81592e+07
1.81632e+07
1.81672e+07
1.81712e+07
1.81753e+07
1.81794e+07
1.81836e+07
1.81879e+07
1.81922e+07
1.81965e+07
1.82009e+07
1.82053e+07
1.82098e+07
1.82144e+07
1.82189e+07
1.82236e+07
1.82282e+07
1.8233e+07
1.82377e+07
1.82426e+07
1.82474e+07
1.82523e+07
1.82573e+07
1.82623e+07
1.82674e+07
1.82725e+07
1.82776e+07
1.82828e+07
1.8288e+07
1.82933e+07
1.82987e+07
1.8304e+07
1.83094e+07
1.83149e+07
1.83204e+07
1.8326e+07
1.83316e+07
1.83372e+07
1.83429e+07
1.83486e+07
1.83544e+07
1.83602e+07
1.83661e+07
1.8372e+07
1.83779e+07
1.83839e+07
1.83899e+07
1.8396e+07
1.84021e+07
1.84083e+07
1.84145e+07
1.84207e+07
1.8427e+07
1.84333e+07
1.84396e+07
1.8446e+07
1.84525e+07
1.84589e+07
1.84654e+07
1.8472e+07
1.84786e+07
1.84852e+07
1.84919e+07
1.84986e+07
1.85053e+07
1.85121e+07
1.85189e+07
1.85257e+07
1.85326e+07
1.85395e+07
1.85464e+07
1.85534e+07
1.85604e+07
1.85675e+07
1.85746e+07
1.85817e+07
1.85889e+07
1.8596e+07
1.86033e+07
1.86105e+07
1.86178e+07
1.86251e+07
1.86324e+07
1.86398e+07
1.86472e+07
1.86546e+07
1.86621e+07
1.86696e+07
1.86771e+07
1.86846e+07
1.86922e+07
1.86998e+07
1.87074e+07
1.87151e+07
1.87228e+07
1.87305e+07
1.87382e+07
1.8746e+07
1.87538e+07
1.87616e+07
1.87694e+07
1.87772e+07
1.87851e+07
1.8793e+07
1.8801e+07
1.88089e+07
1.88169e+07
1.88249e+07
1.88329e+07
1.88409e+07
1.8849e+07
1.8857e+07
1.88651e+07
1.88732e+07
1.88814e+07
1.88895e+07
1.88977e+07
1.89059e+07
1.89141e+07
1.89223e+07
1.89305e+07
1.89388e+07
1.8947e+07
1.89553e+07
1.89636e+07
1.89719e+07
1.89802e+07
1.79957e+07
1.79831e+07
1.79798e+07
1.79784e+07
1.79776e+07
1.7977e+07
1.79764e+07
1.79758e+07
1.79752e+07
1.79745e+07
1.79738e+07
1.79732e+07
1.79725e+07
1.79719e+07
1.79713e+07
1.79708e+07
1.79704e+07
1.79701e+07
1.79699e+07
1.79698e+07
1.79697e+07
1.79698e+07
1.797e+07
1.79703e+07
1.79706e+07
1.79711e+07
1.79717e+07
1.79724e+07
1.79731e+07
1.79739e+07
1.79748e+07
1.79757e+07
1.79766e+07
1.79775e+07
1.79784e+07
1.79793e+07
1.79802e+07
1.7981e+07
1.79818e+07
1.79826e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79851e+07
1.79856e+07
1.7986e+07
1.79864e+07
1.79868e+07
1.79871e+07
1.79873e+07
1.79876e+07
1.79878e+07
1.79879e+07
1.79881e+07
1.79882e+07
1.79883e+07
1.79883e+07
1.79884e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79884e+07
1.79884e+07
1.79884e+07
1.79883e+07
1.79882e+07
1.79882e+07
1.7988e+07
1.79879e+07
1.79878e+07
1.79876e+07
1.79873e+07
1.79871e+07
1.79867e+07
1.79864e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79844e+07
1.79838e+07
1.79832e+07
1.79825e+07
1.79818e+07
1.79811e+07
1.79804e+07
1.79797e+07
1.79791e+07
1.79785e+07
1.79779e+07
1.79774e+07
1.7977e+07
1.79767e+07
1.79765e+07
1.79764e+07
1.79764e+07
1.79765e+07
1.79768e+07
1.79772e+07
1.79777e+07
1.79783e+07
1.79789e+07
1.79797e+07
1.79804e+07
1.79813e+07
1.79821e+07
1.7983e+07
1.79839e+07
1.79847e+07
1.79856e+07
1.79864e+07
1.79872e+07
1.7988e+07
1.79887e+07
1.79894e+07
1.799e+07
1.79906e+07
1.79911e+07
1.79915e+07
1.79919e+07
1.79923e+07
1.79926e+07
1.79929e+07
1.79932e+07
1.79934e+07
1.79936e+07
1.79937e+07
1.79938e+07
1.79939e+07
1.7994e+07
1.79941e+07
1.79942e+07
1.79942e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79941e+07
1.79941e+07
1.79941e+07
1.7994e+07
1.7994e+07
1.79939e+07
1.79938e+07
1.79938e+07
1.79936e+07
1.79935e+07
1.79933e+07
1.79931e+07
1.79928e+07
1.79925e+07
1.79922e+07
1.79917e+07
1.79913e+07
1.79908e+07
1.79902e+07
1.79896e+07
1.79889e+07
1.79883e+07
1.79876e+07
1.79868e+07
1.79861e+07
1.79854e+07
1.79848e+07
1.79841e+07
1.79836e+07
1.79831e+07
1.79827e+07
1.79824e+07
1.79821e+07
1.7982e+07
1.7982e+07
1.79822e+07
1.79824e+07
1.79828e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79852e+07
1.7986e+07
1.79868e+07
1.79877e+07
1.79885e+07
1.79894e+07
1.79903e+07
1.79911e+07
1.79919e+07
1.79927e+07
1.79935e+07
1.79942e+07
1.79949e+07
1.79955e+07
1.7996e+07
1.79966e+07
1.7997e+07
1.79974e+07
1.79978e+07
1.79981e+07
1.79984e+07
1.79987e+07
1.79989e+07
1.79991e+07
1.79992e+07
1.79994e+07
1.79995e+07
1.79996e+07
1.79997e+07
1.79997e+07
1.79998e+07
1.79998e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80002e+07
1.80002e+07
1.80002e+07
1.80003e+07
1.80004e+07
1.80004e+07
1.80005e+07
1.80006e+07
1.80007e+07
1.80009e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80016e+07
1.80019e+07
1.80022e+07
1.80025e+07
1.80028e+07
1.80032e+07
1.80036e+07
1.80041e+07
1.80046e+07
1.80051e+07
1.80057e+07
1.80063e+07
1.8007e+07
1.80077e+07
1.80084e+07
1.80092e+07
1.801e+07
1.80109e+07
1.80118e+07
1.80128e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.80171e+07
1.80183e+07
1.80196e+07
1.80208e+07
1.80222e+07
1.80236e+07
1.8025e+07
1.80265e+07
1.8028e+07
1.80296e+07
1.80312e+07
1.80329e+07
1.80346e+07
1.80364e+07
1.80382e+07
1.80401e+07
1.8042e+07
1.8044e+07
1.8046e+07
1.80481e+07
1.80502e+07
1.80523e+07
1.80545e+07
1.80568e+07
1.80591e+07
1.80615e+07
1.80639e+07
1.80663e+07
1.80688e+07
1.80714e+07
1.8074e+07
1.80767e+07
1.80794e+07
1.80821e+07
1.80849e+07
1.80878e+07
1.80907e+07
1.80936e+07
1.80966e+07
1.80997e+07
1.81028e+07
1.81059e+07
1.81091e+07
1.81124e+07
1.81157e+07
1.81191e+07
1.81225e+07
1.81259e+07
1.81294e+07
1.8133e+07
1.81366e+07
1.81402e+07
1.81439e+07
1.81477e+07
1.81515e+07
1.81553e+07
1.81592e+07
1.81632e+07
1.81672e+07
1.81712e+07
1.81753e+07
1.81794e+07
1.81836e+07
1.81879e+07
1.81922e+07
1.81965e+07
1.82009e+07
1.82053e+07
1.82098e+07
1.82144e+07
1.82189e+07
1.82236e+07
1.82282e+07
1.8233e+07
1.82377e+07
1.82426e+07
1.82474e+07
1.82523e+07
1.82573e+07
1.82623e+07
1.82674e+07
1.82725e+07
1.82776e+07
1.82828e+07
1.8288e+07
1.82933e+07
1.82987e+07
1.8304e+07
1.83094e+07
1.83149e+07
1.83204e+07
1.8326e+07
1.83316e+07
1.83372e+07
1.83429e+07
1.83486e+07
1.83544e+07
1.83602e+07
1.83661e+07
1.8372e+07
1.83779e+07
1.83839e+07
1.83899e+07
1.8396e+07
1.84021e+07
1.84083e+07
1.84145e+07
1.84207e+07
1.8427e+07
1.84333e+07
1.84396e+07
1.8446e+07
1.84525e+07
1.84589e+07
1.84654e+07
1.8472e+07
1.84786e+07
1.84852e+07
1.84919e+07
1.84986e+07
1.85053e+07
1.85121e+07
1.85189e+07
1.85257e+07
1.85326e+07
1.85395e+07
1.85464e+07
1.85534e+07
1.85604e+07
1.85675e+07
1.85746e+07
1.85817e+07
1.85889e+07
1.8596e+07
1.86033e+07
1.86105e+07
1.86178e+07
1.86251e+07
1.86324e+07
1.86398e+07
1.86472e+07
1.86546e+07
1.86621e+07
1.86696e+07
1.86771e+07
1.86846e+07
1.86922e+07
1.86998e+07
1.87074e+07
1.87151e+07
1.87228e+07
1.87305e+07
1.87382e+07
1.8746e+07
1.87538e+07
1.87616e+07
1.87694e+07
1.87772e+07
1.87851e+07
1.8793e+07
1.8801e+07
1.88089e+07
1.88169e+07
1.88249e+07
1.88329e+07
1.88409e+07
1.8849e+07
1.8857e+07
1.88651e+07
1.88732e+07
1.88814e+07
1.88895e+07
1.88977e+07
1.89059e+07
1.89141e+07
1.89223e+07
1.89305e+07
1.89388e+07
1.8947e+07
1.89553e+07
1.89636e+07
1.89719e+07
1.89802e+07
1.79881e+07
1.79795e+07
1.79779e+07
1.79776e+07
1.79773e+07
1.79769e+07
1.79764e+07
1.79758e+07
1.79752e+07
1.79745e+07
1.79738e+07
1.79732e+07
1.79725e+07
1.79719e+07
1.79713e+07
1.79708e+07
1.79704e+07
1.79701e+07
1.79698e+07
1.79697e+07
1.79697e+07
1.79698e+07
1.79699e+07
1.79702e+07
1.79706e+07
1.79711e+07
1.79717e+07
1.79724e+07
1.79731e+07
1.79739e+07
1.79748e+07
1.79757e+07
1.79766e+07
1.79775e+07
1.79784e+07
1.79793e+07
1.79802e+07
1.7981e+07
1.79818e+07
1.79826e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79851e+07
1.79856e+07
1.7986e+07
1.79864e+07
1.79868e+07
1.79871e+07
1.79873e+07
1.79876e+07
1.79878e+07
1.79879e+07
1.79881e+07
1.79882e+07
1.79883e+07
1.79883e+07
1.79884e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79884e+07
1.79884e+07
1.79884e+07
1.79883e+07
1.79882e+07
1.79882e+07
1.7988e+07
1.79879e+07
1.79878e+07
1.79876e+07
1.79873e+07
1.79871e+07
1.79867e+07
1.79864e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79844e+07
1.79838e+07
1.79832e+07
1.79825e+07
1.79818e+07
1.79811e+07
1.79804e+07
1.79797e+07
1.79791e+07
1.79785e+07
1.79779e+07
1.79774e+07
1.7977e+07
1.79767e+07
1.79765e+07
1.79764e+07
1.79764e+07
1.79765e+07
1.79768e+07
1.79772e+07
1.79777e+07
1.79783e+07
1.79789e+07
1.79797e+07
1.79804e+07
1.79813e+07
1.79821e+07
1.7983e+07
1.79839e+07
1.79847e+07
1.79856e+07
1.79864e+07
1.79872e+07
1.7988e+07
1.79887e+07
1.79894e+07
1.799e+07
1.79906e+07
1.79911e+07
1.79915e+07
1.79919e+07
1.79923e+07
1.79926e+07
1.79929e+07
1.79932e+07
1.79934e+07
1.79936e+07
1.79937e+07
1.79938e+07
1.79939e+07
1.7994e+07
1.79941e+07
1.79942e+07
1.79942e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79941e+07
1.79941e+07
1.79941e+07
1.7994e+07
1.7994e+07
1.79939e+07
1.79938e+07
1.79938e+07
1.79936e+07
1.79935e+07
1.79933e+07
1.79931e+07
1.79928e+07
1.79925e+07
1.79922e+07
1.79917e+07
1.79913e+07
1.79908e+07
1.79902e+07
1.79896e+07
1.79889e+07
1.79883e+07
1.79876e+07
1.79868e+07
1.79861e+07
1.79854e+07
1.79848e+07
1.79841e+07
1.79836e+07
1.79831e+07
1.79827e+07
1.79824e+07
1.79821e+07
1.7982e+07
1.7982e+07
1.79822e+07
1.79824e+07
1.79828e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79852e+07
1.7986e+07
1.79868e+07
1.79877e+07
1.79885e+07
1.79894e+07
1.79903e+07
1.79911e+07
1.79919e+07
1.79927e+07
1.79935e+07
1.79942e+07
1.79949e+07
1.79955e+07
1.7996e+07
1.79966e+07
1.7997e+07
1.79974e+07
1.79978e+07
1.79981e+07
1.79984e+07
1.79987e+07
1.79989e+07
1.79991e+07
1.79992e+07
1.79994e+07
1.79995e+07
1.79996e+07
1.79997e+07
1.79997e+07
1.79998e+07
1.79998e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80002e+07
1.80002e+07
1.80002e+07
1.80003e+07
1.80004e+07
1.80004e+07
1.80005e+07
1.80006e+07
1.80007e+07
1.80009e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80016e+07
1.80019e+07
1.80022e+07
1.80025e+07
1.80028e+07
1.80032e+07
1.80036e+07
1.80041e+07
1.80046e+07
1.80051e+07
1.80057e+07
1.80063e+07
1.8007e+07
1.80077e+07
1.80084e+07
1.80092e+07
1.801e+07
1.80109e+07
1.80118e+07
1.80128e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.80171e+07
1.80183e+07
1.80196e+07
1.80208e+07
1.80222e+07
1.80236e+07
1.8025e+07
1.80265e+07
1.8028e+07
1.80296e+07
1.80312e+07
1.80329e+07
1.80346e+07
1.80364e+07
1.80382e+07
1.80401e+07
1.8042e+07
1.8044e+07
1.8046e+07
1.80481e+07
1.80502e+07
1.80523e+07
1.80545e+07
1.80568e+07
1.80591e+07
1.80615e+07
1.80639e+07
1.80663e+07
1.80688e+07
1.80714e+07
1.8074e+07
1.80767e+07
1.80794e+07
1.80821e+07
1.80849e+07
1.80878e+07
1.80907e+07
1.80936e+07
1.80966e+07
1.80997e+07
1.81028e+07
1.81059e+07
1.81091e+07
1.81124e+07
1.81157e+07
1.81191e+07
1.81225e+07
1.81259e+07
1.81294e+07
1.8133e+07
1.81366e+07
1.81402e+07
1.81439e+07
1.81477e+07
1.81515e+07
1.81553e+07
1.81592e+07
1.81632e+07
1.81672e+07
1.81712e+07
1.81753e+07
1.81794e+07
1.81836e+07
1.81879e+07
1.81922e+07
1.81965e+07
1.82009e+07
1.82053e+07
1.82098e+07
1.82144e+07
1.82189e+07
1.82236e+07
1.82282e+07
1.8233e+07
1.82377e+07
1.82426e+07
1.82474e+07
1.82523e+07
1.82573e+07
1.82623e+07
1.82674e+07
1.82725e+07
1.82776e+07
1.82828e+07
1.8288e+07
1.82933e+07
1.82987e+07
1.8304e+07
1.83094e+07
1.83149e+07
1.83204e+07
1.8326e+07
1.83316e+07
1.83372e+07
1.83429e+07
1.83486e+07
1.83544e+07
1.83602e+07
1.83661e+07
1.8372e+07
1.83779e+07
1.83839e+07
1.83899e+07
1.8396e+07
1.84021e+07
1.84083e+07
1.84145e+07
1.84207e+07
1.8427e+07
1.84333e+07
1.84396e+07
1.8446e+07
1.84525e+07
1.84589e+07
1.84654e+07
1.8472e+07
1.84786e+07
1.84852e+07
1.84919e+07
1.84986e+07
1.85053e+07
1.85121e+07
1.85189e+07
1.85257e+07
1.85326e+07
1.85395e+07
1.85464e+07
1.85534e+07
1.85604e+07
1.85675e+07
1.85746e+07
1.85817e+07
1.85889e+07
1.8596e+07
1.86033e+07
1.86105e+07
1.86178e+07
1.86251e+07
1.86324e+07
1.86398e+07
1.86472e+07
1.86546e+07
1.86621e+07
1.86696e+07
1.86771e+07
1.86846e+07
1.86922e+07
1.86998e+07
1.87074e+07
1.87151e+07
1.87228e+07
1.87305e+07
1.87382e+07
1.8746e+07
1.87538e+07
1.87616e+07
1.87694e+07
1.87772e+07
1.87851e+07
1.8793e+07
1.8801e+07
1.88089e+07
1.88169e+07
1.88249e+07
1.88329e+07
1.88409e+07
1.8849e+07
1.8857e+07
1.88651e+07
1.88732e+07
1.88814e+07
1.88895e+07
1.88977e+07
1.89059e+07
1.89141e+07
1.89223e+07
1.89305e+07
1.89388e+07
1.8947e+07
1.89553e+07
1.89636e+07
1.89719e+07
1.89802e+07
1.79892e+07
1.79848e+07
1.79821e+07
1.79797e+07
1.79782e+07
1.79773e+07
1.79766e+07
1.79759e+07
1.79752e+07
1.79745e+07
1.79738e+07
1.79732e+07
1.79725e+07
1.79719e+07
1.79714e+07
1.79709e+07
1.79705e+07
1.79702e+07
1.79699e+07
1.79698e+07
1.79697e+07
1.79698e+07
1.797e+07
1.79702e+07
1.79706e+07
1.79711e+07
1.79716e+07
1.79723e+07
1.79731e+07
1.79739e+07
1.79748e+07
1.79757e+07
1.79766e+07
1.79775e+07
1.79784e+07
1.79793e+07
1.79802e+07
1.7981e+07
1.79818e+07
1.79826e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79851e+07
1.79856e+07
1.7986e+07
1.79864e+07
1.79868e+07
1.79871e+07
1.79873e+07
1.79876e+07
1.79878e+07
1.79879e+07
1.79881e+07
1.79882e+07
1.79883e+07
1.79883e+07
1.79884e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79884e+07
1.79884e+07
1.79884e+07
1.79883e+07
1.79882e+07
1.79882e+07
1.7988e+07
1.79879e+07
1.79878e+07
1.79876e+07
1.79873e+07
1.79871e+07
1.79867e+07
1.79864e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79844e+07
1.79838e+07
1.79832e+07
1.79825e+07
1.79818e+07
1.79811e+07
1.79804e+07
1.79797e+07
1.79791e+07
1.79785e+07
1.79779e+07
1.79774e+07
1.7977e+07
1.79767e+07
1.79765e+07
1.79764e+07
1.79764e+07
1.79765e+07
1.79768e+07
1.79772e+07
1.79777e+07
1.79783e+07
1.79789e+07
1.79797e+07
1.79804e+07
1.79813e+07
1.79821e+07
1.7983e+07
1.79839e+07
1.79847e+07
1.79856e+07
1.79864e+07
1.79872e+07
1.7988e+07
1.79887e+07
1.79894e+07
1.799e+07
1.79906e+07
1.79911e+07
1.79915e+07
1.79919e+07
1.79923e+07
1.79926e+07
1.79929e+07
1.79932e+07
1.79934e+07
1.79936e+07
1.79937e+07
1.79938e+07
1.79939e+07
1.7994e+07
1.79941e+07
1.79942e+07
1.79942e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79941e+07
1.79941e+07
1.79941e+07
1.7994e+07
1.7994e+07
1.79939e+07
1.79938e+07
1.79938e+07
1.79936e+07
1.79935e+07
1.79933e+07
1.79931e+07
1.79928e+07
1.79925e+07
1.79922e+07
1.79917e+07
1.79913e+07
1.79908e+07
1.79902e+07
1.79896e+07
1.79889e+07
1.79883e+07
1.79876e+07
1.79868e+07
1.79861e+07
1.79854e+07
1.79848e+07
1.79841e+07
1.79836e+07
1.79831e+07
1.79827e+07
1.79824e+07
1.79821e+07
1.7982e+07
1.7982e+07
1.79822e+07
1.79824e+07
1.79828e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79852e+07
1.7986e+07
1.79868e+07
1.79877e+07
1.79885e+07
1.79894e+07
1.79903e+07
1.79911e+07
1.79919e+07
1.79927e+07
1.79935e+07
1.79942e+07
1.79949e+07
1.79955e+07
1.7996e+07
1.79966e+07
1.7997e+07
1.79974e+07
1.79978e+07
1.79981e+07
1.79984e+07
1.79987e+07
1.79989e+07
1.79991e+07
1.79992e+07
1.79994e+07
1.79995e+07
1.79996e+07
1.79997e+07
1.79997e+07
1.79998e+07
1.79998e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80002e+07
1.80002e+07
1.80002e+07
1.80003e+07
1.80004e+07
1.80004e+07
1.80005e+07
1.80006e+07
1.80007e+07
1.80009e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80016e+07
1.80019e+07
1.80022e+07
1.80025e+07
1.80028e+07
1.80032e+07
1.80036e+07
1.80041e+07
1.80046e+07
1.80051e+07
1.80057e+07
1.80063e+07
1.8007e+07
1.80077e+07
1.80084e+07
1.80092e+07
1.801e+07
1.80109e+07
1.80118e+07
1.80128e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.80171e+07
1.80183e+07
1.80196e+07
1.80208e+07
1.80222e+07
1.80236e+07
1.8025e+07
1.80265e+07
1.8028e+07
1.80296e+07
1.80312e+07
1.80329e+07
1.80346e+07
1.80364e+07
1.80382e+07
1.80401e+07
1.8042e+07
1.8044e+07
1.8046e+07
1.80481e+07
1.80502e+07
1.80523e+07
1.80545e+07
1.80568e+07
1.80591e+07
1.80615e+07
1.80639e+07
1.80663e+07
1.80688e+07
1.80714e+07
1.8074e+07
1.80767e+07
1.80794e+07
1.80821e+07
1.80849e+07
1.80878e+07
1.80907e+07
1.80936e+07
1.80966e+07
1.80997e+07
1.81028e+07
1.81059e+07
1.81091e+07
1.81124e+07
1.81157e+07
1.81191e+07
1.81225e+07
1.81259e+07
1.81294e+07
1.8133e+07
1.81366e+07
1.81402e+07
1.81439e+07
1.81477e+07
1.81515e+07
1.81553e+07
1.81592e+07
1.81632e+07
1.81672e+07
1.81712e+07
1.81753e+07
1.81794e+07
1.81836e+07
1.81879e+07
1.81922e+07
1.81965e+07
1.82009e+07
1.82053e+07
1.82098e+07
1.82144e+07
1.82189e+07
1.82236e+07
1.82282e+07
1.8233e+07
1.82377e+07
1.82426e+07
1.82474e+07
1.82523e+07
1.82573e+07
1.82623e+07
1.82674e+07
1.82725e+07
1.82776e+07
1.82828e+07
1.8288e+07
1.82933e+07
1.82987e+07
1.8304e+07
1.83094e+07
1.83149e+07
1.83204e+07
1.8326e+07
1.83316e+07
1.83372e+07
1.83429e+07
1.83486e+07
1.83544e+07
1.83602e+07
1.83661e+07
1.8372e+07
1.83779e+07
1.83839e+07
1.83899e+07
1.8396e+07
1.84021e+07
1.84083e+07
1.84145e+07
1.84207e+07
1.8427e+07
1.84333e+07
1.84396e+07
1.8446e+07
1.84525e+07
1.84589e+07
1.84654e+07
1.8472e+07
1.84786e+07
1.84852e+07
1.84919e+07
1.84986e+07
1.85053e+07
1.85121e+07
1.85189e+07
1.85257e+07
1.85326e+07
1.85395e+07
1.85464e+07
1.85534e+07
1.85604e+07
1.85675e+07
1.85746e+07
1.85817e+07
1.85889e+07
1.8596e+07
1.86033e+07
1.86105e+07
1.86178e+07
1.86251e+07
1.86324e+07
1.86398e+07
1.86472e+07
1.86546e+07
1.86621e+07
1.86696e+07
1.86771e+07
1.86846e+07
1.86922e+07
1.86998e+07
1.87074e+07
1.87151e+07
1.87228e+07
1.87305e+07
1.87382e+07
1.8746e+07
1.87538e+07
1.87616e+07
1.87694e+07
1.87772e+07
1.87851e+07
1.8793e+07
1.8801e+07
1.88089e+07
1.88169e+07
1.88249e+07
1.88329e+07
1.88409e+07
1.8849e+07
1.8857e+07
1.88651e+07
1.88732e+07
1.88814e+07
1.88895e+07
1.88977e+07
1.89059e+07
1.89141e+07
1.89223e+07
1.89305e+07
1.89388e+07
1.8947e+07
1.89553e+07
1.89636e+07
1.89719e+07
1.89802e+07
1.79691e+07
1.79731e+07
1.79751e+07
1.79764e+07
1.79769e+07
1.79768e+07
1.79763e+07
1.79758e+07
1.79752e+07
1.79745e+07
1.79738e+07
1.79732e+07
1.79725e+07
1.79719e+07
1.79714e+07
1.79709e+07
1.79704e+07
1.79701e+07
1.79699e+07
1.79697e+07
1.79697e+07
1.79698e+07
1.797e+07
1.79703e+07
1.79707e+07
1.79711e+07
1.79717e+07
1.79724e+07
1.79731e+07
1.79739e+07
1.79748e+07
1.79757e+07
1.79766e+07
1.79775e+07
1.79784e+07
1.79793e+07
1.79802e+07
1.7981e+07
1.79818e+07
1.79826e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79851e+07
1.79856e+07
1.7986e+07
1.79864e+07
1.79868e+07
1.79871e+07
1.79873e+07
1.79876e+07
1.79878e+07
1.79879e+07
1.79881e+07
1.79882e+07
1.79883e+07
1.79883e+07
1.79884e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79884e+07
1.79884e+07
1.79884e+07
1.79883e+07
1.79882e+07
1.79882e+07
1.7988e+07
1.79879e+07
1.79878e+07
1.79876e+07
1.79873e+07
1.79871e+07
1.79867e+07
1.79864e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79844e+07
1.79838e+07
1.79832e+07
1.79825e+07
1.79818e+07
1.79811e+07
1.79804e+07
1.79797e+07
1.79791e+07
1.79785e+07
1.79779e+07
1.79774e+07
1.7977e+07
1.79767e+07
1.79765e+07
1.79764e+07
1.79764e+07
1.79765e+07
1.79768e+07
1.79772e+07
1.79777e+07
1.79783e+07
1.79789e+07
1.79797e+07
1.79804e+07
1.79813e+07
1.79821e+07
1.7983e+07
1.79839e+07
1.79847e+07
1.79856e+07
1.79864e+07
1.79872e+07
1.7988e+07
1.79887e+07
1.79894e+07
1.799e+07
1.79906e+07
1.79911e+07
1.79915e+07
1.79919e+07
1.79923e+07
1.79926e+07
1.79929e+07
1.79932e+07
1.79934e+07
1.79936e+07
1.79937e+07
1.79938e+07
1.79939e+07
1.7994e+07
1.79941e+07
1.79942e+07
1.79942e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79941e+07
1.79941e+07
1.79941e+07
1.7994e+07
1.7994e+07
1.79939e+07
1.79938e+07
1.79938e+07
1.79936e+07
1.79935e+07
1.79933e+07
1.79931e+07
1.79928e+07
1.79925e+07
1.79922e+07
1.79917e+07
1.79913e+07
1.79908e+07
1.79902e+07
1.79896e+07
1.79889e+07
1.79883e+07
1.79876e+07
1.79868e+07
1.79861e+07
1.79854e+07
1.79848e+07
1.79841e+07
1.79836e+07
1.79831e+07
1.79827e+07
1.79824e+07
1.79821e+07
1.7982e+07
1.7982e+07
1.79822e+07
1.79824e+07
1.79828e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79852e+07
1.7986e+07
1.79868e+07
1.79877e+07
1.79885e+07
1.79894e+07
1.79903e+07
1.79911e+07
1.79919e+07
1.79927e+07
1.79935e+07
1.79942e+07
1.79949e+07
1.79955e+07
1.7996e+07
1.79966e+07
1.7997e+07
1.79974e+07
1.79978e+07
1.79981e+07
1.79984e+07
1.79987e+07
1.79989e+07
1.79991e+07
1.79992e+07
1.79994e+07
1.79995e+07
1.79996e+07
1.79997e+07
1.79997e+07
1.79998e+07
1.79998e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80002e+07
1.80002e+07
1.80002e+07
1.80003e+07
1.80004e+07
1.80004e+07
1.80005e+07
1.80006e+07
1.80007e+07
1.80009e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80016e+07
1.80019e+07
1.80022e+07
1.80025e+07
1.80028e+07
1.80032e+07
1.80036e+07
1.80041e+07
1.80046e+07
1.80051e+07
1.80057e+07
1.80063e+07
1.8007e+07
1.80077e+07
1.80084e+07
1.80092e+07
1.801e+07
1.80109e+07
1.80118e+07
1.80128e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.80171e+07
1.80183e+07
1.80196e+07
1.80208e+07
1.80222e+07
1.80236e+07
1.8025e+07
1.80265e+07
1.8028e+07
1.80296e+07
1.80312e+07
1.80329e+07
1.80346e+07
1.80364e+07
1.80382e+07
1.80401e+07
1.8042e+07
1.8044e+07
1.8046e+07
1.80481e+07
1.80502e+07
1.80523e+07
1.80545e+07
1.80568e+07
1.80591e+07
1.80615e+07
1.80639e+07
1.80663e+07
1.80688e+07
1.80714e+07
1.8074e+07
1.80767e+07
1.80794e+07
1.80821e+07
1.80849e+07
1.80878e+07
1.80907e+07
1.80936e+07
1.80966e+07
1.80997e+07
1.81028e+07
1.81059e+07
1.81091e+07
1.81124e+07
1.81157e+07
1.81191e+07
1.81225e+07
1.81259e+07
1.81294e+07
1.8133e+07
1.81366e+07
1.81402e+07
1.81439e+07
1.81477e+07
1.81515e+07
1.81553e+07
1.81592e+07
1.81632e+07
1.81672e+07
1.81712e+07
1.81753e+07
1.81794e+07
1.81836e+07
1.81879e+07
1.81922e+07
1.81965e+07
1.82009e+07
1.82053e+07
1.82098e+07
1.82144e+07
1.82189e+07
1.82236e+07
1.82282e+07
1.8233e+07
1.82377e+07
1.82426e+07
1.82474e+07
1.82523e+07
1.82573e+07
1.82623e+07
1.82674e+07
1.82725e+07
1.82776e+07
1.82828e+07
1.8288e+07
1.82933e+07
1.82987e+07
1.8304e+07
1.83094e+07
1.83149e+07
1.83204e+07
1.8326e+07
1.83316e+07
1.83372e+07
1.83429e+07
1.83486e+07
1.83544e+07
1.83602e+07
1.83661e+07
1.8372e+07
1.83779e+07
1.83839e+07
1.83899e+07
1.8396e+07
1.84021e+07
1.84083e+07
1.84145e+07
1.84207e+07
1.8427e+07
1.84333e+07
1.84396e+07
1.8446e+07
1.84525e+07
1.84589e+07
1.84654e+07
1.8472e+07
1.84786e+07
1.84852e+07
1.84919e+07
1.84986e+07
1.85053e+07
1.85121e+07
1.85189e+07
1.85257e+07
1.85326e+07
1.85395e+07
1.85464e+07
1.85534e+07
1.85604e+07
1.85675e+07
1.85746e+07
1.85817e+07
1.85889e+07
1.8596e+07
1.86033e+07
1.86105e+07
1.86178e+07
1.86251e+07
1.86324e+07
1.86398e+07
1.86472e+07
1.86546e+07
1.86621e+07
1.86696e+07
1.86771e+07
1.86846e+07
1.86922e+07
1.86998e+07
1.87074e+07
1.87151e+07
1.87228e+07
1.87305e+07
1.87382e+07
1.8746e+07
1.87538e+07
1.87616e+07
1.87694e+07
1.87772e+07
1.87851e+07
1.8793e+07
1.8801e+07
1.88089e+07
1.88169e+07
1.88249e+07
1.88329e+07
1.88409e+07
1.8849e+07
1.8857e+07
1.88651e+07
1.88732e+07
1.88814e+07
1.88895e+07
1.88977e+07
1.89059e+07
1.89141e+07
1.89223e+07
1.89305e+07
1.89388e+07
1.8947e+07
1.89553e+07
1.89636e+07
1.89719e+07
1.89802e+07
1.79744e+07
1.79805e+07
1.798e+07
1.79788e+07
1.79779e+07
1.79772e+07
1.79765e+07
1.79759e+07
1.79752e+07
1.79745e+07
1.79739e+07
1.79732e+07
1.79726e+07
1.7972e+07
1.79714e+07
1.79709e+07
1.79705e+07
1.79702e+07
1.797e+07
1.79698e+07
1.79698e+07
1.79698e+07
1.797e+07
1.79703e+07
1.79707e+07
1.79711e+07
1.79717e+07
1.79724e+07
1.79731e+07
1.79739e+07
1.79748e+07
1.79757e+07
1.79766e+07
1.79775e+07
1.79784e+07
1.79793e+07
1.79802e+07
1.7981e+07
1.79818e+07
1.79826e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79851e+07
1.79856e+07
1.7986e+07
1.79864e+07
1.79868e+07
1.79871e+07
1.79873e+07
1.79876e+07
1.79878e+07
1.79879e+07
1.79881e+07
1.79882e+07
1.79883e+07
1.79883e+07
1.79884e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79884e+07
1.79884e+07
1.79884e+07
1.79883e+07
1.79882e+07
1.79882e+07
1.7988e+07
1.79879e+07
1.79878e+07
1.79876e+07
1.79873e+07
1.79871e+07
1.79867e+07
1.79864e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79844e+07
1.79838e+07
1.79832e+07
1.79825e+07
1.79818e+07
1.79811e+07
1.79804e+07
1.79797e+07
1.79791e+07
1.79785e+07
1.79779e+07
1.79774e+07
1.7977e+07
1.79767e+07
1.79765e+07
1.79764e+07
1.79764e+07
1.79765e+07
1.79768e+07
1.79772e+07
1.79777e+07
1.79783e+07
1.79789e+07
1.79797e+07
1.79804e+07
1.79813e+07
1.79821e+07
1.7983e+07
1.79839e+07
1.79847e+07
1.79856e+07
1.79864e+07
1.79872e+07
1.7988e+07
1.79887e+07
1.79894e+07
1.799e+07
1.79906e+07
1.79911e+07
1.79915e+07
1.79919e+07
1.79923e+07
1.79926e+07
1.79929e+07
1.79932e+07
1.79934e+07
1.79936e+07
1.79937e+07
1.79938e+07
1.79939e+07
1.7994e+07
1.79941e+07
1.79942e+07
1.79942e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79941e+07
1.79941e+07
1.79941e+07
1.7994e+07
1.7994e+07
1.79939e+07
1.79938e+07
1.79938e+07
1.79936e+07
1.79935e+07
1.79933e+07
1.79931e+07
1.79928e+07
1.79925e+07
1.79922e+07
1.79917e+07
1.79913e+07
1.79908e+07
1.79902e+07
1.79896e+07
1.79889e+07
1.79883e+07
1.79876e+07
1.79868e+07
1.79861e+07
1.79854e+07
1.79848e+07
1.79841e+07
1.79836e+07
1.79831e+07
1.79827e+07
1.79824e+07
1.79821e+07
1.7982e+07
1.7982e+07
1.79822e+07
1.79824e+07
1.79828e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79852e+07
1.7986e+07
1.79868e+07
1.79877e+07
1.79885e+07
1.79894e+07
1.79903e+07
1.79911e+07
1.79919e+07
1.79927e+07
1.79935e+07
1.79942e+07
1.79949e+07
1.79955e+07
1.7996e+07
1.79966e+07
1.7997e+07
1.79974e+07
1.79978e+07
1.79981e+07
1.79984e+07
1.79987e+07
1.79989e+07
1.79991e+07
1.79992e+07
1.79994e+07
1.79995e+07
1.79996e+07
1.79997e+07
1.79997e+07
1.79998e+07
1.79998e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80002e+07
1.80002e+07
1.80002e+07
1.80003e+07
1.80004e+07
1.80004e+07
1.80005e+07
1.80006e+07
1.80007e+07
1.80009e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80016e+07
1.80019e+07
1.80022e+07
1.80025e+07
1.80028e+07
1.80032e+07
1.80036e+07
1.80041e+07
1.80046e+07
1.80051e+07
1.80057e+07
1.80063e+07
1.8007e+07
1.80077e+07
1.80084e+07
1.80092e+07
1.801e+07
1.80109e+07
1.80118e+07
1.80128e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.80171e+07
1.80183e+07
1.80196e+07
1.80208e+07
1.80222e+07
1.80236e+07
1.8025e+07
1.80265e+07
1.8028e+07
1.80296e+07
1.80312e+07
1.80329e+07
1.80346e+07
1.80364e+07
1.80382e+07
1.80401e+07
1.8042e+07
1.8044e+07
1.8046e+07
1.80481e+07
1.80502e+07
1.80523e+07
1.80545e+07
1.80568e+07
1.80591e+07
1.80615e+07
1.80639e+07
1.80663e+07
1.80688e+07
1.80714e+07
1.8074e+07
1.80767e+07
1.80794e+07
1.80821e+07
1.80849e+07
1.80878e+07
1.80907e+07
1.80936e+07
1.80966e+07
1.80997e+07
1.81028e+07
1.81059e+07
1.81091e+07
1.81124e+07
1.81157e+07
1.81191e+07
1.81225e+07
1.81259e+07
1.81294e+07
1.8133e+07
1.81366e+07
1.81402e+07
1.81439e+07
1.81477e+07
1.81515e+07
1.81553e+07
1.81592e+07
1.81632e+07
1.81672e+07
1.81712e+07
1.81753e+07
1.81794e+07
1.81836e+07
1.81879e+07
1.81922e+07
1.81965e+07
1.82009e+07
1.82053e+07
1.82098e+07
1.82144e+07
1.82189e+07
1.82236e+07
1.82282e+07
1.8233e+07
1.82377e+07
1.82426e+07
1.82474e+07
1.82523e+07
1.82573e+07
1.82623e+07
1.82674e+07
1.82725e+07
1.82776e+07
1.82828e+07
1.8288e+07
1.82933e+07
1.82987e+07
1.8304e+07
1.83094e+07
1.83149e+07
1.83204e+07
1.8326e+07
1.83316e+07
1.83372e+07
1.83429e+07
1.83486e+07
1.83544e+07
1.83602e+07
1.83661e+07
1.8372e+07
1.83779e+07
1.83839e+07
1.83899e+07
1.8396e+07
1.84021e+07
1.84083e+07
1.84145e+07
1.84207e+07
1.8427e+07
1.84333e+07
1.84396e+07
1.8446e+07
1.84525e+07
1.84589e+07
1.84654e+07
1.8472e+07
1.84786e+07
1.84852e+07
1.84919e+07
1.84986e+07
1.85053e+07
1.85121e+07
1.85189e+07
1.85257e+07
1.85326e+07
1.85395e+07
1.85464e+07
1.85534e+07
1.85604e+07
1.85675e+07
1.85746e+07
1.85817e+07
1.85889e+07
1.8596e+07
1.86033e+07
1.86105e+07
1.86178e+07
1.86251e+07
1.86324e+07
1.86398e+07
1.86472e+07
1.86546e+07
1.86621e+07
1.86696e+07
1.86771e+07
1.86846e+07
1.86922e+07
1.86998e+07
1.87074e+07
1.87151e+07
1.87228e+07
1.87305e+07
1.87382e+07
1.8746e+07
1.87538e+07
1.87616e+07
1.87694e+07
1.87772e+07
1.87851e+07
1.8793e+07
1.8801e+07
1.88089e+07
1.88169e+07
1.88249e+07
1.88329e+07
1.88409e+07
1.8849e+07
1.8857e+07
1.88651e+07
1.88732e+07
1.88814e+07
1.88895e+07
1.88977e+07
1.89059e+07
1.89141e+07
1.89223e+07
1.89305e+07
1.89388e+07
1.8947e+07
1.89553e+07
1.89636e+07
1.89719e+07
1.89802e+07
1.79607e+07
1.79748e+07
1.79773e+07
1.79778e+07
1.79776e+07
1.79771e+07
1.79765e+07
1.79759e+07
1.79752e+07
1.79745e+07
1.79739e+07
1.79732e+07
1.79726e+07
1.7972e+07
1.79715e+07
1.7971e+07
1.79706e+07
1.79702e+07
1.797e+07
1.79699e+07
1.79698e+07
1.79699e+07
1.79701e+07
1.79703e+07
1.79707e+07
1.79712e+07
1.79717e+07
1.79724e+07
1.79731e+07
1.79739e+07
1.79748e+07
1.79757e+07
1.79766e+07
1.79775e+07
1.79784e+07
1.79793e+07
1.79802e+07
1.7981e+07
1.79818e+07
1.79826e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79851e+07
1.79856e+07
1.7986e+07
1.79864e+07
1.79868e+07
1.79871e+07
1.79873e+07
1.79876e+07
1.79878e+07
1.79879e+07
1.79881e+07
1.79882e+07
1.79883e+07
1.79883e+07
1.79884e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79884e+07
1.79884e+07
1.79884e+07
1.79883e+07
1.79882e+07
1.79882e+07
1.7988e+07
1.79879e+07
1.79878e+07
1.79876e+07
1.79873e+07
1.79871e+07
1.79867e+07
1.79864e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79844e+07
1.79838e+07
1.79832e+07
1.79825e+07
1.79818e+07
1.79811e+07
1.79804e+07
1.79797e+07
1.79791e+07
1.79785e+07
1.79779e+07
1.79774e+07
1.7977e+07
1.79767e+07
1.79765e+07
1.79764e+07
1.79764e+07
1.79765e+07
1.79768e+07
1.79772e+07
1.79777e+07
1.79783e+07
1.79789e+07
1.79797e+07
1.79804e+07
1.79813e+07
1.79821e+07
1.7983e+07
1.79839e+07
1.79847e+07
1.79856e+07
1.79864e+07
1.79872e+07
1.7988e+07
1.79887e+07
1.79894e+07
1.799e+07
1.79906e+07
1.79911e+07
1.79915e+07
1.79919e+07
1.79923e+07
1.79926e+07
1.79929e+07
1.79932e+07
1.79934e+07
1.79936e+07
1.79937e+07
1.79938e+07
1.79939e+07
1.7994e+07
1.79941e+07
1.79942e+07
1.79942e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79941e+07
1.79941e+07
1.79941e+07
1.7994e+07
1.7994e+07
1.79939e+07
1.79938e+07
1.79938e+07
1.79936e+07
1.79935e+07
1.79933e+07
1.79931e+07
1.79928e+07
1.79925e+07
1.79922e+07
1.79917e+07
1.79913e+07
1.79908e+07
1.79902e+07
1.79896e+07
1.79889e+07
1.79883e+07
1.79876e+07
1.79868e+07
1.79861e+07
1.79854e+07
1.79848e+07
1.79841e+07
1.79836e+07
1.79831e+07
1.79827e+07
1.79824e+07
1.79821e+07
1.7982e+07
1.7982e+07
1.79822e+07
1.79824e+07
1.79828e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79852e+07
1.7986e+07
1.79868e+07
1.79877e+07
1.79885e+07
1.79894e+07
1.79903e+07
1.79911e+07
1.79919e+07
1.79927e+07
1.79935e+07
1.79942e+07
1.79949e+07
1.79955e+07
1.7996e+07
1.79966e+07
1.7997e+07
1.79974e+07
1.79978e+07
1.79981e+07
1.79984e+07
1.79987e+07
1.79989e+07
1.79991e+07
1.79992e+07
1.79994e+07
1.79995e+07
1.79996e+07
1.79997e+07
1.79997e+07
1.79998e+07
1.79998e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80002e+07
1.80002e+07
1.80002e+07
1.80003e+07
1.80004e+07
1.80004e+07
1.80005e+07
1.80006e+07
1.80007e+07
1.80009e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80016e+07
1.80019e+07
1.80022e+07
1.80025e+07
1.80028e+07
1.80032e+07
1.80036e+07
1.80041e+07
1.80046e+07
1.80051e+07
1.80057e+07
1.80063e+07
1.8007e+07
1.80077e+07
1.80084e+07
1.80092e+07
1.801e+07
1.80109e+07
1.80118e+07
1.80128e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.80171e+07
1.80183e+07
1.80196e+07
1.80208e+07
1.80222e+07
1.80236e+07
1.8025e+07
1.80265e+07
1.8028e+07
1.80296e+07
1.80312e+07
1.80329e+07
1.80346e+07
1.80364e+07
1.80382e+07
1.80401e+07
1.8042e+07
1.8044e+07
1.8046e+07
1.80481e+07
1.80502e+07
1.80523e+07
1.80545e+07
1.80568e+07
1.80591e+07
1.80615e+07
1.80639e+07
1.80663e+07
1.80688e+07
1.80714e+07
1.8074e+07
1.80767e+07
1.80794e+07
1.80821e+07
1.80849e+07
1.80878e+07
1.80907e+07
1.80936e+07
1.80966e+07
1.80997e+07
1.81028e+07
1.81059e+07
1.81091e+07
1.81124e+07
1.81157e+07
1.81191e+07
1.81225e+07
1.81259e+07
1.81294e+07
1.8133e+07
1.81366e+07
1.81402e+07
1.81439e+07
1.81477e+07
1.81515e+07
1.81553e+07
1.81592e+07
1.81632e+07
1.81672e+07
1.81712e+07
1.81753e+07
1.81794e+07
1.81836e+07
1.81879e+07
1.81922e+07
1.81965e+07
1.82009e+07
1.82053e+07
1.82098e+07
1.82144e+07
1.82189e+07
1.82236e+07
1.82282e+07
1.8233e+07
1.82377e+07
1.82426e+07
1.82474e+07
1.82523e+07
1.82573e+07
1.82623e+07
1.82674e+07
1.82725e+07
1.82776e+07
1.82828e+07
1.8288e+07
1.82933e+07
1.82987e+07
1.8304e+07
1.83094e+07
1.83149e+07
1.83204e+07
1.8326e+07
1.83316e+07
1.83372e+07
1.83429e+07
1.83486e+07
1.83544e+07
1.83602e+07
1.83661e+07
1.8372e+07
1.83779e+07
1.83839e+07
1.83899e+07
1.8396e+07
1.84021e+07
1.84083e+07
1.84145e+07
1.84207e+07
1.8427e+07
1.84333e+07
1.84396e+07
1.8446e+07
1.84525e+07
1.84589e+07
1.84654e+07
1.8472e+07
1.84786e+07
1.84852e+07
1.84919e+07
1.84986e+07
1.85053e+07
1.85121e+07
1.85189e+07
1.85257e+07
1.85326e+07
1.85395e+07
1.85464e+07
1.85534e+07
1.85604e+07
1.85675e+07
1.85746e+07
1.85817e+07
1.85889e+07
1.8596e+07
1.86033e+07
1.86105e+07
1.86178e+07
1.86251e+07
1.86324e+07
1.86398e+07
1.86472e+07
1.86546e+07
1.86621e+07
1.86696e+07
1.86771e+07
1.86846e+07
1.86922e+07
1.86998e+07
1.87074e+07
1.87151e+07
1.87228e+07
1.87305e+07
1.87382e+07
1.8746e+07
1.87538e+07
1.87616e+07
1.87694e+07
1.87772e+07
1.87851e+07
1.8793e+07
1.8801e+07
1.88089e+07
1.88169e+07
1.88249e+07
1.88329e+07
1.88409e+07
1.8849e+07
1.8857e+07
1.88651e+07
1.88732e+07
1.88814e+07
1.88895e+07
1.88977e+07
1.89059e+07
1.89141e+07
1.89223e+07
1.89305e+07
1.89388e+07
1.8947e+07
1.89553e+07
1.89636e+07
1.89719e+07
1.89802e+07
1.79622e+07
1.79758e+07
1.79778e+07
1.7978e+07
1.79776e+07
1.79771e+07
1.79765e+07
1.79759e+07
1.79752e+07
1.79745e+07
1.79739e+07
1.79732e+07
1.79726e+07
1.7972e+07
1.79715e+07
1.7971e+07
1.79706e+07
1.79702e+07
1.797e+07
1.79699e+07
1.79698e+07
1.79699e+07
1.79701e+07
1.79703e+07
1.79707e+07
1.79712e+07
1.79717e+07
1.79724e+07
1.79731e+07
1.79739e+07
1.79748e+07
1.79757e+07
1.79766e+07
1.79775e+07
1.79784e+07
1.79793e+07
1.79802e+07
1.7981e+07
1.79818e+07
1.79826e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79851e+07
1.79856e+07
1.7986e+07
1.79864e+07
1.79868e+07
1.79871e+07
1.79873e+07
1.79876e+07
1.79878e+07
1.79879e+07
1.79881e+07
1.79882e+07
1.79883e+07
1.79883e+07
1.79884e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79884e+07
1.79884e+07
1.79884e+07
1.79883e+07
1.79882e+07
1.79882e+07
1.7988e+07
1.79879e+07
1.79878e+07
1.79876e+07
1.79873e+07
1.79871e+07
1.79867e+07
1.79864e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79844e+07
1.79838e+07
1.79832e+07
1.79825e+07
1.79818e+07
1.79811e+07
1.79804e+07
1.79797e+07
1.79791e+07
1.79785e+07
1.79779e+07
1.79774e+07
1.7977e+07
1.79767e+07
1.79765e+07
1.79764e+07
1.79764e+07
1.79765e+07
1.79768e+07
1.79772e+07
1.79777e+07
1.79783e+07
1.79789e+07
1.79797e+07
1.79804e+07
1.79813e+07
1.79821e+07
1.7983e+07
1.79839e+07
1.79847e+07
1.79856e+07
1.79864e+07
1.79872e+07
1.7988e+07
1.79887e+07
1.79894e+07
1.799e+07
1.79906e+07
1.79911e+07
1.79915e+07
1.79919e+07
1.79923e+07
1.79926e+07
1.79929e+07
1.79932e+07
1.79934e+07
1.79936e+07
1.79937e+07
1.79938e+07
1.79939e+07
1.7994e+07
1.79941e+07
1.79942e+07
1.79942e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79941e+07
1.79941e+07
1.79941e+07
1.7994e+07
1.7994e+07
1.79939e+07
1.79938e+07
1.79938e+07
1.79936e+07
1.79935e+07
1.79933e+07
1.79931e+07
1.79928e+07
1.79925e+07
1.79922e+07
1.79917e+07
1.79913e+07
1.79908e+07
1.79902e+07
1.79896e+07
1.79889e+07
1.79883e+07
1.79876e+07
1.79868e+07
1.79861e+07
1.79854e+07
1.79848e+07
1.79841e+07
1.79836e+07
1.79831e+07
1.79827e+07
1.79824e+07
1.79821e+07
1.7982e+07
1.7982e+07
1.79822e+07
1.79824e+07
1.79828e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79852e+07
1.7986e+07
1.79868e+07
1.79877e+07
1.79885e+07
1.79894e+07
1.79903e+07
1.79911e+07
1.79919e+07
1.79927e+07
1.79935e+07
1.79942e+07
1.79949e+07
1.79955e+07
1.7996e+07
1.79966e+07
1.7997e+07
1.79974e+07
1.79978e+07
1.79981e+07
1.79984e+07
1.79987e+07
1.79989e+07
1.79991e+07
1.79992e+07
1.79994e+07
1.79995e+07
1.79996e+07
1.79997e+07
1.79997e+07
1.79998e+07
1.79998e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80002e+07
1.80002e+07
1.80002e+07
1.80003e+07
1.80004e+07
1.80004e+07
1.80005e+07
1.80006e+07
1.80007e+07
1.80009e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80016e+07
1.80019e+07
1.80022e+07
1.80025e+07
1.80028e+07
1.80032e+07
1.80036e+07
1.80041e+07
1.80046e+07
1.80051e+07
1.80057e+07
1.80063e+07
1.8007e+07
1.80077e+07
1.80084e+07
1.80092e+07
1.801e+07
1.80109e+07
1.80118e+07
1.80128e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.80171e+07
1.80183e+07
1.80196e+07
1.80208e+07
1.80222e+07
1.80236e+07
1.8025e+07
1.80265e+07
1.8028e+07
1.80296e+07
1.80312e+07
1.80329e+07
1.80346e+07
1.80364e+07
1.80382e+07
1.80401e+07
1.8042e+07
1.8044e+07
1.8046e+07
1.80481e+07
1.80502e+07
1.80523e+07
1.80545e+07
1.80568e+07
1.80591e+07
1.80615e+07
1.80639e+07
1.80663e+07
1.80688e+07
1.80714e+07
1.8074e+07
1.80767e+07
1.80794e+07
1.80821e+07
1.80849e+07
1.80878e+07
1.80907e+07
1.80936e+07
1.80966e+07
1.80997e+07
1.81028e+07
1.81059e+07
1.81091e+07
1.81124e+07
1.81157e+07
1.81191e+07
1.81225e+07
1.81259e+07
1.81294e+07
1.8133e+07
1.81366e+07
1.81402e+07
1.81439e+07
1.81477e+07
1.81515e+07
1.81553e+07
1.81592e+07
1.81632e+07
1.81672e+07
1.81712e+07
1.81753e+07
1.81794e+07
1.81836e+07
1.81879e+07
1.81922e+07
1.81965e+07
1.82009e+07
1.82053e+07
1.82098e+07
1.82144e+07
1.82189e+07
1.82236e+07
1.82282e+07
1.8233e+07
1.82377e+07
1.82426e+07
1.82474e+07
1.82523e+07
1.82573e+07
1.82623e+07
1.82674e+07
1.82725e+07
1.82776e+07
1.82828e+07
1.8288e+07
1.82933e+07
1.82987e+07
1.8304e+07
1.83094e+07
1.83149e+07
1.83204e+07
1.8326e+07
1.83316e+07
1.83372e+07
1.83429e+07
1.83486e+07
1.83544e+07
1.83602e+07
1.83661e+07
1.8372e+07
1.83779e+07
1.83839e+07
1.83899e+07
1.8396e+07
1.84021e+07
1.84083e+07
1.84145e+07
1.84207e+07
1.8427e+07
1.84333e+07
1.84396e+07
1.8446e+07
1.84525e+07
1.84589e+07
1.84654e+07
1.8472e+07
1.84786e+07
1.84852e+07
1.84919e+07
1.84986e+07
1.85053e+07
1.85121e+07
1.85189e+07
1.85257e+07
1.85326e+07
1.85395e+07
1.85464e+07
1.85534e+07
1.85604e+07
1.85675e+07
1.85746e+07
1.85817e+07
1.85889e+07
1.8596e+07
1.86033e+07
1.86105e+07
1.86178e+07
1.86251e+07
1.86324e+07
1.86398e+07
1.86472e+07
1.86546e+07
1.86621e+07
1.86696e+07
1.86771e+07
1.86846e+07
1.86922e+07
1.86998e+07
1.87074e+07
1.87151e+07
1.87228e+07
1.87305e+07
1.87382e+07
1.8746e+07
1.87538e+07
1.87616e+07
1.87694e+07
1.87772e+07
1.87851e+07
1.8793e+07
1.8801e+07
1.88089e+07
1.88169e+07
1.88249e+07
1.88329e+07
1.88409e+07
1.8849e+07
1.8857e+07
1.88651e+07
1.88732e+07
1.88814e+07
1.88895e+07
1.88977e+07
1.89059e+07
1.89141e+07
1.89223e+07
1.89305e+07
1.89388e+07
1.8947e+07
1.89553e+07
1.89636e+07
1.89719e+07
1.89802e+07
1.79597e+07
1.79753e+07
1.79776e+07
1.79779e+07
1.79776e+07
1.79771e+07
1.79765e+07
1.79759e+07
1.79752e+07
1.79745e+07
1.79739e+07
1.79732e+07
1.79726e+07
1.7972e+07
1.79715e+07
1.7971e+07
1.79706e+07
1.79702e+07
1.797e+07
1.79699e+07
1.79698e+07
1.79699e+07
1.79701e+07
1.79703e+07
1.79707e+07
1.79712e+07
1.79717e+07
1.79724e+07
1.79731e+07
1.79739e+07
1.79748e+07
1.79757e+07
1.79766e+07
1.79775e+07
1.79784e+07
1.79793e+07
1.79802e+07
1.7981e+07
1.79818e+07
1.79826e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79851e+07
1.79856e+07
1.7986e+07
1.79864e+07
1.79868e+07
1.79871e+07
1.79873e+07
1.79876e+07
1.79878e+07
1.79879e+07
1.79881e+07
1.79882e+07
1.79883e+07
1.79883e+07
1.79884e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79885e+07
1.79884e+07
1.79884e+07
1.79884e+07
1.79883e+07
1.79882e+07
1.79882e+07
1.7988e+07
1.79879e+07
1.79878e+07
1.79876e+07
1.79873e+07
1.79871e+07
1.79867e+07
1.79864e+07
1.7986e+07
1.79855e+07
1.7985e+07
1.79844e+07
1.79838e+07
1.79832e+07
1.79825e+07
1.79818e+07
1.79811e+07
1.79804e+07
1.79797e+07
1.79791e+07
1.79785e+07
1.79779e+07
1.79774e+07
1.7977e+07
1.79767e+07
1.79765e+07
1.79764e+07
1.79764e+07
1.79765e+07
1.79768e+07
1.79772e+07
1.79777e+07
1.79783e+07
1.79789e+07
1.79797e+07
1.79804e+07
1.79813e+07
1.79821e+07
1.7983e+07
1.79839e+07
1.79847e+07
1.79856e+07
1.79864e+07
1.79872e+07
1.7988e+07
1.79887e+07
1.79894e+07
1.799e+07
1.79906e+07
1.79911e+07
1.79915e+07
1.79919e+07
1.79923e+07
1.79926e+07
1.79929e+07
1.79932e+07
1.79934e+07
1.79936e+07
1.79937e+07
1.79938e+07
1.79939e+07
1.7994e+07
1.79941e+07
1.79942e+07
1.79942e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79944e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79943e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79942e+07
1.79941e+07
1.79941e+07
1.79941e+07
1.7994e+07
1.7994e+07
1.79939e+07
1.79938e+07
1.79938e+07
1.79936e+07
1.79935e+07
1.79933e+07
1.79931e+07
1.79928e+07
1.79925e+07
1.79922e+07
1.79917e+07
1.79913e+07
1.79908e+07
1.79902e+07
1.79896e+07
1.79889e+07
1.79883e+07
1.79876e+07
1.79868e+07
1.79861e+07
1.79854e+07
1.79848e+07
1.79841e+07
1.79836e+07
1.79831e+07
1.79827e+07
1.79824e+07
1.79821e+07
1.7982e+07
1.7982e+07
1.79822e+07
1.79824e+07
1.79828e+07
1.79833e+07
1.79839e+07
1.79845e+07
1.79852e+07
1.7986e+07
1.79868e+07
1.79877e+07
1.79885e+07
1.79894e+07
1.79903e+07
1.79911e+07
1.79919e+07
1.79927e+07
1.79935e+07
1.79942e+07
1.79949e+07
1.79955e+07
1.7996e+07
1.79966e+07
1.7997e+07
1.79974e+07
1.79978e+07
1.79981e+07
1.79984e+07
1.79987e+07
1.79989e+07
1.79991e+07
1.79992e+07
1.79994e+07
1.79995e+07
1.79996e+07
1.79997e+07
1.79997e+07
1.79998e+07
1.79998e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.79999e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.8e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80001e+07
1.80002e+07
1.80002e+07
1.80002e+07
1.80003e+07
1.80004e+07
1.80004e+07
1.80005e+07
1.80006e+07
1.80007e+07
1.80009e+07
1.8001e+07
1.80012e+07
1.80014e+07
1.80016e+07
1.80019e+07
1.80022e+07
1.80025e+07
1.80028e+07
1.80032e+07
1.80036e+07
1.80041e+07
1.80046e+07
1.80051e+07
1.80057e+07
1.80063e+07
1.8007e+07
1.80077e+07
1.80084e+07
1.80092e+07
1.801e+07
1.80109e+07
1.80118e+07
1.80128e+07
1.80138e+07
1.80149e+07
1.8016e+07
1.80171e+07
1.80183e+07
1.80196e+07
1.80208e+07
1.80222e+07
1.80236e+07
1.8025e+07
1.80265e+07
1.8028e+07
1.80296e+07
1.80312e+07
1.80329e+07
1.80346e+07
1.80364e+07
1.80382e+07
1.80401e+07
1.8042e+07
1.8044e+07
1.8046e+07
1.80481e+07
1.80502e+07
1.80523e+07
1.80545e+07
1.80568e+07
1.80591e+07
1.80615e+07
1.80639e+07
1.80663e+07
1.80688e+07
1.80714e+07
1.8074e+07
1.80767e+07
1.80794e+07
1.80821e+07
1.80849e+07
1.80878e+07
1.80907e+07
1.80936e+07
1.80966e+07
1.80997e+07
1.81028e+07
1.81059e+07
1.81091e+07
1.81124e+07
1.81157e+07
1.81191e+07
1.81225e+07
1.81259e+07
1.81294e+07
1.8133e+07
1.81366e+07
1.81402e+07
1.81439e+07
1.81477e+07
1.81515e+07
1.81553e+07
1.81592e+07
1.81632e+07
1.81672e+07
1.81712e+07
1.81753e+07
1.81794e+07
1.81836e+07
1.81879e+07
1.81922e+07
1.81965e+07
1.82009e+07
1.82053e+07
1.82098e+07
1.82144e+07
1.82189e+07
1.82236e+07
1.82282e+07
1.8233e+07
1.82377e+07
1.82426e+07
1.82474e+07
1.82523e+07
1.82573e+07
1.82623e+07
1.82674e+07
1.82725e+07
1.82776e+07
1.82828e+07
1.8288e+07
1.82933e+07
1.82987e+07
1.8304e+07
1.83094e+07
1.83149e+07
1.83204e+07
1.8326e+07
1.83316e+07
1.83372e+07
1.83429e+07
1.83486e+07
1.83544e+07
1.83602e+07
1.83661e+07
1.8372e+07
1.83779e+07
1.83839e+07
1.83899e+07
1.8396e+07
1.84021e+07
1.84083e+07
1.84145e+07
1.84207e+07
1.8427e+07
1.84333e+07
1.84396e+07
1.8446e+07
1.84525e+07
1.84589e+07
1.84654e+07
1.8472e+07
1.84786e+07
1.84852e+07
1.84919e+07
1.84986e+07
1.85053e+07
1.85121e+07
1.85189e+07
1.85257e+07
1.85326e+07
1.85395e+07
1.85464e+07
1.85534e+07
1.85604e+07
1.85675e+07
1.85746e+07
1.85817e+07
1.85889e+07
1.8596e+07
1.86033e+07
1.86105e+07
1.86178e+07
1.86251e+07
1.86324e+07
1.86398e+07
1.86472e+07
1.86546e+07
1.86621e+07
1.86696e+07
1.86771e+07
1.86846e+07
1.86922e+07
1.86998e+07
1.87074e+07
1.87151e+07
1.87228e+07
1.87305e+07
1.87382e+07
1.8746e+07
1.87538e+07
1.87616e+07
1.87694e+07
1.87772e+07
1.87851e+07
1.8793e+07
1.8801e+07
1.88089e+07
1.88169e+07
1.88249e+07
1.88329e+07
1.88409e+07
1.8849e+07
1.8857e+07
1.88651e+07
1.88732e+07
1.88814e+07
1.88895e+07
1.88977e+07
1.89059e+07
1.89141e+07
1.89223e+07
1.89305e+07
1.89388e+07
1.8947e+07
1.89553e+07
1.89636e+07
1.89719e+07
1.89802e+07
)
;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type uniformTotalPressure;
rho none;
psi none;
gamma 1.4364;
pressure tableFile;
pressureCoeffs
{
fileName "$FOAM_RUN/SH6_76mps/outlet0.2_76.2mps_fromCapture.dat";
}
value uniform 1.89847e+07;
}
sides
{
type empty;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //
| [
"alexmayes@gmail.com"
] | alexmayes@gmail.com | |
f40290fd99e42a6f39fca23cc6e5a9647d7502c8 | 9aa0625a324fd07cd06791ce2db224d9728f22c6 | /mainfiles/testNLOpt.cpp | 90c78c6daf998ce39301dae71d4c946067b372ae | [] | no_license | fskovbo/CorrelatedGaussianSVM | 8f94b2d624837cc8528027121b7485a3724d5e08 | 66aeb1ea4993503e318371d6a45f8dffd15e9cc6 | refs/heads/master | 2021-05-15T11:19:41.086691 | 2018-08-19T10:34:16 | 2018-08-19T10:34:16 | 108,314,224 | 2 | 0 | null | 2018-01-10T20:44:23 | 2017-10-25T19:09:38 | C++ | UTF-8 | C++ | false | false | 2,076 | cpp | #include <iostream>
#include "math.h"
#include "nlopt.hpp"
typedef struct {
double a, b;
} my_constraint_data;
// struct my_constraint_data
// {
// void operator()(const double &a, const double &b) const
// {
// a =
// }
// };
//
// static double wrap(const std::vector<double> &x, std::vector<double> &grad, void *data) {
// return (*reinterpret_cast<MyFunction*>(data))(x, grad);
// }
//
// Function to be optimized
//
double myvfunc(const std::vector<double> &x, std::vector<double> &grad, void *my_func_data)
{
if (!grad.empty()) {
grad[0] = 0.0;
grad[1] = 0.5 / sqrt(x[1]);
}
return sqrt(x[1]);
}
//
// Constraints function
//
double myvconstraint(const std::vector<double> &x, std::vector<double> &grad, void *data)
{
my_constraint_data *d = reinterpret_cast<my_constraint_data*>(data);
double a = d->a, b = d->b;
if (!grad.empty()) {
grad[0] = 3 * a * (a*x[0] + b) * (a*x[0] + b);
grad[1] = -1.0;
}
return ((a*x[0] + b) * (a*x[0] + b) * (a*x[0] + b) - x[1]);
}
int main() {
//
// Specify lower bounds for variables
//
std::vector<double> lb(2);
lb[0] = -HUGE_VAL; lb[1] = 0;
//
// Set dimensionality for algorithm and set bounds
//
//nlopt::opt opt(nlopt::LD_MMA, 2); // LD = local & with derivative
nlopt::opt opt(nlopt::LN_COBYLA, 2);
opt.set_lower_bounds(lb);
opt.set_min_objective(myvfunc, NULL);
//
// Specify constraints
//
my_constraint_data data[2] = { {2,0}, {-1,1} }; // parametres of the contraint functions
opt.add_inequality_constraint(myvconstraint, &data[0], 1e-8); // 1e-8 tolerance on constraints
opt.add_inequality_constraint(myvconstraint, &data[1], 1e-8);
opt.set_xtol_rel(1e-8); // tolerance on parametres
//
// Set initial guess x
//
std::vector<double> x(2);
x[0] = 1.234; x[1] = 5.678;
double minf;
//
// Perform optimization
//
nlopt::result result = opt.optimize(x, minf);
for (auto& v : x){
std::cout << v << std::endl;
}
std::cout << minf << std::endl;
return 0;
}
| [
"f.skovbo@hotmail.com"
] | f.skovbo@hotmail.com |
3c6226d87fa274be0f4761f213f02ae1f8a29e82 | 988985424b7b0fb251c35543f30caad327b9686a | /pointHash.cpp | 5f1226d134117d4bbcd84f34e093282dc0480e1b | [
"MIT"
] | permissive | skyformat99/ego-gomoku-c | 7cb4de3f9eac661ad68b919a2c7be54b367f16dc | 07039e232e2b58f9f13966a24710d0ceeee8515a | refs/heads/master | 2021-07-11T03:50:41.569600 | 2017-10-10T12:04:29 | 2017-10-10T12:04:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 656 | cpp | #include "stdafx.h"
#include "pointHash.h"
extern int boardSize;
void pointHash::add(int x, int y)
{
signal[x][y] = true;
count++;
}
void pointHash::add(point p)
{
signal[p.x][p.y] = true;
count++;
}
void pointHash::addMany(points ps)
{
for (int i = 0; i < ps.count; i++)
add(ps.list[i]);
}
bool pointHash::contains(int x, int y)
{
return signal[x][y];
}
bool pointHash::contains(point p)
{
return signal[p.x][p.y];
}
pointHash::pointHash()
{
reset();
}
pointHash::~pointHash()
{
}
void pointHash::reset()
{
for (int i = 0; i < boardSize; i++)
{
for (int j = 0; j < boardSize; j++)
{
signal[i][j] = false;
}
}
count = 0;
}
| [
"tangyan1412@foxmail.com"
] | tangyan1412@foxmail.com |
f0da390724ae1d7e004d62cad399b664511d706d | 49488c7174db9957457c4cb3bd452d518ff51e91 | /code/common/socketpipe.hpp | 4bfdafb5fd646d7dd4c8f9abb7d9a98385bfb858 | [] | no_license | myxxxsquared/robot | cddf02f99796c941115ddac6538fb75b605b1dd3 | e77eea32db8d5b585feeaf3076d446b761569b4f | refs/heads/master | 2021-05-10T21:09:07.014756 | 2018-01-22T15:22:32 | 2018-01-22T15:22:32 | 118,217,938 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,071 | hpp |
#ifndef SOCKETPIPE_HEADER
#define SOCKETPIPE_HEADER
#include <cstring>
#include "message.hpp"
#include <mutex>
#include <thread>
#include <deque>
#include <condition_variable>
class Message;
class MessageProcess;
class SocketPipe
{
public:
int socketval;
std::mutex m_recv;
std::thread thread_recv;
std::thread thread_send;
std::deque<const Message *> queue_send;
std::mutex mutex_send;
std::condition_variable cv_send;
MessageProcess* proc;
SocketPipe(MessageProcess* p);
SocketPipe(const SocketPipe&) = delete;
SocketPipe &operator=(const SocketPipe&) = delete;
void init(bool server, const char *ip, int port);
void send(const void *buffer, size_t n);
void recv(void *buffer, size_t n);
static void recv_thread_static(SocketPipe* pipe);
void recv_thread();
static void send_thread_static(SocketPipe* pipe);
void send_thread();
Message* recvmsg();
void sendmsg(const Message* msg);
void sendmsg_sync(const Message* msg);
void sendmsg_tag(Message::Type t);
};
#endif
| [
"zhang_a_a_a@outlook.com"
] | zhang_a_a_a@outlook.com |
1b5d1853b1b6502cb2361f2d20a115841d7c5c17 | 8332b86ef4a7d26b5c39b08744fca81bcc3cfe1e | /CppND-Route-Planning-Project/src/main.cpp | 248d6c50fa8a68dad3820cc5372579900dbb5b09 | [] | no_license | the-john/A_Star | 9f98723f59fc125cc18f49c0a159aff7ff2964e3 | 342af0d6e40a059ed44ef98699b788202073b12f | refs/heads/master | 2020-08-27T15:05:26.593335 | 2019-10-25T00:06:34 | 2019-10-25T00:06:34 | 216,627,335 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,348 | cpp | #include <optional>
#include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <io2d.h>
#include "route_model.h"
#include "render.h"
#include "route_planner.h"
using namespace std::experimental;
static std::optional<std::vector<std::byte>> ReadFile(const std::string &path)
{
std::ifstream is{path, std::ios::binary | std::ios::ate};
if( !is )
return std::nullopt;
auto size = is.tellg();
std::vector<std::byte> contents(size);
is.seekg(0);
is.read((char*)contents.data(), size);
if( contents.empty() )
return std::nullopt;
return std::move(contents);
}
int main(int argc, const char **argv)
{
std::string osm_data_file = "";
if( argc > 1 ) {
for( int i = 1; i < argc; ++i )
if( std::string_view{argv[i]} == "-f" && ++i < argc )
osm_data_file = argv[i];
}
else {
std::cout << "To specify a map file use the following format: " << std::endl;
std::cout << "Usage: [executable] [-f filename.osm]" << std::endl;
osm_data_file = "../map.osm";
}
std::vector<std::byte> osm_data;
if( osm_data.empty() && !osm_data_file.empty() ) {
std::cout << "Reading OpenStreetMap data from the following file: " << osm_data_file << std::endl;
auto data = ReadFile(osm_data_file);
if( !data )
std::cout << "Failed to read." << std::endl;
else
osm_data = std::move(*data);
}
// TODO 1: Declare floats `start_x`, `start_y`, `end_x`, and `end_y` and get
// user input for these values using std::cin. Pass the user input to the
// RoutePlanner object below in place of 10, 10, 90, 90.
//vector<float> start_vector{0.0, 0.0};
//vector<float> end_vector{0.0, 0.0};
float start_x = 0.0;
float start_y = 0.0;
float end_x = 0.0;
float end_y = 0.0;
// Note: the values below must be between zero and one-hundred based upon the shape/size of our map
std::cout << "\n";
std::cout << "Enter the x coordinate for the starting location: "; //note: must be a value between zero and one-hundred
std::cin >> start_x; //start_vector[0];
if (start_x < 0 || start_x > 100) {
std::cout << "Invalid number for x coordinate. Entry should be between zero and one-hundred. Setting to default of 0.0." << "\n";
start_x = 0.0;
}
std::cout << "Enter the y coordinate for the starting location: "; //note: must be a value between zero and one-hundred
std::cin >> start_y; //start_vector[1];
if (start_y < 0 || start_y > 100) {
std::cout << "Invalid number for y coordinate. Entery should be between zero and one-hundred. Setting to default of 0.0." << "\n";
start_y = 0.0;
}
std::cout << "\n";
std::cout << "Enter the x coordinate for the ending location: "; //note: must be a value between zero and one-hundred
std::cin >> end_x; //end_vector[0];
if (end_x < 0 || end_x > 100) {
std::cout << "Invalid number for x coordinate. Entery should be between zero and one-hundred. Setting to default of 0.0." << "\n";
end_x = 0.0;
}
std::cout << "Enter the y coordinate for the ending location: "; //note: must be a value between zero and one-hundred
std::cin >> end_y; //end_vector[1];
if (end_y < 0 || end_y > 100) {
std::cout << "Invalid number for y coordinate. Entry should be between zero and one-hundred. Setting to default of 0.0." << "\n";
end_y = 0.0;
}
std::cout << "\n";
// Build Model.
RouteModel model{osm_data};
// Create RoutePlanner object and perform A* search.
RoutePlanner route_planner{model, start_x, start_y, end_x, end_y};
route_planner.AStarSearch();
std::cout << "Distance: " << route_planner.GetDistance() << " meters. \n";
// Render results of search.
Render render{model};
auto display = io2d::output_surface{400, 400, io2d::format::argb32, io2d::scaling::none, io2d::refresh_style::fixed, 30};
display.size_change_callback([](io2d::output_surface& surface){
surface.dimensions(surface.display_dimensions());
});
display.draw_callback([&](io2d::output_surface& surface){
render.Display(surface);
});
display.begin_show();
}
| [
"delton.oliver@outlook.com"
] | delton.oliver@outlook.com |
967f3a82a83c39e3d6cdaf9100d886651d066d8b | 2b00823785bb182898609d5565d39cba92036840 | /src/game/server/hl2/npc_combine.cpp | 46305fa5372bbdefd27d361ff986ee972a336302 | [] | no_license | rlabrecque/Source2007SDKTemplate | 4d401595c0381b6fb46cef5bbfc2bcd31fe2a12d | 2e3c7e4847342f575d145452c6246b296e6eee67 | refs/heads/master | 2021-01-10T20:44:46.700845 | 2012-10-18T23:47:21 | 2012-10-18T23:47:21 | 5,194,511 | 3 | 1 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 117,419 | cpp | //========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
#include "ai_hull.h"
#include "ai_navigator.h"
#include "ai_motor.h"
#include "ai_squadslot.h"
#include "ai_squad.h"
#include "ai_route.h"
#include "ai_interactions.h"
#include "ai_tacticalservices.h"
#include "soundent.h"
#include "game.h"
#include "npcevent.h"
#include "npc_combine.h"
#include "activitylist.h"
#include "player.h"
#include "basecombatweapon.h"
#include "basegrenade_shared.h"
#include "vstdlib/random.h"
#include "engine/IEngineSound.h"
#include "globals.h"
#include "grenade_frag.h"
#include "ndebugoverlay.h"
#include "weapon_physcannon.h"
#include "SoundEmitterSystem/isoundemittersystembase.h"
#include "npc_headcrab.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
int g_fCombineQuestion; // true if an idle grunt asked a question. Cleared when someone answers. YUCK old global from grunt code
#define COMBINE_SKIN_DEFAULT 0
#define COMBINE_SKIN_SHOTGUNNER 1
#define COMBINE_GRENADE_THROW_SPEED 650
#define COMBINE_GRENADE_TIMER 3.5
#define COMBINE_GRENADE_FLUSH_TIME 3.0 // Don't try to flush an enemy who has been out of sight for longer than this.
#define COMBINE_GRENADE_FLUSH_DIST 256.0 // Don't try to flush an enemy who has moved farther than this distance from the last place I saw him.
#define COMBINE_LIMP_HEALTH 20
#define COMBINE_MIN_GRENADE_CLEAR_DIST 250
#define COMBINE_EYE_STANDING_POSITION Vector( 0, 0, 66 )
#define COMBINE_GUN_STANDING_POSITION Vector( 0, 0, 57 )
#define COMBINE_EYE_CROUCHING_POSITION Vector( 0, 0, 40 )
#define COMBINE_GUN_CROUCHING_POSITION Vector( 0, 0, 36 )
#define COMBINE_SHOTGUN_STANDING_POSITION Vector( 0, 0, 36 )
#define COMBINE_SHOTGUN_CROUCHING_POSITION Vector( 0, 0, 36 )
#define COMBINE_MIN_CROUCH_DISTANCE 256.0
//-----------------------------------------------------------------------------
// Static stuff local to this file.
//-----------------------------------------------------------------------------
// This is the index to the name of the shotgun's classname in the string pool
// so that we can get away with an integer compare rather than a string compare.
string_t s_iszShotgunClassname;
//-----------------------------------------------------------------------------
// Interactions
//-----------------------------------------------------------------------------
int g_interactionCombineBash = 0; // melee bash attack
//=========================================================
// Combines's Anim Events Go Here
//=========================================================
#define COMBINE_AE_RELOAD ( 2 )
#define COMBINE_AE_KICK ( 3 )
#define COMBINE_AE_AIM ( 4 )
#define COMBINE_AE_GREN_TOSS ( 7 )
#define COMBINE_AE_GREN_LAUNCH ( 8 )
#define COMBINE_AE_GREN_DROP ( 9 )
#define COMBINE_AE_CAUGHT_ENEMY ( 10) // grunt established sight with an enemy (player only) that had previously eluded the squad.
int COMBINE_AE_BEGIN_ALTFIRE;
int COMBINE_AE_ALTFIRE;
//=========================================================
// Combine activities
//=========================================================
//Activity ACT_COMBINE_STANDING_SMG1;
//Activity ACT_COMBINE_CROUCHING_SMG1;
//Activity ACT_COMBINE_STANDING_AR2;
//Activity ACT_COMBINE_CROUCHING_AR2;
//Activity ACT_COMBINE_WALKING_AR2;
//Activity ACT_COMBINE_STANDING_SHOTGUN;
//Activity ACT_COMBINE_CROUCHING_SHOTGUN;
Activity ACT_COMBINE_THROW_GRENADE;
Activity ACT_COMBINE_LAUNCH_GRENADE;
Activity ACT_COMBINE_BUGBAIT;
Activity ACT_COMBINE_AR2_ALTFIRE;
Activity ACT_WALK_EASY;
Activity ACT_WALK_MARCH;
// -----------------------------------------------
// > Squad slots
// -----------------------------------------------
enum SquadSlot_T
{
SQUAD_SLOT_GRENADE1 = LAST_SHARED_SQUADSLOT,
SQUAD_SLOT_GRENADE2,
SQUAD_SLOT_ATTACK_OCCLUDER,
SQUAD_SLOT_OVERWATCH,
};
enum TacticalVariant_T
{
TACTICAL_VARIANT_DEFAULT = 0,
TACTICAL_VARIANT_PRESSURE_ENEMY, // Always try to close in on the player.
TACTICAL_VARIANT_PRESSURE_ENEMY_UNTIL_CLOSE, // Act like VARIANT_PRESSURE_ENEMY, but go to VARIANT_DEFAULT once within 30 feet
};
enum PathfindingVariant_T
{
PATHFINDING_VARIANT_DEFAULT = 0,
};
#define bits_MEMORY_PAIN_LIGHT_SOUND bits_MEMORY_CUSTOM1
#define bits_MEMORY_PAIN_HEAVY_SOUND bits_MEMORY_CUSTOM2
#define bits_MEMORY_PLAYER_HURT bits_MEMORY_CUSTOM3
LINK_ENTITY_TO_CLASS( npc_combine, CNPC_Combine );
//---------------------------------------------------------
// Save/Restore
//---------------------------------------------------------
BEGIN_DATADESC( CNPC_Combine )
DEFINE_FIELD( m_nKickDamage, FIELD_INTEGER ),
DEFINE_FIELD( m_vecTossVelocity, FIELD_VECTOR ),
DEFINE_FIELD( m_hForcedGrenadeTarget, FIELD_EHANDLE ),
DEFINE_FIELD( m_bShouldPatrol, FIELD_BOOLEAN ),
DEFINE_FIELD( m_bFirstEncounter, FIELD_BOOLEAN ),
DEFINE_FIELD( m_flNextPainSoundTime, FIELD_TIME ),
DEFINE_FIELD( m_flNextAlertSoundTime, FIELD_TIME ),
DEFINE_FIELD( m_flNextGrenadeCheck, FIELD_TIME ),
DEFINE_FIELD( m_flNextLostSoundTime, FIELD_TIME ),
DEFINE_FIELD( m_flAlertPatrolTime, FIELD_TIME ),
DEFINE_FIELD( m_flNextAltFireTime, FIELD_TIME ),
DEFINE_FIELD( m_nShots, FIELD_INTEGER ),
DEFINE_FIELD( m_flShotDelay, FIELD_FLOAT ),
DEFINE_FIELD( m_flStopMoveShootTime, FIELD_TIME ),
DEFINE_KEYFIELD( m_iNumGrenades, FIELD_INTEGER, "NumGrenades" ),
DEFINE_EMBEDDED( m_Sentences ),
// m_AssaultBehavior (auto saved by AI)
// m_StandoffBehavior (auto saved by AI)
// m_FollowBehavior (auto saved by AI)
// m_FuncTankBehavior (auto saved by AI)
// m_RappelBehavior (auto saved by AI)
// m_ActBusyBehavior (auto saved by AI)
DEFINE_INPUTFUNC( FIELD_VOID, "LookOff", InputLookOff ),
DEFINE_INPUTFUNC( FIELD_VOID, "LookOn", InputLookOn ),
DEFINE_INPUTFUNC( FIELD_VOID, "StartPatrolling", InputStartPatrolling ),
DEFINE_INPUTFUNC( FIELD_VOID, "StopPatrolling", InputStopPatrolling ),
DEFINE_INPUTFUNC( FIELD_STRING, "Assault", InputAssault ),
DEFINE_INPUTFUNC( FIELD_VOID, "HitByBugbait", InputHitByBugbait ),
DEFINE_INPUTFUNC( FIELD_STRING, "ThrowGrenadeAtTarget", InputThrowGrenadeAtTarget ),
DEFINE_FIELD( m_iLastAnimEventHandled, FIELD_INTEGER ),
DEFINE_FIELD( m_fIsElite, FIELD_BOOLEAN ),
DEFINE_FIELD( m_vecAltFireTarget, FIELD_VECTOR ),
DEFINE_KEYFIELD( m_iTacticalVariant, FIELD_INTEGER, "tacticalvariant" ),
DEFINE_KEYFIELD( m_iPathfindingVariant, FIELD_INTEGER, "pathfindingvariant" ),
END_DATADESC()
//------------------------------------------------------------------------------
// Constructor.
//------------------------------------------------------------------------------
CNPC_Combine::CNPC_Combine()
{
m_vecTossVelocity = vec3_origin;
}
//-----------------------------------------------------------------------------
// Create components
//-----------------------------------------------------------------------------
bool CNPC_Combine::CreateComponents()
{
if ( !BaseClass::CreateComponents() )
return false;
m_Sentences.Init( this, "NPC_Combine.SentenceParameters" );
return true;
}
//------------------------------------------------------------------------------
// Purpose: Don't look, only get info from squad.
//------------------------------------------------------------------------------
void CNPC_Combine::InputLookOff( inputdata_t &inputdata )
{
m_spawnflags |= SF_COMBINE_NO_LOOK;
}
//------------------------------------------------------------------------------
// Purpose: Enable looking.
//------------------------------------------------------------------------------
void CNPC_Combine::InputLookOn( inputdata_t &inputdata )
{
m_spawnflags &= ~SF_COMBINE_NO_LOOK;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNPC_Combine::InputStartPatrolling( inputdata_t &inputdata )
{
m_bShouldPatrol = true;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNPC_Combine::InputStopPatrolling( inputdata_t &inputdata )
{
m_bShouldPatrol = false;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNPC_Combine::InputAssault( inputdata_t &inputdata )
{
m_AssaultBehavior.SetParameters( AllocPooledString(inputdata.value.String()), CUE_DONT_WAIT, RALLY_POINT_SELECT_DEFAULT );
}
//-----------------------------------------------------------------------------
// We were hit by bugbait
//-----------------------------------------------------------------------------
void CNPC_Combine::InputHitByBugbait( inputdata_t &inputdata )
{
SetCondition( COND_COMBINE_HIT_BY_BUGBAIT );
}
//-----------------------------------------------------------------------------
// Purpose: Force the combine soldier to throw a grenade at the target
// If I'm a combine elite, fire my combine ball at the target instead.
// Input : &inputdata -
//-----------------------------------------------------------------------------
void CNPC_Combine::InputThrowGrenadeAtTarget( inputdata_t &inputdata )
{
// Ignore if we're inside a scripted sequence
if ( m_NPCState == NPC_STATE_SCRIPT && m_hCine )
return;
CBaseEntity *pEntity = gEntList.FindEntityByName( NULL, inputdata.value.String(), NULL, inputdata.pActivator, inputdata.pCaller );
if ( !pEntity )
{
DevMsg("%s (%s) received ThrowGrenadeAtTarget input, but couldn't find target entity '%s'\n", GetClassname(), GetDebugName(), inputdata.value.String() );
return;
}
m_hForcedGrenadeTarget = pEntity;
m_flNextGrenadeCheck = 0;
ClearSchedule( "Told to throw grenade via input" );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNPC_Combine::Precache()
{
PrecacheModel("models/Weapons/w_grenade.mdl");
UTIL_PrecacheOther( "npc_handgrenade" );
PrecacheScriptSound( "NPC_Combine.GrenadeLaunch" );
PrecacheScriptSound( "NPC_Combine.WeaponBash" );
PrecacheScriptSound( "Weapon_CombineGuard.Special1" );
BaseClass::Precache();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CNPC_Combine::Activate()
{
s_iszShotgunClassname = FindPooledString( "weapon_shotgun" );
BaseClass::Activate();
}
//-----------------------------------------------------------------------------
// Purpose:
//
//
//-----------------------------------------------------------------------------
void CNPC_Combine::Spawn( void )
{
SetHullType(HULL_HUMAN);
SetHullSizeNormal();
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_STANDABLE );
SetMoveType( MOVETYPE_STEP );
SetBloodColor( BLOOD_COLOR_RED );
m_flFieldOfView = -0.2;// indicates the width of this NPC's forward view cone ( as a dotproduct result )
m_NPCState = NPC_STATE_NONE;
m_flNextGrenadeCheck = gpGlobals->curtime + 1;
m_flNextPainSoundTime = 0;
m_flNextAlertSoundTime = 0;
m_bShouldPatrol = false;
// CapabilitiesAdd( bits_CAP_TURN_HEAD | bits_CAP_MOVE_GROUND | bits_CAP_MOVE_JUMP | bits_CAP_MOVE_CLIMB);
// JAY: Disabled jump for now - hard to compare to HL1
CapabilitiesAdd( bits_CAP_TURN_HEAD | bits_CAP_MOVE_GROUND );
CapabilitiesAdd( bits_CAP_AIM_GUN );
// Innate range attack for grenade
// CapabilitiesAdd(bits_CAP_INNATE_RANGE_ATTACK2 );
// Innate range attack for kicking
CapabilitiesAdd(bits_CAP_INNATE_MELEE_ATTACK1 );
// Can be in a squad
CapabilitiesAdd( bits_CAP_SQUAD);
CapabilitiesAdd( bits_CAP_USE_WEAPONS );
CapabilitiesAdd( bits_CAP_DUCK ); // In reloading and cover
CapabilitiesAdd( bits_CAP_NO_HIT_SQUADMATES );
m_bFirstEncounter = true;// this is true when the grunt spawns, because he hasn't encountered an enemy yet.
m_HackedGunPos = Vector ( 0, 0, 55 );
m_flStopMoveShootTime = FLT_MAX; // Move and shoot defaults on.
m_MoveAndShootOverlay.SetInitialDelay( 0.75 ); // But with a bit of a delay.
m_flNextLostSoundTime = 0;
m_flAlertPatrolTime = 0;
m_flNextAltFireTime = gpGlobals->curtime;
NPCInit();
}
//-----------------------------------------------------------------------------
// Purpose:
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CNPC_Combine::CreateBehaviors()
{
AddBehavior( &m_RappelBehavior );
AddBehavior( &m_ActBusyBehavior );
AddBehavior( &m_AssaultBehavior );
AddBehavior( &m_StandoffBehavior );
AddBehavior( &m_FollowBehavior );
AddBehavior( &m_FuncTankBehavior );
return BaseClass::CreateBehaviors();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CNPC_Combine::PostNPCInit()
{
if( IsElite() )
{
// Give a warning if a Combine Soldier is equipped with anything other than
// an AR2.
if( !GetActiveWeapon() || !FClassnameIs( GetActiveWeapon(), "weapon_ar2" ) )
{
DevWarning("**Combine Elite Soldier MUST be equipped with AR2\n");
}
}
BaseClass::PostNPCInit();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CNPC_Combine::GatherConditions()
{
BaseClass::GatherConditions();
ClearCondition( COND_COMBINE_ATTACK_SLOT_AVAILABLE );
if( GetState() == NPC_STATE_COMBAT )
{
if( IsCurSchedule( SCHED_COMBINE_WAIT_IN_COVER, false ) )
{
// Soldiers that are standing around doing nothing poll for attack slots so
// that they can respond quickly when one comes available. If they can
// occupy a vacant attack slot, they do so. This holds the slot until their
// schedule breaks and schedule selection runs again, essentially reserving this
// slot. If they do not select an attack schedule, then they'll release the slot.
if( OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
{
SetCondition( COND_COMBINE_ATTACK_SLOT_AVAILABLE );
}
}
if( IsUsingTacticalVariant(TACTICAL_VARIANT_PRESSURE_ENEMY_UNTIL_CLOSE) )
{
if( GetEnemy() != NULL && !HasCondition(COND_ENEMY_OCCLUDED) )
{
// Now we're close to our enemy, stop using the tactical variant.
if( GetAbsOrigin().DistToSqr(GetEnemy()->GetAbsOrigin()) < Square(30.0f * 12.0f) )
m_iTacticalVariant = TACTICAL_VARIANT_DEFAULT;
}
}
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CNPC_Combine::PrescheduleThink()
{
BaseClass::PrescheduleThink();
// Speak any queued sentences
m_Sentences.UpdateSentenceQueue();
if ( IsOnFire() )
{
SetCondition( COND_COMBINE_ON_FIRE );
}
else
{
ClearCondition( COND_COMBINE_ON_FIRE );
}
extern ConVar ai_debug_shoot_positions;
if ( ai_debug_shoot_positions.GetBool() )
NDebugOverlay::Cross3D( EyePosition(), 16, 0, 255, 0, false, 0.1 );
if( gpGlobals->curtime >= m_flStopMoveShootTime )
{
// Time to stop move and shoot and start facing the way I'm running.
// This makes the combine look attentive when disengaging, but prevents
// them from always running around facing you.
//
// Only do this if it won't be immediately shut off again.
if( GetNavigator()->GetPathTimeToGoal() > 1.0f )
{
m_MoveAndShootOverlay.SuspendMoveAndShoot( 5.0f );
m_flStopMoveShootTime = FLT_MAX;
}
}
if( m_flGroundSpeed > 0 && GetState() == NPC_STATE_COMBAT && m_MoveAndShootOverlay.IsSuspended() )
{
// Return to move and shoot when near my goal so that I 'tuck into' the location facing my enemy.
if( GetNavigator()->GetPathTimeToGoal() <= 1.0f )
{
m_MoveAndShootOverlay.SuspendMoveAndShoot( 0 );
}
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CNPC_Combine::DelayAltFireAttack( float flDelay )
{
float flNextAltFire = gpGlobals->curtime + flDelay;
if( flNextAltFire > m_flNextAltFireTime )
{
// Don't let this delay order preempt a previous request to wait longer.
m_flNextAltFireTime = flNextAltFire;
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CNPC_Combine::DelaySquadAltFireAttack( float flDelay )
{
// Make sure to delay my own alt-fire attack.
DelayAltFireAttack( flDelay );
AISquadIter_t iter;
CAI_BaseNPC *pSquadmate = m_pSquad ? m_pSquad->GetFirstMember( &iter ) : NULL;
while ( pSquadmate )
{
CNPC_Combine *pCombine = dynamic_cast<CNPC_Combine*>(pSquadmate);
if( pCombine && pCombine->IsElite() )
{
pCombine->DelayAltFireAttack( flDelay );
}
pSquadmate = m_pSquad->GetNextMember( &iter );
}
}
//-----------------------------------------------------------------------------
// Purpose: degrees to turn in 0.1 seconds
//-----------------------------------------------------------------------------
float CNPC_Combine::MaxYawSpeed( void )
{
switch( GetActivity() )
{
case ACT_TURN_LEFT:
case ACT_TURN_RIGHT:
return 45;
break;
case ACT_RUN:
case ACT_RUN_HURT:
return 15;
break;
case ACT_WALK:
case ACT_WALK_CROUCH:
return 25;
break;
case ACT_RANGE_ATTACK1:
case ACT_RANGE_ATTACK2:
case ACT_MELEE_ATTACK1:
case ACT_MELEE_ATTACK2:
return 35;
default:
return 35;
break;
}
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
bool CNPC_Combine::ShouldMoveAndShoot()
{
// Set this timer so that gpGlobals->curtime can't catch up to it.
// Essentially, we're saying that we're not going to interfere with
// what the AI wants to do with move and shoot.
//
// If any code below changes this timer, the code is saying
// "It's OK to move and shoot until gpGlobals->curtime == m_flStopMoveShootTime"
m_flStopMoveShootTime = FLT_MAX;
if( IsCurSchedule( SCHED_COMBINE_HIDE_AND_RELOAD, false ) )
m_flStopMoveShootTime = gpGlobals->curtime + random->RandomFloat( 0.4f, 0.6f );
if( IsCurSchedule( SCHED_TAKE_COVER_FROM_BEST_SOUND, false ) )
return false;
if( IsCurSchedule( SCHED_COMBINE_TAKE_COVER_FROM_BEST_SOUND, false ) )
return false;
if( IsCurSchedule( SCHED_COMBINE_RUN_AWAY_FROM_BEST_SOUND, false ) )
return false;
if( HasCondition( COND_NO_PRIMARY_AMMO, false ) )
m_flStopMoveShootTime = gpGlobals->curtime + random->RandomFloat( 0.4f, 0.6f );
if( m_pSquad && IsCurSchedule( SCHED_COMBINE_TAKE_COVER1, false ) )
m_flStopMoveShootTime = gpGlobals->curtime + random->RandomFloat( 0.4f, 0.6f );
return BaseClass::ShouldMoveAndShoot();
}
//-----------------------------------------------------------------------------
// Purpose: turn in the direction of movement
// Output :
//-----------------------------------------------------------------------------
bool CNPC_Combine::OverrideMoveFacing( const AILocalMoveGoal_t &move, float flInterval )
{
return BaseClass::OverrideMoveFacing( move, flInterval );
}
//-----------------------------------------------------------------------------
// Purpose:
//
//
//-----------------------------------------------------------------------------
Class_T CNPC_Combine::Classify ( void )
{
return CLASS_COMBINE;
}
//-----------------------------------------------------------------------------
// Continuous movement tasks
//-----------------------------------------------------------------------------
bool CNPC_Combine::IsCurTaskContinuousMove()
{
const Task_t* pTask = GetTask();
if ( pTask && (pTask->iTask == TASK_COMBINE_CHASE_ENEMY_CONTINUOUSLY) )
return true;
return BaseClass::IsCurTaskContinuousMove();
}
//-----------------------------------------------------------------------------
// Chase the enemy, updating the target position as the player moves
//-----------------------------------------------------------------------------
void CNPC_Combine::StartTaskChaseEnemyContinuously( const Task_t *pTask )
{
CBaseEntity *pEnemy = GetEnemy();
if ( !pEnemy )
{
TaskFail( FAIL_NO_ENEMY );
return;
}
// We're done once we get close enough
if ( WorldSpaceCenter().DistToSqr( pEnemy->WorldSpaceCenter() ) <= pTask->flTaskData * pTask->flTaskData )
{
TaskComplete();
return;
}
// TASK_GET_PATH_TO_ENEMY
if ( IsUnreachable( pEnemy ) )
{
TaskFail(FAIL_NO_ROUTE);
return;
}
if ( !GetNavigator()->SetGoal( GOALTYPE_ENEMY, AIN_NO_PATH_TASK_FAIL ) )
{
// no way to get there =(
DevWarning( 2, "GetPathToEnemy failed!!\n" );
RememberUnreachable( pEnemy );
TaskFail(FAIL_NO_ROUTE);
return;
}
// NOTE: This is TaskRunPath here.
if ( TranslateActivity( ACT_RUN ) != ACT_INVALID )
{
GetNavigator()->SetMovementActivity( ACT_RUN );
}
else
{
GetNavigator()->SetMovementActivity(ACT_WALK);
}
// Cover is void once I move
Forget( bits_MEMORY_INCOVER );
if (GetNavigator()->GetGoalType() == GOALTYPE_NONE)
{
TaskComplete();
GetNavigator()->ClearGoal(); // Clear residual state
return;
}
// No shooting delay when in this mode
m_MoveAndShootOverlay.SetInitialDelay( 0.0 );
if (!GetNavigator()->IsGoalActive())
{
SetIdealActivity( GetStoppedActivity() );
}
else
{
// Check validity of goal type
ValidateNavGoal();
}
// set that we're probably going to stop before the goal
GetNavigator()->SetArrivalDistance( pTask->flTaskData );
m_vSavePosition = GetEnemy()->WorldSpaceCenter();
}
void CNPC_Combine::RunTaskChaseEnemyContinuously( const Task_t *pTask )
{
if (!GetNavigator()->IsGoalActive())
{
SetIdealActivity( GetStoppedActivity() );
}
else
{
// Check validity of goal type
ValidateNavGoal();
}
CBaseEntity *pEnemy = GetEnemy();
if ( !pEnemy )
{
TaskFail( FAIL_NO_ENEMY );
return;
}
// We're done once we get close enough
if ( WorldSpaceCenter().DistToSqr( pEnemy->WorldSpaceCenter() ) <= pTask->flTaskData * pTask->flTaskData )
{
GetNavigator()->StopMoving();
TaskComplete();
return;
}
// Recompute path if the enemy has moved too much
if ( m_vSavePosition.DistToSqr( pEnemy->WorldSpaceCenter() ) < (pTask->flTaskData * pTask->flTaskData) )
return;
if ( IsUnreachable( pEnemy ) )
{
TaskFail(FAIL_NO_ROUTE);
return;
}
if ( !GetNavigator()->RefindPathToGoal() )
{
TaskFail(FAIL_NO_ROUTE);
return;
}
m_vSavePosition = pEnemy->WorldSpaceCenter();
}
//=========================================================
// start task
//=========================================================
void CNPC_Combine::StartTask( const Task_t *pTask )
{
// NOTE: This reset is required because we change it in TASK_COMBINE_CHASE_ENEMY_CONTINUOUSLY
m_MoveAndShootOverlay.SetInitialDelay( 0.75 );
switch ( pTask->iTask )
{
case TASK_COMBINE_SET_STANDING:
{
if ( pTask->flTaskData == 1.0f)
{
Stand();
}
else
{
Crouch();
}
TaskComplete();
}
break;
case TASK_COMBINE_CHASE_ENEMY_CONTINUOUSLY:
StartTaskChaseEnemyContinuously( pTask );
break;
case TASK_COMBINE_PLAY_SEQUENCE_FACE_ALTFIRE_TARGET:
SetIdealActivity( (Activity)(int)pTask->flTaskData );
GetMotor()->SetIdealYawToTargetAndUpdate( m_vecAltFireTarget, AI_KEEP_YAW_SPEED );
break;
case TASK_COMBINE_SIGNAL_BEST_SOUND:
if( IsInSquad() && GetSquad()->NumMembers() > 1 )
{
CBasePlayer *pPlayer = AI_GetSinglePlayer();
if( pPlayer && OccupyStrategySlot( SQUAD_SLOT_EXCLUSIVE_HANDSIGN ) && pPlayer->FInViewCone( this ) )
{
CSound *pSound;
pSound = GetBestSound();
Assert( pSound != NULL );
if ( pSound )
{
Vector right, tosound;
GetVectors( NULL, &right, NULL );
tosound = pSound->GetSoundReactOrigin() - GetAbsOrigin();
VectorNormalize( tosound);
tosound.z = 0;
right.z = 0;
if( DotProduct( right, tosound ) > 0 )
{
// Right
SetIdealActivity( ACT_SIGNAL_RIGHT );
}
else
{
// Left
SetIdealActivity( ACT_SIGNAL_LEFT );
}
break;
}
}
}
// Otherwise, just skip it.
TaskComplete();
break;
case TASK_ANNOUNCE_ATTACK:
{
// If Primary Attack
if ((int)pTask->flTaskData == 1)
{
// -----------------------------------------------------------
// If enemy isn't facing me and I haven't attacked in a while
// annouce my attack before I start wailing away
// -----------------------------------------------------------
CBaseCombatCharacter *pBCC = GetEnemyCombatCharacterPointer();
if (pBCC && pBCC->IsPlayer() && (!pBCC->FInViewCone ( this )) &&
(gpGlobals->curtime - m_flLastAttackTime > 3.0) )
{
m_flLastAttackTime = gpGlobals->curtime;
m_Sentences.Speak( "COMBINE_ANNOUNCE", SENTENCE_PRIORITY_HIGH );
// Wait two seconds
SetWait( 2.0 );
if ( !IsCrouching() )
{
SetActivity(ACT_IDLE);
}
else
{
SetActivity(ACT_COWER); // This is really crouch idle
}
}
// -------------------------------------------------------------
// Otherwise move on
// -------------------------------------------------------------
else
{
TaskComplete();
}
}
else
{
m_Sentences.Speak( "COMBINE_THROW_GRENADE", SENTENCE_PRIORITY_MEDIUM );
SetActivity(ACT_IDLE);
// Wait two seconds
SetWait( 2.0 );
}
break;
}
case TASK_WALK_PATH:
case TASK_RUN_PATH:
// grunt no longer assumes he is covered if he moves
Forget( bits_MEMORY_INCOVER );
BaseClass::StartTask( pTask );
break;
case TASK_COMBINE_FACE_TOSS_DIR:
break;
case TASK_COMBINE_GET_PATH_TO_FORCED_GREN_LOS:
{
if ( !m_hForcedGrenadeTarget )
{
TaskFail(FAIL_NO_ENEMY);
return;
}
float flMaxRange = 2000;
float flMinRange = 0;
Vector vecEnemy = m_hForcedGrenadeTarget->GetAbsOrigin();
Vector vecEnemyEye = vecEnemy + m_hForcedGrenadeTarget->GetViewOffset();
Vector posLos;
bool found = false;
if ( GetTacticalServices()->FindLateralLos( vecEnemyEye, &posLos ) )
{
float dist = ( posLos - vecEnemyEye ).Length();
if ( dist < flMaxRange && dist > flMinRange )
found = true;
}
if ( !found && GetTacticalServices()->FindLos( vecEnemy, vecEnemyEye, flMinRange, flMaxRange, 1.0, &posLos ) )
{
found = true;
}
if ( !found )
{
TaskFail( FAIL_NO_SHOOT );
}
else
{
// else drop into run task to offer an interrupt
m_vInterruptSavePosition = posLos;
}
}
break;
case TASK_COMBINE_IGNORE_ATTACKS:
// must be in a squad
if (m_pSquad && m_pSquad->NumMembers() > 2)
{
// the enemy must be far enough away
if (GetEnemy() && (GetEnemy()->WorldSpaceCenter() - WorldSpaceCenter()).Length() > 512.0 )
{
m_flNextAttack = gpGlobals->curtime + pTask->flTaskData;
}
}
TaskComplete( );
break;
case TASK_COMBINE_DEFER_SQUAD_GRENADES:
{
if ( m_pSquad )
{
// iterate my squad and stop everyone from throwing grenades for a little while.
AISquadIter_t iter;
CAI_BaseNPC *pSquadmate = m_pSquad ? m_pSquad->GetFirstMember( &iter ) : NULL;
while ( pSquadmate )
{
CNPC_Combine *pCombine = dynamic_cast<CNPC_Combine*>(pSquadmate);
if( pCombine )
{
pCombine->m_flNextGrenadeCheck = gpGlobals->curtime + 5;
}
pSquadmate = m_pSquad->GetNextMember( &iter );
}
}
TaskComplete();
break;
}
case TASK_FACE_IDEAL:
case TASK_FACE_ENEMY:
{
if( pTask->iTask == TASK_FACE_ENEMY && HasCondition( COND_CAN_RANGE_ATTACK1 ) )
{
TaskComplete();
return;
}
BaseClass::StartTask( pTask );
bool bIsFlying = (GetMoveType() == MOVETYPE_FLY) || (GetMoveType() == MOVETYPE_FLYGRAVITY);
if (bIsFlying)
{
SetIdealActivity( ACT_GLIDE );
}
}
break;
case TASK_FIND_COVER_FROM_ENEMY:
{
if (GetHintGroup() == NULL_STRING)
{
CBaseEntity *pEntity = GetEnemy();
// FIXME: this should be generalized by the schedules that are selected, or in the definition of
// what "cover" means (i.e., trace attack vulnerability vs. physical attack vulnerability
if ( pEntity )
{
// NOTE: This is a good time to check to see if the player is hurt.
// Have the combine notice this and call out
if ( !HasMemory(bits_MEMORY_PLAYER_HURT) && pEntity->IsPlayer() && pEntity->GetHealth() <= 20 )
{
if ( m_pSquad )
{
m_pSquad->SquadRemember(bits_MEMORY_PLAYER_HURT);
}
m_Sentences.Speak( "COMBINE_PLAYERHIT", SENTENCE_PRIORITY_INVALID );
JustMadeSound( SENTENCE_PRIORITY_HIGH );
}
if ( pEntity->MyNPCPointer() )
{
if ( !(pEntity->MyNPCPointer()->CapabilitiesGet( ) & bits_CAP_WEAPON_RANGE_ATTACK1) &&
!(pEntity->MyNPCPointer()->CapabilitiesGet( ) & bits_CAP_INNATE_RANGE_ATTACK1) )
{
TaskComplete();
return;
}
}
}
}
BaseClass::StartTask( pTask );
}
break;
case TASK_RANGE_ATTACK1:
{
m_nShots = GetActiveWeapon()->GetRandomBurst();
m_flShotDelay = GetActiveWeapon()->GetFireRate();
m_flNextAttack = gpGlobals->curtime + m_flShotDelay - 0.1;
ResetIdealActivity( ACT_RANGE_ATTACK1 );
m_flLastAttackTime = gpGlobals->curtime;
}
break;
case TASK_COMBINE_DIE_INSTANTLY:
{
CTakeDamageInfo info;
info.SetAttacker( this );
info.SetInflictor( this );
info.SetDamage( m_iHealth );
info.SetDamageType( pTask->flTaskData );
info.SetDamageForce( Vector( 0.1, 0.1, 0.1 ) );
TakeDamage( info );
TaskComplete();
}
break;
default:
BaseClass:: StartTask( pTask );
break;
}
}
//=========================================================
// RunTask
//=========================================================
void CNPC_Combine::RunTask( const Task_t *pTask )
{
/*
{
CBaseEntity *pEnemy = GetEnemy();
if (pEnemy)
{
NDebugOverlay::Line(Center(), pEnemy->Center(), 0,255,255, false, 0.1);
}
}
*/
/*
if (m_iMySquadSlot != SQUAD_SLOT_NONE)
{
char text[64];
Q_snprintf( text, strlen( text ), "%d", m_iMySquadSlot );
NDebugOverlay::Text( Center() + Vector( 0, 0, 72 ), text, false, 0.1 );
}
*/
switch ( pTask->iTask )
{
case TASK_COMBINE_CHASE_ENEMY_CONTINUOUSLY:
RunTaskChaseEnemyContinuously( pTask );
break;
case TASK_COMBINE_SIGNAL_BEST_SOUND:
AutoMovement( );
if ( IsActivityFinished() )
{
TaskComplete();
}
break;
case TASK_ANNOUNCE_ATTACK:
{
// Stop waiting if enemy facing me or lost enemy
CBaseCombatCharacter* pBCC = GetEnemyCombatCharacterPointer();
if (!pBCC || pBCC->FInViewCone( this ))
{
TaskComplete();
}
if ( IsWaitFinished() )
{
TaskComplete();
}
}
break;
case TASK_COMBINE_PLAY_SEQUENCE_FACE_ALTFIRE_TARGET:
GetMotor()->SetIdealYawToTargetAndUpdate( m_vecAltFireTarget, AI_KEEP_YAW_SPEED );
if ( IsActivityFinished() )
{
TaskComplete();
}
break;
case TASK_COMBINE_FACE_TOSS_DIR:
{
// project a point along the toss vector and turn to face that point.
GetMotor()->SetIdealYawToTargetAndUpdate( GetLocalOrigin() + m_vecTossVelocity * 64, AI_KEEP_YAW_SPEED );
if ( FacingIdeal() )
{
TaskComplete( true );
}
break;
}
case TASK_COMBINE_GET_PATH_TO_FORCED_GREN_LOS:
{
if ( !m_hForcedGrenadeTarget )
{
TaskFail(FAIL_NO_ENEMY);
return;
}
if ( GetTaskInterrupt() > 0 )
{
ClearTaskInterrupt();
Vector vecEnemy = m_hForcedGrenadeTarget->GetAbsOrigin();
AI_NavGoal_t goal( m_vInterruptSavePosition, ACT_RUN, AIN_HULL_TOLERANCE );
GetNavigator()->SetGoal( goal, AIN_CLEAR_TARGET );
GetNavigator()->SetArrivalDirection( vecEnemy - goal.dest );
}
else
{
TaskInterrupt();
}
}
break;
case TASK_RANGE_ATTACK1:
{
AutoMovement( );
Vector vecEnemyLKP = GetEnemyLKP();
if (!FInAimCone( vecEnemyLKP ))
{
GetMotor()->SetIdealYawToTargetAndUpdate( vecEnemyLKP, AI_KEEP_YAW_SPEED );
}
else
{
GetMotor()->SetIdealYawAndUpdate( GetMotor()->GetIdealYaw(), AI_KEEP_YAW_SPEED );
}
if ( gpGlobals->curtime >= m_flNextAttack )
{
if ( IsActivityFinished() )
{
if (--m_nShots > 0)
{
// DevMsg("ACT_RANGE_ATTACK1\n");
ResetIdealActivity( ACT_RANGE_ATTACK1 );
m_flLastAttackTime = gpGlobals->curtime;
m_flNextAttack = gpGlobals->curtime + m_flShotDelay - 0.1;
}
else
{
// DevMsg("TASK_RANGE_ATTACK1 complete\n");
TaskComplete();
}
}
}
else
{
// DevMsg("Wait\n");
}
}
break;
default:
{
BaseClass::RunTask( pTask );
break;
}
}
}
//------------------------------------------------------------------------------
// Purpose : Override to always shoot at eyes (for ducking behind things)
// Input :
// Output :
//------------------------------------------------------------------------------
Vector CNPC_Combine::BodyTarget( const Vector &posSrc, bool bNoisy )
{
Vector result = BaseClass::BodyTarget( posSrc, bNoisy );
// @TODO (toml 02-02-04): this seems wrong. Isn't this already be accounted for
// with the eye position used in the base BodyTarget()
if ( GetFlags() & FL_DUCKING )
result -= Vector(0,0,24);
return result;
}
//------------------------------------------------------------------------------
// Purpose:
//------------------------------------------------------------------------------
bool CNPC_Combine::FVisible( CBaseEntity *pEntity, int traceMask, CBaseEntity **ppBlocker )
{
if( m_spawnflags & SF_COMBINE_NO_LOOK )
{
// When no look is set, if enemy has eluded the squad,
// he's always invisble to me
if (GetEnemies()->HasEludedMe(pEntity))
{
return false;
}
}
return BaseClass::FVisible(pEntity, traceMask, ppBlocker);
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CNPC_Combine::Event_Killed( const CTakeDamageInfo &info )
{
// if I was killed before I could finish throwing my grenade, drop
// a grenade item that the player can retrieve.
if( GetActivity() == ACT_RANGE_ATTACK2 )
{
if( m_iLastAnimEventHandled != COMBINE_AE_GREN_TOSS )
{
// Drop the grenade as an item.
Vector vecStart;
GetAttachment( "lefthand", vecStart );
CBaseEntity *pItem = DropItem( "weapon_frag", vecStart, RandomAngle(0,360) );
if ( pItem )
{
IPhysicsObject *pObj = pItem->VPhysicsGetObject();
if ( pObj )
{
Vector vel;
vel.x = random->RandomFloat( -100.0f, 100.0f );
vel.y = random->RandomFloat( -100.0f, 100.0f );
vel.z = random->RandomFloat( 800.0f, 1200.0f );
AngularImpulse angImp = RandomAngularImpulse( -300.0f, 300.0f );
vel[2] = 0.0f;
pObj->AddVelocity( &vel, &angImp );
}
// In the Citadel we need to dissolve this
if ( PlayerHasMegaPhysCannon() )
{
CBaseCombatWeapon *pWeapon = static_cast<CBaseCombatWeapon *>(pItem);
pWeapon->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );
}
}
}
}
BaseClass::Event_Killed( info );
}
//-----------------------------------------------------------------------------
// Purpose: Override. Don't update if I'm not looking
// Input :
// Output : Returns true is new enemy, false is known enemy
//-----------------------------------------------------------------------------
bool CNPC_Combine::UpdateEnemyMemory( CBaseEntity *pEnemy, const Vector &position, CBaseEntity *pInformer )
{
if( m_spawnflags & SF_COMBINE_NO_LOOK )
{
return false;
}
return BaseClass::UpdateEnemyMemory( pEnemy, position, pInformer );
}
//-----------------------------------------------------------------------------
// Purpose: Allows for modification of the interrupt mask for the current schedule.
// In the most cases the base implementation should be called first.
//-----------------------------------------------------------------------------
void CNPC_Combine::BuildScheduleTestBits( void )
{
BaseClass::BuildScheduleTestBits();
if (gpGlobals->curtime < m_flNextAttack)
{
ClearCustomInterruptCondition( COND_CAN_RANGE_ATTACK1 );
ClearCustomInterruptCondition( COND_CAN_RANGE_ATTACK2 );
}
SetCustomInterruptCondition( COND_COMBINE_HIT_BY_BUGBAIT );
if ( !IsCurSchedule( SCHED_COMBINE_BURNING_STAND ) )
{
SetCustomInterruptCondition( COND_COMBINE_ON_FIRE );
}
}
//-----------------------------------------------------------------------------
// Purpose: Translate base class activities into combot activites
//-----------------------------------------------------------------------------
Activity CNPC_Combine::NPC_TranslateActivity( Activity eNewActivity )
{
//Slaming this back to ACT_COMBINE_BUGBAIT since we don't want ANYTHING to change our activity while we burn.
if ( HasCondition( COND_COMBINE_ON_FIRE ) )
return BaseClass::NPC_TranslateActivity( ACT_COMBINE_BUGBAIT );
if (eNewActivity == ACT_RANGE_ATTACK2)
{
// grunt is going to a secondary long range attack. This may be a thrown
// grenade or fired grenade, we must determine which and pick proper sequence
if (Weapon_OwnsThisType( "weapon_grenadelauncher" ) )
{
return ( Activity )ACT_COMBINE_LAUNCH_GRENADE;
}
else
{
return ( Activity )ACT_COMBINE_THROW_GRENADE;
}
}
else if (eNewActivity == ACT_IDLE)
{
if ( !IsCrouching() && ( m_NPCState == NPC_STATE_COMBAT || m_NPCState == NPC_STATE_ALERT ) )
{
eNewActivity = ACT_IDLE_ANGRY;
}
}
if ( m_AssaultBehavior.IsRunning() )
{
switch ( eNewActivity )
{
case ACT_IDLE:
eNewActivity = ACT_IDLE_ANGRY;
break;
case ACT_WALK:
eNewActivity = ACT_WALK_AIM;
break;
case ACT_RUN:
eNewActivity = ACT_RUN_AIM;
break;
}
}
return BaseClass::NPC_TranslateActivity( eNewActivity );
}
//-----------------------------------------------------------------------------
// Purpose: Overidden for human grunts because they hear the DANGER sound
// Input :
// Output :
//-----------------------------------------------------------------------------
int CNPC_Combine::GetSoundInterests( void )
{
return SOUND_WORLD | SOUND_COMBAT | SOUND_PLAYER | SOUND_DANGER | SOUND_PHYSICS_DANGER | SOUND_BULLET_IMPACT | SOUND_MOVE_AWAY;
}
//-----------------------------------------------------------------------------
// Purpose: Return true if this NPC can hear the specified sound
//-----------------------------------------------------------------------------
bool CNPC_Combine::QueryHearSound( CSound *pSound )
{
if ( pSound->SoundContext() & SOUND_CONTEXT_COMBINE_ONLY )
return true;
if ( pSound->SoundContext() & SOUND_CONTEXT_EXCLUDE_COMBINE )
return false;
return BaseClass::QueryHearSound( pSound );
}
//-----------------------------------------------------------------------------
// Purpose: Announce an assault if the enemy can see me and we are pretty
// close to him/her
// Input :
// Output :
//-----------------------------------------------------------------------------
void CNPC_Combine::AnnounceAssault(void)
{
if (random->RandomInt(0,5) > 1)
return;
// If enemy can see me make assualt sound
CBaseCombatCharacter* pBCC = GetEnemyCombatCharacterPointer();
if (!pBCC)
return;
if (!FOkToMakeSound())
return;
// Make sure we are pretty close
if ( WorldSpaceCenter().DistToSqr( pBCC->WorldSpaceCenter() ) > (2000 * 2000))
return;
// Make sure we are in view cone of player
if (!pBCC->FInViewCone ( this ))
return;
// Make sure player can see me
if ( FVisible( pBCC ) )
{
m_Sentences.Speak( "COMBINE_ASSAULT" );
}
}
void CNPC_Combine::AnnounceEnemyType( CBaseEntity *pEnemy )
{
const char *pSentenceName = "COMBINE_MONST";
switch ( pEnemy->Classify() )
{
case CLASS_PLAYER:
pSentenceName = "COMBINE_ALERT";
break;
case CLASS_PLAYER_ALLY:
case CLASS_CITIZEN_REBEL:
case CLASS_CITIZEN_PASSIVE:
case CLASS_VORTIGAUNT:
pSentenceName = "COMBINE_MONST_CITIZENS";
break;
case CLASS_PLAYER_ALLY_VITAL:
pSentenceName = "COMBINE_MONST_CHARACTER";
break;
case CLASS_ANTLION:
pSentenceName = "COMBINE_MONST_BUGS";
break;
case CLASS_ZOMBIE:
pSentenceName = "COMBINE_MONST_ZOMBIES";
break;
case CLASS_HEADCRAB:
case CLASS_BARNACLE:
pSentenceName = "COMBINE_MONST_PARASITES";
break;
}
m_Sentences.Speak( pSentenceName, SENTENCE_PRIORITY_HIGH );
}
void CNPC_Combine::AnnounceEnemyKill( CBaseEntity *pEnemy )
{
if (!pEnemy )
return;
const char *pSentenceName = "COMBINE_KILL_MONST";
switch ( pEnemy->Classify() )
{
case CLASS_PLAYER:
pSentenceName = "COMBINE_PLAYER_DEAD";
break;
// no sentences for these guys yet
case CLASS_PLAYER_ALLY:
case CLASS_CITIZEN_REBEL:
case CLASS_CITIZEN_PASSIVE:
case CLASS_VORTIGAUNT:
break;
case CLASS_PLAYER_ALLY_VITAL:
break;
case CLASS_ANTLION:
break;
case CLASS_ZOMBIE:
break;
case CLASS_HEADCRAB:
case CLASS_BARNACLE:
break;
}
m_Sentences.Speak( pSentenceName, SENTENCE_PRIORITY_HIGH );
}
//-----------------------------------------------------------------------------
// Select the combat schedule
//-----------------------------------------------------------------------------
int CNPC_Combine::SelectCombatSchedule()
{
// -----------
// dead enemy
// -----------
if ( HasCondition( COND_ENEMY_DEAD ) )
{
// call base class, all code to handle dead enemies is centralized there.
return SCHED_NONE;
}
// -----------
// new enemy
// -----------
if ( HasCondition( COND_NEW_ENEMY ) )
{
CBaseEntity *pEnemy = GetEnemy();
bool bFirstContact = false;
float flTimeSinceFirstSeen = gpGlobals->curtime - GetEnemies()->FirstTimeSeen( pEnemy );
if( flTimeSinceFirstSeen < 3.0f )
bFirstContact = true;
if ( m_pSquad && pEnemy )
{
if ( HasCondition( COND_SEE_ENEMY ) )
{
AnnounceEnemyType( pEnemy );
}
if ( HasCondition( COND_CAN_RANGE_ATTACK1 ) && OccupyStrategySlot( SQUAD_SLOT_ATTACK1 ) )
{
// Start suppressing if someone isn't firing already (SLOT_ATTACK1). This means
// I'm the guy who spotted the enemy, I should react immediately.
return SCHED_COMBINE_SUPPRESS;
}
if ( m_pSquad->IsLeader( this ) || ( m_pSquad->GetLeader() && m_pSquad->GetLeader()->GetEnemy() != pEnemy ) )
{
// I'm the leader, but I didn't get the job suppressing the enemy. We know this because
// This code only runs if the code above didn't assign me SCHED_COMBINE_SUPPRESS.
if ( HasCondition( COND_CAN_RANGE_ATTACK1 ) && OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
{
return SCHED_RANGE_ATTACK1;
}
if( HasCondition(COND_WEAPON_HAS_LOS) && IsStrategySlotRangeOccupied( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
{
// If everyone else is attacking and I have line of fire, wait for a chance to cover someone.
if( OccupyStrategySlot( SQUAD_SLOT_OVERWATCH ) )
{
return SCHED_COMBINE_ENTER_OVERWATCH;
}
}
}
else
{
if ( m_pSquad->GetLeader() && FOkToMakeSound( SENTENCE_PRIORITY_MEDIUM ) )
{
JustMadeSound( SENTENCE_PRIORITY_MEDIUM ); // squelch anything that isn't high priority so the leader can speak
}
// First contact, and I'm solo, or not the squad leader.
if( HasCondition( COND_SEE_ENEMY ) && CanGrenadeEnemy() )
{
if( OccupyStrategySlot( SQUAD_SLOT_GRENADE1 ) )
{
return SCHED_RANGE_ATTACK2;
}
}
if( !bFirstContact && OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
{
if( random->RandomInt(0, 100) < 60 )
{
return SCHED_ESTABLISH_LINE_OF_FIRE;
}
else
{
return SCHED_COMBINE_PRESS_ATTACK;
}
}
return SCHED_TAKE_COVER_FROM_ENEMY;
}
}
}
// ---------------------
// no ammo
// ---------------------
if ( ( HasCondition ( COND_NO_PRIMARY_AMMO ) || HasCondition ( COND_LOW_PRIMARY_AMMO ) ) && !HasCondition( COND_CAN_MELEE_ATTACK1) )
{
return SCHED_HIDE_AND_RELOAD;
}
// ----------------------
// LIGHT DAMAGE
// ----------------------
if ( HasCondition( COND_LIGHT_DAMAGE ) )
{
if ( GetEnemy() != NULL )
{
// only try to take cover if we actually have an enemy!
// FIXME: need to take cover for enemy dealing the damage
// A standing guy will either crouch or run.
// A crouching guy tries to stay stuck in.
if( !IsCrouching() )
{
if( GetEnemy() && random->RandomFloat( 0, 100 ) < 50 && CouldShootIfCrouching( GetEnemy() ) )
{
Crouch();
}
else
{
//!!!KELLY - this grunt was hit and is going to run to cover.
// m_Sentences.Speak( "COMBINE_COVER" );
return SCHED_TAKE_COVER_FROM_ENEMY;
}
}
}
else
{
// How am I wounded in combat with no enemy?
Assert( GetEnemy() != NULL );
}
}
// If I'm scared of this enemy run away
if ( IRelationType( GetEnemy() ) == D_FR )
{
if (HasCondition( COND_SEE_ENEMY ) ||
HasCondition( COND_SEE_FEAR ) ||
HasCondition( COND_LIGHT_DAMAGE ) ||
HasCondition( COND_HEAVY_DAMAGE ))
{
FearSound();
//ClearCommandGoal();
return SCHED_RUN_FROM_ENEMY;
}
// If I've seen the enemy recently, cower. Ignore the time for unforgettable enemies.
AI_EnemyInfo_t *pMemory = GetEnemies()->Find( GetEnemy() );
if ( (pMemory && pMemory->bUnforgettable) || (GetEnemyLastTimeSeen() > (gpGlobals->curtime - 5.0)) )
{
// If we're facing him, just look ready. Otherwise, face him.
if ( FInAimCone( GetEnemy()->EyePosition() ) )
return SCHED_COMBAT_STAND;
return SCHED_FEAR_FACE;
}
}
int attackSchedule = SelectScheduleAttack();
if ( attackSchedule != SCHED_NONE )
return attackSchedule;
if (HasCondition(COND_ENEMY_OCCLUDED))
{
// stand up, just in case
Stand();
DesireStand();
if( GetEnemy() && !(GetEnemy()->GetFlags() & FL_NOTARGET) && OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
{
// Charge in and break the enemy's cover!
return SCHED_ESTABLISH_LINE_OF_FIRE;
}
// If I'm a long, long way away, establish a LOF anyway. Once I get there I'll
// start respecting the squad slots again.
float flDistSq = GetEnemy()->WorldSpaceCenter().DistToSqr( WorldSpaceCenter() );
if ( flDistSq > Square(3000) )
return SCHED_ESTABLISH_LINE_OF_FIRE;
// Otherwise tuck in.
Remember( bits_MEMORY_INCOVER );
return SCHED_COMBINE_WAIT_IN_COVER;
}
// --------------------------------------------------------------
// Enemy not occluded but isn't open to attack
// --------------------------------------------------------------
if ( HasCondition( COND_SEE_ENEMY ) && !HasCondition( COND_CAN_RANGE_ATTACK1 ) )
{
if ( (HasCondition( COND_TOO_FAR_TO_ATTACK ) || IsUsingTacticalVariant(TACTICAL_VARIANT_PRESSURE_ENEMY) ) && OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ))
{
return SCHED_COMBINE_PRESS_ATTACK;
}
AnnounceAssault();
return SCHED_COMBINE_ASSAULT;
}
return SCHED_NONE;
}
//-----------------------------------------------------------------------------
// Purpose:
// Input :
// Output :
//-----------------------------------------------------------------------------
int CNPC_Combine::SelectSchedule( void )
{
if ( IsWaitingToRappel() && BehaviorSelectSchedule() )
{
return BaseClass::SelectSchedule();
}
if ( HasCondition(COND_COMBINE_ON_FIRE) )
return SCHED_COMBINE_BURNING_STAND;
int nSched = SelectFlinchSchedule();
if ( nSched != SCHED_NONE )
return nSched;
if ( m_hForcedGrenadeTarget )
{
if ( m_flNextGrenadeCheck < gpGlobals->curtime )
{
Vector vecTarget = m_hForcedGrenadeTarget->WorldSpaceCenter();
if ( IsElite() )
{
if ( FVisible( m_hForcedGrenadeTarget ) )
{
m_vecAltFireTarget = vecTarget;
m_hForcedGrenadeTarget = NULL;
return SCHED_COMBINE_AR2_ALTFIRE;
}
}
else
{
// If we can, throw a grenade at the target.
// Ignore grenade count / distance / etc
if ( CheckCanThrowGrenade( vecTarget ) )
{
m_hForcedGrenadeTarget = NULL;
return SCHED_COMBINE_FORCED_GRENADE_THROW;
}
}
}
// Can't throw at the target, so lets try moving to somewhere where I can see it
if ( !FVisible( m_hForcedGrenadeTarget ) )
{
return SCHED_COMBINE_MOVE_TO_FORCED_GREN_LOS;
}
}
if ( m_NPCState != NPC_STATE_SCRIPT)
{
// If we're hit by bugbait, thrash around
if ( HasCondition( COND_COMBINE_HIT_BY_BUGBAIT ) )
{
// Don't do this if we're mounting a func_tank
if ( m_FuncTankBehavior.IsMounted() == true )
{
m_FuncTankBehavior.Dismount();
}
ClearCondition( COND_COMBINE_HIT_BY_BUGBAIT );
return SCHED_COMBINE_BUGBAIT_DISTRACTION;
}
// We've been told to move away from a target to make room for a grenade to be thrown at it
if ( HasCondition( COND_HEAR_MOVE_AWAY ) )
{
return SCHED_MOVE_AWAY;
}
// These things are done in any state but dead and prone
if (m_NPCState != NPC_STATE_DEAD && m_NPCState != NPC_STATE_PRONE )
{
// Cower when physics objects are thrown at me
if ( HasCondition( COND_HEAR_PHYSICS_DANGER ) )
{
return SCHED_FLINCH_PHYSICS;
}
// grunts place HIGH priority on running away from danger sounds.
if ( HasCondition(COND_HEAR_DANGER) )
{
CSound *pSound;
pSound = GetBestSound();
Assert( pSound != NULL );
if ( pSound)
{
if (pSound->m_iType & SOUND_DANGER)
{
// I hear something dangerous, probably need to take cover.
// dangerous sound nearby!, call it out
const char *pSentenceName = "COMBINE_DANGER";
CBaseEntity *pSoundOwner = pSound->m_hOwner;
if ( pSoundOwner )
{
CBaseGrenade *pGrenade = dynamic_cast<CBaseGrenade *>(pSoundOwner);
if ( pGrenade && pGrenade->GetThrower() )
{
if ( IRelationType( pGrenade->GetThrower() ) != D_LI )
{
// special case call out for enemy grenades
pSentenceName = "COMBINE_GREN";
}
}
}
m_Sentences.Speak( pSentenceName, SENTENCE_PRIORITY_NORMAL, SENTENCE_CRITERIA_NORMAL );
// If the sound is approaching danger, I have no enemy, and I don't see it, turn to face.
if( !GetEnemy() && pSound->IsSoundType(SOUND_CONTEXT_DANGER_APPROACH) && pSound->m_hOwner && !FInViewCone(pSound->GetSoundReactOrigin()) )
{
GetMotor()->SetIdealYawToTarget( pSound->GetSoundReactOrigin() );
return SCHED_COMBINE_FACE_IDEAL_YAW;
}
return SCHED_TAKE_COVER_FROM_BEST_SOUND;
}
// JAY: This was disabled in HL1. Test?
if (!HasCondition( COND_SEE_ENEMY ) && ( pSound->m_iType & (SOUND_PLAYER | SOUND_COMBAT) ))
{
GetMotor()->SetIdealYawToTarget( pSound->GetSoundReactOrigin() );
}
}
}
}
if( BehaviorSelectSchedule() )
{
return BaseClass::SelectSchedule();
}
}
switch ( m_NPCState )
{
case NPC_STATE_IDLE:
{
if ( m_bShouldPatrol )
return SCHED_COMBINE_PATROL;
}
// NOTE: Fall through!
case NPC_STATE_ALERT:
{
if( HasCondition(COND_LIGHT_DAMAGE) || HasCondition(COND_HEAVY_DAMAGE) )
{
AI_EnemyInfo_t *pDanger = GetEnemies()->GetDangerMemory();
if( pDanger && FInViewCone(pDanger->vLastKnownLocation) && !BaseClass::FVisible(pDanger->vLastKnownLocation) )
{
// I've been hurt, I'm facing the danger, but I don't see it, so move from this position.
return SCHED_TAKE_COVER_FROM_ORIGIN;
}
}
if( HasCondition( COND_HEAR_COMBAT ) )
{
CSound *pSound = GetBestSound();
if( pSound && pSound->IsSoundType( SOUND_COMBAT ) )
{
if( m_pSquad && m_pSquad->GetSquadMemberNearestTo( pSound->GetSoundReactOrigin() ) == this && OccupyStrategySlot( SQUAD_SLOT_INVESTIGATE_SOUND ) )
{
return SCHED_INVESTIGATE_SOUND;
}
}
}
// Don't patrol if I'm in the middle of an assault, because I'll never return to the assault.
if ( !m_AssaultBehavior.HasAssaultCue() )
{
if( m_bShouldPatrol || HasCondition( COND_COMBINE_SHOULD_PATROL ) )
return SCHED_COMBINE_PATROL;
}
}
break;
case NPC_STATE_COMBAT:
{
int nSched = SelectCombatSchedule();
if ( nSched != SCHED_NONE )
return nSched;
}
break;
}
// no special cases here, call the base class
return BaseClass::SelectSchedule();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
int CNPC_Combine::SelectFailSchedule( int failedSchedule, int failedTask, AI_TaskFailureCode_t taskFailCode )
{
if( failedSchedule == SCHED_COMBINE_TAKE_COVER1 )
{
if( IsInSquad() && IsStrategySlotRangeOccupied(SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2) && HasCondition(COND_SEE_ENEMY) )
{
// This eases the effects of an unfortunate bug that usually plagues shotgunners. Since their rate of fire is low,
// they spend relatively long periods of time without an attack squad slot. If you corner a shotgunner, usually
// the other memebers of the squad will hog all of the attack slots and pick schedules to move to establish line of
// fire. During this time, the shotgunner is prevented from attacking. If he also cannot find cover (the fallback case)
// he will stand around like an idiot, right in front of you. Instead of this, we have him run up to you for a melee attack.
return SCHED_COMBINE_MOVE_TO_MELEE;
}
}
return BaseClass::SelectFailSchedule( failedSchedule, failedTask, taskFailCode );
}
//-----------------------------------------------------------------------------
// Should we charge the player?
//-----------------------------------------------------------------------------
bool CNPC_Combine::ShouldChargePlayer()
{
return GetEnemy() && GetEnemy()->IsPlayer() && PlayerHasMegaPhysCannon() && !IsLimitingHintGroups();
}
//-----------------------------------------------------------------------------
// Select attack schedules
//-----------------------------------------------------------------------------
#define COMBINE_MEGA_PHYSCANNON_ATTACK_DISTANCE 192
#define COMBINE_MEGA_PHYSCANNON_ATTACK_DISTANCE_SQ (COMBINE_MEGA_PHYSCANNON_ATTACK_DISTANCE*COMBINE_MEGA_PHYSCANNON_ATTACK_DISTANCE)
int CNPC_Combine::SelectScheduleAttack()
{
// Drop a grenade?
if ( HasCondition( COND_COMBINE_DROP_GRENADE ) )
return SCHED_COMBINE_DROP_GRENADE;
// Kick attack?
if ( HasCondition( COND_CAN_MELEE_ATTACK1 ) )
{
return SCHED_MELEE_ATTACK1;
}
// If I'm fighting a combine turret (it's been hacked to attack me), I can't really
// hurt it with bullets, so become grenade happy.
if ( GetEnemy() && GetEnemy()->Classify() == CLASS_COMBINE && FClassnameIs(GetEnemy(), "npc_turret_floor") )
{
// Don't do this until I've been fighting the turret for a few seconds
float flTimeAtFirstHand = GetEnemies()->TimeAtFirstHand(GetEnemy());
if ( flTimeAtFirstHand != AI_INVALID_TIME )
{
float flTimeEnemySeen = gpGlobals->curtime - flTimeAtFirstHand;
if ( flTimeEnemySeen > 4.0 )
{
if ( CanGrenadeEnemy() && OccupyStrategySlot( SQUAD_SLOT_GRENADE1 ) )
return SCHED_RANGE_ATTACK2;
}
}
// If we're not in the viewcone of the turret, run up and hit it. Do this a bit later to
// give other squadmembers a chance to throw a grenade before I run in.
if ( !GetEnemy()->MyNPCPointer()->FInViewCone( this ) && OccupyStrategySlot( SQUAD_SLOT_GRENADE1 ) )
return SCHED_COMBINE_CHARGE_TURRET;
}
// When fighting against the player who's wielding a mega-physcannon,
// always close the distance if possible
// But don't do it if you're in a nav-limited hint group
if ( ShouldChargePlayer() )
{
float flDistSq = GetEnemy()->WorldSpaceCenter().DistToSqr( WorldSpaceCenter() );
if ( flDistSq <= COMBINE_MEGA_PHYSCANNON_ATTACK_DISTANCE_SQ )
{
if( HasCondition(COND_SEE_ENEMY) )
{
if ( OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
return SCHED_RANGE_ATTACK1;
}
else
{
if ( OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
return SCHED_COMBINE_PRESS_ATTACK;
}
}
if ( HasCondition(COND_SEE_ENEMY) && !IsUnreachable( GetEnemy() ) )
{
return SCHED_COMBINE_CHARGE_PLAYER;
}
}
// Can I shoot?
if ( HasCondition(COND_CAN_RANGE_ATTACK1) )
{
// JAY: HL1 behavior missing?
#if 0
if ( m_pSquad )
{
// if the enemy has eluded the squad and a squad member has just located the enemy
// and the enemy does not see the squad member, issue a call to the squad to waste a
// little time and give the player a chance to turn.
if ( MySquadLeader()->m_fEnemyEluded && !HasConditions ( bits_COND_ENEMY_FACING_ME ) )
{
MySquadLeader()->m_fEnemyEluded = FALSE;
return SCHED_GRUNT_FOUND_ENEMY;
}
}
#endif
// Engage if allowed
if ( OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
{
return SCHED_RANGE_ATTACK1;
}
// Throw a grenade if not allowed to engage with weapon.
if ( CanGrenadeEnemy() )
{
if ( OccupyStrategySlot( SQUAD_SLOT_GRENADE1 ) )
{
return SCHED_RANGE_ATTACK2;
}
}
DesireCrouch();
return SCHED_TAKE_COVER_FROM_ENEMY;
}
if ( GetEnemy() && !HasCondition(COND_SEE_ENEMY) )
{
// We don't see our enemy. If it hasn't been long since I last saw him,
// and he's pretty close to the last place I saw him, throw a grenade in
// to flush him out. A wee bit of cheating here...
float flTime;
float flDist;
flTime = gpGlobals->curtime - GetEnemies()->LastTimeSeen( GetEnemy() );
flDist = ( GetEnemy()->GetAbsOrigin() - GetEnemies()->LastSeenPosition( GetEnemy() ) ).Length();
//Msg("Time: %f Dist: %f\n", flTime, flDist );
if ( flTime <= COMBINE_GRENADE_FLUSH_TIME && flDist <= COMBINE_GRENADE_FLUSH_DIST && CanGrenadeEnemy( false ) && OccupyStrategySlot( SQUAD_SLOT_GRENADE1 ) )
{
return SCHED_RANGE_ATTACK2;
}
}
if (HasCondition(COND_WEAPON_SIGHT_OCCLUDED))
{
// If they are hiding behind something that we can destroy, start shooting at it.
CBaseEntity *pBlocker = GetEnemyOccluder();
if ( pBlocker && pBlocker->GetHealth() > 0 && OccupyStrategySlot( SQUAD_SLOT_ATTACK_OCCLUDER ) )
{
return SCHED_SHOOT_ENEMY_COVER;
}
}
return SCHED_NONE;
}
//-----------------------------------------------------------------------------
// Purpose:
// Input :
// Output :
//-----------------------------------------------------------------------------
int CNPC_Combine::TranslateSchedule( int scheduleType )
{
switch( scheduleType )
{
case SCHED_TAKE_COVER_FROM_ENEMY:
{
if ( m_pSquad )
{
// Have to explicitly check innate range attack condition as may have weapon with range attack 2
if ( g_pGameRules->IsSkillLevel( SKILL_HARD ) &&
HasCondition(COND_CAN_RANGE_ATTACK2) &&
OccupyStrategySlot( SQUAD_SLOT_GRENADE1 ) )
{
m_Sentences.Speak( "COMBINE_THROW_GRENADE" );
return SCHED_COMBINE_TOSS_GRENADE_COVER1;
}
else
{
if ( ShouldChargePlayer() && !IsUnreachable( GetEnemy() ) )
return SCHED_COMBINE_CHARGE_PLAYER;
return SCHED_COMBINE_TAKE_COVER1;
}
}
else
{
// Have to explicitly check innate range attack condition as may have weapon with range attack 2
if ( random->RandomInt(0,1) && HasCondition(COND_CAN_RANGE_ATTACK2) )
{
return SCHED_COMBINE_GRENADE_COVER1;
}
else
{
if ( ShouldChargePlayer() && !IsUnreachable( GetEnemy() ) )
return SCHED_COMBINE_CHARGE_PLAYER;
return SCHED_COMBINE_TAKE_COVER1;
}
}
}
case SCHED_TAKE_COVER_FROM_BEST_SOUND:
{
return SCHED_COMBINE_TAKE_COVER_FROM_BEST_SOUND;
}
break;
case SCHED_COMBINE_TAKECOVER_FAILED:
{
if ( HasCondition( COND_CAN_RANGE_ATTACK1 ) && OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
{
return TranslateSchedule( SCHED_RANGE_ATTACK1 );
}
// Run somewhere randomly
return TranslateSchedule( SCHED_FAIL );
break;
}
break;
case SCHED_FAIL_ESTABLISH_LINE_OF_FIRE:
{
if( !IsCrouching() )
{
if( GetEnemy() && CouldShootIfCrouching( GetEnemy() ) )
{
Crouch();
return SCHED_COMBAT_FACE;
}
}
if( HasCondition( COND_SEE_ENEMY ) )
{
return TranslateSchedule( SCHED_TAKE_COVER_FROM_ENEMY );
}
else if ( !m_AssaultBehavior.HasAssaultCue() )
{
// Don't patrol if I'm in the middle of an assault, because
// I'll never return to the assault.
if ( GetEnemy() )
{
RememberUnreachable( GetEnemy() );
}
return TranslateSchedule( SCHED_COMBINE_PATROL );
}
}
break;
case SCHED_COMBINE_ASSAULT:
{
CBaseEntity *pEntity = GetEnemy();
// FIXME: this should be generalized by the schedules that are selected, or in the definition of
// what "cover" means (i.e., trace attack vulnerability vs. physical attack vulnerability
if (pEntity && pEntity->MyNPCPointer())
{
if ( !(pEntity->MyNPCPointer()->CapabilitiesGet( ) & bits_CAP_WEAPON_RANGE_ATTACK1))
{
return TranslateSchedule( SCHED_ESTABLISH_LINE_OF_FIRE );
}
}
// don't charge forward if there's a hint group
if (GetHintGroup() != NULL_STRING)
{
return TranslateSchedule( SCHED_ESTABLISH_LINE_OF_FIRE );
}
return SCHED_COMBINE_ASSAULT;
}
case SCHED_ESTABLISH_LINE_OF_FIRE:
{
// always assume standing
// Stand();
if( CanAltFireEnemy(true) && OccupyStrategySlot(SQUAD_SLOT_SPECIAL_ATTACK) )
{
// If an elite in the squad could fire a combine ball at the player's last known position,
// do so!
return SCHED_COMBINE_AR2_ALTFIRE;
}
if( IsUsingTacticalVariant( TACTICAL_VARIANT_PRESSURE_ENEMY ) && !IsRunningBehavior() )
{
if( OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
{
return SCHED_COMBINE_PRESS_ATTACK;
}
}
return SCHED_COMBINE_ESTABLISH_LINE_OF_FIRE;
}
break;
case SCHED_HIDE_AND_RELOAD:
{
// stand up, just in case
// Stand();
// DesireStand();
if( CanGrenadeEnemy() && OccupyStrategySlot( SQUAD_SLOT_GRENADE1 ) && random->RandomInt( 0, 100 ) < 20 )
{
// If I COULD throw a grenade and I need to reload, 20% chance I'll throw a grenade before I hide to reload.
return SCHED_COMBINE_GRENADE_AND_RELOAD;
}
// No running away in the citadel!
if ( ShouldChargePlayer() )
return SCHED_RELOAD;
return SCHED_COMBINE_HIDE_AND_RELOAD;
}
break;
case SCHED_RANGE_ATTACK1:
{
if ( HasCondition( COND_NO_PRIMARY_AMMO ) || HasCondition( COND_LOW_PRIMARY_AMMO ) )
{
// Ditch the strategy slot for attacking (which we just reserved!)
VacateStrategySlot();
return TranslateSchedule( SCHED_HIDE_AND_RELOAD );
}
if( CanAltFireEnemy(true) && OccupyStrategySlot(SQUAD_SLOT_SPECIAL_ATTACK) )
{
// Since I'm holding this squadslot, no one else can try right now. If I die before the shot
// goes off, I won't have affected anyone else's ability to use this attack at their nearest
// convenience.
return SCHED_COMBINE_AR2_ALTFIRE;
}
if ( IsCrouching() || ( CrouchIsDesired() && !HasCondition( COND_HEAVY_DAMAGE ) ) )
{
// See if we can crouch and shoot
if (GetEnemy() != NULL)
{
float dist = (GetLocalOrigin() - GetEnemy()->GetLocalOrigin()).Length();
// only crouch if they are relatively far away
if (dist > COMBINE_MIN_CROUCH_DISTANCE)
{
// try crouching
Crouch();
Vector targetPos = GetEnemy()->BodyTarget(GetActiveWeapon()->GetLocalOrigin());
// if we can't see it crouched, stand up
if (!WeaponLOSCondition(GetLocalOrigin(),targetPos,false))
{
Stand();
}
}
}
}
else
{
// always assume standing
Stand();
}
return SCHED_COMBINE_RANGE_ATTACK1;
}
case SCHED_RANGE_ATTACK2:
{
// If my weapon can range attack 2 use the weapon
if (GetActiveWeapon() && GetActiveWeapon()->CapabilitiesGet() & bits_CAP_WEAPON_RANGE_ATTACK2)
{
return SCHED_RANGE_ATTACK2;
}
// Otherwise use innate attack
else
{
return SCHED_COMBINE_RANGE_ATTACK2;
}
}
// SCHED_COMBAT_FACE:
// SCHED_COMBINE_WAIT_FACE_ENEMY:
// SCHED_COMBINE_SWEEP:
// SCHED_COMBINE_COVER_AND_RELOAD:
// SCHED_COMBINE_FOUND_ENEMY:
case SCHED_VICTORY_DANCE:
{
return SCHED_COMBINE_VICTORY_DANCE;
}
case SCHED_COMBINE_SUPPRESS:
{
#define MIN_SIGNAL_DIST 256
if ( GetEnemy() != NULL && GetEnemy()->IsPlayer() && m_bFirstEncounter )
{
float flDistToEnemy = ( GetEnemy()->GetAbsOrigin() - GetAbsOrigin() ).Length();
if( flDistToEnemy >= MIN_SIGNAL_DIST )
{
m_bFirstEncounter = false;// after first encounter, leader won't issue handsigns anymore when he has a new enemy
return SCHED_COMBINE_SIGNAL_SUPPRESS;
}
}
return SCHED_COMBINE_SUPPRESS;
}
case SCHED_FAIL:
{
if ( GetEnemy() != NULL )
{
return SCHED_COMBINE_COMBAT_FAIL;
}
return SCHED_FAIL;
}
case SCHED_COMBINE_PATROL:
{
// If I have an enemy, don't go off into random patrol mode.
if ( GetEnemy() && GetEnemy()->IsAlive() )
return SCHED_COMBINE_PATROL_ENEMY;
return SCHED_COMBINE_PATROL;
}
}
return BaseClass::TranslateSchedule( scheduleType );
}
//=========================================================
//=========================================================
void CNPC_Combine::OnStartSchedule( int scheduleType )
{
}
//=========================================================
// HandleAnimEvent - catches the monster-specific messages
// that occur when tagged animation frames are played.
//=========================================================
void CNPC_Combine::HandleAnimEvent( animevent_t *pEvent )
{
Vector vecShootDir;
Vector vecShootOrigin;
bool handledEvent = false;
if (pEvent->type & AE_TYPE_NEWEVENTSYSTEM)
{
if ( pEvent->event == COMBINE_AE_BEGIN_ALTFIRE )
{
EmitSound( "Weapon_CombineGuard.Special1" );
handledEvent = true;
}
else if ( pEvent->event == COMBINE_AE_ALTFIRE )
{
if( IsElite() )
{
animevent_t fakeEvent;
fakeEvent.pSource = this;
fakeEvent.event = EVENT_WEAPON_AR2_ALTFIRE;
GetActiveWeapon()->Operator_HandleAnimEvent( &fakeEvent, this );
// Stop other squad members from combine balling for a while.
DelaySquadAltFireAttack( 10.0f );
// I'm disabling this decrementor. At the time of this change, the elites
// don't bother to check if they have grenades anyway. This means that all
// elites have infinite combine balls, even if the designer marks the elite
// as having 0 grenades. By disabling this decrementor, yet enabling the code
// that makes sure the elite has grenades in order to fire a combine ball, we
// preserve the legacy behavior while making it possible for a designer to prevent
// elites from shooting combine balls by setting grenades to '0' in hammer. (sjb) EP2_OUTLAND_10
// m_iNumGrenades--;
}
handledEvent = true;
}
else
{
BaseClass::HandleAnimEvent( pEvent );
}
}
else
{
switch( pEvent->event )
{
case COMBINE_AE_AIM:
{
handledEvent = true;
break;
}
case COMBINE_AE_RELOAD:
// We never actually run out of ammo, just need to refill the clip
if (GetActiveWeapon())
{
GetActiveWeapon()->WeaponSound( RELOAD_NPC );
GetActiveWeapon()->m_iClip1 = GetActiveWeapon()->GetMaxClip1();
GetActiveWeapon()->m_iClip2 = GetActiveWeapon()->GetMaxClip2();
}
ClearCondition(COND_LOW_PRIMARY_AMMO);
ClearCondition(COND_NO_PRIMARY_AMMO);
ClearCondition(COND_NO_SECONDARY_AMMO);
handledEvent = true;
break;
case COMBINE_AE_GREN_TOSS:
{
Vector vecSpin;
vecSpin.x = random->RandomFloat( -1000.0, 1000.0 );
vecSpin.y = random->RandomFloat( -1000.0, 1000.0 );
vecSpin.z = random->RandomFloat( -1000.0, 1000.0 );
Vector vecStart;
GetAttachment( "lefthand", vecStart );
if( m_NPCState == NPC_STATE_SCRIPT )
{
// Use a fixed velocity for grenades thrown in scripted state.
// Grenades thrown from a script do not count against grenades remaining for the AI to use.
Vector forward, up, vecThrow;
GetVectors( &forward, NULL, &up );
vecThrow = forward * 750 + up * 175;
Fraggrenade_Create( vecStart, vec3_angle, vecThrow, vecSpin, this, COMBINE_GRENADE_TIMER, true );
}
else
{
// Use the Velocity that AI gave us.
Fraggrenade_Create( vecStart, vec3_angle, m_vecTossVelocity, vecSpin, this, COMBINE_GRENADE_TIMER, true );
m_iNumGrenades--;
}
// wait six seconds before even looking again to see if a grenade can be thrown.
m_flNextGrenadeCheck = gpGlobals->curtime + 6;
}
handledEvent = true;
break;
case COMBINE_AE_GREN_LAUNCH:
{
EmitSound( "NPC_Combine.GrenadeLaunch" );
CBaseEntity *pGrenade = CreateNoSpawn( "npc_contactgrenade", Weapon_ShootPosition(), vec3_angle, this );
pGrenade->KeyValue( "velocity", m_vecTossVelocity );
pGrenade->Spawn( );
if ( g_pGameRules->IsSkillLevel(SKILL_HARD) )
m_flNextGrenadeCheck = gpGlobals->curtime + random->RandomFloat( 2, 5 );// wait a random amount of time before shooting again
else
m_flNextGrenadeCheck = gpGlobals->curtime + 6;// wait six seconds before even looking again to see if a grenade can be thrown.
}
handledEvent = true;
break;
case COMBINE_AE_GREN_DROP:
{
Vector vecStart;
GetAttachment( "lefthand", vecStart );
Fraggrenade_Create( vecStart, vec3_angle, m_vecTossVelocity, vec3_origin, this, COMBINE_GRENADE_TIMER, true );
m_iNumGrenades--;
}
handledEvent = true;
break;
case COMBINE_AE_KICK:
{
// Does no damage, because damage is applied based upon whether the target can handle the interaction
CBaseEntity *pHurt = CheckTraceHullAttack( 70, -Vector(16,16,18), Vector(16,16,18), 0, DMG_CLUB );
CBaseCombatCharacter* pBCC = ToBaseCombatCharacter( pHurt );
if (pBCC)
{
Vector forward, up;
AngleVectors( GetLocalAngles(), &forward, NULL, &up );
if ( !pBCC->DispatchInteraction( g_interactionCombineBash, NULL, this ) )
{
if ( pBCC->IsPlayer() )
{
pBCC->ViewPunch( QAngle(-12,-7,0) );
pHurt->ApplyAbsVelocityImpulse( forward * 100 + up * 50 );
}
CTakeDamageInfo info( this, this, m_nKickDamage, DMG_CLUB );
CalculateMeleeDamageForce( &info, forward, pBCC->GetAbsOrigin() );
pBCC->TakeDamage( info );
EmitSound( "NPC_Combine.WeaponBash" );
}
}
m_Sentences.Speak( "COMBINE_KICK" );
handledEvent = true;
break;
}
case COMBINE_AE_CAUGHT_ENEMY:
m_Sentences.Speak( "COMBINE_ALERT" );
handledEvent = true;
break;
default:
BaseClass::HandleAnimEvent( pEvent );
break;
}
}
if( handledEvent )
{
m_iLastAnimEventHandled = pEvent->event;
}
}
//-----------------------------------------------------------------------------
// Purpose: Get shoot position of BCC at an arbitrary position
// Input :
// Output :
//-----------------------------------------------------------------------------
Vector CNPC_Combine::Weapon_ShootPosition( )
{
bool bStanding = !IsCrouching();
Vector right;
GetVectors( NULL, &right, NULL );
if ((CapabilitiesGet() & bits_CAP_DUCK) )
{
if ( IsCrouchedActivity( GetActivity() ) )
{
bStanding = false;
}
}
// FIXME: rename this "estimated" since it's not based on animation
// FIXME: the orientation won't be correct when testing from arbitary positions for arbitary angles
if ( bStanding )
{
if( HasShotgun() )
{
return GetAbsOrigin() + COMBINE_SHOTGUN_STANDING_POSITION + right * 8;
}
else
{
return GetAbsOrigin() + COMBINE_GUN_STANDING_POSITION + right * 8;
}
}
else
{
if( HasShotgun() )
{
return GetAbsOrigin() + COMBINE_SHOTGUN_CROUCHING_POSITION + right * 8;
}
else
{
return GetAbsOrigin() + COMBINE_GUN_CROUCHING_POSITION + right * 8;
}
}
}
//=========================================================
// Speak Sentence - say your cued up sentence.
//
// Some grunt sentences (take cover and charge) rely on actually
// being able to execute the intended action. It's really lame
// when a grunt says 'COVER ME' and then doesn't move. The problem
// is that the sentences were played when the decision to TRY
// to move to cover was made. Now the sentence is played after
// we know for sure that there is a valid path. The schedule
// may still fail but in most cases, well after the grunt has
// started moving.
//=========================================================
void CNPC_Combine::SpeakSentence( int sentenceType )
{
switch( sentenceType )
{
case 0: // assault
AnnounceAssault();
break;
case 1: // Flanking the player
// If I'm moving more than 20ft, I need to talk about it
if ( GetNavigator()->GetPath()->GetPathLength() > 20 * 12.0f )
{
m_Sentences.Speak( "COMBINE_FLANK" );
}
break;
}
}
//=========================================================
// PainSound
//=========================================================
void CNPC_Combine::PainSound ( void )
{
// NOTE: The response system deals with this at the moment
if ( GetFlags() & FL_DISSOLVING )
return;
if ( gpGlobals->curtime > m_flNextPainSoundTime )
{
const char *pSentenceName = "COMBINE_PAIN";
float healthRatio = (float)GetHealth() / (float)GetMaxHealth();
if ( !HasMemory(bits_MEMORY_PAIN_LIGHT_SOUND) && healthRatio > 0.9 )
{
Remember( bits_MEMORY_PAIN_LIGHT_SOUND );
pSentenceName = "COMBINE_TAUNT";
}
else if ( !HasMemory(bits_MEMORY_PAIN_HEAVY_SOUND) && healthRatio < 0.25 )
{
Remember( bits_MEMORY_PAIN_HEAVY_SOUND );
pSentenceName = "COMBINE_COVER";
}
m_Sentences.Speak( pSentenceName, SENTENCE_PRIORITY_INVALID, SENTENCE_CRITERIA_ALWAYS );
m_flNextPainSoundTime = gpGlobals->curtime + 1;
}
}
//-----------------------------------------------------------------------------
// Purpose: implemented by subclasses to give them an opportunity to make
// a sound when they lose their enemy
// Input :
// Output :
//-----------------------------------------------------------------------------
void CNPC_Combine::LostEnemySound( void)
{
if ( gpGlobals->curtime <= m_flNextLostSoundTime )
return;
const char *pSentence;
if (!(CBaseEntity*)GetEnemy() || gpGlobals->curtime - GetEnemyLastTimeSeen() > 10)
{
pSentence = "COMBINE_LOST_LONG";
}
else
{
pSentence = "COMBINE_LOST_SHORT";
}
if ( m_Sentences.Speak( pSentence ) >= 0 )
{
m_flNextLostSoundTime = gpGlobals->curtime + random->RandomFloat(5.0,15.0);
}
}
//-----------------------------------------------------------------------------
// Purpose: implemented by subclasses to give them an opportunity to make
// a sound when they lose their enemy
// Input :
// Output :
//-----------------------------------------------------------------------------
void CNPC_Combine::FoundEnemySound( void)
{
m_Sentences.Speak( "COMBINE_REFIND_ENEMY", SENTENCE_PRIORITY_HIGH );
}
//-----------------------------------------------------------------------------
// Purpose: Implemented by subclasses to give them an opportunity to make
// a sound before they attack
// Input :
// Output :
//-----------------------------------------------------------------------------
// BUGBUG: It looks like this is never played because combine don't do SCHED_WAKE_ANGRY or anything else that does a TASK_SOUND_WAKE
void CNPC_Combine::AlertSound( void)
{
if ( gpGlobals->curtime > m_flNextAlertSoundTime )
{
m_Sentences.Speak( "COMBINE_GO_ALERT", SENTENCE_PRIORITY_HIGH );
m_flNextAlertSoundTime = gpGlobals->curtime + 10.0f;
}
}
//=========================================================
// NotifyDeadFriend
//=========================================================
void CNPC_Combine::NotifyDeadFriend ( CBaseEntity* pFriend )
{
if ( GetSquad()->NumMembers() < 2 )
{
m_Sentences.Speak( "COMBINE_LAST_OF_SQUAD", SENTENCE_PRIORITY_INVALID, SENTENCE_CRITERIA_NORMAL );
JustMadeSound();
return;
}
// relaxed visibility test so that guys say this more often
//if( FInViewCone( pFriend ) && FVisible( pFriend ) )
{
m_Sentences.Speak( "COMBINE_MAN_DOWN" );
}
BaseClass::NotifyDeadFriend(pFriend);
}
//=========================================================
// DeathSound
//=========================================================
void CNPC_Combine::DeathSound ( void )
{
// NOTE: The response system deals with this at the moment
if ( GetFlags() & FL_DISSOLVING )
return;
m_Sentences.Speak( "COMBINE_DIE", SENTENCE_PRIORITY_INVALID, SENTENCE_CRITERIA_ALWAYS );
}
//=========================================================
// IdleSound
//=========================================================
void CNPC_Combine::IdleSound( void )
{
if (g_fCombineQuestion || random->RandomInt(0,1))
{
if (!g_fCombineQuestion)
{
// ask question or make statement
switch (random->RandomInt(0,2))
{
case 0: // check in
if ( m_Sentences.Speak( "COMBINE_CHECK" ) >= 0 )
{
g_fCombineQuestion = 1;
}
break;
case 1: // question
if ( m_Sentences.Speak( "COMBINE_QUEST" ) >= 0 )
{
g_fCombineQuestion = 2;
}
break;
case 2: // statement
m_Sentences.Speak( "COMBINE_IDLE" );
break;
}
}
else
{
switch (g_fCombineQuestion)
{
case 1: // check in
if ( m_Sentences.Speak( "COMBINE_CLEAR" ) >= 0 )
{
g_fCombineQuestion = 0;
}
break;
case 2: // question
if ( m_Sentences.Speak( "COMBINE_ANSWER" ) >= 0 )
{
g_fCombineQuestion = 0;
}
break;
}
}
}
}
//-----------------------------------------------------------------------------
// Purpose:
//
// This is for Grenade attacks. As the test for grenade attacks
// is expensive we don't want to do it every frame. Return true
// if we meet minimum set of requirements and then test for actual
// throw later if we actually decide to do a grenade attack.
// Input :
// Output :
//-----------------------------------------------------------------------------
int CNPC_Combine::RangeAttack2Conditions( float flDot, float flDist )
{
return COND_NONE;
}
//-----------------------------------------------------------------------------
// Purpose: Return true if the combine has grenades, hasn't checked lately, and
// can throw a grenade at the target point.
// Input : &vecTarget -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CNPC_Combine::CanThrowGrenade( const Vector &vecTarget )
{
if( m_iNumGrenades < 1 )
{
// Out of grenades!
return false;
}
if (gpGlobals->curtime < m_flNextGrenadeCheck )
{
// Not allowed to throw another grenade right now.
return false;
}
float flDist;
flDist = ( vecTarget - GetAbsOrigin() ).Length();
if( flDist > 1024 || flDist < 128 )
{
// Too close or too far!
m_flNextGrenadeCheck = gpGlobals->curtime + 1; // one full second.
return false;
}
// -----------------------
// If moving, don't check.
// -----------------------
if ( m_flGroundSpeed != 0 )
return false;
#if 0
Vector vecEnemyLKP = GetEnemyLKP();
if ( !( GetEnemy()->GetFlags() & FL_ONGROUND ) && GetEnemy()->GetWaterLevel() == 0 && vecEnemyLKP.z > (GetAbsOrigin().z + WorldAlignMaxs().z) )
{
//!!!BUGBUG - we should make this check movetype and make sure it isn't FLY? Players who jump a lot are unlikely to
// be grenaded.
// don't throw grenades at anything that isn't on the ground!
return COND_NONE;
}
#endif
// ---------------------------------------------------------------------
// Are any of my squad members near the intended grenade impact area?
// ---------------------------------------------------------------------
if ( m_pSquad )
{
if (m_pSquad->SquadMemberInRange( vecTarget, COMBINE_MIN_GRENADE_CLEAR_DIST ))
{
// crap, I might blow my own guy up. Don't throw a grenade and don't check again for a while.
m_flNextGrenadeCheck = gpGlobals->curtime + 1; // one full second.
// Tell my squad members to clear out so I can get a grenade in
CSoundEnt::InsertSound( SOUND_MOVE_AWAY | SOUND_CONTEXT_COMBINE_ONLY, vecTarget, COMBINE_MIN_GRENADE_CLEAR_DIST, 0.1 );
return false;
}
}
return CheckCanThrowGrenade( vecTarget );
}
//-----------------------------------------------------------------------------
// Purpose: Returns true if the combine can throw a grenade at the specified target point
// Input : &vecTarget -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CNPC_Combine::CheckCanThrowGrenade( const Vector &vecTarget )
{
//NDebugOverlay::Line( EyePosition(), vecTarget, 0, 255, 0, false, 5 );
// ---------------------------------------------------------------------
// Check that throw is legal and clear
// ---------------------------------------------------------------------
// FIXME: this is only valid for hand grenades, not RPG's
Vector vecToss;
Vector vecMins = -Vector(4,4,4);
Vector vecMaxs = Vector(4,4,4);
if( FInViewCone( vecTarget ) && CBaseEntity::FVisible( vecTarget ) )
{
vecToss = VecCheckThrow( this, EyePosition(), vecTarget, COMBINE_GRENADE_THROW_SPEED, 1.0, &vecMins, &vecMaxs );
}
else
{
// Have to try a high toss. Do I have enough room?
trace_t tr;
AI_TraceLine( EyePosition(), EyePosition() + Vector( 0, 0, 64 ), MASK_SHOT, this, COLLISION_GROUP_NONE, &tr );
if( tr.fraction != 1.0 )
{
return false;
}
vecToss = VecCheckToss( this, EyePosition(), vecTarget, -1, 1.0, true, &vecMins, &vecMaxs );
}
if ( vecToss != vec3_origin )
{
m_vecTossVelocity = vecToss;
// don't check again for a while.
m_flNextGrenadeCheck = gpGlobals->curtime + 1; // 1/3 second.
return true;
}
else
{
// don't check again for a while.
m_flNextGrenadeCheck = gpGlobals->curtime + 1; // one full second.
return false;
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool CNPC_Combine::CanAltFireEnemy( bool bUseFreeKnowledge )
{
if (!IsElite() )
return false;
if (IsCrouching())
return false;
if( gpGlobals->curtime < m_flNextAltFireTime )
return false;
if( !GetEnemy() )
return false;
if (gpGlobals->curtime < m_flNextGrenadeCheck )
return false;
// See Steve Bond if you plan on changing this next piece of code!! (SJB) EP2_OUTLAND_10
if (m_iNumGrenades < 1)
return false;
CBaseEntity *pEnemy = GetEnemy();
if( !pEnemy->IsPlayer() && (!pEnemy->IsNPC() || !pEnemy->MyNPCPointer()->IsPlayerAlly()) )
return false;
Vector vecTarget;
// Determine what point we're shooting at
if( bUseFreeKnowledge )
{
vecTarget = GetEnemies()->LastKnownPosition( pEnemy ) + (pEnemy->GetViewOffset()*0.75);// approximates the chest
}
else
{
vecTarget = GetEnemies()->LastSeenPosition( pEnemy ) + (pEnemy->GetViewOffset()*0.75);// approximates the chest
}
// Trace a hull about the size of the combine ball (don't shoot through grates!)
trace_t tr;
Vector mins( -12, -12, -12 );
Vector maxs( 12, 12, 12 );
Vector vShootPosition = EyePosition();
if ( GetActiveWeapon() )
{
GetActiveWeapon()->GetAttachment( "muzzle", vShootPosition );
}
// Trace a hull about the size of the combine ball.
UTIL_TraceHull( vShootPosition, vecTarget, mins, maxs, MASK_SHOT, this, COLLISION_GROUP_NONE, &tr );
float flLength = (vShootPosition - vecTarget).Length();
flLength *= tr.fraction;
//If the ball can travel at least 65% of the distance to the player then let the NPC shoot it.
if( tr.fraction >= 0.65 && flLength > 128.0f )
{
// Target is valid
m_vecAltFireTarget = vecTarget;
return true;
}
// Check again later
m_vecAltFireTarget = vec3_origin;
m_flNextGrenadeCheck = gpGlobals->curtime + 1.0f;
return false;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool CNPC_Combine::CanGrenadeEnemy( bool bUseFreeKnowledge )
{
if( IsElite() )
return false;
CBaseEntity *pEnemy = GetEnemy();
Assert( pEnemy != NULL );
if( pEnemy )
{
// I'm not allowed to throw grenades during dustoff
if ( IsCurSchedule(SCHED_DROPSHIP_DUSTOFF) )
return false;
if( bUseFreeKnowledge )
{
// throw to where we think they are.
return CanThrowGrenade( GetEnemies()->LastKnownPosition( pEnemy ) );
}
else
{
// hafta throw to where we last saw them.
return CanThrowGrenade( GetEnemies()->LastSeenPosition( pEnemy ) );
}
}
return false;
}
//-----------------------------------------------------------------------------
// Purpose: For combine melee attack (kick/hit)
// Input :
// Output :
//-----------------------------------------------------------------------------
int CNPC_Combine::MeleeAttack1Conditions ( float flDot, float flDist )
{
if (flDist > 64)
{
return COND_NONE; // COND_TOO_FAR_TO_ATTACK;
}
else if (flDot < 0.7)
{
return COND_NONE; // COND_NOT_FACING_ATTACK;
}
// Check Z
if ( GetEnemy() && fabs(GetEnemy()->GetAbsOrigin().z - GetAbsOrigin().z) > 64 )
return COND_NONE;
if ( dynamic_cast<CBaseHeadcrab *>(GetEnemy()) != NULL )
{
return COND_NONE;
}
// Make sure not trying to kick through a window or something.
trace_t tr;
Vector vecSrc, vecEnd;
vecSrc = WorldSpaceCenter();
vecEnd = GetEnemy()->WorldSpaceCenter();
AI_TraceLine(vecSrc, vecEnd, MASK_SHOT, this, COLLISION_GROUP_NONE, &tr);
if( tr.m_pEnt != GetEnemy() )
{
return COND_NONE;
}
return COND_CAN_MELEE_ATTACK1;
}
//-----------------------------------------------------------------------------
// Purpose:
// Output : Vector
//-----------------------------------------------------------------------------
Vector CNPC_Combine::EyePosition( void )
{
if ( !IsCrouching() )
{
return GetAbsOrigin() + COMBINE_EYE_STANDING_POSITION;
}
else
{
return GetAbsOrigin() + COMBINE_EYE_CROUCHING_POSITION;
}
/*
Vector m_EyePos;
GetAttachment( "eyes", m_EyePos );
return m_EyePos;
*/
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
Vector CNPC_Combine::GetAltFireTarget()
{
Assert( IsElite() );
return m_vecAltFireTarget;
}
//-----------------------------------------------------------------------------
// Purpose:
// Input : nActivity -
// Output : Vector
//-----------------------------------------------------------------------------
Vector CNPC_Combine::EyeOffset( Activity nActivity )
{
if (CapabilitiesGet() & bits_CAP_DUCK)
{
if ( IsCrouchedActivity( nActivity ) )
return COMBINE_EYE_CROUCHING_POSITION;
}
// if the hint doesn't tell anything, assume current state
if ( !IsCrouching() )
{
return COMBINE_EYE_STANDING_POSITION;
}
else
{
return COMBINE_EYE_CROUCHING_POSITION;
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
Vector CNPC_Combine::GetCrouchEyeOffset( void )
{
return COMBINE_EYE_CROUCHING_POSITION;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CNPC_Combine::SetActivity( Activity NewActivity )
{
BaseClass::SetActivity( NewActivity );
m_iLastAnimEventHandled = -1;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
NPC_STATE CNPC_Combine::SelectIdealState( void )
{
switch ( m_NPCState )
{
case NPC_STATE_COMBAT:
{
if ( GetEnemy() == NULL )
{
if ( !HasCondition( COND_ENEMY_DEAD ) )
{
// Lost track of my enemy. Patrol.
SetCondition( COND_COMBINE_SHOULD_PATROL );
}
return NPC_STATE_ALERT;
}
else if ( HasCondition( COND_ENEMY_DEAD ) )
{
AnnounceEnemyKill(GetEnemy());
}
}
default:
{
return BaseClass::SelectIdealState();
}
}
return GetIdealState();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool CNPC_Combine::OnBeginMoveAndShoot()
{
if ( BaseClass::OnBeginMoveAndShoot() )
{
if( HasStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
return true; // already have the slot I need
if( !HasStrategySlotRange( SQUAD_SLOT_GRENADE1, SQUAD_SLOT_ATTACK_OCCLUDER ) && OccupyStrategySlotRange( SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2 ) )
return true;
}
return false;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CNPC_Combine::OnEndMoveAndShoot()
{
VacateStrategySlot();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
WeaponProficiency_t CNPC_Combine::CalcWeaponProficiency( CBaseCombatWeapon *pWeapon )
{
if( FClassnameIs( pWeapon, "weapon_ar2" ) )
{
if( hl2_episodic.GetBool() )
{
return WEAPON_PROFICIENCY_VERY_GOOD;
}
else
{
return WEAPON_PROFICIENCY_GOOD;
}
}
else if( FClassnameIs( pWeapon, "weapon_shotgun" ) )
{
if( m_nSkin != COMBINE_SKIN_SHOTGUNNER )
{
m_nSkin = COMBINE_SKIN_SHOTGUNNER;
}
return WEAPON_PROFICIENCY_PERFECT;
}
else if( FClassnameIs( pWeapon, "weapon_smg1" ) )
{
return WEAPON_PROFICIENCY_GOOD;
}
return BaseClass::CalcWeaponProficiency( pWeapon );
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool CNPC_Combine::HasShotgun()
{
if( GetActiveWeapon() && GetActiveWeapon()->m_iClassname == s_iszShotgunClassname )
{
return true;
}
return false;
}
//-----------------------------------------------------------------------------
// Only supports weapons that use clips.
//-----------------------------------------------------------------------------
bool CNPC_Combine::ActiveWeaponIsFullyLoaded()
{
CBaseCombatWeapon *pWeapon = GetActiveWeapon();
if( !pWeapon )
return false;
if( !pWeapon->UsesClipsForAmmo1() )
return false;
return ( pWeapon->Clip1() >= pWeapon->GetMaxClip1() );
}
//-----------------------------------------------------------------------------
// Purpose: This is a generic function (to be implemented by sub-classes) to
// handle specific interactions between different types of characters
// (For example the barnacle grabbing an NPC)
// Input : The type of interaction, extra info pointer, and who started it
// Output : true - if sub-class has a response for the interaction
// false - if sub-class has no response
//-----------------------------------------------------------------------------
bool CNPC_Combine::HandleInteraction(int interactionType, void *data, CBaseCombatCharacter *sourceEnt)
{
if ( interactionType == g_interactionTurretStillStanding )
{
// A turret that I've kicked recently is still standing 5 seconds later.
if ( sourceEnt == GetEnemy() )
{
// It's still my enemy. Time to grenade it.
Vector forward, up;
AngleVectors( GetLocalAngles(), &forward, NULL, &up );
m_vecTossVelocity = forward * 10;
SetCondition( COND_COMBINE_DROP_GRENADE );
ClearSchedule( "Failed to kick over turret" );
}
return true;
}
return BaseClass::HandleInteraction( interactionType, data, sourceEnt );
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
const char* CNPC_Combine::GetSquadSlotDebugName( int iSquadSlot )
{
switch( iSquadSlot )
{
case SQUAD_SLOT_GRENADE1: return "SQUAD_SLOT_GRENADE1";
break;
case SQUAD_SLOT_GRENADE2: return "SQUAD_SLOT_GRENADE2";
break;
case SQUAD_SLOT_ATTACK_OCCLUDER: return "SQUAD_SLOT_ATTACK_OCCLUDER";
break;
case SQUAD_SLOT_OVERWATCH: return "SQUAD_SLOT_OVERWATCH";
break;
}
return BaseClass::GetSquadSlotDebugName( iSquadSlot );
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
bool CNPC_Combine::IsUsingTacticalVariant( int variant )
{
if( variant == TACTICAL_VARIANT_PRESSURE_ENEMY && m_iTacticalVariant == TACTICAL_VARIANT_PRESSURE_ENEMY_UNTIL_CLOSE )
{
// Essentially, fib. Just say that we are a 'pressure enemy' soldier.
return true;
}
return m_iTacticalVariant == variant;
}
//-----------------------------------------------------------------------------
// For the purpose of determining whether to use a pathfinding variant, this
// function determines whether the current schedule is a schedule that
// 'approaches' the enemy.
//-----------------------------------------------------------------------------
bool CNPC_Combine::IsRunningApproachEnemySchedule()
{
if( IsCurSchedule( SCHED_CHASE_ENEMY ) )
return true;
if( IsCurSchedule( SCHED_ESTABLISH_LINE_OF_FIRE ) )
return true;
if( IsCurSchedule( SCHED_COMBINE_PRESS_ATTACK, false ) )
return true;
return false;
}
bool CNPC_Combine::ShouldPickADeathPose( void )
{
return !IsCrouching();
}
//-----------------------------------------------------------------------------
//
// Schedules
//
//-----------------------------------------------------------------------------
AI_BEGIN_CUSTOM_NPC( npc_combine, CNPC_Combine )
//Tasks
DECLARE_TASK( TASK_COMBINE_FACE_TOSS_DIR )
DECLARE_TASK( TASK_COMBINE_IGNORE_ATTACKS )
DECLARE_TASK( TASK_COMBINE_SIGNAL_BEST_SOUND )
DECLARE_TASK( TASK_COMBINE_DEFER_SQUAD_GRENADES )
DECLARE_TASK( TASK_COMBINE_CHASE_ENEMY_CONTINUOUSLY )
DECLARE_TASK( TASK_COMBINE_DIE_INSTANTLY )
DECLARE_TASK( TASK_COMBINE_PLAY_SEQUENCE_FACE_ALTFIRE_TARGET )
DECLARE_TASK( TASK_COMBINE_GET_PATH_TO_FORCED_GREN_LOS )
DECLARE_TASK( TASK_COMBINE_SET_STANDING )
//Activities
DECLARE_ACTIVITY( ACT_COMBINE_THROW_GRENADE )
DECLARE_ACTIVITY( ACT_COMBINE_LAUNCH_GRENADE )
DECLARE_ACTIVITY( ACT_COMBINE_BUGBAIT )
DECLARE_ACTIVITY( ACT_COMBINE_AR2_ALTFIRE )
DECLARE_ACTIVITY( ACT_WALK_EASY )
DECLARE_ACTIVITY( ACT_WALK_MARCH )
DECLARE_ANIMEVENT( COMBINE_AE_BEGIN_ALTFIRE )
DECLARE_ANIMEVENT( COMBINE_AE_ALTFIRE )
DECLARE_SQUADSLOT( SQUAD_SLOT_GRENADE1 )
DECLARE_SQUADSLOT( SQUAD_SLOT_GRENADE2 )
DECLARE_CONDITION( COND_COMBINE_NO_FIRE )
DECLARE_CONDITION( COND_COMBINE_DEAD_FRIEND )
DECLARE_CONDITION( COND_COMBINE_SHOULD_PATROL )
DECLARE_CONDITION( COND_COMBINE_HIT_BY_BUGBAIT )
DECLARE_CONDITION( COND_COMBINE_DROP_GRENADE )
DECLARE_CONDITION( COND_COMBINE_ON_FIRE )
DECLARE_CONDITION( COND_COMBINE_ATTACK_SLOT_AVAILABLE )
DECLARE_INTERACTION( g_interactionCombineBash );
//=========================================================
// SCHED_COMBINE_TAKE_COVER_FROM_BEST_SOUND
//
// hide from the loudest sound source (to run from grenade)
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_TAKE_COVER_FROM_BEST_SOUND,
" Tasks"
" TASK_SET_FAIL_SCHEDULE SCHEDULE:SCHED_COMBINE_RUN_AWAY_FROM_BEST_SOUND"
" TASK_STOP_MOVING 0"
" TASK_COMBINE_SIGNAL_BEST_SOUND 0"
" TASK_FIND_COVER_FROM_BEST_SOUND 0"
" TASK_RUN_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" TASK_REMEMBER MEMORY:INCOVER"
" TASK_FACE_REASONABLE 0"
""
" Interrupts"
)
DEFINE_SCHEDULE
(
SCHED_COMBINE_RUN_AWAY_FROM_BEST_SOUND,
" Tasks"
" TASK_SET_FAIL_SCHEDULE SCHEDULE:SCHED_COWER"
" TASK_GET_PATH_AWAY_FROM_BEST_SOUND 600"
" TASK_RUN_PATH_TIMED 2"
" TASK_STOP_MOVING 0"
""
" Interrupts"
)
//=========================================================
// SCHED_COMBINE_COMBAT_FAIL
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_COMBAT_FAIL,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_SET_ACTIVITY ACTIVITY:ACT_IDLE "
" TASK_WAIT_FACE_ENEMY 2"
" TASK_WAIT_PVS 0"
""
" Interrupts"
" COND_CAN_RANGE_ATTACK1"
" COND_CAN_RANGE_ATTACK2"
" COND_CAN_MELEE_ATTACK1"
" COND_CAN_MELEE_ATTACK2"
)
//=========================================================
// SCHED_COMBINE_VICTORY_DANCE
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_VICTORY_DANCE,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_FACE_ENEMY 0"
" TASK_WAIT 1.5"
" TASK_GET_PATH_TO_ENEMY_CORPSE 0"
" TASK_WALK_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" TASK_FACE_ENEMY 0"
" TASK_PLAY_SEQUENCE ACTIVITY:ACT_VICTORY_DANCE"
""
" Interrupts"
" COND_NEW_ENEMY"
" COND_LIGHT_DAMAGE"
" COND_HEAVY_DAMAGE"
)
//=========================================================
// SCHED_COMBINE_ASSAULT
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_ASSAULT,
" Tasks "
" TASK_SET_FAIL_SCHEDULE SCHEDULE:SCHED_COMBINE_ESTABLISH_LINE_OF_FIRE"
" TASK_SET_TOLERANCE_DISTANCE 48"
" TASK_GET_PATH_TO_ENEMY_LKP 0"
" TASK_COMBINE_IGNORE_ATTACKS 0.2"
" TASK_SPEAK_SENTENCE 0"
" TASK_RUN_PATH 0"
// " TASK_COMBINE_MOVE_AND_AIM 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" TASK_COMBINE_IGNORE_ATTACKS 0.0"
""
" Interrupts "
" COND_NEW_ENEMY"
" COND_ENEMY_DEAD"
" COND_ENEMY_UNREACHABLE"
" COND_CAN_RANGE_ATTACK1"
" COND_CAN_MELEE_ATTACK1"
" COND_CAN_RANGE_ATTACK2"
" COND_CAN_MELEE_ATTACK2"
" COND_TOO_FAR_TO_ATTACK"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
)
DEFINE_SCHEDULE
(
SCHED_COMBINE_ESTABLISH_LINE_OF_FIRE,
" Tasks "
" TASK_SET_FAIL_SCHEDULE SCHEDULE:SCHED_FAIL_ESTABLISH_LINE_OF_FIRE"
" TASK_SET_TOLERANCE_DISTANCE 48"
" TASK_GET_PATH_TO_ENEMY_LKP_LOS 0"
" TASK_COMBINE_SET_STANDING 1"
" TASK_SPEAK_SENTENCE 1"
" TASK_RUN_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" TASK_COMBINE_IGNORE_ATTACKS 0.0"
" TASK_SET_SCHEDULE SCHEDULE:SCHED_COMBAT_FACE"
" "
" Interrupts "
" COND_NEW_ENEMY"
" COND_ENEMY_DEAD"
//" COND_CAN_RANGE_ATTACK1"
//" COND_CAN_RANGE_ATTACK2"
" COND_CAN_MELEE_ATTACK1"
" COND_CAN_MELEE_ATTACK2"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
" COND_HEAVY_DAMAGE"
)
//=========================================================
// SCHED_COMBINE_PRESS_ATTACK
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_PRESS_ATTACK,
" Tasks "
" TASK_SET_FAIL_SCHEDULE SCHEDULE:SCHED_COMBINE_ESTABLISH_LINE_OF_FIRE"
" TASK_SET_TOLERANCE_DISTANCE 72"
" TASK_GET_PATH_TO_ENEMY_LKP 0"
" TASK_COMBINE_SET_STANDING 1"
" TASK_RUN_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
""
" Interrupts "
" COND_NEW_ENEMY"
" COND_ENEMY_DEAD"
" COND_ENEMY_UNREACHABLE"
" COND_NO_PRIMARY_AMMO"
" COND_LOW_PRIMARY_AMMO"
" COND_TOO_CLOSE_TO_ATTACK"
" COND_CAN_MELEE_ATTACK1"
" COND_CAN_MELEE_ATTACK2"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
)
//=========================================================
// SCHED_COMBINE_COMBAT_FACE
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_COMBAT_FACE,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_SET_ACTIVITY ACTIVITY:ACT_IDLE"
" TASK_FACE_ENEMY 0"
" TASK_WAIT 1.5"
//" TASK_SET_SCHEDULE SCHEDULE:SCHED_COMBINE_SWEEP"
""
" Interrupts"
" COND_NEW_ENEMY"
" COND_ENEMY_DEAD"
" COND_CAN_RANGE_ATTACK1"
" COND_CAN_RANGE_ATTACK2"
)
//=========================================================
// SCHED_HIDE_AND_RELOAD
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_HIDE_AND_RELOAD,
" Tasks"
" TASK_SET_FAIL_SCHEDULE SCHEDULE:SCHED_RELOAD"
" TASK_FIND_COVER_FROM_ENEMY 0"
" TASK_RUN_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" TASK_REMEMBER MEMORY:INCOVER"
" TASK_FACE_ENEMY 0"
" TASK_RELOAD 0"
""
" Interrupts"
" COND_CAN_MELEE_ATTACK1"
" COND_CAN_MELEE_ATTACK2"
" COND_HEAVY_DAMAGE"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
)
//=========================================================
// SCHED_COMBINE_SIGNAL_SUPPRESS
// don't stop shooting until the clip is
// empty or combine gets hurt.
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_SIGNAL_SUPPRESS,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_FACE_IDEAL 0"
" TASK_PLAY_SEQUENCE_FACE_ENEMY ACTIVITY:ACT_SIGNAL_GROUP"
" TASK_COMBINE_SET_STANDING 0"
" TASK_RANGE_ATTACK1 0"
""
" Interrupts"
" COND_ENEMY_DEAD"
" COND_LIGHT_DAMAGE"
" COND_HEAVY_DAMAGE"
" COND_NO_PRIMARY_AMMO"
" COND_WEAPON_BLOCKED_BY_FRIEND"
" COND_WEAPON_SIGHT_OCCLUDED"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
" COND_COMBINE_NO_FIRE"
)
//=========================================================
// SCHED_COMBINE_SUPPRESS
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_SUPPRESS,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_FACE_ENEMY 0"
" TASK_COMBINE_SET_STANDING 0"
" TASK_RANGE_ATTACK1 0"
""
" Interrupts"
" COND_ENEMY_DEAD"
" COND_LIGHT_DAMAGE"
" COND_HEAVY_DAMAGE"
" COND_NO_PRIMARY_AMMO"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
" COND_COMBINE_NO_FIRE"
" COND_WEAPON_BLOCKED_BY_FRIEND"
)
//=========================================================
// SCHED_COMBINE_ENTER_OVERWATCH
//
// Parks a combine soldier in place looking at the player's
// last known position, ready to attack if the player pops out
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_ENTER_OVERWATCH,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_COMBINE_SET_STANDING 0"
" TASK_SET_ACTIVITY ACTIVITY:ACT_IDLE"
" TASK_FACE_ENEMY 0"
" TASK_SET_SCHEDULE SCHEDULE:SCHED_COMBINE_OVERWATCH"
""
" Interrupts"
" COND_HEAR_DANGER"
" COND_NEW_ENEMY"
)
//=========================================================
// SCHED_COMBINE_OVERWATCH
//
// Parks a combine soldier in place looking at the player's
// last known position, ready to attack if the player pops out
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_OVERWATCH,
" Tasks"
" TASK_WAIT_FACE_ENEMY 10"
""
" Interrupts"
" COND_CAN_RANGE_ATTACK1"
" COND_ENEMY_DEAD"
" COND_LIGHT_DAMAGE"
" COND_HEAVY_DAMAGE"
" COND_NO_PRIMARY_AMMO"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
" COND_NEW_ENEMY"
)
//=========================================================
// SCHED_COMBINE_WAIT_IN_COVER
// we don't allow danger or the ability
// to attack to break a combine's run to cover schedule but
// when a combine is in cover we do want them to attack if they can.
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_WAIT_IN_COVER,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_COMBINE_SET_STANDING 0"
" TASK_SET_ACTIVITY ACTIVITY:ACT_IDLE" // Translated to cover
" TASK_WAIT_FACE_ENEMY 1"
""
" Interrupts"
" COND_NEW_ENEMY"
" COND_CAN_RANGE_ATTACK1"
" COND_CAN_RANGE_ATTACK2"
" COND_CAN_MELEE_ATTACK1"
" COND_CAN_MELEE_ATTACK2"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
" COND_COMBINE_ATTACK_SLOT_AVAILABLE"
)
//=========================================================
// SCHED_COMBINE_TAKE_COVER1
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_TAKE_COVER1 ,
" Tasks"
" TASK_SET_FAIL_SCHEDULE SCHEDULE:SCHED_COMBINE_TAKECOVER_FAILED"
" TASK_STOP_MOVING 0"
" TASK_WAIT 0.2"
" TASK_FIND_COVER_FROM_ENEMY 0"
" TASK_RUN_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" TASK_REMEMBER MEMORY:INCOVER"
" TASK_SET_SCHEDULE SCHEDULE:SCHED_COMBINE_WAIT_IN_COVER"
""
" Interrupts"
)
DEFINE_SCHEDULE
(
SCHED_COMBINE_TAKECOVER_FAILED,
" Tasks"
" TASK_STOP_MOVING 0"
""
" Interrupts"
)
//=========================================================
// SCHED_COMBINE_GRENADE_COVER1
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_GRENADE_COVER1,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_FIND_COVER_FROM_ENEMY 99"
" TASK_FIND_FAR_NODE_COVER_FROM_ENEMY 384"
" TASK_PLAY_SEQUENCE ACTIVITY:ACT_SPECIAL_ATTACK2"
" TASK_CLEAR_MOVE_WAIT 0"
" TASK_RUN_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" TASK_SET_SCHEDULE SCHEDULE:SCHED_COMBINE_WAIT_IN_COVER"
""
" Interrupts"
)
//=========================================================
// SCHED_COMBINE_TOSS_GRENADE_COVER1
//
// drop grenade then run to cover.
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_TOSS_GRENADE_COVER1,
" Tasks"
" TASK_FACE_ENEMY 0"
" TASK_RANGE_ATTACK2 0"
" TASK_SET_SCHEDULE SCHEDULE:SCHED_TAKE_COVER_FROM_ENEMY"
""
" Interrupts"
)
//=========================================================
// SCHED_COMBINE_RANGE_ATTACK1
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_RANGE_ATTACK1,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_FACE_ENEMY 0"
" TASK_ANNOUNCE_ATTACK 1" // 1 = primary attack
" TASK_WAIT_RANDOM 0.3"
" TASK_RANGE_ATTACK1 0"
" TASK_COMBINE_IGNORE_ATTACKS 0.5"
""
" Interrupts"
" COND_NEW_ENEMY"
" COND_ENEMY_DEAD"
" COND_HEAVY_DAMAGE"
" COND_LIGHT_DAMAGE"
" COND_LOW_PRIMARY_AMMO"
" COND_NO_PRIMARY_AMMO"
" COND_WEAPON_BLOCKED_BY_FRIEND"
" COND_TOO_CLOSE_TO_ATTACK"
" COND_GIVE_WAY"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
" COND_COMBINE_NO_FIRE"
""
// Enemy_Occluded Don't interrupt on this. Means
// comibine will fire where player was after
// he has moved for a little while. Good effect!!
// WEAPON_SIGHT_OCCLUDED Don't block on this! Looks better for railings, etc.
)
//=========================================================
// AR2 Alt Fire Attack
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_AR2_ALTFIRE,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_ANNOUNCE_ATTACK 1"
" TASK_COMBINE_PLAY_SEQUENCE_FACE_ALTFIRE_TARGET ACTIVITY:ACT_COMBINE_AR2_ALTFIRE"
""
" Interrupts"
)
//=========================================================
// Mapmaker forced grenade throw
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_FORCED_GRENADE_THROW,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_COMBINE_FACE_TOSS_DIR 0"
" TASK_ANNOUNCE_ATTACK 2" // 2 = grenade
" TASK_PLAY_SEQUENCE ACTIVITY:ACT_RANGE_ATTACK2"
" TASK_COMBINE_DEFER_SQUAD_GRENADES 0"
""
" Interrupts"
)
//=========================================================
// Move to LOS of the mapmaker's forced grenade throw target
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_MOVE_TO_FORCED_GREN_LOS,
" Tasks "
" TASK_SET_TOLERANCE_DISTANCE 48"
" TASK_COMBINE_GET_PATH_TO_FORCED_GREN_LOS 0"
" TASK_SPEAK_SENTENCE 1"
" TASK_RUN_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" "
" Interrupts "
" COND_NEW_ENEMY"
" COND_ENEMY_DEAD"
" COND_CAN_MELEE_ATTACK1"
" COND_CAN_MELEE_ATTACK2"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
" COND_HEAVY_DAMAGE"
)
//=========================================================
// SCHED_COMBINE_RANGE_ATTACK2
//
// secondary range attack. Overriden because base class stops attacking when the enemy is occluded.
// combines's grenade toss requires the enemy be occluded.
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_RANGE_ATTACK2,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_COMBINE_FACE_TOSS_DIR 0"
" TASK_ANNOUNCE_ATTACK 2" // 2 = grenade
" TASK_PLAY_SEQUENCE ACTIVITY:ACT_RANGE_ATTACK2"
" TASK_COMBINE_DEFER_SQUAD_GRENADES 0"
" TASK_SET_SCHEDULE SCHEDULE:SCHED_COMBINE_WAIT_IN_COVER" // don't run immediately after throwing grenade.
""
" Interrupts"
)
//=========================================================
// Throw a grenade, then run off and reload.
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_GRENADE_AND_RELOAD,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_COMBINE_FACE_TOSS_DIR 0"
" TASK_ANNOUNCE_ATTACK 2" // 2 = grenade
" TASK_PLAY_SEQUENCE ACTIVITY:ACT_RANGE_ATTACK2"
" TASK_COMBINE_DEFER_SQUAD_GRENADES 0"
" TASK_SET_SCHEDULE SCHEDULE:SCHED_HIDE_AND_RELOAD" // don't run immediately after throwing grenade.
""
" Interrupts"
)
DEFINE_SCHEDULE
(
SCHED_COMBINE_PATROL,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_WANDER 900540"
" TASK_WALK_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" TASK_STOP_MOVING 0"
" TASK_FACE_REASONABLE 0"
" TASK_WAIT 3"
" TASK_WAIT_RANDOM 3"
" TASK_SET_SCHEDULE SCHEDULE:SCHED_COMBINE_PATROL" // keep doing it
""
" Interrupts"
" COND_ENEMY_DEAD"
" COND_LIGHT_DAMAGE"
" COND_HEAVY_DAMAGE"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
" COND_NEW_ENEMY"
" COND_SEE_ENEMY"
" COND_CAN_RANGE_ATTACK1"
" COND_CAN_RANGE_ATTACK2"
)
DEFINE_SCHEDULE
(
SCHED_COMBINE_BUGBAIT_DISTRACTION,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_RESET_ACTIVITY 0"
" TASK_PLAY_SEQUENCE ACTIVITY:ACT_COMBINE_BUGBAIT"
""
" Interrupts"
""
)
//=========================================================
// SCHED_COMBINE_CHARGE_TURRET
//
// Used to run straight at enemy turrets to knock them over.
// Prevents squadmates from throwing grenades during.
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_CHARGE_TURRET,
" Tasks"
" TASK_COMBINE_DEFER_SQUAD_GRENADES 0"
" TASK_STOP_MOVING 0"
" TASK_SET_FAIL_SCHEDULE SCHEDULE:SCHED_CHASE_ENEMY_FAILED"
" TASK_GET_CHASE_PATH_TO_ENEMY 300"
" TASK_RUN_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" TASK_FACE_ENEMY 0"
""
" Interrupts"
" COND_NEW_ENEMY"
" COND_ENEMY_DEAD"
" COND_ENEMY_UNREACHABLE"
" COND_CAN_MELEE_ATTACK1"
" COND_CAN_MELEE_ATTACK2"
" COND_TOO_CLOSE_TO_ATTACK"
" COND_TASK_FAILED"
" COND_LOST_ENEMY"
" COND_BETTER_WEAPON_AVAILABLE"
" COND_HEAR_DANGER"
)
//=========================================================
// SCHED_COMBINE_CHARGE_PLAYER
//
// Used to run straight at enemy player since physgun combat
// is more fun when the enemies are close
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_CHARGE_PLAYER,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_SET_FAIL_SCHEDULE SCHEDULE:SCHED_CHASE_ENEMY_FAILED"
" TASK_COMBINE_CHASE_ENEMY_CONTINUOUSLY 192"
" TASK_FACE_ENEMY 0"
""
" Interrupts"
" COND_NEW_ENEMY"
" COND_ENEMY_DEAD"
" COND_ENEMY_UNREACHABLE"
" COND_CAN_MELEE_ATTACK1"
" COND_CAN_MELEE_ATTACK2"
" COND_TASK_FAILED"
" COND_LOST_ENEMY"
" COND_HEAR_DANGER"
)
//=========================================================
// SCHED_COMBINE_DROP_GRENADE
//
// Place a grenade at my feet
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_DROP_GRENADE,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_PLAY_SEQUENCE ACTIVITY:ACT_SPECIAL_ATTACK2"
" TASK_FIND_COVER_FROM_ENEMY 99"
" TASK_FIND_FAR_NODE_COVER_FROM_ENEMY 384"
" TASK_CLEAR_MOVE_WAIT 0"
" TASK_RUN_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
""
" Interrupts"
)
//=========================================================
// SCHED_COMBINE_PATROL_ENEMY
//
// Used instead if SCHED_COMBINE_PATROL if I have an enemy.
// Wait for the enemy a bit in the hopes of ambushing him.
//=========================================================
DEFINE_SCHEDULE
(
SCHED_COMBINE_PATROL_ENEMY,
" Tasks"
" TASK_STOP_MOVING 0"
" TASK_WAIT_FACE_ENEMY 1"
" TASK_WAIT_FACE_ENEMY_RANDOM 3"
""
" Interrupts"
" COND_ENEMY_DEAD"
" COND_LIGHT_DAMAGE"
" COND_HEAVY_DAMAGE"
" COND_HEAR_DANGER"
" COND_HEAR_MOVE_AWAY"
" COND_NEW_ENEMY"
" COND_SEE_ENEMY"
" COND_CAN_RANGE_ATTACK1"
" COND_CAN_RANGE_ATTACK2"
)
DEFINE_SCHEDULE
(
SCHED_COMBINE_BURNING_STAND,
" Tasks"
" TASK_SET_ACTIVITY ACTIVITY:ACT_COMBINE_BUGBAIT"
" TASK_RANDOMIZE_FRAMERATE 20"
" TASK_WAIT 2"
" TASK_WAIT_RANDOM 3"
" TASK_COMBINE_DIE_INSTANTLY DMG_BURN"
" TASK_WAIT 1.0"
" "
" Interrupts"
)
DEFINE_SCHEDULE
(
SCHED_COMBINE_FACE_IDEAL_YAW,
" Tasks"
" TASK_FACE_IDEAL 0"
" "
" Interrupts"
)
DEFINE_SCHEDULE
(
SCHED_COMBINE_MOVE_TO_MELEE,
" Tasks"
" TASK_STORE_ENEMY_POSITION_IN_SAVEPOSITION 0"
" TASK_GET_PATH_TO_SAVEPOSITION 0"
" TASK_RUN_PATH 0"
" TASK_WAIT_FOR_MOVEMENT 0"
" "
" Interrupts"
" COND_NEW_ENEMY"
" COND_ENEMY_DEAD"
" COND_CAN_MELEE_ATTACK1"
)
AI_END_CUSTOM_NPC()
| [
"rileylabrecque@gmail.com"
] | rileylabrecque@gmail.com |
abef9cb3382562015f40fe60c575b902b2919401 | cbfa08b7ec2852406c10df6f82362d3bcc84765e | /firmware/library/L1_Drivers/test/system_timer_test.cpp | 9b4a94dcc3f50ec46f4c95366a6daa9e7aec9109 | [
"Apache-2.0"
] | permissive | hangbogu/SJSU-Dev2 | a81dd0375008d2db9aa19f400d6bcb0631812dbb | 38c9e993aa869c4b29abed470d7fd8affae0e655 | refs/heads/master | 2021-08-08T08:45:00.835779 | 2018-10-10T15:06:58 | 2018-11-03T00:59:17 | 137,110,449 | 2 | 0 | Apache-2.0 | 2018-07-28T03:44:35 | 2018-06-12T18:11:15 | C | UTF-8 | C++ | false | false | 3,296 | cpp | // Test for Pin class.
// Using a test by side effect on the Cortex M4 SysTick register
#include "config.hpp"
#include "L0_LowLevel/LPC40xx.h"
#include "L1_Drivers/system_timer.hpp"
#include "L5_Testing/testing_frameworks.hpp"
static void DummyFunction(void) {}
TEST_CASE("Testing SystemTimer", "[system_timer]")
{
// Simulated local version of SysTick register to verify register
// manipulation by side effect of Pin method calls
// Default figure 552 page 703
SysTick_Type local_systick = { 0x4, 0, 0, 0x000F'423F };
// Substitute the memory mapped SysTick with the local_systick test struture
// Redirects manipulation to the 'local_systick'
SystemTimer::sys_tick = &local_systick;
SystemTimer test_subject;
SECTION("SetTickFrequency generate desired frequency")
{
constexpr uint32_t kDivisibleFrequency = 1000;
local_systick.LOAD = 0;
CHECK(0 == test_subject.SetTickFrequency(kDivisibleFrequency));
CHECK((config::kSystemClockRate / kDivisibleFrequency) - 1 ==
local_systick.LOAD);
}
SECTION("SetTickFrequency should return remainder of ticks mismatch")
{
constexpr uint32_t kOddFrequency = 7;
local_systick.LOAD = 0;
CHECK(config::kSystemClockRate % kOddFrequency ==
test_subject.SetTickFrequency(kOddFrequency));
CHECK((config::kSystemClockRate / kOddFrequency) - 1 == local_systick.LOAD);
}
SECTION("Start Timer should set necessary SysTick Ctrl bits and set VAL to 0")
{
// Source: "UM10562 LPC408x/407x User manual" table 553 page 703
constexpr uint8_t kEnableMask = 0b0001;
constexpr uint8_t kTickIntMask = 0b0010;
constexpr uint8_t kClkSourceMask = 0b0100;
constexpr uint32_t kMask = kEnableMask | kTickIntMask | kClkSourceMask;
local_systick.VAL = 0xBEEF;
local_systick.LOAD = 1000;
CHECK(true == test_subject.StartTimer());
CHECK(kMask == local_systick.CTRL);
CHECK(0 == local_systick.VAL);
}
SECTION(
"StartTimer should return false and set no bits if LOAD is set to zero")
{
// Source: "UM10562 LPC408x/407x User manual" table 553 page 703
constexpr uint8_t kClkSourceMask = 0b0100;
// Default value see above.
local_systick.CTRL = kClkSourceMask;
// Setting load value to 0, should return false
local_systick.LOAD = 0;
local_systick.VAL = 0xBEEF;
CHECK(false == test_subject.StartTimer());
CHECK(kClkSourceMask == local_systick.CTRL);
CHECK(0xBEEF == local_systick.VAL);
}
SECTION("DisableTimer should clear all bits")
{
// Source: "UM10562 LPC408x/407x User manual" table 553 page 703
constexpr uint8_t kEnableMask = 0b0001;
constexpr uint8_t kTickIntMask = 0b0010;
constexpr uint8_t kClkSourceMask = 0b0100;
constexpr uint32_t kMask = kEnableMask | kTickIntMask | kClkSourceMask;
local_systick.CTRL = kMask;
local_systick.LOAD = 1000;
test_subject.DisableTimer();
CHECK(0 == local_systick.CTRL);
}
SECTION("SetIsrFunction set SystemTimer::system_timer_isr to DummyFunction")
{
SystemTimer::system_timer_isr = nullptr;
test_subject.SetIsrFunction(DummyFunction);
CHECK(DummyFunction == SystemTimer::system_timer_isr);
}
SystemTimer::sys_tick = SysTick;
}
| [
"kammcecorp@gmail.com"
] | kammcecorp@gmail.com |
c97e09f1b4e10248630f9e6edc06b70b03fa2ba5 | 95da74c106267671cc0e993451911ec11fecc8af | /MoreIsBetter Bits/MoreIsBetter/MIB-Libraries/MoreAppleEvents/MoreAppleEvents.cp | be4238d46aba41341e73898389d773f33a17d57b | [] | no_license | fruitsamples/QISA | 5f2ae53e7182c91eed698844e790d1fb5485906f | 9dac08cd59f7f6db31b559c495c1835fda4428f7 | refs/heads/master | 2021-01-10T11:07:22.821446 | 2015-11-25T21:44:18 | 2015-11-25T21:44:18 | 46,888,953 | 0 | 0 | null | null | null | null | MacCentralEurope | C++ | false | false | 43,853 | cp | /*
File: MoreAppleEvents.cp
Contains: Apple Event Manager utilities.
DRI: George Warner
Copyright: Copyright (c) 2000-2001 by Apple Computer, Inc., All Rights Reserved.
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
("Apple") in consideration of your agreement to the following terms, and your
use, installation, modification or redistribution of this Apple software
constitutes acceptance of these terms. If you do not agree with these terms,
please do not use, install, modify or redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and subject
to these terms, Apple grants you a personal, non-exclusive license, under Apple’s
copyrights in this original Apple software (the "Apple Software"), to use,
reproduce, modify and redistribute the Apple Software, with or without
modifications, in source and/or binary forms; provided that if you redistribute
the Apple Software in its entirety and without modifications, you must retain
this notice and the following text and disclaimers in all such redistributions of
the Apple Software. Neither the name, trademarks, service marks or logos of
Apple Computer, Inc. may be used to endorse or promote products derived from the
Apple Software without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or implied,
are granted by Apple herein, including but not limited to any patent rights that
may be infringed by your derivative works or by other works in which the Apple
Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
(INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Change History (most recent first):
$Log: MoreAppleEvents.cp,v $
Revision 1.25 2002/11/25 18:40:02 eskimo1
Convert OSErr to OSStatus; also got rid of "implicit arithmetic conversion" warnings.
Revision 1.24 2002/11/08 22:53:36 eskimo1
Convert nil to NULL. Convert MoreAssertQ to assert. Moved a bunch of stuff to MoreAEDataModel. Include our header early so as to detect any missing dependencies in the header.
Revision 1.23 2002/10/16 20:32:11 geowar
added MoreAEfprintDesc routine and changed desc parameters to pAEDesc.
Revision 1.22 2002/10/03 00:02:40 geowar
bug fix - corrected improper usage of PSN fields & constants.
Revision 1.21 2002/03/08 23:51:00 geowar
More cleanup.
Fixed memory leak in MoreAETellSelfToSetCFStringRefProperty
Revision 1.20 2002/03/07 20:31:51 geowar
General clean up.
Added recovery code to MoreAESendEventReturnPString.
New API: MoreAECreateAEDescFromCFString.
Revision 1.19 2002/02/19 18:54:57 geowar
Written by: => DRI:
Revision 1.18 2002/01/16 19:11:06 geowar
err => anErr, (anErr ?= noErr) => (noErr ?= anErr)
Added MoreAESendEventReturnAEDesc, MoreAESendEventReturnAEDescList,
MoreAETellSelfToSetCFStringRefProperty, & MoreAEGetCFStringFromDescriptor routines.
Revision 1.17 2001/11/07 15:50:50 eskimo1
Tidy up headers, add CVS logs, update copyright.
<16> 21/9/01 Quinn Changes for CWPro7 Mach-O build.
<15> 8/28/01 gaw CodeBert (error -> pError, theAppleEvent -> pAppleEvent, etc.)
<14> 15/2/01 Quinn MoreAECreateAppleEventTargetID is not supported for Carbon
builds because all of its required declarations are defined
CALL_NOT_IN_CARBON. Also some minor fixes prompted by gcc
warnings.
<13> 26/5/00 Quinn Eliminate bogus consts detected by MPW's SC compiler.
<12> 4/26/00 gaw Fix bug, swapped creator & file type parameters
<11> 27/3/00 Quinn Remove MoreAEDeleteItemFromRecord. It's functionality is
covered by AEDeleteKeyDesc.
<10> 20/3/00 Quinn Added routines to deal with "missing value". Added
MoreAECopyDescriptorDataToHandle. Added
MoreAEDeleteItemFromRecord.
<9> 3/9/00 gaw Y2K!
<8> 3/9/00 gaw API changes for MoreAppleEvents
<7> 3/9/00 GW Intergrating AppleEvent Helper code. First Check In
<6> 6/3/00 Quinn Added a bunch of trivial wrapper routines. George may come
along and change all these soon, but I needed them for MoreOSL.
<5> 1/3/00 Quinn Change the signature for AEGetDescData to match the version we
actually shipped.
<4> 2/15/99 PCG add AEGetDescDataSize for non-Carbon clients
<3> 1/29/99 PCG add AEGetDescData
<2> 11/11/98 PCG fix header
<1> 11/10/98 PCG first big re-org at behest of Quinn
Old Change History (most recent first):
<2> 10/11/98 Quinn Convert "MorePrefix.h" to "MoreSetup.h".
<2> 6/16/98 PCG CreateProcessTarget works with nil PSN
<1> 6/16/98 PCG initial checkin
*/
// Conditionals to setup the build environment the way we like it.
#include "MoreSetup.h"
//********** Our Prototypes ****************************************
#include "MoreAppleEvents.h"
#if !MORE_FRAMEWORK_INCLUDES
//********** Universal Headers ****************************************
#include <AERegistry.h>
#include <AEHelpers.h>
#include <AEObjects.h>
#include <AEPackObject.h>
#include <ASRegistry.h>
//#include <FinderRegistry.h>
#include <Gestalt.h>
#endif
#include <cstdio>
//********** Project Headers ****************************************
#include "MoreAEDataModel.h"
#include "MoreAEObjects.h"
#include "MoreProcesses.h"
#include "MoreMemory.h"
//********** Private Definitions ****************************************
enum {
kFinderFileType = 'FNDR',
kFinderCreatorType = 'MACS',
kFinderProcessType = 'FNDR',
kFinderProcessSignature = 'MACS'
};
static AEIdleUPP gAEIdleUPP = NULL;
//*******************************************************************************
#pragma mark ==> Create Target Descriptors for AEvents •
/********************************************************************************
Create and return an AEDesc for the process target with the specified PSN.
If no PSN is supplied the use the current process
pAEEventClass ==> The class of the event to be created.
pAEEventID ==> The ID of the event to be created.
pAppleEvent ==> Pointer to an AppleEvent where the
event record will be returned.
<== The Apple event.
RESULT CODES
____________
noErr 0 No error
memFullErr -108 Not enough room in heap zone
____________
*/
pascal OSStatus MoreAECreateProcessTarget(ProcessSerialNumber* pPSN, AEDesc* pAppleEvent)
{
ProcessSerialNumber self;
if (!pPSN)
{
pPSN = &self;
self.lowLongOfPSN = kCurrentProcess;
self.highLongOfPSN = 0;
}
return AECreateDesc (typeProcessSerialNumber,pPSN,sizeof(*pPSN),pAppleEvent);
} // MoreAECreateProcessTarget
//*******************************************************************************
#pragma mark ==> Create AEvents •
/********************************************************************************
Create and return an AppleEvent of the given class and ID. The event will be
targeted at the current process, with an AEAddressDesc of type
typeProcessSerialNumber.
pAEEventClass ==> The class of the event to be created.
pAEEventID ==> The ID of the event to be created.
pAppleEvent ==> Pointer to an AppleEvent where the
event record will be returned.
<== The Apple event.
RESULT CODES
____________
noErr 0 No error
memFullErr -108 Not enough room in heap zone
____________
*/
pascal OSStatus MoreAECreateAppleEventSelfTarget(
AEEventClass pAEEventClass,
AEEventID pAEEventID,
AppleEvent* pAppleEvent)
{
OSStatus anError = noErr;
ProcessSerialNumber selfPSN = {0, kCurrentProcess};
anError = MoreAECreateAppleEventProcessTarget( &selfPSN, pAEEventClass, pAEEventID, pAppleEvent );
return ( anError );
}//end MoreAECreateAppleEventSelfTarget
/********************************************************************************
Create and return an AppleEvent of the given class and ID. The event will be
targeted at the process specified by the target type and creator codes,
with an AEAddressDesc of type typeProcessSerialNumber.
pType ==> The file type of the process to be found.
pCreator ==> The creator type of the process to be found.
pAEEventClass ==> The class of the event to be created.
pAEEventID ==> The ID of the event to be created.
pAppleEvent ==> Pointer to an AppleEvent where the
event record will be returned.
<== The Apple event.
RESULT CODES
____________
noErr 0 No error
memFullErr -108 Not enough room in heap zone
procNotFound –600 No eligible process with specified descriptor
____________
*/
pascal OSStatus MoreAECreateAppleEventSignatureTarget(
OSType pType,
OSType pCreator,
AEEventClass pAEEventClass,
AEEventID pAEEventID,
AppleEvent* pAppleEvent )
{
OSStatus anError = noErr;
ProcessSerialNumber psn = {0, kNoProcess};
// <12> bug fix, pCreator & pType parameters swapped.
anError = MoreProcFindProcessBySignature( pCreator, pType, &psn );
if ( noErr == anError )
{
anError = MoreAECreateAppleEventProcessTarget( &psn, pAEEventClass, pAEEventID, pAppleEvent );
}
return anError;
}//end MoreAECreateAppleEventSignatureTarget
/********************************************************************************
Create and return an AppleEvent of the given class and ID. The event will be
targeted at the application with the specific creator.
psnPtr ==> Pointer to the PSN to target the event with.
pAEEventClass ==> The class of the event to be created.
pAEEventID ==> The ID of the event to be created.
pAppleEvent ==> Pointer to an AppleEvent where the
event record will be returned.
<== The Apple event.
RESULT CODES
____________
noErr 0 No error
memFullErr -108 Not enough room in heap zone
procNotFound –600 No eligible process with specified descriptor
____________
*/
pascal OSStatus MoreAECreateAppleEventCreatorTarget(
const AEEventClass pAEEventClass,
const AEEventID pAEEventID,
const OSType pCreator,
AppleEvent* pAppleEvent)
{
OSStatus anError;
AEDesc targetDesc;
assert(pAppleEvent != NULL);
MoreAENullDesc(&targetDesc);
anError = AECreateDesc(typeApplSignature, &pCreator, sizeof(pCreator), &targetDesc);
if (noErr == anError)
anError = AECreateAppleEvent(pAEEventClass, pAEEventID, &targetDesc,
kAutoGenerateReturnID, kAnyTransactionID, pAppleEvent);
MoreAEDisposeDesc(&targetDesc);
return anError;
}//end MoreAECreateAppleEventCreatorTarget
/********************************************************************************
Create and return an AppleEvent of the given class and ID. The event will be
targeted with the provided PSN.
psnPtr ==> Pointer to the PSN to target the event with.
pAEEventClass ==> The class of the event to be created.
pAEEventID ==> The ID of the event to be created.
pAppleEvent ==> Pointer to an AppleEvent where the
event record will be returned.
<== The Apple event.
RESULT CODES
____________
noErr 0 No error
memFullErr -108 Not enough room in heap zone
procNotFound –600 No eligible process with specified descriptor
____________
*/
pascal OSStatus MoreAECreateAppleEventProcessTarget(
const ProcessSerialNumberPtr psnPtr,
AEEventClass pAEEventClass,
AEEventID pAEEventID,
AppleEvent* pAppleEvent )
{
OSStatus anError = noErr;
AEDesc targetAppDesc = {typeNull,NULL};
anError = AECreateDesc (typeProcessSerialNumber, psnPtr, sizeof( ProcessSerialNumber ), &targetAppDesc);
if ( noErr == anError )
{
anError = AECreateAppleEvent( pAEEventClass, pAEEventID, &targetAppDesc,
kAutoGenerateReturnID, kAnyTransactionID, pAppleEvent);
}
MoreAEDisposeDesc( &targetAppDesc );
return anError;
}//end MoreAECreateAppleEventProcessTarget
/********************************************************************************
Create and return an AppleEvent of the given class and ID. The event will be
targeted with the provided TargetID.
pTargetID ==> Pointer to the TargetID to target the event with.
pAEEventClass ==> The class of the event to be created.
pAEEventID ==> The ID of the event to be created.
pAppleEvent ==> Pointer to an AppleEvent where the
event record will be returned.
<== The Apple event.
RESULT CODES
____________
noErr 0 No error
memFullErr -108 Not enough room in heap zone
procNotFound –600 No eligible process with specified descriptor
____________
*/
#if CALL_NOT_IN_CARBON
// See comment in header file.
pascal OSStatus MoreAECreateAppleEventTargetID(
const TargetID* pTargetID,
AEEventClass pAEEventClass,
AEEventID pAEEventID,
AppleEvent* pAppleEvent )
{
OSStatus anError = noErr;
AEDesc targetAppDesc = {typeNull,NULL};
anError = AECreateDesc (typeTargetID, pTargetID, sizeof( TargetID ), &targetAppDesc);
if ( noErr == anError )
{
anError = AECreateAppleEvent( pAEEventClass, pAEEventID, &targetAppDesc,
kAutoGenerateReturnID, kAnyTransactionID, pAppleEvent);
}
MoreAEDisposeDesc( &targetAppDesc );
return anError;
}//end MoreAECreateAppleEventTargetID
#endif
#pragma mark ==> Send AppleEvents •
#if 0
//• De-appreciated! Don't use! Use one of the more specific routines (w/idle proc) below.
pascal OSErr MoreAESendAppleEvent (const AppleEvent* pAppleEvent, AppleEvent* pAEReply)
{
OSErr anErr = noErr;
AESendMode aeSendMode = kAEAlwaysInteract | kAECanSwitchLayer;
if (pAEReply)
{
aeSendMode |= kAEWaitReply;
MoreAENullDesc(pAEReply);
}
anErr = AESend (pAppleEvent, pAEReply, aeSendMode, kAENormalPriority, kAEDefaultTimeout, NULL, NULL);
return anErr;
}//end MoreAESendAppleEvent
#endif 0
/********************************************************************************
Send the provided AppleEvent using the provided idle function.
Will wait for a reply if an idle function is provided, but no result will be returned.
pIdleProcUPP ==> The idle function to use when sending the event.
pAppleEvent ==> The event to be sent.
RESULT CODES
____________
noErr 0 No error
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAESendEventNoReturnValue(
const AEIdleUPP pIdleProcUPP,
const AppleEvent* pAppleEvent )
{
OSStatus anError = noErr;
AppleEvent theReply = {typeNull,NULL};
AESendMode sendMode;
if (NULL == pIdleProcUPP)
sendMode = kAENoReply;
else
sendMode = kAEWaitReply;
anError = AESend( pAppleEvent, &theReply, sendMode, kAENormalPriority, kNoTimeOut, pIdleProcUPP, NULL );
if ((noErr == anError) && (kAEWaitReply == sendMode))
anError = MoreAEGetHandlerError(&theReply);
MoreAEDisposeDesc( &theReply );
return anError;
}//end MoreAESendEventNoReturnValue
/********************************************************************************
Send the provided AppleEvent using the provided idle function.
Return the direct object as a AEDesc of pAEDescType
pIdleProcUPP ==> The idle function to use when sending the event.
pAppleEvent ==> The event to be sent.
pDescType ==> The type of value returned by the event.
pAEDescList <== The value returned by the event.
RESULT CODES
____________
noErr 0 No error
paramErr -50 No idle function provided
and any other error that can be returned by AESend
or the handler in the application that gets the event.
____________
*/
pascal OSStatus MoreAESendEventReturnAEDesc(
const AEIdleUPP pIdleProcUPP,
const AppleEvent *pAppleEvent,
const DescType pDescType,
AEDesc *pAEDesc)
{
OSStatus anError = noErr;
// No idle function is an error, since we are expected to return a value
if (pIdleProcUPP == NULL)
anError = paramErr;
else
{
AppleEvent theReply = {typeNull,NULL};
AESendMode sendMode = kAEWaitReply;
anError = AESend(pAppleEvent, &theReply, sendMode, kAENormalPriority, kNoTimeOut, pIdleProcUPP, NULL);
// [ Don't dispose of the event, it's not ours ]
if (noErr == anError)
{
anError = MoreAEGetHandlerError(&theReply);
if (!anError && theReply.descriptorType != typeNull)
{
anError = AEGetParamDesc(&theReply, keyDirectObject, pDescType, pAEDesc);
}
MoreAEDisposeDesc(&theReply);
}
}
return anError;
} // MoreAESendEventReturnAEDesc
/********************************************************************************
Send the provided AppleEvent using the provided idle function.
Return the direct object as a AEDescList
pIdleProcUPP ==> The idle function to use when sending the event.
pAppleEvent ==> The event to be sent.
pAEDescList <== The value returned by the event.
RESULT CODES
____________
noErr 0 No error
paramErr -50 No idle function provided
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAESendEventReturnAEDescList(
const AEIdleUPP pIdleProcUPP,
const AppleEvent* pAppleEvent,
AEDescList* pAEDescList)
{
return MoreAESendEventReturnAEDesc(pIdleProcUPP,pAppleEvent,typeAEList,pAEDescList);
} // MoreAESendEventReturnAEDescList
/********************************************************************************
Send the provided AppleEvent using the provided idle function.
Return data (at pDataPtr) of type pDesiredType
pIdleProcUPP ==> The idle function to use when sending the event.
pAppleEvent ==> The event to be sent.
theValue <== The value returned by the event.
RESULT CODES
____________
noErr 0 No error
paramErr -50 No idle function provided
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAESendEventReturnData(
const AEIdleUPP pIdleProcUPP,
const AppleEvent *pAppleEvent,
DescType pDesiredType,
DescType* pActualType,
void* pDataPtr,
Size pMaximumSize,
Size *pActualSize)
{
OSStatus anError = noErr;
// No idle function is an error, since we are expected to return a value
if (pIdleProcUPP == NULL)
anError = paramErr;
else
{
AppleEvent theReply = {typeNull,NULL};
AESendMode sendMode = kAEWaitReply;
anError = AESend(pAppleEvent, &theReply, sendMode, kAENormalPriority, kNoTimeOut, pIdleProcUPP, NULL);
// [ Don't dispose of the event, it's not ours ]
if (noErr == anError)
{
anError = MoreAEGetHandlerError(&theReply);
if (!anError && theReply.descriptorType != typeNull)
{
anError = AEGetParamPtr(&theReply, keyDirectObject, pDesiredType,
pActualType, pDataPtr, pMaximumSize, pActualSize);
}
MoreAEDisposeDesc(&theReply);
}
}
return anError;
} // MoreAESendEventReturnData
/********************************************************************************
Send the provided AppleEvent using the provided idle function.
Return a SInt16 (typeSmallInteger).
pIdleProcUPP ==> The idle function to use when sending the event.
pAppleEvent ==> The event to be sent.
theValue <== The value returned by the event.
RESULT CODES
____________
noErr 0 No error
paramErr -50 No idle function provided
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAESendEventReturnSInt16(
const AEIdleUPP pIdleProcUPP,
const AppleEvent* pAppleEvent,
SInt16* pValue)
{
DescType actualType;
Size actualSize;
return MoreAESendEventReturnData(pIdleProcUPP,pAppleEvent,typeShortInteger,
&actualType,pValue,sizeof(SInt16),&actualSize);
} // MoreAESendEventReturnSInt16
/********************************************************************************
Send the provided AppleEvent using the provided idle function.
Returns a PString.
pIdleProcUPP ==> The idle function to use when sending the event.
pAppleEvent ==> The event to be sent.
pStr255 <== The value returned by the event.
RESULT CODES
____________
noErr 0 No error
paramErr -50 No idle function provided
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAESendEventReturnPString(
const AEIdleUPP pIdleProcUPP,
const AppleEvent* pAppleEvent,
Str255 pStr255)
{
DescType actualType;
Size actualSize;
OSStatus anError;
anError = MoreAESendEventReturnData(pIdleProcUPP,pAppleEvent,typePString,
&actualType,pStr255,sizeof(Str255),&actualSize);
if (errAECoercionFail == anError)
{
anError = MoreAESendEventReturnData(pIdleProcUPP,pAppleEvent,typeChar,
&actualType,(Ptr) &pStr255[1],sizeof(Str255),&actualSize);
if (actualSize < 256)
pStr255[0] = (UInt8) actualSize;
else
anError = errAECoercionFail;
}
return anError;
} // MoreAESendEventReturnPString
#pragma mark ==> Functions for talking to ourselfs
/********************************************************************************
Send an AppleEvent of the specified Class & ID to myself using the
default idle function.
pEventID ==> The event to be sent.
RESULT CODES
____________
noErr 0 No error
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAESendToSelfNoReturnValue(
const AEEventClass pEventClass,
const AEEventID pEventID)
{
AppleEvent tAppleEvent = {typeNull,NULL}; // If you always init AEDescs, it's always safe to dispose of them.
OSStatus anError = noErr;
if (NULL == gAEIdleUPP)
gAEIdleUPP = NewAEIdleUPP(MoreAESimpleIdleFunction);
anError = MoreAECreateAppleEventSelfTarget(pEventClass,pEventID,&tAppleEvent);
if (noErr == anError)
{
AEDesc containerObj = {typeNull,NULL}; // start with the null (application) container
AEDesc propertyObject = {typeNull,NULL};
anError = MoreAEOCreatePropertyObject(pSelection, &containerObj, &propertyObject);
if (noErr == anError)
{
anError = AEPutParamDesc(&tAppleEvent, keyDirectObject, &propertyObject);
MoreAEDisposeDesc(&propertyObject); // Always dispose of objects as soon as you are done (helps avoid leaks)
if (noErr == anError)
anError = MoreAESendEventNoReturnValue(gAEIdleUPP, &tAppleEvent);
}
MoreAEDisposeDesc(&tAppleEvent); // always dispose of AEDescs when you are finished with them
}
return anError;
} // MoreAESendToSelfNoReturnValue
/********************************************************************************
Send an AppleEvent of the specified Class & ID to myself using the
default idle function. Wait for a reply and extract a SInt16 result.
pEventClass ==> The event class to be sent.
pEventID ==> The event ID to be sent.
pValue <== Where the return SInt16 will be stored.
RESULT CODES
____________
noErr 0 No error
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAESendToSelfReturnSInt16(
const AEEventClass pEventClass,
const AEEventID pEventID,
SInt16* pValue)
{
AppleEvent tAppleEvent = {typeNull,NULL}; // If you always init AEDescs, it's always safe to dispose of them.
OSStatus anError = noErr;
if (NULL == gAEIdleUPP)
gAEIdleUPP = NewAEIdleUPP(MoreAESimpleIdleFunction);
anError = MoreAECreateAppleEventSelfTarget(pEventClass,pEventID,&tAppleEvent);
if (noErr == anError)
{
AEDesc containerObj = {typeNull,NULL}; // start with the null (application) container
AEDesc propertyObject = {typeNull,NULL};
anError = MoreAEOCreatePropertyObject(pSelection, &containerObj, &propertyObject);
if (noErr == anError)
{
anError = AEPutParamDesc(&tAppleEvent, keyDirectObject, &propertyObject);
MoreAEDisposeDesc(&propertyObject); // Always dispose of objects as soon as you are done (helps avoid leaks)
if (noErr == anError)
anError = MoreAESendEventReturnSInt16(gAEIdleUPP, &tAppleEvent, pValue);
}
MoreAEDisposeDesc(&tAppleEvent); // always dispose of AEDescs when you are finished with them
}
return anError;
}//end MoreAESendToSelfReturnSInt16
/********************************************************************************
Send a get data (kAEGetData) AppleEvent to myself using the
default idle function. Wait for a reply and extract a SInt16 result.
pPropType ==> The property type.
pValue <== Where the resulting SInt16 will be stored.
RESULT CODES
____________
noErr 0 No error
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAETellSelfToGetSInt16Property(const DescType pPropType,SInt16* pValue)
{
AppleEvent tAppleEvent = {typeNull,NULL}; // If you always init AEDescs, it's always safe to dispose of them.
OSStatus anError = noErr;
if (NULL == gAEIdleUPP)
gAEIdleUPP = NewAEIdleUPP(MoreAESimpleIdleFunction);
anError = MoreAECreateAppleEventSelfTarget(kAECoreSuite,kAEGetData,&tAppleEvent);
if (noErr == anError)
{
AEDesc containerObj = {typeNull,NULL}; // start with the null (application) container
AEDesc propertyObject = {typeNull,NULL};
anError = MoreAEOCreatePropertyObject(pPropType, &containerObj, &propertyObject);
if (noErr == anError)
{
anError = AEPutParamDesc(&tAppleEvent, keyDirectObject, &propertyObject);
MoreAEDisposeDesc(&propertyObject); // Always dispose of objects as soon as you are done (helps avoid leaks)
if (noErr == anError)
anError = MoreAESendEventReturnSInt16(gAEIdleUPP, &tAppleEvent, pValue);
}
MoreAEDisposeDesc(&tAppleEvent); // always dispose of AEDescs when you are finished with them
}
return anError;
}//end MoreAETellSelfToGetSInt16Property
/********************************************************************************
Send a get data (kAEGetData) AppleEvent to myself using the
default idle function. Wait for a reply and extract a Str255 result.
pPropType ==> The property type.
pValue <== Where the resulting Str255 will be stored.
RESULT CODES
____________
noErr 0 No error
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAETellSelfToGetStr255Property(const DescType pPropType,Str255 pValue)
{
AppleEvent tAppleEvent = {typeNull,NULL}; // If you always init AEDescs, it's always safe to dispose of them.
OSStatus anError = noErr;
if (NULL == gAEIdleUPP)
gAEIdleUPP = NewAEIdleUPP(MoreAESimpleIdleFunction);
anError = MoreAECreateAppleEventSelfTarget(kAECoreSuite,kAEGetData,&tAppleEvent);
if (noErr == anError)
{
AEDesc containerObj = {typeNull,NULL}; // start with the null (application) container
AEDesc propertyObject = {typeNull,NULL};
anError = MoreAEOCreatePropertyObject(pPropType, &containerObj, &propertyObject);
if (noErr == anError)
{
anError = AEPutParamDesc(&tAppleEvent, keyDirectObject, &propertyObject);
MoreAEDisposeDesc(&propertyObject); // Always dispose of objects as soon as you are done (helps avoid leaks)
if (noErr == anError)
anError = MoreAESendEventReturnPString(gAEIdleUPP, &tAppleEvent, pValue);
}
MoreAEDisposeDesc(&tAppleEvent); // always dispose of AEDescs when you are finished with them
}
return anError;
}//end MoreAETellSelfToGetStr255Property
/********************************************************************************
Send a set data (kAESetData) AppleEvent to myself with a SInt16 parameter
and using the default idle function.
pPropType ==> The property type.
pValue ==> The SInt16 value to be set.
RESULT CODES
____________
noErr 0 No error
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAETellSelfToSetSInt16Property(const DescType pPropType,SInt16 pValue)
{
AppleEvent tAppleEvent = {typeNull,NULL}; // If you always init AEDescs, it's always safe to dispose of them.
OSStatus anError = noErr;
if (NULL == gAEIdleUPP)
gAEIdleUPP = NewAEIdleUPP(MoreAESimpleIdleFunction);
anError = MoreAECreateAppleEventSelfTarget(kAECoreSuite,kAESetData,&tAppleEvent);
if (noErr == anError)
{
AEDesc containerObj = {typeNull,NULL}; // start with the null (application) container
AEDesc propertyObject = {typeNull,NULL};
anError = MoreAEOCreatePropertyObject(pPropType, &containerObj, &propertyObject);
if (noErr == anError)
{
anError = AEPutParamDesc(&tAppleEvent, keyDirectObject, &propertyObject);
MoreAEDisposeDesc(&propertyObject); // Always dispose of objects as soon as you are done (helps avoid leaks)
if (noErr == anError)
{
anError = AEPutParamPtr(&tAppleEvent, keyAEData, typeSInt16, &pValue, sizeof(SInt16));
if (noErr == anError)
anError = MoreAESendEventNoReturnValue(gAEIdleUPP, &tAppleEvent);
}
}
MoreAEDisposeDesc(&tAppleEvent); // always dispose of AEDescs when you are finished with them
}
return anError;
}//end MoreAETellSelfToSetSInt16Property
/********************************************************************************
Send a set data (kAESetData) AppleEvent to myself with a Pascal string
parameter and using the default idle function.
pEventID ==> The event to be sent.
pValue ==> The Str255 to be sent.
RESULT CODES
____________
noErr 0 No error
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAETellSelfToSetStr255Property(const DescType pPropType,Str255 pValue)
{
AppleEvent tAppleEvent = {typeNull,NULL}; // If you always init AEDescs, it's always safe to dispose of them.
OSStatus anError = noErr;
if (NULL == gAEIdleUPP)
gAEIdleUPP = NewAEIdleUPP(MoreAESimpleIdleFunction);
anError = MoreAECreateAppleEventSelfTarget(kAECoreSuite,kAESetData,&tAppleEvent);
if (noErr == anError)
{
AEDesc containerObj = {typeNull,NULL}; // start with the null (application) container
AEDesc propertyObject = {typeNull,NULL};
anError = MoreAEOCreatePropertyObject(pPropType, &containerObj, &propertyObject);
if (noErr == anError)
{
anError = AEPutParamDesc(&tAppleEvent, keyDirectObject, &propertyObject);
MoreAEDisposeDesc(&propertyObject);
if (noErr == anError)
{
anError = AEPutParamPtr(&tAppleEvent, keyAEData, typePString, pValue, pValue[0] + 1);
if (noErr == anError)
anError = MoreAESendEventNoReturnValue(gAEIdleUPP, &tAppleEvent);
}
}
MoreAEDisposeDesc(&tAppleEvent); // always dispose of AEDescs when you are finished with them
}
return anError;
} // MoreAETellSelfToSetStr255Property
/********************************************************************************
Send a set data (kAESetData) AppleEvent to myself with a CFStringRef
parameter and using the default idle function.
pEventID ==> The event to be sent.
pValue ==> The CFString to be sent.
RESULT CODES
____________
noErr 0 No error
and any other error that can be returned by AESend or the handler
in the application that gets the event.
____________
*/
pascal OSStatus MoreAETellSelfToSetCFStringRefProperty(
const DescType pPropType,
const CFStringRef pCFStringRef)
{
AppleEvent tAppleEvent = {typeNull,NULL}; // If you always init AEDescs, it's always safe to dispose of them.
CFIndex length = CFStringGetLength(pCFStringRef);
const UniChar* dataPtr = CFStringGetCharactersPtr(pCFStringRef);
const UniChar* tempPtr = NULL;
OSStatus anError = noErr;
if (dataPtr == NULL)
{
tempPtr = (UniChar*) NewPtr( (Size) (length * sizeof(UniChar)) );
if (NULL == tempPtr) return memFullErr;
CFStringGetCharacters(pCFStringRef, CFRangeMake(0,length), (UniChar*) tempPtr);
dataPtr = tempPtr;
}
if (NULL == gAEIdleUPP)
gAEIdleUPP = NewAEIdleUPP(MoreAESimpleIdleFunction);
anError = MoreAECreateAppleEventSelfTarget(kAECoreSuite,kAESetData,&tAppleEvent);
if (noErr == anError)
{
AEDesc containerObj = {typeNull,NULL}; // start with the null (application) container
AEDesc propertyObject = {typeNull,NULL};
anError = MoreAEOCreatePropertyObject(pPropType, &containerObj, &propertyObject);
if (noErr == anError)
{
anError = AEPutParamDesc(&tAppleEvent, keyDirectObject, &propertyObject);
MoreAEDisposeDesc(&propertyObject);
if (noErr == anError)
{
anError = AEPutParamPtr(&tAppleEvent, keyAEData, typeUnicodeText, dataPtr, (Size) (length * sizeof(UniChar)) );
if (noErr == anError)
anError = MoreAESendEventNoReturnValue(gAEIdleUPP, &tAppleEvent);
}
}
MoreAEDisposeDesc(&tAppleEvent); // always dispose of AEDescs when you are finished with them
}
if (NULL != tempPtr)
DisposePtr((Ptr) tempPtr);
return anError;
} // MoreAETellSelfToSetCFStringRefProperty
//*******************************************************************************
#pragma mark ==> Misc. AE utility functions •
//*******************************************************************************
// Appends each of the items in pSourceList to the pDestList.
pascal OSStatus MoreAEAppendListToList(const AEDescList* pSourceList, AEDescList* pDestList)
{
OSStatus anError;
AEKeyword junkKeyword;
SInt32 listCount;
SInt32 listIndex;
AEDesc thisValue;
assert(pSourceList != NULL);
assert(pDestList != NULL);
anError = AECountItems(pSourceList, &listCount);
if (noErr == anError) {
for (listIndex = 1; listIndex <= listCount; listIndex++) {
MoreAENullDesc(&thisValue);
anError = AEGetNthDesc(pSourceList, listIndex, typeWildCard, &junkKeyword, &thisValue);
if (noErr == anError) {
anError = AEPutDesc(pDestList, 0, &thisValue);
}
MoreAEDisposeDesc(&thisValue);
if (noErr != anError) {
break;
}
}
}
return anError;
}//end MoreAEAppendListToList
//*******************************************************************************
// This routine takes a result descriptor and an error.
// If there is a result to add to the reply it makes sure the reply isn't
// NULL itself then adds the error to the reply depending on the error
// and the type of result.
pascal OSStatus MoreAEMoreAESetReplyErrorNumber (OSErr pOSErr, AppleEvent* pAEReply)
{
OSStatus anError = noErr;
if (pAEReply->dataHandle)
{
if (!MoreAssertPCG (pAEReply->descriptorType == typeAppleEvent))
anError = paramErr;
else
anError = AEPutParamPtr (pAEReply,keyErrorNumber,typeShortInteger,&pOSErr,sizeof(pOSErr));
}
return anError;
}//end MoreAEMoreAESetReplyErrorNumber
//*******************************************************************************
// This routine takes a result descriptor, a reply descriptor and an error.
// If there is a result to add to the reply it makes sure the reply isn't
// NULL itself then adds the result to the reply depending on the error
// and the type of result.
pascal OSStatus MoreAEAddResultToReply(const AEDesc* pResult, AEDesc* pAEReply, const OSErr pError)
{
OSStatus anError;
// Check that the pAEReply is not NULL and there is a result to put in it
if (typeNull == pAEReply->descriptorType || typeNull == pResult->descriptorType)
return (pError);
if (noErr == pError)
anError = AEPutParamDesc(pAEReply, keyDirectObject, pResult);
else
{
switch (pResult->descriptorType)
{
case typeInteger:
anError = AEPutParamDesc(pAEReply, keyErrorNumber, pResult);
break;
case typeChar:
anError = AEPutParamDesc(pAEReply, keyErrorString, pResult);
break;
default:
anError = errAETypeError;
}
if (noErr == anError)
anError = pError; // Don't loose that error
}
return (anError);
}//end MoreAEAddResultToReply
//*******************************************************************************
// Name: MoreAEGotRequiredParams
// Function: Checks that all parameters defined as 'required' have been read
pascal OSStatus MoreAEGotRequiredParams(const AppleEvent* pAppleEventPtr)
{
DescType returnedType;
Size actualSize;
OSStatus anError;
// look for the keyMissedKeywordAttr, just to see if it's there
anError = AEGetAttributePtr(pAppleEventPtr, keyMissedKeywordAttr, typeWildCard,
&returnedType, NULL, 0, &actualSize);
switch (anError)
{
case errAEDescNotFound: // attribute not there means we
anError = noErr; // got all required parameters.
break;
case noErr: // attribute there means missed
anError = errAEParamMissed; // at least one parameter.
break;
// default: pass on unexpected error in looking for the attribute
}
return (anError);
} // GotReqiredParams
/********************************************************************************
Takes a reply event checks it for any errors that may have been returned
by the event handler. A simple function, in that it only returns the error
number. You can often also extract an error string and three other error
parameters from a reply event.
Also see:
IM:IAC for details about returned error strings.
AppleScript developer release notes for info on the other error parameters.
pAEReply ==> The reply event to be checked.
RESULT CODES
____________
noErr 0 No error
???? ?? Pretty much any error, depending on what the
event handler returns for it's errors.
*/
pascal OSStatus MoreAEGetHandlerError(const AppleEvent* pAEReply)
{
OSStatus anError = noErr;
OSErr handlerErr;
DescType actualType;
long actualSize;
if ( pAEReply->descriptorType != typeNull ) // there's a reply, so there may be an error
{
OSErr getErrErr = noErr;
getErrErr = AEGetParamPtr( pAEReply, keyErrorNumber, typeShortInteger, &actualType,
&handlerErr, sizeof( OSErr ), &actualSize );
if ( getErrErr != errAEDescNotFound ) // found an errorNumber parameter
{
anError = handlerErr; // so return it's value
}
}
return anError;
}//end MoreAEGetHandlerError
/********************************************************************************
Get the class and ID from an AppleEvent.
pAppleEvent ==> The event to get the class and ID from.
pAEEventClass output: The event's class.
pAEEventID output: The event's ID.
RESULT CODES
____________
noErr 0 No error
memFullErr -108 Not enough room in heap zone
errAEDescNotFound -1701 Descriptor record was not found
errAENotAEDesc -1704 Not a valid descriptor record
errAEReplyNotArrived -1718 Reply has not yet arrived
*/
pascal OSStatus MoreAEExtractClassAndID(
const AppleEvent* pAppleEvent,
AEEventClass* pAEEventClass,
AEEventID* pAEEventID )
{
DescType actualType;
Size actualSize;
OSStatus anError;
anError = AEGetAttributePtr( pAppleEvent, keyEventClassAttr, typeType, &actualType,
pAEEventClass, sizeof( pAEEventClass ), &actualSize );
if ( noErr == anError )
{
anError = AEGetAttributePtr( pAppleEvent, keyEventIDAttr, typeType, &actualType,
pAEEventID, sizeof( pAEEventID ), &actualSize );
}
return ( anError );
}//end ExtractClassAndID
/********************************************************************************
A very simple idle function. It simply ignors any event it receives,
returns 30 for the sleep time and NULL for the mouse region.
Your application should supply an idle function that handles any events it
might receive. This is especially important if your application has any windows.
Also see:
IM:IAC for details about idle functions.
Pending Update Perils technote for more about handling low-level events.
*/
pascal Boolean MoreAESimpleIdleFunction(
EventRecord* event,
long* sleepTime,
RgnHandle* mouseRgn )
{
#pragma unused( event )
*sleepTime = 30;
*mouseRgn = NULL;
return ( false );
}//end MoreAESimpleIdleFunction
/********************************************************************************
Is the Apple Event Manager present.
RESULT CODES
____________
true The Apple Event Manager is present
false It isn't
*/
pascal Boolean MoreAEHasAppleEvents(void)
{
static long gHasAppleEvents = kFlagNotSet;
if ( gHasAppleEvents == kFlagNotSet )
{
long response;
if ( Gestalt( gestaltAppleEventsAttr, &response ) == noErr )
gHasAppleEvents = ( response & (1L << gestaltAppleEventsPresent) ) != 0;
}
return (gHasAppleEvents != 0);
}//end MoreAEHasAppleEvents
//*******************************************************************************
// Did this AppleEvent come from the Finder?
pascal OSStatus MoreAEIsSenderFinder (const AppleEvent* pAppleEvent, Boolean* pIsFinder)
{
OSStatus anError = noErr;
DescType actualType;
ProcessSerialNumber senderPSN;
Size actualSize;
if (!MoreAssertPCG (pAppleEvent && pIsFinder)) return paramErr;
if (!MoreAssertPCG (pAppleEvent->descriptorType == typeAppleEvent)) return paramErr;
if (!MoreAssertPCG (pAppleEvent->dataHandle)) return paramErr;
anError = AEGetAttributePtr (pAppleEvent, keyAddressAttr, typeProcessSerialNumber, &actualType,
(Ptr) &senderPSN, sizeof (senderPSN), &actualSize);
if (MoreAssertPCG (noErr == anError))
{
if (!MoreAssertPCG (actualType == typeProcessSerialNumber))
anError = paramErr;
else if (!MoreAssertPCG (actualSize == sizeof (senderPSN)))
anError = paramErr;
else
{
ProcessInfoRec processInfo;
if (!(anError = MoreProcGetProcessInformation (&senderPSN,&processInfo)))
{
*pIsFinder = ( processInfo.processSignature == kFinderProcessSignature &&
processInfo.processType == kFinderProcessType);
}
}
}
return anError;
}//end MoreAEIsSenderFinder
//*******************************************************************************
// This routine returns true if and only if pAEDesc is the "missing value" value.
pascal Boolean MoreAEIsMissingValue(const AEDesc* pAEDesc)
{
DescType missing;
return (pAEDesc->descriptorType == typeType)
&& (AEGetDescDataSize(pAEDesc) == sizeof(missing))
&& (AEGetDescData(pAEDesc, &missing, sizeof(missing)) == noErr)
&& (missing == cMissingValue);
}//end MoreAEIsMissingValue
//*******************************************************************************
// This routine creates a descriptor that represents the missing value.
pascal OSStatus MoreAECreateMissingValue(AEDesc* pAEDesc)
{
const static DescType missingValue = cMissingValue;
return AECreateDesc(typeType, &missingValue, sizeof(missingValue), pAEDesc);
}//end MoreAECreateMissingValue
| [
"contact@stevemoser.org"
] | contact@stevemoser.org |
e286424bc329ed5f097a85152b079e2c2789f616 | d2249116413e870d8bf6cd133ae135bc52021208 | /VC++jsnm code/ex31c/ex31c.h | 02696d389d18a626818eb24a0dd6cf0bc2972027 | [] | no_license | Unknow-man/mfc-4 | ecbdd79cc1836767ab4b4ca72734bc4fe9f5a0b5 | b58abf9eb4c6d90ef01b9f1203b174471293dfba | refs/heads/master | 2023-02-17T18:22:09.276673 | 2021-01-20T07:46:14 | 2021-01-20T07:46:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,355 | h | // ex31c.h : main header file for the EX31C application
//
#if !defined(AFX_EX31C_H__496552F5_957C_11D0_85C0_97AC5D47DD70__INCLUDED_)
#define AFX_EX31C_H__496552F5_957C_11D0_85C0_97AC5D47DD70__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CEx31cApp:
// See ex31c.cpp for the implementation of this class
//
class CEx31cApp : public CWinApp
{
public:
CEx31cApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEx31cApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CEx31cApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EX31C_H__496552F5_957C_11D0_85C0_97AC5D47DD70__INCLUDED_)
| [
"chenchao0632@163.com"
] | chenchao0632@163.com |
8bfa548d5231ea6e0e26819b39678ac6ef690ae0 | 6a5399a6674045b16f5cbd57820fbf41f6353c7f | /src/main.cpp | d15fd6b3c158f94401891cb5dffd11d5d10248ec | [] | no_license | brico-labs/PrototipoPlotter | fb1dc176fc75ad1dc9e8e13d9a5c86b07e749b76 | 7af1307e90e5346db8a0075b8ea7175708e78340 | refs/heads/master | 2020-05-01T02:31:17.592576 | 2019-03-22T22:56:55 | 2019-03-22T23:11:09 | 177,220,372 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,072 | cpp | #include <Arduino.h>
// the regular Adafruit "TouchScreen.h" library only works on AVRs
// different mcufriend shields have Touchscreen on different pins
// and rotation.
// Run the UTouch_calibr_kbv sketch for calibration of your shield
#include <Adafruit_GFX.h> // Core graphics library
//#include <Adafruit_TFTLCD.h> // Hardware-specific library
//Adafruit_TFTLCD tft(A3, A2, A1, A0, A4);
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft; // hard-wired for UNO shields anyway.
#include <TouchScreen.h>
//#include <SD.h>
#include <SdFat.h>
#include <SPI.h>
#if defined(__SAM3X8E__)
#undef __FlashStringHelper::F(string_literal)
#define F(string_literal) string_literal
#endif
#include <SoftwareSerial.h>
//----------------------------------------|
// TFT Breakout -- Arduino UNO / Mega2560 / OPEN-SMART UNO Black
// GND -- GND
// 3V3 -- 3.3V
// CS -- A3
// RS -- A2
// WR -- A1
// RD -- A0
// RST -- RESET
// LED -- GND
// DB0 -- 8
// DB1 -- 9
// DB2 -- 10
// DB3 -- 11
// DB4 -- 4
// DB5 -- 13
// DB6 -- 6
// DB7 -- 7
// most mcufriend shields use these pins and Portrait mode:
typedef struct
{
double x;
double y;
} Point;
uint8_t YP = A1; // must be an analog pin, use "An" notation!
uint8_t XM = A2; // must be an analog pin, use "An" notation!
uint8_t YM = 7; // can be a digital pin
uint8_t XP = 6; // can be a digital pin
uint8_t SwapXY = 0;
uint8_t GRBL_TX = 3;
uint8_t GRBL_RX = 2;
SoftwareSerial grbl(GRBL_RX, GRBL_TX); // RX, TX
// Valores máximos y mínimos del táctil
uint16_t TS_LEFT = 870;
uint16_t TS_RT = 165;
uint16_t TS_TOP = 970;
uint16_t TS_BOT = 110;
char *name = "Unknown controller";
const int MIN_POINT_INTERVAL = 100;
// For better pressure precision, we need to know the resistance
// between X+ and X- Use any multimeter to read it
// For the one we're using, its 300 ohms across the X plate
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 250);
TSPoint tp;
File myFile;
int feedrate = 100;
int CS_PIN = 5; //CS_PIN Tarjeta SD
const uint8_t SOFT_MISO_PIN = 12;
const uint8_t SOFT_MOSI_PIN = A4;
const uint8_t SOFT_SCK_PIN = A5;
//
// Chip select may be constant or RAM variable.
//const uint8_t SD_CHIP_SELECT_PIN = 10;
// SdFat software SPI template
SdFatSoftSpi<SOFT_MISO_PIN, SOFT_MOSI_PIN, SOFT_SCK_PIN> SD;
#define MINPRESSURE 20
#define MAXPRESSURE 1000
#define SWAP(a, b) \
{ \
uint16_t tmp = a; \
a = b; \
b = tmp; \
}
uint16_t BOXSIZE;
uint16_t BOXSIZEY;
uint16_t PENRADIUS = 3;
uint16_t identifier, oldcolor, currentcolor;
uint8_t Orientation = 3; //PORTRAIT
// Assign human-readable names to some common 16-bit color values:
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
void show_Serial(void)
{
/* Serial.print(F("Found "));
Serial.print(name);
Serial.println(F(" LCD driver"));
Serial.print(F("ID=0x"));
Serial.println(identifier, HEX);
Serial.println("Screen is " + String(tft.width()) + "x" + String(tft.height()));
Serial.println("Calibration is: ");
Serial.println("LEFT = " + String(TS_LEFT) + " RT = " + String(TS_RT));
Serial.println("TOP = " + String(TS_TOP) + " BOT = " + String(TS_BOT));
Serial.print("Wiring is: ");
Serial.println(SwapXY ? "SWAPXY" : "PORTRAIT");
Serial.println("YP=" + String(YP) + " XM=" + String(XM));
Serial.println("YM=" + String(YM) + " XP=" + String(XP));
*/
}
/*
void show_tft(void) // FUNCION para mostrar parámetros de la SD. Comentada para ahorrar tiempo más adelante, la dejamos por si hiciese falta comprobar algo
{
tft.setCursor(0, 0);
tft.setTextSize(2);
tft.print(F("Found "));
tft.print(name);
tft.println(F(" LCD"));
tft.setTextSize(1);
tft.print(F("ID=0x"));
tft.println(identifier, HEX);
tft.println("Screen is " + String(tft.width()) + "x" + String(tft.height()));
tft.println("Calibration is: ");
tft.println("LEFT = " + String(TS_LEFT) + " RT = " + String(TS_RT));
tft.println("TOP = " + String(TS_TOP) + " BOT = " + String(TS_BOT));
tft.print("\nWiring is: ");
if (SwapXY)
{
tft.setTextColor(CYAN);
tft.setTextSize(2);
}
tft.println(SwapXY ? "SWAPXY" : "PORTRAIT");
tft.println("YP=" + String(YP) + " XM=" + String(XM));
tft.println("YM=" + String(YM) + " XP=" + String(XP));
tft.setTextSize(2);
tft.setTextColor(RED);
tft.setCursor((tft.width() - 48) / 2, (tft.height() * 2) / 4);
tft.print("EXIT");
tft.setTextColor(YELLOW, BLACK);
tft.setCursor(0, (tft.height() * 6) / 8);
tft.print("Touch screen for loc");
while (1)
{
tp = ts.getPoint();
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
pinMode(XP, OUTPUT);
pinMode(YM, OUTPUT);
if (tp.z < MINPRESSURE || tp.z > MAXPRESSURE)
continue;
if (tp.x > 450 && tp.x < 570 && tp.y > 450 && tp.y < 570)
break;
tft.setCursor(0, (tft.height() * 3) / 4);
tft.print("tp.x=" + String(tp.x) + " tp.y=" + String(tp.y) + " ");
}
}
*/
void setup(void)
{
uint16_t tmp;
tft.begin(9600);
tft.reset();
identifier = tft.readID();
if (identifier == 0x6814)
name = "RM68140";
switch (Orientation)
{ // adjust for different aspects
case 0:
break; //no change, calibrated for PORTRAIT
case 1:
tmp = TS_LEFT, TS_LEFT = TS_BOT, TS_BOT = TS_RT, TS_RT = TS_TOP, TS_TOP = tmp;
break;
case 2:
SWAP(TS_LEFT, TS_RT);
SWAP(TS_TOP, TS_BOT);
break;
case 3:
tmp = TS_LEFT, TS_LEFT = TS_TOP, TS_TOP = TS_RT, TS_RT = TS_BOT, TS_BOT = tmp;
break;
}
Serial.begin(115200);
grbl.begin(115200);
tft.begin(0x6814); //to enable RM68140 driver code
show_Serial();
tft.setRotation(Orientation);
tft.fillScreen(BLACK);
// show_tft(); // Retiramos la pantalla para ahorrar el tener que darle a exit
BOXSIZE = 480 / 4; ////tft.width() / 6;
BOXSIZEY = 320 / 10;
tft.fillScreen(BLACK);
// DIBUJAMOS BOTONES
tft.fillRect(0, 0, BOXSIZE, BOXSIZEY, BLUE);
tft.setCursor(BOXSIZE / 2 - 10, BOXSIZEY / 2 - 7);
tft.setTextSize(2);
tft.setTextColor(BLACK, BLUE);
tft.print("H");
tft.fillRect(BOXSIZE, 0, BOXSIZE, BOXSIZEY, RED);
tft.setCursor(BOXSIZE + BOXSIZE / 2 - 10, BOXSIZEY / 2 - 7);
tft.setTextSize(2);
tft.setTextColor(BLACK, RED);
tft.print("X");
tft.fillRect(BOXSIZE * 2, 0, BOXSIZE, BOXSIZEY, YELLOW);
tft.setCursor(BOXSIZE * 2 + BOXSIZE / 2 - 10, BOXSIZEY / 2 - 7);
tft.setTextColor(BLACK, YELLOW);
tft.setTextSize(2);
tft.print("S");
tft.fillRect(BOXSIZE * 3, 0, BOXSIZE, BOXSIZEY, GREEN);
tft.setCursor(BOXSIZE * 3 + BOXSIZE / 2 - 15, BOXSIZEY / 2 - 7);
tft.setTextColor(BLACK, GREEN);
tft.setTextSize(2);
tft.print("->");
//tft.drawRect(0, 0, BOXSIZE, BOXSIZEY, WHITE);
currentcolor = WHITE;
delay(1000);
if (SD.begin(CS_PIN))
Serial.println("SD"); // COMENTADO DE MOMENTO YA QUE SI SE INICIALIZA LA SD, LA PANTALLA DEJA DE DIBUJAR.
}
double segmentLength = 20; // mm
char lineBuffer[50];
double paddingLeft = 0;
double paddingRight = 0;
double paddingTop = 0;
double height = 580;
double width = 710;
Point M1 = {-paddingLeft, height + paddingTop};
Point M2 = {width + paddingRight, height + paddingTop};
Point currentPos = {0, 0};
unsigned long currentPosTime = millis();
double module(Point p)
{
return sqrt(p.x * p.x + p.y * p.y);
}
Point getVector(Point p1, Point p2)
{
return {p2.x - p1.x, p2.y - p1.y};
}
double distance(Point p1, Point p2)
{
Point p = getVector(p1, p2);
return module(p);
}
void generateTranslateGcode(const char *op, double x, double y, double f)
{
sprintf(lineBuffer, "%s X", op);
dtostrf(x, 4, 2, &lineBuffer[strlen(lineBuffer)]);
strcpy(&lineBuffer[strlen(lineBuffer)], " Y");
dtostrf(y, 4, 2, &lineBuffer[strlen(lineBuffer)]);
if (f)
{
strcpy(&lineBuffer[strlen(lineBuffer)], " F");
dtostrf(f, 4, 2, &lineBuffer[strlen(lineBuffer)]);
}
}
void waitForOk()
{
// read the receive buffer (if anything to read)
char c, lastc;
while (true)
{
if (grbl.available())
{
c = grbl.read();
// Serial.print("rec:");
// Serial.println(c);
if (lastc == 'o' && c == 'k')
{
Serial.println("GRBL <- OK");
return;
}
lastc = c;
}
delay(3);
}
}
void sendToGrbl(const char *gcode)
{
Serial.print("GRBL -> ");
Serial.println(gcode);
// vaciar buffer
while (grbl.available())
{
grbl.read();
}
grbl.println(gcode);
waitForOk();
}
Point toPolar(Point cartesian)
{
Point value = {
module(getVector(M1, cartesian)),
module(getVector(M2, cartesian))};
/*
Serial.print(" Cartesian: ");
Serial.print(cartesian.x);
Serial.print(",");
Serial.println(cartesian.y);
Serial.print(" Polar: ");
Serial.print(value.x);
Serial.print(",");
Serial.println(value.y);
*/
return value;
}
void processLine(char *line)
{
double X;
double Y;
double F = 100;
char *lineCopy = strdup(line);
char *op = strtok(lineCopy, " ");
if ((strcmp(op, "G1") == 0) || (strcmp(op, "G0") == 0))
{
char *param;
while (param = strtok(NULL, " "))
{
// Serial.print("Param: ");
// Serial.print(param);
// Serial.println(".");
if (param[0] == 'X')
{
//sscanf(¶m[1], "%lf", &X);
X = atof(¶m[1]);
}
else if (param[0] == 'Y')
{
//sscanf(¶m[1], "%lf", &Y);
Y = atof(¶m[1]);
}
else if (param[0] == 'F')
{
//sscanf(¶m[1], "%lf", &F);
F = atof(¶m[1]);
}
else
{
Serial.print("Unknown param ");
Serial.println(param);
}
}
Point targetPos = {X, Y};
Point vector = getVector(currentPos, targetPos);
double v_mod = module(vector);
double segments = v_mod / segmentLength;
double deltaX = vector.x / segments;
double deltaY = vector.y / segments;
Point nextPos;
Point nextPosPolar;
for (int i = 1; i < segments; i++)
{
nextPos.x = currentPos.x + deltaX * i;
nextPos.y = currentPos.y + deltaY * i;
nextPosPolar = toPolar(nextPos);
generateTranslateGcode(op, nextPosPolar.x, nextPosPolar.y, F);
sendToGrbl(lineBuffer);
}
nextPosPolar = toPolar(targetPos);
generateTranslateGcode(op, nextPosPolar.x, nextPosPolar.y, F);
sendToGrbl(lineBuffer);
currentPos.x = targetPos.x;
currentPos.y = targetPos.y;
}
else
{
sendToGrbl(line);
}
free(lineCopy);
}
void guardasd()
{
myFile = SD.open("test.txt", FILE_WRITE);
generateTranslateGcode("G1", currentPos.x, currentPos.y, feedrate);
myFile.println(lineBuffer);
myFile.close();
}
void pantallaserial()
{
generateTranslateGcode("G1", currentPos.x, currentPos.y, feedrate);
Serial.println(lineBuffer);
}
void calcfeedrate()
{
/* tenemos posición anterior y posición actual. necesitamos distancia entre los dos puntos.
a = xpos - xpos_old
b = ypos - ypos_old
c^2 = x^2 + y^2
c = sqrt(a*a+b*b)
tenemos millis anterior y actual
tiempo = millis_old - primermillis(); (no se me ocurre como detectar el primertoque ahora mismo)
feedrate = c/tiempo;
*/
}
void sdaserial()
{ // se sustituirá por "enviargcode", usar para ver que funciona bien "guardasd"
//Serial.println("Archivo test.txt: ");
myFile = SD.open("test.txt");
while (myFile.available())
{
Serial.write(myFile.read());
}
myFile.close();
//Serial.println("-----------");
}
void borra()
{ // Seica si abres el archivo en modo escritura y lo cierras sin decir nada, se borra el contenido.
SD.remove("test.txt");
tft.fillRect(0, BOXSIZEY, tft.width(), tft.height() - BOXSIZEY, BLACK);
}
void setHome()
{
Serial.println("Set Home");
sendToGrbl("G90"); // absolute coordinates
sendToGrbl("G21");
currentPos = {M1.x, M1.y};
generateTranslateGcode("G92", M1.x, M1.y, 0.0); // set zero
sendToGrbl(lineBuffer);
}
void sdagrbl()
{
char lineBuffer[50];
int lineBufferLength = 0;
// enviar G90, G21 y G92 X0 Y0
myFile = SD.open("test.txt");
while (myFile.available())
{
char c = myFile.read();
if (c == '\n' || c == '\r')
{
lineBuffer[lineBufferLength] = '\0';
processLine(lineBuffer);
lineBufferLength = 0;
}
else
{
lineBuffer[lineBufferLength++] = c;
}
}
lineBuffer[lineBufferLength] = '\0';
processLine(lineBuffer);
myFile.close();
}
void loop()
{
uint16_t xpos, ypos; //screen coordinates
tp = ts.getPoint(); //tp.x, tp.y are ADC values
// if sharing pins, you'll need to fix the directions of the touchscreen pins
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
pinMode(XP, OUTPUT);
pinMode(YM, OUTPUT);
// digitalWrite(XM, HIGH);
// digitalWrite(YP, HIGH);
// we have some minimum pressure we consider 'valid'
// pressure of 0 means no pressing!
if (tp.z > MINPRESSURE && tp.z < MAXPRESSURE && (millis() > currentPosTime + MIN_POINT_INTERVAL))
{
// Serial.print("X = "); Serial.print(tp.x);
// Serial.print("\tY = "); Serial.print(tp.y);
// Serial.print("\tPressure = "); Serial.println(tp.z);
// is controller wired for Landscape ? or are we oriented in Landscape?
if (SwapXY != (Orientation & 1))
SWAP(tp.x, tp.y);
// scale from 0->1023 to tft.width i.e. left = 0, rt = width
// most mcufriend have touch (with icons) that extends below the TFT
// screens without icons need to reserve a space for "erase"
// scale the ADC values from ts.getPoint() to screen values e.g. 0-239
xpos = map(tp.x, TS_LEFT, TS_RT, 0, tft.width());
ypos = map(tp.y, TS_TOP, TS_BOT, 0, tft.height());
if (Orientation == 3)
{
xpos = tft.width() - xpos;
ypos = tft.height() - ypos;
}
// Si pos < altura botones comprueba pos horizontal para determinar boton en concreto
if ((ypos < BOXSIZEY) && (ypos >= 0))
{
if (xpos < BOXSIZE)
{
Serial.println("H");
setHome();
return;
}
else if (xpos < BOXSIZE * 2)
{
borra();
Serial.println("X");
return;
}
else if (xpos < BOXSIZE * 3)
{
sdaserial();
Serial.println("S");
return;
}
else if (xpos < BOXSIZE * 4)
{
Serial.println("->");
sdagrbl();
return;
}
}
// Si pos > altura botones, dibuja línea
if (ypos > 0 && ((ypos - PENRADIUS) > BOXSIZEY) && ((ypos + PENRADIUS) < (uint16_t)tft.height()))
{
//tft.fillCircle(xpos, ypos, PENRADIUS, WHITE);
tft.drawLine(currentPos.x, currentPos.y, xpos, ypos, WHITE);
currentPos.x = xpos;
currentPos.y = ypos;
currentPosTime = millis();
//pantallaserial(); // escribe en serialmonitor
guardasd(); // escribe en SD
}
}
}
| [
"santi.castro@gmail.com"
] | santi.castro@gmail.com |
0205f52c38082d64ec379a6e21b8e71de1f70e0f | 39ee805e40b43ca3238b588e622367d6ae81b028 | /Version2/src/Simulation.cpp | 8ac444b2aae9c7137743aba1d95f1fd53c88d87d | [] | no_license | Willbtsg/CS-307--Mendelian-Genetics | 40f21cce2ccf8872f3d718627cc167ddc40a229e | 74badbc0ae7efb4da467f9ce75c5010cca848961 | refs/heads/master | 2022-11-28T00:19:47.870185 | 2020-06-26T18:48:30 | 2020-06-26T18:48:30 | 275,182,331 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,656 | cpp | /*******************************************************************
* CS 307 Programming Assignment 2
* File: Simulation.cpp
* Author: Will Thomason
* Desc: This program attempts to recreate a model of genetic
* reproduction using chromosomes with linked traits.
* Date: 11/21/19
*
* I attest that this program is entirely my own work
*******************************************************************/
#include "Simulation.h"
#include "SimModel.h"
#include "SimViewer.h"
#include "SimController.h"
#include "GeneticsSimDataParser.h"
#include "GeneFactory.h"
#include "ParentFactory.h"
using namespace std;
//-----------------------------------
// Constructor
//-----------------------------------
Simulation::Simulation()
{
}
//-----------------------------------
// Destructor
//-----------------------------------
Simulation::~Simulation()
{
}
//------------------------------------------------
// creates SimModel and uses Parser
// to create necessary objects within the Model
//------------------------------------------------
void Simulation::initializeSimulation()
{
int i;
const char *filename; //used to hold user input
string fileRequest = "Please input the name of the data file you would like to use.";
SimViewer View; //instantiate a View object
View.printMessage(fileRequest); //print fileRequest to the screen
string input = View.returnText(); //store user input
filename = input.data(); //copy user input into proper format
GeneticsSimDataParser *Parser = GeneticsSimDataParser::getInstance(); //instantiate the Parser
Parser->initDataFile(filename); //initialize the data file
SimModel* Model = SimModel::getInstance(); //gets instance of SimModel
GeneFactory* GFactory = GeneFactory::getInstance();
for (i = 0; i < Parser->getGeneCount(); i++) //until Parser runs out of gene data...
{
Model->addMG(GFactory->createMasterGene()); //create a new MasterGene and add it to the Model
}
ParentFactory* PFactory = ParentFactory::getInstance(); //gets instance of ParentFactory
for (i = 0; i < 2; i++)
{
Model->addParent(PFactory->createParent(i)); //create both of the Parent objects using the ParentFactory and store them in Model
}
Model->setMGCOrder(); //set MGCOrder so MGList data can be retrieved in the proper order later
return;
}
//--------------------------------------
// starts timer and calls SimController
//--------------------------------------
void Simulation::runSimulation()
{
srand((unsigned int)(time(NULL)));
SimViewer View;
View.printMessage("Running Simulation...");
View.printMessage("\n");
SimController Control;
Control.manageSim();
return;
} | [
"willbtsg@gmail.com"
] | willbtsg@gmail.com |
693d0cc4f6fd65bbfb1cc8fc7c07b8eb55792187 | a3c411e37389686e17c64a5bb20c3bafd02242ee | /include/Utility.h | f68e3fd316c1b8cf834b2dbacb5563badd8d5b42 | [] | no_license | Zaiyugi/euryale | 9aa5756614ee1d7ebef950bebcaf1031f8b9104a | e1abe046934c347b9469bef5b8a8d8faeded11be | refs/heads/master | 2021-01-10T23:33:48.459854 | 2017-02-18T07:47:04 | 2017-02-18T07:47:04 | 70,593,557 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 626 | h | /* Name: Zachary Shore
* Created: 2013-12-30
* Edited: 2014-08-04
* Spec: Utility Functions
*/
#ifndef __UTILITY_H__
#define __UTILITY_H__
#include <cstdio>
#include <string>
#include <cxxabi.h>
#include <vector>
#include <Vector.h>
namespace util
{
template <typename T>
void gettype(const T obj);
void writeKarl(std::string path, std::vector<lux::Vector> &data);
void writeObj(std::string path, std::vector<lux::Vector> &data);
float round_to_nearest(float number, float base);
// Template Functions (Strange Magic...)
template <typename T> int sgn(T val);
template <typename T> void swap(T &a, T &b);
}
#endif
| [
"zshore@g.clemson.edu"
] | zshore@g.clemson.edu |
d708f4a60630b2e23aa390f02069a5eb059e446b | c97562296726c3ab80f95aa7187532dfb0e391b4 | /Unbias_LightGBM/src/metric/multiclass_metric.hpp | 6618e2aefa01645e52ae094d216ae7d84dc55451 | [
"MIT"
] | permissive | hbghhy/Unbiased_LambdaMart | a5ee75a5076c6560537e849636fc4db2d12aa6c0 | af756db517d08201ed72d4bab1d91c064fb7e2d9 | refs/heads/master | 2020-08-23T22:15:34.492682 | 2019-10-29T08:31:43 | 2019-10-29T08:31:43 | 216,714,251 | 0 | 0 | MIT | 2019-10-22T03:19:57 | 2019-10-22T03:19:56 | null | UTF-8 | C++ | false | false | 5,612 | hpp | #ifndef LIGHTGBM_METRIC_MULTICLASS_METRIC_HPP_
#define LIGHTGBM_METRIC_MULTICLASS_METRIC_HPP_
#include <LightGBM/utils/log.h>
#include <LightGBM/metric.h>
#include <cmath>
namespace LightGBM {
/*!
* \brief Metric for multiclass task.
* Use static class "PointWiseLossCalculator" to calculate loss point-wise
*/
template<typename PointWiseLossCalculator>
class MulticlassMetric: public Metric {
public:
explicit MulticlassMetric(const MetricConfig& config) {
num_class_ = config.num_class;
}
virtual ~MulticlassMetric() {
}
void Init(const Metadata& metadata, data_size_t num_data) override {
name_.emplace_back(PointWiseLossCalculator::Name());
num_data_ = num_data;
// get label
label_ = metadata.label();
// get weights
weights_ = metadata.weights();
if (weights_ == nullptr) {
sum_weights_ = static_cast<double>(num_data_);
} else {
sum_weights_ = 0.0f;
for (data_size_t i = 0; i < num_data_; ++i) {
sum_weights_ += weights_[i];
}
}
}
const std::vector<std::string>& GetName() const override {
return name_;
}
double factor_to_bigger_better() const override {
return -1.0f;
}
std::vector<double> Eval(const double* score, const ObjectiveFunction* objective) const override {
double sum_loss = 0.0;
int num_tree_per_iteration = num_class_;
int num_pred_per_row = num_class_;
if (objective != nullptr) {
num_tree_per_iteration = objective->NumModelPerIteration();
num_pred_per_row = objective->NumPredictOneRow();
}
if (objective != nullptr) {
if (weights_ == nullptr) {
#pragma omp parallel for schedule(static) reduction(+:sum_loss)
for (data_size_t i = 0; i < num_data_; ++i) {
std::vector<double> raw_score(num_tree_per_iteration);
for (int k = 0; k < num_tree_per_iteration; ++k) {
size_t idx = static_cast<size_t>(num_data_) * k + i;
raw_score[k] = static_cast<double>(score[idx]);
}
std::vector<double> rec(num_pred_per_row);
objective->ConvertOutput(raw_score.data(), rec.data());
// add loss
sum_loss += PointWiseLossCalculator::LossOnPoint(label_[i], rec);
}
} else {
#pragma omp parallel for schedule(static) reduction(+:sum_loss)
for (data_size_t i = 0; i < num_data_; ++i) {
std::vector<double> raw_score(num_tree_per_iteration);
for (int k = 0; k < num_tree_per_iteration; ++k) {
size_t idx = static_cast<size_t>(num_data_) * k + i;
raw_score[k] = static_cast<double>(score[idx]);
}
std::vector<double> rec(num_pred_per_row);
objective->ConvertOutput(raw_score.data(), rec.data());
// add loss
sum_loss += PointWiseLossCalculator::LossOnPoint(label_[i], rec) * weights_[i];
}
}
} else {
if (weights_ == nullptr) {
#pragma omp parallel for schedule(static) reduction(+:sum_loss)
for (data_size_t i = 0; i < num_data_; ++i) {
std::vector<double> rec(num_tree_per_iteration);
for (int k = 0; k < num_tree_per_iteration; ++k) {
size_t idx = static_cast<size_t>(num_data_) * k + i;
rec[k] = static_cast<double>(score[idx]);
}
// add loss
sum_loss += PointWiseLossCalculator::LossOnPoint(label_[i], rec);
}
} else {
#pragma omp parallel for schedule(static) reduction(+:sum_loss)
for (data_size_t i = 0; i < num_data_; ++i) {
std::vector<double> rec(num_tree_per_iteration);
for (int k = 0; k < num_tree_per_iteration; ++k) {
size_t idx = static_cast<size_t>(num_data_) * k + i;
rec[k] = static_cast<double>(score[idx]);
}
// add loss
sum_loss += PointWiseLossCalculator::LossOnPoint(label_[i], rec) * weights_[i];
}
}
}
double loss = sum_loss / sum_weights_;
return std::vector<double>(1, loss);
}
private:
/*! \brief Number of data */
data_size_t num_data_;
/*! \brief Pointer of label */
const label_t* label_;
/*! \brief Pointer of weighs */
const label_t* weights_;
/*! \brief Sum weights */
double sum_weights_;
/*! \brief Name of this test set */
std::vector<std::string> name_;
int num_class_;
};
/*! \brief L2 loss for multiclass task */
class MultiErrorMetric: public MulticlassMetric<MultiErrorMetric> {
public:
explicit MultiErrorMetric(const MetricConfig& config) :MulticlassMetric<MultiErrorMetric>(config) {}
inline static double LossOnPoint(label_t label, std::vector<double>& score) {
size_t k = static_cast<size_t>(label);
for (size_t i = 0; i < score.size(); ++i) {
if (i != k && score[i] >= score[k]) {
return 1.0f;
}
}
return 0.0f;
}
inline static const char* Name() {
return "multi_error";
}
};
/*! \brief Logloss for multiclass task */
class MultiSoftmaxLoglossMetric: public MulticlassMetric<MultiSoftmaxLoglossMetric> {
public:
explicit MultiSoftmaxLoglossMetric(const MetricConfig& config) :MulticlassMetric<MultiSoftmaxLoglossMetric>(config) {}
inline static double LossOnPoint(label_t label, std::vector<double>& score) {
size_t k = static_cast<size_t>(label);
if (score[k] > kEpsilon) {
return static_cast<double>(-std::log(score[k]));
} else {
return -std::log(kEpsilon);
}
}
inline static const char* Name() {
return "multi_logloss";
}
};
} // namespace LightGBM
#endif // LightGBM_METRIC_MULTICLASS_METRIC_HPP_
| [
"bull@Scai2.CS.UCLA.EDU"
] | bull@Scai2.CS.UCLA.EDU |
fce556101db7f9bbfd55c78b82ea94ae965d690a | 566410d1cc2d89d9e9a118f1beccf67788f6f45a | /Week 1/Day6. Plus_One.cpp | ef890d9f68c1f444f359e8469c08e6f9c2fd49a5 | [] | no_license | rajyash1904/July-LeetCoding-Challenge | 540069bd13283188ce49847ba5cfd4cc0671001d | 036fffa0bb54307a6bb7e0c8bf1eae975f8a8022 | refs/heads/master | 2022-11-26T22:33:10.191470 | 2020-08-01T16:49:46 | 2020-08-01T16:49:46 | 276,415,131 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,082 | cpp | /*
Plus One
Given a non-empty array of digits representing a non-negative integer, increment one to the integer.
The digits are stored such that the most significant digit is at the head of the list, and each element in the array contains a single digit.
You may assume the integer does not contain any leading zero, except the number 0 itself.
Example 1:
Input: [1,2,3]
Output: [1,2,4]
Explanation: The array represents the integer 123.
Example 2:
Input: [4,3,2,1]
Output: [4,3,2,2]
Explanation: The array represents the integer 4321.
*/
class Solution {
public:
vector<int> plusOne(vector<int>& digits)
{
bool flag=1;
for(int i=digits.size()-1;i>=0;i--)
{
int k=digits[i];
if(k==9)
{
digits[i]=0;
if(i==0)
{
digits.insert(digits.begin(),1);
}
}
else
{
digits[i]=k+1;
break;
}
}
return digits;
}
}; | [
"ybalidani19.yr@gmail.com"
] | ybalidani19.yr@gmail.com |
667bda5c4ac528b6ef942a7e2551dbe2817a1443 | f0efd484afc3a22ec942b38b9e7bd42ef7e21a9d | /silnia/main.cpp | 59edf31fd75530ef189adead30e18451fb2eb801 | [] | no_license | michalPlusPlus/cpp_szkola | a8a052ebe3671b87f171fb0beeedfce2ae8e42df | 6b94f1af48a0eaad956841c724afd1cd49ac349b | refs/heads/master | 2022-12-31T10:33:58.831487 | 2020-10-17T09:23:10 | 2020-10-17T09:23:10 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,179 | cpp | #include <iostream>
using namespace std;
int silnia (int param) {
int result(1); //program result n! initialised for silnia(1)
for (int i=2; i<=param; i++) {
result*=i;
}
return result;
}
int r_silnia (int n) {
int result(1);
if (n==1) {
return result;
}
else {
result = r_silnia(n-1)*n;
}
return result;
}
/*
int r_silnia (int n) {
if (n==1) {
return 1;
}
else {
return r_silnia(n-1)*n;
}
}
*/
int main(int argc, char* argv[])
{
int input_param(10); //entered parameter
if (argc<2) {
cout << "Command line parameter has not been entered." << endl;
return 0;
}
char option = *argv[1];
switch (option) {
case '?':
cout << " 's' - for method" << endl
<< " 'r' - if and else method" << endl;
break;
case 's':
cout << input_param << "! = " << silnia(input_param);
break;
case 'r':
cout << input_param << "! = " << r_silnia(input_param);
break;
default:
cout << "Selected counting option not supported";
}
cout << endl;
return 0;
}
| [
"michal.mistat@wp.pl"
] | michal.mistat@wp.pl |
61bb59a1e98d9644cd5dc8f8d941915e78937cfe | e11f9b5a9bd11e8e9f31a1c0382b2a5de921252d | /src/parfil/filter.cc | 6a4e51f6e30b93450ba2bb782ffcf232f2503281 | [
"MIT"
] | permissive | iglesias/parfil | d78d8ae85cd4e87489636a020044655f33bb95de | efb80bb15f27a1122d0d750f57a4ccfe191a7904 | refs/heads/master | 2021-01-20T04:36:05.975787 | 2013-11-08T14:12:47 | 2013-11-08T14:15:53 | 12,325,877 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,748 | cc | /* This software is distributed under the MIT license (see LICENSE file in the
* root directory)
*
* Copyright (c) 2013 Fernando J. Iglesias Garcia
*/
#include <parfil/filter.h>
#include <algorithm>
#include <cstdlib>
#include <cassert>
#include <cmath>
namespace parfil {
extern double WORLD_SIZE;
const double STEERING_NOISE = 0.1;
const double DISTANCE_NOISE = 5.0;
const double BEARING_NOISE = 0.1;
// Constructor from the number of particles.
Filter::Filter(int num_particles) {
assert(num_particles>0);
// Particle pose allocation and initialization.
m_particles.reserve(num_particles);
for (int i=0; i<num_particles; ++i) {
Robot particle = Robot();
particle.SetNoise(STEERING_NOISE,DISTANCE_NOISE,BEARING_NOISE);
m_particles.push_back(particle);
}
// Particle weights allocation.
m_weights.resize(num_particles);
}
// Destructor.
Filter::~Filter() {
}
// Extract position from particle set.
void Filter::GetPose(double& x, double& y, double& heading) const {
double heading_x = 0.0;
double heading_y = 0.0;
x = 0;
y = 0;
for (unsigned int i=0; i<m_particles.size(); ++i) {
x += m_particles[i].x();
y += m_particles[i].y();
heading_x += std::cos(m_particles[i].heading());
heading_y += std::sin(m_particles[i].heading());
}
// Normalize using the number of particles.
x /= m_particles.size();
y /= m_particles.size();
heading = std::atan2(heading_y,heading_x);
}
// Run particle filter.
void Filter::Run(const std::vector<Motion>& motions, const std::vector<Measurement>& measurements) {
assert(motions.size()==measurements.size());
for (unsigned int t = 0; t<motions.size(); ++t) {
Filter::Predict(motions[t]);
Filter::MeasurementUpdate(measurements[t]);
Filter::Resample();
}
}
void Filter::Predict(const Motion& motion) {
for (unsigned int i=0; i<m_particles.size(); ++i)
m_particles[i].Move(motion);
}
void Filter::MeasurementUpdate(const Measurement& measurement) {
for (unsigned int i=0; i<m_particles.size(); ++i)
m_weights[i] = m_particles[i].ComputeMeasurementProbability(measurement);
}
// Circular resampling.
void Filter::Resample() {
int index = int(1.0*std::rand()/RAND_MAX*m_particles.size());
double beta = 0.0;
double max_weight = *std::max_element(m_weights.begin(),m_weights.end());
std::vector<Robot> new_particles;
new_particles.reserve(m_particles.size());
for (unsigned int i=0; i<m_weights.size(); ++i) {
beta += 1.0*std::rand()/RAND_MAX*2*max_weight;
while (beta > m_weights[index]) {
beta -= m_weights[index];
index = (index+1)%m_particles.size();
}
new_particles.push_back(m_particles[index]);
}
m_particles = new_particles;
}
} // namespace parfil
| [
"fernando.iglesiasg@gmail.com"
] | fernando.iglesiasg@gmail.com |
af012be87eafefabe748f11ad32ef6db08bb1461 | 37853435f14557740f4147586150d70aeab80f5c | /samples/FedTimeDouble/fedtimeDouble.cpp | 80c70729713427fbf6d587c9e26164acece49b40 | [] | no_license | rhzg/GERTICO | 7e1f399e96989c1606a991a8c8ff5e1fc326a70f | 1bc6642f5fbb447cbd90ccadafc1bcf4debf5f48 | refs/heads/master | 2020-07-26T20:56:26.577367 | 2019-09-16T09:45:00 | 2019-09-16T09:45:00 | 208,763,474 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,766 | cpp | /*******************************************************************************
**
** Copyright (c) Fraunhofer IITB
** All rights reserved.
**
********************************************************************************
**
$Author: mul $
$Name $
$Log: fedtimeDouble.cpp,v $
Revision 1.3 2010/07/23 11:08:22 mul
Remove dos carriage returns.
Revision 1.2 2006/09/15 11:55:06 mul
Fix compile problems.
Revision 1.1 2005/07/19 09:09:11 hzg
Sample implementation for fedtime based on Double coding
Revision 1.5 2005/07/14 12:09:20 mul
Increase internal buffer for maximum time display.
Revision 1.4 2005/02/07 10:30:33 mul
Changes due to test cases.
Revision 1.3 2003/11/03 15:51:53 mul
Reusable buffer to prevent memory leak.
Revision 1.2 2003/08/13 07:26:47 mul
unused include
Revision 1.1 2003/07/16 09:53:39 mul
Place FedTime into its own directory.
Revision 1.5 2003/04/29 06:26:15 hzg
Portierung auf Windows
Revision 1.4 2002/09/10 12:52:40 mul
Fix problems with file not found. Changes for linking fedtimeDouble.cpp.
Revision 1.3 2002/07/16 12:22:59 mul
Remove newline from output.
Revision 1.2 2002/07/16 08:57:24 hzg
Copyright Hinweis und Versiondaten in Dateien aufgenommen
**
*******************************************************************************/
#define MYTIMEAPI
#include "fedtimeDouble.h"
#include <sys/types.h>
#ifdef WIN32
#include <string>
#else
#include <string.h>
#include <netinet/in.h>
#endif
#include <stdio.h>
#include <limits.h>
#if defined(USE_RTTI)
# define RTTI_CAST dynamic_cast
#else
# define RTTI_CAST static_cast
#endif
char ch[512];
RTI::FedTime::~FedTime ()
{
}
static double const
RTI_POSITIVE_INFINITY()
{
return 1.797693e+308;
}
RTIfedTime::RTIfedTime()
: _zero(0.0),
_epsilon(0.000000001),
_positiveInfinity(RTI_POSITIVE_INFINITY())
{
}
RTIfedTime::RTIfedTime(const double & theTime)
: _fedTime(theTime),
_zero(0.0),
_epsilon(0.000000001),
_positiveInfinity(RTI_POSITIVE_INFINITY())
{
}
RTIfedTime::RTIfedTime(const RTIfedTime & theTime)
: _fedTime(theTime._fedTime),
_zero(theTime._zero),
_epsilon(theTime._epsilon),
_positiveInfinity(theTime._positiveInfinity)
{
}
RTIfedTime::RTIfedTime(const RTI::FedTime & theTime)
{
RTIfedTime const & myTime = RTTI_CAST<RTIfedTime const &>(theTime);
_fedTime = myTime._fedTime;
_zero = myTime._zero;
_epsilon = myTime._epsilon;
_positiveInfinity = myTime._positiveInfinity;
}
RTIfedTime::~RTIfedTime()
{
}
void RTIfedTime::setZero()
{
_fedTime = _zero;
}
RTI::Boolean RTIfedTime::isZero()
{
if(_fedTime == 0.0)
return RTI::RTI_TRUE;
else
return RTI::RTI_FALSE;
}
void RTIfedTime::setEpsilon()
{
_fedTime = _epsilon;
}
void RTIfedTime::setPositiveInfinity()
{
_fedTime = _positiveInfinity;
}
RTI::Boolean RTIfedTime::isPositiveInfinity()
{
if(_fedTime == _positiveInfinity)
return RTI::RTI_TRUE;
else
return RTI::RTI_FALSE;
}
RTI::FedTime& RTIfedTime::operator += (const RTI::FedTime& theTime)
throw (RTI::InvalidFederationTime)
{
RTIfedTime& myTime = (RTIfedTime&)theTime;
_fedTime = _fedTime + myTime._fedTime;
return *this;
}
RTI::FedTime& RTIfedTime::operator -= (const RTI::FedTime& theTime)
throw (
RTI::InvalidFederationTime)
{
RTIfedTime& myTime = (RTIfedTime&)theTime;
_fedTime = _fedTime - myTime._fedTime;
return *this;
}
RTI::Boolean RTIfedTime::operator <= (const RTI::FedTime& theTime) const
throw (
RTI::InvalidFederationTime)
{
RTIfedTime& myTime = (RTIfedTime&)theTime;
if (_fedTime <= myTime._fedTime)
return RTI::RTI_TRUE;
else
return RTI::RTI_FALSE;
}
RTI::Boolean RTIfedTime::operator < (const RTI::FedTime& theTime) const
throw (
RTI::InvalidFederationTime)
{
RTIfedTime& myTime = (RTIfedTime&)theTime;
if (_fedTime < myTime._fedTime)
return RTI::RTI_TRUE;
else
return RTI::RTI_FALSE;
}
RTI::Boolean RTIfedTime::operator >= (const RTI::FedTime& theTime) const
throw (
RTI::InvalidFederationTime)
{
RTIfedTime& myTime = (RTIfedTime&)theTime;
if (_fedTime >= myTime._fedTime)
return RTI::RTI_TRUE;
else
return RTI::RTI_FALSE;
}
RTI::Boolean RTIfedTime::operator > (const RTI::FedTime& theTime) const
throw (
RTI::InvalidFederationTime)
{
RTIfedTime& myTime = (RTIfedTime&)theTime;
if (_fedTime > myTime._fedTime)
return RTI::RTI_TRUE;
else
return RTI::RTI_FALSE;
}
RTI::Boolean RTIfedTime::operator == (const RTI::FedTime& theTime) const
throw (
RTI::InvalidFederationTime)
{
const RTI::Double& fedTime = ((RTIfedTime&)theTime)._fedTime;
if (_fedTime == fedTime)
return RTI::RTI_TRUE;
else
return RTI::RTI_FALSE;
}
//-----------------------------------------------------------------
// Implementation operators
//-----------------------------------------------------------------
RTI::Boolean
RTIfedTime::operator== (const RTI::Double& theTime) const
throw (RTI::InvalidFederationTime)
{
if (_fedTime == theTime)
return RTI::RTI_TRUE;
else
return RTI::RTI_FALSE;
}
RTI::Boolean
RTIfedTime::operator!= (const RTI::FedTime& theTime) const
throw (RTI::InvalidFederationTime)
{
const RTI::Double& fedTime = ((RTIfedTime&)theTime)._fedTime;
if (_fedTime != fedTime)
return RTI::RTI_TRUE;
else
return RTI::RTI_FALSE;
}
RTI::Boolean
RTIfedTime::operator!= (const RTI::Double& theTime) const
throw (RTI::InvalidFederationTime)
{
if (_fedTime != theTime)
return RTI::RTI_TRUE;
else
return RTI::RTI_FALSE;
}
RTI::FedTime&
RTIfedTime::operator*= (const RTI::FedTime& theTime)
throw (RTI::InvalidFederationTime)
{
const RTI::Double& fedTime = ((RTIfedTime&)theTime)._fedTime;
_fedTime *= fedTime;
return *this;
}
RTI::FedTime&
RTIfedTime::operator/= (const RTI::FedTime& theTime)
throw (RTI::InvalidFederationTime)
{
const RTI::Double& fedTime = ((RTIfedTime&)theTime)._fedTime;
_fedTime /= fedTime;
return *this;
}
RTI::FedTime&
RTIfedTime::operator+= (const RTI::Double& theTime)
throw (RTI::InvalidFederationTime)
{
_fedTime += theTime;
return *this;
}
RTI::FedTime&
RTIfedTime::operator-= (const RTI::Double& theTime)
throw (RTI::InvalidFederationTime)
{
_fedTime -= theTime;
return *this;
}
RTI::FedTime&
RTIfedTime::operator*= (const RTI::Double& theTime)
throw (RTI::InvalidFederationTime)
{
_fedTime *= theTime;
return *this;
}
RTI::FedTime&
RTIfedTime::operator/= (const RTI::Double& theTime)
throw (RTI::InvalidFederationTime)
{
_fedTime /= theTime;
return *this;
}
RTIfedTime
RTIfedTime::operator+ (const RTI::FedTime& theTime)
throw (RTI::InvalidFederationTime)
{
const RTI::Double& fedTime = ((RTIfedTime&)theTime)._fedTime;
RTIfedTime outTime(_fedTime + fedTime);
return outTime;
}
RTIfedTime
RTIfedTime::operator+ (const RTI::Double& theTime)
throw (RTI::InvalidFederationTime)
{
RTIfedTime outTime(_fedTime + theTime);
return outTime;
}
RTIfedTime
RTIfedTime::operator- (const RTI::FedTime& theTime)
throw (RTI::InvalidFederationTime)
{
const RTI::Double& fedTime = ((RTIfedTime&)theTime)._fedTime;
RTIfedTime outTime(_fedTime - fedTime);
return outTime;
}
RTIfedTime
RTIfedTime::operator- (const RTI::Double& theTime)
throw (RTI::InvalidFederationTime)
{
RTIfedTime outTime(_fedTime - theTime);
return outTime;
}
RTIfedTime
RTIfedTime::operator* (const RTI::FedTime& theTime)
throw (RTI::InvalidFederationTime)
{
const RTI::Double& fedTime = ((RTIfedTime&)theTime)._fedTime;
RTIfedTime outTime(_fedTime * fedTime);
return outTime;
}
RTIfedTime
RTIfedTime::operator* (const RTI::Double& theTime)
throw (RTI::InvalidFederationTime)
{
RTIfedTime outTime(_fedTime * theTime);
return outTime;
}
RTIfedTime
RTIfedTime::operator/ (const RTI::FedTime& theTime)
throw (RTI::InvalidFederationTime)
{
const RTI::Double& fedTime = ((RTIfedTime&)theTime)._fedTime;
RTIfedTime outTime(_fedTime / fedTime);
return outTime;
}
RTIfedTime
RTIfedTime::operator/ (const RTI::Double& theTime)
throw (RTI::InvalidFederationTime)
{
RTIfedTime outTime(_fedTime / theTime);
return outTime;
}
RTI::FedTime & RTIfedTime::operator = (const RTI::FedTime& theTime)
throw (RTI::InvalidFederationTime)
{
RTIfedTime const & myTime = RTTI_CAST<RTIfedTime const &>(theTime);
_fedTime = myTime._fedTime;
return *this;
}
RTI::FedTime & RTIfedTime::operator = (const RTIfedTime& theTime)
throw (RTI::InvalidFederationTime)
{
_fedTime = theTime._fedTime;
return *this;
}
RTI::FedTime&
RTIfedTime::operator= (const RTI::Double& theTime)
throw (RTI::InvalidFederationTime)
{
_fedTime = theTime;
return *this;
}
//return bytes needed to encode
int RTIfedTime::encodedLength() const
{
return sizeof(RTI::Double);
}
//encode into suppled buffer
void
RTIfedTime::encode(char *buff) const
{
RTI::Double netnum = _fedTime;
memcpy(buff, (char*)&netnum, sizeof(netnum));
}
// stream operators
RTI_STD::ostream& operator << (RTI_STD::ostream &out, const RTI::FedTime &e)
{
// char *ch = new char[128];
RTIfedTime f (e);
f.getPrintableString (ch);
return out << ch;
}
int RTIfedTime::getPrintableLength() const
{
char buff[512];
sprintf(buff, "%.2f", _fedTime);
return strlen(buff) +1;
}
void RTIfedTime::getPrintableString(char* buf)
{
sprintf(buf, "%.2f", _fedTime);
}
//
// Implementation specific services
//
RTI::Double RTIfedTime::getTime() const
{
return _fedTime;
}
RTI::FedTime *
RTI::FedTimeFactory::makeZero()
throw(RTI::MemoryExhausted)
{
return new RTIfedTime(0);
}
RTI::FedTime *
RTI::FedTimeFactory::decode(const char* buff)
throw(RTI::MemoryExhausted)
{
RTI::Double netnum;
memcpy((char*)&netnum, buff, sizeof(netnum));
return new RTIfedTime(netnum);
}
| [
"reinhard.herzo@iosb.fraunhofer.de"
] | reinhard.herzo@iosb.fraunhofer.de |
d19c34bb6f38713b98252c19a9b4a525656a2da7 | b9e4f272762d5cf871653e4b4a3aa9ad33b05117 | /1星/KMP(不可重叠时).cpp | 1b11a6d7168b46c02022c416884af0b5a82a7f1e | [] | no_license | haozx1997/C | e799cb25e1fa6c86318721834032c008764066ed | afb7657a58b86bf985c4a44bedfaf1c9cff30cf4 | refs/heads/master | 2021-07-11T23:54:17.357536 | 2017-10-12T03:42:23 | 2017-10-12T03:42:23 | 106,662,415 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 843 | cpp | #include<stdio.h>
#include<string.h>
void makeNext(const char P[],int next[])
{
int q,k;
int m = strlen(P);
next[0] = 0;
for (q = 1,k = 0; q < m; ++q)
{
while(k > 0 && P[q] != P[k])
k = next[k-1];
if (P[q] == P[k])
{
k++;
}
next[q] = k;
}
}
int kmp(const char T[],const char P[],int next[])
{
int n,m;
int i,q;
n = strlen(T);
m = strlen(P);
makeNext(P,next);
for (i = 0,q = 0; i < n; ++i)
{
while(q > 0 && P[q] != T[i])
q = next[q-1];
if (P[q] == T[i])
{
q++;
}
if (q == m)
{
printf("Pattern occurs with shift:%d\n",(i-m+1));
q = 0;
}
}
}
int main()
{
int i;
int next[20]={0};
char T[] = "aaaaaaa";
char P[] = "aa";
printf("%s\n",T);
printf("%s\n",P );
// makeNext(P,next);
kmp(T,P,next);
for (i = 0; i < strlen(P); ++i)
{
printf("%d ",next[i]);
}
printf("\n");
return 0;
}
| [
"haozx1997@users.noreply.github.com"
] | haozx1997@users.noreply.github.com |
3fcd231ecf8bdbccb3d68a451153de21b165adf2 | 0e2ff3aaf52bbcd9d25422d8dd20de4e2f644c4e | /src/qmlapplemusic.h | 57c531645fa011d65ad0ba30385e29a8a3c53abd | [
"MIT"
] | permissive | Qt-QML/carpadapp | 30c88ccb4412fcb38f81faa5c392ac6ce39f8b76 | 7ada9a7c32e394d098f19d2eb6861b0b9f97d972 | refs/heads/master | 2020-03-07T16:28:47.312620 | 2017-10-14T19:29:03 | 2017-10-14T19:29:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 928 | h | #pragma once
#include <QObject>
#include <QtNetwork>
#include <QJSValue>
#include "qmltopsongsmodel.h"
class QQmlEngine;
class QmlAppleMusic : public QObject
{
Q_OBJECT
Q_PROPERTY(QmlTopSongsModel* topSongsModel READ topSongsModel WRITE setTopSongsModel NOTIFY topSongsModelChanged)
public:
explicit QmlAppleMusic(QObject *parent = nullptr);
static void registerTypes(const char *uri, QQmlEngine *engine);
Q_INVOKABLE void createRequest(const QString &url, const QJSValue &callback = QJSValue());
QmlTopSongsModel* topSongsModel() const;
signals:
void topSongsModelChanged(QmlTopSongsModel *topSongsModel);
public slots:
void setTopSongsModel(QmlTopSongsModel *topSongsModel);
private slots:
void replyReceived(QNetworkReply *reply);
private:
QNetworkAccessManager *m_networkAccessManager;
QHash<const QUrl, QJSValue> m_callbackHash;
QmlTopSongsModel *m_topSongsModel;
};
| [
"niraj@app.st"
] | niraj@app.st |
b8d7bc5c437dd16a8737388920bb462f72b296c4 | 6aca503c6d0a4cb9d89fb4fcb24424fd91b7dfef | /main.cpp | 577eb0943616acafe1573b34e4ecf4f76709d12f | [] | no_license | money626/sha2 | 07c32f0ce71adb1c1359bd8351be705415ba5565 | db10b77f104b038835d2ea75102669d484863c0a | refs/heads/main | 2023-06-12T04:32:50.523864 | 2021-06-26T13:57:59 | 2021-06-26T13:57:59 | 380,514,963 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 43 | cpp | #include "myApp.h"
wxIMPLEMENT_APP(MyApp); | [
"money.yuanyuan@gmail.com"
] | money.yuanyuan@gmail.com |
0ff464d4fc7a967466ddd67670eff24cc8d93166 | 404e9d9d32d06bd410d185be2ff9c74ef4b1544a | /src/enigma2/data/AutoTimer.cpp | 5e37a9d610869cefbab59a0477a8ef274e19fb96 | [] | no_license | worm-ee/pvr.vuplus | ebc8277313cd4e1ea5b7a6e891b8b1739efc83ba | 6882acbac77deb1db350adf8f43f071a3db5fb81 | refs/heads/master | 2021-09-26T19:00:02.880374 | 2018-10-30T19:42:57 | 2018-10-30T19:42:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,743 | cpp | #include "AutoTimer.h"
#include "inttypes.h"
#include "util/XMLUtils.h"
#include "p8-platform/util/StringUtils.h"
using namespace enigma2;
using namespace enigma2::data;
using namespace enigma2::utilities;
bool AutoTimer::Like(const AutoTimer &right) const
{
return m_backendId == right.m_backendId;;
}
bool AutoTimer::operator==(const AutoTimer &right) const
{
bool bChanged = true;
bChanged = bChanged && (!m_title.compare(right.m_title));
bChanged = bChanged && (m_startTime == right.m_startTime);
bChanged = bChanged && (m_endTime == right.m_endTime);
bChanged = bChanged && (m_channelId == right.m_channelId);
bChanged = bChanged && (m_weekdays == right.m_weekdays);
bChanged = bChanged && (m_searchPhrase == right.m_searchPhrase);
bChanged = bChanged && (m_searchType == right.m_searchType);
bChanged = bChanged && (m_searchCase == right.m_searchCase);
bChanged = bChanged && (m_state == right.m_state);
bChanged = bChanged && (m_searchFulltext == right.m_searchFulltext);
bChanged = bChanged && (m_startAnyTime == right.m_startAnyTime);
bChanged = bChanged && (m_endAnyTime == right.m_endAnyTime);
bChanged = bChanged && (m_anyChannel == right.m_anyChannel);
bChanged = bChanged && (m_deDup == right.m_deDup);
return bChanged;
}
void AutoTimer::UpdateFrom(const AutoTimer &right)
{
Timer::UpdateFrom(right);
m_searchPhrase = right.m_searchPhrase;
m_encoding = right.m_encoding;
m_searchCase = right.m_searchCase;
m_searchType = right.m_searchType;
m_searchFulltext = right.m_searchFulltext;
m_startAnyTime = right.m_startAnyTime;
m_endAnyTime = right.m_endAnyTime;
m_anyChannel = right.m_anyChannel;
m_deDup = right.m_deDup;
}
void AutoTimer::UpdateTo(PVR_TIMER &left) const
{
strncpy(left.strTitle, m_title.c_str(), sizeof(left.strTitle));
//strncpy(tag.strDirectory, "/", sizeof(tag.strDirectory)); // unused
//strncpy(tag.strSummary, timer.strPlot.c_str(), sizeof(tag.strSummary));
strncpy(left.strEpgSearchString, m_searchPhrase.c_str(), sizeof(left.strEpgSearchString));
left.iTimerType = m_type;
if (m_anyChannel)
left.iClientChannelUid = PVR_TIMER_ANY_CHANNEL;
else
left.iClientChannelUid = m_channelId;
left.startTime = m_startTime;
left.endTime = m_endTime;
left.state = m_state;
left.iPriority = 0; // unused
left.iLifetime = 0; // unused
left.firstDay = 0; // unused
left.iWeekdays = m_weekdays;
//right.iEpgUid = timer.iEpgID;
left.iMarginStart = 0; // unused
left.iMarginEnd = 0; // unused
left.iGenreType = 0; // unused
left.iGenreSubType = 0; // unused
left.iClientIndex = m_clientIndex;
left.bStartAnyTime = m_startAnyTime;
left.bEndAnyTime = m_endAnyTime;
left.bFullTextEpgSearch = m_searchFulltext;
left.iPreventDuplicateEpisodes = m_deDup;
}
bool AutoTimer::UpdateFrom(TiXmlElement* autoTimerNode, Channels &channels)
{
std::string strTmp;
int iTmp;
m_type = Timer::EPG_AUTO_SEARCH;
//this is an auto timer so the state is always scheduled unless it's disabled
m_state = PVR_TIMER_STATE_SCHEDULED;
if (autoTimerNode->QueryStringAttribute("name", &strTmp) == TIXML_SUCCESS)
m_title = strTmp;
if (autoTimerNode->QueryStringAttribute("match", &strTmp) == TIXML_SUCCESS)
m_searchPhrase = strTmp;
if (autoTimerNode->QueryStringAttribute("enabled", &strTmp) == TIXML_SUCCESS)
{
if (strTmp == AUTOTIMER_ENABLED_NO)
{
m_state = PVR_TIMER_STATE_CANCELLED;
}
}
if (autoTimerNode->QueryIntAttribute("id", &iTmp) == TIXML_SUCCESS)
m_backendId = iTmp;
std::string from;
std::string to;
std::string avoidDuplicateDescription;
std::string searchForDuplicateDescription;
autoTimerNode->QueryStringAttribute("from", &from);
autoTimerNode->QueryStringAttribute("to", &to);
autoTimerNode->QueryStringAttribute("avoidDuplicateDescription", &avoidDuplicateDescription);
autoTimerNode->QueryStringAttribute("searchForDuplicateDescription", &searchForDuplicateDescription);
if (avoidDuplicateDescription != AUTOTIMER_AVOID_DUPLICATE_DISABLED)
{
if (searchForDuplicateDescription == AUTOTIMER_CHECK_SEARCH_FOR_DUP_IN_TITLE)
m_deDup = AutoTimer::DeDup::CHECK_TITLE;
else if (searchForDuplicateDescription == AUTOTIMER_CHECK_SEARCH_FOR_DUP_IN_TITLE_AND_SHORT_DESC)
m_deDup = AutoTimer::DeDup::CHECK_TITLE_AND_SHORT_DESC;
else if (searchForDuplicateDescription.empty() || searchForDuplicateDescription == AUTOTIMER_CHECK_SEARCH_FOR_DUP_IN_TITLE_AND_ALL_DESCS) //Even though this value should be 2 it is sent as ommitted for this attribute, we'll allow 2 anyway incase it changes in the future
m_deDup = AutoTimer::DeDup::CHECK_TITLE_AND_ALL_DESCS;
}
if (autoTimerNode->QueryStringAttribute("encoding", &strTmp) == TIXML_SUCCESS)
m_encoding = strTmp;
if (autoTimerNode->QueryStringAttribute("searchType", &strTmp) == TIXML_SUCCESS)
{
m_searchType = strTmp;
if (strTmp == AUTOTIMER_SEARCH_TYPE_DESCRIPTION)
m_searchFulltext = true;
}
if (autoTimerNode->QueryStringAttribute("searchCase", &strTmp) == TIXML_SUCCESS)
m_searchCase = strTmp;
TiXmlElement* serviceNode = autoTimerNode->FirstChildElement("e2service");
if (serviceNode)
{
const TiXmlElement *nextServiceNode = serviceNode->NextSiblingElement("e2service");
if (!nextServiceNode)
{
//If we only have one channel
if (XMLUtils::GetString(serviceNode, "e2servicereference", strTmp))
{
m_channelId = channels.GetChannelUniqueId(strTmp.c_str());
// Skip autotimers for channels we don't know about, such as when the addon only uses one bouquet or an old channel referene that doesn't exist
if (m_channelId < 0)
{
Logger::Log(LEVEL_DEBUG, "%s could not find channel so skipping autotimer: '%s'", __FUNCTION__, m_title.c_str());
return false;
}
m_channelName = channels.GetChannel(m_channelId).GetChannelName();
}
}
else //otherwise set to any channel
{
m_channelId = PVR_TIMER_ANY_CHANNEL;
m_anyChannel = true;
}
}
else //otherwise set to any channel
{
m_channelId = PVR_TIMER_ANY_CHANNEL;
m_anyChannel = true;
}
m_weekdays = 0;
TiXmlElement* includeNode = autoTimerNode->FirstChildElement("include");
if (includeNode)
{
for (; includeNode != nullptr; includeNode = includeNode->NextSiblingElement("include"))
{
std::string includeVal = includeNode->GetText();
std::string where;
if (includeNode->QueryStringAttribute("where", &where) == TIXML_SUCCESS)
{
if (where == "dayofweek")
{
m_weekdays = m_weekdays |= (1 << atoi(includeVal.c_str()));
}
}
}
}
if (m_weekdays != PVR_WEEKDAY_NONE)
{
std::time_t t = std::time(nullptr);
std::tm timeinfo = *std::localtime(&t);
timeinfo.tm_sec = 0;
m_startTime = 0;
if (!from.empty())
{
ParseTime(from, timeinfo);
m_startTime = std::mktime(&timeinfo);
}
timeinfo = *std::localtime(&t);
timeinfo.tm_sec = 0;
m_endTime = 0;
if (!to.empty())
{
ParseTime(to, timeinfo);
m_endTime = std::mktime(&timeinfo);
}
}
else
{
for (int i = 0; i < DAYS_IN_WEEK; i++)
{
m_weekdays = m_weekdays |= (1 << i);
}
m_startAnyTime = true;
m_endAnyTime = true;
}
return true;
}
void AutoTimer::ParseTime(const std::string &time, std::tm &timeinfo) const
{
std::sscanf(time.c_str(), "%02d:%02d", &timeinfo.tm_hour,
&timeinfo.tm_min);
} | [
"phunkyfish@gmail.com"
] | phunkyfish@gmail.com |
384f0a5f924bfce5ee035cafae180692a7b29450 | a0370090e044e2817842b90a9559be41282072c5 | /DevExpress VCL/ExpressBars 7/Demos/CBuilder/EBarMegaDemo/EBarMegaDemoData.h | 7ec6e3c5f4e435dd338532ede5b0b5da7d2dec54 | [] | no_license | bravesoftdz/MyVCL-7 | 600a1c1be2ea71b198859b39b6da53c6b65601b3 | 197c1e284f9ac0791c15376bcf12c243400e7bcd | refs/heads/master | 2022-01-11T17:18:00.430191 | 2018-12-20T08:23:02 | 2018-12-20T08:23:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,608 | h | //---------------------------------------------------------------------------
#ifndef EBarMegaDemoDataH
#define EBarMegaDemoDataH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <DB.hpp>
#include <DBTables.hpp>
//---------------------------------------------------------------------------
class TEBarMegaDemoMainDM : public TDataModule
{
__published: // IDE-managed Components
TTable *tblContacts;
TAutoIncField *tblContactsID;
TIntegerField *tblContactsProductID;
TStringField *tblContactsFirstName;
TStringField *tblContactsLastName;
TStringField *tblContactsCompany;
TStringField *tblContactsAddress;
TStringField *tblContactsCity;
TStringField *tblContactsState;
TDateField *tblContactsPurchaseDate;
TStringField *tblContactsPaymentType;
TBCDField *tblContactsPaymentAmount;
TStringField *tblContactsproduct;
TStringField *tblContactsCustName;
TTable *tblProducts;
TIntegerField *tblProductsID;
TStringField *tblProductsNAME;
TStringField *tblProductsDescription;
TDatabase *Database;
TDataSource *dsProducts;
TDataSource *dsContacts;
void __fastcall tblContactsCalcFields(TDataSet *DataSet);
private: // User declarations
public: // User declarations
__fastcall TEBarMegaDemoMainDM(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TEBarMegaDemoMainDM *EBarMegaDemoMainDM;
//---------------------------------------------------------------------------
#endif
| [
"karaim@mail.ru"
] | karaim@mail.ru |
fd644d4b55a24e8453fb97e88f237297a8bcf5d6 | 7a4b9855ef985f72db1698ba8009c76ef9c02e91 | /loops/ans3.cpp | bf14c332e8efa7c5ada53773a3fef2263cfbead4 | [] | no_license | melvincabatuan/HelloC | 29d8766948a6623c4b99d481e9630167b93a2a95 | ebda68dd6a8405f141167f5a34a712a6ac0377b3 | refs/heads/master | 2022-06-26T07:11:15.869774 | 2022-06-16T04:15:33 | 2022-06-16T04:15:33 | 21,809,619 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 283 | cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int x;
float pi = 3.1416;
printf("Degrees Radians\n");
for(x=0; x<=360; x+=90){
printf("%3i %1.4f\n", x, x/(180/pi));
}
system("pause");
return 0;
}
| [
"melvincabatuan@gmail.com"
] | melvincabatuan@gmail.com |
57ff7036bf6a481715c4fcbb587e7323217d7c95 | ca0e996c1aa0fa02401eca7dfb6dc4eb210a69a2 | /analysis/interface.cpp | 15486589f27f9b85d7e272b7127ec332653a9a94 | [] | no_license | zhanglianhao/qt | de569d1e34ad6519f6cdb0258d6e14ba5efddab1 | 97f04780ef06cfcc5d3c3697d77b81e11b4658cc | refs/heads/master | 2021-09-25T14:33:55.191537 | 2018-10-23T02:04:09 | 2018-10-23T02:04:09 | 154,247,443 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 62 | cpp | #include "interface.h"
interface_icon::interface_icon()
{
}
| [
"xgf13469@163.com"
] | xgf13469@163.com |
be1bd9a16d519f23460690f1c50e9ad13bc2b591 | 3bce275ae3da1af9c08fd9d58404e2067a62bb07 | /Elvart-2760606-Lab-05/Stack.h | e561fd71d615c631addcdcfa663f67f6dbdce1d5 | [] | no_license | telvart/Programming-II | a0147475407d5b061f6831705f8c65e63ea6512c | 213e02bf6fc8a11feef5a3d3514d9a2a6917e7f4 | refs/heads/master | 2021-06-09T04:31:01.322949 | 2016-11-29T21:55:08 | 2016-11-29T21:55:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,475 | h | /** @name:Stack.h
* @author: Tim Elvart
* KUID: 2760606
* Email: telvart@ku.edu
* @date:9.31.15
* @brief: Inherits from StackInterface.h, it is a stack capable of housing any type
*/
#ifndef STACK_H
#define STACK_H
#include "StackInterface.h"
#include "Node.h"
template <typename T>
class Stack: public StackInterface<T>
{
public:
/*
@pre none
@post a stack will be created and initialized
@return none
*/
Stack();
/*
@pre none
@post all the nodes in the stack will be deallocated
@return none
*/
~Stack();
/*
@pre none
@post none
@return true if the stack is empty, otherwise false
*/
bool isEmpty() const;
/*
@pre none
@post a node will be added to the stack that contains the value newEntry
@return none
*/
void push(const T newEntry);
/*
@pre none
@post the node at the top of the stack will be removed
@return none
@throws PVE if pop is attempted on an empty stack
*/
void pop() throw(PreconditionViolationException);
/*
@pre none
@post none
@return the value in the node at the top of the stack
@throws PVE if peek is attempted on an empty stack
*/
T peek() const throw(PreconditionViolationException);
/*
@pre none
@post none
@return the current value of m_size
*/
int size() const;
/*
@pre T is able to be printed to the console
@post all values in the stack will be printed seperated by spaces
@return none
*/
void print() const;
protected:
Node<T>* m_top;
int m_size;
};
#include "Stack.hpp"
#endif
| [
"telvart@ku.edu"
] | telvart@ku.edu |
9bc0f3af8b367c5ce5bf3818a6239f38d396a6da | e1991e8d7f7969f73ff6fc17ce54d561de519846 | /punto 8.cpp | ee3f8237d0db06dff2c35b47bc3cec0da5aac7ac | [] | no_license | Samuel-FF/tallerno5 | 6f0841c123e6d1dd9674a371acaaf137c11c264f | fbd2fad4ffddbff9b2d68875911464050902e383 | refs/heads/master | 2020-03-28T15:09:58.013512 | 2018-09-13T01:17:18 | 2018-09-13T01:17:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 917 | cpp | /*
programa: funcion que almacena numeros y los organiza de mayor a menor
creador: Samuel Fernandez Fernandez
fecha 12/09/2018
*/
#include <iostream>
#include <conio.h>
#include <string.h>
#include <stdio.h>
using namespace std;
void num(int num1[], int n){
printf("Ingrese los numeros: \n");
for(int i = 0; i < n; i ++){
scanf("%d", &num1[i]);
}
}
void mayor(int num1[], int n){
int temp;
for(int i = 0; i < n; i++){
for(int j = 0; j < n - 1; j++){
if( num1[j] < num1[j+1]){
temp = num1[j];
num1[j] = num1[j+1];
num1[j+1] = temp;
}
}
}
}
void result(int num1[], int n){
printf("numeros organizados de mayor a menor: \n");
for(int i = 0; i < n; i++){
printf("%d\n", num1[i]);
}
}
int main() {
int num2[100];
int tam;
printf("Ingrese la cantidad de numeros que desea: ");
scanf("%d", &tam);
num(num2, tam);
mayor(num2, tam);
result(num2, tam);
return 0;
}
| [
"harlemsamu69@gmail.com"
] | harlemsamu69@gmail.com |
7dfbc0f4b83c0ddcdefc7e11cf9847c40fa8e23a | 7cbcb34aaf56aebe09fc6bdc6969025a6a91c84d | /ocr/ocr.cpp | 197aaab3e3b922c29e2a2648b63770daf456dd96 | [] | no_license | sridhar19091986/boxeditor | 138b416aa9edc40fc57a3a1c104212933a57cb98 | 8de9045bee4db989b453e8b57d980ba666e217a6 | refs/heads/master | 2020-05-25T15:53:08.876188 | 2014-09-20T05:32:08 | 2014-09-20T05:32:08 | null | 0 | 0 | null | null | null | null | IBM852 | C++ | false | false | 3,070 | cpp | #include "ocr.h"
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QMimeData>
#include <QDir>
#include <QTextStream>
ocr::ocr(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
setWindowTitle("Text Recognition");
ui.img_view->setParent(this);
ui.scrollArea->setWidget(ui.img_view);
connect(this, SIGNAL(defer_open(QString)), this, SLOT(open(QString)), Qt::QueuedConnection);
connect(&_tess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(tess_error(QProcess::ProcessError)));
connect(&_tess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(tess_finished(int, QProcess::ExitStatus)));
connect(&_tess, SIGNAL(started()), this, SLOT(tess_started()));
connect(ui.scale, SIGNAL(currentIndexChanged(int)), this, SLOT(scale_changed(int)));
auto dir = QDir::currentPath();
QStringList env;
env << QString("TESSDATA_PREFIX=%1").arg(dir);
_tess.setProgram("bin/tesseract.exe");
_tess.setEnvironment(env);
//_tess.setStandardOutputFile("out.txt");
_tess.setStandardErrorFile("error.txt");
}
ocr::~ocr()
{
}
void ocr::dragEnterEvent(QDragEnterEvent* ev)
{
if (ev->mimeData()->hasUrls())
{
auto &urls = ev->mimeData()->urls();
auto &url = urls.first();
auto &filename = url.toLocalFile();
bool can_drop = false;
QFile file(filename);
QRegExp exp(".*[jpg|jpeg|bmp|tif|png|gif]$");
can_drop = exp.exactMatch(filename)
&& file.exists();
ev->setDropAction(can_drop ? Qt::LinkAction : Qt::IgnoreAction);
ev->accept();
}
}
void ocr::dropEvent(QDropEvent* ev)
{
if (ev->mimeData()->hasUrls())
{
ev->accept();
defer_open(ev->mimeData()->urls().first().toLocalFile());
}
}
void ocr::open(QString img_file)
{
_img = QImage(img_file);
QStringList args;
args << img_file << "result" << "-l" << "chi_demo2";
_tess.setArguments(args);
_tess.start();
show_img();
}
void ocr::show_img()
{
if (_img.isNull())
{
ui.img_view->setText("Drop Image Here.");
return;
}
int i = ui.scale->currentIndex();
QImage img;
if (i == 0)
{
int w = ui.scrollArea->geometry().width();
int h = ui.scrollArea->geometry().height();
img = _img.scaled(w, h, Qt::KeepAspectRatio);
}
else if (i == 1)
{
img = _img;
}
ui.img_view->setPixmap(QPixmap::fromImage(img));
}
void ocr::tess_error(QProcess::ProcessError err)
{
ui.txt->setEnabled(true);
ui.txt->setText("ERROR!");
}
void ocr::tess_started()
{
ui.txt->setEnabled(false);
ui.txt->setText("Analyzing, please wait...");
}
void ocr::tess_finished(int code, QProcess::ExitStatus status)
{
ui.txt->setEnabled(true);
if (!code)
{
QFile file("result.txt");
if (file.open(QIODevice::ReadOnly))
{
QTextStream ts(&file);
ts.setCodec("UTF-8");
auto &txt = ts.readAll();
auto s = txt.indexOf(QStringLiteral("Áš╔ˇ"));
if (s != -1)
{
auto e = txt.indexOf(QStringLiteral("║┼"), s);
if (e != -1)
{
ui.txt->setText(txt.mid(s, e - s + 1));
return;
}
}
}
}
ui.txt->setText("ERROR!");
}
void ocr::scale_changed(int i)
{
show_img();
}
void ocr::resizeEvent(QResizeEvent* ev)
{
show_img();
} | [
"aclazycat@gmail.com"
] | aclazycat@gmail.com |
25e141319d3f057e17416b80e8c84e459cf9ef96 | 54035db80ef277f002d0ab5c91b743c7c696f310 | /include/Field.h | 75a45214d1a92ac7c529b78e7559f0f45b079d49 | [] | no_license | tochur/wolfs-lamb | 0cac435a95b26f4ba110c6524b8a77b5d74a4a70 | 988cb30683b7ad3a8362859721ffea77341bc933 | refs/heads/master | 2020-05-16T21:01:36.364633 | 2014-09-24T19:43:12 | 2014-09-24T19:43:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 541 | h | #ifndef FIELD_H
#define FIELD_H
#include"Pion.h"
class Board;
class Field{
public:
Field(int nrPola);
virtual ~Field();
int getPionSignature();
void setPionSignature(int signature);
Pion *pion;
protected:
private:
int x, y;
char appearance;
bool color;
int signature;
int fitPion(int i);
char fitAppearance(int nrPola);
char getFieldAppearance();
void setFieldAppearance(char symbol);
friend Board;
};
#endif // FIELD_H
| [
"tochur@gmail.com"
] | tochur@gmail.com |
24b5d1d760d5b498c996f3c55b619bd1d6bfb3b2 | 7aaafbb769c6a6d9f0d10dac4e0a35c54c84fb24 | /Soil_Moisture/Soil_Moisture.ino | f25849fa8738faf919bee78f6ed95cbfd0df7022 | [] | no_license | mxTuhin/Arduino | e40dde74f2138386e633782f24941c0f122d985d | 99971441ee1973ffbcb6d7ac99e4eea2eed7dc79 | refs/heads/master | 2023-03-09T09:37:52.602595 | 2021-02-24T21:36:29 | 2021-02-24T21:36:29 | 342,041,987 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 576 | ino | /*
* AskSensors IoT Platform.
* Description: Soil moisture monitoring using ESP8266 and the AskSensors IoT cloud.
* Author: https://asksensors.com, 2018 - 2019
* github: https://github.com/asksensors/AskSensors-ESP8266-Moisture
*/
int moisture_Pin= 0; // Soil Moisture Sensor input at Analog PIN A0
int moisture_value= 0;
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.print("MOISTURE LEVEL : ");
moisture_value= analogRead(moisture_Pin);
// moisture_value= moisture_value/10;
Serial.println(moisture_value);
delay(1000);
}
| [
"tuhinmridha11@gmail.com"
] | tuhinmridha11@gmail.com |
ae8708b65b6effb6cdf37f6bba109823046e2367 | 88ae8695987ada722184307301e221e1ba3cc2fa | /ui/events/ozone/evdev/event_converter_evdev.h | 1b3a56555a71f256684d9fdf8836122b8b6ec6fd | [
"BSD-3-Clause"
] | permissive | iridium-browser/iridium-browser | 71d9c5ff76e014e6900b825f67389ab0ccd01329 | 5ee297f53dc7f8e70183031cff62f37b0f19d25f | refs/heads/master | 2023-08-03T16:44:16.844552 | 2023-07-20T15:17:00 | 2023-07-23T16:09:30 | 220,016,632 | 341 | 40 | BSD-3-Clause | 2021-08-13T13:54:45 | 2019-11-06T14:32:31 | null | UTF-8 | C++ | false | false | 8,422 | h | // Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
#define UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
#include <stdint.h>
#include <ostream>
#include <set>
#include <vector>
#include "base/component_export.h"
#include "base/files/file_path.h"
#include "base/functional/callback.h"
#include "base/functional/callback_forward.h"
#include "base/task/current_thread.h"
#include "ui/events/devices/gamepad_device.h"
#include "ui/events/devices/haptic_touchpad_effects.h"
#include "ui/events/devices/input_device.h"
#include "ui/events/devices/stylus_state.h"
#include "ui/events/ozone/evdev/event_device_info.h"
#include "ui/events/ozone/evdev/event_dispatch_callback.h"
#include "ui/events/ozone/evdev/touch_evdev_types.h"
#include "ui/gfx/geometry/size.h"
struct input_event;
namespace ui {
enum class DomCode;
struct InputDeviceSettingsEvdev;
class COMPONENT_EXPORT(EVDEV) EventConverterEvdev
: public base::MessagePumpForUI::FdWatcher {
public:
using ReportStylusStateCallback =
base::RepeatingCallback<void(const InProgressTouchEvdev&,
const int32_t x_res,
const int32_t y_res,
const base::TimeTicks&)>;
using GetLatestStylusStateCallback =
base::RepeatingCallback<void(const InProgressStylusState**)>;
using ReceivedValidInputCallback =
base::RepeatingCallback<void(const EventConverterEvdev* converter)>;
EventConverterEvdev(int fd,
const base::FilePath& path,
int id,
InputDeviceType type,
const std::string& name,
const std::string& phys,
uint16_t vendor_id,
uint16_t product_id,
uint16_t version);
EventConverterEvdev(const EventConverterEvdev&) = delete;
EventConverterEvdev& operator=(const EventConverterEvdev&) = delete;
~EventConverterEvdev() override;
int id() const { return input_device_.id; }
const base::FilePath& path() const { return path_; }
InputDeviceType type() const { return input_device_.type; }
const InputDevice& input_device() const { return input_device_; }
// Update device settings. The default implementation doesn't do
// anything
virtual void ApplyDeviceSettings(const InputDeviceSettingsEvdev& settings);
// Start reading events.
void Start();
// Stop reading events.
void Stop();
// Enable or disable this device. A disabled device still polls for
// input and can update state but must not dispatch any events to UI.
void SetEnabled(bool enabled);
bool IsEnabled() const;
// Flag this device as being suspected for identifying as a device that it is
// not.
void SetSuspectedImposter(bool is_suspected);
bool IsSuspectedImposter() const;
// Cleanup after we stop reading events (release buttons, etc).
virtual void OnStopped();
// Prepare for disable (e.g. should release keys/buttons/touches).
virtual void OnDisabled();
// Start or restart (e.g. should reapply keys/buttons/touches).
virtual void OnEnabled();
// Dump recent events into a file.
virtual void DumpTouchEventLog(const char* filename);
// Returns value corresponding to keyboard status (No Keyboard, Keyboard in
// Blocklist, ect.).
virtual KeyboardType GetKeyboardType() const;
// Returns true if the converter is used for a keyboard device.
virtual bool HasKeyboard() const;
// Returns true if the converter is used for a mouse device (that isn't a
// pointing stick);
virtual bool HasMouse() const;
// Returns true if the converter is used for a pointing stick device (such as
// a TrackPoint);
virtual bool HasPointingStick() const;
// Returns true if the converter is used for a touchpad device.
virtual bool HasTouchpad() const;
// Returns true if the converter is used for a haptic touchpad device.
// If HasHapticTouchpad() is true, then HasTouchpad() is also true.
virtual bool HasHapticTouchpad() const;
// Returns true if the converter is used for a touchscreen device.
virtual bool HasTouchscreen() const;
// Returns true if the converter is used for a pen device.
virtual bool HasPen() const;
// Returns true if the converter is used for a device with gamepad input.
virtual bool HasGamepad() const;
// Returns true if the converter is used for a device with a caps lock LED.
virtual bool HasCapsLockLed() const;
// Returns true if the converter is used for a device with a stylus switch
// (also known as garage or dock sensor, not buttons on a stylus).
virtual bool HasStylusSwitch() const;
// Returns true if the converter is a keyboard and has an assistant key.
virtual bool HasAssistantKey() const;
// Returns the current state of the stylus garage switch, indicating whether a
// stylus is inserted in (or attached) to a stylus dock or garage, or has been
// removed.
virtual ui::StylusState GetStylusSwitchState();
// Returns the size of the touchscreen device if the converter is used for a
// touchscreen device.
virtual gfx::Size GetTouchscreenSize() const;
// Returns the number of touch points this device supports. Should not be
// called unless HasTouchscreen() returns true
virtual int GetTouchPoints() const;
// Returns information for all axes if the converter is used for a gamepad
// device.
virtual std::vector<GamepadDevice::Axis> GetGamepadAxes() const;
// Returns whether the gamepad device supports rumble type force feedback.
virtual bool GetGamepadRumbleCapability() const;
// Returns supported key bits of the gamepad.
virtual std::vector<uint64_t> GetGamepadKeyBits() const;
// Sets which keyboard keys should be processed. If |enable_filter| is
// false, all keys are allowed and |allowed_keys| is ignored.
virtual void SetKeyFilter(bool enable_filter,
std::vector<DomCode> allowed_keys);
// Update caps lock LED state.
virtual void SetCapsLockLed(bool enabled);
// Update touch event logging state.
virtual void SetTouchEventLoggingEnabled(bool enabled);
// Sets callback to enable/disable palm suppression.
virtual void SetPalmSuppressionCallback(
const base::RepeatingCallback<void(bool)>& callback);
// Sets callback to report the latest stylus state.
virtual void SetReportStylusStateCallback(
const ReportStylusStateCallback& callback);
// Sets callback to get the latest stylus state.
virtual void SetGetLatestStylusStateCallback(
const GetLatestStylusStateCallback& callback);
// Set callback to trigger keyboard device update.
virtual void SetReceivedValidInputCallback(
ReceivedValidInputCallback callback);
// Returns supported key bits of the keyboard.
virtual std::vector<uint64_t> GetKeyboardKeyBits() const;
// Helper to generate a base::TimeTicks from an input_event's time
static base::TimeTicks TimeTicksFromInputEvent(const input_event& event);
static bool IsValidKeyboardKeyPress(uint64_t key);
// Handle gamepad force feedback effects.
virtual void PlayVibrationEffect(uint8_t amplitude, uint16_t duration_millis);
virtual void StopVibration();
// Handle haptic touchpad effects.
virtual void PlayHapticTouchpadEffect(HapticTouchpadEffect effect,
HapticTouchpadEffectStrength strength);
virtual void SetHapticTouchpadEffectForNextButtonRelease(
HapticTouchpadEffect effect,
HapticTouchpadEffectStrength strength);
// Describe converter for system log
virtual std::ostream& DescribeForLog(std::ostream& os) const;
protected:
// base::MessagePumpForUI::FdWatcher:
void OnFileCanWriteWithoutBlocking(int fd) override;
// File descriptor to read.
const int fd_;
// Path to input device.
const base::FilePath path_;
// Input device information, including id (which uniquely identifies an
// event converter) and type.
InputDevice input_device_;
// Whether we're polling for input on the device.
bool watching_ = false;
// Controller for watching the input fd.
base::MessagePumpForUI::FdWatchController controller_;
};
} // namespace ui
#endif // UI_EVENTS_OZONE_EVDEV_EVENT_CONVERTER_EVDEV_H_
| [
"jengelh@inai.de"
] | jengelh@inai.de |
ee727db990167992b55f7f5850794b36fac0fae8 | c21d1bceff86e3dbf597501a327cc866f6d1b255 | /src/ch1-Getting-Started/ch1-06-Texture/triangle.cpp | e15838c236e33148b829830f3e419406e447a670 | [] | no_license | JamShan/OpenGL-Learning | 6f7a4e61cb80c31bb7023d37aad2c2c702757f49 | f62bfec60101fe3a929c9fbcbe25fac94e2a67d6 | refs/heads/master | 2020-03-16T08:29:05.182572 | 2015-09-03T08:06:47 | 2015-09-03T08:06:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,073 | cpp | #include "triangle.h"
#include "ogl/loadTexture.h"
namespace byhj
{
void Triangle::Init()
{
init_shader();
init_buffer();
init_vertexArray();
init_texture();
}
void Triangle::Render()
{
glUseProgram(program);
glBindVertexArray(vao);
update();
glDrawArrays(GL_TRIANGLES, 0, 3);
glUseProgram(0);
glBindVertexArray(0);
}
void Triangle::Shutdown()
{
glDeleteProgram(program);
glDeleteVertexArrays(1, &vao);
glDeleteBuffers(1, &vbo);
glDeleteTextures(1, &brickTex);
}
void Triangle::update()
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, brickTex);
glUniform1i(tex_loc, 0);
}
const static GLfloat VertexData[] =
{
// Positions //Texcoords
0.5f, -0.5f, 0.0f, 0.0f, // Bottom Right
-0.5f, -0.5f, 1.0f, 0.0f, // Bottom Left
0.0f, 0.5f, 0.5f, 1.0f // Top
};
const static GLsizei VertexSize = sizeof(VertexData);
void Triangle::init_shader()
{
TriangleShader.init();
TriangleShader.attach(GL_VERTEX_SHADER, "triangle.vert");
TriangleShader.attach(GL_FRAGMENT_SHADER, "triangle.frag");
TriangleShader.link();
TriangleShader.info();
program = TriangleShader.GetProgram();
tex_loc = glGetUniformLocation(program, "tex");
assert(tex_loc != ogl::VALUE);
}
void Triangle::init_buffer()
{
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo); //load the vertex data
glBufferData(GL_ARRAY_BUFFER, VertexSize, VertexData, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
void Triangle::init_vertexArray()
{
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glBindBuffer(GL_ARRAY_BUFFER, vbo); //bind the vbo to vao, send the data to shader
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), (GLvoid*)0);
glEnableVertexAttribArray(0);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(GLfloat), (GLvoid*)(2 * sizeof(GLfloat)));
glEnableVertexAttribArray(1);
glBindVertexArray(0);
glDisableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
void Triangle::init_texture()
{
brickTex = ogl::loadTexture("../../../media/textures/wall.jpg");
}
} | [
"476652422@qq.com"
] | 476652422@qq.com |
2b369f361348375977a5988b44e93780bb0530ce | 25524f27ecf1189a4b995f17fc6623fdc6bee7ee | /depends/ClanLib/Sources/API/Network/NetGame/event_dispatcher.h | 958fa394d4f9e700ea3b94111880be43e3d24196 | [] | no_license | sveale/gm-engine | f81a3ddd9b34311dc25bcb0a31cad9d7c2688731 | aa3752ce9bc69ecc1c1c6e2580a70b37f4afa941 | refs/heads/master | 2021-01-18T17:09:30.131899 | 2014-11-05T08:37:58 | 2014-11-05T08:37:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,957 | h | /*
** ClanLib SDK
** Copyright (c) 1997-2014 The ClanLib Team
**
** This software is provided 'as-is', without any express or implied
** warranty. In no event will the authors be held liable for any damages
** arising from the use of this software.
**
** Permission is granted to anyone to use this software for any purpose,
** including commercial applications, and to alter it and redistribute it
** freely, subject to the following restrictions:
**
** 1. The origin of this software must not be misrepresented; you must not
** claim that you wrote the original software. If you use this software
** in a product, an acknowledgment in the product documentation would be
** appreciated but is not required.
** 2. Altered source versions must be plainly marked as such, and must not be
** misrepresented as being the original software.
** 3. This notice may not be removed or altered from any source distribution.
**
** Note: Some of the libraries ClanLib may link to may have additional
** requirements or restrictions.
**
** File Author(s):
**
** Magnus Norddahl
** Chu Chin Kuan
*/
#pragma once
#include "../api_network.h"
#include "event.h"
namespace clan
{
template<class... Params>
class CL_API_NETWORK NetGameEventDispatcher
{
public:
typedef std::function< void (const NetGameEvent &, Params... ) > CallbackClass;
CallbackClass &func_event(const std::string &name) { return event_handlers[name]; }
/** \brief Dispatches the event object.
* \return true if the event handler is invoked and false if the
* event handler is not found.
*/
bool dispatch(const NetGameEvent &game_event, Params... params)
{
auto it = event_handlers.find(game_event.get_name());
if (it != event_handlers.end() && !it->second.is_null())
{
it->second(game_event, params...);
return true;
}
else
{
return false;
}
}
private:
std::map<std::string, CallbackClass> event_handlers;
};
}
| [
"endre.88.oma@gmail.com"
] | endre.88.oma@gmail.com |
c1b9ab1031cbb234214f7de7369027975e13353b | f0a26ec6b779e86a62deaf3f405b7a83868bc743 | /Engine/Source/Developer/AssetTools/Private/AssetTypeActions/AssetTypeActions_DestructibleMesh.cpp | 941ab4b4ce5dbe6da4c62871fe0dc84fbf982007 | [] | no_license | Tigrouzen/UnrealEngine-4 | 0f15a56176439aef787b29d7c80e13bfe5c89237 | f81fe535e53ac69602bb62c5857bcdd6e9a245ed | refs/heads/master | 2021-01-15T13:29:57.883294 | 2014-03-20T15:12:46 | 2014-03-20T15:12:46 | 18,375,899 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,602 | cpp | // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "AssetToolsPrivatePCH.h"
#include "Editor/DestructibleMeshEditor/Public/DestructibleMeshEditorModule.h"
#include "Editor/DestructibleMeshEditor/Public/IDestructibleMeshEditor.h"
#define LOCTEXT_NAMESPACE "AssetTypeActions"
UClass* FAssetTypeActions_DestructibleMesh::GetSupportedClass() const
{
return UDestructibleMesh::StaticClass();
}
void FAssetTypeActions_DestructibleMesh::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
auto Meshes = GetTypedWeakObjectPtrs<UDestructibleMesh>(InObjects);
MenuBuilder.AddMenuEntry(
LOCTEXT("ObjectContext_EditUsingDestructibleMeshEditor", "Edit"),
LOCTEXT("ObjectContext_EditUsingDestructibleMeshEditorTooltip", "Opens the selected meshes in the Destructible Mesh editor."),
FSlateIcon(),
FUIAction(
FExecuteAction::CreateSP( this, &FAssetTypeActions_DestructibleMesh::ExecuteEdit, Meshes ),
FCanExecuteAction()
)
);
MenuBuilder.AddMenuEntry(
LOCTEXT("ObjectContext_ReimportDestructibleMesh", "Reimport"),
LOCTEXT("ObjectContext_ReimportDestructibleMeshTooltip", "Reimports the selected meshes from file."),
FSlateIcon(),
FUIAction(
FExecuteAction::CreateSP( this, &FAssetTypeActions_DestructibleMesh::ExecuteReimport, Meshes ),
FCanExecuteAction()
)
);
}
void FAssetTypeActions_DestructibleMesh::OpenAssetEditor( const TArray<UObject*>& InObjects, TSharedPtr<IToolkitHost> EditWithinLevelEditor )
{
for (auto ObjIt = InObjects.CreateConstIterator(); ObjIt; ++ObjIt)
{
auto Mesh = Cast<UDestructibleMesh>(*ObjIt);
if (Mesh != NULL)
{
FDestructibleMeshEditorModule& DestructibleMeshEditorModule = FModuleManager::LoadModuleChecked<FDestructibleMeshEditorModule>( "DestructibleMeshEditor" );
TSharedRef< IDestructibleMeshEditor > NewDestructibleMeshEditor = DestructibleMeshEditorModule.CreateDestructibleMeshEditor( EToolkitMode::Standalone, EditWithinLevelEditor, Mesh );
}
}
}
void FAssetTypeActions_DestructibleMesh::ExecuteEdit(TArray<TWeakObjectPtr<UDestructibleMesh>> Objects)
{
for (auto ObjIt = Objects.CreateConstIterator(); ObjIt; ++ObjIt)
{
auto Object = (*ObjIt).Get();
if ( Object )
{
FAssetEditorManager::Get().OpenEditorForAsset(Object);
}
}
}
void FAssetTypeActions_DestructibleMesh::ExecuteReimport(TArray<TWeakObjectPtr<UDestructibleMesh>> Objects)
{
for (auto ObjIt = Objects.CreateConstIterator(); ObjIt; ++ObjIt)
{
auto Object = (*ObjIt).Get();
if ( Object )
{
FReimportManager::Instance()->Reimport(Object, true);
}
}
}
#undef LOCTEXT_NAMESPACE
| [
"michaellam430@gmail.com"
] | michaellam430@gmail.com |
977093829664bcc45579992d58bc3f0108c99887 | f1a8b8ff8680ef418a84a958350569054c93fd58 | /src/iatable.h | 9113f1f020779a7af916921d694dc7f2090649b1 | [] | no_license | Donaim/mcinclude | 988dfc48639f10f80e65d93370be242698c98864 | dbcbf9bd3cb3beec217bb7c65d0051d1cc336d64 | refs/heads/master | 2021-04-03T08:49:31.114470 | 2018-04-27T15:10:59 | 2018-04-27T15:10:59 | 124,797,069 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 556 | h | #pragma once
class Label;
class LabelFactory;
class IncludeFactory;
#include "line.h"
#include "writer.h"
#include "slist.hpp"
#include <string>
#include <vector>
class IAtable {
friend class LabelFactory;
protected:
std::vector<std::string> dest_names;
const LabelFactory& lbl_fac;
IAtable(LabelFactory& fac, const Line& source);
public:
const Line& source_line;
void add_dest_name(std::string label_name);
virtual void write_from_label(Writer& w, const Label& lbl) = 0;
static const char * const AT_KEYWORD;
};
| [
"0@kek.com"
] | 0@kek.com |
bcf7f8112fe90712d915becafab13a04207fffd6 | a8fdb1bacfe71db7a5cbbdb0fb2a71095bb3b23f | /Nowy/kolo.cpp | 3fb699395befa32e9c3fa9fd9273929ad46a2b9a | [] | no_license | SeriousSeba/Zadanie3 | db337d4284b4967c8f6f90740d4cec7c3d5267cd | 1a62cf05d2108e5c538c206b9c959d353528a0e8 | refs/heads/master | 2021-01-10T15:34:30.760366 | 2015-12-14T20:45:07 | 2015-12-14T20:45:07 | 47,997,632 | 0 | 0 | null | 2015-12-14T20:20:22 | 2015-12-14T19:51:06 | C++ | UTF-8 | C++ | false | false | 176 | cpp | #include <stdio.h>
#include <math.h>
int main(void)
{double r;
scanf("%lf", &r);
printf("Pole kola o promieniu %.3lf wynosi %.3lf a jego obwod %.3lf",r, M_PI*r*r, 2*r*M_PI);
}
| [
"prykstefan@gmail.com"
] | prykstefan@gmail.com |
018d6bae26f5a655af1f9877ade4738c47dbe346 | 847a0217508a39502509ebab74dfcd626180137a | /OSY/OSY_2/test5.cpp | 989f4f369d7a89d65ef3f5cdb513f117a8510174 | [
"MIT"
] | permissive | JahodaPaul/FIT_CTU | 757c5ef4b47f9ccee77ce020230b7309f325ee57 | 2d96f18c7787ddfe340a15a36da6eea910225461 | refs/heads/master | 2021-06-04T20:16:44.816831 | 2021-03-13T10:25:06 | 2021-03-13T10:25:06 | 133,488,802 | 29 | 20 | null | null | null | null | UTF-8 | C++ | false | false | 2,006 | cpp | #include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cstdarg>
#include <pthread.h>
#include <semaphore.h>
#include "common.h"
#include "test_op.h"
using namespace std;
struct TChild
{
uint32_t m_Pages;
uint32_t m_Share;
pthread_barrier_t * m_Barrier;
};
static void childProcess ( CCPU * cpu,
TChild * arg )
{
checkResize ( cpu, arg -> m_Pages );
rwTest ( cpu, arg -> m_Share, arg -> m_Pages );
pthread_barrier_wait ( arg -> m_Barrier );
rTest ( cpu, 0, arg -> m_Share );
rTest ( cpu, arg -> m_Share, arg -> m_Pages );
}
static void initProcess ( CCPU * cpu,
void * arg )
{
const int PROCESSES = 10;
const int BASE_SIZE = 1500;
static TChild childData[PROCESSES];
pthread_barrier_t bar;
checkResize ( cpu, BASE_SIZE );
rwiTest ( cpu, 0, BASE_SIZE );
pthread_barrier_init ( &bar, NULL, PROCESSES + 1 );
for ( int i = 0; i < PROCESSES; i ++ )
{
childData[i] . m_Pages = BASE_SIZE + ( i - PROCESSES / 2 ) * 20;
childData[i] . m_Share = BASE_SIZE / 2;
childData[i] . m_Barrier = &bar;
cpu -> NewProcess ( &childData[i], (void (*)(CCPU *, void*))childProcess, true );
}
pthread_barrier_wait ( &bar );
rTest ( cpu, 0, BASE_SIZE );
pthread_barrier_destroy ( &bar );
}
int main ( void )
{
const int PAGES = 10 * 1024;
// PAGES + extra 4KiB for alignment
uint8_t * mem = new uint8_t [ PAGES * CCPU::PAGE_SIZE + CCPU::PAGE_SIZE ];
// align to a mutiple of 4KiB
uint8_t * memAligned = (uint8_t *) (( ((uintptr_t) mem) + CCPU::PAGE_SIZE - 1) & ~(uintptr_t) ~CCPU::ADDR_MASK );
testStart ();
MemMgr ( memAligned, PAGES, NULL, initProcess );
testEnd ( "test #6" );
delete [] mem;
return 0;
}
| [
"pavel.jahoda3@seznam.cz"
] | pavel.jahoda3@seznam.cz |
e13088f999ec3433bd6883926a926ed2ed7211c9 | 523bbdf02a62450ab67cf0749b100930413e24f6 | /METPlots/RecHitSpectra/plugins/RecHitSpectra2023.cc | 5d98727894fc513d88fdb31d3cfa6d713831ae5d | [] | no_license | kencall/HcalRecHits | 7c213c9d5f9838087ed032e4c8ae7d434c545a69 | 282e1d67d8b4a0a673658112926ae716bf19532b | refs/heads/master | 2021-01-18T21:57:01.987411 | 2017-01-28T05:43:01 | 2017-01-28T05:43:01 | 40,324,027 | 0 | 1 | null | 2015-08-31T17:05:38 | 2015-08-06T19:53:47 | C | UTF-8 | C++ | false | false | 18,947 | cc | // -*- C++ -*-
//
// Package: METPlots/RecHitSpectra2023
// Class: RecHitSpectra2023
//
/**\class RecHitSpectra2023 RecHitSpectra2023.cc METPlots/RecHitSpectra2023/plugins/RecHitSpectra2023.cc
Description: [one line class summary]
Implementation:
[Notes on implementation]
*/
//
// Original Author: kenneth call
// Created: Wed, 15 Jul 2015 16:05:14 GMT
//
//
//All include files from HcalRecHitsValidation
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
#include "DataFormats/HcalRecHit/interface/HcalSourcePositionData.h"
#include <DataFormats/EcalDetId/interface/EBDetId.h>
#include <DataFormats/EcalDetId/interface/EEDetId.h>
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
#include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
#include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
#include <vector>
#include <utility>
#include <ostream>
#include <string>
#include <algorithm>
#include <cmath>
#include "DataFormats/DetId/interface/DetId.h"
// channel status
#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"
#include "CondFormats/HcalObjects/interface/HcalChannelQuality.h"
#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h"
// severity level assignment for HCAL
#include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h"
// severity level assignment for ECAL
#include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h"
//All include files from HcalRecHitsValidation
// system include files
#include <memory>
// user include files
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
#include "DataFormats/HcalRecHit/interface/HcalSourcePositionData.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
#include "CondFormats/HcalObjects/interface/HcalChannelQuality.h"
#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h"
// severity level assignment for HCAL
#include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h"
#include <math.h>
#include <TFile.h>
#include <TTree.h>
#include <TROOT.h>
#include <vector>
#include <utility>
#include <ostream>
#include <string>
#include <algorithm>
//CaloTowers
#include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"
#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
//
// class declaration
//
class RecHitSpectra2023 : public edm::EDAnalyzer {
public:
explicit RecHitSpectra2023(const edm::ParameterSet&);
~RecHitSpectra2023();
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
private:
virtual void beginJob() override;
virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
virtual void endJob() override;
//virtual void beginRun(edm::Run const&, edm::EventSetup const&) override;
//virtual void endRun(edm::Run const&, edm::EventSetup const&) override;
//virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
//virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;
// ----------member data ---------------------------
std::string outputfile_;
edm::EDGetTokenT<HBHERecHitCollection> tok_hbhe_;
// edm::EDGetTokenT<HORecHitCollection> tok_ho_;
edm::EDGetTokenT<HFRecHitCollection> tok_hf_;
// edm::EDGetTokenT<reco::VertexCollection> tok_vertexc_;
// edm::EDGetTokenT<CaloTowerCollection> tok_calo_;
TFile *tf1;
TTree *tt1;
//int nrechits;
//int nvertx;
// run:lumi:event
int run;
int lumi;
int event;
//std::vector<float> recHitEn_HB;
//std::vector<float> recHitEn_HE;
//std::vector<float> recHitEn_HF;
//std::vector<float> recHitEn_HO;
std::vector<float> recHitHB_En;
std::vector<float> recHitHB_EnRAW;
std::vector<int> recHitHB_ieta;
std::vector<int> recHitHB_iphi;
std::vector<float> recHitHB_time;
std::vector<int> recHitHB_depth;
std::vector<float> recHitHE_En;
std::vector<float> recHitHE_EnRAW;
std::vector<int> recHitHE_ieta;
std::vector<int> recHitHE_iphi;
std::vector<float> recHitHE_time;
std::vector<int> recHitHE_depth;
std::vector<float> recHitHF_En;
std::vector<float> recHitHF_EnRAW;
std::vector<int> recHitHF_ieta;
std::vector<int> recHitHF_iphi;
std::vector<float> recHitHF_time;
std::vector<int> recHitHF_depth;
// for checking the status of ECAL and HCAL channels stored in the DB
//const HcalChannelQuality* theHcalChStatus;
// calculator of severety level for HCAL
//const HcalSeverityLevelComputer* theHcalSevLvlComputer;
//int hcalSevLvl(const CaloRecHit* hit);
};
//
// constants, enums and typedefs
//
//
// static data member definitions
//
//
// constructors and destructor
//
RecHitSpectra2023::RecHitSpectra2023(const edm::ParameterSet& iConfig)
{
outputfile_ = iConfig.getParameter<std::string>("rootOutputFile");
//Collections
tok_hbhe_ = consumes<HBHERecHitCollection>(iConfig.getUntrackedParameter<edm::InputTag>("HBHERecHitCollectionLabel"));
tok_hf_ = consumes<HFRecHitCollection>(iConfig.getUntrackedParameter<edm::InputTag>("HFRecHitCollectionLabel"));
//tok_ho_ = consumes<HORecHitCollection>(iConfig.getUntrackedParameter<edm::InputTag>("HORecHitCollectionLabel"));
//tok_vertexc_ = consumes<reco::VertexCollection>(iConfig.getUntrackedParameter<edm::InputTag>("VertexCollectionLabel"));
//tok_calo_ = consumes<CaloTowerCollection>(iConfig.getUntrackedParameter<edm::InputTag>("CaloTowerCollectionLabel"));
//now do what ever initialization is needed
tf1 = new TFile(outputfile_.c_str(), "RECREATE");
tt1 = new TTree("RecHitTree","RecHitTree");
//branches
//tt1->Branch("nRecHits", &nrechits, "nRecHits/I");
//tt1->Branch("nVertices", &nvertx, "nVertices/I");
tt1->Branch("run", &run, "run/I");
tt1->Branch("lumi", &lumi, "lumi/I");
tt1->Branch("event", &event, "event/I");
//tt1->Branch("recHitEn_HB","std::vector<float>", &recHitEn_HB, 32000, 0);
//tt1->Branch("recHitEn_HE","std::vector<float>", &recHitEn_HE, 32000, 0);
//tt1->Branch("recHitEn_HF","std::vector<float>", &recHitEn_HF, 32000, 0);
//tt1->Branch("recHitEn_HO","std::vector<float>", &recHitEn_HO, 32000, 0);
tt1->Branch("recHitHB_En","std::vector<float>", &recHitHB_En, 32000, 0);
//tt1->Branch("recHitHB_EnRAW","std::vector<float>", &recHitHB_EnRAW, 32000, 0);
tt1->Branch("recHitHB_ieta","std::vector<int>", &recHitHB_ieta, 32000, 0);
tt1->Branch("recHitHB_iphi","std::vector<int>", &recHitHB_iphi, 32000, 0);
tt1->Branch("recHitHB_depth","std::vector<int>", &recHitHB_depth, 32000, 0);
tt1->Branch("recHitHB_time","std::vector<float>", &recHitHB_time, 32000, 0);
tt1->Branch("recHitHE_En","std::vector<float>", &recHitHE_En, 32000, 0);
//tt1->Branch("recHitHE_EnRAW","std::vector<float>", &recHitHE_EnRAW, 32000, 0);
tt1->Branch("recHitHE_ieta","std::vector<int>", &recHitHE_ieta, 32000, 0);
tt1->Branch("recHitHE_iphi","std::vector<int>", &recHitHE_iphi, 32000, 0);
tt1->Branch("recHitHE_depth","std::vector<int>", &recHitHE_depth, 32000, 0);
tt1->Branch("recHitHE_time","std::vector<float>", &recHitHE_time, 32000, 0);
tt1->Branch("recHitHF_En","std::vector<float>", &recHitHF_En, 32000, 0);
//tt1->Branch("recHitHF_EnRAW","std::vector<float>", &recHitHF_EnRAW, 32000, 0);
tt1->Branch("recHitHF_ieta","std::vector<int>", &recHitHF_ieta, 32000, 0);
tt1->Branch("recHitHF_iphi","std::vector<int>", &recHitHF_iphi, 32000, 0);
tt1->Branch("recHitHF_depth","std::vector<int>", &recHitHF_depth, 32000, 0);
tt1->Branch("recHitHF_time","std::vector<float>", &recHitHF_time, 32000, 0);
//tt1->Branch("recHitHO_En","std::vector<float>", &recHitHO_En, 32000, 0);
//tt1->Branch("recHitHO_EnRAW","std::vector<float>", &recHitHO_EnRAW, 32000, 0);
//tt1->Branch("recHitHO_ieta","std::vector<int>", &recHitHO_ieta, 32000, 0);
//tt1->Branch("recHitHO_iphi","std::vector<int>", &recHitHO_iphi, 32000, 0);
//tt1->Branch("recHitHO_time","std::vector<float>", &recHitHO_time, 32000, 0);
//tt1->Branch("caloTower_HadEt","std::vector<float>", &caloTower_HadEt, 32000, 0);
//tt1->Branch("caloTower_EMEt","std::vector<float>", &caloTower_EmEt, 32000, 0);
//tt1->Branch("caloTower_ieta","std::vector<int>", &caloTower_ieta, 32000, 0);
//tt1->Branch("caloTower_iphi","std::vector<int>", &caloTower_iphi, 32000, 0);
//tt1->Branch("recHitEn_HB2","std::Vector<float>", &recHitEn_HB2, 32000, 0);
//tt1->Branch("recHitEn_HE1","std::vector<float>", &recHitEn_HE1, 32000, 0);
//tt1->Branch("recHitEn_HE2","std::Vector<float>", &recHitEn_HE2, 32000, 0);
//tt1->Branch("recHitEn_HE3","std::Vector<float>", &recHitEn_HE3, 32000, 0);
//tt1->Branch("recHitEn_HF1", "std::vector<float>", &recHitEn_HF1, 32000, 0);
//tt1->Branch("recHitEn_HF2", "std::vector<float>", &recHitEn_HF2, 32000, 0);
}
RecHitSpectra2023::~RecHitSpectra2023()
{
// do anything here that needs to be done at desctruction time
// (e.g. close files, deallocate resources etc.)
tf1->cd();
tt1->Write();
tf1->Write();
tf1->Close();
}
//
// member functions
//
// ------------ method called for each event ------------
void
RecHitSpectra2023::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
{
using namespace edm;
using namespace reco;
// HCAL channel status map ****************************************
//edm::ESHandle<HcalChannelQuality> hcalChStatus;
//iSetup.get<HcalChannelQualityRcd>().get( "withTopo", hcalChStatus );
//theHcalChStatus = hcalChStatus.product();
// Assignment of severity levels **********************************
//edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
//iSetup.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
//theHcalSevLvlComputer = hcalSevLvlComputerHndl.product();
//Clear out the RecHit vectors
//recHitEn_HB.clear();
//recHitEn_HE.clear();
//recHitEn_HF.clear();
//recHitEn_HO.clear();
//recHitEn_HB1.clear();
//recHitEn_HE1.clear();
//recHitEn_HF1.clear();
//recHitEn_HB2.clear();
//recHitEn_HE2.clear();
//recHitEn_HF2.clear();
//recHitEn_HE3.clear();
recHitHB_En.clear();
//recHitHB_EnRAW.clear();
recHitHB_ieta.clear();
recHitHB_iphi.clear();
recHitHB_depth.clear();
recHitHB_time.clear();
recHitHE_En.clear();
//recHitHE_EnRAW.clear();
recHitHE_ieta.clear();
recHitHE_iphi.clear();
recHitHE_depth.clear();
recHitHE_time.clear();
recHitHF_En.clear();
//recHitHF_EnRAW.clear();
recHitHF_ieta.clear();
recHitHF_iphi.clear();
recHitHF_depth.clear();
recHitHF_time.clear();
//recHitHO_En.clear();
//recHitHO_EnRAW.clear();
//recHitHO_ieta.clear();
//recHitHO_iphi.clear();
//recHitHO_time.clear();
//caloTower_HadEt.clear();
//caloTower_EmEt.clear();
//caloTower_ieta.clear();
//caloTower_iphi.clear();
//run:lumi:event
run = iEvent.id().run();
lumi = iEvent.id().luminosityBlock();
event = iEvent.id().event();
//Clear the nvertx
//nvertx = 0;
//nrechits = 0;
//Good Vertices
//edm::Handle<VertexCollection> vertexcoll;
//iEvent.getByToken(tok_vertexc_, vertexcoll);
//for(VertexCollection::const_iterator vitr = vertexcoll->begin(); vitr != vertexcoll->end(); vitr++){
//if(vitr->isFake()) continue;
//if(vitr->ndof() <= 4) continue;
//if(vitr->z() > 24) continue;
//if(vitr->z() < -24) continue;
//if(vitr->position().Rho()>=2) continue;
//if(vitr->position().Rho()<=-2) continue;
//nvertx++;
//} //Good Vertices
// CaloTowers
//edm::Handle<CaloTowerCollection> towers;
//iEvent.getByToken(tok_calo_,towers);
//CaloTowerCollection::const_iterator cal;
//for(cal = towers->begin(); cal != towers->end(); cal++){
// CaloTowerDetId idT = cal->id();
// caloTower_HadEt.push_back(cal->hadEt());
// caloTower_EmEt.push_back(cal->emEt());
// caloTower_ieta.push_back(idT.ieta());
// caloTower_iphi.push_back(idT.iphi());
//}
//HBHE RecHits
edm::Handle<HBHERecHitCollection> hbhecoll;
iEvent.getByToken(tok_hbhe_, hbhecoll);
int depth = 0;
int severityLevel = 0;
for(HBHERecHitCollection::const_iterator j=hbhecoll->begin(); j != hbhecoll->end(); j++){
HcalDetId cell(j->id());
depth = cell.depth();
//severityLevel = hcalSevLvl( (CaloRecHit*) &*j );
//if(severityLevel > 8) continue;
if(cell.subdet() == HcalBarrel){
//nrechits++;
//recHitEn_HB.push_back(j->energy());
recHitHB_En.push_back(j->energy());
//recHitHB1_EnRAW.push_back(j->eraw());
recHitHB_ieta.push_back(cell.ieta());
recHitHB_iphi.push_back(cell.iphi());
recHitHB_depth.push_back(depth);
recHitHB_time.push_back(j->time());
}//HB
if(cell.subdet() == HcalEndcap){
//nrechits++;
//recHitEn_HE.push_back(j->energy());
recHitHE_En.push_back(j->energy());
//recHitHE_EnRAW.push_back(j->eraw());
recHitHE_ieta.push_back(cell.ieta());
recHitHE_iphi.push_back(cell.iphi());
recHitHE_depth.push_back(depth);
recHitHE_time.push_back(j->time());
}//HE
} //HBHE
//HF RecHits
edm::Handle<HFRecHitCollection> hfcoll;
iEvent.getByToken(tok_hf_, hfcoll);
for( HFRecHitCollection::const_iterator j = hfcoll->begin(); j != hfcoll->end(); j++){
HcalDetId cell(j->id());
depth = cell.depth();
//severityLevel = hcalSevLvl( (CaloRecHit*) &*j );
//ZS emulation
//int auxwd = j->aux();
//bool reject = true;
//for(int TSidx = 0; TSidx < 3; TSidx++){
//int TS2 = (auxwd >> (TSidx*7)) & 0x7F;
//int TS3 = (auxwd >> (TSidx*7+7)) & 0x7F;
//if(TS2+TS3 >= 10) reject = false;
//}
//if(reject) continue;
//ZS emulation
//if(severityLevel > 8) continue;
//nrechits++;
//recHitEn_HF.push_back(j->energy());
recHitHF_En.push_back(j->energy());
//recHitHF1_EnRAW.push_back(j->eraw());
recHitHF_ieta.push_back(cell.ieta());
recHitHF_iphi.push_back(cell.iphi());
recHitHF_depth.push_back(depth);
recHitHF_time.push_back(j->time());
} //HF
//HO RecHits
//edm::Handle<HORecHitCollection> hocoll;
//iEvent.getByToken(tok_ho_, hocoll);
//for( HORecHitCollection::const_iterator j = hocoll->begin(); j != hocoll->end(); j++){
//HcalDetId cell(j->id());
//severityLevel = hcalSevLvl( (CaloRecHit*) &*j );
//if(severityLevel > 8) continue;
//nrechits++;
//recHitEn_HO.push_back(j->energy());
//recHitHO_En.push_back(j->energy());
//recHitHO_EnRAW.push_back(j->eraw());
//recHitHO_ieta.push_back(cell.ieta());
//recHitHO_iphi.push_back(cell.iphi());
//recHitHO_time.push_back(j->time());
//} //HO
//Fill Tree
tt1->Fill();
}
// ------------ method called once each job just before starting event loop ------------
void
RecHitSpectra2023::beginJob()
{
}
// ------------ method called once each job just after ending the event loop ------------
void
RecHitSpectra2023::endJob()
{
}
// ------------ method called when starting to processes a run ------------
/*
void
RecHitSpectra2023::beginRun(edm::Run const&, edm::EventSetup const&)
{
}
*/
// ------------ method called when ending the processing of a run ------------
/*
void
RecHitSpectra2023::endRun(edm::Run const&, edm::EventSetup const&)
{
}
*/
// ------------ method called when starting to processes a luminosity block ------------
/*
void
RecHitSpectra2023::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
{
}
*/
// ------------ method called when ending the processing of a luminosity block ------------
/*
void
RecHitSpectra2023::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&)
{
}
*/
// ------------ method fills 'descriptions' with the allowed parameters for the module ------------
void
RecHitSpectra2023::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
//The following says we do not know what parameters are allowed so do no validation
// Please change this to state exactly what you do use, even if it is no parameters
edm::ParameterSetDescription desc;
desc.setUnknown();
descriptions.addDefault(desc);
}
//int
//RecHitSpectra2023::hcalSevLvl(const CaloRecHit* hit){
// const DetId id = hit->detid();
// const uint32_t recHitFlag = hit->flags();
// const uint32_t dbStatusFlag = theHcalChStatus->getValues(id)->getValue();
// int severityLevel = theHcalSevLvlComputer->getSeverityLevel(id, recHitFlag, dbStatusFlag);
// return severityLevel;
//}
//define this as a plug-in
DEFINE_FWK_MODULE(RecHitSpectra2023);
| [
"ken_call@baylor.edu"
] | ken_call@baylor.edu |
0e2c5cd833c2acce15f9c22b23fbfea3a83002be | 8a84644276ae6204ae935f858b5e2367a2777613 | /src/init.cpp | 6a0735aa251e1026ab0409026f19b96d19f951a6 | [
"MIT"
] | permissive | puzcoin/bitone | 88978981a4fef5c5bb4746209635f1efdf8964c6 | 7cae35aa8a5489480318f2c7d1cf2814ef19a0a6 | refs/heads/master | 2020-04-15T11:20:37.012905 | 2019-01-08T10:39:25 | 2019-01-08T10:39:25 | 164,626,279 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 91,642 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2018 The PIVX developers
// Copyright (c) 2018 The Bone Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "config/bone-config.h"
#endif
#include "init.h"
#include "accumulators.h"
#include "activemasternode.h"
#include "addrman.h"
#include "amount.h"
#include "checkpoints.h"
#include "compat/sanity.h"
#include "httpserver.h"
#include "httprpc.h"
#include "key.h"
#include "main.h"
#include "masternode-budget.h"
#include "masternode-payments.h"
#include "masternodeconfig.h"
#include "masternodeman.h"
#include "miner.h"
#include "net.h"
#include "rpcserver.h"
#include "script/standard.h"
#include "scheduler.h"
#include "spork.h"
#include "sporkdb.h"
#include "txdb.h"
#include "torcontrol.h"
#include "ui_interface.h"
#include "util.h"
#include "utilmoneystr.h"
#include "validationinterface.h"
#ifdef ENABLE_WALLET
#include "db.h"
#include "wallet.h"
#include "walletdb.h"
#include "accumulators.h"
#endif
#include <fstream>
#include <stdint.h>
#include <stdio.h>
#ifndef WIN32
#include <signal.h>
#endif
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/filesystem.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/thread.hpp>
#include <openssl/crypto.h>
#if ENABLE_ZMQ
#include "zmq/zmqnotificationinterface.h"
#endif
using namespace boost;
using namespace std;
#ifdef ENABLE_WALLET
CWallet* pwalletMain = NULL;
int nWalletBackups = 10;
#endif
volatile bool fFeeEstimatesInitialized = false;
volatile bool fRestartRequested = false; // true: restart false: shutdown
extern std::list<uint256> listAccCheckpointsNoDB;
#if ENABLE_ZMQ
static CZMQNotificationInterface* pzmqNotificationInterface = NULL;
#endif
#ifdef WIN32
// Win32 LevelDB doesn't use filedescriptors, and the ones used for
// accessing block files, don't count towards to fd_set size limit
// anyway.
#define MIN_CORE_FILEDESCRIPTORS 0
#else
#define MIN_CORE_FILEDESCRIPTORS 150
#endif
/** Used to pass flags to the Bind() function */
enum BindFlags {
BF_NONE = 0,
BF_EXPLICIT = (1U << 0),
BF_REPORT_ERROR = (1U << 1),
BF_WHITELIST = (1U << 2),
};
static const char* FEE_ESTIMATES_FILENAME = "fee_estimates.dat";
CClientUIInterface uiInterface;
//////////////////////////////////////////////////////////////////////////////
//
// Shutdown
//
//
// Thread management and startup/shutdown:
//
// The network-processing threads are all part of a thread group
// created by AppInit() or the Qt main() function.
//
// A clean exit happens when StartShutdown() or the SIGTERM
// signal handler sets fRequestShutdown, which triggers
// the DetectShutdownThread(), which interrupts the main thread group.
// DetectShutdownThread() then exits, which causes AppInit() to
// continue (it .joins the shutdown thread).
// Shutdown() is then
// called to clean up database connections, and stop other
// threads that should only be stopped after the main network-processing
// threads have exited.
//
// Note that if running -daemon the parent process returns from AppInit2
// before adding any threads to the threadGroup, so .join_all() returns
// immediately and the parent exits from main().
//
// Shutdown for Qt is very similar, only it uses a QTimer to detect
// fRequestShutdown getting set, and then does the normal Qt
// shutdown thing.
//
volatile bool fRequestShutdown = false;
void StartShutdown()
{
fRequestShutdown = true;
}
bool ShutdownRequested()
{
return fRequestShutdown || fRestartRequested;
}
class CCoinsViewErrorCatcher : public CCoinsViewBacked
{
public:
CCoinsViewErrorCatcher(CCoinsView* view) : CCoinsViewBacked(view) {}
bool GetCoins(const uint256& txid, CCoins& coins) const
{
try {
return CCoinsViewBacked::GetCoins(txid, coins);
} catch (const std::runtime_error& e) {
uiInterface.ThreadSafeMessageBox(_("Error reading from database, shutting down."), "", CClientUIInterface::MSG_ERROR);
LogPrintf("Error reading from database: %s\n", e.what());
// Starting the shutdown sequence and returning false to the caller would be
// interpreted as 'entry not found' (as opposed to unable to read data), and
// could lead to invalid interpration. Just exit immediately, as we can't
// continue anyway, and all writes should be atomic.
abort();
}
}
// Writes do not need similar protection, as failure to write is handled by the caller.
};
static CCoinsViewDB* pcoinsdbview = NULL;
static CCoinsViewErrorCatcher* pcoinscatcher = NULL;
void Interrupt(boost::thread_group& threadGroup)
{
InterruptHTTPServer();
InterruptHTTPRPC();
InterruptRPC();
InterruptREST();
InterruptTorControl();
threadGroup.interrupt_all();
}
/** Preparing steps before shutting down or restarting the wallet */
void PrepareShutdown()
{
fRequestShutdown = true; // Needed when we shutdown the wallet
fRestartRequested = true; // Needed when we restart the wallet
LogPrintf("%s: In progress...\n", __func__);
static CCriticalSection cs_Shutdown;
TRY_LOCK(cs_Shutdown, lockShutdown);
if (!lockShutdown)
return;
/// Note: Shutdown() must be able to handle cases in which AppInit2() failed part of the way,
/// for example if the data directory was found to be locked.
/// Be sure that anything that writes files or flushes caches only does this if the respective
/// module was initialized.
RenameThread("bone-shutoff");
mempool.AddTransactionsUpdated(1);
StopHTTPRPC();
StopREST();
StopRPC();
StopHTTPServer();
#ifdef ENABLE_WALLET
if (pwalletMain)
bitdb.Flush(false);
GenerateBitcoins(false, NULL, 0);
#endif
StopNode();
DumpMasternodes();
DumpBudgets();
DumpMasternodePayments();
UnregisterNodeSignals(GetNodeSignals());
if (fFeeEstimatesInitialized) {
boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
CAutoFile est_fileout(fopen(est_path.string().c_str(), "wb"), SER_DISK, CLIENT_VERSION);
if (!est_fileout.IsNull())
mempool.WriteFeeEstimates(est_fileout);
else
LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string());
fFeeEstimatesInitialized = false;
}
{
LOCK(cs_main);
if (pcoinsTip != NULL) {
FlushStateToDisk();
//record that client took the proper shutdown procedure
pblocktree->WriteFlag("shutdown", true);
}
delete pcoinsTip;
pcoinsTip = NULL;
delete pcoinscatcher;
pcoinscatcher = NULL;
delete pcoinsdbview;
pcoinsdbview = NULL;
delete pblocktree;
pblocktree = NULL;
delete zerocoinDB;
zerocoinDB = NULL;
delete pSporkDB;
pSporkDB = NULL;
}
#ifdef ENABLE_WALLET
if (pwalletMain)
bitdb.Flush(true);
#endif
#if ENABLE_ZMQ
if (pzmqNotificationInterface) {
UnregisterValidationInterface(pzmqNotificationInterface);
delete pzmqNotificationInterface;
pzmqNotificationInterface = NULL;
}
#endif
#ifndef WIN32
try {
boost::filesystem::remove(GetPidFile());
} catch (const boost::filesystem::filesystem_error& e) {
LogPrintf("%s: Unable to remove pidfile: %s\n", __func__, e.what());
}
#endif
UnregisterAllValidationInterfaces();
}
/**
* Shutdown is split into 2 parts:
* Part 1: shut down everything but the main wallet instance (done in PrepareShutdown() )
* Part 2: delete wallet instance
*
* In case of a restart PrepareShutdown() was already called before, but this method here gets
* called implicitly when the parent object is deleted. In this case we have to skip the
* PrepareShutdown() part because it was already executed and just delete the wallet instance.
*/
void Shutdown()
{
// Shutdown part 1: prepare shutdown
if (!fRestartRequested) {
PrepareShutdown();
}
// Shutdown part 2: Stop TOR thread and delete wallet instance
StopTorControl();
#ifdef ENABLE_WALLET
delete pwalletMain;
pwalletMain = NULL;
#endif
LogPrintf("%s: done\n", __func__);
}
/**
* Signal handlers are very limited in what they are allowed to do, so:
*/
void HandleSIGTERM(int)
{
fRequestShutdown = true;
}
void HandleSIGHUP(int)
{
fReopenDebugLog = true;
}
bool static InitError(const std::string& str)
{
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR);
return false;
}
bool static InitWarning(const std::string& str)
{
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING);
return true;
}
bool static Bind(const CService& addr, unsigned int flags)
{
if (!(flags & BF_EXPLICIT) && IsLimited(addr))
return false;
std::string strError;
if (!BindListenPort(addr, strError, (flags & BF_WHITELIST) != 0)) {
if (flags & BF_REPORT_ERROR)
return InitError(strError);
return false;
}
return true;
}
void OnRPCStopped()
{
cvBlockChange.notify_all();
LogPrint("rpc", "RPC stopped.\n");
}
void OnRPCPreCommand(const CRPCCommand& cmd)
{
#ifdef ENABLE_WALLET
if (cmd.reqWallet && !pwalletMain)
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found (disabled)");
#endif
// Observe safe mode
string strWarning = GetWarnings("rpc");
if (strWarning != "" && !GetBoolArg("-disablesafemode", false) &&
!cmd.okSafeMode)
throw JSONRPCError(RPC_FORBIDDEN_BY_SAFE_MODE, string("Safe mode: ") + strWarning);
}
std::string HelpMessage(HelpMessageMode mode)
{
// When adding new options to the categories, please keep and ensure alphabetical ordering.
string strUsage = HelpMessageGroup(_("Options:"));
strUsage += HelpMessageOpt("-?", _("This help message"));
strUsage += HelpMessageOpt("-version", _("Print version and exit"));
strUsage += HelpMessageOpt("-alertnotify=<cmd>", _("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)"));
strUsage += HelpMessageOpt("-alerts", strprintf(_("Receive and display P2P network alerts (default: %u)"), DEFAULT_ALERTS));
strUsage += HelpMessageOpt("-blocknotify=<cmd>", _("Execute command when the best block changes (%s in cmd is replaced by block hash)"));
strUsage += HelpMessageOpt("-blocksizenotify=<cmd>", _("Execute command when the best block changes and its size is over (%s in cmd is replaced by block hash, %d with the block size)"));
strUsage += HelpMessageOpt("-checkblocks=<n>", strprintf(_("How many blocks to check at startup (default: %u, 0 = all)"), 500));
strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), "Bitone.conf"));
if (mode == HMM_BITCOIND) {
#if !defined(WIN32)
strUsage += HelpMessageOpt("-daemon", _("Run in the background as a daemon and accept commands"));
#endif
}
strUsage += HelpMessageOpt("-datadir=<dir>", _("Specify data directory"));
strUsage += HelpMessageOpt("-dbcache=<n>", strprintf(_("Set database cache size in megabytes (%d to %d, default: %d)"), nMinDbCache, nMaxDbCache, nDefaultDbCache));
strUsage += HelpMessageOpt("-loadblock=<file>", _("Imports blocks from external blk000??.dat file") + " " + _("on startup"));
strUsage += HelpMessageOpt("-maxreorg=<n>", strprintf(_("Set the Maximum reorg depth (default: %u)"), Params(CBaseChainParams::MAIN).MaxReorganizationDepth()));
strUsage += HelpMessageOpt("-maxorphantx=<n>", strprintf(_("Keep at most <n> unconnectable transactions in memory (default: %u)"), DEFAULT_MAX_ORPHAN_TRANSACTIONS));
strUsage += HelpMessageOpt("-par=<n>", strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"), -(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS));
#ifndef WIN32
strUsage += HelpMessageOpt("-pid=<file>", strprintf(_("Specify pid file (default: %s)"), "boned.pid"));
#endif
strUsage += HelpMessageOpt("-reindex", _("Rebuild block chain index from current blk000??.dat files") + " " + _("on startup"));
strUsage += HelpMessageOpt("-reindexaccumulators", _("Reindex the accumulator database") + " " + _("on startup"));
strUsage += HelpMessageOpt("-reindexmoneysupply", _("Reindex the Bone and xBONE money supply statistics") + " " + _("on startup"));
strUsage += HelpMessageOpt("-resync", _("Delete blockchain folders and resync from scratch") + " " + _("on startup"));
#if !defined(WIN32)
strUsage += HelpMessageOpt("-sysperms", _("Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)"));
#endif
strUsage += HelpMessageOpt("-txindex", strprintf(_("Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)"), 0));
strUsage += HelpMessageOpt("-forcestart", _("Attempt to force blockchain corruption recovery") + " " + _("on startup"));
strUsage += HelpMessageGroup(_("Connection options:"));
strUsage += HelpMessageOpt("-addnode=<ip>", _("Add a node to connect to and attempt to keep the connection open"));
strUsage += HelpMessageOpt("-banscore=<n>", strprintf(_("Threshold for disconnecting misbehaving peers (default: %u)"), 100));
strUsage += HelpMessageOpt("-bantime=<n>", strprintf(_("Number of seconds to keep misbehaving peers from reconnecting (default: %u)"), 86400));
strUsage += HelpMessageOpt("-bind=<addr>", _("Bind to given address and always listen on it. Use [host]:port notation for IPv6"));
strUsage += HelpMessageOpt("-connect=<ip>", _("Connect only to the specified node(s)"));
strUsage += HelpMessageOpt("-discover", _("Discover own IP address (default: 1 when listening and no -externalip)"));
strUsage += HelpMessageOpt("-dns", _("Allow DNS lookups for -addnode, -seednode and -connect") + " " + _("(default: 1)"));
strUsage += HelpMessageOpt("-dnsseed", _("Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)"));
strUsage += HelpMessageOpt("-externalip=<ip>", _("Specify your own public address"));
strUsage += HelpMessageOpt("-forcednsseed", strprintf(_("Always query for peer addresses via DNS lookup (default: %u)"), 0));
strUsage += HelpMessageOpt("-listen", _("Accept connections from outside (default: 1 if no -proxy or -connect)"));
strUsage += HelpMessageOpt("-listenonion", strprintf(_("Automatically create Tor hidden service (default: %d)"), DEFAULT_LISTEN_ONION));
strUsage += HelpMessageOpt("-maxconnections=<n>", strprintf(_("Maintain at most <n> connections to peers (default: %u)"), 125));
strUsage += HelpMessageOpt("-maxreceivebuffer=<n>", strprintf(_("Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)"), 5000));
strUsage += HelpMessageOpt("-maxsendbuffer=<n>", strprintf(_("Maximum per-connection send buffer, <n>*1000 bytes (default: %u)"), 1000));
strUsage += HelpMessageOpt("-onion=<ip:port>", strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy"));
strUsage += HelpMessageOpt("-onlynet=<net>", _("Only connect to nodes in network <net> (ipv4, ipv6 or onion)"));
strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), 1));
strUsage += HelpMessageOpt("-peerbloomfilters", strprintf(_("Support filtering of blocks and transaction with bloom filters (default: %u)"), DEFAULT_PEERBLOOMFILTERS));
strUsage += HelpMessageOpt("-port=<port>", strprintf(_("Listen for connections on <port> (default: %u or testnet: %u)"), 12700, 27170));
strUsage += HelpMessageOpt("-proxy=<ip:port>", _("Connect through SOCKS5 proxy"));
strUsage += HelpMessageOpt("-proxyrandomize", strprintf(_("Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)"), 1));
strUsage += HelpMessageOpt("-seednode=<ip>", _("Connect to a node to retrieve peer addresses, and disconnect"));
strUsage += HelpMessageOpt("-timeout=<n>", strprintf(_("Specify connection timeout in milliseconds (minimum: 1, default: %d)"), DEFAULT_CONNECT_TIMEOUT));
strUsage += HelpMessageOpt("-torcontrol=<ip>:<port>", strprintf(_("Tor control port to use if onion listening enabled (default: %s)"), DEFAULT_TOR_CONTROL));
strUsage += HelpMessageOpt("-torpassword=<pass>", _("Tor control port password (default: empty)"));
#ifdef USE_UPNP
#if USE_UPNP
strUsage += HelpMessageOpt("-upnp", _("Use UPnP to map the listening port (default: 1 when listening)"));
#else
strUsage += HelpMessageOpt("-upnp", strprintf(_("Use UPnP to map the listening port (default: %u)"), 0));
#endif
#endif
strUsage += HelpMessageOpt("-whitebind=<addr>", _("Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6"));
strUsage += HelpMessageOpt("-whitelist=<netmask>", _("Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times.") +
" " + _("Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway"));
#ifdef ENABLE_WALLET
strUsage += HelpMessageGroup(_("Wallet options:"));
strUsage += HelpMessageOpt("-createwalletbackups=<n>", _("Number of automatic wallet backups (default: 10)"));
strUsage += HelpMessageOpt("-disablewallet", _("Do not load the wallet and disable wallet RPC calls"));
strUsage += HelpMessageOpt("-keypool=<n>", strprintf(_("Set key pool size to <n> (default: %u)"), 100));
if (GetBoolArg("-help-debug", false))
strUsage += HelpMessageOpt("-mintxfee=<amt>", strprintf(_("Fees (in BONE/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"),
FormatMoney(CWallet::minTxFee.GetFeePerK())));
strUsage += HelpMessageOpt("-paytxfee=<amt>", strprintf(_("Fee (in BONE/kB) to add to transactions you send (default: %s)"), FormatMoney(payTxFee.GetFeePerK())));
strUsage += HelpMessageOpt("-rescan", _("Rescan the block chain for missing wallet transactions") + " " + _("on startup"));
strUsage += HelpMessageOpt("-salvagewallet", _("Attempt to recover private keys from a corrupt wallet.dat") + " " + _("on startup"));
strUsage += HelpMessageOpt("-sendfreetransactions", strprintf(_("Send transactions as zero-fee transactions if possible (default: %u)"), 0));
strUsage += HelpMessageOpt("-spendzeroconfchange", strprintf(_("Spend unconfirmed change when sending transactions (default: %u)"), 1));
strUsage += HelpMessageOpt("-disablesystemnotifications", strprintf(_("Disable OS notifications for incoming transactions (default: %u)"), 0));
strUsage += HelpMessageOpt("-txconfirmtarget=<n>", strprintf(_("If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)"), 1));
strUsage += HelpMessageOpt("-maxtxfee=<amt>", strprintf(_("Maximum total fees to use in a single wallet transaction, setting too low may abort large transactions (default: %s)"),
FormatMoney(maxTxFee)));
strUsage += HelpMessageOpt("-upgradewallet", _("Upgrade wallet to latest format") + " " + _("on startup"));
strUsage += HelpMessageOpt("-wallet=<file>", _("Specify wallet file (within data directory)") + " " + strprintf(_("(default: %s)"), "wallet.dat"));
strUsage += HelpMessageOpt("-walletnotify=<cmd>", _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)"));
if (mode == HMM_BITCOIN_QT)
strUsage += HelpMessageOpt("-windowtitle=<name>", _("Wallet window title"));
strUsage += HelpMessageOpt("-zapwallettxes=<mode>", _("Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup") +
" " + _("(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)"));
#endif
#if ENABLE_ZMQ
strUsage += HelpMessageGroup(_("ZeroMQ notification options:"));
strUsage += HelpMessageOpt("-zmqpubhashblock=<address>", _("Enable publish hash block in <address>"));
strUsage += HelpMessageOpt("-zmqpubhashtx=<address>", _("Enable publish hash transaction in <address>"));
strUsage += HelpMessageOpt("-zmqpubhashtxlock=<address>", _("Enable publish hash transaction (locked via SwiftX) in <address>"));
strUsage += HelpMessageOpt("-zmqpubrawblock=<address>", _("Enable publish raw block in <address>"));
strUsage += HelpMessageOpt("-zmqpubrawtx=<address>", _("Enable publish raw transaction in <address>"));
strUsage += HelpMessageOpt("-zmqpubrawtxlock=<address>", _("Enable publish raw transaction (locked via SwiftX) in <address>"));
#endif
strUsage += HelpMessageGroup(_("Debugging/Testing options:"));
if (GetBoolArg("-help-debug", false)) {
strUsage += HelpMessageOpt("-checkblockindex", strprintf("Do a full consistency check for mapBlockIndex, setBlockIndexCandidates, chainActive and mapBlocksUnlinked occasionally. Also sets -checkmempool (default: %u)", Params(CBaseChainParams::MAIN).DefaultConsistencyChecks()));
strUsage += HelpMessageOpt("-checkmempool=<n>", strprintf("Run checks every <n> transactions (default: %u)", Params(CBaseChainParams::MAIN).DefaultConsistencyChecks()));
strUsage += HelpMessageOpt("-checkpoints", strprintf(_("Only accept block chain matching built-in checkpoints (default: %u)"), 1));
strUsage += HelpMessageOpt("-dblogsize=<n>", strprintf(_("Flush database activity from memory pool to disk log every <n> megabytes (default: %u)"), 100));
strUsage += HelpMessageOpt("-disablesafemode", strprintf(_("Disable safemode, override a real safe mode event (default: %u)"), 0));
strUsage += HelpMessageOpt("-testsafemode", strprintf(_("Force safe mode (default: %u)"), 0));
strUsage += HelpMessageOpt("-dropmessagestest=<n>", _("Randomly drop 1 of every <n> network messages"));
strUsage += HelpMessageOpt("-fuzzmessagestest=<n>", _("Randomly fuzz 1 of every <n> network messages"));
strUsage += HelpMessageOpt("-flushwallet", strprintf(_("Run a thread to flush wallet periodically (default: %u)"), 1));
strUsage += HelpMessageOpt("-maxreorg", strprintf(_("Use a custom max chain reorganization depth (default: %u)"), 100));
strUsage += HelpMessageOpt("-stopafterblockimport", strprintf(_("Stop running after importing blocks from disk (default: %u)"), 0));
strUsage += HelpMessageOpt("-sporkkey=<privkey>", _("Enable spork administration functionality with the appropriate private key."));
}
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, tor, mempool, net, proxy, bone, (obfuscation, swiftx, masternode, mnpayments, mnbudget, zero)"; // Don't translate these and qt below
if (mode == HMM_BITCOIN_QT)
debugCategories += ", qt";
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
_("If <category> is not supplied, output all debugging information.") + _("<category> can be:") + " " + debugCategories + ".");
if (GetBoolArg("-help-debug", false))
strUsage += HelpMessageOpt("-nodebug", "Turn off debugging messages, same as -debug=0");
#ifdef ENABLE_WALLET
strUsage += HelpMessageOpt("-gen", strprintf(_("Generate coins (default: %u)"), 0));
strUsage += HelpMessageOpt("-genproclimit=<n>", strprintf(_("Set the number of threads for coin generation if enabled (-1 = all cores, default: %d)"), 1));
#endif
strUsage += HelpMessageOpt("-help-debug", _("Show all debugging options (usage: --help -help-debug)"));
strUsage += HelpMessageOpt("-logips", strprintf(_("Include IP addresses in debug output (default: %u)"), 0));
strUsage += HelpMessageOpt("-logtimestamps", strprintf(_("Prepend debug output with timestamp (default: %u)"), 1));
if (GetBoolArg("-help-debug", false)) {
strUsage += HelpMessageOpt("-limitfreerelay=<n>", strprintf(_("Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u)"), 15));
strUsage += HelpMessageOpt("-relaypriority", strprintf(_("Require high priority for relaying free or low-fee transactions (default:%u)"), 1));
strUsage += HelpMessageOpt("-maxsigcachesize=<n>", strprintf(_("Limit size of signature cache to <n> entries (default: %u)"), 50000));
}
strUsage += HelpMessageOpt("-minrelaytxfee=<amt>", strprintf(_("Fees (in BONE/Kb) smaller than this are considered zero fee for relaying (default: %s)"), FormatMoney(::minRelayTxFee.GetFeePerK())));
strUsage += HelpMessageOpt("-printtoconsole", strprintf(_("Send trace/debug info to console instead of debug.log file (default: %u)"), 0));
if (GetBoolArg("-help-debug", false)) {
strUsage += HelpMessageOpt("-printpriority", strprintf(_("Log transaction priority and fee per kB when mining blocks (default: %u)"), 0));
strUsage += HelpMessageOpt("-privdb", strprintf(_("Sets the DB_PRIVATE flag in the wallet db environment (default: %u)"), 1));
strUsage += HelpMessageOpt("-regtest", _("Enter regression test mode, which uses a special chain in which blocks can be solved instantly.") + " " +
_("This is intended for regression testing tools and app development.") + " " +
_("In this mode -genproclimit controls how many blocks are generated immediately."));
}
strUsage += HelpMessageOpt("-shrinkdebugfile", _("Shrink debug.log file on client startup (default: 1 when no -debug)"));
strUsage += HelpMessageOpt("-testnet", _("Use the test network"));
strUsage += HelpMessageOpt("-litemode=<n>", strprintf(_("Disable all Bone specific functionality (Masternodes, Zerocoin, SwiftX, Budgeting) (0-1, default: %u)"), 0));
#ifdef ENABLE_WALLET
strUsage += HelpMessageGroup(_("Staking options:"));
strUsage += HelpMessageOpt("-staking=<n>", strprintf(_("Enable staking functionality (0-1, default: %u)"), 1));
strUsage += HelpMessageOpt("-reservebalance=<amt>", _("Keep the specified amount available for spending at all times (default: 0)"));
if (GetBoolArg("-help-debug", false)) {
strUsage += HelpMessageOpt("-printstakemodifier", _("Display the stake modifier calculations in the debug.log file."));
strUsage += HelpMessageOpt("-printcoinstake", _("Display verbose coin stake messages in the debug.log file."));
}
#endif
strUsage += HelpMessageGroup(_("Masternode options:"));
strUsage += HelpMessageOpt("-masternode=<n>", strprintf(_("Enable the client to act as a masternode (0-1, default: %u)"), 0));
strUsage += HelpMessageOpt("-mnconf=<file>", strprintf(_("Specify masternode configuration file (default: %s)"), "masternode.conf"));
strUsage += HelpMessageOpt("-mnconflock=<n>", strprintf(_("Lock masternodes from masternode configuration file (default: %u)"), 1));
strUsage += HelpMessageOpt("-masternodeprivkey=<n>", _("Set the masternode private key"));
strUsage += HelpMessageOpt("-masternodeaddr=<n>", strprintf(_("Set external address:port to get to this masternode (example: %s)"), "128.127.106.235:12700"));
strUsage += HelpMessageOpt("-budgetvotemode=<mode>", _("Change automatic finalized budget voting behavior. mode=auto: Vote for only exact finalized budget match to my generated budget. (string, default: auto)"));
strUsage += HelpMessageGroup(_("Zerocoin options:"));
// strUsage += HelpMessageOpt("-enablezeromint=<n>", strprintf(_("Enable automatic Zerocoin minting (0-1, default: %u)"), 1));
strUsage += HelpMessageOpt("-zeromintpercentage=<n>", strprintf(_("Percentage of automatically minted Zerocoin (1-100, default: %u)"), 10));
strUsage += HelpMessageOpt("-preferredDenom=<n>", strprintf(_("Preferred Denomination for automatically minted Zerocoin (1/5/10/50/100/500/1000/5000), 0 for no preference. default: %u)"), 0));
strUsage += HelpMessageOpt("-backupxion=<n>", strprintf(_("Enable automatic wallet backups triggered after each xBONE minting (0-1, default: %u)"), 1));
// strUsage += " -anonymizeionamount=<n> " + strprintf(_("Keep N Bone anonymized (default: %u)"), 0) + "\n";
// strUsage += " -liquidityprovider=<n> " + strprintf(_("Provide liquidity to Obfuscation by infrequently mixing coins on a continual basis (0-100, default: %u, 1=very frequent, high fees, 100=very infrequent, low fees)"), 0) + "\n";
strUsage += HelpMessageGroup(_("SwiftX options:"));
strUsage += HelpMessageOpt("-enableswifttx=<n>", strprintf(_("Enable SwiftX, show confirmations for locked transactions (bool, default: %s)"), "true"));
strUsage += HelpMessageOpt("-swifttxdepth=<n>", strprintf(_("Show N confirmations for a successfully locked transaction (0-9999, default: %u)"), nSwiftTXDepth));
strUsage += HelpMessageGroup(_("Node relay options:"));
strUsage += HelpMessageOpt("-datacarrier", strprintf(_("Relay and mine data carrier transactions (default: %u)"), 1));
strUsage += HelpMessageOpt("-datacarriersize", strprintf(_("Maximum size of data in data carrier transactions we relay and mine (default: %u)"), MAX_OP_RETURN_RELAY));
if (GetBoolArg("-help-debug", false)) {
strUsage += HelpMessageOpt("-blockversion=<n>", "Override block version to test forking scenarios");
}
strUsage += HelpMessageGroup(_("Block creation options:"));
strUsage += HelpMessageOpt("-blockminsize=<n>", strprintf(_("Set minimum block size in bytes (default: %u)"), 0));
strUsage += HelpMessageOpt("-blockmaxsize=<n>", strprintf(_("Set maximum block size in bytes (default: %d)"), DEFAULT_BLOCK_MAX_SIZE));
strUsage += HelpMessageOpt("-blockprioritysize=<n>", strprintf(_("Set maximum size of high-priority/low-fee transactions in bytes (default: %d)"), DEFAULT_BLOCK_PRIORITY_SIZE));
strUsage += HelpMessageGroup(_("RPC server options:"));
strUsage += HelpMessageOpt("-server", _("Accept command line and JSON-RPC commands"));
strUsage += HelpMessageOpt("-rest", strprintf(_("Accept public REST requests (default: %u)"), 0));
strUsage += HelpMessageOpt("-rpcbind=<addr>", _("Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)"));
strUsage += HelpMessageOpt("-rpccookiefile=<loc>", _("Location of the auth cookie (default: data dir)"));
strUsage += HelpMessageOpt("-rpcuser=<user>", _("Username for JSON-RPC connections"));
strUsage += HelpMessageOpt("-rpcpassword=<pw>", _("Password for JSON-RPC connections"));
strUsage += HelpMessageOpt("-rpcport=<port>", strprintf(_("Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"), 12705, 27171));
strUsage += HelpMessageOpt("-rpcallowip=<ip>", _("Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times"));
strUsage += HelpMessageOpt("-rpcthreads=<n>", strprintf(_("Set the number of threads to service RPC calls (default: %d)"), DEFAULT_HTTP_THREADS));
if (GetBoolArg("-help-debug", false)) {
strUsage += HelpMessageOpt("-rpcworkqueue=<n>", strprintf("Set the depth of the work queue to service RPC calls (default: %d)", DEFAULT_HTTP_WORKQUEUE));
strUsage += HelpMessageOpt("-rpcservertimeout=<n>", strprintf("Timeout during HTTP requests (default: %d)", DEFAULT_HTTP_SERVER_TIMEOUT));
}
return strUsage;
}
std::string LicenseInfo()
{
return FormatParagraph(strprintf(_("Copyright (C) 2009-%i The Bitcoin Core Developers"), COPYRIGHT_YEAR)) + "\n" +
"\n" +
FormatParagraph(strprintf(_("Copyright (C) 2014-%i The Dash Core Developers"), COPYRIGHT_YEAR)) + "\n" +
"\n" +
FormatParagraph(strprintf(_("Copyright (C) 2015-%i The PIVX Core Developers"), COPYRIGHT_YEAR)) + "\n" +
"\n" +
FormatParagraph(strprintf(_("Copyright (C) %i The Bone Core Developers"), COPYRIGHT_YEAR)) + "\n" +
"\n" +
FormatParagraph(_("This is experimental software.")) + "\n" +
"\n" +
FormatParagraph(_("Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>.")) + "\n" +
"\n" +
FormatParagraph(_("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.")) +
"\n";
}
static void BlockNotifyCallback(const uint256& hashNewTip)
{
std::string strCmd = GetArg("-blocknotify", "");
boost::replace_all(strCmd, "%s", hashNewTip.GetHex());
boost::thread t(runCommand, strCmd); // thread runs free
}
static void BlockSizeNotifyCallback(int size, const uint256& hashNewTip)
{
std::string strCmd = GetArg("-blocksizenotify", "");
boost::replace_all(strCmd, "%s", hashNewTip.GetHex());
boost::replace_all(strCmd, "%d", std::to_string(size));
boost::thread t(runCommand, strCmd); // thread runs free
}
struct CImportingNow {
CImportingNow()
{
assert(fImporting == false);
fImporting = true;
}
~CImportingNow()
{
assert(fImporting == true);
fImporting = false;
}
};
void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
{
RenameThread("bone-loadblk");
// -reindex
if (fReindex) {
CImportingNow imp;
int nFile = 0;
while (true) {
CDiskBlockPos pos(nFile, 0);
if (!boost::filesystem::exists(GetBlockPosFilename(pos, "blk")))
break; // No block files left to reindex
FILE* file = OpenBlockFile(pos, true);
if (!file)
break; // This error is logged in OpenBlockFile
LogPrintf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile);
LoadExternalBlockFile(file, &pos);
nFile++;
}
pblocktree->WriteReindexing(false);
fReindex = false;
LogPrintf("Reindexing finished\n");
// To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked):
InitBlockIndex();
}
// hardcoded $DATADIR/bootstrap.dat
filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat";
// import old Bone block file $DATADIR/blk0001.dat
filesystem::path pathBlk0001 = GetDataDir() / "blk0001.dat";
if (filesystem::exists(pathBootstrap)) {
FILE* file = fopen(pathBootstrap.string().c_str(), "rb");
if (file) {
CImportingNow imp;
filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old";
LogPrintf("Importing bootstrap.dat...\n");
LoadExternalBlockFile(file);
RenameOver(pathBootstrap, pathBootstrapOld);
} else {
LogPrintf("Warning: Could not open bootstrap file %s\n", pathBootstrap.string());
}
} else if (filesystem::exists(pathBlk0001)) {
FILE* file = fopen(pathBlk0001.string().c_str(), "rb");
if (file) {
CImportingNow imp;
filesystem::path pathBlk0001Old = GetDataDir() / "blk0001.dat.old";
LogPrintf("Importing blk0001.dat...\n");
LoadExternalBlockFile(file);
RenameOver(pathBlk0001, pathBlk0001Old);
} else {
LogPrintf("Warning: Could not import blk0001.dat file %s\n", pathBootstrap.string());
}
}
// -loadblock=
BOOST_FOREACH (boost::filesystem::path& path, vImportFiles) {
FILE* file = fopen(path.string().c_str(), "rb");
if (file) {
CImportingNow imp;
LogPrintf("Importing blocks file %s...\n", path.string());
LoadExternalBlockFile(file);
} else {
LogPrintf("Warning: Could not open blocks file %s\n", path.string());
}
}
if (GetBoolArg("-stopafterblockimport", false)) {
LogPrintf("Stopping after block import\n");
StartShutdown();
}
}
/** Sanity checks
* Ensure that Bone is running in a usable environment with all
* necessary library support.
*/
bool InitSanityCheck(void)
{
if (!ECC_InitSanityCheck()) {
InitError("OpenSSL appears to lack support for elliptic curve cryptography. For more "
"information, visit https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries");
return false;
}
if (!glibc_sanity_test() || !glibcxx_sanity_test())
return false;
return true;
}
bool AppInitServers(boost::thread_group& threadGroup)
{
RPCServer::OnStopped(&OnRPCStopped);
RPCServer::OnPreCommand(&OnRPCPreCommand);
if (!InitHTTPServer())
return false;
if (!StartRPC())
return false;
if (!StartHTTPRPC())
return false;
if (GetBoolArg("-rest", false) && !StartREST())
return false;
if (!StartHTTPServer())
return false;
return true;
}
/** Initialize bone.
* @pre Parameters should be parsed and config file should be read.
*/
bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
{
// ********************************************************* Step 1: setup
#ifdef _MSC_VER
// Turn off Microsoft heap dump noise
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0));
#endif
#if _MSC_VER >= 1400
// Disable confusing "helpful" text message on abort, Ctrl-C
_set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
#endif
#ifdef WIN32
// Enable Data Execution Prevention (DEP)
// Minimum supported OS versions: WinXP SP3, WinVista >= SP1, Win Server 2008
// A failure is non-critical and needs no further attention!
#ifndef PROCESS_DEP_ENABLE
// We define this here, because GCCs winbase.h limits this to _WIN32_WINNT >= 0x0601 (Windows 7),
// which is not correct. Can be removed, when GCCs winbase.h is fixed!
#define PROCESS_DEP_ENABLE 0x00000001
#endif
typedef BOOL(WINAPI * PSETPROCDEPPOL)(DWORD);
PSETPROCDEPPOL setProcDEPPol = (PSETPROCDEPPOL)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "SetProcessDEPPolicy");
if (setProcDEPPol != NULL) setProcDEPPol(PROCESS_DEP_ENABLE);
#endif
if (!SetupNetworking())
return InitError("Error: Initializing networking failed");
#ifndef WIN32
if (GetBoolArg("-sysperms", false)) {
#ifdef ENABLE_WALLET
if (!GetBoolArg("-disablewallet", false))
return InitError("Error: -sysperms is not allowed in combination with enabled wallet functionality");
#endif
} else {
umask(077);
}
// Clean shutdown on SIGTERM
struct sigaction sa;
sa.sa_handler = HandleSIGTERM;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(SIGTERM, &sa, NULL);
sigaction(SIGINT, &sa, NULL);
// Reopen debug.log on SIGHUP
struct sigaction sa_hup;
sa_hup.sa_handler = HandleSIGHUP;
sigemptyset(&sa_hup.sa_mask);
sa_hup.sa_flags = 0;
sigaction(SIGHUP, &sa_hup, NULL);
// Ignore SIGPIPE, otherwise it will bring the daemon down if the client closes unexpectedly
signal(SIGPIPE, SIG_IGN);
#endif
// ********************************************************* Step 2: parameter interactions
// Set this early so that parameter interactions go to console
fPrintToConsole = GetBoolArg("-printtoconsole", false);
fLogTimestamps = GetBoolArg("-logtimestamps", true);
fLogIPs = GetBoolArg("-logips", false);
if (mapArgs.count("-bind") || mapArgs.count("-whitebind")) {
// when specifying an explicit binding address, you want to listen on it
// even when -connect or -proxy is specified
if (SoftSetBoolArg("-listen", true))
LogPrintf("AppInit2 : parameter interaction: -bind or -whitebind set -> setting -listen=1\n");
}
if (mapArgs.count("-connect") && mapMultiArgs["-connect"].size() > 0) {
// when only connecting to trusted nodes, do not seed via DNS, or listen by default
if (SoftSetBoolArg("-dnsseed", false))
LogPrintf("AppInit2 : parameter interaction: -connect set -> setting -dnsseed=0\n");
if (SoftSetBoolArg("-listen", false))
LogPrintf("AppInit2 : parameter interaction: -connect set -> setting -listen=0\n");
}
if (mapArgs.count("-proxy")) {
// to protect privacy, do not listen by default if a default proxy server is specified
if (SoftSetBoolArg("-listen", false))
LogPrintf("%s: parameter interaction: -proxy set -> setting -listen=0\n", __func__);
// to protect privacy, do not use UPNP when a proxy is set. The user may still specify -listen=1
// to listen locally, so don't rely on this happening through -listen below.
if (SoftSetBoolArg("-upnp", false))
LogPrintf("%s: parameter interaction: -proxy set -> setting -upnp=0\n", __func__);
// to protect privacy, do not discover addresses by default
if (SoftSetBoolArg("-discover", false))
LogPrintf("AppInit2 : parameter interaction: -proxy set -> setting -discover=0\n");
}
if (!GetBoolArg("-listen", true)) {
// do not map ports or try to retrieve public IP when not listening (pointless)
if (SoftSetBoolArg("-upnp", false))
LogPrintf("AppInit2 : parameter interaction: -listen=0 -> setting -upnp=0\n");
if (SoftSetBoolArg("-discover", false))
LogPrintf("AppInit2 : parameter interaction: -listen=0 -> setting -discover=0\n");
if (SoftSetBoolArg("-listenonion", false))
LogPrintf("AppInit2 : parameter interaction: -listen=0 -> setting -listenonion=0\n");
}
if (mapArgs.count("-externalip")) {
// if an explicit public IP is specified, do not try to find others
if (SoftSetBoolArg("-discover", false))
LogPrintf("AppInit2 : parameter interaction: -externalip set -> setting -discover=0\n");
}
if (GetBoolArg("-salvagewallet", false)) {
// Rewrite just private keys: rescan to find transactions
if (SoftSetBoolArg("-rescan", true))
LogPrintf("AppInit2 : parameter interaction: -salvagewallet=1 -> setting -rescan=1\n");
}
// -zapwallettx implies a rescan
if (GetBoolArg("-zapwallettxes", false)) {
if (SoftSetBoolArg("-rescan", true))
LogPrintf("AppInit2 : parameter interaction: -zapwallettxes=<mode> -> setting -rescan=1\n");
}
if (!GetBoolArg("-enableswifttx", fEnableSwiftTX)) {
if (SoftSetArg("-swifttxdepth", "0"))
LogPrintf("AppInit2 : parameter interaction: -enableswifttx=false -> setting -nSwiftTXDepth=0\n");
}
if (mapArgs.count("-reservebalance")) {
if (!ParseMoney(mapArgs["-reservebalance"], nReserveBalance)) {
InitError(_("Invalid amount for -reservebalance=<amount>"));
return false;
}
}
// Make sure enough file descriptors are available
int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1);
nMaxConnections = GetArg("-maxconnections", 125);
nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS)), 0);
int nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS);
if (nFD < MIN_CORE_FILEDESCRIPTORS)
return InitError(_("Not enough file descriptors available."));
if (nFD - MIN_CORE_FILEDESCRIPTORS < nMaxConnections)
nMaxConnections = nFD - MIN_CORE_FILEDESCRIPTORS;
// ********************************************************* Step 3: parameter-to-internal-flags
fDebug = !mapMultiArgs["-debug"].empty();
// Special-case: if -debug=0/-nodebug is set, turn off debugging messages
const vector<string>& categories = mapMultiArgs["-debug"];
if (GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), string("0")) != categories.end())
fDebug = false;
// Check for -debugnet
if (GetBoolArg("-debugnet", false))
InitWarning(_("Warning: Unsupported argument -debugnet ignored, use -debug=net."));
// Check for -socks - as this is a privacy risk to continue, exit here
if (mapArgs.count("-socks"))
return InitError(_("Error: Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported."));
// Check for -tor - as this is a privacy risk to continue, exit here
if (GetBoolArg("-tor", false))
return InitError(_("Error: Unsupported argument -tor found, use -onion."));
// Check level must be 4 for zerocoin checks
if (mapArgs.count("-checklevel"))
return InitError(_("Error: Unsupported argument -checklevel found. Checklevel must be level 4."));
if (GetBoolArg("-benchmark", false))
InitWarning(_("Warning: Unsupported argument -benchmark ignored, use -debug=bench."));
// Checkmempool and checkblockindex default to true in regtest mode
mempool.setSanityCheck(GetBoolArg("-checkmempool", Params().DefaultConsistencyChecks()));
fCheckBlockIndex = GetBoolArg("-checkblockindex", Params().DefaultConsistencyChecks());
Checkpoints::fEnabled = GetBoolArg("-checkpoints", true);
// -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency
nScriptCheckThreads = GetArg("-par", DEFAULT_SCRIPTCHECK_THREADS);
if (nScriptCheckThreads <= 0)
nScriptCheckThreads += boost::thread::hardware_concurrency();
if (nScriptCheckThreads <= 1)
nScriptCheckThreads = 0;
else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS)
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS;
fServer = GetBoolArg("-server", false);
setvbuf(stdout, NULL, _IOLBF, 0); /// ***TODO*** do we still need this after -printtoconsole is gone?
// Staking needs a CWallet instance, so make sure wallet is enabled
#ifdef ENABLE_WALLET
bool fDisableWallet = GetBoolArg("-disablewallet", false);
if (fDisableWallet) {
#endif
if (SoftSetBoolArg("-staking", false))
LogPrintf("AppInit2 : parameter interaction: wallet functionality not enabled -> setting -staking=0\n");
#ifdef ENABLE_WALLET
}
#endif
nConnectTimeout = GetArg("-timeout", DEFAULT_CONNECT_TIMEOUT);
if (nConnectTimeout <= 0)
nConnectTimeout = DEFAULT_CONNECT_TIMEOUT;
// Fee-per-kilobyte amount considered the same as "free"
// If you are mining, be careful setting this:
// if you set it to zero then
// a transaction spammer can cheaply fill blocks using
// 1-satoshi-fee transactions. It should be set above the real
// cost to you of processing a transaction.
if (mapArgs.count("-minrelaytxfee")) {
CAmount n = 0;
if (ParseMoney(mapArgs["-minrelaytxfee"], n) && n > 0)
::minRelayTxFee = CFeeRate(n);
else
return InitError(strprintf(_("Invalid amount for -minrelaytxfee=<amount>: '%s'"), mapArgs["-minrelaytxfee"]));
}
#ifdef ENABLE_WALLET
if (mapArgs.count("-mintxfee")) {
CAmount n = 0;
if (ParseMoney(mapArgs["-mintxfee"], n) && n > 0)
CWallet::minTxFee = CFeeRate(n);
else
return InitError(strprintf(_("Invalid amount for -mintxfee=<amount>: '%s'"), mapArgs["-mintxfee"]));
}
if (mapArgs.count("-paytxfee")) {
CAmount nFeePerK = 0;
if (!ParseMoney(mapArgs["-paytxfee"], nFeePerK))
return InitError(strprintf(_("Invalid amount for -paytxfee=<amount>: '%s'"), mapArgs["-paytxfee"]));
if (nFeePerK > nHighTransactionFeeWarning)
InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction."));
payTxFee = CFeeRate(nFeePerK, 1000);
if (payTxFee < ::minRelayTxFee) {
return InitError(strprintf(_("Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)"),
mapArgs["-paytxfee"], ::minRelayTxFee.ToString()));
}
}
if (mapArgs.count("-maxtxfee")) {
CAmount nMaxFee = 0;
if (!ParseMoney(mapArgs["-maxtxfee"], nMaxFee))
return InitError(strprintf(_("Invalid amount for -maxtxfee=<amount>: '%s'"), mapArgs["-maxtxfee"]));
if (nMaxFee > nHighTransactionMaxFeeWarning)
InitWarning(_("Warning: -maxtxfee is set very high! Fees this large could be paid on a single transaction."));
maxTxFee = nMaxFee;
if (CFeeRate(maxTxFee, 1000) < ::minRelayTxFee) {
return InitError(strprintf(_("Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)"),
mapArgs["-maxtxfee"], ::minRelayTxFee.ToString()));
}
}
nTxConfirmTarget = GetArg("-txconfirmtarget", 1);
bSpendZeroConfChange = GetBoolArg("-spendzeroconfchange", false);
bdisableSystemnotifications = GetBoolArg("-disablesystemnotifications", false);
fSendFreeTransactions = GetBoolArg("-sendfreetransactions", false);
std::string strWalletFile = GetArg("-wallet", "wallet.dat");
#endif // ENABLE_WALLET
fIsBareMultisigStd = GetBoolArg("-permitbaremultisig", true) != 0;
nMaxDatacarrierBytes = GetArg("-datacarriersize", nMaxDatacarrierBytes);
fAlerts = GetBoolArg("-alerts", DEFAULT_ALERTS);
if (GetBoolArg("-peerbloomfilters", DEFAULT_PEERBLOOMFILTERS))
nLocalServices |= NODE_BLOOM;
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
// Sanity check
if (!InitSanityCheck())
return InitError(_("Initialization sanity check failed. Bone Core is shutting down."));
std::string strDataDir = GetDataDir().string();
#ifdef ENABLE_WALLET
// Wallet file must be a plain filename without a directory
if (strWalletFile != boost::filesystem::basename(strWalletFile) + boost::filesystem::extension(strWalletFile))
return InitError(strprintf(_("Wallet %s resides outside data directory %s"), strWalletFile, strDataDir));
#endif
// Make sure only a single Bone process is using the data directory.
boost::filesystem::path pathLockFile = GetDataDir() / ".lock";
FILE* file = fopen(pathLockFile.string().c_str(), "a"); // empty lock file; created if it doesn't exist.
if (file) fclose(file);
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
// Wait maximum 10 seconds if an old wallet is still running. Avoids lockup during restart
if (!lock.timed_lock(boost::get_system_time() + boost::posix_time::seconds(10)))
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bone Core is probably already running."), strDataDir));
#ifndef WIN32
CreatePidFile(GetPidFile(), getpid());
#endif
if (GetBoolArg("-shrinkdebugfile", !fDebug))
ShrinkDebugFile();
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
LogPrintf("BONE version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);
LogPrintf("Using OpenSSL version %s\n", SSLeay_version(SSLEAY_VERSION));
#ifdef ENABLE_WALLET
LogPrintf("Using BerkeleyDB version %s\n", DbEnv::version(0, 0, 0));
#endif
if (!fLogTimestamps)
LogPrintf("Startup time: %s\n", DateTimeStrFormat("%Y-%m-%d %H:%M:%S", GetTime()));
LogPrintf("Default data directory %s\n", GetDefaultDataDir().string());
LogPrintf("Using data directory %s\n", strDataDir);
LogPrintf("Using config file %s\n", GetConfigFile().string());
LogPrintf("Using at most %i connections (%i file descriptors available)\n", nMaxConnections, nFD);
std::ostringstream strErrors;
LogPrintf("Using %u threads for script verification\n", nScriptCheckThreads);
if (nScriptCheckThreads) {
for (int i = 0; i < nScriptCheckThreads - 1; i++)
threadGroup.create_thread(&ThreadScriptCheck);
}
if (mapArgs.count("-sporkkey")) // spork priv key
{
if (!sporkManager.SetPrivKey(GetArg("-sporkkey", "")))
return InitError(_("Unable to sign spork message, wrong key?"));
}
// Start the lightweight task scheduler thread
CScheduler::Function serviceLoop = boost::bind(&CScheduler::serviceQueue, &scheduler);
threadGroup.create_thread(boost::bind(&TraceThread<CScheduler::Function>, "scheduler", serviceLoop));
/* Start the RPC server already. It will be started in "warmup" mode
* and not really process calls already (but it will signify connections
* that the server is there and will be ready later). Warmup mode will
* be disabled when initialisation is finished.
*/
if (fServer) {
uiInterface.InitMessage.connect(SetRPCWarmupStatus);
if (!AppInitServers(threadGroup))
return InitError(_("Unable to start HTTP server. See debug log for details."));
}
int64_t nStart;
// ********************************************************* Step 5: Backup wallet and verify wallet database integrity
#ifdef ENABLE_WALLET
if (!fDisableWallet) {
filesystem::path backupDir = GetDataDir() / "backups";
if (!filesystem::exists(backupDir)) {
// Always create backup folder to not confuse the operating system's file browser
filesystem::create_directories(backupDir);
}
nWalletBackups = GetArg("-createwalletbackups", 10);
nWalletBackups = std::max(0, std::min(10, nWalletBackups));
if (nWalletBackups > 0) {
if (filesystem::exists(backupDir)) {
// Create backup of the wallet
std::string dateTimeStr = DateTimeStrFormat(".%Y-%m-%d-%H-%M", GetTime());
std::string backupPathStr = backupDir.string();
backupPathStr += "/" + strWalletFile;
std::string sourcePathStr = GetDataDir().string();
sourcePathStr += "/" + strWalletFile;
boost::filesystem::path sourceFile = sourcePathStr;
boost::filesystem::path backupFile = backupPathStr + dateTimeStr;
sourceFile.make_preferred();
backupFile.make_preferred();
if (boost::filesystem::exists(sourceFile)) {
#if BOOST_VERSION >= 158000
try {
boost::filesystem::copy_file(sourceFile, backupFile);
LogPrintf("Creating backup of %s -> %s\n", sourceFile, backupFile);
} catch (boost::filesystem::filesystem_error& error) {
LogPrintf("Failed to create backup %s\n", error.what());
}
#else
std::ifstream src(sourceFile.string(), std::ios::binary);
std::ofstream dst(backupFile.string(), std::ios::binary);
dst << src.rdbuf();
#endif
}
// Keep only the last 10 backups, including the new one of course
typedef std::multimap<std::time_t, boost::filesystem::path> folder_set_t;
folder_set_t folder_set;
boost::filesystem::directory_iterator end_iter;
boost::filesystem::path backupFolder = backupDir.string();
backupFolder.make_preferred();
// Build map of backup files for current(!) wallet sorted by last write time
boost::filesystem::path currentFile;
for (boost::filesystem::directory_iterator dir_iter(backupFolder); dir_iter != end_iter; ++dir_iter) {
// Only check regular files
if (boost::filesystem::is_regular_file(dir_iter->status())) {
currentFile = dir_iter->path().filename();
// Only add the backups for the current wallet, e.g. wallet.dat.*
if (dir_iter->path().stem().string() == strWalletFile) {
folder_set.insert(folder_set_t::value_type(boost::filesystem::last_write_time(dir_iter->path()), *dir_iter));
}
}
}
// Loop backward through backup files and keep the N newest ones (1 <= N <= 10)
int counter = 0;
BOOST_REVERSE_FOREACH (PAIRTYPE(const std::time_t, boost::filesystem::path) file, folder_set) {
counter++;
if (counter > nWalletBackups) {
// More than nWalletBackups backups: delete oldest one(s)
try {
boost::filesystem::remove(file.second);
LogPrintf("Old backup deleted: %s\n", file.second);
} catch (boost::filesystem::filesystem_error& error) {
LogPrintf("Failed to delete backup %s\n", error.what());
}
}
}
}
}
if (GetBoolArg("-resync", false)) {
uiInterface.InitMessage(_("Preparing for resync..."));
// Delete the local blockchain folders to force a resync from scratch to get a consitent blockchain-state
filesystem::path blocksDir = GetDataDir() / "blocks";
filesystem::path chainstateDir = GetDataDir() / "chainstate";
filesystem::path sporksDir = GetDataDir() / "sporks";
filesystem::path zerocoinDir = GetDataDir() / "zerocoin";
LogPrintf("Deleting blockchain folders blocks, chainstate, sporks and zerocoin\n");
// We delete in 4 individual steps in case one of the folder is missing already
try {
if (filesystem::exists(blocksDir)){
boost::filesystem::remove_all(blocksDir);
LogPrintf("-resync: folder deleted: %s\n", blocksDir.string().c_str());
}
if (filesystem::exists(chainstateDir)){
boost::filesystem::remove_all(chainstateDir);
LogPrintf("-resync: folder deleted: %s\n", chainstateDir.string().c_str());
}
if (filesystem::exists(sporksDir)){
boost::filesystem::remove_all(sporksDir);
LogPrintf("-resync: folder deleted: %s\n", sporksDir.string().c_str());
}
if (filesystem::exists(zerocoinDir)){
boost::filesystem::remove_all(zerocoinDir);
LogPrintf("-resync: folder deleted: %s\n", zerocoinDir.string().c_str());
}
} catch (boost::filesystem::filesystem_error& error) {
LogPrintf("Failed to delete blockchain folders %s\n", error.what());
}
}
LogPrintf("Using wallet %s\n", strWalletFile);
uiInterface.InitMessage(_("Verifying wallet..."));
if (!bitdb.Open(GetDataDir())) {
// try moving the database env out of the way
boost::filesystem::path pathDatabase = GetDataDir() / "database";
boost::filesystem::path pathDatabaseBak = GetDataDir() / strprintf("database.%d.bak", GetTime());
try {
boost::filesystem::rename(pathDatabase, pathDatabaseBak);
LogPrintf("Moved old %s to %s. Retrying.\n", pathDatabase.string(), pathDatabaseBak.string());
} catch (boost::filesystem::filesystem_error& error) {
// failure is ok (well, not really, but it's not worse than what we started with)
}
// try again
if (!bitdb.Open(GetDataDir())) {
// if it still fails, it probably means we can't even create the database env
string msg = strprintf(_("Error initializing wallet database environment %s!"), strDataDir);
return InitError(msg);
}
}
if (GetBoolArg("-salvagewallet", false)) {
// Recover readable keypairs:
if (!CWalletDB::Recover(bitdb, strWalletFile, true))
return false;
}
if (filesystem::exists(GetDataDir() / strWalletFile)) {
CDBEnv::VerifyResult r = bitdb.Verify(strWalletFile, CWalletDB::Recover);
if (r == CDBEnv::RECOVER_OK) {
string msg = strprintf(_("Warning: wallet.dat corrupt, data salvaged!"
" Original wallet.dat saved as wallet.{timestamp}.bak in %s; if"
" your balance or transactions are incorrect you should"
" restore from a backup."),
strDataDir);
InitWarning(msg);
}
if (r == CDBEnv::RECOVER_FAIL)
return InitError(_("wallet.dat corrupt, salvage failed"));
}
} // (!fDisableWallet)
#endif // ENABLE_WALLET
// ********************************************************* Step 6: network initialization
RegisterNodeSignals(GetNodeSignals());
if (mapArgs.count("-onlynet")) {
std::set<enum Network> nets;
BOOST_FOREACH (std::string snet, mapMultiArgs["-onlynet"]) {
enum Network net = ParseNetwork(snet);
if (net == NET_UNROUTABLE)
return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet));
nets.insert(net);
}
for (int n = 0; n < NET_MAX; n++) {
enum Network net = (enum Network)n;
if (!nets.count(net))
SetLimited(net);
}
}
if (mapArgs.count("-whitelist")) {
BOOST_FOREACH (const std::string& net, mapMultiArgs["-whitelist"]) {
CSubNet subnet(net);
if (!subnet.IsValid())
return InitError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net));
CNode::AddWhitelistedRange(subnet);
}
}
// Check for host lookup allowed before parsing any network related parameters
fNameLookup = GetBoolArg("-dns", DEFAULT_NAME_LOOKUP);
bool proxyRandomize = GetBoolArg("-proxyrandomize", true);
// -proxy sets a proxy for all outgoing network traffic
// -noproxy (or -proxy=0) as well as the empty string can be used to not set a proxy, this is the default
std::string proxyArg = GetArg("-proxy", "");
SetLimited(NET_TOR);
if (proxyArg != "" && proxyArg != "0") {
CService proxyAddr;
if (!Lookup(proxyArg.c_str(), proxyAddr, 9050, fNameLookup)) {
return InitError(strprintf(_("Lookup(): Invalid -proxy address or hostname: '%s'"), proxyArg));
}
proxyType addrProxy = proxyType(proxyAddr, proxyRandomize);
if (!addrProxy.IsValid())
return InitError(strprintf(_("isValid(): Invalid -proxy address or hostname: '%s'"), proxyArg));
SetProxy(NET_IPV4, addrProxy);
SetProxy(NET_IPV6, addrProxy);
SetProxy(NET_TOR, addrProxy);
SetNameProxy(addrProxy);
SetLimited(NET_TOR, false); // by default, -proxy sets onion as reachable, unless -noonion later
}
// -onion can be used to set only a proxy for .onion, or override normal proxy for .onion addresses
// -noonion (or -onion=0) disables connecting to .onion entirely
// An empty string is used to not override the onion proxy (in which case it defaults to -proxy set above, or none)
std::string onionArg = GetArg("-onion", "");
if (onionArg != "") {
if (onionArg == "0") { // Handle -noonion/-onion=0
SetLimited(NET_TOR); // set onions as unreachable
} else {
CService onionProxy;
if (!Lookup(onionArg.c_str(), onionProxy, 9050, fNameLookup)) {
return InitError(strprintf(_("Invalid -onion address or hostname: '%s'"), onionArg));
}
proxyType addrOnion = proxyType(onionProxy, proxyRandomize);
if (!addrOnion.IsValid())
return InitError(strprintf(_("Invalid -onion address or hostname: '%s'"), onionArg));
SetProxy(NET_TOR, addrOnion);
SetLimited(NET_TOR, false);
}
}
// see Step 2: parameter interactions for more information about these
fListen = GetBoolArg("-listen", DEFAULT_LISTEN);
fDiscover = GetBoolArg("-discover", true);
bool fBound = false;
if (fListen) {
if (mapArgs.count("-bind") || mapArgs.count("-whitebind")) {
BOOST_FOREACH (std::string strBind, mapMultiArgs["-bind"]) {
CService addrBind;
if (!Lookup(strBind.c_str(), addrBind, GetListenPort(), false))
return InitError(strprintf(_("Cannot resolve -bind address: '%s'"), strBind));
fBound |= Bind(addrBind, (BF_EXPLICIT | BF_REPORT_ERROR));
}
BOOST_FOREACH (std::string strBind, mapMultiArgs["-whitebind"]) {
CService addrBind;
if (!Lookup(strBind.c_str(), addrBind, 0, false))
return InitError(strprintf(_("Cannot resolve -whitebind address: '%s'"), strBind));
if (addrBind.GetPort() == 0)
return InitError(strprintf(_("Need to specify a port with -whitebind: '%s'"), strBind));
fBound |= Bind(addrBind, (BF_EXPLICIT | BF_REPORT_ERROR | BF_WHITELIST));
}
} else {
struct in_addr inaddr_any;
inaddr_any.s_addr = INADDR_ANY;
fBound |= Bind(CService(in6addr_any, GetListenPort()), BF_NONE);
fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound ? BF_REPORT_ERROR : BF_NONE);
}
if (!fBound)
return InitError(_("Failed to listen on any port. Use -listen=0 if you want this."));
}
if (mapArgs.count("-externalip")) {
BOOST_FOREACH (string strAddr, mapMultiArgs["-externalip"]) {
CService addrLocal(strAddr, GetListenPort(), fNameLookup);
if (!addrLocal.IsValid())
return InitError(strprintf(_("Cannot resolve -externalip address: '%s'"), strAddr));
AddLocal(CService(strAddr, GetListenPort(), fNameLookup), LOCAL_MANUAL);
}
}
BOOST_FOREACH (string strDest, mapMultiArgs["-seednode"])
AddOneShot(strDest);
#if ENABLE_ZMQ
pzmqNotificationInterface = CZMQNotificationInterface::CreateWithArguments(mapArgs);
if (pzmqNotificationInterface) {
RegisterValidationInterface(pzmqNotificationInterface);
}
#endif
// ********************************************************* Step 7: load block chain
fReindex = GetBoolArg("-reindex", false);
// Upgrading to 0.8; hard-link the old blknnnn.dat files into /blocks/
filesystem::path blocksDir = GetDataDir() / "blocks";
if (!filesystem::exists(blocksDir)) {
filesystem::create_directories(blocksDir);
bool linked = false;
for (unsigned int i = 1; i < 10000; i++) {
filesystem::path source = GetDataDir() / strprintf("blk%04u.dat", i);
if (!filesystem::exists(source)) break;
filesystem::path dest = blocksDir / strprintf("blk%05u.dat", i - 1);
try {
filesystem::create_hard_link(source, dest);
LogPrintf("Hardlinked %s -> %s\n", source.string(), dest.string());
linked = true;
} catch (filesystem::filesystem_error& e) {
// Note: hardlink creation failing is not a disaster, it just means
// blocks will get re-downloaded from peers.
LogPrintf("Error hardlinking blk%04u.dat : %s\n", i, e.what());
break;
}
}
if (linked) {
fReindex = true;
}
}
// cache size calculations
size_t nTotalCache = (GetArg("-dbcache", nDefaultDbCache) << 20);
if (nTotalCache < (nMinDbCache << 20))
nTotalCache = (nMinDbCache << 20); // total cache cannot be less than nMinDbCache
else if (nTotalCache > (nMaxDbCache << 20))
nTotalCache = (nMaxDbCache << 20); // total cache cannot be greater than nMaxDbCache
size_t nBlockTreeDBCache = nTotalCache / 8;
if (nBlockTreeDBCache > (1 << 21) && !GetBoolArg("-txindex", true))
nBlockTreeDBCache = (1 << 21); // block tree db cache shouldn't be larger than 2 MiB
nTotalCache -= nBlockTreeDBCache;
size_t nCoinDBCache = nTotalCache / 2; // use half of the remaining cache for coindb cache
nTotalCache -= nCoinDBCache;
nCoinCacheSize = nTotalCache / 300; // coins in memory require around 300 bytes
bool fLoaded = false;
while (!fLoaded) {
bool fReset = fReindex;
std::string strLoadError;
uiInterface.InitMessage(_("Loading block index..."));
nStart = GetTimeMillis();
do {
try {
UnloadBlockIndex();
delete pcoinsTip;
delete pcoinsdbview;
delete pcoinscatcher;
delete pblocktree;
delete zerocoinDB;
delete pSporkDB;
//BONE specific: zerocoin and spork DB's
zerocoinDB = new CZerocoinDB(0, false, fReindex);
pSporkDB = new CSporkDB(0, false, false);
pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReindex);
pcoinsdbview = new CCoinsViewDB(nCoinDBCache, false, fReindex);
pcoinscatcher = new CCoinsViewErrorCatcher(pcoinsdbview);
pcoinsTip = new CCoinsViewCache(pcoinscatcher);
if (fReindex)
pblocktree->WriteReindexing(true);
// BONE: load previous sessions sporks if we have them.
uiInterface.InitMessage(_("Loading sporks..."));
LoadSporksFromDB();
uiInterface.InitMessage(_("Loading block index..."));
string strBlockIndexError = "";
if (!LoadBlockIndex(strBlockIndexError)) {
strLoadError = _("Error loading block database");
strLoadError = strprintf("%s : %s", strLoadError, strBlockIndexError);
break;
}
// If the loaded chain has a wrong genesis, bail out immediately
// (we're likely using a testnet datadir, or the other way around).
if (!mapBlockIndex.empty() && mapBlockIndex.count(Params().HashGenesisBlock()) == 0)
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?"));
// Initialize the block index (no-op if non-empty database was already loaded)
if (!InitBlockIndex()) {
strLoadError = _("Error initializing block database");
break;
}
// Check for changed -txindex state
if (fTxIndex != GetBoolArg("-txindex", true)) {
strLoadError = _("You need to rebuild the database using -reindex to change -txindex");
break;
}
// Populate list of invalid/fraudulent outpoints that are banned from the chain
PopulateInvalidOutPointMap();
// Recalculate money supply for blocks that are impacted by accounting issue after zerocoin activation
if (GetBoolArg("-reindexmoneysupply", false)) {
if (chainActive.Height() > Params().Zerocoin_StartHeight()) {
RecalculateXIONMinted();
RecalculateXIONSpent();
}
RecalculateBONESupply(1);
}
// Force recalculation of accumulators.
if (GetBoolArg("-reindexaccumulators", false)) {
CBlockIndex* pindex = chainActive[Params().Zerocoin_StartHeight()];
while (pindex->nHeight < chainActive.Height()) {
if (!count(listAccCheckpointsNoDB.begin(), listAccCheckpointsNoDB.end(), pindex->nAccumulatorCheckpoint))
listAccCheckpointsNoDB.emplace_back(pindex->nAccumulatorCheckpoint);
pindex = chainActive.Next(pindex);
}
}
// BONE: recalculate Accumulator Checkpoints that failed to database properly
if (!listAccCheckpointsNoDB.empty()) {
uiInterface.InitMessage(_("Calculating missing accumulators..."));
LogPrintf("%s : finding missing checkpoints\n", __func__);
string strError;
if (!ReindexAccumulators(listAccCheckpointsNoDB, strError))
return InitError(strError);
}
uiInterface.InitMessage(_("Verifying blocks..."));
// Flag sent to validation code to let it know it can skip certain checks
fVerifyingBlocks = true;
// Zerocoin must check at level 4
if (!CVerifyDB().VerifyDB(pcoinsdbview, 4, GetArg("-checkblocks", 100))) {
strLoadError = _("Corrupted block database detected");
fVerifyingBlocks = false;
break;
}
} catch (std::exception& e) {
if (fDebug) LogPrintf("%s\n", e.what());
strLoadError = _("Error opening block database");
fVerifyingBlocks = false;
break;
}
fVerifyingBlocks = false;
fLoaded = true;
} while (false);
if (!fLoaded) {
// first suggest a reindex
if (!fReset) {
bool fRet = uiInterface.ThreadSafeMessageBox(
strLoadError + ".\n\n" + _("Do you want to rebuild the block database now?"),
"", CClientUIInterface::MSG_ERROR | CClientUIInterface::BTN_ABORT);
if (fRet) {
fReindex = true;
fRequestShutdown = false;
} else {
LogPrintf("Aborted block database rebuild. Exiting.\n");
return false;
}
} else {
return InitError(strLoadError);
}
}
}
// As LoadBlockIndex can take several minutes, it's possible the user
// requested to kill the GUI during the last operation. If so, exit.
// As the program has not fully started yet, Shutdown() is possibly overkill.
if (fRequestShutdown) {
LogPrintf("Shutdown requested. Exiting.\n");
return false;
}
LogPrintf(" block index %15dms\n", GetTimeMillis() - nStart);
boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
CAutoFile est_filein(fopen(est_path.string().c_str(), "rb"), SER_DISK, CLIENT_VERSION);
// Allowed to fail as this file IS missing on first startup.
if (!est_filein.IsNull())
mempool.ReadFeeEstimates(est_filein);
fFeeEstimatesInitialized = true;
// ********************************************************* Step 8: load wallet
#ifdef ENABLE_WALLET
if (fDisableWallet) {
pwalletMain = NULL;
LogPrintf("Wallet disabled!\n");
} else {
// needed to restore wallet transaction meta data after -zapwallettxes
std::vector<CWalletTx> vWtx;
if (GetBoolArg("-zapwallettxes", false)) {
uiInterface.InitMessage(_("Zapping all transactions from wallet..."));
pwalletMain = new CWallet(strWalletFile);
DBErrors nZapWalletRet = pwalletMain->ZapWalletTx(vWtx);
if (nZapWalletRet != DB_LOAD_OK) {
uiInterface.InitMessage(_("Error loading wallet.dat: Wallet corrupted"));
return false;
}
delete pwalletMain;
pwalletMain = NULL;
}
uiInterface.InitMessage(_("Loading wallet..."));
fVerifyingBlocks = true;
nStart = GetTimeMillis();
bool fFirstRun = true;
pwalletMain = new CWallet(strWalletFile);
DBErrors nLoadWalletRet = pwalletMain->LoadWallet(fFirstRun);
if (nLoadWalletRet != DB_LOAD_OK) {
if (nLoadWalletRet == DB_CORRUPT)
strErrors << _("Error loading wallet.dat: Wallet corrupted") << "\n";
else if (nLoadWalletRet == DB_NONCRITICAL_ERROR) {
string msg(_("Warning: error reading wallet.dat! All keys read correctly, but transaction data"
" or address book entries might be missing or incorrect."));
InitWarning(msg);
} else if (nLoadWalletRet == DB_TOO_NEW)
strErrors << _("Error loading wallet.dat: Wallet requires newer version of Bone Core") << "\n";
else if (nLoadWalletRet == DB_NEED_REWRITE) {
strErrors << _("Wallet needed to be rewritten: restart Bone Core to complete") << "\n";
LogPrintf("%s", strErrors.str());
return InitError(strErrors.str());
} else
strErrors << _("Error loading wallet.dat") << "\n";
}
if (GetBoolArg("-upgradewallet", fFirstRun)) {
int nMaxVersion = GetArg("-upgradewallet", 0);
if (nMaxVersion == 0) // the -upgradewallet without argument case
{
LogPrintf("Performing wallet upgrade to %i\n", FEATURE_LATEST);
nMaxVersion = CLIENT_VERSION;
pwalletMain->SetMinVersion(FEATURE_LATEST); // permanently upgrade the wallet immediately
} else
LogPrintf("Allowing wallet upgrade up to %i\n", nMaxVersion);
if (nMaxVersion < pwalletMain->GetVersion())
strErrors << _("Cannot downgrade wallet") << "\n";
pwalletMain->SetMaxVersion(nMaxVersion);
}
if (fFirstRun) {
// Create new keyUser and set as default key
RandAddSeedPerfmon();
CPubKey newDefaultKey;
if (pwalletMain->GetKeyFromPool(newDefaultKey)) {
pwalletMain->SetDefaultKey(newDefaultKey);
if (!pwalletMain->SetAddressBook(pwalletMain->vchDefaultKey.GetID(), "", "receive"))
strErrors << _("Cannot write default address") << "\n";
}
pwalletMain->SetBestChain(chainActive.GetLocator());
}
LogPrintf("%s", strErrors.str());
LogPrintf(" wallet %15dms\n", GetTimeMillis() - nStart);
RegisterValidationInterface(pwalletMain);
CBlockIndex* pindexRescan = chainActive.Tip();
if (GetBoolArg("-rescan", false))
pindexRescan = chainActive.Genesis();
else {
CWalletDB walletdb(strWalletFile);
CBlockLocator locator;
if (walletdb.ReadBestBlock(locator))
pindexRescan = FindForkInGlobalIndex(chainActive, locator);
else
pindexRescan = chainActive.Genesis();
}
if (chainActive.Tip() && chainActive.Tip() != pindexRescan) {
uiInterface.InitMessage(_("Rescanning..."));
LogPrintf("Rescanning last %i blocks (from block %i)...\n", chainActive.Height() - pindexRescan->nHeight, pindexRescan->nHeight);
nStart = GetTimeMillis();
pwalletMain->ScanForWalletTransactions(pindexRescan, true);
LogPrintf(" rescan %15dms\n", GetTimeMillis() - nStart);
pwalletMain->SetBestChain(chainActive.GetLocator());
nWalletDBUpdated++;
// Restore wallet transaction metadata after -zapwallettxes=1
if (GetBoolArg("-zapwallettxes", false) && GetArg("-zapwallettxes", "1") != "2") {
BOOST_FOREACH (const CWalletTx& wtxOld, vWtx) {
uint256 hash = wtxOld.GetHash();
std::map<uint256, CWalletTx>::iterator mi = pwalletMain->mapWallet.find(hash);
if (mi != pwalletMain->mapWallet.end()) {
const CWalletTx* copyFrom = &wtxOld;
CWalletTx* copyTo = &mi->second;
copyTo->mapValue = copyFrom->mapValue;
copyTo->vOrderForm = copyFrom->vOrderForm;
copyTo->nTimeReceived = copyFrom->nTimeReceived;
copyTo->nTimeSmart = copyFrom->nTimeSmart;
copyTo->fFromMe = copyFrom->fFromMe;
copyTo->strFromAccount = copyFrom->strFromAccount;
copyTo->nOrderPos = copyFrom->nOrderPos;
copyTo->WriteToDisk();
}
}
}
}
fVerifyingBlocks = false;
bool fEnableXIONBackups = GetBoolArg("-backupxion", true);
pwalletMain->setXIONAutoBackups(fEnableXIONBackups);
} // (!fDisableWallet)
#else // ENABLE_WALLET
LogPrintf("No wallet compiled in!\n");
#endif // !ENABLE_WALLET
// ********************************************************* Step 9: import blocks
if (mapArgs.count("-blocknotify"))
uiInterface.NotifyBlockTip.connect(BlockNotifyCallback);
if (mapArgs.count("-blocksizenotify"))
uiInterface.NotifyBlockSize.connect(BlockSizeNotifyCallback);
// scan for better chains in the block chain database, that are not yet connected in the active best chain
CValidationState state;
if (!ActivateBestChain(state))
strErrors << "Failed to connect best block";
std::vector<boost::filesystem::path> vImportFiles;
if (mapArgs.count("-loadblock")) {
BOOST_FOREACH (string strFile, mapMultiArgs["-loadblock"])
vImportFiles.push_back(strFile);
}
threadGroup.create_thread(boost::bind(&ThreadImport, vImportFiles));
if (chainActive.Tip() == NULL) {
LogPrintf("Waiting for genesis block to be imported...\n");
while (!fRequestShutdown && chainActive.Tip() == NULL)
MilliSleep(10);
}
// ********************************************************* Step 10: setup ObfuScation
uiInterface.InitMessage(_("Loading masternode cache..."));
CMasternodeDB mndb;
CMasternodeDB::ReadResult readResult = mndb.Read(mnodeman);
if (readResult == CMasternodeDB::FileError)
LogPrintf("Missing masternode cache file - mncache.dat, will try to recreate\n");
else if (readResult != CMasternodeDB::Ok) {
LogPrintf("Error reading mncache.dat: ");
if (readResult == CMasternodeDB::IncorrectFormat)
LogPrintf("magic is ok but data has invalid format, will try to recreate\n");
else
LogPrintf("file format is unknown or invalid, please fix it manually\n");
}
uiInterface.InitMessage(_("Loading budget cache..."));
CBudgetDB budgetdb;
CBudgetDB::ReadResult readResult2 = budgetdb.Read(budget);
if (readResult2 == CBudgetDB::FileError)
LogPrintf("Missing budget cache - budget.dat, will try to recreate\n");
else if (readResult2 != CBudgetDB::Ok) {
LogPrintf("Error reading budget.dat: ");
if (readResult2 == CBudgetDB::IncorrectFormat)
LogPrintf("magic is ok but data has invalid format, will try to recreate\n");
else
LogPrintf("file format is unknown or invalid, please fix it manually\n");
}
//flag our cached items so we send them to our peers
budget.ResetSync();
budget.ClearSeen();
uiInterface.InitMessage(_("Loading masternode payment cache..."));
CMasternodePaymentDB mnpayments;
CMasternodePaymentDB::ReadResult readResult3 = mnpayments.Read(masternodePayments);
if (readResult3 == CMasternodePaymentDB::FileError)
LogPrintf("Missing masternode payment cache - mnpayments.dat, will try to recreate\n");
else if (readResult3 != CMasternodePaymentDB::Ok) {
LogPrintf("Error reading mnpayments.dat: ");
if (readResult3 == CMasternodePaymentDB::IncorrectFormat)
LogPrintf("magic is ok but data has invalid format, will try to recreate\n");
else
LogPrintf("file format is unknown or invalid, please fix it manually\n");
}
fMasterNode = GetBoolArg("-masternode", false);
if ((fMasterNode || masternodeConfig.getCount() > -1) && fTxIndex == false) {
return InitError("Enabling Masternode support requires turning on transaction indexing."
"Please add txindex=1 to your configuration and start with -reindex");
}
if (fMasterNode) {
LogPrintf("IS MASTER NODE\n");
strMasterNodeAddr = GetArg("-masternodeaddr", "");
LogPrintf(" addr %s\n", strMasterNodeAddr.c_str());
if (!strMasterNodeAddr.empty()) {
CService addrTest = CService(strMasterNodeAddr);
if (!addrTest.IsValid()) {
return InitError("Invalid -masternodeaddr address: " + strMasterNodeAddr);
}
}
strMasterNodePrivKey = GetArg("-masternodeprivkey", "");
if (!strMasterNodePrivKey.empty()) {
std::string errorMessage;
CKey key;
CPubKey pubkey;
if (!obfuScationSigner.SetKey(strMasterNodePrivKey, errorMessage, key, pubkey)) {
return InitError(_("Invalid masternodeprivkey. Please see documenation."));
}
activeMasternode.pubKeyMasternode = pubkey;
} else {
return InitError(_("You must specify a masternodeprivkey in the configuration. Please see documentation for help."));
}
}
//get the mode of budget voting for this masternode
strBudgetMode = GetArg("-budgetvotemode", "auto");
if (GetBoolArg("-mnconflock", true) && pwalletMain) {
LOCK(pwalletMain->cs_wallet);
LogPrintf("Locking Masternodes:\n");
uint256 mnTxHash;
BOOST_FOREACH (CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) {
LogPrintf(" %s %s\n", mne.getTxHash(), mne.getOutputIndex());
mnTxHash.SetHex(mne.getTxHash());
COutPoint outpoint = COutPoint(mnTxHash, boost::lexical_cast<unsigned int>(mne.getOutputIndex()));
pwalletMain->LockCoin(outpoint);
}
}
fEnableZeromint = false;//GetBoolArg("-enablezeromint", true);
nZeromintPercentage = 0;//GetArg("-zeromintpercentage", 10);
if (nZeromintPercentage > 100) nZeromintPercentage = 100;
if (nZeromintPercentage < 1) nZeromintPercentage = 0;
nPreferredDenom = GetArg("-preferredDenom", 0);
if (nPreferredDenom != 0 && nPreferredDenom != 1 && nPreferredDenom != 5 && nPreferredDenom != 10 && nPreferredDenom != 50 &&
nPreferredDenom != 100 && nPreferredDenom != 500 && nPreferredDenom != 1000 && nPreferredDenom != 5000){
LogPrintf("-preferredDenom: invalid denomination parameter %d. Default value used\n", nPreferredDenom);
nPreferredDenom = 0;
}
// XX42 Remove/refactor code below. Until then provide safe defaults
nAnonymizeBONEAmount = 2;
// nLiquidityProvider = GetArg("-liquidityprovider", 0); //0-100
// if (nLiquidityProvider != 0) {
// obfuScationPool.SetMinBlockSpacing(std::min(nLiquidityProvider, 100) * 15);
// fEnableZeromint = true;
// nZeromintPercentage = 99999;
// }
//
// nAnonymizeBONEAmount = GetArg("-anonymizeionamount", 0);
// if (nAnonymizeBONEAmount > 999999) nAnonymizeBONEAmount = 999999;
// if (nAnonymizeBONEAmount < 2) nAnonymizeBONEAmount = 2;
fEnableSwiftTX = GetBoolArg("-enableswifttx", fEnableSwiftTX);
nSwiftTXDepth = GetArg("-swifttxdepth", nSwiftTXDepth);
nSwiftTXDepth = std::min(std::max(nSwiftTXDepth, 0), 60);
//lite mode disables all Masternode and Obfuscation related functionality
fLiteMode = GetBoolArg("-litemode", false);
if (fMasterNode && fLiteMode) {
return InitError("You can not start a masternode in litemode");
}
LogPrintf("fLiteMode %d\n", fLiteMode);
LogPrintf("nSwiftTXDepth %d\n", nSwiftTXDepth);
LogPrintf("Anonymize Bone Amount %d\n", nAnonymizeBONEAmount);
LogPrintf("Budget Mode %s\n", strBudgetMode.c_str());
/* Denominations
A note about convertability. Within Obfuscation pools, each denomination
is convertable to another.
For example:
1 BONE+1000 == (.1 BONE+100)*10
10 BONE+10000 == (1 BONE+1000)*10
*/
obfuScationDenominations.push_back((10000 * COIN) + 10000000);
obfuScationDenominations.push_back((1000 * COIN) + 1000000);
obfuScationDenominations.push_back((100 * COIN) + 100000);
obfuScationDenominations.push_back((10 * COIN) + 10000);
obfuScationDenominations.push_back((1 * COIN) + 1000);
obfuScationDenominations.push_back((.1 * COIN) + 100);
/* Disabled till we need them
obfuScationDenominations.push_back( (.01 * COIN)+10 );
obfuScationDenominations.push_back( (.001 * COIN)+1 );
*/
obfuScationPool.InitCollateralAddress();
threadGroup.create_thread(boost::bind(&ThreadCheckObfuScationPool));
// ********************************************************* Step 11: start node
if (!CheckDiskSpace())
return false;
if (!strErrors.str().empty())
return InitError(strErrors.str());
RandAddSeedPerfmon();
//// debug print
LogPrintf("mapBlockIndex.size() = %u\n", mapBlockIndex.size());
LogPrintf("chainActive.Height() = %d\n", chainActive.Height());
#ifdef ENABLE_WALLET
LogPrintf("setKeyPool.size() = %u\n", pwalletMain ? pwalletMain->setKeyPool.size() : 0);
LogPrintf("mapWallet.size() = %u\n", pwalletMain ? pwalletMain->mapWallet.size() : 0);
LogPrintf("mapAddressBook.size() = %u\n", pwalletMain ? pwalletMain->mapAddressBook.size() : 0);
#endif
if (GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION))
StartTorControl(threadGroup);
StartNode(threadGroup, scheduler);
#ifdef ENABLE_WALLET
// Generate coins in the background
if (pwalletMain)
GenerateBitcoins(GetBoolArg("-gen", false), pwalletMain, GetArg("-genproclimit", 1));
#endif
// ********************************************************* Step 12: finished
SetRPCWarmupFinished();
uiInterface.InitMessage(_("Done loading"));
#ifdef ENABLE_WALLET
if (pwalletMain) {
// Add wallet transactions that aren't already in a block to mapTransactions
pwalletMain->ReacceptWalletTransactions();
// Run a thread to flush wallet periodically
threadGroup.create_thread(boost::bind(&ThreadFlushWalletDB, boost::ref(pwalletMain->strWalletFile)));
}
#endif
return !fRequestShutdown;
}
| [
"akuma@mud.com.cn"
] | akuma@mud.com.cn |
96da089444a7d037f3069bc67086ca1a30ebc078 | 1cc17e9f4c3b6fba21aef3af5e900c80cfa98051 | /chrome/browser/ui/startup/startup_browser_creator_impl.h | 3a89e00e9af61018de2e0b40af8432f98b69a572 | [
"BSD-3-Clause"
] | permissive | sharpglasses/BitPop | 2643a39b76ab71d1a2ed5b9840217b0e9817be06 | 1fae4ecfb965e163f6ce154b3988b3181678742a | refs/heads/master | 2021-01-21T16:04:02.854428 | 2013-03-22T02:12:27 | 2013-03-22T02:12:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,266 | 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 CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_
#define CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_
#include <string>
#include <vector>
#include "base/file_path.h"
#include "base/gtest_prod_util.h"
#include "chrome/browser/ui/startup/startup_tab.h"
#include "chrome/browser/ui/startup/startup_types.h"
#include "googleurl/src/gurl.h"
class Browser;
class CommandLine;
class FilePath;
class Profile;
class StartupBrowserCreator;
namespace content {
class WebContents;
}
// Assists launching the application and appending the initial tabs for a
// browser window.
class StartupBrowserCreatorImpl {
public:
// There are two ctors. The first one implies a NULL browser_creator object
// and thus no access to distribution-specific first-run behaviors. The
// second one is always called when the browser starts even if it is not
// the first run. |is_first_run| indicates that this is a new profile.
StartupBrowserCreatorImpl(const FilePath& cur_dir,
const CommandLine& command_line,
chrome::startup::IsFirstRun is_first_run);
StartupBrowserCreatorImpl(const FilePath& cur_dir,
const CommandLine& command_line,
StartupBrowserCreator* browser_creator,
chrome::startup::IsFirstRun is_first_run);
~StartupBrowserCreatorImpl();
// Creates the necessary windows for startup. Returns true on success,
// false on failure. process_startup is true if Chrome is just
// starting up. If process_startup is false, it indicates Chrome was
// already running and the user wants to launch another instance.
bool Launch(Profile* profile,
const std::vector<GURL>& urls_to_open,
bool process_startup);
// Convenience for OpenTabsInBrowser that converts |urls| into a set of
// Tabs.
Browser* OpenURLsInBrowser(Browser* browser,
bool process_startup,
const std::vector<GURL>& urls);
// Creates a tab for each of the Tabs in |tabs|. If browser is non-null
// and a tabbed browser, the tabs are added to it. Otherwise a new tabbed
// browser is created and the tabs are added to it. The browser the tabs
// are added to is returned, which is either |browser| or the newly created
// browser.
Browser* OpenTabsInBrowser(Browser* browser,
bool process_startup,
const StartupTabs& tabs);
private:
FRIEND_TEST_ALL_PREFIXES(BrowserTest, RestorePinnedTabs);
FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch);
// If the process was launched with the web application command line flags,
// e.g. --app=http://www.google.com/ or --app_id=... return true.
// In this case |app_url| or |app_id| are populated if they're non-null.
bool IsAppLaunch(std::string* app_url, std::string* app_id);
// If IsAppLaunch is true, tries to open an application window.
// If the app is specified to start in a tab, or IsAppLaunch is false,
// returns false to specify default processing. |out_app_contents| is an
// optional argument to receive the created WebContents for the app.
bool OpenApplicationWindow(Profile* profile,
content::WebContents** out_app_contents);
// If IsAppLaunch is true and the user set a pref indicating that the app
// should open in a tab, do so.
bool OpenApplicationTab(Profile* profile);
// Invoked from Launch to handle processing of urls. This may do any of the
// following:
// . Invoke ProcessStartupURLs if |process_startup| is true.
// . If |process_startup| is false, restore the last session if necessary,
// or invoke ProcessSpecifiedURLs.
// . Open the urls directly.
void ProcessLaunchURLs(bool process_startup,
const std::vector<GURL>& urls_to_open);
// Does the following:
// . If the user's startup pref is to restore the last session (or the
// command line flag is present to force using last session), it is
// restored.
// . Otherwise invoke ProcessSpecifiedURLs
// If a browser was created, true is returned. Otherwise returns false and
// the caller must create a new browser.
bool ProcessStartupURLs(const std::vector<GURL>& urls_to_open);
// Invoked from either ProcessLaunchURLs or ProcessStartupURLs to handle
// processing of URLs where the behavior is common between process startup
// and launch via an existing process (i.e. those explicitly specified by
// the user somehow). Does the following:
// . Attempts to restore any pinned tabs from last run of chrome.
// . If urls_to_open is non-empty, they are opened.
// . If the user's startup pref is to launch a specific set of URLs they
// are opened.
//
// If any tabs were opened, the Browser which was created is returned.
// Otherwise null is returned and the caller must create a new browser.
Browser* ProcessSpecifiedURLs(const std::vector<GURL>& urls_to_open);
// Adds a Tab to |tabs| for each url in |urls| that doesn't already exist
// in |tabs|.
void AddUniqueURLs(const std::vector<GURL>& urls, StartupTabs* tabs);
// Adds any startup infobars to the selected tab of the given browser.
void AddInfoBarsIfNecessary(
Browser* browser,
chrome::startup::IsProcessStartup is_process_startup);
// Adds additional startup URLs to the specified vector.
void AddStartupURLs(std::vector<GURL>* startup_urls) const;
// Checks whether the Preferences backup is invalid and notifies user in
// that case.
void CheckPreferencesBackup(Profile* profile);
const FilePath cur_dir_;
const CommandLine& command_line_;
Profile* profile_;
StartupBrowserCreator* browser_creator_;
bool is_first_run_;
DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreatorImpl);
};
// Returns true if |profile| has exited uncleanly and has not been launched
// after the unclean exit.
bool HasPendingUncleanExit(Profile* profile);
#endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_
| [
"vgachkaylo@crystalnix.com"
] | vgachkaylo@crystalnix.com |
3447f310222531615479c6acd4f1036d04b06cfb | f9ebe7a39f065eb9f2b23dfb5fabab5dfc385580 | /all/native/graphics/utils/GLContext.cpp | 5632c7906957959e591f64c80e1616a62071c8e2 | [
"BSD-3-Clause"
] | permissive | giserfly/mobile-sdk | b94f771a3723eb594c4469fffa54a47ee02a4337 | 7997616230901ccc0864f47e1079e86cd212ce39 | refs/heads/master | 2021-01-01T15:37:53.424250 | 2017-07-05T13:30:13 | 2017-07-05T13:30:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,796 | cpp | #include "GLContext.h"
#include "utils/Log.h"
#include "utils/GeneralUtils.h"
namespace carto {
bool GLContext::HasGLExtension(const char* extension) {
std::lock_guard<std::mutex> lock(_Mutex);
auto it = _ExtensionCache.find(extension);
if (it != _ExtensionCache.end()) {
return true;
}
return false;
}
void GLContext::LoadExtensions() {
const char* extensions = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS));
if (!extensions) {
return;
}
std::vector<std::string> tokens = GeneralUtils::Split(std::string(extensions), ' ');
{
std::lock_guard<std::mutex> lock(_Mutex);
for (const std::string& extension : tokens) {
_ExtensionCache.insert(extension);
}
}
TEXTURE_FILTER_ANISOTROPIC = HasGLExtension("GL_EXT_texture_filter_anisotropic");
TEXTURE_NPOT_REPEAT = HasGLExtension("GL_OES_texture_npot");
TEXTURE_NPOT_MIPMAPS = HasGLExtension("GL_OES_texture_npot") || HasGLExtension("NV_texture_npot_2D_mipmap");
}
void GLContext::CheckGLError(const char* place) {
for (GLint error = glGetError(); error; error = glGetError()) {
Log::Errorf("GLContext::CheckGLError: GLError (0x%x) at %s \n", error, place);
}
}
GLContext::GLContext() {
}
bool GLContext::TEXTURE_FILTER_ANISOTROPIC = false;
bool GLContext::TEXTURE_NPOT_REPEAT = false;
bool GLContext::TEXTURE_NPOT_MIPMAPS = false;
std::size_t GLContext::MAX_VERTEXBUFFER_SIZE = 65535; // Should NOT exceed 64k!
std::unordered_set<std::string> GLContext::_ExtensionCache;
std::mutex GLContext::_Mutex;
}
| [
"mark.tehver@gmail.com"
] | mark.tehver@gmail.com |
a265e20d75d00d287e0f47101bf8a3e5b1bf9f84 | 9e6d644c6fdbb79497bbcdb727d4367cda12613a | /treeleaf_vs30.inc | 242b647709747d5f4b2b1e230de683402ffbec84 | [] | no_license | evil-inject0r/shaders-prebuilt | 40598dedb6df86a2ebe878debaeca8c11ab1e911 | 6ef461dc1dc4abf1e42d5d7c00cedf52b2042c4f | refs/heads/master | 2020-05-19T12:33:00.786757 | 2019-07-07T11:38:20 | 2019-07-07T11:38:20 | 185,017,559 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,345 | inc | #include "shaderlib/cshader.h"
class treeleaf_vs30_Static_Index
{
private:
int m_nHALFLAMBERT;
#ifdef _DEBUG
bool m_bHALFLAMBERT;
#endif
public:
void SetHALFLAMBERT( int i )
{
Assert( i >= 0 && i <= 1 );
m_nHALFLAMBERT = i;
#ifdef _DEBUG
m_bHALFLAMBERT = true;
#endif
}
void SetHALFLAMBERT( bool i )
{
m_nHALFLAMBERT = i ? 1 : 0;
#ifdef _DEBUG
m_bHALFLAMBERT = true;
#endif
}
public:
treeleaf_vs30_Static_Index( )
{
#ifdef _DEBUG
m_bHALFLAMBERT = false;
#endif // _DEBUG
m_nHALFLAMBERT = 0;
}
int GetIndex()
{
// Asserts to make sure that we aren't using any skipped combinations.
// Asserts to make sure that we are setting all of the combination vars.
#ifdef _DEBUG
bool bAllStaticVarsDefined = m_bHALFLAMBERT;
Assert( bAllStaticVarsDefined );
#endif // _DEBUG
return ( 4 * m_nHALFLAMBERT ) + 0;
}
};
#define shaderStaticTest_treeleaf_vs30 vsh_forgot_to_set_static_HALFLAMBERT + 0
class treeleaf_vs30_Dynamic_Index
{
private:
int m_nDYNAMIC_LIGHT;
#ifdef _DEBUG
bool m_bDYNAMIC_LIGHT;
#endif
public:
void SetDYNAMIC_LIGHT( int i )
{
Assert( i >= 0 && i <= 1 );
m_nDYNAMIC_LIGHT = i;
#ifdef _DEBUG
m_bDYNAMIC_LIGHT = true;
#endif
}
void SetDYNAMIC_LIGHT( bool i )
{
m_nDYNAMIC_LIGHT = i ? 1 : 0;
#ifdef _DEBUG
m_bDYNAMIC_LIGHT = true;
#endif
}
private:
int m_nSTATIC_LIGHT;
#ifdef _DEBUG
bool m_bSTATIC_LIGHT;
#endif
public:
void SetSTATIC_LIGHT( int i )
{
Assert( i >= 0 && i <= 1 );
m_nSTATIC_LIGHT = i;
#ifdef _DEBUG
m_bSTATIC_LIGHT = true;
#endif
}
void SetSTATIC_LIGHT( bool i )
{
m_nSTATIC_LIGHT = i ? 1 : 0;
#ifdef _DEBUG
m_bSTATIC_LIGHT = true;
#endif
}
public:
treeleaf_vs30_Dynamic_Index()
{
#ifdef _DEBUG
m_bDYNAMIC_LIGHT = false;
#endif // _DEBUG
m_nDYNAMIC_LIGHT = 0;
#ifdef _DEBUG
m_bSTATIC_LIGHT = false;
#endif // _DEBUG
m_nSTATIC_LIGHT = 0;
}
int GetIndex()
{
// Asserts to make sure that we aren't using any skipped combinations.
// Asserts to make sure that we are setting all of the combination vars.
#ifdef _DEBUG
bool bAllDynamicVarsDefined = m_bDYNAMIC_LIGHT && m_bSTATIC_LIGHT;
Assert( bAllDynamicVarsDefined );
#endif // _DEBUG
return ( 1 * m_nDYNAMIC_LIGHT ) + ( 2 * m_nSTATIC_LIGHT ) + 0;
}
};
#define shaderDynamicTest_treeleaf_vs30 vsh_forgot_to_set_dynamic_DYNAMIC_LIGHT + vsh_forgot_to_set_dynamic_STATIC_LIGHT + 0
| [
"none-of-your@busienss.com"
] | none-of-your@busienss.com |
97308727b348194c618ef5c496241197d74ce498 | d9bd24b85e3b5ee1bf7335e2f1f35dd02252aa9c | /달의 불씨/GameFramework/ZeepLine.cpp | fc0382535ee2ef4f63727dfba024c3ec873418db | [] | no_license | willtriti03/FireOfMoon | eccb72a2189a444792bc6c6eb9864c078cf3ff33 | 46cabc0a141ff51884d7a35f985be165e953149a | refs/heads/master | 2021-01-18T22:41:31.306721 | 2017-11-09T07:18:15 | 2017-11-09T07:18:15 | 72,596,797 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 143 | cpp | #include "ZeepLine.h"
ZeepLine::ZeepLine()
{
}
ZeepLine::~ZeepLine()
{
}
void ZeepLine::Update(float eTime){
}
void ZeepLine::Render(){
}
| [
"willtriti03@naver.com"
] | willtriti03@naver.com |
90bdc1da1da4841027b4d0d677e98ba8e9e8d991 | bd6aac8e6867d6ce3c3a609a14eca0c7b70ecfa9 | /CPP/7zip/Archive/Zip/ZipIn.h | d4700ffed0005f4fc7bf7b5dde8e72e22c4dd437 | [] | no_license | basinilya/7zip | cebacf614e835ba097b4e6b0b06dafcf96a981a9 | 22dcc7ec5ee8b8ae52b70e41339e8d6267798b7f | refs/heads/master | 2021-01-18T16:28:14.566722 | 2015-04-05T19:04:39 | 2015-04-05T19:04:39 | 33,448,110 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,776 | h | // Archive/ZipIn.h
#ifndef __ZIP_IN_H
#define __ZIP_IN_H
#include "../../../Common/MyCom.h"
#include "../../IStream.h"
#include "../../Common/InBuffer.h"
#include "ZipHeader.h"
#include "ZipItem.h"
API_FUNC_IsArc IsArc_Zip(const Byte *p, size_t size);
namespace NArchive {
namespace NZip {
class CItemEx: public CItem
{
public:
UInt32 LocalFullHeaderSize; // including Name and Extra
UInt64 GetLocalFullSize() const
{ return LocalFullHeaderSize + PackSize + (HasDescriptor() ? kDataDescriptorSize : 0); }
UInt64 GetDataPosition() const
{ return LocalHeaderPos + LocalFullHeaderSize; };
};
struct CInArchiveInfo
{
Int64 Base; /* Base offset of start of archive in stream.
Offsets in headers must be calculated from that Base.
Base is equal to MarkerPos for normal ZIPs.
Base can point to PE stub for some ZIP SFXs.
if CentralDir was read,
Base can be negative, if start of data is not available,
if CentralDirs was not read,
Base = ArcInfo.MarkerPos; */
/* The following *Pos variables contain absolute offsets in Stream */
UInt64 MarkerPos; /* Pos of first signature, it can point to PK00 signature
= MarkerPos2 in most archives
= MarkerPos2 - 4 if there is PK00 signature */
UInt64 MarkerPos2; // Pos of first local item signature in stream
UInt64 FinishPos; // Finish pos of archive data
UInt64 FileEndPos; // Finish pos of stream
UInt64 FirstItemRelatOffset; /* Relative offset of first local (read from cd) (relative to Base).
= 0 in most archives
= size of stub for some SFXs */
bool CdWasRead;
CByteBuffer Comment;
CInArchiveInfo(): Base(0), MarkerPos(0), MarkerPos2(0), FinishPos(0), FileEndPos(0),
FirstItemRelatOffset(0), CdWasRead(false) {}
UInt64 GetPhySize() const { return FinishPos - Base; }
UInt64 GetEmbeddedStubSize() const
{
if (CdWasRead)
return FirstItemRelatOffset;
return MarkerPos2 - Base;
}
bool ThereIsTail() const { return FileEndPos > FinishPos; }
void Clear()
{
Base = 0;
MarkerPos = 0;
MarkerPos2 = 0;
FinishPos = 0;
FileEndPos = 0;
FirstItemRelatOffset = 0;
CdWasRead = false;
Comment.Free();
}
};
struct CProgressVirt
{
virtual HRESULT SetCompletedLocal(UInt64 numFiles, UInt64 numBytes) = 0;
virtual HRESULT SetTotalCD(UInt64 numFiles) = 0;
virtual HRESULT SetCompletedCD(UInt64 numFiles) = 0;
};
struct CCdInfo
{
UInt64 NumEntries;
UInt64 Size;
UInt64 Offset;
void ParseEcd(const Byte *p);
void ParseEcd64(const Byte *p);
};
class CInArchive
{
CInBuffer _inBuffer;
bool _inBufMode;
UInt32 m_Signature;
UInt64 m_Position;
HRESULT Seek(UInt64 offset);
HRESULT FindAndReadMarker(IInStream *stream, const UInt64 *searchHeaderSizeLimit);
HRESULT IncreaseRealPosition(UInt64 addValue);
HRESULT ReadBytes(void *data, UInt32 size, UInt32 *processedSize);
void SafeReadBytes(void *data, unsigned size);
void ReadBuffer(CByteBuffer &buffer, unsigned size);
Byte ReadByte();
UInt16 ReadUInt16();
UInt32 ReadUInt32();
UInt64 ReadUInt64();
void Skip(unsigned num);
void Skip64(UInt64 num);
void ReadFileName(unsigned nameSize, AString &dest);
bool ReadExtra(unsigned extraSize, CExtraBlock &extraBlock,
UInt64 &unpackSize, UInt64 &packSize, UInt64 &localHeaderOffset, UInt32 &diskStartNumber);
bool ReadLocalItem(CItemEx &item);
HRESULT ReadLocalItemDescriptor(CItemEx &item);
HRESULT ReadCdItem(CItemEx &item);
HRESULT TryEcd64(UInt64 offset, CCdInfo &cdInfo);
HRESULT FindCd(CCdInfo &cdInfo);
HRESULT TryReadCd(CObjectVector<CItemEx> &items, UInt64 cdOffset, UInt64 cdSize, CProgressVirt *progress);
HRESULT ReadCd(CObjectVector<CItemEx> &items, UInt64 &cdOffset, UInt64 &cdSize, CProgressVirt *progress);
HRESULT ReadLocals(CObjectVector<CItemEx> &localItems, CProgressVirt *progress);
HRESULT ReadHeaders2(CObjectVector<CItemEx> &items, CProgressVirt *progress);
public:
CInArchiveInfo ArcInfo;
bool IsArc;
bool IsZip64;
bool HeadersError;
bool HeadersWarning;
bool ExtraMinorError;
bool UnexpectedEnd;
bool NoCentralDir;
CMyComPtr<IInStream> Stream;
void Close();
HRESULT Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit);
HRESULT ReadHeaders(CObjectVector<CItemEx> &items, CProgressVirt *progress);
bool IsOpen() const { return Stream != NULL; }
bool AreThereErrors() const { return HeadersError || UnexpectedEnd; }
bool IsLocalOffsetOK(const CItemEx &item) const
{
if (item.FromLocal)
return true;
return /* ArcInfo.Base >= 0 || */ ArcInfo.Base + (Int64)item.LocalHeaderPos >= 0;
}
HRESULT ReadLocalItemAfterCdItem(CItemEx &item);
HRESULT ReadLocalItemAfterCdItemFull(CItemEx &item);
ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
UInt64 GetOffsetInStream(UInt64 offsetFromArc) const { return ArcInfo.Base + offsetFromArc; }
bool CanUpdate() const
{
if (AreThereErrors())
return false;
if (ArcInfo.Base < 0)
return false;
if ((Int64)ArcInfo.MarkerPos2 < ArcInfo.Base)
return false;
// 7-zip probably can update archives with embedded stubs.
// we just disable that feature for more safety.
if (ArcInfo.GetEmbeddedStubSize() != 0)
return false;
if (ArcInfo.ThereIsTail())
return false;
return true;
}
};
}}
#endif
| [
"basinilya@gmail.com"
] | basinilya@gmail.com |
e7159cc74a32adddd8bf27416171ffe540e476e9 | d3d1d7d99054b8684ed5fc784421024050a95c79 | /codeforces/contest/1519/b.cpp | 86e33f5477d38b7ac1f85ff26f798ae13563ab36 | [] | no_license | rishabhSharmaOfficial/CompetitiveProgramming | 76e7ac3f8fe8c53599e600fc2df2520451b39710 | 85678a6dc1ee437d917adde8ec323a55a340375e | refs/heads/master | 2023-04-28T05:51:18.606350 | 2021-05-15T07:04:33 | 2021-05-15T07:04:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,167 | cpp | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define dbg(x) cout << #x << ": " << x << endl;
#define clr(x,v) memset(x, v, sizeof(x));
#define fix(x) cout << setprecision(x) << fixed;
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rand(st, ed) uniform_int_distribution<int>(st, ed)(rng)
using ll = long long int;
using ld = long double;
using pi = pair<int, int>;
const double PI = acos(-1.0);
const double eps = 1e-9;
const ll mod = 1e9 + 7;
const int inf = 1e7;
const int MAXN = 1e5 + 5;
void cp()
{
int n, m, k;
cin >> n >> m >> k;
int need = n * m - 1;
if(need == k)
cout << "YES\n";
else
cout << "NO\n";
}
int main()
{
FASTIO;
int t;
t = 1;
cin >> t;
while(t--)
{
cp();
}
return 0;
}
| [
"pranav.sindura@gmail.com"
] | pranav.sindura@gmail.com |
3d0cc38a07b3d336ad020fe0a00b3897c0fd521b | 34aa58efb0bd2908b6a89b97e02947f6ab5523f2 | /server/游戏组件/藏宝库子游戏/21点/游戏录像/GameVideoItemSink.h | 421dc1e1e09acca8b55706e17ee66480fc223f58 | [] | no_license | aywlcn/whdlm | 8e6c9901aed369658f0a7bb657f04fd13df5802e | 86d0d2edb98ce8a8a09378cabfda4fc357c7cdd2 | refs/heads/main | 2023-05-28T14:12:50.150854 | 2021-06-11T10:50:58 | 2021-06-11T10:50:58 | 380,582,203 | 1 | 0 | null | 2021-06-26T19:31:50 | 2021-06-26T19:31:49 | null | GB18030 | C++ | false | false | 1,518 | h | #pragma once
#include "..\服务器组件\GameVideo.h"
class CGameVideoItemSink : public IGameVideo
{
public:
CGameVideoItemSink(void);
virtual ~CGameVideoItemSink(void);
public:
//开始录像
virtual bool __cdecl StartVideo(ITableFrame *pTableFrame);
//停止和保存
virtual bool __cdecl StopAndSaveVideo(WORD wServerID, WORD wTableID, WORD wPlayCount);
//增加录像数据
virtual bool __cdecl AddVideoData(WORD wMsgKind, VOID *pData, size_t sDataSize, bool bFirst);
protected:
void ResetVideoItem();
bool RectifyBuffer(size_t iSize);
VOID BuildVideoNumber(CHAR szVideoNumber[], WORD wLen,WORD wServerID,WORD wTableID);
size_t Write(const void* data, size_t size);
size_t WriteUint8(UINT8 val) { return Write(&val, sizeof(val)); }
size_t WriteUint16(UINT16 val) { return Write(&val, sizeof(val)); }
size_t WriteUint32(UINT32 val) { return Write(&val, sizeof(val)); }
size_t WriteUint64(UINT64 val) { return Write(&val, sizeof(val)); }
size_t WriteInt8(INT8 val) { return Write(&val, sizeof(val)); }
size_t WriteInt16(INT16 val) { return Write(&val, sizeof(val)); }
size_t WriteInt32(INT32 val) { return Write(&val, sizeof(val)); }
size_t WriteInt64(INT64 val) { return Write(&val, sizeof(val)); }
//数据变量
private:
ITableFrame * m_pITableFrame; //框架接口
size_t m_iCurPos; //数据位置
size_t m_iBufferSize; //缓冲长度
LPBYTE m_pVideoDataBuffer; //缓冲指针
};
| [
"494294315@qq.com"
] | 494294315@qq.com |
42d0c58c24947dabbbec1c3e68a6c5f557cf47d4 | 6af5b637526b51cebdd5d828b7fcd74e133c8e6b | /study10.31 模板和string/string.cpp | 0b18f6fd599bd6f03514648b8b196f63045c53cf | [] | no_license | FeierSarah/study | a4d134dc4078adbd56bb94c69a4cba7ec8d529d7 | 57f1d579196fd9234d42478efae2c95dbc6b319b | refs/heads/master | 2021-07-11T23:04:49.996554 | 2020-09-10T04:15:21 | 2020-09-10T04:15:21 | 185,595,648 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 1,624 | cpp | #include<iostream>
#include<list>
#include<string>
using namespace std;
//string basic_string<char>
//typedef basic_string<char, char_traits, allocator> string
void testString1() {
string s;
string s2("hello world");
string copy(s2);
string s2(s2, 0, 5);//hello
string s4("hello world", 2);//he
string s5(10, 'a');//aaaaaaaaaa
char str1[] = "china";
char str2[] = "中国";
}
void testIterator() {
string s2("hello world");
/*
迭代器:一种容器内容的访问机制
使用方式:类似于指针的使用方式
begin迭代器:指向容器的第一个元素的位置
end迭代器:指向容器的最后一个元素的下一个位置
左闭右开:[begin, end]
*/
string::iterator it = s2.begin();
while (it != s2.end()) {
//*it = 'a'; 可读可写
cout << *it << " " ;
++it;
}
cout << endl;
//反向迭代器
// begin迭代器:指向容器的第一个元素的前一个位置
//end迭代器:指向容器的最后一个元素的位置
string::reverse_iterator rit = s2.rbegin();
while (rit != s2.rend()) {
cout << *rit << " ";
++rit;
}
cout << endl;
for (int i = 0; i < s2.size(); i++)
{
cout << s2[i] << " ";
}
cout << endl;
//const迭代器只读
const string s3("hello");
string::const_iterator s3it = s3.begin();
while (s3it != s3.end())
{
//*s3it = 'a';
cout << *s3it << " ";
++s3it;
}
cout << endl;
list<int> l;
l.push_back(1);
l.push_back(2);
l.push_back(3);
list<int>::iterator lit = l.begin();
while (lit != l.end()) {
cout << *lit << " " ;
++lit;
}
cout << endl;
}
int main() {
testString1();
return 0;
} | [
"2109625761@qq.com"
] | 2109625761@qq.com |
ffe377eb290e9dfea387545f184a82e5bf5a6169 | 6f224b734744e38062a100c42d737b433292fb47 | /clang/test/Driver/cxx20-header-units-02.cpp | 7b7a40f9e831fa5662de2347627f0ad9fab25c57 | [
"NCSA",
"LLVM-exception",
"Apache-2.0"
] | permissive | smeenai/llvm-project | 1af036024dcc175c29c9bd2901358ad9b0e6610e | 764287f1ad69469cc264bb094e8fcdcfdd0fcdfb | refs/heads/main | 2023-09-01T04:26:38.516584 | 2023-08-29T21:11:41 | 2023-08-31T22:16:12 | 216,062,316 | 0 | 0 | Apache-2.0 | 2019-10-18T16:12:03 | 2019-10-18T16:12:03 | null | UTF-8 | C++ | false | false | 1,503 | cpp | // Test user-facing command line options to generate C++20 header units.
// RUN: %clang -### -std=c++20 -fmodule-header=user foo.hh 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-USER %s
// RUN: %clang -### -std=c++20 -fmodule-header=user foo.h 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-USER1 %s
// RUN: %clang -### -std=c++20 -fmodule-header=system foo.hh 2>&1 | \
// RUN: FileCheck -check-prefix=CHECK-SYS1 %s
// RUN: %clang -### -std=c++20 -fmodule-header=system \
// RUN: -xc++-system-header vector 2>&1 | FileCheck -check-prefix=CHECK-SYS2 %s
// RUN: %clang -### -std=c++20 -fmodule-header=system \
// RUN: -xc++-header vector 2>&1 | FileCheck -check-prefix=CHECK-SYS2 %s
// RUN: %clang -### -std=c++20 -fmodule-header %/S/Inputs/header-unit-01.hh \
// RUN: 2>&1 | FileCheck -check-prefix=CHECK-ABS %s -DTDIR=%/S/Inputs
// CHECK-USER: "-emit-header-unit"
// CHECK-USER-SAME: "-o" "foo.pcm"
// CHECK-USER-SAME: "-x" "c++-user-header" "foo.hh"
// CHECK-USER1: "-emit-header-unit"
// CHECK-USER1-SAME: "-o" "foo.pcm"
// CHECK-USER1-SAME: "-x" "c++-user-header" "foo.h"
// CHECK-SYS1: "-emit-header-unit"
// CHECK-SYS1-SAME: "-o" "foo.pcm"
// CHECK-SYS1-SAME: "-x" "c++-system-header" "foo.hh"
// CHECK-SYS2: "-emit-header-unit"
// CHECK-SYS2-SAME: "-o" "vector.pcm"
// CHECK-SYS2-SAME: "-x" "c++-system-header" "vector"
// CHECK-ABS: "-emit-header-unit"
// CHECK-ABS-SAME: "-o" "header-unit-01.pcm"
// CHECK-ABS-SAME: "-x" "c++-header-unit-header" "[[TDIR]]/header-unit-01.hh"
| [
"iain@sandoe.co.uk"
] | iain@sandoe.co.uk |
b1e7c52828ee1c703d227a655eb4058fe188d0b2 | 67563a4436b914654dd441eb2e1915bbd41aa8ca | /Common/Util/logvwr/GplViewDlg.h | cca57bfa639c4133054377446981705f52de60a2 | [
"Apache-2.0"
] | permissive | PKO-Community-Sources/ClientSide-Sources | 1cab923af538ffe9d9cb9154b14dd3e0a903ca14 | ddbcd293d6ef3f58ff02290c02382cbb7e0939a2 | refs/heads/main | 2023-05-13T00:15:04.162386 | 2021-06-02T15:35:36 | 2021-06-02T15:35:36 | 372,753,278 | 3 | 0 | Apache-2.0 | 2021-06-02T15:26:17 | 2021-06-01T08:17:07 | C++ | GB18030 | C++ | false | false | 1,187 | h | #pragma once
#include "atltypes.h"
// CGplViewDlg dialog
class CLogvwrDlg;
class CLogTypeData;
typedef std::vector<CLogTypeData*> LGDATALIST;
typedef LGDATALIST* PLGDATALIST;
typedef std::vector<CLogTypeData*>::iterator LGDATALISTIT;
class CGplTypeData;
typedef std::vector<CGplTypeData*> GPLDATALIST;
typedef GPLDATALIST* PGPLDATALIST;
typedef std::vector<CGplTypeData*>::iterator GPLDATALISTIT;
class CGplViewDlg : public CDialog
{
DECLARE_DYNAMIC(CGplViewDlg)
public:
CGplViewDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CGplViewDlg();
void SetGplDataList(PGPLDATALIST pGPLData) {m_pGPLData = pGPLData;}
void SetLgDataList(PLGDATALIST pLGData) {m_pLGData = pLGData;}
// Dialog Data
enum { IDD = IDD_GPLVIEW };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnPaint();
afx_msg BOOL OnCommand(WPARAM wParam, LPARAM lParam);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
private:
// 主菜单
CLogvwrDlg* m_pParent;
CRect m_RC;
CBrush m_Brush;
// 数据源
PGPLDATALIST m_pGPLData;
PLGDATALIST m_pLGData;
public:
BOOL DrawGplData(CPaintDC& dc);
};
| [
"businessyagura2k@gmail.com"
] | businessyagura2k@gmail.com |
122572439454a12b6319d212fb024d66bcf89a48 | 2ab2afc76f6e5d0ac7bfbbbc8c4b0aa51c48ca05 | /src/qt/stancecoinaddressvalidator.h | 325aa5bb925458a08eddceb9b9363bae216abf7e | [
"MIT"
] | permissive | stance-project/stance-core | 3587f016edb2a6d785ea36a26183f7ce1c98414b | 7a3930614506c3d949b6a425e23421c9d191f4fc | refs/heads/master | 2020-05-01T16:54:59.247874 | 2019-03-28T22:01:13 | 2019-03-28T22:01:13 | 177,481,588 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 964 | h | // Copyright (c) 2011-2014 The Stancecoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef STANCECOIN_QT_STANCECOINADDRESSVALIDATOR_H
#define STANCECOIN_QT_STANCECOINADDRESSVALIDATOR_H
#include <QValidator>
/** Base58 entry widget validator, checks for valid characters and
* removes some whitespace.
*/
class StancecoinAddressEntryValidator : public QValidator
{
Q_OBJECT
public:
explicit StancecoinAddressEntryValidator(QObject *parent);
State validate(QString &input, int &pos) const;
};
/** Stancecoin address widget validator, checks for a valid stancecoin address.
*/
class StancecoinAddressCheckValidator : public QValidator
{
Q_OBJECT
public:
explicit StancecoinAddressCheckValidator(QObject *parent);
State validate(QString &input, int &pos) const;
};
#endif // STANCECOIN_QT_STANCECOINADDRESSVALIDATOR_H
| [
"moabproject@protonmail.com"
] | moabproject@protonmail.com |
8f598c434a65edd56e054aed6fbbbec1cf462810 | 188fb8ded33ad7a2f52f69975006bb38917437ef | /Fluid/processor2/0.09/meshPhi | fff07f45cb876920bc2219e29f73f022c8b5dcf9 | [] | no_license | abarcaortega/Tuto_2 | 34a4721f14725c20471ff2dc8d22b52638b8a2b3 | 4a84c22efbb9cd2eaeda92883343b6910e0941e2 | refs/heads/master | 2020-08-05T16:11:57.674940 | 2019-10-04T09:56:09 | 2019-10-04T09:56:09 | 212,573,883 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,201 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "0.09";
object meshPhi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
internalField nonuniform List<scalar>
881
(
3.38925e-06
1.27775e-06
1.30363e-06
3.51361e-06
1.55387e-06
4.24446e-06
1.60462e-06
4.96271e-06
1.64652e-06
1.7129e-06
3.64976e-06
1.86497e-06
4.37785e-06
1.94538e-06
5.10272e-06
2.02529e-06
5.79147e-06
2.13093e-06
2.28887e-06
3.81779e-06
2.21304e-06
4.53768e-06
2.32752e-06
5.25244e-06
2.44789e-06
5.93651e-06
2.59881e-06
6.55434e-06
2.79992e-06
7.05946e-06
3.07258e-06
3.43279e-06
4.02367e-06
2.602e-06
4.73506e-06
2.75543e-06
5.43837e-06
2.91967e-06
6.10649e-06
3.11597e-06
6.71309e-06
3.36066e-06
7.22461e-06
3.669e-06
7.62094e-06
4.05007e-06
7.88616e-06
4.50356e-06
5.01815e-06
4.27762e-06
3.03961e-06
4.97823e-06
3.23606e-06
5.6673e-06
3.44678e-06
6.31932e-06
3.6886e-06
6.90846e-06
3.97404e-06
7.40865e-06
4.31398e-06
7.80405e-06
4.71387e-06
8.0788e-06
5.17117e-06
8.22543e-06
5.676e-06
6.20511e-06
4.59138e-06
3.53912e-06
5.27802e-06
3.7803e-06
5.9492e-06
4.03722e-06
6.58181e-06
4.32246e-06
7.15218e-06
4.64465e-06
7.63801e-06
5.01094e-06
8.02224e-06
5.42413e-06
8.29098e-06
5.87992e-06
8.43878e-06
6.36608e-06
8.45873e-06
6.86296e-06
8.33844e-06
7.33967e-06
7.75442e-06
4.97793e-06
4.11742e-06
5.64614e-06
4.40139e-06
6.29497e-06
4.70025e-06
6.90386e-06
5.0232e-06
7.45171e-06
5.37567e-06
7.91849e-06
5.76132e-06
8.2874e-06
6.1806e-06
8.54527e-06
6.62785e-06
8.68377e-06
7.0902e-06
8.69809e-06
7.54771e-06
8.58053e-06
7.97212e-06
8.3318e-06
8.3327e-06
8.58823e-06
5.451e-06
4.79136e-06
6.0944e-06
5.11154e-06
6.71552e-06
5.44398e-06
7.29566e-06
5.79527e-06
7.81602e-06
6.16851e-06
8.25858e-06
6.56456e-06
8.60699e-06
6.98105e-06
8.84819e-06
7.41114e-06
8.97298e-06
7.84203e-06
8.97486e-06
8.25433e-06
8.84816e-06
8.6221e-06
8.59255e-06
8.91428e-06
8.20637e-06
9.09668e-06
7.6827e-06
9.12376e-06
8.94372e-06
6.02438e-06
5.57456e-06
6.63472e-06
5.91845e-06
7.22157e-06
6.27213e-06
7.76729e-06
6.6395e-06
8.25467e-06
7.0214e-06
8.66715e-06
7.41645e-06
8.98901e-06
7.81969e-06
9.20736e-06
8.22298e-06
9.31246e-06
8.61396e-06
9.29692e-06
8.97419e-06
9.15508e-06
9.27944e-06
8.88382e-06
9.50053e-06
8.48116e-06
9.6038e-06
7.94215e-06
9.54927e-06
7.26485e-06
9.29893e-06
8.81067e-06
6.70859e-06
6.46303e-06
7.27797e-06
6.8198e-06
7.82355e-06
7.18089e-06
8.32856e-06
7.55012e-06
8.77678e-06
7.92646e-06
9.15267e-06
8.30703e-06
9.44142e-06
8.68555e-06
9.63027e-06
9.05241e-06
9.70907e-06
9.3949e-06
9.6698e-06
9.69593e-06
9.50614e-06
9.93302e-06
9.21338e-06
1.00788e-05
8.78765e-06
1.01016e-05
8.22439e-06
9.96561e-06
7.52064e-06
9.63325e-06
6.6712e-06
9.06777e-06
5.66601e-06
8.22333e-06
7.05235e-06
7.51168e-06
7.44671e-06
8.03393e-06
7.80489e-06
8.53134e-06
8.15829e-06
8.98866e-06
8.51387e-06
9.39075e-06
8.86957e-06
9.72303e-06
9.22148e-06
9.97164e-06
9.5629e-06
1.01239e-05
9.88355e-06
1.01693e-05
1.01698e-05
1.00991e-05
1.04051e-05
9.90646e-06
1.05689e-05
9.58538e-06
1.06361e-05
9.13061e-06
1.05772e-05
8.53696e-06
1.03591e-05
7.79953e-06
9.94659e-06
6.9129e-06
9.30307e-06
5.86866e-06
8.38787e-06
4.65985e-06
7.16348e-06
5.59437e-06
8.4452e-06
8.51368e-06
8.91285e-06
8.85509e-06
9.35432e-06
9.1837e-06
9.75612e-06
9.5097e-06
1.01044e-05
9.82999e-06
1.03855e-05
1.01398e-05
1.05863e-05
1.04319e-05
1.06944e-05
1.06962e-05
1.06987e-05
1.0919e-05
1.059e-05
1.10834e-05
1.03608e-05
1.11703e-05
1.0004e-05
1.11569e-05
9.51335e-06
1.10156e-05
8.88265e-06
1.07162e-05
8.10578e-06
1.02255e-05
7.17614e-06
9.50872e-06
6.08592e-06
8.5288e-06
4.82789e-06
7.24933e-06
3.39354e-06
5.6365e-06
3.6523e-06
9.52165e-06
9.63138e-06
9.92437e-06
9.93853e-06
1.03007e-05
1.02262e-05
1.06383e-05
1.05078e-05
1.09244e-05
1.07793e-05
1.11461e-05
1.10351e-05
1.12908e-05
1.12676e-05
1.13466e-05
1.14668e-05
1.1302e-05
1.16196e-05
1.11469e-05
1.17094e-05
1.0873e-05
1.17175e-05
1.04728e-05
1.16227e-05
9.93884e-06
1.14003e-05
9.26408e-06
1.10219e-05
8.44135e-06
1.04569e-05
7.4632e-06
9.67238e-06
6.32163e-06
8.63406e-06
5.00858e-06
7.3072e-06
3.51581e-06
5.65765e-06
1.83377e-06
3.65109e-06
1.28513e-06
1.07479e-05
1.0752e-05
1.10747e-05
1.10111e-05
1.13761e-05
1.12448e-05
1.16404e-05
1.147e-05
1.18555e-05
1.16819e-05
1.20091e-05
1.18743e-05
1.20892e-05
1.20394e-05
1.2084e-05
1.21673e-05
1.19822e-05
1.22456e-05
1.17728e-05
1.22587e-05
1.14461e-05
1.2188e-05
1.09943e-05
1.20134e-05
1.04093e-05
1.17124e-05
9.68325e-06
1.12594e-05
8.80794e-06
1.06258e-05
7.77521e-06
9.7808e-06
6.57661e-06
8.69235e-06
5.2036e-06
7.32746e-06
3.64759e-06
5.65308e-06
1.9e-06
3.63646e-06
1.27722e-06
1.21243e-05
1.18181e-05
1.23651e-05
1.20198e-05
1.25821e-05
1.21906e-05
1.27641e-05
1.23512e-05
1.28995e-05
1.24962e-05
1.29764e-05
1.26192e-05
1.29832e-05
1.27122e-05
1.29083e-05
1.27656e-05
1.27406e-05
1.27675e-05
1.24687e-05
1.27035e-05
1.20815e-05
1.25562e-05
1.157e-05
1.23059e-05
1.09261e-05
1.19317e-05
1.01413e-05
1.14105e-05
9.20648e-06
1.07161e-05
8.11287e-06
9.81984e-06
6.85143e-06
8.69168e-06
5.41321e-06
7.30042e-06
3.78938e-06
5.61443e-06
1.97154e-06
3.60226e-06
1.26322e-06
1.36459e-05
1.2766e-05
1.37921e-05
1.29053e-05
1.39161e-05
1.30092e-05
1.40073e-05
1.31013e-05
1.40546e-05
1.31762e-05
1.40465e-05
1.32274e-05
1.39717e-05
1.32472e-05
1.38187e-05
1.32261e-05
1.35764e-05
1.3153e-05
1.32335e-05
1.30147e-05
1.27782e-05
1.27951e-05
1.21995e-05
1.24754e-05
1.14891e-05
1.2036e-05
1.06382e-05
1.14557e-05
9.63702e-06
1.07107e-05
8.47617e-06
9.77467e-06
7.14608e-06
8.61946e-06
5.63734e-06
7.2158e-06
3.94085e-06
5.53357e-06
2.04812e-06
3.54244e-06
1.24063e-06
1.5302e-05
1.35291e-05
1.53463e-05
1.36057e-05
1.53701e-05
1.36432e-05
1.53632e-05
1.36675e-05
1.5315e-05
1.36733e-05
1.52144e-05
1.36546e-05
1.50503e-05
1.36037e-05
1.48113e-05
1.35118e-05
1.44864e-05
1.33686e-05
1.40643e-05
1.31617e-05
1.35332e-05
1.28768e-05
1.28808e-05
1.24967e-05
1.20969e-05
1.20027e-05
1.11727e-05
1.1375e-05
1.00985e-05
1.05921e-05
8.86426e-06
9.63003e-06
7.45984e-06
8.46284e-06
5.87539e-06
7.06313e-06
4.10148e-06
5.40242e-06
2.12931e-06
3.45151e-06
1.20739e-06
1.70757e-05
1.40417e-05
1.70132e-05
1.40595e-05
1.69313e-05
1.40353e-05
1.68204e-05
1.39966e-05
1.66705e-05
1.39386e-05
1.64709e-05
1.38555e-05
1.62108e-05
1.37403e-05
1.58791e-05
1.35849e-05
1.54645e-05
1.33796e-05
1.49558e-05
1.31134e-05
1.43415e-05
1.27732e-05
1.3609e-05
1.23441e-05
1.27458e-05
1.18087e-05
1.17421e-05
1.11481e-05
1.05887e-05
1.03425e-05
9.27523e-06
9.37057e-06
7.7912e-06
8.20891e-06
6.12621e-06
6.83202e-06
4.27041e-06
5.21313e-06
2.21459e-06
3.32438e-06
1.1617e-06
1.89446e-05
1.42418e-05
1.87722e-05
1.42081e-05
1.8581e-05
1.41306e-05
1.83621e-05
1.40375e-05
1.8106e-05
1.39244e-05
1.78025e-05
1.37861e-05
1.74412e-05
1.36165e-05
1.70111e-05
1.34081e-05
1.65011e-05
1.31523e-05
1.58998e-05
1.28392e-05
1.51958e-05
1.24571e-05
1.4377e-05
1.19929e-05
1.34298e-05
1.14313e-05
1.23417e-05
1.07543e-05
1.11037e-05
9.94394e-06
9.70606e-06
8.98123e-06
8.13776e-06
7.84515e-06
6.38797e-06
6.51242e-06
4.44638e-06
4.95823e-06
2.30331e-06
3.15636e-06
1.10189e-06
2.08802e-05
1.40735e-05
2.05971e-05
1.39982e-05
2.02952e-05
1.38787e-05
1.99663e-05
1.37427e-05
1.96014e-05
1.35864e-05
1.91911e-05
1.34054e-05
1.8725e-05
1.31943e-05
1.81927e-05
1.29465e-05
1.75831e-05
1.26546e-05
1.68849e-05
1.23098e-05
1.60864e-05
1.19019e-05
1.51761e-05
1.14194e-05
1.41403e-05
1.08488e-05
1.29646e-05
1.01745e-05
1.16384e-05
9.38007e-06
1.01525e-05
8.44799e-06
8.49616e-06
7.35982e-06
6.65816e-06
6.09499e-06
4.62769e-06
4.63085e-06
2.3946e-06
2.94317e-06
1.0265e-06
2.28484e-05
1.34888e-05
2.24562e-05
1.3384e-05
2.20444e-05
1.32358e-05
2.16057e-05
1.30707e-05
2.11318e-05
1.28856e-05
2.06136e-05
1.26768e-05
2.00415e-05
1.24397e-05
1.94052e-05
1.21688e-05
1.86938e-05
1.18577e-05
1.78961e-05
1.14989e-05
1.70005e-05
1.10837e-05
1.59952e-05
1.06021e-05
1.48675e-05
1.00427e-05
1.36022e-05
9.39226e-06
1.21857e-05
8.63581e-06
1.06089e-05
7.75785e-06
8.86207e-06
6.74238e-06
6.93356e-06
5.57143e-06
4.8122e-06
4.22494e-06
2.48737e-06
2.68108e-06
9.34257e-07
2.48094e-05
1.24492e-05
2.43119e-05
1.2328e-05
2.37935e-05
1.21659e-05
2.32477e-05
1.19872e-05
2.26668e-05
1.17895e-05
2.20424e-05
1.15697e-05
2.13653e-05
1.13242e-05
2.06255e-05
1.10485e-05
1.98124e-05
1.07373e-05
1.89151e-05
1.03843e-05
1.79218e-05
9.98232e-06
1.68207e-05
9.52303e-06
1.55995e-05
8.99694e-06
1.42435e-05
8.39294e-06
1.27369e-05
7.69853e-06
1.10687e-05
6.90039e-06
9.23017e-06
5.98424e-06
7.21025e-06
4.9349e-06
4.99731e-06
3.73554e-06
2.58031e-06
2.3671e-06
8.24145e-07
2.67174e-05
1.09267e-05
2.61208e-05
1.0803e-05
2.55017e-05
1.06426e-05
2.48541e-05
1.04669e-05
2.41711e-05
1.02738e-05
2.34448e-05
1.00613e-05
2.26665e-05
9.82643e-06
2.18266e-05
9.56568e-06
2.09148e-05
9.27487e-06
1.99203e-05
8.94907e-06
1.88314e-05
8.58249e-06
1.76363e-05
8.16845e-06
1.63224e-05
7.69932e-06
1.48764e-05
7.16641e-06
1.32816e-05
6.55977e-06
1.15237e-05
5.86788e-06
9.59421e-06
5.0787e-06
7.48368e-06
4.18034e-06
5.18004e-06
3.15912e-06
2.67195e-06
1.99911e-06
6.95458e-07
2.85203e-05
8.90536e-06
2.78335e-05
8.79322e-06
2.71222e-05
8.65055e-06
2.63812e-05
8.49469e-06
2.5604e-05
8.32441e-06
2.47833e-05
8.13808e-06
2.39109e-05
7.93363e-06
2.29774e-05
7.70851e-06
2.1973e-05
7.45962e-06
2.08869e-05
7.18329e-06
1.97075e-05
6.8752e-06
1.8423e-05
6.53035e-06
1.70208e-05
6.14299e-06
1.54881e-05
5.70666e-06
1.38082e-05
5.21356e-06
1.19642e-05
4.65478e-06
9.94729e-06
4.02171e-06
7.74892e-06
3.30506e-06
5.35719e-06
2.49392e-06
2.7607e-06
1.57616e-06
5.4789e-07
3.01598e-05
6.38295e-06
2.93944e-05
6.29627e-06
2.86025e-05
6.18708e-06
2.77795e-05
6.06814e-06
2.69195e-05
5.93864e-06
2.60155e-05
5.79755e-06
2.50597e-05
5.64353e-06
2.4043e-05
5.47491e-06
2.29558e-05
5.28967e-06
2.17872e-05
5.08536e-06
2.0526e-05
4.85912e-06
1.91602e-05
4.6076e-06
1.76771e-05
4.32693e-06
1.60639e-05
4.01271e-06
1.43046e-05
3.65951e-06
1.23813e-05
3.26183e-06
1.02827e-05
2.81427e-06
8.00105e-06
2.30972e-06
5.52557e-06
1.74048e-06
2.84498e-06
1.09866e-06
3.81615e-07
3.15704e-05
3.37284e-06
3.07406e-05
3.32488e-06
2.98832e-05
3.26454e-06
2.89937e-05
3.19896e-06
2.80664e-05
3.12774e-06
2.70946e-05
3.05036e-06
2.60704e-05
2.96617e-06
2.49851e-05
2.87435e-06
2.3829e-05
2.77389e-06
2.25915e-05
2.66358e-06
2.12611e-05
2.54198e-06
1.98258e-05
2.40741e-06
1.82727e-05
2.25792e-06
1.65887e-05
2.09123e-06
1.47592e-05
1.90469e-06
1.27659e-05
1.69572e-06
1.05938e-05
1.46151e-06
8.23537e-06
1.19816e-06
5.68232e-06
9.01825e-07
2.92339e-06
5.68673e-07
1.97389e-07
3.26922e-05
3.18165e-05
3.09131e-05
2.9977e-05
2.90024e-05
2.79825e-05
2.69094e-05
2.57745e-05
2.45678e-05
2.32787e-05
2.18956e-05
2.04062e-05
1.87976e-05
1.70561e-05
1.5168e-05
1.31146e-05
1.08784e-05
8.45209e-06
5.82866e-06
2.99715e-06
)
;
boundaryField
{
inlet
{
type calculated;
value nonuniform 0();
}
outlet
{
type calculated;
value uniform 0;
}
flap
{
type calculated;
value nonuniform 0();
}
upperWall
{
type calculated;
value uniform 0;
}
lowerWall
{
type calculated;
value nonuniform 0();
}
frontAndBack
{
type empty;
value nonuniform 0();
}
procBoundary2to1
{
type processor;
value nonuniform List<scalar>
17
(
-6.9666e-06
-7.94904e-06
-9.08709e-06
-1.03873e-05
-1.18478e-05
-1.34618e-05
-1.52166e-05
-1.70937e-05
-1.90683e-05
-2.11099e-05
-2.31821e-05
-2.52428e-05
-2.72442e-05
-2.91318e-05
-3.08444e-05
-3.23135e-05
-3.34757e-05
)
;
}
procBoundary2to4
{
type processor;
value nonuniform List<scalar>
11
(
-2.67618e-06
-2.80032e-06
-2.94138e-06
-3.11155e-06
-3.32029e-06
-3.57912e-06
-3.90064e-06
-4.29955e-06
-4.79231e-06
-5.39637e-06
-6.12059e-06
)
;
}
procBoundary2to5
{
type processor;
value nonuniform List<scalar>
34
(
-1.03798e-06
-1.04912e-06
4.10013e-06
-1.31879e-06
-1.365e-06
5.62155e-06
-1.84383e-06
6.38934e-06
-2.53213e-06
-2.87648e-06
7.43165e-06
-3.8792e-06
-4.38863e-06
8.0097e-06
-5.55684e-06
8.23238e-06
-6.71427e-06
-7.14442e-06
8.08221e-06
-8.04381e-06
7.94962e-06
-8.67257e-06
-8.52029e-06
7.02136e-06
-8.49697e-06
6.44325e-06
-8.02145e-06
-6.87959e-06
4.49873e-06
-5.5139e-06
3.27722e-06
-3.63407e-06
1.77155e-06
-1.28905e-06
)
;
}
}
// ************************************************************************* //
| [
"aldo.abarca.ortega@gmail.com"
] | aldo.abarca.ortega@gmail.com | |
570adb65a654a0bb3ee43e74603a9ab6078ce5f1 | 04721d03a4bf0bdefcdd527d2d1c845af7850a14 | /uri/Regional2015/gen.cpp | 126c8dcdd8b440ea2d732188fff41eb74440c27e | [] | no_license | ArielGarciaM/CompetitiveProgramming | 81e3808fdb14372f14e54d1e69c582be9ba44893 | c7115c38b988b6bc053850f1024a8005eb24fcee | refs/heads/master | 2020-03-28T15:19:55.788844 | 2019-08-09T20:54:25 | 2019-08-09T20:54:25 | 148,581,397 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 335 | cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("output.out", "w", stdout);
int r = 100, c = 100;
int cur = 1;
for(int i = 0; i < r; i++)
{
for(int j = 0; j < c; j++)
{
cur = (13*cur + 2)%109 + 1;
cout << cur << " ";
}
cout << endl;
}
} | [
"largam@ciencias.unam.mx"
] | largam@ciencias.unam.mx |
81d3c4065dd530bfe42514cbb86e0ade2c5e9a8b | 2f71acd47b352909ca2c978ad472a082ee79857c | /src/abc174/d.cpp | cd598579f75298c0b1a8a6e49b07a66fc8988fe7 | [] | no_license | imoted/atCoder | 0706c8b188a0ce72c0be839a35f96695618d0111 | 40864bca57eba640b1e9bd7df439d56389643100 | refs/heads/master | 2022-05-24T20:54:14.658853 | 2022-03-05T08:23:49 | 2022-03-05T08:23:49 | 219,258,307 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,321 | cpp | #include <bits/stdc++.h>
using namespace std;
// input
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
#define VAR(type, ...)type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__); // __VA_ARGS__可変引数マクロ
template<typename T> void MACRO_VAR_Scan(T& t) { std::cin >> t; }
template<typename First, typename...Rest>void MACRO_VAR_Scan(First& first, Rest& ...rest) { std::cin >> first; MACRO_VAR_Scan(rest...); }
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define MAT(type, c, m, n) std::vector<std::vector<type>> c(m, std::vector<type>(n));for(auto& R:c)for(auto& w:R)std::cin>>w;
// output
template<typename T>void MACRO_OUT(const T t) { std::cout << t; }
template<typename First, typename...Rest>void MACRO_OUT(const First first, const Rest...rest) { std::cout << first << " "; MACRO_OUT(rest...); }
#define OUT(...) MACRO_OUT(__VA_ARGS__);
#define FOUT(n, dist) std::cout<<std::fixed<<std::setprecision(n)<<(dist); // std::fixed 浮動小数点の書式 / setprecision 浮動小数点数を出力する精度を設定する。
#define SP std::cout<<" ";
#define TAB std::cout<<"\t";
#define BR std::cout<<"\n";
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define ENDL std::cout<<std::endl;
#define FLUSH std::cout<<std::flush;
// utility
#define ALL(a) (a).begin(),(a).end()
#define FOR(w, a, n) for(int w=(a);w<(n);++w)
#define REP(w, n) for(int w=0;w<int(n);++w)
#define IN(a, x, b) (a<=x && x<b)
template<class T> inline T CHMAX(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T CHMIN(T& a, const T b) { return a = (a > b) ? b : a; }
template<class T> using V = std::vector<T>;
template<class T> using VV = V<V<T>>;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using PAIR = std::pair<int, int>;
using PAIRLL = std::pair<ll, ll>;
constexpr int INFINT = (1 << 30) - 1; // 1.07x10^ 9
constexpr int INFINT_LIM = (1LL << 31) - 1; // 2.15x10^ 9
constexpr ll INFLL = 1LL << 60; // 1.15x10^18
constexpr ll INFLL_LIM = (1LL << 62) - 1 + (1LL << 62); // 9.22x10^18
constexpr double eps = 1e-7;
constexpr int MOD = 1000000007;
constexpr double PI = 3.141592653589793238462643383279;
template<class T, size_t N> void FILL(T(&a)[N], const T & val) { for (auto& x : a) x = val; } // int a[5] = {1,2,3,4,5}; FILL(a,10);
template<class ARY, size_t N, size_t M, class T> void FILL(ARY(&a)[N][M], const T & val) { for (auto& b : a) FILL(b, val); } // 2次元配列でもそのまま使える
template<class T> void FILL(std::vector<T> & a, const T & val) { for (auto& x : a) x = val; } // 使い方 vector<int> a(3); FILL(a,10);
template<class ARY, class T> void FILL(std::vector<std::vector<ARY>> & a, const T & val) { for (auto& b : a) FILL(b, val); } // 2次元配列でもそのまま使える
// ------------>8------------------------------------->8------------
// Rの全部の数を数える ON
// 左側に寄せてRを並べた場合、 元々そこにある Wを数える ON
// Wの数を OUT O1
int main() {
INIT;
VAR(int,n)
VAR(string,c)
int cnt=0;
REP(i,n){
if(c[i] == 'R'){
cnt++;
}
}
int ans =0;
REP(i,cnt){
if (c[i] == 'W')
{
ans++;
}
}
OUT(ans)
return 0;
}
| [
"tad.imokawa@gmail.com"
] | tad.imokawa@gmail.com |
87fcf1512f41dd7e203ff29d084c4dbcd57e84fd | 7fde539690cf3b340ecef3c0a742ed1e506030f3 | /13008_2/cc.cpp | e015d1f1c8108008452aa17fa1b72b2767a4c67d | [] | no_license | Jinmin-Goh/GSHS_Computer_Programming_2013_1 | bbb9524a195476f05440c3ab4a1ea42654b63bdd | 4132506390868ec82787bbefda07beb0400945e1 | refs/heads/master | 2020-09-16T11:59:51.876821 | 2019-11-24T15:27:53 | 2019-11-24T15:27:53 | 223,762,908 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 488 | cpp | #include<stdio.h>
int m,n,k,p,sum,i,A[702],flag;
double s;
int main(){
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
scanf("%d%d",&n,&m);
if(n==m){
for(i=1;i<=n;i++)
scanf("%d",&p);
printf("Perfect");
}
else{
for(i=1;i<=n;i++){
scanf("%d",&k);
A[k]++;}
for(i=1;i<=700;i++){
while(A[i]>0){
sum=sum+i;
A[i]=A[i]-1;
p=p+1;
if(p==n-m) flag=1;
}
if(flag==1) break;
}
s=(double)sum/10;
printf("%.1lf",s);
}
return 0;
} | [
"eric970901@gmail.com"
] | eric970901@gmail.com |
5245a0986882980b8e0d863f3615144766a9cfb6 | f1c641370890ba23e6ffb4c08543f90225836c7e | /bdelock/bdelock.cpp | da8fe9030e5353f7f5ebfad7e5e5ecb53f206dee | [] | no_license | csersoft/bdelock | 93096eb022e42fb2e725acadd844d158e5c2b277 | f10cf29001aba10d31522a6d900edbf8cb2315d0 | refs/heads/master | 2021-01-21T14:44:32.772363 | 2017-06-25T00:26:25 | 2017-06-25T00:26:25 | 95,329,758 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 339 | cpp | #include "stdafx.h"
int main(int argc, char *argv[])
{
if (argc > 1)
{
char chDrive[16], chTemp[256];
char *lpChar;
strcpy_s(chDrive, argv[1]);
lpChar = strchr(chDrive, '\\');
if (lpChar) *lpChar = 0;
sprintf_s(chTemp, "manage-bde.exe -lock %s", chDrive);
WinExec(chTemp, SW_HIDE);
}
return 0;
}
| [
"csersoft@gmail.com"
] | csersoft@gmail.com |
3874caeec7a071f8ec9afe9a55313c1c7146e8a6 | cc4f275a62299c0fcecc65eb3ddf476d70c7f896 | /tools/pre_parser/lua_bind/geometry.h | 8b33f5c9cffb9fdc2bb1df37dc958ebc9e4bef79 | [
"MIT"
] | permissive | gamezoo/Cjing3D-Test | 31d794613fb899f40a4fb6d80134d9cbc060b537 | 711667cc7a62fc5d07e7cedd6dfbc57c64bfbfa2 | refs/heads/master | 2023-07-01T16:22:29.414792 | 2021-08-10T10:55:53 | 2021-08-10T10:55:53 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,464 | h | #pragma once
#include "maths_common.h"
#include "vec_facade.h"
namespace Cjing3D {
/**
* \brief 纹理坐标类
*/
class UV : public F32x2
{
public:
constexpr UV() = default;
constexpr UV(F32 u, F32 v) : F32x2(u, v) {}
~UV() = default;
constexpr F32 GetU()const { return operator[](0); }
constexpr F32 GetV()const { return operator[](1); }
void SetU(F32 v) { operator[](0) = v; }
void SetV(F32 v) { operator[](1) = v; }
};
/**
* \brief 三维点类
*/
class Point3 : public F32x3
{
public:
constexpr Point3() = default;
constexpr Point3(F32 x, F32 y, F32 z) : F32x3(x, y, z) {}
~Point3() = default;
constexpr F32 GetX()const { return operator[](0); }
constexpr F32 GetY()const { return operator[](1); }
constexpr F32 GetZ()const { return operator[](2); }
void SetX(F32 v) { operator[](0) = v; }
void SetY(F32 v) { operator[](1) = v; }
void SetZ(F32 v) { operator[](2) = v; }
};
/**
* \brief 三维空间向量
*/
class Vertex3 : public F32x3 {
public:
constexpr Vertex3() = default;
constexpr Vertex3(F32 x, F32 y, F32 z) : F32x3(x, y, z) {}
constexpr explicit Vertex3(F32x3 v) :F32x3(std::move(v)) {}
~Vertex3() = default;
constexpr F32 GetX()const { return operator[](0); }
constexpr F32 GetY()const { return operator[](1); }
constexpr F32 GetZ()const { return operator[](2); }
void SetX(F32 v) { operator[](0) = v; }
void SetY(F32 v) { operator[](1) = v; }
void SetZ(F32 v) { operator[](2) = v; }
};
/**
* \brief 三维空间法向量
*/
class Normal3 : public Vertex3 {
public:
constexpr Normal3() = default;
constexpr Normal3(F32 x, F32 y, F32 z) : Vertex3(x, y, z) {}
constexpr explicit Normal3(F32x3 v) : Vertex3(std::move(v)) {}
};
struct RectInt
{
public:
I32 mLeft = 0;
I32 mTop = 0;
I32 mRight = 0;
I32 mBottom = 0;
};
class Rect
{
public:
enum RectMargin
{
LEFT,
TOP,
RIGHT,
BOTTOM
};
F32 mLeft = 0.0f;
F32 mTop = 0.0f;
F32 mRight = 0.0f;
F32 mBottom = 0.0f;
Rect() = default;
Rect(F32 left, F32 top, F32 right, F32 bottom) : mLeft(left), mTop(top), mRight(right), mBottom(bottom) {}
Rect(F32x2 pos, F32x2 size) :mLeft(pos[0]), mTop(pos[1]), mRight(pos[0] + size[0]), mBottom(pos[1] + size[1]) {}
void SetSize(F32x2 size) { mRight = mLeft + size[0]; mBottom = mTop + size[1]; }
void SetPos(F32x2 pos) { F32x2 offset = pos - GetPos(); Offset(offset); }
F32x2 GetPos()const { return { mLeft, mTop }; }
F32x2 GetSize()const { return { mRight - mLeft, mBottom - mTop }; }
F32 GetHeight()const { return mBottom - mTop; }
F32 GetWidth()const { return mRight - mLeft; }
F32x2 GetCenter()const { return {(mRight + mLeft) * 0.5f, (mTop + mBottom) * 0.5f }; }
bool Intersects(const Rect& rect)const;
bool Intersects(const F32x2& point)const;
inline void Union(const Rect& rect)
{
mLeft = std::min(mLeft, rect.mLeft);
mTop = std::min(mTop, rect.mTop);
mRight = std::max(mRight, rect.mRight);
mBottom = std::max(mBottom, rect.mBottom);
}
inline void SetMargin(RectMargin margin, F32 v)
{
switch (margin)
{
case LEFT:
mLeft = v;
break;
case TOP:
mTop = v;
break;
case RIGHT:
mRight = v;
break;
case BOTTOM:
mBottom = v;
break;
default:
break;
}
}
Rect& Offset(const F32x2& offset)
{
mLeft += offset[0];
mTop += offset[1];
mRight += offset[0];
mBottom += offset[1];
return *this;
}
};
} | [
"844635471@qq.com"
] | 844635471@qq.com |
f98eb8eaee99bbb02efd75c9c2e8717f7e9dd882 | 8073c5e6d7929ec01da60488871e3db455d134c3 | /testprograms/SquareDivisor.cpp | 694cf225c3f82746ab8d586fb44a028300e3a5ef | [] | no_license | tracyhenry/TopCoder | acbdf542bce0f9f6ca64e8249690057328853070 | a413f9c03aadddf0522c3b01fe484c651cf7d89b | refs/heads/master | 2021-01-19T01:45:31.531243 | 2016-12-29T19:27:17 | 2016-12-29T19:41:33 | 23,521,458 | 0 | 0 | null | 2016-12-29T19:43:52 | 2014-08-31T19:37:12 | C++ | UTF-8 | C++ | false | false | 3,078 | cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#define LL long long
#define pi 3.1415926535897932384626433
#define sqr(a) ((a)*(a))
using namespace std;
class SquareDivisor {
public:
long long biggest(long long n);
};
long long SquareDivisor::biggest(long long n)
{
LL ans = 0;
for (LL i = 1; i <= 10000000; i ++)
if (n % (i * i) == 0)
ans = max(ans, i * i);
for (LL i = 1; i <= 100000; i ++)
if (n % i == 0)
{
LL cur = n / i;
LL v = (LL) sqrt(cur);
if (v * v == cur)
ans = max(ans, cur);
}
return ans;
}
// BEGIN KAWIGIEDIT TESTING
// Generated by KawigiEdit 2.1.8 (beta) modified by pivanof
#include <iostream>
#include <string>
#include <vector>
using namespace std;
bool KawigiEdit_RunTest(int testNum, long long p0, bool hasAnswer, long long p1) {
cout << "Test " << testNum << ": [" << p0;
cout << "]" << endl;
SquareDivisor *obj;
long long answer;
obj = new SquareDivisor();
clock_t startTime = clock();
answer = obj->biggest(p0);
clock_t endTime = clock();
delete obj;
bool res;
res = true;
cout << "Time: " << double(endTime - startTime) / CLOCKS_PER_SEC << " seconds" << endl;
if (hasAnswer) {
cout << "Desired answer:" << endl;
cout << "\t" << p1 << endl;
}
cout << "Your answer:" << endl;
cout << "\t" << answer << endl;
if (hasAnswer) {
res = answer == p1;
}
if (!res) {
cout << "DOESN'T MATCH!!!!" << endl;
} else if (double(endTime - startTime) / CLOCKS_PER_SEC >= 2) {
cout << "FAIL the timeout" << endl;
res = false;
} else if (hasAnswer) {
cout << "Match :-)" << endl;
} else {
cout << "OK, but is it right?" << endl;
}
cout << "" << endl;
return res;
}
int main() {
bool all_right;
all_right = true;
long long p0;
long long p1;
{
// ----- test 0 -----
p0 = 12ll;
p1 = 4ll;
all_right = KawigiEdit_RunTest(0, p0, true, p1) && all_right;
// ------------------
}
{
// ----- test 1 -----
p0 = 100ll;
p1 = 100ll;
all_right = KawigiEdit_RunTest(1, p0, true, p1) && all_right;
// ------------------
}
{
// ----- test 2 -----
p0 = 2014ll;
p1 = 1ll;
all_right = KawigiEdit_RunTest(2, p0, true, p1) && all_right;
// ------------------
}
{
// ----- test 3 -----
p0 = 999999875021574338ll;
p1 = 499999937510787169ll;
all_right = KawigiEdit_RunTest(3, p0, true, p1) && all_right;
// ------------------
}
{
// ----- test 4 -----
p0 = 999999998000000002ll;
p1 = 1ll;
all_right = KawigiEdit_RunTest(4, p0, true, p1) && all_right;
// ------------------
}
if (all_right) {
cout << "You're a stud (at least on the example cases)!" << endl;
} else {
cout << "Some of the test cases had errors." << endl;
}
return 0;
}
// END KAWIGIEDIT TESTING
//Powered by KawigiEdit 2.1.8 (beta) modified by pivanof!
| [
"thieryhenrytracy@163.com"
] | thieryhenrytracy@163.com |
5d58e19ffa81631cc293385a9e9573b7fe7069b1 | 1ee1c93597e714e3495b5ce96d541bfd5a45053e | /222D/ans.cpp | 735edfd7f482ac9ad1ae589d151e075aa3abbff4 | [] | no_license | mchensd/Competitive-Programming | 5f11873d1a74f925045e1db37d6ca419af542a45 | 55292a593c757abed545b409fef466e2479c1be8 | refs/heads/master | 2020-03-29T08:17:06.562341 | 2019-12-05T02:19:07 | 2019-12-05T02:19:07 | 149,702,683 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 655 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define mp make_pair
#define pb push_back
int nums[100005];
int main() {
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#endif
int n, x;
multiset<int> other;
scanf("%d%d", &n, &x);
for (int i=0; i<2; ++i){
for(int j=0;j<n;++j){
int x; cin >>x;
if (i) nums[j]=x;
else other.insert(x);
}
}
int num=0;
for (int i=0; i<n; ++i) {
int k = x-nums[i];
auto it = other.lower_bound(k);
if (it == other.end()) continue;
++num; other.erase(it);
}
printf("1 %d\n", num);
}
| [
"chen.young@Michaels-MacBook-Pro.local"
] | chen.young@Michaels-MacBook-Pro.local |
888785efa364fcffcdbedc545646faf9f783959b | 1a17167c38dc9a12c1f72dd0f3ae7288f5cd7da0 | /Source/ThirdParty/angle/third_party/SwiftShader/third_party/SPIRV-Tools/source/opt/wrap_opkill.h | 8b0328132f46cb42a6de0b208d3a4e1a50070704 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"Zlib",
"LicenseRef-scancode-khronos",
"BSL-1.0",
"BSD-2-Clause"
] | permissive | elix22/Urho3D | c57c7ecb58975f51fabb95bcc4330bc5b0812de7 | 99902ae2a867be0d6dbe4c575f9c8c318805ec64 | refs/heads/master | 2023-06-01T01:19:57.155566 | 2021-12-07T16:47:20 | 2021-12-07T17:46:58 | 165,504,739 | 21 | 4 | MIT | 2021-11-05T01:02:08 | 2019-01-13T12:51:17 | C++ | UTF-8 | C++ | false | false | 2,560 | h | // Copyright (c) 2019 Google LLC
//
// 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 SOURCE_OPT_WRAP_OPKILL_H_
#define SOURCE_OPT_WRAP_OPKILL_H_
#include "source/opt/pass.h"
namespace spvtools {
namespace opt {
// Documented in optimizer.hpp
class WrapOpKill : public Pass {
public:
WrapOpKill() : void_type_id_(0) {}
const char* name() const override { return "wrap-opkill"; }
Status Process() override;
IRContext::Analysis GetPreservedAnalyses() override {
return IRContext::kAnalysisDefUse |
IRContext::kAnalysisInstrToBlockMapping |
IRContext::kAnalysisDecorations | IRContext::kAnalysisCombinators |
IRContext::kAnalysisNameMap | IRContext::kAnalysisBuiltinVarId |
IRContext::kAnalysisIdToFuncMapping | IRContext::kAnalysisConstants |
IRContext::kAnalysisTypes;
}
private:
// Replaces the OpKill instruction |inst| with a function call to a function
// that contains a single instruction, which is OpKill. An OpUnreachable
// instruction will be placed after the function call. Return true if
// successful.
bool ReplaceWithFunctionCall(Instruction* inst);
// Returns the id of the void type.
uint32_t GetVoidTypeId();
// Returns the id of the function type for a void function with no parameters.
uint32_t GetVoidFunctionTypeId();
// Return the id of a function that has return type void, has no parameters,
// and contains a single instruction, which is an OpKill. Returns 0 if the
// function could not be generated.
uint32_t GetOpKillFuncId();
// The id of the void type. If its value is 0, then the void type has not
// been found or created yet.
uint32_t void_type_id_;
// The function that is a single instruction, which is an OpKill. The
// function has a void return type and takes no parameters. If the function is
// |nullptr|, then the function has not been generated.
std::unique_ptr<Function> opkill_function_;
};
} // namespace opt
} // namespace spvtools
#endif // SOURCE_OPT_WRAP_OPKILL_H_
| [
"elix22@gmail.com"
] | elix22@gmail.com |
312af9034dfb4c0f0889dce1eb970fa222b761a2 | 3fc186da30c820d82109a2aa45ae8e9b277f2b8f | /set-cover/main.cpp | d2afbc3519c8df2cb34c93d420a10faa1fd90a48 | [] | no_license | gaabrielfranco/np-hard-problems | 6ab2d050feea7ea45ddace32882492f0afeda2ff | 54f1de4aa5033a019fc770ef073f82f36a3d2bf5 | refs/heads/master | 2020-04-09T02:58:16.785003 | 2018-12-11T18:05:02 | 2018-12-11T18:05:02 | 159,962,747 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,273 | cpp | #include <algorithm>
#include <chrono>
#include <climits>
#include <cstring>
#include <iostream>
#include <set>
#include <vector>
typedef std::chrono::high_resolution_clock Clock;
/*
Calculates the cost of a MCC solution
Params:
- G: graph
- n: number of elements
- m: number of subsets
- subset: MCC solution
*/
size_t calc_cost(size_t* costs, size_t m, std::vector<size_t>& subset)
{
size_t total_cost = 0;
for (size_t i = 0; i < subset.size(); i++)
{
total_cost += costs[subset[i]];
}
return total_cost;
}
/*
Checks if a subset is a MCC solution
Params:
- G: graph
- n: number of elements
- m: number of subsets
- subset: possible MCC solution
*/
bool is_solution(std::vector<std::vector<size_t>>& G, size_t n, size_t m,
std::vector<size_t>& subset)
{
bool visited[n] = {false};
for (size_t i = 0; i < subset.size(); i++)
{
for (size_t j = 0; j < G[subset[i]].size(); j++)
{
visited[G[subset[i]][j] - 1] = true;
}
}
for (size_t i = 0; i < n; i++)
{
if (!visited[i])
{
return false;
}
}
return true;
}
/*
MCC solver using a brute force algorithm
Params:
- G: graph
- n: number of elements
- m: number of subsets
- costs: array of costs of each subset
*/
void brute_force_solver(std::vector<std::vector<size_t>>& G, size_t n, size_t m,
size_t* costs)
{
std::vector<size_t> subset, min_subset;
size_t min_cost = ULLONG_MAX;
// Generates all subsets
for (size_t i = 0; i < (1 << m); i++)
{
for (size_t j = 0; j < m; j++)
{
if ((i & (1 << j)) != 0)
{
subset.push_back(j);
}
}
if (!subset.empty())
{
if (is_solution(G, n, m, subset))
{
size_t cost = calc_cost(costs, m, subset);
if (cost < min_cost)
{
min_cost = cost;
min_subset = subset;
}
}
subset.clear();
}
}
std::cout << "Solution:\n{ ";
for (size_t i = 0; i < min_subset.size(); i++)
{
std::cout << min_subset[i] + 1 << " ";
}
std::cout << "} with cost = ";
std::cout << min_cost << std::endl;
}
/*
MCC solver using a greedy algorithm
Params:
- G_reverse: graph
- n: number of elements
- m: number of subsets
- costs: array of costs of each subset
*/
void greedy_solver(std::vector<std::vector<size_t>>& G,
std::vector<std::vector<size_t>>& G_reverse, size_t n,
size_t m, size_t* costs)
{
std::set<size_t> greedy_sol;
std::vector<size_t> v;
for (size_t i = 0; i < n; i++)
{
G_reverse.push_back(v);
}
for (size_t i = 0; i < m; i++)
{
for (size_t j = 0; j < G[i].size(); j++)
{
if (G_reverse[G[i][j] - 1].empty())
{
// Putting the subset
G_reverse[G[i][j] - 1].push_back(i);
}
else
{
bool was_inserted = false;
// Putting the subset ordered by cost
for (size_t k = 0; k < G_reverse[G[i][j] - 1].size(); k++)
{
if (costs[i] <= costs[G_reverse[G[i][j] - 1][k]])
{
G_reverse[G[i][j] - 1].insert(
G_reverse[G[i][j] - 1].begin() + k, i);
was_inserted = true;
break;
}
}
if (!was_inserted)
{
G_reverse[G[i][j] - 1].push_back(i);
}
}
}
}
for (size_t i = 0; i < n; i++)
{
greedy_sol.insert(G_reverse[i][0]);
}
size_t min_cost = 0;
std::cout << "\nUsing Greedy\n";
std::cout << "Solution:\n{ ";
for (auto i = greedy_sol.begin(); i != greedy_sol.end(); i++)
{
std::cout << *i + 1 << " ";
min_cost += costs[*i];
}
std::cout << "} with cost = ";
std::cout << min_cost << std::endl;
}
int main(int argc, char** argv)
{
size_t n, m, element;
char c;
std::vector<std::vector<size_t>> G;
std::vector<std::vector<size_t>> G_reverse;
size_t costs[1000];
std::vector<size_t> v;
if (argc == 1 ||
(argc == 2 && (strcmp(argv[1], "-bf") && strcmp(argv[1], "-gr") &&
strcmp(argv[1], "-all"))))
{
std::cout
<< "-bf: Executes the brute force algorithm\n-gr: Executes the "
"greedy algorithm\n-all: Executes both algorithms\n";
return 0;
}
// Input
scanf("%zu %zu", &n, &m);
for (size_t i = 0; i < m; i++)
{
while (scanf("%zu%c", &element, &c))
{
v.push_back(element);
if (c == '\n')
{
G.push_back(v);
v.clear();
break;
}
}
}
for (size_t i = 0; i < m; i++)
{
std::cin >> costs[i];
}
if (!strcmp(argv[1], "-bf") || !strcmp(argv[1], "-all"))
{
// Brute force solution
std::cout << "\nUsing Brute Force\n";
auto start = Clock::now();
brute_force_solver(G, n, m, costs);
auto end = Clock::now();
std::cout << "Brute Force duration: ";
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(
end - start)
.count();
std::cout << "ms\n";
}
if (!strcmp(argv[1], "-gr") || !strcmp(argv[1], "-all"))
{
// Greedy solution
auto start = Clock::now();
greedy_solver(G, G_reverse, n, m, costs);
auto end = Clock::now();
std::cout << "Greedy duration: ";
std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(
end - start)
.count();
std::cout << "ms\n";
}
return 0;
} | [
"gabriel.vita@ufv.br"
] | gabriel.vita@ufv.br |
2251fd2852f507d74b21381a9c0e40c40073760d | c97b7dd61e049b95a49d794f077c274b7955cff4 | /server/server/ObjectBase.cpp | 41cb7e4346fb80ea520e6ad22f8072a15d7d6a6d | [] | no_license | ilvuos/ipc | b341a7b07ae3d03c4ddf385c1839dad29226461a | a23bbbe7d6f1e16610e970e0b81b74a2b478dce9 | refs/heads/master | 2020-06-28T04:50:30.757524 | 2017-07-14T12:35:15 | 2017-07-14T12:35:15 | 97,089,495 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 111 | cpp | #include "stdafx.h"
#include "ObjectBase.h"
CObjectBase::CObjectBase()
{
}
CObjectBase::~CObjectBase()
{
}
| [
"ilvuos@126.com"
] | ilvuos@126.com |
453f3d7e4edf87e29cbb89431c5f949c5d30eca0 | 749e6814d6488aea461676385780d847e07fd380 | /Core/GDCore/IDE/Events/ExpressionsRenamer.h | 73f028690c1a256041d2543077d2d40321f0efb3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | 4ian/GDevelop | 258a007a2aa74bfd97c75a6c1753bc3fd48e634f | 134886eedcfaeaa04139463aaf826b71c11819c5 | refs/heads/master | 2023-08-18T23:14:56.149709 | 2023-08-18T20:39:40 | 2023-08-18T20:39:40 | 21,331,090 | 4,722 | 748 | NOASSERTION | 2023-09-14T21:40:54 | 2014-06-29T19:58:38 | JavaScript | UTF-8 | C++ | false | false | 2,060 | h | /*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#ifndef ExpressionsRenamer_H
#define ExpressionsRenamer_H
#include <map>
#include <memory>
#include <vector>
#include "GDCore/IDE/Events/ArbitraryEventsWorker.h"
#include "GDCore/String.h"
namespace gd {
class BaseEvent;
class Platform;
class EventsList;
} // namespace gd
namespace gd {
/**
* \brief Replace in expressions, in parameters of actions or conditions, calls
* to a function by another function.
*
* \ingroup IDE
*/
class GD_CORE_API ExpressionsRenamer : public ArbitraryEventsWorkerWithContext {
public:
ExpressionsRenamer(const gd::Platform &platform_) : platform(platform_){};
virtual ~ExpressionsRenamer();
ExpressionsRenamer &SetReplacedFreeExpression(
const gd::String &oldFunctionName_, const gd::String &newFunctionName_) {
objectType = "";
behaviorType = "";
oldFunctionName = oldFunctionName_;
newFunctionName = newFunctionName_;
return *this;
}
ExpressionsRenamer &SetReplacedObjectExpression(
const gd::String &objectType_,
const gd::String &oldFunctionName_,
const gd::String &newFunctionName_) {
objectType = objectType_;
behaviorType = "";
oldFunctionName = oldFunctionName_;
newFunctionName = newFunctionName_;
return *this;
};
ExpressionsRenamer &SetReplacedBehaviorExpression(
const gd::String &behaviorType_,
const gd::String &oldFunctionName_,
const gd::String &newFunctionName_) {
objectType = "";
behaviorType = behaviorType_;
oldFunctionName = oldFunctionName_;
newFunctionName = newFunctionName_;
return *this;
};
private:
bool DoVisitInstruction(gd::Instruction &instruction,
bool isCondition) override;
const gd::Platform &platform;
gd::String oldFunctionName;
gd::String newFunctionName;
gd::String behaviorType;
gd::String objectType;
};
} // namespace gd
#endif // ExpressionsRenamer_H
| [
"Florian.Rival@gmail.com"
] | Florian.Rival@gmail.com |
5d11143430af8a3748d66a224d8f98350863812c | e029526c2fe719c4ebe88881e8e54f03ed44a25c | /cryptonote/include/INode.h | 18256d22670f21416fbe6f26c28bce63ccb03e04 | [
"MIT"
] | permissive | VortexTech/FTSCOIN | c4b2e443b77ec51627deb7215ae0289f43aab537 | d9b682e0ec1260ccdedf1e474eb6ca6d15642334 | refs/heads/master | 2020-12-22T16:36:47.467747 | 2020-02-08T06:14:37 | 2020-02-08T06:14:37 | 238,838,103 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 4,393 | h | // Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2020 The Circle Foundation & FTSCoin Devs
// Copyright (c) 2020-2019 FTSCoin Network & FTSCoin Devs
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <cstdint>
#include <functional>
#include <system_error>
#include <vector>
#include "crypto/crypto.h"
#include "CryptoNoteCore/CryptoNoteBasic.h"
#include "CryptoNoteProtocol/CryptoNoteProtocolDefinitions.h"
#include "Rpc/CoreRpcServerCommandsDefinitions.h"
#include "BlockchainExplorerData.h"
#include "ITransaction.h"
namespace CryptoNote {
class INodeObserver {
public:
virtual ~INodeObserver() {}
virtual void peerCountUpdated(size_t count) {}
virtual void localBlockchainUpdated(uint32_t height) {}
virtual void lastKnownBlockHeightUpdated(uint32_t height) {}
virtual void poolChanged() {}
virtual void blockchainSynchronized(uint32_t topHeight) {}
};
struct OutEntry {
uint32_t outGlobalIndex;
Crypto::PublicKey outKey;
};
struct OutsForAmount {
uint64_t amount;
std::vector<OutEntry> outs;
};
struct TransactionShortInfo {
Crypto::Hash txId;
TransactionPrefix txPrefix;
};
struct BlockShortEntry {
Crypto::Hash blockHash;
bool hasBlock;
CryptoNote::Block block;
std::vector<TransactionShortInfo> txsShortInfo;
};
class INode {
public:
typedef std::function<void(std::error_code)> Callback;
virtual ~INode() {}
virtual bool addObserver(INodeObserver* observer) = 0;
virtual bool removeObserver(INodeObserver* observer) = 0;
virtual void init(const Callback& callback) = 0;
virtual bool shutdown() = 0;
virtual size_t getPeerCount() const = 0;
virtual uint32_t getLastLocalBlockHeight() const = 0;
virtual uint32_t getLastKnownBlockHeight() const = 0;
virtual uint32_t getLocalBlockCount() const = 0;
virtual uint32_t getKnownBlockCount() const = 0;
virtual uint64_t getLastLocalBlockTimestamp() const = 0;
virtual void relayTransaction(const Transaction& transaction, const Callback& callback) = 0;
virtual void getRandomOutsByAmounts(std::vector<uint64_t>&& amounts, uint64_t outsCount, std::vector<CryptoNote::COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::outs_for_amount>& result, const Callback& callback) = 0;
virtual void getNewBlocks(std::vector<Crypto::Hash>&& knownBlockIds, std::vector<CryptoNote::block_complete_entry>& newBlocks, uint32_t& startHeight, const Callback& callback) = 0;
virtual void getTransactionOutsGlobalIndices(const Crypto::Hash& transactionHash, std::vector<uint32_t>& outsGlobalIndices, const Callback& callback) = 0;
virtual void queryBlocks(std::vector<Crypto::Hash>&& knownBlockIds, uint64_t timestamp, std::vector<BlockShortEntry>& newBlocks, uint32_t& startHeight, const Callback& callback) = 0;
virtual void getPoolSymmetricDifference(std::vector<Crypto::Hash>&& knownPoolTxIds, Crypto::Hash knownBlockId, bool& isBcActual, std::vector<std::unique_ptr<ITransactionReader>>& newTxs, std::vector<Crypto::Hash>& deletedTxIds, const Callback& callback) = 0;
virtual void getMultisignatureOutputByGlobalIndex(uint64_t amount, uint32_t gindex, MultisignatureOutput& out, const Callback& callback) = 0;
virtual void getBlocks(const std::vector<uint32_t>& blockHeights, std::vector<std::vector<BlockDetails>>& blocks, const Callback& callback) = 0;
virtual void getBlocks(const std::vector<Crypto::Hash>& blockHashes, std::vector<BlockDetails>& blocks, const Callback& callback) = 0;
virtual void getBlocks(uint64_t timestampBegin, uint64_t timestampEnd, uint32_t blocksNumberLimit, std::vector<BlockDetails>& blocks, uint32_t& blocksNumberWithinTimestamps, const Callback& callback) = 0;
virtual void getTransactions(const std::vector<Crypto::Hash>& transactionHashes, std::vector<TransactionDetails>& transactions, const Callback& callback) = 0;
virtual void getTransactionsByPaymentId(const Crypto::Hash& paymentId, std::vector<TransactionDetails>& transactions, const Callback& callback) = 0;
virtual void getPoolTransactions(uint64_t timestampBegin, uint64_t timestampEnd, uint32_t transactionsNumberLimit, std::vector<TransactionDetails>& transactions, uint64_t& transactionsNumberWithinTimestamps, const Callback& callback) = 0;
virtual void isSynchronized(bool& syncStatus, const Callback& callback) = 0;
};
}
| [
"pablob07@mail.com"
] | pablob07@mail.com |
e0efa7894187b485443c8d3615f21439ade9c0a0 | 7024e065b74745c39d1255a8c2cd6070b4a40a22 | /src/transform/cross_entropy_binary.cc | 2da7aabf4a2633acadda477f1267b5af1bf55edb | [] | no_license | ABadCandy/blitz | 3f8db069efbd3d4a23591b7cc981c7d39fbe8d1e | 0cad76e3a8d470b48e80edd8ff11d6f0b095cb73 | refs/heads/master | 2021-01-14T11:20:37.553062 | 2016-08-13T08:30:31 | 2016-08-13T08:30:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 843 | cc | #include "transform/cross_entropy_binary.h"
#include "backend/backends.h"
namespace blitz {
template<template <typename> class TensorType, typename DType>
DType CrossEntropyBinary<TensorType, DType>::Apply(
const shared_ptr<TensorType<DType> > output,
const shared_ptr<TensorType<DType> > target) {
return Backend<TensorType, DType>::CrossEntropyBinaryApplyFunc(
output.get(), target.get());
}
template<template <typename> class TensorType, typename DType>
void CrossEntropyBinary<TensorType, DType>::Derivative(
const shared_ptr<TensorType<DType> > output,
const shared_ptr<TensorType<DType> > target,
shared_ptr<TensorType<DType> > result) {
Backend<TensorType, DType>::CrossEntropyBinaryDerivativeFunc(
output.get(), target.get(), result.get());
}
INSTANTIATE_CLASS(CrossEntropyBinary);
} // namespace blitz
| [
"robinho364@gmail.com"
] | robinho364@gmail.com |
27fb41ecc397da3396544a99ea0c53b96a909e14 | 2bbe280cac6f3614d371a85c0b99cf3fbf0d2152 | /ServerSetting.h | bbaaae67e3651a201d5b6ad43d48756592f1366a | [] | no_license | hikanashi/mockhttpd | 1a7c0809c34460ac7e4c77800a6ac98996ac92ed | cd9e9acff8005d24561f567a3ad42b64bbd3e587 | refs/heads/master | 2021-06-27T02:05:52.066230 | 2021-01-27T14:07:38 | 2021-01-27T14:07:38 | 213,154,700 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,098 | h | #ifndef SERVERSETTING_H_
#define SERVERSETTING_H_
#include "Common.h"
#include "HttpHeader.h"
#include <string>
typedef struct _SettingConnection
{
std::string port_http;
std::string port_https;
std::string node;
bool enable_tls;
bool use_proxymode;
SSL_CTX* ssl_ctx;
std::string certificate_chain;
std::string private_key;
bool enable_clientverify;
intptr_t verify_depth;
std::string client_certificate;
bool enable_ocsp_stapling;
std::string stapling_file;
bool verify_stapling;
struct timeval exit_time; // sec, usec
_SettingConnection()
: port_http(std::string("80"))
, port_https(std::string("443"))
, node(std::string("127.0.0.1"))
, enable_tls(true)
, use_proxymode(false)
, ssl_ctx(nullptr)
, certificate_chain("/opt/local/SSL/svr1CA.pem")
, private_key("/opt/local/SSL/svr1key.pem")
, enable_clientverify(true)
, verify_depth(3)
, client_certificate("/opt/local/SSL/rootCA.pem")
, enable_ocsp_stapling(false)
, stapling_file("/opt/local/SSL/ocsp_response.der")
, verify_stapling(false)
, exit_time()
{}
} SettingConnection;
#endif | [
"hikanashi@gmail.com"
] | hikanashi@gmail.com |
7eb857d336e4f33d27ea57e837f35232da8870f9 | 988413076cd53832ed9b0041770b64346f162201 | /src/misaxx-imaging/include/misaxx/imaging/descriptions/misa_image_stack_description.h | 65d021eac0fd70e40c275b0ce309bb5acefe57ad | [
"BSD-2-Clause"
] | permissive | applied-systems-biology/misa-framework | 1a1edb7208009e92d8e34e6e749f1efe6a758840 | e7a303ccfd79e41f45df5fa79e52e24bdf4123d9 | refs/heads/master | 2023-08-20T12:46:10.905828 | 2023-08-12T12:19:06 | 2023-08-12T12:19:06 | 181,515,264 | 2 | 2 | null | 2023-09-06T18:43:36 | 2019-04-15T15:27:13 | HTML | UTF-8 | C++ | false | false | 1,271 | h | /**
* Copyright by Ruman Gerst
* Research Group Applied Systems Biology - Head: Prof. Dr. Marc Thilo Figge
* https://www.leibniz-hki.de/en/applied-systems-biology.html
* HKI-Center for Systems Biology of Infection
* Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Insitute (HKI)
* Adolf-Reichwein-Straße 23, 07745 Jena, Germany
*
* This code is licensed under BSD 2-Clause
* See the LICENSE file provided with this code for the full license.
*/
#pragma once
#include <misaxx/core/descriptions/misa_file_stack_description.h>
namespace misaxx::imaging {
struct misa_image_stack_description : public misaxx::misa_file_stack_description {
using misaxx::misa_file_stack_description::misa_file_stack_description;
std::string get_documentation_name() const override;
std::string get_documentation_description() const override;
protected:
void build_serialization_id_hierarchy(std::vector<misaxx::misa_serialization_id> &result) const override;
};
inline void to_json(nlohmann::json& j, const misa_image_stack_description& p) {
p.to_json(j);
}
inline void from_json(const nlohmann::json& j, misa_image_stack_description& p) {
p.from_json(j);
}
}
| [
"ruman.gerst@leibniz-hki.de"
] | ruman.gerst@leibniz-hki.de |
c3940e7912b7ee9e660c70b08b69647ab1db1c1e | d11235048abad36a8f09b5881c225074869aca71 | /include/thrust/system/detail/generic/swap_ranges.inl | 4bf1334981a3e656a2b6a273a8becd6987df8a30 | [] | no_license | peu-oliveira/pibiti | 108057e196e7388a39916bf464d89d886d3e2cba | 7acfa9d173c7d2bd4d4406e030a8510ced8a3add | refs/heads/main | 2023-04-18T00:30:43.890808 | 2021-04-28T13:55:50 | 2021-04-28T13:55:50 | 306,166,539 | 1 | 0 | null | 2021-04-28T13:55:50 | 2020-10-21T22:54:45 | C | UTF-8 | C++ | false | false | 2,452 | inl | /*
* Copyright 2008-2013 NVIDIA Corporation
*
* 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 <thrust/detail/config.h>
#include <thrust/system/detail/generic/swap_ranges.h>
#include <thrust/tuple.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/detail/internal_functional.h>
#include <thrust/for_each.h>
namespace thrust
{
namespace system
{
namespace detail
{
namespace generic
{
namespace detail
{
// XXX define this here rather than in internal_functional.h
// to avoid circular dependence between swap.h & internal_functional.h
struct swap_pair_elements
{
template <typename Tuple>
__host__ __device__
void operator()(Tuple t)
{
// use unqualified swap to allow ADL to catch any user-defined swap
using thrust::swap;
swap(thrust::get<0>(t), thrust::get<1>(t));
}
}; // end swap_pair_elements
} // end detail
template<typename DerivedPolicy,
typename ForwardIterator1,
typename ForwardIterator2>
__host__ __device__
ForwardIterator2 swap_ranges(thrust::execution_policy<DerivedPolicy> &exec,
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2)
{
typedef thrust::tuple<ForwardIterator1,ForwardIterator2> IteratorTuple;
typedef thrust::zip_iterator<IteratorTuple> ZipIterator;
ZipIterator result = thrust::for_each(exec,
thrust::make_zip_iterator(thrust::make_tuple(first1, first2)),
thrust::make_zip_iterator(thrust::make_tuple(last1, first2)),
detail::swap_pair_elements());
return thrust::get<1>(result.get_iterator_tuple());
} // end swap_ranges()
} // end generic
} // end detail
} // end system
} // end thrust
| [
"pepeuguimaraes@gmail.com"
] | pepeuguimaraes@gmail.com |
464db4a8d27956fb23499957df0d1a30ce60f155 | d1c567d49963a4e835bb1e2c680708fc621b224e | /shortest_path/src/graph_fhandler.cpp | b22a0c65f73fba6edef01a701e9b2e40bc961f18 | [] | no_license | droptablestar/parallel_computing | 3e253188351a4378a357334a948b72ca34301e9f | 322901362d220660a0d0467f5615beb5693b4840 | refs/heads/master | 2021-08-23T16:31:23.900574 | 2017-12-05T17:44:56 | 2017-12-05T17:44:56 | 113,211,135 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,117 | cpp | /*
* graph_fhandler: A file handler for graphs of the form
* Destination\tSource\tInfo
*
* @author jreese
*/
#include <iostream>
#include "../include/graph_fhandler.hpp"
using namespace std;
/**
* Constructs a new fhandler object
*
* @param filename the name of the file to read from
*/
graph_fhandler::graph_fhandler(const char *filename):
filename(filename), file(NULL){
} // graph_fhandler()
/**
* Deconstructs a fhandler object
*
* Releases memory allocated by the file handler and closes the file.
*/
graph_fhandler::~graph_fhandler() {
close();
free_file();
} // ~graph_fhandler()
/**
* Opens the file this handler is operating on
*/
int graph_fhandler::open() {
inputfile.open(filename, ios::in);
if (inputfile.is_open()) return 1;
else {er+="Error opening file\n"; return 0;}
} // open()
/**
* Closes the file this handler is operating on
*/
void graph_fhandler::close() {
if (inputfile.is_open()) inputfile.close();
} // close()
/**
* Obtains the size of the file (in bytes), reads it into memory, and stores
* the result in the file variable
*/
int graph_fhandler::read_file() {
long begin, end;
if (!open()) return 0;
begin = inputfile.tellg();
inputfile.seekg(0, ios::end);
end = inputfile.tellg();
inputfile.seekg(0, ios::beg);
long nbytes = end-begin;
file = (char *)operator new(sizeof(char) * nbytes);
inputfile.read(file, nbytes);
return 1;
} // read_file()
/**
* Deletes the memory allocated for the file. This should be called when
* the file is no longer needed (e.g. when the parser is finished
* constructing the node objects.
*/
void graph_fhandler::free_file() {
if (file) {
delete file;
file = NULL;
}
} // free_file()
/**
* Returns the contents of the file
*
* @return the contents of the file
*/
char *graph_fhandler::get_data() {
return file;
} // get_data()
/**
* Returns any errors associated with opening and reading this file
*
* @return the contents of the error log
*/
string graph_fhandler::get_error() {
return er;
} // get_error()
| [
"jreeseue@gmail.com"
] | jreeseue@gmail.com |
5604a3ba757baea63b0c38783ee7e124fc783669 | 667b9da1fd47acf44cf95124c9695dd8c6fb2522 | /jobDisph.cpp | 36cb23e0f4743eff392f030385f8023a84993b44 | [] | no_license | cnzoupeng/ltServ | 989c4a74b861e74d4ce6b1f145480a69f7775fe8 | b6a5200ae08ed3b2fbc15249e7b35754106f52c3 | refs/heads/master | 2020-05-25T09:49:07.128346 | 2013-09-12T15:11:56 | 2013-09-12T15:11:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,446 | cpp |
#include "jobDisph.h"
#include <sys/sysinfo.h>
#include <cassert>
#include "numUpdate.h"
#include <cstring>
#include <cerrno>
int JobDisph::run()
{
_thdCount = get_nprocs();
_thdCount *= 8;
if (_thdCount > MAX_THREAD)
{
_thdCount = MAX_THREAD;
}
for (int i = 0; i < _thdCount; ++i)
{
if (pthread_create(&_thids[i], NULL, JobDisph::_runRecv, this) != 0)
{
return -1;
}
pthread_detach(_thids[i]);
}
return 0;
}
void* JobDisph::_runRecv(void* arg)
{
NetCore& netCore = NetCore::getInst();
ReqData* req = NULL;
while(1)
{
req = netCore.getReq();
switch(req->head.job)
{
case JOB_HISTORY:
_historyGet(req);
break;
default:
netCore.close(req->sock.sock);
break;
}
}
return NULL;
}
void JobDisph::_historyGet(ReqData* req)
{
assert(req != NULL);
NetCore& netCore = NetCore::getInst();
NumUpdate& numUp = NumUpdate::getInst();
int mustLen = sizeof(CommHead) + sizeof(ReqHis);
if (req->len != mustLen)
{
LogErr("Recv len wrong =%d wanted=%d\n", req->len, mustLen);
netCore.close(req->sock.sock);
delete req;
return;
}
if (req->head.len != (u32)mustLen)
{
LogErr("Recv head.len wrong =%d wanted=%d\n", req->head.len, mustLen);
netCore.close(req->sock.sock);
delete req;
return;
}
string hisStr;
ReqHis* reqHis = (ReqHis*)req->data;
reqHis->start = ntohl(reqHis->start);
reqHis->stop = ntohl(reqHis->stop);
LogMsg("REQ: JOB_HISTORY: %d--%d\n", reqHis->start, reqHis->stop);
if (numUp.get_range_str(reqHis->start, reqHis->stop, hisStr) < 0)
{
//netCore.close(req->sock.sock);
//delete req;
//return;
}
int resLen = sizeof(ResData);
if (hisStr.length() > 0)
{
resLen += hisStr.length() + 1;
}
ResData* res = (ResData*)new char[resLen];
res->head.key = 0;
res->head.magic = ntohl(LT_MAGIC);
res->head.job = ntohl(JOB_HISTORY);
res->head.len = ntohl(resLen);
res->result = 0;
if (hisStr.length() > 0)
{
strcpy(res->data, hisStr.c_str());
}
char* pSend = (char*)res;
int freg = resLen / TCP_FREG_LEG;
int minLen = resLen % TCP_FREG_LEG;
for (int i = freg; i > 0; --i)
{
if(netCore.send(&req->sock, pSend, TCP_FREG_LEG) != TCP_FREG_LEG)
{
LogErr("Send failed %s\n", strerror(errno));
break;
}
pSend += TCP_FREG_LEG;
}
if (minLen > 0)
{
if(netCore.send(&req->sock, pSend, minLen) != minLen)
{
LogErr("Send failed %s\n", strerror(errno));
}
}
netCore.close(req->sock.sock);
delete req;
delete res;
} | [
"zou.peng.cn@gmail.com"
] | zou.peng.cn@gmail.com |
fd9370181fb520dbb9191490bd327fb00bbca9c2 | 559207eb5beae4ba9fd638d19bd3009cbe3a6d11 | /src/mod_spdy/common/testing/notification.h | 169978ce769261485e10f6c00b1e76d15308c314 | [
"Apache-2.0"
] | permissive | voku/mod-spdy | 2a8989668fe0c0f0de48c0b7ecd85b5b5b554ed1 | bcfb388cbc5415ee660c2b5dbcf61f6f43c2a5ca | refs/heads/master | 2023-04-05T09:50:46.847114 | 2015-03-19T17:58:09 | 2015-03-19T17:58:09 | 32,537,692 | 0 | 0 | NOASSERTION | 2023-04-04T01:40:41 | 2015-03-19T17:56:26 | C++ | UTF-8 | C++ | false | false | 1,807 | h | // Copyright 2012 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MOD_SPDY_COMMON_TESTING_NOTIFICATION_H_
#define MOD_SPDY_COMMON_TESTING_NOTIFICATION_H_
#include "base/basictypes.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
namespace base { class TimeDelta; }
namespace mod_spdy {
namespace testing {
// A Notification allows one thread to Wait() until another thread calls Set()
// at least once. In order to help avoid deadlock, Set() is also called by the
// destructor.
class Notification {
public:
Notification();
~Notification();
// Set the notification.
void Set();
// Block until the notification is set.
void Wait();
// In a unit test, expect that the notification has not yet been set.
void ExpectNotSet();
// In a unit test, expect that the notification is currently set, or becomes
// set by another thread within the give time delta.
void ExpectSetWithin(const base::TimeDelta& delay);
void ExpectSetWithinMillis(int millis);
private:
base::Lock lock_;
base::ConditionVariable condvar_;
bool is_set_;
DISALLOW_COPY_AND_ASSIGN(Notification);
};
} // namespace testing
} // namespace mod_spdy
#endif // MOD_SPDY_COMMON_TESTING_NOTIFICATION_H_
| [
"ptrck@blck.io"
] | ptrck@blck.io |
6d5b0a400ab531e4b5538e0f6b7c7fbb877a0005 | 404c2d59e5d3a8a296c2ccbd11ce95b52e193eb7 | /examples/abc_example/a_code/vFinal/clientA_lb_in_A.cpp | 59981d668ef1bee5cccce6949069f66cce0a8190 | [] | no_license | copslock/libVNF | 6ff58151128687b43604f5f5f6d00dc73273d3c2 | faee34feb2d6e51e68ccd088e522cd92f18ee33a | refs/heads/master | 2023-02-03T10:50:28.102942 | 2018-06-03T14:02:37 | 2018-06-03T14:02:37 | 323,908,947 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,132 | cpp | #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <iostream>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <pthread.h>
#include <time.h>
#include <stdlib.h>
#include "common.h"
#include <vector>
#define MAX_THREADS 5
#define THC 1000
using namespace std;
int duration;
struct thread_data{
int id;
int status;
};
void printinput()
{
printf("Run : ./a.out <num-threads> <duration-seconds>\n");
}
long long diff(timespec start, timespec end)
{
timespec temp;
long long ret;
if ((end.tv_nsec-start.tv_nsec)<0) {
temp.tv_sec = end.tv_sec-start.tv_sec-1;
temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
} else {
temp.tv_sec = end.tv_sec-start.tv_sec;
temp.tv_nsec = end.tv_nsec-start.tv_nsec;
}
ret = (temp.tv_sec * 1000000000) + temp.tv_nsec;
return ret;
}
void *action(void *arg)
{
int socketfd, portno, n;
struct sockaddr_in rcvr_addr;
time_t start,end;
double elapsed;
int my_duration = duration;
timespec time1, time2;
long long lat,t;
vector<long long> callat;
struct thread_data *my_data;
my_data = (struct thread_data *) arg;
int i = my_data->id;
char buf[100];
strcpy(buf,"heelo");
// srand(time(NULL));
// int r;
// r = rand() % 10000;
// r += i;
// rcvr = gethostbyname("169.254.9.33");
portno = 5000;
rcvr_addr.sin_family = AF_INET;
// rcvr_addr.sin_addr.s_addr = inet_addr("169.254.9.33"); //3 core b
// rcvr_addr.sin_addr.s_addr = inet_addr("169.254.9.88"); //lb
// rcvr_addr.sin_addr.s_addr = inet_addr("169.254.9.28"); //1 core b
rcvr_addr.sin_port = htons(portno);
start = time(NULL);
t = 0;
while(1)
{
end=time(NULL);
elapsed = difftime(end,start);
// cout<<"start "<<start<<" end "<<end<<" elapsed "<<elapsed<<" duration "<<duration<<endl;
if(elapsed >= my_duration)
break;
t++;
if(t == 50)
{
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1);
}
// usleep(2000);
socketfd = socket(AF_INET, SOCK_STREAM, 0);
if (socketfd < 0) {
cout<<"Error: Opening Socket"<<'\n';
exit(-1);
}
/* bzero((char *) &rcvr_addr, sizeof(rcvr_addr));
rcvr_addr.sin_family = AF_INET;
bcopy((char *)rcvr->h_addr, (char *)&rcvr_addr.sin_addr.s_addr, rcvr->h_length);
rcvr_addr.sin_port = htons(portno);
*/
if(socketfd%2==0){
rcvr_addr.sin_addr.s_addr = inet_addr("169.254.9.28"); //1 core b
}
else
rcvr_addr.sin_addr.s_addr = inet_addr("169.254.9.13"); //1 core b
if(connect(socketfd, (struct sockaddr*)&rcvr_addr, sizeof(rcvr_addr)) < 0 ) {
cout<<"Error : connecting"<<'\n';
exit(-1);
}
// cout<<"\n\t\t\tconnecting"<<'\n';
//strcpy(buf,"heelo");
// sprintf(buf, "%d", r);
// sleep(1);
n = write(socketfd, buf, 5);
if(n <= 0){
cout<<"Error : Wirite Error"<<'\n';
close(socketfd);
//exit(-1);
continue;
}
// cout<<"Sent: \n";
n = read(socketfd, buf, 5);
if( n <= 0) {
cout<<"Error: Read Error"<<'\n';
close(socketfd);
//exit(-1);
continue;
}
//cout<<"\tRcvd : \t"<<buf<<'\n';
// cout<<"\tRcvd"<<socketfd<<endl; //sep25
// sleep(1);
//}
// }
close(socketfd);
if(t == 50)
{
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);
lat = diff(time1, time2);
//cout<<lat<<endl;
callat.push_back(lat);
t = 0;
}
}
//cout<<"T: Exiting"<<i<<'\n';
/*lat = 0;
for(t = 0; t < callat.size(); t++)
{
lat += callat[t];
}
//cout<<"Latency for "<<t<<" : "<<lat<<endl;
lat = lat/t;
cout<<"Latency for "<<i<<" :"<<lat<<';'<<endl;*/
//cout<<"Thread exiting "<<i<<endl;
lat = 0;
for(t = 0; t < callat.size(); t++)
{
lat += callat[t];
}
//cout<<"Latency for "<<t<<" : "<<lat<<endl;
lat = lat/t;
// sleep(2);
cout<<"Latency for "<<i<<" :"<<lat<<';'<<endl;
pthread_exit(NULL);
}
int main(int argc, char *argv[])
{
int i,n,numth,rc;
if(argc != 3)
{
printinput();
exit(0);
}
numth = atoi(argv[1]);
duration = atoi(argv[2]);
pthread_t th[THC];
struct thread_data td[THC];
pthread_attr_t attr;
void *status;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
for(i = 0; i < numth;i++)
{ td[i].id = i;
//td[i].status = 0;
rc = pthread_create(&th[i], &attr, action, (void *)&td[i]);
if(rc)
{
cout<<"Error thread"<<endl;
}
}
for(i = 0; i < numth; i++)
{
//td[i].status = 1;
rc = pthread_join(th[i], &status);
if (rc){
cout << "Error:unable to join," << rc << endl;
exit(-1);
}
//cout << " M: Joined with status " << status << endl;
}
pthread_exit(NULL);
}
| [
"ppnaik@cse.iitb.ac.in"
] | ppnaik@cse.iitb.ac.in |
3b60e02fbf83a08a89e0546b4ff44a4b3f89e63d | 2c2d6921ef641af90ca4a32e1eb809693509d335 | /3rdparty/inc/nua/nua.hh | 388033328abbda57ebae78e33e24ea30bf4ed80f | [] | no_license | lucklove/PM-Game-Server | 93187e8679395f6eb0efbffa165b3c1ec2b774ad | 3aeb8cc91a6ef97fe06d4369f287b02898622f27 | refs/heads/master | 2021-01-10T07:40:56.741576 | 2016-02-29T02:16:41 | 2016-02-29T02:16:41 | 48,524,042 | 4 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 703 | hh | #pragma once
#include <lua.hpp>
#include <iostream>
#include <type_traits>
#include <stdexcept>
#include <string>
#include <functional>
#include <memory>
#include <typeindex>
#include <tuple>
#include <vector>
#include "MetatableRegistry.hh"
#include "LuaRef.hh"
#include "ScopeGuard.hh"
#include "ExceptionHolder.hh"
#include "exception.hh"
#include "StackGuard.hh"
#include "ErrorHandler.hh"
#include "function.hh"
#include "primitives.hh"
#include "types.hh"
#include "stack.hh"
#include "BaseFunc.hh"
#include "utils.hh"
#include "ClassFunc.hh"
#include "Dtor.hh"
#include "Func.hh"
#include "Class.hh"
#include "Registry.hh"
#include "Selector.hh"
#include "Context.hh"
#include "function_impl.hh"
| [
"gnu.crazier@gmail.com"
] | gnu.crazier@gmail.com |
d1a846b82cf3125576ad3d4258a09ec0562f55bf | 484ec4d1331b94fe9c19fd282009d6618e9a1eef | /Real-Time Corruptor/BizHawk_RTC/waterbox/libsnes/bsnes/snes/cpu/dma/dma.cpp | e8cdb3ecc172122288e9cc3ff2b1b74279fac7e3 | [
"GPL-1.0-or-later",
"MIT"
] | permissive | mguid65/RTC3 | a565303fdfd1807a2516be5752c7b30a8be3d909 | 4082eb302f8e6e20ba621ec70308dab94985fe7f | refs/heads/master | 2020-04-13T16:57:31.933643 | 2018-12-31T16:03:39 | 2018-12-31T16:03:39 | 161,684,492 | 0 | 0 | MIT | 2018-12-13T19:19:17 | 2018-12-13T19:19:17 | null | UTF-8 | C++ | false | false | 7,593 | cpp | #ifdef CPU_CPP
void CPU::dma_add_clocks(unsigned clocks) {
status.dma_clocks += clocks;
add_clocks(clocks);
}
//=============
//memory access
//=============
bool CPU::dma_transfer_valid(uint8 bbus, uint32 abus) {
//transfers from WRAM to WRAM are invalid; chip only has one address bus
if(bbus == 0x80 && ((abus & 0xfe0000) == 0x7e0000 || (abus & 0x40e000) == 0x0000)) return false;
return true;
}
bool CPU::dma_addr_valid(uint32 abus) {
//A-bus access to B-bus or S-CPU registers are invalid
if((abus & 0x40ff00) == 0x2100) return false; //$[00-3f|80-bf]:[2100-21ff]
if((abus & 0x40fe00) == 0x4000) return false; //$[00-3f|80-bf]:[4000-41ff]
if((abus & 0x40ffe0) == 0x4200) return false; //$[00-3f|80-bf]:[4200-421f]
if((abus & 0x40ff80) == 0x4300) return false; //$[00-3f|80-bf]:[4300-437f]
return true;
}
uint8 CPU::dma_read(uint32 abus) {
if(dma_addr_valid(abus) == false) return 0x00;
return bus.read(abus);
}
//simulate two-stage pipeline for DMA transfers; example:
//cycle 0: read N+0
//cycle 1: write N+0 & read N+1 (parallel; one on A-bus, one on B-bus)
//cycle 2: write N+1 & read N+2 (parallel)
//cycle 3: write N+2
void CPU::dma_write(bool valid, unsigned addr, uint8 data) {
if(pipe.valid) bus.write(pipe.addr, pipe.data);
pipe.valid = valid;
pipe.addr = addr;
pipe.data = data;
}
void CPU::dma_transfer(bool direction, uint8 bbus, uint32 abus) {
if(direction == 0) {
dma_add_clocks(4);
regs.mdr = dma_read(abus);
dma_add_clocks(4);
dma_write(dma_transfer_valid(bbus, abus), 0x2100 | bbus, regs.mdr);
} else {
dma_add_clocks(4);
regs.mdr = dma_transfer_valid(bbus, abus) ? bus.read(0x2100 | bbus) : 0x00;
dma_add_clocks(4);
dma_write(dma_addr_valid(abus), abus, regs.mdr);
}
}
//===================
//address calculation
//===================
uint8 CPU::dma_bbus(unsigned i, unsigned index) {
switch(channel[i].transfer_mode) { default:
case 0: return (channel[i].dest_addr); //0
case 1: return (channel[i].dest_addr + (index & 1)); //0,1
case 2: return (channel[i].dest_addr); //0,0
case 3: return (channel[i].dest_addr + ((index >> 1) & 1)); //0,0,1,1
case 4: return (channel[i].dest_addr + (index & 3)); //0,1,2,3
case 5: return (channel[i].dest_addr + (index & 1)); //0,1,0,1
case 6: return (channel[i].dest_addr); //0,0 [2]
case 7: return (channel[i].dest_addr + ((index >> 1) & 1)); //0,0,1,1 [3]
}
}
inline uint32 CPU::dma_addr(unsigned i) {
uint32 r = (channel[i].source_bank << 16) | (channel[i].source_addr);
if(channel[i].fixed_transfer == false) {
if(channel[i].reverse_transfer == false) {
channel[i].source_addr++;
} else {
channel[i].source_addr--;
}
}
return r;
}
inline uint32 CPU::hdma_addr(unsigned i) {
return (channel[i].source_bank << 16) | (channel[i].hdma_addr++);
}
inline uint32 CPU::hdma_iaddr(unsigned i) {
return (channel[i].indirect_bank << 16) | (channel[i].indirect_addr++);
}
//==============
//channel status
//==============
uint8 CPU::dma_enabled_channels() {
uint8 r = 0;
for(unsigned i = 0; i < 8; i++) {
if(channel[i].dma_enabled) r++;
}
return r;
}
inline bool CPU::hdma_active(unsigned i) {
return (channel[i].hdma_enabled && !channel[i].hdma_completed);
}
inline bool CPU::hdma_active_after(unsigned i) {
for(unsigned n = i + 1; n < 8; n++) {
if(hdma_active(n) == true) return true;
}
return false;
}
inline uint8 CPU::hdma_enabled_channels() {
uint8 r = 0;
for(unsigned i = 0; i < 8; i++) {
if(channel[i].hdma_enabled) r++;
}
return r;
}
inline uint8 CPU::hdma_active_channels() {
uint8 r = 0;
for(unsigned i = 0; i < 8; i++) {
if(hdma_active(i) == true) r++;
}
return r;
}
//==============
//core functions
//==============
void CPU::dma_run() {
dma_add_clocks(8);
dma_write(false);
dma_edge();
for(unsigned i = 0; i < 8; i++) {
if(channel[i].dma_enabled == false) continue;
unsigned index = 0;
do {
dma_transfer(channel[i].direction, dma_bbus(i, index++), dma_addr(i));
dma_edge();
} while(channel[i].dma_enabled && --channel[i].transfer_size);
dma_add_clocks(8);
dma_write(false);
dma_edge();
channel[i].dma_enabled = false;
}
status.irq_lock = true;
}
void CPU::hdma_update(unsigned i) {
dma_add_clocks(4);
regs.mdr = dma_read((channel[i].source_bank << 16) | channel[i].hdma_addr);
dma_add_clocks(4);
dma_write(false);
if((channel[i].line_counter & 0x7f) == 0) {
channel[i].line_counter = regs.mdr;
channel[i].hdma_addr++;
channel[i].hdma_completed = (channel[i].line_counter == 0);
channel[i].hdma_do_transfer = !channel[i].hdma_completed;
if(channel[i].indirect) {
dma_add_clocks(4);
regs.mdr = dma_read(hdma_addr(i));
channel[i].indirect_addr = regs.mdr << 8;
dma_add_clocks(4);
dma_write(false);
if(!channel[i].hdma_completed || hdma_active_after(i)) {
dma_add_clocks(4);
regs.mdr = dma_read(hdma_addr(i));
channel[i].indirect_addr >>= 8;
channel[i].indirect_addr |= regs.mdr << 8;
dma_add_clocks(4);
dma_write(false);
}
}
}
}
void CPU::hdma_run() {
dma_add_clocks(8);
dma_write(false);
for(unsigned i = 0; i < 8; i++) {
if(hdma_active(i) == false) continue;
channel[i].dma_enabled = false; //HDMA run during DMA will stop DMA mid-transfer
if(channel[i].hdma_do_transfer) {
static const unsigned transfer_length[8] = { 1, 2, 2, 4, 4, 4, 2, 4 };
unsigned length = transfer_length[channel[i].transfer_mode];
for(unsigned index = 0; index < length; index++) {
unsigned addr = channel[i].indirect == false ? hdma_addr(i) : hdma_iaddr(i);
dma_transfer(channel[i].direction, dma_bbus(i, index), addr);
}
}
}
for(unsigned i = 0; i < 8; i++) {
if(hdma_active(i) == false) continue;
channel[i].line_counter--;
channel[i].hdma_do_transfer = channel[i].line_counter & 0x80;
hdma_update(i);
}
status.irq_lock = true;
}
void CPU::hdma_init_reset() {
for(unsigned i = 0; i < 8; i++) {
channel[i].hdma_completed = false;
channel[i].hdma_do_transfer = false;
}
}
void CPU::hdma_init() {
dma_add_clocks(8);
dma_write(false);
for(unsigned i = 0; i < 8; i++) {
if(!channel[i].hdma_enabled) continue;
channel[i].dma_enabled = false; //HDMA init during DMA will stop DMA mid-transfer
channel[i].hdma_addr = channel[i].source_addr;
channel[i].line_counter = 0;
hdma_update(i);
}
status.irq_lock = true;
}
//==============
//initialization
//==============
void CPU::dma_power() {
for(unsigned i = 0; i < 8; i++) {
channel[i].direction = 1;
channel[i].indirect = true;
channel[i].unused = true;
channel[i].reverse_transfer = true;
channel[i].fixed_transfer = true;
channel[i].transfer_mode = 7;
channel[i].dest_addr = 0xff;
channel[i].source_addr = 0xffff;
channel[i].source_bank = 0xff;
channel[i].transfer_size = 0xffff;
channel[i].indirect_bank = 0xff;
channel[i].hdma_addr = 0xffff;
channel[i].line_counter = 0xff;
channel[i].unknown = 0xff;
}
}
void CPU::dma_reset() {
for(unsigned i = 0; i < 8; i++) {
channel[i].dma_enabled = false;
channel[i].hdma_enabled = false;
channel[i].hdma_completed = false;
channel[i].hdma_do_transfer = false;
}
pipe.valid = false;
pipe.addr = 0;
pipe.data = 0;
}
#endif
| [
"philtre@live.ca"
] | philtre@live.ca |
d31479d2ee311554a81179dd7280a68798a58d37 | 4dbb45758447dcfa13c0be21e4749d62588aab70 | /iOS/Libraries/libil2cpp/include/utils/DirectoryUtils.h | 75a4f57db064ce5e54e17c282bdebfa755e13adf | [
"MIT"
] | permissive | mopsicus/unity-share-plugin-ios-android | 6dd6ccd2fa05c73f0bf5e480a6f2baecb7e7a710 | 3ee99aef36034a1e4d7b156172953f9b4dfa696f | refs/heads/master | 2020-12-25T14:38:03.861759 | 2016-07-19T10:06:04 | 2016-07-19T10:06:04 | 63,676,983 | 12 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 314 | h | #pragma once
#include <string>
namespace il2cpp
{
namespace utils
{
bool Match (const std::string name, size_t nameIndex, const std::string& pattern, const size_t patternIndex);
bool Match (const std::string name, const std::string& pattern);
std::string CollapseAdjacentStars(const std::string& pattern);
}
}
| [
"lii@rstgames.com"
] | lii@rstgames.com |
80a87e21966e3fed834307912cdab984bf3ea69d | bccfd081c3873ea983ac885749d7cf66b0955b75 | /ClientCocos2dx/Classes/Scene/WaitingScene.h | 1f0d2b2972fa84f1b4f13bda664301201db9b7b7 | [] | no_license | luuthevinh/battle-city-multiplayer | 7438bff40dffd84d579fdc32a28e55fc3011cadd | 052b504ae25edcc283117c73492ad9008a2291a1 | refs/heads/master | 2021-01-12T14:24:58.823956 | 2016-12-30T20:44:10 | 2016-12-30T20:46:12 | 69,934,878 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,721 | h | #ifndef __WAITING_SCENE_H__
#define __WAITING_SCENE_H__
#include "cocos2d.h"
#include "GameObject\TankCursor.h"
#include "ui\CocosGUI.h"
USING_NS_CC;
class Player;
class WaitingScene : public Layer
{
public:
WaitingScene();
~WaitingScene();
CREATE_FUNC(WaitingScene);
static Scene* createScene();
bool init() override;
void update(float dt) override;
void onKeyPressed(EventKeyboard::KeyCode keycode, Event* e);
void nameTextFieldEvent(Ref *pSender, cocos2d::ui::TextField::EventType type);
void playBtnTouchEvent(Ref* sender, ui::Widget::TouchEventType type);
void backBtnTouchEvent(Ref* sender, ui::Widget::TouchEventType type);
void joinBtnTouchEvent(Ref* sender, ui::Widget::TouchEventType type);
void decreaseBtnTouchEvent(Ref* sender, ui::Widget::TouchEventType type);
void increaseBtnTouchEvent(Ref* sender, ui::Widget::TouchEventType type);
void yellowBtnTouchEvent(Ref* sender, ui::Widget::TouchEventType type);
void greenBtnTouchEvent(Ref* sender, ui::Widget::TouchEventType type);
private:
// Layer* _playLayer;
TankCursor* _cursor;
// ui
ui::TextField* _textField;
ui::TextField* _addrTextField;
Sprite* _pointerInput;
Sprite* _pointerPlayerSelect;
Label* _greenTankNumber;
Label* _whiteTankNumber;
Label* _yellowTankNumber;
bool _isReady;
void handleData();
void gotoPlayScene();
void createPlayer(eObjectId id);
void updateYellowNumberText();
void updateGreenNumberText();
void updateWhiteNumberText();
int _greenTankCounter;
int _yellowTankCounter;
int _whiteTankCounter;
int _maxBots;
eObjectId _playerSelected;
void updateAndSendPlayerId(eObjectId id);
void updateNumberOfBots(int value);
Player* _currentPlayer;
};
#endif // !__WAITING_SCENE_H__
| [
"luuthevinh7@gmail.com"
] | luuthevinh7@gmail.com |
742ec705b173565b2546d7239789b2d30c8749bc | fd9d7610860a0b406405038bf057160025566fdd | /src/File.h | 7d9b6d8829731f27efeac9defc136771e9728b0f | [] | no_license | Mitch-Muscle-Man-Sorenstein/CSE2- | a7a89ad9394279e6291102130845bd20c6871c17 | 83e803b5feccd83dcc89e0914bd233013cb3fdad | refs/heads/master | 2022-12-09T20:18:43.891396 | 2020-09-06T05:23:21 | 2020-09-06T05:23:21 | 289,932,065 | 11 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 584 | h | #pragma once
#include <stddef.h>
#include <stdio.h>
#include <string>
unsigned char* LoadFileToMemory(std::string file_path, size_t *file_size);
unsigned short File_ReadBE16(FILE *stream);
unsigned long File_ReadBE32(FILE *stream);
unsigned short File_ReadLE16(FILE *stream);
unsigned long File_ReadLE32(FILE *stream);
double File_ReadDouble(FILE *fp);
void File_WriteBE16(unsigned short value, FILE *stream);
void File_WriteBE32(unsigned long value, FILE *stream);
void File_WriteLE16(unsigned short value, FILE *stream);
void File_WriteLE32(unsigned long value, FILE *stream);
| [
"Mitch-Muscle-Man-Sorenstein@users.noreply.github.com"
] | Mitch-Muscle-Man-Sorenstein@users.noreply.github.com |
0eed6e46301ce68f9734688def4f22be3b9e12b2 | 66b5f06db90d97897fb32fa8de4e6c6174cfde96 | /dz13 list/List.h | 96eb3f74af07ccf2e6a773d00ad97eac34fb45ad | [] | no_license | Vlad-git805/OOP-dz-13 | 7a8f5754014e37adbc383f42c0cc3c6d1e041639 | 379726115cc9114ab1c1c69a9a97d0bd0dae7338 | refs/heads/master | 2022-11-06T11:58:27.731858 | 2020-06-22T11:21:06 | 2020-06-22T11:21:06 | 272,706,318 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,429 | h | #pragma once
#include <iostream>
using namespace std;
template<class T>
class List
{
private:
struct Node
{
T value;
Node * next;
};
Node* head;
public:
List() : head(nullptr) { }
List(const List& other)
{
Node* current = other.head;
while (current != nullptr)
{
AddToTail(current->value);
current = current->next;
}
}
List& operator=(const List& other)
{
if (this == &other)
return *this;
while (!isEmpty())
{
DeleteHead();
}
Node* current = other.head;
while (current != nullptr)
{
AddToTail(current->value);
current = current->next;
}
return *this;
}
void FindByPosition(int index)
{
if (index > (ShowSizeOfList() - 1) || index < 0) return;
else
{
Node* current = head;
int counter = 0;
while (counter != index)
{
current = current->next;
counter++;
}
cout << current->value << endl;
}
}
int ShowSizeOfList()
{
int count = 0;
Node* current = head;
while (current != nullptr)
{
++count;
current = current->next;
}
return count;
}
void operator++()
{
AddToTail(0);
}
void AddToHead(T value)
{
Node* newElement = new Node;
newElement->value = value;
newElement->next = head;
head = newElement;
}
void AddToTail(T value)
{
Node* newElement = new Node;
newElement->value = value;
newElement->next = nullptr;
if (head == nullptr)
{
head = newElement;
}
else
{
Node* current = head;
while (current->next != nullptr)
{
current = current->next;
}
current->next = newElement;
}
}
void AddByIndex(int index, T value)
{
if (index > ShowSizeOfList() || index < 0)
{
cout << "error" << endl;
return;
}
else
{
if (index == ShowSizeOfList())
{
AddToTail(value);
return;
}
int count = 0;
Node* newElement = new Node;
newElement->value = value;
Node* current = head;
while (current != nullptr)
{
if (count + 1 == index)
{
newElement->next = current->next;
current->next = newElement;
}
++count;
current = current->next;
}
}
}
void DeleteByIndex(int index)
{
if (index > (ShowSizeOfList() - 1) || index < 0)
{
cout << "error" << endl;
return;
}
else
{
if (head == nullptr) return;
if (head->next == nullptr)
{
delete head;
head = nullptr;
}
else
{
int count = 0;
Node* current = head;
Node*temp = new Node;
while (current != nullptr)
{
if (count + 1 == index)
{
temp = current->next;
current->next = current->next->next;
delete temp;
}
++count;
current = current->next;
}
}
}
}
void DeleteHead()
{
if (head == nullptr) return;
Node* temp = head->next;
delete head;
if (temp == nullptr)
head = nullptr;
else
head = temp;
}
void DeleteTail()
{
if (head == nullptr) return;
if (head->next == nullptr)
{
delete head;
head = nullptr;
}
else
{
Node* current = head;
while (current->next->next != nullptr)
{
current = current->next;
}
delete current->next;
current->next = nullptr;
}
}
void Print()const
{
Node* current = head;
while (current != nullptr)
{
cout << current->value << ", ";
current = current->next;
}
}
bool isEmpty()const
{
return head == nullptr;
}
~List()
{
while (!isEmpty())
{
DeleteHead();
}
}
friend class Stack<T>;
};
| [
"zhomyruk_ak18@nuwm.edu.ua"
] | zhomyruk_ak18@nuwm.edu.ua |
78860b173ca797f93ee5df290076df93b0409ad9 | 7c32a56c46ba024d4f3c513de950a1373c268b56 | /src/graphics/renderop_rect.cpp | 84e1bc8e8f0666945e145e6e0f5a5bd923576488 | [
"MIT"
] | permissive | lineCode/oaknut | 4aee7741706235585c940c302c2939ef634c46a2 | de438c7341da0c699d4ca4d8e587b6fd0fbd85fb | refs/heads/master | 2020-08-02T02:15:28.788868 | 2019-09-26T20:46:06 | 2019-09-26T20:46:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,505 | cpp | //
// Copyright © 2018 Sandcastle Software Ltd. All rights reserved.
//
// This file is part of 'Oaknut' which is released under the MIT License.
// See the LICENSE file in the root of this installation for details.
//
#include <oaknut.h>
RectRenderOp::RectRenderOp() : RenderOp() {
_blendMode = BLENDMODE_NONE;
}
COLOR RectRenderOp::getFillColor() const {
return _color;
}
void RectRenderOp::setFillColor(COLOR fillColor) {
setColor(fillColor);
_blendMode = ((fillColor>>24) < 255) ? BLENDMODE_NORMAL : BLENDMODE_NONE;
}
void RectRenderOp::setAlpha(float alpha) {
if (alpha != _alpha) {
_alpha = alpha;
invalidate();
}
}
void RectRenderOp::setStrokeWidth(float strokeWidth) {
if (_strokeWidth != strokeWidth) {
_strokeWidth = strokeWidth;
invalidate();
}
}
void RectRenderOp::setStrokeColor(COLOR strokeColor) {
if (_strokeColor != strokeColor) {
_strokeColor = strokeColor;
invalidate();
}
}
VECTOR4 RectRenderOp::getCornerRadii() const {
return _radii;
}
void RectRenderOp::setCornerRadius(float radius) {
setCornerRadii({radius, radius, radius, radius});
}
void RectRenderOp::setCornerRadii(const VECTOR4& radii) {
if (_radii != radii) {
_radii = radii;
bool singleRadius = (radii[0]==radii[1] && radii[2]==radii[3] && radii[0]==radii[3]);
if (singleRadius) {
if (radii[0] == 0.0f) {
_flags = _flags & ~(OPFLAG_CORNER1|OPFLAG_CORNER4);
} else {
_flags |= OPFLAG_CORNER1;
}
} else {
_flags |= OPFLAG_CORNER4;
}
invalidate();
}
}
void RectRenderOp::validateShader(Renderer* renderer) {
Shader::Features features;
if (_alpha<1.0f) {
features.alpha = 1;
_blendMode = BLENDMODE_NORMAL;
} else {
_blendMode = ((_color>>24) < 255) ? BLENDMODE_NORMAL : BLENDMODE_NONE;
}
if (_strokeWidth>0 && _strokeColor!=0) {
}
bool singleRadius = (_radii[0]==_radii[1] && _radii[2]==_radii[3] && _radii[0]==_radii[3]);
if (singleRadius) {
if (_radii[0] != 0.0f) {
features.roundRect = SHADER_ROUNDRECT_1;
}
} else {
if ((_radii[0]==_radii[2]) && (_radii[1]==_radii[3])) {
features.roundRect = SHADER_ROUNDRECT_2H;
}
else {
features.roundRect = SHADER_ROUNDRECT_4;
}
}
_blendMode = BLENDMODE_NORMAL;
_shader = renderer->getStandardShader(features);
}
void RectRenderOp::prepareToRender(Renderer* renderer, class Surface* surface) {
RenderOp::prepareToRender(renderer, surface);
if (_shader->_features.alpha) {
renderer->setUniform(_shader->_u_alpha, _alpha);
}
if (_shader->_features.roundRect) {
renderer->setUniform(_shader->_u_strokeColor, _strokeColor);
renderer->setUniform(_shader->_u_u, VECTOR4(_rect.size.width/2, _rect.size.height/2,0, _strokeWidth));
if (_shader->_features.roundRect == SHADER_ROUNDRECT_1) {
renderer->setUniform(_shader->_u_radius, _radii[0]);
} else {
renderer->setUniform(_shader->_u_radii, _radii);
}
}
}
bool RectRenderOp::canMergeWith(const RenderOp* op) {
if (!RenderOp::canMergeWith(op)) {
return false;
}
if (_shader->_features != op->_shader->_features) {
return false;
}
if (_shader->_features.roundRect) {
return _rect.size.width == ((const RectRenderOp*)op)->_rect.size.width
&& _rect.size.height == ((const RectRenderOp*)op)->_rect.size.height
&& _strokeColor==((const RectRenderOp*)op)->_strokeColor
&& _strokeWidth==((const RectRenderOp*)op)->_strokeWidth
&& _radii[0] ==((const RectRenderOp*)op)->_radii[0]
&& _radii[1] ==((const RectRenderOp*)op)->_radii[1]
&& _radii[2] ==((const RectRenderOp*)op)->_radii[2]
&& _radii[3] ==((const RectRenderOp*)op)->_radii[3];
}
return true;
}
void RectRenderOp::asQuads(QUAD *quad) {
rectToSurfaceQuad(_rect, quad);
if (_shader->_features.roundRect) {
// Put the quad size into the texture coords so the frag shader
// can trivially know distance to quad center
quad->tl.s = quad->bl.s = -_rect.size.width/2;
quad->tl.t = quad->tr.t = -_rect.size.height/2;
quad->tr.s = quad->br.s = _rect.size.width/2;
quad->bl.t = quad->br.t = _rect.size.height/2;
}
}
| [
"reuben.scratton@gmail.com"
] | reuben.scratton@gmail.com |
d2176e360b9f32aeaae4c01901768413f53cc6f2 | a0f55e31c92c31832fbe074038f07b8f8726425b | /数据结构/数据结构严蔚敏/严蔚敏数据结构(最全资料)/数据结构(严慰民)配套纯c代码/ch2/MAIN2-2.CPP | d85be4cffb9cd770b7b0a80d5a8445f4c04d94bd | [
"MIT"
] | permissive | jjc521/E-book-Collection | 7533717250395a8b81163564eef821e66bae5202 | b18bf6630bf99b7bf19b4cc4450b67887f618d31 | refs/heads/master | 2023-03-15T23:48:49.018347 | 2019-08-30T07:26:01 | 2019-08-30T07:26:01 | 206,090,622 | 2 | 2 | null | null | null | null | GB18030 | C++ | false | false | 2,296 | cpp | // main2-2.cpp 检验bo2-2.cpp的主程序(与main2-1.cpp很像)
#include"c1.h"
typedef int ElemType;
#include"c2-2.h" // 与main2-1.cpp不同
#include"bo2-2.cpp" // 与main2-1.cpp不同
Status comp(ElemType c1,ElemType c2)
{ // 数据元素判定函数(相等为TRUE,否则为FALSE)
if(c1==c2)
return TRUE;
else
return FALSE;
}
void visit(ElemType c) // 与main2-1.cpp不同
{
printf("%d ",c);
}
void main() // 除了几个输出语句外,主程和main2-1.cpp很像
{
LinkList L; // 与main2-1.cpp不同
ElemType e,e0;
Status i;
int j,k;
i=InitList(L);
for(j=1;j<=5;j++)
i=ListInsert(L,1,j);
printf("在L的表头依次插入1~5后:L=");
ListTraverse(L,visit); // 依次对元素调用visit(),输出元素的值
i=ListEmpty(L);
printf("L是否空:i=%d(1:是 0:否)\n",i);
i=ClearList(L);
printf("清空L后:L=");
ListTraverse(L,visit);
i=ListEmpty(L);
printf("L是否空:i=%d(1:是 0:否)\n",i);
for(j=1;j<=10;j++)
ListInsert(L,j,j);
printf("在L的表尾依次插入1~10后:L=");
ListTraverse(L,visit);
GetElem(L,5,e);
printf("第5个元素的值为:%d\n",e);
for(j=0;j<=1;j++)
{
k=LocateElem(L,j,comp);
if(k)
printf("第%d个元素的值为%d\n",k,j);
else
printf("没有值为%d的元素\n",j);
}
for(j=1;j<=2;j++) // 测试头两个数据
{
GetElem(L,j,e0); // 把第j个数据赋给e0
i=PriorElem(L,e0,e); // 求e0的前驱
if(i==INFEASIBLE)
printf("元素%d无前驱\n",e0);
else
printf("元素%d的前驱为:%d\n",e0,e);
}
for(j=ListLength(L)-1;j<=ListLength(L);j++)//最后两个数据
{
GetElem(L,j,e0); // 把第j个数据赋给e0
i=NextElem(L,e0,e); // 求e0的后继
if(i==INFEASIBLE)
printf("元素%d无后继\n",e0);
else
printf("元素%d的后继为:%d\n",e0,e);
}
k=ListLength(L); // k为表长
for(j=k+1;j>=k;j--)
{
i=ListDelete(L,j,e); // 删除第j个数据
if(i==ERROR)
printf("删除第%d个数据失败\n",j);
else
printf("删除的元素为:%d\n",e);
}
printf("依次输出L的元素:");
ListTraverse(L,visit);
DestroyList(L);
printf("销毁L后:L=%u\n",L);
} | [
"907097904@qq.com"
] | 907097904@qq.com |
5e6b4ed294e84e317644265a9d8ed0c6fc36de22 | e162f2608e5b48e5cd2f649c72a80caea44f6af3 | /binary_tree.h | ba41f8ef0422b96c90dd910c9d709ca68d43535b | [] | no_license | enmex/c05 | 782b8400fd7979c42d87667de07ab675130803a9 | 86cacc8e99473076023130142a42a7a7bbc47bcd | refs/heads/master | 2023-05-01T07:09:46.572425 | 2021-05-19T06:01:10 | 2021-05-19T06:01:10 | 360,033,938 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,584 | h | #pragma once
#include <iostream>
#include "TreeException.h"
#include <vector>
#include <queue>
#include <iomanip>
struct treenode{
int field;
int key;
treenode *left, *right;
};
class binary_tree {
private:
treenode* btree;
treenode* root;
int size;
int height;
public:
binary_tree();
binary_tree(const binary_tree&);
binary_tree(binary_tree&&);
~binary_tree();
binary_tree operator=(const binary_tree&);
binary_tree operator=(binary_tree&&);
void add(int, std::vector<int>);
friend std::ostream& operator<<(std::ostream& out, const binary_tree& tree);
void setRoot(int);
int evenSum();
bool isPositive();
void clearLeaves();
double average();
bool isBTS();
std::vector<int> find(int x);
void pretty_print_rotate();
private:
int evenSum(treenode* point);
bool isPositive(treenode* point);
int clearLeaves(treenode* &point);
double sum(treenode* point);
void find(int x, treenode* point, std::vector<int>&);//указывает на какой ветке (0 или 1)
bool isBTS(treenode* point);
void pretty_print_rotate(treenode* point, int level);
static std::ostream& print_node(std::ostream& out, treenode* node){
out << node->field;
if(node->left!=nullptr){
out << "->left[";
print_node(out, node->left);
out << "]";
}
if(node->right!=nullptr){
out << "->right[";
print_node(out, node->right);
out << "]";
}
return out;
}
}; | [
"ds"
] | ds |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.