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.
14,726
questions
0
votes
1
answer
30
views
'bit_ceil' was not declared in this scope
i am trying to use bit_ceil(), I included the < bit > header, and used the std namespace (I know that it is not a good practice, but I did it here for the sake of the question)
but when I try to ...
0
votes
0
answers
26
views
how to convert pandas dataframe to binary pandas dataframe? [duplicate]
I have a pandas dataframe:
1. sc_RNA seq dataframe (n_cells, a_genes): contains gene expression matrix.
Now I need to convert these pandas dataframes into binary pandas data frames, where, if there ...
-1
votes
1
answer
34
views
Write a program that takes a positive number and outputs it as binary
Write a program that takes in a positive integer as input, and outputs
a string of 1's and 0's representing the integer in binary. Example output: 5 is 101 binary. When the value is 0 or less, output ...
-1
votes
0
answers
19
views
Batch Normalization in Binary data [closed]
Should i use batch normalization in binary data after the first dense layer? I am also using dropout, if i should use batch normalization, should it be used after or before the dropout layer?
It is ...
1
vote
1
answer
37
views
An output problem while converting from decimal to binary in assembly 8086
I was writing a code in assembly 8086 were you have to input a decimal number and it converts it to a binary one, but I face a problem with the output. The output is fine from numbers 1 to 2559, but ...
0
votes
0
answers
9
views
Failed install Bettercap /usr/local/bin/bettercap: line 9: require: command not found
Good evening community
I hope you can help me, I am trying to install bettercap on my kali linux, but I am getting the following errors
/usr/local/bin/bettercap: line 9: require: command not found
/...
1
vote
1
answer
34
views
How to get .pdf file from remote server to local?
I have remote virtual server(oracle linux 7.6) contain .pdf file and I open this with Firefox.
Remote server block external network.
but I can select, copy string from remote to local.
how to get ....
0
votes
0
answers
22
views
Expression.Error: We cannot convert a value of type Binary to type Text. M/Power Query in PowerBi
` let
// Define the API endpoint URL
apiUrl = "https://collibra.com/rest/2.0/outputModule/export/csv?validationEnabled=false&headerRow=true",
// Define the username and password for ...
0
votes
1
answer
14
views
How to I shorten this base64 line by 4 characters?
i'm working on a geometry dash private server and I need to replace the original database link (aHR0cDovL3d3dy5ib29tbGluZ3MuY29tL2RhdGFiYXNl) with my own but every time I encode my database link it ...
-1
votes
0
answers
24
views
Is there an equivalent in C# to javascripts FileReader .readAsDataUrl method?
I have some javascript code below that works for an incoming binary image string:
export function convertAttachmentBody(binaryString) {
let my_uint8_array = Uint8Array.from(binaryString, c => ...
0
votes
2
answers
51
views
KOTLIN - How to represent message length as 2 binary bytes
I am facing a problem while building an integration between ECR (electronic cash register) and an android POS. I'm working on the android POS and i want to calculate the message size and add it in &...
-3
votes
0
answers
16
views
How do I unencode this data? [closed]
This data is from a log file in my NWjs application... **C:\Users\Me\AppData\Local\boxes\User Data\Default\shared_proto_db\metadata\000003 **
óh.6 __global t¥íž __global ðªw ...
0
votes
0
answers
5
views
how to convert .ssj file or custom binary format video file into standard video file
I have a custom binary file with the .ssj extension, and I'm looking to convert it into a standard video format like MP4, AVI, or MKV. Unfortunately, there is no official documentation available for ...
0
votes
3
answers
51
views
Decimal to Binary Number Representation Logical Error
I have been instructed to write a program that will represent a decimal as a 32 bit binary number. My code is working, compiling properly, but the output is not correct. I have used every resource but ...
1
vote
1
answer
39
views
How can I take square of a number that come from a function?
I am new to javascript and coding.I can't take a square of a number which comes from a function.I wrote below what I want to do.Thank you all.
// BİNARY to DECİMAL
// (100110)2 > (1 × 2⁵) + (0 × ...
0
votes
4
answers
70
views
Binary Bit Extraction: How to Isolate Digits from a Whole Number in R
New to the stackoverflow here!
I hope you are all doing well. I am currently working on a dota2 data anaylst project for uni assignment and have encountered a problem that I am unable to solve on my ...
-3
votes
0
answers
38
views
How do I print out a basic binary tree as a triangle in C++?
What is want to achieve is basically this (each dot is an element of the tree)
.
..
....
........
................
................................
Up until now best I came up with is
for(ll i = ...
-3
votes
0
answers
19
views
This binary subtraction is right or wrong. Please explain me [closed]
Please explain me what is wrong my math calculation.
This is my exam note. I was solve this binary subtraction small number to large number. When I calculated by using binary calculator I got exactly ...
1
vote
2
answers
39
views
Formula to convert single precision from binary to decimal
I need to show that a single precision format, which contains 24 total bits of precision, is equivalent to about 7 decimal digits of precision.
The expression I found was simply log10(224) = 7.225, ...
0
votes
0
answers
31
views
Most efficient way to get Least Significant not set bit and Most Significant not set bit
I have a binary string, say 10111101111 and I want the Most significant not set bit i.e the first 0 starting from the left and the Least significant not set bit i.e. the first 0 from the right.
...
0
votes
1
answer
34
views
Print actual binary representation of a file [closed]
I want to print the actual binary representation of a file. For example, give some text file a.txt:
This is some text
I can print its binary representation with:
$ python -c "import sys;print(''....
-1
votes
0
answers
25
views
IEEE - IEEE 754 standard - Biased representation
Biased representation of integers.
(a) Calculate true value of 8-bit biased (also known as excess-value) representation of (1010)_2.
Assume bias is (127)_10.
Show IEEE 754 representations of the ...
1
vote
2
answers
141
views
Converting a decimal to binary in C
Edit: Sorry for the weird format, I'm still new to Stackoverflow but here is the actual main method that is supposed to be printing out the conversions. I've left out the hexadecimal part in the main ...
-1
votes
1
answer
33
views
I want to convert Gray code to binary in python and c [duplicate]
In two languages C and python3 I need to know How can i convert Gray code to its equal in binary?
For example 0111 in Gray code is equal to 0101 in binary.
Grey->Binary
0000->0000
0001->0001
...
0
votes
2
answers
61
views
Regexp to extract binary from a string
Is it possible to have string and extract the binary value from it and additionally only get the last binary digit from the value:
String = FCW2026P4F6
this would output in binary:
01000110 01000011 ...
0
votes
1
answer
27
views
Python PulP optimization with list of variables and binary variable
I'm attempting to a simple optimization using 4 variables that have lists of data. All I want to do is multiple the first 3 variables and divide the result by the 4rth variable. Then I want the ...
0
votes
0
answers
40
views
How to calculate and convert floating number to binary value?
I am working on a binary calculator app in iOS swift/SwiftUI, normal calculation are working fine in that calculator as
I take input in binary and convert binary input to Int
calculate its (Int) ...
0
votes
1
answer
67
views
Issue with Converting Binary PDF Data Stored in SQL Server VARBINARY Field
I am facing an issue with transferring binary PDF data stored in a SQL Server VARBINARY(MAX) field to a client's database using the OPENROWSET BLOB method. Here's an overview of the problem:
I ...
0
votes
1
answer
31
views
webpack.config.js with .data (binary) Files
I try to use a meter and qr scanner offline.
This scanner needs 10 Files 2 .js, 2 .gz and 6 .data files.
I added the folder in my webpack.config.js like this:
{ from: 'anylinejs', to: 'anylinejs' }
...
-2
votes
0
answers
75
views
any solution on how to access std in c++
The current version of my g++ is 13.2,
while I was able to compiled using this -std=c++20 in my tasks.json.
However, when I tried to run my binary in the terminal using .\main.exe.
I have the ...
0
votes
1
answer
29
views
Boolean Logic - Two Input Boolean Functions - Truth Table function's output clarification
I do not understand the truth table (Figure 1.2) function's output (the four right columns)
The function input variables (x and y) have bold numbers to the right of them, that I am not sure how to use,...
0
votes
1
answer
30
views
Why is BSON parsing faster than JSON?
I am trying to understand BSON in-depth. I read a few informative questions such as:
Why is JSON faster than BSON in node.js?, Which one is lighter, JSON or BSON?.
But I still do not understand what ...
1
vote
1
answer
58
views
Extracting the Last N Bits from an Array of Bytes in C
I have an array of unsigned characters in C:
unsigned char array[] = { 0xF0, 0xCC, 0xAA, 0xF0};
/* Represented as binary: 11110000 11001100 10101010 11110000 */
I'd like to extract the last N bits ...
0
votes
1
answer
33
views
How to convert an image stream to an img elements src?
I'm receiving what I am assuming to be a jpeg image stream from a request. I want to turn this into something usable as am image elements source. I've tried many methods but I continue to get an ...
0
votes
0
answers
10
views
Follwing the "https://stackoverflow.com/questions/56987505/how-do-i-decompress-a-dsn6-file-into-a-readable-format" to extract electron density data
`import sys`
`from importlib import reload
`import struct
`import numpy as np``
`reload(sys)`
`#sys.setdefaultencoding('Cp1252')`
`#sys.setdefaultencoding('utf-8')`
`#Type = sys.getfilesystemencoding()...
-1
votes
0
answers
131
views
How can I fix this corrupted.ad1 file
I failed a CTF challange and I have been searching all over the internet looking for solutions but didn't get one. Can someone help me so that I can fix the image and get the CTF flag. Here is link to ...
0
votes
0
answers
25
views
How to serialize std::unordered_map with std::variant to binary file? [duplicate]
Trying to find a way how to serialize
std::unordered_map<std::string, std::variant<bool, int, float, std::string>> m_Settings{};
Is there any other way to serialize it other than going ...
3
votes
3
answers
104
views
Best way to count set bits in Oracle
In order to save space for a very particular use-case in Oracle SQL, I'm experimenting with using a bitmap methodology for representing Boolean state over time (an event did or did not happen on that ...
3
votes
1
answer
56
views
Find the maximum k such that it's possible to get a string of 1s after applying the bitwise negation to the substrings of length >= k
You can choose a substring of length >= k unlimited times and apply the bitwise negation to it. The answer is the maximum k that allows to get a string of 1s from the initial string.
Any ideas on ...
-3
votes
0
answers
37
views
VHDL 1261 FPGA - how to change a single bit in a vector with 0 or 1
I'm trying to divide two 32-bit vectors and output a result. I compare a single bit position and then make a decision on this.
library IEEE;
use IEEE.std_logic_1164.all;
use ieee.numeric_std.all;
...
2
votes
1
answer
102
views
I'm stuck with converting a very large binary file to PNG in Java
Context
I'm trying to converting a binary file (this is a raw memory file, dumped from pmemsave instruction of QEmu monitor) to PNG file with RGB color. That's mean each 3 bytes equal Red-Green-Blue ...
0
votes
0
answers
7
views
How to execute a binary from an android app with targetSdk > 28
Everything is in the title, I ran into the same issue as the person in this topic :
Android: Execute binary from application
However no solution was found and I would like to be able to target newer ...
0
votes
0
answers
14
views
React native project installation error - cannot execute binary file
npx react-native run-android
/var/folders/7f/jpn548vn4ns3lq7chr50nb_h0000gn/T/npx-d96401db.sh: line 1: /Users/node_modules/.bin/react-native: cannot execute binary file
project file is not installing,...
0
votes
1
answer
19
views
In python I want to create a 'group_id' column based on a binary column with the count increasing for values that are 1 and staying constant for 0
The group_id should be increasing for each binary that is = 1 but grouping all consecutive 0's into one group_id, with the next group of consecutive 0's being in another group_id.
I have been using
df[...
0
votes
0
answers
43
views
Encoding difference between Python and C
I am trying to save some data obtained in Python to a binary file that one could read using C. The problem is that strings in Python and C are encoded differently, which creates unnecessary mess while ...
1
vote
1
answer
19
views
Is it necessary to convert to binary when doing addition with a hexadecimal's two's complement?
3 9 6 F E 2 + 5 3 8 A A A
This is the problem that I have to solve assuming two's complement addition. I know how to find the two's complement of each.
C 6 9 0 1 E
A C 7 5 5 6
However, most of the ...
-2
votes
1
answer
30
views
This code is solving Tree Sum problem without executing a return statement in a recursive function?
I am trying to solve GeeksforGeeks problem Sum Tree:
Given a Binary Tree. Return true if, for every node X in the tree other than the leaves, its value is equal to the sum of its left subtree's value ...
0
votes
2
answers
50
views
python output from a file like image, or npz file
I’ve tried to read a npz file and it turn out the output like below
b’PK\x04\x03\x14\x00\x00\x00\x07\x00\x05\x00!\x00M\xd05\xda\xa1\xb7\
x00\x00\x00\x07\x01\x00\x00\x06\x00\x14\x00PK.npy\x01\x00\x10\...
0
votes
1
answer
58
views
What is the algorithm to count the number of 1 bits in a 64-bit integer? [duplicate]
For example:
./bit_count 0x123456789abcdef0
bit_count(0x123456789abcdef0) returned 32
What would be an algorithm to count the number of 1-bits in the 64-bit integer value that was passed in to the ...
0
votes
2
answers
56
views
Why is 0xF used for bitwise operations involving conversions from BCD values to integers?
This may be a really dumb question, but why is 0xF used in the bitwise operations when converting from a BCD values to an integer. I understand that 0xF represents something like 0x15, which is equal ...