qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
70,405,640 | What should be the css to align them in the same line?
```
<div class="discount-tab">
<h1 class="discount-heading">Book your first adventure with us at 10% discount</h1>
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">Book now</button>
</div>
``` | 2021/12/18 | [
"https://Stackoverflow.com/questions/70405640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17223877/"
] | You can set the `h1` tag to: `display: inline-block`. It'll only take up the space it needs that way.
Another approach, which might be even better is to make use of flexbox.
Flexbox can align all the items vertically and/or horizontally.
```
.discount-tab {
display: flex;
flex-direction: row;
align-items:... | You can use [grid](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout) `display: grid;` and add styling to button a little.
```css
.discount-tab {
display: grid;
align-items: center;
justify-content: center;
grid-template-columns: 4fr 1fr;
}
.mdl-button {
max-width: 100px;
}
```
```html
<div ... |
15,710 | Was travelling on a Airbus A320 (night flight) and during the safety briefing noticed that the fluorescent floor lighting strip referred to in the evacuation instructions was totally absent. Both sides of the aisle.
I could see the marks on the floor carpet where it must have been earlier tacked on. Was removed and w... | 2015/06/11 | [
"https://aviation.stackexchange.com/questions/15710",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/7611/"
] | According to [this document](http://fsims.faa.gov/wdocs/mmel/a-320%20r21.pdf) the answer would appear to be no if all lights were missing.

The 1/1 columns indicates the number installed and required for dispatch. | Those lights don't have to be mounted to the floor. They can also be seat mounted.
<http://www.bruceind.com/index.php?option=com_k2&view=item&id=90:escape-path-lighting-systems&Itemid=189>
<http://www.astronics.com/_images/aircraft-safety/EPM%20033010.pdf>
 prefix being advertised as an individual route without the knowledge of the individual routes which make up the summary.
This doesn't mean... | The AD of the EIGRP summary route is 5 only on the router that has the summary route configured. When the summary is advertised to other routers it has an AD of 90.
The reason for the low AD is to insure that the summary route (to nul0) is preferred to prevent routing loops. |
44,268,716 | I have a test data service written in Angular4. It currently looks like this:
```
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise'
@Injectable()
export class DataService {
constructor(private http: Http) { }
fe... | 2017/05/30 | [
"https://Stackoverflow.com/questions/44268716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The in-memory-web-api will interfere with your "outside" requests. You need to remove that from your NgModule, since otherwise Angular is always trying to look in in-memory-web-api for your requests, which obviously doesn't exist in that place. So removing the equivalent of
```
InMemoryWebApiModule.forRoot(InMemoryDa... | Try importing `import 'rxjs/add/operator/toPromise';` and add toPromise to the end of the http get in the the fetchData() function.
```
fetchData(){
return this.http.get('https://dinstruct-d4b62.firebaseio.com/.json').map(
(res) => res.json()).toPromise();
}
```
Your calling function should then look like th... |
44,268,716 | I have a test data service written in Angular4. It currently looks like this:
```
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise'
@Injectable()
export class DataService {
constructor(private http: Http) { }
fe... | 2017/05/30 | [
"https://Stackoverflow.com/questions/44268716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The in-memory-web-api will interfere with your "outside" requests. You need to remove that from your NgModule, since otherwise Angular is always trying to look in in-memory-web-api for your requests, which obviously doesn't exist in that place. So removing the equivalent of
```
InMemoryWebApiModule.forRoot(InMemoryDa... | In AppModule.ts where you have imports[], you would have imported the **HttpClientInMemoryWebApiModule**
like =>
---
```
HttpClientInMemoryWebApiModule
.forRoot(
InMemoryService, { dataEncapsulation: false }
),
```
---
Now What is happening here is that your application is searching for the public ... |
8,621 | I'm setting up a storage server in a typical (albeit very large) computer case. I have like 20 2 TB SATA hard drives, and I want to connect all of them to one motherboard. The most ports I found on a consumer motherboard was 15. Is there some sort of way to get like 20 SATA ports from USB C or PCIe? I don't mind slower... | 2017/12/29 | [
"https://hardwarerecs.stackexchange.com/questions/8621",
"https://hardwarerecs.stackexchange.com",
"https://hardwarerecs.stackexchange.com/users/6353/"
] | TL;DR: Your motherboard + an LSI 9211-8i, or just a motherboard with more SATA ports.
=====================================================================================
### Motherboard upgrade
If you're willing to manage with a slightly lower amount of ports, just get a motherboard with a bunch of SATA ports! The ... | Assuming this is a typical logic board, PCIe is a lower-level connection.
In other words, PCIe is actually a 'direct connect' into the PCI buss..
On the other hand, USB is usually routed thru the PCI buss THEN thru a USB controller chip, to then run thru the USB circuit.
This means that data would be handled faster t... |
8,621 | I'm setting up a storage server in a typical (albeit very large) computer case. I have like 20 2 TB SATA hard drives, and I want to connect all of them to one motherboard. The most ports I found on a consumer motherboard was 15. Is there some sort of way to get like 20 SATA ports from USB C or PCIe? I don't mind slower... | 2017/12/29 | [
"https://hardwarerecs.stackexchange.com/questions/8621",
"https://hardwarerecs.stackexchange.com",
"https://hardwarerecs.stackexchange.com/users/6353/"
] | TL;DR: Your motherboard + an LSI 9211-8i, or just a motherboard with more SATA ports.
=====================================================================================
### Motherboard upgrade
If you're willing to manage with a slightly lower amount of ports, just get a motherboard with a bunch of SATA ports! The ... | Most companies that produce RAID controllers have similar options. What your doing isn't even hard, people do 256 hard drives via SAS/SATA expanders and chasis like the one listed below.
Clearly you need an adaptec raid controller card.
The 71685 supports 24 devices natively.
<https://storage.microsemi.com/en-us/supp... |
700 | I know someone who bought earphones that shine light in you ears. According to what he was told, there are neurons that sense light and then make you feel wide awake when activated, which seemed like snake oil to me. Apparently the pineal gland may be able to sense light and it does secrete melatonin - a sleep regulati... | 2012/01/17 | [
"https://biology.stackexchange.com/questions/700",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/368/"
] | There is no known mechanism for light detection through the ears in humans, as far as I know. It is certainly true that the pineal gland is part of the system that regulates the circadian rhythm (briefly, the daily sleep-wake cycle). However, while the pineal gland in birds and other non-mammalian vertebrates is direct... | I believe there are light sensors ([TRPV3](http://en.wikipedia.org/wiki/TRPV3)) in the skin for infrared light (heat), that convey that information back to the brain from the skin. This is kind of light detection, but it is not direct detection like the rhodopsins in the eye.
By the way, without passing information o... |
11,986,428 | I have the following function for which I want to find the extrema using matlab.

That function has to use the "normcdf" function in matlab in order to get the results but when I'm trying to create the symbolic function I get back some errors.
The ... | 2012/08/16 | [
"https://Stackoverflow.com/questions/11986428",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1221734/"
] | <http://dev.elevationblog.com/2009/07/23/event-calendar-rails-plugin/>
After loading almost all the comments I found the answer to that question.
just override the color method in your event model.
```
def color
# color logic based on event type
# or maybe associated calendar?, ie
# self.calendar.color
if self.ty... | I did things a little differently for more flexibility based on info I found on this site.
**Output**
```
<div class="btn-group event_color" data-toggle="buttons-radio">
<button type="button" class="btn btn-success" value="#00a651">Active</button>
<button type="button" class="btn btn-warning" value="#ecef0... |
145,653 | If I do `$collection->getSelect()` I am moving from `collection` object to `select` object and I can use some useful stuff more close to raw sql.
But what can I do to get back from `select` to magento `collection`?
If, for example, I want to use `$collection->getFirstItem()->getId()`? | 2016/11/14 | [
"https://magento.stackexchange.com/questions/145653",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/36253/"
] | ```
$collection = your collection here;
$select = $collection->getSelect();
//do nasty stuff with the $select object.
```
since this is an object, it is passed by reference and anything you change in it will be reflected in the collection select
Then you can use again:
```
$collection->getFirstItem();
``` | As long as you don't store the result of `getSelect()` into a new variable and try to call the collection methods on that new variable, you should still be able to use collection methods.
For example:
```
$collection->getSelect()->where('is_enabled=?', 0);
return $collection->getFirstItem();
```
This would work per... |
806,506 | Where is it written that my hard disk is SSD or HDD?
I have tried searching:
* msinfo32
* Device Manager
* Disk Management
I need to to see the words solid state drive or hard disk drive in Windows 7.
It may be either through CLI or GUI.
I found the same information for Windows 8 here.
Right-click on C drive-> *P... | 2014/09/03 | [
"https://superuser.com/questions/806506",
"https://superuser.com",
"https://superuser.com/users/303024/"
] | 1. Find the drive in Device Manager (devmgmt.msc).
2. Look up the model number in Google.
Example:

[KINGSTON SH103S3120G](http://lmgtfy.com/?q=kingston+sh103s3120g&l=1) - Kingston 120 GB SSD
[ST1000LM014-1EJ164-SSHD](http://lmgtfy.com/?q=ST1000LM0... | I'm not completely clear on your question; however, in My Computer, right click on drive, select properties, select Hardware tab. In my case it shows *Patriot Pyro SSd SATA Disk Device*. |
806,506 | Where is it written that my hard disk is SSD or HDD?
I have tried searching:
* msinfo32
* Device Manager
* Disk Management
I need to to see the words solid state drive or hard disk drive in Windows 7.
It may be either through CLI or GUI.
I found the same information for Windows 8 here.
Right-click on C drive-> *P... | 2014/09/03 | [
"https://superuser.com/questions/806506",
"https://superuser.com",
"https://superuser.com/users/303024/"
] | 1. Find the drive in Device Manager (devmgmt.msc).
2. Look up the model number in Google.
Example:

[KINGSTON SH103S3120G](http://lmgtfy.com/?q=kingston+sh103s3120g&l=1) - Kingston 120 GB SSD
[ST1000LM014-1EJ164-SSHD](http://lmgtfy.com/?q=ST1000LM0... | Goto the control panel -> system -> and find the "device manager", click on it to give a listing of all devices present.
It should list the storage media, as in model **WD 500000000-XYZ.abc** You then check to see what that model# refers to by googling the exact model# provided. Once done it explains the specs of tha... |
32,538,758 | I am working on Caffe framework and using PyCaffe interface. I am using a Python script obtained from converting the IPython Notebook **00-classification.ipynb** for testing the classification by a trained model for ImageNet. But any **get\_ipython()** statement in the script is giving the following error:
```
$ pytho... | 2015/09/12 | [
"https://Stackoverflow.com/questions/32538758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2452617/"
] | You have to run your script with ipython:
```
$ ipython python/my_test_imagenet.py
```
Then `get_ipython` will be already in global context.
Note: Importing it via `from IPython import get_ipython` in ordinary shell `python` will not work as you really need `ipython` running. | If your intention is to run converted .py file notebook then you should just comment out `get_ipython()` statements. The matlibplot output can't be shown inside console so you would have some work to do . Ideally, iPython shouldn't have generated these statements. You can use following to show plots:
```
plt.show(bloc... |
32,538,758 | I am working on Caffe framework and using PyCaffe interface. I am using a Python script obtained from converting the IPython Notebook **00-classification.ipynb** for testing the classification by a trained model for ImageNet. But any **get\_ipython()** statement in the script is giving the following error:
```
$ pytho... | 2015/09/12 | [
"https://Stackoverflow.com/questions/32538758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2452617/"
] | You have to run your script with ipython:
```
$ ipython python/my_test_imagenet.py
```
Then `get_ipython` will be already in global context.
Note: Importing it via `from IPython import get_ipython` in ordinary shell `python` will not work as you really need `ipython` running. | `get_ipython` is available only if the IPython module was imported that happens implicitly if you run ipython shell (or Jupyter notebook).
If not, the import will fail, but you can still import it explicitly with:
```
from IPython import get_ipython
``` |
32,538,758 | I am working on Caffe framework and using PyCaffe interface. I am using a Python script obtained from converting the IPython Notebook **00-classification.ipynb** for testing the classification by a trained model for ImageNet. But any **get\_ipython()** statement in the script is giving the following error:
```
$ pytho... | 2015/09/12 | [
"https://Stackoverflow.com/questions/32538758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2452617/"
] | You have to run your script with ipython:
```
$ ipython python/my_test_imagenet.py
```
Then `get_ipython` will be already in global context.
Note: Importing it via `from IPython import get_ipython` in ordinary shell `python` will not work as you really need `ipython` running. | Just want to add that converting ipynb file to py having magic functions in your script trigger the same error as well since for instance `%%time` converts to `get_ipython().run_cell_magic('time')`
Why so? [Magic functions](https://ipython.readthedocs.io/en/stable/interactive/python-ipython-diff.html?highlight=magics)... |
32,538,758 | I am working on Caffe framework and using PyCaffe interface. I am using a Python script obtained from converting the IPython Notebook **00-classification.ipynb** for testing the classification by a trained model for ImageNet. But any **get\_ipython()** statement in the script is giving the following error:
```
$ pytho... | 2015/09/12 | [
"https://Stackoverflow.com/questions/32538758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2452617/"
] | If your intention is to run converted .py file notebook then you should just comment out `get_ipython()` statements. The matlibplot output can't be shown inside console so you would have some work to do . Ideally, iPython shouldn't have generated these statements. You can use following to show plots:
```
plt.show(bloc... | `get_ipython` is available only if the IPython module was imported that happens implicitly if you run ipython shell (or Jupyter notebook).
If not, the import will fail, but you can still import it explicitly with:
```
from IPython import get_ipython
``` |
32,538,758 | I am working on Caffe framework and using PyCaffe interface. I am using a Python script obtained from converting the IPython Notebook **00-classification.ipynb** for testing the classification by a trained model for ImageNet. But any **get\_ipython()** statement in the script is giving the following error:
```
$ pytho... | 2015/09/12 | [
"https://Stackoverflow.com/questions/32538758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2452617/"
] | If your intention is to run converted .py file notebook then you should just comment out `get_ipython()` statements. The matlibplot output can't be shown inside console so you would have some work to do . Ideally, iPython shouldn't have generated these statements. You can use following to show plots:
```
plt.show(bloc... | Just want to add that converting ipynb file to py having magic functions in your script trigger the same error as well since for instance `%%time` converts to `get_ipython().run_cell_magic('time')`
Why so? [Magic functions](https://ipython.readthedocs.io/en/stable/interactive/python-ipython-diff.html?highlight=magics)... |
32,538,758 | I am working on Caffe framework and using PyCaffe interface. I am using a Python script obtained from converting the IPython Notebook **00-classification.ipynb** for testing the classification by a trained model for ImageNet. But any **get\_ipython()** statement in the script is giving the following error:
```
$ pytho... | 2015/09/12 | [
"https://Stackoverflow.com/questions/32538758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2452617/"
] | `get_ipython` is available only if the IPython module was imported that happens implicitly if you run ipython shell (or Jupyter notebook).
If not, the import will fail, but you can still import it explicitly with:
```
from IPython import get_ipython
``` | Just want to add that converting ipynb file to py having magic functions in your script trigger the same error as well since for instance `%%time` converts to `get_ipython().run_cell_magic('time')`
Why so? [Magic functions](https://ipython.readthedocs.io/en/stable/interactive/python-ipython-diff.html?highlight=magics)... |
53,037 | Suppose the following problem: I have $n$ models, $M\_k$, each with parameters $\mathbf{\theta}\_k$ for a data set $D$. There where previous observations of a subset of the parameters which are common to every model $M\_k$ (i.e., I have well defined priors for a subset of the parameters $\theta\_k$), so I performed an ... | 2013/03/22 | [
"https://stats.stackexchange.com/questions/53037",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/9174/"
] | Strictly speaking, the question **"to decide which of those models is the 'correct' one"** makes no sense in a Bayesian analysis. In the Bayesian framework, what you do is to compare the models *with respect to each other*. Bayesian inference always gives you a *relative* comparison of competing models. There is a lot ... | BIC and DIC are "Bayesian" tools similar to AIC. A slightly different Bayesian model selection tool is the Log-Predictive Score.
Note that, with exception of the BIC, Bayesian tools are based on the posterior distribution (or the posterior sample) rather than on point estimators. This is common in Bayesian statistics ... |
53,037 | Suppose the following problem: I have $n$ models, $M\_k$, each with parameters $\mathbf{\theta}\_k$ for a data set $D$. There where previous observations of a subset of the parameters which are common to every model $M\_k$ (i.e., I have well defined priors for a subset of the parameters $\theta\_k$), so I performed an ... | 2013/03/22 | [
"https://stats.stackexchange.com/questions/53037",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/9174/"
] | None of these information criteria are unbiased, but under some conditions they are consistent estimators of the out-of-sample deviance. They also all utilize the likelihood in some fashion, but the WAIC and the LOOIC differ from the AIC and the DIC in that the former two average the likelihood for each observation ove... | BIC and DIC are "Bayesian" tools similar to AIC. A slightly different Bayesian model selection tool is the Log-Predictive Score.
Note that, with exception of the BIC, Bayesian tools are based on the posterior distribution (or the posterior sample) rather than on point estimators. This is common in Bayesian statistics ... |
53,037 | Suppose the following problem: I have $n$ models, $M\_k$, each with parameters $\mathbf{\theta}\_k$ for a data set $D$. There where previous observations of a subset of the parameters which are common to every model $M\_k$ (i.e., I have well defined priors for a subset of the parameters $\theta\_k$), so I performed an ... | 2013/03/22 | [
"https://stats.stackexchange.com/questions/53037",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/9174/"
] | Strictly speaking, the question **"to decide which of those models is the 'correct' one"** makes no sense in a Bayesian analysis. In the Bayesian framework, what you do is to compare the models *with respect to each other*. Bayesian inference always gives you a *relative* comparison of competing models. There is a lot ... | Nestor: You seem to be misinterpreting BIC and DIC. They are based on a Bayesian approach. The fact that you observe the likelihood in their expressions is due to an approximation.
>
> The BIC was developed by Gideon E. Schwarz, who gave a Bayesian argument for adopting it.
>
>
> It [DIC] is particularly useful in ... |
53,037 | Suppose the following problem: I have $n$ models, $M\_k$, each with parameters $\mathbf{\theta}\_k$ for a data set $D$. There where previous observations of a subset of the parameters which are common to every model $M\_k$ (i.e., I have well defined priors for a subset of the parameters $\theta\_k$), so I performed an ... | 2013/03/22 | [
"https://stats.stackexchange.com/questions/53037",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/9174/"
] | None of these information criteria are unbiased, but under some conditions they are consistent estimators of the out-of-sample deviance. They also all utilize the likelihood in some fashion, but the WAIC and the LOOIC differ from the AIC and the DIC in that the former two average the likelihood for each observation ove... | Nestor: You seem to be misinterpreting BIC and DIC. They are based on a Bayesian approach. The fact that you observe the likelihood in their expressions is due to an approximation.
>
> The BIC was developed by Gideon E. Schwarz, who gave a Bayesian argument for adopting it.
>
>
> It [DIC] is particularly useful in ... |
53,037 | Suppose the following problem: I have $n$ models, $M\_k$, each with parameters $\mathbf{\theta}\_k$ for a data set $D$. There where previous observations of a subset of the parameters which are common to every model $M\_k$ (i.e., I have well defined priors for a subset of the parameters $\theta\_k$), so I performed an ... | 2013/03/22 | [
"https://stats.stackexchange.com/questions/53037",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/9174/"
] | None of these information criteria are unbiased, but under some conditions they are consistent estimators of the out-of-sample deviance. They also all utilize the likelihood in some fashion, but the WAIC and the LOOIC differ from the AIC and the DIC in that the former two average the likelihood for each observation ove... | Strictly speaking, the question **"to decide which of those models is the 'correct' one"** makes no sense in a Bayesian analysis. In the Bayesian framework, what you do is to compare the models *with respect to each other*. Bayesian inference always gives you a *relative* comparison of competing models. There is a lot ... |
23,320,128 | I'm running a pretty time-consuming method in a thread, and one of the things it does, is if there is no image available it sets a grid named Background's background to a solid color. Here's how that snippet looks:
```
SolidColorBrush scb = new SolidColorBrush();
scb.Color = Color.FromRgb(21, 21, 21);
Dispatcher.Begin... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23320128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2860324/"
] | `SolidColorBrush` is a dependency object - and you're creating it in the non-UI thread, then trying to use it in the UI thread. Try this instead:
```
Action action = () =>
{
SolidColorBrush scb = new SolidColorBrush(Color.FromRgb(21, 21, 21));
Background.Background = scb;
};
Dispatcher.BeginInvoke(action);
``... | A `Brush` is a `DispatcherObject`, and as such it has a thread affinity - it belongs to the thread that created it, and normally can only be used by it.
However, WPF has a sub-class of dispatcher objects, called `Freezable`s, for which you can remove the thread affinity by making them read-only. Brushes are freezable,... |
26,006,385 | I need to keep the overall layout of an object. I pass it into a method and:
1. I need to delete things from the object, then do something,
2. once I get back to the main function I was in
3. I need the object to be UNTOUCHED.
The way it is setup now it deletes it from the main object as well as the one in the bottom... | 2014/09/23 | [
"https://Stackoverflow.com/questions/26006385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2888257/"
] | The [MPVolumeView class](https://developer.apple.com/Library/ios/documentation/MediaPlayer/Reference/MPVolumeView_Class/index.html) is designed to let you do exactly this. It's in MediaPlayer.framework, so add that to your app to make things build correctly.
You create it and make it visible the way you instantiate a... | The process to writing such a slider is incredibly simple, look into `UISlider`(<https://developer.apple.com/library/ios/documentation/UIKit/Reference/UISlider_Class/>) and then use the float value from the slider to set the volume.
If you do not want to write your own slider, look on GitHub([github.com](http://github... |
68,761 | *[Beyond Libertarianism: Interpretations of Mill's Harm Principle and the Economic Implications Therein](https://scholarworks.gsu.edu/cgi/viewcontent.cgi?article=1051&context=political_science_theses#page=26)*
>
> The harm principle does not stipulate strict rights of the individual, applied uniformly.
>
>
> To jus... | 2021/09/14 | [
"https://politics.stackexchange.com/questions/68761",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/39834/"
] | This is where the difference between [intrinsic goals and instrumental goals](https://en.wikipedia.org/wiki/Instrumental_and_intrinsic_value) is important to discuss.
Mill is expressing an intrinsic goal in the Harm Principle, that is, a thing which self-justifies. Any moral philosophy that results in a self-defeating... | In the words of Adam Smith, commonly accepted to be the father of modern Capitalism
>
> "A power to dispose of estates for ever is manifestly absurd. The earth and the fulness of it belongs to every generation, and the preceding one can have no right to bind it up from posterity. Such extension of property is quite u... |
68,761 | *[Beyond Libertarianism: Interpretations of Mill's Harm Principle and the Economic Implications Therein](https://scholarworks.gsu.edu/cgi/viewcontent.cgi?article=1051&context=political_science_theses#page=26)*
>
> The harm principle does not stipulate strict rights of the individual, applied uniformly.
>
>
> To jus... | 2021/09/14 | [
"https://politics.stackexchange.com/questions/68761",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/39834/"
] | This is where the difference between [intrinsic goals and instrumental goals](https://en.wikipedia.org/wiki/Instrumental_and_intrinsic_value) is important to discuss.
Mill is expressing an intrinsic goal in the Harm Principle, that is, a thing which self-justifies. Any moral philosophy that results in a self-defeating... | The text of the 'harm principle', as given in the linked document, reads as follows:
>
> That principle is, that the sole end for which mankind are warranted,
> individually or collectively, in interfering with the liberty of
> action of any of their number is self-protection. That the only
> purpose for which power ... |
40,636,021 | Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).
I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller an... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849837/"
] | There is a way to find out why pods were deleted and who deleted them.
The only way to find out something is to set the `ttl` for k8s to be greater than the default 1h and search through the events:
`kubectl get event -o custom-columns=NAME:.metadata.name | cut -d "." -f1` | ```
kubectl get pods -a
```
you will get the list of running pods and the terminated pods in case you are searching for this |
40,636,021 | Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).
I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller an... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849837/"
] | You can try `kubectl logs --previous` to list the logs of a previously stopped pod
<http://kubernetes.io/docs/user-guide/kubectl/kubectl_logs/>
You may also want to check out these debugging tips
<http://kubernetes.io/docs/user-guide/debugging-pods-and-replication-controllers/> | There is a way to find out why pods were deleted and who deleted them.
The only way to find out something is to set the `ttl` for k8s to be greater than the default 1h and search through the events:
`kubectl get event -o custom-columns=NAME:.metadata.name | cut -d "." -f1` |
40,636,021 | Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).
I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller an... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849837/"
] | As of today, `kubectl get pods -a` is deprecated, and as a result you cannot get deleted pods.
What you can do though, is to get a list of recently deleted pod names - up to 1 hour in the past unless you changed the `ttl` for kubernetes events - by running:
`kubectl get event -o custom-columns=NAME:.metadata.name | c... | If you want to see all the previously deleted `pods` and you are trying to fetch the previous `pods`.
Command line:
`kubectl get pods`
in which you will get all the pod details, because every service has one or more pods and they have unique ip address
Here you can check the lifecycle of pods and what phases of pod... |
40,636,021 | Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).
I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller an... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849837/"
] | As of today, `kubectl get pods -a` is deprecated, and as a result you cannot get deleted pods.
What you can do though, is to get a list of recently deleted pod names - up to 1 hour in the past unless you changed the `ttl` for kubernetes events - by running:
`kubectl get event -o custom-columns=NAME:.metadata.name | c... | If your container has previously crashed, you can access the previous container’s crash log with:
kubectl logs --previous ${POD\_NAME} ${CONTAINER\_NAME} |
40,636,021 | Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).
I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller an... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849837/"
] | As of today, `kubectl get pods -a` is deprecated, and as a result you cannot get deleted pods.
What you can do though, is to get a list of recently deleted pod names - up to 1 hour in the past unless you changed the `ttl` for kubernetes events - by running:
`kubectl get event -o custom-columns=NAME:.metadata.name | c... | There is a way to find out why pods were deleted and who deleted them.
The only way to find out something is to set the `ttl` for k8s to be greater than the default 1h and search through the events:
`kubectl get event -o custom-columns=NAME:.metadata.name | cut -d "." -f1` |
40,636,021 | Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).
I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller an... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849837/"
] | There is a way to find out why pods were deleted and who deleted them.
The only way to find out something is to set the `ttl` for k8s to be greater than the default 1h and search through the events:
`kubectl get event -o custom-columns=NAME:.metadata.name | cut -d "." -f1` | If you want to see all the previously deleted `pods` and you are trying to fetch the previous `pods`.
Command line:
`kubectl get pods`
in which you will get all the pod details, because every service has one or more pods and they have unique ip address
Here you can check the lifecycle of pods and what phases of pod... |
40,636,021 | Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).
I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller an... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849837/"
] | There is a way to find out why pods were deleted and who deleted them.
The only way to find out something is to set the `ttl` for k8s to be greater than the default 1h and search through the events:
`kubectl get event -o custom-columns=NAME:.metadata.name | cut -d "." -f1` | If your container has previously crashed, you can access the previous container’s crash log with:
kubectl logs --previous ${POD\_NAME} ${CONTAINER\_NAME} |
40,636,021 | Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).
I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller an... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849837/"
] | as far as i know you may not get the pod details once the pod is deleted. can i know what is the usecase?
example:
1. if a pod created using - kubectl run busybox-test-pod-status --image=busybox --restart=Never -- /bin/false
you will have a pod with status termiated:error
2. if a pod is created using - kubectl run b... | ```
kubectl get pods -a
```
you will get the list of running pods and the terminated pods in case you are searching for this |
40,636,021 | Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).
I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller an... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849837/"
] | As of today, `kubectl get pods -a` is deprecated, and as a result you cannot get deleted pods.
What you can do though, is to get a list of recently deleted pod names - up to 1 hour in the past unless you changed the `ttl` for kubernetes events - by running:
`kubectl get event -o custom-columns=NAME:.metadata.name | c... | You can try `kubectl logs --previous` to list the logs of a previously stopped pod
<http://kubernetes.io/docs/user-guide/kubectl/kubectl_logs/>
You may also want to check out these debugging tips
<http://kubernetes.io/docs/user-guide/debugging-pods-and-replication-controllers/> |
40,636,021 | Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).
I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller an... | 2016/11/16 | [
"https://Stackoverflow.com/questions/40636021",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1849837/"
] | You can try `kubectl logs --previous` to list the logs of a previously stopped pod
<http://kubernetes.io/docs/user-guide/kubectl/kubectl_logs/>
You may also want to check out these debugging tips
<http://kubernetes.io/docs/user-guide/debugging-pods-and-replication-controllers/> | ```
kubectl get pods -a
```
you will get the list of running pods and the terminated pods in case you are searching for this |
31,161,509 | Client will fetch json formatted data from server:
```
{"html": "<hr>a<br>"}
```
And I want to render the html code into a div. How can I do that?
And in fact, I want to display the rendered html page inside a wysiwyg editor.
Is there any Opensource wysiwyg(js, html5, or sth) can do this? | 2015/07/01 | [
"https://Stackoverflow.com/questions/31161509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2038901/"
] | The problem is not in the ng-repeat. It is correct based on your data structure. I would change the approach to the way you're adding data to your cart. Presently, you're pushing all of the "item" sizes to the cart regardless if the user selects that particular size of item or not and you're just using ng-class to hide... | Your HTML
```
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit"
alt="Make payments with PayPal - it's fast, free and secure!">
```
Replace it with :
```
<input type="submit" style="background:url(http://www.paypal.com/en_US/i/btn/x-click-but01.gif); width:100px;... |
175,794 | I've heard and read enough programmers firmly advocating automatic tests. According to many, tests are themselves part of a code's functionality, untested code is broken and/or legacy by definition, long-term manual testing is more time-consuming and provides far weaker guarantees against failures than automatic testin... | 2019/09/25 | [
"https://gamedev.stackexchange.com/questions/175794",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/101389/"
] | Testing is an investment in your future. While an individual test might duplicate some aspect of manual testing you are about to do in any given run of the game, a robust suite of tests can in the long run cover far more scenarios than that small bit of overlapping work (manual testing can also more effectively test mo... | First off, 100% test coverage is not a realistic goal, and games especially tend to incorporate elements that are difficult to test reliably, for example when aspects like timing, physics or (nontrivial) AI become involved. In addition, automated tests are neither infallible nor by definition superior to manual testing... |
175,794 | I've heard and read enough programmers firmly advocating automatic tests. According to many, tests are themselves part of a code's functionality, untested code is broken and/or legacy by definition, long-term manual testing is more time-consuming and provides far weaker guarantees against failures than automatic testin... | 2019/09/25 | [
"https://gamedev.stackexchange.com/questions/175794",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/101389/"
] | Testing is an investment in your future. While an individual test might duplicate some aspect of manual testing you are about to do in any given run of the game, a robust suite of tests can in the long run cover far more scenarios than that small bit of overlapping work (manual testing can also more effectively test mo... | >
> Problem is I'll have to anyway boot my game and play it! To see if it feels right, if it plays right, if not for anything else.
>
>
>
Yes, you need to do that while you are iterating on that specific situation you are implementing right now. But think ahead a couple years in the future. You might be working on... |
74,994 | I was trying to understand how the following reaction occurs (taken from a synthesis of homopipecolic acid[1]):

I thought that triethylsilane, $\ce{Et3SiH}$, would reduce the ester to an aldehyde. Howev... | 2017/05/23 | [
"https://chemistry.stackexchange.com/questions/74994",
"https://chemistry.stackexchange.com",
"https://chemistry.stackexchange.com/users/17541/"
] | My organic chemistry is rusty by now, but the full mechanism for the reduction itself is likely something along these lines:
[](https://i.stack.imgur.com/LcoaW.png)
In a "typical" lactone / ester, the alkyl oxygen can't be lost so easi... | This is what I came up with.
The starting material first reacts with the Lewis acid - $\ce{BF\_3}$-etherate. There are two sites which can attack the acid - the carbonyl of the ester, or the carbonyl of the amide in the protecting group. Considering the first step to be kinetically controlled (which it generally is), ... |
69,367,375 | I want to use do notation to combine pseudo-random values:
```
g :: StdGen
g = mkStdGen 100
example1 :: Bool
example1
= fst
$ runState
(do x <- state (uniformR (False,True))
y <- state (uniformR (False,True))
return $ x == y
)
g
```
Function `uniformR` is defined in terms of the Syst... | 2021/09/28 | [
"https://Stackoverflow.com/questions/69367375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1264328/"
] | It is much simpler than one would imagine:
```hs
example4 :: Bool
example4 = runStateGen_ (mkStdGen 100) $ \gen -> do
x <- uniformRM (False,True) gen
y <- uniformRM (False,True) gen
pure (x == y)
```
Of course `uniformRM (False, True) == unformM`, but that is probably irrelevant, since that was just an example... | The second argument to `runStateGen` is `StateGenM g -> State g a`, which is `ReaderT` in disguise:
```
import Control.Monad.Reader (ReaderT(..), runReaderT)
import Control.Applicative (liftA2)
import qualified System.Random.Stateful as Random
uniformRM :: (Random.UniformRange a, Random.StatefulGen g m) => (a, a) -> ... |
9,306,045 | The default action to expand a node on ExtJS tree is double-click.
Before version 4, there is `singleClickExpand` property in TreeNode configuration.
How to apply `singleClickExpand` behavior on ExtJS version 4 tree ??
Is there a configuration property for this behavior without setting event listener??
Thank you. | 2012/02/16 | [
"https://Stackoverflow.com/questions/9306045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560305/"
] | I've spent some time looking for the same thing. I feel I can definitively answer your question with...
No there isn't a config option for it.
I had to set a click handler. I needed one anyway though to implement functionality for leaf clicks:
```
var tree = Ext.create('Ext.tree.Panel', {
store: store,
rootV... | If you're using keyboard navigation, you probably need to use the selectionChange event so that you cover all the scenarios, but anyway, here's an approach i'm using in my case to achieve the singleClick thingy.
define a new event in the tree, for instance imagine you have defined a class which inherits from the treep... |
9,306,045 | The default action to expand a node on ExtJS tree is double-click.
Before version 4, there is `singleClickExpand` property in TreeNode configuration.
How to apply `singleClickExpand` behavior on ExtJS version 4 tree ??
Is there a configuration property for this behavior without setting event listener??
Thank you. | 2012/02/16 | [
"https://Stackoverflow.com/questions/9306045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560305/"
] | I've spent some time looking for the same thing. I feel I can definitively answer your question with...
No there isn't a config option for it.
I had to set a click handler. I needed one anyway though to implement functionality for leaf clicks:
```
var tree = Ext.create('Ext.tree.Panel', {
store: store,
rootV... | In fact you use the expand function of the treeview.
Just implement the itemclick function on you treepanel:
```
listeners: {
itemclick: function (treeview, record, item, index, e, eOpts) {
treeview.expand(record);
}
}
``` |
58,525 | **Is there any evidence which shows whether users are more able to recognise another user's Photo over their Username or vice versa?**
I am interested in understanding this from a usability perspective.
Lets say on a site such as this network, a user has both a username as well as a photo/avatar.
* On *Sci-Fi.se* [D... | 2014/06/06 | [
"https://ux.stackexchange.com/questions/58525",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4430/"
] | Remember or recall words or images is highly individual and depends on which hemisphere of the brain is dominant. My right half of the brain is slightly more dominant than the left, which makes me remember a face rather than the name. Sometimes I'm embarrassed when meeting people on the street and I recognize the perso... | As most people have said, it depends on the user.
For me personally it depends entirely on the context.
* On forums I'm heavily dependant on usernames for identifying people. I tend to remember people by their usernames on forums (and here). I think this is because forum users tend to use avatars detached from their ... |
58,525 | **Is there any evidence which shows whether users are more able to recognise another user's Photo over their Username or vice versa?**
I am interested in understanding this from a usability perspective.
Lets say on a site such as this network, a user has both a username as well as a photo/avatar.
* On *Sci-Fi.se* [D... | 2014/06/06 | [
"https://ux.stackexchange.com/questions/58525",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4430/"
] | To the other questions I would add accessibility concerns. For many with poor sight a username is much more easily used either by using zoomed text or some for of text reading. Even for those who don't need screen enhancements (e.g. me) avatars can be hard to tell apart e.g. Twitter and using pictures, may are difficul... | Certain avatar images are very memorable and distinct. Some are almost indistinguishable. Likewise with user names. Someone who was asked to remember the username of "Jon Skeet" and was asked a day later later to identify it from a list of the ten most similar usernames might have a good chance at identifying it, while... |
58,525 | **Is there any evidence which shows whether users are more able to recognise another user's Photo over their Username or vice versa?**
I am interested in understanding this from a usability perspective.
Lets say on a site such as this network, a user has both a username as well as a photo/avatar.
* On *Sci-Fi.se* [D... | 2014/06/06 | [
"https://ux.stackexchange.com/questions/58525",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4430/"
] | It depends not only on person, but also on service.
if you need to type username often ( or see it in your message ) then username is more memorable ( twitter )
Making avatar very small also prevent avatar to recognition.
Some services might allow to use not only latin letters in the username which make them weird
... | Although it is not exactly about avatar and user name, there is a research paper about distinctive file icons called [VisualIDs: Automatic Distinctive Icons for Desktop Interfaces](http://scribblethink.org/Work/VisualIDs/visualids.html) in SIGGRAPH 2004. Visual distinctiveness is unsurprisingly useful for both short te... |
58,525 | **Is there any evidence which shows whether users are more able to recognise another user's Photo over their Username or vice versa?**
I am interested in understanding this from a usability perspective.
Lets say on a site such as this network, a user has both a username as well as a photo/avatar.
* On *Sci-Fi.se* [D... | 2014/06/06 | [
"https://ux.stackexchange.com/questions/58525",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4430/"
] | Standard reminder: Graphics are often of little or no use to folks who are reading the screen through assistive technology. The simplest answer -- as here in Stack Exchange -- is to display *both*. | Although it is not exactly about avatar and user name, there is a research paper about distinctive file icons called [VisualIDs: Automatic Distinctive Icons for Desktop Interfaces](http://scribblethink.org/Work/VisualIDs/visualids.html) in SIGGRAPH 2004. Visual distinctiveness is unsurprisingly useful for both short te... |
58,525 | **Is there any evidence which shows whether users are more able to recognise another user's Photo over their Username or vice versa?**
I am interested in understanding this from a usability perspective.
Lets say on a site such as this network, a user has both a username as well as a photo/avatar.
* On *Sci-Fi.se* [D... | 2014/06/06 | [
"https://ux.stackexchange.com/questions/58525",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4430/"
] | Some people have a great memory for words, other people a great memory for faces. Some have both or neither.
Some avatars can be completely generic and difficult to remember, such as Gravatar's autogenerated avatars.

Others can be very unique and m... | Standard reminder: Graphics are often of little or no use to folks who are reading the screen through assistive technology. The simplest answer -- as here in Stack Exchange -- is to display *both*. |
58,525 | **Is there any evidence which shows whether users are more able to recognise another user's Photo over their Username or vice versa?**
I am interested in understanding this from a usability perspective.
Lets say on a site such as this network, a user has both a username as well as a photo/avatar.
* On *Sci-Fi.se* [D... | 2014/06/06 | [
"https://ux.stackexchange.com/questions/58525",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4430/"
] | As most people have said, it depends on the user.
For me personally it depends entirely on the context.
* On forums I'm heavily dependant on usernames for identifying people. I tend to remember people by their usernames on forums (and here). I think this is because forum users tend to use avatars detached from their ... | Although it is not exactly about avatar and user name, there is a research paper about distinctive file icons called [VisualIDs: Automatic Distinctive Icons for Desktop Interfaces](http://scribblethink.org/Work/VisualIDs/visualids.html) in SIGGRAPH 2004. Visual distinctiveness is unsurprisingly useful for both short te... |
58,525 | **Is there any evidence which shows whether users are more able to recognise another user's Photo over their Username or vice versa?**
I am interested in understanding this from a usability perspective.
Lets say on a site such as this network, a user has both a username as well as a photo/avatar.
* On *Sci-Fi.se* [D... | 2014/06/06 | [
"https://ux.stackexchange.com/questions/58525",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4430/"
] | It depends on the person.
A bit of an extreme example, but a dyslexic for example might struggle telling apart John Skeet and Jonno Teeks, whereas a color-blind person might not be able to tell two people apart that have combinations of certain colors in their avatar.
In general though, avatars tend to offer a wider ... | It depends not only on person, but also on service.
if you need to type username often ( or see it in your message ) then username is more memorable ( twitter )
Making avatar very small also prevent avatar to recognition.
Some services might allow to use not only latin letters in the username which make them weird
... |
58,525 | **Is there any evidence which shows whether users are more able to recognise another user's Photo over their Username or vice versa?**
I am interested in understanding this from a usability perspective.
Lets say on a site such as this network, a user has both a username as well as a photo/avatar.
* On *Sci-Fi.se* [D... | 2014/06/06 | [
"https://ux.stackexchange.com/questions/58525",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4430/"
] | It depends on the person.
A bit of an extreme example, but a dyslexic for example might struggle telling apart John Skeet and Jonno Teeks, whereas a color-blind person might not be able to tell two people apart that have combinations of certain colors in their avatar.
In general though, avatars tend to offer a wider ... | If it's only about recognizable or memorable, then it's avatar.
[Wikipedia page of Avatar](http://en.wikipedia.org/wiki/Avatar_%28computing%29) stated this (too bad no research or article backed this up)
>
> ...the avatar is placed in order for other users to easily identify who has written the post without having t... |
58,525 | **Is there any evidence which shows whether users are more able to recognise another user's Photo over their Username or vice versa?**
I am interested in understanding this from a usability perspective.
Lets say on a site such as this network, a user has both a username as well as a photo/avatar.
* On *Sci-Fi.se* [D... | 2014/06/06 | [
"https://ux.stackexchange.com/questions/58525",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4430/"
] | Some people have a great memory for words, other people a great memory for faces. Some have both or neither.
Some avatars can be completely generic and difficult to remember, such as Gravatar's autogenerated avatars.

Others can be very unique and m... | If it's only about recognizable or memorable, then it's avatar.
[Wikipedia page of Avatar](http://en.wikipedia.org/wiki/Avatar_%28computing%29) stated this (too bad no research or article backed this up)
>
> ...the avatar is placed in order for other users to easily identify who has written the post without having t... |
58,525 | **Is there any evidence which shows whether users are more able to recognise another user's Photo over their Username or vice versa?**
I am interested in understanding this from a usability perspective.
Lets say on a site such as this network, a user has both a username as well as a photo/avatar.
* On *Sci-Fi.se* [D... | 2014/06/06 | [
"https://ux.stackexchange.com/questions/58525",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/4430/"
] | It depends not only on person, but also on service.
if you need to type username often ( or see it in your message ) then username is more memorable ( twitter )
Making avatar very small also prevent avatar to recognition.
Some services might allow to use not only latin letters in the username which make them weird
... | Certain avatar images are very memorable and distinct. Some are almost indistinguishable. Likewise with user names. Someone who was asked to remember the username of "Jon Skeet" and was asked a day later later to identify it from a list of the ten most similar usernames might have a good chance at identifying it, while... |
9,849,475 | I would like to select a value from a database table or its inverse with only one SQL Request.
I previoulsy posted a question, but now I have more specifications, which change the problem.
My table fields are : `id, rate, from_value, to_value, date_modified`
This is the pseudo-code I would like to do with only one r... | 2012/03/24 | [
"https://Stackoverflow.com/questions/9849475",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1288927/"
] | Looks like a simple [CASE](http://dev.mysql.com/doc/refman/5.5/en/case-statement.html) will do the trick:
```
select
case
when from_value = $from_value and to_value = $to_value then rate
when from_value = $to_value and to_value = $from_value then 1 / rate
end
...
```
You might want an ELS... | haven't tried this out, but you can use an IF construct as follows
```
SELECT if from_value = $from_value and to_value = $to_value then rate else 1/rate end as rate from tablename
``` |
27,205,874 | I decided to create my own `SortableDictionary` struct in Swift, building it in the Xcode playground so I could test it as I went. `SortableDictionary` works by taking a dictionary and a sort function and using the sort function to create a sorted array of keys from the dictionary. It can sort by dictionary keys or by ... | 2014/11/29 | [
"https://Stackoverflow.com/questions/27205874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4307013/"
] | I would suggest a *structure* (i.e. a `struct` or a `class`) for the top level, have a `std::map` of those top-level structure. Then each structure in turn contains a `std::map` for the contained symbols, again with a structure that contains, among other things, the type of the symbol.
Something as simple as this:
``... | Here it is!
If you accept an advice, start reading the main function instead of the types on the top.
I didn't need multimap. Instead of copying the parent block's variables, I only reference the parent container with its index. Just before printing there is a traversal to the top-most block, and it collects all the ... |
48,835,065 | The question seems to be pretty easy, but I haven't found solution myself.
I have some folder, with 1 jpg-file inside it (foo bar.jpg) and this bat-file:
```
for /f %%f in ('dir /b /a:-d "*.jpg"') do echo "%%f"
pause
```
For some reason instead of something like this:
```
C:\Test>echo foo bar.jpg
foo bar.jpg
```
... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48835065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5587480/"
] | Cypress automatically sends the cookie named "csrftoken" with the request, but Django expects the csrf token to be called "csrfmiddlewaretoken". Therefore, I had to get the token and pass it by hand as follows:
```
cy.getCookie('csrftoken')
.then((csrftoken) => {
cy.request({
method: 'POST'... | You are correct, Cypress is not sending the token in the body because it is `undefined`, because of the way you are using `.get()` on the `input` to get the token.
You are using `.get()` as a *synchronous* call, but it's actually **async**. This is because Cypress will intelligently retry finding the DOM element, and ... |
48,835,065 | The question seems to be pretty easy, but I haven't found solution myself.
I have some folder, with 1 jpg-file inside it (foo bar.jpg) and this bat-file:
```
for /f %%f in ('dir /b /a:-d "*.jpg"') do echo "%%f"
pause
```
For some reason instead of something like this:
```
C:\Test>echo foo bar.jpg
foo bar.jpg
```
... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48835065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5587480/"
] | You can get the first CSRF token required for login using a `HEAD` request and looking at the cookies (no need to parse the page).
Also you can have your custom `cy.login()` return the token (asynchronously, so you need to use `.then()`) instead of having to call `cy.getCookie('csrftoken')` again if you need a token a... | You are correct, Cypress is not sending the token in the body because it is `undefined`, because of the way you are using `.get()` on the `input` to get the token.
You are using `.get()` as a *synchronous* call, but it's actually **async**. This is because Cypress will intelligently retry finding the DOM element, and ... |
48,835,065 | The question seems to be pretty easy, but I haven't found solution myself.
I have some folder, with 1 jpg-file inside it (foo bar.jpg) and this bat-file:
```
for /f %%f in ('dir /b /a:-d "*.jpg"') do echo "%%f"
pause
```
For some reason instead of something like this:
```
C:\Test>echo foo bar.jpg
foo bar.jpg
```
... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48835065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5587480/"
] | To use Cypress to login programmatically with Django (i.e., without using the UI), the simplest solution is to change two words in the CSRF testing recipe that Cypress provides.
The two changes that I made in the below compared to the Cypress recipe at <https://github.com/cypress-io/cypress-example-recipes/blob/master... | You are correct, Cypress is not sending the token in the body because it is `undefined`, because of the way you are using `.get()` on the `input` to get the token.
You are using `.get()` as a *synchronous* call, but it's actually **async**. This is because Cypress will intelligently retry finding the DOM element, and ... |
48,835,065 | The question seems to be pretty easy, but I haven't found solution myself.
I have some folder, with 1 jpg-file inside it (foo bar.jpg) and this bat-file:
```
for /f %%f in ('dir /b /a:-d "*.jpg"') do echo "%%f"
pause
```
For some reason instead of something like this:
```
C:\Test>echo foo bar.jpg
foo bar.jpg
```
... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48835065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5587480/"
] | According to the documentation
>
> In addition, for HTTPS requests, strict referer checking is done by CsrfViewMiddleware. This means that even if a subdomain can set or modify cookies on your domain, it can’t force a user to post to your application since that request won’t come from your own exact domain.
>
>
>
... | You are correct, Cypress is not sending the token in the body because it is `undefined`, because of the way you are using `.get()` on the `input` to get the token.
You are using `.get()` as a *synchronous* call, but it's actually **async**. This is because Cypress will intelligently retry finding the DOM element, and ... |
48,835,065 | The question seems to be pretty easy, but I haven't found solution myself.
I have some folder, with 1 jpg-file inside it (foo bar.jpg) and this bat-file:
```
for /f %%f in ('dir /b /a:-d "*.jpg"') do echo "%%f"
pause
```
For some reason instead of something like this:
```
C:\Test>echo foo bar.jpg
foo bar.jpg
```
... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48835065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5587480/"
] | You can get the first CSRF token required for login using a `HEAD` request and looking at the cookies (no need to parse the page).
Also you can have your custom `cy.login()` return the token (asynchronously, so you need to use `.then()`) instead of having to call `cy.getCookie('csrftoken')` again if you need a token a... | Cypress automatically sends the cookie named "csrftoken" with the request, but Django expects the csrf token to be called "csrfmiddlewaretoken". Therefore, I had to get the token and pass it by hand as follows:
```
cy.getCookie('csrftoken')
.then((csrftoken) => {
cy.request({
method: 'POST'... |
48,835,065 | The question seems to be pretty easy, but I haven't found solution myself.
I have some folder, with 1 jpg-file inside it (foo bar.jpg) and this bat-file:
```
for /f %%f in ('dir /b /a:-d "*.jpg"') do echo "%%f"
pause
```
For some reason instead of something like this:
```
C:\Test>echo foo bar.jpg
foo bar.jpg
```
... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48835065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5587480/"
] | You can get the first CSRF token required for login using a `HEAD` request and looking at the cookies (no need to parse the page).
Also you can have your custom `cy.login()` return the token (asynchronously, so you need to use `.then()`) instead of having to call `cy.getCookie('csrftoken')` again if you need a token a... | To use Cypress to login programmatically with Django (i.e., without using the UI), the simplest solution is to change two words in the CSRF testing recipe that Cypress provides.
The two changes that I made in the below compared to the Cypress recipe at <https://github.com/cypress-io/cypress-example-recipes/blob/master... |
48,835,065 | The question seems to be pretty easy, but I haven't found solution myself.
I have some folder, with 1 jpg-file inside it (foo bar.jpg) and this bat-file:
```
for /f %%f in ('dir /b /a:-d "*.jpg"') do echo "%%f"
pause
```
For some reason instead of something like this:
```
C:\Test>echo foo bar.jpg
foo bar.jpg
```
... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48835065",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5587480/"
] | You can get the first CSRF token required for login using a `HEAD` request and looking at the cookies (no need to parse the page).
Also you can have your custom `cy.login()` return the token (asynchronously, so you need to use `.then()`) instead of having to call `cy.getCookie('csrftoken')` again if you need a token a... | According to the documentation
>
> In addition, for HTTPS requests, strict referer checking is done by CsrfViewMiddleware. This means that even if a subdomain can set or modify cookies on your domain, it can’t force a user to post to your application since that request won’t come from your own exact domain.
>
>
>
... |
60,558 | I had my first session as Dungeon Master (DM) yesterday playing pathfinder ("First Steps In Lore" from the "Pathfinder Society" series) with a group of first-time tabletop RPG players (myself included). Overall the sessions went well, a good crash course for everyone and everyone seemed to enjoy themselves.
My questio... | 2015/05/04 | [
"https://rpg.stackexchange.com/questions/60558",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/22662/"
] | have the players roll a bunch of perception rolls at the beginning, list them all and cross them off as you go, they know the rolled them, but have no idea if they see nothing because of a bad roll, or if there is truely nothing to see. | Perception rolls, like Stealth rolls, should be rolled by the GM out of sight of the players. The players should not know if they rolled high or low, just what they find. |
60,558 | I had my first session as Dungeon Master (DM) yesterday playing pathfinder ("First Steps In Lore" from the "Pathfinder Society" series) with a group of first-time tabletop RPG players (myself included). Overall the sessions went well, a good crash course for everyone and everyone seemed to enjoy themselves.
My questio... | 2015/05/04 | [
"https://rpg.stackexchange.com/questions/60558",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/22662/"
] | When I GM, there are generally four ways a perception check plays out.
1) There is something to be discovered. If I know that there is a trap or an ambush in the room, then the player's might spot that thing. Depending on the amount of success on the perception roll, the player's may get different levels of informatio... | I would say, allow a character an opportunity to roll a perception check...
And treat it as a "Gut feeling" type of thing about a room. If, they want to go in more depth into a room, treat it as a Search attempt (X amount of time at a DC of Y) and do the whole DM trick of secretly rolling for random encounters or dual ... |
60,558 | I had my first session as Dungeon Master (DM) yesterday playing pathfinder ("First Steps In Lore" from the "Pathfinder Society" series) with a group of first-time tabletop RPG players (myself included). Overall the sessions went well, a good crash course for everyone and everyone seemed to enjoy themselves.
My questio... | 2015/05/04 | [
"https://rpg.stackexchange.com/questions/60558",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/22662/"
] | We assume that players are by default going around being perceptive at an ordinary level. If there's an interesting detail that might escape the players' notice, the DM will call for the relevant characters (maybe everyone, maybe the guy in front, maybe the characters with darkvision, etc...) to make a perception check... | Perception rolls, like Stealth rolls, should be rolled by the GM out of sight of the players. The players should not know if they rolled high or low, just what they find. |
60,558 | I had my first session as Dungeon Master (DM) yesterday playing pathfinder ("First Steps In Lore" from the "Pathfinder Society" series) with a group of first-time tabletop RPG players (myself included). Overall the sessions went well, a good crash course for everyone and everyone seemed to enjoy themselves.
My questio... | 2015/05/04 | [
"https://rpg.stackexchange.com/questions/60558",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/22662/"
] | So, what's the downside of saying, "nope, you find nothing"?
You're committed to letting players make their own rolls (which is perfectly fine, though not everyone plays that way), so they already know that they hit a DC of 23 or less (or whatever). There is no need to punish yourself or them by pretending otherwise.
... | have the players roll a bunch of perception rolls at the beginning, list them all and cross them off as you go, they know the rolled them, but have no idea if they see nothing because of a bad roll, or if there is truely nothing to see. |
60,558 | I had my first session as Dungeon Master (DM) yesterday playing pathfinder ("First Steps In Lore" from the "Pathfinder Society" series) with a group of first-time tabletop RPG players (myself included). Overall the sessions went well, a good crash course for everyone and everyone seemed to enjoy themselves.
My questio... | 2015/05/04 | [
"https://rpg.stackexchange.com/questions/60558",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/22662/"
] | **There is ALWAYS something to be found!**\* *What* the players find, of course, may not be at all relevant or useful to the story or to the characters' progress.
But in fact, a high roll when searching or observing an area is a great chance to use some creativity to both enhance the overall experience, **and also to ... | have the players roll a bunch of perception rolls at the beginning, list them all and cross them off as you go, they know the rolled them, but have no idea if they see nothing because of a bad roll, or if there is truely nothing to see. |
60,558 | I had my first session as Dungeon Master (DM) yesterday playing pathfinder ("First Steps In Lore" from the "Pathfinder Society" series) with a group of first-time tabletop RPG players (myself included). Overall the sessions went well, a good crash course for everyone and everyone seemed to enjoy themselves.
My questio... | 2015/05/04 | [
"https://rpg.stackexchange.com/questions/60558",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/22662/"
] | **There is ALWAYS something to be found!**\* *What* the players find, of course, may not be at all relevant or useful to the story or to the characters' progress.
But in fact, a high roll when searching or observing an area is a great chance to use some creativity to both enhance the overall experience, **and also to ... | We assume that players are by default going around being perceptive at an ordinary level. If there's an interesting detail that might escape the players' notice, the DM will call for the relevant characters (maybe everyone, maybe the guy in front, maybe the characters with darkvision, etc...) to make a perception check... |
60,558 | I had my first session as Dungeon Master (DM) yesterday playing pathfinder ("First Steps In Lore" from the "Pathfinder Society" series) with a group of first-time tabletop RPG players (myself included). Overall the sessions went well, a good crash course for everyone and everyone seemed to enjoy themselves.
My questio... | 2015/05/04 | [
"https://rpg.stackexchange.com/questions/60558",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/22662/"
] | have the players roll a bunch of perception rolls at the beginning, list them all and cross them off as you go, they know the rolled them, but have no idea if they see nothing because of a bad roll, or if there is truely nothing to see. | If they fail, make them perceive something wrong. A misperception can happen anytime, specially if they're really looking for something. Characters can misinterpret, misunderstand and become very obsessed with something so they can be completely wrong about something. This will get them in trouble and give you plenty o... |
60,558 | I had my first session as Dungeon Master (DM) yesterday playing pathfinder ("First Steps In Lore" from the "Pathfinder Society" series) with a group of first-time tabletop RPG players (myself included). Overall the sessions went well, a good crash course for everyone and everyone seemed to enjoy themselves.
My questio... | 2015/05/04 | [
"https://rpg.stackexchange.com/questions/60558",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/22662/"
] | We assume that players are by default going around being perceptive at an ordinary level. If there's an interesting detail that might escape the players' notice, the DM will call for the relevant characters (maybe everyone, maybe the guy in front, maybe the characters with darkvision, etc...) to make a perception check... | I would say, allow a character an opportunity to roll a perception check...
And treat it as a "Gut feeling" type of thing about a room. If, they want to go in more depth into a room, treat it as a Search attempt (X amount of time at a DC of Y) and do the whole DM trick of secretly rolling for random encounters or dual ... |
60,558 | I had my first session as Dungeon Master (DM) yesterday playing pathfinder ("First Steps In Lore" from the "Pathfinder Society" series) with a group of first-time tabletop RPG players (myself included). Overall the sessions went well, a good crash course for everyone and everyone seemed to enjoy themselves.
My questio... | 2015/05/04 | [
"https://rpg.stackexchange.com/questions/60558",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/22662/"
] | have the players roll a bunch of perception rolls at the beginning, list them all and cross them off as you go, they know the rolled them, but have no idea if they see nothing because of a bad roll, or if there is truely nothing to see. | The situation should be handled exactly as if there were something interesting to find but they did not meet the DC for finding it. That is effectively what happened, just in this case the DC is infinite as there is nothing to be found.
Explicitly telling the players that there is nothing to be found should be avoide... |
60,558 | I had my first session as Dungeon Master (DM) yesterday playing pathfinder ("First Steps In Lore" from the "Pathfinder Society" series) with a group of first-time tabletop RPG players (myself included). Overall the sessions went well, a good crash course for everyone and everyone seemed to enjoy themselves.
My questio... | 2015/05/04 | [
"https://rpg.stackexchange.com/questions/60558",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/22662/"
] | We assume that players are by default going around being perceptive at an ordinary level. If there's an interesting detail that might escape the players' notice, the DM will call for the relevant characters (maybe everyone, maybe the guy in front, maybe the characters with darkvision, etc...) to make a perception check... | have the players roll a bunch of perception rolls at the beginning, list them all and cross them off as you go, they know the rolled them, but have no idea if they see nothing because of a bad roll, or if there is truely nothing to see. |
11,705,339 | I have a UITableView in another view. I want to make the height of the UITabeView constant. I have variable number of rows, but I want the height of the UITableView constant so that it does not hide the views below it when the rows increase. how do I do this? I tried setting the autoresizingmask but that did not help. ... | 2012/07/28 | [
"https://Stackoverflow.com/questions/11705339",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1415788/"
] | [EPyLEpSY](https://stackoverflow.com/users/1039901/epylepsy) is correct.
```
CGRect tbFrame = [myTableView frame];
tbFrame.size.height = 100;
[myTableView setFrame:tbFrame];
``` | you can use the method:
```
- (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
```
and initialize the frame with the width and height you want.
The style can be one of the following options:
UITableViewStylePlain
UITableViewStyleGrouped
I recommend reviewing [UITableView class reference](http://devel... |
62,281,484 | First, I am finding an average of some data, and then formatting that average into to decimal points.
And in the end, I want to use rollup to generate a total row for all columns.
The problem is: I want the rollup to sum the data as they appear, however, when adding up the average it is not adding them as the way they... | 2020/06/09 | [
"https://Stackoverflow.com/questions/62281484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13563566/"
] | your column 'time' is of dtype `timedelta` as the error tells you; you could use the `total_seconds()` method to convert to seconds and divide by 60 to get the minutes.
If you want a full-featured datetime column, combine 'date' and 'time'. Then you can use `.dt.minute`.
**Ex:**
```
import pandas as pd
df = pd.DataF... | If you have not converted to a datetime dataframe do that first
then you create a new column like this
```
df['minute'] = df['date'].dt.minute
```
or this method here
```
df[new]= df[column].map(lambda x: datetime.datetime(x.minutes))
``` |
62,281,484 | First, I am finding an average of some data, and then formatting that average into to decimal points.
And in the end, I want to use rollup to generate a total row for all columns.
The problem is: I want the rollup to sum the data as they appear, however, when adding up the average it is not adding them as the way they... | 2020/06/09 | [
"https://Stackoverflow.com/questions/62281484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13563566/"
] | your column 'time' is of dtype `timedelta` as the error tells you; you could use the `total_seconds()` method to convert to seconds and divide by 60 to get the minutes.
If you want a full-featured datetime column, combine 'date' and 'time'. Then you can use `.dt.minute`.
**Ex:**
```
import pandas as pd
df = pd.DataF... | @Fobersteiner's answer is very good, but just for completeness, I would like to add that you could also divide your column of dtype `timedelta` by a fixed `timedelta`. For instance:
```py
from datetime import timedelta
import pandas as pd
df = pd.DataFrame({'time': pd.to_timedelta(['00:30:45','00:30:45','00:21:06','00... |
58,324,162 | I'm experimenting with WSASockets and I'm very new to it.
I tried to send the input and the output of a process (cmd.exe in this case, to act like a remote shell) through a socket using handles, but whenever I try to use :
```
si.dwFlags = (STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW);
si.hStdInput = si.hStdOutput = ... | 2019/10/10 | [
"https://Stackoverflow.com/questions/58324162",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10512647/"
] | There are two small issues with your code:
1. You want to combine two conditions with `&`, but you should wrap each of these conditions in parenthesis to clearly seperate them: `(x==...) & (y=...)`
2. The result of this check has the form of a Series (with only one observation in it). Python is not sure how to convert... | So, let's break this statement down:
`df_workable[df_workable['workable_day'] == 4 & df_workable['month'] == 1]['day']`
1. `df_workable`: the complete DataFrame
2. `df_workable[df_workable['workable_day'] == int(row['wday_a1']) & df_workable['month'] == 1]`: you are filtering the DataFrame based on specific values fo... |
29,998,196 | I just got a NFC Reader (ACS ACR122U), but the SDK available is for Windows only.
Where can I find a SDK for Mac OSX? I already contacted helpdesk of the hardware provider but until now I don't get any response from them. | 2015/05/02 | [
"https://Stackoverflow.com/questions/29998196",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/421066/"
] | libnfc works with the ACR122U, according to <http://nfc-tools.org/index.php?title=ACR122> .
To install libnfc on OSX, see: <http://nfc-tools.org/index.php?title=Libnfc#Mac_OS_X> | To add privileges you run `vigr` and `vigr -s` on OSX.
On linux you can do the same or use
```
usermod <user> -G <group>
```
Where group is `libnfc` or `nfc` or something like that. |
7,428,554 | I did by code the following:
```
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7428554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778076/"
] | Try this:
```
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(40, 30, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = NSTextAlignmentCenter;
label.textColor = [UIColor whiteColor];
label.numberOfLines = 0;
label.lineBreakMode = UILineBreakModeWordWrap;
... | One Minor Change on iOS 6 or later is that the
```
label.textAlignment = UITextAlignmentCenter;
```
is deprecated so use
```
label.textAlignment = NSTextAlignmentLeft;
```
instead. |
7,428,554 | I did by code the following:
```
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7428554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778076/"
] | To show the UILable as your displayed in your image, you need to set the following property of [UILabel](http://developer.apple.com/library/ios/#documentation/uikit/reference/UILabel_Class/Reference/UILabel.html#jumpTo_9) and also increase the height of your Label.
```
@property(nonatomic) NSInteger numberOfLines;
@pr... | One Minor Change on iOS 6 or later is that the
```
label.textAlignment = UITextAlignmentCenter;
```
is deprecated so use
```
label.textAlignment = NSTextAlignmentLeft;
```
instead. |
7,428,554 | I did by code the following:
```
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7428554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778076/"
] | One Minor Change on iOS 6 or later is that the
```
label.textAlignment = UITextAlignmentCenter;
```
is deprecated so use
```
label.textAlignment = NSTextAlignmentLeft;
```
instead. | here is how to create UILabel Programmatically..
1) Write this in .h file of your project.
```
UILabel *label;
```
2) Write this in .m file of your project.
```
label=[[UILabel alloc]initWithFrame:CGRectMake(10, 70, 50, 50)];//Set frame of label in your viewcontroller.
[label setBackgroundColor:[UIColor lightGrayC... |
7,428,554 | I did by code the following:
```
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7428554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778076/"
] | if you know the number of line i.e if number of Line is 3 then you can write
```
label.numberOfLines=3;
label.lineBreakMode=UILineBreakModeCharacterWrap;
```
and if u don't know the exact line for label then you can write
```
label.numberOfLines=0;
label.lineBreakMode=UILineBreakModeCharacterWrap;
``` | Set Numberoflines property of your label and then also increase some width of your lable so your label can shows proper.
This property controls the maximum number of lines to use in order to fit the label’s text into its bounding rectangle. The default value for this property is 1. To remove any maximum limit, and us... |
7,428,554 | I did by code the following:
```
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7428554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778076/"
] | Try this:
```
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(40, 30, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = NSTextAlignmentCenter;
label.textColor = [UIColor whiteColor];
label.numberOfLines = 0;
label.lineBreakMode = UILineBreakModeWordWrap;
... | Set **numberOfLines** property of UILabel.
```
label.lineBreakMode = UILineBreakModeWordWrap;
label.numberOfLines = 3;
label.text = @"Telechargez et consultez les catalogues et les tarifs de la gamme Audi au format PDF";
``` |
7,428,554 | I did by code the following:
```
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7428554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778076/"
] | Try this:
```
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(40, 30, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = NSTextAlignmentCenter;
label.textColor = [UIColor whiteColor];
label.numberOfLines = 0;
label.lineBreakMode = UILineBreakModeWordWrap;
... | here is how to create UILabel Programmatically..
1) Write this in .h file of your project.
```
UILabel *label;
```
2) Write this in .m file of your project.
```
label=[[UILabel alloc]initWithFrame:CGRectMake(10, 70, 50, 50)];//Set frame of label in your viewcontroller.
[label setBackgroundColor:[UIColor lightGrayC... |
7,428,554 | I did by code the following:
```
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7428554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778076/"
] | To show the UILable as your displayed in your image, you need to set the following property of [UILabel](http://developer.apple.com/library/ios/#documentation/uikit/reference/UILabel_Class/Reference/UILabel.html#jumpTo_9) and also increase the height of your Label.
```
@property(nonatomic) NSInteger numberOfLines;
@pr... | if you know the number of line i.e if number of Line is 3 then you can write
```
label.numberOfLines=3;
label.lineBreakMode=UILineBreakModeCharacterWrap;
```
and if u don't know the exact line for label then you can write
```
label.numberOfLines=0;
label.lineBreakMode=UILineBreakModeCharacterWrap;
``` |
7,428,554 | I did by code the following:
```
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7428554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778076/"
] | Try this:
```
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(40, 30, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = NSTextAlignmentCenter;
label.textColor = [UIColor whiteColor];
label.numberOfLines = 0;
label.lineBreakMode = UILineBreakModeWordWrap;
... | ```
UILabel *mycoollabel=[[UILabel alloc]initWithFrame:CGRectMake(10, 70, 50, 50)];
mycoollabel.text=@"I am cool";//
// for multiple lines,if text lenght is long use next line
mycoollabel.numberOfLines=0;
[self.View addSubView:mycoollabel];
``` |
7,428,554 | I did by code the following:
```
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7428554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778076/"
] | Set Numberoflines property of your label and then also increase some width of your lable so your label can shows proper.
This property controls the maximum number of lines to use in order to fit the label’s text into its bounding rectangle. The default value for this property is 1. To remove any maximum limit, and us... | ```
UILabel *mycoollabel=[[UILabel alloc]initWithFrame:CGRectMake(10, 70, 50, 50)];
mycoollabel.text=@"I am cool";//
// for multiple lines,if text lenght is long use next line
mycoollabel.numberOfLines=0;
[self.View addSubView:mycoollabel];
``` |
7,428,554 | I did by code the following:
```
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(40, 70, 300, 50)];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter; // UITextAlignmentCenter, UITextAlignmentLeft
label.textColor=[UIColor whiteColor];
label.text = @"... | 2011/09/15 | [
"https://Stackoverflow.com/questions/7428554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/778076/"
] | Set Numberoflines property of your label and then also increase some width of your lable so your label can shows proper.
This property controls the maximum number of lines to use in order to fit the label’s text into its bounding rectangle. The default value for this property is 1. To remove any maximum limit, and us... | here is how to create UILabel Programmatically..
1) Write this in .h file of your project.
```
UILabel *label;
```
2) Write this in .m file of your project.
```
label=[[UILabel alloc]initWithFrame:CGRectMake(10, 70, 50, 50)];//Set frame of label in your viewcontroller.
[label setBackgroundColor:[UIColor lightGrayC... |
26,831,439 | Is it possible to have LinearLayout with layout\_height="match\_parent" and layout\_width that would attribute to half the height?
I would then put those layouts in larger HorizontalScrollView and let layouts keep desired aspect ratio.
Is this possible without creating my own layout that would handle it ? | 2014/11/09 | [
"https://Stackoverflow.com/questions/26831439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1109920/"
] | You need a custom ViewGroup for this. Google has one called [ProportionalLayout](https://android.googlesource.com/platform/packages/apps/ContactsCommon/+/master/src/com/android/contacts/common/widget/ProportionalLayout.java) -- it's not part of the Android SDK, so you have to copy the source code into your app in order... | You can do that programmatically by getting the layout height and then set the width to half that size.
```
LinearLayout layout = (LinearLayout)findViewById(R.id.numberPadLayout);
int height = layout.getHeight();
LayoutParams params = layout.getLayoutParams();
params.height = height;
params.width = height/2;
``` |
26,831,439 | Is it possible to have LinearLayout with layout\_height="match\_parent" and layout\_width that would attribute to half the height?
I would then put those layouts in larger HorizontalScrollView and let layouts keep desired aspect ratio.
Is this possible without creating my own layout that would handle it ? | 2014/11/09 | [
"https://Stackoverflow.com/questions/26831439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1109920/"
] | You need a custom ViewGroup for this. Google has one called [ProportionalLayout](https://android.googlesource.com/platform/packages/apps/ContactsCommon/+/master/src/com/android/contacts/common/widget/ProportionalLayout.java) -- it's not part of the Android SDK, so you have to copy the source code into your app in order... | I have faced with this question month ago. The found the only way to solve it:
In the layout file make width = match\_parent, and height = 0dp or whatever!
In the onCreate method add of your activity add onGlobalLayoutListener(). This method will be called when all heights and widths of all widgets are measured. So yo... |
422,052 | The [AMD Catalyst™ 13.12 Proprietary Linux x86 Display Driver](http://support.amd.com/en-us/kb-articles/Pages/amdcatalyst13-12linreleasenotes.aspx) can be used with Ubuntu `12.04.2` and `13.04` and the [14.1 Beta](http://support.amd.com/en-us/kb-articles/Pages/Latest-LINUX-Beta-Driver.aspx) version can be used with Ubu... | 2014/02/17 | [
"https://askubuntu.com/questions/422052",
"https://askubuntu.com",
"https://askubuntu.com/users/95857/"
] | You can download old Ubuntu versions from <http://old-releases.ubuntu.com/releases/12.04.2/>
Now choose the version you want (12.04.2) and be sure if you want it 32 or 64bit Then click on it to download.
Now for the updates you can run the update manager from DASH then go to settings and beside check for updates cho... | In such a case I would pin down the dependencies but let the updates continue. In this manner security issues and high impact bugs in other packages will be dealt with.
In the case of this driver this means: Xserver <=1.14, Kernel <=3.11, Glib <=2.3
The way to do this is described [here](https://serverfault.com/quest... |
72,315 | I am rather new to Unity, I have only started using it after upgrading to 11.10 several days ago, and one thing really worries me. I started to miss incoming messages in Empathy and Skype because sometimes I'm not there when they arrive. And when I'm back, I don't use the launcher because I have a maximized window, so ... | 2011/10/26 | [
"https://askubuntu.com/questions/72315",
"https://askubuntu.com",
"https://askubuntu.com/users/202/"
] | You can use [Recent Notifications Indicator](https://launchpad.net/recent-notifications) for catching up missed notifications. It will display a postbox icon in your notification area.
To install, use the following commands:
```
sudo apt-add-repository ppa:jconti/recent-notifications
sudo apt-get update
sudo apt-get ... | This seems to be a empathy user interface bug as Pidgin does not exhibit the same behaviour. Also try following this guide [Pidgin Skype](http://www.omgubuntu.co.uk/2011/04/run-skype-as-a-daemon-and-manage-it-from-empathy-in-ubuntu-11-04/) to integrate Skype messages into the messaging menu so you don't miss those eith... |
70,606,414 | ****I want to get single image from bitmap array recycler view and show it to my detail activity****
[recycler view adapter class]
'
public void onBindViewHolder(@NonNull viewholder holder, @SuppressLint("RecyclerView") int position) {
```
model model= list.get(position);
byte[] image=list.get(position).getI... | 2022/01/06 | [
"https://Stackoverflow.com/questions/70606414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16262113/"
] | You can pass table name as second parameter in 'classe' relation like this:
```
public function classe()
{
return $this->belongsToMany(Classes::class, 'class_student');
}
``` | In relations (in both models) as second parameter you must provide table name `class_student` because you don't follow convention because you model name is `Classes` |
57,139,486 | Having trouble for adding a gradient color to my fileinput progress bar.
Right now, I was able to change the color of the progress bar from a regular blue to something else using the code provided here. [Colour of progress bar in fileInput -- Shiny](https://stackoverflow.com/questions/44401763/colour-of-progress-bar-... | 2019/07/22 | [
"https://Stackoverflow.com/questions/57139486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9996679/"
] | To set a gradient in CSS, the property is `background-image`, not `background-color`. You also have to set the `background-size` to `auto`, otherwise it is set to `40px 40px` and the progress bar is striped. Here is the CSS:
```
tags$head(
tags$style(
".progress-bar {
background-image: linear-gra... | Try creating a colour ramp from a predefined color palette:
<https://www.rdocumentation.org/packages/dichromat/versions/1.1/topics/colorRampPalette> |
60,613,031 | i want to load previous and next page as by default when PageView has been initialized. But in default implementation the next page is loading when the page is scrolled the next page. is there any way to do that. in android we can simply achieve it by using `offscreenpagelimit` but in flutter I couldn't found any equiv... | 2020/03/10 | [
"https://Stackoverflow.com/questions/60613031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4862911/"
] | There is an issue on GitHub about preloading tabs: <https://github.com/flutter/flutter/issues/31191>
Please check their solutions. | Try this:
```
PageView(
cacheExtents: your_offset_limit_here,
/// etc
)
``` |
25,931,651 | In mobile Safari (iOS 8.0 iPad Mini) it seems that, the more inputs (I've tried with different types) a web has, the slower the "typing" gets (I've even managed to freeze safari just typing). Just to make sure it was not the keyboard, I tested with Swiftkey, but the same problem arose. With Swiftkey, the input was fast... | 2014/09/19 | [
"https://Stackoverflow.com/questions/25931651",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1346273/"
] | Same issue as this one: [Why does Safari Mobile have trouble handling many input fields on iOS 8](https://stackoverflow.com/questions/26149532/why-does-safari-mobile-have-trouble-handling-many-input-fields-on-ios-8)
A workaround is to wrap each input element in a form element like this:
```
<form><input class="" typ... | In order for the community to have the context: would you please share the entire source for one of the pages this issue is occurring on?
If you're trying to debug on a physical iPad I strongly recommend downloading [Xcode](https://developer.apple.com/xcode/downloads/) and opening the iPad emulator. From there you can... |
1,568,881 | The examples they use on my book are basically from basic arithmetic like 1, 2 and 3 to calculus and calculating derivatives, which is really annoying because I can't build the fundamental skill required to do harder questions. Anyhow, I have to solve an non-factorable inequality. Normally, I would use the quadratic fo... | 2015/12/10 | [
"https://math.stackexchange.com/questions/1568881",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/272298/"
] | After manipulating a little bit and rearranging terms when the whole thing is $\leq 0$:
$$x^4 + 2x^3 - 4x^2 - 6x + 3 \\
x^4+2x^3-6x-4x^2+3 \\
x^4 + 2x(x^2-3)-4x^2+3 \\
x^4 + 2x(x^2-3)-3x^2-x^2+3 \\
x^4 + 2x(x^2-3)-3x^2-(x^2-3) \\
x^4 -3x^2 + 2x(x^2-3)-(x^2-3) \\
x^4 -3x^2 + (x^2-3)(2x-1) \\
x^2(x^2-3) + (x^2-3)(2x-1) ... | There is a [quartic formula](http://www.sosmath.com/algebra/factor/fac12/fac12.html), but I do not recommend using it, since it is incredibly convoluted. Since you are trying to solve an inequality, it is probably fine to use a numerical approximation for the zeroes, which are about $.414, -1.732, 1.732,$ and $ -2.414$... |
42,643,410 | Does anyone know how to select(check) all the check boxes in column of handsontable by checking the first check box of a particular column. I tried all the possible options to get it done but I,m not able to do it by any means.
Here is the code,
```
function getCarData() {
return [
{ available: true,avai... | 2017/03/07 | [
"https://Stackoverflow.com/questions/42643410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are trying to open AlertDialog from BroadcastReceiver that is not able to find context(context you) .Do one thing redirect user to from broadcastreceiver and from there show alertdialog in onCreate.
Problem One : You have to pass theme in Alert Dialog
>
> AlertDialog.Builder builder = new
> AlertDialog.Builder... | try to change the id for different notifications:
```
notificationManager.notify(0, notificationBuilder);
```
here change `0` to some dynamic number |
42,643,410 | Does anyone know how to select(check) all the check boxes in column of handsontable by checking the first check box of a particular column. I tried all the possible options to get it done but I,m not able to do it by any means.
Here is the code,
```
function getCarData() {
return [
{ available: true,avai... | 2017/03/07 | [
"https://Stackoverflow.com/questions/42643410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are trying to open AlertDialog from BroadcastReceiver that is not able to find context(context you) .Do one thing redirect user to from broadcastreceiver and from there show alertdialog in onCreate.
Problem One : You have to pass theme in Alert Dialog
>
> AlertDialog.Builder builder = new
> AlertDialog.Builder... | Normally a dialog needs an Activity context, or make the dialog type a system alert dialog
>
> alert.getWindow().setType(WindowManager.LayoutParams.TYPE\_SYSTEM\_ALERT);
>
>
>
This needs the android.permission.SYSTEM\_ALERT\_WINDOW to be declared in manifest. |
42,643,410 | Does anyone know how to select(check) all the check boxes in column of handsontable by checking the first check box of a particular column. I tried all the possible options to get it done but I,m not able to do it by any means.
Here is the code,
```
function getCarData() {
return [
{ available: true,avai... | 2017/03/07 | [
"https://Stackoverflow.com/questions/42643410",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You are trying to open AlertDialog from BroadcastReceiver that is not able to find context(context you) .Do one thing redirect user to from broadcastreceiver and from there show alertdialog in onCreate.
Problem One : You have to pass theme in Alert Dialog
>
> AlertDialog.Builder builder = new
> AlertDialog.Builder... | For my opinion , `onReceive` can only survive for 10 seconds. So if your random time is longer than 10 seconds,the notification object is destroied which is newed in `onReceive`. So my advice is that do this in a new thread in `Service` instead of `Broadcast Receiver`. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.