Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
136 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
  • 71
0 votes
1 answer
174 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
994 votes
21 answers
2.0m views

I'm converting something from VB into C#. Having a problem with the syntax of this statement: if ((searchResult.Properties["user"].Count > 0)) { profile.User = System.Text.Encoding....
nouptime's user avatar
  • 10.6k
504 votes
35 answers
608k views

I got this code to covert size in bytes via PHP. Now I want to convert those sizes to human readable sizes using JavaScript. I tried to convert this code to JavaScript, which looks like this: ...
l2aelba's user avatar
  • 22.3k
679 votes
37 answers
943k views

When I executed the following command: ALTER TABLE `mytable` ADD UNIQUE ( `column1` , `column2` ); I got this error message: #1071 - Specified key was too long; max key length is 767 bytes ...
Steven's user avatar
  • 25.5k
924 votes
11 answers
2.4m views

I've very recently migrated to Python 3.5. This code was working properly in Python 2.7: with open(fname, 'rb') as f: lines = [x.strip() for x in f.readlines()] for line in lines: tmp = line....
masroore's user avatar
  • 10.2k
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
176 votes
31 answers
214k views

Just wondering if .NET provides a clean way to do this: int64 x = 1000000; string y = null; if (x / 1024 == 0) { y = x + " bytes"; } else if (x / (1024 * 1024) == 0) { y = string.Format("{0:...
John Smith's user avatar
  • 4,536
-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
42 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
-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
4 votes
1 answer
125 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
231 votes
13 answers
780k views

Does an Integer variable in C occupy 2 bytes or 4 bytes? What are the factors that it depends on? Most of the textbooks say integer variables occupy 2 bytes. But when I run a program printing the ...
Rajiv Prathap's user avatar
143 votes
14 answers
499k views

I want to convert a byte array to an image. This is my database code from where I get the byte array: public void Get_Finger_print() { try { using (SqlConnection thisConnection = new ...
Tanzeel ur Rahman's user avatar
209 votes
11 answers
1.0m views

I have to store some constant values (UUIDs) in byte array form in java, and I'm wondering what the best way to initialize those static arrays would be. This is how I'm currently doing it, but I feel ...
dfickling's user avatar
  • 2,705
122 votes
14 answers
280k views

For example, the bits in a byte B are 10000010, how can I assign the bits to the string str literally, that is, str = "10000010". Edit I read the byte from a binary file, and stored in the ...
Sean's user avatar
  • 4,555
102 votes
4 answers
173k views

I have a bytes type object like this: b"{'one': 1, 'two': 2}" I need to get proper python dictionary from the above bytes type object using python code. string = b"{'one': 1, 'two': 2}&...
Harathi's user avatar
  • 1,129
131 votes
14 answers
232k views

I've done some research. A byte is 8 bits and a word is the smallest unit that can be addressed on memory. The exact length of a word varies. What I don't understand is what's the point of having a ...
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
163 votes
10 answers
243k views

I would like to know how much space does my MySQL database use, in order to select a web host. I found the command SHOW TABLE STATUS LIKE 'table_name' so when I do the query, I get something like this:...
marvin's user avatar
  • 1,945
0 votes
2 answers
461 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
131 votes
10 answers
247k views

I need to create a client-server example over TCP. In the client side I read 2 numbers and I send them to the server. The problem I faced is that I can't convert from []byte to int, because the ...
Emanuel's user avatar
  • 6,992
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
95 votes
11 answers
211k views

I have an instance of a struct that I defined and I would like to convert it to an array of bytes. I tried []byte(my_struct), but that did not work. Also, I was pointed to the binary package, but I am ...
abw333's user avatar
  • 6,001

1
2 3 4 5
157