qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
3,070,274
I'm looking for a way to do something like this: ``` // style.css @def borderSize '2px'; .style { width: borderSize + 2; height: borderSize + 2; } ``` where the width and height attributes would end up having values of 4px.
2010/06/18
[ "https://Stackoverflow.com/questions/3070274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/317404/" ]
Mozilla kind-of-sort-of-not-really supports this with it's CSS `calc()` function. This example shamelessly stolen (with attribution!) from [Ajaxian](http://ajaxian.com/archives/css-calc-in-the-house) ``` /* * Two divs aligned, split up by a 1em margin */ #a { width:75%; margin-right: 1em; } #b { width: -moz-cal...
You could also calculate in your provider method, if you put a parameter in the function: ``` @eval baseFontSize com.myexample.CssSettingsProvider.getBaseFontSize(0)+"pt"; @eval baseFontSize_plus_1 com.myexample.CssSettingsProvider.getBaseFontSize(1)+"pt"; ``` `com.myexample.CssSettingsProvider` would look like thi...
3,070,274
I'm looking for a way to do something like this: ``` // style.css @def borderSize '2px'; .style { width: borderSize + 2; height: borderSize + 2; } ``` where the width and height attributes would end up having values of 4px.
2010/06/18
[ "https://Stackoverflow.com/questions/3070274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/317404/" ]
Sometimes I use the following: ``` @eval BORDER_SIZE_PLUS_2 2+2+"px"; /* GWT evaluates this at compile time! */ ``` Oddly, this only works, if you don't put any spaces between the `+` operator and the operands. Also, in @eval you can't use constants that were previously defined by @def. You can however use constants...
You could also calculate in your provider method, if you put a parameter in the function: ``` @eval baseFontSize com.myexample.CssSettingsProvider.getBaseFontSize(0)+"pt"; @eval baseFontSize_plus_1 com.myexample.CssSettingsProvider.getBaseFontSize(1)+"pt"; ``` `com.myexample.CssSettingsProvider` would look like thi...
49,470,764
Suppose you have 14 bits. How do you determine how many integers can be represented in binary from those 14 bits? Is it simply just 2^n? So 2^14 = 16384? Please note this part of the question: "how many INTEGERS can be represented in BINARY...". That's where my confusion lies in what otherwise seems like a fairly str...
2018/03/24
[ "https://Stackoverflow.com/questions/49470764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8716929/" ]
The answer depends on whether you need signed or unsigned integers. If you need unsigned integers then using `2^n` you can represent integers from 0 to 2^n exclusive. e.g. n=2; 2^2=4 you can represent the integers from 0 to 4 exclusive (0 to 3 inclusive). Therefore with n bits, you can represent a maximum unsigned int...
Yes, it's that easy as `2^n`. A bit can have 2 distinct values: 0 and 1. If you have 2 bits, than you have 4 distinct values: 00, 01, 10, 11. The list goes on. Combinatorics has the simple counting formula ``` N = n_1 ⋅ n_2 ⋅ ... ⋅ n_k ``` Since `n_1 = n_2 = n_k = 2` you can reduce the formula to ``` N = 2 ^ k ...
186,718
The Bearer: Background ---------------------- --- On Alternate Earth, studies and cases have shown that a *small percentage of the population (10%) is responsible for 90% of the bad luck*. **These people are targeted by bad luck**, almost by cosmic forces: they are struck by lightning out of a sunny day, hit by cars...
2020/10/03
[ "https://worldbuilding.stackexchange.com/questions/186718", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/68848/" ]
***Two Roads:*** There are two directions your society can take with regards to bearers, and it somewhat depends on how the actual "ability" functions. The tetroid wave situation is complex, and I think only you fully understand it. Both of these solutions can be applied, or can be exclusive. It's up to you. 1. **Exi...
What about The Fortunate? ========================= The fortunate would be the opposite end of the spectrum-the people for whom bad luck simply doesn't happen. They are the ones who could build a rocket out of a tin can and successfully circumnavigate the moon down to your simply lucky people who play a good stock mar...
186,718
The Bearer: Background ---------------------- --- On Alternate Earth, studies and cases have shown that a *small percentage of the population (10%) is responsible for 90% of the bad luck*. **These people are targeted by bad luck**, almost by cosmic forces: they are struck by lightning out of a sunny day, hit by cars...
2020/10/03
[ "https://worldbuilding.stackexchange.com/questions/186718", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/68848/" ]
***Two Roads:*** There are two directions your society can take with regards to bearers, and it somewhat depends on how the actual "ability" functions. The tetroid wave situation is complex, and I think only you fully understand it. Both of these solutions can be applied, or can be exclusive. It's up to you. 1. **Exi...
There is a certain amount of bad luck in the world; we need the Bearers, because otherwise we'd be suffering all that bad luck ourselves ---------------------------------------------------------------------------------------------------------------------------------------- Is it true? Doesn't matter! The most humane r...
186,718
The Bearer: Background ---------------------- --- On Alternate Earth, studies and cases have shown that a *small percentage of the population (10%) is responsible for 90% of the bad luck*. **These people are targeted by bad luck**, almost by cosmic forces: they are struck by lightning out of a sunny day, hit by cars...
2020/10/03
[ "https://worldbuilding.stackexchange.com/questions/186718", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/68848/" ]
### Vigilantism, Genocide & Eugenics I'm sorry to basically go full Nazi on the first answer here. History shows us what happens when we scapegoat a particular group of people as being responsible for all the suffering in the world. Replace ["The Eternal Jew"](https://encyclopedia.ushmm.org/content/en/article/nazi-pr...
What about The Fortunate? ========================= The fortunate would be the opposite end of the spectrum-the people for whom bad luck simply doesn't happen. They are the ones who could build a rocket out of a tin can and successfully circumnavigate the moon down to your simply lucky people who play a good stock mar...
186,718
The Bearer: Background ---------------------- --- On Alternate Earth, studies and cases have shown that a *small percentage of the population (10%) is responsible for 90% of the bad luck*. **These people are targeted by bad luck**, almost by cosmic forces: they are struck by lightning out of a sunny day, hit by cars...
2020/10/03
[ "https://worldbuilding.stackexchange.com/questions/186718", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/68848/" ]
### Vigilantism, Genocide & Eugenics I'm sorry to basically go full Nazi on the first answer here. History shows us what happens when we scapegoat a particular group of people as being responsible for all the suffering in the world. Replace ["The Eternal Jew"](https://encyclopedia.ushmm.org/content/en/article/nazi-pr...
There is a certain amount of bad luck in the world; we need the Bearers, because otherwise we'd be suffering all that bad luck ourselves ---------------------------------------------------------------------------------------------------------------------------------------- Is it true? Doesn't matter! The most humane r...
128,386
I have these scripts I made that work absolutely perfectly as I need them to. Is there any improvements that can be done to these scripts and make them more efficient for Mobile Platforms? Or even just combine them into one script? These 4 scripts are just about identical except that each one controls a different obst...
2016/05/14
[ "https://codereview.stackexchange.com/questions/128386", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/103199/" ]
1. **Bracket alignment**. For some reason, all obstacle classes and `while`-loops are written with vertically aligned bracket, while the `MonoBehaviour`s are egyptians. > > [Coding style] create a consistent look to the code, so that readers can focus on content, not layout. - [C# Coding Convention](https://msdn.micr...
You only need one `Obstacle` class, and then you can create four instances of it. Your "Spawn" methods can be extracted into a single method, with parameters to handle the differences. For example, because `spawnRotation` not the same for each obstacle, you can have that be a parameter or a variable in the `Obstacle` c...
40,802
I need to compute the Drazin inverse $A^D$ of a singular M-matrix $A$, i.e., a matrix in the form $A=\lambda I -P$, where $P$ has nonnegative entries and $\lambda$ is the spectral radius (Perron value) of $P$. I already know the right and left eigenvectors $v$ and $u^T$ of $P$ with eigenvalue $\lambda$ (that is, the ve...
2010/10/02
[ "https://mathoverflow.net/questions/40802", "https://mathoverflow.net", "https://mathoverflow.net/users/1898/" ]
If you have access to Matlab, and the matrix is not gigantic you can use the following to calculate the Drazin inverse: 1. Determine the index of $A$, i.e, does $\mathrm{rank}(A^k) = \mathrm{rank}(A^{k+1})$ 2. Solve the linear system $A^{k+1} X = A^k$ 3. Use the fact that $A^D$, the Drazin inverse, is given by $$A^D...
This one might have some pertinent leads: <http://www.sciencedirect.com/science/article/pii/0024379585902356>
4,315
Fred has a puzzle. The instruction sheet, which is separate from the equation,simply says: "Make this equation true. You may ONLY draw ONE, PERFECTLY straight line". The equation is all alone on a blank piece of paper and reads: ``` 5+5+5=550 ``` There are 4 acceptable answers. You must get all 4 for a correct answ...
2014/11/12
[ "https://puzzling.stackexchange.com/questions/4315", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/5180/" ]
1. > > Cross out the equals sign > > > 2. > > Turn the first $+$ into a 4 giving $545+5=550$ > > > 3. > > Turn the second $+$ into a 4 giving $5+545=550$ > > > 4. > > Turn the equals sign into less than or equal to > > >
> > 5+5+5≠550 > > > negating the equality. > > > > Edit: > > You could negate the entire statement, depending on how you interpret the equation... > > \_\_\_\_\_\_\_\_\_ > > 5+5+5=550    could evaluate to "true" in some contexts... ^^ > > >
4,315
Fred has a puzzle. The instruction sheet, which is separate from the equation,simply says: "Make this equation true. You may ONLY draw ONE, PERFECTLY straight line". The equation is all alone on a blank piece of paper and reads: ``` 5+5+5=550 ``` There are 4 acceptable answers. You must get all 4 for a correct answ...
2014/11/12
[ "https://puzzling.stackexchange.com/questions/4315", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/5180/" ]
> > 5+5+5≠550 > > > negating the equality. > > > > Edit: > > You could negate the entire statement, depending on how you interpret the equation... > > \_\_\_\_\_\_\_\_\_ > > 5+5+5=550    could evaluate to "true" in some contexts... ^^ > > >
I'd put a line > > on one of the plus signs, straight up. > > The equation would read > 545 + 5 = 550 > > >
4,315
Fred has a puzzle. The instruction sheet, which is separate from the equation,simply says: "Make this equation true. You may ONLY draw ONE, PERFECTLY straight line". The equation is all alone on a blank piece of paper and reads: ``` 5+5+5=550 ``` There are 4 acceptable answers. You must get all 4 for a correct answ...
2014/11/12
[ "https://puzzling.stackexchange.com/questions/4315", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/5180/" ]
I think the fourth answer, which hasn't been posted yet is: > > $5+5+5≤550$ > > > That makes all of them: > > $5+5+5≤550$ > > $545+5=550$ > > $5+545=550$ > > $5+5+5≠550$ > > > >
> > 5+5+5≠550 > > > negating the equality. > > > > Edit: > > You could negate the entire statement, depending on how you interpret the equation... > > \_\_\_\_\_\_\_\_\_ > > 5+5+5=550    could evaluate to "true" in some contexts... ^^ > > >
4,315
Fred has a puzzle. The instruction sheet, which is separate from the equation,simply says: "Make this equation true. You may ONLY draw ONE, PERFECTLY straight line". The equation is all alone on a blank piece of paper and reads: ``` 5+5+5=550 ``` There are 4 acceptable answers. You must get all 4 for a correct answ...
2014/11/12
[ "https://puzzling.stackexchange.com/questions/4315", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/5180/" ]
1. > > Cross out the equals sign > > > 2. > > Turn the first $+$ into a 4 giving $545+5=550$ > > > 3. > > Turn the second $+$ into a 4 giving $5+545=550$ > > > 4. > > Turn the equals sign into less than or equal to > > >
I'd put a line > > on one of the plus signs, straight up. > > The equation would read > 545 + 5 = 550 > > >
4,315
Fred has a puzzle. The instruction sheet, which is separate from the equation,simply says: "Make this equation true. You may ONLY draw ONE, PERFECTLY straight line". The equation is all alone on a blank piece of paper and reads: ``` 5+5+5=550 ``` There are 4 acceptable answers. You must get all 4 for a correct answ...
2014/11/12
[ "https://puzzling.stackexchange.com/questions/4315", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/5180/" ]
1. > > Cross out the equals sign > > > 2. > > Turn the first $+$ into a 4 giving $545+5=550$ > > > 3. > > Turn the second $+$ into a 4 giving $5+545=550$ > > > 4. > > Turn the equals sign into less than or equal to > > >
I think the fourth answer, which hasn't been posted yet is: > > $5+5+5≤550$ > > > That makes all of them: > > $5+5+5≤550$ > > $545+5=550$ > > $5+545=550$ > > $5+5+5≠550$ > > > >
4,315
Fred has a puzzle. The instruction sheet, which is separate from the equation,simply says: "Make this equation true. You may ONLY draw ONE, PERFECTLY straight line". The equation is all alone on a blank piece of paper and reads: ``` 5+5+5=550 ``` There are 4 acceptable answers. You must get all 4 for a correct answ...
2014/11/12
[ "https://puzzling.stackexchange.com/questions/4315", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/5180/" ]
I think the fourth answer, which hasn't been posted yet is: > > $5+5+5≤550$ > > > That makes all of them: > > $5+5+5≤550$ > > $545+5=550$ > > $5+545=550$ > > $5+5+5≠550$ > > > >
I'd put a line > > on one of the plus signs, straight up. > > The equation would read > 545 + 5 = 550 > > >
345,024
I found a theme I really like: <https://de.wordpress.org/themes/online-consulting/> Unfortunately, the "Read more" button is in a position I don't really like: [![enter image description here](https://i.stack.imgur.com/DHg0E.png)](https://i.stack.imgur.com/DHg0E.png) I would vastly prefer if the button was below th...
2019/08/13
[ "https://wordpress.stackexchange.com/questions/345024", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/173432/" ]
If you go into your Admin section, under Appearance > Edit CSS, you will be able to override the CSS of the theme. In order to find out what the class is, you might want to Inspect the control with Google Chrome's Developer Tools.
If you look at the demo for your theme, you will see those buttons are on new lines. <https://de.wordpress.org/themes/online-consulting/> It looks like it just needs to be a paragraph and then the button. Do you maybe have the button inside the paragraph? If you go to the demo in your browser and right click the but...
65,483,417
I get error: "UnhandledPromiseRejectionWarning: Error [ERR\_HTTP\_HEADERS\_SENT]: Cannot set headers after they are sent to the client", guessing that the problem is with promises, but I don't understand how to fix it. How do I fix my code to avoid this error, but keep the logic and work with the database? ``` router...
2020/12/28
[ "https://Stackoverflow.com/questions/65483417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14866914/" ]
You can declare listOfFileSignatures globally, but the signatures are computed asynchronously, so the list will be empty directly after the for loop. FileReader is always asynchronous, so you can't avoid that. One possibility to handle this is to check if the list is full inside onloadend (`listOfFileSignatures.length ...
fileReader.onload is asynchronous, console.log (listOfFileSignatures); is called before files have been read one option is to create an external function that returns a promise, returning the listOfFileSignatures array ``` function getListFile() { return new Promise((resolve, reject) => { var blob = file...
73,603,252
I have the following data: ``` structure(list(cells = c("Adipocytes", "B-cells", "Basophils", "CD4+ memory T-cells", "CD4+ naive T-cells", "CD4+ T-cells", "CD4+ Tcm", "CD4+ Tem", "CD8+ naive T-cells", "CD8+ T-cells", "CD8+ Tcm", "Class-switched memory B-cells", "DC", "Endothelial cells", "Eosinophils", "Epithelial...
2022/09/04
[ "https://Stackoverflow.com/questions/73603252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17945841/" ]
`string` isn't a byte buffer, it has very hard rules for encoding. I can easily see how the normal encoding rules will lengthen or shorten the resulting bytes that you're then using to convert to an integer. In fact, even if everything works perfectly, your string has twice as many bytes as the resulting integer. Have ...
Solution to problem. 1. Upgrade project to .NET 6 (<https://dotnet.microsoft.com/en-us/platform/upgrade-assistant/tutorial/install-upgrade-assistant>) 2. Add the `System.Text.Encoding.CodePages` NuGet package to solution 3. Register encoding in Startup. 4. Create a global variable (Encod in the sample) and assign to e...
64,206
As the title suggests, a friend and I are writing a manga-plot and there is this character that is having the speech disorder - he stutters. --- Writing the question directly to avoid confusion. Afterwards providing some attempts to clarify both what the question is about & details. Finally I will add *Background*,...
2023/01/15
[ "https://writers.stackexchange.com/questions/64206", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/47418/" ]
So if I'm interpreting this correctly, you want to write a character who stutters based off yourself, but want to know how to avoid them coming off as cliché or offending other people who stutter/stutterers due to being nonrepresentative, right? And have attempted to search for resources only to find a sum total of not...
I'm not sure it can work, but maybe you can sometimes express your character thoughts using some graphical convention like specific speech bubble and sometimes use ordinary speech bubble where he stutter. It may even be possible to use both at once to show what the character wants to tell and how he fails to do it. Ju...
13,110,276
I'm working on a regular expression where I need to verify a input text that contains 4 distinct words separated by a comma. > > input text words: - one, two, three, four. Each of these words should not be repeated more than once. > so, it can be: two, three, four, one or three, four, two, one and not one, one, on...
2012/10/28
[ "https://Stackoverflow.com/questions/13110276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781007/" ]
It would be far easier to NOT do this particular problem with a single regular expression. First off, `\b` is zero-width. So you do not need to follow it using a `?`, your intention is probably `\s?`. Next, regex is pretty much stateless, in the general case, which means that you'd need to construct your regex as fol...
Why do you want to use regex? Just split the text on comma and do your usual array / list duplicate check
13,110,276
I'm working on a regular expression where I need to verify a input text that contains 4 distinct words separated by a comma. > > input text words: - one, two, three, four. Each of these words should not be repeated more than once. > so, it can be: two, three, four, one or three, four, two, one and not one, one, on...
2012/10/28
[ "https://Stackoverflow.com/questions/13110276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781007/" ]
``` boolean valid( String input ) { input.tokenize( ',' ).with { list -> list.unique( false ) == list && list.every { it in ['one','two','three','four'] } } } ``` should do it without regular expressions
Why do you want to use regex? Just split the text on comma and do your usual array / list duplicate check
13,110,276
I'm working on a regular expression where I need to verify a input text that contains 4 distinct words separated by a comma. > > input text words: - one, two, three, four. Each of these words should not be repeated more than once. > so, it can be: two, three, four, one or three, four, two, one and not one, one, on...
2012/10/28
[ "https://Stackoverflow.com/questions/13110276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781007/" ]
It would be far easier to NOT do this particular problem with a single regular expression. First off, `\b` is zero-width. So you do not need to follow it using a `?`, your intention is probably `\s?`. Next, regex is pretty much stateless, in the general case, which means that you'd need to construct your regex as fol...
I believe you are trying to use regular expressions to parse a non regular input. In this case, the input is more like a context free language. I recommend tokenizing the string and counting.
13,110,276
I'm working on a regular expression where I need to verify a input text that contains 4 distinct words separated by a comma. > > input text words: - one, two, three, four. Each of these words should not be repeated more than once. > so, it can be: two, three, four, one or three, four, two, one and not one, one, on...
2012/10/28
[ "https://Stackoverflow.com/questions/13110276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781007/" ]
``` boolean valid( String input ) { input.tokenize( ',' ).with { list -> list.unique( false ) == list && list.every { it in ['one','two','three','four'] } } } ``` should do it without regular expressions
I believe you are trying to use regular expressions to parse a non regular input. In this case, the input is more like a context free language. I recommend tokenizing the string and counting.
13,110,276
I'm working on a regular expression where I need to verify a input text that contains 4 distinct words separated by a comma. > > input text words: - one, two, three, four. Each of these words should not be repeated more than once. > so, it can be: two, three, four, one or three, four, two, one and not one, one, on...
2012/10/28
[ "https://Stackoverflow.com/questions/13110276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781007/" ]
It would be far easier to NOT do this particular problem with a single regular expression. First off, `\b` is zero-width. So you do not need to follow it using a `?`, your intention is probably `\s?`. Next, regex is pretty much stateless, in the general case, which means that you'd need to construct your regex as fol...
You can use negative lookaheads in this way (see at [Regexr](http://regexr.com?32k60)): ```rb \b(one|two|three|four)\b, # match one of the allowed words \b(?!\1)(one|two|three|four)\b, # match one of them but not first matched one \b(?!\1|\2)(one|two|three|four)\b, # match one of them but not firs...
13,110,276
I'm working on a regular expression where I need to verify a input text that contains 4 distinct words separated by a comma. > > input text words: - one, two, three, four. Each of these words should not be repeated more than once. > so, it can be: two, three, four, one or three, four, two, one and not one, one, on...
2012/10/28
[ "https://Stackoverflow.com/questions/13110276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781007/" ]
It would be far easier to NOT do this particular problem with a single regular expression. First off, `\b` is zero-width. So you do not need to follow it using a `?`, your intention is probably `\s?`. Next, regex is pretty much stateless, in the general case, which means that you'd need to construct your regex as fol...
You should definitely not use a regex for this. You can, though: ``` boolean foundMatch = subjectString.matches( "(?x) # Verbose regex \n" + "(?: # Match... \n" + " (?:one()|two()|three()|four()) # on...
13,110,276
I'm working on a regular expression where I need to verify a input text that contains 4 distinct words separated by a comma. > > input text words: - one, two, three, four. Each of these words should not be repeated more than once. > so, it can be: two, three, four, one or three, four, two, one and not one, one, on...
2012/10/28
[ "https://Stackoverflow.com/questions/13110276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781007/" ]
``` boolean valid( String input ) { input.tokenize( ',' ).with { list -> list.unique( false ) == list && list.every { it in ['one','two','three','four'] } } } ``` should do it without regular expressions
You can use negative lookaheads in this way (see at [Regexr](http://regexr.com?32k60)): ```rb \b(one|two|three|four)\b, # match one of the allowed words \b(?!\1)(one|two|three|four)\b, # match one of them but not first matched one \b(?!\1|\2)(one|two|three|four)\b, # match one of them but not firs...
13,110,276
I'm working on a regular expression where I need to verify a input text that contains 4 distinct words separated by a comma. > > input text words: - one, two, three, four. Each of these words should not be repeated more than once. > so, it can be: two, three, four, one or three, four, two, one and not one, one, on...
2012/10/28
[ "https://Stackoverflow.com/questions/13110276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781007/" ]
``` boolean valid( String input ) { input.tokenize( ',' ).with { list -> list.unique( false ) == list && list.every { it in ['one','two','three','four'] } } } ``` should do it without regular expressions
You should definitely not use a regex for this. You can, though: ``` boolean foundMatch = subjectString.matches( "(?x) # Verbose regex \n" + "(?: # Match... \n" + " (?:one()|two()|three()|four()) # on...
37,208,644
I want to add new row to gridcontrol at every button click. I tried many ways but no success. I am sending my code. ``` private void B_Click(object sender, EventArgs e) { Button bt = (Button)sender; int productId = (int)bt.Tag; AddProductDataContext db = new AddProductDataContext(); d...
2016/05/13
[ "https://Stackoverflow.com/questions/37208644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6325555/" ]
For god sake, protect your query against SQL injection : ``` $sql = "DELETE from utilisateur where pseudo = '".mysqli_real_escape_string($con, $pseudo)."'"; ```
``` $sql = "DELETE from utilisateur where pseudo = '$pseudo'"; ```
49,240,739
I wanted to export data from *netezza database* to *CSV* file. The format for the data will be: ``` col1,col2,col3 ``` OR: ``` "col1","col2","col3" ``` I am using the query: ``` CREATE EXTERNAL TABLE 'H:\\test.csv' USING ( DELIMITER ',' REMOTESOURCE 'ODBC' ) AS SELECT * FROM TEST_TABLE ``` Above query is not...
2018/03/12
[ "https://Stackoverflow.com/questions/49240739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3863192/" ]
Desired output can be achieved by using nzsql command line statement.The only limitation of this approach is max file will limit to **2 GB** .Here is the link from IBM KB [Sending query results to an output file](http://www-01.ibm.com/support/docview.wss?crawler=1&uid=swg21567479) ``` [nz@netezza ~]$ nzsql -d test -A ...
You can use ~~`ESCAPECHAR '@'` to use an '@' rather than a backslash~~ only a backlash as an [escape character](https://en.wikipedia.org/wiki/Escape_character). The problem is that a csv file needs a way to say "this comma is data, not a delimiter" - which is what the escape char is used for. The code that consumes you...
70,444,674
Hey all so I'll keep it short. I know there've been some questions asked similar to this but none of them are able to answer what I'm trying to achieve. This is what I want the code to do: * Show a div when forward slash "/" is typed in textarea * Not show a div when forward slash is not typed * hide the pop up when t...
2021/12/22
[ "https://Stackoverflow.com/questions/70444674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16663406/" ]
I think the problem is a combination of Stencil's tree-shakable API and a problem with its build-time analysis of dynamic imports. Stencil tries to ship as little "Stencil" code as possible, so it will analyze your project to find out which features you're actually using and only include those in the final bundle. If ...
I think it should be ```js @Component({ tag: 'component-two', styleUrl: 'component-two.css', shadow: true, }) export class ComponentTwo { // omitting all code that didn't change ... render() { // probably not needed let this_ = this; /* ---------------------------------------------------- */ ...
19,767,553
I am using a `UIAlertView` to prompt users for a password. If the password is correct, I'd like the alert view to go away normally; if the password is incorrect, I'd like the alert view to remain (with the text changed to something like "Please try again."). How do I alter the default behaviour so that the view doesn't...
2013/11/04
[ "https://Stackoverflow.com/questions/19767553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781058/" ]
You could design a **UIView** similar to the alertview and can cal the functions inside this. Removing a UIView is controlled by you.
It's not possible to leave the alert there when a button has been clicked. You can either disable the "OK" button by delegate method `alertViewShouldEnableFirstOtherButton:`, if you are checking the password locally, or just show another alert later. The second alert can contain a different information, e.g. "Password...
19,767,553
I am using a `UIAlertView` to prompt users for a password. If the password is correct, I'd like the alert view to go away normally; if the password is incorrect, I'd like the alert view to remain (with the text changed to something like "Please try again."). How do I alter the default behaviour so that the view doesn't...
2013/11/04
[ "https://Stackoverflow.com/questions/19767553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781058/" ]
As this is very old question,but I got one solution and though of posting if any other developer need in near future. Implement protocol methods in .h file In order to respond to button taps in our UIAlertView, we will use the – alertView:clickedButtonAtIndex: protocol method as ``` - (void)alertView:(UIAlertView *)...
It's not possible to leave the alert there when a button has been clicked. You can either disable the "OK" button by delegate method `alertViewShouldEnableFirstOtherButton:`, if you are checking the password locally, or just show another alert later. The second alert can contain a different information, e.g. "Password...
4,229,732
initially, my textarea has a value of Enter Comment... set via `<textarea>Enter Comment...</textarea>` I have a .focus like: `$("textarea.commentTextArea").live('focus', function() { if($(this).val() == "Enter Comment...") { $(this).val(''); } });` and a .blur() like: `$("textarea.commentTextArea").live('blur', ...
2010/11/19
[ "https://Stackoverflow.com/questions/4229732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/409993/" ]
You don't have quotes around the word 'textarea' in the second statement. Also, your focus event will delete anything the user entered if they return to the textarea to edit again. do this to solve the second problem (same trick you used on the blur event): ``` $("textarea").focus(function() { if ($(this).val() == 'E...
My first guess would be that `$(textarea)` is returning null -- I'm guessing that it should be `$("textarea")`. I think this is fine. I tried it out using [jsfiddle](http://www.jsfiddle.net/jwiscarson/a55qD/1/), and it worked.
4,229,732
initially, my textarea has a value of Enter Comment... set via `<textarea>Enter Comment...</textarea>` I have a .focus like: `$("textarea.commentTextArea").live('focus', function() { if($(this).val() == "Enter Comment...") { $(this).val(''); } });` and a .blur() like: `$("textarea.commentTextArea").live('blur', ...
2010/11/19
[ "https://Stackoverflow.com/questions/4229732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/409993/" ]
You don't have quotes around the word 'textarea' in the second statement. Also, your focus event will delete anything the user entered if they return to the textarea to edit again. do this to solve the second problem (same trick you used on the blur event): ``` $("textarea").focus(function() { if ($(this).val() == 'E...
I presume it's because you missed the quotes around the `$(textarea).blur()` method. I've created an [example with your code](http://jsfiddle.net/AScM4/) which works.
1,245,376
Hey Exchange community, We have finite-dimensional vector spaces $V$ and $W$ with ordered bases $B$ and $A$ respectively. Is it true/false that $L(V,W)=L(W,V)$? Just wondering if someone could articulate what the difference is between the two notations. Having someone write it down as if they were verbally explainin...
2015/04/21
[ "https://math.stackexchange.com/questions/1245376", "https://math.stackexchange.com", "https://math.stackexchange.com/users/233092/" ]
The symbols $\mathcal{L}(V,W)$ indicates the linear transformations from vector space $V$ into vector space $W$, and the analogous statement is made for $\mathcal{L}(W,V)$. If $V$ and $W$ are not the same space (e.g. isomorphic) then you don't in general have the same maps going from $V$ to $W$ as you do from $W$ to $V...
$\mathcal{L}(U,W)=\{T\colon U\to W/ T \mbox{ is a linear transformation }\}$ $\mathcal{L}(W,U)=\{T\colon W\to U/ T \mbox{ is a linear transformation }\}$ There are different because $Im(\mathcal{L}(U,V))\subset U$ and $Im((\mathcal{L}(V,U))\subset V$ and $ U, V$ nor always will be subsets of the same space. For exam...
35,527,163
I created a simple Jekyll blog by following the instructions in the Quick-start guide in <http://jekyllrb.com/docs/quickstart/>. I changed the blog a little bit to suit my needs and was able to successfully implement these changes and view them locally. But, as soon as I deployed the blog on Github Pages, I get this ...
2016/02/20
[ "https://Stackoverflow.com/questions/35527163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3649966/" ]
By going off the assumption that you mean the styling is off. I opened the dev console in your website and noticed there was this error ``` http://palpen.github.io/palpen_articles/palpen_articles/css/main.css Failed to load resource: the server responded with a status of 404 (Not Found) ``` Notice that it's attempt...
Perhaps you might face more trouble in the future if locally you don't use the same environment as GitHub does. You'll need to serve Jekyll with bundler to accomplish that. Take a look at this [answer](https://stackoverflow.com/a/35449384/5455207) to check how to do it. Hope to have helped!
676,357
My Ubuntu Linux server has an mdadm array (RAID 5) with four 2TB SATA disks that keeps "loosing" two disks from time to time. Rebooting and re-assembling the arrays has worked out fine up until now. Hardware is a Dell PowerEdge T20 with an Exsys EX-3400 card that provides four additional SATA ports. Two of the fours d...
2015/03/18
[ "https://serverfault.com/questions/676357", "https://serverfault.com", "https://serverfault.com/users/276935/" ]
You have these three commands ``` mkdir test_dir test_dir1 test_dir2 test_dir3 touch file1 file2 file3 cp -v file* test_dir*/ ``` Assuming no other files or directories in `.` before the example is started, the wildcards in that last line get expanded thus: ``` cp -v file1 file2 file3 test_dir/ test_dir1/ test_dir2...
Because the `cp` commands works so. If it has more as 2 argument, the last argument must be a directory, and every argument before that will be copied into. I think you want a `cp` which behaves much more like the windows `copy` command, and yes, there are such tools, although they aren't widely used. Even I had to go...
9,898,773
I realize there are similar posts to this out there, but rest assured, this isn't a duplicate post! I have a site on a godaddy server. I DO NOT have access to the outside of the root of my server (everything is public). I have a file delete.php that needs to run on CRON, and only by CRON. The file should not execute ...
2012/03/27
[ "https://Stackoverflow.com/questions/9898773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/910737/" ]
Checking for the `cli` SAPI is sufficient; a user executing it via apache (be it mod\_php or fastcgi or cgi) will never cause PHP to be called through the CLI sapi. You can get rid of the ugly `else {}` around your real code though; if you `exit;` at the end of the *then* block there is no need for an *else* block. Ho...
Of course, placing those files outside the webroot would be the preferred way of doing it. On the other hand, you could create `.htaccess` which defines `Deny all` rule for all access. This way `Deny all` prevents direct server access but PHP CLI would still be able to access it.
41,346,681
i have a set of code that i copied from someone on youtube and i completely understand and there is some unused logic in there but basically at the moment all it is meant to do is grab the rocket.show function and draw a rectangle and i cannot for the life of me work out why it is not doing so. it is throwing out no er...
2016/12/27
[ "https://Stackoverflow.com/questions/41346681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6308045/" ]
You should check for the *first* property that might not exist: so don't check the `coconut.color` property before you are sure that `coconut` exists. If the property you check for should be an object (which is your case) then you can do so with the `!` operator: ``` if (!myObj.fruits.coconut) myObj.fruits.coconut =...
If you want to test for the presence of a property on an object you can use the `Object.prototype.hasOwnProperty()`: ``` myObj.fruits.hasOwnProperty("apples") //true myObj.fruits.hasOwnProperty("oranges") //false ```
41,346,681
i have a set of code that i copied from someone on youtube and i completely understand and there is some unused logic in there but basically at the moment all it is meant to do is grab the rocket.show function and draw a rectangle and i cannot for the life of me work out why it is not doing so. it is throwing out no er...
2016/12/27
[ "https://Stackoverflow.com/questions/41346681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6308045/" ]
You should check for the *first* property that might not exist: so don't check the `coconut.color` property before you are sure that `coconut` exists. If the property you check for should be an object (which is your case) then you can do so with the `!` operator: ``` if (!myObj.fruits.coconut) myObj.fruits.coconut =...
As someone pointed out in the comments, you have at least two ways. First one, the simplest, is simply doing ``` if(!myObj.fruits.cononut) // do stuff ``` However this is not very safe since it *"does stuffs"* even if `.coconut` is `false`, for example. What people usually does is ``` if(typeof myObj.fruits.c...
41,346,681
i have a set of code that i copied from someone on youtube and i completely understand and there is some unused logic in there but basically at the moment all it is meant to do is grab the rocket.show function and draw a rectangle and i cannot for the life of me work out why it is not doing so. it is throwing out no er...
2016/12/27
[ "https://Stackoverflow.com/questions/41346681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6308045/" ]
You should check for the *first* property that might not exist: so don't check the `coconut.color` property before you are sure that `coconut` exists. If the property you check for should be an object (which is your case) then you can do so with the `!` operator: ``` if (!myObj.fruits.coconut) myObj.fruits.coconut =...
Underscore js contains **\_.has** [link](http://underscorejs.org/#has) > > \_.has(object, key) > Does the object contain the given key? Identical to object.hasOwnProperty(key), but uses a safe reference to the hasOwnProperty function, in case it's been overridden accidentally. > > > ``` _.has({a: 1, b: 2, c: 3}...
6,658
В чем их отличие? Согласно некоторым источникам "просветительская" - принадлежащая тому, кто просвещает, - просветителю. "Просветительная" - направленная на просвещение. Путаница, да и только. Например, просветительная работа для родителей. Думаю, этот вариант верен.
2012/07/19
[ "https://rus.stackexchange.com/questions/6658", "https://rus.stackexchange.com", "https://rus.stackexchange.com/users/653/" ]
> > > > > > > > > > > > Согласно некоторым источникам "просветительская" - принадлежащая тому, кто просвещает, - просветителю. "Просветительная" - направленная на просвещение. > > > > > > > > > > > > > > > > > > Всё так. Никакой путаницы. Другое дело, что во многих случаях подходят оба варианта. "Просвет...
ПРОСВЕТИТЕЛЬНЫЙ, -ая, -ое. 1. Служащий просвещению;распространяющий знания. П. кружок. **П-ая работа.** 2. Связанный с учениями и деятельностью представителей эпохи Просвещения или просветительства. П-ие идеи (о просветительских учениях 17 - 18 вв.). П-ая философия. ПРОСВЕТИТЕЛЬСКИЙ, -ая, -ое. к Просветитель и Просвет...
46,808,446
I'm working on a responsive website. I have tried EVERYTHING and my footer won't stay down. It's because I used float:left. I don't want it to be fixed, i want it only to appear when i scroll to the bottom of the page. This is my code: EDIT: ok so i took position:absolute out and now it works on the pages it didn't be...
2017/10/18
[ "https://Stackoverflow.com/questions/46808446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7906130/" ]
`random.randint` only takes two arguments, a start and an end. The third argument mentioned by Python is `self`, which is done automatically. To pick a number between 1 and 3, just do `random.randint(1,3)`. Those `if` statements don't make any sense, by the way; they should look something like: ``` if userInput == "...
if you need more than one random number,you can also use `numpy.random.randint(start,stop-1,number of randoms)`
46,808,446
I'm working on a responsive website. I have tried EVERYTHING and my footer won't stay down. It's because I used float:left. I don't want it to be fixed, i want it only to appear when i scroll to the bottom of the page. This is my code: EDIT: ok so i took position:absolute out and now it works on the pages it didn't be...
2017/10/18
[ "https://Stackoverflow.com/questions/46808446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7906130/" ]
`random.randint` only takes two arguments, a start and an end. The third argument mentioned by Python is `self`, which is done automatically. To pick a number between 1 and 3, just do `random.randint(1,3)`. Those `if` statements don't make any sense, by the way; they should look something like: ``` if userInput == "...
I had the same problem, I was building a guess-the-number script, and since I provided all the numbers between 1 and 10. I think you are supposed to format it as random.randit(1,3) instead of listing the variable in between. If you use (1,3) it also accounts for the variable in between those two numbers. -edit I did n...
46,808,446
I'm working on a responsive website. I have tried EVERYTHING and my footer won't stay down. It's because I used float:left. I don't want it to be fixed, i want it only to appear when i scroll to the bottom of the page. This is my code: EDIT: ok so i took position:absolute out and now it works on the pages it didn't be...
2017/10/18
[ "https://Stackoverflow.com/questions/46808446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7906130/" ]
if you need more than one random number,you can also use `numpy.random.randint(start,stop-1,number of randoms)`
I had the same problem, I was building a guess-the-number script, and since I provided all the numbers between 1 and 10. I think you are supposed to format it as random.randit(1,3) instead of listing the variable in between. If you use (1,3) it also accounts for the variable in between those two numbers. -edit I did n...
52,914,982
I'm trying to implement my own TabBar design in flutter. I was able to get a pretty good result. However, when I tap another tab to change the tab, there is a highlight create by default as shown in the image [here](https://i.stack.imgur.com/XBwMg.png). I'm wondering if there is any way I can get rid of the square high...
2018/10/21
[ "https://Stackoverflow.com/questions/52914982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4914834/" ]
That's the ripple effect. You can remove it by wrapping it in a `Container` and giving transparent color to it.
You can also disable the ripple/highlight/splash effect with the code below. Add the Theme with the data of ThemeData where the hightlight and splash color is both transparent. ``` return Scaffold( appBar: PreferredSize( preferredSize: Size.fromHeight(70), child: Theme( data: ThemeData( hig...
52,914,982
I'm trying to implement my own TabBar design in flutter. I was able to get a pretty good result. However, when I tap another tab to change the tab, there is a highlight create by default as shown in the image [here](https://i.stack.imgur.com/XBwMg.png). I'm wondering if there is any way I can get rid of the square high...
2018/10/21
[ "https://Stackoverflow.com/questions/52914982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4914834/" ]
That's the ripple effect. You can remove it by wrapping it in a `Container` and giving transparent color to it.
Here is my custom solution from @Tempelriter ``` Theme( data: Theme.of(context).copyWith( highlightColor: Colors.transparent, splashColor: Colors.transparent, ), child: Container( decoration: BoxDecoration( color: Colors.gray, border: B...
52,914,982
I'm trying to implement my own TabBar design in flutter. I was able to get a pretty good result. However, when I tap another tab to change the tab, there is a highlight create by default as shown in the image [here](https://i.stack.imgur.com/XBwMg.png). I'm wondering if there is any way I can get rid of the square high...
2018/10/21
[ "https://Stackoverflow.com/questions/52914982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4914834/" ]
That's the ripple effect. You can remove it by wrapping it in a `Container` and giving transparent color to it.
you should set tabbar `splashFactory: NoSplash.splashFactory` as this post mentioned. ``` TabBar(splashFactory: NoSplash.splashFactory,) ``` [How to disable default Widget splash effect in Flutter?](https://stackoverflow.com/questions/50020523/how-to-disable-default-widget-splash-effect-in-flutter)
52,914,982
I'm trying to implement my own TabBar design in flutter. I was able to get a pretty good result. However, when I tap another tab to change the tab, there is a highlight create by default as shown in the image [here](https://i.stack.imgur.com/XBwMg.png). I'm wondering if there is any way I can get rid of the square high...
2018/10/21
[ "https://Stackoverflow.com/questions/52914982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4914834/" ]
You can also disable the ripple/highlight/splash effect with the code below. Add the Theme with the data of ThemeData where the hightlight and splash color is both transparent. ``` return Scaffold( appBar: PreferredSize( preferredSize: Size.fromHeight(70), child: Theme( data: ThemeData( hig...
Here is my custom solution from @Tempelriter ``` Theme( data: Theme.of(context).copyWith( highlightColor: Colors.transparent, splashColor: Colors.transparent, ), child: Container( decoration: BoxDecoration( color: Colors.gray, border: B...
52,914,982
I'm trying to implement my own TabBar design in flutter. I was able to get a pretty good result. However, when I tap another tab to change the tab, there is a highlight create by default as shown in the image [here](https://i.stack.imgur.com/XBwMg.png). I'm wondering if there is any way I can get rid of the square high...
2018/10/21
[ "https://Stackoverflow.com/questions/52914982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4914834/" ]
You can also disable the ripple/highlight/splash effect with the code below. Add the Theme with the data of ThemeData where the hightlight and splash color is both transparent. ``` return Scaffold( appBar: PreferredSize( preferredSize: Size.fromHeight(70), child: Theme( data: ThemeData( hig...
you should set tabbar `splashFactory: NoSplash.splashFactory` as this post mentioned. ``` TabBar(splashFactory: NoSplash.splashFactory,) ``` [How to disable default Widget splash effect in Flutter?](https://stackoverflow.com/questions/50020523/how-to-disable-default-widget-splash-effect-in-flutter)
22,329,950
I want to share multi images with caption on Facebook using Intent. I tried some ways but it doesn't work. I can share photos but not the caption. Can you help me, please? Thanks!!! My share function ``` private void share(String nameApp, ArrayList<String> imagePath, String text) { try { List<Inte...
2014/03/11
[ "https://Stackoverflow.com/questions/22329950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2714606/" ]
``` SELECT Car, Shop, Prices FROM `Car List` WHERE Car = 'Mercedes' ``` Depending on your DB engine you need to escape tables names containing spaces differently.
``` SELECT Car, Shop, Prices FROM "Car List" WHERE UPPER(Car) LIKE '%MERCEDES%' ``` You may need to change double quotes depending on the RDBMS you are using. Also, this solution is slower than the equal solution for several reasons but it is more compatible if your data is messy.
22,329,950
I want to share multi images with caption on Facebook using Intent. I tried some ways but it doesn't work. I can share photos but not the caption. Can you help me, please? Thanks!!! My share function ``` private void share(String nameApp, ArrayList<String> imagePath, String text) { try { List<Inte...
2014/03/11
[ "https://Stackoverflow.com/questions/22329950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2714606/" ]
Define "it doesn't work." Surely there's an error message that's trying to help you? For example, what is the data type of `Car`? Based on the attempted comparison, it sounds like it's a string. In which case the value being compared would need to be wrapped in quotes: ``` SELECT Car, Shop, Prices WHERE Car = 'Merced...
``` SELECT Car, Shop, Prices FROM "Car List" WHERE UPPER(Car) LIKE '%MERCEDES%' ``` You may need to change double quotes depending on the RDBMS you are using. Also, this solution is slower than the equal solution for several reasons but it is more compatible if your data is messy.
24,366,351
I have a string that contains an exe full path and exe name like so: ``` mainExePath = "c:\Folder1\Folder2\MyProgram.exe" ``` I want to get jus the path like so: ``` "c:\Folder1\Folder2\" ``` I have tried this: ``` string mainPath = System.IO.Path.GetFullPath(mainExePath); ``` but this returned the same strin...
2014/06/23
[ "https://Stackoverflow.com/questions/24366351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2339664/" ]
Use `Path.GetDirectoryName(mainExePath)`
That would be ``` string mainPath = Path.GetDirectoryName(mainExePath); ``` This works for both paths including file names and paths only. See the [documentation here](http://msdn.microsoft.com/en-us/library/system.io.path.getdirectoryname%28v=vs.110%29.aspx).
24,366,351
I have a string that contains an exe full path and exe name like so: ``` mainExePath = "c:\Folder1\Folder2\MyProgram.exe" ``` I want to get jus the path like so: ``` "c:\Folder1\Folder2\" ``` I have tried this: ``` string mainPath = System.IO.Path.GetFullPath(mainExePath); ``` but this returned the same strin...
2014/06/23
[ "https://Stackoverflow.com/questions/24366351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2339664/" ]
Use `Path.GetDirectoryName(mainExePath)`
You could use the following one: ``` string mainPath = Directory.GetParent(mainExePath); ``` For further documentation on this, please haev a look [here](http://msdn.microsoft.com/en-us/library/system.io.directory.getparent%28v=vs.110%29.aspx). **Update** In order you use the `Directory` class, you have to use the...
29,094
How does one set a flash message in the templates? I can't find any documentation about this, only for plugins or getting the message. My use-case is, I am checking if a user is allowed to access a certain page and if they cannot I want to set a flash message, then redirect them to another page. I prefer this than to...
2019/01/12
[ "https://craftcms.stackexchange.com/questions/29094", "https://craftcms.stackexchange.com", "https://craftcms.stackexchange.com/users/4993/" ]
You can set [flash messages](https://www.yiiframework.com/doc/guide/2.0/en/runtime-sessions-cookies#flash-data) using [yii\web\Session::setFlash()](https://www.yiiframework.com/doc/api/2.0/yii-web-session#setFlash()-detail). The `session` component is available to templates via `craft.app.session`. ``` {% do craft.ap...
**Edit: Brandon replied as I was writing this. Feel free to remove :)** You can do that using this in your conditional, just above your redirect tag ``` {% do craft.app.session.setFlash('error', 'no no no') %} {% redirect "tosomewhere" %} ``` Then in the template you are redirecting to ``` {% set message = craft.a...
212,569
Following a previous discussion about **I would like** vs **I would have liked**, I have a similar question. What is the difference between > > I wanted to come to your party but I couldn't > > > I would have liked to come to your party but I couldn't. > > >
2019/05/28
[ "https://ell.stackexchange.com/questions/212569", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/96204/" ]
This sounds like one of those rules that someone made up because they could think of examples where breaking it caused problems, but didn't try to think through if breaking it would ALWAYS cause problems. Well, off the top let me point out that the rule as worded, "never use two possessives in a row", is clearly wrong...
"Our today's meeting" means literally "(the) meeting of our today". This is why it's wrong. I believe we all agree that nobody would say "meeting of our today".
212,569
Following a previous discussion about **I would like** vs **I would have liked**, I have a similar question. What is the difference between > > I wanted to come to your party but I couldn't > > > I would have liked to come to your party but I couldn't. > > >
2019/05/28
[ "https://ell.stackexchange.com/questions/212569", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/96204/" ]
I've answered essentially the same question over at english.stackexchange.com: [Why is “our today's meeting” wrong?](https://english.stackexchange.com/questions/251561/why-is-our-todays-meeting-wrong) Usually, a noun phrase in English must have exactly one determiner: you can say "I drove this car" or "I drove my car"...
It's either: > > Last week's meeting > > > or: > > Our meeting last week > > > but I agree with your teacher that: > > Our last week's meeting > > > sounds awkward and should probably be avoided.
212,569
Following a previous discussion about **I would like** vs **I would have liked**, I have a similar question. What is the difference between > > I wanted to come to your party but I couldn't > > > I would have liked to come to your party but I couldn't. > > >
2019/05/28
[ "https://ell.stackexchange.com/questions/212569", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/96204/" ]
There isn't a rule that you can't use two possessives, but they don't indicate possession of the noun at the end, but instead each one modifies the next phrase. > > Our last week's meeting > > > Is naturally read as > > (Our last week)'s meeting > > > So, unless you are talking about meeting someone with i...
You can use two possessives in a row, that is not an issue. For example, if I have a cat, and my cat has a toy, I can say "my cat's toy." If there is a manufacturer for that toy, it would be somewhat acceptable, although convoluted, to say "my cat's toy's manufacturer," which would be three possessives in a row. If tha...
212,569
Following a previous discussion about **I would like** vs **I would have liked**, I have a similar question. What is the difference between > > I wanted to come to your party but I couldn't > > > I would have liked to come to your party but I couldn't. > > >
2019/05/28
[ "https://ell.stackexchange.com/questions/212569", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/96204/" ]
There is no such rule: "our last week's meeting" is perfectly grammatical. There could be a last week's meeting that is not our: "the other team's last week's meeting raised the issue that we covering in our this week's meeting". The phrase "in our last week's episode" is often heard in broadcasting, from native speak...
"Our today's meeting" means literally "(the) meeting of our today". This is why it's wrong. I believe we all agree that nobody would say "meeting of our today".
212,569
Following a previous discussion about **I would like** vs **I would have liked**, I have a similar question. What is the difference between > > I wanted to come to your party but I couldn't > > > I would have liked to come to your party but I couldn't. > > >
2019/05/28
[ "https://ell.stackexchange.com/questions/212569", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/96204/" ]
I've answered essentially the same question over at english.stackexchange.com: [Why is “our today's meeting” wrong?](https://english.stackexchange.com/questions/251561/why-is-our-todays-meeting-wrong) Usually, a noun phrase in English must have exactly one determiner: you can say "I drove this car" or "I drove my car"...
There isn't a rule that you can't use two possessives, but they don't indicate possession of the noun at the end, but instead each one modifies the next phrase. > > Our last week's meeting > > > Is naturally read as > > (Our last week)'s meeting > > > So, unless you are talking about meeting someone with i...
212,569
Following a previous discussion about **I would like** vs **I would have liked**, I have a similar question. What is the difference between > > I wanted to come to your party but I couldn't > > > I would have liked to come to your party but I couldn't. > > >
2019/05/28
[ "https://ell.stackexchange.com/questions/212569", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/96204/" ]
I've answered essentially the same question over at english.stackexchange.com: [Why is “our today's meeting” wrong?](https://english.stackexchange.com/questions/251561/why-is-our-todays-meeting-wrong) Usually, a noun phrase in English must have exactly one determiner: you can say "I drove this car" or "I drove my car"...
> > Our last week's meeting > > > is a little akward, but I for one do **not** think that it is incorrect. The answer by Tanner Swett says "it's never acceptable for a noun phrase to have more than one determiner." However, [the Wikipedia article](https://en.wikipedia.org/wiki/English_determiners#Combinations_of...
212,569
Following a previous discussion about **I would like** vs **I would have liked**, I have a similar question. What is the difference between > > I wanted to come to your party but I couldn't > > > I would have liked to come to your party but I couldn't. > > >
2019/05/28
[ "https://ell.stackexchange.com/questions/212569", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/96204/" ]
I've answered essentially the same question over at english.stackexchange.com: [Why is “our today's meeting” wrong?](https://english.stackexchange.com/questions/251561/why-is-our-todays-meeting-wrong) Usually, a noun phrase in English must have exactly one determiner: you can say "I drove this car" or "I drove my car"...
This sounds like one of those rules that someone made up because they could think of examples where breaking it caused problems, but didn't try to think through if breaking it would ALWAYS cause problems. Well, off the top let me point out that the rule as worded, "never use two possessives in a row", is clearly wrong...
212,569
Following a previous discussion about **I would like** vs **I would have liked**, I have a similar question. What is the difference between > > I wanted to come to your party but I couldn't > > > I would have liked to come to your party but I couldn't. > > >
2019/05/28
[ "https://ell.stackexchange.com/questions/212569", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/96204/" ]
> > Our last week's meeting > > > is a little akward, but I for one do **not** think that it is incorrect. The answer by Tanner Swett says "it's never acceptable for a noun phrase to have more than one determiner." However, [the Wikipedia article](https://en.wikipedia.org/wiki/English_determiners#Combinations_of...
You can use two possessives in a row, that is not an issue. For example, if I have a cat, and my cat has a toy, I can say "my cat's toy." If there is a manufacturer for that toy, it would be somewhat acceptable, although convoluted, to say "my cat's toy's manufacturer," which would be three possessives in a row. If tha...
212,569
Following a previous discussion about **I would like** vs **I would have liked**, I have a similar question. What is the difference between > > I wanted to come to your party but I couldn't > > > I would have liked to come to your party but I couldn't. > > >
2019/05/28
[ "https://ell.stackexchange.com/questions/212569", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/96204/" ]
I've answered essentially the same question over at english.stackexchange.com: [Why is “our today's meeting” wrong?](https://english.stackexchange.com/questions/251561/why-is-our-todays-meeting-wrong) Usually, a noun phrase in English must have exactly one determiner: you can say "I drove this car" or "I drove my car"...
You can use two possessives in a row, that is not an issue. For example, if I have a cat, and my cat has a toy, I can say "my cat's toy." If there is a manufacturer for that toy, it would be somewhat acceptable, although convoluted, to say "my cat's toy's manufacturer," which would be three possessives in a row. If tha...
212,569
Following a previous discussion about **I would like** vs **I would have liked**, I have a similar question. What is the difference between > > I wanted to come to your party but I couldn't > > > I would have liked to come to your party but I couldn't. > > >
2019/05/28
[ "https://ell.stackexchange.com/questions/212569", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/96204/" ]
It's either: > > Last week's meeting > > > or: > > Our meeting last week > > > but I agree with your teacher that: > > Our last week's meeting > > > sounds awkward and should probably be avoided.
"Our today's meeting" means literally "(the) meeting of our today". This is why it's wrong. I believe we all agree that nobody would say "meeting of our today".
73,829,087
I've created a control and it has a bindable property, but when I try to set its value, it does not set, when I check its setter, it's not getting hit while debugging, not sure what am I doing wrong. ``` public decimal MetricValue { get => (decimal)GetValue(MetricValueProperty); set => ...
2022/09/23
[ "https://Stackoverflow.com/questions/73829087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6155965/" ]
``` LiteDB `5.x` is .NET Framework 4.5 and .NET Standard 2.0 compatible. You can work with LiteDB in any target framework that .NE TStantard 2.0 is compatible, like: - .NET 5 - .NET Core 2+ - .NET Framework 4.6.1 - Mono 5.4 - Xamarin.iOS 10.14 - Xamarin.Mac 3.8 - Xamarin.Android 8 - UWP 10.0.16299 - Unity 2018.1 http...
Found that actually liteDB '5.x' works fine with .NET 6. I was just having some trouble with the installation
6,413,842
> > **Possible Duplicate:** > > [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) > > > I understand using the `@` symbol is like an escape character for a string. However, I have the following line as a path to store a file to a m...
2011/06/20
[ "https://Stackoverflow.com/questions/6413842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
The **@** symbol in front of a string literal tells the compiler to ignore and escape sequences in the string (ie things that begin with a slash) and just to create the string "as-is" It can also be used to create variables whose name is a reserved work. For example: ``` int @class=10; ``` If you don't prefix the @...
The @ symbol goes right before the quotes. It only works on string literals, and it simply changes the way the string is understood by the compiler. The main thing it does is cause `\` to be interpreted as a literal backslash, rather than escaping the next character. So you want: ``` String location = args[0] + id + @...
6,413,842
> > **Possible Duplicate:** > > [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) > > > I understand using the `@` symbol is like an escape character for a string. However, I have the following line as a path to store a file to a m...
2011/06/20
[ "https://Stackoverflow.com/questions/6413842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
It is used for two things: * create "verbatim" strings (ignores the escape character): `string path = @"C:\Windows"` * escape language keywords to use them as identifiers: `string @class = "foo"` In your case you need to do this: ``` String location = args[0] + id + @"\\"; ```
In this case you may not need to use @; just make it ``` String location = args[0] + id + "\\"; ```
6,413,842
> > **Possible Duplicate:** > > [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) > > > I understand using the `@` symbol is like an escape character for a string. However, I have the following line as a path to store a file to a m...
2011/06/20
[ "https://Stackoverflow.com/questions/6413842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
The @ prefix means the string is a literal string and the processing of escape characters is not performed by the compiler, so: ``` @"\n" ``` is not translated to a newline character. Without it, you'd have: ``` String location = "\\\\192.168.2.10\\datastore\\\\" + id + "\\\\"; ``` which looks a bit messy. The '@...
The @ symbol goes right before the quotes. It only works on string literals, and it simply changes the way the string is understood by the compiler. The main thing it does is cause `\` to be interpreted as a literal backslash, rather than escaping the next character. So you want: ``` String location = args[0] + id + @...
6,413,842
> > **Possible Duplicate:** > > [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) > > > I understand using the `@` symbol is like an escape character for a string. However, I have the following line as a path to store a file to a m...
2011/06/20
[ "https://Stackoverflow.com/questions/6413842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
The @ prefix means the string is a literal string and the processing of escape characters is not performed by the compiler, so: ``` @"\n" ``` is not translated to a newline character. Without it, you'd have: ``` String location = "\\\\192.168.2.10\\datastore\\\\" + id + "\\\\"; ``` which looks a bit messy. The '@...
By default the '\' character is an escape character for strings in C#. That means that if you want to have a backslash in your string you need two slashes the first to escape the second as follows: ``` string escaped = "This is a backslash \\"; //The value of escaped is - This is a backslash \ ``` An easier example ...
6,413,842
> > **Possible Duplicate:** > > [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) > > > I understand using the `@` symbol is like an escape character for a string. However, I have the following line as a path to store a file to a m...
2011/06/20
[ "https://Stackoverflow.com/questions/6413842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
In this case you may not need to use @; just make it ``` String location = args[0] + id + "\\"; ```
By default the '\' character is an escape character for strings in C#. That means that if you want to have a backslash in your string you need two slashes the first to escape the second as follows: ``` string escaped = "This is a backslash \\"; //The value of escaped is - This is a backslash \ ``` An easier example ...
6,413,842
> > **Possible Duplicate:** > > [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) > > > I understand using the `@` symbol is like an escape character for a string. However, I have the following line as a path to store a file to a m...
2011/06/20
[ "https://Stackoverflow.com/questions/6413842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
@-quoted string literals start with @ and are enclosed in double quotation marks. For example: ``` @"good morning" // a string literal ``` The advantage of @-quoting is that escape sequences are not processed, which makes it easy to write, for example, a fully qualified file name: ``` @"c:\Docs\Source\a.txt" // r...
The @ symbol is only relevant for string literals in code. Variables should never modify the contents of a string.
6,413,842
> > **Possible Duplicate:** > > [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) > > > I understand using the `@` symbol is like an escape character for a string. However, I have the following line as a path to store a file to a m...
2011/06/20
[ "https://Stackoverflow.com/questions/6413842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
The **@** symbol in front of a string literal tells the compiler to ignore and escape sequences in the string (ie things that begin with a slash) and just to create the string "as-is" It can also be used to create variables whose name is a reserved work. For example: ``` int @class=10; ``` If you don't prefix the @...
If you load from the command line, it will already be escaped for you. This is why your escapes are "ignored" from your perspective. Note that the same is true when you load from config, so don't do this: ``` <add key="pathToFile" value="C:\\myDirectory\\myFile.txt"/> ``` If you do, you end up with double strings, a...
6,413,842
> > **Possible Duplicate:** > > [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) > > > I understand using the `@` symbol is like an escape character for a string. However, I have the following line as a path to store a file to a m...
2011/06/20
[ "https://Stackoverflow.com/questions/6413842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
The `@` symbol has two uses in C#. 1. To use a quotes instead of escaping. "\windows" can be represented as @"\windows". "\"John!\"" can be represented @"""John!""". 2. To escape variable names (for example to use a keyword as a parameter name) private static void InsertSafe (string item, object @lock) { lock (@loc...
If you load from the command line, it will already be escaped for you. This is why your escapes are "ignored" from your perspective. Note that the same is true when you load from config, so don't do this: ``` <add key="pathToFile" value="C:\\myDirectory\\myFile.txt"/> ``` If you do, you end up with double strings, a...
6,413,842
> > **Possible Duplicate:** > > [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) > > > I understand using the `@` symbol is like an escape character for a string. However, I have the following line as a path to store a file to a m...
2011/06/20
[ "https://Stackoverflow.com/questions/6413842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
It is used for two things: * create "verbatim" strings (ignores the escape character): `string path = @"C:\Windows"` * escape language keywords to use them as identifiers: `string @class = "foo"` In your case you need to do this: ``` String location = args[0] + id + @"\\"; ```
The @ symbol goes right before the quotes. It only works on string literals, and it simply changes the way the string is understood by the compiler. The main thing it does is cause `\` to be interpreted as a literal backslash, rather than escaping the next character. So you want: ``` String location = args[0] + id + @...
6,413,842
> > **Possible Duplicate:** > > [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) > > > I understand using the `@` symbol is like an escape character for a string. However, I have the following line as a path to store a file to a m...
2011/06/20
[ "https://Stackoverflow.com/questions/6413842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51649/" ]
The **@** symbol in front of a string literal tells the compiler to ignore and escape sequences in the string (ie things that begin with a slash) and just to create the string "as-is" It can also be used to create variables whose name is a reserved work. For example: ``` int @class=10; ``` If you don't prefix the @...
The @ symbol is only relevant for string literals in code. Variables should never modify the contents of a string.
6,625,598
My iPhone app badly leaks when flipping back and forth between a main uiviewcontroller and a help uiviewcontroller . Here is the source of the main view, followed by source of the help view. MAIN VIEW - FLIP TO HELP..................... ``` // Changes from operational view to Help view. - (IBAction)showHelp:(id)send...
2011/07/08
[ "https://Stackoverflow.com/questions/6625598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/746100/" ]
You are creating a controller with ref count of 1 and a local reference each time `showHelp:` is called: ``` HelpView *controller = [[HelpView alloc] initWithNibName:@"HelpView" bundle:nil]; ``` you are losing your reference to it at the end of this method. You happen to have references to it in `done:` (self) and ...
You could well be leaking on this line ``` controller.delegate = self; ``` What is your property declaration for the delegate. If it's anything other than assign, then you either need to change it (*preferred option*) or make sure you are releasing it in the `dealloc` method of `HelpView` controller.
69,474,555
--- **Thanks everyone, especially Mr.Drew Reese. If you are newbie as me, see his [answer](https://stackoverflow.com/a/69474833/14745811).** --- I don't know why but when I console log state **data** if I use **useEffect**, it always rerender although state **generalInfo** not change :/ so someone can help me to fix...
2021/10/07
[ "https://Stackoverflow.com/questions/69474555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14745811/" ]
in your `useEfect` you are setting `generalInfo` and it causes change in the dependency array of `useEffect`. So, it runs over and over: ``` useEffect(() => { onGetGeneralInfo(); setData(generalInfo); }, [generalInfo]); ``` try this instead: ``` useEffect(() => { onGetGeneralInfo(); setData(ge...
Yow hook has or uses things that are not listed in the dependencies list ``` useEffect(() => { onGetGeneralInfo(); setData(generalInfo); }, [ onGetGeneralInfo, setData, generalInfo]); ``` Also let's remember that useEffect is call before the component mounts and after it mounts, so if you add a log it ...
69,474,555
--- **Thanks everyone, especially Mr.Drew Reese. If you are newbie as me, see his [answer](https://stackoverflow.com/a/69474833/14745811).** --- I don't know why but when I console log state **data** if I use **useEffect**, it always rerender although state **generalInfo** not change :/ so someone can help me to fix...
2021/10/07
[ "https://Stackoverflow.com/questions/69474555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14745811/" ]
> > the initial state in redux and state in component is an empty array. > so I want to GET data from API. and I push it to redux's state. then I > useState it. I want to use useEffect because I want to update state > when I PUT the data and update local state after update. > > > Ok, so I've gathered that you want...
in your `useEfect` you are setting `generalInfo` and it causes change in the dependency array of `useEffect`. So, it runs over and over: ``` useEffect(() => { onGetGeneralInfo(); setData(generalInfo); }, [generalInfo]); ``` try this instead: ``` useEffect(() => { onGetGeneralInfo(); setData(ge...
69,474,555
--- **Thanks everyone, especially Mr.Drew Reese. If you are newbie as me, see his [answer](https://stackoverflow.com/a/69474833/14745811).** --- I don't know why but when I console log state **data** if I use **useEffect**, it always rerender although state **generalInfo** not change :/ so someone can help me to fix...
2021/10/07
[ "https://Stackoverflow.com/questions/69474555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14745811/" ]
> > the initial state in redux and state in component is an empty array. > so I want to GET data from API. and I push it to redux's state. then I > useState it. I want to use useEffect because I want to update state > when I PUT the data and update local state after update. > > > Ok, so I've gathered that you want...
Yow hook has or uses things that are not listed in the dependencies list ``` useEffect(() => { onGetGeneralInfo(); setData(generalInfo); }, [ onGetGeneralInfo, setData, generalInfo]); ``` Also let's remember that useEffect is call before the component mounts and after it mounts, so if you add a log it ...
53,497,455
I have default laravel `users` table and my custom `educations` table in my database. In `educations` table users can save education histories. Example `educations` data: ``` ------------------------------------------------------------ id | user_id | university | speciality | finish_year | level --------------------...
2018/11/27
[ "https://Stackoverflow.com/questions/53497455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7496039/" ]
Considering that you have a `educations` method in your User model that represents a `HasMany` association, you can use eloquent's `has` (or `whereHas`) method: ``` $users = App\User::whereHas('educations', function ($query) { $query->where('level', 4); })->get(); ``` Here's a link to the [docs](https://laravel....
If you have the relationship setup correctly, so in your `User` model you should have something like this: ``` public function educations() { return $this->hasMany(Education::class); } ``` Then a simple use will be the following: ``` User::with(['educations' => function($query) { $query->where('level', 4); ...
5,059,506
I am trying to clean up some of my projects, and one of the things that are puzzling me is how to deal with header files in static libraries that I have added as "project dependencies" (by adding the project file itself). The basic structure is like this: ``` MyProject.xcodeproj Contrib thirdPartyLibrary.xcodep...
2011/02/20
[ "https://Stackoverflow.com/questions/5059506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292477/" ]
If I understand correctly, I believe you want to add a path containing $(BUILT\_PRODUCTS\_DIR) to the HEADER\_SEARCH\_PATHS in your projects build settings. As an example, I took an existing iOS project which contains a static library, which is included just in the way you describe, and set the libraries header files ...
I think that your solution is sufficient and a generally accepted one. One alternative would be to have all header files located under an umbrella directory that can describe the interface to using the depended-on libraries and put that in your include path. I see this as being similar to /usr/include. Another alternat...
5,059,506
I am trying to clean up some of my projects, and one of the things that are puzzling me is how to deal with header files in static libraries that I have added as "project dependencies" (by adding the project file itself). The basic structure is like this: ``` MyProject.xcodeproj Contrib thirdPartyLibrary.xcodep...
2011/02/20
[ "https://Stackoverflow.com/questions/5059506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292477/" ]
I think that your solution is sufficient and a generally accepted one. One alternative would be to have all header files located under an umbrella directory that can describe the interface to using the depended-on libraries and put that in your include path. I see this as being similar to /usr/include. Another alternat...
The way we do it is to go into build target settings for the main project and add: ``` User Header Search Path = "Contrib" ``` and check that it searches recursively. We don't see performance problems with searching recursively even with many (10-15 in some projects) dependencies.
5,059,506
I am trying to clean up some of my projects, and one of the things that are puzzling me is how to deal with header files in static libraries that I have added as "project dependencies" (by adding the project file itself). The basic structure is like this: ``` MyProject.xcodeproj Contrib thirdPartyLibrary.xcodep...
2011/02/20
[ "https://Stackoverflow.com/questions/5059506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292477/" ]
If I understand correctly, I believe you want to add a path containing $(BUILT\_PRODUCTS\_DIR) to the HEADER\_SEARCH\_PATHS in your projects build settings. As an example, I took an existing iOS project which contains a static library, which is included just in the way you describe, and set the libraries header files ...
The way we do it is to go into build target settings for the main project and add: ``` User Header Search Path = "Contrib" ``` and check that it searches recursively. We don't see performance problems with searching recursively even with many (10-15 in some projects) dependencies.
53,719,824
Say I have an array of objects like so: ``` [{"taco":"","burrito":"","scone":"","beans":"true"}, {"taco":"true","burrito":"","scone":"true","beans":""}, {"taco":"true","burrito":"","scone":"","beans":""}, {"taco":"true","burrito":"","scone":"","beans":"true"}] ``` I need to count the occurrence of each element an...
2018/12/11
[ "https://Stackoverflow.com/questions/53719824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9633658/" ]
**You can try this** You can do it with `reduce()`. What i have done is first i check is the **`object property of current element`** if it is already in **`output object`**. If it's present than i check the value of **`current element property`**. if it is true than i increment the property of **`output object`** by...
Try this: ```js var data = [{ taco: "", burrito: "", scone: "", beans: "true" }, { taco: "true", burrito: "", scone: "true", beans: "" }, { taco: "", burrito, "true", scone: "", beans: "", }, { taco...
53,719,824
Say I have an array of objects like so: ``` [{"taco":"","burrito":"","scone":"","beans":"true"}, {"taco":"true","burrito":"","scone":"true","beans":""}, {"taco":"true","burrito":"","scone":"","beans":""}, {"taco":"true","burrito":"","scone":"","beans":"true"}] ``` I need to count the occurrence of each element an...
2018/12/11
[ "https://Stackoverflow.com/questions/53719824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9633658/" ]
**You can try this** You can do it with `reduce()`. What i have done is first i check is the **`object property of current element`** if it is already in **`output object`**. If it's present than i check the value of **`current element property`**. if it is true than i increment the property of **`output object`** by...
You can loop through the array and then loop through the keys of each object. Then increment the `key` of the `countObject` if it already exists or assign it zero. This is dynamic. Even if one of the object has an extra `key`, it will count them. This doesn't expect all the items of array to have the same keys. ```js...
23,241
I'm sure there will be variation depending on what the contaminated item or surface is made of - linens, I could imagine, would remain dangerous for longer than a door-knob. But if the items are not decontaminated in some way, how long can the virus survive outside a host?
2014/10/17
[ "https://biology.stackexchange.com/questions/23241", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/9817/" ]
This really depends on the environment, one study (listed below as reference 1) found that the Ebola virus can survive under ideal conditions on flat surfaces in the dark for up to six days - see the figure from the same publication. ![enter image description here](https://i.stack.imgur.com/0dLLL.gif) However, the v...
I found this safety sheet in the topic. > > SECTION IV – STABILITY AND VIABILITY > > > DRUG SUSCEPTIBILITY: Unknown. S-adenosylhomocysteine hydrolase > inhibitors have been found to have complete mortality protection in > mice infected with a lethal dose of Ebola virus (30). > > > DRUG RESISTANCE: There are no...
42,232,606
I'm using Django 1.10 and trying to catch all exceptions with exception middleware. The code below causes an internal server error: ``` mw_instance = middleware(handler) TypeError: object() takes no parameters ``` views.py ``` from django.http import HttpResponse def my_view(request): x = 1/0 # cause an excep...
2017/02/14
[ "https://Stackoverflow.com/questions/42232606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/984003/" ]
Since you are using the new `MIDDLEWARE` settings, your Middleware class must accept a `get_response` argument: <https://docs.djangoproject.com/en/1.10/topics/http/middleware/#writing-your-own-middleware> You could write your class like this: ``` from django.http import HttpResponse class ExceptionMiddleware(object)...
in the newer version of Django, the middleware should be written like this ``` import datetime from django.core.cache import cache from django.conf import settings from django.utils.deprecation import MiddlewareMixin class ActiveUserMiddleware(MiddlewareMixin): def process_request(self, request): curren...
59,278,991
Alright I'm trying to allow user input to include only letters, numbers, and dashes. Any other characters would be invalid. I also only want the characters to be 1-9 characters in length. Here is what I have so far: ``` def main(): tag = input("Please enter your ID Tag: ") while(not rSeriesValidate(tag)): ...
2019/12/11
[ "https://Stackoverflow.com/questions/59278991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you don't want to use regular expressions, try simply going character by character: ``` def rSeriesValidate(tag): if len(tag) < 1 or len(tag) > 9: return False for currChar in tag: if not currChar.isalnum() and currChar != "-": return False return True ``` This first che...
Use `regex` to solve your problem. Example below: ``` import re #pattern to search for any character other then [- A-Z a-z 0-9] pattern = r'[^\-A-Za-z0-9]' def check_str(sample_str): if re.search(pattern, sample_str): #Character other then [- A-Z a-z 0-9] was found print('Invalid : {}'.format(sam...
59,278,991
Alright I'm trying to allow user input to include only letters, numbers, and dashes. Any other characters would be invalid. I also only want the characters to be 1-9 characters in length. Here is what I have so far: ``` def main(): tag = input("Please enter your ID Tag: ") while(not rSeriesValidate(tag)): ...
2019/12/11
[ "https://Stackoverflow.com/questions/59278991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you don't want to use regular expressions, try simply going character by character: ``` def rSeriesValidate(tag): if len(tag) < 1 or len(tag) > 9: return False for currChar in tag: if not currChar.isalnum() and currChar != "-": return False return True ``` This first che...
There are several ways to tackle this problem: Check each character in the tag: ``` def rSeriesValidate(tag): return 1 <= len(tag) <= 9 and all(ch.isalnum() or ch=='-' for ch in tag) ``` Split the tag on '-' and test each part with `isalnum()`: ``` def rSeriesValidate(tag): return 1 <= len(tag) <= 9 and ...
5,485,338
What version of Eclipse do I need for Google Web Toolkit? I see about 7 versions, but none make any references to GWT. Google doesn't mention it to. I did install the PHP version.
2011/03/30
[ "https://Stackoverflow.com/questions/5485338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340761/" ]
Since GWT means Java programming I would recommend the Java (default) Version of Eclipse or Java EE Version because they contain the Java Development Tools which will help you very when coding in Java
I suppose you should install JavaEE version.. Because GWT produce a war file, and it should be deployed to a web application server.
5,485,338
What version of Eclipse do I need for Google Web Toolkit? I see about 7 versions, but none make any references to GWT. Google doesn't mention it to. I did install the PHP version.
2011/03/30
[ "https://Stackoverflow.com/questions/5485338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340761/" ]
Definitely the Java EE version. The regular java version doesn't seem to work with the google plugin.
Since GWT means Java programming I would recommend the Java (default) Version of Eclipse or Java EE Version because they contain the Java Development Tools which will help you very when coding in Java
5,485,338
What version of Eclipse do I need for Google Web Toolkit? I see about 7 versions, but none make any references to GWT. Google doesn't mention it to. I did install the PHP version.
2011/03/30
[ "https://Stackoverflow.com/questions/5485338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340761/" ]
Well I download the Eclipse for Java EE: <http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/heliossr2> But one which is great is Spring STS (based on eclipse). You can choose to install GWT at the beginning. <http://www.springsource.com/downloads/sts>
I suppose you should install JavaEE version.. Because GWT produce a war file, and it should be deployed to a web application server.
5,485,338
What version of Eclipse do I need for Google Web Toolkit? I see about 7 versions, but none make any references to GWT. Google doesn't mention it to. I did install the PHP version.
2011/03/30
[ "https://Stackoverflow.com/questions/5485338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340761/" ]
Definitely the Java EE version. The regular java version doesn't seem to work with the google plugin.
I suppose you should install JavaEE version.. Because GWT produce a war file, and it should be deployed to a web application server.
5,485,338
What version of Eclipse do I need for Google Web Toolkit? I see about 7 versions, but none make any references to GWT. Google doesn't mention it to. I did install the PHP version.
2011/03/30
[ "https://Stackoverflow.com/questions/5485338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340761/" ]
Definitely the Java EE version. The regular java version doesn't seem to work with the google plugin.
Well I download the Eclipse for Java EE: <http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/heliossr2> But one which is great is Spring STS (based on eclipse). You can choose to install GWT at the beginning. <http://www.springsource.com/downloads/sts>
1,441,063
I have some code like: ``` Lookup(Of String)("Testing") Lookup(Of Integer)("Testing") ``` And both of those Lookups work great. What I'm trying to is call the appropriate LookUp based on the type of another variable. Something that would look like... ``` Lookup(Of GetType(MyStringVariable))("Testing") ``` I've tr...
2009/09/17
[ "https://Stackoverflow.com/questions/1441063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73381/" ]
You do not specify the full signature for the method that you're calling, but my psychic powers tell me that it is this: ``` Function Lookup(Of T)(key As String) As T ``` And you want to avoid having to repeat `Integer` twice as in the example below: ``` Dim x As Integer x = Lookup(Of Integer)("foo"); ``` The pro...
One solution to this is to use reflection. See this [question](https://stackoverflow.com/questions/232535/how-to-use-reflection-to-call-generic-method) for details.
1,441,063
I have some code like: ``` Lookup(Of String)("Testing") Lookup(Of Integer)("Testing") ``` And both of those Lookups work great. What I'm trying to is call the appropriate LookUp based on the type of another variable. Something that would look like... ``` Lookup(Of GetType(MyStringVariable))("Testing") ``` I've tr...
2009/09/17
[ "https://Stackoverflow.com/questions/1441063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73381/" ]
You do not specify the full signature for the method that you're calling, but my psychic powers tell me that it is this: ``` Function Lookup(Of T)(key As String) As T ``` And you want to avoid having to repeat `Integer` twice as in the example below: ``` Dim x As Integer x = Lookup(Of Integer)("foo"); ``` The pro...
The VB.NET compiler in VS2008 actually uses type-inference. That means if you are using a generic method, and one of the parameters is of the generic type, then you don't need to specify the generic type in your call. Take the following definition... ``` Function DoSomething(Of T)(Target As T) As Boolean ``` If ...
1,441,063
I have some code like: ``` Lookup(Of String)("Testing") Lookup(Of Integer)("Testing") ``` And both of those Lookups work great. What I'm trying to is call the appropriate LookUp based on the type of another variable. Something that would look like... ``` Lookup(Of GetType(MyStringVariable))("Testing") ``` I've tr...
2009/09/17
[ "https://Stackoverflow.com/questions/1441063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/73381/" ]
You do not specify the full signature for the method that you're calling, but my psychic powers tell me that it is this: ``` Function Lookup(Of T)(key As String) As T ``` And you want to avoid having to repeat `Integer` twice as in the example below: ``` Dim x As Integer x = Lookup(Of Integer)("foo"); ``` The pro...
You can't use a dynamic type unless you do runtime compiling, which of course is really inefficient. Although generics allows you to use different types, the type still has to be known at compile time so that the compiler can generate the specific code for that type. This is not the way to go. You should ask about wh...
49,649,819
I am currently using this code to screen capture the panel I created, but whenever I am saving it, the quality is bad. Is there any way to maintain the good quality when saving it? I tried resizing the panel but the result is still the same. I tried doing a normal screen shot with the snipping tool and it also has the...
2018/04/04
[ "https://Stackoverflow.com/questions/49649819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7899801/" ]
This is what I use to save a screenshot: ``` using System.Drawing; using System.Drawing.Imaging; using System.IO; private void SaveControlAsImage(Control control, string path) { Bitmap bitmap = new Bitmap(control.Width, control.Height); control.DrawToBitmap(bitmap, control.Bounds); using (FileStream fs = n...
Windows Forms is not using vector graphics to draw the user interface. Therefore, all you can get generically is to draw the control to a Bitmap instead of to the screen. This works independently of whether your control is visible on the screen, but there is not more than that. If you want a higher-resolution image fro...
49,649,819
I am currently using this code to screen capture the panel I created, but whenever I am saving it, the quality is bad. Is there any way to maintain the good quality when saving it? I tried resizing the panel but the result is still the same. I tried doing a normal screen shot with the snipping tool and it also has the...
2018/04/04
[ "https://Stackoverflow.com/questions/49649819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7899801/" ]
``` Bitmap bmp= new Bitmap(controls.Width, controls.Height-50, System.Drawing.Imaging.PixelFormat.Format32bppArgb); Graphics Grap = Graphics.FromImage(bmp); Grap.CopyFromScreen(PointToScreen(controls.Location).X, PointToScreen(controls.Location).Y, 0, 0, AnhDoThi.Size, CopyPixelOperation.SourceCopy); SaveFileDialog sa...
Windows Forms is not using vector graphics to draw the user interface. Therefore, all you can get generically is to draw the control to a Bitmap instead of to the screen. This works independently of whether your control is visible on the screen, but there is not more than that. If you want a higher-resolution image fro...