Bind a key combination for GNOME overlay - fedora

Using GNOME 42.3.1 (Wayland) on fedora 36, the default key to launch the GNOME activities overlay is Super. I'd like to change that to Super-return.
I installed dconf-editor and used it to change the value at org.gnome.mutter.overlay-key to Super_L|return and to ['<Super>Return'], but these did not have the desired effect. What is the correct syntax for specifying a key combination here?

Related

Failed to launch home screen widget in iOS 14 Simulator

Error Details:
SendProcessControlEvent:toPid: encountered an error: Error
Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show
Widget 'com.anupam.iOS14Feature.widgetExtension' error: Error
Domain=SBAvocadoDebuggingControllerErrorDomain Code=2 "Please specify
the widget kind in the scheme's Environment Variables using the key
'_XCWidgetKind' to be one of: 'BillPayCheckerWidget',
'CommitCheckerWidget'" UserInfo={NSLocalizedDescription=Please specify
the widget kind in the scheme's Environment Variables using the key
'_XCWidgetKind' to be one of: 'BillPayCheckerWidget',
'CommitCheckerWidget'}." UserInfo={NSLocalizedDescription=Failed to
show Widget 'com.anupam.iOS14Feature.widgetExtension' error: Error
Domain=SBAvocadoDebuggingControllerErrorDomain Code=2 "Please specify
the widget kind in the scheme's Environment Variables using the key
'_XCWidgetKind' to be one of: 'BillPayCheckerWidget',
'CommitCheckerWidget'" UserInfo={NSLocalizedDescription=Please specify
the widget kind in the scheme's Environment Variables using the key
'_XCWidgetKind' to be one of: 'BillPayCheckerWidget',
'CommitCheckerWidget'}., NSUnderlyingError=0x7fc70d618350 {Error
Domain=SBAvocadoDebuggingControllerErrorDomain Code=2 "Please specify
the widget kind in the scheme's Environment Variables using the key
'_XCWidgetKind' to be one of: 'BillPayCheckerWidget',
'CommitCheckerWidget'" UserInfo={NSLocalizedDescription=Please specify
the widget kind in the scheme's Environment Variables using the key
'_XCWidgetKind' to be one of: 'BillPayCheckerWidget',
'CommitCheckerWidget'}}} Domain: DTXMessage Code: 1
--
System Information
macOS Version 10.15.6 (Build 19G73) Xcode 12.0 (17200.1)
likely because you changed the kind string inside of your :widget struct. Go to edit your scheme, and in arguments, change the name of _XCWidgetKind to one of your new kind names. Literally just loaded this fix into my simulator as i typed this lol.
If you have multiple widgets, in my case I have two widget.
Static Configuration widget
Intent Configuration widget
And, when you run your widget extension target, you need to specify which widget you want to run.
Product -> Scheme -> Edit scheme
Enable _XCWidgetKind and provide the wiget struct name [in my case "Selectable_OTP_Extn"]
Enable XCWidgetDefaultView & _XCWidgetFamily
I tried other answers but for multiple Widgets (i.e. WidgetBundle) only this answer helped me: https://stackoverflow.com/a/64000716/2095408 (comment other Widgets and leave just 1 Widget uncommented).
If you have many different widgets in your app, you need to tell Xcode which one you are going to debug, you can't debug all of them at the same time, that's what _XCWidgetKind is for, so add the Class name of your widget works.

How to apply keyDown in Sikuli for common key

I need Sikuli to hold a common key f but can't figure out how to do this.
keyDown(Key.F)
keyDown("f")
Doesn't work and tutorials are only about functional keys Ctrs, Shift.
But how to hold a common key?
You can use any key the same way you use functional keys. You can test it by trying the below code while your cursor is located in some text area and you will see that it performs "Select all" (Ctrl+a)
keyDown(Key.CTRL)
keyDown("a")
EDIT
If you want to repeat a key, try something like that:
for i in range(n):
type("a")
where n is the number of times you want to type the letter
The Windows OS, and maybe others, interprets two or three subsequent calls to the same keyDown as holding a key down.
keyDown("f")
keyDown("f")
keyDown("f")
To simulate a SELECT ALL, do this in SikuliX:
type("a", Key.CTRL)
Here is another way (older way):
type("a", KEY_CTRL)
Beware: There is a bug, where, for some computers, the NUM LOCK has to be turned off for the special CTRL commands to work.
Hope this helps!

Octave equivalent of "hold all"

There is a nice command in Matlab called hold all, which causes subsequent plot commands to add to the current plot, using subsequent colours from the current colourmap.
But Octave says:
o.exe:248> hold all
error: hold: invalid hold state
error: called from:
error: C:\Programs\Octave\324_gcc440\share\octave\3.2.4\m\plot\hold.m at line 70, column 2
I've been using hold on, but all the lines a blue and similar, and I'm finding I'm spending too much brainpower trying to figure out which is which, rather than focus on understanding the pattern.
I'm looking for a solution that I can just type in, would rather not modify Octave's code or add scripts, for all the obvious reasons. Automatic colourmap rotation ought to have been the default behaviour, so maybe I'm missing something obvious...?
The option hold all already exists in Octave. The problem is that you're using a very old version of Octave. The current version is 3.6.4.

Use Mysql in dev/prod and H2 in test

Using the play framework 2.1, I'm trying to find the best way to have two different databases configurations:
One to run my application based on mysql
One to test my application based on H2
While it is very easy to do one or the other, I run into the following problems when I try to do both:
I cannot have the same database evolutions because there are some mysql specific commands that do not function with H2 even in mysql mode: this means two sets of evolutions and two separate database names
I'm not certain how to override the main application.conf file by another reserved to test in test mode. What I tried (passing the file name or overriding keys from the command line) seems to be reserved to prod mode.
My question: Can anyone recommend a good way to do both (mysql all the time and only H2 in test) without overly complicating running the application? Google did not help me.
Thanks for your help.
There are a couple of tricks you might find useful.
Firstly, MySQL's /*! */ notation allows you to add code which MySQL will obey, but other DBs will ignore, for example:
create table Users (
id bigint not null auto_increment,
name varchar(40)
) /*! engine=InnoDB */
It's not a silver bullet, but it'll let you paper over some of the differences between MySQL and H2's syntax. It's a MySQL-ism, so it won't help with other databases, but since most other databases aren't as quirky as MySQL, you probably wouldn't need it - we migrated our database from MySQL to PostgreSQL, which doesn't support the /*! */ notation, but PostgreSQL is similar enough to H2 that we didn't need it.
If you want to use a different config for dev and prod, you're probably best off having extra config for prod. The reason for this is that you'll probably start your dev server with play run, and start your prod server with play stage; target/start. target/start can take a -Dconfig.resource parameter. For example, create an extra config file prod.conf for prod that looks like:
include "application.conf"
# Extra config for prod - this will override the dev values in application.conf
db.default.driver=...
db.default.url=...
...
and create a start_prod script that looks like:
#!/bin/sh
# Optional - you might want to do this as part of the build/deploy process instead
#play stage
target/start -Dconfig.resource=prod.conf
In theory, you could do it the other way round, and have application.conf contain the prod conf, and create a dev.conf file, but you'll probably want a script to start prod anyway (you'll probably end up needing extra JVM/memory/GC parameters, or to add it to rc.d, or whatever).
Using different database engines is probably worst possible scenario, as you wrote yourself : differences in some functions, reserved keywords etc. causes that you need to write sometimes custom statements very specific for selected DB engine. Better use two separate databases using the same engine.
Unfortunately I don't know issues with config overriding, so if default ways for overriding configs fails... override id in application.conf - so you'll be able to comment whole block fast...)
Here's how to use in memory database for tests:
public class ApplicationTest extends WithApplication {
#Before
public void setup() {
start(fakeApplication(inMemoryDatabase("default-test"), fakeGlobal()));
}
/// skipped ....
}
inMemoryDatabase() will use H2 driver by default.
You can find more details in source code

CCApplication::getCurrentLanguage() get null on cocos2d-x

I'm working on Linux actually, but I use Mac too.
I'm trying to add multi language support to my game, and I'm going to use different XML with tags.
When I use ccLanguageType _myLanguage = CCApplication::getCurrentLanguage() get null, signal 11 exception.
I have used getCurrentLanguageJNI() too but it did't work.
What's going on?
Try use CCApplication::sharedApplication().getCurrentLanguage();