I'm new to lisp, working in clisp on cygwin. When I have a problem, I see something like this
*** - SYSTEM::READ-EVAL-PRINT: variable DB.CLISP has no value
The following restarts are available:
USE-VALUE :R1 Input a value to be used instead of DB.CLISP.
STORE-VALUE :R2 Input a new value for DB.CLISP.
ABORT :R3 Abort main loop
Break 1 [4]
And I have a bunch of prompts where the number seems to increment no matter what I do.
Can someone point me to a newbie guide to what this does, and what I can do here? I've found a few things but they are opaque to me. My practice now is just to quit out of clisp.
Did you take look at clisp faq list?
It has a question you are asking: How do I get out of the debugger?, although it links to the wrong section of the manual, what you are looking for is Top Level Loop.
Basically, "abort" reduces the debug level by 1 and "quit" drops you out of all the debuggers.
Related
EDIT: I tried the code lines in the link to other questions that were similar, however the programs did not execute correctly
I am a full-on noob trying to complete some free online resources for self improvement and learning. I am using University of Waterloo's 'Python from scratch' and CS circles course I have tried to answer this question and cannot seem to:
Write a program that asks the user for a string and then prints the string in upper case.
I have tried:
print (str(input()).upper)
AS WELL AS
text = input()
print (text.upper)
AND
print(input().upper())
all programs run, but dont have correct output so I dont know what I am missing here. It's likely obvious and I may feel foolish
I would love to learn and move on, thanks for any assistance!
this is 'Python from scratch' 2.11 problem 'g' (7th problem in set)
You were very close, the following works:
input.upper()
so, print(input.upper())
should work for you.
text=input()
print(text.upper())
print(input().upper())
This should have worked for you in Python 3.x
Could someone please tell me what exactly does printw do? I tried looking for information but just could not find anything.
5 seconds on Google revealed some nice documentation.
printw() class: Print formatted output similar to printf()
and
6.3.1. printw() and mvprintw
These two functions work much like printf(). mvprintw() can be used to move
the cursor to a position and then print. If you want to move the cursor first
and then print using printw() function, use move() first and then use printw()
though I see no point why one should avoid using mvprintw(), you have the
flexibility to manipulate.
Source - NCURSES-Programming-HOWTO
Type man printw (I suppose you are not programming with Windows).
I have a problem here...
I'm using debug (in cmd/ms-dos) to learn some things and to peforme some commands... I set AX to 1234 and DX to ABCD.
So, I did '-a 100' to register a instruction, I did: mov ah,dl
And them "-g" (because I set an interruption) or "-g 102" to peforme the instruction and stop before 102 offset (if I not set the interruption).
When I peform -r to show me the registers values, they remain unchanged, this should be AX:CD34, but AX is 1234 yet, looks like the MOV command doesn't works... what am I doing wrong?
http://img203.imageshack.us/img203/4866/movdxdldoesntworks.png
(sorry for the link, I need reputation to post image)
I also would like to know if exists something like Windows Debug to Linux, I mean, I have nasm and yasm in my Linux installation (Debian-based), but it's just a compiler, I need to write the code into a file, and compile it to run, we have some "emulator" or "debug" tool for ASM in Linux? Like the Debug windows software in the picture above?
The last thing, sorry to make the message so long with 3 questions, but I don't want to "flood" with a lot of topics, so, my last question is where can I find some kind of list of interruptions? I would like to find some list or manual with machine code functions. In Peter Norton's book, for example, when I have "02h" in the "AH" register, I tell to DOS to print one character in the screen, and he said "if you want to find a list of functions, you can look your DOS manual", well, I can't find this dos manual (in linux we can type "man" and we have manuals for everything), the windows "help" function is only a list for simple commands, not a real manual like the unix "man".
I try to find it in google, but every "DOS manual" did I found only show me simple functions like "cd, dir, format, time, blablabla", nothing real technical about the system or something... Can you help-me in find some complete list of "AH" commands and functions?
I know INT 18h is for run Basic and INT 19h restarts the computer (a guy said to me, 18h for him doesn't run basic but restarts the computer instead of INT 19h). I also find 2 or 3 more occurrences in Google, but not a "complete" list, someone have it?
Thanks for the help, patience and attention, I love you! ;)
Please try it again with:
.g=cs:0100 0102
http://www.armory.com/~rstevew/Public/Tutor/Debug/debug-manual.html
.........
RBIL: Ralf Browns x86/MSDOS Interrupt List
http://www.pobox.com/~ralf
http://www.pobox.com/~ralf/files.html
ftp://ftp.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/
Dirk
It is hard to say why it does not work in your debugger.
Did you try to just type this in your program and put breakpoint at the end of it to see the result?
Here is an answer to the question about linux debugger (they recommend GDB):
Linux Assembly Debugger
For the third question here you have a good source of info about interrupts: http://www.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/WWW/files.html
In case link gets outdated search for "Ralf Brown's Interrupt List"
How can you set a string to be used instead of standard input? For example, when running the latex command in Unix it will always find some trivial errors, to skip through all errors you have to enter "r" into the command line (I now know that with latex specifically you can use -interactionmode nonstopmode, but is there a more general solution to do this?)
Is there anyway to specify that this should be done automatically? I tried redirecting standard input to read from a file containing "r\n", but this didn't work.
How can I achieve this?
Not all applications that need input can be satisfied with their stdin redirected.
This is because the app can call the isatty C function (if written in C, or some equivalent call for other languages) to determine if the input come from a tty or not.
In such situation, there is a valuable tool to use, and this is expect.
latex --interaction=MODE
where MODE is one of:
errorstopmode: stop at every error and ask for input
scrollmode: scroll over non-fatal errors, but stop at fatal errors (such as "file not found")
nonstopmode: scroll over non-fatal errors, abort at fatal errors
batchmode: like nonstopmode, but don't show messaes at the terminal
For interactive use, errorstopmode (the default) is fine, for non-interactive use, nonstopmode and batchmode are better.
But beware, there are no trivial errors: all errors must be fixed, and all warnings should be fixed if possible.
Redirecting stdin works without problems here:
/tmp $ tex '\undefined\end' <<< r
This is TeX, Version 3.1415926 (TeX Live 2010)
! Undefined control sequence.
<*> \undefined
\end
? OK, entering \nonstopmode...
(see the transcript file for additional information)
No pages of output.
Transcript written on texput.log.
You've got two plausible answers detailing the way to handle Latex specifically. One comment indicates that you need a more general answer.
Most usually, the tool recommended for the general solution is 'expect'. It arranges for the command to have a pseudo-tty connected for input and output, and the command interacts with the pseudo-tty just as it would your real terminal. You tell 'expect' to send certain strings and expect certain other strings, with conditional code and regular expressions to help you do so.
Expect is built using Tcl/Tk. There are alternative implementations for other languages; Perl has an Expect module, for example.
From the man page:
-interaction mode
Sets the interaction mode. The mode can be either batchmode, nonstopmode, scrollmode, and errorstopmode. The meaning of these modes is the same as that of the corresponding \commands.
Looks like -interaction nonstopmode might help you.
I have implemented a simple linux shell in c. Now, I am adding some features and one I immediately thought about was to be able to show the last commands with the up arrow.
Question 1:
However, I have no idea how to accomplish this. Do you?
Question 2:
Any comment on how to store the "history" commands are also appreciated. I suppose something like a queue which allows access to all elements would be a good idea. Am I wrong? Do I have to implement it or is there already some good implementation out there I should know about?
Thanks.
Build libedit or readline support into your shell.
If you want to be lazy, you can use rlwrap:
rlwrap prog
I wrote the shell for HelenOS. Grab the bzr repo and navigate to uspace/app/bdsh (bdsh stands for the (b)rain (d)ead (sh)ell).
Other contributors have since added line editing / history / tab completion to the functions that handle input. Its written purely in ANSI C, does not link against glibc and implements its own functions. The code (both in the shell and underlying HelenOS libc) is 3 clause BSD, you can use it in anything.
If nothing else, it might help to just examine the implementation to get started.