binary

Inserting raw (binary?) image data into mysql? (PHP)

I've got a raw/(binary?) image like this: ÿØÿà�JFIF��–�–�*!!!$'$ &(goes on forever); when i try to insert this into mysql it doesn't work, the column type is set to longblob, any ideas? ...

K&R C Exercise Help

I've been going through the K&R C Programming Language book and I'm stuck on Exercise 2-6 which reads: Write a function setbits(x,p,n,y) that returns x with the n bits that begin at position p set to the rightmost n bits of y, leaving the other bits unchanged. I'm having trouble understanding the exact thing they're looking for me...

Unexpected bitshift results

I'm initializing an unsigned short int with a = 0xff (all bits are set). Then I assign b to a>>7 which should yield (0000 0001) and it does. However, the odd thing is that when I assign c to a<<7, it isn't equivalent to (1000 0000). I tested this by outputting 0x80 (which is 1000 0000) and c, but they aren't the same. Here is some code:...

What exactly is the textual representation of Binary data?

Sometimes when you download a compiled binary file with the wrong mime type or for example running the "more" command on a binary file you get a bunch of "garbly gook" for lack of a better term. For example this a snippet of what I see when I run "more" from the command line on a very simple C program compiled with gcc on OS X. <94>^^^...

How do I type literal binary in VB.NET?

How do you type binary literals in VB.NET? &HFF // literal Hex -- OK &b11111111 // literal Binary -- how do I do this? ...

Generically reading a well-formed binary file

I'm trying to read contents of a game's map/model files into a program for the purposes of writing a small model viewer and testing out some DirectX features. The model/map file formats are chunked in nature, and I know the format of these files. I can easily read the files by parsing through the individual chunks, using an approach like...

Convert hex to binary

I have ABC123EFFF, I want to have 01010101010001010101. How? ...

Run SQL query on a binary file?

My company has a legacy micro-simulation program that simulates a population and changes to that population over a period of years. For each year, the program produces a binary file with a record for each individual that holds their characteristics (e.g., age, maritial status, income ... about 20 fields). We currently have several ut...

What is the difference between plaintext and binary data?

Many languages have functions which only process "plaintext", not binary. Does this mean that only characters within the ASCII range will be allowed? Binary is just a series of bytes, isn't it similar to plaintext which is just a series of bytes interpreted as characters? So, can plaintext store the same data formats / protocols as bin...

Restoring from backup and binary

There are times when a table / database is dropped unintentionally. I have to check the date-time of the start position from the binary when the backup was taken. I do also have to check the date-time of the position where the "drop" statement is found. I do run the mysqlbinlog statement with those parameters. I can not use start-posit...

How to change decimal to binary and restore its bit values to an array?

For example: $result = func(14); The $result should be: array(1,1,1,0) How to implement this func? ...

How to identify binary and text files using Python ?

I need identify which file is binary and which is a text in a directory. I tried use mimetypes but it isnt a good idea in my case because it cant identify all files mimes, and I have strangers ones here... I just need know, binary or text. Simple ? But I couldn´t find a solution... Thanks ...

Replacing a rejected iphone app, would it trigger a whole new review process?

Hi i have 2 questions 1) Will replacing a rejected iPhone binary cause a new review process to start from the beginning? As in suppose that it took 18 days to get a response and it was rejected for some reason, when replacing the binary, would it take at least another 18 days to get another review? 2) Is the reason given in the rejecti...

Where is my application binary in XCode?

I've built an app for the iTunes store. However, being a noob to the platform, I can't figure out how to submit the app. Where is the actual binary that I need to submit to the iTunes store? What folder does it get built in? ...

Is there a C# equivalent to Python's unhexlify?

Possible Duplicate: How to convert hex to a byte array? I'm searching for a python compatible method in C# to convert hex to binary. I've reversed a hash in Python by doing this: import sha import base64 import binascii hexvalue = "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8" binaryval = binascii.unhexlify(hexvalue) print base64...

Javascript decimal to binary operation

var d = 7; in binary: 7 = (111) What I want to do is to set second place from right to 1 or 0 at disposal, and return the decimal value. For example,if I want to make the second 1 to 0,then after process should return a 5, because 5=(101). How to implement this in javascript? EDIT the answer should be something like this: funct...

How can I create a binary file in Perl?

For example, I want to create a file called sample.bin and put a number, like 255, so that 255 is saved in the file as little-endian, FF 00. Or 3826 to F2 0E. I tried using binmode, as the perldoc said. ...

C# Deserialize a class which has moved or been renamed

If I have a class named "MyClass" in an assembly named "AssemblyA" and serialize it to a file using .NET's BinaryFormatter. Then move the code of "MyClass" into an assembly named "AssemblyB" and try to deserialize the file I get the following "System.TypeLoadException" exception: Could not load type 'AssemblyA.MyClass' from assembly ...

C program showing a square instead of string

I have done a lot with Java but I am currently trying to learn c. I am trying to make a program to convert a number from decimal to binary. Here is what I have: #include <stdio.h> #define LENGTH 33 int main( int argc, char*argv[ ] ) { unsigned int number, base, remainder, x, i; char result[LENGTH]; puts( "Enter a decimal value, a...

Removing lowest order bit

Given a binary number, what is the fastest way of removing the lowest order bit? 01001001010 -> 01001001000 It would be used in code to iterate over the bits of a variable. Pseudo-code follows. while(bits != 0){ index = getIndexOfLowestOrderBit(bits); doSomething(index); removeLowestOrderBit(bits); } The possible languages I'...