Search Results

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

Page 193/1640 | < Previous Page | 189 190 191 192 193 194 195 196 197 198 199 200  | Next Page >

  • golang dynamically parsing files

    - by Brian Voelker
    For parsing files i have setup a variable for template.ParseFiles and i currently have to manually set each file. Two things: How would i be able to walk through a main folder and a multitude of subfolders and automatically add them to ParseFiles so i dont have to manually add each file individually? How would i be able to call a file with the same name in a subfolder because currently I get an error at runtime if i add same name file in ParseFiles. var templates = template.Must(template.ParseFiles( "index.html", // main file "subfolder/index.html" // subfolder with same filename errors on runtime "includes/header.html", "includes/footer.html", )) func main() { // Walk and ParseFiles filepath.Walk("files", func(path string, info os.FileInfo, err error) { if !info.IsDir() { // Add path to ParseFiles } return }) http.HandleFunc("/", home) http.ListenAndServe(":8080", nil) } func home(w http.ResponseWriter, r *http.Request) { render(w, "index.html") } func render(w http.ResponseWriter, tmpl string) { err := templates.ExecuteTemplate(w, tmpl, nil) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } }

    Read the article

  • Managing the localization of Java properties files

    - by andri
    I have a Web application written in Java that is targeting several countries, all of which speak different languages (and more often than not, several languages -- that's Europe for you). We have a bunch of .properties files that hold the localized strings, and our current procedure is to e-mail the language-specific files to our partners for updating before doing major updates. However, this process is rather error-prone, as sometimes people forget to translate new strings and sometimes new strings don't get added to every language file, thus small mistakes get through very easily. Does anyone know of any existing software that could help us clear this mess? At a bare minimum, I'm thinking of something that would allow you to load a master file (for example, in English), a localized file and then would highlight the keys that were added to or removed from the master file.

    Read the article

  • Fast read of certain bytes of multiple files in C/C++

    - by Alejandro Cámara
    I've been searching in the web about this question and although there are many similar questions about read/write in C/C++, I haven't found about this specific task. I want to be able to read from multiple files (256x256 files) only sizeof(double) bytes located in a certain position of each file. Right now my solution is, for each file: Open the file (read, binary mode): fstream fTest("current_file", ios_base::out | ios_base::binary); Seek the position I want to read: fTest.seekg(position*sizeof(test_value), ios_base::beg); Read the bytes: fTest.read((char *) &(output[i][j]), sizeof(test_value)); And close the file: fTest.close(); This takes about 350 ms to run inside a for{ for {} } structure with 256x256 iterations (one for each file). Q: Do you think there is a better way to implement this operation? How would you do it?

    Read the article

  • how to fetch a range of files from an FTP server using C#

    - by user260076
    hello all, i'm stuck at a point where i am using a wildcard parameter with the FtpWebRequest object as suck FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/" + WildCard)); now this works fine, however i now want to fetch a specific range of files. say the file naming structure is *YYYYMMDD.* and i need to fetch all the files prior to today's date. i've been searching for a wildcard pattern for that with no good results, one that will work in a simple file listing. and it doesn't look like i can use regex here. any thoughts ?

    Read the article

  • How to open files in Java Swing without JFileChooser

    - by ron
    I'm using Java Swing (GUI) and I want to add a button to my project for opening files . I don't like the JFileChooser since it opens a small window for browsing through the files of the directories . Can I use something else , instead of the JFileChooser under Java Swing ? I've tried to use elements of SWT but it didn't work , meaning is the use of the button object and then use it inside the Jframe , but that failed , so I guess SWT and Swing don't mix together? Here is the example of Java Swing with JFileChooser and I'm looking for something like this to put in my JFrame.

    Read the article

  • Pre-load audio files at the client-side for later use

    - by awj
    I'm building an online test which implements audio (mp3) using the native audio player (i.e. non Flash-based). The test shows one question at a time and loads each subsequent question asynchronously. Some questions have an accompanying audio file, others don't, and the audio files can be several MB in size. So what I'm hoping to do is to preload the audio files client-side at the start of the test and then move these into place when the relevant question comes up. So far I've tried loading an audio file into a QuickTime player, then when that question comes up I use jQuery's clone(true) method to copy this into a part of the page which is displayed. However, when I do this the QuickTime player has to reload the audio file from source. Same is true for Windows Media Player. Does anyone have any suggestions as to how I can preload the audio client-side and then call it forward when needed?

    Read the article

  • Challege: merging csv files intelligently!

    - by Evenz495
    We are in the middle of changing web store platform and we need to import products' data from different sources. We currently have several different csv files from different it systems/databases because each system is missing some information. Fortunatly the product ids are the same so it's possible to relate the data using ids. We need to merge this data into one big csv file so we can import in into our new e-commerce site. My question: is there a general approach when you need to merge csv files with related data into one csv file? Are there any applications or tools that helps you out?

    Read the article

  • What is the most efficient way to list all of the files in a directory (including sub-directories)?

    - by prometheus
    I am writing a servlet which will examine a directory on the server (external to the web container), and recursively search for certain files (by certain files, I mean files that are of a certain extension as well as a certain naming convention). Once these files are found, the servlet responds with a long list of all of the found files (including the full path to the files). My problem is that there are so many files and directories that my servlet goes extremely slow. I was wondering if there was a best practice or existing servlet for this type of problem? Would it be more efficient to simply compile the entire list of files and do the filtering via js/jquery on the client side?

    Read the article

  • discovering files in the FileSystem, through SSIS

    - by cometbill
    I have a folder where files are going to be dropped for importing into my data warehouse. \\server\share\loading_area I have the following (inherited) code that uses xp_cmdshell shivers to call out to the command shell to run the DIR command and insert the resulting filenames into a table in SQL Server. I would like to 'go native' and reproduce this functionality in SSIS. Thanks in advance guys and girls. Here's the code USE MyDatabase GO declare @CMD varchar(500) declare @EXTRACT_PATH varchar(255) set @EXTRACT_PATH = '\\server\share\folder\' create table tmp_FILELIST([FILENUM] int identity(1,1), [FNAME] varchar(100), [FILE_STATUS] varchar(20) NULL CONSTRAINT [DF_FILELIST_FILE_STATUS] DEFAULT ('PENDING')) set @CMD = 'dir ' + @EXTRACT_PATH + '*.* /b /on' insert tmp_FILELIST([FNAME]) exec master..xp_cmdshell @CMD --remove the DOS reply when the folder is empty delete tmp_FILELIST where [FNAME] is null or [FNAME] = 'File Not Found' --Remove my administrative and default/common, files not for importing, such as readme.txt delete tmp_FILELIST where [FNAME] is null or [FNAME] = 'readme.txt'

    Read the article

  • Extract all files with directory path in given directory

    - by gaurav
    I have a tar archive in which I have a directory which I need to extract in a given directory. For example: I have a directory TarPrefix/x/y/z in a tar archive I want to extract it in a given target directory for example: extracted/a/ this directory should contain all the files and directories contained in directory TarPrefix/x/y/z. subdir_and_files = [ tarinfo for tarinfo in tar.getmembers() if tarinfo.name.startswith("subfolder/") ] to get the list of all the members in the directory path "subfolder/" and then I extract it using tar.extractall(extracted/a,subdir_and_files) but it extracts all the members with their directory path For example this results in extracted/a/x/y/z. Could you please help me in extracting these files in the given folder.

    Read the article

  • need to upload multiple files each with different parameters

    - by OM The Eternity
    I have a form in which there are total eight fields, name, address, age and 5 other file/photo upload fields such that at a time one upload field is visible.. Now here every time I upload a file i need to fill the "name, address and age" as well. at this point I dont want to submit the form, but I just want to save these values in any variable and get back to same form with information of previous file ready to be submitted, now again user can upload new file with new values in... and so on... as user is done with the 5 files he should not be allowed to upload more but he should be allowed to submit all the 5 files to DB along with there supporting fields.. How should I proceed further ...?

    Read the article

  • Disable Drag&Drop of files in Richtextbox in .NET

    - by Jiri
    Hello, I use a .NET richtextbox and I want to have the EnableAutoDragDrop property set to True. This allows user to drag&drop text, rtf and images around etc. However, I need to process files dropped into the richtextbox myself - I do not want them to be embedded as OLE objects when they are dropped. How can I overcome this? Is there any way to delete embedded files from richtextbox? (I've found API DragAcceptFiles which doesn't work for some reason.) Thanks!

    Read the article

  • Using external javascript files with asp.net MVC

    - by twal
    I have some javascript inwhich I am using such helpers as var url = <%=ResolveUrl("~/controller/action") %> When the javascript is embeded in the .aspx page using the <script> tag everything works fine When I move it out to an external file those scripts that have the helper methods do not work. Other scripts do just the ones with the var url = <%=ResolveUrl("~/controller/action") %> do not. Are these not possible to use in external javascript files?? I would like to get all of my javascript out of the aspx files if I can. thanks!

    Read the article

  • how to get files as they are added to a remote server

    - by Jordan
    I am using a bash script (below) on a remote server (so far using ssh to connect) to execute a python script that downloads a lot of pdf files one at a time (getting the download locations from a text file with the URL's) in a loop. I would like to move the files from the remote server to my local computer as they are downloaded, and then delete the file from the remote server. Is there a way that I can expand my bash script to do this? Or are there alternatives for completing this task? while read line; do python python_script.py -l $line; done < pdfURLs.txt

    Read the article

  • Open zip file without temporary files

    - by Javis Perez
    i've seem this post about extracting a zip without a temporary file via stream and pipes: Open a file from archive without temporary extraction The problem is that i'm using php and have no idea if that is possible. I've search a lot with no luck. My idea is to preview zip files from the dropbox using its API but i dont want to save the files to a local drive, just preview the content. Any idea if that's possible with php? Almost everything i found is about creating the file, not reading it... :-\ I was thinking that i might try with nodejs, but i know mostly nothing about nodejs, do you think it would support it? Any other idea please? thank you.

    Read the article

  • Packaging "hidden" asset files

    - by ChaimKut
    I'm placing the file '.nomedia' into a folder in order to avoid Android's MediaScanner from detecting the media files in the folder. I need to copy this folder (including '.nomedia') from the APK's assets to the SD card (so other apps can make use of these media files, etc.). When I package the APK in Eclipse, it doesn't package the '.nomedia' file. Presumably it's detecting it as a hidden file. Any ideas how to fix this? Is there a secret aapt flag I can use? I'd like to avoid copying the folder and then manually creating a '.nomedia' folder, if possible.

    Read the article

  • Creating a iso file from a set of img files

    - by cafebabe1991
    So i have started building android from scratch and after lot of effort finally landed up to a point where i have the OUT folder consisting of all the required IMG files for an emulator to run. Like the system.img ramdisk.img userdata-qemu.img So after that i ran the emulator command so that means the OUT directory was valid and could easily be used to create any other bootable medium. What i want to accomplish Creating the iso file from all those img files found at the end of building process,or a way to just create an iso out of that complete OUT folder. any help in this regard would be greatly appreciated.

    Read the article

  • What is good practice for writing web applications that control daemons (and their config files)

    - by Jones R
    Can someone suggest some basic advice on dealing with web applications that interact with configuration files like httpd.conf, bind zone files, etc. I understand that it's bad practice, in fact very dangerous to allow arbitrary execution of code without fully validating it and so on. But say you are tasked to write a small app that allows one to add vhosts to an apache configuration. Do you have your code execute with full privileges, do you write future variables into a database and have a cron job (with full privileges) execute a script that pulls the vars from the database and throws them into a template config file, etc. Some thoughts & contributions on this issue would be appreciated. tl;dr - how can you securely write a web app to update/create entries in a config file like apache's httpd.conf, etc.

    Read the article

  • MVC Serve audio files while preventing direct linking using HttpResponseBase

    - by VinceGeek
    I need to be able to serve audio files to an mvc app while preventing direct access. Ideally the page would render with a player control so the user can start/stop the audio linked to the database record (audio files are in a folder not the db). I have a controller action like this: Response.Clear(); Response.ContentType = "audio/wav"; Response.TransmitFile(audioFilename); Response.End(); return Response; and the view uses the RenderAction method <% Html.RenderAction("ServeAudioFile"); %> this works but it won't display inline on the existing view, it opens a new page with just the media control. Am I totally barking up the wrong tree or is there a way to embed the response in the existing view? works exactly as I would like but I can't control access to the file.

    Read the article

  • What is an alternative to ADO.NET, but elegant way in C# to read Excel files

    - by Khnle
    ADO.NET just fails miserably when it's used to read Excel files where a column contains mixed data types. It appears that it tries to determine the data type of a column, and then assume the rest of the entire column is of the same data type. Here are some backgrounds: http://stackoverflow.com/questions/2968111/how-to-prevent-ado-net-from-altering-double-values-when-it-reads-from-excel-files http://blog.lab49.com/archives/196 What is an alternative approach that doesn't require automation, Excel to be co-installed, is simple (since the input excel file will only have one worksheet in each file).

    Read the article

  • jquery load a specific #Div content from multiple html files

    - by Vikram
    Hello friends I am trying to make a Content Slider for my site. I have multiple HTML files and the structure of these files is like this: <div id="title"><h2>Title of the Slide</h2></div> <div id="image"><a href="http://mylink.com"><img src="image.jpg" width="600" height="300" alt="image"</a></div> <div id="content">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</div> I have been trying to use the following script get content (but no success): <?php function render($position="") { ob_start(); foreach(glob("/slides/*.html") as $fileName) { $fname = basename( $fileName ); $curArr = file($fname); $slides[$fname ]['title'] = $curArr[0]; $slides[$fname ]['image'] = $curArr[1]; $slides[$fname ]['content'] = $curArr[2]; foreach($slides as $key => $value){ ?> <div id="slide-title"> <?php echo $value['title'] ?> </div> <div id="slide-content"> <?php echo $value['image'] ?> </div> <div id="slide-image"> <?php echo $value['content'] ?> </div> <?php }} ?> <?php return ob_get_clean(); } But then I came to know about a jQuery function.... (again no success) jQuery.noConflict(); (function($){ $(document).ready(function () { $('#slide-title').load('slides/slide1.html #title'); $('#slide-content').load('slides/slide1.html #content'); $('#slide-image').load('slides/slide1.html #image'); }); })(jQuery); Now My questions are..... Am I using the right syntax. How do I get the content from multiple files using jQuery. Please Note : My knowledge on Programming is almost '0'. I have just started learning it.

    Read the article

  • Auto-deployment of subversion files in apache server

    - by KeyStroke
    Hi, We're a small team and we're running subversion and apache on the same server. We're currently facing a small problem: everyone saves their edits of our web application directly to the server, which means countless errors when we all work on the same class. Now we're trying to solve this by letting the server use the files in subversion only, so that everyone can freely edit their files without breaking the application. Any idea how I can do that? by the way, we're running Apache on a Windows machine.

    Read the article

< Previous Page | 189 190 191 192 193 194 195 196 197 198 199 200  | Next Page >