Questions tagged [modifier]

347 questions
5
votes
5 answers

'private static readonly' fields and static/nonstatic constructors

I have three objects : private static readonly Apple a, c; private readonly Orange b; This code is called from my constructor : public SomeClass() { a = new Apple(); b = new Orange(a.getDna()); c = new Apple(b.getDna()); } It gives me…
Hele
  • 1,558
  • 4
  • 23
  • 39
5
votes
5 answers

I need to have a java method that can be accessed from anywhere within my API but cannot be accessed from the application using the API

I am developing a java API. During my development, I keep facing the following issue: I have two classes in two different packages. Class A in package x, and class B in package y. I need the class A to access a method M defined in class B. Hence,…
Traveling Salesman
  • 2,209
  • 11
  • 46
  • 83
4
votes
1 answer

Compose clickable modifier with interactionSource breaks

Updated - see in the bottom of the question. We are trying to add content to a sticky topbar defined from each screen, and the solution works. But our custom modifier clickableWithScaleAnimation breaks when ever we add add a composable method to the…
Morten Holmgaard
  • 7,484
  • 8
  • 63
  • 85
4
votes
0 answers

How to get modifier error message from a ETH smart contract?

I'm working on a web3 project with React and a contract that is deployed on the Rinkeby Testnet. I'm on purpose sending requests that will not succeed to do and confirm however capture the revert messages and show the knowledge within the browser.…
4
votes
4 answers

SwiftUI Conditional .frame View Modifier

I have my code as follows: Rectangle() .fill(Color.red) .frame(width: 60, height: 60, alignment: .center) .cornerRadius(recording ? 5 : 30) So I was wondering if .frame could be conditional just like .cornerRadius is. I am doing that in…
EV3REST
  • 105
  • 8
4
votes
1 answer

How to: Use conditional custom background views for background modifier?

Usually it ist straight forward how to use the ternary oparator for conditional changes in a modifier. But when I'm trying to switch between two custom views for the background modifier I get this error. This ist not the case if you e.g. directly…
4
votes
3 answers

Determine whether modifier key was pressed

I know how to obtain which modifier key was pressed in C# but I don't know how I can actually check if any modifier key was pressed. I need to check it in KeyUp event, is it possible any other way than doing something like if(e.KeyCode !=…
haluzak
  • 1,133
  • 3
  • 17
  • 31
4
votes
1 answer

printf width modifier for special characters

i have a problem with printf width modifier in C example: char a[] = "o", b[] = "l"; printf("%-3s %s", a, b); console output gives me 3 spaces between strings, but when I change "o" to "ó", console shows 2 spaces between. Every time i use…
M.Chelm
  • 61
  • 6
4
votes
2 answers

C# return non-modifiable list

I have a class which contains a List I have a getter on the class that returns this. Is there some thing I can do to ensure the user who calls cannot modify the returned List? (Since it's a reference type - I believe changes to the returned…
Aishwar
  • 9,284
  • 10
  • 59
  • 80
4
votes
1 answer

Template parameter modifier

I have a question related to templates. template void someFunction (A* array, const B& numEl); I want numEl (-->numberOfElements) to be unsigned, but const unsigned won't compile. Number of elements in an array is never a…
BR41N-FCK
  • 766
  • 6
  • 17
4
votes
2 answers

How to set a (UTF8) modifier for RegEx of a RegEx Route in Zend Framework 2?

I'm having troubles with (german) special characters in URIs and want to try to resolve it with a RegEx Route and a PCRE pattern modifier for UTF-8 u. 'router' => array( 'routes' => array( // ... 'city' => array( …
automatix
  • 14,018
  • 26
  • 105
  • 230
4
votes
1 answer

Working with matplotlib key events and modifiers

import matplotlib import matplotlib.pyplot as plt print matplotlib.__version__ print plt.get_backend() def key_event(e): print e.key fig = plt.figure() fig.canvas.mpl_connect('key_press_event', key_event) plt.show() I'm interested in key press…
wim
  • 338,267
  • 99
  • 616
  • 750
4
votes
1 answer

Prevent modifier final in interfaces

you can set within eclipse the code style to use modifier 'final' where possible. Unfortunately this modifier is also set in interfaces. But there it doesn't make sense. Is it possible to prevent setting the modifier 'final' for method parameters in…
Cengiz
  • 5,375
  • 6
  • 52
  • 77
4
votes
1 answer

Does the Ruby rescue statement work with require?

Does the Ruby rescue statement modifier work with require? irb(main):001:0> require 'a' rescue nil LoadError: no such file to load -- a from (irb):1:in `require' from (irb):1 from :0
4
votes
2 answers

Why am I getting an update thread null pointer exception (Android AndEngine)?

I'm new to using AndEngine and am trying to get a sprite to increase in size on touch. It kind of works, but will suddenly get this error sometimes. Any ideas? At this point, I just need enough text so SO will let me post my question. If anyone…
rphello101
  • 1,671
  • 5
  • 31
  • 59