Implementing Bitcoind on an online website

I am new to this world and would like to understand better.
I have an online platform and I wish to receive payments in bitcoins directly from end customers in my portfolio without going through the 3d part.

I understood that Bitcoind is one of my options.
In fact, I would like to set up a background in my website.

let me know if this flow is possible:
1. The end customer wants to deposit BTC.
2. he gets a unique address for his transaction that is connected directly to my portfolio.
3. waiting for at least 1 confirmation of the Blockchain network.
4. his account credited on the platform.

thank you,

usability – Implementing different levels of drag and drop functionality?

I'm working on a tablet app for a motel. Initially, the application was going to be tested on a floor. The application would basically be used to move guests from one room / bed to another room / bed.

As you can see on the very simple screenshot, I can drag and drop Joe from Room 301- 1 to Room 303-2. Or I can drag and drop Joe into Room 301: From No. 1 to 2. Overall, on the tablet, you can see all the rooms on one floor. Here, it works very well.

The problem now is that the application will be used on several floors. I like the drag and drop feature a lot, but I do not know how I can drag and drop from different floors. For example, suppose I want to drag and drop Joe from room 301- # 1 to room 404 # 2. How can I show this graphically using this drag-and-drop interface?

I'm trying to come up with creative ideas that can be used for that. It must be simple, and as simple as it sounds, it would be to move Joe from his current room 301 # 1 to room 405 # 3 in one move / swype.

enter the description of the image here

Thank you.

performance – What are the elements to look for when implementing a feed such as Facebook?

I want to understand the elements implemented by Facebook to continuously display videos and images in a list without delay.

When I scroll down the home screen, the video instantly starts playing without delay or buffering. I've also noticed that they pre-load a video of a few seconds to remove the buffer. Is my understanding true?

As we know that there are many formats for video, I want to know which format has less size to allow fast transfer over the Internet and provide no delay even on low speed networks.

They have to compress on the video, so what is the preferred way to compress their level. I do not want to lose in quality and I still want to load my video quickly. Do they convert the downloaded video to another format, for example Mp4 to 3Gp, to compress them or compress the same format?

A thumbnail must be displayed before the start of the video. How do they choose (or extract) a thumbnail of the downloaded video?

Do I need code in C language to reach their level of functionality or are they offered by Android APIs?

A little help will help me understand these things.

Thank you for taking the time to read and help me about it.

Implementing Machine Learning in an iOS Application

I need to develop an iOS application involving the classification of images. The ML algorithm that I use should be able to analyze the image of a vase and identify its specific pattern. As a starting point, I plan to use TensorFlow models with Core ML. Is this the ideal method of first approach? Thank you!

multithreading – Implementing the C ++ thread pool

I have been working on this thread pool for some time to make it as easy to use as possible. I need advice to improve performance and good ways to test its performance. I was wondering if anyone had any opinions / suggestions!

Here is the class:

#pragma once

#understand
#understand
#understand
#understand
#understand
#understand
#understand

#define MAX_THREADS std :: thread :: hardware_concurrency () - 1;

// portable way to cancel copying and assigning operators
#define NULL_COPY_AND_ASSIGN (T) 
T (const T & other) {(void) other;} 
empty operator = (const T & other) {(void) other; }

/ * ThreadPool class
It's a singleton. To prevent spawning
tons of threads, I made a singleton * /
ThreadPool class {
public:

// getInstance to allow the second constructor to be called
Static ThreadPool & getInstance (int numThreads) {
static instance of ThreadPool (numThreads);

return instance;
}

// add any arg # function to the queue
model 
    automatic push online (Func && f, Args && ... args) {

// retrieve the return type of the function
typedef decltype (f (args ...)) retType;

// package the task
std :: packaged_task task (std :: move (std :: bind (f, arguments ...)));

// lock the mutex of the queue, add the job to the queue
std :: unique_lock lock (JobMutex);

// recovers the future of the task before it is moved to the queue
std :: future future = task.get_future ();

// put the job in the queue
JobQueue.emplace (std :: make_shared <AnyJob > (std :: move (task)));

// notify a thread when there is a new job
thread.notify_one ();

// return the future of the function so that the user can get the return value
return to the future;
}

/ * The utility functions will go here * /
inline void resize (int newTCount) {

int tmp = MAX_THREADS;
if (newTCount> tmp || newTCount < 1){
            tmp = numThreads;
            numThreads = MAX_THREADS;
            Pool.resize(newTCount);
            for (int i = tmp; i != numThreads; ++i) {
                Pool.emplace_back(std::thread(&ThreadPool::threadManager, this));
                Pool.back().detach();
            }
        }
        else if (newTCount > numThreads) {
uint8_t tmp = numThreads;
numThreads = newTCount;
Pool.resize (numThreads);
for (int i = tmp; i! = numThreads; ++ i) {
Pool.emplace_back (std :: thread (& ThreadPool :: threadManager, this));
Pool.back (). Detach ();
}
}
other {
numThreads = (uint8_t) newTCount;
Pool.resize (newTCount);
}


}

inline uint8_t getThreadCount () {
return numThreads;
}

private:

// used the polymorphism to store any type of function in the queue of jobs
Job class {
private:
std :: packaged_task func;
public:
Virtual ~ Job () {}
virtual void execute () = 0;
};

model 
    AnyJob class: Job public {
private:
std :: packaged_task func;
public:
AnyJob (std :: packaged_task func): func (std :: move (func)) {}
void execute () {
func ();
}
};
// end of the member classes

// member variables
uint8_t numThreads; // number of threads in the pool
std :: vector Basin; // the real thread pool
std :: queue <std :: shared_ptr> JobQueue;
std :: condition_variable thread; // used to notify threads of available jobs
std :: mutex JobMutex; // used to push / jump jobs to / from the queue
// end member variables

/ * infinite loop function * /
inline void threadManager () {
while (true) {

std :: unique_lock lock (JobMutex);
thread.wait (lock, [this] {Return! JobQueue.empty (); });

// strange bug where it will continue even if the queue is empty
if (JobQueue.size () < 1)
                continue;

            (*JobQueue.front()).execute();

            JobQueue.pop();
        }
    }

    /*  Constructors */
    ThreadPool(); //prevent default constructor from being called

    //real constructor that is used
    inline ThreadPool(uint8_t numThreads) : numThreads(numThreads) {
        int tmp = MAX_THREADS;
        if(numThreads > tmp) {
numThreads = tmp;
}
Pool.reserve (numThreads);
for (int i = 0; i! = numThreads; ++ i) {
Pool.emplace_back (std :: thread (& ThreadPool :: threadManager, this));
Pool.back (). Detach ();
}
}
/ * end builders * /


NULL_COPY_AND_ASSIGN (ThreadPool);
}; / * end ThreadPool Class * /

Here is an example of use:

#include "ThreadPool.h"
#understand 

int main () {

ThreadPool & pool = ThreadPool :: getInstance (4); // create a pool with 4 threads

auto testFunc = [](int x) {return x * x; };

auto returnValue = pool.push (testFunc, 5);

std :: cout << returnValue.get () << std :: endl;

returns 0;
}
`` `

Project Management – When we calculate the cost of implementing a new web application, should we have separate costs to provide the source code to the client?

I am currently working on a new asp.net MVC Web application as a senior outsourced software developer / developer. Now, I have participated in many requirements gathering sessions with the client, and I have arrived with a detailed document on requirements and design, written by the client. Next, I break the document into tasks and calculate the total effort needed to design, develop, test, and host the Web application, as follows:

  1. Creation and design of databases. 50 hours + cost 4000 USD.
  2. Develop user registration and profile creation. 10 hours + cost 8.00 USD.
  3. Develop a transaction workflow. 200 hours + cost 16 000 USD.
  4. tasks for development and hosting and UAT continues
  5. Final. 500 hours + cost 40 000 USD.

Thus, the above covers the time and total cost of project implementation. but should this cover by default by giving the client the source code of the application? or it is not necessary? and if our customer needs / requests the source code, can we supply the cost separately?

django – Implementing multiple session support in a chatbot

I'm currently implementing a Chatbot only in python.

In my current implementation, whenever the user starts a new conversation from one session, another instance of Chatbot is started and therefore, Chatbot starts from the initial state.

I want to change this behavior and make it similar to, say, chat on Facebook / Messenger, where you can move seamlessly between sessions while chatting without inconsistencies. Namely, I want these attributes:

  1. If the user enters something in session A, for example, it should be immediately visible in all current sessions. Likewise, the Chatbot response should be immediately visible on all devices.
  2. All sessions display the same discussion history

To implement the first point, I used this example django-channels documents and I modified it by creating a single group / chatroom for each user. All sessions of the same user are connected to the same group / chat room and therefore receive all messages from the group / chat room regardless of where they were sent.

However, this implementation currently has a bug. Whenever a user is logged in, he initializes a Chatbot instance that resumes from the initial state, while the old connections have Chatbot instances that are currently in a different state.

This leads to inconsistent responses that are different depending on the window in which the user has entered something.

Basically, instead of having two sessions that talk to the same Chatbot instance, we have two sessions that talk to two different Chatbot instances and the messages from these four sources are added to the same chat room.

In addition, we waste resources by keeping multiple Chatbot instances per user, which increases with the number of currently active sessions.

I want all user windows to interact with the same Chatbot instance. What would be the best way to implement this?

Currently, I can think of three solutions:

  1. Create another project Django the Chatbot and make requests to this HTTP server. The Chatbot state is kept on this server and any request from the user will go to the same Chatbot instance.
    • It's easy to implement for me (just run another server)
    • This naturally resolves all state problems because all instances will query the same Chatbot object.
  2. To create a Control The channel wire that will contain the current Chatbot instance (a python object) and all new channels will be returned to it for the chatbot response.
    • It will be complicated to implement
    • I will have to maintain which thread is master and which ones are slaves
    • In situations where a user closes the master wire connection, I will have to one way or another change one of the slave connections into a master connection and transmit the entire object ( ?!) Or at least pass the state variable and recreate the chatbot instance.
  3. Create an independent thread / process in python for the chatbot instance and have all the channel connections communicate with that thread / process.
    • It will be difficult for me to implement because I do not know how to make IPC Python

Are there other possible solutions? What would be the ideal solution?

I use the following technologies:

  1. Django as the main server, with Django channels for WebSockets
  2. RASA NLU for the chatbot NLU component and a finite state machine model implemented with pytransitions for the management of python dialogs

What are the steps to follow when implementing SEO?

What are the steps to follow when implementing SEO?

Implementing basic data structures – Mathematica Stack Exchange

Data structures are your friend. Using the right data structure in the right place means better performance and less work from the programmer.

Of course, this is a problem in Mathematica because it has very few key structures. As of v10, it has (finally) hash cards, but it still lacks some of the biggest ones. In particular we do not have:

  • Stack
  • Tail
  • heap
  • Tree
  • sorts

On the other hand, I would like to even be able to take any effective data structure I need and apply it to my current problem.

To make this possible, however, I can not just wait for the IRG, but I really have to implement them myself.

So, how can I do that effectively and clean. It means three things:

  • The data must be well encapsulated. I do not want to have to remember that one particular listing is a pile when I circulate it in my program. It must be able to support a reasonable API (object-oriented is the best solution, of course, but to be idiomatic, it may be more logical to expose 5000 StackModifyLikeThis, StackModifyLikeThat the functions…

  • The time complexity and memory consumption of all major operations should correspond to what a real programming language would provide in its main data structures.

  • Operations can not be so much worse than native operations. Obviously, this will be a little slower than the data types implemented by the kernel, but I do not want the performance to be so much worse that I can not use these much more practical structures.


As a concrete example, how to effectively implement a FIFO queue?

That means we want to create a resizable file automatically Tail data structure that gives us two things:

  • Constant time QueuePush surgery
  • Constant time QueuePop surgery

How will you do it and how will it illustrate the best practices for designing the Mathematica data structure?

c ++ – implementing C ++ results 17

This is a C ++ 17 implementation.

Left and Right are help structures to avoid the use of extra bool in Result.

to the left(…) and to the right(…) auxiliary functions for the specified side if both types are identical Result.

namespace marklar :: result
{
// Assistant
model
struct Left;

model
struct Right;

model
struct is_left: std :: false_type {};

model
struct is_left <Left>: std :: true_type {};

model
constexpr inline bool is_left_v = is_left::value;

model
struct is_right: std :: false_type {};

model
struct is_right <Right>: std :: true_type {};

model
constexpr inline bool is_right_v = is_right::value;

model
struct Left {
Type const value_;

template <typename ParamType = Type,
type_name std :: enable_if_t <
! std :: is_same_v <Left, ParamType>
&& std :: is_constructible_v
                 && std :: is_convertible_v
                 , bool> = true>
constexpr Left (ParamType && value)
: value_ {std :: forward(value) }
{}

template <typename ParamType = Type,
type_name std :: enable_if_t <
! std :: is_same_v <Left, ParamType>
&& std :: is_constructible_v
                 &&! std :: is_convertible_v
                 , bool> = false>
explicit constexpr Left (ParamType && value)
: value_ {std :: forward(value) }
{}

template <typename ParamType = Type,
type_name std :: enable_if_t <
! std :: is_same_v
                     && std :: is_constructible_v
                     &&! std :: is_convertible_v
                 , bool> = false>
constexpr explicit left (left const and other)
: value_ {other.value_}
{}

template <typename ParamType = Type,
type_name std :: enable_if_t <
! std :: is_same_v
                 && std :: is_constructible_v
                 && std :: is_convertible_v
                 , bool> = true>
constexpr left (left && other)
: value_ {std :: move (other). value_}
{}

template <typename ParamType = Type,
type_name std :: enable_if_t <
! std :: is_same_v
                 && std :: is_constructible_v
                 &&! std :: is_convertible_v
                 , bool> = false>
constexpr explicit left (left && other)
: value_ {std :: move (other). value_}
{}
};

model
struct Right {
Type const value_;

template <typename ParamType = Type,
type_name std :: enable_if_t <
! std :: is_same_v <Right, ParamType>
&& std :: is_constructible_v
                 && std :: is_convertible_v
                 , bool> = true>
constexpr Right (ParamType && value)
: value_ {std :: forward(value) }
{}

template <typename ParamType = Type,
type_name std :: enable_if_t <
! std :: is_same_v <Right, ParamType>
&& std :: is_constructible_v
                 &&! std :: is_convertible_v
                 , bool> = false>
constexpr Explicit right (ParamType && value)
: value_ {std :: forward(value) }
{}

template <typename ParamType = Type,
type_name std :: enable_if_t <
! std :: is_same_v
                 && std :: is_constructible_v
                 &&! std :: is_convertible_v
                 , bool> = false>
explicit constexpr Right (right const and other)
: value_ {other.value_}
{}

template <typename ParamType = Type,
type_name std :: enable_if_t <
! std :: is_same_v
                 && std :: is_constructible_v
                 && std :: is_convertible_v
                 , bool> = true>
constexpr Right && other)
: value_ {std :: move (other). value_}
{}

template <typename ParamType = Type,
type_name std :: enable_if_t <
! std :: is_same_v
                 && std :: is_constructible_v
                 &&! std :: is_convertible_v
                 , bool> = false>
explicit constexpr Right (right && other)
: value_ {std :: move (other). value_}
{}
};

model
inline constexpr left
to_left (Type const & value) {
back left{ value };
}

template <type_name Type, type_name std :: enable_if_t <! std :: is_move_constructible_v, bool> = true>
inline constexpr left
to_left (Type && value) {
back left{std :: forward(value) };
}

model
constexpr inline Right
to_right (Type const & value) {
go right{ value };
}

template <type_name Type, type_name std :: enable_if_t <! std :: is_move_constructible_v, bool> = true>
constexpr inline Right
to_right (Type && value) {
go right{std :: forward(value) };
}

model
struct Result {
static_assert (! (std :: is_reference_v || std :: is_reference_v)
, "The result should have no alternative of reference");
static_assert (! (std :: is_void_v || std :: is_void_v)
, "The result must not have an empty alternative");

using LeftValue = Left;
using RightValue = Right;

static constexpr size_t index_left_ = 0;
static constexpr size_t index_right_ = 1;

const std :: variant variant_;

explicit constexpr Result (Result && other)
: variant_ {std :: forward <Result> (other) .variant_}
{}

model
    constexpr Explicit result (ParamType const & value)
: variant_ {
            []() -> auto {
if constexpr (std :: is_same_v || is_left_v) {
returns std :: in_place_index;
} else if constexpr (std :: is_same_v || is_right_v) {
returns std :: in_place_index;
}
} ()
, [](ParamType const & value) -> auto {
if constexpr (std :: is_same_v) {
return to_left (value);
} else if constexpr (std :: is_same_v) {
return to_right (value);
} else if constexpr (is_left_v || is_right_v) {
return value;
}
}(value)
}
{
static_assert ((is_left_v || is_right_v || std :: is_same_v || std :: is_same_v)
, "Only defined result solutions can be used");

if constexpr (! (is_left_v || is_right_v)) {
static_assert (! std :: is_same_v
                          , "The result must distinguish between alternatives");
}
}

model
    constexpr Explicit result (ParamType && value) noexcept
: variant_ {
            []() -> auto {
if constexpr (std :: is_same_v || is_left_v) {
returns std :: in_place_index;
} else if constexpr (std :: is_same_v || is_right_v) {
returns std :: in_place_index;
}
} ()
, [](ParamType && value) -> auto {
if constexpr (std :: is_same_v) {
returns to_left (std :: forward(value));
} else if constexpr (std :: is_same_v) {
return to_right (std :: forward(value));
} else if constexpr (is_left_v || is_right_v) {
returns std :: forward(value);
}
} (std :: forward(value))
}
{
static_assert ((is_left_v || is_right_v || std :: is_same_v || std :: is_same_v)
, "Only defined result solutions can be used");

if constexpr (! (is_left_v || is_right_v)) {
static_assert (! std :: is_same_v
                          , "The result must distinguish between alternatives");
}
}

model
    constexpr Online TempType const &
left () const &
{
static_assert (std :: is_convertible_v)

returns std :: get(variant _). value_;
}

model
    constexpr TempType &&
left() &&
{
static_assert (std :: is_convertible_v)

returns std :: move (std :: get(variant _). value_);
}

model
    constexpr LeftType
left_or (TempType && substitute) const &
{
static_assert (std :: is_convertible_v)

returns std :: hold_alternative(variant_)
? this-> left ()
: static_cast(std :: forward(replace));
}

model
    constexpr LeftType &&
left_or (TempType && substitute) &&
{
static_assert (std :: is_convertible_v)

returns std :: hold_alternative(variant_)
? std :: move (this-> left ())
: static_cast(std :: forward(replace));
}

model
    constexpr Online TempType const &
right () const &
{
static_assert (std :: is_convertible_v)

returns std :: get(variant _). value_;
}

model
    constexpr TempType &&
right () &&
{
static_assert (std :: is_convertible_v)

returns std :: move (std :: get(variant _). value_);
}

model
    constexpr RightType
right_or (TempType && substitute) const &
{
static_assert (std :: is_convertible_v)

returns std :: hold_alternative(variant_)
? static_cast(std :: forward(replace))
: this-> right ();
}

model
    constexpr RightType &&
right_or (TempType && substitute) &&
{
static_assert (std :: is_convertible_v)

returns std :: hold_alternative(variant_)
? static_cast(std :: forward(replace))
: std :: move (this-> right ());
}

model
    inline constexpr auto left_map (Function const & function) &&
-> Result <decltype (function (std :: get(variant _). value_)), RightType>
{
returns std :: hold_alternative(variant_)
? Result {to_left (function (this-> left ())))}
: Result {std :: get(variant_) };
}

model
    inline constexpr auto
right_map (const function & function) const
-> Result <LeftType, decltype (function (std :: get(variant _). value _))>
{
returns std :: hold_alternative(variant_)
? Result {std :: get(variant_) }
: Result {to_right (function (this-> right ()))}};
}

model
    inline constexpr auto
join () const
-> std :: common_type_t
    {
returns std :: hold_alternative(variant_)
? this-> left ()
: this-> right ();
}

inline operator constexpr bool () const noexcept
{
returns std :: hold_alternative(variant_);
}
};

} // name space marklar :: result

An example of work

  • Suggestions for better implementation?
  • Is the perfect transmission used correctly?