Questions tagged [binary-data]

Binary-data is information stored using a two character alphabet (typically written using 0 and 1)

Binary Data is information which is stored using a two character alphabet. For example, the number 42 could be stored as its base-2 representation: 101010.

In modern computers, almost all data is ultimately represented in binary form.

To be useful, the writer and reader of binary data must have a pre-agreed format (e.g. a file consisting of a 32-bit, two's compliment integer followed by three IEEE 754 floating point numbers).

The term is usually used to distinguish data stored in this way against data stored using a textual encoding. For example, the digits of 42 in base-10 (4 and 2) may be represented using ASCII as 00110100 and 00110010. Whether this is considered binary data or not depends on the task at hand; a chat client would consider messages as textual data, but the communication protocol it is built on may consider the same messages as arbitrary binary data.

1585 questions
0
votes
1 answer

Using dynamic mp3 data into embedded player via PHP not working

I've got an embedded mp3 player that i'm running in a webpage. When i load a physical mp3's path as the file url, it works just fine, but when i try to load mp3 binary data from a php endpoint, it fails. here's what I'd doing to output the mp3 data…
Kristian
  • 21,204
  • 19
  • 101
  • 176
0
votes
2 answers

How to write NON ASCII data in one file with php

I must write a binary file with php, but I think that I don't use the correct method. I use this function: $ptr = fopen("file.txt", 'wb'); fwrite($ptr, $Str); fclose($ptr); I write this string (chaotic representation of 0 and…
0
votes
0 answers

Pass binary data into stored procedure with the use of XML

I am working on a Silverlight application. Is there any way to pass binary data from an application to a stored procedure? My stored procedure only accepts one XML parameter I have a file-browse control through which I select a file I want to save…
Chirag
  • 375
  • 4
  • 30
0
votes
2 answers

Use PHP / GD to Save Binary Data as a JPEG Without Losing Metadata

I have an image that is being fed to my PHP script as binary data. I want to save this image as a jpeg to a directory on my server. I can accomplish this with the following code: // create image resource from the binary data $image =…
Chris
  • 5,485
  • 15
  • 68
  • 130
0
votes
1 answer

Mixing ASCII and Binary for record delimiters

My requirements are to write binary records inside a file. The binary records can be thought of as raw bytes in memory. I need a way to delimit each record, so that i can do something similar to binary search on the file. For example start in middle…
Jimm
  • 8,165
  • 16
  • 69
  • 118
0
votes
1 answer

Binary Character in QR code

It seem QR code is able to store Binary character(8bits) but I can't find anyway to do it. Anyone have any idea about it?
Eden Chow
  • 33
  • 5
0
votes
2 answers

Transforming byte values so that their MSB is removed / restored

I have a binary protocol which extracts the MSB of each payload byte into a MSB collection byte (septett) for transmission, and re-injects the MSBs on receiver side. The payload consists of n four byte frames, depending on sender (six in my…
ptashek
  • 186
  • 2
  • 6
0
votes
3 answers

What is a Binary Literal?

Can someone give a clear explanation of what Binary Literal is? What is the difference between binary literals, hexadecimal and binary numbers, strings? What are they used for?
Vincent
  • 16,086
  • 18
  • 67
  • 73
-1
votes
1 answer

Linear programming problem, searching for a group that has the most in common

I have 6 matrixes of numbers with binary variables like this: matrix 1:[0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1] matrix 2:[0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1] matrix 3:[0, 0, 0, 1, 1, 0, 0, 1, 0, 0,…
-1
votes
1 answer

How to create function that translates an array of 0 and 1s into a float?

I am trying to create a function that takes an array as argument, the array represents number but in Binary, I want this function to return a number. I can translate any number into Binary, however I can't figure out how to get float number from…
mitas1c
  • 301
  • 3
  • 13
-1
votes
2 answers

What's the default value of the Data type in Swift?

I'm looking to save an image from PhotosPicker to CoreData (as a Binary Data with Allows External Storage) but I have an issue. I don't know it's default value. I'm fine with other types but definitely not with Data, here's an example: import…
Alexnnd
  • 429
  • 4
  • 13
-1
votes
1 answer

Base64 decode a binary content with Groovy script

I use following script to decode a Base64 coded binary content and put it into a string then write to file. byte[] decoded = slurper.signatureValue.decodeBase64(); String sigValue = new String(decoded) def path =…
plaidshirt
  • 5,189
  • 19
  • 91
  • 181
-1
votes
1 answer

save binary data in core core data in specific slot

I want to save an item in the second spot of a binary data core data attribute. The core data entity is named Pictucre and the attribute is named pic. My code right is based off of something that would append the item to the core data attribute.…
-1
votes
1 answer

Binary numbers returns all 0

I'm trying to convert my web scraping data into binary numbers. Basically, if the class name contains yes it is equal to 1 and no is equal to 0. When I print out the binary_value, it returns all 0 even though it contains yes. I'm not really sure…
-1
votes
1 answer

Count one's in given submatrices

I have a binary matrix of size M*N. I'm given K queries where each consists of given sub-matrix, with upper left coord (x1,y1) and lower right coord (x2,y2). My task is to find how many one's are in each submatrix. I should find the best solution in…
popcorn
  • 388
  • 1
  • 7
  • 28
1 2 3
99
100