Questions tagged [modifier]
347 questions
7
votes
4 answers
Apply Smarty modifier on block output
I'm trying to apply a modifier (truncate, in my case) to the output of a block (a tr block, that is, a translation block). I don't have tr as a modifier because it's not convenient for HTML markup.
I don't really know what kind of syntax I should…

Lazlo
- 8,518
- 14
- 77
- 116
7
votes
2 answers
Smarty "capitalize" modifier... always capitalizes "L"? ... and "P"?
Quite simply: I'm using Smarty and the |capitalize modifier. It works fine, but when I pass any word with l in it, it capitalizes it, even if it's not at the beginning of the word.
What why?
EDIT: Same happens with…

Lazlo
- 8,518
- 14
- 77
- 116
7
votes
3 answers
How do you force Perl to re-compile a regex compiled with "/o" on demand?
Technical question:
Given a regex:
my $regEx = qr{whatever$myVar}oxi; # Notice /o for "compile-once"
What is the most effective way to force it to recompile on demand? (e.g. when I know from the program logic that $myVar value changed) without…

DVK
- 126,886
- 32
- 213
- 327
7
votes
1 answer
"inconsistent" match result when using code block in regex [Raku]
While checking and testing various aspects of regexes, I stumbled upon a strange and "incosistent" behaviour. I was trying to use some code in a regex, but the same behaviour applies also with use of a void code block.
Especially what moved me the…

jakar
- 1,701
- 5
- 14
7
votes
6 answers
C++ Setting Speed of While Loop per Second
I am relatively new to C++, so I don't have a huge amount of experience. I have learned Python, and I am trying to make an improved version of a Python code I wrote in C++. However, I want it to work in real time, so I need to set the speed of a…

Asaaj
- 272
- 2
- 3
- 9
6
votes
3 answers
How to add a modifier to a quoted regular (qr) expression
Is there an easy way to add regex modifiers such as 'i' to a quoted regular expression? For example:
$pat = qr/F(o+)B(a+)r/;
$newpat = $pat . 'i'; # This doesn't work
The only way I can think of is to print "$pat\n" and get back…

dividebyzero
- 1,243
- 2
- 9
- 17
6
votes
1 answer
Set a project default for VB.NET projects so that the default Modifiers property for controls is Private
Is it possible to set a project default for VB.NET winforms projects so that the default Modifier for controls added to winforms is Private (not Friend)?
I know there's a "modifiers" property in the properties window so I can set it for each…

Darren
- 9,014
- 2
- 39
- 50
6
votes
7 answers
How to change modifier of a control to Static in Visual Studio
when i create a control by drag and drop VS automatically generate code like this:
public System.Windows.Forms.Label label1;
When i want to change modifier of that control to Static, i go to Form1.Designer.cs and edit to:
public static…

Wayne
- 6,361
- 10
- 46
- 69
6
votes
8 answers
The use of visibility modifiers in Java
class Orange{
Orange(){
}
}
What is the difference between the usage of the modifier - in this case, package-private - in front of the class and in front of the constructor? I think the modifier in front of the constructor means it is…

joy
- 721
- 2
- 11
- 18
6
votes
3 answers
What are the Java primitive data type modifiers?
Alright, I've been programming in Java for the better part of three years, now, and consider myself very experienced. However, while looking over the Java SE source code, I ran into something I didn't expect:
in class Double:
public static final…

Ky -
- 30,724
- 51
- 192
- 308
5
votes
3 answers
how should name the modifier params in Jetpack compose component which gets two or more modifiers?
If we have a compose component which gets two or more modifiers, how should we handle it ?
I mean the naming of modifiers while lint complains changing the name of modifier parameter
Sample code to figure out easily :
@Composable
private fun…

Sepideh Vatankhah
- 597
- 5
- 17
5
votes
1 answer
Warning: preg_match() [function.preg-match]: Unknown modifier 'v'
I keep getting this error about 20 times in my wordpress blog about the same line of code. Here is the line of code that keeps getting the error.
if ( preg_match( '/' . $id_base . '-([0-9]+)$/', $widget_id, $matches ) )
$number =…

Frank Aguilar
- 251
- 1
- 4
- 12
5
votes
2 answers
get modifierFlags in keyDown event without pressing non-modifier key along with it!
I have subclassed NSWindow in a NSDocument application in order to receive keyDown events.
I have used the following code in my subclasss...
- (void)keyDown:(NSEvent *)theEvent {
NSLog(@"keyDown!");
if ([theEvent modifierFlags] &…

Vassilis
- 2,878
- 1
- 28
- 43
5
votes
1 answer
How to set the background colour of elements according to their visibility modifier in Eclipse?
I'd like to set the background colour of fields and methods (on the first level) according to their visibility modifier in Eclipse.
For example private fields and methods should get a red background, while public fields and methods get a green…

Edward
- 4,453
- 8
- 44
- 82
5
votes
5 answers
How to use a variable as modifier in a substitution
Is there a way to use a variable as modifier in a substitution?
my $search = 'looking';
my $replace = '"find: $1 ="';
my $modifier = 'ee';
s/$search/$replace/$modifier;
I need to use an array of hashes to make bulk search-replace with different…

bem33
- 63
- 1
- 4