In iOS there's an option in Settings > General > Keyboard called '"." Shortcut'. When enabled, "Double tapping the space bar will insert a period followed by a space" and automatically capitalizes the next letter.
Does anyone know how to go abouts creating an AutoHotKey script to do this, as I find it extremely useful in iOS?
Ben,
You could try this:
~$Space:: ; trigger on {Space}
if (A_PriorHotkey <> "~$Space" or A_TimeSincePriorHotkey > 250)
Return
SendInput, {BS 2}.{Space}
Input, NextKey, I L1 T10 V B, {LControl}{RControl}{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{Capslock}{Numlock}{PrintScreen}{Pause}
If NextKey and NextKey is lower
SendInput, {BS}+%NextKey%
Return
Related
I would like to rearrange an equation in a way that certain variables only appear on the left side using wxMaxima.
%i: eq: term1 = term2 ;
%i: fun(eq,[v]);
%o: term3 = term4
Where the allowed symbols for the terms would be something like this:
term1 = all
term2 = all
term3 = only [v] and operators
term4 = all but [v]
[v] = the variable (or list) that I want to be on the left side
I tried to get something done with matchdeclare and defrule but I couldn't even get the b of a=b+c to the left side. I am not even sure if defrule is the correct approach as term 1 and 2 have nothing to do with 3 and 4. Is there a way to solve for lists?
UPDATE:
I came up with "something". It is not yet what I initially wanted, but at least closer.
It is basically a substitution. I can provide a left hand side and the function tries to solve for it. Of course this exact left side might not be possible so that some variables remain on the right side. But one can specify one variable that should be eliminated on the right.
expr: a=b+c*d+e $
left: log(a+b) $
notright: b $
solve_form( expr, left, notright);
results in:
[log(b+a)=log(-e-c*d+2*a)]
Now, if I instead choose log(a-b) for the left side the output is:
[log(a-b)=log(e+c*d)]
which is pretty much what I wanted. Variables a and b are on the left side, but not on the right.
But I have to give an explicit left side. I would love to have a function that would find an arbitrary left side on its own so that neither a nor b are on the right side.
The obvious solution would have been:[a-b=e+c*d]
Function:
solve_form(expr,lterm,substvar) := block(
[z],
lterm: z = lterm,
solve(lterm,substvar),
ev(expr,%%),
solve(%%,z),
ev(%%,lterm)
)$
Alternative function that does not need the notright input.
solveform(expr,zz_term) := block(
[z,zz_term_vars,slist],
zz_term: zz = zz_term,
zz_term_vars: listofvars(rhs(zz_term)),
slist:[],
for i:1 thru length(zz_term_vars) do block(
solve(zz_term,zz_term_vars[i]),
ev(expr,%%),
slist: append(slist,solve(%%,zz))
),
listify(setify(ev(slist,zz_term)))
)$
I think solve, linsolve, algsys, and eliminate have more or less the effect you are looking for.
Chapter 3 of Starting FORTH says,
Now that you've made a block "current", you can list it by simply typing the word L. Unlike LIST, L does not want to be proceeded by a block number; instead it lists the current block.
When I run 180 LIST, I get
Screen 180 not modified
0
...
15
ok
But when I run L, I get an error
:30: Undefined word
>>>L<<<
Backtrace:
$7F0876E99A68 throw
$7F0876EAFDE0 no.extensions
$7F0876E99D28 interpreter-notfound1
What am I doing wrong?
Yes, gForth supports an internal (BLOCK) editor. Start gforth
type: use blocked.fb (a demo page)
type: 1 load
type editor
words will show the editor words,
s b n bx nx qx dl il f y r d i t 'par 'line 'rest c a m ok
type 0 l to list screen 0 which describes the editor,
Screen 0 not modified
0 \\ some comments on this simple editor 29aug95py
1 m marks current position a goes to marked position
2 c moves cursor by n chars t goes to line n and inserts
3 i inserts d deletes marked area
4 r replaces marked area f search and mark
5 il insert a line dl delete a line
6 qx gives a quick index nx gives next index
7 bx gives previous index
8 n goes to next screen b goes to previous screen
9 l goes to screen n v goes to current screen
10 s searches until screen n y yank deleted string
11
12 Syntax and implementation style a la PolyFORTH
13 If you don't like it, write a block editor mode for Emacs!
14
15
ok
Creating your own block file
To create your own new block file myblocks.fb
type: use blocked.fb
type: 1 load
type editor
Then
type use myblocks.fb
1 load will show BLOCK #1 (lines 0 till 15. 16 Lines of 64 characters each)
1 t will highlight line 1
Type i this is text to [i]nsert into line 1
After the current BLOCK is edited type flush in order to write BLOCK #1 to the file myblocks.fb
For more information see, gForth Blocks
It turns out these are "Editor Commands" the book says,
For Those Whose EDITOR Doesn't Follow These Rules
The FORTH-79 Standard does not specify editor commands. Your system may use a different editor; if so, check your systems documentation
I don't believe gforth supports an internal editor at all. So L, T, I, P, F, E, D, R are all presumably unsupported.
gforth is well integrated with emacs. In my xemacs here, by default any file called *.fs is considered FORTH source. "C-h m", as usual, gives the available commands.
No, GNU Forth doesn't have an internal editor; I use Vim :)
Background
I asked this question:
how do I convert DAQ-derived mxd file format to csv?
The answer was good and relevant then, but now I have upwards near a thousand files to process. The last thing I can do is manually process them one at a time. In their compressed form they are a good number of GB. There seem to be ~100k rows per file.
When I try to load them, it get this:
The files do not have sequential filenames like "1.mxd", "2.mxd", etc. This means the code is going to have to look into the subdirectory, get a filename, pass it to the converter, and go from there.
Question:
How do I convert this to an accessible format?
Thoughts:
I was thinking about a windows scripting tool like autohotkey or autoit. Is there a reason those wouldn't work? It might take a few hours to get it running right, but it isn't going to be taking person weeks of click-click-click.
I like R, MatLab, JMP, and Excel, so anything that speaks an output format that any of those like could work. R is likely to be the most format agnostic of the bunch.
So I used "Autohotkey" (aka AHK) and "R". I could have gone AHK-only, but R just made it faster. I passed the filename to AHK. AHK ran mouse and keyboard to operate the MW100 Viewer to open the file, export it, and close it. This was done for each file needed.
I would open the viewer, maximize it on one monitor, manually open a file in the proper directory so that the local directory was set, then go to R and tell it to read the file names, and feed them one at a time, in 25 second intervals, to the AHK program.
It ran overnight and I was able to access the CSV data in the morning.
Modified code follows. Where it says "xx" or "yy" you should put the proper x and y coords for the GUI.
There is no implied anything, this is how I kludged together what I need to in order to do the job. You can notice the "Escape::", so if you need to kill something just hit the Escape button.
;this means when I double-click it reloads, not pops up another instance
#SingleInstance force
; "^j::" means control-j and it starts the script
;^j::
Loop, %0%
{
;input parameter is %param%
myfile := %A_Index%
; make "Data Viewer" active
WinActivate, Data Viewer
;click to open a file
Click, left, xx, yy
;wait one second
; wait up to 3 seconds for "Data Viewer" to become active
WinWait, Open, , 3
;click area where we type name of file
click left, 117, 230
;send filename
Send %myfile% {Enter}
; wait until "Information" becomes active
WinWait, Information, , 1
;Click "no" on import related files
click left, xx, yy
; it imports, this waits while importing
Sleep, 2000
WinActivate, Data Viewer
;Click the menu "convert"
click left, xx, yy
;Wait half a second
Sleep, 500
;Click the "to ascii" item
click left, xx, yy
; make "Information" active
WinWait, ASCII Conversion Details, , 1
;click okay
click left, xx, yy
;wait 8 seconds
Sleep, 14000
;click file menu
click left, xx, yy
; wait half a second
Sleep, 100
;select close sub-item
click left, xx, yy
}
;Return
Escape::
ExitApp
Return
Find in Files (all files in project, no regexp): "Integer("
("" are not part of the search term) with 'Whole words only' checked
returns these 6 lines:
PlanRoutines.BekijkRefplan( Integer( Items.Objects[ ItemIndex ] ));
PlanRoutines.BekijkRefplan( Integer( Items.Objects[ ItemIndex ] ));
Result := Integer( ComboBoxStatus.Properties.Items.Objects[ ComboBoxStatus.ItemIndex ] );
LNieuweStatus := Integer( ComboBoxNieuweStatus.Properties.Items.Objects[ ComboBoxNieuweStatus.ItemIndex ] );
LVanafStatus := Integer( ComboBoxVanafStatus.Properties.Items.Objects[ ComboBoxVanafStatus.ItemIndex ] );
LTotStatus := Integer( ComboBoxNieuweStatus.Properties.Items.Objects[ ComboBoxTotStatus.ItemIndex ] );
How come?
I would expect this first search to find no results (I accidentally had WWO checked when this happened)
With WWO unchecked, searching for " Integer(" (note the extra space in front) Delphi finds approx 100 lines including those 6 mentioned above.
Even the search dialog itself has weird behaviour:
If I copy or type "Integer(" into the search edit, then insert a space in front, the cursor jumps to the end of "Integer(".
This does not happen if I type another character in front of "Integer(", or if I type a space in front of e.g. "string", "string(" or "String("
Can anyone confirm? What is my Delphi XE2 Update 4 Hotfix 1 (16.0.4504.48759) doing (Win7 64bit)?
It's not a big deal, just curious.
(That initial search result is wrong, but I would not intentially do that search. WWO was still checked from a previous search).
Additional examples that surprise me: with WWO on, search "TMyEventHandlers." -> 0 results, search ":= true" -> 0 results, search "true)" -> plenty results, search "(Sender:" -> 0 results. I do not understand how Delphi behaves here. The only thing I can can conclude right now is 'Better make sure to only have chars/digits' in the search string when checking WWO.
then insert a space in front, the cursor jumps to the end of "Integer("
cannot confirm. Works like a charm.
win7 x64 / XE2 u4hf1 / Ide FixPack 5.0 / VersionCopntrol-Plus SVN
I would expect this first search to find no results
Basically that has little practical sense. Why search to find zero results ? to test IDE ?
To me i formulate WWO behaviour rather simple - both left and right from pattern there whould be distinct separate terms. And within brackets - there are those.
My keyboard's layout(2nd row):
`1...0-=Backspace
I want to map function calls to Ctrl+ 0, -, =.
This is the function I created:
" it doesn't work
nnoremap <C-=> :call IncFontSize(+1)<CR>
" it works
nnoremap <C--> :call IncFontSize(-1)<CR>
" it doesn't work
nnoremap <C-0> :call IncFontSize(0)<CR>
fun! IncFontSize(inc)
if !exists('+guifont')
return
endif
let s:defaultfont = 'Ubuntu Mono 12'
if a:inc==0 || empty(&guifont)
let &guifont = s:defaultfont
return
endif
let &guifont = substitute(&guifont, '\d\+$', '\=submatch(0)+'.a:inc, '')
endfun
How can I map function calls to these keys?
Notice how in command-line mode, Ctrl-_ results in ^_, but Ctrl-0 and Ctrl-= yield nothing.
Due to the way that the keyboard input is handled internally, differentiating this as well as many other key combinations (like Ctrl+Letter vs. Ctrl+Shift+Letter) unfortunately isn't possible today, even in GVIM. This is a known pain point, and the subject of various discussions on vim_dev and the #vim IRC channel.
Some people (foremost Paul LeoNerd Evans) want to fix that (even for console Vim in terminals that support this), and have floated various proposals, cp. link
But as of today, no patches or volunteers have yet come forward, though many have expressed a desire to have this in a future Vim 8 major release.
http://vim.wikia.com/wiki/Fast_window_resizing_with_plus/minus_keys
just only + and - …… no alias name
:nmap + :echo "hello world"<CR>
Is it what you want ?