Existence of .inputrc breaks paste shortcut - copy-paste

I recently created an .inputrc file in the root directory of my Windows (Vista) user, to override the default history behavior. Today I realized that the 'Insert' key doesn't work for pasting text any more - a tilde character is pasted instead. I found out that this is caused by the .inputrc file being there (an empty file is sufficient). Without the file, insert works just fine.
I tried to restore the insert behavior in the inputrc file, but I don't understand it well enough to make it work. I'm not even sure if I have to override "\e[1~", "\e[2~", or if I have to set some other variable.
Any ideas on how to use both 'Insert' for pasting and .inputrc?

Adding the line
"\e[2~": paste-from-clipboard
to your .inputrc should do it, see How can I copy and paste into Cygwin console windows? You'll probably also need mappings for the Home, End and Delete keys as show under Why don't the Home and End keys work in rxvt and vim?

Related

Erlang : exception error: no match of right hand side value {error,enoent} while reading a text file

I am currenly working on an erlang project and stuck in reading the file. I want to read a text file which is in the /src folder where all the erlang and a text file are in the same structure. Then too, I am not being able to read the file despite of specifying file paths. Any help would be appreciated.
start() ->
{ok,DataList} = file:consult("Calls.txt"),
io:format("** Calls to be made **"),
io:fwrite("~w~n",[DataList]).
The data file stores contents like : {john, [jill,joe,bob]}.
Try add folder name to the path or try set full patch to the file:
1> {ok,DataList} = file:consult("src/Calls.txt").
Notes: the error {error,enoent} mean that the file does not exist or you don't have a rights to read/write current file, for this case need set 777 rights or similar.
If you need to use src/call.txt, then this simply means that your IDE (or you) has created a src folder in which the calls.txt file has been placed. At the same time, the IDE is using a path that only includes the top level folder (i.e., the root folder for the IDE project). So src/call.txt must be used in that case. This isn’t a problem with Erlang, or even the IDE. It’s just the way your project is set up.
You can do either of two things. Move the calls.txt file up one level in the IDE file manager, so that it can be referenced as calls.txt, not src/call.txt. You can also just change the path to “calls.txt” before you run it from the command line.
enoent means "Error: No Entry/Entity". It means the file couldn't be found. When I try your code, it works correctly and outputs
[{john,[jill,joe,bob]}]

'C:\Program' is not recognized error

I set ANT_HOME=C:\Program Files\ant-1.8.0
then try to build local host by Weblogic. But, it gives me the following error:
C:\Program' is not recognized as an internal or external command.
I already tried putting quotes when defining the variable: "ANT_HOME=C:\Program Files\ant-1.8.0". but it is not working either, it shows the following error message:
Files\ant-1.8.0""=="" was unexpected at this time.
I have been stuck here for the past few weeks. Iv'e googled it many times but I still cant resolve the problem.
Edited:
dir c:\pro /x
didn't show the Progra~1 and Progra~2
set "var=content" is a good practice to avoid having unintended trailing spaces, but your error occures when using the value. There you need qoutes (that are not part of your variable content with the above syntax):
set "folder=c:\program Files"
dir %folder%
dir "%folder%"
the first dir will give you "file not found", because it tries to show you the contents of c:\program (which doesn't exist) plus the contents of files (which also doesn't exist). The second dir will show you successfully the contents of "c:\program files"
Even current versions of Windows automatically create a second file name which adheres to the old 8.3 naming scheme which has been there since DOS was invented. This name does not contain a space character which makes it a good candidate to be used in scenarios like that described by you.
Unless this has been explicitly disabled you can show the alternative filenames.
Open a dosbox and enter dir C:\pro* /x. The result will be similar to this:
I ran this on a German Windows 10 Pro but the output will be identical on other versions of Windows.
You can see that for C:\Program Files Windows created an alternative name C:\Progra~1.

Windows 7 - Add Path

I need to add a new path (sumatraPDF) on my PATH variable.
I don't know why it does not work...
I think everything is right but when I try to execute sumatrapdf.exe from CMD it cannot find the program.
This is what I did:
The path is correct, I checked it 1000 times.
The idea is use LaTeX with sublimetext and when I save a .text file sumatra has to open and show to me the result. If I want that I have to add the path of SumatraPDF... but it does not work.
I think you are editing something in the windows registry but that has no effect on the path.
Try this:
How to Add, Remove or Edit Environment variables in Windows 7
the variable of interest is the PATH
also you can type on the command line:
Set PATH=%PATH%;(your new path);
Another method that worked for me on Windows 7 that did not require administrative privileges:
Click on the Start menu, search for "environment," click "Edit environment variables for your account."
In the window that opens, select "PATH" under "User variables for username" and click the "Edit..." button. Add your new path to the end of the existing Path, separated by a semi-colon (%PATH%;C:\Python27;...;C:\NewPath). Click OK on all the windows, open a new CMD window, and test the new variable.
I founded the problem:
Just insert the folder without the executable file.
so Instead of:
C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe
you have to write this:
C:\Program Files (x86)\SumatraPDF\
In answer to the OP:
The PATH environment variable specifies which folders Windows will search in, in order to find such files as executable programs or DLLs. To make your Windows installation find your program, you specify the folder that the program resides in, NOT the program file itself!
So, if you want Windows to look for executables (or other desired files) in the folder:
C:\PHP
because, for example, you want to install PHP manually, and choose that folder into which to install PHP, then you add the entry:
C:\PHP
to your PATH environment variable, NOT an entry such as "C:\PHP\php.exe".
Once you've added the folder entry to your PATH environment variable, Windows will search that folder, and will execute ANY named executable file you specify, if that file happens to reside in that folder, just the same as with all the other existing PATH entries.
Before editing your PATH variable, though, protect yourself against foul ups in advance. Copy the existing value of the PATH variable to a Notepad file, and save it as a backup. If you make a mistake editing PATH, you can simply revert to the previous version with ease if you take this step.
Once you've done that, append your desired path entries to the text (again, I suggest you do this in Notepad so you can see what you're doing - the Windows 7 text box is a pain to read if you have even slight vision impairment), then paste that text into the Windows text box, and click OK.
Your PATH environment variable is a text string, consisting of a list of folder paths, each entry separated by semicolons. An example has already been given by someone else above, such as:
C:\Program Files; C:\Winnt; C:\Winnt\System32
Your exact version may vary depending upon your system.
So, to add "C:\PHP" to the above, you change it to read as follows:
C:\Program Files; C:\Winnt; C:\Winnt\System32; C:\PHP
Then you copy & paste that text into the windows dialogue box, click OK, and you should now have a new PATH variable, ready to roll. If your changes don't take effect immediately, you can always restart the computer.
The path is a list of directories where the command prompt will look for executable files, if it can't find it in the current directory. The OP seems to be trying to add the actual executable, when it just needs to specify the path where the executable is.
Try this in cmd:
cd address_of_sumatrapdf.exe_file && sumatrapdf.exe
Where you should put the address of your .exe file instead of adress_of_sumatrapdf.exe_file.

EpubCheck troubleshooting; declaration errors

I need some extra pairs of more experienced eyes on these declaration warnings:
and this code:
As you can see; despite what the declaration warnings may say, I indeed have declared the file in the OPF. The OPF is in its standard location inside the OEBPS folder. I have spent a good few hours trying to find what is wrong, and I still don't see why epubcheck isn't seeing the declaration.
Things that I've checked:
• The declaration is between the <manifest></manifest> tags.
• The path is correct. (Unless I'm missing something)
• I've tried to make sure that the mimetype file comes first in the zip.
Since I'm very new to creating epubs, I don't know if I'm missing something else entirely, like, there's something wrong with the code before the css declarations. Would you have any suggestions as to what I could check?
It turns out, there was a discrepancy between the spelling of the iexcercises folder and the declared iexercises folder. There was no 'C'.
Also, I found a very helpful comment on a forum site while I was troubleshooting the epub; it describes how to save the epubcheck errors and warnings log into a text file for easier browsing.
Source
Comment by bernieh2...#gmail.com, Nov 6, 2011 || My five cents for
non-techies...
For using epubcheck on a Windows PC, do the following:
(1) Download and unzip the latest epubcheck version wherever you
please on your computer (That is, rename the unzipped folder as you
like and put it on whatever directory you may deem it fit). For the
sake of this explanation, let's rename such unzipped folder as
"my_epubcheck" (w/o the "" characters).
(2) Open any ASCII text editor of your choice (e.g. notepad) and type
the following:
java -jar epubcheck-1.2.jar file.epub> report.txt 2>&1
pause
(3) Save this as an ASCII text file (name it, let's say,
"validate.bat" -- w/o the "" characters) on your my_epubcheck folder.
The only important thing is that the extension MUST be .bat
(4) To check any epub file, do the following:
Copy the file you intend to check to your my_epubcheck folder. Rename it as "file.epub" (w/o the "" characters).
Double-click on the validate.bat icon in your my_epubcheck folder.
A new (system) window will appear on your screen, epubcheck will start working and then pause with the message "press any key to
continue..."
Press any key.
Examine the contents of your my_epubcheck folder. You'll find a file named report.txt.
Double-click on the report.txt icon to see the results of your test.
IMPORTANT: Should you use a different epubcheck version, replace
epubcheck-1.2.jar on the validate.bat file with the exact name of the
.jar file you're using (find the name in your my_epubcheck folder).
Hope this helps,
Bernieh.
Again, I hope this helps someone!

VIM folding for ERB files?

Vim noob here. I have code folding working in most places, via indent mode, but for some reason I cannot get Vim to fold .html.erb files in ruby... even with indents.
Here's the relevant region of my vimrc. Is there something else I need to do to make Vim aware of the erb files? Is it possible to customize my folding per file type?
I'm running all the Janus plugins, so have rails.vim, etc. all installed.
let ruby_fold=1
set foldmethod=indent
set foldcolumn=0
set foldlevel=99
nnoremap <space> za<cr>
It's a difficult question, because there's probably something in your vim configuration that inhibits folding and I, for example, can't reproduce it. But I can suggest a few things you could try.
First of all, check what the values of those settings are in the actual buffer. Meaning, open up an erb file and check if the settings are correct. In order to do that, you can type, for example, set foldmethod, which will echo the current value of foldmethod to the screen. If one of the settings doesn't match the ones in your .vimrc, then that might be the problem.
Also, see if the file really does have the "eruby" filetype. If it's not displayed in your statusline, you could check that with set filetype.
Most importantly, one way of customizing settings per filetype is by creating a file with the filetype's name inside the ~/.vim/ftplugin directory. In your case, you can create the file ~/.vim/ftplugin/eruby.vim and put any filetype-specific settings in it. Setting them with setlocal instead of set will keep them local to the file. If it turns out the settings for erb are off, you can "fix" them by putting the values you want there.

Resources