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.

learn more… | top users | synonyms

0
votes
2answers
7 views

Give function get file extension for you

I have written a function that retrieves the extension from a given file name for you. I would like to make this more efficient and increase it's performance. ...
3
votes
1answer
43 views

JSON Cache Program

I have some code that is intended to be a package (so that it can be accessed via import cachejson). Here is the code for the package: The update variable is ...
0
votes
0answers
22 views

Script to append a new method to a XAML code-behind file

My company is converting a VB.NET project to a C# application and I was tasked with writing a script to automate part of the process. In particular, given information about a control name and event in ...
6
votes
1answer
71 views

Merge sort practice

Never written a merge sort for huge files before. So after this mornings question I though I would give it a go. ...
0
votes
1answer
30 views

PHP Cache weather in a file

I'm using the darksky api to get weather data for a display board website. The free version is limited to 1000 api calls per month. I have a lot of devices (iPads) displaying this information in ...
6
votes
2answers
341 views

Creating index to a file in C

My task was to index a file in C. I'm getting one argument: file name. The index should contain all the words and a line list which appears in. A few notes: Big and small letters are the same. A ...
4
votes
1answer
35 views

Read reference data from external file

This is a function from a program I am working on for my internship, which involves research in computational science. I have some text files with reference data in a directory ...
8
votes
2answers
99 views

Grouping Equivalent Files in Filesystem

The docstring in group_equivalent_files should be self-explanatory for what I'm trying to do. I'm specifically trying to group by equivalent files as opposed to just finding pairs of equivalent files. ...
4
votes
2answers
63 views

generate a file name with format Name(Number).extension

I am writing a program which downloads a file from a URL. Because the name of the downloaded file depends on the url, there is a risk of duplication if the user downloads the same file twice. For ...
3
votes
1answer
38 views

Reading in millions of lines of AOL query logs for query suggestion/expansion

I am working on a query suggestion program, and to faciliate this, I am reading in millions of AOL queries logs. The logs have this format: ...
0
votes
1answer
25 views

Read date from a file and rename two files using the date

Problem I have image files that are RAW data and have the extension .NEF Whatever edits I make to these files are stored in what is called a sidecar file with the ...
-3
votes
1answer
34 views

Finding phrase in specified files v2 c++

Please provide constructive feedback so I can learn from my mistakes. Please tell me what I did right and where I came up with very good solution and where I should improve. Here is the code (Please ...
3
votes
2answers
89 views

C program to handle information of cars and owners

This is a school assignment, it's the longest program I've wrote this far, and I feel it's a bit messy and all over the place. I will try to translate the assignment to the best I can: We have a ...
1
vote
1answer
74 views

C++ Reading Data in a File

I'm not sure if I should ask here. The program worked it's just that I'm not satisfied how I implemented it because I used two while loop to read a specific data and I have no idea what am I doing. ...
4
votes
2answers
149 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 ...
1
vote
1answer
130 views

AES Encryption/Decryption of Files and Bytes

I have gathered some information about aes256 in c# from the internet and put together this code and I would like to know if this is secure or if its lacking in security. Working encrypt/decrypt ...
0
votes
1answer
45 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
112 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 ...
7
votes
2answers
98 views

Finding phrase in specified files

Please provide constructive feedback so I can learn from my mistakes. Please tell me what I did right and where I came up with very good solution and where I should improve. Here is the code (Please ...
4
votes
1answer
121 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 ...
5
votes
4answers
183 views

change space to underscore in filename using C

I have written my first C program that renames spaces in filenames to underscores. I wonder if there is an easier or more efficient way: ...
3
votes
1answer
113 views

Python .WAV generator

The following is a .wav file generator that I wrote briefly while (re)learning about audio sampling: ...
4
votes
2answers
49 views

Read lines from a file in chunks

I created a function to read lines from an file into chunks. My hidden agenda in creation this script was in python the yield function in interaction with chunks. The script works fine, but now i ...
7
votes
2answers
179 views

Read file into char*

Because I use the task so often, I wrote a C header for reading a file. I never formally learned C, so I'd really appreciate a code review on the code. As a matter of personal taste, I do not put a ...
2
votes
1answer
82 views

C program to find and replace a word in a file

This program will perform a find and replace on a single word in a file, with the condition that the new word must have the same length as the old one. It will also display the number of occurrences ...
6
votes
1answer
51 views

Read a file as 4-line chunks

I want to extract the file content into chunks with perl. I have prepared some code snippets which read a file content into chunks. I want to know what is the best way in Perl? Example-File-Content: ...
4
votes
3answers
94 views

Add Number to First Number on Each Line of File then Write to Another File - Python

Python program adds a value to the first number in a fixed width file of variable length. Normally one line header. Before user deletes original file and renames new file they need to check it. How ...
-1
votes
4answers
59 views

Saving the contents of a TextArea to a file

Can this method be modified to be more efficient? ...
3
votes
2answers
63 views

Extracting an IP address from a hosts file by hostname

I am currently working with Vagrant for the first time, and therefore also working with Ruby for the first time. I have a specific hostname and IP address I would like set for my VM, both of which are ...
3
votes
4answers
118 views

Randomly pick a first name from a file

I have a very easy question for you guys out there. It's been a while since I took my programming courses (switched majors) but am trying to get my feet wet again. Objective: I will be creating a ...
7
votes
1answer
77 views

Saving temporary file for plotting audio waveform

I am developing a web application in Flask - Python. My goal is to let the user upload an mp3/wav file. This file will (for the scope of this question) get processed by the server and a picture ...
3
votes
2answers
101 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: ...
5
votes
2answers
393 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 ...
2
votes
3answers
432 views

Loading dictionary words into a trie

I have here a program created for pset5 of the CS50 course. The program compiles correctly and does as it should. However, is there any way to improve the run time of this program? Are there any ...
4
votes
2answers
132 views

Optimize Huffman Compressor in C++

I'm currently writing a Huffman compressor for educational purposes. I want it to compress/decompress files less then 5mb. The time limit is 5 seconds. Now it compresses a 5mb file in almost 8 ...
3
votes
2answers
78 views

C program to write 5 lines to a file then print the lines except the second line

This will read 5 lines into a file from stdin, then print all the lines except the second one. I used an array because I'm not sure how to do dynamic memory allocation. ...
0
votes
1answer
52 views

How I can make file multiple of `segmentSize` [closed]

I multiply the original file and cut a piece of final file with intention to do it a multiple of segmentSize times with minimum loss of data. Example: I have a ...
5
votes
1answer
125 views

Speech Recognition Part 2: Classifying Data

Now that I have generated training data, I need to classify each example with a label to train a TensorFlow neural net (first building a suitable dataset). To streamline the process, I wrote this ...
3
votes
1answer
62 views

2048 clone in libgdx, handling assets, and OOP overkill?

I have created a 2048 clone, I wanted to take on a simple project since I have never actually finished anything. Now I have, though I'm not a hundred percent happy with the result. Images so you know ...
5
votes
1answer
60 views

Removing duplicates from a file containing IP addresses

I have a big txt file containing some specific IP addresses, and all of them appear more than once (the file has around 13 million lines). The file looks like this (the first octet is set to zero for ...
11
votes
2answers
484 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 ...
3
votes
2answers
85 views

Read numeric data from a text file using C++

I need to read Numeric Data from a text file that looks like this: 2 cell X-cord Y-cord 1 1.1 2.2 2 2.1 2.0 The first line indicates the dimension (...
1
vote
1answer
44 views

C program to read data from text file and write it to a binary one

This program will read data in the form of: Number Name In each line of a text file, then it will write it to a binary file and print the resulting binary file. I am getting a warning in line 73, ...
3
votes
1answer
63 views

Writing to rotating log file via channels

I'm an experienced programmer (mostly C#, JavaScript, PHP). Go is quite a paradigm shift and I want to make sure I'm starting on the right foot. This is my first Golang package. It's purpose is to be ...
5
votes
2answers
171 views

Validating a CSV list of contacts and convert it to JSON - Follow Up

This is a follow up to my original post: 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 ...
3
votes
2answers
70 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, ...
2
votes
3answers
92 views
0
votes
1answer
78 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
90 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 ...
10
votes
1answer
135 views

Reading and processing histograms stored in ROOT files

The Context My daily workflow largely consists of producing, styling, and circulating plots from a dataset to my advisor and collaborators. We use the C++ framework ROOT to generate and store ...