binary

suggestions for using PATH to executables with version control (Mercurial)

So I'm pretty new to version control but I'm trying to use Mercurial on my Mac to keep a large Python data analysis program organized. I typically clone my main repository, tweak the clone's code a bit, and run the code on my data. If the changes were successful I commit and eventually push the changes back to my main repository. I gu...

What is a suitable buffer for Python's struct module

In Python I'm accessing a binary file by reading it into a string and then using struct.unpack(...). Now I want to write to that string using struct.pack_into(...), but I get the error "Cannot use string as modifiable buffer". What would be a suitable buffer for use with the struct module? ...

Read version info from .ABR file (Photoshop brush set)

Is it possible to detect which Photoshop version a brush set (.abr) file is compatible with from its binary data? There is a open source C# programm called ABRViewer but it doesn't read version info. Sample brushes: http://mark-s.deviantart.com/art/Fractal-Brushes-Set-20484978 http://redheadstock.deviantart.com/art/Arcane-Circles-Sym...

Can I distribute a modified GPL binary which I use from my closed source application

This is very similar to other questions, but none of the other ones quite answer it, so please read through fully before shouting at me :) (See e.g. http://stackoverflow.com/questions/1394623/can-i-dynamically-call-a-lgpl-gpl-software-in-my-closed-source-application) I have written a closed source, commercial application. The applicat...

Bitwise Operation and Usage

x = 1 # 0001 x << 2 # Shift left 2 bits: 0100 # Result: 4 x | 2 # Bitwise OR: 0011 # Result: 3 x & 1 # Bitwise AND: 0001 # Result: 1 I can understand the arithmetic operators in Python (and other langs), but I never understood 'bitwise' operators quite well. In the above example (from a Python book), I und...

How to send a push notification using Erlang?

I'm trying to send a push notification to APNs using Erlang. This is the code I came up with so far: -module(apnstest2). -export([connect/0]). connect() -> application:start(ssl), ssl:seed("someseedstring"), Address = "gateway.sandbox.push.apple.com", Port = 2195, Cert = "/path/to/Certificate.pem", Key = "/path/...

is there any api provided by dot net platform to convert a string or bytres array into user defined object?

Suppose i have input array byte A[50]; i have put three diffrent data types values in array as below string of length 42 bytes(converted into binary) long with length 4 bytes(converted into binary) float with length of 4 bytes(converted into binary) Now i have defined a schema like as below <schemaforparsing> <field> ...

Viewing File in Binary in Terminal

First things first, I'm on a Mac ssh'ing into a Linux machine via Terminal. I would like to view the contents of a file in the current directory, but in binary. Is there a binary mode for any text editors like VI or Nano or the like? ...

Handling large ActiveRecord object set as binary data

I have an issue with manipulating large number of record objects of type ActiveRecord model(Records are extracted from a complex operation but from the same table) and I want to pass that object set around between controller actions. So I have couple of solutions but is wage about which way to choose. Simpler but uglier solution is to sa...

Printing several binary data fields from Google DataStore?

I'm using Google App Engine and python for a web service. Some of the models (tables) I have in my web service have several binary data fields in them, and I'd like to present this data to a computer requesting it, all fields at the same time. Now, the problem is I don't know how to write it out in a way that the other computer knows whe...

How to deserialze a binary file

I'm having some trouble figuring out how to deserialize a binary file. I mostly can't figure out how to use the second argument of SerializationInfo.GetValue(); - if I just put a type keyword there, it's invalid, and if I use the TypeCode, it's invalid as well. This is my current attempt (obviously it doesn't build). protected Grou...

Binary Tree in C#

Are there any objects in C# (or in .net) that represents a binary tree (or for curiosity) an n-ary tree? I am not talking about presentation tree controls, but as model objects. If not, are there any good external implementations? ...

[VHDL] How to generate serial signal from string?

How do I send data represented by a binary string (e.g. "01011101000100111", length is variable) to an std_logic signal given either fixed delay or clock signal? I want this for a testbench so I'd want to be able to arbitrarily change the binary string with as little hassle as possible, so I'm thinking of using generate. ...

Convert from hexadecimal to binary C++

This kind of builds up on Already asked question... However here, say, I'm given a hexadecimal input which could be a max of '0xFFFF' I'll need it converted to binary, so that I'd end up with a max of 16 bits. I was wondering if using 'bitset' it'd be quite simple.. Any ideas? EDIT : After getting answers, improvised piece of code he...

C# equivalent of python's struct.pack

Is there a library for C# that allows similar functionality to python's struct from the standard library? One can emulate the struct library quite closely with real aligned structs. But I didn't find yet any way to directly control the endianess in C#'s structs (the C#'s structs seems to be geared more towards COM interop, and less towa...

Add source code to elf file

Hi, I want to add my C++ source code to the corresponding elf binary file and I'm looking for the best way to do this. (I'm using several versions of my code and not every version should be committed into svn). Can I just append the source code without destroying the elf file using bash's >> operator? Or is objcopy --add-section a way ...

Binary encoding for low bandwidth connections?

In my application I have a simple XML formatted file containing structured data. Each data entry has a data type and a value. Something like <entry> <field type="integer">5265</field> <field type="float">34.23</field> <field type="string">Jorge</field> </entry> Now, this formatting allow us to have the data in a human readable f...

How to sniff the number of records in a binary file before reading into an array in the C programming language?

How do I tell in a better way how many records there are in a binary file before I open up the file and read the records into an array for example? MyFile = fopen("DATA.dat", "rb"); i = 0; while (feof(MyFile) == 0) { fread(&tempReadingRecord,sizeof(tempReadingRecord), 1, file); if (feof(MyFile) == 0 { i++; } } fclo...

Why does Mac OS sometimes launch the wrong binary when I click on a .app

I created this application that contains several binary files (let's say X, Y and Z). I have a .plist file that specifies that the application should launch X when opened. Everything works fine 99.9% of the time but sometimes, it launches another binary (Y or Z). This usually happens after something crashed in my application so I am gue...

Python integer to read-only buffer

I am using cdb for a constant database in python. I would like to associate integer id's with some strings, and I would like to avoid storing each of these integer id's as strings, and instead store them as an integer. cdb though is looking for either a string or a read only buffer. Is there a way that I can store these keys as intege...