# Questions tagged [binary]

Binary, the base-2 numeral system, represents numbers using two symbols: 0 and 1. For compiled computer programs, use the "executable" tag instead.

**0**

votes

**0**answers

7 views

### Is there a repository of scripts to install of language runtimes (python, golang, node) and binaries (docker, imagemagick)?

I am spinning up many different servers for very different use cases, and I need a mix of all common run-times. For example, I want to install Golang 1.8 and Node 8.6 and .NET Core 2.1 on Ubuntu 18.04,...

**-1**

votes

**0**answers

17 views

### I have to convert an input file of ASCII and non ASCII characters to a binary vector using Fortran 90

Is there any routine available ? I didn´t find any
Thanks

**0**

votes

**1**answer

27 views

### Problem converting a text file into binary file using perl

I would like to convert some data in binary using Perl. The data needs to be output in 8 bits binary. The original data comes in this format:
137.0000
136.0000
133.0000
136.0000
10.0000
134.0000
0....

**-4**

votes

**0**answers

32 views

### Show png in html from binary datas

I need to display an image in php and html, i get the image from a link and it give me this code:
‰PNG
IHDRÈå“š’PLTEÙÚÝ>=<DBAsnjÓÔÛÔÕÛ321‹ŠÐÑØ[XU+*)!! ÕÖÞÓÔÜÓÕÜÍÎÕ)((ÈÊÑÆÉÑÑÒÚÅÈÐÔÕÝZMFØÚáËÎÖÖ×...

**1**

vote

**3**answers

69 views

### How to parse through a list of lists and analyze the elements together to see how many times they occur over time?

Let's say I have a machine that sends out 4 bits every second and I want to see the amount of times a certain bit signature is sent over time.
I am given an input list of lists that contain a message ...

**0**

votes

**0**answers

34 views

### How Does a computer understand an input not just a string of letters or numbers? [duplicate]

I have been programing with languages that allow me to input values or strings and I get something. But I seek a deeper understanding of something.
How does a computer on a software level understand ...

**-2**

votes

**1**answer

39 views

### Unable to pass python variable to go binary

In my python script I am trying to pass a variable to a Go binary to perform an operation and retrieve output from Go binary as variable and use it in my python script
This is my Go Program which I ...

**-1**

votes

**1**answer

30 views

### How to use binary data inside a python file [on hold]

I want to use a binary data of jpg file inside a py file.
I can use:
with open("example.jpg", "rb") as f:
Content = f.read()
But in that case I have to use both jpg file and python file.
So I ...

**-5**

votes

**0**answers

23 views

### How to see and edit the .jpeg or .png files binary code?

i was searching for How to see the .jpeg or .png files binary code in python , but i couldn't find anything
i want to see their headers and edit them
what should i do ?

**0**

votes

**0**answers

17 views

### Read unsigned long long in PHP from file

I need to read 16x unsigned long long in PHP.
How to rewrite those from python in PHP?
file.seek(12108)
string = format(unpack('>Q', file.read(0x8))[0], '016x')
print(string)

**-3**

votes

**0**answers

67 views

### Algorithm for maximum sum after XOR

Let there be a set of N numbers. Now we are given two values K and X. Now we pick exactly K different numbers. And the each of that number with the XOR of X and that number.
We can perform these ...

**0**

votes

**1**answer

17 views

### Python read binary file of unsigned 16 bit integers

I must read a binary file in Python, and store its content in an array. The information I have on this file is that
filename.bin is of size 560x576 (height x width) with 16 b/p, i.e., unsigned 16-bit ...

**0**

votes

**1**answer

19 views

### Why is it subtracting 1 and doing a bitwise inverse is equivalent to doing a bitwise inverse and adding 1?

I am studying two's complement and have come across 2 methods for converting a number's two's complement representation to its decimal representation:
Subtract 1 from the initial binary number, then ...

**1**

vote

**1**answer

37 views

### How to fix binary trees coming back with "cannot read 'left' of null' after running test?

My unit tests for my binary tree and binary search tree are coming back as
TypeError: Cannot read property 'left' of null.
I've looked at similar questions here and have checked for ...

**-1**

votes

**4**answers

84 views

### How can I find how many times does 101b show in the number?

I need to find out how many times does the sequence 101b shows in a 16 bit number. But I need to find also the ones that are far away.
For example: in the number 01010101 it appears 4 times. Because ...

**0**

votes

**1**answer

56 views

### I don't understand how this code to “write an uint32 inside an array in javascript” works

So basically i have this piece of code that i have found into someone else's code and works fine for the thing i'm trying to do but i will like to understand how it works.
I wanna know how it ...

**0**

votes

**1**answer

13 views

### Create a repeating binary pattern of known length

I want to create a repeating binary pattern based on a user-specified length. The number specified would determine the number of 0's and 1's in each cycle. For example, if the user inputs 2, then ...

**0**

votes

**1**answer

30 views

### How to write array of bytes to a binary file in Java

How to write an array of bytes b[i] to a binary file in Java.
I need to write those bytes it into a "binary file" to be able to read it later using Hex Editor (AXE).
Some readers might be confused ...

**-1**

votes

**0**answers

29 views

### Anyone know how to Decode AVC data C++? No libraries

I'm looking to decode avc data, specifically, avc1 codec data held inside an mp4 file. For the purpose of this post, please refrain from suggesting libraries to use, as the task is to do it in C++ ...

**0**

votes

**1**answer

13 views

### Combining fine and course multispeed synchro angles

I'm looking to combine the binary outputs from a course and a fine synchro, sometimes referred to as combining multispeed resolvers.
The course synchro is connected x1 so its MSB corresponds to a ...

**0**

votes

**1**answer

15 views

### How to replace efficiently a line in huge half ascii half binary file in Python

i need to change the a line in the ascii header of a huge .ply binary file (point cloud format)[see : http://paulbourke.net/dataformats/ply/ ]. I don't need to change anything else.
I'm using python ...

**0**

votes

**1**answer

54 views

### C++: How to convert 32bit data into Signed Integers [duplicate]

In my personal C++ library, I code to handle working on different endian systems (little or big) by working with individual bytes. For example, I calculate a 16bit unsigned integer as follows by using ...

**-1**

votes

**1**answer

38 views

### Swift - Convert an Image's Data to Binary Number

Is it possible to take an image and convert its data to Binary?
I was able to convert an image's data to a String, but I'm not sure how to now take that String and display its Binary equivalent.
...

**-1**

votes

**0**answers

12 views

### How to open a binary file and extract an image?

Can anyone help me with extracting an image from a file which has charset= format?
I am not sure what to try here.
image/jpeg; charset=binary
Would like to get an image out of it.
Thank you for ...

**1**

vote

**2**answers

48 views

### How to put numbers to array in while loop in java?

I am trying to add two binary numbers and then get their sum in binary system. I got their sum in decimal and now I am trying to turn it into binary. But there is problem that when I take their sum (...

**2**

votes

**1**answer

33 views

### x86 Linux ELF Loader Troubles

I'm trying to write an ELF executable loader for x86-64 Linux, similar to this, which was implemented on ARM. Chris Rossbach's advanced OS class includes a lab that does basically what I want to do. ...

**0**

votes

**1**answer

21 views

### Reading integer from bin file does modulu(256) on number which are larger than 256

I'm trying to read numbers from a bin file, when it gets to a number which is larger than 256, it does a modulu(256) on that number, for example:
the number which i'm trying to read is 258, the number ...

**0**

votes

**0**answers

38 views

### How to convert a decimal fraction number into base 2 fraction number in R?

I need to write a function that converts a decimal fraction number into base 2 fraction number in R. e.g. f(0.125) # 0.001
What I did: I searched for the related functions in R packages:
DescTools::...

**1**

vote

**1**answer

41 views

### How to save binary dat file (.dat) to png or jpg format?

I have a binary file format .dat. I want to convert it to png or jpg format, I try to decode it using numpy.loadtxt() to get an array list and then save it to png or jpg format. But when I execute it ...

**0**

votes

**2**answers

18 views

### Why can't I convert these hexadecimals into utf-8?

Hexadecimals: 0xe0 0x3e 0x38 0x2e 0x7e 0x63 0x78 0x66
HEX: e0 => DEC: 224
HEX: 3e => DEC: 62
and so on.
If I convert each of these hexadecimals to a decimal and look up the decimal in the "unicode ...

**0**

votes

**1**answer

19 views

### I read image file as binary strange symbols appear

I read an image file in binary in python:
open('chall.png, 'rb').read()
Result:
b'\xe0>8.~cxfein{ ;-0lek\xf7virejneinv\xe7I\x01blo7\x14"1\x07;\x03\x1bE\x19\x1c\x19\x0f\x1a\x05\x07L\x11\x10\x1e\...

**1**

vote

**3**answers

48 views

### Encoding and decoding two integer values both 0-3 into one byte

I'm trying to encode two values a "movement direction" which can be 0,1,2, or 3 and a "looking direction" which can also be 0, 1, 2, or 3
I know it's possible to store this information into one byte
...

**0**

votes

**0**answers

24 views

### Converting a decimal number into a Q3.4 fixed point representation

How can I convert - 4,5_10 into the Q3.4 fixed point representation?
My suggestion would be:
4_10 = 100_2
0,5 * 2 = 1,0
0 * 2 = 0,0
Result: 0100 0010_2
Inverting the result to: 1011 1101_2
And ...

**0**

votes

**1**answer

24 views

### Search for pattern in binary array

I am writing a function to search in the binary array(bitmap file) a pattern of bits. The size of the pattern is from 5 to 8 bit long. I have implemented this function as testing for each bit in the ...

**1**

vote

**3**answers

58 views

### Converting a number to IEEE 754

Can someone help me with this question:
“Convert the decimal number 10/32 to the 32-bit IEEE 754 floating point and
express your answer in hexadecimal. (Reminder: the 32 bits are used as
follows: Bit ...

**-2**

votes

**0**answers

19 views

### How to get specific fields from MBR file (Linux)

I need to write Java code for parsing .bin file which contains MBR data.
I need to get the addresses of the beginning of the logical drive, its name, and the system code.
I tried to find some ...

**-2**

votes

**0**answers

21 views

### Problem in converting elements of array to binary and Find a float input number after decimal point

First I Apologize for the Previous Question, that was incomplete and I correct my question.
I have a dataset contains 4 columns of data, and we need to convert all of them to binary. Each of the ...

**-2**

votes

**2**answers

55 views

### What is a variable type bit(32)?

What is a variable of type bit(32) and when can I use it? I also can't seem to replicate this declaration in my own C++ code (in xcode). This is an example of it being used in mp4 file specifications, ...

**0**

votes

**0**answers

17 views

### Trouble with simple Hex to Int Calculation

The specifications for mp4 files outlines its contained matrix. For which, it describes:
The matrix provides a transformation matrix for the video: (u,v,w) are restricted here to (0,0,1) with types (...

**0**

votes

**0**answers

40 views

### How to do binary linear algebra on a sparse matrix in Matlab (or any other language)?

I have a sparse binary matrices whose properties I want to analyze over the binary field. The application is to analyze some sparse, binary error-correcting codes. The matrices themselves are too big ...

**-1**

votes

**1**answer

13 views

### How to pass binary (16) to a mysql function as an argument

I would like to pass the uuid of version varbinary(16) to a user-defined function in MySQL version 5.7.x - It throws an error
1406 - Data too long for column
I have a table with uuid primary key ...

**2**

votes

**1**answer

69 views

### Understanding the binary representation of a float

I am using the following code to print out a "binary representation" of a floating point number:
template<class F>
void printBinary(F value)
{
std::cout <<
std::bitset<...

**1**

vote

**1**answer

46 views

### How to edit binary file in Android?

I want to create an app that can open binary file, read and edit it's content in decimal values, and then save it back to binary file.
This file that I want to open have multiple parameters written ...

**0**

votes

**4**answers

59 views

### finding the power of 2 of a number [duplicate]

What is the most optimized way to find the power of 2 of a number. For example : if number is 64 then I want 6 as result.
P.S. : I have read many posts about how to check if the number can be ...

**-4**

votes

**2**answers

52 views

### 5.2 recurring binary how to calculate the binary value

double 5.2 number when i find the binary value of this recurring binary i get as
01000000 00010100 11001100 11001100 11001100 11001100 11001100 11001100
like this when i print the binary value ...

**0**

votes

**0**answers

10 views

### How to host a server that's only a binary file?

I'm experimenting with compiling my Node app to binary using 'nexe' and then hosting it. The app is compiling successfully so far but I am wondering how I can use a host? Is there any host service ...

**0**

votes

**0**answers

7 views

### What is native binary encoding in blockchain?

I understanding binary encoding but could not comprehend what does native binary encoding mean? If I am off-context, I would like to share from where I got this term: A GH page.

**1**

vote

**2**answers

44 views

### Can a Wasm executable be encrypted to prevent reverse engineering?

Can a Wasm executable be encrypted to prevent it being reverse engineered?

**1**

vote

**2**answers

40 views

### How to convert floating number to binary if I have no 32 bits for it

I'm trying to convert a fractional number 1,76 to binary, but the size of the exponent is not 8 bits, but 3 bits, and the size of mantissa is not 23 bits, but 6 bits. That is, there are only 10 bits.
...

**1**

vote

**1**answer

48 views

### How to read images and labels from the infimnist / mnist8m dataset?

Using the the program at this link, https://leon.bottou.org/projects/infimnist, I generated some data.
As far as i can tell it is in some sort of binary format:
b"\x00\x00\x08\x01\x00\x00'\x10\x07\...