read

iphone asynchronous file load?

is there way to load local files in iphone asynchronously? I load uiimages for my uitableview using this: NSData *imageData = [[NSData alloc] initWithContentsOfFile:fileName]; UIImage *cachedImage = [[[UIImage alloc] initWithData:imageData] autorelease]; but it is slow, because main thread is locked or something until NSData finishes ...

Reading binary file into array in Objective-C [iPhone]

Hey I want to read binary file on my iPhone. I have .txt file which stores information about an array: int[6000][9] How can I put this data into an array in my code? I tried this: int mapa1[6000][9]; NSFileHandle* file = [NSFileHandle fileHAndleForReadingAtPAth: @"level1.txt"]; [[file readDataOfLength:4] getBytes:mapa1]; mapa1 = NSSw...

How to read Android Market comments?

Reading the users' feedbacks about my apps is really important, but in my phone I can only read those written in the language of my phone (Italian). Is there a way to read all of them? A program for PC or a website could be a good solution. (Actually Cyrket and AndroLib read comments directly from the market, but sometimes they don't ...

Read event log in C#

Hi, I'm trying to read event logs for my application EventLoggingApp. The problem is reading logs for my single source (EventLoggingApp). This code read logs for every source. What is the problem? Any advice? static void ReadEvenLog() { string eventLogName = "Application"; string sourceName = "EventLoggingApp"; string...

iphone - reading from Localizable.strings file as a key-value in a dictionary

I want to read the text from the localizable.strings file. I am collecting the strings for translation from several directories and file in one .strings file. But then I have several copies of the same translation strings. I want to remove this programmatically. So I need to read the strings only (not the comments) from the .strings fil...

Read a file after a specific word using java

I have to read a file and write into another but after a specific word occurs something like hi. How can i do any help please. ...

OSX: Hook file read event

I have a particular file I want to monitor for file read attempts by all applications on OSX. I'd like to be able to interrupt the requests so I could decide which applications have permission to read the file and which don't (by querying the user, or checking a cache of user responses). Is this possible with the OSX API? If not, is i...

python file read

def file_open(filename): fo=open(filename,'r') #fo.seek(5) fo.read(3) fo.close() file_open("file_ro.py") I expect above program to return first 3 bytes from file . But it returns nothing. When I ran these in interactive python command prompt - I get expected output! ...

Python file.read() grabs more data than necessary, under the hood.

cat file_ro.py import sys def file_open(filename): fo=open(filename,'r') fo.seek(7) read_data=fo.read(3) fo.close() print read_data file_open("file.py") But strace says readlink("file_ro.py", 0x7fff31fc7ea0, 4096) = -1 EINVAL (Invalid argument) getcwd("/home/laks/python", 4096) = 18 lsta...

Read a file backwards line by line using fseek

How do I read a file backwards line by line using fseek? code can be helpful. must be cross platform and pure php. many thanks in advance regards Jera ...

mat file from matlab to pascal program

Hi please, any one help me to solve my peoblem: I have struct of array containing image file name and color histogram and save it in mat file. How can I use this file in pascal program ...

NASM and INT13h - what am I doing wrong?

Hey, I'm pretty interested in OS writing, I was for a long time, but still just could not swallow it (I mostly go with "What can't you understand on first read you should not do at all" - and it applies well for everything else I do, like PHP, HTML, AS3.0, C++... a lot more) just now I KIND of got it. The problem is - really, ASM was not...

file_get_contents function not working

Hi All, I have some problem with file_get_contents() function, it not working properly when I tried to read URL like "http://google.com" is accessible but when I tried to access any file like "classes/connect_temp.txt" it is not accessible. Here is some code i use $file_path =realpath('./')."/classes/connect_temp.txt"; $...

How do you read xml data from a project resource into a dataset?

I have an xml file that is a project resource. I can access it via Properties.Resources.DrivereSettings. The xml file looks like this: <?xml version="1.0" encoding="utf-8" ?> <FilterOffsets> <FocusOffset> <SerialNumber>12543</SerialNumber> <Filter>4</Filter> <Wheel>A</Wheel> <Offset>7</Offset> </FocusOffset> </Filte...

Insert and delete emails from a text file using PHP

Hi i am creating an under construction page where users can leave their email to be notified when the site launch i need to add those emails to a text file called list.txt my question is two parts how can i add [email protected] to the text file ? and how i can later delete certain email from a text file ? thanks for help ...

Materialize data from related sqldatareader into an aggregated IEnumerable<Customer>

Hello, I have this relation: Customer - Order - Product each mapped to its own sql table. When I want to eager load now the Customers with its Orders and the Orders with its Products How do I have to iterate the 3 sqldatareader to get in the end a IEnumerable just as I would use an ORM. What I do not want to do is to pass the Sql...

Socket client/server input/output polling vs. read/write in linux

Basically I set up a test to see which method is the fastest way to get data from another computer my network for a server with only a few clients(10 at max, 1 at min). I tried two methods, both were done in a thread/per client fashion, and looped the read 10000 times. I timed the loop from the creation of the threads to the joining of ...

How to read a very large rss/atom.

I have a very large RSS (which may be 1M), so when I read it, it takes alot of time. If I set the number of items read, example: 4, I think this will not ensure that I read all the data which updated since last time I read it (and I will lose some items), What can I do? I am using Google AJAX Feed Api to read the RSS/Atom feed. updat...

Slow performance in reading from stream .NET

I have a monitoring system and I want to save a snapshot from a camera when alarm trigger. I have tried many methods to do that…and it’s all working fine , stream snapshot from the camera then save it as a jpg in the pc…. picture (jpg format,1280*1024,140KB)..That’s fine But my problem is in the application performance... The app need ...

Reading single byte with Asio::read

Hi. Is it possible to read a single byte via asio::read? I'm getting a single byte response and it seems wasteful to use the current buffering code: //Read the 1 byte reply char buffer[1]; size_t bytesRead = asio::read(s, asio::buffer(buffer, 1)); if(bytesRead < 1) return false; Thanks. ...