Questions tagged [file]

A block of arbitrary information, or resource for storing information, accessible by the string-based name or path. Files are available to computer programs and are usually based on some kind of persistent storage.

Filter by
Sorted by
Tagged with
10
votes
4answers
450 views

Writing computer generated music to a .wav file in C - follow-up

See the previous and initial iteration. See the next iteration. Now I have refactored the code according to many suggestions made in the first iteration. What's new: I attempted to deal with ...
1
vote
1answer
658 views

Opening a file and printing its contents line by line

Everything that I've read online says that the best way to open a file in python is: ...
4
votes
1answer
114 views

Group duplicate files

Here is my source code which group duplicate files together, written in Python 2.7. Any advice on smarter ideas to group duplicate files together more efficient, it will be great. Any general advice ...
4
votes
1answer
400 views

Copy File, remove spaces in specific lines

This question now has a follow-up question 1 and follow-up question 2 As an exercise in writing decent code and because I learn best by example, I wrote this program and would ask for a review so ...
4
votes
1answer
120 views

An Update on my TileMap Class

I'm making a old-school Final Fantasy type game and I made a tile map class a while back and posted it on here (Is this a good way to implement a tile map from a text file?) But, when I got to ...
3
votes
1answer
89 views

Follow-up 2: Copy File, remove spaces in specific lines

This is an iterative review: The Original Question | Follow up 1 Differences to Follow up 1 This iteration tries to take the previous review to heart and see how it turns out. It sacrifices the ...
3
votes
2answers
148 views

Follow-up 1: Copy File, remove spaces in specific lines

This Question now has a follow-up question After learning a lot about applying OO principles, interfaces and a bit about argument-handling I post a revised version of my previous code. This is still ...
2
votes
0answers
113 views

Counting words in files - follow-up 2

Previous question: Counting words in files - follow-up I have fixed punctuation problems in my previous code by using template, because it is easy to understand and my focus on template mechanism. ...
42
votes
5answers
6k views

Writing computer generated music to a .wav file in C

See the next iteration. I wrote this simple C program for writing computer generated music to a WAV file over three years ago. I refactored it a little, but it does not look good to me. Any ...
10
votes
1answer
278 views

Fuzzy grep for fuzzy bears in pure Python

I am aware of the Python modules galore to do this, but this was partially a learning experience and partially all the functionality I need and no more. I'm writing a simple interpreter for a Forth-...
7
votes
4answers
8k views

Reversing the lines of a file

I am trying to reverse the lines of a file by reading the file through an array. Is there a more efficient and quicker way of achieving this? ...
8
votes
1answer
2k views

Duplicate files finder in C++

I've came across this question https://stackoverflow.com/questions/11760420/what-is-an-optimal-way-to-find-duplicate-files-in-c and there are two answers for it both the answers convey that it is bit ...
6
votes
1answer
1k views

Simple Rust Webserver

I started learning Rust today and for my first project created a simple webserver. I don't have a clear vision about Rust programming and I tried to write it with my previous knowledge in Python and ...
3
votes
1answer
301 views

File parsing and data management

This is part of a two-part post (Part 2). Here, I have two recent projects that parse a file. The first uses a loop that's kind of hard to follow, and the second uses "modes" to decide what to do. ...
2
votes
3answers
114 views

File parsing and data management - follow-up

This is part of a two-part post (Part 1). Here, I have two recent projects that parse a file. The first uses a loop that's kind of hard to follow, and the second uses "modes" to decide what to do. ...
11
votes
2answers
859 views

Speech Recognition Part 1: Generate Training Data

You've all heard of neural nets, no? One of the "hello world"s of neural nets is OCR with the MNIST dataset. My idea for speech recognition is to train the neural net with short labeled spectrograms ...
11
votes
5answers
5k views

Most common words in a text file of about 1.1 million words

I'm learning programming with Python. I’ve written the code below for finding the most common words in a text file that has about 1.1 million words. It is working fine, but I believe there is always ...
8
votes
1answer
390 views

Non-curses pager in C

I have written a pager in C that is supposed to be used in systems where curses is not installed (or broken). It can also be used as a system-wide pager, it works ...
7
votes
2answers
153 views

Cleaning a file / Word Query

In a followup this application was turned into a GUI using FLTK: Cleaning a file / Word Query GUI (FLTK) I did the following two exercises in Programming: Principles and Practice Using C++ (2nd ...
7
votes
2answers
2k views

Project Euler #22 - Name scores

I have written code in C++ 11 and check output with Project Euler site, and it is correct. I am not showing output, just to keep it secret, at least from my end. Please review my C++ 11 code. ...
4
votes
2answers
913 views

Scanning through logs (tail -f fashion) parsing and sending to a remote server

I have a task at hand to build a utility which Scans through a log file. Rolls over if a log file is reset. Scans through each line of the log file. Each line is sent to an executor service and ...
4
votes
0answers
195 views

Text-based Snake game on Window - follow-up

Previous question: Text-based Snake game on Window Summary of improvements: Removed unnecessary functions such as clearScreen() Added new ...
4
votes
2answers
234 views

Uploading multiple files to server with PHP and JavaScript

I wrote some code to upload multiple files to a server with PHP and JavaScript. I'm happy with the form and JavaScript, below. ...
4
votes
2answers
159 views

Writing computer generated music to a wav.file in C - follow-up 2

See the previous iteration. What's new: endianness is now handled more gracefully (only one endianness check, and convertion if need be) and music is more funky. ...
3
votes
2answers
157 views

Validating a CSV list of contacts and convert it to JSON

I've written a class that takes a file, validates the formatting of the lines from an input file and writes the set of valid lines to an output file. Each line of the file should have a first name, ...
14
votes
4answers
2k views

Reading a DHT11 to a file

Disclaimer: not a Pythonista, first actual Python programme written right here. I'm reading a DHT11 sensor from GPIO pin 4 on my Raspberry Pi (thanks Thomas Ward for sending the RPi to me), and I ...
8
votes
2answers
5k views

Python code that compares two files byte by byte

I wrote a Python (2.7) script that compares a file byte by byte. filecmp was not suitable for the application because it compares metadata as well. How can I ...
7
votes
2answers
1k views

Find and rename all png files

I have such problem : find all png files to disk and rename them as I did: ...
7
votes
3answers
177 views

Console based Vocabulary Trainer

This code was reworked and repostet in Console based Vocabulary Trainer Version 2 I wrote a console based Vocabulary Trainer to practice C++. Its possible to add and remove vocabulary and practice ...
6
votes
2answers
4k views

The most efficient way to merge two lists in Java

I am looking for a way to merge two files with a list of distinct words, one word per line. I have to create a new txt file that would contain all the words of the first list and all the words from ...
6
votes
1answer
95 views

Inserting filename, reading data, inserting regex, and testing if each line matches

This program first displays a menu which shows some options that the user can select. Each option will the respective functions which do some things. The user can insert a filename, read data from it,...
6
votes
1answer
109 views

Randomly selecting an adjective and noun, combining them into a message

This is my first Rust program. I have previously written a lot of Python, and some C. I would like some advice on whether I am doing things idiomatically, and any improvements I could make! I also ...
6
votes
1answer
2k views

Speeding up process time while archiving files

I asked this question on Stackoverflow, and was told I might have better luck here. I'm new to c# and have created a basic file archiver. It works, and it does what it's suppose to do, but I think it'...
6
votes
2answers
401 views

Some sort of console “notepad”

This is notepad that works with list of files (pages w/e) that can be edited (list). You can access each file separately and edit/view it too (rewrite, append, read). Here's my implementation of it. I ...
5
votes
3answers
2k views

Is this a good way to implement a tile map from a text file?

I'm working on a small final fantasy type game. I have this for a tile map. I was just wondering if this is a good way to do this or if anyone has any suggestions, I would love to read them. ...
5
votes
2answers
4k views

Efficiently processing large (~100 MB) structured binary data in Python 3

I need to process the data contained in a (relatively) large binary file. The file has the following structure: ...
5
votes
1answer
1k views

Python Hex Viewer

I have created an hex viewer in python, as a timed-challenge by friend. My implementation was in the form of a class, with a separate main file running with argparse...
5
votes
1answer
1k views

Reading a binary file containing periodic samples

I have the following code for reading HTK feature files. The code below is working completely correct (verified it with unit tests and the output of the original HTK toolkit). ...
5
votes
1answer
70 views

Python script to rename images based on descriptions in a text file

I like to collect images for my desktop background, but the problem is sometimes the image names don't represent what the image is. I decided to write a script that reads a text file that contains the ...
5
votes
3answers
1k views

Correcting duplicate names in array

I have an array of file names. For example: string[] files= { "one.zip", "two.txt", "one.zip", "three.txt", "three.txt", "one.zip" }; And I've developed the ...
4
votes
1answer
4k views

Application for encrypting and decrypting files in Java

(See the next iteration.) I have that application for en-/decrypting files. Here, I will post the actual GUI and command line code. In order to run the program refer to this GitHub repository. Some ...
4
votes
1answer
5k views

Making a list from user input

I have wrote a program that lets the user open up their text file that would look something like this: 1 2 3 4 5 6 It would then let the user enter a name for ...
4
votes
1answer
315 views

Application for encrypting and decrypting files in Java - follow-up

(Everything needed for running the app is here.) I have refactored my previous version a bit. App.java: ...
4
votes
1answer
67 views

Unlocking spreadsheet files quickly

I've created a program for my job that unlocks spreadsheet files quickly and efficiently. What we use to have to do before this program is we'd have to go into the system, search for the file, kill ...
4
votes
2answers
5k views

Search word in multiple files

I am writing a brute-force method to search for a word. Please review my code and tell me how I can improve it. ...
3
votes
1answer
92 views

Scanning multiple huge files in Python (follow-up)

I'm trying to implement an algorithm able to search for multiple keys through ten huge files in Python (16 million of rows each one). I've got a sorted file with 62 million of keys, and I'm trying to ...
3
votes
1answer
80 views

Inserting filename, reading data, inserting regex, and testing if each line matches - version 2

This is a improved version of the program seen in my older question. This program first displays a menu which shows some options that the user can select. Each option will the respective functions ...
3
votes
1answer
88 views

Non-curses pager in C (revision 2)

In this revision (follow-up of this post) I've fixed reading from stdin, and also tried to minimise the damage caused by typing additional characters. You might want to see my original post on this. <...
3
votes
2answers
145 views

Correcting duplicate names in generic array - follow up

Follow Up question of : Correcting duplicate names in array I have an array of file names. For example: ...
3
votes
1answer
88 views

Reading all file contents via x64 assembly

I have come up with the following snippet by building upon the answers given to my StackOverflow question. Just trying to get some other eyeballs to review things so that they can point out any ...