I am reading one line at a time from a file, but at the end of each line it adds a '\n'.
example:
line is: 094 234 hii
but my input is: 094 234 hii\n
I want to read line by linem but I don't need to keep the newlines...
My goal is to read a list from every line: I need ['094','234','hii'], not ['094','234','hii\n']
Any advice?
Hi All,
I am creating application using jquery in asp.net. I am displaying images(664 x 428) with fade effect using cycle plugin and also a gif file outside the control.
Problem:
The gif file animation is working only if i pause the cycle fade effect the gif file animation is working.
Coding:
$('#mainBanner').cycle({
fx: 'fade',
continuous: true,
speed: 7500,
timeout: 55000,
pause: 1,
sync: 1
});
<img src="Images/HomePageImages/scan.gif" alt="" width="124" border="0" height="124" />
I cannot embed this into the msi - meaning - while building the setup, I do not know the content of the text file. After the setup has been built (the msi is ready), I want to distribute a text file along with the msi and make the setup paste that file inside a particular folder - in my case, the machine's ProgramData folder. Please guide.
I have a PHP project setup in Netbeans (v6.8) where all the PHP files are on a remote server and in a single directory. Whenever I save files locally they are updated on the remote server via SFTP.
I now need to edit a remote JavaScript file to add some jQuery logic but the file is located within a different directory on the webserver. How to I add this JavaScript file such that when it is saved or updated it is transferred to it's own location on the server?
When I attempt to create the file locally within NetBeans it saves to the same directory as my PHP files. I would like to be able to continue using NetBeans rather than doing this all manually using an SFTP client and a text editor. Thanks in advance.
can anybody explain why uploaded php files treated by a server as a text file ?
The symptom is when i try to access a php file, the server send me the content of the file.
I'm using FILE type in my MFC project but after compiled, it shows the following errors:
Error 23 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 24 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 22 error C2146: syntax error : missing ';' before identifier 'm_pFileW'
Those errors are referring to this code:
FILE *m_pFileW;
Did I missing any library header to use FILE syntax? Do I need to use different approach and replace FILE syntax? This errors are only generated when I placed it into my MFC project. This is not happening in C++ Console. Please help.
Thank you.
I have written
List<Attachment> lstAttachment = new List<Attachment>();
//Check if any error file is present in which case it needs to be send
if (new FileInfo(Path.Combine(errorFolder, errorFileName)).Exists)
{
Attachment unprocessedFile = new Attachment(Path.Combine(errorFolder, errorFileName));
lstAttachment.Add(unprocessedFile);
}
//Check if any processed file is present in which case it needs to be send
if (new FileInfo(Path.Combine(outputFolder, outputFileName)).Exists)
{
Attachment processedFile = new Attachment(Path.Combine(outputFolder, outputFileName));
lstAttachment.Add(processedFile);
}
Working fine and is giving the expected output.
Basically I am attaching the file to the list based on whether the file is present or not.
I am looking for any other elegant solution than the one I have written.
Reason: Want to learn differnt ways of representing the same program.
I am using C#3.0
Thanks.
Hey,
In my asp.net application I create pdf file and save it in App_Data folder on server. Next I want to open this file that user can print it.
How to open this file in browser ? Send it in http header etc ? Someone have some examples?
Please help ;)
One of the sites i visit has an annoying habit of naming all their files showimage.php. When i save the image or file it saves as a .php so i cannot open the file. The worse part is, there is a &ext=zip&more=blah in the url.
Is it possible to use greasemonkey to rename the file ext so it isnt php? (maybe injecting a content disposition header?)
Looking for a way to rename files that are uploaded by users through a filefield. For example, rename user profile photos using uniqid.
I found a good solution for D6 here:
http://www.wesjones.net/home/2011/03/drupal-6-how-to-change-filename-on-upload
but can't find anything for D7.
Another option is to use File (Field) Paths, but (1) the module causes warnings on my setup and (2) seems to be a bit of an overkill to install a general module for a very specific purpose.
Say there is a file called 12345.jpg. In C, how can I get the file extension so that I can compare with some file extension? If there are any inbuilt functions, kindly please let me know.
Hi i am new to blackberry (7.0) environment. Recently i have been trying to download a file from the server on to the sdcard of the simulaotr through a FTP client. After searching a lot, i have not been able to find a reference for how to code a FTP. Can anyone please help or provide me a link where i can get a sample code of how to download a file using FTP. Also when i was working in Android environment previously, i made use of external jar file of FTP. But in Blackberry that same jar file is of no use. So please help me its part of my project...
As I know, C inline function body should be defined in .h file
because it causes an error 'function-name used but never defined" if body defined in .c file.
Is this the regular way? Or how to define inline function body in .c file?
Trying to download a file on a remote server and save it to a local subdirectory.
The following code seems to work for small files, < 1MB, but larger files just time out and don't even begin to download.
<?php
$source = "http://someurl.com/afile.zip";
$destination = "/asubfolder/afile.zip";
$data = file_get_contents($source);
$file = fopen($destination, "w+");
fputs($file, $data);
fclose($file);
?>
Any suggestions on how to download larger files without interruption?
I've got this piece of code that I want to write the output to a text file but with the correct format i.e. no brackets, single quotes so it appears as a formatted list.
This is the code:
file = open("env5.txt", "w");
for key in os.environ.keys():
env = os.environ[key];
key1 = key;
list = str([key, env]).replace("'","").replace('[]', '');
list2 = list[1:-1];
print(list2);
file.writelines(list2);
file.close();
This is the original code:
for key in os.environ.keys():
print(key, os.environ[key]);
Many thanks
how to get the directory name for a particular file on the drive in java?
for example i have a test.java under a test directory on my D drive.how do i find the directory name for this test.java?
Hi All,
I have a text file with Tag - Value format data. I want to parse this file to form a Trie. What will be the best approach?
Sample of File: (String inside "" is a tag and '#' is used to comment the line.)
#Hi, this is a sample file.
"abcd" = 12;
"abcde" = 16;
"http" = 32;
"sip" = 21;
I have a scenario where i created pipe for communication between two child and parent. Parent writes (using write function)data to the pipe and closes the respective file descriptor. The problem is when i want to write data again to the pipe, the write function is returning error code -1. I think its because writing end has been closed in previous iteration. Then how to open the corresponding file descriptor after it has been closed once.
I tried using open() function which requires path to some file as arguement. But i am not using any files in my application. I have simple file descriptors (int arr[2]).
Is it possible to achieve above scenario with pipes????
I think the number of files is so effective in time of transfering files for example :
Transfering 1000 item that have 1GB size need more time than transfering 1 file with same size.