qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
18,012,532 | I have a JavaEE project with several entities with the following `persistence.xml` file:
```
...
<properties>
<!-- Scan for annotated classes -->
<property name="hibernate.archive.autodetection" value="class"/>
...
```
And it seems to work. The project is then deployed as a JAR to two different projects. In ... | 2013/08/02 | [
"https://Stackoverflow.com/questions/18012532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I think Hibernate only scans for JPA Entities inside jar files, and not in classes/ folders for example, or it only scans in the jar with the persistence.xml, or something like that. Instead of trying to bend the Hibernate scanner, I felt it would be easier to scan for entities myself. It is a lot easier than I anticip... | Using the empty element `<jar-file></jar-file>` works e.g. with WildFly 8.2.1.Final (Hibernate 4.3.7.Final) :) as mentioned [here](https://stackoverflow.com/a/25908447/1915920).
(`<property name="hibernate.archive.autodetection" value="class, hbm" />` did not work)
(but it did not work outside of WildFly for Eclipse-r... |
66,466,323 | My React structure is
```
- App
|--SelectStudy
|--ParticipantsTable
```
In `SelectStudy` there is a button whose click triggers a message to its sibling, `ParticipantsTable`, **via the `App` parent**. The first Child->Parent transfer works. But how do I implement the second Parent->Child transfer? See question... | 2021/03/03 | [
"https://Stackoverflow.com/questions/66466323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1005607/"
] | The state should live definitively at the `App` level, not in the child. State needs to live one level above the lowest common denominator that needs access to it. So if both `SelectStudy` and `ParticipantsTable` need access to the same bit of state data, then it *must* live in their closest common ancestor (or above).... | I think what you need to understand is the difference between `state` and `props`.
`state` is internal to a component while `props` are passed down from parents to children
Here is a [in-depth answer](https://stackoverflow.com/questions/27991366/what-is-the-difference-between-state-and-props-in-react)
So you want to... |
38,500,112 | I want to get the duplicate values count from one table. The input values are like as below,
1. SUB -xxx-20160721
2. SUB -xxx-20160721
3. SUB -125-20160022
Here (1) and (2) are same value. If the Name is more than 1 it should return 1 as a result. the result should return the count as (2).
```
var numberOfDuplicat... | 2016/07/21 | [
"https://Stackoverflow.com/questions/38500112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2207366/"
] | The return value of the below code is an anonymous object with 2 properties:
* `Value` The value that is duplicate
* `Amount` The amount of times it is duplicate
```
var numberOfDuplicates = this.UnitOfWork.Repository()
.Queryable().GroupBy(x => x.Name)
.Where(x => x.Count() > 1)
.Select(x => new { Value ... | The problem with your code is that you're returning the `Count` of each group using the `Select(x=> x.Count())` statement.
You can return the Name (The `Key` of Grouping) and the Count using anonymous types:
```
var numberOfDuplicates = this.UnitOfWork.Repository<Models.SUB>()
.Queryable().GroupBy(x => x... |
63,568,056 | I have a list with different csv files, what I would like to do is read these csv files and save in a variable for posterior operations.
This is what I have now
```
DF_list= list()
for filename in sorted(glob.glob(dirname + '/*.csv')):
print(filename)
df7 = pd.read_csv(filename)
DF_list.append(df7)
```... | 2020/08/24 | [
"https://Stackoverflow.com/questions/63568056",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11985685/"
] | AWS added an official [workaround](https://github.com/aws/aws-cdk/blob/master/packages/@aws-cdk/core/README.md#removing-automatic-cross-stack-references). It allows you to manually create an export in the dependent stack. When you need to remove an export, create it manually, remove its usage, deploy, remove it, and de... | I understood your issue like that: Create another cluster, migrate TaskDefinition with Service from old to the new cluster.
The thing is, that your old task is still is running as the error is telling you (SGs are still in use).
Additionally, could it be the case that you are trying to re-use the security groups from ... |
63,568,056 | I have a list with different csv files, what I would like to do is read these csv files and save in a variable for posterior operations.
This is what I have now
```
DF_list= list()
for filename in sorted(glob.glob(dirname + '/*.csv')):
print(filename)
df7 = pd.read_csv(filename)
DF_list.append(df7)
```... | 2020/08/24 | [
"https://Stackoverflow.com/questions/63568056",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11985685/"
] | AWS added an official [workaround](https://github.com/aws/aws-cdk/blob/master/packages/@aws-cdk/core/README.md#removing-automatic-cross-stack-references). It allows you to manually create an export in the dependent stack. When you need to remove an export, create it manually, remove its usage, deploy, remove it, and de... | [This](https://aws.amazon.com/es/premiumsupport/knowledge-center/cloudformation-stack-export-name-error/) was usefull for me. In my case I was using CDK and wanted to remove one stack (lets say stackA) with outputs referenced as input in another stacks (lets say stackB and stackC). So I broke all cross stack references... |
63,568,056 | I have a list with different csv files, what I would like to do is read these csv files and save in a variable for posterior operations.
This is what I have now
```
DF_list= list()
for filename in sorted(glob.glob(dirname + '/*.csv')):
print(filename)
df7 = pd.read_csv(filename)
DF_list.append(df7)
```... | 2020/08/24 | [
"https://Stackoverflow.com/questions/63568056",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11985685/"
] | AWS added an official [workaround](https://github.com/aws/aws-cdk/blob/master/packages/@aws-cdk/core/README.md#removing-automatic-cross-stack-references). It allows you to manually create an export in the dependent stack. When you need to remove an export, create it manually, remove its usage, deploy, remove it, and de... | If you are using [AWS CDK](https://aws.amazon.com/cdk/) for infra-as-code development, this blog [CDK tips, part 3 – how to unblock cross-stack references](https://www.endoflineblog.com/cdk-tips-03-how-to-unblock-cross-stack-references) written by Adam Ruka, who worked on CDK for almost 7 years in Amazon, could be a ve... |
63,568,056 | I have a list with different csv files, what I would like to do is read these csv files and save in a variable for posterior operations.
This is what I have now
```
DF_list= list()
for filename in sorted(glob.glob(dirname + '/*.csv')):
print(filename)
df7 = pd.read_csv(filename)
DF_list.append(df7)
```... | 2020/08/24 | [
"https://Stackoverflow.com/questions/63568056",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11985685/"
] | AWS added an official [workaround](https://github.com/aws/aws-cdk/blob/master/packages/@aws-cdk/core/README.md#removing-automatic-cross-stack-references). It allows you to manually create an export in the dependent stack. When you need to remove an export, create it manually, remove its usage, deploy, remove it, and de... | Another workaround is to manually create the outputs needed by setting the same `exportName` and value from the CloudFormation console in the cluster class:
```
new cdk.CfnOutput(this, `${this.id}clusterOutput`, { value: "sample-value", exportName: "ecs:ExportsOutputFnGetAttdefaultasgspotInstanceSecurityGroup2D2AFE98G... |
38,365,229 | I currently have the following jQuery code working. Here's what it does: when I click a button, it will swap between classes. Each of those classes contains a background image. So, as I click this single button, it cycles through the background images. (edit: I just need to store whatever the current variable is, so wh... | 2016/07/14 | [
"https://Stackoverflow.com/questions/38365229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6587429/"
] | Use the [`Window.sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage) API for a single session.
Just set by getting the value from the `sessionStorage` if applicable (if not, set a default value):
```
var classes = sessionStorage.getItem(classes) || ['bg1','bg2','bg3','bg4'];
```
... | The selector `#backgrounds` should only match one element. So it is unnecessary to use `each`:
```
// Define classes & background element.
var classes = ['bg1','bg2','bg3','bg4'],
$bg = document.getElementById('backgrounds');
// On first run:
$bg.className = sessionStorage.getItem('currentClass') || classes[0];
//... |
837,982 | I'm studying the remainder and factor theorems and a question asks:
>
> -4 is a root of $x^4 + ax^3 - 19x^2 - 46x + 120$ What is the value of a?
>
>
>
Since -4 is a root then I can deduce that x+4 is a factor of the polynomial. But that's as far as I get.
Hints? | 2014/06/18 | [
"https://math.stackexchange.com/questions/837982",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/13439/"
] | Let $f(x)=x^4+ax^3-19x^2-46x+120$. We say that $-4$ is a root of $f(x)$ if $f(-4)=0$.
Thus
$$(-4)^4+a(-4)^3-19(-4)^2-46(-4)+120=0.$$
Simplify, and solve for $a$.
**Remark:** The problem setter chose the numbers to make the final answer very simple. | The remainder theorem says if $a$ is a root of a degree $n$ polynomial $p(x)$, that is, if $p(a) = 0$, then $$(x-a) | p(x)$$ or equivalently, we can write $$p(x) = (x-a)q(x)$$ for some polynomial $q(x)$ with degree $n-1$.
However, you don't need to apply that here. If $-4$ is a root, then $p(-4) = 0$. If you evaluate... |
44,829,077 | I have a problem with some dynamically generated forms and passing values to them. I feel like someone must have solved this, or I’m missing something obvious, but I can't find any mention of it.
So for example, I have three components, a parent, a child, and then a child of that child. For names, I’ll go with, formCo... | 2017/06/29 | [
"https://Stackoverflow.com/questions/44829077",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4496240/"
] | I do something similar, whereby I have forms populated from data coming from my Ngrx Store. My forms aren't dynamic so I'm not 100% sure if this will also work for you.
Define your input with just a setter, then call patchValue(), or setValue() on your form/ form control. Your root component stays the same, passing th... | Here are my thoughts on the question, taking into account limited code snippet.
First, provided example doesn't seem to have anything to do with `ngrx`. In this case, it is expected that `ngOnInit` runs only once and at that time `this.asyncPipedValue` value is `undefined`. Consequently, if `changeDetection` of `this.... |
44,829,077 | I have a problem with some dynamically generated forms and passing values to them. I feel like someone must have solved this, or I’m missing something obvious, but I can't find any mention of it.
So for example, I have three components, a parent, a child, and then a child of that child. For names, I’ll go with, formCo... | 2017/06/29 | [
"https://Stackoverflow.com/questions/44829077",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4496240/"
] | I do something similar, whereby I have forms populated from data coming from my Ngrx Store. My forms aren't dynamic so I'm not 100% sure if this will also work for you.
Define your input with just a setter, then call patchValue(), or setValue() on your form/ form control. Your root component stays the same, passing th... | I believe I have figured out a solution (with some help from the gitter.com/angular channel).
Since the values are coming in to the questionComponent can change, and trigger it's ngOnChanges to fire, whenever there is an event in ngOnChanges, it needs to parse through the event, and bind and changes to the dynamic chi... |
24,018,685 | Is there any way for me to sort files for POST to server using any client side solution?
More specific, i am using the following tag `<input type="file" name="Myfiles[]" multiple>` To choose some images.
With the code at the end i display a preview of the images and using jQuery UI sortable i'm able to change the pos... | 2014/06/03 | [
"https://Stackoverflow.com/questions/24018685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1766201/"
] | Assuming you are storing the files into an array:
```
var storedFiles = [];
```
You can create a hidden field to store the IDs of the images in the order you want (3,1,2,4..) These IDs must be generated after your images are selected.
Then when the upload button is clicked, grab the sorted contents of the hidden in... | The order in which the server receives the files will be the order in which they were placed in the form to be submitted to the server.
That means it's probably easier to re-order them client-side before submitting e.g. by re-ordering the order in which they appear in the form for submission. Heres a rough-and-ready ... |
24,018,685 | Is there any way for me to sort files for POST to server using any client side solution?
More specific, i am using the following tag `<input type="file" name="Myfiles[]" multiple>` To choose some images.
With the code at the end i display a preview of the images and using jQuery UI sortable i'm able to change the pos... | 2014/06/03 | [
"https://Stackoverflow.com/questions/24018685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1766201/"
] | The order in which the server receives the files will be the order in which they were placed in the form to be submitted to the server.
That means it's probably easier to re-order them client-side before submitting e.g. by re-ordering the order in which they appear in the form for submission. Heres a rough-and-ready ... | You can use plain JavaScript code to sort the files using the file names and store them as an array.
```
var files = evt.target.files
var RESULT = []
var m = files.length
for (var a = 0; a < m; a++) {
var min = 0
for (var b = 0; b < (m - 1) - a; b++) {
if ((files[b].name).localeCompare(files[b + 1].na... |
24,018,685 | Is there any way for me to sort files for POST to server using any client side solution?
More specific, i am using the following tag `<input type="file" name="Myfiles[]" multiple>` To choose some images.
With the code at the end i display a preview of the images and using jQuery UI sortable i'm able to change the pos... | 2014/06/03 | [
"https://Stackoverflow.com/questions/24018685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1766201/"
] | Assuming you are storing the files into an array:
```
var storedFiles = [];
```
You can create a hidden field to store the IDs of the images in the order you want (3,1,2,4..) These IDs must be generated after your images are selected.
Then when the upload button is clicked, grab the sorted contents of the hidden in... | You can use plain JavaScript code to sort the files using the file names and store them as an array.
```
var files = evt.target.files
var RESULT = []
var m = files.length
for (var a = 0; a < m; a++) {
var min = 0
for (var b = 0; b < (m - 1) - a; b++) {
if ((files[b].name).localeCompare(files[b + 1].na... |
476,342 | I started making my mind around space and time and recently came to a point where I wondered if the concept of "space" is actually needed to describe physical processes at all and not just some concept that could entirely drop out by the fact that the "speed" of light / information is constant in some "rest" frame?
My... | 2019/04/27 | [
"https://physics.stackexchange.com/questions/476342",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/213499/"
] | As you point out, in terms of GR spacetime is a dynamic participant in the physics taking place. Spacetime that is unstressed exists in a geometrically flat state. Presence of stress and/or energy density induces a state away from that: spacetime curvature. That stressed state is itself a source of gravity.
There is a... | I'm taking the unusual step of posting a second answer, in order to reply to a comment. G. Smith has raised an important point, one that merits thorough discussion.
I argued in a comment to an answer by G. Smith that the assertion that:
>
> You can have spacetime without matter or radiation in it
>
>
>
is too b... |
476,342 | I started making my mind around space and time and recently came to a point where I wondered if the concept of "space" is actually needed to describe physical processes at all and not just some concept that could entirely drop out by the fact that the "speed" of light / information is constant in some "rest" frame?
My... | 2019/04/27 | [
"https://physics.stackexchange.com/questions/476342",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/213499/"
] | As you point out, in terms of GR spacetime is a dynamic participant in the physics taking place. Spacetime that is unstressed exists in a geometrically flat state. Presence of stress and/or energy density induces a state away from that: spacetime curvature. That stressed state is itself a source of gravity.
There is a... | User [WillO](https://physics.stackexchange.com/users/4993/willo) wrote the following comment:
>
> why isn't Minkowski space a counterexample to the expectation you
> attribute to Einstein?
>
>
>
I will write a temporary answer here, as it is too large to fit into a comment. WillO, if you submit your question as ... |
476,342 | I started making my mind around space and time and recently came to a point where I wondered if the concept of "space" is actually needed to describe physical processes at all and not just some concept that could entirely drop out by the fact that the "speed" of light / information is constant in some "rest" frame?
My... | 2019/04/27 | [
"https://physics.stackexchange.com/questions/476342",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/213499/"
] | As you point out, in terms of GR spacetime is a dynamic participant in the physics taking place. Spacetime that is unstressed exists in a geometrically flat state. Presence of stress and/or energy density induces a state away from that: spacetime curvature. That stressed state is itself a source of gravity.
There is a... | The way your question is phrased might be applied to something more familiar, namely electromagnetism. There you have an electromagnetic field which exerts a force on charged matter. But it does not follow that an electromagnetic field is the same sort of thing as electric charge.
This analogy with electromagnetism w... |
476,342 | I started making my mind around space and time and recently came to a point where I wondered if the concept of "space" is actually needed to describe physical processes at all and not just some concept that could entirely drop out by the fact that the "speed" of light / information is constant in some "rest" frame?
My... | 2019/04/27 | [
"https://physics.stackexchange.com/questions/476342",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/213499/"
] | Yes, there is a difference. You can have spacetime without matter or radiation in it, but you cannot have matter or radiation that is not in spacetime.
Matter and radiation exist in, and move through, spacetime. But spacetime has its own dynamics. Its geometry is determined by matter and radiation, and that geometry a... | I'm taking the unusual step of posting a second answer, in order to reply to a comment. G. Smith has raised an important point, one that merits thorough discussion.
I argued in a comment to an answer by G. Smith that the assertion that:
>
> You can have spacetime without matter or radiation in it
>
>
>
is too b... |
476,342 | I started making my mind around space and time and recently came to a point where I wondered if the concept of "space" is actually needed to describe physical processes at all and not just some concept that could entirely drop out by the fact that the "speed" of light / information is constant in some "rest" frame?
My... | 2019/04/27 | [
"https://physics.stackexchange.com/questions/476342",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/213499/"
] | Yes, there is a difference. You can have spacetime without matter or radiation in it, but you cannot have matter or radiation that is not in spacetime.
Matter and radiation exist in, and move through, spacetime. But spacetime has its own dynamics. Its geometry is determined by matter and radiation, and that geometry a... | User [WillO](https://physics.stackexchange.com/users/4993/willo) wrote the following comment:
>
> why isn't Minkowski space a counterexample to the expectation you
> attribute to Einstein?
>
>
>
I will write a temporary answer here, as it is too large to fit into a comment. WillO, if you submit your question as ... |
476,342 | I started making my mind around space and time and recently came to a point where I wondered if the concept of "space" is actually needed to describe physical processes at all and not just some concept that could entirely drop out by the fact that the "speed" of light / information is constant in some "rest" frame?
My... | 2019/04/27 | [
"https://physics.stackexchange.com/questions/476342",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/213499/"
] | Yes, there is a difference. You can have spacetime without matter or radiation in it, but you cannot have matter or radiation that is not in spacetime.
Matter and radiation exist in, and move through, spacetime. But spacetime has its own dynamics. Its geometry is determined by matter and radiation, and that geometry a... | The way your question is phrased might be applied to something more familiar, namely electromagnetism. There you have an electromagnetic field which exerts a force on charged matter. But it does not follow that an electromagnetic field is the same sort of thing as electric charge.
This analogy with electromagnetism w... |
22,085,152 | Here is my class:
```
class UserProfile(TimeStampedModel):
# some fields
class UserCohort(TimeStampedModel):
CHOICE1, CHOICE2, CHOICE3 = range(3)
COHORT_TYPES = (
(CHOICE1, 'Readable 1'),
(CHOICE2, 'Readable 2'),
(CHOICE3, 'Readable 3'))
user_profile = models.ForeignKey('User... | 2014/02/28 | [
"https://Stackoverflow.com/questions/22085152",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2532070/"
] | There isn't a way to use the `Readable 1` value because that is not what is saved in the database. However you can use the constant `CHOICE1` that you defined.
```
UserProfile.objects.filter(cohorts__cohort=UserCohort.CHOICE1)
``` | If you're receiving `"Readable 1"` from the user then you're doing it wrong. Use the field values as the `value`s for the input elements. Or better yet, use a `ModelForm` that will handle everything for you. |
15,860,868 | So I'm using bootstrap and HTMl boilerplate to start up a site. I'm having an issue over writing the brand class from bootstrap. In main.css I added a .navbar .brand class and I'm attempting to change float to top. When I load my web page in the browser my .navbar .brand in main.css is blank (according to firebug). I c... | 2013/04/07 | [
"https://Stackoverflow.com/questions/15860868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1322962/"
] | I really couldn't explain it any better than Mark Pospesel already did in his post [Anatomy of a page-flip animation](http://markpospesel.com/2012/05/23/anatomy-of-a-page-flip-animation/).
The solution is his solution uses Core Animation very effectively to do this and goes trough things like perspective and anti-alia... | I too am looking for something like this and there a few awesome things about the Paper implementation that the commenter and answerers of this question are overlooking.
1) Page flipping in paper is inertial. Got a 100 page book? Flip through dozens of pages at once with a strong swipe of the finger. Just like a real ... |
50,269 | Does it make sense to ask for a better job title (e.g. senior developer instead of developer) when negotiating with my current employer? This does not include any increase in the salary.
Will improving the job title improve my perceived status in the company? Is this something more than just a small personal win? (Mos... | 2015/07/28 | [
"https://workplace.stackexchange.com/questions/50269",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13021/"
] | Remember that the higher title *does* come with higher expectations. A year that exceeds expectations for one level may barely meet expectations for the next level up. Moving up when you aren't ready to do so may make you look worse rather than better. | If most developers don't have a formal title then why should you? If it's not in your company's culture or infrastructure, then there isn't really any reason to want it or request it. If it is, then it should come with a pay raise and increase in responsibility as "Senior Developer" implies a certain level of professio... |
50,269 | Does it make sense to ask for a better job title (e.g. senior developer instead of developer) when negotiating with my current employer? This does not include any increase in the salary.
Will improving the job title improve my perceived status in the company? Is this something more than just a small personal win? (Mos... | 2015/07/28 | [
"https://workplace.stackexchange.com/questions/50269",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13021/"
] | Changing your title may make you look more impressive to prospective employers until they look at what you actually did. You are probably not impressing anyone at your company. And your employer may not be happy when your colleagues start clamoring for getting the same title as yours.
Having the title of senior develo... | In my experience, most medium or larger companies have specific conventions for what different title levels mean. They're not (supposed to be) just honorifics, but rather indicators of responsibility and expectation. A senior developer will be expected to work with less guidance, to *give* guidance and mentoring, and t... |
50,269 | Does it make sense to ask for a better job title (e.g. senior developer instead of developer) when negotiating with my current employer? This does not include any increase in the salary.
Will improving the job title improve my perceived status in the company? Is this something more than just a small personal win? (Mos... | 2015/07/28 | [
"https://workplace.stackexchange.com/questions/50269",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13021/"
] | If the title doesn't have any [a] increased responsibility or [b] increased pay or benefits, then its not worth it. Think about your next employer who will ask you "so how did your deliverables change once you were promoted to senior developer" - how do you expect to answer that?
>
> Will improving the job title impr... | Yes, but only if you are performing a Senior Developer role currently or are being asked to perform one, and your salary reflects at least the bottom end of that scale (typically roughly double the rate of a junior developer in the same company, in my experience)
In that case, you're not asking for a promotion, you're... |
50,269 | Does it make sense to ask for a better job title (e.g. senior developer instead of developer) when negotiating with my current employer? This does not include any increase in the salary.
Will improving the job title improve my perceived status in the company? Is this something more than just a small personal win? (Mos... | 2015/07/28 | [
"https://workplace.stackexchange.com/questions/50269",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13021/"
] | In my experience, most medium or larger companies have specific conventions for what different title levels mean. They're not (supposed to be) just honorifics, but rather indicators of responsibility and expectation. A senior developer will be expected to work with less guidance, to *give* guidance and mentoring, and t... | Job performance will be more important if wanting to ask for a better raise than what is currently offered.
If you want to have additional responsibilities (team leader, architect, design...), then you will need to ask for them; maybe there is a need for that, then you will have to sell yourself to them and tell them ... |
50,269 | Does it make sense to ask for a better job title (e.g. senior developer instead of developer) when negotiating with my current employer? This does not include any increase in the salary.
Will improving the job title improve my perceived status in the company? Is this something more than just a small personal win? (Mos... | 2015/07/28 | [
"https://workplace.stackexchange.com/questions/50269",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13021/"
] | Remember that the higher title *does* come with higher expectations. A year that exceeds expectations for one level may barely meet expectations for the next level up. Moving up when you aren't ready to do so may make you look worse rather than better. | In my experience, most medium or larger companies have specific conventions for what different title levels mean. They're not (supposed to be) just honorifics, but rather indicators of responsibility and expectation. A senior developer will be expected to work with less guidance, to *give* guidance and mentoring, and t... |
50,269 | Does it make sense to ask for a better job title (e.g. senior developer instead of developer) when negotiating with my current employer? This does not include any increase in the salary.
Will improving the job title improve my perceived status in the company? Is this something more than just a small personal win? (Mos... | 2015/07/28 | [
"https://workplace.stackexchange.com/questions/50269",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13021/"
] | Remember that the higher title *does* come with higher expectations. A year that exceeds expectations for one level may barely meet expectations for the next level up. Moving up when you aren't ready to do so may make you look worse rather than better. | Yes, but only if you are performing a Senior Developer role currently or are being asked to perform one, and your salary reflects at least the bottom end of that scale (typically roughly double the rate of a junior developer in the same company, in my experience)
In that case, you're not asking for a promotion, you're... |
50,269 | Does it make sense to ask for a better job title (e.g. senior developer instead of developer) when negotiating with my current employer? This does not include any increase in the salary.
Will improving the job title improve my perceived status in the company? Is this something more than just a small personal win? (Mos... | 2015/07/28 | [
"https://workplace.stackexchange.com/questions/50269",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13021/"
] | In my experience, most medium or larger companies have specific conventions for what different title levels mean. They're not (supposed to be) just honorifics, but rather indicators of responsibility and expectation. A senior developer will be expected to work with less guidance, to *give* guidance and mentoring, and t... | If most developers don't have a formal title then why should you? If it's not in your company's culture or infrastructure, then there isn't really any reason to want it or request it. If it is, then it should come with a pay raise and increase in responsibility as "Senior Developer" implies a certain level of professio... |
50,269 | Does it make sense to ask for a better job title (e.g. senior developer instead of developer) when negotiating with my current employer? This does not include any increase in the salary.
Will improving the job title improve my perceived status in the company? Is this something more than just a small personal win? (Mos... | 2015/07/28 | [
"https://workplace.stackexchange.com/questions/50269",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13021/"
] | Changing your title may make you look more impressive to prospective employers until they look at what you actually did. You are probably not impressing anyone at your company. And your employer may not be happy when your colleagues start clamoring for getting the same title as yours.
Having the title of senior develo... | If the title doesn't have any [a] increased responsibility or [b] increased pay or benefits, then its not worth it. Think about your next employer who will ask you "so how did your deliverables change once you were promoted to senior developer" - how do you expect to answer that?
>
> Will improving the job title impr... |
50,269 | Does it make sense to ask for a better job title (e.g. senior developer instead of developer) when negotiating with my current employer? This does not include any increase in the salary.
Will improving the job title improve my perceived status in the company? Is this something more than just a small personal win? (Mos... | 2015/07/28 | [
"https://workplace.stackexchange.com/questions/50269",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13021/"
] | >
> Does it make sense to ask for a better job title (e.g. senior
> developer instead of developer) when negotiating with my current
> employer?
>
>
>
Sometimes. Job titles have some effect when dealing with clients, when dealing with others in the organisation, and when dealing with possible future employers. I... | If most developers don't have a formal title then why should you? If it's not in your company's culture or infrastructure, then there isn't really any reason to want it or request it. If it is, then it should come with a pay raise and increase in responsibility as "Senior Developer" implies a certain level of professio... |
50,269 | Does it make sense to ask for a better job title (e.g. senior developer instead of developer) when negotiating with my current employer? This does not include any increase in the salary.
Will improving the job title improve my perceived status in the company? Is this something more than just a small personal win? (Mos... | 2015/07/28 | [
"https://workplace.stackexchange.com/questions/50269",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13021/"
] | >
> Does it make sense to ask for a better job title (e.g. senior
> developer instead of developer) when negotiating with my current
> employer?
>
>
>
Sometimes. Job titles have some effect when dealing with clients, when dealing with others in the organisation, and when dealing with possible future employers. I... | Job performance will be more important if wanting to ask for a better raise than what is currently offered.
If you want to have additional responsibilities (team leader, architect, design...), then you will need to ask for them; maybe there is a need for that, then you will have to sell yourself to them and tell them ... |
17,865,278 | I ran a query as follows:
```
rs = conn.execute("SELECT * FROM fruits WHERE name = 'apple' AND type = 'sweet'" )
puts "Results = #{rs.inspect}"
```
this gives me something like
```
Results = [{"fruitId"=> 123, "name"=>"apple", "type"=>"sweet" }]
```
How do I get the fruitId out from this?
I tried this:
```
... | 2013/07/25 | [
"https://Stackoverflow.com/questions/17865278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2619674/"
] | **Preferences > Java > Code Style > Clean Up**, press Edit..., Code Style tab, set `Use blocks in if/while/for/do statements` to `Only if necessary`. After that you can simply do the hell on particular file or even whole project with Source > Clean Up... option :)
P.S. Nevertheless, my choice is "Always". | Go to Java -> Editor -> Typing and see if that is what you are looking for |
17,865,278 | I ran a query as follows:
```
rs = conn.execute("SELECT * FROM fruits WHERE name = 'apple' AND type = 'sweet'" )
puts "Results = #{rs.inspect}"
```
this gives me something like
```
Results = [{"fruitId"=> 123, "name"=>"apple", "type"=>"sweet" }]
```
How do I get the fruitId out from this?
I tried this:
```
... | 2013/07/25 | [
"https://Stackoverflow.com/questions/17865278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2619674/"
] | **Preferences > Java > Code Style > Clean Up**, press Edit..., Code Style tab, set `Use blocks in if/while/for/do statements` to `Only if necessary`. After that you can simply do the hell on particular file or even whole project with Source > Clean Up... option :)
P.S. Nevertheless, my choice is "Always". | Formatters aren't supposed to change the non-whitespace characters. What you're referring to would be a part of the **Clean Up** functionality, but I don't see exactly what you've mentioned as one of the things it can do. |
17,237,737 | In the same vein as [pg\_dump without comments on objects?](https://stackoverflow.com/questions/17027611/pg-dump-without-comments-on-objects), is anyone aware of a command to quickly get rid of the comments (created with `COMMENT ON`) on all objects at once ?
For now, I resorted to bash generating a SQL script that wo... | 2013/06/21 | [
"https://Stackoverflow.com/questions/17237737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689522/"
] | I have faced a very similar problem some time ago and came up with a very simple solution: delete from the system catalog table [`pg_description`](http://www.postgresql.org/docs/current/interactive/catalog-pg-description.html) **directly**. Comments are just "attached" to objects and don't interfere otherwise.
```
DEL... | Ok, thanks to your help, I found the following commands pretty useful:
To delete a comment from a given column position of a specific object (here, mytable), you could go:
```
DELETE FROM pg_description WHERE (SELECT relname FROM pg_class WHERE oid=objoid)='mytable' AND objsubid=2;
```
...but note that it's not mor... |
17,237,737 | In the same vein as [pg\_dump without comments on objects?](https://stackoverflow.com/questions/17027611/pg-dump-without-comments-on-objects), is anyone aware of a command to quickly get rid of the comments (created with `COMMENT ON`) on all objects at once ?
For now, I resorted to bash generating a SQL script that wo... | 2013/06/21 | [
"https://Stackoverflow.com/questions/17237737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1689522/"
] | I have faced a very similar problem some time ago and came up with a very simple solution: delete from the system catalog table [`pg_description`](http://www.postgresql.org/docs/current/interactive/catalog-pg-description.html) **directly**. Comments are just "attached" to objects and don't interfere otherwise.
```
DEL... | If you want to do this without hacking a system table, then this will generate the statements for you:
```
SELECT 'COMMENT ON COLUMN ' || quote_ident(pg_namespace.nspname) || '.' || quote_ident(pg_class.relname) || '.' || quote_ident(columns.column_name) || ' IS NULL;'
FROM pg_description
JOIN pg_class ON pg_class.o... |
36,126,024 | **My original string is :**
**Låt** den jäsa tifgdfgfll dubbel storlek ungdfgdfder en handduk **endtimer** dfgsdg fgsdfg hello ho hi **Låt** den jäsa till dubbel storlek undegdfgr en handduk **endtimer** heouu hiy hinl **Låt** den jäsa till dubbel stofgdfgrlek under en hfdgdfndduk **endtimer** jijfr ii iuwii **Låt** de... | 2016/03/21 | [
"https://Stackoverflow.com/questions/36126024",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4972038/"
] | Try with this
```
NSString *appendString = [yourString stringByReplacingOccurrencesOfString:@"Låt" withString:@"iOS Låt"];
appendString = [appendString stringByReplacingOccurrencesOfString:@"endtimer" withString:@"endtimer objective c"];
``` | An option:
```
NSString *string = @"Låt den jäsa tifgdfgfll dubbel storlek ungdfgdfder en handduk endtimer dfgsdg fgsdfg hello ho hi Låt den jäsa till dubbel storlek undegdfgr en handduk endtimer heouu hiy hinl Låt den jäsa till dubbel stofgdfgrlek under en hfdgdfndduk endtimer jijfr ii iuwii Låt den jäsa till dugdfgb... |
13,124,030 | I am receiving the error above where it asking me for a string length of 4 as I am trying to unpack a float from a binary file. My code runs perfectly fine on my Mac, however it falls short on Windows. The code is as follows:
```
for i in range (0,elec_array.nb_chan):
elec_array.chan[i].x = struct.unpack('f',f.re... | 2012/10/29 | [
"https://Stackoverflow.com/questions/13124030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1217248/"
] | You probably forgot to open the file in binary mode. In text mode, a `0x0d` `0x0a` sequence gets shortened to `0x0a` and your file will be the wrong size. | Well, do the `read()` separately; it's I/O so it can, as you've just learned, fail.
To debug, print the data and the length of the data as you read it, this will help you understand what's going wrong.
It's hard to be more specific without seeing the file, and the surrounding code. Are you opening the file in binary ... |
17,434,149 | I have a django view defined as follows.
```
class SomeView(View):
def post(self, request, *args, **kwargs):
print "###############################"
print request.POST
print "###############################"
return HttpResponse(json.dumps(kwargs), mimetype='application/json')
```
... | 2013/07/02 | [
"https://Stackoverflow.com/questions/17434149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1876508/"
] | The `request.POST` attribute is for form encoded data. You are posting json encoded data, so use `request.BODY` instead.
For more information see the docs on [http request objects](https://docs.djangoproject.com/en/1.5/ref/request-response/#httprequest-objects).
Finally, the args and kwargs are not related to the pas... | A few corrections that should at least point you in the right direction:
1. When using class based views the request parameter is accessed via `self.request`
2. Use `--data '{"hello":"world"}'`, from the curl man page:
```
-d, --data <data>
(HTTP) Sends the specified data in a POST request to the HTTP server... |
3,427 | I am working on an open source project, and we are looking to make changes to the way we do version control.
I want to propose several systems, and have the developers vote.
What would be a good platform for doing this, where the developers would not need to create an account to vote on something...
EDIT: Does any... | 2011/09/19 | [
"https://pm.stackexchange.com/questions/3427",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/2170/"
] | If you are all on the same Exchange server, just use the Outlook voting options. Otherwise, something like Google Forms would be a great idea. | I am one of the developers of [PollUnit](https://pollunit.com "PollUnit").
With our tool you can quickly prioritize tasks or find decisions with the least rejection (or highest acceptance).
Users can vote without account or can login with their google account.
Here are two examples (Dot Voting and Systemic Consensus... |
3,427 | I am working on an open source project, and we are looking to make changes to the way we do version control.
I want to propose several systems, and have the developers vote.
What would be a good platform for doing this, where the developers would not need to create an account to vote on something...
EDIT: Does any... | 2011/09/19 | [
"https://pm.stackexchange.com/questions/3427",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/2170/"
] | I suggest that, rather than voting, you work with your developers (or just senior developers if the team is too large) to get a consensus on how to amend the way you do version control. The reasons for this are (in no particular order):
1. The rest of the team may have good suggestions that you haven't come up with.
2... | I am one of the developers of [PollUnit](https://pollunit.com "PollUnit").
With our tool you can quickly prioritize tasks or find decisions with the least rejection (or highest acceptance).
Users can vote without account or can login with their google account.
Here are two examples (Dot Voting and Systemic Consensus... |
3,427 | I am working on an open source project, and we are looking to make changes to the way we do version control.
I want to propose several systems, and have the developers vote.
What would be a good platform for doing this, where the developers would not need to create an account to vote on something...
EDIT: Does any... | 2011/09/19 | [
"https://pm.stackexchange.com/questions/3427",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/2170/"
] | If you are all on the same Exchange server, just use the Outlook voting options. Otherwise, something like Google Forms would be a great idea. | Here are two voting solutions that I like:
* [Trello](http://www.trello.com) (created by founders of Stack Overflow) - allows users to vote items up and down
* [Google Moderator](https://www.google.com/moderator/) |
3,427 | I am working on an open source project, and we are looking to make changes to the way we do version control.
I want to propose several systems, and have the developers vote.
What would be a good platform for doing this, where the developers would not need to create an account to vote on something...
EDIT: Does any... | 2011/09/19 | [
"https://pm.stackexchange.com/questions/3427",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/2170/"
] | If you consider something long term as well, I would propose two options, both open source:
* <http://drupal.org/project/ideatorrent> (example -
<http://sourceforge.net/apps/ideatorrent/notepad-plus/>) - haven't
tried it, but it's worth considering for its simplicity. Slightly like Dell's IdeaStorm
(http://www.ideasto... | I am one of the developers of [PollUnit](https://pollunit.com "PollUnit").
With our tool you can quickly prioritize tasks or find decisions with the least rejection (or highest acceptance).
Users can vote without account or can login with their google account.
Here are two examples (Dot Voting and Systemic Consensus... |
3,427 | I am working on an open source project, and we are looking to make changes to the way we do version control.
I want to propose several systems, and have the developers vote.
What would be a good platform for doing this, where the developers would not need to create an account to vote on something...
EDIT: Does any... | 2011/09/19 | [
"https://pm.stackexchange.com/questions/3427",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/2170/"
] | If you are all on the same Exchange server, just use the Outlook voting options. Otherwise, something like Google Forms would be a great idea. | You never get the best answer by voting. Because not all your developers are experts in version control systems. It is better to get a group of the most competent developers and let them achieve a consensus. No software is required for that. |
3,427 | I am working on an open source project, and we are looking to make changes to the way we do version control.
I want to propose several systems, and have the developers vote.
What would be a good platform for doing this, where the developers would not need to create an account to vote on something...
EDIT: Does any... | 2011/09/19 | [
"https://pm.stackexchange.com/questions/3427",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/2170/"
] | I would:
1. Do a **Brainstorming & Painstorming** meeting to gather the requirements and problems
2. **Do a research** and find possible solutions
3. **Make a presentation** to share a research results with the others
4. **Do a survey** / voting
And for activity #4 I would suggest [SurveyMonkey](http://www.surveymonk... | Here are two voting solutions that I like:
* [Trello](http://www.trello.com) (created by founders of Stack Overflow) - allows users to vote items up and down
* [Google Moderator](https://www.google.com/moderator/) |
3,427 | I am working on an open source project, and we are looking to make changes to the way we do version control.
I want to propose several systems, and have the developers vote.
What would be a good platform for doing this, where the developers would not need to create an account to vote on something...
EDIT: Does any... | 2011/09/19 | [
"https://pm.stackexchange.com/questions/3427",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/2170/"
] | If you consider something long term as well, I would propose two options, both open source:
* <http://drupal.org/project/ideatorrent> (example -
<http://sourceforge.net/apps/ideatorrent/notepad-plus/>) - haven't
tried it, but it's worth considering for its simplicity. Slightly like Dell's IdeaStorm
(http://www.ideasto... | You never get the best answer by voting. Because not all your developers are experts in version control systems. It is better to get a group of the most competent developers and let them achieve a consensus. No software is required for that. |
3,427 | I am working on an open source project, and we are looking to make changes to the way we do version control.
I want to propose several systems, and have the developers vote.
What would be a good platform for doing this, where the developers would not need to create an account to vote on something...
EDIT: Does any... | 2011/09/19 | [
"https://pm.stackexchange.com/questions/3427",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/2170/"
] | If you consider something long term as well, I would propose two options, both open source:
* <http://drupal.org/project/ideatorrent> (example -
<http://sourceforge.net/apps/ideatorrent/notepad-plus/>) - haven't
tried it, but it's worth considering for its simplicity. Slightly like Dell's IdeaStorm
(http://www.ideasto... | Another long-term solution is <http://www.osqa.net> It satisfies all your requirements. |
3,427 | I am working on an open source project, and we are looking to make changes to the way we do version control.
I want to propose several systems, and have the developers vote.
What would be a good platform for doing this, where the developers would not need to create an account to vote on something...
EDIT: Does any... | 2011/09/19 | [
"https://pm.stackexchange.com/questions/3427",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/2170/"
] | I would:
1. Do a **Brainstorming & Painstorming** meeting to gather the requirements and problems
2. **Do a research** and find possible solutions
3. **Make a presentation** to share a research results with the others
4. **Do a survey** / voting
And for activity #4 I would suggest [SurveyMonkey](http://www.surveymonk... | Another long-term solution is <http://www.osqa.net> It satisfies all your requirements. |
3,427 | I am working on an open source project, and we are looking to make changes to the way we do version control.
I want to propose several systems, and have the developers vote.
What would be a good platform for doing this, where the developers would not need to create an account to vote on something...
EDIT: Does any... | 2011/09/19 | [
"https://pm.stackexchange.com/questions/3427",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/2170/"
] | If you consider something long term as well, I would propose two options, both open source:
* <http://drupal.org/project/ideatorrent> (example -
<http://sourceforge.net/apps/ideatorrent/notepad-plus/>) - haven't
tried it, but it's worth considering for its simplicity. Slightly like Dell's IdeaStorm
(http://www.ideasto... | Here are two voting solutions that I like:
* [Trello](http://www.trello.com) (created by founders of Stack Overflow) - allows users to vote items up and down
* [Google Moderator](https://www.google.com/moderator/) |
27,798,744 | In code:
```
<% @hotelUser=HotelUser.find( cookies[:user_id2]) %>
<%= debug @orderLast=Order.where(:email=>@hotelUser.email,"order.hotel_user_id IS NOT NULL").last%>
```
I am getting syntax error after executing this code.I want to search `hotel_user_id` where `hotel_user_id != nil or empty?`. Please tell me the ri... | 2015/01/06 | [
"https://Stackoverflow.com/questions/27798744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4380542/"
] | ```
Order.where(email: @hotelUser.email).where.not(hotel_user_id: nil)
``` | You can also do this
```
Order.where(email: @hotelUser.email).where("hotel_user_id <> ?", nil)
``` |
65,694,839 | I have a large data frame in which I am wanting to do element-wise multiplication but only for some columns. Here is an example of the DF
```
Name Age State Student_A Student_B Height_Student_A Height_Student_B
A 2 NZ 0.5 NA 0.5 0.2
B 1 AS 0.5 ... | 2021/01/13 | [
"https://Stackoverflow.com/questions/65694839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3962801/"
] | You can capture Student columns and Height columns and multiply them directly.
```
student_cols <- sort(grep('^Student', names(df), value = TRUE))
height_cols <- sort(grep('^Height', names(df), value = TRUE))
df[paste0('Score_', student_cols)] <- df[student_cols] * df[height_cols]
df
# Name Age State Student_A Stude... | Since R is vectorized you can multiply the columns directly to create the new columns:
```
DF$Score_Student_A <- DF$Student_A * DF$Height_Student_A
DF$Score_Student_B <- DF$Student_B * DF$Height_Student_B
``` |
65,694,839 | I have a large data frame in which I am wanting to do element-wise multiplication but only for some columns. Here is an example of the DF
```
Name Age State Student_A Student_B Height_Student_A Height_Student_B
A 2 NZ 0.5 NA 0.5 0.2
B 1 AS 0.5 ... | 2021/01/13 | [
"https://Stackoverflow.com/questions/65694839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3962801/"
] | You can capture Student columns and Height columns and multiply them directly.
```
student_cols <- sort(grep('^Student', names(df), value = TRUE))
height_cols <- sort(grep('^Height', names(df), value = TRUE))
df[paste0('Score_', student_cols)] <- df[student_cols] * df[height_cols]
df
# Name Age State Student_A Stude... | Late to the game, but it might help you (and address [@latlio's comment](https://stackoverflow.com/questions/65694839/element-wise-multiplication-but-only-select-columns#comment116153095_65694942)) to generalize this for other handling as well (since Ronak's deals quite well as a general solution for this data).
Resha... |
65,694,839 | I have a large data frame in which I am wanting to do element-wise multiplication but only for some columns. Here is an example of the DF
```
Name Age State Student_A Student_B Height_Student_A Height_Student_B
A 2 NZ 0.5 NA 0.5 0.2
B 1 AS 0.5 ... | 2021/01/13 | [
"https://Stackoverflow.com/questions/65694839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3962801/"
] | Late to the game, but it might help you (and address [@latlio's comment](https://stackoverflow.com/questions/65694839/element-wise-multiplication-but-only-select-columns#comment116153095_65694942)) to generalize this for other handling as well (since Ronak's deals quite well as a general solution for this data).
Resha... | Since R is vectorized you can multiply the columns directly to create the new columns:
```
DF$Score_Student_A <- DF$Student_A * DF$Height_Student_A
DF$Score_Student_B <- DF$Student_B * DF$Height_Student_B
``` |
14,286,597 | People frown upon the `center` tag, but for me it *always* works *just the way I want it*. Nevertheless, `center` is deprecated so I'll make an effort.
Now I see many people suggest the cryptic CSS `margin: 0 auto;` but I can't even get it to work (see fiddle [here](http://jsfiddle.net/MgcDU/1269/)). Other people will... | 2013/01/11 | [
"https://Stackoverflow.com/questions/14286597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/707381/"
] | You can set `.container { text-align:center; }` so that everything inside `div.container` will be centered.
In general, there are two ways centering things.
1. To center inline elements (such as text, spans and images) inside their parents, set `text-align: center;` on the parent.
2. To center a block level element... | `<span>` is an inline element. `<div>` is a block element. That's why it is not centering.
```
<div class="container" style='float:left; width:100%; text-align:center;'>
<span class='btn btn-primary'>Click me!</span>
</div>
```
You can center the content of span only when you convert it into block, using 'inline-b... |
14,286,597 | People frown upon the `center` tag, but for me it *always* works *just the way I want it*. Nevertheless, `center` is deprecated so I'll make an effort.
Now I see many people suggest the cryptic CSS `margin: 0 auto;` but I can't even get it to work (see fiddle [here](http://jsfiddle.net/MgcDU/1269/)). Other people will... | 2013/01/11 | [
"https://Stackoverflow.com/questions/14286597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/707381/"
] | `Span` is an inline element, and the `margin: 0 auto` for centering only works on non-inline elements that have a width that is less than 100%.
One option is to set an alignment on the container, though this probably isn't what you want for this situation:
```
div.container { text-align: center }
```
<http://jsfidd... | `<span>` is an inline element. `<div>` is a block element. That's why it is not centering.
```
<div class="container" style='float:left; width:100%; text-align:center;'>
<span class='btn btn-primary'>Click me!</span>
</div>
```
You can center the content of span only when you convert it into block, using 'inline-b... |
14,286,597 | People frown upon the `center` tag, but for me it *always* works *just the way I want it*. Nevertheless, `center` is deprecated so I'll make an effort.
Now I see many people suggest the cryptic CSS `margin: 0 auto;` but I can't even get it to work (see fiddle [here](http://jsfiddle.net/MgcDU/1269/)). Other people will... | 2013/01/11 | [
"https://Stackoverflow.com/questions/14286597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/707381/"
] | You make the span block level, give it a width so margin:auto works
see this [fiddle](http://jsfiddle.net/faeLG/)
```
.center {
display:block;
margin:auto auto;
width:150px; //all rules upto here are important the rest are styling
border:1px solid black;
padding:5px;
... | `<span>` is an inline element. `<div>` is a block element. That's why it is not centering.
```
<div class="container" style='float:left; width:100%; text-align:center;'>
<span class='btn btn-primary'>Click me!</span>
</div>
```
You can center the content of span only when you convert it into block, using 'inline-b... |
14,286,597 | People frown upon the `center` tag, but for me it *always* works *just the way I want it*. Nevertheless, `center` is deprecated so I'll make an effort.
Now I see many people suggest the cryptic CSS `margin: 0 auto;` but I can't even get it to work (see fiddle [here](http://jsfiddle.net/MgcDU/1269/)). Other people will... | 2013/01/11 | [
"https://Stackoverflow.com/questions/14286597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/707381/"
] | `Span` is an inline element, and the `margin: 0 auto` for centering only works on non-inline elements that have a width that is less than 100%.
One option is to set an alignment on the container, though this probably isn't what you want for this situation:
```
div.container { text-align: center }
```
<http://jsfidd... | You can set `.container { text-align:center; }` so that everything inside `div.container` will be centered.
In general, there are two ways centering things.
1. To center inline elements (such as text, spans and images) inside their parents, set `text-align: center;` on the parent.
2. To center a block level element... |
14,286,597 | People frown upon the `center` tag, but for me it *always* works *just the way I want it*. Nevertheless, `center` is deprecated so I'll make an effort.
Now I see many people suggest the cryptic CSS `margin: 0 auto;` but I can't even get it to work (see fiddle [here](http://jsfiddle.net/MgcDU/1269/)). Other people will... | 2013/01/11 | [
"https://Stackoverflow.com/questions/14286597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/707381/"
] | You can set `.container { text-align:center; }` so that everything inside `div.container` will be centered.
In general, there are two ways centering things.
1. To center inline elements (such as text, spans and images) inside their parents, set `text-align: center;` on the parent.
2. To center a block level element... | You make the span block level, give it a width so margin:auto works
see this [fiddle](http://jsfiddle.net/faeLG/)
```
.center {
display:block;
margin:auto auto;
width:150px; //all rules upto here are important the rest are styling
border:1px solid black;
padding:5px;
... |
14,286,597 | People frown upon the `center` tag, but for me it *always* works *just the way I want it*. Nevertheless, `center` is deprecated so I'll make an effort.
Now I see many people suggest the cryptic CSS `margin: 0 auto;` but I can't even get it to work (see fiddle [here](http://jsfiddle.net/MgcDU/1269/)). Other people will... | 2013/01/11 | [
"https://Stackoverflow.com/questions/14286597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/707381/"
] | You can set `.container { text-align:center; }` so that everything inside `div.container` will be centered.
In general, there are two ways centering things.
1. To center inline elements (such as text, spans and images) inside their parents, set `text-align: center;` on the parent.
2. To center a block level element... | Your parent element needs to have a larger width in order to let a child element be positioned within it. After that the trick with `margin: 0 auto;` is getting the parent and child container `position` and `display` values to be compatible with each other.
```
.container {
border: 2px dashed;
width: 100%;}
.btn ... |
14,286,597 | People frown upon the `center` tag, but for me it *always* works *just the way I want it*. Nevertheless, `center` is deprecated so I'll make an effort.
Now I see many people suggest the cryptic CSS `margin: 0 auto;` but I can't even get it to work (see fiddle [here](http://jsfiddle.net/MgcDU/1269/)). Other people will... | 2013/01/11 | [
"https://Stackoverflow.com/questions/14286597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/707381/"
] | `Span` is an inline element, and the `margin: 0 auto` for centering only works on non-inline elements that have a width that is less than 100%.
One option is to set an alignment on the container, though this probably isn't what you want for this situation:
```
div.container { text-align: center }
```
<http://jsfidd... | You make the span block level, give it a width so margin:auto works
see this [fiddle](http://jsfiddle.net/faeLG/)
```
.center {
display:block;
margin:auto auto;
width:150px; //all rules upto here are important the rest are styling
border:1px solid black;
padding:5px;
... |
14,286,597 | People frown upon the `center` tag, but for me it *always* works *just the way I want it*. Nevertheless, `center` is deprecated so I'll make an effort.
Now I see many people suggest the cryptic CSS `margin: 0 auto;` but I can't even get it to work (see fiddle [here](http://jsfiddle.net/MgcDU/1269/)). Other people will... | 2013/01/11 | [
"https://Stackoverflow.com/questions/14286597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/707381/"
] | `Span` is an inline element, and the `margin: 0 auto` for centering only works on non-inline elements that have a width that is less than 100%.
One option is to set an alignment on the container, though this probably isn't what you want for this situation:
```
div.container { text-align: center }
```
<http://jsfidd... | Your parent element needs to have a larger width in order to let a child element be positioned within it. After that the trick with `margin: 0 auto;` is getting the parent and child container `position` and `display` values to be compatible with each other.
```
.container {
border: 2px dashed;
width: 100%;}
.btn ... |
14,286,597 | People frown upon the `center` tag, but for me it *always* works *just the way I want it*. Nevertheless, `center` is deprecated so I'll make an effort.
Now I see many people suggest the cryptic CSS `margin: 0 auto;` but I can't even get it to work (see fiddle [here](http://jsfiddle.net/MgcDU/1269/)). Other people will... | 2013/01/11 | [
"https://Stackoverflow.com/questions/14286597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/707381/"
] | You make the span block level, give it a width so margin:auto works
see this [fiddle](http://jsfiddle.net/faeLG/)
```
.center {
display:block;
margin:auto auto;
width:150px; //all rules upto here are important the rest are styling
border:1px solid black;
padding:5px;
... | Your parent element needs to have a larger width in order to let a child element be positioned within it. After that the trick with `margin: 0 auto;` is getting the parent and child container `position` and `display` values to be compatible with each other.
```
.container {
border: 2px dashed;
width: 100%;}
.btn ... |
26,979,711 | I am limited to python2.5, and I thought that threading.Thread was asynchronous. I run: python t.py and the script does not return to the shell until 3 seconds have gone by, which means its blocking. Why is it blocking?
My Code:
```
#!/usr/bin/python
import threading,time
def doit():
time.sleep(3)
print "DONE"
... | 2014/11/17 | [
"https://Stackoverflow.com/questions/26979711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/420259/"
] | By default, threads in Python are non-daemonic. A Python application [will not exit](https://docs.python.org/2.7/library/threading.html#thread-objects) until the all non-daemon threads have completed, so in your case it won't exit until `doit` has finished. If you want to script to exit immediately upon reaching the en... | Threading in Python is "kind-of" asynchronous. What does this mean?
* Only one thread can be running Python code at one time
* threads that are Python code and CPU intensive will not benefit
Your issue seems to be that you think a Python thread should keep running after Python itself quits -- that's not how it works.... |
708,958 | Corpuscular theory of light States that:
>
> Light is made up of small discrete particles called "corpuscles" (little particles) which travel in a straight line with a finite velocity.
>
>
>
According to Einstein,
>
> Light is composed of small particle are known as photons. And energy of a photon is given by $... | 2022/05/16 | [
"https://physics.stackexchange.com/questions/708958",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/319695/"
] | The corpuscular theory was opposed to the wave theory, and was rejected when diffraction experiments confirmed the wave theory. The blackbody spectrum also confirmed the wave theory at low frequencies, but at high frequencies it didn't work. Thus, the photon theory emerged with its counterintuitive mix of particle and ... | As an example, when using the corpuscular theory refraction of light and Snell’s Law is predicted using Newtonian Mechanics but a requirement of the theory is that the speed of light in glass is greater than that in air which is found by experiment not to be true. Theory related to photons have the speeds in different ... |
12,576,178 | How come I've never heard of the term [MapReduce](http://en.wikipedia.org/wiki/MapReduce) when using relational database (RDBMS)? And now suddenly with [NoSQL](http://en.wikipedia.org/wiki/NoSQL) MapReduce is everywhere. I would just like to understand in general sense why there's no MapReduce concept in relational dat... | 2012/09/25 | [
"https://Stackoverflow.com/questions/12576178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/52752/"
] | Judging by what the Wiki article you linked to has to say, MapReduce is an implementation technique. One of many possible others.
The relational model was invented precisely so that implementation techniques could be **abstracted away** from the user.
It is quite telling that certain people now start "movements" that... | <https://www.coursera.org/#course/bigdata> |
71,712,669 | I am making a percentage updating Loading bar(Label) which should automatically start when my program has started. When the 'Loading bar' hits 100%, the 'Loading bar' should be removed, and the rest of the program should continue, although when I am starting the program, the window does not respond until about 5 second... | 2022/04/01 | [
"https://Stackoverflow.com/questions/71712669",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17814262/"
] | Here is a [stackblitz demo](https://stackblitz.com/edit/angular-hewot8?file=src%2Fapp%2Fselect-overview-example.ts) of what you would like to achieve.
I used the `ngClass` directive and `selectionChange` event on `mat-select` to detect the option selection. | You can try ng-style
```
ng-style="IfCondition1 ? checkAnotherCondition && {'color':'red'} : {'color': 'green','font-weight':'bolder'}"
``` |
34,807,591 | I'm beginner in WPF and MVVM, but want to learn it by building some small project.
I've got a WPF app using the Model-View-ViewModel pattern, based on [Rachel Lim](https://rachel53461.wordpress.com/2011/12/18/navigation-with-mvvm-2/) example. In my app I have 2 views - EmployeesList and EmployeeDetails.
List of empl... | 2016/01/15 | [
"https://Stackoverflow.com/questions/34807591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5088581/"
] | *How to change view when I double-click on a row*
First, you need to add EventTrigger for MouseDoubleClick event:
```
<DataGrid Name="gridEmployees" ItemsSource="{Binding Employees}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<local:CustomCommandAct... | It looks like you're missing a needed element to show the selected view. If you look at the linked sample note the *ItemsControl* is contained within a *Border* which is in turn inside a *DockPanel*.
Below the *DockPanel* there is a *ContentControl* which is a key element needed to show the selected view. |
46,992 | In the U.S. today the Republican Party and its partisans use much more patriotic imagery than its opposition. Conservatives highly value loyalty (see Haidt's [moral foundations theory](https://en.wikipedia.org/wiki/Moral_foundations_theory)). The national flag itself appears to be neutral, but it is sort of owned by on... | 2018/07/05 | [
"https://history.stackexchange.com/questions/46992",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/18968/"
] | National flags represent the country... or the state?
Ok, in the books it is the country, but the state is who actually manages the country. And of course, patriotism and nationalism are powerful tools, so it makes sense to use them.
If you are lucky, the state (and those who support the *status quo*) will not use th... | Pretty much every national symbol stems from partisan/patriotic sentiment.
That's how they became national symbols in the first place, they have over time become synonymous with a country.
So in your specific case (as in most all of them) it's the other way around from what you're trying to say, the US flag isn't part... |
46,992 | In the U.S. today the Republican Party and its partisans use much more patriotic imagery than its opposition. Conservatives highly value loyalty (see Haidt's [moral foundations theory](https://en.wikipedia.org/wiki/Moral_foundations_theory)). The national flag itself appears to be neutral, but it is sort of owned by on... | 2018/07/05 | [
"https://history.stackexchange.com/questions/46992",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/18968/"
] | National symbols are always non-partisan; but from time to time one party or another may wish to disassociate itself from them. In 2012 the Democrats were not the least shy about use of the American flag, because they were in power.
[](https://i.stack... | Pretty much every national symbol stems from partisan/patriotic sentiment.
That's how they became national symbols in the first place, they have over time become synonymous with a country.
So in your specific case (as in most all of them) it's the other way around from what you're trying to say, the US flag isn't part... |
46,992 | In the U.S. today the Republican Party and its partisans use much more patriotic imagery than its opposition. Conservatives highly value loyalty (see Haidt's [moral foundations theory](https://en.wikipedia.org/wiki/Moral_foundations_theory)). The national flag itself appears to be neutral, but it is sort of owned by on... | 2018/07/05 | [
"https://history.stackexchange.com/questions/46992",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/18968/"
] | Let me present a specific example from Central Europe.
The [Árpád-stripes:](https://en.wikipedia.org/wiki/%C3%81rp%C3%A1d_stripes)
[](https://i.stack.imgur.com/loXP7.png)
Originally it was the heraldic device of the Árpád-dynasty. Of course there ... | Pretty much every national symbol stems from partisan/patriotic sentiment.
That's how they became national symbols in the first place, they have over time become synonymous with a country.
So in your specific case (as in most all of them) it's the other way around from what you're trying to say, the US flag isn't part... |
46,992 | In the U.S. today the Republican Party and its partisans use much more patriotic imagery than its opposition. Conservatives highly value loyalty (see Haidt's [moral foundations theory](https://en.wikipedia.org/wiki/Moral_foundations_theory)). The national flag itself appears to be neutral, but it is sort of owned by on... | 2018/07/05 | [
"https://history.stackexchange.com/questions/46992",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/18968/"
] | Pretty much every national symbol stems from partisan/patriotic sentiment.
That's how they became national symbols in the first place, they have over time become synonymous with a country.
So in your specific case (as in most all of them) it's the other way around from what you're trying to say, the US flag isn't part... | I would argue that at least in the United States southern conservatives traditionally drape themselves in the flag to show their patriotism. There is a public display factor in the practice. Perhaps this is the nature of conservatism, which cherish history and it's symbols rather than more forward looking expressions o... |
46,992 | In the U.S. today the Republican Party and its partisans use much more patriotic imagery than its opposition. Conservatives highly value loyalty (see Haidt's [moral foundations theory](https://en.wikipedia.org/wiki/Moral_foundations_theory)). The national flag itself appears to be neutral, but it is sort of owned by on... | 2018/07/05 | [
"https://history.stackexchange.com/questions/46992",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/18968/"
] | National flags represent the country... or the state?
Ok, in the books it is the country, but the state is who actually manages the country. And of course, patriotism and nationalism are powerful tools, so it makes sense to use them.
If you are lucky, the state (and those who support the *status quo*) will not use th... | National symbols are always non-partisan; but from time to time one party or another may wish to disassociate itself from them. In 2012 the Democrats were not the least shy about use of the American flag, because they were in power.
[](https://i.stack... |
46,992 | In the U.S. today the Republican Party and its partisans use much more patriotic imagery than its opposition. Conservatives highly value loyalty (see Haidt's [moral foundations theory](https://en.wikipedia.org/wiki/Moral_foundations_theory)). The national flag itself appears to be neutral, but it is sort of owned by on... | 2018/07/05 | [
"https://history.stackexchange.com/questions/46992",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/18968/"
] | National flags represent the country... or the state?
Ok, in the books it is the country, but the state is who actually manages the country. And of course, patriotism and nationalism are powerful tools, so it makes sense to use them.
If you are lucky, the state (and those who support the *status quo*) will not use th... | Let me present a specific example from Central Europe.
The [Árpád-stripes:](https://en.wikipedia.org/wiki/%C3%81rp%C3%A1d_stripes)
[](https://i.stack.imgur.com/loXP7.png)
Originally it was the heraldic device of the Árpád-dynasty. Of course there ... |
46,992 | In the U.S. today the Republican Party and its partisans use much more patriotic imagery than its opposition. Conservatives highly value loyalty (see Haidt's [moral foundations theory](https://en.wikipedia.org/wiki/Moral_foundations_theory)). The national flag itself appears to be neutral, but it is sort of owned by on... | 2018/07/05 | [
"https://history.stackexchange.com/questions/46992",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/18968/"
] | National flags represent the country... or the state?
Ok, in the books it is the country, but the state is who actually manages the country. And of course, patriotism and nationalism are powerful tools, so it makes sense to use them.
If you are lucky, the state (and those who support the *status quo*) will not use th... | I would argue that at least in the United States southern conservatives traditionally drape themselves in the flag to show their patriotism. There is a public display factor in the practice. Perhaps this is the nature of conservatism, which cherish history and it's symbols rather than more forward looking expressions o... |
46,992 | In the U.S. today the Republican Party and its partisans use much more patriotic imagery than its opposition. Conservatives highly value loyalty (see Haidt's [moral foundations theory](https://en.wikipedia.org/wiki/Moral_foundations_theory)). The national flag itself appears to be neutral, but it is sort of owned by on... | 2018/07/05 | [
"https://history.stackexchange.com/questions/46992",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/18968/"
] | National symbols are always non-partisan; but from time to time one party or another may wish to disassociate itself from them. In 2012 the Democrats were not the least shy about use of the American flag, because they were in power.
[](https://i.stack... | I would argue that at least in the United States southern conservatives traditionally drape themselves in the flag to show their patriotism. There is a public display factor in the practice. Perhaps this is the nature of conservatism, which cherish history and it's symbols rather than more forward looking expressions o... |
46,992 | In the U.S. today the Republican Party and its partisans use much more patriotic imagery than its opposition. Conservatives highly value loyalty (see Haidt's [moral foundations theory](https://en.wikipedia.org/wiki/Moral_foundations_theory)). The national flag itself appears to be neutral, but it is sort of owned by on... | 2018/07/05 | [
"https://history.stackexchange.com/questions/46992",
"https://history.stackexchange.com",
"https://history.stackexchange.com/users/18968/"
] | Let me present a specific example from Central Europe.
The [Árpád-stripes:](https://en.wikipedia.org/wiki/%C3%81rp%C3%A1d_stripes)
[](https://i.stack.imgur.com/loXP7.png)
Originally it was the heraldic device of the Árpád-dynasty. Of course there ... | I would argue that at least in the United States southern conservatives traditionally drape themselves in the flag to show their patriotism. There is a public display factor in the practice. Perhaps this is the nature of conservatism, which cherish history and it's symbols rather than more forward looking expressions o... |
13,647,765 | My winforms application needs to interact with hardware devices.
The display is kind of workflow... after step 1 .. completed.. go to step 2 .. etc.
The display is dynamic with controls being made visible at run time and activity being initiated (each of these User controls use timer/ BGWorker within).
I m Raising cus... | 2012/11/30 | [
"https://Stackoverflow.com/questions/13647765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866594/"
] | You're getting a leak because the dataArray property is declared with retain, which means that when you use self (thus you use the setter), your retain count goes up to 2 and you only release it once. On the other hand, if you only use the ivar, the retain count is 1 (because of alloc) and you release it once, which is... | If you use the `self.` signature you are accessing to the object via automatically generated / custom getter/setter. The setter will tipically manage the memory and you don't need to do that.
If you don't use self you access directly to the object.
The code what you presented is leaking, because the default setter of ... |
13,647,765 | My winforms application needs to interact with hardware devices.
The display is kind of workflow... after step 1 .. completed.. go to step 2 .. etc.
The display is dynamic with controls being made visible at run time and activity being initiated (each of these User controls use timer/ BGWorker within).
I m Raising cus... | 2012/11/30 | [
"https://Stackoverflow.com/questions/13647765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866594/"
] | You're getting a leak because the dataArray property is declared with retain, which means that when you use self (thus you use the setter), your retain count goes up to 2 and you only release it once. On the other hand, if you only use the ivar, the retain count is 1 (because of alloc) and you release it once, which is... | What's happening here is that `alloc` is adding one to the retain count of the new object. The property reference is also retaining the object. If you want to do it this way, you only want one of those. A common method is:
```
self.dataArray = [[[NSMutableArray alloc]init] autorelease];
```
However, better still is ... |
13,647,765 | My winforms application needs to interact with hardware devices.
The display is kind of workflow... after step 1 .. completed.. go to step 2 .. etc.
The display is dynamic with controls being made visible at run time and activity being initiated (each of these User controls use timer/ BGWorker within).
I m Raising cus... | 2012/11/30 | [
"https://Stackoverflow.com/questions/13647765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866594/"
] | If you use the `self.` signature you are accessing to the object via automatically generated / custom getter/setter. The setter will tipically manage the memory and you don't need to do that.
If you don't use self you access directly to the object.
The code what you presented is leaking, because the default setter of ... | What's happening here is that `alloc` is adding one to the retain count of the new object. The property reference is also retaining the object. If you want to do it this way, you only want one of those. A common method is:
```
self.dataArray = [[[NSMutableArray alloc]init] autorelease];
```
However, better still is ... |
326,528 | Is it correct and natural to use both the present simple and the present continuous for future scheduled events? For example:
>
> I go home tomorrow at 4pm.
>
>
> I'm going home tomorrow at 4pm.
>
>
>
By that I mean that my bus leaves at 4pm. | 2022/11/02 | [
"https://ell.stackexchange.com/questions/326528",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/60696/"
] | Using the simple present to describe a future activity usually implies that that activity is happening *according to a schedule*, as is the case in your first example sentence. So your first sentence roughly means, "I am scheduled to go home tomorrow at 4", and it also implies that you intend to follow that schedule.
... | There's a *slight* nuance of difference in that OP's first (present simple) version tends to imply "by arrangement" - often meaning the speaker is somehow *constrained / obliged* to carry out the "planned" future action (a plan perhaps enforced by someone else, or by circumstances).
The second (present continuous) phr... |
3,123,530 | I have a number of "section items" (Lesson, Info) which inherit from the common type SectionItem. The various types of SectionItems share **some** but not all properties.
I have found the best way to pass parameters to each kind of object is to pack them all in a **`Dictionary<string, object>`** and then let the base... | 2010/06/26 | [
"https://Stackoverflow.com/questions/3123530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4639/"
] | Can you just create a 'parameters' class for each SectionItem class?
```
public class SectionItemParameters
{
public string Title { get; set; }
}
public class SectionItemLessonParameters
: SectionItemParameters
{
public int SectionNumber { get; set; }
public DateTime StartDate { get; set; }
publi... | If the set of possible names is known at compile time and using C#4 you could use default/optional parameters on the constructor. If only certain combinations are valid (e.g. only supply "Foo" if neither "Bar" and "Baz" are supplied) then you will still need runtime checks.
But if the set of names is truly dynamic, th... |
43,543 | I'm asked to find a system that is modeled (or at least approximated) by $x'(t)=\sin (x(t))$
Differentiate yields $x''(t)=\cos (x(t)) \sin (x(t))$ and integrating (care of [Wolfram Alpha](http://www.wolframalpha.com/input/?i=integral+x%27%28t%29%3Dsin%28x%28t%29%29) ) yields $x(t)=2 \cot ^{-1}(e^{-c-t})$ , but I am at... | 2011/06/06 | [
"https://math.stackexchange.com/questions/43543",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/6968/"
] | An inverted pendulum in a very viscous medium. | Imagine a bowl whose shape is given in cylindrical coordinates by $z=c-\frac{1}{2g}\sin^2(r)$ for $r\in[0,\frac{\pi}{2}]$ say. Then take a ball and place it at rest anywhere in this bowl. The energy of the ball is $E = \frac{1}{2}mr^{\prime2}+mgz$, so $\frac{1}{2}r^{\prime2} = \frac{E}{m}-g(c-\frac{1}{2g}\sin^2(r)) = \... |
1,894,320 | Prove that $(k^k)$ is periodic modulo 3 and find its period. Not sure how to approach this.
Edit: So I know the sequence is 1, 1, 0, 1, 2, 0, ... (plugging in k = 1, 2, 3, ...) so I think the period should be 6 since thats the length of each cycle. I also know a function f(x) is periodic if there exists some minimum n... | 2016/08/16 | [
"https://math.stackexchange.com/questions/1894320",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/361803/"
] | **Hint** $\ $ mod prime $\, p\!:\,\ (k+(p\!-\!1)p)^{\large k+(p-1)p}\equiv k^{\large k} k^{\large (p-1)p} \equiv k^{\large k}\ $ by little Fermat | The sequence has period $6$, i.e., is $(1,1,0,1,2,0,\cdots)$. The periodicity has been proved in the paper [On the last digit and the last non-zero digit of $n^n$ in base $b$](http://arxiv.org/abs/1203.4066), by Grau and Oller-Marcin. In section $3$ they discuss the case $b=3$. The sequence is [A204688 in OEIS](http://... |
1,894,320 | Prove that $(k^k)$ is periodic modulo 3 and find its period. Not sure how to approach this.
Edit: So I know the sequence is 1, 1, 0, 1, 2, 0, ... (plugging in k = 1, 2, 3, ...) so I think the period should be 6 since thats the length of each cycle. I also know a function f(x) is periodic if there exists some minimum n... | 2016/08/16 | [
"https://math.stackexchange.com/questions/1894320",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/361803/"
] | **Hint** $\ $ mod prime $\, p\!:\,\ (k+(p\!-\!1)p)^{\large k+(p-1)p}\equiv k^{\large k} k^{\large (p-1)p} \equiv k^{\large k}\ $ by little Fermat | if $k \equiv\_3 0$ then $k^k\equiv\_3 0$
if $k \equiv\_3 1$ then $k^k\equiv\_3 1$
if $k \equiv\_3 -1$ then $k^k \equiv\_3 (-1)^k$ |
69,365,473 | I got a new computer yesterday. I am coding in Android Studio for a course that I'm taking, and I figured it would be as easy as re-downloading Android Studio and cloning my repo onto the new computer. It isn't.
Something is messed up about my Gradle version, and I don't have the time to figure it out before the next ... | 2021/09/28 | [
"https://Stackoverflow.com/questions/69365473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13965343/"
] | It's very straightforward to do it:
1. Clone the desired original project
2. Add your desired code on top of the clone
3. Add & commit your changed
4. Now you can push your changes in several ways:
* You can have a new commit
`git push origin <branch name>`
* You can overwrite the current commit on your remote
`g... | Yes, you can.
You just have to link your new local project to the git repository,
once you push the new changes they will erase the old ones. |
48,230,507 | I want to pull out the pre-deployment Flyway version number of my production database so I can use this in my continuous deployment pipeline (Jenkins) in case I do a rollback later.
How can I achieve this?
One option would be to query the flyway history table, but I can't work out a fail-safe way of achieving this. | 2018/01/12 | [
"https://Stackoverflow.com/questions/48230507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/167364/"
] | I have fashioned an answer, although it feels like a big of a hack. I run --dryRunOutput in migrate as a means to get flyway to output the version number to the screen, as info doesn't do this for some reason.
I read the output into a file (because DOS makes it hard to pipe or pass into a variable) then isolate the ou... | The following one-liner does what you want:
`flyway info | grep Success | tail -1 | cut -f3 "-d|" | xargs` |
36,171,536 | I am trying to learn a bit about Vala and wanted to create a Calculator to test how Gtk worked. The problem is that I coded everything around the supposition that there would be a way to parse a string that contained the required operations. Something like this:
```
string operation = "5+2/3*4"
```
I have done this ... | 2016/03/23 | [
"https://Stackoverflow.com/questions/36171536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6102615/"
] | Here's something I found that would do the work. I used the C++ libmatheval library, for this I first required a vapi file to bind it to Vala. Which I found [here](https://github.com/nemequ/vala-extra-vapis/blob/master/libmatheval.vapi). There are a lot of available vapi files under the project named [vala-extra-apis](... | You could parse the expression using `libvala` (which is part of the compiler).
The [compiler creates](https://git.gnome.org/browse/vala/tree/compiler/valacompiler.vala#n176) a `CodeContext` and runs the Vala parser over a (or several) .vala file(s).
You could then create your own `CodeVisitor` decendant class that v... |
58,231,489 | ```
if not len(blurred.shape) == 2:
gray = cv2.cvtColor(blurred, cv2.COLOR_RGB2GRAY)
else:
gray = blurred
edge = cv2.Canny(gray, 50, 150)
circles = AHTforCircles(edge,center_threhold_factor=params[i]['center_threhold_factor'],score_threhold=params[i]['s... | 2019/10/04 | [
"https://Stackoverflow.com/questions/58231489",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11752565/"
] | Use `connect by` with `listagg` as following:
```
SQL> WITH MAIN_QUERY AS (
2 SELECT
3 8 AS VAL,
4 1 AS STEP,
5 5 RANG
6 FROM
7 DUAL
8 )
9 SELECT
10 LISTAGG(VAL +((LEVEL - 1) * STEP), ',') WITHIN GROUP(
11 ORDER BY
12 LEVEL
... | **You can try this:**
use with statement.
```
with main as
(select 8 as start_value , 1 as step , 5 range from dual)
,sub as ( SELECT LEVEL AS colval
FROM main
CONNECT BY LEVEL < start_value+range*step
)
,sub2 as(
select * from
sub,main
where colval>=start_value
)
sel... |
62,440,274 | I've tried to research online, but no other questions were able to help me with my issue.
Here's my scenario.
I am making a mute command in discord.py.
I want the time to be optional, but if the time is not specified I want that argument to be part of the reason.
Clarification on what I mean:
```py
@client.command... | 2020/06/18 | [
"https://Stackoverflow.com/questions/62440274",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12422515/"
] | You can optionally wait asynchronously and then unmute the user:
```
@bot.command()
async def mute(ctx, member: discord.Member, time: typing.Optional[int]):
await member.edit(mute=True)
if time:
await asyncio.sleep(time)
await member.edit(mute=False)
``` | You can set a default argument:
```py
@bot.command()
async def mute(ctx, member: discord.Member, time=None):
if not time:
# Mute indefinitely? do whatever you want
else:
# Mute for x amount of time
```
---
**References:**
* [Default arguments](https://www.programiz.com/python-programming/fu... |
52,996,286 | I have query on how to compare two lists?
This is my case scenario.
I have two `ArrayList` (`nameList<String>` and `countList<Integer>`). Both lists can contain duplicate values and size of both lists is also same.
Now I have to merge these 2 lists as a key-value pair. For this, I had created a custom List of ... | 2018/10/25 | [
"https://Stackoverflow.com/questions/52996286",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8282324/"
] | Using `duplicated` with `apply`
```
apply(df,1,duplicated)
[,1] [,2] [,3]
[1,] FALSE FALSE FALSE
[2,] FALSE TRUE TRUE
[3,] FALSE TRUE FALSE
```
And replace it with `NA`
```
df[t(apply(df,1,duplicated))]=NA
df
label val val1
1 a x z
2 b <NA> <NA>
3 c <NA> d
``` | Here are couple of options
Using base R `apply` we `replace` the `duplicated` values to `NA` for each row
```
df[] <- t(apply(df, 1, function(x) replace(x, duplicated(x), NA)))
df
# label val val1
#1 a x z
#2 b <NA> <NA>
#3 c <NA> d
```
---
Or another alternative using `dplyr` and `tidyr` i... |
59,726,608 | I am trying to edit a zip file in memory in Go and return the zipped file through a HTTP response
The goal is to add a few files to a path in the zip file example
I add a `log.txt` file in my `path/to/file` route in the zipped folder
All this should be done without saving the file or editing the original file. | 2020/01/14 | [
"https://Stackoverflow.com/questions/59726608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4920718/"
] | I have implemented a simple version of real-time stream compression, which can correctly compress a single file. If you want it to run efficiently, you need a lot of optimization.
This is only for reference. If you need more information, you should set more useful HTTP header information before compression so that the... | So after hours of tireless work i figured out my approach was bad or maybe not possible with the level of my knowledge so here is a not so optimal solution but it works and fill ur file is not large it should be okay for you.
So you have a file template.zip and u want to add extra files, my initial approach was to cop... |
60,082,726 | I'm trying to publish an app to azure app service but the problem i'm getting is http 307 status which is for temporary redirection.
In my startup.cs i've already configured the app to use SSL port 443.
but after checking logs i'm getting.
```
2020-02-05 09:15:00.1616|INFO|Microsoft.AspNetCore.Hosting.Internal.WebHost... | 2020/02/05 | [
"https://Stackoverflow.com/questions/60082726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6623590/"
] | Your port 443 is probably occupied. | The problem was related to UserSecrets.Json since it was not available in the production so when i was trying to add google authentication it was throwing error.
As suggested by @John Hanley when i added try catch i got the iishttpserver error.
Which was coming due to client id and client secret was unable to found on.... |
37,470,072 | I have a function with a docstring as follows,
```
def func(x):
'''Boring function
Notes
-----
Let :math:`\bar{x}_k = \sum_{i=1}^{n_k}x_{ik}`,
'''
return x
```
But the `\bar` command in Latex renders as "ar",
[](https://i... | 2016/05/26 | [
"https://Stackoverflow.com/questions/37470072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2170613/"
] | Python is interpreting the backslashes. You need to pass the backslashes through so LaTeX can interpret them; you should use a [raw string](https://stackoverflow.com/questions/2081640/what-exactly-do-u-and-r-string-flags-do-in-python-and-what-are-raw-string-l) to do so:
```
def func(x):
# Note the r!
r'''Bori... | Alternative answer for future visitors: use two backslashes instead of one. It's useful for formatting formulas as we saw above, but also for uses like:
```
print("/!\\ Error encountered.")
``` |
5,339,593 | "strace is a system call tracer, i.e. a debugging tool which prints out a trace of all the system calls made by a another process/program."
What if the systems calls works recursively or one system call calls another system call. How can I get this information?
Possible Solution - We can create a simple variable ind... | 2011/03/17 | [
"https://Stackoverflow.com/questions/5339593",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/204623/"
] | System calls are defined as the boundary between kernel and user space, so any recursion there happens inside the kernel and cannot be intercepted.
`strace` works by attaching to the process as a debugger, letting it run free except when a system call is triggered, at which point the parameters and return values are p... | If you have root access, you can use ftrace to trace kernel function calls, and filter by the names of the kernel-side syscall interfaces.
Use function\_graph as the tracer (see <https://lwn.net/Articles/366796/> for an explanation).
Since the "original syscall" also passed through such a call, you would clearly see a... |
30,531,026 | I have a list that uses float to show keys and values on alternative sides of the div.
The problem I'm having is that when there's a long string as a key, which is floated, instead of breaking onto multiple lines, the entire line moves down onto a new line.
Here's an example : <http://jsfiddle.net/3djakgf7/>
This di... | 2015/05/29 | [
"https://Stackoverflow.com/questions/30531026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3359782/"
] | Something like this should work, with the addition of the special case call\_me\_t<0>
```
template <int N>
struct call_me_t
{
static void exec(int i)
{
if (i < N)
call_me_t<N-1>::exec(i) ;
else if (i == N)
call_me(custom_type<N>()) ;
}
} ;
template<>
struct call_me_t<0>
{
... | You may use the following:
```
template <std::size_t I>
void call_me_with_custom_type()
{
call_me(custom_type<I>());
}
namespace detail
{
template <std::size_t ... Is>
void foo(std::index_sequence<Is...>, int i)
{
std::function<void()> calls[] = {call_me_with_custom_type<Is>...};
cal... |
125,225 | Given the same amount of exposure, sometimes you may prefer smaller or bigger aperture because you may want high or low depth of field.
Similarly, sometimes you may prefer slow or fast shutter speed, because you may want to freeze the action or you may want the blurred effect.
In case of ISO, is there ever a reason... | 2021/06/18 | [
"https://photo.stackexchange.com/questions/125225",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/99572/"
] | Apart from the obvious consideration that high ISOs will be preferred in situations of low available light, one further point not yet mentioned is that in the context of film, different emulsions with different ISO ratings have vastly different grain characteristics. Sometimes prominent grain (high ISO) is chosen for i... | You may want to force the camera to use a different noise reduction algorithm.
------------------------------------------------------------------------------
Some camera use different noise reduction algorithms for different ISO settings. You can, for example, let the camera smooth out skin imperfections by taking a p... |
125,225 | Given the same amount of exposure, sometimes you may prefer smaller or bigger aperture because you may want high or low depth of field.
Similarly, sometimes you may prefer slow or fast shutter speed, because you may want to freeze the action or you may want the blurred effect.
In case of ISO, is there ever a reason... | 2021/06/18 | [
"https://photo.stackexchange.com/questions/125225",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/99572/"
] | Generally, the best image quality will be obtained at base ISO, which is usually the lowest ISO setting normally available. Some cameras let the user set an ISO value lower than the base ISO by enabling "expanded" ISO settings. In that case dynamic range is reduced.
See PetaPixel: [Lower ISO Doesn’t Always Lead to Hig... | **Yes**, even with your constraints.
And let's eliminate "artistic" reasons of *wanting* more noise and restrict ourselves to technical reasons. I will also not discuss the "extended" ISO below the base, which effectively shoots at base ISO and pulls the image, which is covered in other answers.
You already know from... |
125,225 | Given the same amount of exposure, sometimes you may prefer smaller or bigger aperture because you may want high or low depth of field.
Similarly, sometimes you may prefer slow or fast shutter speed, because you may want to freeze the action or you may want the blurred effect.
In case of ISO, is there ever a reason... | 2021/06/18 | [
"https://photo.stackexchange.com/questions/125225",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/99572/"
] | **Yes**, even with your constraints.
And let's eliminate "artistic" reasons of *wanting* more noise and restrict ourselves to technical reasons. I will also not discuss the "extended" ISO below the base, which effectively shoots at base ISO and pulls the image, which is covered in other answers.
You already know from... | You probably want to avoid "lowest" ISO settings, if they're "extended"; i.e., achieved by digital pull-processing (increase the exposure, then lower it equivalently in post), because it reduces dynamic range. The ISO 50 setting on my Canon 5DMkII is done this way. I basically only use it if I'm willing to have decreas... |
125,225 | Given the same amount of exposure, sometimes you may prefer smaller or bigger aperture because you may want high or low depth of field.
Similarly, sometimes you may prefer slow or fast shutter speed, because you may want to freeze the action or you may want the blurred effect.
In case of ISO, is there ever a reason... | 2021/06/18 | [
"https://photo.stackexchange.com/questions/125225",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/99572/"
] | While aperture and speed control the amount of light that reachs de the sensor, ISO only controls the amplification of the signal.
So, in a world of perfect sensors there would be no difference between high and low ISO.
That's why with a different combination of aperture and speed you may get the same exposure, but di... | You probably want to avoid "lowest" ISO settings, if they're "extended"; i.e., achieved by digital pull-processing (increase the exposure, then lower it equivalently in post), because it reduces dynamic range. The ISO 50 setting on my Canon 5DMkII is done this way. I basically only use it if I'm willing to have decreas... |
125,225 | Given the same amount of exposure, sometimes you may prefer smaller or bigger aperture because you may want high or low depth of field.
Similarly, sometimes you may prefer slow or fast shutter speed, because you may want to freeze the action or you may want the blurred effect.
In case of ISO, is there ever a reason... | 2021/06/18 | [
"https://photo.stackexchange.com/questions/125225",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/99572/"
] | You probably want to avoid "lowest" ISO settings, if they're "extended"; i.e., achieved by digital pull-processing (increase the exposure, then lower it equivalently in post), because it reduces dynamic range. The ISO 50 setting on my Canon 5DMkII is done this way. I basically only use it if I'm willing to have decreas... | Physics provides some limits as to when you can change the ISO, all other things being equal. Because you targeted properly exposed shots, there's only three cases:
* Change the ISO and shutter speed
* Change the ISO and aperture
* Change the ISO, shutter speed, and aperture.
I can't think of any unusual cases that s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.