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

How can I view the contents of sql binary data fields?

Does anybody know how to view the contents of fields containing binary data in an MS SQL Server 2005 database?
Xandir
  • 173
  • 1
  • 1
  • 7
17
votes
7 answers

Version control for sound, video, and other binary files

What's the best way to version large amounts of binary files, say audio and video files? Git doesn't seem like it's really designed to handle large amounts of binary files. The other issue is that content produces don't necessarily want to learn how…
catphive
  • 3,511
  • 3
  • 31
  • 29
17
votes
4 answers

SQL Query with binary data (PHP and MySQL)

This site had helped me a lot in the past, but now I am lost. Thanks in advance for your guidance. I have a MySQL table that contains a Binary value, like the example below. I cannot change the table. CREATE TABLE `test` ( `id` int(10) unsigned…
user2007877
  • 173
  • 1
  • 1
  • 6
16
votes
11 answers

What language is to binary, as Perl is to text?

I am looking for a scripting (or higher level programming) language (or e.g. modules for Python or similar languages) for effortlessly analyzing and manipulating binary data in files (e.g. core dumps), much like Perl allows manipulating text files…
Eric Hansander
  • 944
  • 2
  • 11
  • 20
16
votes
6 answers

Convert from binary data to an image control in ASP.NET

I have binary data of an image in my database, and I want to display it in an image control in ASP.NET. How? If it is impossible, please find another way to save it in the database and display it in an image control.
kartal
  • 17,436
  • 34
  • 100
  • 145
16
votes
4 answers

R-How to generate random sample of a discrete random variables?

In R, I want to generate a random sample of a discrete random variable: X, where: P(X=a)=P(X=-a)=1/2. I have been searching for a function online, but there seems no direct function doing this.
Kelly Nguyen
  • 273
  • 1
  • 2
  • 4
16
votes
2 answers

Is there an orthodox way to avoid compiler warning C4309 - "truncation of constant value" with binary file output?

My program does the common task of writing binary data to a file, conforming to a certain non-text file format. Since the data I'm writing is not already in existing chunks but instead is put together byte by byte at runtime, I use…
Sam Kauffman
  • 1,221
  • 11
  • 30
15
votes
4 answers

C++: How to add raw binary data into source with Visual Studio?

I have a binary file which i want to embed directly into my source code, so it will be compiled into the .exe file directly, instead of reading it from a file, so the data would already be in the memory when i launch the program. How do i do…
Rookie
  • 1,242
  • 3
  • 17
  • 22
15
votes
3 answers

Finding a number of maximally different binary vectors from a set

Consider the set, S, of all binary vectors of length n where each contains exactly m ones; so there are n-m zeros in each vector. My goal is to construct a number, k, of vectors from S such that these vectors are as different as possible from each…
15
votes
3 answers

How do you set a string of bytes from an environment variable in Python?

Say that you have a string of bytes generated via os.urandom(24), b'\x1b\xba\x94(\xae\xd0\xb2\xa6\xf2f\xf6\x1fI\xed\xbao$\xc6D\x08\xba\x81\x96v' and you'd like to store that in an environment variable, export…
ybakos
  • 8,152
  • 7
  • 46
  • 74
15
votes
4 answers

Accessing binary data from Javascript, Ajax, IE: can responseBody be read from Javascript (not VB)?

First of all, I am aware of this question: How do I load binary image data using Javascript and XMLHttpRequest? and specifically best answer therein, http://emilsblog.lerch.org/2009/07/javascript-hacks-using-xhr-to-load.html. So accessing binary…
StaxMan
  • 113,358
  • 34
  • 211
  • 239
15
votes
1 answer

How to read a binary data over serial terminal in C program?

I read followed links and other sources, but didn't find answer for my question. Binary data over serial terminal Data gets corrupted during transmission over the serial port I communicate with my embedded device through a serial port. By default,…
Bakir
  • 193
  • 1
  • 2
  • 9
14
votes
1 answer

How to extract hardcoded strings from a binary in Mac?

Is there API available in any language that can run on a Mac (Perl/Python/Cocoa/etc) or command line tools you can use to load a binary (app/bundle/framework/etc) and extract the hard-coded strings used in the code? The reason behind is we want to…
radj
  • 4,360
  • 7
  • 26
  • 41
13
votes
3 answers

Fastest way to read many 300 bytes chunks randomly by file offset from a 2TB file?

I have some 2TB read only (no writing once created) files on a RAID 5 (4 x 7.2k @ 3TB) system. Now I have some threads that wants to read portions of that file. Every thread has an array of chunks it needs. Every chunk is addressed by file offset…
Chris
  • 4,325
  • 11
  • 51
  • 70
13
votes
2 answers

Accessing bitfields while reading/writing binary data structures

I'm writing a parser for a binary format. This binary format involves different tables which are again in binary format containing varying field sizes usually (somewhere between 50 - 100 of them). Most of these structures will have bitfields and…
Tuxdude
  • 47,485
  • 15
  • 109
  • 110