Categories
Raspberry Pi User Help

I2C instabillity between a pair of Raspberry Pi

I have a connected a Raspberry Pi Zero (1.3, no W, running Raspbian 10 (buster) lite) as an I2C slave (clock:GPIO18,data:GPIO19) to a Raspberry Pi 3b (running Ubuntu 20.04.1) as an I2C master(clock:GPIO3,data:GPIO2). The wiring is Dupont style connectors of approximately 20cm length connected directly between the GPIO headers. The only configuration done is to […]

Categories
Mastering Development

Handlebars helpers within rocket (rust)

I’m learning rust and I stumbled across a problem that I’m not able to solve. I am trying to register a helper for handlebars the ultimate goal is to be able to have a helper that calculates/prints the length of a Vec. But I already fail to get the samples from the documentation into my […]

Categories
Mastering Development

Replacing numbers after a specific string using regex in C++ [duplicate]

I’m trying to replace the number after the string buy-price: I don’t exactly know how digits there are after the string, This is what I have so far: using namespace std; int main() { string test = “buy-price: 592”; regex reg(“buy-price\: (\d+)”); string test2 = regex_replace(test, reg, “600”); cout << test2 << endl; return 0; […]

Categories
Development

I want to create a dataframe from xml fil

def Ain_Mfn_Reg(path): from xml.dom import minidom import pandas as pd mydoc = minidom.parse(path) item1 = mydoc.getElementsByTagName(“AIN”) item2=mydoc.getElementsByTagName(“REG”) item3=mydoc.getElementsByTagName(“MFN”) columns = [“AIN”, “REG”, “MFN”] datatframe = pd.DataFrame(columns = columns) for elem1,elem2,elem3 in zip(item1,item2,item3): AIN = elem1.firstChild.data REG = elem2.firstChild.data MFN = elem3.firstChild.data dataframe = datatframe.append(pd.Series([AIN, REG, MFN], index = columns), ignore_index = True) return dataframe

Categories
Development

How do I repeat my code but take away one from a variable for the next time around?

I am making a python code as if I was going to put it in a car parking ticket machine. It goes through all the functions – displays the number of available parking spaces, asks for the last three digits of your registration plate, gets you to insert money but I am unsure how to […]

Categories
Development

How to encode POP instructions in 8086?

I’m trying to encode the following few instructions in 8086. I’ve learnt how the whole mod, reg, d, w and everything works. So, I can encode almost all the instructions like MOV [BX + 1234H], DS but I just cant seem to wrap my head around the PUSH and POP instructions? POP DS Answer: 1FH […]

Categories
Development

PHP and PDO record duplication during data tranfer

I’m doing a data transfer script in php from the MysqlDB “A” to MysqlDB “B”. While using PDO to perform selection from A and insertion to B something strange happened. All the records inserted in the B database were all the same, so i had about 500 times the same record. Some charachters in A […]