read.table cannot open the connection - file

I know this has been asked and answered a million times but nothing I've tried can fix the issue.
I'm trying to read a text file on my desktop using the read.table("Bees.txt") command that returns the error "Warning: cannot open file 'Bees.txt': No such file or directoryError in file(file, "rt") : cannot open the connection".
I've changed the working directory manually (setwd(User/NAME/desktop) and through the session tab (>> set working directory) and even through the wheel by the files tab on the bottom right of the Rstudio screen. I keep getting the same error, regardless of where I move the file or how I change the working directory. I'm on a Mac if that makes a difference. Is there any other way that I could read this data?
I can import it to the R environment to work on but then I can't knit the file as it can't find the object.
Sorry for the vague terminology, I'm new to R.

Related

Windows 10 file size does not update in the file explorer until the file is opened

I am trying to monitor changes to the php error log.
Ideally I would like to monitor the changes using something like the nix tail -f. I attempted this using notepad++ as there is a silent monitor for changes within that editor but this did not work.
A deeper look showed that the file size displayed in file explorer did not change even after errors were generated and the f5 refresh button was pressed.
After opening the log file, the errors were appended to the file as per usual. Still no updates in the file explorer or notepad++.
Only a refresh performed after opening the file in a new instance of notepad updated the values for the size. Still waiting for the update in notepad++. Anybody else had this problem?
Here is how to have Notepad++ update file automatically and display this line:
Preference -> Misc -> File-Status-Auto-Detection -> Scroll to the last line after update
The thing is you have to toggle to another window, then back again for it to work.

theme.res file does not open anymore, codename one themes

Themes.res file is not opening.
What do i do ?
However, the app is working.
The exception that I am getting on the console while opening the file is:
java.lang.NullPointerException
at com.codename1.ui.util.Resources.createImage(Resources.java:936)
at com.codename1.ui.util.EditableResources.createImage(EditableResources.java:2332)
at com.codename1.ui.util.Resources.loadFont(Resources.java:1119)
at com.codename1.ui.util.EditableResources.loadFont(EditableResources.java:1932)
at com.codename1.ui.util.EditableResources.openFileWithXMLSupport(EditableResources.java:426)
at com.codename1.designer.ResourceEditorView$LoadResourceFileAction.exectute(ResourceEditorView.java:4112)
at com.codename1.ui.resource.util.BlockingAction.run(BlockingAction.java:88)
at java.lang.Thread.run(Unknown Source)
Is there any way I can recover this file / data ?
First verify that the file isn't a 0 size file, if it got corrupted to that level you will need to restore from backup. This hasn't happened for us in years as far as I know but its always a risk.
Next make sure you didn't remove/rename any ttf fonts that might be used by the theme, this is a common cause for failures in the designer.
Next we need to see the actual error and to do that we need to run the designer from command line using:
java -jar ~/.codenameone/designer_1.jar
(code for Mac/Linux replace ~ with your home directory and reverse the slashes for Windows).
Now try to open the resource file and see if you get an exception in the console. Assuming you do we will know more about it and might be able to help you recover your data.
We are currently migrating to new XML based format which should become the default soon.

VB.Net Transferring A Windows Form App Onto A USB Stick

I am just wondering how do you transfer a windows form application onto a flash drive because every time I have tried after its transferred I click to open it and an error message displays saying:
"Cannot find the file 'F:\Vending Machine.vb.'
I need to be able to transfer it so when it opens I am able to edit the code and the appearance of the application as I would if I were to just open a new windows form application now.
Thank you
Marcus.
You will need to transfer the entire project/solution to the USB.
Transfering the already compiled .exe should open the latest build of your application. Transferring only a portion of the solution folder and then trying to open the .sln will cause errors on the files you have left out.
Clear your FlashDrive
Copy the entire folder(not the contents) to your flashdrive (C:\Users\Marcus's MPC\Documents\Visual Studio 2010\Projects\Vending Machine)
Attempt to open the .sln
Based on your additional comments it seems you are not moving all of the files the solution needs. If you have files stored in other locations (like My Document) those will need to be reconfigured to work with the solution or you will have to mimic the environment.
I would recommend reconfiguring the project to consolidate any stray files you have.

Fopen returns null unless explored there?

This is a very odd error.
I am using Visual Studio 2012, and in a C++ project (as a container for a C project), I am loading a file in this way:
const char* fname = "SomeFile.csv";
if(!(fp = fopen(fname, "r")))
{
printf("Error! Could not open %s!\n",fname);
return;
}
The CSV is in the same folder as the .EXE, and that is the intention for this program.
1. When I run it in debug, it fails to read the CSV.
2. When I put in the full pathname to the file, it works correctly and loads the CSV.
3. When I go to the output folder in Windows Explorer, and run the .exe, it correctly loads the CSV.
4. Now here is the weird part. When I go to another folder (anywhere else), and I then paste in the full path including the .exe into Windows Explorer, it starts up the program, as it should, but it fails to read the CSV.
As a caveat, if I have the folder loaded in explorer, but run it in the VS2012 debugger, it also fails to load the CSV.
What is going on here? Why would it only find it if I am running it while the window is open in explorer?
fopen, open, etc. will, given a bare filename with no path components, attempt to open the named file in the "current directory". Given a filename without a filesystem root it will attempt to open the file in a directory relative to the current directory. Only when given an absolute (full) path will it look exactly where you've told it.
In a command-line based system, the current directory is pretty obvious - it's the directory you are in when you issue the command.
In a Graphical User Interface the notion of a current directory is a bit more mushy:
Navigate in Windows explorer to the program (let's say WORD.EXE) and double click it - the current directory is likely to be the directory where the program is - the place to which you navigated (but there's no standard that says this has to be the case)
Navigate to your documents for your project and double click a Word document, which launches WORD.EXE automatically - what is the current directory? It's likely to be where the document is.
Launch WORD.EXE from the Start menu - what the heck is the current directory now?
Launch your program from the debugger - now what is the current directory?
This last point is why you have to tell the IDE / debugger what to use as the current directory when it launches your program.
The fileOpenDialog doesn't exactly "default" to the current directory - it open to where you last opened it, without changing the current directory for the program - when you pick a file it then passes the full path of that file to the program.

Cannot delete, a file with that name may already exist

This is starting to vex me. I recently decided to clear out my FTP, and stumbled across an old Wordpress install I forgot I had (oh yes, very security conscious me). Anyway, for some reason deleting the directory failed so I investigated to see what was causing the blockage and I've narrowed it down to a file in wp-content.
Now when I try to delete this file I can get two errors. I've tried in Windowx Explorer (FTP) and the Web Control Panel's File Manager. Here's some error shots:
As you can see my File manager thinks the file is a Symbolic Link. While it scares me that
my web server is host to an obviously religoious artifact I'm also heavily confused by the situation.
I've tried renaming the file.
I've refreshed the FTP view.
I've tried moving the file to another dir (which worked, no success on deletion though).
I've tried editing the file and then deletion.
And I'm at a loss. Is there a special way to delete SymLinks? I've never heard of them, until now.
edit
Oho Windows you really are a magician of sorts. I decided to take a look at my FTP via command prompt and guess what? The file doesn't exist. Whether ftp ignores symlinks I don't know but I'm about to give up :P
First of all, try emailing your webhost either for SSH-access or to remove the symlink for you.
If you get SSH-access, use:
unlink index.php
Or if neither works: Create a PHP file there (for instance remove.php) that contains:
<?php unlink("./index.php") ?>
Then open that file in your browser, afterwards remove the remove.php file.

Resources