binary

Inserting NSData into SQLite on the iPhone

Hi all, So far I've managed to create this method for inserting into a SQLite database on the iPhone: - (void) insertToDB :(NSString *)Identifier :(NSString *)Name { sqlite3 *database; if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { char *sql1 = "INSERT INTO table VALUES ('"; const cha...

Converting binary to string then back to binary

Hello all, This is the synopsis: the PHP code is an interpreter of commands given in a terminal-like fashion, so as a string. Basically PHP receives a string argument, interprets it based on a given regular expression and then execute it. Here, the code receives a string similar to ftp>fput -file(contents-of-file) In this case, the ...

did i must be include images with binary file (xcode)

hello. i finished my project in Xcode and everything in OK. when i tried to upload my app to apple store there are option :Please upload a new binary my question is : did i must be upload mu images i use with a binary file ? because when i select my binary file only itunes accept that. but when i try to upload my binary file with im...

What is the binary representation of a boolean value in c#

I know that a boolean value is 1 byte (8 bits long) But I would like to know is what is its binary representation. e.g. decimal => binary 4 => 100 (0000 0100) 8 => 1000 (0000 1000) bool value => ??? ...

How does LLV encoding work?

I'm working with a binary protocol that uses LLV to encode some variables. I was given an example below which is used to specify a set of 5 chars to display. F1 F0 F5 4C 69 6E 65 31 the F1 is specific to my device, it indicates display text on line one. The f0 and f5 I'm not sure about, the rest looks like ASCII text. Anyone know h...

How do I convert an incoming object to binary in Access 2007 VBA?

I need to import PDF and XLS objects and convert them to binary. The following code doesn't work, apparently because the "fd.SelectedItems(1)" is the path of the object instead of the object itself. If I dim "fileToUpload" as an object, I get a "run time '91' Object variable or With block variable not set". If I don't specifically Di...

Save binary to sql

Hello, I'm trying to convert a pdf to binary dato and saving it to my SQL database. When i just output the pdf (from binary) to the user, it works perfectly. The field in my database for the binary data is image. Here is what i'm doing atm: Set oFileStream = Server.CreateObject("ADODB.Stream") oFileStream.Open oFileStream.Type = 1 'B...

How to test for the existance of a constant when creating a iPhone universal binary

I am trying to create a universal binary that supports multitasking on the iPhone 4 and can still run on the iPad. I know how to avoid compile errors for different versions of the iPhone IOS by checking if a class exists by using NSClassFromString and "respondToSelector", but is there a way to check for the existence of constants like U...

Delphi chars are now stored with 2 bytes rather than 1 in typed binary files. How can I still read my old files?

I maintain a Delphi program which uses typed binary files as its native file format. After upgrading from Turbo Delphi to Delphi 2010, all chars in the record type being stored started being stored with 2 bytes rather than one. The data types being stored are char and array[1..5] of char. So before, part of the file looked like: 4C 20...

iPhone - Execute iphone app from documents folder

Hi all, I'm writing an app which must download other apps and EXECUTE them from the documents folder. One of the approaches I was thinking about is to use a bash script like the one in installous which unzips the app and copies whatever whenever it's needed.That way I can install it,but not execute it. So I was wondering if there is a ...

MinimumOSVersionn info.plist key? Itunes Connect invalid binary

Hey guys, I'm trying to submit an app with these details: Base SDK: iPhone Device 3.2 Architectures: Standard (armv6 armv7) Target Device Family: iPhone/iPad iPhone OS Deployment Target: iPhone OS 2.2.1 when I submit to Itunes Connect, I get an invalid binary with this followup: "Invalid Binary Architecture - iOS 3.0 introduces su...

Writing blob from SQLite to file using Python

Hello, A clueless Python newbie needs help. I muddled through creating a simple script that inserts a binary file into a blog field in a SQLite database: import sqlite3 conn = sqlite3.connect('database.db') cursor = conn.cursor() input_note = raw_input(_(u'Note: ')) input_type = 'A' input_file = raw_input(_(u'Enter path to file...

Java and Binary data in the context of sockets

Java newbie here. Are there any helper functions to serialize data in and out of byte arrays? I am writing a Java package that implements a network protocol. So I have to write some typical variables like a version (1byte), sequence Number (long) and binary data (bytes) in a loop. How do I do this in Java? Coming from C I am thinking of ...

Help simplifying this regular expression

^[0-1]*1[0-1]*1[0-1]*1[0-1]*$ To match a binary string with 3 or more occurrences of '1' This expression works...just trying to make it better. ...

deserialize json base64 binary in .net using DataContractJsonSerializer

hey, I am having a problem deserializing base64 json back into the .net object using wcf datacontract.... I have this to deserialize: public static T FromJSON( this string json ) { using ( MemoryStream ms = new MemoryStream(ASCIIEncoding.Default.GetBytes(json)) ) { DataContractJsonSerializer ser = new DataContractJsonS...

binary file encryption problem

hello all. i'm having a problem while encrypting some data in the file. i'm using simple xor for that. lets say i have this struct: struct MyFile{ char fileName[128]; int account; float balance;}; saving this as a binary file is working properly but when i use xor to encrypt the filename in the struct and save the struct to hd then re...

Python method for storing list of bytes in network (big-endian) byte order to file (little-endian)

My present task is to dissect tcpdump data that includes P2P messages and I am having trouble with the piece data I acquire and write to a file on my x86 machine. My suspicion is I have a simple endian-ness issue with the bytes I write to to file. I have a list of bytes holding a piece of P2P video read and processed using python-pcapy...

Writing binary data to middle of a sparse file in Python

I need to compile a binary file in pieces with pieces arriving in random order (yes, its a P2P project) def write(filename, offset, data) file.open(filename, "ab") file.seek(offset) file.write(data) file.close() Say I have a 32KB write(f, o, d) at offset 1MB into file and then another 32KB write(f, o, d) at offset ...

Corrupted Binary Files after Transfer libcurl

I am transferring a binary file (.exe) with FTP using libcurl, and saving it to a local file. The problem is that after the file is transferred, it is altered and is no longer a valid Win32 application, and doesn't run. Here's how I'm doing it: CURL *curl; curl = curl_easy_init(); FILE* f = fopen("C:\\blah.exe", "w"); if(curl) { ...

c binary file reading problems

hi i am reading a binary file using c as shown here link text so that all the information read from binary file is stored in "char *buffer". i have the format standard where it says that one of the lines should be format: unsigned char, size: 1 byte i am doing the following: printf("%x\n", buffer[N]); but what should i do ...