1
голосов
1ответов
945 просмотров

Sending part of byte array over the network using WCF

I have a byte array of some binary data that i need to send over the network using WCF and NetTcpBinding. My problem is that i need to send only the part of the array. Is there any way to do this, other than copying that part to a separate array, and sending that one. This extra copying degrades ...

4
голосов
3ответов
10944 просмотров

How can I convert a binary to a decimal without using a loop?

I have a 12-bit binary that I need to convert to a decimal. For example: A = [0,1,1,0,0,0,0,0,1,1,0,0]; Bit 1 is the most significant bit, Bit 12 is the least significant bit.

0
голосов
5ответов
233 просмотров

Problems loading bulk data in mysql using php

I have a script that gets the raw binary image data via url request. It then takes the data and puts it into mysql. Pretty simple right? Well It's I'm inserting some 8,000 decent sized 600x400 jpegs and for some odd reason some of the images are getting cut off. Maybe the part of my script that ...

0
голосов
2ответов
3804 просмотров

VBScript - image to binary

i'm not a VB programmer but i need a vbscript that convert image file (from local disk) to be converted to binary data and the passed to webservice. I realize how to pass data to webservice but i can't find how to convert the image file to binary data. I spend a lot of time to find some kind of s...

12
голосов
6ответов
12384 просмотров

Encoding an integer in 7-bit format of C# BinaryReader.ReadString

C#'s BinaryReader has a function that according to MSDN, reads an integer encoded as "seven bit integer", and then reads a string with the length of this integer. Is there a clear documentation for the seven bit integer format (I have a rough understanding that the MSB or the LSB marks whether t...

3
голосов
2ответов
4034 просмотров

How can I XOR these base64'd numbers?

I have are 5 binary strings base64_encode()'ed wAD4Af8B/gHuA/4BzgP1A/8P/h//f/xv+z30D9IDSAE= AAAgCPgf/B/4H/w1+B74Gfg/+B/8P/4f/D/8HwABAAA= AAAAAMB/wP/A/8B/4HvAf+B/+n/3P/Y//z/4n4CDgAE= AAAAXcB/wH/Af8B/wHfAP+B/6H/xf+7//r/4f0CngFY= AAiwifAP+B/4D/gf8B74D/gd8V/4H/gP8B/8vwABAAA= AAAAAAAA/QD/Af4B/iP...

1
голосов
2ответов
13842 просмотров

Opening file in another directory in C

How is this achieved? I want to use pFile = fopen( file, "rb" ); Where file is a char, string or long containing the literal text containing a local path to a binary file C:\Documents and Settings\Supernovah\Desktop\Supernovah.bin but of course that crashes. I am also interested in how to ...

7
голосов
8ответов
12230 просмотров

How are bits stored in memory? (In chunks? Can there be bits of multiple sizes stored toghether?)

I used to think that each memory location contains 8, 16, 32 or 64 bits. So 0101 would be stored in an 8 bit machine as 00000101 (sign extended if it was negative). This was all fine and dandy until I wrote a program in java out of curiosity to find out some more inner workings of this system. ...

8
голосов
4ответов
4439 просмотров

Faster version of dec2bin function for converting many elements?

I am reading a bitmap file and converting each of the RGB values ranging from 0 to 255 to binary. So a 240 by 320 bitmap will have 230400 RGB values to convert. The original dec2bin function was too slow, so I wrote my own as I know my value will always be between 0 to 255. But going through 23...

2
голосов
4ответов
13124 просмотров

Search for Binary Pattern in C (Read buffered binary file)

Hey there. I'm trying to write a small program that will read the four following bytes after the last occurrence of "0xFF 0xC0 0x00 0x11" which can be converted easily to binary or decimal. The purpose is that the 2-5 bytes following the last occurrence of that hex pattern represent the width and...

3
голосов
4ответов
17126 просмотров

C# Binary Serialization

I am trying to serialize and deserialize objects to/from a Byte array for network communication, I currently have an interface 'ISerialize'. However I got thinking there should be a more robust way to do this via reflection. I've looked around a little bit at doing this using BinaryFormater, but...

6
голосов
2ответов
5147 просмотров

RESTful design - how to model entity's attachments

I am trying to model entity's attachments in REST. Let's say a defect entity can have multiple attachments attached to it. Every attachment has a description and some other properties (last modified, file size...) . The attachment itself is a file in any format (jpeg, doc ...) I was wondering ho...

4
голосов
2ответов
5742 просмотров

Convert an image from CFHTTP filecontent to binary data with Coldfusion

I'm trying to convert an image (jpg) loaded via cfhttp to binary data. I can't use cffile action="readBinary" as it is not a local file.

4
голосов
4ответов
1325 просмотров

Is it a good thing for a custom rest protocol to be binary based instead of text based like Http?

Have you ever seen a good reason to create a custom binary rest protocol instead of using the basic http rest implementation? I am currently working on a service oriented architecture framework in .Net responsible for hosting and consuming services. I don't want to be based on an existing framew...

6
голосов
2ответов
8565 просмотров

iPhone writing binary data

How do you write binary data to a file? I want to write floats to a file, raw, and then read them back as floats. How do you do that?

76
голосов
9ответов
169022 просмотров

Binary numbers in Python

How can I add, subtract, and compare binary numbers in Python without converting to decimal?

32
голосов
10ответов
13893 просмотров

What’s the best way to distribute a binary application for Linux?

I just finished porting an application from Windows into Linux. I have to create an installer of the application. The application is not open source => I should distribute the application's binaries (executable file, couple .so files, help files and images). I found several methods to do it: ...

2
голосов
2ответов
1031 просмотров

Python Fixed Length Packet

I am trying to build a fixed length packet in python for an ATSC PSIP generator. This is probably very simple but so far I can't seem to get it to work. I am trying to build a packet with fields similar to the following: table_id = 0xCB syntax = 0b1 reserved = 0b11 table_ext = 0xFF the end g...

23
голосов
14ответов
21689 просмотров

How does binary translate to hardware?

I understand how the code is compiled to assembly, and that assembly is a 1:1 replacement with binary codes. Can somebody help me understand how binary is connected to the hardware? How is the binary physically read and run? How does an if statement work in the hardware? From google searches I'm...

5
голосов
2ответов
1989 просмотров

Better way to download a binary file?

I have a site where a user can download a file. Some files are extremely large (the largest being 323 MB). When I test it to try and download this file I get an out of memory exception. The only way I know to download the file is below. The reason I'm using the code below is because the URL i...

2
голосов
2ответов
3849 просмотров

Trouble with OpenSSL's BN_bn2bin function

I'm trying to use the BN_* functions in OpenSSL. Specifically, I have the following code: #import <openssl/bn.h> BIGNUM * num = BN_new(); BN_set_word(num, 42); char * buffer = malloc((BN_num_bytes(num)+1) * sizeof(char)); buffer[BN_num_bytes(num)] = '"42 in binary is *"'; int len = BN_bn2...

1
голосов
3ответов
178 просмотров

BinaryFormatter picking up events

I have a storage class that has events on adding items to it. My form class handles the event. When I try to serialize it, formatter complains about form class not marked as serializable. Of course, I don't want to serialize it, however, i can't mark event as [NonSerialize] since it is not fie...

1
голосов
2ответов
264 просмотров

Any Tips For Serializing UIComponent

I am trying to serialize an extended UIComponent (com.esri.ags.layers.GraphicsLayer) to send and store in a MSSQL Server database using WebOrb. Apparently, these types of objects aren't meant to be serialized, and I haven't had much serializing/deserializing using the flash byteArray. I have al...

0
голосов
1ответов
1677 просмотров

Using ASP.Net saving a image using the FileUpload control

I want a user to choose an image to upload for his avatar. So in my form, I'm asking his username, password, DOB, etc... I'm making an object[] array and rounding up every field, and then pass that array to my method that saves the information to my Database. How can I "get" the binary informat...

4
голосов
4ответов
3451 просмотров

Is there an unofficial Flash .FLA spec?

Is there an unofficial spec anywhere that explains how to reverse engineer a Flash .FLA file? I'm specifically interested in creating an application that can "auto-scene plan" a Flash document programmatically, pulling in content from other files, arranging that content into layers, without need...

1
голосов
1ответов
1941 просмотров

Writing binary files using SAS?

We currently use SAS to import a binary file and run queries on its data. To do this we use the techniques shown on the SAS website. As an example, this is how we read the data: data work.binary_data; infile "&ifName" lrecl=8 recfm=f; input @1 a PIB1. @2 b PIB1. @3 c PIB1. ...

2
голосов
3ответов
5328 просмотров

What is the byte signature of a password-protected ZIP file?

I've read that ZIP files start with the following bytes: 50 4B 03 04 Reference: http://www.garykessler.net/library/file_sigs.html Question: Is there a certain sequence of bytes that indicate a ZIP file has been password-protected?

3
голосов
6ответов
7216 просмотров

C++ Storing objects in a file

I have a list of objects that I would like to store in a file as small as possible for later retrieval. I have been carefully reading this tutorial, and am beginning (I think) to understand, but have several questions. Here is the snippet I am working with: static bool writeHistory(string fi...

7
голосов
11ответов
5475 просмотров

Index of lowest order bit

I want to find the fastest way to get the index of the lowest order bit of a long long. ie: 00101001001000 -> 3 Solutions involving looping and shifting are too slow. ie: int i; if(bits == 0ULL) { i = 64; } else { for(i = 0;!(bits & 1ULL);i++) bits >>= 1; } EDIT: Info...

4
голосов
3ответов
7515 просмотров

Binary stdin and stdout

I'm looking to write a pair of utilities that read in a newline separated list of integers on stdin and output their binary (4 byte) equivalent to stdout, and vice versa. My first thought was a simple bash/linux command that would do this, but I was unable to find one. My second thought was to ...