Autohotkey / AHK - String as function parameter without " " - autohotkey

Is there any way to define function parameter as string by default, so I could send them without using double quotes?

If you know C++ and want to compile your own version of AHK from the source code, or if you want to make an other script which will insert in the quotes automatically after the fact, then yes. Otherwise no.
And I really don't know why you'd want to do this. Seems terrible in my opinion.
Maybe you're used to legacy AHK? If so, you really should let go of that. Maybe about 10 years ago it was fine to use.

Related

Eclipse Auto-Correct?

Is there a way to have Eclipse auto-correct certain misspellings? For example, I tend to type "System" as "Sysetm", and Eclipse catches it. However, it only tells me it's an invalid package, and I have to manually correct it. I'm hoping there's a way like in Microsoft Word, where you can add words to be auto-corrected.
Trust me you don't want something like that. It would make it almost impossible to write code with it changing what it thinks you want a variable called. Also its use would be very limited.
I have a hard enough time trying to convince word I mean colour and not color.
try to use "alt+/" after input 'sys'

String trigger IRC script

I need a script for IRC client (using KVirc) that will play a sound located somewhere on my hard drive whenever a certain piece of string is mentioned on the main channel. I assume such a thing is possible, but after some time of learning about scripting, I haven't found a way to do this on my own, and would be very grateful to anyone who would either write the piece of code or guide me how to do it myself.
Just a side note, this certain string I have in mind is not an exact string where all the characters are defined, but just first few letters, I assume the $ character is a substitute for all the text after the defined string.
Here it is, I hope I'm not too late xD
Open up KVIrc, hold ALT and press ENTER, it will bring up small console.
In there just copy this:
/event(OnChannelMessage,sounds) { %match_string = "abccc";
%music_file = "C:\\YouTubeMp3\\Selo\ Gori\\CĂ©line\ Dion\ -\ My\ Heart\ Will\ Go\ On-WNIPqafd4As.flv";
if($str.match(%match_string*,$3)) snd.play %music_file;
}
Of course, you should change %match_string and %music_file path, if you have spaces in path just escape them with backslash (), just like I did it.
If you have any questions or you need something else for KVIrc feel free to contact me on Rizon IRC network, nickname is DonVitoCorleone.

Eclipse basic shortcuts - assigning assistant, extract variable

There are some pretty basic tasks and I'm in doubt how it can be effectively done in Eclipse IDE:
Content assisted variable declaration/assignment:
Imagine you have to write something like this DateFormat df = new SimpleDateFormat();. How can it be effectively typed? One guess like DateFormat df = new plus some quick Ctrl+Space, not very, very long SimpleDateFormat. But this does not work, it will show completely useless alphabetically sorted types from classpath, usually unassignable to DateFormat.
Extracting variable:
Is there any way to extract variable like Alt+Shift+L does but WITHOUT the need to manipulate the mouse to select expression or whole line? Just like extract content under cursor? Or is there some way to select line (this work only for standalone expression but better than mouse)?
Extracting field:
Any way to extract field in more convenient way than perform 2. followed by another magic - convert variable to field?
I'm doing mentioned combos every 1-5 minute, and it seems to me like editor completely unusable for serious work. (Iff one is not Ray Manzarek)How are you typing in Eclipse? Note that I prefer default settings, no fine-tuning which stops working after first upgrade or terminal change. Thanks.
For your first problem, here's how I do:
DateF<ctrl-space><Enter> df = new SDF<ctrl-space><Enter>
For your second problem, I simply select the text I want with ctrl-shift-left_or_right_arrow.
For your third problem, no idea. I don't remember having transformed a local variable into a field for a long long time. Maybe I just know beforehand which fields I'll need for a given class.
For the first one, I find I just need to type DateF Alt-\ Enter df = new Sim Alt-\ Enter ;, which doesn't seem too bad to me.
For your second question Shift-Option-Right extends the selection to the right one word at a time, and Shift-Option-Left to the left; that, in combination with the keyboard shortcut you mention, should do what you want (those are Mac keys, of course, but I'm sure there are Windows equivalents; I understand some folks actually develop software on Windows.)
For number three: don't think so. You could write your own plugin to do it pretty easily.

How do I define a Windows file path as a variable?

I am screwing around with a tiny script I am making and one thing I am trying to figure out is how to make a perl variable reflect an executable, for example.
$putty = C:\putty.exe;
When ever I run it like this it tells me "C:\ is not recognizable command, what am I doing wrong? I have also tried surrounding it in quotes and no help by that.
You should be quoting literal strings, for example like
my $putty = 'C:\putty.exe';
If this is news to you, you might have been missing out on the strict pragma before. I highly recommend having a look at that and using it in all of your code.

What is a good method for inventing a command name?

We're struggling to come up with a command name for our all purpose "developer helper" tool, which we are using on our project. It's like a wrapper for our existing tools like cmake and hg. The purpose of the command is really just to make our lives easier by combining multiple commands into one (for example, publishing packages). For example, we have commands like:
do conf
do build
do install
do publish
We've considered a few ambiguous names like do (as above) and run, but obviously, do is a Linux bash command and run is pretty ambiguous.
We'd like our command to be 2 chars short, preferably - but who thinks we're asking the impossible? Is there a practical way to check the availability of command names (other than just typing them into your terminal), or is it just a case of choose one and hope nobody else will use it? Are we worrying about nothing?
Since it's a "developer helper" tool why not use hm [run|build|port|deploy|test], Help Me ...
Give it a verbose name, then let everyone alias it to whatever they want. Make sure you use the verbose name in other scripts so that it removes ambiguity.
This way, each user gets to use whatever makes sense to him/her, and the scripts are more readable and more easily searchable (for example, grepping four "our_cool_tool" will usually yield better results than grepping for "run").
How many 2-character words are useful in this context? I think you need four. With that in mind, here are some suggestions.
omni
torq
fluf
mega
spif
crnk
splt
argh
quat
drul
scud
prun
sqat
zoom
sizl
I have more if you need them.
Pick one: http://en.wikipedia.org/wiki/List_of_all_two-letter_combinations
To check the availability of command names, I suggest looking for all two-letter filenames that are in the directories in your path. You can use a script like this
for item in `echo $PATH | sed 's/:/ /g'` ; do
ls -1d $item/??
done
It won't show builtins in your shell (like "do" as you mentioned) but it's a good start.
Change ?? to ??? for three-letter files, etc.
I'm going to vote for qp (quick package?) since it's easy to pronounce, easy to type, and easy to remember where the keys are on the keyboard.
I use "asd". it's short and most developers type it without thinking
(oh, and you can always claim later that it stands for some "Advanced Script for Developers" if you need to justify yourself a few years from now)
How about fu? As in Kung Fu. It's a special purpose tool. And it's really easy to type.
I think that run is a good name, at least anybody that will download your project will know what to do. Calling it without parameters should reveal your options.
Even 'do' will do, I think you can use backquotes to run it from bash scripts.
Also remember that running the tools without parameters will tell you what options you have.
Use makefiles to do everything for you.
How about calling it something descriptive, like 'build_runner', and then just aliasing it to 'br' (or preferred acronym) in your .bashrc?
There is a really crappy tool called cleartool (part of clearcase), and people will alias it on their machine to "ct". Perhaps you can have a longer command and suggest users alias it.
It would probably be best to do something like ire_and_curses suggested, name it descriptively then alias it to a 2 letter command. If I was choosing, I would name it dev_help and alias it to dh.
I think you're worrying about nothing. Install the program as 'the-command-to-do-evertyhing-and-if-you-dont-make-your-own-alias-for-it-you-should'. I don't think that will be too long for any modern filesystems, but you might need to shorten it to 'tctdeaiydmyoafiys'. See what common aliases are used, and then change the program's name to that. In other words: don't decide, let natural selection decide for you. If you are working with a team of < 10, this should not even remotely cause any problems.
Call it devtool alias to dt
Custom tools like that I like to start with the prefix 'jj-'. I can type (with big index-finger power) 'jj ' and see all my personal commands. Also, they group together in alphabetical lists. 'J' is not a very common character for built-inc commands, but you can pick your own.
Since you want two characters, you can use just 'zz', or something starting with 'z'.
Are you sure you want to put all your functionality in one command? That might be simultaneously over-constraining and over-loading the interface a little.
do conf
do build
do install
do publish