Using the " | " character - browser

I use a spanish layout keyboard which has some symbols such as | # # use the combination altgr + number. In many cases this is find but I have found certain cases were this doesnt work. I normally get around it by copy pasting the symbol, but it doesnt allow copy paste either. Most recently I have been using auto hot keys to use other combos to faster input certain characters.
However I am working with code academy now and I cant find a way of using |. I have tried different scripts such as
:*:bar::|
#f::
Send |
return
^w::
Send |
return
!o::
Send |
return
The first will be detected, but instead of being substituted for | bar dissapears and no character is seen. Ive tried the others inside my navigator (Chrome) for example in the search bar and they work, but have no effect in the codecadamy input.
Any way I can get aroung it?

Try doing this instead:
#f::
Send, {Asc 124}
return
I use a spanish keyboard too. c:

Update to the latest version of AutoHotkey_L and make sure you install the Unicode version. Your code is completely valid and all your 4 approaches would work.

Related

Syntax Err GET on an Apple II, AppleDOS 3.3 using Applesoft

I am using the AppleWin emulator, setup as an Apple IIe, Apple DOS 3.3 with Applesoft. My goal is to make a simple game.
This simple GET program works fine at the ] prompt (I am not sure, but I think it's called the monitor).
10 GET V$
20 PRINT V$
It prints the pressed key as expected
Then I start Applesoft using LOAD APPLESOFT. I tried writing the same simple program than at the ] prompt. But this time when I type the first line 10 GET V$ I get as output *** SYNTAX ERR.
I think it's not a supported feature, but in the ApplesoftII Basic Programming Reference Manual they list get a reserved keyword.
I could update to a higher version of Applesoft, then which version of Applebasic would support it?
I can also use another method of getting a key press without the user needing to press enter afterwards.
Applesoft on the Apple ][e (the first apple version to support lower-case at all) is case sensitive, and all the keywords are UPPERCASE only -- so get will not match the keyword (or anything) and will give you a syntax error.
Of course, if you're emulating an original Apple ][, there's no lower case at all, and lower case letters show up as flashing uppercase -- and still won't match a keyword.
After continuing to research my issue, I have found the location of memory for the keyboard buffer.
The keyboard buffer is -16384 and the way to reset that value of that address is to access -16368.
If the value in -16384 is larger than 128 then a key has been pressed.
So, I can use PEEK -16384 to read the value. To get an ASCII code you need to subtract 128 to that value.
Example code:
KEY= PEEK(-16384)
IF KEY>=128 THEN PRINT KEY-128
To tell the system you dealt with the key press and reset the value, you need to access the value in -16368. By using PEEK or POKE.
Example code:
POKE -16368,0
Or can also be PEEKed
PRINT PEEK -16368
if the error you are getting is *** SYNTAX ERR and not "?SYNTAX ERROR" then you are using integer basic and not applesoft basic. Try to switch to applesoft basic first by using FP

Python script in Colab keeps throwing error message: IndentationError: unindent does not match any outer indentation level

I'm currently using Google Colab in order to take advantage of its free GPU. I was trying to modify a code that I copy and pasted from machinelearningmaster.com. However, whenever I try to add a new code line, for example "print("some words"), I get an indention error.
I have tried adding tabs or spaces before the print call but I still get the error. for example:
space,space,print("some words")
tab, tab ,print("some words")
I have also checked the colab editor settings, currently the indention width setting are set to two spaces.
The first three lines are part of the original code, the print statement is
my addition. I copy and pasted this directly from the colab editor. In Colab all four lines are aligned. As you can see here only the first three lines are aligned. I don't know what's going on.
img_path = images_dir + filename
ann_path = annotations_dir + image_id + '.xml'
count=count+1
print("this is count: ", count)
I expected this to print the value of count, instead I get an error message telling me:
IndentationError: unindent does not match any outer indentation level
Okay, after much searching and frustration, I have an idea of what went wrong, but even better, a solution to fix it.
It appears that the Google Collaborator (Colab) editor does not have a way to set it for tabs "\t" versus space (space-bar entries). From the settings tab on the cell you can set the width of the tab from 2 to 4, but these will be interpreted as 2 to 4 space-bar entries. Usually, this isn't a problem. However, if you're like me and you want to test out code from the web, or be lazy and just copy paste from your editor, problems can arise.
Here's how I fixed it. Before pasting the copied code into Colab, first put it into notepad++. Go to View> Show Symbols >Show All Characters, click on this, you should now be able so see all the characters in the code. Find a tab, it will look like an arrow pointing to the right -->, right click and copy it. Open Search> Find, open the Replace tab. Depending on your version of notepad++ the tab you copied will automatically be entered and the replace will already be set to four spaces. Hit "Replace all". This will automatically replace all tabs with equivalent spaces. Copy the code from notepad++ back to Colab. Now there will be no more conflicts.
I think using a simple find and replace tool will just work fine. I also came across this error recently in Colab and I went through #Rice Man solution. The only difference was I used Libre office writer instead of Notepad++. I also found this tool to be helpful. I am not proficient in using Colab but this solution worked for me.
Another quick fix that worked for me related to this question.
I was trying to run a python script in colab and faced this error though the line seems at an appropriate indentation in that script.
I checked with the !cat filename.py cmd, and found out that the actual indentation appears different than it is in the script (hence the error).
Taking that unindented line (according to the colab) at the start of the line and using space afterward fixed the error.
I used this website to fix the error.
Copy your code to the site, then click beautify button on top left. This will remove indention errors.
If you want to know where the indention error is coming from, use #Prachi answer.

Sublime text multiple cursors?

Sublime Text is so damn advanced and this seems like such a stupid question, but...
I started writing a for loop in PHP (using SFTP), loved that it gave me a choice to auto-generate the loop. However, it enters this weird multi-cursor mode, which
1)I am not really sure how to use/exit without using the mouse;
2) it seems useless, seeing as all 3 type the same thing, even though I need to change, for example, the $i > x or $i = x.
Although Sublime does indeed support the idea of multiple cursors (which is an incredible time saver and useful as all get out, as we're about to see), what you're actually asking about here is a snippet which in this case happens to also include multiple cursors.
The general idea is that for code that you're likely to type many times (e.g. a for loop), you can create a snippet that will generate the bulk of the text for you in one shot, and then allow you to easily customize it as needed. In this case, the snippet in question is part of the default functionality of Sublime and is provided by the shipped PHP package.
To answer point #2 in your question first, this is far from useless. As seen here, I enter the text for and then press Tab to expand the snippet out. The first thing to notice here is that the status line says Field 1 of 4 to tell me that I'm in a snippet and that it contains four fields.
The first field is the name of the control variable for the loop, and all of them are selected so that as I change the name, all of them change at the same time because when there are multiple cursors, the text you type appears at all of them at the same time.
Once I'm done changing the name of the variable, I press Tab again to go to the next field, which allows me to easily change the point at which the loop starts. Another press of Tab takes me to the third field, where I can specify where the loop ends.
One last press of Tab exits the snippet and selects the text in the loop, so I can start writing my code (caveat: I am not a PHP developer).
At this point you can see Sublime offering another snippet for echo, which would expand out to an echo statement complete with quotes, then allow me to edit the text in the echo and skip to the end.
Circling back around to the first point in your question, you can use Esc at any point to jump out of a snippet and go back to regular editing. You can also use Tab or Shift+Tab to move through the fields in the snippet, and pressing Tab at the last field in the snippet exits it as well.
In this particular case, the first field in the snippet sets up multiple cursors, and so exiting the snippet while this field is active leaves multiple cursors in effect. You can jump back to a single cursor by pressing Esc one more time (this is true regardless of how you ended up with multiple cursors).

AutoCAD displays `question mark` instead of tab character when using AutoLISP

Software: AutoCAD 2012 (Japanese language)
System: MS Windows 7 (Japanese language)
I have made a .LSP file which defines a new function "C:MAKEATABLE".
I am trying to print a string which contains a tab character, using AutoLISP. But that character shows up as a question mark (?).
If I manually try to edit it (by double-clicking it, or using DDEDIT, or by TEXTEDIT ) it automatically gets converted to the tab character, which I require.
I don`t know which character encoding is being used (if that is causing a problem).
The font being used is "txt.shx".
Things I have tried:
Used (chr 9) in concatenation with the rest of the string => still shows up as a question mark
tried to print the two parts of string (on either side of the tab) separately => not good, since I need that text as a single object
tried using "DDEDIT" function in the code => It requires the user to press enter at its every invocation, so not good.
I tried simulatinging the enter key using " " , "" , ";" , (terpri). Nothing works, it still prompts the user to select another object.
tried using "TEXTEDIT" function in the code => doesn`t do anything; says that," MAKEATABLE Unknown command "MAKEATABLE". Press F1 for help."
ran the same code on my English language PC and English version of AutoCAD 2012 => same problem if i use any of the .SHX fonts; but works fine if I use the other fonts like "Arial"
I might have missed a thing or two, so please let me know if any other information is required.
Perhaps a different approach:
Isn't your problem that you are trying to create a "SingleLine text" object in AutoCAD. These do not support TABs. You could try to use the "Multline Text" object instead.
Cheers,
Alain

PutS only displaying one character on TI-84 Plus Silver edition

I have recently discovered that my TI-84 plus silver edition can be programmed in hex. I have been messing around with it but have had a few bugs. Whenever I try to make a bcall to PutS it only prints one character and moves on. If I add a second PutS command it puts the second letter down and to the right by one. My current code is:
AsmPrgm
219D9D
EFD9481C
C9
48692100
Necro reply: It seems like you are using one of the new Math Print OSes. Because of the "pretty print" math, TI had to change how strings are printed to the screen. Unfortunately, they broke older functions that as _PutS. One way to get around it is to just put your calc into Classic mode. This disables math print, so printing characters to the homescreen will work as expected.
Go to [Mode],[down] 8 times, [right], [Enter]
It works on my 84+ too. There is nothing wrong with this program.
Possible solutions:
Check if you typed in the hexadecimal correctly.
Perhaps you are using a different OS version that has the bcall at a different location in memory. My os version is 2.43 (no mathprint)
Good luck!

Resources