Categories
Mastering Development

Call to a member function bind_param() on boolean error

I am having troubles getting my form to work – I am receiving the error: Fatal error: Uncaught Error: Call to a member function bind_param() on boolean** on line 135… I’ve provided line 134 through 137, I am really struggling to find the issue… I’m still learning this language, it’s tough. $stmt = $database->prepare(“INSERT INTO […]

Categories
Mastering Development

How do I add my custom field in django filter?

I am creating an API to return posts on a user profile. The posts can be public, friends only or with custom privacy. Here is my filter: posts = Post.objects.filter( Q(created_by=user, privacy=’PUBLIC’) | Q(created_by=user, privacy=’FRIENDS’)| Q(created_by=instance, privacy=’CUSTOM’, custom_list=requested_by.pk)) Here I want to get the ‘friends_only’ posts if the requested user is friend of the user […]

Categories
CMS Development Wordpress

wp_query not showing posts when user is logged in (non admin)

I created a related post function that I am calling in a sidebar: function get_all_related_posts(){ global $post; $postid = $post->ID; $tag_ids = wp_get_post_tags( $postid, array( ‘fields’ => ‘ids’ ) ); $args = array( ‘post_type’ => ‘any’, ‘tag__in’ => $tag_ids, ‘post__not_in’ => array($postid), ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘posts_per_page’ => 5, ); $the_query = new […]

Categories
Cryptocurrency Development Ethereum

Cannot deploy to Ropsten with truffle

I keep getting an error when trying to deploy a project to ropsten. This is my config file. Any idea??? const HDWalletProvider = require(“@truffle/hdwallet-provider”); const infuraKey = “xxxxxlmaoxxxxx”; const fs = require(‘fs’); const mnemonic = fs.readFileSync(“.secret”).toString().trim(); module.exports = { networks: { development: { provider: () => new HDWalletProvider(mnemonic, “http://127.0.0.1:7545”), network_id: “” // Any network (default: […]

Categories
Development

How can I format my text file to make it not repeat the same line over and over? [closed]

I am trying to write a text file using C++ ,but it keeps repeating the line. Is there a certain way to format to make it only have the line once and not 10 times? This is my code and when I try to make it write the definition for the keyword it writes the […]

Categories
Development

Expose MongoDB instance within the local network with Windows Server

I have two computers within the same network. One of them is a server, which serves a publicly accessible website; the other one is for my daily use. Both computers are using Microsoft technologies. (Windows Server 2019/Windows 10) I have a MongoDB instance running on the server, and I want to connect it using my […]

Categories
Development Linux

egress traffic shaping rules on mirrored interface aren’t working

In my small, private, network I have a device (IP address 192.168.0.240) which I want to have a “guaranteed” section of the pipe. To that end, I’ve been following this Server Fault article to shape the egress on a my interface. I’ve done, on interface ifb0, the same things I’ve done on eth1 as discussed […]

Categories
Development Linux

egress traffic shaping rules on mirrored interface aren’t working

In my small, private, network I have a device (IP address 192.168.0.240) which I want to have a “guaranteed” section of the pipe. To that end, I’ve been following this Server Fault article to shape the egress on a my interface. I’ve done, on interface ifb0, the same things I’ve done on eth1 as discussed […]

Categories
CMS Development Wordpress

Move some posts to end of sort order, even if there is a sort in the wp_Query already

I have a site that lists properties for sale. I have a custom wp_query, with a sort dropdown I created. This dropdown reorders the posts query by date, price (low-high & high-low) and beds (low-high & high-low). Price and beds are custom fields, with numeric values only. (no currency/comma’s). On change, AJAX reorganises the posts […]

Categories
Development

Invalid signature – detached iTextSharp PDF signing with RSA PKCS#1 v1.5 signature from smart card using PKCS#11

My goal is to implement a PDF signing process in which the server (.NET Core service) provides the hash to be signed to the client (Angular + Electron NodeJS). The client then signs the given hash using a private key obtained from a smart card through a PKCS#11 interface. The signature is then sent back […]