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 |
|---|---|---|---|---|---|
11,226,026 | I got confused with async nature of node.js. I'm writing a small project in it and my previous (sync) programming experience gets in the way.
How should I decide if/where to write async code?
For example I've got a model with fields, where each has some validation rules:
```
model = { title: text_validation,
subt... | 2012/06/27 | [
"https://Stackoverflow.com/questions/11226026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/467736/"
] | You probably shouldn't. In most cases, you need async logic only when you're waiting for something from outside your application (mostly file, database and network operations). Delaying in-application code asynchronously will give you no performance advantage, as your code will still need to run *at some point*. | I already said that in comment, but I think it is a good idea to give examples as well.
The concepts of *callback* and *asynchrounous operations* are different, although related. The `forEach` loop you are using **is not** asynchronous at all. Here's how more or less the definition of `forEach` looks:
```
Array.proto... |
39,084,824 | Here's my code:
HTML
----
```
<div class="screen screen1"></div>
<div class="screen screen2"></div>
```
CSS
---
```
.screen{
width: 100%;
height: 50%;
position: absolute;
background-color:#001;
background-image: radial-gradient(white 15%, transparent 16%),
radial-gradient(white 15%, transpa... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39084824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4768408/"
] | I assume you are unsatisfied with the "speeding up" and "slowing down" at the beginning and end of each cycle. Have a look at 'easing':
```
function move(first, second) {
first.animate({
left: '-100%',
}, 3000, 'linear', function() {
first.css('left', '100%');
move(second, first);
}... | Animating two divs to loop right to left indefinitely
Here's my code:
<https://jsfiddle.net/a1275tuv/5/>
```
$(function(){
var x = 0;
setInterval(function(){
x-=1;
$('.screen').css('background-position', x + 'px 0');
}, 10);
})
``` |
39,084,824 | Here's my code:
HTML
----
```
<div class="screen screen1"></div>
<div class="screen screen2"></div>
```
CSS
---
```
.screen{
width: 100%;
height: 50%;
position: absolute;
background-color:#001;
background-image: radial-gradient(white 15%, transparent 16%),
radial-gradient(white 15%, transpa... | 2016/08/22 | [
"https://Stackoverflow.com/questions/39084824",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4768408/"
] | You should totally drop that and try ~~jQuery~~ CSS animations:
```css
@keyframes animate {
from {
background-position: 0 0;
}
to {
background-position: -60px 0;
}
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: sans-serif;
}
html, body {
height: 100%;
min... | Animating two divs to loop right to left indefinitely
Here's my code:
<https://jsfiddle.net/a1275tuv/5/>
```
$(function(){
var x = 0;
setInterval(function(){
x-=1;
$('.screen').css('background-position', x + 'px 0');
}, 10);
})
``` |
26,034,690 | Having a string like:
```
"/some regex/gi"
```
How can I get an array with the search pattern (`"some regex"`) and flags (`"gi"`)?
I tried to use `match` function:
```
> "/some regex/gi".match("/(.*)/([a-z]+)")
[ '/some regex/gi',
'some regex',
'gi',
index: 0,
input: '/some regex/gi' ]
```
However, this... | 2014/09/25 | [
"https://Stackoverflow.com/questions/26034690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1420197/"
] | This will work even if there're `\/` inside the regex: `/(\/?)(.+)\1([a-z]*)/i`
With delimiters and flags:
```
var matches = "/some regex/gi".match(/(\/?)(.+)\1([a-z]*)/i);
```
**output:**
```
["/some regex/gi", "/", "some regex", "gi"]
```
Without delimiters:
```
var matches = "without flags".match(/(\/?)(.+)\... | Remove quotes from your regex and use regex delimiters `/.../`:
```
var obj = {
"/without flags/": new RegExp("without flags"),
"/something/gi": new RegExp("something", "gi"),
"/with\/slashes\//gi": new RegExp("with\/slashes\/", "gi"),
"/with \/some\/(.*)regex/gi": new RegExp("with \/some\/(.*)regex", ... |
26,034,690 | Having a string like:
```
"/some regex/gi"
```
How can I get an array with the search pattern (`"some regex"`) and flags (`"gi"`)?
I tried to use `match` function:
```
> "/some regex/gi".match("/(.*)/([a-z]+)")
[ '/some regex/gi',
'some regex',
'gi',
index: 0,
input: '/some regex/gi' ]
```
However, this... | 2014/09/25 | [
"https://Stackoverflow.com/questions/26034690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1420197/"
] | Remove quotes from your regex and use regex delimiters `/.../`:
```
var obj = {
"/without flags/": new RegExp("without flags"),
"/something/gi": new RegExp("something", "gi"),
"/with\/slashes\//gi": new RegExp("with\/slashes\/", "gi"),
"/with \/some\/(.*)regex/gi": new RegExp("with \/some\/(.*)regex", ... | Why not just
```
/\/(.*)\/(.*)|(.*)/
```
In English
```
Look for either
a slash, followed by
a (greedy) sequence of characters,
a closing slash,
and an optional sequence of flags
or
any sequence of characters
```
See <http://regex101.com/r/aY1oS8/2>. |
26,034,690 | Having a string like:
```
"/some regex/gi"
```
How can I get an array with the search pattern (`"some regex"`) and flags (`"gi"`)?
I tried to use `match` function:
```
> "/some regex/gi".match("/(.*)/([a-z]+)")
[ '/some regex/gi',
'some regex',
'gi',
index: 0,
input: '/some regex/gi' ]
```
However, this... | 2014/09/25 | [
"https://Stackoverflow.com/questions/26034690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1420197/"
] | This will work even if there're `\/` inside the regex: `/(\/?)(.+)\1([a-z]*)/i`
With delimiters and flags:
```
var matches = "/some regex/gi".match(/(\/?)(.+)\1([a-z]*)/i);
```
**output:**
```
["/some regex/gi", "/", "some regex", "gi"]
```
Without delimiters:
```
var matches = "without flags".match(/(\/?)(.+)\... | Why not just
```
/\/(.*)\/(.*)|(.*)/
```
In English
```
Look for either
a slash, followed by
a (greedy) sequence of characters,
a closing slash,
and an optional sequence of flags
or
any sequence of characters
```
See <http://regex101.com/r/aY1oS8/2>. |
26,034,690 | Having a string like:
```
"/some regex/gi"
```
How can I get an array with the search pattern (`"some regex"`) and flags (`"gi"`)?
I tried to use `match` function:
```
> "/some regex/gi".match("/(.*)/([a-z]+)")
[ '/some regex/gi',
'some regex',
'gi',
index: 0,
input: '/some regex/gi' ]
```
However, this... | 2014/09/25 | [
"https://Stackoverflow.com/questions/26034690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1420197/"
] | This will work even if there're `\/` inside the regex: `/(\/?)(.+)\1([a-z]*)/i`
With delimiters and flags:
```
var matches = "/some regex/gi".match(/(\/?)(.+)\1([a-z]*)/i);
```
**output:**
```
["/some regex/gi", "/", "some regex", "gi"]
```
Without delimiters:
```
var matches = "without flags".match(/(\/?)(.+)\... | Use **backtracking**. See this regex:
```
/^(?:\/(.*)\/([a-z]*)|(.*))$/
```
Here is an [online code demo](https://eval.in/private/ca83867b165da2). Works now. |
26,034,690 | Having a string like:
```
"/some regex/gi"
```
How can I get an array with the search pattern (`"some regex"`) and flags (`"gi"`)?
I tried to use `match` function:
```
> "/some regex/gi".match("/(.*)/([a-z]+)")
[ '/some regex/gi',
'some regex',
'gi',
index: 0,
input: '/some regex/gi' ]
```
However, this... | 2014/09/25 | [
"https://Stackoverflow.com/questions/26034690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1420197/"
] | Use **backtracking**. See this regex:
```
/^(?:\/(.*)\/([a-z]*)|(.*))$/
```
Here is an [online code demo](https://eval.in/private/ca83867b165da2). Works now. | Why not just
```
/\/(.*)\/(.*)|(.*)/
```
In English
```
Look for either
a slash, followed by
a (greedy) sequence of characters,
a closing slash,
and an optional sequence of flags
or
any sequence of characters
```
See <http://regex101.com/r/aY1oS8/2>. |
7,275 | I found this plot on Wikipedia:

>
> [Domain coloring](http://en.wikipedia.org/wiki/Domain_coloring) of $\sin(z)$ over $(-\pi,\pi)$ on $x$ and $y$ axes. Brightness indicates absolute magnitude, saturation represents imaginary and real magnit... | 2012/06/23 | [
"https://mathematica.stackexchange.com/questions/7275",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/121/"
] | Building on Heike's `ColorFunction`, I came up with this:
[](https://i.stack.imgur.com/ZU9kk.png)
The white bits are the trickiest - you need to make sure the brightness is high where the saturation is low, otherwise the black lines appear on top of ... | This is a good way :
```
DensityPlot[ Rescale[ Arg[Sin[-x - I y]], {-Pi, Pi}], {x, -Pi, Pi}, {y, -Pi, Pi},
MeshFunctions -> Function @@@ {{{x, y, z}, Re[Sin[x + I y]]},
{{x, y, z}, Im[Sin[x + I y]]},
{{x, y, z}, Abs[... |
7,275 | I found this plot on Wikipedia:

>
> [Domain coloring](http://en.wikipedia.org/wiki/Domain_coloring) of $\sin(z)$ over $(-\pi,\pi)$ on $x$ and $y$ axes. Brightness indicates absolute magnitude, saturation represents imaginary and real magnit... | 2012/06/23 | [
"https://mathematica.stackexchange.com/questions/7275",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/121/"
] | This is a good way :
```
DensityPlot[ Rescale[ Arg[Sin[-x - I y]], {-Pi, Pi}], {x, -Pi, Pi}, {y, -Pi, Pi},
MeshFunctions -> Function @@@ {{{x, y, z}, Re[Sin[x + I y]]},
{{x, y, z}, Im[Sin[x + I y]]},
{{x, y, z}, Abs[... | With Mathematica 12.0, there's now a [`ComplexPlot`](https://reference.wolfram.com/language/ref/ComplexPlot.html) function that replaces user made solutions. As with other `Plot` functions, it allows us to specify a [`ColorFunction`](https://reference.wolfram.com/language/ref/ColorFunction.html) option to manipulate ho... |
7,275 | I found this plot on Wikipedia:

>
> [Domain coloring](http://en.wikipedia.org/wiki/Domain_coloring) of $\sin(z)$ over $(-\pi,\pi)$ on $x$ and $y$ axes. Brightness indicates absolute magnitude, saturation represents imaginary and real magnit... | 2012/06/23 | [
"https://mathematica.stackexchange.com/questions/7275",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/121/"
] | Building on Heike's `ColorFunction`, I came up with this:
[](https://i.stack.imgur.com/ZU9kk.png)
The white bits are the trickiest - you need to make sure the brightness is high where the saturation is low, otherwise the black lines appear on top of ... | Not as pretty as the one in the original post, but it's getting in the right direction I think:
```
RegionPlot[True,
{x, -Pi, Pi}, {y, -Pi, Pi},
ColorFunction -> (Hue[Rescale[Arg[Sin[#1 + I #2]], {-Pi, Pi}],
Sin[2 Pi Abs[Sin[#1 + I #2]]]^2,
Abs@(Sin[Pi Re[Sin[#1 + I #2]]] Sin[Pi Im[Sin[#1 + I #2]]])^(1/
... |
7,275 | I found this plot on Wikipedia:

>
> [Domain coloring](http://en.wikipedia.org/wiki/Domain_coloring) of $\sin(z)$ over $(-\pi,\pi)$ on $x$ and $y$ axes. Brightness indicates absolute magnitude, saturation represents imaginary and real magnit... | 2012/06/23 | [
"https://mathematica.stackexchange.com/questions/7275",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/121/"
] | Not as pretty as the one in the original post, but it's getting in the right direction I think:
```
RegionPlot[True,
{x, -Pi, Pi}, {y, -Pi, Pi},
ColorFunction -> (Hue[Rescale[Arg[Sin[#1 + I #2]], {-Pi, Pi}],
Sin[2 Pi Abs[Sin[#1 + I #2]]]^2,
Abs@(Sin[Pi Re[Sin[#1 + I #2]]] Sin[Pi Im[Sin[#1 + I #2]]])^(1/
... | With Mathematica 12.0, there's now a [`ComplexPlot`](https://reference.wolfram.com/language/ref/ComplexPlot.html) function that replaces user made solutions. As with other `Plot` functions, it allows us to specify a [`ColorFunction`](https://reference.wolfram.com/language/ref/ColorFunction.html) option to manipulate ho... |
7,275 | I found this plot on Wikipedia:

>
> [Domain coloring](http://en.wikipedia.org/wiki/Domain_coloring) of $\sin(z)$ over $(-\pi,\pi)$ on $x$ and $y$ axes. Brightness indicates absolute magnitude, saturation represents imaginary and real magnit... | 2012/06/23 | [
"https://mathematica.stackexchange.com/questions/7275",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/121/"
] | Building on Heike's `ColorFunction`, I came up with this:
[](https://i.stack.imgur.com/ZU9kk.png)
The white bits are the trickiest - you need to make sure the brightness is high where the saturation is low, otherwise the black lines appear on top of ... | I already mentioned Bernd Thaller's package `Graphics`ComplexPlot`` in the comments; if one blends the ideas from Artes's and Heike's answers, and then use the function `$ComplexToColorMap[]` from Thaller's package (I won't include it here; again, see the package for that), we get this:

>
> [Domain coloring](http://en.wikipedia.org/wiki/Domain_coloring) of $\sin(z)$ over $(-\pi,\pi)$ on $x$ and $y$ axes. Brightness indicates absolute magnitude, saturation represents imaginary and real magnit... | 2012/06/23 | [
"https://mathematica.stackexchange.com/questions/7275",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/121/"
] | I already mentioned Bernd Thaller's package `Graphics`ComplexPlot`` in the comments; if one blends the ideas from Artes's and Heike's answers, and then use the function `$ComplexToColorMap[]` from Thaller's package (I won't include it here; again, see the package for that), we get this:
 function that replaces user made solutions. As with other `Plot` functions, it allows us to specify a [`ColorFunction`](https://reference.wolfram.com/language/ref/ColorFunction.html) option to manipulate ho... |
7,275 | I found this plot on Wikipedia:

>
> [Domain coloring](http://en.wikipedia.org/wiki/Domain_coloring) of $\sin(z)$ over $(-\pi,\pi)$ on $x$ and $y$ axes. Brightness indicates absolute magnitude, saturation represents imaginary and real magnit... | 2012/06/23 | [
"https://mathematica.stackexchange.com/questions/7275",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/121/"
] | Building on Heike's `ColorFunction`, I came up with this:
[](https://i.stack.imgur.com/ZU9kk.png)
The white bits are the trickiest - you need to make sure the brightness is high where the saturation is low, otherwise the black lines appear on top of ... | With Mathematica 12.0, there's now a [`ComplexPlot`](https://reference.wolfram.com/language/ref/ComplexPlot.html) function that replaces user made solutions. As with other `Plot` functions, it allows us to specify a [`ColorFunction`](https://reference.wolfram.com/language/ref/ColorFunction.html) option to manipulate ho... |
55,329,028 | To build context, my app has a stack of cards (similar to Tinder) that flip and each could contain a lot of text on one side that require a UITextView for scrolling. It's basically a flashcard app, so once the user is done looking at the card, they swipe it away to view the next one.
I'm trying to make it so the user ... | 2019/03/24 | [
"https://Stackoverflow.com/questions/55329028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11116880/"
] | Maybe you can add a `UITapGestureRecognizer` to the text view itself. Something like:
```
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(ViewController.didTap(_:)))
textView.addGestureRecognizer(tapGesture)
@objc func didTap(_ gesture: UITapGestureRecognizer) {
// Handle the tap
}
``` | did you try a tableView or a collectionView, you can customize your cell to look like a card then when a user clicks the cell it will flip or present a popup view, thats easier. |
55,329,028 | To build context, my app has a stack of cards (similar to Tinder) that flip and each could contain a lot of text on one side that require a UITextView for scrolling. It's basically a flashcard app, so once the user is done looking at the card, they swipe it away to view the next one.
I'm trying to make it so the user ... | 2019/03/24 | [
"https://Stackoverflow.com/questions/55329028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11116880/"
] | You can create a `UITapGestureRecognizer`, like so:
```
let gesture = UITapGestureRecognizer(target: self, action: #selector(tap(gesture:)))
addGestureRecognizer(gesture)
```
And the function to trigger:
```
@objc func tap(gesture: UITapGestureRecognizer) {
print("Tap!")
}
``` | did you try a tableView or a collectionView, you can customize your cell to look like a card then when a user clicks the cell it will flip or present a popup view, thats easier. |
55,329,028 | To build context, my app has a stack of cards (similar to Tinder) that flip and each could contain a lot of text on one side that require a UITextView for scrolling. It's basically a flashcard app, so once the user is done looking at the card, they swipe it away to view the next one.
I'm trying to make it so the user ... | 2019/03/24 | [
"https://Stackoverflow.com/questions/55329028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11116880/"
] | You can create a `UITapGestureRecognizer`, like so:
```
let gesture = UITapGestureRecognizer(target: self, action: #selector(tap(gesture:)))
addGestureRecognizer(gesture)
```
And the function to trigger:
```
@objc func tap(gesture: UITapGestureRecognizer) {
print("Tap!")
}
``` | Maybe you can add a `UITapGestureRecognizer` to the text view itself. Something like:
```
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(ViewController.didTap(_:)))
textView.addGestureRecognizer(tapGesture)
@objc func didTap(_ gesture: UITapGestureRecognizer) {
// Handle the tap
}
``` |
41,721 | I wrote a module that adds a mass action for creating invoices and shipments from the invoice. This gets done by calling the URL ./sales\_order/finishorder (calls the finish\_order function.
After finishing creating the invoices and shipments I wanted to redirect to pdfinvoices to directly print the PDFs for the order... | 2014/10/28 | [
"https://magento.stackexchange.com/questions/41721",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/12910/"
] | The first line in `pdfinvoices` is:
```
$orderIds = $this->getRequest()->getPost('order_ids');
```
Thus it is expecting an array list of order ids to work on.
Make sure your mass action variable is called `order_ids`. If you then forward to the `pdfinvoice` action, it will use the same order ids you just worked on.... | As I see both methods are in the same controller, so you can do it like this in the end of `finishorder` method:
```
// set post
$this->getRequest()->setPost('order_ids',$orderIds);
$this->_forward('pdfinvoices');
``` |
168,451 | >
> I found four injured men alive.
>
>
>
In this sentence, the adjective "alive" comes after the noun "men".
Why we have to use adjective "alive" after the noun, not before? because in adjective order, adjectives should come before the nouns. | 2018/06/04 | [
"https://ell.stackexchange.com/questions/168451",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/76335/"
] | I think the structure is
Subject +verb+object+ adjective as objective complement.
>
> **I found four injured men alive**
>
>
>
it is similar to the structure
**He painted the house green**
**The Jury found him guilty** | It's a stylized use of "find". You can "find [something] *to be* [some adjective]". The "to be" is optional.
>
> I **found** her (to be) **perfectly charming**
>
>
> I **found** the dinner (to be) **almost inedible**.
>
>
> I **found** the movie (to be) **exciting but implausible**.
>
>
>
In a similar way, in... |
121,175 | Say we are able to mass produce clones for our clone army and give them memories. Then we decide to give them the same template/personality/identity/etc.
What psychological effects would this have on the clones?
EDIT : They know they're clones. | 2018/08/12 | [
"https://worldbuilding.stackexchange.com/questions/121175",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/54091/"
] | **How do you interact with other members of H. sapiens?**
What you describe is a clone that is mostly alike. They get to have different memories from the moment they are born.
From a genetic perspective, something like 99.4% of our genome is cloned. How do you treat your almost-clones?
Really, the more important psy... | When identical twins interact with each other, they're effectively dealing with clones -- they have the same genetics and even the same birthdate. Of course these twins **also** interact with others, but the same principles would apply:
* Individuals who know each other would notice small differences, not large simila... |
60,753,718 | We are going to handle another team's work and move to use Azure DevOps Service instead of SVN.
They put everything in a single Git Repo. That made the Repo quiet large. Have no idea how large it is.
Per my understanding, Microsoft hold data in their own Azure SQL Database. If so, do we have any limited size of Git R... | 2020/03/19 | [
"https://Stackoverflow.com/questions/60753718",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12911012/"
] | I found an answer:
```
pacman -S git
```
Now I can use git in my mysy terminal. | If you downloaded "Git for Windows" then that installs MSYS2 but it's different to the MSYS you installed. They would not know about each other. You can merge the to as this guy writes (number 3):
<https://www.automationdojos.com/install-pacman-on-git-for-win-without-full-setup/>
If you start fresh, the I would get MS... |
36,700,643 | I'm having trouble getting a `glyphicon-search` button to line up in bootstrap.
This is not a unique problem, I found [this question](https://stackoverflow.com/questions/10615872/bootstrap-align-input-with-button) that asks a similar thing, except the accepted and celebrated answer isn't working for me. Just like the ... | 2016/04/18 | [
"https://Stackoverflow.com/questions/36700643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4945793/"
] | <http://jsfiddle.net/kv8n7n5g/>
```
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-default" type="button"><i class="glyphicon glyphicon-search"></i></button>
</span>
<input type="text" class="form-control" placeholder="Search">
</div>
```
You had the glyphicon cla... | That's interesting. I've never tried using a button with an input group like that, and I'm not sure why that behavior is occuring. Seems to be an easy fix though.
I added `top:0` to the existing rule `.input-group-btn>.btn` which already had `position: relative;` ...
<http://jsfiddle.net/pk84s94t/1/>
**EDIT**
Wh... |
36,700,643 | I'm having trouble getting a `glyphicon-search` button to line up in bootstrap.
This is not a unique problem, I found [this question](https://stackoverflow.com/questions/10615872/bootstrap-align-input-with-button) that asks a similar thing, except the accepted and celebrated answer isn't working for me. Just like the ... | 2016/04/18 | [
"https://Stackoverflow.com/questions/36700643",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4945793/"
] | <http://jsfiddle.net/kv8n7n5g/>
```
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-default" type="button"><i class="glyphicon glyphicon-search"></i></button>
</span>
<input type="text" class="form-control" placeholder="Search">
</div>
```
You had the glyphicon cla... | The problem you are having is due to the glyphicon button default size in bootstrap. But if you put some text in the button it aligns perfectly as now the button for the text is given more priority than the glyphicon's default. For the text I used  . It works fine now.
```
<div class="input-group">
<input clas... |
46,854,159 | :)
Is there an easy way to group a particular data set into a reduced data frame from certain characteristics? I was thinking of an algorithm for this, but is there any function in R that can be used for this? I've trying to use `dplyr`, but it didin't work very well...
E.g.:
[. When you do `querydict['key'] = value`, it sets the key to `[value]`, not `value`.
You can use the [`QueryDict.setlist`](https://docs.djangoproject.com/en/1.11/ref... | If I've understood the constraints correctly, you should use [builtin array type](https://docs.python.org/2/library/array.html).
```
>>> q = U"2,4,6,7"
>>> import array
>>> ary = array.array('u', q)
>>> [i for i in ary if i.isdigit()]
[u'2', u'4', u'6', u'7']
``` |
8,496,351 | I have jQuery UI's demo form like below. How do i submit data via ajax to a page called add.html.php?
style
```
<style>
body { font-size: 62.5%; }
label, input { display:block; }
input.text { margin-bottom:12px; width:95%; padding: .4em; }
fieldset { padding:0; border:0; margin-top:25px; }
h1 { f... | 2011/12/13 | [
"https://Stackoverflow.com/questions/8496351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867592/"
] | In your `form`, add an input type of submit:
```
<input type='submit' value='submit' />
```
Alternatively, you can also just create a function that submits the form:
```
function fncSubmit() {
$('form').trigger('submit');
}
```
Add this in the `ready` block:
```
$('form').submit(function() {
$.ajax(
... | First, you'll need to give the form an ID and give it a way to submit. (a button in this example)
```
<form name="loginForm" id="loginForm">
//Inputs
<button type="button" id="submitButton">Submit</button>
</form>
```
Then, you'll want to throw a click event on on the button to submit the form to the ajax call.
... |
25,708,631 | I have two class, main class is app.php in root directory, and db.php in \system
How To Get property $config in class base, with namespace pattern??
I want to get $config in class base, this is what I want
I define config for hostname,user,pass
then I declare base class wit new \App\base
I can get config in class db
... | 2014/09/07 | [
"https://Stackoverflow.com/questions/25708631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286189/"
] | AFAIK all current implementations of websockets depend on a handshake via HTTP. After the handshake the existing connection is upgraded. You don't get a new one and the port stays the same. Basically all websocket connections start as HTTP connections.
As a side note the ports, IP addresses etc. are subject of the ser... | Spring WebSocket different port for ws:// protocol
--------------------------------------------------
Due to limitation and in order to use websockets on App Engine Flexible Environment, app need to connect directly to application instance using the instance's public external IP. This IP can be obtained from the metad... |
7,572 | I would like to simulate the trajectory of a weather balloon in an altitude of 12 to 20 km.
For this I would like to know how the velocity-field (i.e. wind-speed and direction as a function of position and time) looks like and how constant it is in the time and space domain.
Is there some publicly available data about... | 2016/02/24 | [
"https://earthscience.stackexchange.com/questions/7572",
"https://earthscience.stackexchange.com",
"https://earthscience.stackexchange.com/users/5526/"
] | [This presentation](http://www.goes-r.gov/downloads/AMS/AMS2015/January%208/Joint%20Session%2019/Cubesat%20FTS%20for%203D%20Winds%20AMS%20J19.4.pdf) mentions "Atmospheric Motion Vectors (AMVs)", and specifically mentions a number of AMVs, which separately cover the globe (GOES AMVs ±60N, plus polar AMVs from MODIS/AVHR... | I have also found these maps: <http://earth.nullschool.net/>
It is a nice visualization of winds at different elevations (from surface up to 10hPa). |
24,936,123 | I found that I cannot update my device to the ADB connectable driver, what's wrong with that???
When I updated my device to the adb connectable driver (..sdk\extras\google\usb\_driver),
and then press 'Next, it shows
'Window has determined the driver software for your device is up to date.
WPD Composite Device'
I h... | 2014/07/24 | [
"https://Stackoverflow.com/questions/24936123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3873277/"
] | I had same problem with my xperia u, and I use [this](http://androidxda.com/download-sony-xperia-usb-driver) page to download driver. After intalling driver, adb works with device like a charm. | Try executing `adb kill-server`, `adb start-server` and replug the device.
Also, find the `adb_usb.ini` file (usually in your home folder) and add a line with `054c` (Extracted from the [official documentation](https://developer.android.com/tools/device.html)). |
20,192,531 | What is the **difference** between a Windows **service** and a Windows **process**? | 2013/11/25 | [
"https://Stackoverflow.com/questions/20192531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192982/"
] | A service is a true-blooded Windows process, no difference there. The only thing that's special about a service is that it is started by the operating system and runs in a separate session. An isolated one that keeps it from interfering with the desktop session. Traditionally named a [*daemon*](http://en.wikipedia.org/... | A service is a process **without** user interface. You can call service as a subset of process. |
20,192,531 | What is the **difference** between a Windows **service** and a Windows **process**? | 2013/11/25 | [
"https://Stackoverflow.com/questions/20192531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192982/"
] | A service is a true-blooded Windows process, no difference there. The only thing that's special about a service is that it is started by the operating system and runs in a separate session. An isolated one that keeps it from interfering with the desktop session. Traditionally named a [*daemon*](http://en.wikipedia.org/... | Windows services are essentially long-running executable applications that run in their own windows sessions and do not possess any user interface. These can be automatically started when the computer boots up and can be paused and restarted. |
20,192,531 | What is the **difference** between a Windows **service** and a Windows **process**? | 2013/11/25 | [
"https://Stackoverflow.com/questions/20192531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/192982/"
] | A service is a process **without** user interface. You can call service as a subset of process. | Windows services are essentially long-running executable applications that run in their own windows sessions and do not possess any user interface. These can be automatically started when the computer boots up and can be paused and restarted. |
40,570,285 | Some of the file I'm working with: <http://pastebin.com/WriQcuPs>
Currently I had to make the population, latitude, and longitude strings or else I wouldn't get the desired output. I want for them to be int, double, and double in that order.
```
public class City {
String countrycode;
String city;
String... | 2016/11/13 | [
"https://Stackoverflow.com/questions/40570285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7151725/"
] | If you declare the list as follows, you can put instances of any reference type into it:
```
List<Object> list = new ArrayList<>();
```
But the downside is that when you get an element from the list, the static type of the element will be `Object`, and you will need to type cast it to the type that you need.
Al... | You could parse the string values before they are passed into a new `City` object. Then you could change the constructor and variables within a `City` to be an int, double, and double.
```
int pop = Integer.parseInt(cityList.get(3));
double latitude = Double.parseDouble(cityList.get(4));
double longitude = Double.pars... |
40,570,285 | Some of the file I'm working with: <http://pastebin.com/WriQcuPs>
Currently I had to make the population, latitude, and longitude strings or else I wouldn't get the desired output. I want for them to be int, double, and double in that order.
```
public class City {
String countrycode;
String city;
String... | 2016/11/13 | [
"https://Stackoverflow.com/questions/40570285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7151725/"
] | If you declare the list as follows, you can put instances of any reference type into it:
```
List<Object> list = new ArrayList<>();
```
But the downside is that when you get an element from the list, the static type of the element will be `Object`, and you will need to type cast it to the type that you need.
Al... | By looking at the `City` class you have defined the members are of different primitive data types. When you read the file to create a City, you need to pass the constructor parameters with the defined data types as in your constructor.
Modify your `City` class as below :
```
public class City {
String countryco... |
40,570,285 | Some of the file I'm working with: <http://pastebin.com/WriQcuPs>
Currently I had to make the population, latitude, and longitude strings or else I wouldn't get the desired output. I want for them to be int, double, and double in that order.
```
public class City {
String countrycode;
String city;
String... | 2016/11/13 | [
"https://Stackoverflow.com/questions/40570285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7151725/"
] | If you declare the list as follows, you can put instances of any reference type into it:
```
List<Object> list = new ArrayList<>();
```
But the downside is that when you get an element from the list, the static type of the element will be `Object`, and you will need to type cast it to the type that you need.
Al... | I believe no, but you can do this
```
public class City {
String countrycode;
String city;
String region;
String population;
double latitude;
double longitude;
public City (String countrycode, String city, String region, String population, double latitude, double longitude) {
this.countrycode = countrycode;
t... |
40,570,285 | Some of the file I'm working with: <http://pastebin.com/WriQcuPs>
Currently I had to make the population, latitude, and longitude strings or else I wouldn't get the desired output. I want for them to be int, double, and double in that order.
```
public class City {
String countrycode;
String city;
String... | 2016/11/13 | [
"https://Stackoverflow.com/questions/40570285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7151725/"
] | If you declare the list as follows, you can put instances of any reference type into it:
```
List<Object> list = new ArrayList<>();
```
But the downside is that when you get an element from the list, the static type of the element will be `Object`, and you will need to type cast it to the type that you need.
Al... | You can do something like this:
**READER CLASS**
```
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
public class Reader {
In input = new In("file:world_cities.txt");
private static City cityInfo;
public static void main(String[] args) {
... |
40,570,285 | Some of the file I'm working with: <http://pastebin.com/WriQcuPs>
Currently I had to make the population, latitude, and longitude strings or else I wouldn't get the desired output. I want for them to be int, double, and double in that order.
```
public class City {
String countrycode;
String city;
String... | 2016/11/13 | [
"https://Stackoverflow.com/questions/40570285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7151725/"
] | If you declare the list as follows, you can put instances of any reference type into it:
```
List<Object> list = new ArrayList<>();
```
But the downside is that when you get an element from the list, the static type of the element will be `Object`, and you will need to type cast it to the type that you need.
Al... | >
> Is there a way to make it so that some of the elements of the list are
> of a different type?
>
>
>
It is possible to have a `List` with elements of different type, but not if you're populating it with `String.split()` -- because that returns a `String[]`.
You can convert the strings you get back fro `String... |
40,570,285 | Some of the file I'm working with: <http://pastebin.com/WriQcuPs>
Currently I had to make the population, latitude, and longitude strings or else I wouldn't get the desired output. I want for them to be int, double, and double in that order.
```
public class City {
String countrycode;
String city;
String... | 2016/11/13 | [
"https://Stackoverflow.com/questions/40570285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7151725/"
] | If you declare the list as follows, you can put instances of any reference type into it:
```
List<Object> list = new ArrayList<>();
```
But the downside is that when you get an element from the list, the static type of the element will be `Object`, and you will need to type cast it to the type that you need.
Al... | Like Stephen suggested, you can use `List<Object>`, besides that, you can just pass String to City but let City itself to handle the datatype.
```
public class City {
String countrycode;
String city;
String region;
int population;
double latitude;
double longitude;
public City (String coun... |
3,225,027 | $ \sin 30° \sin x \sin 10° = \sin 20° \sin ({80°-x}) \sin 40° $
I tried transformation formulas , $ 2\sin a \sin b $ one. I know the value of sin 30° but what about others?
Original problem
In triangle ABC, P is an interior point such that $ \angle PAB = 10°. \angle PBA = 20° PAC = 40° \angle PCA = 30° $ then what k... | 2019/05/13 | [
"https://math.stackexchange.com/questions/3225027",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/665572/"
] | Assume AB = 1.
[](https://i.stack.imgur.com/za8tk.png)
Apply sine law to PAB to get $PB = 2 \sin 10^0$.
Apply sine law to PAC to get $PB = 2 \sin 20^0$ and $PC = 4 \sin 20^0 \sin 40^0$.
Apply cosine law to PBC to get $BC$ in terms of those angles.... | Like [Solve $\frac{\sin(xº)\sin(80º)}{\sin(170º - xº) \sin(70º)} = \frac {\sin(60º)}{\sin (100º)}$](https://math.stackexchange.com/questions/3252593/solve-frac-sinx%C2%BA-sin80%C2%BA-sin170%C2%BA-x%C2%BA-sin70%C2%BA-frac-sin60%C2%BA/3252622#3252622)
$$\dfrac{\sin(80-x)}{\sin x}=\dfrac{\sin30\sin10}{\sin20\sin40}$$
$$... |
32,995,675 | I would like to know the behavior of a C program calling free on a pointer to an extern variable. The background is that I'm a developer of a verifier analyzing C code and I wonder what my verifier should do if it encounters such a situation (e.g., say why the program is undefined - if it is).
To find out the behavior... | 2015/10/07 | [
"https://Stackoverflow.com/questions/32995675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5418937/"
] | The C standard is unambigous about this. Quoting document [N1570](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf), the closest approximation to C11 available online at no charge, section 7.22.3.3 para 2 (the specification of `free`):
>
> The `free` function causes the space pointed to by `ptr`
> to be dea... | You should only call `free` on a pointer which was previously allocated by `malloc` or `calloc` or `realloc` or `aligned_alloc`. Otherwise it doesn't matter if it is "extern'd" or not.
---
**UPDATE #1**
It does not always run without errors, also check what the output of `valgrind` is:
```none
==21569== Invalid fre... |
32,995,675 | I would like to know the behavior of a C program calling free on a pointer to an extern variable. The background is that I'm a developer of a verifier analyzing C code and I wonder what my verifier should do if it encounters such a situation (e.g., say why the program is undefined - if it is).
To find out the behavior... | 2015/10/07 | [
"https://Stackoverflow.com/questions/32995675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5418937/"
] | The C standard is unambigous about this. Quoting document [N1570](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf), the closest approximation to C11 available online at no charge, section 7.22.3.3 para 2 (the specification of `free`):
>
> The `free` function causes the space pointed to by `ptr`
> to be dea... | When you call free on a pointer that was not previously allocated by malloc, calloc or realloc, the behavior is undefined. That means it can have different behavior in different tool chains, and also different behavior at different times in the same program.
Whether it generates a crash with an error message depends o... |
32,995,675 | I would like to know the behavior of a C program calling free on a pointer to an extern variable. The background is that I'm a developer of a verifier analyzing C code and I wonder what my verifier should do if it encounters such a situation (e.g., say why the program is undefined - if it is).
To find out the behavior... | 2015/10/07 | [
"https://Stackoverflow.com/questions/32995675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5418937/"
] | The C standard is unambigous about this. Quoting document [N1570](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf), the closest approximation to C11 available online at no charge, section 7.22.3.3 para 2 (the specification of `free`):
>
> The `free` function causes the space pointed to by `ptr`
> to be dea... | [Chapter and verse](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf)
>
> **7.22.3.3 The `free` function**
>
> ...
>
> 2 The `free` function causes the space pointed to by `ptr` to be deallocated, that is, made
> available for further allocation. If `ptr` is a null pointer, no action occurs. Otherwise,... |
27,424,831 | After last firefox-update some of css3-code has been broken... [Example](http://jsfiddle.net/944tL115/4/) (jsfiddle).
* In chromium:

* In firefox 34:

Is it bug? Or normal working? What do i need to change to ... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27424831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892741/"
] | What you could do is, subtract `80px` from `100%` and set that a `width` for `input`. Additionally, add `box-sizing: border-box` to prevent overflow.
```css
form {
display: flex;
}
#flex {
display: flex;
border: 1px solid green;
outline: 1px solid red;
}
label {
display: flex;
flex: 0 0 80px;
}
... | `Display: flex;` **only** needs to be on the container that needs to be flexible, not the inner elements. Here's the updated CSS, if you need a specific width, you can set that on `form {}`.
CSS
```
form {}
#flex {
display: flex;
border: 1px solid green;
outline: 1px solid red;
}
#flex > * {
flex: 1... |
27,424,831 | After last firefox-update some of css3-code has been broken... [Example](http://jsfiddle.net/944tL115/4/) (jsfiddle).
* In chromium:

* In firefox 34:

Is it bug? Or normal working? What do i need to change to ... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27424831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892741/"
] | There is a bug in Firefox 34. One of the elements is not playing nicely as a flex child, and the input seems to be too wide. This extra width is not taken into account by the flex containers green border.
---
This can be confirmed as a bug because in Firefox 33.1 (and Chrome / IE) there is no problem with your exampl... | What you could do is, subtract `80px` from `100%` and set that a `width` for `input`. Additionally, add `box-sizing: border-box` to prevent overflow.
```css
form {
display: flex;
}
#flex {
display: flex;
border: 1px solid green;
outline: 1px solid red;
}
label {
display: flex;
flex: 0 0 80px;
}
... |
27,424,831 | After last firefox-update some of css3-code has been broken... [Example](http://jsfiddle.net/944tL115/4/) (jsfiddle).
* In chromium:

* In firefox 34:

Is it bug? Or normal working? What do i need to change to ... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27424831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892741/"
] | Fix:
```
input { min-width: 1px; }
```
For vertical direction - `min-height`; | What you could do is, subtract `80px` from `100%` and set that a `width` for `input`. Additionally, add `box-sizing: border-box` to prevent overflow.
```css
form {
display: flex;
}
#flex {
display: flex;
border: 1px solid green;
outline: 1px solid red;
}
label {
display: flex;
flex: 0 0 80px;
}
... |
27,424,831 | After last firefox-update some of css3-code has been broken... [Example](http://jsfiddle.net/944tL115/4/) (jsfiddle).
* In chromium:

* In firefox 34:

Is it bug? Or normal working? What do i need to change to ... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27424831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892741/"
] | variant with
```
min-width: 0
```
also works | What you could do is, subtract `80px` from `100%` and set that a `width` for `input`. Additionally, add `box-sizing: border-box` to prevent overflow.
```css
form {
display: flex;
}
#flex {
display: flex;
border: 1px solid green;
outline: 1px solid red;
}
label {
display: flex;
flex: 0 0 80px;
}
... |
27,424,831 | After last firefox-update some of css3-code has been broken... [Example](http://jsfiddle.net/944tL115/4/) (jsfiddle).
* In chromium:

* In firefox 34:

Is it bug? Or normal working? What do i need to change to ... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27424831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892741/"
] | There is a bug in Firefox 34. One of the elements is not playing nicely as a flex child, and the input seems to be too wide. This extra width is not taken into account by the flex containers green border.
---
This can be confirmed as a bug because in Firefox 33.1 (and Chrome / IE) there is no problem with your exampl... | `Display: flex;` **only** needs to be on the container that needs to be flexible, not the inner elements. Here's the updated CSS, if you need a specific width, you can set that on `form {}`.
CSS
```
form {}
#flex {
display: flex;
border: 1px solid green;
outline: 1px solid red;
}
#flex > * {
flex: 1... |
27,424,831 | After last firefox-update some of css3-code has been broken... [Example](http://jsfiddle.net/944tL115/4/) (jsfiddle).
* In chromium:

* In firefox 34:

Is it bug? Or normal working? What do i need to change to ... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27424831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892741/"
] | Fix:
```
input { min-width: 1px; }
```
For vertical direction - `min-height`; | `Display: flex;` **only** needs to be on the container that needs to be flexible, not the inner elements. Here's the updated CSS, if you need a specific width, you can set that on `form {}`.
CSS
```
form {}
#flex {
display: flex;
border: 1px solid green;
outline: 1px solid red;
}
#flex > * {
flex: 1... |
27,424,831 | After last firefox-update some of css3-code has been broken... [Example](http://jsfiddle.net/944tL115/4/) (jsfiddle).
* In chromium:

* In firefox 34:

Is it bug? Or normal working? What do i need to change to ... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27424831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892741/"
] | variant with
```
min-width: 0
```
also works | `Display: flex;` **only** needs to be on the container that needs to be flexible, not the inner elements. Here's the updated CSS, if you need a specific width, you can set that on `form {}`.
CSS
```
form {}
#flex {
display: flex;
border: 1px solid green;
outline: 1px solid red;
}
#flex > * {
flex: 1... |
27,424,831 | After last firefox-update some of css3-code has been broken... [Example](http://jsfiddle.net/944tL115/4/) (jsfiddle).
* In chromium:

* In firefox 34:

Is it bug? Or normal working? What do i need to change to ... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27424831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892741/"
] | Fix:
```
input { min-width: 1px; }
```
For vertical direction - `min-height`; | There is a bug in Firefox 34. One of the elements is not playing nicely as a flex child, and the input seems to be too wide. This extra width is not taken into account by the flex containers green border.
---
This can be confirmed as a bug because in Firefox 33.1 (and Chrome / IE) there is no problem with your exampl... |
27,424,831 | After last firefox-update some of css3-code has been broken... [Example](http://jsfiddle.net/944tL115/4/) (jsfiddle).
* In chromium:

* In firefox 34:

Is it bug? Or normal working? What do i need to change to ... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27424831",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/892741/"
] | Fix:
```
input { min-width: 1px; }
```
For vertical direction - `min-height`; | variant with
```
min-width: 0
```
also works |
92,346 | I'm trying to print a set of beamer slides with multiple slides per page (4-up or 6-up). When I select 4 pages or 6 pages per sheet in the Okular print dialog, the pages print quite small (perhaps even tiny -- about 1.75" by 1.25") and leave significant white-space on the page.
I can get around this behavior by using... | 2010/01/06 | [
"https://superuser.com/questions/92346",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | As Tomas Markauskas said, the .app is a bundle.
Why did you try to move a .app file to /usr/bin? I'm going to guess that what you really want to know is "how do I open a file using Foo.app when I'm at the command line?"
If I'm right, the answer isn't to move the .app file to /usr/bin. The right answer is to use the `... | .app is actually not a file, but a folder (or Application bundle) with many different files in it. It also contains the executable files that you actually run. |
92,346 | I'm trying to print a set of beamer slides with multiple slides per page (4-up or 6-up). When I select 4 pages or 6 pages per sheet in the Okular print dialog, the pages print quite small (perhaps even tiny -- about 1.75" by 1.25") and leave significant white-space on the page.
I can get around this behavior by using... | 2010/01/06 | [
"https://superuser.com/questions/92346",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | .app is actually not a file, but a folder (or Application bundle) with many different files in it. It also contains the executable files that you actually run. | You can also run the app directly with the `open` command:
```
open /Applications/Safari.app/
``` |
92,346 | I'm trying to print a set of beamer slides with multiple slides per page (4-up or 6-up). When I select 4 pages or 6 pages per sheet in the Okular print dialog, the pages print quite small (perhaps even tiny -- about 1.75" by 1.25") and leave significant white-space on the page.
I can get around this behavior by using... | 2010/01/06 | [
"https://superuser.com/questions/92346",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Wikipedia has a good article on [Application Bundle](http://en.wikipedia.org/wiki/Application_Bundle)s.
In short, a `.app` is not a file: it's a directory tree with a specific structure. The actual binary that runs (ie, the equivalent of the binary you'd find in `/usr/bin`) is `PackageName.app/Contents/MacOS/PackageNa... | .app is actually not a file, but a folder (or Application bundle) with many different files in it. It also contains the executable files that you actually run. |
92,346 | I'm trying to print a set of beamer slides with multiple slides per page (4-up or 6-up). When I select 4 pages or 6 pages per sheet in the Okular print dialog, the pages print quite small (perhaps even tiny -- about 1.75" by 1.25") and leave significant white-space on the page.
I can get around this behavior by using... | 2010/01/06 | [
"https://superuser.com/questions/92346",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | As Tomas Markauskas said, the .app is a bundle.
Why did you try to move a .app file to /usr/bin? I'm going to guess that what you really want to know is "how do I open a file using Foo.app when I'm at the command line?"
If I'm right, the answer isn't to move the .app file to /usr/bin. The right answer is to use the `... | You can also run the app directly with the `open` command:
```
open /Applications/Safari.app/
``` |
92,346 | I'm trying to print a set of beamer slides with multiple slides per page (4-up or 6-up). When I select 4 pages or 6 pages per sheet in the Okular print dialog, the pages print quite small (perhaps even tiny -- about 1.75" by 1.25") and leave significant white-space on the page.
I can get around this behavior by using... | 2010/01/06 | [
"https://superuser.com/questions/92346",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Wikipedia has a good article on [Application Bundle](http://en.wikipedia.org/wiki/Application_Bundle)s.
In short, a `.app` is not a file: it's a directory tree with a specific structure. The actual binary that runs (ie, the equivalent of the binary you'd find in `/usr/bin`) is `PackageName.app/Contents/MacOS/PackageNa... | As Tomas Markauskas said, the .app is a bundle.
Why did you try to move a .app file to /usr/bin? I'm going to guess that what you really want to know is "how do I open a file using Foo.app when I'm at the command line?"
If I'm right, the answer isn't to move the .app file to /usr/bin. The right answer is to use the `... |
92,346 | I'm trying to print a set of beamer slides with multiple slides per page (4-up or 6-up). When I select 4 pages or 6 pages per sheet in the Okular print dialog, the pages print quite small (perhaps even tiny -- about 1.75" by 1.25") and leave significant white-space on the page.
I can get around this behavior by using... | 2010/01/06 | [
"https://superuser.com/questions/92346",
"https://superuser.com",
"https://superuser.com/users/-1/"
] | Wikipedia has a good article on [Application Bundle](http://en.wikipedia.org/wiki/Application_Bundle)s.
In short, a `.app` is not a file: it's a directory tree with a specific structure. The actual binary that runs (ie, the equivalent of the binary you'd find in `/usr/bin`) is `PackageName.app/Contents/MacOS/PackageNa... | You can also run the app directly with the `open` command:
```
open /Applications/Safari.app/
``` |
2,900,340 | I am introducing auto-rotation to my app and I'm having an issue with a memory warning. Whatever orientation I start my app in, as long as the device remains in that orientation, I get no memory warnings. However, the first time I rotate the device the following warning is placed on the console: Safari got memory level... | 2010/05/24 | [
"https://Stackoverflow.com/questions/2900340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/334440/"
] | You can't assume that memory warnings will never happen; you have to handle them gracefully. Suggestions:
* Check for memory leaks with Leaks (note that it doesn't catch all leaks).
* Fix your view controllers to handle a view reload. Specifically (unless you override -(void)loadView), it'll call -(void)viewDidUnload ... | Memory warnings are part of a normal iOS behavior, due to its limited memory, especially now that multi-tasking is supported.
UIKit doesn’t only allow navigation back from a view controller, but also allows navigation to other view controllers from existing ones. In such a case, a new UIViewController will be allocate... |
21,843,647 | In the following string, I want to match only 10.00
```
Test(+$15.00)(dsfa) (+$10.00)
```
Right now I have:
```
\([\+|\-]\$(?:[0-9\.]+?)\)$
```
but it captures (+$10.00), I'd like to have only the interior of the capture group.
Edit:
I'm using JS | 2014/02/18 | [
"https://Stackoverflow.com/questions/21843647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/618450/"
] | The problem is that you haven't defined a capturing group in your pattern, you only have literal parenthesis that is totally different. This will give you the result in the capturing group 1 *that is defined with simple parenthesis `(...)`*:
```
\([+-]\$([0-9.]+)\)$
```
*(Note that several characters don't need to b... | It's easy in JavaScript when using a capturing group. The return value of your test function will be an array where element 0 is the full capture and element 1 is your target result.
```
str = "Test(+$15.00)(dsfa) (+$10.00)"
matches = str.match(/(?:[+-]\$)(\d+\.\d\d)(?:\))$/)
result = matches[1]
```
`matches` here w... |
73,842,262 | I'm using C and I want to get the String "ABCABCABCABCABCABC" in the output screen through multithreading. One thread displays the 'A' character, the second one displays the 'B' and the third one displays the 'C'. If I compile the following code:
```
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#define... | 2022/09/25 | [
"https://Stackoverflow.com/questions/73842262",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20080932/"
] | >
> Can someone explain me this please?
>
>
>
The different output in linux has to do with the used scheduler.
[man sched](https://man7.org/linux/man-pages/man7/sched.7.html)
>
> Since Linux 2.6.23, the default scheduler is CFS, the "Completely Fair Scheduler".
>
>
>
[Completely Fair Scheduler](https://en.w... | You can store the order of execution in a global volatile variable named for example *order* which is set with the values 0, 1 and 2 circularly (thanks to an incrementation and a modulo operation). This variable is checked with a condition variable:
```c
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
int... |
73,842,262 | I'm using C and I want to get the String "ABCABCABCABCABCABC" in the output screen through multithreading. One thread displays the 'A' character, the second one displays the 'B' and the third one displays the 'C'. If I compile the following code:
```
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#define... | 2022/09/25 | [
"https://Stackoverflow.com/questions/73842262",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20080932/"
] | >
> Can someone explain me this please?
>
>
>
The different output in linux has to do with the used scheduler.
[man sched](https://man7.org/linux/man-pages/man7/sched.7.html)
>
> Since Linux 2.6.23, the default scheduler is CFS, the "Completely Fair Scheduler".
>
>
>
[Completely Fair Scheduler](https://en.w... | >
> On Windows through Dev-C++, the console throws me: ABACBACBACBACBACBC but if I compile the same code in Linux, I get CCCCCCBBBBBBAAAAAA.
> Can someone explain me this please?
>
>
>
The Linux behavior is what you should expect. Some thread has to start running first. Whichever thread it is, the other two thread... |
32,849,355 | I have a big dataframe and I need to create a new dataframe only with the data where one index is consecutive to the other.
For Example:
```
import pandas as pd
import numpy as np
indexer = [0,1,3,5,6,8,10,12,13,17,18,20,22,24,25,26]
df = pd.DataFrame(range(50,66), index=indexer, columns = ['A'])
```
So the desire... | 2015/09/29 | [
"https://Stackoverflow.com/questions/32849355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5235265/"
] | You can't shift the index, so you first need to reset it. Then use a `loc` operation together with testing both up and down one shift. Remember to set your index back to the original.
```
df.reset_index(inplace=True)
>>> df.loc[(df['index'] == df['index'].shift(1) + 1)
| (df['index'] == df['index'].shift(-... | Yes there's a faster way, using the [`.diff()` method, which exists on `Series` and `DataFrame`, but not `Int64Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.diff.html). We want all the rows where either forward difference == 1 or backward difference == -1. We use logical indexing dire... |
4,726,220 | When executing the command *shell-command*, the output shown in the associated buffer is not colorized.
This is particularly annoying when calling a testing framework (outputting yellow/green/red...) from within emacs.
How can I configure, or extend, emacs in order to have *shell-command* allowing colorized output in... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4726220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/479711/"
] | You can implement your own shell-execute, something like
```
(defun my-shell-execute(cmd)
(interactive "sShell command: ")
(shell (get-buffer-create "my-shell-buf"))
(process-send-string (get-buffer-process "my-shell-buf") (concat cmd "\n")))
``` | This is probably what you want :
```
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
``` |
4,726,220 | When executing the command *shell-command*, the output shown in the associated buffer is not colorized.
This is particularly annoying when calling a testing framework (outputting yellow/green/red...) from within emacs.
How can I configure, or extend, emacs in order to have *shell-command* allowing colorized output in... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4726220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/479711/"
] | This is probably what you want :
```
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
``` | This adds an advice to run `ansi-color-apply-on-region` on the minibuffer after shell-command finishes:
```
(require 'ansi-color)
(defun ansi-color-apply-on-buffer ()
(ansi-color-apply-on-region (point-min) (point-max)))
(defun ansi-color-apply-on-minibuffer ()
(let ((bufs (remove-if-not
(lambda... |
4,726,220 | When executing the command *shell-command*, the output shown in the associated buffer is not colorized.
This is particularly annoying when calling a testing framework (outputting yellow/green/red...) from within emacs.
How can I configure, or extend, emacs in order to have *shell-command* allowing colorized output in... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4726220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/479711/"
] | This is probably what you want :
```
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
``` | This solution is inspired by [@ArneBabenhauserheide](https://stackoverflow.com/a/42666026/2974621)'s but uses [`xterm-color`](https://github.com/atomontage/xterm-color) instead of `ansi-color`. It also colorizes the `*Shell Command Output*` buffer as well as the mini
```
(defun xterm-color-colorize-shell-command-outpu... |
4,726,220 | When executing the command *shell-command*, the output shown in the associated buffer is not colorized.
This is particularly annoying when calling a testing framework (outputting yellow/green/red...) from within emacs.
How can I configure, or extend, emacs in order to have *shell-command* allowing colorized output in... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4726220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/479711/"
] | You can implement your own shell-execute, something like
```
(defun my-shell-execute(cmd)
(interactive "sShell command: ")
(shell (get-buffer-create "my-shell-buf"))
(process-send-string (get-buffer-process "my-shell-buf") (concat cmd "\n")))
``` | This adds an advice to run `ansi-color-apply-on-region` on the minibuffer after shell-command finishes:
```
(require 'ansi-color)
(defun ansi-color-apply-on-buffer ()
(ansi-color-apply-on-region (point-min) (point-max)))
(defun ansi-color-apply-on-minibuffer ()
(let ((bufs (remove-if-not
(lambda... |
4,726,220 | When executing the command *shell-command*, the output shown in the associated buffer is not colorized.
This is particularly annoying when calling a testing framework (outputting yellow/green/red...) from within emacs.
How can I configure, or extend, emacs in order to have *shell-command* allowing colorized output in... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4726220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/479711/"
] | You can implement your own shell-execute, something like
```
(defun my-shell-execute(cmd)
(interactive "sShell command: ")
(shell (get-buffer-create "my-shell-buf"))
(process-send-string (get-buffer-process "my-shell-buf") (concat cmd "\n")))
``` | This solution is inspired by [@ArneBabenhauserheide](https://stackoverflow.com/a/42666026/2974621)'s but uses [`xterm-color`](https://github.com/atomontage/xterm-color) instead of `ansi-color`. It also colorizes the `*Shell Command Output*` buffer as well as the mini
```
(defun xterm-color-colorize-shell-command-outpu... |
4,726,220 | When executing the command *shell-command*, the output shown in the associated buffer is not colorized.
This is particularly annoying when calling a testing framework (outputting yellow/green/red...) from within emacs.
How can I configure, or extend, emacs in order to have *shell-command* allowing colorized output in... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4726220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/479711/"
] | This adds an advice to run `ansi-color-apply-on-region` on the minibuffer after shell-command finishes:
```
(require 'ansi-color)
(defun ansi-color-apply-on-buffer ()
(ansi-color-apply-on-region (point-min) (point-max)))
(defun ansi-color-apply-on-minibuffer ()
(let ((bufs (remove-if-not
(lambda... | This solution is inspired by [@ArneBabenhauserheide](https://stackoverflow.com/a/42666026/2974621)'s but uses [`xterm-color`](https://github.com/atomontage/xterm-color) instead of `ansi-color`. It also colorizes the `*Shell Command Output*` buffer as well as the mini
```
(defun xterm-color-colorize-shell-command-outpu... |
26,882 | My asp.net page will render different controls based on which report a user has selected e.g. some reports require 5 drop downs, some two checkboxes and 6 dropdowns).
They can select a report using two methods. With `SelectedReport=MyReport` in the query string, or by selecting it from a dropdown. And it's a common ca... | 2008/08/25 | [
"https://Stackoverflow.com/questions/26882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/233/"
] | You need to turn off autopostback on the dropdown - then, you need to hook up some javascript code that will take over that role - in the event handler code for the onchange event for the dropdown, you would create a URL based on the currently-selected value from the dropdown and use javascript to then request that pag... | If it's an automatic post when the data changes then you should be able to redirect to the new query string with a server side handler of the dropdown's 'onchange' event. If it's a button, handle server side in the click event. I'd post a sample of what I'm talking about but I'm on the way out to pick up the kids. |
26,882 | My asp.net page will render different controls based on which report a user has selected e.g. some reports require 5 drop downs, some two checkboxes and 6 dropdowns).
They can select a report using two methods. With `SelectedReport=MyReport` in the query string, or by selecting it from a dropdown. And it's a common ca... | 2008/08/25 | [
"https://Stackoverflow.com/questions/26882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/233/"
] | You need to turn off autopostback on the dropdown - then, you need to hook up some javascript code that will take over that role - in the event handler code for the onchange event for the dropdown, you would create a URL based on the currently-selected value from the dropdown and use javascript to then request that pag... | Have you tried to modify the Request.QueryString[] on the SelectedIndexChanged for the DropDown? That should do the trick. |
26,882 | My asp.net page will render different controls based on which report a user has selected e.g. some reports require 5 drop downs, some two checkboxes and 6 dropdowns).
They can select a report using two methods. With `SelectedReport=MyReport` in the query string, or by selecting it from a dropdown. And it's a common ca... | 2008/08/25 | [
"https://Stackoverflow.com/questions/26882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/233/"
] | You need to turn off autopostback on the dropdown - then, you need to hook up some javascript code that will take over that role - in the event handler code for the onchange event for the dropdown, you would create a URL based on the currently-selected value from the dropdown and use javascript to then request that pag... | You could populate your dropdown based on the querystring on non-postbacks, then always use the value from the dropdown. That way the user's first visit to the page will be based on the querystring and subsequent changes they make to the dropdown will change the selected report. |
26,882 | My asp.net page will render different controls based on which report a user has selected e.g. some reports require 5 drop downs, some two checkboxes and 6 dropdowns).
They can select a report using two methods. With `SelectedReport=MyReport` in the query string, or by selecting it from a dropdown. And it's a common ca... | 2008/08/25 | [
"https://Stackoverflow.com/questions/26882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/233/"
] | You need to turn off autopostback on the dropdown - then, you need to hook up some javascript code that will take over that role - in the event handler code for the onchange event for the dropdown, you would create a URL based on the currently-selected value from the dropdown and use javascript to then request that pag... | The view state only lasts for [multiple requests for the same page](http://msdn.microsoft.com/en-us/library/540y83hx.aspx). Changing the query string in the URL is requesting a new page, thus clearing the view state.
Is it possible to remove the reliance on the view state by adding more query string parameters? You ca... |
26,882 | My asp.net page will render different controls based on which report a user has selected e.g. some reports require 5 drop downs, some two checkboxes and 6 dropdowns).
They can select a report using two methods. With `SelectedReport=MyReport` in the query string, or by selecting it from a dropdown. And it's a common ca... | 2008/08/25 | [
"https://Stackoverflow.com/questions/26882",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/233/"
] | You need to turn off autopostback on the dropdown - then, you need to hook up some javascript code that will take over that role - in the event handler code for the onchange event for the dropdown, you would create a URL based on the currently-selected value from the dropdown and use javascript to then request that pag... | You can use the following function to modify the querystring on postback in asp.net using the Webresource.axd script as below.
```
var url = updateQueryStringParameter(window.location.href,
'Search',
document.getElementById('txtSearch').value);
... |
60,525,208 | I am a newbie on Kubernetes and try to generate 2 pods including front-end application and back-end mysql. First I make a yaml file which contains both application and mysql server like below,
```
apiVersion: v1
kind: Pod
metadata:
name: blog-system
spec:
containers:
- name: blog-app
image: blog-app:latest
... | 2020/03/04 | [
"https://Stackoverflow.com/questions/60525208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3840940/"
] | In the working case since same pod has two containers they are able to talk using localhost but in the second case since you have two pods you can not use localhost anymore. In this case you need to use the pod IP of the mysql pod in the frontend application. But problem with using POD IP is that it may change. Better ... | For this you need to write service for exposing the db pod.
There are 4 types of services.
1. `ClusterIP`
2. `NodePort`
3. `LoadBalancer`
4. `ExternalName`
Now you need only inside the cluster then use `ClusterIP`
For reference use following yaml file.
```
kind: Service
apiVersion: v1
metadata:
name: mysql-svc
spec... |
60,525,208 | I am a newbie on Kubernetes and try to generate 2 pods including front-end application and back-end mysql. First I make a yaml file which contains both application and mysql server like below,
```
apiVersion: v1
kind: Pod
metadata:
name: blog-system
spec:
containers:
- name: blog-app
image: blog-app:latest
... | 2020/03/04 | [
"https://Stackoverflow.com/questions/60525208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3840940/"
] | In the working case since same pod has two containers they are able to talk using localhost but in the second case since you have two pods you can not use localhost anymore. In this case you need to use the pod IP of the mysql pod in the frontend application. But problem with using POD IP is that it may change. Better ... | Pods created will have dns configured in the following manner
`pod_name.namespace.svc.cluster.local`
In your case assuming these pods are in default namespace your jdbc connection string will be
`jdbc:mysql://blog-mysql.default.svc.cluster.local:3306/test`
Refer: <https://kubernetes.io/docs/concepts/services-networ... |
60,525,208 | I am a newbie on Kubernetes and try to generate 2 pods including front-end application and back-end mysql. First I make a yaml file which contains both application and mysql server like below,
```
apiVersion: v1
kind: Pod
metadata:
name: blog-system
spec:
containers:
- name: blog-app
image: blog-app:latest
... | 2020/03/04 | [
"https://Stackoverflow.com/questions/60525208",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3840940/"
] | For this you need to write service for exposing the db pod.
There are 4 types of services.
1. `ClusterIP`
2. `NodePort`
3. `LoadBalancer`
4. `ExternalName`
Now you need only inside the cluster then use `ClusterIP`
For reference use following yaml file.
```
kind: Service
apiVersion: v1
metadata:
name: mysql-svc
spec... | Pods created will have dns configured in the following manner
`pod_name.namespace.svc.cluster.local`
In your case assuming these pods are in default namespace your jdbc connection string will be
`jdbc:mysql://blog-mysql.default.svc.cluster.local:3306/test`
Refer: <https://kubernetes.io/docs/concepts/services-networ... |
2,170,843 | >
> A file that is given as input to the linker is called **Object File**.
> The linker produces an **Image file**, which in turn is used as input by the loader.
>
>
>
A blurb from "**Microsoft Portable Executable and Common Object File Format Specification**"
>
> **RVA (relative virtual address)**. In an ima... | 2010/01/31 | [
"https://Stackoverflow.com/questions/2170843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/193653/"
] | Most Windows process (\*.exe) are loaded in (user mode) memory address 0x00400000, that's what we call the "virtual address" (VA) - because they are visible only to each process, and will be converted to different physical addresses by the OS (visible by the kernel / driver layer).
For example, a possible physical mem... | A relative virtual address is an offset from the address at which the file is loaded. Probably the simplest way to get the idea is with an example. Assume you have a file (e.g., a DLL) that's loaded at address 1000h. In that file, you have a variable at RVA 200h. In that case, the VA of that variable (after the DLL is ... |
180,165 | How do people define the minimum hardware requirements for software? For example: how can a software development company tell the customer that they will need 8 GB of RAM to run the program properly? | 2012/12/20 | [
"https://softwareengineering.stackexchange.com/questions/180165",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/75596/"
] | First off, not all requirements are hard requirements, but rather the minimum supported hardware. If someone has less than the minimum, it may run - but not optimally, or it may not run at all. In either case, its not a supported system and the problems you have are your own.
The simplest way to get hardware requireme... | For some applications the requirements may actually be hard requirements, such as when the developer has analyzed or profiled their app and knows exactly how many megaflops, MIPS, polygons per second, array working set sizes, etc. are required to meet some specified performance benchmark.
For small developers, cost ma... |
180,165 | How do people define the minimum hardware requirements for software? For example: how can a software development company tell the customer that they will need 8 GB of RAM to run the program properly? | 2012/12/20 | [
"https://softwareengineering.stackexchange.com/questions/180165",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/75596/"
] | First off, not all requirements are hard requirements, but rather the minimum supported hardware. If someone has less than the minimum, it may run - but not optimally, or it may not run at all. In either case, its not a supported system and the problems you have are your own.
The simplest way to get hardware requireme... | Hardware requirements fall into a couple of different buckets. Often you'll include requirements from a few of these buckets when determining specific hardware requirements for any software system you build.
**Technical Constraints in the Architecture**
These are the kinds of requirements that absolutely must be sati... |
180,165 | How do people define the minimum hardware requirements for software? For example: how can a software development company tell the customer that they will need 8 GB of RAM to run the program properly? | 2012/12/20 | [
"https://softwareengineering.stackexchange.com/questions/180165",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/75596/"
] | Hardware requirements fall into a couple of different buckets. Often you'll include requirements from a few of these buckets when determining specific hardware requirements for any software system you build.
**Technical Constraints in the Architecture**
These are the kinds of requirements that absolutely must be sati... | For some applications the requirements may actually be hard requirements, such as when the developer has analyzed or profiled their app and knows exactly how many megaflops, MIPS, polygons per second, array working set sizes, etc. are required to meet some specified performance benchmark.
For small developers, cost ma... |
67,081,389 | All of tags are changed to the below type of string on outlook web browser
```
[www.frimetime.com/verify/9026151fe8ddd0db4a9cb84e2ac0e7ce1a07ccd1be100896b2772e620b74ac16]Verify Now
```
It has to be.
```
<a href="www.frimetime.com/verify/9026151fe8ddd0db4a9cb84e2ac0e7ce1a07ccd1be100896b2772e620b74ac16">Verify Now</a... | 2021/04/13 | [
"https://Stackoverflow.com/questions/67081389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14979586/"
] | Do you mean something like this?
I hope I understood the question well.
You can write a recursive function:
```js
let string = "Lion, Unicorn, Unicorn";
let array1 = ["Lion", "Unicorn"];
let array2 = ["Fox", "Hound"];
function myCustomReplace(str, a1, a2) {
let wordToReplace=a1.shift(); // a1[0] - if array change... | It's sometimes worthwhile to first transform the inputs into a shape that is easier to work on. For this problem, the input sentence is better thought of as an array of words, and the two arrays used for replacement are better represented as a single object mapping input words to output words...
```js
let string = "Li... |
67,081,389 | All of tags are changed to the below type of string on outlook web browser
```
[www.frimetime.com/verify/9026151fe8ddd0db4a9cb84e2ac0e7ce1a07ccd1be100896b2772e620b74ac16]Verify Now
```
It has to be.
```
<a href="www.frimetime.com/verify/9026151fe8ddd0db4a9cb84e2ac0e7ce1a07ccd1be100896b2772e620b74ac16">Verify Now</a... | 2021/04/13 | [
"https://Stackoverflow.com/questions/67081389",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14979586/"
] | Do you mean something like this?
I hope I understood the question well.
You can write a recursive function:
```js
let string = "Lion, Unicorn, Unicorn";
let array1 = ["Lion", "Unicorn"];
let array2 = ["Fox", "Hound"];
function myCustomReplace(str, a1, a2) {
let wordToReplace=a1.shift(); // a1[0] - if array change... | If we use [`split(', ')`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) to convert the string to an array of single words, we can use [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) to replace them by searching for a ... |
113,446 | I am using ArcView (ArcGIS Desktop Basic) 10.1 and I need to perform a point distance analysis.
What are the steps to determine the distance from A to B-Z, B to A-Z, C to A-Z, etc? | 2014/09/11 | [
"https://gis.stackexchange.com/questions/113446",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/36861/"
] | The following code is not polished but should work to create the same output table as the Point Distance tool but requires ArcGIS 10.1 (or later) for Desktop and only a Basic level license:
```py
import arcpy,math
# Set variables for input point feature classes and output table
ptFC1 = "C:/temp/test.gdb/PointFC1"
ptF... | Using arcpy geometry objects is a good way to determine distances between features. Use data access cursors to access a feature's geometry and the method `angleAndDistanceTo` to determine distances.
From my [blog](http://emilsarcpython.blogspot.com/2017/08/arcgis-point-distance-without-advanced.html):
```
import os
i... |
48,301,533 | I have the following code:
```
let fetcher = DiagnosticFetcher(commandSender: sender)
fetcher.fetch()
.observeOn(MainScheduler.instance)
.subscribe(
onNext: { self.store.save(content: $0) },
onError: { self.view.showError("Error") },
onCompleted: { log.verbose("Diagnostic fetched") })
```... | 2018/01/17 | [
"https://Stackoverflow.com/questions/48301533",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15361/"
] | I got it to compile by specifying the first parameter in the `onError` lambda:
```
fetcher.fetch()
.observeOn(MainScheduler.instance)
.subscribe(
onNext: { self.store.save(content: $0) },
onError: { _ in self.view.showError("Error")})
``` | Adding my contribution.
I had the same issue but, in my case:
```
recordHeader.albumArray.asObservable()
.subscribe(onNext: { [weak self] value in
self?.populateView(recordHeader: value)
})
.disposed(by: disposeBag)
```
The value type of the function "populateView" didn't match to value type of ... |
73,367,277 | I tried to install turtle on my VS Code and got this error message, could you guys tell me what's going on with this module, please?
 | 2022/08/15 | [
"https://Stackoverflow.com/questions/73367277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19399657/"
] | Turtle is already included in the Python standard library. I am assuming that pip is trying to install a different package than you are looking for and your geting an error
[Turtle](https://docs.python.org/3.7/library/turtle.html) | Which turtle do you want to install?
If you mean this package, then you don't need to do any installation.
[](https://i.stack.imgur.com/s55VY.png)
It already exists when you install Python. |
42,548 | On behalf of my advisor, I recently wrote a grant to obtain some specialized and expensive hardware. Is it ok to mention this on my CV, even though the grant is in my advisor's name and if yes, what would be a good way to word it ? | 2015/03/29 | [
"https://academia.stackexchange.com/questions/42548",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/27265/"
] | You can list on your CV whatever you think is useful information for the reader. In your case, whether something is useful depends on what your position in life is. If you're a full professor with a long history of funded research, what you describe is likely not useful to list on a CV. If you're a graduate student wit... | I wouldn't put this on a CV, but it is something that you should bring up during an interview as an example of your experience with the grant writing process.
To elaborate on this:
An individual is either a PI/Co-PI on a grant or they aren't. Some readers might read your CV and think that you're claiming undue credi... |
42,548 | On behalf of my advisor, I recently wrote a grant to obtain some specialized and expensive hardware. Is it ok to mention this on my CV, even though the grant is in my advisor's name and if yes, what would be a good way to word it ? | 2015/03/29 | [
"https://academia.stackexchange.com/questions/42548",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/27265/"
] | **I would list all relevant grant activity on your CV.** Grant activity is something that many departments consider when considered people for academic appointments and it's often missing or hard to see.
It is completely normal for graduate students to apply for grants with their advisors listed as PIs. Be honest abou... | I wouldn't put this on a CV, but it is something that you should bring up during an interview as an example of your experience with the grant writing process.
To elaborate on this:
An individual is either a PI/Co-PI on a grant or they aren't. Some readers might read your CV and think that you're claiming undue credi... |
42,548 | On behalf of my advisor, I recently wrote a grant to obtain some specialized and expensive hardware. Is it ok to mention this on my CV, even though the grant is in my advisor's name and if yes, what would be a good way to word it ? | 2015/03/29 | [
"https://academia.stackexchange.com/questions/42548",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/27265/"
] | You can list on your CV whatever you think is useful information for the reader. In your case, whether something is useful depends on what your position in life is. If you're a full professor with a long history of funded research, what you describe is likely not useful to list on a CV. If you're a graduate student wit... | **I would list all relevant grant activity on your CV.** Grant activity is something that many departments consider when considered people for academic appointments and it's often missing or hard to see.
It is completely normal for graduate students to apply for grants with their advisors listed as PIs. Be honest abou... |
4,339,013 | I have a javascript function that has been driving me nuts. This is the latest variation on the problem. If I put the code in line after the end of the form (i.e. after the tag, the code works just fine; but if I put a script reference to the code, it loads but doesn't execute.
This works:
```
<script type="text/jav... | 2010/12/02 | [
"https://Stackoverflow.com/questions/4339013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95306/"
] | Self-closing `<script>` tags aren't valid, this:
```
<script type="text/javascript" src="js/DOTAutocomplete.js" />
```
should be:
```
<script type="text/javascript" src="js/DOTAutocomplete.js"></script>
```
Also note that since you're using a selector `$('#' + matchFieldName)`, the file should either be included ... | Chances are that you're not targeting the file correctly. You're using type="text/javascript", right? If it works inline but not with a src reference, it's almost certainly that you're not nailing the path to the file. |
4,339,013 | I have a javascript function that has been driving me nuts. This is the latest variation on the problem. If I put the code in line after the end of the form (i.e. after the tag, the code works just fine; but if I put a script reference to the code, it loads but doesn't execute.
This works:
```
<script type="text/jav... | 2010/12/02 | [
"https://Stackoverflow.com/questions/4339013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95306/"
] | Self-closing `<script>` tags aren't valid, this:
```
<script type="text/javascript" src="js/DOTAutocomplete.js" />
```
should be:
```
<script type="text/javascript" src="js/DOTAutocomplete.js"></script>
```
Also note that since you're using a selector `$('#' + matchFieldName)`, the file should either be included ... | Try this, put this code back into an external file, make sure you have a valid script include tag, per Nick's post.
```
$(function(){
var matchFieldName = 'dotmatch';
var resultFieldName = 'dotnumber';
var lookupURL = "/AutoSuggestJSTest/AutoSuggest.asmx/DOTFind";
var labelFieldName = "JobTitle";
... |
4,339,013 | I have a javascript function that has been driving me nuts. This is the latest variation on the problem. If I put the code in line after the end of the form (i.e. after the tag, the code works just fine; but if I put a script reference to the code, it loads but doesn't execute.
This works:
```
<script type="text/jav... | 2010/12/02 | [
"https://Stackoverflow.com/questions/4339013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95306/"
] | Self-closing `<script>` tags aren't valid, this:
```
<script type="text/javascript" src="js/DOTAutocomplete.js" />
```
should be:
```
<script type="text/javascript" src="js/DOTAutocomplete.js"></script>
```
Also note that since you're using a selector `$('#' + matchFieldName)`, the file should either be included ... | As noted above by Mr. Craver, self-closing Javascript tags are no good. Here's a discussion on why:
[Why don't self-closing script tags work?](https://stackoverflow.com/questions/69913/why-dont-self-closing-script-tags-work)
There's no satisfying reason why - it's just that the SCRIPT tag isn't marked as having a con... |
4,339,013 | I have a javascript function that has been driving me nuts. This is the latest variation on the problem. If I put the code in line after the end of the form (i.e. after the tag, the code works just fine; but if I put a script reference to the code, it loads but doesn't execute.
This works:
```
<script type="text/jav... | 2010/12/02 | [
"https://Stackoverflow.com/questions/4339013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95306/"
] | Chances are that you're not targeting the file correctly. You're using type="text/javascript", right? If it works inline but not with a src reference, it's almost certainly that you're not nailing the path to the file. | As noted above by Mr. Craver, self-closing Javascript tags are no good. Here's a discussion on why:
[Why don't self-closing script tags work?](https://stackoverflow.com/questions/69913/why-dont-self-closing-script-tags-work)
There's no satisfying reason why - it's just that the SCRIPT tag isn't marked as having a con... |
4,339,013 | I have a javascript function that has been driving me nuts. This is the latest variation on the problem. If I put the code in line after the end of the form (i.e. after the tag, the code works just fine; but if I put a script reference to the code, it loads but doesn't execute.
This works:
```
<script type="text/jav... | 2010/12/02 | [
"https://Stackoverflow.com/questions/4339013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95306/"
] | Try this, put this code back into an external file, make sure you have a valid script include tag, per Nick's post.
```
$(function(){
var matchFieldName = 'dotmatch';
var resultFieldName = 'dotnumber';
var lookupURL = "/AutoSuggestJSTest/AutoSuggest.asmx/DOTFind";
var labelFieldName = "JobTitle";
... | As noted above by Mr. Craver, self-closing Javascript tags are no good. Here's a discussion on why:
[Why don't self-closing script tags work?](https://stackoverflow.com/questions/69913/why-dont-self-closing-script-tags-work)
There's no satisfying reason why - it's just that the SCRIPT tag isn't marked as having a con... |
48,968,873 | I am writing a recursive function to find the index of a node in a linked list. It looks like this:
```
function indexAt(node, collection, linkedList) {
let index = 0;
if (node === nodeAt(index, linkedList,collection)) {
return index
} else {
index ++
return indexAt(node, collection, linkedList)
}
}
```
... | 2018/02/24 | [
"https://Stackoverflow.com/questions/48968873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8833196/"
] | Do you minimize it because you are busy with other things? You can use headless mode once your code is doing what you want visually and avoid this problem. | By the way you should try PhantomJs as the driver if minimizing the window is a big concern. It basically works the same way as the chrome driver but it uses no browser so all your code will run in the backgroud, it worked for me. It may work for you, happy coding! <http://phantomjs.org> |
48,968,873 | I am writing a recursive function to find the index of a node in a linked list. It looks like this:
```
function indexAt(node, collection, linkedList) {
let index = 0;
if (node === nodeAt(index, linkedList,collection)) {
return index
} else {
index ++
return indexAt(node, collection, linkedList)
}
}
```
... | 2018/02/24 | [
"https://Stackoverflow.com/questions/48968873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8833196/"
] | Do you minimize it because you are busy with other things? You can use headless mode once your code is doing what you want visually and avoid this problem. | As you mentioned *the test browser minimized, the new content does not load* is pretty much expected as *Selenium needs **focus** on the **Browsing Window** to interact with the DOM elements.*
Reason
------
At this point it is worth to mention that *a webpage could **change its content** when the **focus is lost*** .... |
102,605 | Hi guys currently i am using Tooling Api to integrate a java app to Salesforce using Soap Api.I am making a callout for runtest() It's working fine with rest api but it doesn't work with soap i don't no how to make request for soap.
Here is code for rest Api which i am able to implement.
```
/runTestsAsynchronous/ Bo... | 2015/12/16 | [
"https://salesforce.stackexchange.com/questions/102605",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/26908/"
] | The SOAP version on the Tooling API doesn't currently have an equivalent web method that allows you to specify the testMethods to run in each apex class.
See [RunTestsRequest](https://developer.salesforce.com/docs/atlas.en-us.200.0.apexcode.meta/apexcode/sforce_api_calls_runtests_request.htm), which is the parameter a... | Did you try this example? This will give you the necessary Java class you need to call runtestAsynchronous() soap method whil also setting up the class and suite Ids. Unlike REST API you can not use a Test Array ID List, You can only pass in either suite Ids and/or class Ids. I hope this helps
<https://developer.sales... |
58,670,133 | I have this functionality where user can add product to cart. e.g so user can add one product in cart after sometime the product gets deleted by the seller but still it is in the users cart, so if he checks out one product which has been deleted it will redirect him back to cart saying the product was deleted(one produ... | 2019/11/02 | [
"https://Stackoverflow.com/questions/58670133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11710915/"
] | One approach, using `preg_match` with a capture group:
```
$input = "fishPrice/1572268723Career Portal.pdf";
preg_match("/.*\d{10}(.*)\.\w+$/", $input, $matches);
echo $matches[1];
```
This prints `Career Portal`. The regex logic here is to capture everything after the final 10 digit number sequence, but before the ... | Okay I worked on a little example for you.
```
$string = "fishPrice/1572268723Career Portal.pdf";
//Echo 1572268723Career Portal.pdf
$string = substr($string, strpos($string, "/")+1);
while(is_numeric($string[0]))
{
$string = substr($string, 1);
}
//Career Portal.pdf
echo $string;
```
First of all, I subst... |
58,670,133 | I have this functionality where user can add product to cart. e.g so user can add one product in cart after sometime the product gets deleted by the seller but still it is in the users cart, so if he checks out one product which has been deleted it will redirect him back to cart saying the product was deleted(one produ... | 2019/11/02 | [
"https://Stackoverflow.com/questions/58670133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11710915/"
] | With only one sample string, the pattern accuracy is speculative.
My best guess is: ([Demo](https://3v4l.org/7af5v))
```
$input = "fishPrice/1572268723Career Portal.pdf";
echo preg_match("~\d{10}\K[^.]+~", $input, $out) ? $out[0] : 'fail';
```
Output:
```
Career Portal
```
Just match the non-dot characters afte... | Okay I worked on a little example for you.
```
$string = "fishPrice/1572268723Career Portal.pdf";
//Echo 1572268723Career Portal.pdf
$string = substr($string, strpos($string, "/")+1);
while(is_numeric($string[0]))
{
$string = substr($string, 1);
}
//Career Portal.pdf
echo $string;
```
First of all, I subst... |
46,377,720 | I have an activity that consists of a tablayout of 3 tabs. Each tab is a fragment and all of them contains a pdf view to view different pdf files.
I have written a class for Pdf Viewer. I need to call that class in numerous fragments to open pdf file in that fragment. But I'm not being able to pass the context properl... | 2017/09/23 | [
"https://Stackoverflow.com/questions/46377720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6719239/"
] | You are trying to use a query object, but it seems you didn't create a mapped class to instantiate it.
[Query documentation](http://docs.sqlalchemy.org/en/latest/orm/query.html?highlight=filter_by#the-query-object)
[Mapping documentation](http://docs.sqlalchemy.org/en/latest/orm/tutorial.html#declare-a-mapping)
You ... | You are not using the uuid correctly.
Please follow the declaration below.
```
from sqlalchemy.dialects.postgresql import UUID
...
uuid = db.Column(
UUID(as_uuid=True),
nullable=False,
index=True,
unique=True,
server_default=text("uuid_generate_v4()")
)
``` |
167,559 | I currently have a error in my 1.9.3.2 store.
When a customer wants to reset their password, the Magento Report error page is displayed.
When check the report, I get the following error:
```
a:5:{i:0;s:156:"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'customer_flowpassword' doesn't exist, query was: DE... | 2017/04/04 | [
"https://magento.stackexchange.com/questions/167559",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | From Magento DevDocs:
The sections that follow discuss requirements for one or two Magento file system owners. That means:
**One user**: Typically necessary on shared hosting providers, which allow you to access only one user on the server This user can log in, transfer files using FTP, and this user also runs the we... | Run this command :
```
chmod -R 777 var/ pub/
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.