How to exit CoffeeScript REPL? - exit

I was trying to play around the awesome script - CoffeeScript in its REPL mode, but I found really hard to exit from it. I tried "exit", "q", "quit", ctrl + c, but still failed.
I'm using cygwin in Windows XP.
Anyone knows how to exit from it? Thanks!
Grace

If all else fails:
process.exit()

Related

Exit code -1 in terminal but code=1 in output when running "Hello world" in c++ Visual Studio Code

Before I begin I want to address the fact that I am EXTREMELY new to computer sciences and I do not have any background in technology or technical jargon/term words. I'm mainly an artist/writer and trying to find my way into this realm of technology.
I am in a class for learning C++ but my teacher has not helped the entire time, so I thought turning to here would help.
This mess is kind of confusing, at least for me as a newbie, but when I try to imput the Hello World command from my Visual Studio Code program (C++), I get confusing messages about the code not working.
When I first hit run, the popup appears saying "The preLaunchTask 'C/C++:gcc.exe build active file' terminated with exit code -1"
I click show errors and the Problems menu says there is no issues.
I click the output window and it says, per quote
[Running] cd "c:\Users\isabe\OneDrive\Desktop\All game and coding stuff\c++ coding\" && g++ .cpp -o && "c:\Users\isabe\OneDrive\Desktop\All game and coding stuff\c++ coding\"
g++: error: missing filename after '-o'
[Done] exited with code=1 in 0.114 seconds"
In the terminal it looks like a big mess of code looking through my files but at the end it says
undefined reference to 'std::cout'collect2.exe: error: ld returned 1 exit status
Build finished with errors
The terminal process terminated with exit code : -1"
The code was input directly from the book I was told to purchase by my teacher as just a test to check if the compiler was working, no clue what I'm really doing so I'm kind of at a loss.

QT cannot open output file debug\trud1.exe: Permission denied

Using debug I can run my project only one time. After that every time I get error:
cannot open output file debug\trud1.exe: Permission denied error:
ld returned 1 exit status
I close running Qt projects but seems like I can not close this one even via task manager (theres no tasks trud1.exe).
Explorer does not let me delete trud1.exe because it is used by my "System" (i can not kill this process).
Restarting Qt does not help me, only restarting computer does.
Please help me solve my problem.
This happens because you have to close the program you've launched before.
Look it isn't running on background.

C++ on windows closes a program immediately after launching

I installed minGW and the eclipse CDT, and the console keeps doing something weird. The code of the program is
using namespace std;
#include <iostream>
int main() {
cout << "Hello, windows (8, c++)" << endl;
//system("PAUSE");
return 0;
}
You all know it, its the Hello World program. Now when I run this the Eclipse console displays some stuff about building, and then goes blank. And when I navigate to the HelloWorldProgram.exe in the explorer and run it, a windows flashes up and displays "hello world", but then immediately closes. When I do this on Mac OSX there's no problem, and the windows stays up until I decide to close it. Now I know there's a command
system("PAUSE") //I dont know what I need to import to use this. Could you tell me that too?
Which will give me more or less the same effect, but I'd like to know why Windows does it differently from OSX, and what I can do to fix it (bc this annoys the crap out of me).
Looking forward to your replies!
This happens on Windows because this is just the behavior of the Windows console. You'll have to open up the console manually and then running your program through the console you've opened if you don't want the window to close automatically once the program has executed.
You may want to take a look at these:
What is the Best Practice for Combating the Console Closing Issue?
https://superuser.com/questions/186562/how-can-i-keep-the-terminal-open
Don't use system("pause"), it's wrong for a multitude of reasons (read more about it here).
Put cin.get() before return and the window will stay open until you press enter.
If you want to just run your console program, you should open a console, and run it.
Apparently, the OSX version of Eclipse is configured to open a console, and run the program, and not close it. Maybe you can configure the Win version so, too.
You shouldn't meddle with your program to behave differently on another platform, instead wrap it into something that 'adapts' the behaviour.
Probably, you can tell eclipse to use "cmd /c 'yourprogram.exe && pause'", to open a command window and have it execute your program and then pause.
Just add getch(); before return, and add #include <conio.h>.

"Cannot Open a.exe" Error in C++

I'm trying to compile my C++ program, but when I press the "Build" button, it displays the following error message:
c:/gnat/2010/bin/../libexec/gcc/i686-pc-mingw32/4.3.6/ld.exe:
cannot open output file a.exe: Invalid
argument collect2: ld returned 1 exit
status
This is not the first time it has done this. It seems to do this most when I have been editing the same project a lot and building it often, almost as if something has been flooded, or overloaded, or something.
I had fixed it before, I believe, by restarting my PC, but I can't afford to keep restarting my PC every time this occurs.
I thought this was just a one-time problem, but it has continued to happen and so I thought I'd look for more help on this.
I found another SO question that I thought had the same error message/problem as I had. However, when I tried the solutions listed on afore-linked question, nothing helped.
Has anyone else had this issue? Or does anyone know how I can fix this issue (besides restarting my computer every time)?
I am developing in jGrasp also, if that helps any.
EDIT: I just wanted to add that I thought it might be that my previous executable was still running in the background, but even if I close my IDE, it still won't let me delete the executable, because it says it is still running.
I checked my process explorer to see if the a.exe was still running, but there's absolutely nothing in my processes that has to do with jGrasp or a.exe
I guess your executable is still running. It's the only reason I think about... I guess the best is to check on your task manager (process Explorer is your friend ;)).
In Visual Studio Code, go to Settings -> Search for "clear previous" in the search bar and check on the box named "clear previous output". :)
It is happening because your previous output is already running in the background. And VS Code offers a feature to close that on every run.
EDIT: it's nothing to do with collect2.exe.
Do you get any other error text, like for example 'permission denied errors' etc.
http://max.berger.name/howto/cdt/ar01s05.jsp
It is beacause the .exe is still running. If you're on Windows use the command line del -f a.exe and if you're on linux use rm -rf ./a.out
I have the same problem, was worried for hours. I disabled my avg antivirus and it worked.

Program terminates after rc.d script starts it (Arch Linux)

Hey guys,
I have written a program to act as a keyboard backlight controller for my MacBook Pro that runs Arch, just like there is natively in OS X. The program itself works great, but the rc.d script I provide with the Arch program package, doesn't seem to open the program correctly ... or so I think.
The source to the Arch package can be found here (rc.d script and PKGBUILD file). I have added "mbpkbdbacklightctl" to the line with daemons in my /etc/rc.conf.
What happens is, that upon start up, I see that the rc.d script starts the program is started without errors, and the backlight on the keyboard is lit on which means the program is also run properly, but then when gdm starts to log in to gnome, the program seems to already have been terminated. I havent been able to find any errors logged, but the program will turn off the backlight if no keyboard or mouse events are registered in 20 or more seconds and turn it back on when one it registered, and this doesnt happen at the gdm and neither in gnome. Also, when I reach gnome and do a pidof -o %PPID /usr/bin/mbpkbdbacklightctl, it returns nothing indicating that the program has been terminated. When gnome is started, I have to restart the rc.d script to make things run properly.
I cant seem to get a grasp on what happens to the program since it is terminated.
The source to the program can be found here, though, I believe that the error is in the rc.d script and that it might not start the program properly for it to "survive" through gdm start-up.
Any ideas to what can be going on?
Regards,
Chris Buchholz
If you read the source code for mbpkbdbacklightctl.cpp you will see these lines:
95 std::string the_display = ":0.0";
96 Display *x11_display = XOpenDisplay(the_display.c_str());
97 if(x11_display != NULL) {
So it will fail if there is no active X server, this means that you have to start this script after X session starts. So you have to put your script under /etc/X11/xinit/xinitrc.d