binary

what is exactly an EOF?

is EOF a special byte sequence that lies in the end of every file, or is it kinda exception(interrupt) that is notified by the kernel? ...

transferring binary files between systems

Hi guys I'm trying to transfer my files between 2 UNIX clusters, the data is pure numeric (vectors of double) in binary form. Unfortunately one of the systems is IBM ppc997 and the other is AMD Opteron, It seems the format of binary numbers in these systems are different. I have tried 3 ways till now: 1- Changed my files to ASCII for...

Creating Binary Block from struct

I hope the title is describing the problem, i'll change it if anyone has a better idea. I'm storing information in a struct like this: struct AnyStruct { AnyStruct() : testInt(20), testDouble(100.01), testBool1(true), testBool2(false), testBool3(true), testChar('x') {} int testIn...

VB.NET encoding one character wrong

I have a byte array that I'm encoding to a string: Private Function GetKey() As String Dim ba() As Byte = {&H47, &H43, &H44, &H53, &H79, &H73, &H74, &H65, &H6D, _ &H73, &H89, &HA, &H1, &H32, &H31, &H36} Dim strReturn As String = Encoding.ASCII.GetString(ba) Return strReturn End Function Then I wri...

Binary Plist Serializing/Deserializing using C#

Hi I have an iPhone client talking to a Windows server written in C#.The data from the device is sent as a binary plist.I am looking for a framework in C# that understands the binary plist and converts it into a dataset. On googling, I ran into plutil but that's a CLI and I need something that does it inline with the application. Thank...

Manipulating binary data in Python

I am opening up a binary file like so: file = open("test/test.x", 'rb') and reading in lines to a list. Each line looks a little like: '\xbe\x00\xc8d\xf8d\x08\xe4.\x07~\x03\x9e\x07\xbe\x03\xde\x07\xfe\n' I am having a hard time manipulating this data. If I try and print each line, python freezes, and emits beeping noises (I think ...

Perl, treat string as binary byte array

In Perl, is it appropriate to use a string as a byte array containing 8-bit data? All the documentation I can find on this subject focuses on 7-bit strings. For instance, if I read some data from a binary file into $data my $data; open FILE, "<", $filepath; binmode FILE; read FILE $data 1024; and I want to get the first byte out, is...

iphone binary failing to compress

When I try to compress my binary (to upload for app submission), I get a ridiculously small zip file (a 10 meg file turns into 300k). I've done this a dozen times and never had a problem and am uncertain what could be causing this. I tried restarting xcode and doing a clean build. Has anyone seen this happen before? ...

Help with converting Hex to booleans?

I am new at Java. I am learning. I am trying to do the following: convert a hexadecimal string into a binary, then process the binary into a series of booleans. public static void getStatus() { /* * CHECKTOKEN is a 4 bit hexadecimal * String Value in FF format. * It needs to go into binary format */ ...

Any libraries of reading & writing binary file formats (PE & ELF)?

HellO, I want to write a binary file format viewer for windows which can operate on both PE & ELF files. Similar to the ones already there: PE Explorer http://www.pe-explorer.com/ PE VIew: http://www.magma.ca/~wjr/ PEBrowse Professional http://www.smidgeonsoft.prohosting.com/pebrowse-pro-file-viewer.html I've reasons why I want to ...

Can we force rendering a text as binary when 'to_yaml'?

requrie 'yaml' hash = {:title=>'abc'} hash.to_yaml will output: --- title: abc Is there any method to force the title to be a binary, like: --- title: !binary| 5Lit5pa UPDATE I'm asking this because I want to dump the data from database to yml files. But the text in the database, contains English and non-English text, and bot...

Perl pack use - double big endian ?

Hi, According to this calculator site (link text) , when converting 3 from dec to double I get 4008 0000 0000 0000 When using Perl pack function, with the parameter "d>*" , I expected to see 4008 0000 0000 0000 as I use this function: print $File pack("d>*",3); But when I "Hexdump" to the Perl output file, I see 0840 0000 0000 0000...

PL/SQL base conversion without functions

Is there any way to convert decimal to binary, or binary to decimal, in Oracle 10g without having to first define a function? I have limited database access (SELECT only) and all the solutions for this I've found online seem to involve CREATE FUNCTION, which does not work for me. ...

C++ gsoap mime/dime for binary files in windows

Hello, I'm pretty close to losing my head here ;) I'm developing a service that uses gsoap. I would like to return a mime response. I have everything working, but when reading binary files, all kind of files like jpeg, pdf, etc... contains the \0 char several times over the data (if opened with notepad can see a lot of NUL). So any c...

Java check whether file is binary

Hello all. I wrote the following method to see whether particular file contains ASCII text characters only or control characters in addition to that. Could you glance at this code, suggest improvements and point out oversights? The logic is as follows: "If first 500 bytes of a file contain 5 or more Control characters - report it as bi...

Ruby - How to unpack a binary string into a normal string?

I'm opening a CSV file and reading values from it using File.open(filename). So I do something like this: my_file = File.open(filename) my_file.each_line do |line| line_array = line.split("\t") ratio = line_array[1] puts "#{ratio}" puts ratio.isutf8? end The issue I'm having is the values in line_array seem to be in a strange for...

How to convert a floating point number to its binary representation (IEEE 754) in Javascript?

What's the easiest way to convert a floating point number to its binary representation in Javascript? (e.g. 1.0 -> 0x3F800000). I have tried to do it manually, and this works to some extent (with usual numbers), but it fails for very big or very small numbers (no range checking) and for special cases (NaN, infinity, etc.): function flo...

Import gif file to SSIS and save binary, filename etc to table fields

Hi I need to use SSIS to cycle through a bunch of .gif images in a folder and import each one into a single row in a table, which contains fields such as filename and size, but more crucially, the binary from the file. I will use a foreach loop to cycle through the files, and probably a script transformation to assign variables to cert...

Pseudo-Random Binary Sequence Prediction (Newbie)

Hi, i know nothing about programming or C or windowing... nothing too deep about computers... but i'm very interested in: given a pseudo-random binary sequence (e.g.: 00101010010101) of finite values, predict how will the sequence continue. Can someone please tell me the easiest way to do it? Or in case it's too difficult for someone who...

C++ ifstream::read() - corrupts ifstream get pointer?

Hi all, Does anyone here know of a way a C++ ifstream's get pointer might get corrupted after a read() call? I'm seeing some truly bizarre behaviour that I'm at a loss to explain. For example (illustrative code, rather than what I'm actually running): int main() { // datafile.bin is a 2MB binary file... std::ifstream ifs( "datafi...