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
8
votes
1 answer

How to tell scikit-learn for which label the F-1/precision/recall score is given (in binary classification)?

As explained in this article, it matters for calculating the F-1 score (that is, for calculating recall and precision) whether those calculations are based on the positive or negative class. For example, if I have a skewed dataset with 1% labels of…
8
votes
1 answer

Read binary data from an image and save it with JavaScript

I want to read the binary data of an image and then save it again to my local disk with JavaScript. I wrote a small demo that shows this use-case. To read the file I use readAsBinaryString from the File Reader API (HTML5) to get the binary data. I…
Benny Code
  • 51,456
  • 28
  • 233
  • 198
8
votes
4 answers

How to serve a file with JSP?

This may sound totally stupid, but is a case of real life :( I'm able to display a HTML table with a "virtual" link name. Something like this: Xyz description document.doc Xyz description
OscarRyz
  • 196,001
  • 113
  • 385
  • 569
8
votes
1 answer

Rails 3 - use json to upload image

In my Rails 3 application I have multiple models, and each model is associated with another model. User model has_many :departments accepts_nested_attributes_for :departments Department Model has_many :projects accepts_nested_attributes_for…
Cyber
  • 4,844
  • 8
  • 41
  • 61
8
votes
8 answers

How would you go about reverse engineering a set of binary data pulled from a device?

A friend of mine brought up this questiont he other day, he's recently bought a garmin heart rate moniter device which keeps track of his heart rate and allows him to upload his heart rate stats for a day to his computer. The only problem is there…
Omar Kooheji
  • 54,530
  • 68
  • 182
  • 238
7
votes
3 answers

Looking at binary output from fortran on gnuplot

So, I created a binary file with fortran, using something similar to this: open (3,file=filename,form="unformatted",access="sequential") write(3) matrix(i,:) The way I understand it, fortran pads the file with 4 bytes on either end of the file, and…
Andrew Spott
  • 3,457
  • 8
  • 33
  • 59
7
votes
3 answers

Is there a Template Haskell / deriving mechanism for Data.Binary (or friends?)

The Data.Binary documentation shows writing an instance by hand. Is there a way around this? I saw here there is another library, SerTH, which has a (Template Haskell based) deriving mechanism, but the link to it seems broken. Also, if you know…
gatoatigrado
  • 16,580
  • 18
  • 81
  • 143
7
votes
5 answers

bash/unix toolchain binary stream processing/slicing

I have a binary stream on standard input, it's in a fixed size format, a continuos stream of packets, each packet has a header with length X and a body with length Y. So if X=2 Y=6 then it's something like 00abcdef01ghijkl02mnopqr03stuvwx, but it's…
Karoly Horvath
  • 94,607
  • 11
  • 117
  • 176
7
votes
2 answers

How to convert Mathematica binary dump file to list of definitions?

As the Documentation says, "DumpSave writes out definitions in a binary format that is optimized for input by Mathematica." Is there a way to convert a Mathematica binary dump file back to the list of definitions without evaluating them?…
Alexey Popkov
  • 9,355
  • 4
  • 42
  • 93
7
votes
2 answers

Parsing binary data in JavaScript

I want to design and write a 3d image viewing web application in JavaScript. I've already written it in java and flash and basically want to port it. I want the 3d image export files to be in a binary format just like the Java and flash versions…
Zeeno
  • 2,671
  • 9
  • 37
  • 60
7
votes
1 answer

Encoding and decoding binary data for inclusion into JSON with Python 3

I need to decide on a schema for including binary elements into a message object so that it can be decoded again on the receiving end (In my situation a consumer on an Rabbit MQ / AMQP queue). I decided against multipart MIME encoding over JSON…
The Tahaan
  • 6,915
  • 4
  • 34
  • 54
7
votes
2 answers

Serving binary files from the database with compojure

I have the following routes definition: (require '[compojure.core :as ccore] '[ring.util.response :as response]) (def *main-routes* (ccore/defroutes avalanche-routes (ccore/GET "/" [] "Hello World 2") (ccore/GET…
Pieter Breed
  • 5,579
  • 5
  • 44
  • 60
7
votes
1 answer

Write binary data to file, literally

I have an array of integers Array ( [0] => Array ( [0] => 1531412763 [1] => 1439959339 [2] => 76 [3] => 122 [4] => 200 [5] => 4550 [6] => 444 …
php_nub_qq
  • 15,199
  • 21
  • 74
  • 144
7
votes
1 answer

Matlab : Unable to get unique rationals when implementing a formula for binary to real number conversion Part1

There is a nonlinear dynamic system x_n = f(x_n,eta) whose functional form is x[n+1] = 2*x[n] mod 1. This is a chaotic dynamical system called as the Sawtooth map or the Bernoulli Map. I am facing difficulty in implementing the two representations…
SKM
  • 959
  • 2
  • 19
  • 45
7
votes
2 answers

data-binary parameter in cURL

I have to send data-binary parameter through cURL in php. This is the command: curl -D - -u user:password -X PUT -H "Content-Type: text/plain" --data-binary "data-id=2010-10-01_15-15-53" https://someurl. In the console this works, now I have to do…
OSdave
  • 8,538
  • 7
  • 45
  • 60