files

Reading a specific number of lines from a file in C (scanf, fseek,fgets)

I have a process master that spawns N child processes that communicate with the parent through unnamed pipes. I must be able to: make the father open the file and then send, to each child, a struct telling that it has to read from min to max line; this is going to happen at the same time, so I don't know: 1st how to divide total_lines ...

Django: How Add Static Files

Readed all these topic http://stackoverflow.com/search?q=django.views.static.serve And it not helped :( OS: Windows XP Python: 2.7 Django: 1.2.3 Media in D:\bugtracker\static With files: docicons-note.gif style.css In settings.py i set: MEDIA_ROOT = 'D:/bugtracker/static/' MEDIA_URL = '/static/' In urls.py i set: urlpatterns = pa...

How can I create a two-dimensional array in Perl?

I am currently trying to pass a matrix file that is 32 by 48 to a multi-dimensional array in Perl. I am able to access all of the values but am having issues accessing a specific value. I need to run specific statistics on each of the values, calculate zscore, subtract the mean from each value, penalize specific values et cetera. I tried...

How can I merge two versions of a file in PHP or JavaScript?

I'm trying to code a site that will allow multiple people to be working on a file at the same time. In doing so, the biggest road-block I have come across is merging the new versions of the files, version-control style. I have been unable to find anything in the vein of a built-in JavaScript or PHP function that will help me with this....

bash cat multiple files content in to single string without newlines

i got some files with name start as eg_. and only each contains one single line eg_01.txt: @china:129.00 eg_02.txt @uk:219.98 eg_03.txt @USA:341.90 ...... i am expecting to cat them in to a single line to send by URL like: @china:129.00@uk:219.98@USA:341.90 i use echo cat eg_* it give me the output look like a string, but it actu...

How write + NSDictionary in file

NSMutableDictionary *dicta = [[NSMutableDictionary alloc] init]; [dicta writeToFile:[docDirectory stringByAppendingPathComponent:foo] atomically:YES]; I know only how write W+ ? ...

What's the best way to slurp the contents of a file into a string in Mathematica?

I know this is asked commonly but googling doesn't turn up a definitive answer for Mathematica so I thought it would be valuable to have this on StackOverflow. I've been doing this with Import but it occurred to me that that might be horribly inefficient, Import being such a heavyweight function. So the question is, can you improve on ...

HOw to group header files in header subfolders under the general header files folder using Cmake

Hi I am building Cmake based build system. I would like to group header files in folders (VC++ can do it) under the general folder Headr Files. Similar I would like to group the corresponding .cpp files in folders under the Source Files directory. Unfortunately I could not find any instructions of how to do it. Please help. Dimitre ...

how to do unit testing of functions writing files using python unittest

I have a python function that writes an output file to a disk. I want to write a unit test for it using python unittest module. How should I assert equality of files? I would like to get an error if the file content differs from the expected one + list of differences. As in the output of unix diff command. Is there any official/recomm...

read & write from file

I want to write a program in c++ that prompts a user for a file name of an existing file that contains 10 records where the length of each record is 12 characters. next the program seeks to the beginning of the 6th record, reads the records in the file and append them to the end of an existing output file that contains 3 records. Thank y...

allow only specific ips to access site and allow all to access specific file

I have this configuration in my httpd.conf <Directory /> AllowOverride none Order Deny,Allow Deny from all Allow from 66.220.144.0/20 69.63.176.0/20 </Directory> <Files crossdomain.xml> Order deny,allow Allow from all </Files> What I am trying to achive is allow facebook to access the web application and deny ...

AWK/BASH: how to match a field in one file from a field in another?

Hi all, I have 2 files, the first contains the following: ... John Allen Smith II 16 555-555-5555 10/24/2010 John Allen Smith II 3 555-555-5555 10/24/2010 John Allen Smith II 17 555-555-5555 10/24/2010 John Doe 16 555-555-5555 10/24/2010 Jane Smith 16 555-555-5555 9/16/2010 Jane Smith 00 555-555-5555 10/24/2010 ... and the second fil...

Groovy : get a list of all the files in a directory (recursive)

Newbie question: I'm trying to get (not print , that's easy) the list of files in a directory and it's sub directories. I've tried: def folder = "C:\\DevEnv\\Projects\\Generic"; def baseDir = new File(folder); files = baseDir.listFiles(); but I only get the dirs. I've also tried def files = []; def processFileClosure = { ...

Storing temporary files

I would like to generate some temporary files in the course of my application. Specifically, I'm using AVAudioRecorder to record a file that I, upon stopping the recording, would like to load and edit/process. My question is: What is the appropriate standard place to create temporary files. Is there some generally accepted approach t...

C++ how to check if folder is empty / list existing files

Possible Duplicate: How do you iterate through every file/directory recursively in standard C++ Hello everyone! I've been looking for a way to check if a determined folder is empty or not, and if it isn't, list the existing files in the folder, but of course to no avail. I've been looking around and found something called di...

Combining files in Notepad++

Is there a Notepad++ plugin out there that automatically combines all currently opened files into a single file? Update: Yes, I am very aware of copy and paste :) I'm working with lots of files, and I want a solution that makes this step in the process a little bit faster than several dozen copy and pastes. I'm aware of utilities for c...

VBScript current directory + sub directory?

I am trying to get the path of a file that is within a sub-directory of the current directory in VBScript. The following does not seem to work? currentDirectory = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(len(WScript.ScriptName))) FileToCopy = currentDirectory & "\test\user.js" Here is the entire code: Set oFSO = Cre...

Batch File: List all files not beginning with "SP"

Hello I have a DOS batch file that performs an action for files beginning with text "SP", as follows: FOR /F "tokens=*" %%A IN ( 'DIR SP*.sql /s /b' ) DO ECHO .compile_file = "%%A" >> output.txt The key bit here is obviously: DIR SP*.sql /s /b I need to do a similar thing before the "FOR" line above, but for all other files not st...

Access files on WM6 phone using USB connection

Windows XP shows my Windows Mobile 6 phone (HP iPAQ 514) as "Mobile Device" in "My computer". Using Windows explorer, I can copy files from/to the device and its storage card. Which possibilities are there to access these files programmatically? Any way to access them using normal filenames or special paths? Note that I'm searching for...

Can we submit dual binary file ( of the same app) to apple app store, one for OS 3.x and another for IOS 4.x?

Hello, Can we submit two binary files of a same iphone application to App store? One specific to OS 3.x and another specific to iOS 4.x. Thanks in advance. ...