binary

How can I read/write from/to a file, byte by byte, with PHP5?

I've worked with reading and writing text files with PHP. Now, I'd like to read and write binary files. I've not found any useful resources/tutorials for doing this with PHP5. Is it possible? How? Specifically, I'll be searching for specific 2-byte patterns. If it matters, I'm on a Mac (OS X 10.4 Tiger). ...

binary sequence detector

Does anyone know of an optimized way of detecting a 37 bit sequence in a chunk of binary data that is optimal. Sure I can do a brute force compare using windowing (just compare starting with index 0+next 36 bits, increment and loop until i find it) but is there a better way? Maybe some hashing search that returns a probability that the s...

compress binaries in SVN ?

Hi, I have written a script to compress and uncompress binary files of a selected directory (and the sub-directories). I need to activate the script before I commit files to SVN. Is there a way to use the pre-commit hook to execute the script? and if so, how do I give to the he script the root directory (so it would scan the sub-folde...

Counting binary bit pattern combinations

I'm looking for an algorithm that will count the number of binary bit patterns in an n-bit word which are equal to or less than an arbitrary limit that is less than 2^n. Further, I want to generate the count for all 1-bit combinations, 2-bit combinations, etc.. Obviously, if the limit were 2^n, there would be 2^n combinations (C(n,1) 1-b...

Wrapper to SVN commit and checkout for compressing.

Possible Duplicate: compress binaries in SVN ? exact duplicate by same author: compress binaries in SVN? Hi, I want to build a script to wrap the issues of commit and checkout. I want to compress binary files before commiting and to uncompress right after checkout. What is the way to do it? is the IMPORT command instead of C...

Python: binary/hex string conversion?

I have a string that has both binary and string characters and I would like to convert it to binary first, then to hex. The string is as below: <81>^Q<81>"^Q^@^[)^G ^Q^A^S^A^V^@<83>^Cd<80><99>}^@N^@^@^A^@^@^@^@^@^@^@j How do I go about converting this string in Python so that the output in hex format is similar to this below? 242080...

What are the available tools to compile .NET projects to standalone native binaries?

What tools do you know to compile .NET projects to native binaries that run without .NET Framework, so far I've found : Xenocode Postbuild for .NET, which costs $1599. Salamander .NET Linker, which costs $1249. Mono Ahead-of-Time compilation (AOT), free. Thanks to JaredPar and Reed Copsey Native Image Generator (Ngen.exe), free, does...

django binary (no source code) deployment

Hello all, is there possible only to deploy binary version of web application based on django , no source code publish? Thanks ...

Website binaries in asp.net website project?

I hate to ask such a stupid question but i couldnt find the answer on Google. I can successfully build a large website project with lots of asp.net code but i dont know where the binaries are being kept so i can upload it a development server. I checked the bin folder but and they only seem to contain library dlls. ...

C# binary constants representation

I am really stumped on this one. In C# there is a hexadecimal constants representation format as below : int a = 0xAF2323F5; is there a binary constants representation format? ...

Inverting binary networks

How can I invert a binary equation, such that I can find which inputs will produce a given output. Example: Inputs: i0 through i8 Outputs: o0 through o8 Operators: ^ = XOR, & = AND Binary equations: (1&i0) ^ (1&i1) ^ (0&i2) ^ (1&i3) ^ (0&i4) ^ (0&i5) ^ (0&i6) ^ (0&i7) ^ (0&i8) = o0 (0&i0) ^ (1&i1) ^ (0&i2) ^ (1&i3) ^ (1&i4) ^ (0&i5)...

reconstructing symbols stripped from Mach-O binary

Using Mac OS X 10.5 I'm trying to figure out how to use dtrace to track the execution of a Mach-O binary. However, it seems the symbols have all be stripped out so any attempts to put use probes based on internal class/method names fail. I was able to use class-dump to dump the classes, method names and the address they are implemented...

Is this an idiomatic C way to convert longs to a binary (char *) representation?

The question is in the title I guess. This is the temporary solution I came up with but I was wondering: If there are disadvantages to representing binary as char*. Is there a better way (considering i would want the ability of bit-shifting etc...) If there is obvious non-idiomatic C (or other errors) in the code below. All suggesti...

Is there a Fiddler plugin for binary XML?

Fiddler has many useful extensions. However, I can't find one that understands WCF's binary-encoded SOAP envelopes. (Content-Type: application/soap+msbin1) Suggestions for comparable (non-Fiddler) tools are welcome too. ...

Convert binary string to bigint in MySQL?

I am attempting to hash a string to a 64-bit value (bigint) in MySQL. I am aware of the MD5() function, which returns a 128-bit hash as a binary string. I'd be happy to just take the bottom or top 64 bits of this result. However, I cannot figure out how to get from a binary string type to a numeric type of any sort. Any pointers? ...

HTTP POST binary files using Python: concise non-pycurl examples?

Hi, I'm interested in writing a short python script which uploads a short binary file (.wav/.raw audio) via a POST request to a remote server. I've done this with pycurl, which makes it very simple and results in a concise script; unfortunately it also requires that the end user have pycurl installed, which I can't rely on. I've al...

Sending binary data through web service and using WS-Security

Hi, We have to transfer binary data using web service stack and in the process we have to sign web service requests/responses. The main question is: what is the prefered way to do this? Should we use MTOM and WS-Security? From ISSUE CXF-1904 I have concluded that there are issues when one uses MTOM and WS-Security. CXF and axis2 use ...

Binary String to Integer

Hello, I have a binary string, entered by the user, which I need to convert to an integer. At first I naivly used this simple line: Convert.ToInt32("11011",2); Unfortunately this throws an exception if the user enters the integer directly. Convert.ToInt32("123",2); // throws Exception How can I make sure that the string entered b...

Any efficient way to read datas from large binary file?

Hi, I need to handle tens of Gigabytes data in one binary file. Each record in the data file is variable length. So the file is like: <len1><data1><len2><data2>..........<lenN><dataN> The data contains integer, pointer, double value and so on. I found python can not even handle this situation. There is no problem if I read the wh...

Can XmlDictionaryReader really handle binary XML? If not, what does?

I'm trying to write a debugging tool that allows the user to view WCF's new binary XML format (application/soap +msbin1) in plain text. Once I found the XmlDictionaryReader class I thought I'd be done in minutes, but it's not working as expected. private string DecodeBinaryXML(byte[] binaryBuffer) { if (binaryBuffer == null) ...