Search Results

Search found 40999 results on 1640 pages for 'duplicate files'.

Page 162/1640 | < Previous Page | 158 159 160 161 162 163 164 165 166 167 168 169  | Next Page >

  • Set the path for the location of media files in program

    - by Zaheer Boovaji
    I have made a Java Swing Desktop application in Netbeans which can play media files I have put the videos in my workspace resources location and in my java program I am calling those media files using an URL which is something like this: C:/users/Dell/My Documents /NetBeansProjects/Media/src/resources/ MediaFiles/ddd.mpg This works well when I run in my IDE and also i have made Jar for this it works well on my computer but the problem is when i copy this jar file on my friends system the interface is coming but when I click a button to play a media file it says: C:/users/Dell/MyDocuments/NetBeansProjects/Media/src/resources/ MediaFiles/ddd.mpg does not exist So, please provide me a solution of how to set the default path so that when I run a jar file on other systems it should play the media file location I am passing as in my program. How to set the path for the location of media files in program? Update The videos are in the jar file.

    Read the article

  • How can a FILE* (pointer to a struct) be tested (if == NULL)?

    - by m4design
    I was playing around with C, anyways I was thinking how can file pointer (which points to a struct type), be tested if NULL as for instant: FILE *cfPtr; if ( ( cfPtr = fopen( "file.dat", "w" ) ) == NULL ) I tried to do that myself, but an error occurs. struct foo{ int x; }; struct foo bar = {0}; if (bar == NULL) puts("Yay\n"); else puts("Nay"); error C2088: '==' : illegal for struct Here's the FILE deceleration in the stdio.h file: struct _iobuf { char *_ptr; int _cnt; char *_base; int _flag; int _file; int _charbuf; int _bufsiz; char *_tmpfname; }; typedef struct _iobuf FILE;

    Read the article

  • appending text to all files that starts with a string

    - by learner135
    How do I append a string to all the files in a directory that starts with a particular string? I tried, cat mysig >> F* But instead of appending contents of mysig to all files starting with F, it creates a file named "F*". Obviously wildcard doesn't seem to work. Any alternatives? Thanks in advance. Edit: Also how do I delete this newly created file "F*" safely?. Using rm F* would delete all the files starting with F which I wouldn't want.

    Read the article

  • Using C struct without including header file

    - by shams
    My basic problem is that I want to use some structs and functions defined in a header file by not including that header file in my code. The header file is generated by a tool. Since I don't have access to the header file, I can't include it in my program. Here's a simple example of my scenario: first.h #ifndef FIRST_H_GUARD #define FIRST_H_GUARD typedef struct ComplexS { float real; float imag; } Complex; Complex add(Complex a, Complex b); // Other structs and functions #endif first.c #include "first.h" Complex add(Complex a, Complex b) { Complex res; res.real = a.real + b.real; res.imag = a.imag + b.imag; return res; } my_program.c // I cannot/do not want to include the first.h header file here // but I want to use the structs and functions from the first.h #include <stdio.h> int main() { Complex a; a.real = 3; a.imag = 4; Complex b; b.real = 6; b.imag = 2; Complex c = add(a, b); printf("Result (%4.2f, %4.2f)\n", c.real, c.imag); return 0; } My intention is to build an executable for my_program and then use the linker to link up the executables. Is what I want to achieve possible in C?

    Read the article

  • Search in big text log files

    - by 0xFF
    Hi, let's say you have an game server which creating text log files of gamers actions, and from time to time you need to lookup something in those logs files (like investigating an scam or loosing an item). Just for example you have 100 files and each file have size between 20MB and 50MB - How you would search them quickly? What I have already tried to do is create several threads and each invidual thread will map his own file to memory (let say memory should not be problem if it not exceed 500MB of ram) perform search here, result was something around 1 second per file : File:a26.log - read in: 0.891, lines: 625282, matches: 78848 Is there better way how to do that ? - because it seems to me kinda slow. thanks. (java was used for this case)

    Read the article

  • Extract object (*.o) files from an iPhone static library

    - by Brett
    I have a set of iPhone static libraries (a *.a file) in which I only call a few of the classes from. I have used AR in the past (with linux libraries) to extract the object files from the static library, remove the unwanted object files and rearchive. However, when I try this with an iPhone compliled static library, I get the following error: ar: CustomiPhoneLib.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it) ar: CustomiPhoneLib.a: Inappropriate file type or format Does anyone know how to extract the object files from an iphone compiled static library? Doing thie could potentially reduce the final file size.

    Read the article

  • How does file creation work in Java

    - by Ankur
    I am trying to create a file using File newFile = new File("myFile"); However no file called "myFile" is created. This is within a Web application Project i.e. proper form to be pakaged as a WAR but I am calling it as part of a main method (just to see how this works). How can I make it so that a new file is created at a location relative to the current one i.e not have to put in an absolute path.

    Read the article

  • Tools for viewing logs of unlimited size

    - by jkff
    It's no secret that application logs can go well beyond the limits of naive log viewers, and the desired viewer functionality (say, filtering the log based on a condition, or highlighting particular message types, or splitting it into sublogs based on a field value, or merging several logs based on a time axis, or bookmarking etc.) is beyond the abilities of large-file text viewers. I wonder: Whether decent specialized applications exist (I haven't found any) What functionality might one expect from such an application? (I'm asking because my student is writing such an application, and the functionality above has already been implemented to a certain extent of usability)

    Read the article

  • read from file after calling lseek64 - Linux

    - by rursw1
    Hi, I'm trying to read a large file ( 2.0 GB). The seeking is done by lseek64, then I tried to read using read(fileHandle, buffer, bufferLength)\ pread64(fileHandle, buffer, bufferLength, offset) - but both return with -1. What could it be? Thanks in advance!

    Read the article

  • Reading a large text file to memory in C++

    - by NoneType
    Is there a way to read a large text file (~60MB) into memory at once (like a compiler flag to increase program memory limit) ? Currently, ofstream's open function throws a segmentation fault while trying to read this file. ifstream fis; fis.open("my_large_file.txt"); // Segfaults here The file just consists of rows of the form number_1<tabspace>number_2 i.e., two numbers separated by a tabspace.

    Read the article

  • another file_exists with special chars problem

    - by Camran
    I have some folders with special characters in their names. I run currently at a test-computer with Windows OS, but later I will use LINUX. My problem is that the folders with special chars in their names cannot be recognized somehow. ex: file_exists('../Bilar/27733691_1.jpg') // TRUE file_exists('../Båtar/27733691_1.jpg') // FALSE because of the special char in folder name... How should I solve this? I plan to run LINUX in the future when website is online... would that matter? Please explain thoroughly because I am a newb at this Thanks

    Read the article

  • C++: Is windows.h generally an efficient code library?

    - by Alerty
    I heard some people complaining about including the windows header file in a C++ application. They mentioned that it is inefficient. Is this just some urban legend or are there really some real hard facts behind it? In other words, if you believe it is efficient or inefficient please explain how this can be with facts. I am no C++ Windows programmer guru. It would really be appreciated to have detailed explanations.

    Read the article

  • Using Linux C code and header files to compile a Windows DLL

    - by df382
    I would like to know if in general it is possible to create a C++ DLL with Visual C++ 2010 starting from C code and the header files I find in a Linux distribution. Theoretically, if I take a piece of C code (that includes different header files) from Linux and I find in the Linux file system all the header files needed for the linkage of the project, will I be able to successfully compile the project in Windows with Visual C++ 2010? Are there some examples or a tutorial for doing this? After compiling a DLL, I would like to use it in a C# application, which I will run under Linux with Mono.

    Read the article

  • Split text files Accross threads

    - by Kevin
    The problem: I have a few text files (10) with numbers in them on every line. I need to have them split across some threads I create using the pthread library. these threads that are created (worker threads) are to find the largest prime number that gets sent to them (and over all the largest prime from all of the text files). My current thoughts on solutions: I am thinking myself to have two arrays and all of the text files in one array and the other array will contain a binary file that I can read say 1000 lines and send the pointer to the index of that binary file in a struct that contains the id, file pointer, and file position and let it crank through that. a little bit of what I am talking about pthread_create(&threads[index],NULL,calc_sqrt,(void *)threadFields[index]);//Pass struct to each worker Struct: typedef struct threadFields{ int *id, *position; FILE *Fin; }tField; If anyone has any insight or a better solution it would be greatly appreciated Thanks

    Read the article

  • Copying files from one directory to another in Java

    - by user42155
    Hello, I want to copy files from one directory to another (subdirectory) using Java. I have a directory, dir, with text files. I iterate over the first 20 files in dir, and want to copy them to another directory in the dir directory, which I have created right before the iteration. In the code, I want to copy the review (which represents the ith text file or review) to trainingDir. How can I do this? There seems not to be such a function (or I couldn't find). Thank you. boolean success = false; File[] reviews = dir.listFiles(); String trainingDir = dir.getAbsolutePath() + "/trainingData"; File trDir = new File(trainingDir); success = trDir.mkdir(); for(int i = 1; i <= 20; i++) { File review = reviews[i]; }

    Read the article

  • Use the keyword class as a variable name in C++

    - by Leif Andersen
    I am having trouble writing C++ code that uses a header file designed for a C file. In particular, the header file used a variable name called class: int BPY_class_validate(const char *class_type, PyObject *class, PyObject *base_class, BPY_class_attr_check* class_attrs, PyObject **py_class_attrs); This works in C as class isn't taken as a keyword, but in C++, class is. So is there anyway I can #include this header file into a c++ file, or am I out of luck? Thank you.

    Read the article

  • visual studio 2008 keyboard gets locked when editing source controlled files

    - by Rama
    Hi, I am facing a strange issue with editing source controlled files (especially aspx files) using visual studio 2008. when I check out and edit the file, I can edit fine for few seconds and after that keyboard gets locked and I can't type anything (it doesn't affect the files not added to source control). as soon it is locked, if I try to type, the focus shifts to solution explorer and other windows and sometimes it freezes and doesn't respond at all. I tried uninstalling and reinstalling visual studio, reinstalling the source control plug-in. none of it worked. not sure if it is my machine or my profile. Please help if you have any clues. I can't see any other solution for this except rebuilding the machine Thanks, Rama

    Read the article

  • PHP: csv generator creates extra field

    - by WhyKiki
    I'm coding a script that takes one csv file to transform it into another one. Basically, two foreach loops are used: one to iterate records and another to iterate fields. Certain fields (cno 25, 26, 44) for each record needs to be modified. The problem is that each modificatino creates an extra empty field, i.e. the code $colStr .= '"' . $col . '";'; works but not any of the code in the if statements. The code is: $rno = 0; foreach ($csvArray as $line) { $cno = 0; $colStr = ""; foreach ($line as $col) { if($rno>0 && $cno==25) { $stuff = array($csvArray[$rno][41], $csvArray[$rno][47], $csvArray[$rno][48], $csvArray[$rno][49]); foreach($stuff as &$value) { $value = preg_replace('/[^0-9]/', '', $value); } sort($stuff, SORT_NUMERIC); // Causes bug! $colStr .= '"' . $stuff[0] . '";'; } if($rno>0 && $cno==26) { $urls = ""; for($i = 55; $i<=62; $i++) { $urls .= "Images: " . $csvArray[$rno][$i] . " | "; } $urls .= "Some text: " . $csvArray[$rno][43] . " | "; // Causes bug! $colStr .= '"' . $urls . '";'; } if($rno>0 && $cno==44) { $colStr .= '"' . $_POST['location'][$rno] . '";'; } if($rno>0 && $cno==54) { $objType = $col; $objType = preg_replace('/foobar/i', '123', $objType); // Causes bug! $colStr .= '"' . $objType . '";'; } else { // This is ok, though $colStr .= '"' . $col . '";'; } $cno++; } $colStr = preg_replace('/;$/', '', $colStr); $colStr .= "\n"; fwrite($outputFile, $colStr); $rno++; } fclose($outputFile);

    Read the article

  • PHP: File exists and is in a certain sub-directory

    - by Svish
    I get a file path to a user file and I want to make sure that this path is to a valid existing user file and not to something bogus or a system file or something like that. I know I can use file_exists to check that it exists, but I'm not sure how I should make sure that the file is in a certain sub-directory...

    Read the article

  • Scan Numbers among letters in a Sentence

    - by ZaZu
    Hello, I have a pretty easy question. (using C) In a sentence such as In this document, there are 345 words and 6 figures How can I scan 345 and 6 while ignoring all that is in between ? I tried fscanf(FILE *pointer,"%d %d",&words,&figs); But it only gets the first value ... What am I doing wrong ?

    Read the article

< Previous Page | 158 159 160 161 162 163 164 165 166 167 168 169  | Next Page >