qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
207,306 | So I'm trying to restore my backup files with Déjà Dup, however, each time I enter in the correct password, it keeps asking for it over and over again.
This seems to be a bug, and I have found a couple of bug reports already reported on this issue. I am currently using 12.04, it did not also work in 12.10.
Is there a... | 2012/10/27 | [
"https://askubuntu.com/questions/207306",
"https://askubuntu.com",
"https://askubuntu.com/users/101428/"
] | Déjà Dup is a (very useful) frontend to the `duplicity` command line program.
There are instructions on using it to restore backups on the GNOME wiki:
[Apps/DejaDup/Help/Restore/WorstCase - GNOME Wiki!](https://wiki.gnome.org/Apps/DejaDup/Help/Restore/WorstCase) | I think you can reinstall Deja dup and may be you try Back in Time , it's also used in Ubuntu Software Center |
26,951,812 | In my F# application I often need to perform a case-insensitive search of a string within a string, so I created a function with the appropriate comparison:
```
let indexOf (str:string) (value:string) startIndex =
match str.IndexOf(value, startIndex, StringComparison.OrdinalIgnoreCase) with
| index when index ... | 2014/11/15 | [
"https://Stackoverflow.com/questions/26951812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/603268/"
] | If you are defining the functionality as F# functions, then I think that using two separate functions (with reasonably descriptive names) is probably the best option you have. So I'd go with your first option (I definitely prefer this option over defining a discriminated union just for this single purpose):
```
let in... | I think option 1 (with curried function) would be simplest. Curried functions are pretty common in functional programming.
In options 2 or 3 you'll still have to pass additional parameter to the function for the search from the beginning
Options 4 or 5 require additional overhead to create type. It's kind of 'overkil... |
2,874,756 | I have found the Euler-Langrange equation of the functional:
$$\int\_{a}^{b} y'^2+y^4\,\mathrm dx$$
to be $y'' = 2y^3$
How do I solve this non-linear DE? | 2018/08/07 | [
"https://math.stackexchange.com/questions/2874756",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/551287/"
] | $$y''=2y^3$$
$$2y''y'=4y^3y'$$
$$y^4=y'^2+c\_1$$
$$y'=\pm \sqrt{y^4-c\_1}$$
$$x=\pm\int \frac{\mathrm dy}{\sqrt{y^4-c\_1}}+c\_2$$
This is an elliptic integral : <http://mathworld.wolfram.com/EllipticIntegral.html>
The inverse function $y(x)$ involves the sn Jacobi elliptic function :
<http://mathworld.wolfram.com/Jaco... | $$y'' = 2y^3$$
Substitute
$$p=\frac {\mathrm dy}{\mathrm dx} \implies y''=\frac {\mathrm dp}{\mathrm dx}=\frac {\mathrm dp}{\mathrm dy}\frac {\mathrm dy}{\mathrm dx}=p'p$$
Then the equation is separable
$$pp'=2y^3$$
Integrate
$$\int p\,\mathrm dp=2\int y^3\,\mathrm dy$$
$$p^2+K=\frac {y^4}2$$
$$\frac {\mathrm dy}{\mat... |
27,176,097 | Those are my declarations and methods of DispatcherTimer:
```
private DispatcherTimer DishTimer;
private TimeSpan SpanTime;
private void InitTimer()
{
DishTimer = new DispatcherTimer();
DishTimer.Interval = new TimeSpan(0, 0, 0, 1);
DishTimer.Tick += TimerOnTick;
}
private void TimerOnTick(object sender... | 2014/11/27 | [
"https://Stackoverflow.com/questions/27176097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3420365/"
] | Calling `Stop()` and then `Start()` should restart the Timer Interval. | You need to (re)set your `SpanTime` when you press the Capture-button.
just do
```
SpanTime = new TimeSpan();
```
it should be reset to zero and start over until you press the button again. |
9,239 | What makes an option strategy long or short?
I got the impression that if it is a net debit (you pay to open the strategy) it is classified 'long' (strangle, straddle)
Then I learned about the call butterfly which is short (when debited to open) and long (when credited to open) and got confused.
What became further co... | 2013/10/23 | [
"https://quant.stackexchange.com/questions/9239",
"https://quant.stackexchange.com",
"https://quant.stackexchange.com/users/6346/"
] | All complex multi leg options strategies involve being both long and short options. In other words to enter into a multileg position one is both buys options and sells other options. Therefore it is confusing to think of spreads (2 legs), butterflies (3 legs) and condors(4 legs) as buying them or selling them. Step bac... | In Finance, a Position , or a Greek ( delta , gamma , vega , etc... ) or any other quantity is said to be "long" if the holder benefits when that position / greek increases with time ahead.
Hope it clarifies your doubt ! |
4,029,417 | Straight to the point: given the integral
$$\iint\_Q \frac{1}{\left(x^2+y^2+z^2\right)^{3/2}}\,dxdy$$
where $Q=[-a,a]\times[-b,b]$, can you think of any neat way to solve it?
At a first glance it looked quite innocent. No need to say that I’ve changed my mind.
EDIT:
Integrating first w.r.t. y, using the integral
... | 2021/02/17 | [
"https://math.stackexchange.com/questions/4029417",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/685451/"
] | **Hint:** $T$ is self-adjoint and has no eigenvectors. Use the spectral theorem. | **Hint**
Let $f\_n(x)=n^{3/2}\boldsymbol 1\_{[0,\frac{1}{n}]}(x)$ for all $n\in\mathbb N$. Set $K=\{f\_n\mid n\in\mathbb N\}\subset L^2(0,1)$. Is $K$ bounded ? Is $T(K)$ relatively compact ? |
4,029,417 | Straight to the point: given the integral
$$\iint\_Q \frac{1}{\left(x^2+y^2+z^2\right)^{3/2}}\,dxdy$$
where $Q=[-a,a]\times[-b,b]$, can you think of any neat way to solve it?
At a first glance it looked quite innocent. No need to say that I’ve changed my mind.
EDIT:
Integrating first w.r.t. y, using the integral
... | 2021/02/17 | [
"https://math.stackexchange.com/questions/4029417",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/685451/"
] | **Hint**
Let $f\_n(x)=n^{3/2}\boldsymbol 1\_{[0,\frac{1}{n}]}(x)$ for all $n\in\mathbb N$. Set $K=\{f\_n\mid n\in\mathbb N\}\subset L^2(0,1)$. Is $K$ bounded ? Is $T(K)$ relatively compact ? | On the infinite dimensional invariant subspace $\{f\in L\_2([0,1]): f\_{[0,1/2]}=0\}$ the operator is invertible. |
4,029,417 | Straight to the point: given the integral
$$\iint\_Q \frac{1}{\left(x^2+y^2+z^2\right)^{3/2}}\,dxdy$$
where $Q=[-a,a]\times[-b,b]$, can you think of any neat way to solve it?
At a first glance it looked quite innocent. No need to say that I’ve changed my mind.
EDIT:
Integrating first w.r.t. y, using the integral
... | 2021/02/17 | [
"https://math.stackexchange.com/questions/4029417",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/685451/"
] | **Hint:** $T$ is self-adjoint and has no eigenvectors. Use the spectral theorem. | On the infinite dimensional invariant subspace $\{f\in L\_2([0,1]): f\_{[0,1/2]}=0\}$ the operator is invertible. |
12,041 | So basically L satisfies the conditions of the pumping lemma for CFL's but is not a CFL (that is possible according to the definition of the lemma). | 2013/05/15 | [
"https://cs.stackexchange.com/questions/12041",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/8197/"
] | The classical example is $L = \{ a^i b^j c^k : i,j,k \text{ all different} \}$. Wise shows in his paper [A strong pumping lemma for context-free languages](http://www.sciencedirect.com/science/article/pii/0304397576900529) that neither the Bar-Hillel pumping lemma nor Parikh's theorem (stating that the set of lengths o... | A simple language is $\{a b^n c^n d^n \colon n \ge 1\} \cup \mathcal{L}(a a^+ b^+ c^+ d^+)$. Intersect with $\mathcal{L}(a b^+ c^+ d^+)$ to get a clearly non-CFL, but you can always pump the $a$, and mimetize the equal-length-ness in the sea of ${}^+$. |
12,041 | So basically L satisfies the conditions of the pumping lemma for CFL's but is not a CFL (that is possible according to the definition of the lemma). | 2013/05/15 | [
"https://cs.stackexchange.com/questions/12041",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/8197/"
] | The classical example is $L = \{ a^i b^j c^k : i,j,k \text{ all different} \}$. Wise shows in his paper [A strong pumping lemma for context-free languages](http://www.sciencedirect.com/science/article/pii/0304397576900529) that neither the Bar-Hillel pumping lemma nor Parikh's theorem (stating that the set of lengths o... | Even simpler: $\{a^m b^n c^n d^n\colon m \ge 1, n \ge 1\}$. Can always pump the $a$s; intersection with the regular $\mathcal{L}(a b^+ c^+ d^+)$ gives a non-CFL (and that *can* be proved by pumping lemma). |
12,041 | So basically L satisfies the conditions of the pumping lemma for CFL's but is not a CFL (that is possible according to the definition of the lemma). | 2013/05/15 | [
"https://cs.stackexchange.com/questions/12041",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/8197/"
] | Even simpler: $\{a^m b^n c^n d^n\colon m \ge 1, n \ge 1\}$. Can always pump the $a$s; intersection with the regular $\mathcal{L}(a b^+ c^+ d^+)$ gives a non-CFL (and that *can* be proved by pumping lemma). | A simple language is $\{a b^n c^n d^n \colon n \ge 1\} \cup \mathcal{L}(a a^+ b^+ c^+ d^+)$. Intersect with $\mathcal{L}(a b^+ c^+ d^+)$ to get a clearly non-CFL, but you can always pump the $a$, and mimetize the equal-length-ness in the sea of ${}^+$. |
4,165,335 | Let $(\mathbb{Z}/n\mathbb{Z})^{\times}$ the set of units of $\mathbb{Z}/n\mathbb{Z}$ (i.e the elements with multiplicative inverse). And consider the groups:
$$(\mathbb{Z}/17\mathbb{Z})^{\times}, (\mathbb{Z}/32\mathbb{Z})^{\times}, (\mathbb{Z}/34\mathbb{Z})^{\times}, (\mathbb{Z}/40\mathbb{Z})^{\times}, (\mathbb{Z}/48 \... | 2021/06/06 | [
"https://math.stackexchange.com/questions/4165335",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/842659/"
] | The given groups are $ U\_{17}, U\_{32}, U\_{34}, U\_{40} \, and \, U\_{48} $ which are respectively isomorphic to
$\mathbb Z\_{16}, \mathbb Z\_ 2 \times \mathbb Z\_8 , U\_2 \times U\_{17}, U\_8\times U\_5 \, and \, U\_{16} \times U\_3$. These are respectively isomorphic to $\mathbb Z\_{16}, \mathbb Z\_2 \times \mathbb... | You can see fairly directly that at least $(\mathbb{Z}/17\mathbb{Z})^{\times}$ and $(\mathbb{Z}/34\mathbb{Z})^{\times}$ are isomorphic.
Indeed, $(\mathbb{Z}/34\mathbb{Z})^{\times}$ are the set of integers
$\{k \in \{1,2, \ldots, 33\}$; $k$ odd;$ (k,17)=1\}$. So let $\phi$: $(\mathbb{Z}/34\mathbb{Z})^{\times} \mapsto (... |
72,059,589 | I have three columns,two are used to calculate the one. I'm using leading 0s for the "waypoint #" and I would like to include them so the Ref # column, its formula is `=IF(OR([@[GPS colour]] = "O"), "1", "2")& [@[waypoint '#]]`.
[](https://i.stack.img... | 2022/04/29 | [
"https://Stackoverflow.com/questions/72059589",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13822027/"
] | One needs to use TEXT to keep the format:
```
TEXT([@[waypoint '#]],"000")
```
So:
```
=IF(OR([@[GPS colour]] = "O"), "1", "2")& TEXT([@[waypoint '#]],"000")
```
Also it can be simplified:
```
((@[GPS colour]] <> "O")+1)&TEXT([@[waypoint '#]],"000")
``` | To me GPS color looks like a character (O) not a zero (0).
In case there is more than one Character that should be mapped, try this:
[](https://i.stack.imgur.com/F9kpX.png)
`=IFNA(INDEX(configMapping[Mapping],MATCH([@[GPS colour]],configMapping[GPS ... |
673,895 | I have a small question about how to approach this problem:
$\dfrac{d}{dx}\left((-4x^2-9)^6 \* (6x^2+17)^{15}\right)$
Am I correct in thinking that I should do the Product Rule and THEN the Chain rule? | 2014/02/12 | [
"https://math.stackexchange.com/questions/673895",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/127475/"
] | Let $f(x) =(-4x^2-9)^6$ and $g(x) = (6x^2+17)^{15}$. Then $h(x)=f(x)g(x)$
$$\implies h'(x)=f(x)g'(x)+g(x)f'(x)\tag{using product rule}$$
Then use the **chain rule** to find $f'(x)$ and $g'(x)$ and you're good to go. | $$f\left(x\right)=\left(-4x^2-9\right)^6\*\left(6x^2+17\right)^{15}$$
$$ \;\quad \quad \quad =\left[-\left(4x^2+9\right)\right]^6\*\left(6x^2+17\right)^{15}$$
$$ \;\;\;\quad \quad \quad =\left(-1\right)^6\left(4x^2+9\right)^6\*\left(6x^2+17\right)^{15}$$
$$ \;\;\;\quad =\left(4x^2+9\right)^6\*\left(6x^2+17\right)^{1... |
39,060,261 | I am trying to deploy this app to Heroku, but when deploying the app to heroku I am getting the following error:
**Application Error
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.**
On the logs ... | 2016/08/21 | [
"https://Stackoverflow.com/questions/39060261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1547007/"
] | Short answer: no. Variables can be defined only within functions.
Another way to implement your function is to use pattern matching in function heads:
```
get_weather(toronto) -> rain;
get_weather(montreal) -> storms;
get_weather(london) -> fog;
get_weather(paris) -> sun;
get_weather(boston) -> fog;
get_weather(vanco... | An alternative is to define a function that returns the data list:
```
weather_data() -> [{toronto, rain},
{montreal, storms},
{london, fog},
{paris, sun},
{boston, fog},
{vancouver, snow}].
get_weather() ->
[Locatio... |
28,994,095 | To begin have a look at the following fiddle:
<https://jsfiddle.net/ob43hwdu/1/>
with help from this community, JSON data are displayed on screen upon the user hitting the generate button. In the sense that they are various input field that user fills in and when they hit generate, it populates the json data on screen... | 2015/03/11 | [
"https://Stackoverflow.com/questions/28994095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4644565/"
] | You wont be able to this with just javascript, jquery, html, json or html5.
You'll need some serverside processing to get the string and save it on the system.
PHP is simple to use but you have to check what's instaled on your server and if you have permission to create/save files. | You can use something like [Firebase](https://www.firebase.com/) or [OpenWS](http://openws-app.herokuapp.com/) that will allow you to hook your form submission into something that can save JSON objects into a backend. |
7,629,774 | I am interested in making a game in Haskell and I am looking for a graphics library. I found one called the HUGS Graphics Library but much to my dismay it only runs on Win32. I was wondering if there was a graphics library for Linux/Unix Haskell programming or am I out of luck. Thank you for reading. | 2011/10/02 | [
"https://Stackoverflow.com/questions/7629774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/809055/"
] | Raincat is a simple puzzle game written in Haskell that demonstrates graphics library usage and some strait forward techniques. Try looking up some Haskell SDL and OpenGL tutorials to help you in understanding the code. I am looking forward to playing your game.
Regards,
<http://hackage.haskell.org/package/Raincat> | Do you know about [hackage](http://hackage.haskell.org/packages/archive/pkg-list.html)? Hosted on hackage are lots of graphics-related libraries. Low level OpenGL bindings (openglraw, glut, hgl, glfw), higher level special-purpose GL libraries (ex: gloss), 2D libraries (cairo, gtk, gd), and more. For 2D I suggest you s... |
35,212,929 | Say that I have two `WeakReference` instances and I want to see if they point to the same object or not. You could imagine two scenarios, one where both references point to the same object:
```
SomeClass a = 1;
var wr1 = new WeakReference(a);
var wr2 = new WeakReference(a);
```
and one where they don't:
```
SomeCla... | 2016/02/04 | [
"https://Stackoverflow.com/questions/35212929",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5130863/"
] | Target property references to the underlying object.
Try this:
```
wr1.Target == wr2.Target
``` | You can create own wrapper for the `WeakReference` with overloaded operator. Like this:
```
public interface IWeakReferenceDecorator<T> where T : class
{
public void SetTarget(T target);
public bool TryGetTarget(out T target);
}
public class TransientWeakReference<T> : IWeakReferenceDe... |
30,431,037 | I have an Angular project where in one view you have a list of orders, of those orders you will see only the title, once you click on that title, you should be redirected by the `list.id` to a new view where you would see the full content of the order.
This is the html where you should see the title of that order
```... | 2015/05/25 | [
"https://Stackoverflow.com/questions/30431037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3424817/"
] | You don't need to use any `ng-repeat`
and just use `order` instead, look:
```
<table class="table">
<tbody>
<tr>
<th>Supervisor:</th>
<td>{{order.supervisor}}</td>
</tr>
<tr>
... | AFAIK you have to use variable `order` instead of `list` in `table`. Am thinking that `table` is in detailed view.
For the uri `/orders/:id` you have `order` variable in controller `OrderIdCtrl`. |
13,385,503 | We use [?? Operator](http://msdn.microsoft.com/en-us/library/ms173224.aspx) to evaluate expressions against null values, for example:
```
string foo = null;
string bar = "woooo";
string foobar= foo ?? bar ;
// Evaluates foobar as woooo
```
We also used an `if` statement, which works the same if used with above expr... | 2012/11/14 | [
"https://Stackoverflow.com/questions/13385503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1490287/"
] | You may be asking the wrong question. You don't choose to use one over the other primarily due to efficiency (though it may be a secondary concern), but due to utility.
Really you should compare `??` to `?:` and not to `if` as they have different purposes. Yes, they are all some form of "conditional" goodness, but the... | They should both compile to the same IL, and thus execute the same.
Even if they didn't, the performance difference would be negligible. I wouldn't even think to look at this unless I profiled my application and saw the statements taking a significant amount of time.
Always use the clearest syntax unless you can prov... |
17,198,204 | I have a project, TestA, that depends on another project, TestB and this is mentioned in the pom.xml. Now, I need to load a few configuration files that are present in TestB from TestA at runtime. Any idea how to do it? | 2013/06/19 | [
"https://Stackoverflow.com/questions/17198204",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1326947/"
] | If your ActiveRecord model associations are setup correctly, you can do:
```
Player.create(game: Game.default_game)
```
Alternatively, you can set the id more directly:
```
Player.create(game_id: Game.default_game.id)
``` | is the datatype of game\_id have the same datatype of default\_game? In some langauges, instead of crashing, NIL Is a returned value. |
36,886,539 | I have got some problem.
In the enitity I have set validation.
I have there term field, which is required (NotBlank constraint).
It works fine, but when someone is editing the object I want to disable the validation on this field; then it's not required, because someone already uploaded this file. Of course I have only... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36886539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3453400/"
] | Pyomo latest release which is `pyomo4.3.11377` is not working with windows 10.
I have tried an older version using `pip install pyomo==4.3.11328` and it solved all of my problems and I used an older version of **glpk4.57** with it to run the optimizations | Can you try installing missing coopr module: **pip install Coopr**
More in this link,
<https://software.sandia.gov/downloads/pub/coopr/CooprInstallGuide.html> |
36,886,539 | I have got some problem.
In the enitity I have set validation.
I have there term field, which is required (NotBlank constraint).
It works fine, but when someone is editing the object I want to disable the validation on this field; then it's not required, because someone already uploaded this file. Of course I have only... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36886539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3453400/"
] | This was a problem with the wheel file that was uploaded to pypi. The issue was fixed as of Pyomo 4.3.11388. | Can you try installing missing coopr module: **pip install Coopr**
More in this link,
<https://software.sandia.gov/downloads/pub/coopr/CooprInstallGuide.html> |
36,886,539 | I have got some problem.
In the enitity I have set validation.
I have there term field, which is required (NotBlank constraint).
It works fine, but when someone is editing the object I want to disable the validation on this field; then it's not required, because someone already uploaded this file. Of course I have only... | 2016/04/27 | [
"https://Stackoverflow.com/questions/36886539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3453400/"
] | Pyomo latest release which is `pyomo4.3.11377` is not working with windows 10.
I have tried an older version using `pip install pyomo==4.3.11328` and it solved all of my problems and I used an older version of **glpk4.57** with it to run the optimizations | This was a problem with the wheel file that was uploaded to pypi. The issue was fixed as of Pyomo 4.3.11388. |
20,057,615 | So I have this function in my class that reads in these three variables until numSale equals 10, or else until "X" is entered. Currently, I can run this, but it does not exit. Any advice on how to make the loop quit if X is hit?
```
void Read()
{
string id;
float price;
float amount;
cout... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20057615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2108147/"
] | Change this:
```
while(id != "X" || numSale < MAX_RECORDS)
```
into this:
```
while(id != "X" && numSale < MAX_RECORDS)
```
A `while` loop keeps running **as long as** the expression inside it is true. | The easiest way is to start off with checking that you stream is in good state. You want to check our input *after* reading it anyway:
```
while (numSale < MAX_RECORDS && std::cin >> id >> price >> amount && id != "X") {
// do something with the input
}
``` |
20,057,615 | So I have this function in my class that reads in these three variables until numSale equals 10, or else until "X" is entered. Currently, I can run this, but it does not exit. Any advice on how to make the loop quit if X is hit?
```
void Read()
{
string id;
float price;
float amount;
cout... | 2013/11/18 | [
"https://Stackoverflow.com/questions/20057615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2108147/"
] | Change this:
```
while(id != "X" || numSale < MAX_RECORDS)
```
into this:
```
while(id != "X" && numSale < MAX_RECORDS)
```
A `while` loop keeps running **as long as** the expression inside it is true. | How are you testing the exit? Could it be the case that `cin >> id >> price >> amount` is blocking waiting for a `price` and an `amount`?
In other words, if the user just enters
```
X <Enter>
```
Your program will still stay on the cin line until it finds two more inputs that it can parse as floats. |
47,665,043 | I have the following
```
<div class="row">
<div class="col-md-6">
<div class = "box-cell">
<p>
Slightly short text
</p>
</div>
</div>
<div class="col-md-6">
<div class = "box-cell">
<p>
Text that<br>literally<br>spans<br>4 lines
</p>
</div>
</div>
</div>
... | 2017/12/06 | [
"https://Stackoverflow.com/questions/47665043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/964335/"
] | I tried [replicating what it sounds like you are looking for.](https://jsfiddle.net/vusynd03/)
I would recommend you mess around with `flexbox` since it seems to do exactly what you are looking for.
```
<div class="myc">
<div class="col">
<p>Text of some sorts</p>
<p>Text of some sorts</p>
<p>Te... | ```css
.row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.row > [class*='col-'] {
display: flex;
flex-direction: column;
}
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" h... |
47,665,043 | I have the following
```
<div class="row">
<div class="col-md-6">
<div class = "box-cell">
<p>
Slightly short text
</p>
</div>
</div>
<div class="col-md-6">
<div class = "box-cell">
<p>
Text that<br>literally<br>spans<br>4 lines
</p>
</div>
</div>
</div>
... | 2017/12/06 | [
"https://Stackoverflow.com/questions/47665043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/964335/"
] | I tried [replicating what it sounds like you are looking for.](https://jsfiddle.net/vusynd03/)
I would recommend you mess around with `flexbox` since it seems to do exactly what you are looking for.
```
<div class="myc">
<div class="col">
<p>Text of some sorts</p>
<p>Text of some sorts</p>
<p>Te... | ```
<style type="text/css">
.box-cell{
position: relative;
margin: 3px;
border-style: groove ridge ridge groove;
border-width: 3px;
background-size: cover;
}
</style>
<div class="row">
<div class="col-md-6">
<div class = "box-cell">
<p>
Slightly short te... |
47,665,043 | I have the following
```
<div class="row">
<div class="col-md-6">
<div class = "box-cell">
<p>
Slightly short text
</p>
</div>
</div>
<div class="col-md-6">
<div class = "box-cell">
<p>
Text that<br>literally<br>spans<br>4 lines
</p>
</div>
</div>
</div>
... | 2017/12/06 | [
"https://Stackoverflow.com/questions/47665043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/964335/"
] | I tried [replicating what it sounds like you are looking for.](https://jsfiddle.net/vusynd03/)
I would recommend you mess around with `flexbox` since it seems to do exactly what you are looking for.
```
<div class="myc">
<div class="col">
<p>Text of some sorts</p>
<p>Text of some sorts</p>
<p>Te... | Some options to solve it:
[Different Tricks on How to Make Bootstrap Columns All the Same Height](https://scotch.io/bar-talk/different-tricks-on-how-to-make-bootstrap-columns-all-the-same-height) |
47,665,043 | I have the following
```
<div class="row">
<div class="col-md-6">
<div class = "box-cell">
<p>
Slightly short text
</p>
</div>
</div>
<div class="col-md-6">
<div class = "box-cell">
<p>
Text that<br>literally<br>spans<br>4 lines
</p>
</div>
</div>
</div>
... | 2017/12/06 | [
"https://Stackoverflow.com/questions/47665043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/964335/"
] | ```css
.row {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.row > [class*='col-'] {
display: flex;
flex-direction: column;
}
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" h... | ```
<style type="text/css">
.box-cell{
position: relative;
margin: 3px;
border-style: groove ridge ridge groove;
border-width: 3px;
background-size: cover;
}
</style>
<div class="row">
<div class="col-md-6">
<div class = "box-cell">
<p>
Slightly short te... |
47,665,043 | I have the following
```
<div class="row">
<div class="col-md-6">
<div class = "box-cell">
<p>
Slightly short text
</p>
</div>
</div>
<div class="col-md-6">
<div class = "box-cell">
<p>
Text that<br>literally<br>spans<br>4 lines
</p>
</div>
</div>
</div>
... | 2017/12/06 | [
"https://Stackoverflow.com/questions/47665043",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/964335/"
] | Some options to solve it:
[Different Tricks on How to Make Bootstrap Columns All the Same Height](https://scotch.io/bar-talk/different-tricks-on-how-to-make-bootstrap-columns-all-the-same-height) | ```
<style type="text/css">
.box-cell{
position: relative;
margin: 3px;
border-style: groove ridge ridge groove;
border-width: 3px;
background-size: cover;
}
</style>
<div class="row">
<div class="col-md-6">
<div class = "box-cell">
<p>
Slightly short te... |
387,196 | "I've done everything I can"
"I've done everything I can **do**"
Which of the above is the grammatically correct version? Is the "do" at the end needed?
Thanks! | 2017/04/30 | [
"https://english.stackexchange.com/questions/387196",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/233758/"
] | Both are grammatically correct.
I believe that the first is more common, but I do not find the second one at all strange. | "I've done everything I can" is correct
;-)
Rather "I've done everything I can do" one might say "I've done all I can do" |
387,196 | "I've done everything I can"
"I've done everything I can **do**"
Which of the above is the grammatically correct version? Is the "do" at the end needed?
Thanks! | 2017/04/30 | [
"https://english.stackexchange.com/questions/387196",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/233758/"
] | It is fine to elide a verb after an auxiliary verb. It's simply a matter of omitting a verb whose meaning can be ascertained from the prior clause. Since it's understandable, it's acceptable.
This is [also discussed here](https://english.stackexchange.com/questions/317847/omitting-verbs-is-it-correct).
Another examp... | "I've done everything I can" is correct
;-)
Rather "I've done everything I can do" one might say "I've done all I can do" |
13,206,526 | Is it ok to use initialization like this?
```
class Foo
{
public:
Foo() : str("str") {}
char str[4];
};
```
And this?
```
int main()
{
char str[4]("str");
}
```
Both give me an error in gcc 4.7.2:
>
> error: array used as initializer
>
>
>
Comeau compiles both. | 2012/11/03 | [
"https://Stackoverflow.com/questions/13206526",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1608835/"
] | In C++03, the non-static member array cannot be initialized as you mentioned. In g++ may be you can have an extension of *initializer list*, but that's a C++11 feature.
Local variable in a function can be initialized like this:
```
char str[] = "str"; // (1)
char str[] = {'s','t','r',0}; // (2)
```
Though you can ... | In C++03, that is not possible. Comeau might compile it because of non-Standard extension.
In C++11, you can do this:
```
Foo() : str({'s','t','r'}) {} //C++11 only
```
Or, you may prefer this intead:
```
class Foo
{
public:
Foo() {}
char str[4] = "str"; //in-class initialization (C++11 only)
};
```
... |
13,206,526 | Is it ok to use initialization like this?
```
class Foo
{
public:
Foo() : str("str") {}
char str[4];
};
```
And this?
```
int main()
{
char str[4]("str");
}
```
Both give me an error in gcc 4.7.2:
>
> error: array used as initializer
>
>
>
Comeau compiles both. | 2012/11/03 | [
"https://Stackoverflow.com/questions/13206526",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1608835/"
] | This code is valid C++03 and gcc is simply not conformant here.
The language that allows this syntax for initializing character arrays is the same as allows it for any other type; there are no exceptions that would prohibit it from being used on character arrays. `()` and `=` initialization are equivalent in these cas... | In C++03, that is not possible. Comeau might compile it because of non-Standard extension.
In C++11, you can do this:
```
Foo() : str({'s','t','r'}) {} //C++11 only
```
Or, you may prefer this intead:
```
class Foo
{
public:
Foo() {}
char str[4] = "str"; //in-class initialization (C++11 only)
};
```
... |
61,888,654 | I have two tables `t1,t2` as below:
t1
```
[date] col1 col3 col4
13-05-2020 xyz ttx 1
16-05-2020 xyz abc 5
15-05-2019 xyz abc 2
11-05-2019 xyz ttx 3
19-05-2020 xyx abc 4
```
t2
```
[date] col1
14-05-2019 ttx
18-05-2020 abc
19-05-2020 abc
```
I am trying ... | 2020/05/19 | [
"https://Stackoverflow.com/questions/61888654",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13531852/"
] | I have come up with a solution.
```
from os import getpid, kill
from time import sleep
import signal
import ipykernel
import psutil
def get_active_kernels():
active_kernels = []
pids = psutil.pids()
my_pid = getpid()
for pid in pids:
if pid == my_pid:
continue
try:
... | Jupyter notebooks work with an instance VM on its backend and you can access them through ssh protocol like the other instances from the compute engine. This means that any script which works in a computer engine instance must work with a jupyter notebook.
In your description I understand you are referring to this [s... |
8,708,814 | I am not quite adept in maneuvering jQuery, and it came to a point that I need to debug a program that was passed down from me without a documentation.
I have this var **a**, an object, that I really want to know the content of its collection. In my mind I need a function like `foreach()` in PHP to iterate over this o... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8708814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/941959/"
] | Why don't you just accumulate the values in an array, then display the whole array (for instance, using JSON)? Example:
```
var acc = []
$.each(a, function(index, value) {
acc.push(index + ': ' + value);
});
alert(JSON.stringify(acc));
```
In any case, I'd suggest using a debug tool like [Firebug](http://getfire... | In firefox you could try:
```
alert(yourObject.toSource());
```
OR you could use some plugin:
See: [jQuery Dump Plugin](http://code.google.com/p/jquery-dump-plugin/) |
41,253,613 | So I'm working on a project with some teammates and I have rebased on their changes, but is there a way to remove their commit (just locally - not planning to push it this way) and add it back at will?
\*\* Edit: Clarification, I don't want to combine the commit with my commit, I just want to make it as if that commi... | 2016/12/21 | [
"https://Stackoverflow.com/questions/41253613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/843400/"
] | Don't be afraid of branches! Branches—branch *names* in particular, because [the word "branch" is ambiguous in Git](https://stackoverflow.com/questions/25068543/what-exactly-do-we-mean-by-branch)—are so cheap as to be nearly free. For Git, creating a new branch consists of writing one commit hash ID into one file,1 and... | First, try to get all commit within repository
Try--> **`git log`**
which displays all commit to the repository.
there will be all different commit and reference number your team made:
Example:
-->commit 4406fbc67a665a1e78c9ac2698164986b81bed13
let you want to change on the first commit just refer that no. like this... |
41,253,613 | So I'm working on a project with some teammates and I have rebased on their changes, but is there a way to remove their commit (just locally - not planning to push it this way) and add it back at will?
\*\* Edit: Clarification, I don't want to combine the commit with my commit, I just want to make it as if that commi... | 2016/12/21 | [
"https://Stackoverflow.com/questions/41253613",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/843400/"
] | Don't be afraid of branches! Branches—branch *names* in particular, because [the word "branch" is ambiguous in Git](https://stackoverflow.com/questions/25068543/what-exactly-do-we-mean-by-branch)—are so cheap as to be nearly free. For Git, creating a new branch consists of writing one commit hash ID into one file,1 and... | You can rebase your commit onto the commit you want as the parent.
While on Commit C:
```
git rebase --onto <a_hash> <b_hash>
```
This doesn't "remove" B but it is no longer a part of C's history, which seems like it is your goal.
You can 'add it back' by rebasing back onto B.
```
git rebase --onto <b_hash> <a_ha... |
116,436 | In most publications scientific names are abbreviated except the first time. Moreover, the names must be in *italics* and only the first letter of the generic name should be upper-case.
The `biocon` package allow define a identifier for each species that manage all these requirements, but I don't want depend of remem... | 2013/05/27 | [
"https://tex.stackexchange.com/questions/116436",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/11604/"
] | Here's a hopefully complete solution also to the indexing problems. The assumption is that in the species' names you have only plain ASCII characters.
```
\documentclass[11pt]{article}
\usepackage{makeidx}
\usepackage{biocon}
\usepackage[colorlinks=true,linkcolor=blue]{hyperref}
\makeindex
% Provide \genus{Generic na... | Just for the record. Although [egreg](https://tex.stackexchange.com/users/4427/egreg) provided (in few minutes!) a complete rewrite of the macro, that works perfectly with the bonus point of not relying in `etoolbook` package, did not solve why `\lowercase` within `\providebool`, like the money inside my wallet, is n... |
58,881,075 | I'm working on an Angular 2 app where we allow the user to download a Word document. Right now it's working, but the name that comes back is a long string/GUID. I need the actual name of the file that was downloaded. Here's our setup:
on the client side:
```
downloadWordTemplate(): void {
this._data.getDocument(this.... | 2019/11/15 | [
"https://Stackoverflow.com/questions/58881075",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2584472/"
] | exactly what it says, there is another deployment with the same name going on at this time, either change the name of the deployment you are trying to queue or wait for the other deployment to finish\fail | This can also occur if you use Bicep templates for your ARM deployement and multiple modules or resources in the template have the same name:
```
module fooModule '../modules/foo.bicep' = {
name: 'foo'
}
module barModule '../modules/bar.bicep' = {
name: 'foo'
}
``` |
43,509,691 | Who writes on chip EMV application that communicates with terminal?
Are those developed by entities like VISA, Mastercard and given to issuing bank or the card issuing bank develops it and loads onto chip | 2017/04/20 | [
"https://Stackoverflow.com/questions/43509691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7256714/"
] | In most simple terms,
Card manufacturers manufacture card and also installs operating system and applet ( if java - open platform).
Card issuers personalize these cards( I guess you know what will be there in an emv card).
After personalization, card is ready to use. | Anyone who wrote EMV application (either native or javacard applet) and pass the payment scheme certification (functional or security), he could sell his product.
The general idea is that the application developed have to pass the mandated certification test before going to the market and carrying the payment scheme ... |
43,509,691 | Who writes on chip EMV application that communicates with terminal?
Are those developed by entities like VISA, Mastercard and given to issuing bank or the card issuing bank develops it and loads onto chip | 2017/04/20 | [
"https://Stackoverflow.com/questions/43509691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7256714/"
] | In most simple terms,
Card manufacturers manufacture card and also installs operating system and applet ( if java - open platform).
Card issuers personalize these cards( I guess you know what will be there in an emv card).
After personalization, card is ready to use. | There is a specification (ISO/IEC 7816-4) which specifies the protocol of an EMV card. It is on the net. Just google emvco and you would find them. The specification is complicated and takes time to understand. Here is a youtube channel
<https://youtu.be/iWg8EBhsfjY>
explaining the specification in a simple way. Espe... |
43,509,691 | Who writes on chip EMV application that communicates with terminal?
Are those developed by entities like VISA, Mastercard and given to issuing bank or the card issuing bank develops it and loads onto chip | 2017/04/20 | [
"https://Stackoverflow.com/questions/43509691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7256714/"
] | Anyone who wrote EMV application (either native or javacard applet) and pass the payment scheme certification (functional or security), he could sell his product.
The general idea is that the application developed have to pass the mandated certification test before going to the market and carrying the payment scheme ... | There is a specification (ISO/IEC 7816-4) which specifies the protocol of an EMV card. It is on the net. Just google emvco and you would find them. The specification is complicated and takes time to understand. Here is a youtube channel
<https://youtu.be/iWg8EBhsfjY>
explaining the specification in a simple way. Espe... |
52,939,916 | I have a dataframe, want to create third column say col3 based on the condition
if col2 value is present in col1 then 'Yes' else 'No'
```
data = [[[('330420', 0.9322496056556702), ('76546', 0.9322003126144409)],76546],[[('330420', 0.9322496056556702), ('500826', 0.9322003126144409)],876546]]
test = pd.DataFrame(data, ... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52939916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3623402/"
] | Using `any` with `zip`
```
[any([int(z[0])==y for z in x]) for x, y in zip (test.col1,test.col2)]
Out[227]: [True, False]
``` | Using numpy `where`:
```
test['col3'] = test.apply(lambda x: np.where(str(x.col2) in [i[0] for i in x.col1],"yes", "no"), axis =1)
test['col3']
0 yes
1 no
``` |
52,939,916 | I have a dataframe, want to create third column say col3 based on the condition
if col2 value is present in col1 then 'Yes' else 'No'
```
data = [[[('330420', 0.9322496056556702), ('76546', 0.9322003126144409)],76546],[[('330420', 0.9322496056556702), ('500826', 0.9322003126144409)],876546]]
test = pd.DataFrame(data, ... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52939916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3623402/"
] | Using `any` with `zip`
```
[any([int(z[0])==y for z in x]) for x, y in zip (test.col1,test.col2)]
Out[227]: [True, False]
``` | You should avoid lists in series. Let's try a vectorised solution:
```
# extract array of values and reshape
arr = np.array(df.pop('col1').values.tolist()).reshape(-1, 4)
# join to dataframe and replace list of tuples
df = df.join(pd.DataFrame(arr, dtype=float))
# apply test via isin
df['test'] = df.drop('col2', 1).... |
52,939,916 | I have a dataframe, want to create third column say col3 based on the condition
if col2 value is present in col1 then 'Yes' else 'No'
```
data = [[[('330420', 0.9322496056556702), ('76546', 0.9322003126144409)],76546],[[('330420', 0.9322496056556702), ('500826', 0.9322003126144409)],876546]]
test = pd.DataFrame(data, ... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52939916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3623402/"
] | Using `any` with `zip`
```
[any([int(z[0])==y for z in x]) for x, y in zip (test.col1,test.col2)]
Out[227]: [True, False]
``` | You can do this using `.apply()`
```
def sublist_checker(row):
check_both = ['Yes' if str(row['col2']) in sublist else 'No' for sublist in row['col1']]
check_any = 'Yes' if 'Yes' in check_both else 'No'
return check_any
test['col3'] = test.apply(sublist_checker, axis=1)
print(test)
... |
52,939,916 | I have a dataframe, want to create third column say col3 based on the condition
if col2 value is present in col1 then 'Yes' else 'No'
```
data = [[[('330420', 0.9322496056556702), ('76546', 0.9322003126144409)],76546],[[('330420', 0.9322496056556702), ('500826', 0.9322003126144409)],876546]]
test = pd.DataFrame(data, ... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52939916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3623402/"
] | You should avoid lists in series. Let's try a vectorised solution:
```
# extract array of values and reshape
arr = np.array(df.pop('col1').values.tolist()).reshape(-1, 4)
# join to dataframe and replace list of tuples
df = df.join(pd.DataFrame(arr, dtype=float))
# apply test via isin
df['test'] = df.drop('col2', 1).... | Using numpy `where`:
```
test['col3'] = test.apply(lambda x: np.where(str(x.col2) in [i[0] for i in x.col1],"yes", "no"), axis =1)
test['col3']
0 yes
1 no
``` |
52,939,916 | I have a dataframe, want to create third column say col3 based on the condition
if col2 value is present in col1 then 'Yes' else 'No'
```
data = [[[('330420', 0.9322496056556702), ('76546', 0.9322003126144409)],76546],[[('330420', 0.9322496056556702), ('500826', 0.9322003126144409)],876546]]
test = pd.DataFrame(data, ... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52939916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3623402/"
] | You can do this using `.apply()`
```
def sublist_checker(row):
check_both = ['Yes' if str(row['col2']) in sublist else 'No' for sublist in row['col1']]
check_any = 'Yes' if 'Yes' in check_both else 'No'
return check_any
test['col3'] = test.apply(sublist_checker, axis=1)
print(test)
... | Using numpy `where`:
```
test['col3'] = test.apply(lambda x: np.where(str(x.col2) in [i[0] for i in x.col1],"yes", "no"), axis =1)
test['col3']
0 yes
1 no
``` |
8,869,573 | I am trying to combine the data from two tables sales & purchase in one table. Both Sales & Purchase table shares foreign key from third table store.
What is the best way to construct the query to get the results exactly as in results tables, Preferably(if possible) without using sub-query, as I need to create a view ... | 2012/01/15 | [
"https://Stackoverflow.com/questions/8869573",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1124993/"
] | You have to change your query and put ORDER BY at bottom, something like the following should work :
```
SELECT * FROM `table` WHERE fdID = 2222 AND TabID IN (1,2,3)
UNION
select TabConID, Name, Tiles, Layers, TabID, NULL AS Score ID, NULL AS fbID, NULL AS Layout, NULL AS Score FROM `table` where fbID != 2222
ORDE... | You cannot have the WHERE clause before the UNION.
To do what you want you probably need to squeeze the first "leg" of the union into a subquery. |
8,869,573 | I am trying to combine the data from two tables sales & purchase in one table. Both Sales & Purchase table shares foreign key from third table store.
What is the best way to construct the query to get the results exactly as in results tables, Preferably(if possible) without using sub-query, as I need to create a view ... | 2012/01/15 | [
"https://Stackoverflow.com/questions/8869573",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1124993/"
] | You do not need to do a UNION query. Simply move the "fbId" condition from WHERE to the JOIN condition.
The below query should give you the desired result:
```
SELECT t1.*, t2.*
FROM TabContent t1
LEFT JOIN HighScore t2
ON t1.Name = t2.Layout AND t2.fbId = 2222
WHERE TabID IN (1,2,3)
ORDER BY TabID, LayoutName
```... | You cannot have the WHERE clause before the UNION.
To do what you want you probably need to squeeze the first "leg" of the union into a subquery. |
8,869,573 | I am trying to combine the data from two tables sales & purchase in one table. Both Sales & Purchase table shares foreign key from third table store.
What is the best way to construct the query to get the results exactly as in results tables, Preferably(if possible) without using sub-query, as I need to create a view ... | 2012/01/15 | [
"https://Stackoverflow.com/questions/8869573",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1124993/"
] | You do not need to do a UNION query. Simply move the "fbId" condition from WHERE to the JOIN condition.
The below query should give you the desired result:
```
SELECT t1.*, t2.*
FROM TabContent t1
LEFT JOIN HighScore t2
ON t1.Name = t2.Layout AND t2.fbId = 2222
WHERE TabID IN (1,2,3)
ORDER BY TabID, LayoutName
```... | You have to change your query and put ORDER BY at bottom, something like the following should work :
```
SELECT * FROM `table` WHERE fdID = 2222 AND TabID IN (1,2,3)
UNION
select TabConID, Name, Tiles, Layers, TabID, NULL AS Score ID, NULL AS fbID, NULL AS Layout, NULL AS Score FROM `table` where fbID != 2222
ORDE... |
14,516 | I purchased "Earthgro potting soil" today and I noticed something odd.
When i was patting down the soil, I looked at my hands and saw what seemed to be like crystal specs. They look like small tiny snowflakes or tiny broken glass. I took a closer look at the soil and noticed these specs all over it.
Is this normal a... | 2014/10/31 | [
"https://gardening.stackexchange.com/questions/14516",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/7360/"
] | Someone else has noticed this before. From [here](http://irregulartimes.com/2013/06/17/dangerous-earthgro-pottting-soil-from-scotts/):
>
> Do shards of glass and ceramic sherds count as organic and natural? That’s what I found in the Earthgro potting soil.
>
>
>
This product has very, [very poor reviews](http://r... | While it certainly could be contamination I would also consider the possibility it's water absorbing crystals. Something like this:
[http://www.amazon.com/Medium-absorbing-crystal-polymer-Insect/dp/B0051V40AO](http://rads.stackoverflow.com/amzn/click/B0051V40AO) |
67,510,784 | I'm gonna be honest, I have no clue what I'm looking at here.
Out of nowhere my Debug configuration in this VSCode project, a Discord bot, has been spitting out errors when I begin debugging. It doesn't do this when running the program normally, and debugging seems to be okay in other projects.
About 50% of the time,... | 2021/05/12 | [
"https://Stackoverflow.com/questions/67510784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14688435/"
] | **Answer:**
Change `"program": "bot"` to `"program": "${workspaceFolder}\\bot.py"` in `./.vscode/launch.json`.
For most people the file name will not be `bot`, but `main` or `script` or whatever you have called the file of your Python Script. So you would use `"${workspaceFolder}\\main.py"` etc.
**Background:**
In ... | ### Here's the reason for such error and a better way to fix it
>
> The error occurs because the python debugger executes files in the terminal from the current open folder (by default)
>
> But you can change this behavior, to use execute in the file's directory:
>
>
>
* Go to vscode settings (or use the short... |
40,458,087 | What are the most efficient ways to extract text from a string? Are there some available functions or regex expressions, or some other way?
>
> For example, my string is below and I want to extract the IDs as well
> as the ScreenNames, separately.
>
>
>
```
[User(ID=1234567890, ScreenName=RandomNameHere), User(I... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40458087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7124717/"
] | ```
import re
str = '[User(ID=1234567890, ScreenName=RandomNameHere), User(ID=233323490, ScreenName=AnotherRandomName), User(ID=4459284, ScreenName=YetAnotherName)]'
print 'Target IDs = ' + ','.join( re.findall(r'ID=(\d+)', str) )
print 'Target ScreenNames = ' + ','.join( re.findall(r' ScreenName=(\w+)', str) )
```
O... | The regex I'd use would be:
```
(?:ID=|ScreenName=)+(\d+|[\w\d]+)
```
However, this assumes that ID is only digits (`\d`) and usernames are only letters or numbers (`[\w\d]`).
This regex (when combined with `re.findall`) would return a list of matches that could be iterated through and sorted in some fashion like ... |
40,458,087 | What are the most efficient ways to extract text from a string? Are there some available functions or regex expressions, or some other way?
>
> For example, my string is below and I want to extract the IDs as well
> as the ScreenNames, separately.
>
>
>
```
[User(ID=1234567890, ScreenName=RandomNameHere), User(I... | 2016/11/07 | [
"https://Stackoverflow.com/questions/40458087",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7124717/"
] | ```
import re
str = '[User(ID=1234567890, ScreenName=RandomNameHere), User(ID=233323490, ScreenName=AnotherRandomName), User(ID=4459284, ScreenName=YetAnotherName)]'
print 'Target IDs = ' + ','.join( re.findall(r'ID=(\d+)', str) )
print 'Target ScreenNames = ' + ','.join( re.findall(r' ScreenName=(\w+)', str) )
```
O... | It depends. Assuming that all your text comes in the form of
```
TagName = TagValue1, TagValue2, ...
```
You need just two calls to split.
```
tag, value_string = string.split('=')
values = value_string.split(',')
```
Remove the excess space (probably a couple of `rstrip()`/`lstrip()` calls will suffice) and you ... |
160,519 | Probably close to 13 or 10 years since I've read it. But I cannot remember the name or author.
What I can remember is that it's a magic series, set in London. Based on magic artifacts like orbs that are and do different things and I think it's about a guy who buys them or has a shop. I remember there being golems and... | 2017/05/29 | [
"https://scifi.stackexchange.com/questions/160519",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/84087/"
] | Could this be the '[Bartimaeus Sequence](https://en.wikipedia.org/wiki/Bartimaeus_Sequence)' of books by Jonathan Stroud, starting with *The Amulet of Samarkand* (2003)?
It's set in London, there are djinni, golems, magical orbs and other such artifacts.
>
> The first book in the series, published 2003, introduces... | As Valorum has already [said](https://scifi.stackexchange.com/a/160520/31394), this is almost certainly the Bartimaeus series. However, since (I think) Valorum hasn't read these books himself and is only going by online descriptions, I thought it'd be worth having a more detailed answer based on knowledge of the books.... |
8,080,438 | I want to show a small popup menu when you right-click a tab, now this is working fine but when you right click it also selects that tab which is unwanted.
So my idea was to make a new class, extend JTabbedPane and recode those mouse events. Problem is that I have no idea where to start, I was browsing its [source](h... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8080438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/720386/"
] | Beware: dirty hack ahead! The only reason I recommend it, is that I consider the behaviour (select on right press) a bug in the BasicTabbedPaneUI's Handler.
The basic idea is to grab the listener installed by the ui, remove it, wrap into a custom listener which delegates everything except a right pressed to the origin... | then you have to add [JPopupMenu](http://download.oracle.com/javase/tutorial/uiswing/components/menu.html#popup) (or [JToolTip](http://download.oracle.com/javase/tutorial/uiswing/components/tooltip.html) on MouseHoverOver ) to the [JTabbedPane](http://download.oracle.com/javase/tutorial/uiswing/components/tabbedpane.ht... |
8,080,438 | I want to show a small popup menu when you right-click a tab, now this is working fine but when you right click it also selects that tab which is unwanted.
So my idea was to make a new class, extend JTabbedPane and recode those mouse events. Problem is that I have no idea where to start, I was browsing its [source](h... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8080438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/720386/"
] | then you have to add [JPopupMenu](http://download.oracle.com/javase/tutorial/uiswing/components/menu.html#popup) (or [JToolTip](http://download.oracle.com/javase/tutorial/uiswing/components/tooltip.html) on MouseHoverOver ) to the [JTabbedPane](http://download.oracle.com/javase/tutorial/uiswing/components/tabbedpane.ht... | This article will helpful for removing unwanted tab selection when you click right mouse button.
[Stop right click Event on JTabbedPane](https://community.oracle.com/thread/1364979?start=0&tstart=0)
I liked to add more about removing Mouse Listeners.
Try to override the method rather than removing it. It's better for ... |
8,080,438 | I want to show a small popup menu when you right-click a tab, now this is working fine but when you right click it also selects that tab which is unwanted.
So my idea was to make a new class, extend JTabbedPane and recode those mouse events. Problem is that I have no idea where to start, I was browsing its [source](h... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8080438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/720386/"
] | Beware: dirty hack ahead! The only reason I recommend it, is that I consider the behaviour (select on right press) a bug in the BasicTabbedPaneUI's Handler.
The basic idea is to grab the listener installed by the ui, remove it, wrap into a custom listener which delegates everything except a right pressed to the origin... | A possible workaround is to set your custom tab component for each tab - see JTabbedPane#setTabComponentAt(...). Add a mouse handler to your custom tab component and redispatch left click events to the tabbedPane as described at <http://www.jyloo.com/news/?pubId=1315817317000>.
The custom tab component can be a simpl... |
8,080,438 | I want to show a small popup menu when you right-click a tab, now this is working fine but when you right click it also selects that tab which is unwanted.
So my idea was to make a new class, extend JTabbedPane and recode those mouse events. Problem is that I have no idea where to start, I was browsing its [source](h... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8080438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/720386/"
] | Beware: dirty hack ahead! The only reason I recommend it, is that I consider the behaviour (select on right press) a bug in the BasicTabbedPaneUI's Handler.
The basic idea is to grab the listener installed by the ui, remove it, wrap into a custom listener which delegates everything except a right pressed to the origin... | This article will helpful for removing unwanted tab selection when you click right mouse button.
[Stop right click Event on JTabbedPane](https://community.oracle.com/thread/1364979?start=0&tstart=0)
I liked to add more about removing Mouse Listeners.
Try to override the method rather than removing it. It's better for ... |
8,080,438 | I want to show a small popup menu when you right-click a tab, now this is working fine but when you right click it also selects that tab which is unwanted.
So my idea was to make a new class, extend JTabbedPane and recode those mouse events. Problem is that I have no idea where to start, I was browsing its [source](h... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8080438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/720386/"
] | A possible workaround is to set your custom tab component for each tab - see JTabbedPane#setTabComponentAt(...). Add a mouse handler to your custom tab component and redispatch left click events to the tabbedPane as described at <http://www.jyloo.com/news/?pubId=1315817317000>.
The custom tab component can be a simpl... | This article will helpful for removing unwanted tab selection when you click right mouse button.
[Stop right click Event on JTabbedPane](https://community.oracle.com/thread/1364979?start=0&tstart=0)
I liked to add more about removing Mouse Listeners.
Try to override the method rather than removing it. It's better for ... |
7,971 | What was the percentage drop in hashrate during the 2018 march anti-ASIC hardfork before and after the fork?
Finding this number, can we estimate how many ASIC's were produced?
This is assuming this drop was all due to ASICs, but I'm sure many were also just due to non-upgraded miners. But judging from this drop, w... | 2018/04/06 | [
"https://monero.stackexchange.com/questions/7971",
"https://monero.stackexchange.com",
"https://monero.stackexchange.com/users/1078/"
] | The fork was moved to today (April 6, 2018), so it is hard to tell. Early indications based on block-times are about 80% of the hash-rate is missing. Some of that is non-ASIC miners failing to update on time. We should know more in a week or so. | The network hash rate was around 1123 MH/s at the time of the fork. The difficulty hasn't changed yet, so blocks are coming in much slower(lower hash rate at same "asic difficulty"), and while it will slowly decrease with each new block, it will take 720 blocks before the true adjustment takes place(a few more days at ... |
7,971 | What was the percentage drop in hashrate during the 2018 march anti-ASIC hardfork before and after the fork?
Finding this number, can we estimate how many ASIC's were produced?
This is assuming this drop was all due to ASICs, but I'm sure many were also just due to non-upgraded miners. But judging from this drop, w... | 2018/04/06 | [
"https://monero.stackexchange.com/questions/7971",
"https://monero.stackexchange.com",
"https://monero.stackexchange.com/users/1078/"
] | The fork was moved to today (April 6, 2018), so it is hard to tell. Early indications based on block-times are about 80% of the hash-rate is missing. Some of that is non-ASIC miners failing to update on time. We should know more in a week or so. | As of writing this answer (2018-04-07 03:00 UTC), ~18.5 hours after [network upgrade](https://moneroblocks.info/block/1546000), there are 65 blocks mined (latest is [1546065](https://moneroblocks.info/block/1546065)). It takes on average 17 minutes to mine a block, which is 8.5 times the expected 2 minutes.
The diffic... |
23,957,167 | The following HTML, when copied into an *.html* file and viewed in a browser directly shows my problem.
```
<!DOCTYPE HTML>
<html ng-app="myApp">
<head>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1... | 2014/05/30 | [
"https://Stackoverflow.com/questions/23957167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/969613/"
] | Ok so it turns out Google Maps can't handle rendering on a non-active tab, so I needed to create the tab and set it to active before I rendered the map.
I changed:
```
$scope.locations.push({ id: id, city: $scope.newLocation.city, country: $scope.newLocation.country });
```
To:
```
$scope.locations.push({ id: id, ... | try triggering a resize:
```
google.maps.event.trigger(map, "resize");
``` |
65,374,690 | Is there any chance to install Laravel 8 without Jetstream? I want to use Laravel 8 + Inertiajs + Vue.js + Tailwind. Unfortunately Orchid admin panel compatible just with Laravel 8; that's why I have to use Laravel 8. | 2020/12/19 | [
"https://Stackoverflow.com/questions/65374690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13450774/"
] | Yes, you can install laravel 8 without Jetstream, Jetstream is used for Auth, if you decide to create your auth by yourself you are free, or you can use [Laravel Breeze](https://github.com/laravel/breeze) if you are anti-Jetstream for Auth
```
composer create-project laravel/laravel nameofprojectt --prefer-dist
```
... | Yes, Laravel 8 is by default getting installed without Jetstream.
You can run the following command to start working without Jetstream.
Windows / MacOS:
```
curl -s https://laravel.build/example-app | bash
```
Don't forget to repalce "example-app" with the project/directory name you want to give it.
[Laravel inst... |
65,374,690 | Is there any chance to install Laravel 8 without Jetstream? I want to use Laravel 8 + Inertiajs + Vue.js + Tailwind. Unfortunately Orchid admin panel compatible just with Laravel 8; that's why I have to use Laravel 8. | 2020/12/19 | [
"https://Stackoverflow.com/questions/65374690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13450774/"
] | Yes, you can install laravel 8 without Jetstream, Jetstream is used for Auth, if you decide to create your auth by yourself you are free, or you can use [Laravel Breeze](https://github.com/laravel/breeze) if you are anti-Jetstream for Auth
```
composer create-project laravel/laravel nameofprojectt --prefer-dist
```
... | yeah you can
create project laravel
```
$ laravel new blog
```
replace blog by your project name
then go to inertia website, follow the steps and install inertia and vuejs
then install tailwindcss
it's work |
65,374,690 | Is there any chance to install Laravel 8 without Jetstream? I want to use Laravel 8 + Inertiajs + Vue.js + Tailwind. Unfortunately Orchid admin panel compatible just with Laravel 8; that's why I have to use Laravel 8. | 2020/12/19 | [
"https://Stackoverflow.com/questions/65374690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13450774/"
] | Yes, you can install laravel 8 without Jetstream, Jetstream is used for Auth, if you decide to create your auth by yourself you are free, or you can use [Laravel Breeze](https://github.com/laravel/breeze) if you are anti-Jetstream for Auth
```
composer create-project laravel/laravel nameofprojectt --prefer-dist
```
... | Yes you can
with composer
```
composer create-project laravel/laravel example-app
cd example-app
php artisan serve
``` |
65,374,690 | Is there any chance to install Laravel 8 without Jetstream? I want to use Laravel 8 + Inertiajs + Vue.js + Tailwind. Unfortunately Orchid admin panel compatible just with Laravel 8; that's why I have to use Laravel 8. | 2020/12/19 | [
"https://Stackoverflow.com/questions/65374690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13450774/"
] | Yes, you can install laravel 8 without Jetstream, Jetstream is used for Auth, if you decide to create your auth by yourself you are free, or you can use [Laravel Breeze](https://github.com/laravel/breeze) if you are anti-Jetstream for Auth
```
composer create-project laravel/laravel nameofprojectt --prefer-dist
```
... | if you have composer installed you can use this command line:
```
composer create-project laravel/laravel App_Name
``` |
65,374,690 | Is there any chance to install Laravel 8 without Jetstream? I want to use Laravel 8 + Inertiajs + Vue.js + Tailwind. Unfortunately Orchid admin panel compatible just with Laravel 8; that's why I have to use Laravel 8. | 2020/12/19 | [
"https://Stackoverflow.com/questions/65374690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13450774/"
] | Yes, you can install laravel 8 without Jetstream, Jetstream is used for Auth, if you decide to create your auth by yourself you are free, or you can use [Laravel Breeze](https://github.com/laravel/breeze) if you are anti-Jetstream for Auth
```
composer create-project laravel/laravel nameofprojectt --prefer-dist
```
... | First Install new Laravel project using the below command:
```
composer create-project --prefer-dist laravel/laravel YourProject
```
After that install InertiaJS in your project. For more information go to the below link:
<https://inertiajs.com/server-side-setup> |
10,426,640 | I'm building against various Lucene and Solr Maven artifacts from Apache's Maven repository hosted in the Nexus repository manager. The artifacts are version `4.0-SNAPSHOT` and get updated daily, with older artifacts being deleted regularly.
I was wondering how to peg the artifacts to a specific date, so whenever a Ma... | 2012/05/03 | [
"https://Stackoverflow.com/questions/10426640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14193/"
] | You need to backquote your `int`s as they are a reserved keyword.
Alternatively, use a different alias.
```
SELECT interest_desc, categoryID, category_desc, MAX(num_in_cat) AS num_in_cat
FROM
(
SELECT `int`.interest_desc, `int`.category_ID, cat.category_desc,
COUNT(categoryID) AS num_in_cat
FRO... | Naming a table `int` is a problem. It can be solved by quoting the table name, but you really should rename it. For your sanity, and those who will work on it after you. |
10,426,640 | I'm building against various Lucene and Solr Maven artifacts from Apache's Maven repository hosted in the Nexus repository manager. The artifacts are version `4.0-SNAPSHOT` and get updated daily, with older artifacts being deleted regularly.
I was wondering how to peg the artifacts to a specific date, so whenever a Ma... | 2012/05/03 | [
"https://Stackoverflow.com/questions/10426640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14193/"
] | Use a different alias for your `interests` table.
Also - you'll need to sort out the following:
* `categoryID` vs `category_ID` - which one is correct?
* `count(categoryID)` is ambiguous given that `categoryID` is present in both `categories` and `interests` table
Assuming that the column is `categoryID` on both tab... | Naming a table `int` is a problem. It can be solved by quoting the table name, but you really should rename it. For your sanity, and those who will work on it after you. |
43,593,286 | I want to handle a `kill signal` from C program.
I'm starting by create an infinite loop and handle the signal
```
void signal_callback_handler(int signum)
{
printf("Caught signal %d\n",signum);
// Cleanup and close up stuff here
// Terminate program
exit(signum);
}
main()
{
signal(SIGINT, signal_cal... | 2017/04/24 | [
"https://Stackoverflow.com/questions/43593286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1251787/"
] | This is it: **you cannot catch a `SIGKILL`**, it will *definitely* kill your program, this is what it's been created for. | You cannot catch or ignore a SIGKILL signal. Also in your code shown below you have created a signal handler only for SIGINT, that is, whenever a SIGINT signal is caught it will call the signal\_callback\_handler(). All other signals will be caught by the default signal handler.
```
signal(SIGINT, signal_callback_hand... |
43,593,286 | I want to handle a `kill signal` from C program.
I'm starting by create an infinite loop and handle the signal
```
void signal_callback_handler(int signum)
{
printf("Caught signal %d\n",signum);
// Cleanup and close up stuff here
// Terminate program
exit(signum);
}
main()
{
signal(SIGINT, signal_cal... | 2017/04/24 | [
"https://Stackoverflow.com/questions/43593286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1251787/"
] | This is it: **you cannot catch a `SIGKILL`**, it will *definitely* kill your program, this is what it's been created for. | You need to add
```
signal(SIGTERM, signal_callback_handler);
```
As you are only connected to SIGINT (e.g. Ctrl+C) but for a kill/killall your friend is SIGTERM |
43,593,286 | I want to handle a `kill signal` from C program.
I'm starting by create an infinite loop and handle the signal
```
void signal_callback_handler(int signum)
{
printf("Caught signal %d\n",signum);
// Cleanup and close up stuff here
// Terminate program
exit(signum);
}
main()
{
signal(SIGINT, signal_cal... | 2017/04/24 | [
"https://Stackoverflow.com/questions/43593286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1251787/"
] | You cannot catch or ignore a SIGKILL signal. Also in your code shown below you have created a signal handler only for SIGINT, that is, whenever a SIGINT signal is caught it will call the signal\_callback\_handler(). All other signals will be caught by the default signal handler.
```
signal(SIGINT, signal_callback_hand... | You need to add
```
signal(SIGTERM, signal_callback_handler);
```
As you are only connected to SIGINT (e.g. Ctrl+C) but for a kill/killall your friend is SIGTERM |
64,954,022 | I have this pandas dataframe
```
interval_mins = {
'10' : 0.11,
'15' : 0.4,
'20' : 0.19
}
pd.DataFrame({
'id' : [10, 15, 20, 10, 20, 15],
'interval' : [0.1, 0.39, 0.2, 0.12, 0.25, 0.42]
})
```
In pandas DataFrame, I want to select items with `interval` values less than `interval_mins` for each `i... | 2020/11/22 | [
"https://Stackoverflow.com/questions/64954022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8453594/"
] | Let's do:
```
m = df['interval'] < df['id'].astype(str).map(interval_mins)
df.loc[m.groupby(df['id']).shift(fill_value=False), 'interval'] += df.groupby('id')['interval'].shift()
```
**Details:**
Create a boolean mask representing condition where `interval` values are less than `interval_mins` for each `id`:
```
p... | Consistent with your rule, but not with your output (see my comment), this should do it. I leave intermediate calculations in place so it is easier to understand what's going on. Note I replaced keys in `interval_mis` with `int`s from `str`s. Desired output in column `interval_2`
```
df['add'] = df['id'].map(interval_... |
8,436,600 | I have to read a Date from a file and the date is written on this file in this way: `dd/MM//yy` but when the I read I obtain values totally different. For example: `17/11/10` became `Mon Jan 04 00:00:00 CET 2010`. The value is different.why?
This is the code I use:
```
SimpleDateFormat sdf=new SimpleDateFormat("dd/MM... | 2011/12/08 | [
"https://Stackoverflow.com/questions/8436600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1055637/"
] | The placeholder for year is `yy`, not `YY`. Don't know why it gives this result, though. | Can you include your actual code in the question because I doubt its `dd/MM//yy` and `dd/MM/YY` is invalid.
```
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy");
String text = "17/11/10";
System.out.println(sdf.parse(text));
```
prints
```
Wed Nov 17 00:00:00 GMT 2010
``` |
43,094,930 | I have multiple date arrays, I need to put these in input type hidden field value.
```
["5/3/2017"]
["12/3/2017"]
["19/3/2017"]
["26/3/2017"]
["26/2/2017"]
```
I want to make it like this:
```
<input type="hidden" value="5/3/2017, 12/3/2017, 19/3/2017, 26/3/2017, 26/2/2017">
```
I tried with merge, join() but I ... | 2017/03/29 | [
"https://Stackoverflow.com/questions/43094930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7169837/"
] | @Elbarto is correct, all I needed to do was echo "checked" and not "checked='checked'" | I hope this will work for you :
```
<select name="memType">
<option value="" selected="<?php if ( ($status != 'Option A') && ($status != 'Option B') ){echo 'selected';}?>">None</option>
<option value="Option A" selected="<?php if ($status == 'Option A'){echo 'selected';}?>">Option A</option>
<option valu... |
43,094,930 | I have multiple date arrays, I need to put these in input type hidden field value.
```
["5/3/2017"]
["12/3/2017"]
["19/3/2017"]
["26/3/2017"]
["26/2/2017"]
```
I want to make it like this:
```
<input type="hidden" value="5/3/2017, 12/3/2017, 19/3/2017, 26/3/2017, 26/2/2017">
```
I tried with merge, join() but I ... | 2017/03/29 | [
"https://Stackoverflow.com/questions/43094930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7169837/"
] | @Elbarto is correct, all I needed to do was echo "checked" and not "checked='checked'" | Same Issue for me...
```
<div class="form-group">
<label>Class</label>
<select name="sclass">
<option value="" disabled>Select Class</option>
<?php
if(mysqli_num_rows($result2)>0){
while($row2 = mysqli_fetch_assoc($result2)){
if($... |
3,928,065 | Could you give an example or a proof for a graph that has no triangles but still has chromatic number $\chi(G) \ge n$, where $n \gt 3$ is the number of vertices? This is from coloring of a graph.
The only way I can think about it is in terms of complete graph $K\_n$, but that has triangles and its chromatic number is ... | 2020/11/29 | [
"https://math.stackexchange.com/questions/3928065",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/834919/"
] | An upper bound for chromatic number is $\chi(G) \le \Delta(G)+1$ (see [Greedy coloring](https://en.wikipedia.org/wiki/Greedy_coloring)). And we know that for any simple graph $G$, we have $\Delta(G) \le n-1$ (Note that if $G$ is not simple, we can consider its condensation by removing parallel edges as they don't affec... | I assume that by $n$ you mean the number of vertices. If a graph is not complete then there is a pair of vertices with no edge between them, color them in the same color and all of the other vertices in their own unique colors to obtain an $(n-1)$-coloring. So a graph that has chromatic number $\ge n$ is complete. A co... |
55,210 | In the following example, the ∉ symbol does not look good.
```
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}
\begin{document}
This does not show: $\notin$ \\
This does not look good: $\not\in$
\end{document}
```
.
```
\documentcl... | ```
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}
\newcommand\cnot[1]{%
\mathrel{\ooalign{\hfil$#1$\hfil\cr\hfil$/$\hfil\cr}}}
\begin{document}
$a \cnot\in S$
\end{document}
```
Note: I don't know why Oberdiek's `centernot` package also fail. S... |
55,210 | In the following example, the ∉ symbol does not look good.
```
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}
\begin{document}
This does not show: $\notin$ \\
This does not look good: $\not\in$
\end{document}
```
: It centers the `/` above whatever symbol follows. |
55,210 | In the following example, the ∉ symbol does not look good.
```
\documentclass{article}
\usepackage{unicode-math}
\setmainfont{Latin Modern Roman}
\setmathfont{Latin Modern Math}
\begin{document}
This does not show: $\notin$ \\
This does not look good: $\not\in$
\end{document}
```
.
```
\documentcl... | Try `\centernot\in` (from the `centernot` package): It centers the `/` above whatever symbol follows. |
63,979,603 | The file contents should be like this:
```
foo
foobar
bar
```
foo or foobar can exist alone. But bar must be after foo and can't occur without foo. So any occurrences of bar without foo, I want to delete.
For my use case (the issue), bar was always coming before foo once and after foo once.
```
bar
...
foo
foobar
... | 2020/09/20 | [
"https://Stackoverflow.com/questions/63979603",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2381348/"
] | ```
awk '/^bar/{if (k) k=0; else next} /^foo/{k=1} 1' file
```
`k` means keep the line, it expires at first `bar` found after `foo`. | >
> is it possible with sed or some other tool to actually find the previous occurrence of foo and keep a count.
>
>
>
It is possible with `sed`, in principle, to keep a running count the number of appearances of `foo`. For example, performing an `H` command for each `foo` line would do this, though the resulting ... |
1,088,453 | I work in the maintenance team of a big project (around 7k+ classes) and my daily work is mainly to fix bugs. Sometimes, though, I have no bugs to work in. When this happens, I spent most of the time looking for performance gaps in the code. The fact that I have more than 7 thousand classes to look in means it's not ob... | 2009/07/06 | [
"https://Stackoverflow.com/questions/1088453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33857/"
] | The Java compilers are also pretty good at sniffing for performance improvements, probably better than any single human. So while there are some obvious places you can improve, there is also a good possibility of making things harder for the compiler to optimize. It's much better to profile and identify the bottlenecks... | I would first look to see if newer/faster hardware can solve your problems. As much as one may want to optimize code, it often is more economical to move the software to a faster server. I like to use the DaCapo bennchmarking tool to compare Java performance on hardware. I also keep a running list of [hardware which I'... |
1,088,453 | I work in the maintenance team of a big project (around 7k+ classes) and my daily work is mainly to fix bugs. Sometimes, though, I have no bugs to work in. When this happens, I spent most of the time looking for performance gaps in the code. The fact that I have more than 7 thousand classes to look in means it's not ob... | 2009/07/06 | [
"https://Stackoverflow.com/questions/1088453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33857/"
] | Don't change blindly things just because they "look" like feasible.
Think about this:
```
logger.debug("Initializing object state " + object.initialize() );
```
If you simply and blindly remove that statement the object won't get initialized.
Of course such statement is wrong in first place, but, believe me they... | The Java compilers are also pretty good at sniffing for performance improvements, probably better than any single human. So while there are some obvious places you can improve, there is also a good possibility of making things harder for the compiler to optimize. It's much better to profile and identify the bottlenecks... |
1,088,453 | I work in the maintenance team of a big project (around 7k+ classes) and my daily work is mainly to fix bugs. Sometimes, though, I have no bugs to work in. When this happens, I spent most of the time looking for performance gaps in the code. The fact that I have more than 7 thousand classes to look in means it's not ob... | 2009/07/06 | [
"https://Stackoverflow.com/questions/1088453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33857/"
] | Don't change blindly things just because they "look" like feasible.
Think about this:
```
logger.debug("Initializing object state " + object.initialize() );
```
If you simply and blindly remove that statement the object won't get initialized.
Of course such statement is wrong in first place, but, believe me they... | **Rules of optimization**
1. Don't do it.
2. Measure twice.
3. You shouldn't get here.
4. Don't micro optimize. Look for algorithmic complexity like the containers you use. |
1,088,453 | I work in the maintenance team of a big project (around 7k+ classes) and my daily work is mainly to fix bugs. Sometimes, though, I have no bugs to work in. When this happens, I spent most of the time looking for performance gaps in the code. The fact that I have more than 7 thousand classes to look in means it's not ob... | 2009/07/06 | [
"https://Stackoverflow.com/questions/1088453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33857/"
] | If there are performance problems, then @DarkSquid's and @AlbertoPL's advice is right on. If not, though, perhaps your time would be better spent preparing the code for future modifications. Like analyzing test coverage, particularly unit-test coverage, like assessing cyclomatic complexity or simply looking at the clas... | First, only attempt to provide performance enhancements in locations that you know are performance hogs. This can only really be determined using a profiler. There are a few nice [tools](http://java-source.net/open-source/profilers) that may help in that regard.
Second, just replacing Strings with StringBuilders does ... |
1,088,453 | I work in the maintenance team of a big project (around 7k+ classes) and my daily work is mainly to fix bugs. Sometimes, though, I have no bugs to work in. When this happens, I spent most of the time looking for performance gaps in the code. The fact that I have more than 7 thousand classes to look in means it's not ob... | 2009/07/06 | [
"https://Stackoverflow.com/questions/1088453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33857/"
] | Instead of focusing on performance, you may want to use some of the following static analysis tools to identify any bugs/potential bugs in code, and fix those. These will sometimes help identify performance issues:
* [FindBugs](http://findbugs.sourceforge.net/)
* [Crap4J](http://www.crap4j.org/)
Both of these include... | I suggest using a quality tool. My shop uses sonar. It helps you:
* find duplicate code
* find complex code zones
* find code rule violation and potential bugs
* see code coverage
* see undocumented code
<http://sonar.codehaus.org/> |
1,088,453 | I work in the maintenance team of a big project (around 7k+ classes) and my daily work is mainly to fix bugs. Sometimes, though, I have no bugs to work in. When this happens, I spent most of the time looking for performance gaps in the code. The fact that I have more than 7 thousand classes to look in means it's not ob... | 2009/07/06 | [
"https://Stackoverflow.com/questions/1088453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33857/"
] | Sounds to me like you're hunting for performance anti-patterns. That's nice and all, but unless you put them in the context of your app it's all just *feel good coding*.
>
> I shaved a straight 3 seconds of that method invocation. I don't care that it only runs once in a batch job every 12 years.
>
>
>
If you re... | First, only attempt to provide performance enhancements in locations that you know are performance hogs. This can only really be determined using a profiler. There are a few nice [tools](http://java-source.net/open-source/profilers) that may help in that regard.
Second, just replacing Strings with StringBuilders does ... |
1,088,453 | I work in the maintenance team of a big project (around 7k+ classes) and my daily work is mainly to fix bugs. Sometimes, though, I have no bugs to work in. When this happens, I spent most of the time looking for performance gaps in the code. The fact that I have more than 7 thousand classes to look in means it's not ob... | 2009/07/06 | [
"https://Stackoverflow.com/questions/1088453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33857/"
] | I suggest using a quality tool. My shop uses sonar. It helps you:
* find duplicate code
* find complex code zones
* find code rule violation and potential bugs
* see code coverage
* see undocumented code
<http://sonar.codehaus.org/> | Rather than focussing on "slow" parts of the application, you should try to focus on "bad" parts of the application.
There is an automated tool that help you find [where your code behaves like CRAP](http://www.artima.com/weblogs/viewpost.jsp?thread=215899)
CRAP is really the acronym for the tool! It does some useful ... |
1,088,453 | I work in the maintenance team of a big project (around 7k+ classes) and my daily work is mainly to fix bugs. Sometimes, though, I have no bugs to work in. When this happens, I spent most of the time looking for performance gaps in the code. The fact that I have more than 7 thousand classes to look in means it's not ob... | 2009/07/06 | [
"https://Stackoverflow.com/questions/1088453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33857/"
] | Rather than focussing on "slow" parts of the application, you should try to focus on "bad" parts of the application.
There is an automated tool that help you find [where your code behaves like CRAP](http://www.artima.com/weblogs/viewpost.jsp?thread=215899)
CRAP is really the acronym for the tool! It does some useful ... | If your code uses several critical data structures, and especially maps/sets/anything that involves a lot of lookups, you may want to make sure that you are using them optimally.
For example, if you are using Hash based collections, how good is your hash function in terms of producing a uniform distribution? This is ... |
1,088,453 | I work in the maintenance team of a big project (around 7k+ classes) and my daily work is mainly to fix bugs. Sometimes, though, I have no bugs to work in. When this happens, I spent most of the time looking for performance gaps in the code. The fact that I have more than 7 thousand classes to look in means it's not ob... | 2009/07/06 | [
"https://Stackoverflow.com/questions/1088453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33857/"
] | Don't just look around the code and change things.
As others say, don't fix performance problems until you've proven where they are.
[I use this simple method.](https://stackoverflow.com/questions/266373/one-could-use-a-profiler-but-why-not-just-halt-the-program/317160#317160)
With 7000+ classes, I would bet heavy mo... | I'd say to look for the areas where the performance of the system is slow. I'm inherently a bit suspicious of attempts to naively improve performance for no sake other than for improving performance. I'd say you'd be far better off looking for appropriate locations in the code to **refactor** (which it sounds like some... |
1,088,453 | I work in the maintenance team of a big project (around 7k+ classes) and my daily work is mainly to fix bugs. Sometimes, though, I have no bugs to work in. When this happens, I spent most of the time looking for performance gaps in the code. The fact that I have more than 7 thousand classes to look in means it's not ob... | 2009/07/06 | [
"https://Stackoverflow.com/questions/1088453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33857/"
] | **Rules of optimization**
1. Don't do it.
2. Measure twice.
3. You shouldn't get here.
4. Don't micro optimize. Look for algorithmic complexity like the containers you use. | First, only attempt to provide performance enhancements in locations that you know are performance hogs. This can only really be determined using a profiler. There are a few nice [tools](http://java-source.net/open-source/profilers) that may help in that regard.
Second, just replacing Strings with StringBuilders does ... |
74,896 | I took the plunge and installed Windows 7 on my computer. Even better, I installed it on my new Intel x25m (got to love that SSD goodness).
Windows Vista was known to thrash, throttle, and otherwise wear out an SSD. Apparently Windows 7 addresses some of the more serious issues.
However, I am more concerned that mayb... | 2009/11/24 | [
"https://superuser.com/questions/74896",
"https://superuser.com",
"https://superuser.com/users/8834/"
] | "The cool new SSD optimizations" are largely eyewash, hardly 'cool' and certainly not new. Microsoft certainly did not reinvent the wheel here.
>
> When a solid state drive is present,
> Windows 7 will disable disk
> defragmentation, Superfetch,
> ReadyBoost, as well as boot and
> application launch prefetching.
... | I think what you're looking for is a program called Intel SSD Toolbox, but it doesn't look like you can download it currently because it has some bugs. I wouldn't worry too much though. Wearing out an SSD takes a very long time (I've read that in normal use cases, a good SSD will generally outlast a normal hard drive). |
74,896 | I took the plunge and installed Windows 7 on my computer. Even better, I installed it on my new Intel x25m (got to love that SSD goodness).
Windows Vista was known to thrash, throttle, and otherwise wear out an SSD. Apparently Windows 7 addresses some of the more serious issues.
However, I am more concerned that mayb... | 2009/11/24 | [
"https://superuser.com/questions/74896",
"https://superuser.com",
"https://superuser.com/users/8834/"
] | If you open a command prompt window (as an admin) and type the following command, Windows 7 will tell you if it's detected that your drive supports the TRIM command and thus has set Windows to use the full range of SSD optimizations automatically:
```
fsutil behavior query disabledeletenotify
```
You should get some... | I think what you're looking for is a program called Intel SSD Toolbox, but it doesn't look like you can download it currently because it has some bugs. I wouldn't worry too much though. Wearing out an SSD takes a very long time (I've read that in normal use cases, a good SSD will generally outlast a normal hard drive). |
74,896 | I took the plunge and installed Windows 7 on my computer. Even better, I installed it on my new Intel x25m (got to love that SSD goodness).
Windows Vista was known to thrash, throttle, and otherwise wear out an SSD. Apparently Windows 7 addresses some of the more serious issues.
However, I am more concerned that mayb... | 2009/11/24 | [
"https://superuser.com/questions/74896",
"https://superuser.com",
"https://superuser.com/users/8834/"
] | To my knowledge, currently there's no simple method, that would cover to all possible cases.
Still, in most practical cases, it should be enough to check the following:
1. As mentioned [here](https://superuser.com/a/76210) `fsutil behavior query disabledeletenotify` should be 0, otherwise TRIM is disabled in your ... | I think what you're looking for is a program called Intel SSD Toolbox, but it doesn't look like you can download it currently because it has some bugs. I wouldn't worry too much though. Wearing out an SSD takes a very long time (I've read that in normal use cases, a good SSD will generally outlast a normal hard drive). |
74,896 | I took the plunge and installed Windows 7 on my computer. Even better, I installed it on my new Intel x25m (got to love that SSD goodness).
Windows Vista was known to thrash, throttle, and otherwise wear out an SSD. Apparently Windows 7 addresses some of the more serious issues.
However, I am more concerned that mayb... | 2009/11/24 | [
"https://superuser.com/questions/74896",
"https://superuser.com",
"https://superuser.com/users/8834/"
] | If you open a command prompt window (as an admin) and type the following command, Windows 7 will tell you if it's detected that your drive supports the TRIM command and thus has set Windows to use the full range of SSD optimizations automatically:
```
fsutil behavior query disabledeletenotify
```
You should get some... | "The cool new SSD optimizations" are largely eyewash, hardly 'cool' and certainly not new. Microsoft certainly did not reinvent the wheel here.
>
> When a solid state drive is present,
> Windows 7 will disable disk
> defragmentation, Superfetch,
> ReadyBoost, as well as boot and
> application launch prefetching.
... |
74,896 | I took the plunge and installed Windows 7 on my computer. Even better, I installed it on my new Intel x25m (got to love that SSD goodness).
Windows Vista was known to thrash, throttle, and otherwise wear out an SSD. Apparently Windows 7 addresses some of the more serious issues.
However, I am more concerned that mayb... | 2009/11/24 | [
"https://superuser.com/questions/74896",
"https://superuser.com",
"https://superuser.com/users/8834/"
] | If you open a command prompt window (as an admin) and type the following command, Windows 7 will tell you if it's detected that your drive supports the TRIM command and thus has set Windows to use the full range of SSD optimizations automatically:
```
fsutil behavior query disabledeletenotify
```
You should get some... | To my knowledge, currently there's no simple method, that would cover to all possible cases.
Still, in most practical cases, it should be enough to check the following:
1. As mentioned [here](https://superuser.com/a/76210) `fsutil behavior query disabledeletenotify` should be 0, otherwise TRIM is disabled in your ... |
1,074,331 | So I have these users in /Users

But in Preferences -> Users and Groups some users don't show up.
When I open the command line the the prompt looks like it's shown in the screen shot.
So I have two user names that show in the prompt, and I find that weird. And I jus... | 2016/05/07 | [
"https://superuser.com/questions/1074331",
"https://superuser.com",
"https://superuser.com/users/591532/"
] | The Issue has bee resolved successfully by the following:
1. In the search box on the taskbar, type Command prompt, right-click (or press and hold) Command prompt, and then select Run as administrator > Yes.
2. At the command prompt, run the following commands in the listed order, and then check to see if that fixes y... | You can check to see if any of the websites used CloudFlare DDoS protection.
Websites with the security do not let you ping the websites. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.