Gtk+ Error when Copy / Paste performed outside of application - gtk

I'm fairly new to Gtk. I'm working on a GUI application. Everything works great until I press Ctrl + C, Ctrl + V to copy/paste (in an outside application like excel). I am using Windows 8 64bit with a Mingw 32bit compiler. Any help on this issue would be appreciated.

I managed to hit the same assertion error by inducing infinite recursion (my trick was to call paste_clipboard() inside a paste_clipboard signal handler - fun fun!). Possibly you had something that responded to a clipboard change by changing the clipboard?

Related

Why do I have to restart VS Code every time I want to run my code with the latest (saved) changes?

I just started having this problem a few hours ago, and before that I never had this issue.
I am writing a code in Julia using VS Code also using Julia Repl and Revise. Since a few hours every time I make a change in the code I have to restart VS Code to be able to run my recently saved code. Otherwise, if I do not restart the code, terminal just tells that it is finished and the code ran already, which actually did not happen.
Does anyone have an idea how to solve this, or what the problem could be?
Thanks in advance!
I tried to save it different ways, and searched for similar problem online, but did not really find anything useful.
What if you restart the REPL inside the VSCode instead of restarting the whole program?
For this, you can use this key shortcut: Ctrl + J Ctrl + R. Also, you can find it using Ctrl + Shift + P and the search for Restart REPL.
For me, however, this didn't happen unless I wrote the code so it couldn't be mutated after the first run. For example, I can't redefine a composite type in Julia, and I do need to restart the Julia session to do it.

How do I discover Elm's REPL in VS Code?

How do I discover Elm's REPL in VS Code?
Specifically, I have no clue how to get up and running with Elm and VS Code.
My past experience involves using F# and Visual Studio.
How do I send instructions to Elm's REPL?
Where is Elm's REPL located within VS Code's IDE?
Any suggestions?
Once you've installed the Elm package, you can use the Elm: REPL - Start command to start a REPL session.
(You access this command the same way as you access other commands in VS Code: by opening the Command Palette. This can be done through the View menu (View -> Command Palette) or with a keyboard shortcut (Ctrl + Shift + P or Cmd + Shift + P, depending on whether you use Windows or Mac).
Once the session has started, you can send lines or selections to the REPL. Type a line into your editor, then run the Elm: REPL - Send Line command to send it to the REPL. There is a default keyboard shortcut for this (Alt + /) as well.
If you want to send more than a line, highlight the thing you'd like to send (probably a function or value definition), and run the Elm: REPL - Send Selection command. Again, there's a keyboard shortcut: Alt + Enter.
Note that the REPL does not support type annotations; sending type annotations to the REPL will result in an error. You can still annotate your function and value definitions in your code, but when you highlight the definitions to send to the REPL, just make sure not to highlight the type annotations.
If you're just looking to play around in the Elm repl, just do this:
1) install Elm globally (using npm, or using an installer from elm-lang.org)
2) open VS Code, then press CTRL + ` (or Cmd + ` on a Mac); this opens VS Code's built-in terminal
3) type elm-repl -- this starts elm's repl, and you can try out snippets, etc
However since your real question is about getting up and running w/ Elm in VS Code, here's a start:
1) download/install elm-format from https://github.com/avh4/elm-format
2) install VS Code
3) install VS Code extension "elm" (it's by a Sascha Brink); add "elm.formatOnSave": true to your VS Code settings
Now when you create/edit a .elm file you'll get code coloring, etc.
If your Elm code is for an app (as opposed to repl snippets), you'll want to see results in elm-reactor. So start a VS Code terminal (see above), type elm-reactor, and your app should be served at http://localhost:8000
In short; You don't want to use vscode (yet) for Elm development. Either go with Atom (Elmjutsu) or IntelliJ (CE works fine with the elm-plugin).
You get support for refactoring and fast navigation. The reason I don't recommend using vscode is because the elm-plugin is underdeveloped.
Unfortunately, the elm-plugin with IntelliJ also is a little underdeveloped, since it does not underline-highlight errors in your sourcecode – so tracking errors does have a cognitive tax.
I know that this question is related to the elm-repl and the possibility to send your selection to the repl is a nice one. But it only saves you two shortcuts (copy selection, send to repl vs copy selection, alt-tab to repl, paste and enter). The way lines are formatted (in elm-format) renders send-single-line as mostly a not-properly-thougth-through feature.
What I do is open a terminal and open elm-repl there, and I split my screen so I always have the output available.

how to stop matlab from running a script in mac

I know this is a duplicate but none of the answers published already are solving my problem . im using mac and trying to stop matlab runing with cmd + .
or cmd + c . pressing for long time does not help .
any suggestion?
Ctrl + C? Some heavy Matlab calls may be un-interuptable in this way, but mostly this should work.
If you don't care about the intermediate results or the content of your global workspace, you could always kill MATLAB's process.
Next time you'll run a script with huge loops, take the advice of including some function calls that will transfer briefly the control to the user interface: drawnow, getframe etc.
For Octave 4.4.1 GUI, on MacOS 10.14 Mojave, to exit code mid execution I use:
For code that is paused:
option + c
For code stuck in a loop:
control + c
You may need to hold this down for a few seconds

Shortcut to copy text from documentation in Matlab 2013b 64-bit on Windows

I want to copy some text (namely code snippets) from the documentation. Ctrl + C doesn't work. Is there any shortcut to do it?
I use Matlab 2013b 64-bit on Windows 7 x64 SP1.
Ctrl + C doesn't work in Matlab 2013b 64-bit's documentation when certain versions of Internet Explorer, in particular IE11 and sometimes IE10, are installed. A workaround is to use Ctrl + Insert or Shift + Insert instead.
To get Ctrl + C working for Matlab 2013b, you can try downgrading to Internet Explorer 10 (follow steps 1 to 5).
This may not be an exact answer to your question, but if your intention is to copy code snippets from the documentation in order to later be able to paste them into MATLAB for execution, then instead of using Ctrl-C you can use F9, which executes the selected code directly in MATLAB.

Shortcut key to clear console in Eclipse

What is the shortcut key to clear console in Eclipse or how can it be configured?
Any work-arounds to achieve this?
I know this thread is already 3 years old, but if someone is still looking for it, in Indigo the shortcut is Shift - F10 followed by r.
Cheers.
It does not appear to be a way, as there's a bug filled regarding this issue on bugs.eclipse.org.
I found a solution for the wiping the console in an Eclipse IDE. It uses the Robot class. Please see code below and caption for explanation:
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
public void wipeConsole() throws AWTException{
Robot robbie = new Robot();
//shows the Console View
robbie.keyPress(KeyEvent.VK_ALT);
robbie.keyPress(KeyEvent.VK_SHIFT);
robbie.keyPress(KeyEvent.VK_Q);
robbie.keyRelease(KeyEvent.VK_ALT);
robbie.keyPress(KeyEvent.VK_SHIFT);
robbie.keyPress(KeyEvent.VK_Q);
robbie.keyPress(KeyEvent.VK_C);
robbie.keyRelease(KeyEvent.VK_C);
//clears the console
robbie.keyPress(KeyEvent.VK_SHIFT);
robbie.keyPress(KeyEvent.VK_F10);
robbie.keyRelease(KeyEvent.VK_SHIFT);
robbie.keyRelease(KeyEvent.VK_F10);
robbie.keyPress(KeyEvent.VK_R);
robbie.keyRelease(KeyEvent.VK_R);
}
Assuming you haven't changed the default hot key settings in Eclipse and import those java classes, this should work.
This thread is 7 years old now, but I constantly need to clean the console so i can get work done. Thanks to sbanders I made this AutoHotKey script:
#`::
WinGetTitle, Title, ahk_class SWT_Window0
if InStr(Title, "Eclipse") {
WinActivate, ahk_class SWT_Window0
Send +!q
Sleep, 1200
Send c
Send +{F10}r
}
return
What this means is the following.
When the user presses WinKey + Backtic (this can easily be changed to a different hotkey),
If an Eclipse window exists
Activate that window and press CTRL + SHIFT + q (opens navigation context menu)
Wait 1.2 seconds (wait time probably depends on system specs)
Press c (Will focus on console view)
Press SHIFT + F10 + r (Clears console)
End script
It's a very handy script for coders who don't like clicking so I thought I'd share it.
Press Shift + Alt + Q followed by C to set focus to console.
Then press Shift+F10 followed by R to clear it.
When I right-click inside the console window and select 'clear' it clears my console. I'm using Windows 10.
If you press Shift+F10+r that works.