file-io

How to find and update a matching control once a file exists

你离开我真会死。 提交于 2019-12-25 02:58:40
问题 I have written a WinForm project which displays a ListBox containing a list of file names. When the user clicks a submit button, the application dynamically loads and displays one PictureBox control for each file and then waits while they are processed. As PDF files are generated for each one, the matching PictureBox for that file needs to be updated to display an image. Here's what I have so far: Private Sub ButtonSubmit_Click(sender As System.Object, e As System.EventArgs) Handles

Kivy Does Not Output Plain Text, Only Object Location

不羁的心 提交于 2019-12-25 02:57:28
问题 So I was trying to create a very basic text editor in Kivy. So I had got around the issue of text not showing up (via lambda). However, a new error appeared on the horizon; saving. I want to save automatically to a plain txt file. However, my current code only save an object (is it a pointer?) of the actual text input. Thank you all, SO! import kivy import os kivy.require('1.10.1') # replace with your current kivy version ! from kivy.app import App from kivy.uix.boxlayout import BoxLayout

How to ensure that open command invokes main function in the Java application on Mac

寵の児 提交于 2019-12-25 02:50:08
问题 I have a java application on Mac that was built in Eclipse, and bundled by using a maven plugin named osxappbundle-maven-plugin. After I unpack the dmg file of the application, obtain an App file, and copy it to my hard drive, I invoke this App through a terminal by using the following command: open -a "/Full/Path/To/App/Match Player.app" --args "/Full/Path/To/File/TEST 1.mplx" This opens the application correctly. However, after I execute the following command: open -a "/Full/Path/To/App

How to read from post param?

丶灬走出姿态 提交于 2019-12-25 02:44:11
问题 I need to parse text file. This file is in post param. I have code like this: upload_file('POST', []) -> File = Req:post_param("file"), What should I do next? How to parse it? 回答1: What's inside Req:post_param("file") ? You assume it's a path to a file: have you checked the value of File ? Anyway, it's Req:post_files/0 you are probably looking for: [{_, _FileName, TempLocation, _Size}|_] = Req:post_files(), {ok,Data} = file:read_file(TempLocation), It's also probably a Bad Idea to leave the

Open file from a listbox

a 夏天 提交于 2019-12-25 02:42:38
问题 I'm trying to open files from a listbox , the files could be Word , PDF , Excel , etc. Does there need to be separate code for each file type, or is there some way to just open the file when its double clicked? The listbox populates fine through the use of the update button I have. Public Class frmMain Private Sub ButtonUpdate_Click(sender As Object, e As EventArgs) Handles ButtonUpdate.Click Dim folderInfo As New IO.DirectoryInfo("my directory is here") Dim arrFilesInFolder() As IO.FileInfo

SAS set a variable from a filename

你离开我真会死。 提交于 2019-12-25 02:41:01
问题 I have a number of csv files in a folder. They all have the same structure (3 columns). The SAS code below imports all of them into one dataset. It includes the 3 columns plus their file name. My challenge is that the filename variable includes the directories and drive letter (e.g. 'Z:\DIRECTORYA\DIRECTORYB\file1.csv'). How can I just list the file name and not the path (e.g. file1.csv)? Thank you data WORK.mydata; %let _EFIERR_ = 0; /* set the ERROR detection macro variable */ length FNAME

how to split a file into multiple arrays, display them, and perform calculations on some arrays

给你一囗甜甜゛ 提交于 2019-12-25 02:38:21
问题 I have a question on how to split a file's data into multiple arrays and perform calculations on certain arrays. In my case, I need to read a hurricanes file and print out the name, year, category, pressure and windspeed each in its own array and then find the average of the category, pressure, and windspeed and then find out the number of a specific category, like Category 1: 26. I don't know how to do this. I used in.nextInt() but I assume it would print out all the numbers in the line of

Can't write the last part of a txt file to cout using ifstream

半世苍凉 提交于 2019-12-25 02:31:30
问题 The code below will print all of the text from the sample text file I'm using except for the last little snippet of it. I think this has something to do with the eof or the byte size I'm using not working as I expect. #include <iostream> #include <fstream> using namespace std; int main(int argc, char* argv[]){ int length; char* buffer; //get file stream and open local file. ifstream stream; stream.open("SampleFile.txt", ios::binary); stream.seekg(0, ios::end); length = stream.tellg(); stream

Read integers from txt file and storing into an array

半城伤御伤魂 提交于 2019-12-25 02:22:40
问题 I'm having issues reading and storing only integers from a text file. I'm using a int array so I want to do this without list. I'm getting a input mismatch exception, and I don't know how I should go about correcting that issue. The text files being read from also include strings. public static Integer[] readFileReturnIntegers(String filename) { Integer[] array = new Integer[1000]; int i = 0; //connect to the file File file = new File(filename); Scanner inputFile = null; try { inputFile = new

How read/write into a named pipe in perl?

假如想象 提交于 2019-12-25 02:14:39
问题 I have a script which have their input/output plugged to named pipes. I try to write something to the first named pipe and to read the result from the second named pipe but nothing happen. I used open then open2 then sysopen whithout success : sysopen(FH, "/home/Moses/enfr_kiid5/pipe_CGI_Uniform", O_RDWR); sysopen(FH2, "/home/Moses/enfr_kiid5/pipe_Detoken_CGI", O_RDWR); print FH "test 4242 test 4242" or die "error print"; doesn't made error but didn't work : i can't see trace of the print,