Binding the enabled bit of a check box - nsuserdefaults

I have a preferences pane built using Cocoa bindings, and many of the options are check boxes. Some of these should only be editable if others are turned on. Here is an example - the indented (selected) box should only be enabled when the one above it is turned on:
To make this work I created two entries in my defaults, one for the value of each check box (the first two):
Testing this worked fine, I could turn the boxes on and off and the values were saved run-to-run as I expected. Ok, finally I want to link the enabled status of the second to the first:
And at that point, the entire system stops working - the preferences pane opens but it's empty. This prints in the output:
2016-02-25 08:46:04.691 SwiftNEC[49564:4153826] Failed to set (contentViewController) user defined inspected property on (NSWindow): Cannot create BOOL from object <_NSControllerObjectProxy: 0x618000003be0> of class _NSControllerObjectProxy
Un-binding this makes everything work again. Now unless I'm mistaken, the enabled value should be a Boolean, and the preferences definitely is a Boolean (as you can see). Can anyone offer an explanation of how to do this?

Related

The value provided to Autocomplete is invalid

I'm using the mui autocomplete component, but I made it to work like a stepper.
Every step, the user is presented with a new set of options.
Because of this, the component complains that none of the options match.
The thing is, I don't want the options to have matches.
There are 3 steps that can repeat over and over again, and the user should be able to select the same option multiple times.
I have it completely working except for this single error. I don't want to use the freeSolo prop, because I want the user to be restricted to the options at the current step.
I set isOptionEqualToValue={() => false}, which displays the select menu how I'd like, but it's still just throwing this warning. Is there a way to just disable this warning?

Azure Dev Ops: How to set a boolean item's default value on a work item template

I have all required permissions to do whatever I want. This is our bug item template. We have a pre-existing Boolean item we've used for years now (To be Triaged - pictured below). It used to be defaulting to false, I want to default to true.
Is the only way / correct way to do this via a custom rule on create? Seems odd. Other text based fields for example allow you to specify required (this is greyed out, presumably because it's a bool?) and subsequently a default. This does not. Seems to require an explicit "rule" be created.
I could not find a way to do this without a custom rule. This rule worked for me:

how do I clear the Plugin svelte: A11y: on:blur error/warning?

In svelte if I setup a <select> control like this:
<select bind:value={selected} on:change="{() => changeTheme()}">
the change event fires correctly and the value is bound but I get a warning in vscode:
(!) Plugin svelte: A11y: on:blur must be used instead of on:change, unless absolutely necessary and it causes no negative consequences for keyboard only or screen reader users.
If I change the binding to on:blur as described, the event only works if you click elsewhere in the page after you make your selection (causing the select control to lose focus). on:click kind of works, but is annoying.
on:change seems correct - how do I clear this warning?
All you need to do is put a comment above the line with your select element.
<!-- svelte-ignore a11y-no-onchange -->
You will need to reload the window to clear the error. https://svelte.dev/docs#Comments if you're ever curious how to disable a warning in VS code it tells you the name of it after the warning, whatever is in the parenthesis goes after svelte-ignore.

Orbeon autocomplete - Not working properly when initially hidden and readonly

I'm using Orbeon version 2017.1 and I have autocomplete control mode = resource which is initially hidden and readonly.
When it becomes visible and not-readonly if I start typing something in the control nothing is suggested.
What I can see in the source is that the result is successfully retrieved into select element fr-autocomplete-select1, but the values are not populated into the list element fr-autocomplete-yui-div and therefore not displayed.
After some debugging, I see that autoComplete.dynamicItemset in autocomplete.js always returns false in this case because the element fr-autocomplete-dynamic-itemset initially doesn't have any value, and afterwards is not reset.

deleting an element in debug mode in eclipse

I'm running my code in debug mode in eclipse and in the middle of it, I want to change the size of a List,say from 9 to 6, by deleting 3 elements.
But I'm not seeing any option to do that, in fact what I'm seeing is the option to change the values present in the elements.
So how can I delete the elements itself from the List ?
Make sure you have the "Variables" tabs on eclipse "Debug" view focused on your current evaluated code.
In "Debug" view, right-click on "Value" cell inside the "Variables" table, and select "Change value".
You will have an option to write a Java expression so you can add something like:
yourList.add("newItem"); or: yourList.remove(0);
Make sure to reload the variable ("F5") once you are done and you will see the updated state.
Note that not every List implementation supports add() or remove() methods.
See this for more details if you encounter an exception.
See also:
Eclipse docs - Variables view
Eclipse docs - Change variable value
I was looking to do something similar. I had an ArrayList containing 1 element, and I wanted to remove it.
I tried #Leet-Falcon's answer, e.g. yourList.remove(0), and Eclipse replied "Unsupported operation exception".
What ended up working was : return new java.util.ArrayList<>();
Looks like the "Debug Shell" view allows this, or additionally if it's a simple enough list, the following simple Change Variable can also work:
new ArrayList<String>(java.util.Arrays.asList("1","2")) // or any other simple list
Modifying Java Collection (List) Variable in Eclipse Debugger