binary

Best storage approach for small amount of 99% static data needed at startup?

I have some (small amount) of data that I'll need quick access to on inital load, but not after that. Right now, I have serialized the data (Generic List) to an Xml file and I'm deserializing it on load as needed. My question is should I use the XmlSerializer or the BinaryFormatter? I'm not worried about file size, but serialization sp...

How can I convert a binary number into a string character using Perl script?

Hi, How can I convert a binary number into a string character using Perl script? thanks in advance. ...

php: reversing mysql_real_escape_string's effects on binary

I built a webpage where users can submit a PDF which is then inserted into a MySQL database in a mediumblob for retrieval later. This all works fine, except when the PDF contains images or embedded fonts, in which case the images are corrupted and any text using the font disappears (Acrobat display a message about the missing font). I'...

Embedding a binary file inside a class library

Hi, Is it possible to embed a custom binary file inside a C# class library and then at runtime read it with a binary reader? I'm guessing it might be possible through resources. Many thanks ...

How can I detect if a file is binary (non-text) in python?

How can I tell if a file is binary (non-text) in python? I am searching through a large set of files in python, and keep getting matches in binary files. This makes the output look incredibly messy. I know I could use grep -I, but I am doing more with the data than what grep allows for. In the past I would have just searched for charac...

What is the binary format of a floating point number used by C++ on Intel based systems?

I am interested to learn about the binary format for a single or a double type used by C++ on Intel based systems. I have avoided the use of floating point numbers in cases where the data needs to potentially be read or written by another system (i.e. files or networking). I do realise that I could use fixed point numbers instead, and ...

Is there a binary equivalent of System.Text.StringBuilder?

I'm concatenating a large number of byte[] arrays in C#. If I were doing this for strings, I would use StringBuilder -- is there an equivalent class that would work for binary data in byte[] arrays? ...

Use the official binaries of a library without losing the option to load the source on demand.

Within a Visual Studio (2005/2008) Project I'd like to use an open source library. I'd like to link to the binaries so that I'm not responsible for a proper build and can check those binaries into the source control server (SVN). So far so good, but if I'd like to debug into the open source library or want to take a look at a class impl...

PopUpWindow and null object reference

Hello, I've been struggling with this problem for last few hours but still got no idea what's wrong. Here's the scenario: Application built on top of the Mate framework sometimes need to exchange data with remote server over plain binary socket. When specific packet is received I have to switch view (using ViewStack) and create custo...

How can I determine if a file is binary or text in c#?

I need to determine in 80% if a file is binary or text, is there any way to do it even quick and dirty/ugly in c#? ...

retrieve the value of a timestamp field with adodb - how to read a byte array from classic asp

I'm working with asp and adodb, querying a database (ms sql 2005) I have a field named stamp, of type timestamp in asp I get the following field.ActualSize: 8 field.DefinedSize: field.Name: Stamp field.Type: adBinary (128) field.Attributes: 528 (adFldFixed (16) + adFldRowVersion (512) ) (so adFldLong is NOT turned on, so I can't u...

How to deal with dead open-source dependencies?

Hi folks, I'm trying to prep a project for open-source release and have run into a problem... This project depends on a number of open-source components which I've just stored as JAR-files in my lib directory to date. Some of them date back a few years, and at least of them is from an open-source project whose site has disappeared and w...

Insert One Bit into Byte Array

Hello, I'm trying to insert a single bit into an array of bytes, which would shift all the bits in the byte array to the left. Say I have a Java byte array as follows: byte[] byteArray = new byte[2]; byteArray[0] = 0x11 byteArray[1] = 0x00 In binary, this byte array represented as: 0001 0001 0000 0000 Now I want to insert a zero ...

Convert A String (like testing123) To Binary In Java

I would like to be able to convert a String (with words/letters) to other forms, like binary. How would I go about doing this. I am coding in BLUEJ (Java). Thanks ...

How to SQL insert a raw/Binary field value from bytes/integer array using VBScript (orVB6)?

Does anyone know how to pass a several bytes into a Binary (or varbinary) field using SQL and ideally in ADO (classic) & VBScript (or Visual Basic 6)? I wish to encode 10-20 (maybe more) bytes of data and have this data stored in a SQL db field. (Its not MS-SQLSVR, but I'm hoping that a standard SQL supported format will work!) The byt...

.NET binary serialization between 32-bit and 64-bit OS

I have a program that saves data to hard drive using binary serialization. If I recompile the program on a 64-bit machine, can it deserialize the data from 32-bit machine? ...

Binary Serialization of an Array of DateTime

Hi, when i serialize an array of Int32 using the BinaryFormatter, i get about 400MB/s (100 million items in one second), but when i try to serialize an array of DateTime, i get only a throughput of about 27MB/s (100 million items in 30 seconds). One DateTime occupies eight bytes in serialized form. I guess that the BinaryFormatter uses ...

Which tools exists for byte-level inspection of files ?

I have a partially corrupted MS-Word file which I'd like to inspect in the byte-level. ...

How to save data in a 32 bit binary file in matlab?

I have to test some "random numbers" generatied by a program in matlab, with diehard. it accept only 32 bit binary file, while if i save my data in matlab, they are saved in binary file with double precision (so 2*64=128 bit binary file). how can i take a 32 bit binary file in matlab, working on a 64 bit system? ...

Convert really big number from binary to decimal and print it

I know how to convert binary to decimal. I know at least 2 methods: table and power ;-) I want to convert binary to decimal and print this decimal. Moreover, I'm not interested in this `decimal'; I want just to print it. But, as I wrote above, I know only 2 methods to convert binary to decimal and both of them required addition. So, I'...