Skip to main content
Filter by
Sorted by
Tagged with
-3 votes
0 answers
57 views

I'm kind of a beginner in all this CS stuff but let me try to explain what I'm asking. A bit is basically an "on" or "off" switch which just stores the value of either "true&...
Manuel's user avatar
  • 1
Advice
0 votes
4 replies
53 views

from PIL import Image img = Image.open('some/file.png') img = img.convert(mode='1') imgbytes = img.tobytes() with open('filepath', 'w') as file_out: file_out.write(imgbytes) I would like to write the ...
Cutter's user avatar
  • 1,862
0 votes
1 answer
59 views

I am receiving my ".wav" file in a django view as an "InMemoryUploadedFile" then converting it to bytes: views.py import functions.bytes_to_wav_wave if voice_value: ...
Mohammed Baashar's user avatar
1 vote
1 answer
138 views

I'm trying to implement a lambda function (for educational purposes) to initiate an array to append to the front of potentially encrypted data to save information like salt and initiation vector, ...
Lucy's user avatar
  • 95
0 votes
2 answers
63 views

Below is the code extracted from this repo: import os.path, io filename = "" n_chunks = 12 # Number of processes to use -- will split the file up into this many pieces def ...
Akira's user avatar
  • 2,820
0 votes
1 answer
176 views

Please I'm having an issue where I need to split a payload coming from an energy meter into chunks of 5-bytes each that represent different values of line parameters. The payload length is 35 bytes as ...
bquark's user avatar
  • 21
4 votes
2 answers
177 views

I am trying to make my own file compressor and some of the chars in the file that I am trying to compress are '�'. I tried: #include <iostream> int main(){ std :: cout << (int)'�'; ...
Jordon's user avatar
  • 103
0 votes
2 answers
130 views

In an excel cell, I have a large number represented as a string, lets say 12345689994765411. I am looking for a way to reverse the bytes inside that number to get the decimal representation of that ...
Manuel Selva's user avatar
  • 19.1k
0 votes
1 answer
62 views

I've a rabbitMQ implementation (C# with RabbitMQ.Client 7.1.12 nuget) where we send a short json to a queue. But when the receiver gets the queue item sometimes (approximately 1 on 5) the byte array ...
BvdVen's user avatar
  • 2,961
1 vote
2 answers
139 views

I am messing around with c#, and i noticed something. If i were to instantiate an sbyte with 8 bits, such as 0b_1111_1111 (-1), it throws an error, but if i were to first make a byte with it, and then ...
infinitychances's user avatar
-2 votes
2 answers
133 views

I want to add a byte after every third byte in a byte array. # This is an example of where the bytes would be added b'\xF2\xA1\x23{ADD}\xFF\x00\x05{ADD}\xE2\x20\x05{ADD}...' Usually, I have a byte ...
Nitroxy's user avatar
  • 50
0 votes
1 answer
43 views

The methods AI showed me are not working. However, one method mentioned by AI seems to be usable, but it is private: private CodedOutputStream(byte[] buffer, int offset, int length) So, how can I ...
21k's user avatar
  • 439
1 vote
2 answers
147 views

I would like to switch between different BYTE Arrays after user input. I need to apply the same processing to different arrays depending on user input, but I would like to avoid repeating the code. ...
Alex's user avatar
  • 13
-5 votes
1 answer
80 views

I am getting the error message data_new.write(binary_data[j]) TypeError: a bytes-like object is required, not 'int' although binary_data should be bytes-like. data_new = open(Datei_neu, "wb"...
Bulova's user avatar
  • 1
0 votes
0 answers
64 views

I have gone through dozens of articles, and this StackOverflow thread but I'm still as clueless as ever. The main points I have read everywhere and why I don't understand them are: The main points I ...
Mayank Rajput's user avatar
0 votes
1 answer
121 views

I would like to extract text from a textbox and use it as a hexadecimal: When someone types in "80" into the textbox, I want to be converted from string to hex "0x80", not "...
winter's user avatar
  • 67
-3 votes
1 answer
73 views

Input: unsigned char vet[] = { 0xBC,0xFF,0x01 };unsigned short int len = 18; Output: short int minLung;short int maxLung; Given a sequence of bits, determine the minimum and maximum length of ...
Tania Volo's user avatar
0 votes
0 answers
45 views

I'm running a python script that receives data over a TCP connection. This connection can send multiple messages that consists of multiple variables which have multiple data types. When a string is ...
Arn's user avatar
  • 1
4 votes
1 answer
129 views

I am trying to create and save KeePass entries using pykeepass and saving a .txt file as an attachment. However I get a type-error: Traceback (most recent call last): File "c:\Users\...
Simplicissimus's user avatar
0 votes
0 answers
48 views

I am trying to write a binary string as binary data to file but my function seems to be having a problem with the int conversion. I am reading a text file and manipulating it which gives me a string ...
user3840530's user avatar
0 votes
1 answer
103 views

I see a lot of questions and answer regarding converting a byte array into string however my case is quite different and I cannot for the life of me find a way to do what I need. I generate a result ...
Rami Aboulissane's user avatar
0 votes
0 answers
38 views

I'm working on a python program that uses mpmath to implement the Chunovsky algorithm for computing pi. I want to make my program log its progress to a file on regular intervals, so that I can ...
ulsbai's user avatar
  • 1
1 vote
3 answers
82 views

I am using a TCP-client program to catch a list of bytes, and when I send such a list of bytes, this is what I see: I want to capture those characters in a logfile, so I did the following: log.Debug($...
Dominique's user avatar
  • 17.6k
0 votes
0 answers
48 views

Does anyone know how we can store images obtained from a URL to object box ? This is what i currently have: @Entity() class ServiceModel { @Id() int id = 0; @Unique() final String identifier; ...
Mervin Hemaraju's user avatar
0 votes
0 answers
73 views

I'm taking over an old VB.Net application, and there is some information, written in a string. I'm trying to decode this into a ByteArray but this fails: Here's the code: Dim sixthColumn As String = ...
Dominique's user avatar
  • 17.6k
0 votes
2 answers
101 views

Hey all I am getting the following error when running this code: byte[] bytes = new[] { Convert.ToByte("&H" + Conversion.Hex(127)), Convert.ToByte("&H" + Conversion....
StealthRT's user avatar
  • 10.6k
0 votes
0 answers
37 views

class Metadata(Enum): bit_rate_kbps: int sample_rate: int channel_mode: Literal['mono', 'audio'] file_name: str # includes extension file_size: int # mb file_ext: Literal['wav']...
Dani Baba's user avatar
0 votes
1 answer
76 views

I would like help please to get the 4 Return meter values (post gain/trim, gate, dyn gain reduction and post‐fade) from the X32 behringer mixer, these are in 32 bits floats, little‐endian coded. to ...
Ossama's user avatar
  • 2,441
2 votes
1 answer
194 views

Problem statement: I am encountering an issue when running the following multi-threaded program. The program spawns a large number of threads (10,000) that process the same byte array value. The issue ...
Amey Sawant's user avatar
3 votes
2 answers
171 views

I have a hex string of unknown (variable) length and I want to pack or unpack at any time to convert to bytes. ["a"].pack("H*") # => "\xA0" I'm getting \xA0 -- is ...
q9f's user avatar
  • 11.9k
1 vote
0 answers
23 views

Cause: Incorrect data types or column count mismatch when inserting rows. Solution: Verify that the row data matches the container schema. For Blob type, ensure the binary data is passed as a ...
Thomas Richard's user avatar
-2 votes
1 answer
96 views

I got a byte[] array from an input file (ASCII text file) and I'm trying to delete all bytes of a pre-set hex value, without converting the array to string and without using lists. This is the code I ...
maykuul's user avatar
  • 13
1 vote
3 answers
149 views

Consider the following code: signed a = -1; unsigned b = UINT_MAX; printf("%d\n", a==b); signed char c = -1; unsigned char d = UCHAR_MAX; printf("%d\n", c==d); The result will be:...
Elicon's user avatar
  • 219
0 votes
2 answers
469 views

Trying to create a function that converts objects to byte arrays (without the overhead/metadata things like BinaryFormatter create). I think I'm happy with the following code except the ability of it ...
Arvo Bowen's user avatar
  • 4,968
2 votes
1 answer
273 views

Is there a consistent way of reading a c struct from a file back into a Python Dataclass? E.g. I have this c struct struct boh { uint32_t a; int8_t b; boolean c; }; And I want to read it's data ...
Brendon Mendicino's user avatar
1 vote
0 answers
38 views

I want to upload a picture file without saving it to the hard disk (mainly because of performance). My code is as shown below. Public Shared Function ConvertToByteArray(ByVal value As Bitmap) As Byte()...
Tanmay Chakraborty's user avatar
-2 votes
1 answer
59 views

I'm trying to confirm this struct is being formatted correctly for network byte order, but printing out the bytes and printing out the hex of the bytes give me different output, with the hex being the ...
Thundercleez's user avatar
1 vote
4 answers
227 views

It is possible to find the value stored at an individual byte of memory of an int by creating a pointer of a byte type, such as char, and initializing to the address of the int. The code should look ...
Artem Panfilov's user avatar
1 vote
1 answer
561 views

I am trying to convert a vector of ASCII bytes into a rust string. I found the std::str::from_utf8() function, that should be able to handle all ASCII strings. For some reason it cannot read the ...
rwutscher's user avatar
0 votes
1 answer
68 views

I am trying to convert values from 0 to 255 to a single char. I am using chr. But this is somehow converting a number like 255 to a two char string. I add up those values to a string which is then ...
user3719581's user avatar
-2 votes
1 answer
222 views

I recently found out that bytes.nth(i) is waay faster than chars.nth(i) if you want to iterate over a String. pub fn test(word1: String) { for i in (0..word1.len()).rev() { word1.bytes()....
SebastiaanTheCoder's user avatar
0 votes
1 answer
415 views

I need to build a WireMock.Net server for requests having body as bytes. I tried the matcher .WithBody combined with the converters Encoding.ASCII.GetBytes (and GetString) but with no success. Thank ...
Youcef Kelanemer's user avatar
1 vote
3 answers
340 views

I have results returned from a function and storing it in a dictionary like this ${results}={'value': b'\x01\x00\x01\x00\x01\x00', 'type': None, 'error': None} Now I want to extract only the value of ...
Usha RH's user avatar
  • 11
0 votes
1 answer
1k views

I am working with byte strings that include non-ASCII characters, specifically Hebrew text, and I encountered a UnicodeDecodeError when trying to decode the byte string to UTF-8. Here's the ...
Ofer Rahat's user avatar
3 votes
1 answer
103 views

I'm writing a .wav PCM file header in C, but one part I'm still stumped on handling is the bits per sample format parameter of a file. Right now I've only added support for 8-bit and 16-bit PCMs (...
opl23590's user avatar
0 votes
0 answers
54 views

I am looking for a solution to retrieve the hex I am storing in my VersionNum column of my database which is of type (timestamp, not null). I am using a SQL Server database. VersionNum (timestamp, not ...
Unconquered82's user avatar
4 votes
2 answers
252 views

Why does the VB expression Asc(ChrB(128) & ChrB(0)) yield 63 and not 128? Recently, I've been looking at Visual Basic's InputB function for reading binary data. According to the help system, ...
Ant's user avatar
  • 42
1 vote
0 answers
38 views

According to Microsoft (https://learn.microsoft.com/en-us/windows/win32/controls/themesfileformat-overview#metrics-section), the Metrics section of a .theme file looks like IconMetrics=76 0 0 0 139 0 ...
user85987's user avatar
0 votes
3 answers
117 views

I have a Python scripts for printing a decimal string-represented integer as a 4-bytes little-endian representation: import sys i4 = int(sys.argv[1]) sys.stdout.buffer.write(i4.to_bytes(4, 'little')) #...
Vadim Kantorov's user avatar
1 vote
0 answers
52 views

I have the following function: def pad(array, target_size=(224, 224), pad_value=255): # calculate padding pad_h = (target_size[0] - array.shape[0]) // 2 pad_w = (target_size[1] - array....
T_d's user avatar
  • 63

1
2 3 4 5
157