Categories
Mastering Development

AssertionError: No value at JSON path, but value exists in valid JSON response

I saw many of solutions provided here, on the forum, and also a guide for the problem (provided here), but none of them helped me… I tried to keep my code cleare as much as I can, so I decided to create many of test classes including test items, for example: @Getter @Setter public class […]

Categories
Mastering Development

How to update payload info for python scraping

I have a python scraper that works for this site: https://dhhr.wv.gov/COVID-19/Pages/default.aspx It will scrape the tooltips from one of the graphs that is navigated to by clicking the “Positive Case Trends” link in the above URL. here is my code: import re import requests import json from datetime import date url4 = ‘https://wabi-us-gov-virginia-api.analysis.usgovcloudapi.net/public/reports/querydata?synchronous=true’ # payload: […]

Categories
Mastering Development

Kafka – Consumer failed to start: Connection refused – connect(2) for 127.0.0.1:9092

I’m trying to get one of my services up and running locally within the docker network, but keep getting “Consumer failed to start: Connection refused – connect(2) for 127.0.0.1:9092” exception. zookeeper: image: wurstmeister/zookeeper:3.4.6 restart: always expose: – “2181” kafka: depends_on: – zookeeper environment: KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092 KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE hostname: kafka […]

Categories
Mastering Development

How to explode nested json array in data frame

This is my input data frame structure root |–Name (String) |–Version (int) |–Details (array) Something like this : “Name”:”json”, “Version”:1, “Details”:[ “{ \”Id\”:\”123\”, \”TaxDetails\”:[\”TaxDetail1\”:\”val1\”, \”TaxDetail2\”:\”val2\”] }”, “{ \”Id\”:\”234\”, \”TaxDetails\”:[\”TaxDetail3\”:\”val3\”, \”TaxDetail4\”:\”val4\”] }” ] I want to explode this at level of TaxDetails something like this : “Name”:”json”, “Version”:1, “TaxDetail”:{\”TaxDetail1\”:\”val1\”} “Name”:”json”, “Version”:1, “TaxDetail”:{\”TaxDetail2\”:\”val2\”} “Name”:”json”, “Version”:1, “TaxDetail”:{\”TaxDetail3\”:\”val3\”} “Name”:”json”, […]

Categories
Bitcoin Cryptocurrency Development

Missing input returned from sendrawtransaction on P2SH multisig?

I’m playing around on regtest to build a flow for P2SH multisig. I’m getting “missing inputs” back from the sendrawtransaction RPC call, but I see inputs when I put it in a decoder. They each have a parent txid along with the index of the transaction they’re trying to spend. Also the sigscript is two […]

Categories
Cryptocurrency Development Ethereum

Metamask Signing gives different signature than web3.js

I have successfully been using metamask to sign EIP712 data. I am currently trying to write truffle tests and need to replicate the signing process outside the browser. The issue I am facing is that the signatures using EthUtil.ecsign and web3.eth.accounts.sign are not matching the one that is generated in the browser. Here is the […]

Categories
Cryptocurrency Development Ethereum

Metamask Signing gives different signature than web3.js

I have successfully been using metamask to sign EIP712 data. I am currently trying to write truffle tests and need to replicate the signing process outside the browser. The issue I am facing is that the signatures using EthUtil.ecsign and web3.eth.accounts.sign are not matching the one that is generated in the browser. Here is the […]

Categories
Development

It seems that sklearn n_jobs does not make full use of multiple cores

I am running a set of parallel computing on Intel(R) Xeon(R) L5640. (6 cores 12 siblings) Ubuntu 18.04, Python 3.7.3, numpy 1.16.4, sklearn 0.21.2. I checked the utilization while this program is running from sklearn.neighbors import KNeighborsClassifier from sklearn.metrics import classification_report from sklearn.model_selection import train_test_split from sklearn.datasets import fetch_openml import time X, y = fetch_openml(‘mnist_784’, […]