How to set DrRacket so that I can draw pictures - racket

I want to practice drawing pictures in DrRacket. I have read online:
first, I copy #lang slideshow in the definition area
then I click RUN
then It should be okay with pictures.
But my result is: after clicking RUN, I get: read-syntax: #lang not enabled
I don't know how to fix this. I use advanced student language.

In the lower, left corner of DrRacket you will need to switch to
"Determine language from source".
The slideshow language is not a teaching language,
so that explains, why you can't run it with your
current language setting.

Related

What is the correct way to show menu / help screens in Emacs?

When using tools like Org-mode and Magit the mode will sometimes show help menus. For instance, org-mode export will show a nice menu that accept single keys and then executes some command. In Magit, when looking at the status view it will accept tabs to expand the staged and commit areas.
These areas, for both Git and Org, are nicely placed to take up some portion of the emacs frame that is mostly convenient. How does emacs do choose this?
Additionally, these views are read-only, up until the user presses tab in the case of Magit and the status view. Is there a best practice when creating these views which control editing, but allows the mode to edit the file and present alternative text?
Perhaps the answer is take a look at these function A, B, and C. Which is fine, I'm just learning and experimenting on my own.
Magit in particular is not the simplest introduction to popup buffers in Emacs, but it certainly is sophisticated and a good read. Find magit-popup.el on your machine, for example M-x find-function RET magit-popup-mode-setup. To me, that function looks like a good candidate to start reading that file. You can see the macro magit-define-popup in use for example in magit-push-popup in the file magit-remote.el
In the end, it boils down to opening a new buffer in a new window and give it a dedicated major mode which has all the key-bindings.
Another good candidate is the family of temp-buffer-* functions.
Hope, that gives some pointers to start reading.
An easy way to show menus/help screens à la Magit and org-mode is with Hydras:
http://wikemacs.org/wiki/Discoverability#Hydra
https://github.com/abo-abo/hydra/
https://github.com/abo-abo/hydra/wiki
It's a short elisp method to write and it will give you a menu like org-mode. For example:
(defhydra hydra-zoom (global-map "<f2>")
"zoom"
("g" text-scale-increase "in")
("l" text-scale-decrease "out"))
ps: it's not what org-mode and magit use. Magit's system wasn't re-usable until recently and I don't know how it compares with Hydra. A nice feature of Hydras is that you can tell it to not disappear after a keypress, so than you can press many keys in a row.

How do you get the helpful tools in DrRacket?

My brother wanted to introduce me to lisp languages, so he showed me DrRacket on his computer. Everything looked awesome, including arrows that point to where a function is being imported from, and a documentation bubble of sorts that tells you the syntax for a function.
I downloaded DrRacket onto my computer, however I don't have either of these. They are definitely not required, but they would make learning much easier.
According to my brother, he "spammed a bunch of Emacs shortcuts by accident, and it just sort of happened."
If anyone could help me, it would be much appreciated.
These features are provided as part of DrRacket's background expansion, which can be enabled or disabled in the "Background Expansion" tab of DrRacket's preferences.
Enabling background expansion causes DrRacket to constantly perform macro-expansion as you edit your program, which will automatically detect syntax errors as a helpful side-effect.
Once background expansion has completed for a program, binding arrows and documentation blueboxes will be enabled (provided you've checked the relevant checkboxes in the background expansion preferences).
In some especially complex programs that employ a large number of macros, background expansion can take a non-trivial amount of time, though it shouldn't take any more than a few moments for all but the most complicated of programs. The current state of background expansion is displayed in the bottom-right corner of DrRacket's editor window.
Once background expansion has completed, the indicator circle will turn green, and all program analysis tools such as arrows, documentation bubbles, and refactoring will become available.
If you don't want to use background expansion for some reason, you can manually trigger the syntax analysis DrRacket provides by pressing the "Check Syntax" button in the DrRacket toolbar.
This enables the binding arrows and documentation bubbles, and it also colorizes the source code using more advanced syntax highlighting that provides some additional information about the way bindings are used (this feature is only provided by Check Syntax, not background expansion).

Marking/commenting Matlab code?

Is there any way to mark Matlab code (in Matlab) via some kind of add-on? I'm looking for something similar to what Microsoft Word has with its "Review" mode where you can highlight a certain phrase/section and make a comment on the side. When I say "comment", I don't mean the regular code comments that you do with "%" in Matab.
I've googled for this, but I couldn't find anything. Anyone know if something like this exists that I may have missed? It would really help me when I'm reading someone else's code and I have to keep track of things / make comments for certain lines. Even if commenting isn't possible, it would be nice to be able to highlight certain lines via some kind of "highlighter" like the one in Word.
No. This isn't possible.
In fact, most editors and IDEs (if not ALL of them) that I know don't even support this feature as each IDE will have to be specific in the way this is implemented (à la Trojanian). The only thing that I can think of is if you print out the code in PDF, then use bubbles within the PDF viewer to tack on your comments.
However, if you want to highlight a specific line in your editor, you'll have to set this up in your settings. Go to preferences, then in the Editor / Debugger options, choose the Display option, then choose Highlight Current Line. Choose whichever colour you see fit. I'm running MATLAB R2013a on Mac OS, and this is the window I get:
You'll see the Highlight Current Line feature. Change that to whichever colour you want. I have it as gray because I do like having the current line highlighted.

What does DrRacket mean by reverse video in the definitions window (after pressing Run)?

I've written a small module in Beginning Student Language. When I click Run, some expressions in the Definitions window are highlighted in reverse video (red text on a black background). I can't figure out which expressions are chosen or what the reverse video means.
According to the colour preferences, it indicates code that the tests didn't cover:

is there any eclipse plugin available for writing a memo on any line of code?

Doe anybody know of an eclipse plugin, which can be used to insert short text (in the form of memo) to remember what that line of code does or a block of code does to help me understand the existing code better and i can also refer it back later on.
Just like "Task" can be added on a line of code, although i can use "tasks" for this purpose, but that is not very convenient and intuitive.
If you want to add a short text to "remember what that line of code does or a block of code does to help me understand the existing code better", use comments. That's what they're for, and practically every formal language in the world has them.
If you want the ability to quickly jump to an arbitrary point in the code, using bookmarks is a convenient option - right click the bar immediately left of the text and choose to add a bookmark. You can then easily jump between bookmarks with the "bookmark view", which you can enable from the Window -> Show View menu.
The closest thing I can think of is bookmark support. There is native bookmark support in Eclipse and also several other vendors supply more function.
I'm assuming that there's a very good reason that you don't want to or can't modify the code.