Questions tagged [modifier]

347 questions
2
votes
1 answer

Conditionally apply ? modifier in mapped type per-property

From the TypeScript docs: // Removes 'optional' attributes from a type's properties type Concrete = { [Property in keyof Type]-?: Type[Property]; }; type MaybeUser = { id: string; name?: string; age?: number; }; I know I can add the…
Davide Valdo
  • 779
  • 8
  • 21
2
votes
1 answer

How to export the mesh after modified the Vertices in Three.js?

I tried to export the bent text geometry in the example of https://threejs.org/examples/webgl_modifier_curve.html by OBJExporter.js. But the result text geometry exported was not bent as seen in the scene. The code of "new OBJExporter..." was added…
toowing
  • 23
  • 2
2
votes
3 answers

EnumSet modifiers inside an enum in Java

It makes sense declaring an EnumSet within a enum with the modifiers static and final? Or are redundant? Example: public enum Guitar { STRATOCASTER, LES_PAUL, CLASSIC; private static final EnumSet electrics =…
jpestana
  • 37
  • 6
2
votes
1 answer

How to add/remove modifier to/from a statement?

I am using the TypeScript compiler API to transform TypeScript code, but one thing I haven't quite figured out is adding/removing modifiers in a generic way. The closest I've gotten is this function removeDeclareModifier(s) { let modifiers; …
D. Griesel
  • 61
  • 7
2
votes
1 answer

Mac Catalyst cannot capture .command key modifier with pressesBegan override

I'm developing a remote desktop control application for iOS (and MacOS through Mac Catalyst) that must be able to capture all keyboard input on the device including the Cmd key (equivalent to Super / Start key on non Mac keyboards) when the app is…
iiordanov
  • 21
  • 2
2
votes
2 answers

TS / JS: Overwrite a function and call original function within

I'd like to know if there's a way to modify a function in TypeScript and access the original function within. This is an example of how I got it to work: let obj = { shout: () => { console.log("AHHHHH!"); }, }; let s = obj.shout; obj.shout…
d0n.key
  • 1,318
  • 2
  • 18
  • 39
2
votes
3 answers

How to hide visibility of Kotlin internal class in Java from different modules?

I was working on the Android library which I'm developing in Kotlin. I kept access modifier of some classes as internal. Internal classes are only visible in that library module in Kotlin. If I implement that library in the app then it's not visible…
Shreyas Patil
  • 808
  • 6
  • 17
2
votes
0 answers

Kotlin modifiers or workarounds for in-between visibilities

Not sure what to put in the title for this... so tried to make it as broad as possible Generally with visibility modifiers, we can expose interfaces to the public or keep internal interfaces to the module. I've come across a scenario where a project…
user2951
  • 67
  • 1
  • 6
2
votes
0 answers

CGEventCreateScrollWheelEvent can't work as Zoom in/out as Control key is press

I can use Event Tap/CGEventCreateScrollWheelEvent to send scroll event to HID Tap. But as I keep sending the scroll events and also pressing the control key at the same time, the expected Zoom in/out does not come. Is the HID Event tap too high…
Bill Huang
  • 21
  • 1
2
votes
5 answers

Warning: preg_match() [function.preg-match]: Unknown modifier '('

I have this HTML tags :
Copy me if you can
so I wanna use preg_match to take just "Copy me if you can" I'm using this preg pattern : $preg = "
(.+?)
"; So I wrote this code $match =…
Adam
  • 21
  • 1
  • 2
2
votes
1 answer

What the difference between @Transient annotation and transient modifier

Let's say i have an entity like this. What the difference between field a and b? public class Human implements Serializable{ public transient String a; @Transient public String b; }
Vytsalo
  • 670
  • 3
  • 9
  • 19
2
votes
1 answer

C# Change Method Modifier of nested Class

I want to figure out if this is possible: I have a class class Class { private Person person = new Person(); public void NamePerson() { person.Name = "Peter"; } public Person CPerson { get { …
Nussti
  • 67
  • 6
2
votes
1 answer

Custom Variable Declarations Using Metal With Scene Kit Shader Modifiers

I am having difficulty passing uniforms to Scene Kit's shader modifiers. This seems to work fine when using OpenGL but not when using Metal. I have used SCNProgram successfully before but wanted to take advantage of SceneKit's tessellator instead of…
Eoin Roe
  • 89
  • 6
2
votes
1 answer

How to modify all values in a pandas dataframe with another numpy array

I have the following example of code import pandas as pd df = pd.DataFrame({'a':[1, 2, 3], 'b':[10, 20, 30], 'c':[100, 200, 300], 'd':['q', 'w', 'r']}) Get the values of the dataframe In…
moctarjallo
  • 1,479
  • 1
  • 16
  • 33
2
votes
2 answers

Angular can't compile Typescript's mapped type modifiers

I have a node.js project where I successfully use a custom mapped type export type Mutable = { -readonly [P in keyof T]: T[P]; }; but if I add the same code to an Angular 6 project, compilation fails saying: ERROR in…
Sergio
  • 2,078
  • 3
  • 24
  • 41