Categories
Mastering Development

R: y-axis disappears when using coord_trans

Data: structure(list(Doy = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L), Greenup = c(108, NA, 107, NA, 108, 108, NA, 108, NA, 108, […]

Categories
Arduino Ask Engineering

NodeMcu 1.0 keeps resetting automatically after random time

I want to show some digits in a 3×3 p10 red led panel where the number will come from the cloud and the number keeps updating. For this, I have used esp8266 based Nodemcu. I have used WiFi Manager library and DMD2 library for this and I am requesting the server every 5 seconds to […]

Categories
Mastering Development

Fast way to remove array of specific row values from 2D numpy array

I have a 2D array like this: a = np.array([[25, 83, 18, 71], [75, 7, 0, 85], [25, 83, 18, 71], [25, 83, 18, 71], [75, 48, 8, 43], [ 7, 47, 96, 94], [ 7, 47, 96, 94], [56, 75, 50, 0], [19, 49, 92, 57], [52, 93, 58, 9]]) and I want to […]

Categories
Mastering Development

Object.keys(myObject) returns an arbitrary list of numbers, not expected value

This is a bit of a head-scratcher – and has been a source of pain for the past 3 hours. Here’s my code. const payloadBody = JSON.parse(gatewayEvent.body); console.log(payloadBody); console.log(gatewayEvent.body); console.log(payloadBody.paymentMethodId); console.log(payloadBody[‘paymentMethodId’]); console.log(Object.keys(payloadBody)); If I look at the CloudWatch logs for this (I am executing in Lambda), the line console.log(payloadBody) logs: { "customerId": "cus_REDACTED", "paymentMethodId": "pm_REDACTED", […]

Categories
Cryptocurrency Ethereum Mastering Development

ethers.js wrong signature

From the same private key in ethers.js and secp256k1 I get the same eth address. But if I sign a message I get a different (wrong) signature in ethers.js. What is wrong with my code? import { createKeyPair, sign } from ‘@erebos/secp256k1’ import { pubKeyToAddress } from ‘@erebos/keccak256’ import { ethers, Wallet } from ‘ethers’; […]

Categories
Mastering Development

WPF LiveChart rendering from usercontrol

I´m trying to render a Cartesian Chart from a usercontrol. The textblock just renders fine but unfortunately the chart isn`t shown. I´ve no clue how to fix this. Could anybody give me a hint? This is the function for rendering the graph and save it as a pngfile. public void ConvertGraph(Object dataContext) { UserControl ucGraph […]

Categories
Mastering Development System & Network

Iptables rules as script but it blocks usb wifi adapter and vpn

i found this script online , when i execute it, it causes only 2 problems 1 – USB WiFi adapter stay blocked – rules applies only on internal WiFi 2- i can not connect to any VPN what changes do i have to make inside this script thanks in advice #!/bin/sh ############################################################################### Firewall rules to […]

Categories
Mastering Development

How to create a Infinite List in Haskell where the new value consumes all the previous values

If I create a infinite list like this: let t xs = xs ++ [sum(xs)] let xs = [1,2] : map (t) xs take 10 xs I will get this result: [ [1,2], [1,2,3], [1,2,3,6], [1,2,3,6,12], [1,2,3,6,12,24], [1,2,3,6,12,24,48], [1,2,3,6,12,24,48,96], [1,2,3,6,12,24,48,96,192], [1,2,3,6,12,24,48,96,192,384], [1,2,3,6,12,24,48,96,192,384,768] ] This is pretty close to what I am trying to do. This […]

Categories
Linux Mastering Development

Linux Machine as a Router with Several VPN Gateways

I’m trying to configure a linux machine as a router with multiple VPN connection onboard for my intranet net. At the moment there are 2 VPN Gateways on the machine. I want them to be used randomly for each connection the router gets. It’s ok for me to have same ip for the same host […]

Categories
Mastering Development

Show an Icon inside Modal Dialog Box

I’m completely new to MFC and have been working on this issue for a couple of days now and can’t find any solution that works. Problem: I have a dialog class (Modal Dialog Box) with a style defined in an .rc file (Code below) and get the resource id of the icon (int m_icon is […]