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
577,427
In c# how do I evenly divide 100 into 7? So the result would be 1. 16 2. 14 3. 14 4. 14 5. 14 6. 14 7. 14 The code below is incorrect as all 7 values are set to 15 (totalling 105). ``` double [] vals = new double[7]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Ceiling...
2009/02/23
[ "https://Stackoverflow.com/questions/577427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
To get my suggested result of 15, 15, 14, 14, 14, 14, 14: ``` // This doesn't try to cope with negative numbers :) public static IEnumerable<int> DivideEvenly(int numerator, int denominator) { int rem; int div = Math.DivRem(numerator, denominator, out rem); for (int i=0; i < denominator; i++) { ...
Not sure why you are working with doubles but wanting integer division semantics. ``` double input = 100; const int Buckets = 7; double[] vals = new double[Buckets]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Floor(input / Buckets); } double remainder = input % Buckets; ...
577,427
In c# how do I evenly divide 100 into 7? So the result would be 1. 16 2. 14 3. 14 4. 14 5. 14 6. 14 7. 14 The code below is incorrect as all 7 values are set to 15 (totalling 105). ``` double [] vals = new double[7]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Ceiling...
2009/02/23
[ "https://Stackoverflow.com/questions/577427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Since this seems to be homework, here is a hint and not the full code. You are doing Math.Ceiling and it converts 14.28 into 15.
Not sure why you are working with doubles but wanting integer division semantics. ``` double input = 100; const int Buckets = 7; double[] vals = new double[Buckets]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Floor(input / Buckets); } double remainder = input % Buckets; ...
577,427
In c# how do I evenly divide 100 into 7? So the result would be 1. 16 2. 14 3. 14 4. 14 5. 14 6. 14 7. 14 The code below is incorrect as all 7 values are set to 15 (totalling 105). ``` double [] vals = new double[7]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Ceiling...
2009/02/23
[ "https://Stackoverflow.com/questions/577427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The algorithm is this 1. Divide 100 by 7, put the result in X 2. Get the highest even number below X and put this in Y. 3. Multiply Y by 7 and put the answer in Z. 4. Take Z away from 100. The answer is then 6 lots of Y plus whatever the result of step 4 was. This algorithm may only work for this specific instance. ...
Not sure why you are working with doubles but wanting integer division semantics. ``` double input = 100; const int Buckets = 7; double[] vals = new double[Buckets]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Floor(input / Buckets); } double remainder = input % Buckets; ...
577,427
In c# how do I evenly divide 100 into 7? So the result would be 1. 16 2. 14 3. 14 4. 14 5. 14 6. 14 7. 14 The code below is incorrect as all 7 values are set to 15 (totalling 105). ``` double [] vals = new double[7]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Ceiling...
2009/02/23
[ "https://Stackoverflow.com/questions/577427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Since this seems to be homework, here is a hint and not the full code. You are doing Math.Ceiling and it converts 14.28 into 15.
The algorithm is this 1. Divide 100 by 7, put the result in X 2. Get the highest even number below X and put this in Y. 3. Multiply Y by 7 and put the answer in Z. 4. Take Z away from 100. The answer is then 6 lots of Y plus whatever the result of step 4 was. This algorithm may only work for this specific instance. ...
577,427
In c# how do I evenly divide 100 into 7? So the result would be 1. 16 2. 14 3. 14 4. 14 5. 14 6. 14 7. 14 The code below is incorrect as all 7 values are set to 15 (totalling 105). ``` double [] vals = new double[7]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Ceiling...
2009/02/23
[ "https://Stackoverflow.com/questions/577427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Since this seems to be homework, here is a hint and not the full code. You are doing Math.Ceiling and it converts 14.28 into 15.
Not sure if this is exactly what you are after, but I would think that if you use Math.ceiling you will always end up with too big a total. Math.floor would underestimate and leave you with a difference that can be added to one of your pieces as you see fit. For example by this method you might end up with 7 lots of 1...
577,427
In c# how do I evenly divide 100 into 7? So the result would be 1. 16 2. 14 3. 14 4. 14 5. 14 6. 14 7. 14 The code below is incorrect as all 7 values are set to 15 (totalling 105). ``` double [] vals = new double[7]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Ceiling...
2009/02/23
[ "https://Stackoverflow.com/questions/577427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
To get my suggested result of 15, 15, 14, 14, 14, 14, 14: ``` // This doesn't try to cope with negative numbers :) public static IEnumerable<int> DivideEvenly(int numerator, int denominator) { int rem; int div = Math.DivRem(numerator, denominator, out rem); for (int i=0; i < denominator; i++) { ...
Here you go: ``` Func<int, int, IEnumerable<int>> f = (a, b) => Enumerable.Range(0,a/b).Select((n) => a / b + ((a % b) <= n ? 0 : 1)) ``` Good luck explaining it in class though :)
577,427
In c# how do I evenly divide 100 into 7? So the result would be 1. 16 2. 14 3. 14 4. 14 5. 14 6. 14 7. 14 The code below is incorrect as all 7 values are set to 15 (totalling 105). ``` double [] vals = new double[7]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Ceiling...
2009/02/23
[ "https://Stackoverflow.com/questions/577427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Here you go: ``` Func<int, int, IEnumerable<int>> f = (a, b) => Enumerable.Range(0,a/b).Select((n) => a / b + ((a % b) <= n ? 0 : 1)) ``` Good luck explaining it in class though :)
Not sure why you are working with doubles but wanting integer division semantics. ``` double input = 100; const int Buckets = 7; double[] vals = new double[Buckets]; for (int i = 0; i < vals.Length; i++) { vals[i] = Math.Floor(input / Buckets); } double remainder = input % Buckets; ...
50,598,438
I am tracing a python script like this: ``` python -m trace --ignore-dir=$HOME/lib64:$HOME/lib:/usr -t bin/myscript.py ``` Some lines look like this: ``` --- modulename: __init__, funcname: getEffectiveLevel __init__.py(1325): logger = self __init__.py(1326): while logger: __init__.py(1327): ...
2018/05/30
[ "https://Stackoverflow.com/questions/50598438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/633961/" ]
if the purpose is finding the full path, then check [hunter](https://python-hunter.readthedocs.io/en/latest/readme.html#id1) project, it even has support for [query-style](https://python-hunter.readthedocs.io/en/latest/cookbook.html) tracing. ``` # a modified example from docs # do check the documentation it is easy t...
Unfortunately there is no flag/command-line option to enable that. So the immediate (and probably correct) answer is: **No**. If you're okay with messing with the built-in libraries you can easily make it possible by changing the line that reads: ``` print (" --- modulename: %s, funcname: %s" % (modulename, c...
50,598,438
I am tracing a python script like this: ``` python -m trace --ignore-dir=$HOME/lib64:$HOME/lib:/usr -t bin/myscript.py ``` Some lines look like this: ``` --- modulename: __init__, funcname: getEffectiveLevel __init__.py(1325): logger = self __init__.py(1326): while logger: __init__.py(1327): ...
2018/05/30
[ "https://Stackoverflow.com/questions/50598438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/633961/" ]
if the purpose is finding the full path, then check [hunter](https://python-hunter.readthedocs.io/en/latest/readme.html#id1) project, it even has support for [query-style](https://python-hunter.readthedocs.io/en/latest/cookbook.html) tracing. ``` # a modified example from docs # do check the documentation it is easy t...
You can create a `trace2.py` file with below content ``` from trace import Trace, main original_globaltrace_lt = Trace.globaltrace_lt def patch_Trace_globaltrace_lt(self, frame, why, arg): value = original_globaltrace_lt(self, frame, why, arg) if value: filename = frame.f_globals.get('__file__', "") ...
398,469
If the limit as $x$ approaches $3$ of $x^2$ is $9$, how do I use the epsilon delta definition to prove this? I was trying to work it out this way but could do figure out how.
2013/05/21
[ "https://math.stackexchange.com/questions/398469", "https://math.stackexchange.com", "https://math.stackexchange.com/users/74636/" ]
Anything specifying a *range* on a continuous parameter does not typically reduce the dimensionality of the system. If there exist points 'in the middle of' all the ranges, they are locally unaware of the boundary, and hence locally the dimensionality is unaffected. You have exactly one proper *constraint* on the moti...
I think it'll be helpful to first think of 1 dimensional physical space which for your case of $N$ non interacting particles is actually $2N$ dimensions (position and momentum). In this space, the conditions read: $$p\_i = c\_i,\ r\_i \in[0,l]$$ So the dimension of this space is simply $N$ (since $p$ is constant i.e. z...
2,991,514
Let $X(t) = A\_0 +A\_1t+A\_2t^2$, where $A\_i's$ are uncorrelated random variables with mean $0$ and variance $1$. Find the mean function and covariance function of $X(t)$. I do not have any clue on how to even begin this. Any help would be appreciated!
2018/11/09
[ "https://math.stackexchange.com/questions/2991514", "https://math.stackexchange.com", "https://math.stackexchange.com/users/595608/" ]
1) Mean Function: Remember that expectation $\mathbb{E}$ is linear. $$ \mathbb{E}[X(t)] = \mathbb{E}[A\_0 + A\_1t+ A\_2t^2] = \mathbb{E}[A\_0] + \mathbb{E}[A\_1]t + \mathbb{E}[A\_2]t^2 = 0 $$ 2) Covariance Function: Remember the definition $\text{Cov}(X,Y) = \mathbb{E}[XY] - \mathbb{E}[X]\cdot\mathbb{E}[Y]$. $$ \text{...
The question is, what's a formula for $m(t)=E(X(t))$ and for $$C(t,u)=\mathrm{Cov}(X(t),X(u))=E(X(t)X(u))-(E(X(t))(E(X(u))?$$ Which you can work out because you know the first two moments of the $A\_i$ used in the formula for $X(t)$.
2,768,142
The full sentence is "There exist 50 different types of sushi, and I have not had one of them." I understand that the two different interpretations of this sentence are: 1. There exist 50 different types of sushi, and I have had all but one of them. 2. There exist 50 different types of sushi, and I have not had any ...
2018/05/05
[ "https://math.stackexchange.com/questions/2768142", "https://math.stackexchange.com", "https://math.stackexchange.com/users/559197/" ]
Define $S$ to be the set of all types of sushi. For any $x\in S$, define $H(x)$ to be the statement "I have had sushi type $x$." (As a side note, you're saying $|S|=50$.) * "I have not had any of them" $\iff$ $\forall x\in S.\; \neg H(x)$ * "I have had all but one of them" $\iff$ $\exists y\in S.\; \left[\left(\neg H(...
I would say: 1. "I have not had any of them": $\forall x. \neg(\text{I have had }x)$. 2. "I have not had all of them": $\neg \forall x . (\text{I have had }x)$. 3. "There's one of them I haven't had": $\exists x.\neg(\text{I have had }x)$. 4. "There's exactly one of them I haven't had": $\exists! x.\neg(\text{I have h...
2,768,142
The full sentence is "There exist 50 different types of sushi, and I have not had one of them." I understand that the two different interpretations of this sentence are: 1. There exist 50 different types of sushi, and I have had all but one of them. 2. There exist 50 different types of sushi, and I have not had any ...
2018/05/05
[ "https://math.stackexchange.com/questions/2768142", "https://math.stackexchange.com", "https://math.stackexchange.com/users/559197/" ]
Define $S$ to be the set of all types of sushi. For any $x\in S$, define $H(x)$ to be the statement "I have had sushi type $x$." (As a side note, you're saying $|S|=50$.) * "I have not had any of them" $\iff$ $\forall x\in S.\; \neg H(x)$ * "I have had all but one of them" $\iff$ $\exists y\in S.\; \left[\left(\neg H(...
First: you really need to use a first-order logic formula for this, not a propositional logic formula. Now, using: $S(x): x$ is a type of Sushi $H(x,y): x$ has had $y$ $i: I$ to say that you haven't had any type of sushi would be: $$\forall x (S(x) \rightarrow \neg H(i,x))$$ and to say that there is (exactly) on...
5,000,405
how to build/develop a modal diglog box in mvc and how to pop it up on click of a button in jquery
2011/02/15
[ "https://Stackoverflow.com/questions/5000405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536411/" ]
The modal would likely already be in the source of the page already, unless it's something that requires an AJAX call. This is pretty simple to do, and I'd look into the jQuery UI library for their 'dialog' styles. This does pretty much exactly what you want. <http://jqueryui.com/demos/dialog/> From there it's as eas...
Just use [jQuery-UI dialog](http://jqueryui.com/demos/dialog/)
7,189,711
I have implement the effect and Transition using pixel shader files. When i apply effect and transition separately it working fine, but if i am applying both simultaneously it is not working. How can apply multiple shader to a sprite. Below is code what i am doing. ``` _effect = Effect.FromFile(_parentRVRenderer.Devic...
2011/08/25
[ "https://Stackoverflow.com/questions/7189711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/345738/" ]
Put your two pixel shader functions in the same shader, and use a two-pass technique that applies a different pixel shader in each pass. You still have to use two render targets to bounce the output from the first pass to the other as stated above, but it's better to use the two-pass approach than sending the render ...
I'm unsure as to if you can apply 2 shaders simultaneously. But what i would do, is draw the sprite to a render target using the first shader, and then draw the resulting image to the screen using the second shader. Obviously it would be ideal if you could combine the effects into a single shader but thats not always ...
48,770,777
I am pulling data from a json file and I get results no problem but I a only get 1 result. So when I do a foreach loop I get no results. **json results:** ``` { "channels": [ { "position": 4, "id": "901", "name": "Away" }, { "position": 0, "id": "900", "name": "Genera...
2018/02/13
[ "https://Stackoverflow.com/questions/48770777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7808922/" ]
You are getting the value of first object only. `$json_array['channels']` is an array of objects, you need to loop over that objects. This should work: ``` foreach($json_array['channels'] as $item) { echo $item['position']; echo $item['id']; echo $item['name']; } ``` To make it clear to understand, this ...
You missing collection iteration ``` foreach($json_array['channels'] as $item) { echo $item['position']; echo $item['id']; echo $item['name']; } ```
48,770,777
I am pulling data from a json file and I get results no problem but I a only get 1 result. So when I do a foreach loop I get no results. **json results:** ``` { "channels": [ { "position": 4, "id": "901", "name": "Away" }, { "position": 0, "id": "900", "name": "Genera...
2018/02/13
[ "https://Stackoverflow.com/questions/48770777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7808922/" ]
You are getting the value of first object only. `$json_array['channels']` is an array of objects, you need to loop over that objects. This should work: ``` foreach($json_array['channels'] as $item) { echo $item['position']; echo $item['id']; echo $item['name']; } ``` To make it clear to understand, this ...
Using `foreach`, you can now access every element of array *channels* by variable `$item` ``` foreach($json_array['channels'] as $item) { echo $item['position']; echo $item['id']; echo $item['name']; } ``` Doc: <http://php.net/manual/en/control-structures.foreach.php>
48,770,777
I am pulling data from a json file and I get results no problem but I a only get 1 result. So when I do a foreach loop I get no results. **json results:** ``` { "channels": [ { "position": 4, "id": "901", "name": "Away" }, { "position": 0, "id": "900", "name": "Genera...
2018/02/13
[ "https://Stackoverflow.com/questions/48770777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7808922/" ]
You are getting the value of first object only. `$json_array['channels']` is an array of objects, you need to loop over that objects. This should work: ``` foreach($json_array['channels'] as $item) { echo $item['position']; echo $item['id']; echo $item['name']; } ``` To make it clear to understand, this ...
You're telling your php that you want in your json file to go to ['channels'] and then take the first position [0]. So you're looping and it keeps hitting it at position 0. So you could do, as others said: ``` foreach($json_array['channels'] as $item) { echo $item['position']; echo $item['id']; echo $item[...
42,767,517
I have a c-extension that loads environment variables during static initialization. I need to be able to change these values and reload the module (I cannot change the fact that they are loaded statically). I tried setting `os.environ`, but there doesn't seem to be an `env` option in `importlib` like for `subprocess.ca...
2017/03/13
[ "https://Stackoverflow.com/questions/42767517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/464289/" ]
If I am not mistaken, the reason this does not work is not because the environment is not modified but because when you do `importlib.reload(s)` [the c module is not actually re-initialized](http://bugs.python.org/issue1144263). What you can do is put your calls to s in another process, and whenever you need to reload...
Maybe you can do something with Py\_Finalize and Py\_Initialize in your or a second c extension that will replace your module reload? But it's maybe an overkill...?
28,979,924
We have a modal dialog with multiple dependent dropdowns, selecting the value in one dropdown repopulates the dependent drop down dynamically. Because of this behaviour, JAWS is reading all the fields again whenever any of the drop down options are repopulated. Example, Dummy markup ``` <div role="dialog"> <div> ...
2015/03/11
[ "https://Stackoverflow.com/questions/28979924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/925214/" ]
I had the same problem. This simple solution brilliant works for me: Change ``` <b:widget id='header' type='HeaderTitle'/> ``` to ``` <b:widget id='HeaderTitle1' type='HeaderTitle'/> ``` Name **must** be same as type and with any number (1, 2, 3 etc.).
Blogspot right? okay. this is your previous codes: ``` <b:widget id='header' type='HeaderTitle'/> ``` when you create new widget, you should take notice of two things: 1. widget must be inside of section. 2. each of widgets must contains of type. HeaderTitle is, indeed invalid type when you modify it. This must be...
12,790,970
Could someone please explain what this code exactly means: ``` for i,j in [(i,j) for i in range(len(rows)-2,-1,-1) for (j) in range(i+1)]: ``` When there is an array called rows. what would is assign to i and j? I believe i would be the n-1th index for the array, but I'm not sure about j. Would it just be i+1?
2012/10/08
[ "https://Stackoverflow.com/questions/12790970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/495123/" ]
``` [(i,j) for i in range(len(rows)-2,-1,-1) for (j) in range(i+1)] ``` Is the same as: ``` result = [] # from len(rows)-2 to 0, decrementing by one each time for i in range(len(rows)-2,-1,-1): # from 0 to i for j in range(i+1): result.append((i, j)) ```
It works as product of sequences: ``` >>> [(i, j) for i in [1, 2] for j in ['a', 'b']] [(1, 'a'), (1, 'b'), (2, 'a'), (2, 'b')] ``` This is similar to: ``` from itertools import product print [(i, j) for i, j in product(list1, list2)] ```
7,474,358
This is my current jQuery: ``` $('#submit').click(function() { var texts = $('#texts').val(); var calls = $('#calls').val(); var callstometeor = $('#callstometeor').val(); $.post('compare.php', { texts: texts, calls: calls, callstometeor: callstometeor }, function(data) { $('#result').html(data); ...
2011/09/19
[ "https://Stackoverflow.com/questions/7474358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/953136/" ]
This one does it. It hides #result div first, fills it with response data and fades in ``` $('#result').hide().html(data).fadeIn(); ```
``` $(function(){ $('#submit').click(function() { var texts = $('#texts').val(); var calls = $('#calls').val(); var callstometeor = $('#callstometeor').val(); $.post('compare.php', { texts: texts, calls: calls, callstometeor: callstometeor }, function(data) { var res= data; //here you get the respo...
203,757
I was performing some basic computations when I noticed that ``` NumberForm[N[Zeta[3]], {100, 100}] ``` yields ``` 1.2020569031595940000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ``` This is having a very parasitic effect on my computations that are using $\zeta(3)$ and nee...
2019/08/15
[ "https://mathematica.stackexchange.com/questions/203757", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/49819/" ]
To give a simple answer to the question in the title: There is dedicated *hardware* in your CPU for machine precision computations. In contrast, arbitrary precision computations have to be emulated in *software*. That is why machine precision computations are orders of magnitude faster. And that is also why *Mathemati...
> > How can I make it return much more precise results? > > > There is not a great discussion of precision and accuracy control, AFAIK. Familiarize yourself with the functions in this guide: * [Precision & Accuracy Control](http://reference.wolfram.com/language/guide/PrecisionAndAccuracyControl.html) Take care ...
1,252,282
I have successfully removed Intel ME from the firmware by reflashing the BIOS using corna's tool: * <https://github.com/corna/me_cleaner> However I am still concerned about SMM. Intel ME and AMT vulnerabilities are horrible and classified as ring -3, however the SMM module also has plenty of vulnerabilities and possi...
2017/09/20
[ "https://superuser.com/questions/1252282", "https://superuser.com", "https://superuser.com/users/769660/" ]
The best solution is to buy hardware you trust. The primary example is [CoreBoot](https://www.coreboot.org/). There are system integrators who sell CoreBoot based computers. If you buy from System76 or Purism you are supporting people who are building free and open firmware so you don't have to go down the path you ar...
[System Management Mode (SMM)](https://en.wikipedia.org/wiki/System_Management_Mode): > > SMM is entered via the SMI (system management interrupt), which is invoked by: > > > * Motherboard hardware or chipset signaling via a designated pin SMI# of the processor chip. This signal can be an independent event. > * Sof...
52,327
I refer to this question (which is protected, but I cannot answer because it is 'protected') [What are the differences between tone, note, and pitch?](https://music.stackexchange.com/questions/3262/what-are-the-differences-between-tone-note-and-pitch). In it, Matthew Read accepts Kos' comment "I believe that note is m...
2017/01/17
[ "https://music.stackexchange.com/questions/52327", "https://music.stackexchange.com", "https://music.stackexchange.com/users/36114/" ]
'Tone' is a word with at least 3 distinct meanings: * **a synonym for' timbre'** * **a note or sound - often an electronically-produced one.** * **an interval of a certain size (i.e. two semitones!)** * ...and probably more.... > > Can 'tone' be defined as "note with information about timbre"? > > > No, that isn...
> > Thus, 'tone' could be defined as (named/unnamed) note with information > about timbre > > > No. As you referenced, *note* means a tone or pitch **with temporal information.**, as in *half-**note***, *quarter-**note*** etc. *Tone* has no connection to temporal information, as is clear from @topomorto 's defin...
38,101,336
I've tried the following: Deleting the fields Name and Type, saving the template (red square in screenshot) Selecting the field on the left tree and pressing delete (green in screenshot) Using the Builder Options menu and pressing Remove button (blue in screenshot) [![enter image description here](https://i.stack.i...
2016/06/29
[ "https://Stackoverflow.com/questions/38101336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/521446/" ]
If you are using Ucommerce you need to delete from product definition field not from Sitecore templates. UCommerce is using a data provider to bring product fields from ucommerce db to Sitecore db. That's the reason why fields are reaper in Sitecore. Please check here how to add and delete product definition fiel...
You need to save the template after making these changes. Use Ctrl+S or click Save in the Home ribbon. To remove a field, you can also right click > delete in the Content Tree.
45,139,697
Hi I have a file with 6 columns and I wish to know the average of three of these (columns 2,3,4) and the sum of the last two (columns 5 and 6) for each unique variable in column one. ``` A1234 0.526 0.123 0.456 0.986 1.123 A1234 0.423 0.256 0.397 0.876 0.999 A1234 0.645 0.321 0.402 0.903 1.101 A1234 0.555 0.155 0.406 ...
2017/07/17
[ "https://Stackoverflow.com/questions/45139697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4019644/" ]
``` awk '{a[$1]+=$2;b[$1]+=$3;c[$1]+=$4;d[$1]+=$5;e[$1]+=$6;f[$1]++} END{for (i in a) print i,a[i]/f[i],b[i]/f[i],c[i]/f[i],d[i],e[i]}' file ``` O/p: ``` B5678 0.222667 0.283 0.303333 2.445 2.697 A1234 0.53725 0.21375 0.41525 3.653 4.232 ```
To calculate average of column 2, 3, 4: ``` awk '{ sum += $2 + $3 + $4 } END { print sum / (NR * 3) }' ``` To calculate the sum of column 5 and 6 group by column 1: ``` awk '{ arr[$1] += $5 + $6 } END { for (a in arr) if (a) print a, arr[a] }' ``` ~~To calculate column 5 and 6 of the last row:~~ ``` tail file...
45,139,697
Hi I have a file with 6 columns and I wish to know the average of three of these (columns 2,3,4) and the sum of the last two (columns 5 and 6) for each unique variable in column one. ``` A1234 0.526 0.123 0.456 0.986 1.123 A1234 0.423 0.256 0.397 0.876 0.999 A1234 0.645 0.321 0.402 0.903 1.101 A1234 0.555 0.155 0.406 ...
2017/07/17
[ "https://Stackoverflow.com/questions/45139697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4019644/" ]
``` awk '{a[$1]+=$2;b[$1]+=$3;c[$1]+=$4;d[$1]+=$5;e[$1]+=$6;f[$1]++} END{for (i in a) print i,a[i]/f[i],b[i]/f[i],c[i]/f[i],d[i],e[i]}' file ``` O/p: ``` B5678 0.222667 0.283 0.303333 2.445 2.697 A1234 0.53725 0.21375 0.41525 3.653 4.232 ```
try following once and let me know if this helps you. ``` awk '{A[$1]=A[$1]?A[$1]+$5+$6:$5+$6;C[$1]=C[$1]?C[$1]+$2+$3+$4:$2+$3+$4;B[$1]++} END{for(i in A){print "Avg. for " i" =\t",C[i]/(B[i]*3) RS "Count for " i" =\t",A[i]}}' Input_file ``` ***EDIT:*** Adding a non-one liner form of solution too now. ``` awk '{ ...
45,139,697
Hi I have a file with 6 columns and I wish to know the average of three of these (columns 2,3,4) and the sum of the last two (columns 5 and 6) for each unique variable in column one. ``` A1234 0.526 0.123 0.456 0.986 1.123 A1234 0.423 0.256 0.397 0.876 0.999 A1234 0.645 0.321 0.402 0.903 1.101 A1234 0.555 0.155 0.406 ...
2017/07/17
[ "https://Stackoverflow.com/questions/45139697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4019644/" ]
``` awk '{a[$1]+=$2;b[$1]+=$3;c[$1]+=$4;d[$1]+=$5;e[$1]+=$6;f[$1]++} END{for (i in a) print i,a[i]/f[i],b[i]/f[i],c[i]/f[i],d[i],e[i]}' file ``` O/p: ``` B5678 0.222667 0.283 0.303333 2.445 2.697 A1234 0.53725 0.21375 0.41525 3.653 4.232 ```
***awk*** solution: ``` awk '{ a[$1]++; avg[$1]+=$2+$3+$4; sum[$1]+=$5+$6 } END{ for(i in a) printf "%s%.2f%s%.2f\n",i OFS,avg[i]/(a[i]*3),OFS,sum[i] }' file ``` The output (the 2nd column - ***average*** value, the 3rd column - ***sum*** value): ``` B5678 0.27 5.14 A1234 0.39 7.88 ```
35,767,157
I have been verified both from and to email addresses(both the emails are case sensitive) over and over and I still get the 554 Message rejected: Email address is not verified Rejection from SES. But when i try to send the emails from Amazon SES Console by using the same email, it is working fine. If my from and to ema...
2016/03/03
[ "https://Stackoverflow.com/questions/35767157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1501354/" ]
I took other way to fix this problem, because no one knows how to fixed this, So with this code I don't need to use SensorManager. Now I use two functions for starting and stoping sensor, I think is the only one solution. ``` import android.content.Context; import android.os.PowerManager; import android.support.v7.app...
In your initial code you have not handled releasing the wake lock properly. When your activity is in onStop , unregister your listener and also release the wake lock held.
35,767,157
I have been verified both from and to email addresses(both the emails are case sensitive) over and over and I still get the 554 Message rejected: Email address is not verified Rejection from SES. But when i try to send the emails from Amazon SES Console by using the same email, it is working fine. If my from and to ema...
2016/03/03
[ "https://Stackoverflow.com/questions/35767157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1501354/" ]
I took other way to fix this problem, because no one knows how to fixed this, So with this code I don't need to use SensorManager. Now I use two functions for starting and stoping sensor, I think is the only one solution. ``` import android.content.Context; import android.os.PowerManager; import android.support.v7.app...
Use the function `wakeLock.setReferenceCounted(false)`. I have used it, and it works.
21,628,939
Just a bit of a syntax problem here. I'm using SQL and ASP and have this code thus far: ``` set rs=Server.CreateObject("ADODB.recordset") rs.Open "Select * from Questions", conn sql="INSERT INTO Questions(QuestionText, QuestionType)" sql=sql & " VALUES " sql=sql & "('" & qtext & "'," sql=sql & "'" & "checkbox" & "');...
2014/02/07
[ "https://Stackoverflow.com/questions/21628939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2870266/" ]
Try this; ```vb ' What is this for? 'set rs=Server.CreateObject("ADODB.recordset") 'rs.Open "Select * from Questions", conn Dim cmd, rs, sql, new_id, yourconnstring sql = "" sql = sql & "INSERT INTO Questions(QuestionText, QuestionType) VALUES (?, ?);" & vbCrLf sql = sql & "SELECT SCOPE_IDENTITY();" Set cmd = Serve...
Alternative without the use of a command object ``` Set rs=Server.CreateObject("ADODB.recordset") rs.Open "Select * from Questions", conn ... rs.Close sql="INSERT INTO Questions(QuestionText, QuestionType)" & _ " VALUES " & _ "('" & qtext & "'," & _ "'" & "checkbox" & "');" & _ "SELECT SCOPE_IDENTITY()...
27,714,469
I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission. ``` <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate...
2014/12/31
[ "https://Stackoverflow.com/questions/27714469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397606/" ]
All you need to do is convert the string produced by the `<input>` into a Date using the Date constructor `new Date("2014-06-12")` ```js function checkDate() { var selectedText = document.getElementById('datepicker').value; var selectedDate = new Date(selectedText); var now = new Date(); if (selectedD...
Before comparing dates, they should be set to 0 hours. This would ensure difference between them is in multiples of 1 day. ``` const isPastDate = (date) => { const specificDate = new Date(date).setHours(0, 0, 0, 0); const today = new Date().setHours(0, 0, 0, 0); return specificDate < today; } console.log(...
27,714,469
I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission. ``` <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate...
2014/12/31
[ "https://Stackoverflow.com/questions/27714469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397606/" ]
For those who use type="date" (introduced with HTML5) instead of type="text", it can be done this way: ``` function checkDate() { var date = this.value; if(date.valueAsDate <= new Date()) { //Date in the past } else { //Date in the future } } ```
Before comparing dates, they should be set to 0 hours. This would ensure difference between them is in multiples of 1 day. ``` const isPastDate = (date) => { const specificDate = new Date(date).setHours(0, 0, 0, 0); const today = new Date().setHours(0, 0, 0, 0); return specificDate < today; } console.log(...
27,714,469
I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission. ``` <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate...
2014/12/31
[ "https://Stackoverflow.com/questions/27714469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397606/" ]
The `date()` function returns a string. Try converting both dates to integers first using the `Date.parse()` function: ```html <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate() { ...
Simple mine function working ... ``` function check_not_past_date_time(enter_date) { var a =new Date(enter_date); var now =new Date(); if(a>now){ return true; }else { return false; } } ```
27,714,469
I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission. ``` <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate...
2014/12/31
[ "https://Stackoverflow.com/questions/27714469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397606/" ]
All you need to do is convert the string produced by the `<input>` into a Date using the Date constructor `new Date("2014-06-12")` ```js function checkDate() { var selectedText = document.getElementById('datepicker').value; var selectedDate = new Date(selectedText); var now = new Date(); if (selectedD...
For those who use type="date" (introduced with HTML5) instead of type="text", it can be done this way: ``` function checkDate() { var date = this.value; if(date.valueAsDate <= new Date()) { //Date in the past } else { //Date in the future } } ```
27,714,469
I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission. ``` <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate...
2014/12/31
[ "https://Stackoverflow.com/questions/27714469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397606/" ]
For those who use type="date" (introduced with HTML5) instead of type="text", it can be done this way: ``` function checkDate() { var date = this.value; if(date.valueAsDate <= new Date()) { //Date in the past } else { //Date in the future } } ```
Your code is really close, try this instead: ``` var selectedDate = $('#datepicker').datepicker('getDate'); var now = new Date(); if (selectedDate < now) { // selected date is in the past } ```
27,714,469
I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission. ``` <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate...
2014/12/31
[ "https://Stackoverflow.com/questions/27714469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397606/" ]
The `date()` function returns a string. Try converting both dates to integers first using the `Date.parse()` function: ```html <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate() { ...
You can use ``` _isDate1LowerThanDate2(date1, date2) { return new Date(date1) < new Date(date2); } ```
27,714,469
I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission. ``` <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate...
2014/12/31
[ "https://Stackoverflow.com/questions/27714469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397606/" ]
The `date()` function returns a string. Try converting both dates to integers first using the `Date.parse()` function: ```html <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate() { ...
Your code is really close, try this instead: ``` var selectedDate = $('#datepicker').datepicker('getDate'); var now = new Date(); if (selectedDate < now) { // selected date is in the past } ```
27,714,469
I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission. ``` <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate...
2014/12/31
[ "https://Stackoverflow.com/questions/27714469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397606/" ]
All you need to do is convert the string produced by the `<input>` into a Date using the Date constructor `new Date("2014-06-12")` ```js function checkDate() { var selectedText = document.getElementById('datepicker').value; var selectedDate = new Date(selectedText); var now = new Date(); if (selectedD...
You can use ``` _isDate1LowerThanDate2(date1, date2) { return new Date(date1) < new Date(date2); } ```
27,714,469
I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission. ``` <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate...
2014/12/31
[ "https://Stackoverflow.com/questions/27714469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397606/" ]
The `date()` function returns a string. Try converting both dates to integers first using the `Date.parse()` function: ```html <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate() { ...
Before comparing dates, they should be set to 0 hours. This would ensure difference between them is in multiples of 1 day. ``` const isPastDate = (date) => { const specificDate = new Date(date).setHours(0, 0, 0, 0); const today = new Date().setHours(0, 0, 0, 0); return specificDate < today; } console.log(...
27,714,469
I have this code that I want to check if a date is in the past. I want to check it as soon as the date is entered, before form submission. ``` <input id="datepicker" onchange="checkDate()" required class="datepicker-input" type="text" data-date-format="yyyy-mm-dd" > <script type="text/javascript"> function checkDate...
2014/12/31
[ "https://Stackoverflow.com/questions/27714469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397606/" ]
All you need to do is convert the string produced by the `<input>` into a Date using the Date constructor `new Date("2014-06-12")` ```js function checkDate() { var selectedText = document.getElementById('datepicker').value; var selectedDate = new Date(selectedText); var now = new Date(); if (selectedD...
Simple mine function working ... ``` function check_not_past_date_time(enter_date) { var a =new Date(enter_date); var now =new Date(); if(a>now){ return true; }else { return false; } } ```
45,543,051
I'm new to JSON and have below file. I have to save the array "steps" in java and need to loop the objects "duration" , "status" and "Keyword". ``` "steps": [ { "result": { "duration": 7128811788, "status": "passed" }, "line": 5, "name": "The Browser is Launche...
2017/08/07
[ "https://Stackoverflow.com/questions/45543051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2890055/" ]
I would present a modal view at startup, which you can then configure with login fields. This allows you to keep split view as the root view. In AppDelegate's `didFinishLaunchingWithOptions`, you can add something like: ``` let storyboard = UIStoryboard(name: "Main", bundle: nil) let modalView = storyboard.ins...
After login succeed, you set the root of window to SplitViewController like that: ``` let splitVC = UISplitViewController() let window = UIApplication.shared.windows.first window?.rootViewController = splitVC ```
43,313
Given a bad balanced RGB image (in terms of white balance), how can I choose the proper color balance that needs to be applyed (as a RGB vector where 128,128,128 is the neutral)? Same question for a YUV image.
2013/10/11
[ "https://photo.stackexchange.com/questions/43313", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/21665/" ]
If you have a known white or grey point, you want to calculate the ratio between the colors so that each is given a factor to multiply by. For example, in your 250,245,255 reference it would be 1.02, 1.0625, 1 since multiplying the sampled values for white would produce an actual white. (255,255,255). Since the sensor ...
> > Given a bad balanced RGB image (in terms of white balance), how can I choose the proper color balance that needs to be applyed (as a RGB vector where 128,128,128 is the neutral)? > > > The answer is, you can't, at least not without human judgement. If you have an RGB image with an incorrect white balance, the...
5,802,178
I'm trying to show a preview of the print-styled page before the print dialog, by applying the print stylesheet to the screen stylesheet. This doesn't work: ``` $('link[media*="screen"]').attr("href",url+"css/print/default.css"); window.print(); ``` But with an alert() before the print(), it DOES work: ``` $('lin...
2011/04/27
[ "https://Stackoverflow.com/questions/5802178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/520168/" ]
This function delays execution of `window.print` a few seconds (`delay` parameter, default about 5 seconds): ``` function doPrint(delay){ delay = delay || 5; //default to 5 seconds $('link[media*="screen"]').attr("href",url+"css/print/default.css"); setTimeout(function(){window.print();},delay*1000); } ``` You co...
Don't call window.print() until you want to show the print dialog. Add another button to the page which the user can press to open the print dialog (this button may be hidden by default, shown when you show the preview, but don't forget to hide it again when printing!).
5,802,178
I'm trying to show a preview of the print-styled page before the print dialog, by applying the print stylesheet to the screen stylesheet. This doesn't work: ``` $('link[media*="screen"]').attr("href",url+"css/print/default.css"); window.print(); ``` But with an alert() before the print(), it DOES work: ``` $('lin...
2011/04/27
[ "https://Stackoverflow.com/questions/5802178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/520168/" ]
This function delays execution of `window.print` a few seconds (`delay` parameter, default about 5 seconds): ``` function doPrint(delay){ delay = delay || 5; //default to 5 seconds $('link[media*="screen"]').attr("href",url+"css/print/default.css"); setTimeout(function(){window.print();},delay*1000); } ``` You co...
It takes time to load a stylesheet. Without the alert, you are calling `print` before enough time has passed for the stylesheet to be loaded. > > Any hints? > > > Browsers have built in print and print preview functions. Avoid wheel reinvention.
10,033,086
I am new to testing and have a question about how can we verify the local language using Selenium. Suppose that I have some link which lets me choose the language, so if I choose a language how can I verify that?
2012/04/05
[ "https://Stackoverflow.com/questions/10033086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
By anything on the page! Let's assume our page is only made of one element, either ``` <div> It's time to kick ass and chew bubble gum! </div> ``` or ``` <div> Il est temps de botter le cul et mâcher de la gomme à bulles! </div> ``` Then, with Selenium, you can get the element, get the inner text and veri...
Well, you can * search for flag of that language on the page * check number formatting, or time formatting (does change in some locales) * Verify some well known text (like greeting) is changed. Say, from `Good evening` to `Dobrý večer` (that was in Czech ;) )
10,033,086
I am new to testing and have a question about how can we verify the local language using Selenium. Suppose that I have some link which lets me choose the language, so if I choose a language how can I verify that?
2012/04/05
[ "https://Stackoverflow.com/questions/10033086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Well, you can * search for flag of that language on the page * check number formatting, or time formatting (does change in some locales) * Verify some well known text (like greeting) is changed. Say, from `Good evening` to `Dobrý večer` (that was in Czech ;) )
``` <!-- Using Selenium IDE --> <tr> <td>storeAttribute</td> <td>//html@lang</td> <td>language</td> </tr> <tr> <td>echo</td> <td>The label is ${language}</td> <td></td> </tr> ```
10,033,086
I am new to testing and have a question about how can we verify the local language using Selenium. Suppose that I have some link which lets me choose the language, so if I choose a language how can I verify that?
2012/04/05
[ "https://Stackoverflow.com/questions/10033086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
By anything on the page! Let's assume our page is only made of one element, either ``` <div> It's time to kick ass and chew bubble gum! </div> ``` or ``` <div> Il est temps de botter le cul et mâcher de la gomme à bulles! </div> ``` Then, with Selenium, you can get the element, get the inner text and veri...
We use dictionary files for l10n. Dictionary is an xml file with strings stored like `<string key="Cancel">Cancel</string>`. So for testing purposes we replace all `</string>` with something like `@@@</string>` and replace all spaces between `<string key="...">` and `</string>` with '\_' (can be done in notepad++ with...
10,033,086
I am new to testing and have a question about how can we verify the local language using Selenium. Suppose that I have some link which lets me choose the language, so if I choose a language how can I verify that?
2012/04/05
[ "https://Stackoverflow.com/questions/10033086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
By anything on the page! Let's assume our page is only made of one element, either ``` <div> It's time to kick ass and chew bubble gum! </div> ``` or ``` <div> Il est temps de botter le cul et mâcher de la gomme à bulles! </div> ``` Then, with Selenium, you can get the element, get the inner text and veri...
``` <!-- Using Selenium IDE --> <tr> <td>storeAttribute</td> <td>//html@lang</td> <td>language</td> </tr> <tr> <td>echo</td> <td>The label is ${language}</td> <td></td> </tr> ```
10,033,086
I am new to testing and have a question about how can we verify the local language using Selenium. Suppose that I have some link which lets me choose the language, so if I choose a language how can I verify that?
2012/04/05
[ "https://Stackoverflow.com/questions/10033086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
We use dictionary files for l10n. Dictionary is an xml file with strings stored like `<string key="Cancel">Cancel</string>`. So for testing purposes we replace all `</string>` with something like `@@@</string>` and replace all spaces between `<string key="...">` and `</string>` with '\_' (can be done in notepad++ with...
``` <!-- Using Selenium IDE --> <tr> <td>storeAttribute</td> <td>//html@lang</td> <td>language</td> </tr> <tr> <td>echo</td> <td>The label is ${language}</td> <td></td> </tr> ```
38,333,326
I want to compute `K*es` where `K` is an `Eigen` matrix (dimension `pxp`) and `es` is a `px1` random binary vector with 1s. For example if `p=5` and `t=2` a possible `es` is `[1,0,1,0,0]'` or `[0,0,1,1,0]'` and so on... How do I easily generate `es` with `Eigen`?
2016/07/12
[ "https://Stackoverflow.com/questions/38333326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4480180/" ]
I came up with even a better solution, which is a combination of `std::vector`, `Egien::Map` and `std::shuffle`. ``` std::vector<int> esv(p,0); std::fill_n(esv.begin(),t,1); Eigen::Map<Eigen::VectorXi> es (esv.data(), esv.size()); std::random_device rd; std::mt19937 g(rd()); std::shuffle(std::begin(esv), std::end(esv)...
So you're using Eigen. I'm not sure what matrix type you're using, but I'll go off the class `Eigen::MatrixXd`. What you need to do is: * Create a 1xp matrix that's all 0 * Choose random spots to flip from 0 to 1 that are between 0-p, and make sure that spot is unique. The following code should do the trick, althoug...
38,333,326
I want to compute `K*es` where `K` is an `Eigen` matrix (dimension `pxp`) and `es` is a `px1` random binary vector with 1s. For example if `p=5` and `t=2` a possible `es` is `[1,0,1,0,0]'` or `[0,0,1,1,0]'` and so on... How do I easily generate `es` with `Eigen`?
2016/07/12
[ "https://Stackoverflow.com/questions/38333326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4480180/" ]
I came up with even a better solution, which is a combination of `std::vector`, `Egien::Map` and `std::shuffle`. ``` std::vector<int> esv(p,0); std::fill_n(esv.begin(),t,1); Eigen::Map<Eigen::VectorXi> es (esv.data(), esv.size()); std::random_device rd; std::mt19937 g(rd()); std::shuffle(std::begin(esv), std::end(esv)...
When `t` is close to `p`, Ryan's method need to generate much more than `t` random numbers. To avoid this performance degrade, you could solve your original problem > > find `t` different numbers from [0, p) that are uniformly distributed > > > by the following steps 1. generate `t` uniformly distributed random ...
568,921
I need to get a unique ID for the device. I originally thought I'd use the device's imei, but that doesn't seem to return anything: ``` import QtSystemInfo 5.0 DeviceInfo { id: device } Component.onCompleted { console.log(device.imei(0)) // Returns nothing } ``` That may or may not be a bug: <https://bugs....
2015/01/04
[ "https://askubuntu.com/questions/568921", "https://askubuntu.com", "https://askubuntu.com/users/334/" ]
As dobey said, there's no way to get the IMEI in confined apps, so I gave up on trying to get an ID based on the device itself. Instead, I just generate a UUID and store it in U1DB. ``` // uuid.js .pragma library function generateUUID(){ var d = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxx...
This does work. It is how *ubuntu-system-settings* is [getting the IMEI](https://bazaar.launchpad.net/~system-settings-touch/ubuntu-system-settings/trunk/view/head:/plugins/about/PageComponent.qml#L116). Rather, your issue may be that console.log() is not going to whatever console output you're expecting to see it at...
568,921
I need to get a unique ID for the device. I originally thought I'd use the device's imei, but that doesn't seem to return anything: ``` import QtSystemInfo 5.0 DeviceInfo { id: device } Component.onCompleted { console.log(device.imei(0)) // Returns nothing } ``` That may or may not be a bug: <https://bugs....
2015/01/04
[ "https://askubuntu.com/questions/568921", "https://askubuntu.com", "https://askubuntu.com/users/334/" ]
This does work. It is how *ubuntu-system-settings* is [getting the IMEI](https://bazaar.launchpad.net/~system-settings-touch/ubuntu-system-settings/trunk/view/head:/plugins/about/PageComponent.qml#L116). Rather, your issue may be that console.log() is not going to whatever console output you're expecting to see it at...
In more recent versions, the `DeviceInfo` QML type has a `uniqueID` property: ``` DeviceInfo { id: device } Component.onCompleted { console.log(device.uniqueID) } ``` Documentation: [QML DeviceInfo Element: property uniqueID](https://doc-snapshots.qt.io/qt-mobility/qml-deviceinfo.html#uniqueID-prop). (Code ...
568,921
I need to get a unique ID for the device. I originally thought I'd use the device's imei, but that doesn't seem to return anything: ``` import QtSystemInfo 5.0 DeviceInfo { id: device } Component.onCompleted { console.log(device.imei(0)) // Returns nothing } ``` That may or may not be a bug: <https://bugs....
2015/01/04
[ "https://askubuntu.com/questions/568921", "https://askubuntu.com", "https://askubuntu.com/users/334/" ]
As dobey said, there's no way to get the IMEI in confined apps, so I gave up on trying to get an ID based on the device itself. Instead, I just generate a UUID and store it in U1DB. ``` // uuid.js .pragma library function generateUUID(){ var d = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxx...
In more recent versions, the `DeviceInfo` QML type has a `uniqueID` property: ``` DeviceInfo { id: device } Component.onCompleted { console.log(device.uniqueID) } ``` Documentation: [QML DeviceInfo Element: property uniqueID](https://doc-snapshots.qt.io/qt-mobility/qml-deviceinfo.html#uniqueID-prop). (Code ...
55,233,883
I'm trying to demonstrate a cost function right now and wondering if there's a way to traverse the parabola by adding plot in the same subplot and figure. ``` def costfuntion(b, a): # b Value x = np.linspace(b*(-b), b*(b), 100) y = (x - a)**2 return y ``` My Plot Attempt: ``` plt.plot(costfuntion(20...
2019/03/19
[ "https://Stackoverflow.com/questions/55233883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10193760/" ]
`Array.forEach` does not return anything. You need to use `Array.map`. Also you should be returning the component to be rendered in the callback. ``` return ( <div> {this.state.articles.map((card) => ( <ArticleCard {...card} /> )} </div> ) ```
Instead of using forEach, you should use `map` function on array, and with `return` keyword to return each and every `ArticleCard` ```js return( <div> {this.state.articles.map((card) => { return <ArticleCard {...card} /> })} </div> ) ```
40,465
There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance: * **The Scrum Master:** Responsible for the process. Removes impediments. * **The Product Owner:** Manages and prioritizes the...
2011/01/27
[ "https://softwareengineering.stackexchange.com/questions/40465", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5692/" ]
In one of the projects I worked, when it turned into Scrum, our earlier project manager alternatively took the roles of Product Owner and Scrum Master. It sort of worked for the 6 months I spent with that team, although it was not ideal (for me). He was the kind of guy who wanted to keep things under tight control, but...
One of the main problems with the traditional project manager role is that it separates authority from responsibility. The PM has complete authority over the project organization - (s)he decides what tasks need to be done, by whom, in what order, etc. But (s)he's not held accountable for the completion of these tasks o...
40,465
There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance: * **The Scrum Master:** Responsible for the process. Removes impediments. * **The Product Owner:** Manages and prioritizes the...
2011/01/27
[ "https://softwareengineering.stackexchange.com/questions/40465", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5692/" ]
I'd be fair and say that in my view what works for me is the Scrum master acting as the Project manager as well. Being a Scrum master isnt a full time job - once the team is mature the scrum master doesnt even need to attend the daily stand ups. There are more and more vacancies that I see for a Project Manager/ Scr...
One of the main problems with the traditional project manager role is that it separates authority from responsibility. The PM has complete authority over the project organization - (s)he decides what tasks need to be done, by whom, in what order, etc. But (s)he's not held accountable for the completion of these tasks o...
40,465
There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance: * **The Scrum Master:** Responsible for the process. Removes impediments. * **The Product Owner:** Manages and prioritizes the...
2011/01/27
[ "https://softwareengineering.stackexchange.com/questions/40465", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5692/" ]
Maybe you should present things like this: > > The project manager did not disappear in **Scrum**. He is still there. There is **three** of them now! > > > * **The Scrum Master**: he manages the process and solve impediments. That was the responsibility of the project manager before. * **The Product Owner**: he m...
The Scrum roles are quite well defined (if they seem vague it is because they are meant to be applicable in different types of organizations), and since Scrum teams are always (well, commonly) of about the same size - i.e. not very big - it is relatively easy to agree on what they encompass, even if that varies dependi...
40,465
There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance: * **The Scrum Master:** Responsible for the process. Removes impediments. * **The Product Owner:** Manages and prioritizes the...
2011/01/27
[ "https://softwareengineering.stackexchange.com/questions/40465", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5692/" ]
Maybe you should present things like this: > > The project manager did not disappear in **Scrum**. He is still there. There is **three** of them now! > > > * **The Scrum Master**: he manages the process and solve impediments. That was the responsibility of the project manager before. * **The Product Owner**: he m...
For me this comes from a lack of understanding of what a Project Manager does and the rather generic nature of the PM title. I'm not an expert on SCRUM but I've always seen the SCRUM Master as replacing the development manager / team leader rather than the Project Manager. Project Managers (as defined by methodologies...
40,465
There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance: * **The Scrum Master:** Responsible for the process. Removes impediments. * **The Product Owner:** Manages and prioritizes the...
2011/01/27
[ "https://softwareengineering.stackexchange.com/questions/40465", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5692/" ]
There are a few things that a Project Manager can do that a Scrum Master or Product Owner might not be able to. * Project Managers usually have extensive experience in running projects (surprise!). * They are aware of common pitfalls, and can spot them and help head them off before they happen. * They are usually expe...
I'd be fair and say that in my view what works for me is the Scrum master acting as the Project manager as well. Being a Scrum master isnt a full time job - once the team is mature the scrum master doesnt even need to attend the daily stand ups. There are more and more vacancies that I see for a Project Manager/ Scr...
40,465
There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance: * **The Scrum Master:** Responsible for the process. Removes impediments. * **The Product Owner:** Manages and prioritizes the...
2011/01/27
[ "https://softwareengineering.stackexchange.com/questions/40465", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5692/" ]
Maybe you should present things like this: > > The project manager did not disappear in **Scrum**. He is still there. There is **three** of them now! > > > * **The Scrum Master**: he manages the process and solve impediments. That was the responsibility of the project manager before. * **The Product Owner**: he m...
There are a few things that a Project Manager can do that a Scrum Master or Product Owner might not be able to. * Project Managers usually have extensive experience in running projects (surprise!). * They are aware of common pitfalls, and can spot them and help head them off before they happen. * They are usually expe...
40,465
There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance: * **The Scrum Master:** Responsible for the process. Removes impediments. * **The Product Owner:** Manages and prioritizes the...
2011/01/27
[ "https://softwareengineering.stackexchange.com/questions/40465", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5692/" ]
For me this comes from a lack of understanding of what a Project Manager does and the rather generic nature of the PM title. I'm not an expert on SCRUM but I've always seen the SCRUM Master as replacing the development manager / team leader rather than the Project Manager. Project Managers (as defined by methodologies...
I'd be fair and say that in my view what works for me is the Scrum master acting as the Project manager as well. Being a Scrum master isnt a full time job - once the team is mature the scrum master doesnt even need to attend the daily stand ups. There are more and more vacancies that I see for a Project Manager/ Scr...
40,465
There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance: * **The Scrum Master:** Responsible for the process. Removes impediments. * **The Product Owner:** Manages and prioritizes the...
2011/01/27
[ "https://softwareengineering.stackexchange.com/questions/40465", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5692/" ]
**Project manager:** a role within a traditional organization or enterprise. **Scrum master:** a role within a software development team using the Scrum methodology. Talking about project manager vs. scrum master is really talking about apples and oranges because the roles have different contexts. I've never heard of...
The Scrum roles are quite well defined (if they seem vague it is because they are meant to be applicable in different types of organizations), and since Scrum teams are always (well, commonly) of about the same size - i.e. not very big - it is relatively easy to agree on what they encompass, even if that varies dependi...
40,465
There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance: * **The Scrum Master:** Responsible for the process. Removes impediments. * **The Product Owner:** Manages and prioritizes the...
2011/01/27
[ "https://softwareengineering.stackexchange.com/questions/40465", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5692/" ]
Maybe you should present things like this: > > The project manager did not disappear in **Scrum**. He is still there. There is **three** of them now! > > > * **The Scrum Master**: he manages the process and solve impediments. That was the responsibility of the project manager before. * **The Product Owner**: he m...
This question smells of [Scrumbut](http://www.scrum.org/scrumbut "'reasons why teams can’t take full advantage of Scrum...'"). Scrum is a subset of what is contained in a project management method (Prince2/PMP etc). In fact, if you look at the Prince2 process MP (managing product delivery), all the elements of Scrum c...
40,465
There are three roles defined in Scrum: Team, Product Owner and Scrum Master. There is no project manager, instead the **project manager job is spread across the three roles**. For instance: * **The Scrum Master:** Responsible for the process. Removes impediments. * **The Product Owner:** Manages and prioritizes the...
2011/01/27
[ "https://softwareengineering.stackexchange.com/questions/40465", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/5692/" ]
There are a few things that a Project Manager can do that a Scrum Master or Product Owner might not be able to. * Project Managers usually have extensive experience in running projects (surprise!). * They are aware of common pitfalls, and can spot them and help head them off before they happen. * They are usually expe...
One of the main problems with the traditional project manager role is that it separates authority from responsibility. The PM has complete authority over the project organization - (s)he decides what tasks need to be done, by whom, in what order, etc. But (s)he's not held accountable for the completion of these tasks o...
20,839,359
I'm wondering how to use `RequireJS` with `JS` libraries like: *html5shiv* and *retina.js*, libraries like these don't need to be use the way we use jquery or something else. We just need to include it. I'm currently using it an ugly way: ``` require(["html5shiv"], function () { //doing nothing here.. }); ``` Any...
2013/12/30
[ "https://Stackoverflow.com/questions/20839359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1881058/" ]
You are forgetting that the divs are part of the DOM tree now, you either target them as well or you remove them. ``` div { counter-increment: chapter; counter-reset: section; } div:before { content: "Chapter " counter(chapter) " "; } ```
The reason is that “Counters are ‘self-nesting’, in the sense that resetting a counter in a descendant element or pseudo-element automatically creates a new instance of the counter.” (CSS 2.1, 12.4.1 [Nested counters and scope](http://www.w3.org/TR/CSS2/generate.html#propdef-counter-reset)). So in the “wrong counter” ...
20,839,359
I'm wondering how to use `RequireJS` with `JS` libraries like: *html5shiv* and *retina.js*, libraries like these don't need to be use the way we use jquery or something else. We just need to include it. I'm currently using it an ugly way: ``` require(["html5shiv"], function () { //doing nothing here.. }); ``` Any...
2013/12/30
[ "https://Stackoverflow.com/questions/20839359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1881058/" ]
The reason it works as intended in the second section (without the div's) but doesn't in the fist section is due to counter scope. According to the [W3C](http://www.w3.org/TR/CSS21/generate.html#scope): > > The scope of a counter starts at the first element in the document that has a 'counter-reset' for that counter ...
You are forgetting that the divs are part of the DOM tree now, you either target them as well or you remove them. ``` div { counter-increment: chapter; counter-reset: section; } div:before { content: "Chapter " counter(chapter) " "; } ```
20,839,359
I'm wondering how to use `RequireJS` with `JS` libraries like: *html5shiv* and *retina.js*, libraries like these don't need to be use the way we use jquery or something else. We just need to include it. I'm currently using it an ugly way: ``` require(["html5shiv"], function () { //doing nothing here.. }); ``` Any...
2013/12/30
[ "https://Stackoverflow.com/questions/20839359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1881058/" ]
I have added class to the wrap to differentiate div. **[Working Demo](http://jsfiddle.net/surjithctly/75MHS/23/)** HTML ``` <div class="head"><h3>dddd</h3></div> <div class="sub"><h4>dddd</h4></div> <div class="sub"><h4>dddd</h4></div> <div class="head"><h3>dddd</h3></div> <div class="sub"><h4>dddd</h4></div> <div c...
The reason is that “Counters are ‘self-nesting’, in the sense that resetting a counter in a descendant element or pseudo-element automatically creates a new instance of the counter.” (CSS 2.1, 12.4.1 [Nested counters and scope](http://www.w3.org/TR/CSS2/generate.html#propdef-counter-reset)). So in the “wrong counter” ...
20,839,359
I'm wondering how to use `RequireJS` with `JS` libraries like: *html5shiv* and *retina.js*, libraries like these don't need to be use the way we use jquery or something else. We just need to include it. I'm currently using it an ugly way: ``` require(["html5shiv"], function () { //doing nothing here.. }); ``` Any...
2013/12/30
[ "https://Stackoverflow.com/questions/20839359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1881058/" ]
The reason it works as intended in the second section (without the div's) but doesn't in the fist section is due to counter scope. According to the [W3C](http://www.w3.org/TR/CSS21/generate.html#scope): > > The scope of a counter starts at the first element in the document that has a 'counter-reset' for that counter ...
I have added class to the wrap to differentiate div. **[Working Demo](http://jsfiddle.net/surjithctly/75MHS/23/)** HTML ``` <div class="head"><h3>dddd</h3></div> <div class="sub"><h4>dddd</h4></div> <div class="sub"><h4>dddd</h4></div> <div class="head"><h3>dddd</h3></div> <div class="sub"><h4>dddd</h4></div> <div c...
20,839,359
I'm wondering how to use `RequireJS` with `JS` libraries like: *html5shiv* and *retina.js*, libraries like these don't need to be use the way we use jquery or something else. We just need to include it. I'm currently using it an ugly way: ``` require(["html5shiv"], function () { //doing nothing here.. }); ``` Any...
2013/12/30
[ "https://Stackoverflow.com/questions/20839359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1881058/" ]
The reason it works as intended in the second section (without the div's) but doesn't in the fist section is due to counter scope. According to the [W3C](http://www.w3.org/TR/CSS21/generate.html#scope): > > The scope of a counter starts at the first element in the document that has a 'counter-reset' for that counter ...
The reason is that “Counters are ‘self-nesting’, in the sense that resetting a counter in a descendant element or pseudo-element automatically creates a new instance of the counter.” (CSS 2.1, 12.4.1 [Nested counters and scope](http://www.w3.org/TR/CSS2/generate.html#propdef-counter-reset)). So in the “wrong counter” ...
49,866,365
Typescript allows readonly class members to be initialized in the constructor, but what if data comes as a response to asynchronous request? ``` class Test { readonly data; constructor() { setTimeout(() => { this.data = 15 // error }); } } ```
2018/04/16
[ "https://Stackoverflow.com/questions/49866365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8191072/" ]
As far as I know, typescript only allows you to set a readonly class property in the constructor function. Since you're setting it as part of a callback function (even though the callback is in the constructor), typescript is going to produce an error. The way around this is to do one of two things. For a quick and ea...
Depending on use case of the class in question, the data *could* be taken outside of the component and pass to the component.
49,866,365
Typescript allows readonly class members to be initialized in the constructor, but what if data comes as a response to asynchronous request? ``` class Test { readonly data; constructor() { setTimeout(() => { this.data = 15 // error }); } } ```
2018/04/16
[ "https://Stackoverflow.com/questions/49866365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8191072/" ]
As far as I know, typescript only allows you to set a readonly class property in the constructor function. Since you're setting it as part of a callback function (even though the callback is in the constructor), typescript is going to produce an error. The way around this is to do one of two things. For a quick and ea...
I have same problem and I'm using another work-around. I pass the Promise to the property. ``` class Test { readonly dataPromise: Promise<number>; constructor() { this.dataPromise = new Promise<number>((resolve) => { setTimeout(() => { resolve(15) }, 1000); }) } } ``` Also optional...
49,866,365
Typescript allows readonly class members to be initialized in the constructor, but what if data comes as a response to asynchronous request? ``` class Test { readonly data; constructor() { setTimeout(() => { this.data = 15 // error }); } } ```
2018/04/16
[ "https://Stackoverflow.com/questions/49866365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8191072/" ]
Depending on use case of the class in question, the data *could* be taken outside of the component and pass to the component.
I have same problem and I'm using another work-around. I pass the Promise to the property. ``` class Test { readonly dataPromise: Promise<number>; constructor() { this.dataPromise = new Promise<number>((resolve) => { setTimeout(() => { resolve(15) }, 1000); }) } } ``` Also optional...
41,862,414
I'm trying to split a string in R using `strsplit` and a perl regex. The string consists of various alphanumeric tokens separated by periods or hyphens, e.g `"WXYZ-AB-A4K7-01A-13B-J29Q-10"`. I want to split the string: * wherever a hyphen appears. * wherever a period appears. * between the second and third character o...
2017/01/25
[ "https://Stackoverflow.com/questions/41862414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1530508/" ]
An alternative that prevents you from having to consider how the `strsplit` algorithm works, is to use your original regex with `gsub` to insert a simple splitting character in all the right places, then do use `strsplit` to do the straightforward splitting. ``` strsplit( gsub("((?<=[-.]\\d{2})(?=[A-Z][-.]))|[.-]"...
You may use a *consuming* version of a positive lookahead (a match reset operator `\K`) to make sure `strsplit` works correctly in R and avoid the problem of using a negative lookbehind inside a positive one. ``` "(?<![^.-])\\d{2}\\K(?=[A-Z](?:[.-]|$))|[.-]" ``` See the [R demo online](http://ideone.com/QFH33T) (and...
41,862,414
I'm trying to split a string in R using `strsplit` and a perl regex. The string consists of various alphanumeric tokens separated by periods or hyphens, e.g `"WXYZ-AB-A4K7-01A-13B-J29Q-10"`. I want to split the string: * wherever a hyphen appears. * wherever a period appears. * between the second and third character o...
2017/01/25
[ "https://Stackoverflow.com/questions/41862414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1530508/" ]
An alternative that prevents you from having to consider how the `strsplit` algorithm works, is to use your original regex with `gsub` to insert a simple splitting character in all the right places, then do use `strsplit` to do the straightforward splitting. ``` strsplit( gsub("((?<=[-.]\\d{2})(?=[A-Z][-.]))|[.-]"...
Thanks to Rich Scriven and Jota I was able to solve the problem. Every time `strsplit` finds a match, it removes the match and everything to its left before looking for the next match. This means that regex's that rely on lookbehinds may not function as expected when the lookbehind overlaps with a previous match. In my...
9,864
Is it generally possible to change a credit card from one "specialty" to another, **without changing the credit card number or expiry date**? For example, is it possible to switch from a [TD Drivers Rewards Visa](http://www.tdcanadatrust.com/tdvisa/drivers_rewards.jsp) card to a [TD Platinum Travel Visa](http://www.td...
2011/07/27
[ "https://money.stackexchange.com/questions/9864", "https://money.stackexchange.com", "https://money.stackexchange.com/users/3983/" ]
It depends on if a new card would share the same [bank identification number](http://en.wikipedia.org/wiki/List_of_Bank_Identification_Numbers). The first digits of your credit card identify what bank issues the card. Looking over the list on wikipedia, some banks have multiple numbers based on card type. If that is th...
Every Card type comes with its set of reward and other features. Today the systems that are in Bank are not geared up to change the type and keep the card number same. The reason being that for newer transactions they can still do it, however the historical transactions will become a mess, for example the rewards po...
47,101,743
> > Error starting ApplicationContext. To display the auto-configuration > report re-run your application with 'debug' enabled > > > I am getting the above message when I try to run my Spring Boot application. Does anyone know how I can re-run the application with 'debug' enabled? I am running the application...
2017/11/03
[ "https://Stackoverflow.com/questions/47101743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6171247/" ]
Set `debug = true` or `debug: true` in your properties/yml. It can also be passed as an argument `--debug`. There are further details available in the Spring Boot documentation on what the debug flag does. <https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-logging-...
In Run/Debug Configurations check "Enable debug output" [![enter image description here](https://i.stack.imgur.com/ZS4V0.png)](https://i.stack.imgur.com/ZS4V0.png)
47,101,743
> > Error starting ApplicationContext. To display the auto-configuration > report re-run your application with 'debug' enabled > > > I am getting the above message when I try to run my Spring Boot application. Does anyone know how I can re-run the application with 'debug' enabled? I am running the application...
2017/11/03
[ "https://Stackoverflow.com/questions/47101743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6171247/" ]
Set `debug = true` or `debug: true` in your properties/yml. It can also be passed as an argument `--debug`. There are further details available in the Spring Boot documentation on what the debug flag does. <https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-logging-...
There are lots of properties you can refer to in [common-application-properties](https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html), when configuring the properties. ``` # ---------------------------------------- # CORE PROPERTIES # -------------------------------------...
47,101,743
> > Error starting ApplicationContext. To display the auto-configuration > report re-run your application with 'debug' enabled > > > I am getting the above message when I try to run my Spring Boot application. Does anyone know how I can re-run the application with 'debug' enabled? I am running the application...
2017/11/03
[ "https://Stackoverflow.com/questions/47101743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6171247/" ]
Set `debug = true` or `debug: true` in your properties/yml. It can also be passed as an argument `--debug`. There are further details available in the Spring Boot documentation on what the debug flag does. <https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-logging-...
Set `logging.level.org.springframework.boot.autoconfigure` property to `DEBUG` in your application's YAML/settings file. This would be enough.
47,101,743
> > Error starting ApplicationContext. To display the auto-configuration > report re-run your application with 'debug' enabled > > > I am getting the above message when I try to run my Spring Boot application. Does anyone know how I can re-run the application with 'debug' enabled? I am running the application...
2017/11/03
[ "https://Stackoverflow.com/questions/47101743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6171247/" ]
Set `debug = true` or `debug: true` in your properties/yml. It can also be passed as an argument `--debug`. There are further details available in the Spring Boot documentation on what the debug flag does. <https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-logging-...
As I leant on it at Baeldung lecture, the debug report on autoconfigured beans displayed on Console by putting below line in "application.properties" file: ``` logging.level.org.springframework.boot.autoconfigure=DEBUG ``` [![enter image description here](https://i.stack.imgur.com/Xc9Xq.png)](https://i.stack.imgur.c...
47,101,743
> > Error starting ApplicationContext. To display the auto-configuration > report re-run your application with 'debug' enabled > > > I am getting the above message when I try to run my Spring Boot application. Does anyone know how I can re-run the application with 'debug' enabled? I am running the application...
2017/11/03
[ "https://Stackoverflow.com/questions/47101743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6171247/" ]
In Run/Debug Configurations check "Enable debug output" [![enter image description here](https://i.stack.imgur.com/ZS4V0.png)](https://i.stack.imgur.com/ZS4V0.png)
There are lots of properties you can refer to in [common-application-properties](https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html), when configuring the properties. ``` # ---------------------------------------- # CORE PROPERTIES # -------------------------------------...
47,101,743
> > Error starting ApplicationContext. To display the auto-configuration > report re-run your application with 'debug' enabled > > > I am getting the above message when I try to run my Spring Boot application. Does anyone know how I can re-run the application with 'debug' enabled? I am running the application...
2017/11/03
[ "https://Stackoverflow.com/questions/47101743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6171247/" ]
In Run/Debug Configurations check "Enable debug output" [![enter image description here](https://i.stack.imgur.com/ZS4V0.png)](https://i.stack.imgur.com/ZS4V0.png)
Set `logging.level.org.springframework.boot.autoconfigure` property to `DEBUG` in your application's YAML/settings file. This would be enough.
47,101,743
> > Error starting ApplicationContext. To display the auto-configuration > report re-run your application with 'debug' enabled > > > I am getting the above message when I try to run my Spring Boot application. Does anyone know how I can re-run the application with 'debug' enabled? I am running the application...
2017/11/03
[ "https://Stackoverflow.com/questions/47101743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6171247/" ]
In Run/Debug Configurations check "Enable debug output" [![enter image description here](https://i.stack.imgur.com/ZS4V0.png)](https://i.stack.imgur.com/ZS4V0.png)
As I leant on it at Baeldung lecture, the debug report on autoconfigured beans displayed on Console by putting below line in "application.properties" file: ``` logging.level.org.springframework.boot.autoconfigure=DEBUG ``` [![enter image description here](https://i.stack.imgur.com/Xc9Xq.png)](https://i.stack.imgur.c...
47,101,743
> > Error starting ApplicationContext. To display the auto-configuration > report re-run your application with 'debug' enabled > > > I am getting the above message when I try to run my Spring Boot application. Does anyone know how I can re-run the application with 'debug' enabled? I am running the application...
2017/11/03
[ "https://Stackoverflow.com/questions/47101743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6171247/" ]
There are lots of properties you can refer to in [common-application-properties](https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html), when configuring the properties. ``` # ---------------------------------------- # CORE PROPERTIES # -------------------------------------...
Set `logging.level.org.springframework.boot.autoconfigure` property to `DEBUG` in your application's YAML/settings file. This would be enough.
47,101,743
> > Error starting ApplicationContext. To display the auto-configuration > report re-run your application with 'debug' enabled > > > I am getting the above message when I try to run my Spring Boot application. Does anyone know how I can re-run the application with 'debug' enabled? I am running the application...
2017/11/03
[ "https://Stackoverflow.com/questions/47101743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6171247/" ]
There are lots of properties you can refer to in [common-application-properties](https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html), when configuring the properties. ``` # ---------------------------------------- # CORE PROPERTIES # -------------------------------------...
As I leant on it at Baeldung lecture, the debug report on autoconfigured beans displayed on Console by putting below line in "application.properties" file: ``` logging.level.org.springframework.boot.autoconfigure=DEBUG ``` [![enter image description here](https://i.stack.imgur.com/Xc9Xq.png)](https://i.stack.imgur.c...
32,716
When you are answering questions here as well as in the real life what do you do if you feel there is a bigger issue/misunderstanding behind a simple(?) question asked? Sometimes the straight answer is pretty obvious. Just give the person asking the fix they want and be done with it. But what if the question shows th...
2009/12/11
[ "https://meta.stackexchange.com/questions/32716", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/140269/" ]
You can only teach someone to fish if they want to learn how to fish. Yes many questions show far deeper issues that simply the question that is being asked, however the people who ask those questions can easily be split into 2 categories: * Those who care * Those who don't The people who don't care are never going ...
I usually provide an answer, then expand on it to discuss alternatives or ask more questions about what the use case may be that seems to be driving them towards whatever is causing me to wonder about the question. The reason I try to provide an answer is that, in a very real sense, the question stands on its own. It's...
32,716
When you are answering questions here as well as in the real life what do you do if you feel there is a bigger issue/misunderstanding behind a simple(?) question asked? Sometimes the straight answer is pretty obvious. Just give the person asking the fix they want and be done with it. But what if the question shows th...
2009/12/11
[ "https://meta.stackexchange.com/questions/32716", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/140269/" ]
I usually try to do a bit of both, where I feel it's appropriate. For homework questions I'm much more likely to give "fishing hints" rather than giving a whole fish. For "I need this for my job" questions I try to give the "fishing" bit first and *then* give the answer - that helps to stop people from only reading as ...
I usually provide an answer, then expand on it to discuss alternatives or ask more questions about what the use case may be that seems to be driving them towards whatever is causing me to wonder about the question. The reason I try to provide an answer is that, in a very real sense, the question stands on its own. It's...
32,716
When you are answering questions here as well as in the real life what do you do if you feel there is a bigger issue/misunderstanding behind a simple(?) question asked? Sometimes the straight answer is pretty obvious. Just give the person asking the fix they want and be done with it. But what if the question shows th...
2009/12/11
[ "https://meta.stackexchange.com/questions/32716", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/140269/" ]
Look, we've seen this [all the time](https://stackoverflow.com/questions/1890472/jquery-css-add-color-to-un-ordered-list-items). What I try to do, is check if it is a duplicate (that generally this kind of simple questions have) and if there is none, provide as complete an answer as I can. I start explaining the backg...
Usually some people inevitably **come to the rescue** by throwing fish even in spite of an accepted quick solution. Sometimes the total fish carnage is quite respectful. In general most of us like **to know reasons why**, and we understand by leaving background info we are helping out still, even if a solution has alre...
32,716
When you are answering questions here as well as in the real life what do you do if you feel there is a bigger issue/misunderstanding behind a simple(?) question asked? Sometimes the straight answer is pretty obvious. Just give the person asking the fix they want and be done with it. But what if the question shows th...
2009/12/11
[ "https://meta.stackexchange.com/questions/32716", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/140269/" ]
Look, we've seen this [all the time](https://stackoverflow.com/questions/1890472/jquery-css-add-color-to-un-ordered-list-items). What I try to do, is check if it is a duplicate (that generally this kind of simple questions have) and if there is none, provide as complete an answer as I can. I start explaining the backg...
I usually try to do a bit of both, where I feel it's appropriate. For homework questions I'm much more likely to give "fishing hints" rather than giving a whole fish. For "I need this for my job" questions I try to give the "fishing" bit first and *then* give the answer - that helps to stop people from only reading as ...
32,716
When you are answering questions here as well as in the real life what do you do if you feel there is a bigger issue/misunderstanding behind a simple(?) question asked? Sometimes the straight answer is pretty obvious. Just give the person asking the fix they want and be done with it. But what if the question shows th...
2009/12/11
[ "https://meta.stackexchange.com/questions/32716", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/140269/" ]
Look, we've seen this [all the time](https://stackoverflow.com/questions/1890472/jquery-css-add-color-to-un-ordered-list-items). What I try to do, is check if it is a duplicate (that generally this kind of simple questions have) and if there is none, provide as complete an answer as I can. I start explaining the backg...
You can only teach someone to fish if they want to learn how to fish. Yes many questions show far deeper issues that simply the question that is being asked, however the people who ask those questions can easily be split into 2 categories: * Those who care * Those who don't The people who don't care are never going ...
32,716
When you are answering questions here as well as in the real life what do you do if you feel there is a bigger issue/misunderstanding behind a simple(?) question asked? Sometimes the straight answer is pretty obvious. Just give the person asking the fix they want and be done with it. But what if the question shows th...
2009/12/11
[ "https://meta.stackexchange.com/questions/32716", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/140269/" ]
Look, we've seen this [all the time](https://stackoverflow.com/questions/1890472/jquery-css-add-color-to-un-ordered-list-items). What I try to do, is check if it is a duplicate (that generally this kind of simple questions have) and if there is none, provide as complete an answer as I can. I start explaining the backg...
Great question indeed. I think you've already stumbled on one of the key points in the discussion: differentiating between a simple question with a simple answer and a question indicating there's a bigger problem. For the simple questions, the simple answer is probably best. As you've stated, the person posing the que...
32,716
When you are answering questions here as well as in the real life what do you do if you feel there is a bigger issue/misunderstanding behind a simple(?) question asked? Sometimes the straight answer is pretty obvious. Just give the person asking the fix they want and be done with it. But what if the question shows th...
2009/12/11
[ "https://meta.stackexchange.com/questions/32716", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/140269/" ]
Great question indeed. I think you've already stumbled on one of the key points in the discussion: differentiating between a simple question with a simple answer and a question indicating there's a bigger problem. For the simple questions, the simple answer is probably best. As you've stated, the person posing the que...
Usually some people inevitably **come to the rescue** by throwing fish even in spite of an accepted quick solution. Sometimes the total fish carnage is quite respectful. In general most of us like **to know reasons why**, and we understand by leaving background info we are helping out still, even if a solution has alre...
32,716
When you are answering questions here as well as in the real life what do you do if you feel there is a bigger issue/misunderstanding behind a simple(?) question asked? Sometimes the straight answer is pretty obvious. Just give the person asking the fix they want and be done with it. But what if the question shows th...
2009/12/11
[ "https://meta.stackexchange.com/questions/32716", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/140269/" ]
I usually try to do a bit of both, where I feel it's appropriate. For homework questions I'm much more likely to give "fishing hints" rather than giving a whole fish. For "I need this for my job" questions I try to give the "fishing" bit first and *then* give the answer - that helps to stop people from only reading as ...
You can only teach someone to fish if they want to learn how to fish. Yes many questions show far deeper issues that simply the question that is being asked, however the people who ask those questions can easily be split into 2 categories: * Those who care * Those who don't The people who don't care are never going ...
32,716
When you are answering questions here as well as in the real life what do you do if you feel there is a bigger issue/misunderstanding behind a simple(?) question asked? Sometimes the straight answer is pretty obvious. Just give the person asking the fix they want and be done with it. But what if the question shows th...
2009/12/11
[ "https://meta.stackexchange.com/questions/32716", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/140269/" ]
Great question indeed. I think you've already stumbled on one of the key points in the discussion: differentiating between a simple question with a simple answer and a question indicating there's a bigger problem. For the simple questions, the simple answer is probably best. As you've stated, the person posing the que...
I usually provide an answer, then expand on it to discuss alternatives or ask more questions about what the use case may be that seems to be driving them towards whatever is causing me to wonder about the question. The reason I try to provide an answer is that, in a very real sense, the question stands on its own. It's...
32,716
When you are answering questions here as well as in the real life what do you do if you feel there is a bigger issue/misunderstanding behind a simple(?) question asked? Sometimes the straight answer is pretty obvious. Just give the person asking the fix they want and be done with it. But what if the question shows th...
2009/12/11
[ "https://meta.stackexchange.com/questions/32716", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/140269/" ]
Look, we've seen this [all the time](https://stackoverflow.com/questions/1890472/jquery-css-add-color-to-un-ordered-list-items). What I try to do, is check if it is a duplicate (that generally this kind of simple questions have) and if there is none, provide as complete an answer as I can. I start explaining the backg...
I usually provide an answer, then expand on it to discuss alternatives or ask more questions about what the use case may be that seems to be driving them towards whatever is causing me to wonder about the question. The reason I try to provide an answer is that, in a very real sense, the question stands on its own. It's...
68,250,519
I have dataset ``` structure(list(animal = c("dg", "dg", "c", "c", "dg", "eph", "eph"), water = c("y", "n", "n", "y", "n", "y", "n"), temperature = c(77, 72, 88, 88, 49, 59, 76)), row.names = c(NA, -7L), class = "data.frame") ``` The data is currently coded. The only way to decode this dataframe is using 2 datafra...
2021/07/05
[ "https://Stackoverflow.com/questions/68250519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16182643/" ]
In basic term, [cache\_page](https://docs.djangoproject.com/en/3.2/topics/cache/#the-per-view-cache) is a decorator which can cache the view's response. So, > > And the 60-seconds cycle begins when another user requests the same end point? > > > yes. View will be return cached response for any request for 60 seco...
Yes. When cache is set, it holds the value until time has passed, or until you *explicitly* delete/overwrite it. When request is received, django will: * check for cached response * if cached - return cached value, do not execute method * else execute method, return response and set cache Since cache is set on reque...
163,992
My friends and I are currently raising a startup that will launch our first product at the end of Q3 this year. Apart from the freelance marketing team, this startup consists of three developers, which is two of my friends and I. My roles cover a lot of things, from code to sales. One of our developer having a 9-5 ...
2020/09/17
[ "https://workplace.stackexchange.com/questions/163992", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/91555/" ]
> > Should I carry on, act as a single-fighter developer? Or there might be something else I need to do? > > > You need to gather with your friends and have a good talk about the future of this project and the commitment they are willing to take. Together each one of you can decide if they are still able to commi...
CEO does not build. CEO does sales. with sales, your team will see potential and get excited. Do not stay on to be the only developer. You should not be a developer at all. You should be selling your product, and raising funds.
163,992
My friends and I are currently raising a startup that will launch our first product at the end of Q3 this year. Apart from the freelance marketing team, this startup consists of three developers, which is two of my friends and I. My roles cover a lot of things, from code to sales. One of our developer having a 9-5 ...
2020/09/17
[ "https://workplace.stackexchange.com/questions/163992", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/91555/" ]
> > I have to take any action before things fall apart. > > > It's already fallen apart, I'm surprised it took 9 months. You need to make a decision to carry on solo or slowly watch it turn into dust. You also need to make sure you have sole ownership and can cut the others out if you need to. Realistically this...
CEO does not build. CEO does sales. with sales, your team will see potential and get excited. Do not stay on to be the only developer. You should not be a developer at all. You should be selling your product, and raising funds.