Categories
Mastering Development

PHP MySQL clone function does not work as intended

I have a button that should clone a selected entry in a table with a new userID and the current date, but it doesn’t work. PHP: <?php session_start(); $activitynumber = $_POST[‘activitynumber’]; $mysqli = new mysqli(“localhost”, “username”, “password”, “volunteer_hours”); if($mysqli->connect_error) { echo(‘Could not connect’); } $sql = “SELECT * FROM User WHERE (ActivityID = ‘$activitynumber’)”; $res […]

Categories
Linux Mastering Development Ubuntu

Trying to build Electric sheep from source

I am trying to build Electric sheep from source on Ubuntu 18.04.4 LTS following this page github electric sheep compiling for building in Linux. I ran into some errors at the end. I think the problem is my understanding of the instructions. I will present what I did: Installed the packages mentioned. Then I figured […]

Categories
Mastering Development

How to fix No instance of constructor matches argument list

I can’t access in sub class (RightRectangularPyramid) it said no instance of constructor “Shape3D::Shape3D” matches the argument list — argument types are: (double, double, double) #include <iostream> #include <cmath> #include <cstdlib> using namespace std; class Shape3D{ public: virtual double volumn(); virtual double surfaceArea(); }; class RightRectangularPyramid:public Shape3D{ private: double width; double length; double height; public: […]

Categories
Mastering Development

c++ boost read wrong data from socket

I try to use boost ssl socket server. I get the example from https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/example/cpp11/ssl/server.cpp and try to cout receive data: #include <cstdlib> #include <functional> #include <iostream> #include <boost/asio.hpp> #include <boost/asio/ssl.hpp> using boost::asio::ip::tcp; class session : public std::enable_shared_from_this<session> { public: session(tcp::socket socket, boost::asio::ssl::context& context) : socket_(std::move(socket), context) { } void start() { do_handshake(); } private: void […]

Categories
Mastering Development

Trying to pause and resume goroutines using channels but eventually they hang up

I need to spwan multiple goroutines that make api calls to github to get reviews of PRs for all repos of an org in batches. For example {RepoA: #1, #2, ……….#20} {RepoA: #21, #22, ……….#40} . . {RepoZ: #1, #2, ……….#20} This is my calling process // get the heartbeats channel heartbeats := signal.Heartbeats() // […]

Categories
Mastering Development

Why is rowselect of antd-react selecting all the rows when I click only one row in my table?

I have a table built with antd in react. I am getting the data from an API endpoint. Everything else works fine. But when i click one row at the table, all the rows are getting selected. The row selection is working fine with constant data of antd documentation. But when i plug it in […]

Categories
Linux Mastering Development

Can I find who did an HTTP request?

I am mentioned that my server did an HTTP download some days ago, and it may be a virus. I have the request’s source IP/port, the destination IP/port, the protocol, time, length, and method. Maybe my server is hacked, but I want to find which user and which program did the HTTP request. Is it […]

Categories
Mastering Development

VCRUNTIME140.dll error calling memcpy() inside JNI library doing USB i/o

I am writing a Java application that executes USB I/O on Windows 10 with Java 10 JDK. My i/o library is the libusb api. The app loads a JNI library .dll compiled/built in Visual Studio 2017 with both Microsoft Visual 2013 C++ and Microsoft Visual C++ 2015-2019 installed. This application generates the following crash warning […]

Categories
Development

Draw a path progressively with getSegment

I created a custom view to draw a line, but progressively. I tried to use PathMeasure and getSegment, but the effect doesn’t work. It just keeps drawing the line already with the final size. private val paint = Paint().apply { isAntiAlias = true color = Color.WHITE style = Paint.Style.STROKE strokeWidth = 10f } override fun […]

Categories
Development

How to create a defined structured metadata to use in a python script

I started learning python and trying to read a log file having a defined structure 34 12 20 02 02 14 15 10 03 02 03 0A 00 02 60 17 0A 80 0B 00 01 72 0B 80 0C 00 01 45 0C 80 56 78 20 02 02 14 15 10 The data […]