Marking the line(s) that has/have an error in Atom editor - atom-editor

Often it is useful to mark the lines where an error exists, in order to pinpoint [it] easily should you want to edit the code in the future.
How one can do such an action in Atom editor?

If you want to mark lines manually, you can use the built-in Bookmarks package, which provides actions for marking lines, going back to the bookmarked lines, and viewing all available bookmarks:
https://atom.io/packages/bookmarks

Related

Can I filter error messages from certain sources in the Chrome Dev console?

In the Chrome DevTools console, I keep getting error messages from certain places that do not actually affect my application's performance. Is there a way to filter out errors from those sources? (e.g., a YouTube iframe with errors, certain Chrome Extensions, etc.)
Yes, you can. You are able to filter messages from any file source by right-clicking on the file's name and line (something like main.js:15) and selecting Hide messages from *filename*. This will block all messages coming from that file (as is probably self-explanatory given what the button says).
Warning: This will also block messages using console.log() that might harm your debugging process, as well as errors that might come up in the future and be important (which you will now not know about). Use with caution on your own files. It should be harmless with files that aren't yours (again, things like iframes and extensions).
You can reverse the block by going up to the Filter dialog box near the top of the console (to the right of the eye icon) and deleting it. (This will also delete all other filters, so you could just remove one if you needed.) You can also more specifically filter messages using Filter, but for the purposes of the question (blocking messages from a certain file), it does the job the fastest and the best.
For more information, see: https://developers.google.com/web/tools/chrome-devtools/console/reference#filter. This also includes information on the other ways to more specifically filter console messages.
At the top of your console is a filter box. Here you can do
plain text search
regular expression search such as /\d+\s\d+/
attribute, such as url:pagead
negate any of the above with prefix -.
combine (AND) any of the above with space
For example -url:pagead will filter out all messages that have pagead in the url. There are two other attributes context: and source:, but I don't know what they do.
For example, def anon will show only messages that contain both def and anon (not necessarily together).
I have not found any way to OR two expressions (UNION).
see documentation

How to access the script/source history in RStudio?

I would like to access the history of what have been typed in the source panel in RStudio.
I'm interested in the way we learn and type code. Three things I would like to analyse are: i) the way a single person type code, ii) how different persons type code, iii) the way a beginner improve typing.
Grabbing the history of commands is quite satisfying as first attempt in this way but I would like to reach a finer granularity and thus access the successive changes, within a single line in a way.
So, to be clear, I'm neither looking for the history of commands or for a diff between different versions of and .R file.
What I would like to access is really the successive alterations to the source panel that are visible when you recursively press Ctrl+Z. I do not know if there is a more accurate word for what I describe, but again what I'm interested in is how bits of code are added/moved/deleted/corrected/improved in the source panel but not necessary passed to the Console and thus absent from the history of command.
This must be somewhere/somehow saved by RStudio as it is accessible by the later. This may be saved in a quite hidden/private/memory/process/... way and I have a very vague idea of how a GUI works. I do not know it if would be easily accessible, then programmaticaly analyzed, typically if we could save a file from it. Timestamps would be the cherry on top but I would be happy without.
Do you have idea how to access this history?
RStudio's source panel is essentially a view to an Ace Editor. As such you'd need to access the editor session's editSession and use getDocument or getWordRange along with the undo of the editSession's undoManager instance.
I don't think you'll be doing that from within RStudio without hacking on the RStudio code unless the RStudio Addin api is made to pass-thru editor events in the future.
It might be easier to write a session recorder as changes are made rather than try to mess with the undo history. I imagine you could write an Addin that calls a javascript to communicate over the existing RStudio port using the Ace Editor's events (ie. onChange).
As #GegznaV said, RStudio saves code history to a ".RHistory" file. It's in the "Documents" folder on my computer. It's probably the same folder if you're using Windows. If you do not know the location, you can find the file by searching.
It also allows saving RStudio history to a file manually. There is a "Save" button in the History panel. So you can also get a timestamp. You can ask different users to save their code history after they have finished writing code. It may be indirectly useful to your research.

How can I automatically add author and copyright info to newly created ipython notebooks?

I'd like to pre-pend a simple author and copyright clause the beginning of newly created ipython notebooks. Is this possible? If so how can it be done?
We want to support this in metadata at notebook top level, but nobody has taken time to write a proposal for metadata structure, how to edit it, and how to show it.
This would be usefull for view on nbviewer, but also for conversion to LaTeX, and other format. It might just be slightly more complicated that at first thought, as you probably want the Authors to be more that just first name/last name (like a full embeded vcard for example).
If you want to work on that you are welcomed, otherwise in the meantime I suggest adding a simple markdown cell at top with those info.
This should be easy to do on a buch on notebook at once as they are easy parsable json.

Change Word 2013 autocorrect behaviour

This question involves bending Microsoft Word 2013 to one's will.
I have been asked to help fix a problem with Word 2013's autocorrect.
We are working on a spell checker for my native language (Afrikaans), and many Afrikaans words contain a diacritical/umlaut (ë, ö, Ü, etc).
The spell checker consists of a .dic file which is basically just a text file that contains about 508 000 words, and an autocorrect list (.acl) file that is used to automatically replace text as you type.
The spell checker works very well for the most part. It replaces the text as you type, which is the desired effect. The problem is that autocorrect doesn't work with all words.
For example, if I want to type the Afrikaans word 'pêrels' (which means 'pearls'), I should only have to type 'perels' (without the ^ character on the 'e'), and autocorrect should automatically change it to the correct form.
Same with 'reën' (rain). If I type 'reen' (without the umlaut), it is supposed to automatically correct it.
However, in both of the above cases, the words remain unchanged. A red line appears under the words, and when you right-click, you can select the correct word from the pop-up autocorrect menu as shown in the image below.
As you can see, the correct form of the word is the first one in the context menu. I need autocorrect to automatically change the wrong word into the first word that appears in said menu. It should completely ignore the other menu items, and just go with the first word.
My initial instinct was to manually add the words to the *.acl file using a text editor, but the file is encrypted and not readable (I used Notepad++).
I then tried adding them inside Word's autocorrect options menu. However, Word 2013 has a maximum autocorrect memory of 64KB, and the size of the file is already at that maximum. Whenever I add more words, it bombs out and basically wipes the file contents. This doesn't seem like the most efficient strategy anyway, since I would need to manually enter hundreds, if not thousands of autocorrect cases. Ain't nobody got time for that!
What makes this even more complicated (ironically), is that there is no real "program". In other words, this isn't a C# program with source code that I can manipulate. I have the two files mentioned above, and Word's built-in options (which I have already explored). That's it. Nothing else.
I'm stuck. Does anyone have any ideas?
Is it perhaps possible for me to hack Word to increase the autocorrect memory to, let's say, 128 KB? Google hasn't turned up anything of use.
Or, is there a way to set Word to not give the autocorrect context menu, and instead default to the first matching word in the dictionary, as mentioned above?
I can probably write a batch script, C# program, or edit the registry if need be. I just need to know where to start.
Thanks for any help!
In case you are still looking for a solution, you might consider using AutoHotkey (http://www.autohotkey.com). It is a very powerful free open-source utility, and can handle substitutions similar to AutoCorrect. Whenever the built-in program features of Word and others fail to handle my needs, I use AutoHotkey. It has the added benefit of not being tied to any specific program (e.g., Word), so the substitutions can occur anywhere needed. I hope it helps you. I have used and depended on AutoHotkey for years of new Windows versions, new Office versions, and highly recommend having a look. You might even get new ideas about time-saving automation with AutoHotkey. Good luck!

retrieving a line of code after pressing the down-arrow key

If I type a line of R code at the cursor and press 'Enter' I can immediately retrieve that code by pressing the up-arrow key once. However, if I am typing a line of code and accidentally press the down-arrow key once then that line of code disappears and I cannot retrieve it. This is a minor, but ever-present annoyance, most frustrating when typing data into a vector.
Is there a way to retrieve a line of code after accidentally pressing the down-arrow key?
I am using a Windows machine and the R GUI found on my desktop immediately after installation... ...I think one of the questions during installation is whether I want a short-cut on my desktop, and I select 'yes'.
this is completely dependent on the GUI. I believe (but am not certain) that RStudio, for example, preserves what you have typed.
While not a direct solution, what might be helpful is to use edit in an external window. I dont use windows, but I suspect if you hit ctrl+n you will get an editor in which you can then use F5 or ctrl+R to execute that specific line.
Personally, I use Sublime Text 2, and cmd+enter gets my code executed at the console
I found that if I open R and click File then New Script in the R menu an editor will open. I can type a line of R code in that editor. Then I can highlight that line of code and press Ctrl+R, as mentioned in Ricardo Saporta's answer and djhurio's comment. By pressing Ctrl+R that line of R code will execute. The line of R code remains visible in the editor and seems safe from being lost even if I accidentally hit the down-arrow key.
Hopefully this builds on Ricardo Saporta's answer enough to warrant being posted as another answer, although I would not have figured this out without Ricardo's and djhurio's help.
P.S.
In retrospect, I see now this is what Ricardo meant in his second comment beneath his answer.

Resources