Deactivate console messages - netbeans

I'm currently working on a project and an I used several print commands in order to see if all is going well.
But all these prints take some execution time and since the program is running well I was wondering if there is a way to comment or delete all of those commands at once.

Generally you can perform a "Replace in Projects...".
Presuming you code in JAVA:
Goto "Edit > Replace in Projects"
Set "Containing Text" to System.out.print
Set "Match" to Literal
Set "Replace with" to //System.out.print
Choose your Scope (Project)
Hit Continue
It is easy as that. Not even a need for Regular expression.
Have Fun.

Related

Codesys ScriptEngine tool/key binding

I have created some scripts in (Iron)Python that help me with the generation of a lot of the boilercode in my project. However, every thime I change something in some part of my project, I have to rerun those scripts. Right now, every thime I have to go to the menu -> Tools -> Scripting -> Execute script File... and navigate to the script in the File Explorer.
However, I go into Tools -> Customize... I can see that there are listings for Script0, Script1 and etc. They are also available in the keyboard shorcut bindings. This suggests to me that there must be a way toadd ToolMenu entries and key shortcuts to run predefined scripts, however all of them have "(unavailable)" written next to them, and I can't figure any way to configure them and make them do something.
Does anybody know how to make use of them?
Follow this instruction:
https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_executing_scripts_toolbar.html
Note:
What you see in "Add commands" under "Scripting Commands" is a alphabetic index list of your script file names. That means if no scripts are active linked in config.json then the count of maximal possible 32 scripts are listed under alphabetic index "S" as "Script0(unavailable)" to "Script31(unavailable)". If linked one script in config.json then is listed under alphabetic index and "Script0(unavailable)" is hidden.

Is it possible to take control of sublimetext3 tabs with cmd

Good Day.
I am a hobby programmer, and am just looking for creative ways to get things done.
In particular, closing a tab or tabs in sublimetext3 through a cmd line method.
The even cooler thing would be, if so, is there a way to decide in cmd which tab to close e.g. 3rd from left/right etc?
In keeping with the idea that this is mostly curiosity and preference than anything else, so creative replies are definitely appreciated as well.
You can execute any command* from the command line, so this is very much possible.
For example, to close the active tab of the most recently used Sublime Text window, you can run subl --command close.
To close a specific tab, for example the 18th tab, which will have index 17 because it is zero-based:
subl --command 'close_by_index {"group": 0, "index": 17}'
(This is assuming bash syntax - for Windows cmd syntax, you may need to do some creative escaping because the command arguments have to be valid JSON and quoted as part of the same argument as the name of the command you want to execute.)
This is exactly the same command that would be run when right-clicking on the tab and picking Close Tab in the context menu. This command can be seen by inspecting Packages/Default/Tab Context.sublime-menu using the built-in View Package File functionality in the Command Palette. You can check this file to see other pre-defined entries like closing all other tabs, or tabs to the right etc.
*: Caveats being if ST is not already running, then it tries to run the command before plugins are loaded.

NppExec in Notepad++ to "Run a Macro Multiple Times..."

I use simple NPP_Exec commands in N++ which work fine for macros. Eg.:
NPP_MENUCOMMAND Macro/Action1
NPP_MENUCOMMAND Encoding/Convert to ANSI
NPP_SAVE
But how can I run a specific macro several times?
I have tried NPP_MENUCOMMAND Macro/Run but then I still have to manually select the macro I need and set it to "Run until the end of line" in the pop-up window.
You can use the NppExec plugin for simple loops like this:
:REPEAT
SCI_SENDMSG SCI_GETCURRENTPOS
set pos1 = $(MSG_RESULT)
// put your Macro invocation here instead of the linedown:
SCI_SENDMSG SCI_LINEDOWN
SCI_SENDMSG SCI_GETCURRENTPOS
set pos2 = $(MSG_RESULT)
// if the linedown (or your macro) doesnot give another pos, we have reached the end
if $(pos1) == $(pos2) goto END
// else loop
goto REPEAT
:END
it stores the current position
then it does something that advances the position (in this example a linedown, you would put your Macro invocation there, make sure it changes the cursor position)
then the position is compared with the stored position; we have reached the end, if the position has not changed;
in this case we leave the loop
I just found a simple and easy solution for that. I did not use command lines but it might work as well:
Make sure the macro ends with a Ctrl-Tab key
From Settings -> Preferences -> MISC, disable the doc switcher.
Open all files to be edited.
Use the "Run macro multiple times" dialog, and enter the number of files you have just opened.
Execute
Save all
I did not create this, found it here:https://sourceforge.net/p/notepad-plus/discussion/331754/thread/469ffec9/ , but it worked like a charm for me. I could edit 400 documents in less than 2 min.
I found another way to achieve this. Inspired by Wagner Fontes's answer, we can do the following:
Step 1: Record your Macro
Step 2 (Important): Before you finish the Macro, type the "Ctrl + Tab" as the last record in the Macro. This hotkey means moving to the next opening text file.
Step 3: Save the Marco.
Because of the Step 2, Notepad will move to the next text file after running the macro once. In this method, "Run a Macro Multiple Times" makes "Multiple Files".

Eclipse - multiline comment with asterisks doesn't work

I'm not able to use ani shortcuts for using comments with asterisk. Every key combination doesn't work. I tried with CTRL+/, CTRL+SHIFT+/, CTRL+C; all of these have the same output, i.e. a simple comment with // on every line. Other shortcuts like CTRL+\, CTRL+SHIFT+\ or CTRL+SHIFT+F doesn't work at all.
So, how can I have this shortcut?
These are the Comments options
Open Window>Preferences>General>Keys>type "add block comment" in the search box, you should see:
the type "remove block comment"
These settings are by default, but if the shortcut is not working on your machine, you must be missing these bindings, To create them, you need to mark the command "Add Block Comment", then click inside the "Binding" field and press CTRL+SHIFT+/, then press Apply. The same is for uncommenting.
I have a similar problem to the one you have: the / shortcut seems to trigger a folding operation (at least in the Java editor) that does not appear in the keys preferences table.
Modifying the key in the keys preferences table seems to work fine: setting the binding to Shift+Ctrl+Q for the "Add Block Comment" command sets the expected block comment.
The reason is clear to me: the Shift+Ctrl+/ binding is very difficult to reproduce in a Linux environment because Eclipse makes a clear difference Numpad_Divide and the '/'. The Normal '/' strike is being modified by the shift key (French keyboard).

How to copy watch expression value in eclipse?

How to copy watch expression value in eclipse? Whenever I use "Copy Expression" from drop down menu it gets me something like this '"System.currentTimeMillis()" (pending)'. Is the pending part should have been the value of system time?
This worked for me:
Select the expression, right click and disable.
Then copy/paste as normal
Then right click and enable
Should get something like this (and you can just delete the disabled tag):
"System.currentTimeMillis()" value (disabled)
Could not find a way to do this directly - but here's a workaround:
Use
System.out.println(YourExpression.foo())
Then you can copy the output from the Console.