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

I wrote a variation of Ryu double-to-stream algorithm. My version has no meaningful impact on the code, for the purpose of this question you can read the original file. I'm writing coverage test for ...
Vento's user avatar
  • 93
Advice
2 votes
5 replies
140 views

I've written a program that takes in a text then prints the binary translation of it. İts been working perfectly fine until I tried the case where entire string is just made up of spaces. As to ...
Mehmet emi Sevim's user avatar
Advice
0 votes
4 replies
43 views

I have the following c source: int _start(){} which I compile as: gcc -c -o main.o main.c -ffreestanding then I link as: ld -oformat binary main.o The binary's hexdump looks as: $ hexdump a.out ...
mltm's user avatar
  • 595
Best practices
0 votes
4 replies
128 views

I have confirmed that the following VBA code works just fine. Dim mydate As Date mydate = Date Open "C:\Windows\Temp\dlctest.data" For Binary Access Write As #1 Put #1, , mydate Close #1 ...
Dave Clark's user avatar
4 votes
3 answers
193 views

I am trying to figure out a code that would be able to swap the higher half and the lower half of the binary form of an integer number such as for example: 0000000 00110011 01001001 11111110 turn into ...
Fe A person Mo's user avatar
2 votes
3 answers
136 views

I have created a simple hello.c which contains just the definition of an array: unsigned char arr[4] = {1,2,3,77}; I have then compiled it with gcc -r in order to produce a relocatable object file. ...
Sterpu Mihai's user avatar
0 votes
2 answers
155 views

I'm building a Huffman compressor in Java. I already have: The original text, the Huffman code table (Map<Character, String>), and the order of character appearance. My current goal is to write ...
Eslyn19's user avatar
  • 19
0 votes
0 answers
87 views

The problem: "Use Hamming's code to detect if there was an error in the following message and correct it." m_8 m_7 m_6 m_5 m_4 m_3 m_2 m_1 c_4 c_3 c_2 c_1 1 1 1 0 1 0 1 1 0 0 0 1 My first ...
Danilo Jonić's user avatar
0 votes
2 answers
184 views

I have a C program that I made that is supposed to convert binary into a signed integer, but it does not give the correct result. Here is the function of the code that converts binary numbers to ...
Sebastian Llaurador's user avatar
0 votes
1 answer
136 views

I coded int num1_bin = 00000010; However, in the debug console, it comes out as 8. Is there a mistake in my code, or a setting in C++? I just started coding in C++ for univ. I expected int num1_bin = ...
Whadaboi23's user avatar
-1 votes
3 answers
99 views

Assume I have a 1 source variable (int) which is 10 bits long. Let's call it src. I have 2 destination variables (int) which are 8 bits long namely byte1 and byte2. MSB LSB src ...
user1175097's user avatar
0 votes
2 answers
142 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
3 votes
1 answer
163 views

I want to code a shinyApp which can convert a string from binary (0 and 1, not hex) to utf-8 and vice-versa. Example : encode("Aé") # return "010000011100001110101001" decode("...
Francois51's user avatar
2 votes
1 answer
174 views

I'm writing a Winforms app that will allow me to change my cursor. My goal is to have buttons with each having their own respective cursor as their image by converting their files into bitmaps. ...
ElateTugboat's user avatar
3 votes
1 answer
230 views

I'm working with microscope images captured using a JEOL system, and I'm trying to decode metadata stored in the TIFF tags. The data appears to be in a binary format and when extracted (using tifffile ...
Hulk Kok's user avatar
0 votes
2 answers
114 views

I have a number represented as a large binary string (length can be up to 1 million bits). The number is recursively split as follows: At each step, divide the number x into two parts: floor(x/2) and ...
md emon6767's user avatar
0 votes
0 answers
29 views

Given a number with a width of n bits representing a signed number in two's complement, what is the minimal number of bits that need to be checked and which ones, in order to know whether there will ...
Ranar 100's user avatar
1 vote
1 answer
111 views

My goal is to save a huge 2d matrix as binary in kdb q, so that my python code can import it as numpy matrix. I played with numpy.fromfile and numpy.memmap but I don't think kdb is writing it into a ...
David Moss's user avatar
0 votes
0 answers
40 views

What are the possible ways to generate all the vertices of boolean hypercube of dimension n (0 to 2^n - 1 in binary representation) using parallel programming? Also, among all the possible ways, ...
ahmed 's user avatar
  • 11
3 votes
3 answers
200 views

I have a simple CURL callback for a C websocket that needs to identify the closecode, but it gives me weird values when I shift it. I don't understand signed char binary representation. size_t ...
stavratum's user avatar
0 votes
0 answers
85 views

I have two bitwise expressions and need to figure out which one is faster. Also, if there are other ways to implement the same, but in a faster way than the given expression. I am using these ...
ahmed 's user avatar
  • 11
1 vote
1 answer
99 views

I'm making a binary translator to get back into C but the program doesn't work. The code: #include <stdio.h> void clearBuffer() { char dummy; while (dummy != '\n') scanf("%...
Angargedon's user avatar
-2 votes
1 answer
123 views

I'm trying to make a function that appends 2 longs into one and back again. I used the (ac) + (ad) + (bc) + (bd) formula to combine the numbers. I have searched for and wide (including this site) with ...
taylor_krs's user avatar
0 votes
1 answer
45 views

We have some swagger-ui.js code generating a download link to a png image delivered from a REST API call. The download link is generated by the swagger-ui.js code: var binaryData = []; binaryData.push(...
G. Cuthbert's user avatar
0 votes
2 answers
140 views

I needed to convert decimal numbers in a string to binary. I needed to use it for a program. I tried this code: static String numbers = "48, 40, 6, 82, 222, 94, 152, 46, 77"; public ...
YahyaB's user avatar
  • 84
0 votes
0 answers
94 views

I am using an STM32H723 to communicate with a u-blox NEO M9N IC over the UART protocol. I have established communication with the NEO M9N GPS and received accurate positioning data at around 1 Hz. ...
Alexander-Rumer'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
130 views

I create a file named "test.s" with the content "jmp -2". Then I execute "as --32 -o test.o test.s" and "objdump -D test.o". (I don't want to discuss here that ...
user1994405's user avatar
1 vote
0 answers
106 views

I wrote a function in Arduino to generate random numbers with the same number of binary bits as the input. However, when using random() with calculated ranges, the output sometimes doesn't match the ...
石佳恩's user avatar
0 votes
1 answer
62 views

I have a binary file with the following structure: • Byte 0: file version number (2) • The remaining bytes represent records, which are composed of the following information: – 2 bytes: lane ...
morg's user avatar
  • 1
-6 votes
1 answer
190 views

Trying to make a simple binary counter in C++: #include <iostream> #include <condition_variable> #include <cstdlib> using namespace std; int c1 = 0; int c2 = 0; int c3 = 0; int c4 = ...
James Reeploeg's user avatar
1 vote
1 answer
99 views

I'm having some problems decoding what should be simple data. I have a base64 string that represents a np.int64 followed by an array of np.float64. The size of the array is defined by the first np....
jpmorr's user avatar
  • 676
3 votes
1 answer
52 views

Currently I am building an economic model in Python GEKKO: m = GEKKO() m.time = np.arange(0, 200, 1) #define the variables consumption = m.Var() tax = m.Var() ...
user29971580's user avatar
2 votes
1 answer
183 views

I might be silly to ask this, but I search around in google and did not got an definite answer(maybe I should be more careful). Given a series of bytes, what is the fastest way to know the number of 1 ...
Zeyu Zhang CN's user avatar
-12 votes
3 answers
313 views

What is an efficient way to get the same result as list(product((0, 1), repeat=n)) without using itertools and any imports? For example, given n=3, the output be: [(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, ...
Ξένη Γήινος's user avatar
0 votes
2 answers
265 views

This may seem trivial but I haven't found a good solution to the problem. I have even found this: generate all n bit binary numbers in a fastest way possible. but I haven't found an exact duplicate. ...
Ξένη Γήινος's user avatar
0 votes
2 answers
157 views

I'm reading The C Programming Language by K & R 2nd edition and got to the bitwise operators. Why, on C, the Complement (~) Operator applied to a N number, returns -(N + 1) ? When it normally just ...
nerdpanda's user avatar
-1 votes
1 answer
53 views

Is there a way to make Python interpret ~3 as an unsigned integer?
Geremia's user avatar
  • 5,844
0 votes
1 answer
236 views

While researching embedded arm programming using gnu tools, I have found many examples, such as here or here, of build scripts where objcopy is invoked with -S -O binary, for example: arm-none-eabi-...
AWM's user avatar
  • 54
0 votes
0 answers
63 views

nanodbc::connection connection("Driver={SQL Server};..."); nanodbc::statement statement(connection); nanodbc::prepare(statement,"select NULL, CAST(NULL AS VARBINARY(MAX))"); auto ...
yoko's user avatar
  • 1
1 vote
1 answer
200 views

I have the following... @MessageMapping("/hello") @SendTo("/topic/greetings") @Throws(Exception::class) fun greeting(message: TestMessage): Greeting { However, when I run and send ...
Jackie's user avatar
  • 24k
1 vote
1 answer
158 views

Is there an algorithm that produces an efficient shuffle for a uint32 into a different uint32 that results in a 1:1 mapping when given a changeable random seed? My initial direction on this is an ...
rtek's user avatar
  • 101
1 vote
1 answer
110 views

I want to create a 2-D matrix of binary variables x. For now I do it like this: x = IndexedBase('x', shape=(imax,jmax), integer=True) For a binary variable, the following identity holds: x_i**n == x_i ...
ccalaza's user avatar
  • 23
1 vote
0 answers
58 views

Context I have a file of binary logs and each log is 7 bytes. The first 4 bytes is a timestamp (writeUInt32BE), the following 1 byte is an indicator (num 1 or 2 using writeUInt8) and the last 2 bytes ...
user423896's user avatar
0 votes
1 answer
40 views

There are tons of answers here in SO and elsewhere on the web about how to resize an image using PHP when the image is on disk. However, these do not work if the image is held in a variable. I believe ...
user6631314's user avatar
  • 2,050
0 votes
0 answers
157 views

I found that I can sandwich .7z archive files between other, binary data and 7za is still able to list and (presumably) extract files from this archive. I think this is useful eg to create a quintuple-...
ecm's user avatar
  • 2,953
0 votes
2 answers
96 views

orjson is already quite fast but I'm curious if there's an even faster way of getting from [1, 0, 0, 1] to 'intermediary_string' and back again, without storing any metadata separately (such as length)...
umar's user avatar
  • 21
1 vote
2 answers
89 views

I'm trying to find more decimal places to the 'Prime Constant'. The output maxes out at 51 decimal places after using getcontext().prec=100 from decimal import * getcontext().prec = 100 base = 2 s = &...
D W's user avatar
  • 23
1 vote
0 answers
473 views

I was trying various methods to use apktool on my Android-based server. My Android server runs on an arm64 architecture, but when I extracted the aapt2 binary file required for APK building from ...
Lucas's user avatar
  • 11
3 votes
1 answer
113 views

I'm trying to install a Go binary via go install from my own private repository on github. I am able to get my repository to use the sdk, but not to install. Here is my setup in ~/.gitconfig: [url &...
MaxThom's user avatar
  • 1,451

1
2 3 4 5
297