qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
509 | In [Triangle](http://www.imdb.com/title/tt1187064/), at the start when Jess arrives at the boat for the "first" time, is this the start of the continuation of the ending scene?
It's known that the cruise ship and any surroundings after leaving it is in a time loop.
Though Jess remembers the ship and tells Greg, she m... | 2011/12/15 | [
"https://movies.stackexchange.com/questions/509",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/68/"
] | I thought it might help to explain just the mechanics of the events on board the *Aeolus* a bit to clear up what's happening. I am loosely following this [video analysis by Peng Yang](https://www.youtube.com/watch?v=uWZfHfQokMA), though I think I simplified the explanation a bit.
The two key aspects of the main plot a... | I think, that the time repeats itself because Jess does not want to let go of her son. When they are sitting on their yacht, after the storm, she says that "If I do something differently, I'll loose him (her son)", and therefore she lets the story happen over and over again. Also I believe that the taxi driver is the d... |
509 | In [Triangle](http://www.imdb.com/title/tt1187064/), at the start when Jess arrives at the boat for the "first" time, is this the start of the continuation of the ending scene?
It's known that the cruise ship and any surroundings after leaving it is in a time loop.
Though Jess remembers the ship and tells Greg, she m... | 2011/12/15 | [
"https://movies.stackexchange.com/questions/509",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/68/"
] | The movie *just* shows us the never-ending loop in which Jess is stuck seemingly forever. What *actually happened* that left her in this loop is never shown. Only subtle hints are given throughout the movie.
There is no starting point to the loop. That just seems so to the viewer. I would say that the instant she has ... | What I think is that the "good Jess" is the only surviving Jess, at both the beginning, the "exactly the same" Jess mentioned that her kid was in school, which means, her son died. Therefore, at the first part of the movie (before the storm), there are actually two Jesses, one who was killed, and the one who killed. Th... |
509 | In [Triangle](http://www.imdb.com/title/tt1187064/), at the start when Jess arrives at the boat for the "first" time, is this the start of the continuation of the ending scene?
It's known that the cruise ship and any surroundings after leaving it is in a time loop.
Though Jess remembers the ship and tells Greg, she m... | 2011/12/15 | [
"https://movies.stackexchange.com/questions/509",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/68/"
] | The only thing possible to break out from the same-things-happening time loop is the "knowledge" of the previous loop, so that she can change them. I think she loses it all while she falls asleep on the boat, waking up with champagne and all.
All time bending movies have their inconsistencies somewhere. They're good f... | in order to understand i think first you need to consider that the movie has a linear story. The most important thing in this movie that you must consider in order to solve most of the puzzle is that when she arrives for the 2nd time she is not like the 1st jess and she already knows everything that is going to happen ... |
509 | In [Triangle](http://www.imdb.com/title/tt1187064/), at the start when Jess arrives at the boat for the "first" time, is this the start of the continuation of the ending scene?
It's known that the cruise ship and any surroundings after leaving it is in a time loop.
Though Jess remembers the ship and tells Greg, she m... | 2011/12/15 | [
"https://movies.stackexchange.com/questions/509",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/68/"
] | Not the way I remember it. The way I see it Jess is in a kind of purgatory, as the end of the movie shows her as an abusive mother. She's trapped in the time loop, but seems to be gradually changing things. Perhaps when she has righted all her wrongs she can be free? | jess said the whole process restarts when all them dies, just like the other jess who was wearing those black gowns told her that jess must kill her(jess) but she fell of the ship and ended at the beach where she walked back to her home(begining of the movie). there was a black cloth in the water at the beach, the same... |
509 | In [Triangle](http://www.imdb.com/title/tt1187064/), at the start when Jess arrives at the boat for the "first" time, is this the start of the continuation of the ending scene?
It's known that the cruise ship and any surroundings after leaving it is in a time loop.
Though Jess remembers the ship and tells Greg, she m... | 2011/12/15 | [
"https://movies.stackexchange.com/questions/509",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/68/"
] | I agree that we enter the loop during its Nth playthrough. However, I do not think we are following the same Jess all the way through -- there is a moment when the film seems to judder and jump back several frames -- I think this represents several more playthroughs of the exact same moment thus we have jumped forward ... | Not the way I remember it. The way I see it Jess is in a kind of purgatory, as the end of the movie shows her as an abusive mother. She's trapped in the time loop, but seems to be gradually changing things. Perhaps when she has righted all her wrongs she can be free? |
509 | In [Triangle](http://www.imdb.com/title/tt1187064/), at the start when Jess arrives at the boat for the "first" time, is this the start of the continuation of the ending scene?
It's known that the cruise ship and any surroundings after leaving it is in a time loop.
Though Jess remembers the ship and tells Greg, she m... | 2011/12/15 | [
"https://movies.stackexchange.com/questions/509",
"https://movies.stackexchange.com",
"https://movies.stackexchange.com/users/68/"
] | The movie *just* shows us the never-ending loop in which Jess is stuck seemingly forever. What *actually happened* that left her in this loop is never shown. Only subtle hints are given throughout the movie.
There is no starting point to the loop. That just seems so to the viewer. I would say that the instant she has ... | I think, that the time repeats itself because Jess does not want to let go of her son. When they are sitting on their yacht, after the storm, she says that "If I do something differently, I'll loose him (her son)", and therefore she lets the story happen over and over again. Also I believe that the taxi driver is the d... |
59,214,308 | I have been setting up a small Hyperledger fabric application. It is already running and I can add delete and change users.
But until now I have been using nano to code until now.
I want to change to a proper ide (goland) for the sake of autocompletion and so on.
The problem is: On my local machine it can not find ... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59214308",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12285811/"
] | The issue is, the shim and protos were moved to stand-alone repositories several months ago, you need to do a `go get` on `github.com/hyperledger/fabric-chaincode-go/shim` and `github.com/hyperledger/fabric-protos-go` and change your import references to these new repos:
```
import (
"fmt"
"github.com/hyperledge... | Unfortunately, `go get` only imports go code files. Other assets like the raw proto files are excluded. An option is to check-out the git repo in `$GOPATH/src/github.com/hyperledger/fabric` |
59,214,308 | I have been setting up a small Hyperledger fabric application. It is already running and I can add delete and change users.
But until now I have been using nano to code until now.
I want to change to a proper ide (goland) for the sake of autocompletion and so on.
The problem is: On my local machine it can not find ... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59214308",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12285811/"
] | The issue is, the shim and protos were moved to stand-alone repositories several months ago, you need to do a `go get` on `github.com/hyperledger/fabric-chaincode-go/shim` and `github.com/hyperledger/fabric-protos-go` and change your import references to these new repos:
```
import (
"fmt"
"github.com/hyperledge... | this worked for me <https://www.programmersought.com/article/17446289383/>
additional any one using this thread now need to update the pkgs to
"github.com/hyperledger/fabric-chaincode-go/shim"
pb "github.com/hyperledger/fabric-protos-go/peer" |
55,715,322 | I am building my UI from code and need to present another view controller as a popover, over the current controller. The popover will act as a modal dialog and will use about 50% of the screen size. The contents of the popover must be constrained in the screen center and support device rotation.
My initial implementa... | 2019/04/16 | [
"https://Stackoverflow.com/questions/55715322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11299563/"
] | If you are not adding constraints yourself - which, in this case, you are not - you still need to tell the view how to behave.
Change your `createSubviews()` function to this:
```
func createSubViews() {
//translatesAutoresizingMaskIntoConstraints = false
autoresizingMask = [.flexibleHeight, .flexibleWidth]
... | According to Apple docs for translatesAutoresizingMaskIntoCon
>
> If this property’s value is true, the system creates a set of constraints that duplicate the behavior specified by the view’s autoresizing mask.
>
>
>
and
>
> By default, the property is set to true for any view you programmatically create. If y... |
64,727,976 | I have a dictionary with some personality traits and related adjectives:
```
personality={'sincerity': [ "tru", "honest"],'excitement': ['excit', 'fizzy']}
```
(note this is much longer)
As well I have a dictionary with lists of words extracted from tweets:
```
prova={"brand1": ["true", "truth", "thrutfull", "ora... | 2020/11/07 | [
"https://Stackoverflow.com/questions/64727976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14595813/"
] | IIUC you need `transform`:
```
df["count"] = df.groupby("Name")["Tag"].transform("size")
print (df)
Name Tag Field count
0 A 1 X 2
1 A 2 X 2
2 B 3 Y 2
3 B 4 Z 2
4 C 5 R 1
``` | you can also try
```
df['Count'] = df['Name'].apply(lambda x: len(df.loc[df['Name'] == x, :]))
``` |
2,558,553 | Let's say you have two objects, each described by some 2D corresponding points.
In order to compare these two shapes, you can multiple algorithms:
1. Procrustes analysis
2. Search the Linear / Affine transformation (with least-squares)
3. Other ...
My question is; what's the difference between the first two? For me,... | 2017/12/09 | [
"https://math.stackexchange.com/questions/2558553",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/502656/"
] | Based on my own experience with computer vision, Procrustes analysis is just the process of solving the problem of fitting one set of points to another using rotations, translations and scaling (and in some contexts, reflection.)
Finding such a transformation with least squares is simply one solution to the Procrustes... | The difference is the type of transform:
1. Procrustes finds the optimal (with respect to least squares distances of corresponding points) transform consisting of translation, scaling, reflection and rotation. So rigid transform (translation and rotation) plus global scaling and reflection.
2. Linear is different as i... |
17,540,351 | I have a restaurant that has\_many menus and a menu that has\_many sub\_menus. Am trying to get the total orders for each menu or sub\_menu within rails views. I already have the logic of splitting the two (menu and sub\_menu) through if, else statement. But am having trouble of having sum of all orders for each menu o... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17540351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/910488/"
] | press F12, check all the resources your browser displaying. You can find all the images link in the resource tab. | [1] Map data is overlaid server-side, then sent to client as images. E.g.:
```
GET https://mt3.google.com/mapslt?lyrs=gw:direct:GFwQAlABWgZsbXE6Kip1wBWuQHoFZjphbnk|gid:XTlZKwxnPFg6qxnrb95r6g&x=5283&y=12716&z=15&hl=en
```
`mt3` server
`mapslt` **???**
`lyrs=gw` **???**
`direct:...|gid:...` presumably specif... |
14,451,329 | Sorry for my English, and i don't know if my question is righ.
I have an array:
```
Array
(
[0] => Array
(
[date] => 2013-01-22
[id] => 1
[views] => 33286
)
[1] => Array
(
[date] => 2013-01-23
[id] => 1
[views] => 33223
)
[2] => Array
(
... | 2013/01/22 | [
"https://Stackoverflow.com/questions/14451329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1087311/"
] | I doubt your end goal is to write out a table of values. But in case it is, here's some code that would do that.
```
<?php
$a = array(
array('date'=>'2013-01-22', 'id'=>1, 'views'=>33286),
array('date'=>'2013-01-23', 'id'=>1, 'views'=>33223),
array('date'=>'2013-01-22', 'id'=>2, 'views'=>33223),
array... | [See the manual](http://php.net/manual/en/function.date.php) about formatting dates.
```
foreach ($yourarray as $key => $value){
$yourarray[$key]['date'] = date("d-m-Y",strtotime($value['date']));
}
```
I have assumed you don't mind overwriting the other format. |
12,349,138 | I created an own template for WordPress 3.4.1 and got the problem that WordPress automatically(???) generates titles for every single page I create, but I don't want the page-titles as headline.
My template bases on the "Modern Theme" for Magento eCommerce. After adapting for WordPress it consists of footer, header an... | 2012/09/10 | [
"https://Stackoverflow.com/questions/12349138",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1503813/"
] | Remove the `<?php get_title() ?>` from the page.php and single.php. | Since it is a display issue, you should add `display:none;` to the corresponding css class or id, no need to remove `the_title` or `get_title`. |
33,105,639 | I can't seem to change the background color of a div I have in my HTML, here is what I have so far:
```html
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</div>
```
```css
.footer {
color: #FF0000;
width: 100%;
}
``` | 2015/10/13 | [
"https://Stackoverflow.com/questions/33105639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5407137/"
] | You're probably after something like this:
```
.footer {
color: #FF0000;
width: 100%;
background-color: blue;
}
```
You'll also need some content in the actual div's to see the background colour, or set height/padding | You may need background-color, instead of color. Color is normally for font color |
33,105,639 | I can't seem to change the background color of a div I have in my HTML, here is what I have so far:
```html
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</div>
```
```css
.footer {
color: #FF0000;
width: 100%;
}
``` | 2015/10/13 | [
"https://Stackoverflow.com/questions/33105639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5407137/"
] | You're probably after something like this:
```
.footer {
color: #FF0000;
width: 100%;
background-color: blue;
}
```
You'll also need some content in the actual div's to see the background colour, or set height/padding | You need to use the `CSS` property of
```
background-color
```
*This adds color to the background of the selected element*
The property (`color`) which you have used adds *color to the foreground to the selected element i.e. it represents the color of the text*
```css
.footer {
background-color: red;
width:... |
33,105,639 | I can't seem to change the background color of a div I have in my HTML, here is what I have so far:
```html
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</div>
```
```css
.footer {
color: #FF0000;
width: 100%;
}
``` | 2015/10/13 | [
"https://Stackoverflow.com/questions/33105639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5407137/"
] | You're probably after something like this:
```
.footer {
color: #FF0000;
width: 100%;
background-color: blue;
}
```
You'll also need some content in the actual div's to see the background colour, or set height/padding | The `color` property changes the text color. You need to set the `background-color` property instead. However, unless you give the `div` some height you won't be able to see it!
```
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</... |
33,105,639 | I can't seem to change the background color of a div I have in my HTML, here is what I have so far:
```html
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</div>
```
```css
.footer {
color: #FF0000;
width: 100%;
}
``` | 2015/10/13 | [
"https://Stackoverflow.com/questions/33105639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5407137/"
] | You're probably after something like this:
```
.footer {
color: #FF0000;
width: 100%;
background-color: blue;
}
```
You'll also need some content in the actual div's to see the background colour, or set height/padding | Based on your CSS you are using the incorrect property to set the background color, use `background-color` instead of `color`. `color` is used for setting the color of you text.
**Note** Based on some comments to answers it seems that you have tested `background-color` on your sample markup, which has no content and t... |
33,105,639 | I can't seem to change the background color of a div I have in my HTML, here is what I have so far:
```html
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</div>
```
```css
.footer {
color: #FF0000;
width: 100%;
}
``` | 2015/10/13 | [
"https://Stackoverflow.com/questions/33105639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5407137/"
] | You're probably after something like this:
```
.footer {
color: #FF0000;
width: 100%;
background-color: blue;
}
```
You'll also need some content in the actual div's to see the background colour, or set height/padding | you have to use background-color. color is for text
```
.footer {
background-color: the color you want;
}
``` |
33,105,639 | I can't seem to change the background color of a div I have in my HTML, here is what I have so far:
```html
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</div>
```
```css
.footer {
color: #FF0000;
width: 100%;
}
``` | 2015/10/13 | [
"https://Stackoverflow.com/questions/33105639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5407137/"
] | You should be using `background` (shorthand) or `background-color` to change the background color.
Something like this would:
```
.footer {
background-color: #fff;
}
```
You'll also need to add either something to the div to give it height, or declare at height for the div in CSS like so:
```
.footer {
bac... | You may need background-color, instead of color. Color is normally for font color |
33,105,639 | I can't seem to change the background color of a div I have in my HTML, here is what I have so far:
```html
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</div>
```
```css
.footer {
color: #FF0000;
width: 100%;
}
``` | 2015/10/13 | [
"https://Stackoverflow.com/questions/33105639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5407137/"
] | You should be using `background` (shorthand) or `background-color` to change the background color.
Something like this would:
```
.footer {
background-color: #fff;
}
```
You'll also need to add either something to the div to give it height, or declare at height for the div in CSS like so:
```
.footer {
bac... | You need to use the `CSS` property of
```
background-color
```
*This adds color to the background of the selected element*
The property (`color`) which you have used adds *color to the foreground to the selected element i.e. it represents the color of the text*
```css
.footer {
background-color: red;
width:... |
33,105,639 | I can't seem to change the background color of a div I have in my HTML, here is what I have so far:
```html
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</div>
```
```css
.footer {
color: #FF0000;
width: 100%;
}
``` | 2015/10/13 | [
"https://Stackoverflow.com/questions/33105639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5407137/"
] | You should be using `background` (shorthand) or `background-color` to change the background color.
Something like this would:
```
.footer {
background-color: #fff;
}
```
You'll also need to add either something to the div to give it height, or declare at height for the div in CSS like so:
```
.footer {
bac... | The `color` property changes the text color. You need to set the `background-color` property instead. However, unless you give the `div` some height you won't be able to see it!
```
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</... |
33,105,639 | I can't seem to change the background color of a div I have in my HTML, here is what I have so far:
```html
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</div>
```
```css
.footer {
color: #FF0000;
width: 100%;
}
``` | 2015/10/13 | [
"https://Stackoverflow.com/questions/33105639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5407137/"
] | You should be using `background` (shorthand) or `background-color` to change the background color.
Something like this would:
```
.footer {
background-color: #fff;
}
```
You'll also need to add either something to the div to give it height, or declare at height for the div in CSS like so:
```
.footer {
bac... | Based on your CSS you are using the incorrect property to set the background color, use `background-color` instead of `color`. `color` is used for setting the color of you text.
**Note** Based on some comments to answers it seems that you have tested `background-color` on your sample markup, which has no content and t... |
33,105,639 | I can't seem to change the background color of a div I have in my HTML, here is what I have so far:
```html
<div class="footer">
<div class="left-footer">
</div>
<div class="center-footer">
</div>
<div class="right-footer">
</div>
</div>
```
```css
.footer {
color: #FF0000;
width: 100%;
}
``` | 2015/10/13 | [
"https://Stackoverflow.com/questions/33105639",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5407137/"
] | You should be using `background` (shorthand) or `background-color` to change the background color.
Something like this would:
```
.footer {
background-color: #fff;
}
```
You'll also need to add either something to the div to give it height, or declare at height for the div in CSS like so:
```
.footer {
bac... | you have to use background-color. color is for text
```
.footer {
background-color: the color you want;
}
``` |
71,875 | ### Background:
I'm a fairly inexperienced GM and I'm working with a group that has wildly varying experience with role-playing - the game is intended as a teaching campaign to help a couple new players get familiar with the game, and give me some experience GMing. We're playing Pathfinder and have just reached level ... | 2015/12/05 | [
"https://rpg.stackexchange.com/questions/71875",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/23886/"
] | ### Going for "small footprint, cumulative effect" here...
*GM: you open the door and see a pair of seated giants, one picking his teeth with the bones of his last victim, the other fashioning a goblet out of a fallen hero's helm, turn to face you. Grinning, the first reaches for his enormous maul...*
*BARD: who want... | **In my experience with *Pathfinder*, there are two surefire ways to encourage people to interact with each other in role play: have each player make a game-relevant background and throw problems at them that have no short-term answer**
The first and easiest way to get people to interact in game more is to have them f... |
71,875 | ### Background:
I'm a fairly inexperienced GM and I'm working with a group that has wildly varying experience with role-playing - the game is intended as a teaching campaign to help a couple new players get familiar with the game, and give me some experience GMing. We're playing Pathfinder and have just reached level ... | 2015/12/05 | [
"https://rpg.stackexchange.com/questions/71875",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/23886/"
] | ### Going for "small footprint, cumulative effect" here...
*GM: you open the door and see a pair of seated giants, one picking his teeth with the bones of his last victim, the other fashioning a goblet out of a fallen hero's helm, turn to face you. Grinning, the first reaches for his enormous maul...*
*BARD: who want... | For small elements that encourage RP, I can think of a few pointers:
1: When at the game, call them by their character names. Not by their real names. If Steve is playing Greckar the Barbarian, then don't say, "Steve, your turn." Instead, say "Greckar, take action!"
2: Do an in-character questionnaire for your group.... |
71,875 | ### Background:
I'm a fairly inexperienced GM and I'm working with a group that has wildly varying experience with role-playing - the game is intended as a teaching campaign to help a couple new players get familiar with the game, and give me some experience GMing. We're playing Pathfinder and have just reached level ... | 2015/12/05 | [
"https://rpg.stackexchange.com/questions/71875",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/23886/"
] | One of the best ways to begin interaction like this is at the beginning. That is in the "how they meet each other" set up where you have each person arrive at the table, inn, tavern, starport, recruiting center, house of first client (or wherever) and then invite each player in one at a time (IRL) at intervals of four ... | **In my experience with *Pathfinder*, there are two surefire ways to encourage people to interact with each other in role play: have each player make a game-relevant background and throw problems at them that have no short-term answer**
The first and easiest way to get people to interact in game more is to have them f... |
71,875 | ### Background:
I'm a fairly inexperienced GM and I'm working with a group that has wildly varying experience with role-playing - the game is intended as a teaching campaign to help a couple new players get familiar with the game, and give me some experience GMing. We're playing Pathfinder and have just reached level ... | 2015/12/05 | [
"https://rpg.stackexchange.com/questions/71875",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/23886/"
] | One of the best ways to begin interaction like this is at the beginning. That is in the "how they meet each other" set up where you have each person arrive at the table, inn, tavern, starport, recruiting center, house of first client (or wherever) and then invite each player in one at a time (IRL) at intervals of four ... | For small elements that encourage RP, I can think of a few pointers:
1: When at the game, call them by their character names. Not by their real names. If Steve is playing Greckar the Barbarian, then don't say, "Steve, your turn." Instead, say "Greckar, take action!"
2: Do an in-character questionnaire for your group.... |
71,875 | ### Background:
I'm a fairly inexperienced GM and I'm working with a group that has wildly varying experience with role-playing - the game is intended as a teaching campaign to help a couple new players get familiar with the game, and give me some experience GMing. We're playing Pathfinder and have just reached level ... | 2015/12/05 | [
"https://rpg.stackexchange.com/questions/71875",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/23886/"
] | **In my experience with *Pathfinder*, there are two surefire ways to encourage people to interact with each other in role play: have each player make a game-relevant background and throw problems at them that have no short-term answer**
The first and easiest way to get people to interact in game more is to have them f... | For small elements that encourage RP, I can think of a few pointers:
1: When at the game, call them by their character names. Not by their real names. If Steve is playing Greckar the Barbarian, then don't say, "Steve, your turn." Instead, say "Greckar, take action!"
2: Do an in-character questionnaire for your group.... |
44,349,153 | I have a problem aligning the profile picture in a chat. The profile picture should always be right beside the username like demonstrated in the picture below.
[](https://i.stack.imgur.com/Pdqvw.png)
How can I fix this? Been sitting hours trying to f... | 2017/06/03 | [
"https://Stackoverflow.com/questions/44349153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7696624/"
] | **Solution: `align-items: center;` Should be `align-items: flex-start`:**
**REF:**
>
> ### The `align-items` property is a sub-property of the Flexible Box Layout module.
>
>
> [](https://i.stack.imgur.com/1biO1.png)
>
>
> REF: <https://css-tric... | Your CSS as-is doesn't tell the image to go to the top. Depending on your needs, you may be able to use absolute and relative positioning. One simple method is by adding the following CSS:
```
.chat-content {
position: relative;
}
.responsive-img {
position: absolute;
top: 2px;
}
.chat-message {
margin-left: 4... |
44,349,153 | I have a problem aligning the profile picture in a chat. The profile picture should always be right beside the username like demonstrated in the picture below.
[](https://i.stack.imgur.com/Pdqvw.png)
How can I fix this? Been sitting hours trying to f... | 2017/06/03 | [
"https://Stackoverflow.com/questions/44349153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7696624/"
] | **Solution: `align-items: center;` Should be `align-items: flex-start`:**
**REF:**
>
> ### The `align-items` property is a sub-property of the Flexible Box Layout module.
>
>
> [](https://i.stack.imgur.com/1biO1.png)
>
>
> REF: <https://css-tric... | In the `div class="col s12 chat-content"` element, you had `align-items: center`, which, while a great default for most things where you need a flexbox, it does what it says on the tin can: it aligns everything within the flexbox to be *centered* on the cross-axis, whereas you want things aligned to the *top*.
There a... |
66,422,966 | I'm reading Elements of Programming Interviews, and on page 43, there's the following line/quote:
>
> Implemented naively, quicksort has large run times and deep function call stacks
> on arrays with many duplicates because the subarrays may differ greatly in size.
>
>
> One solution is to reorder the array so that... | 2021/03/01 | [
"https://Stackoverflow.com/questions/66422966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15307349/"
] | The quick sort algorithm requires as one of its steps some algorithm to *partition* the data, based on a selected *pivot*. The ideal scenario is that each partition is as small as possible, so that it requires fewer further divisions. If more than half the elements end up in one partition, more steps will be needed to ... | >
> quicksort has large run times and deep function call stacks
> on arrays with many duplicates
>
>
>
This is only true for Lomuto type partition scheme, a variation of quicksort that first appears to be mentioned in 1984, versus the original Hoare partition scheme published in 1961. Normally Lomuto partition ste... |
66,422,966 | I'm reading Elements of Programming Interviews, and on page 43, there's the following line/quote:
>
> Implemented naively, quicksort has large run times and deep function call stacks
> on arrays with many duplicates because the subarrays may differ greatly in size.
>
>
> One solution is to reorder the array so that... | 2021/03/01 | [
"https://Stackoverflow.com/questions/66422966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15307349/"
] | The quick sort algorithm requires as one of its steps some algorithm to *partition* the data, based on a selected *pivot*. The ideal scenario is that each partition is as small as possible, so that it requires fewer further divisions. If more than half the elements end up in one partition, more steps will be needed to ... | "because the subarrays may differ greatly in size" says it. The pivot and the array values can be such that a subarray of size N is split in two subarrays of size N-1 and 1. This can create a degenerate situation such that N recursive calls are stacked. |
66,422,966 | I'm reading Elements of Programming Interviews, and on page 43, there's the following line/quote:
>
> Implemented naively, quicksort has large run times and deep function call stacks
> on arrays with many duplicates because the subarrays may differ greatly in size.
>
>
> One solution is to reorder the array so that... | 2021/03/01 | [
"https://Stackoverflow.com/questions/66422966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15307349/"
] | >
> quicksort has large run times and deep function call stacks
> on arrays with many duplicates
>
>
>
This is only true for Lomuto type partition scheme, a variation of quicksort that first appears to be mentioned in 1984, versus the original Hoare partition scheme published in 1961. Normally Lomuto partition ste... | "because the subarrays may differ greatly in size" says it. The pivot and the array values can be such that a subarray of size N is split in two subarrays of size N-1 and 1. This can create a degenerate situation such that N recursive calls are stacked. |
100,291 | I'm using a PIC24FJ256GB110 connected via SPI to a CAN Bus Controller chip MCP2515. The MCP2515 requires a crystal connected to it but has a Clock Output pin for driving a connected MCU. So I was going to connect the Clkout from the MCP2515 to the MCU.
My question is that in the [osillator data sheet](http://ww1.micr... | 2014/02/19 | [
"https://electronics.stackexchange.com/questions/100291",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/27446/"
] | It's just a gate to clean up the waveform (or just to indicate that there is a logic output driving the input)- it would not generally be used if you were employing a clock oscillator nearby the MCU such as [this](http://www.foxonline.com/pdfs/FXO_HC73.pdf) one (photo from Digikey.com).
) oscillators are commonly built around CMOS ports for their high impedance. Usually a [74HC04](http://www.nxp.com/documents/data_sheet/74HC_HCT04.pdf), [4069](http://www.cmos4000.com/cmos/4069.html) will do the job. Use the remaining ports as output buffe... |
55,570 | I have an excel file with 8083 X and Y columns.
The first column represents the name of the image I have, and the other column represents the multiplicaltion reusult of the (x,y) resolution of that image (i.e; (512,512) -> 262144.
Now, in this case, I will have an image name and a result beside it.
I'm trying to plo... | 2011/08/04 | [
"https://math.stackexchange.com/questions/55570",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/7549/"
] | [Asymptote](http://asymptote.sourceforge.net/) vector graphics language. Check out the gallery of graphs/plots/sketches.

"Here is a histogram example, which uses the stats module."
```
import graph;
import stats;
size(400,200,IgnoreAspect);
int n=10000;... | This is tricky to do in Excel, since you seem to want to plot a huge amount of points, e.g. it could look like
```
1 0
2 0
3 0
...
262144 1
...
```
which will be a very long list.
You can do it in [R](http://www.r-project.org/) quite easily. For example
```
> x = 1:8083
> y = 2:8084
> z = x*y
> t = table(z)
> plot... |
55,570 | I have an excel file with 8083 X and Y columns.
The first column represents the name of the image I have, and the other column represents the multiplicaltion reusult of the (x,y) resolution of that image (i.e; (512,512) -> 262144.
Now, in this case, I will have an image name and a result beside it.
I'm trying to plo... | 2011/08/04 | [
"https://math.stackexchange.com/questions/55570",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/7549/"
] | [Asymptote](http://asymptote.sourceforge.net/) vector graphics language. Check out the gallery of graphs/plots/sketches.

"Here is a histogram example, which uses the stats module."
```
import graph;
import stats;
size(400,200,IgnoreAspect);
int n=10000;... | Why not take a look at R? -- it has tools for binning & counting, and I gather that's what you need to do. Here's a link
[histograms in R](http://www2.warwick.ac.uk/fac/sci/moac/degrees/modules/ch923/r_introduction/histograms_etc/). Another alternative might be [Octave](http://www.gnu.org/software/octave/). |
17,366,888 | Given a Textbox, that should contain a numeric value:
```
<asp:TextBox ID="txtHoldsAnInt" runat="server" />
```
In our codebase, generally a [RegularExpressionValidator](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.regularexpressionvalidator.aspx) is used for all validation (except required fiel... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17366888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1316573/"
] | If you are familiar with regular expressions, then I would recommend using the `<asp:RegularExpressionValidator`. You are correct that there is no noticeable difference when they are equal to each other, but the RegularExpressionValidator allows for easy editing later on when specifications change. For example with a R... | In terms of functionality/end result, there is no difference between using the two. I would suggest using the range validator other validators if the situation permits and it satisfy your needs. It is much easier for someone to understand `<asp:RangeValidator` than to understand `^[0-9]{1,8}$`. While the `RegularExpres... |
4,119,783 | Hello mathexchange users!
Let be $a,b,c$ **integer numbers** , $a\ne0$ such that:
$$an^4+bn^2+c$$ is a **perfect square** for every $n$ **positive integer**.
Prove that there is $x,y$ **integers** such that:
$$a=x^2$$
$$b=2xy$$
$$c=y^2$$
---
Now i will include my work on the problem:
I considered the polynomial
$$P(... | 2021/04/28 | [
"https://math.stackexchange.com/questions/4119783",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/876044/"
] | It looks like, the problem statement is not correct.
Take,
$$a=c=0, ~b=m^2, m≠0.$$ | There was an early answer that proved the statement under the assumption that an integer coefficent polynomial $P(x)$ must be a perfect square (i.e. $P(x) = Q(x)^2$ for some integer coefficient polynomial) if $P(n)$ is a perfect square for all $n\in \mathbb{N}$. That answer was later deleted, presumably because the ans... |
53,711,258 | I have a typealias as follow:
```
typealias Member = (memberId: Int64?,fullName: String?,photoUrl: String?)
```
when I call this as follow
```
Member(memberid: 14, fullname: "Nifras", photourl: "Hello")
```
I got the error like this
>
> Cannot invoke initializer for type 'Member' with an argument list of
> ... | 2018/12/10 | [
"https://Stackoverflow.com/questions/53711258",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2672566/"
] | `Member` is an alias for a tuple. You are trying to create an instance of a `Member` like calling an initializer for a class or struct.
You want:
```
let someVar: Member = (14, "Nifras", "Hello")
```
Or you can use `Member` as a type for a parameter or return type.
```
func someFunc(someParam: Member)
```
or
``... | If you want to use `Member(memberId: 14, fullName: "Nifras", photoUrl: "Hello")` syntax, you have to create `struct Member`:
```
struct Member {
memberId: Int64?
fullName: String?
photoUrl: String?
}
```
You can read more about structures <https://docs.swift.org/swift-book/LanguageGuide/ClassesAndStructu... |
14,731,360 | I have a bunch of DIV's that all have the same class and style except for 1.
```
<div id="0" class="divpage" style="display:none"></div>
<div id="1" class="divpage" style="display:none"></div>
<div id="2" class="divpage" style="display:none"></div>
<div id="3" class="divpage" style="display:none"></div... | 2013/02/06 | [
"https://Stackoverflow.com/questions/14731360",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2047006/"
] | using `:visible` will find the div that is visible
You should not use numbers as id, i think its only valid in html5
```
var num = $('.divpage:visible').attr('id');
``` | Like this -
```
var theID = $('.divpage[style="display:block"]').attr('id');
``` |
44,818,047 | Right now, when one field change, the other field change accordingly.
What i want to do is originally the 2nd field has some prefilled input from database, and when the 1st input field was fill in by the user, i want to keep the data from database plus adding the text input by the user after the database data.
The prob... | 2017/06/29 | [
"https://Stackoverflow.com/questions/44818047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8165517/"
] | Try this:
```js
var oldValue = document.getElementById('url').value;
addEvent(document.getElementById('name'), 'keyup', function () {
document.getElementById('url').value = oldValue + this.value.replace(' ');
});
function addEvent(ele, evnt, funct) {
if (ele.addEventListener) // W3C
return ele.addEvent... | Why dont you keep it simple ,since you have tagged it in jQuery ,here's my answer:
```js
if(typeof set =="undefined"){
var set = $("#url").val();
}
$("#name").on('keyup',function(){
$("#url").val(set+$(this).val());
});
```
```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js... |
67,561,683 | I want to create Class with writable:false-fields.
The task is:
* I need to use constructor for these values;
* We can write these values only once.
F.e:
```
Class Room {
constructor(length, width) {
this.length = length;
this.width = width;
}
}
let room = new Room(20, 10);
console.log(room.length) ... | 2021/05/16 | [
"https://Stackoverflow.com/questions/67561683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15079009/"
] | Calling `Object.defineProperty` in the constructor works:
```js
class Room {
constructor(length, width) {
Object.defineProperty(this, 'length', { value: length });
Object.defineProperty(this, 'width', { value: width });
}
}
let room = new Room(20, 10);
console.log(room.length) // 20
room.length = 10000 // ... | If this should be the behaviour for all properties of the instance, and are looking for an immutable object, then you can call `Object.freeze`:
```js
class Room {
constructor(length, width) {
this.length = length;
this.width = width;
Object.freeze(this);
}
}
let room = new Room(20, 10);
console.log(ro... |
11,663,440 | I am currently looking for a good framework to integrate multiple systems with different communication methods like
* FTP
* Mail
* Queue
* Web Service
in a .NET application. For Java there seem to be a lot of options available, but I could not find anything similar for the .NET platform. | 2012/07/26 | [
"https://Stackoverflow.com/questions/11663440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1109366/"
] | The Workflow Foundations are more suitable for... well.. work flows representing the business logic. You seem to be more interested in integrating existing services. In that case I would focus more on the Windows Communication Foundation. Which were introduced together with the (original) Workflow Foundation. So WCF is... | 1. For FTP client you can use framework like [FTPclient](http://ftpclient.codeplex.com), or [FTP Client Lib for .NET](http://www.codeproject.com/Articles/11991/An-FTP-client-library-for-NET-2-0) or can find from google to suite your needs.
2. Mail Clien :- What you want to achieve using framework and can find the best ... |
11,663,440 | I am currently looking for a good framework to integrate multiple systems with different communication methods like
* FTP
* Mail
* Queue
* Web Service
in a .NET application. For Java there seem to be a lot of options available, but I could not find anything similar for the .NET platform. | 2012/07/26 | [
"https://Stackoverflow.com/questions/11663440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1109366/"
] | The Workflow Foundations are more suitable for... well.. work flows representing the business logic. You seem to be more interested in integrating existing services. In that case I would focus more on the Windows Communication Foundation. Which were introduced together with the (original) Workflow Foundation. So WCF is... | I suggest you have a look at [Windows Workflow Foundation (WF)](http://msdn.microsoft.com/en-us/library/ee342461.aspx). It's part of the .NET Framework.
It uses the concept of Activities. An activity is a general concept, and is also well suited for "connectors" to other systems. Some out-of-the-box activities are pro... |
11,663,440 | I am currently looking for a good framework to integrate multiple systems with different communication methods like
* FTP
* Mail
* Queue
* Web Service
in a .NET application. For Java there seem to be a lot of options available, but I could not find anything similar for the .NET platform. | 2012/07/26 | [
"https://Stackoverflow.com/questions/11663440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1109366/"
] | The Workflow Foundations are more suitable for... well.. work flows representing the business logic. You seem to be more interested in integrating existing services. In that case I would focus more on the Windows Communication Foundation. Which were introduced together with the (original) Workflow Foundation. So WCF is... | If you want something more enterprice:y look at Biztalk, comes with a bunch of adaptors and tools, it is not free however. |
17,225 | Every so often while shortwave listening I’ll come across a frequency where tons of hams are talking all over each other giving a call sign and a six digit number only (not a QSO). I imagine these numbers may be club membership numbers but I can’t figure out the purpose. Is this some way to build up a large number of Q... | 2020/08/30 | [
"https://ham.stackexchange.com/questions/17225",
"https://ham.stackexchange.com",
"https://ham.stackexchange.com/users/11878/"
] | Guessing it was a contest, and the numbers were the exchanges, per the contest rules.
The exchanges vary by contest, so it depends on which contest you heard.
Try searching the contest-calendar, here:
<https://www.contestcalendar.com/weeklycont.php>
Perhaps with some more information we can narrow it down. | If it was on the 10m band then it could have been the 10-10 club net.https://www.ten-ten.org/ |
17,225 | Every so often while shortwave listening I’ll come across a frequency where tons of hams are talking all over each other giving a call sign and a six digit number only (not a QSO). I imagine these numbers may be club membership numbers but I can’t figure out the purpose. Is this some way to build up a large number of Q... | 2020/08/30 | [
"https://ham.stackexchange.com/questions/17225",
"https://ham.stackexchange.com",
"https://ham.stackexchange.com/users/11878/"
] | Guessing it was a contest, and the numbers were the exchanges, per the contest rules.
The exchanges vary by contest, so it depends on which contest you heard.
Try searching the contest-calendar, here:
<https://www.contestcalendar.com/weeklycont.php>
Perhaps with some more information we can narrow it down. | You may have stumbled onto a net that is specifically designed to allow amateurs to work on getting awards quickly by contacting others via net, such as the ARRL Worked All States (WAS) award. There's several nets that do this but perhaps the largest one is the OMISS (Old Man International Sideband Society) net. They h... |
17,225 | Every so often while shortwave listening I’ll come across a frequency where tons of hams are talking all over each other giving a call sign and a six digit number only (not a QSO). I imagine these numbers may be club membership numbers but I can’t figure out the purpose. Is this some way to build up a large number of Q... | 2020/08/30 | [
"https://ham.stackexchange.com/questions/17225",
"https://ham.stackexchange.com",
"https://ham.stackexchange.com/users/11878/"
] | What you're talking about sounds like activity that is common for a contest or a QSO party. If you're not familiar with QSO parties they are organized like contests, but the organizers try to emphasize everyone having fun, and don't focus quite as much on scores. There is a saying though, that if something smells, look... | If it was on the 10m band then it could have been the 10-10 club net.https://www.ten-ten.org/ |
17,225 | Every so often while shortwave listening I’ll come across a frequency where tons of hams are talking all over each other giving a call sign and a six digit number only (not a QSO). I imagine these numbers may be club membership numbers but I can’t figure out the purpose. Is this some way to build up a large number of Q... | 2020/08/30 | [
"https://ham.stackexchange.com/questions/17225",
"https://ham.stackexchange.com",
"https://ham.stackexchange.com/users/11878/"
] | What you're talking about sounds like activity that is common for a contest or a QSO party. If you're not familiar with QSO parties they are organized like contests, but the organizers try to emphasize everyone having fun, and don't focus quite as much on scores. There is a saying though, that if something smells, look... | You may have stumbled onto a net that is specifically designed to allow amateurs to work on getting awards quickly by contacting others via net, such as the ARRL Worked All States (WAS) award. There's several nets that do this but perhaps the largest one is the OMISS (Old Man International Sideband Society) net. They h... |
17,225 | Every so often while shortwave listening I’ll come across a frequency where tons of hams are talking all over each other giving a call sign and a six digit number only (not a QSO). I imagine these numbers may be club membership numbers but I can’t figure out the purpose. Is this some way to build up a large number of Q... | 2020/08/30 | [
"https://ham.stackexchange.com/questions/17225",
"https://ham.stackexchange.com",
"https://ham.stackexchange.com/users/11878/"
] | You may have stumbled onto a net that is specifically designed to allow amateurs to work on getting awards quickly by contacting others via net, such as the ARRL Worked All States (WAS) award. There's several nets that do this but perhaps the largest one is the OMISS (Old Man International Sideband Society) net. They h... | If it was on the 10m band then it could have been the 10-10 club net.https://www.ten-ten.org/ |
75,339 | Given a battery with a certain capacity **C** (in Ah) and given a certain charging current **Ich** (in A), how I can calculate the charging time? | 2013/07/09 | [
"https://electronics.stackexchange.com/questions/75339",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/23983/"
] | Charging time depends on a very large number of factors and so capacity and current are insufficient information to make a good calculation. For example, for a typical lead-acid battery you don't charge beyond 75% capacity at a constant current.
You can trade off battery lifetime against charging time. The appropriate... | Divide C by Ich.
Example: C = 20Ah, I=1A => 20h
Also, charging current might be given as a ratio of C. In this case it would be marked as 0.5C.
Edit: Manufacturers give a C rating = capacity in amp-hours. That says nothing about the actual charge or discharge current. Then they might give a ratio of C for charging an... |
17,799,764 | In C, it is possible for functions to return pointers to memory that that function dynamically-allocated and require the calling code to free it. It's also common to require that the calling code supplies a buffer to a second function, which then sets the contents of that buffer. For example:
```
struct mystruct {
... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17799764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1087161/"
] | It depends on the specific situation but in general supplying the allocated buffer seems to be preferable.
As mentioned by Jim, DLLs can cause problems if called function allocates memory. That would be the case if you decide to distribute the code as a Dll and get\_a\_struct is exported to/is visible by the users of... | I think that providing the already allocated struct as an argument is preferable, because in most cases you wouldn't need to call malloc/calloc in the calling code, and therefore worrying about free'ing it. Example:
```
int init_struct(struct some_struct *ss, args...)
{
// init ss
}
int main()
{
struct some_s... |
17,799,764 | In C, it is possible for functions to return pointers to memory that that function dynamically-allocated and require the calling code to free it. It's also common to require that the calling code supplies a buffer to a second function, which then sets the contents of that buffer. For example:
```
struct mystruct {
... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17799764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1087161/"
] | I think that providing the already allocated struct as an argument is preferable, because in most cases you wouldn't need to call malloc/calloc in the calling code, and therefore worrying about free'ing it. Example:
```
int init_struct(struct some_struct *ss, args...)
{
// init ss
}
int main()
{
struct some_s... | I agree with other answers that passing the allocated `struct` is preferred, but there is one situation where returning a pointer may be preferred.
In case you need to explicitly free some resource at the end (close a file or socket, or free some memory internal to the struct, or join a thread, or something else that ... |
17,799,764 | In C, it is possible for functions to return pointers to memory that that function dynamically-allocated and require the calling code to free it. It's also common to require that the calling code supplies a buffer to a second function, which then sets the contents of that buffer. For example:
```
struct mystruct {
... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17799764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1087161/"
] | It depends on the specific situation but in general supplying the allocated buffer seems to be preferable.
As mentioned by Jim, DLLs can cause problems if called function allocates memory. That would be the case if you decide to distribute the code as a Dll and get\_a\_struct is exported to/is visible by the users of... | The "pass an pointer in is preferred", unless it's absolutely required that every object is a "new object allocated from the heap" for some logistical reason - e.g. it's going to be put into a linked list as a node, and the linked-list handler will eventually destroy the elements by calling free - or some other situati... |
17,799,764 | In C, it is possible for functions to return pointers to memory that that function dynamically-allocated and require the calling code to free it. It's also common to require that the calling code supplies a buffer to a second function, which then sets the contents of that buffer. For example:
```
struct mystruct {
... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17799764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1087161/"
] | The "pass an pointer in is preferred", unless it's absolutely required that every object is a "new object allocated from the heap" for some logistical reason - e.g. it's going to be put into a linked list as a node, and the linked-list handler will eventually destroy the elements by calling free - or some other situati... | I agree with other answers that passing the allocated `struct` is preferred, but there is one situation where returning a pointer may be preferred.
In case you need to explicitly free some resource at the end (close a file or socket, or free some memory internal to the struct, or join a thread, or something else that ... |
17,799,764 | In C, it is possible for functions to return pointers to memory that that function dynamically-allocated and require the calling code to free it. It's also common to require that the calling code supplies a buffer to a second function, which then sets the contents of that buffer. For example:
```
struct mystruct {
... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17799764",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1087161/"
] | It depends on the specific situation but in general supplying the allocated buffer seems to be preferable.
As mentioned by Jim, DLLs can cause problems if called function allocates memory. That would be the case if you decide to distribute the code as a Dll and get\_a\_struct is exported to/is visible by the users of... | I agree with other answers that passing the allocated `struct` is preferred, but there is one situation where returning a pointer may be preferred.
In case you need to explicitly free some resource at the end (close a file or socket, or free some memory internal to the struct, or join a thread, or something else that ... |
29,342,262 | I am working with `AFNetworking`. I created a class called `MyRequest` which extends `NSObject`. I created a method called `requestForPost` that
```
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSDictionary *parameters = @{@"foo": variable1};
[manager POST:@"http://app.com/resourc... | 2015/03/30 | [
"https://Stackoverflow.com/questions/29342262",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/844872/"
] | Use the same way as AFNetworking do: use blocks. One for the success, one for the failure. Using this way in your `UIViewController`, you will know if your request was a success or failure, and the object returned.
In your API file:
```
- (void)yourAPIMethodWithSuccess:(void (^)(id responseObject))success failure:(vo... | Create your custom network layer class to interact with server, where you can make custom handling of any request results/errors. And then use this class in your view controllers.
In this case you can change code in one place and can be sure that everything will be changed for all app, where you use this network layer... |
35,848,688 | MongoDB bulk operations have two options:
1. [**`Bulk.find.updateOne()`**](https://docs.mongodb.org/manual/reference/method/Bulk.find.updateOne/)
>
> Adds a single document update operation to a bulk operations list. The operation can either replace an existing document or update specific fields in an existing docum... | 2016/03/07 | [
"https://Stackoverflow.com/questions/35848688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462347/"
] | With `replaceOne()` you can only replace the entire document, while `updateOne()` allows for updating fields.
Since `replaceOne()` replaces the entire document - fields in the old document not contained in the new will be lost. With `updateOne()` new fields can be added without losing the fields in the old document.
... | `replaceOne()` replaces the entire document, while `updateOne()` allows for updating or adding fields. When using `updateOne()` you also have access to the [update operators](https://docs.mongodb.org/manual/reference/operator/update/) which can reliably perform updates on documents. For example two clients can "simulta... |
35,848,688 | MongoDB bulk operations have two options:
1. [**`Bulk.find.updateOne()`**](https://docs.mongodb.org/manual/reference/method/Bulk.find.updateOne/)
>
> Adds a single document update operation to a bulk operations list. The operation can either replace an existing document or update specific fields in an existing docum... | 2016/03/07 | [
"https://Stackoverflow.com/questions/35848688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462347/"
] | With `replaceOne()` you can only replace the entire document, while `updateOne()` allows for updating fields.
Since `replaceOne()` replaces the entire document - fields in the old document not contained in the new will be lost. With `updateOne()` new fields can be added without losing the fields in the old document.
... | `db.collection.replaceOne()` does exactly the same thing as `db.collection.updateOne()`.
The main difference is that `db.collection.replaceOne()`'s data that are being edited will have to go back and forth to the server, whereas `db.collection.UpdateOne()` will request only the filtered ones and not the whole document... |
35,848,688 | MongoDB bulk operations have two options:
1. [**`Bulk.find.updateOne()`**](https://docs.mongodb.org/manual/reference/method/Bulk.find.updateOne/)
>
> Adds a single document update operation to a bulk operations list. The operation can either replace an existing document or update specific fields in an existing docum... | 2016/03/07 | [
"https://Stackoverflow.com/questions/35848688",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/462347/"
] | `replaceOne()` replaces the entire document, while `updateOne()` allows for updating or adding fields. When using `updateOne()` you also have access to the [update operators](https://docs.mongodb.org/manual/reference/operator/update/) which can reliably perform updates on documents. For example two clients can "simulta... | `db.collection.replaceOne()` does exactly the same thing as `db.collection.updateOne()`.
The main difference is that `db.collection.replaceOne()`'s data that are being edited will have to go back and forth to the server, whereas `db.collection.UpdateOne()` will request only the filtered ones and not the whole document... |
8,526,866 | I am having some trouble with assemblies and DLL's.
instrument\_ is declared as an object and I'm creating an instance of "PP150" from the dll whose path is specified by path\_.
```
string className = ContineoProperties.getSingleton().getClassName(path_);
assembly_ = Assembly.LoadFrom(path_);
Type classType = assembl... | 2011/12/15 | [
"https://Stackoverflow.com/questions/8526866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100790/"
] | If object type is not known in compile time,
To call a method defined on an object, you must use Reflection.
```
MethodInfo mInfo = classType.GetMethod("instrumentCommand");
mInfo.Invoke(instrument_, new Object[] { _parameters});
``` | This happens because [`Activator.CreateInstance`](http://msdn.microsoft.com/en-us/library/wccyzw83.aspx) returns an `object`. I would create a separate DLL for the `interface` which is implemented by the class you want to instantiate. Both the DLL containing this class, and the executable should reference the DLL conta... |
8,526,866 | I am having some trouble with assemblies and DLL's.
instrument\_ is declared as an object and I'm creating an instance of "PP150" from the dll whose path is specified by path\_.
```
string className = ContineoProperties.getSingleton().getClassName(path_);
assembly_ = Assembly.LoadFrom(path_);
Type classType = assembl... | 2011/12/15 | [
"https://Stackoverflow.com/questions/8526866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100790/"
] | The compiler is never going to recognize the methods on a type that you are loading via reflection (e.g. using `Assembly.GetType()` and `Activator.CreateInstance()`). Unless you have the type metadata available at build time, you will always get that error if you try to call methods that are not defined on Object itsel... | This happens because [`Activator.CreateInstance`](http://msdn.microsoft.com/en-us/library/wccyzw83.aspx) returns an `object`. I would create a separate DLL for the `interface` which is implemented by the class you want to instantiate. Both the DLL containing this class, and the executable should reference the DLL conta... |
8,526,866 | I am having some trouble with assemblies and DLL's.
instrument\_ is declared as an object and I'm creating an instance of "PP150" from the dll whose path is specified by path\_.
```
string className = ContineoProperties.getSingleton().getClassName(path_);
assembly_ = Assembly.LoadFrom(path_);
Type classType = assembl... | 2011/12/15 | [
"https://Stackoverflow.com/questions/8526866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100790/"
] | If object type is not known in compile time,
To call a method defined on an object, you must use Reflection.
```
MethodInfo mInfo = classType.GetMethod("instrumentCommand");
mInfo.Invoke(instrument_, new Object[] { _parameters});
``` | The compiler is never going to recognize the methods on a type that you are loading via reflection (e.g. using `Assembly.GetType()` and `Activator.CreateInstance()`). Unless you have the type metadata available at build time, you will always get that error if you try to call methods that are not defined on Object itsel... |
8,526,866 | I am having some trouble with assemblies and DLL's.
instrument\_ is declared as an object and I'm creating an instance of "PP150" from the dll whose path is specified by path\_.
```
string className = ContineoProperties.getSingleton().getClassName(path_);
assembly_ = Assembly.LoadFrom(path_);
Type classType = assembl... | 2011/12/15 | [
"https://Stackoverflow.com/questions/8526866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100790/"
] | If object type is not known in compile time,
To call a method defined on an object, you must use Reflection.
```
MethodInfo mInfo = classType.GetMethod("instrumentCommand");
mInfo.Invoke(instrument_, new Object[] { _parameters});
``` | The most simple thing would be to link agains PP150.
If you did link against the dll you must use Assembly.LoadFile or Assembly.Load and not LoadFrom because the last one will cause the assembly load to load your assembly in the LoadFrom loader context which will alter type identity.
Suppose you load the Type T from ... |
8,526,866 | I am having some trouble with assemblies and DLL's.
instrument\_ is declared as an object and I'm creating an instance of "PP150" from the dll whose path is specified by path\_.
```
string className = ContineoProperties.getSingleton().getClassName(path_);
assembly_ = Assembly.LoadFrom(path_);
Type classType = assembl... | 2011/12/15 | [
"https://Stackoverflow.com/questions/8526866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1100790/"
] | The compiler is never going to recognize the methods on a type that you are loading via reflection (e.g. using `Assembly.GetType()` and `Activator.CreateInstance()`). Unless you have the type metadata available at build time, you will always get that error if you try to call methods that are not defined on Object itsel... | The most simple thing would be to link agains PP150.
If you did link against the dll you must use Assembly.LoadFile or Assembly.Load and not LoadFrom because the last one will cause the assembly load to load your assembly in the LoadFrom loader context which will alter type identity.
Suppose you load the Type T from ... |
5,146,539 | I am attempting to stream a csv file as an attachment download. The CSV files are getting to be 4MB in size or more, and I need a way for the user to actively download the files without waiting for all of the data to be created and committed to memory first.
I first used my own file wrapper based on Django's `FileWrap... | 2011/02/28 | [
"https://Stackoverflow.com/questions/5146539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264567/"
] | Here's some simple code that'll stream a CSV; you can probably go from this to whatever you need to do:
```
import cStringIO as StringIO
import csv
def csv(request):
def data():
for i in xrange(10):
csvfile = StringIO.StringIO()
csvwriter = csv.writer(csvfile)
csvwriter... | The problem I was having was with the ConditionalGetMiddleware. I saw django-piston come up with a replacement middleware for the ConditionalGetMiddleware that allows streaming:
```
from django.middleware.http import ConditionalGetMiddleware
def compat_middleware_factory(klass):
"""
Class wrapper that only ex... |
5,146,539 | I am attempting to stream a csv file as an attachment download. The CSV files are getting to be 4MB in size or more, and I need a way for the user to actively download the files without waiting for all of the data to be created and committed to memory first.
I first used my own file wrapper based on Django's `FileWrap... | 2011/02/28 | [
"https://Stackoverflow.com/questions/5146539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264567/"
] | Here's some simple code that'll stream a CSV; you can probably go from this to whatever you need to do:
```
import cStringIO as StringIO
import csv
def csv(request):
def data():
for i in xrange(10):
csvfile = StringIO.StringIO()
csvwriter = csv.writer(csvfile)
csvwriter... | The middleware issue has been solved as of Django 1.5 and a [StreamingHttpResponse](https://docs.djangoproject.com/en/1.5/ref/request-response/#django.http.StreamingHttpResponse) has been introduced. The following should do:
```python
import cStringIO as StringIO
import csv
def csv_view(request):
...
# Assume... |
5,146,539 | I am attempting to stream a csv file as an attachment download. The CSV files are getting to be 4MB in size or more, and I need a way for the user to actively download the files without waiting for all of the data to be created and committed to memory first.
I first used my own file wrapper based on Django's `FileWrap... | 2011/02/28 | [
"https://Stackoverflow.com/questions/5146539",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264567/"
] | The middleware issue has been solved as of Django 1.5 and a [StreamingHttpResponse](https://docs.djangoproject.com/en/1.5/ref/request-response/#django.http.StreamingHttpResponse) has been introduced. The following should do:
```python
import cStringIO as StringIO
import csv
def csv_view(request):
...
# Assume... | The problem I was having was with the ConditionalGetMiddleware. I saw django-piston come up with a replacement middleware for the ConditionalGetMiddleware that allows streaming:
```
from django.middleware.http import ConditionalGetMiddleware
def compat_middleware_factory(klass):
"""
Class wrapper that only ex... |
234,251 | I am a SQL Server DBA. I recently had the misfortune of losing a database due to drive failure. I was able to restore the data but for whatever reason, it stopped at a certain time and not all of the data was restored.
I restored the database again to a test server only to find and restore ALL of the data but the pro... | 2019/04/08 | [
"https://dba.stackexchange.com/questions/234251",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/176734/"
] | To subract a month from a date you can use [`dateadd()`](https://learn.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql?view=sql-server-2017).
For example
```
SET @MaxDate = dateadd(month, -1, @MaxDate);
```
would subtract one month from your `@MaxDate`. That would keep the day of the month though. (Unl... | I upvoted @StickyBits answer, but wanted to suggest the usage of a *Date Dimension* table (*if you don't already have one*) as another option. In addition to providing you the ability to determine the last day of any month, there is a wealth of other information that could also be used once you find a particular row in... |
36,983 | I have had this plant for over 17 years sitting near my kitchen sink near 2 windows. Some say it looks like a peace lily however never had a white bloom on it. This had always been a hearty plant and these spikes would appear sometimes. I have looked for similar plants but haven't had any luck. These growing spikes are... | 2018/01/27 | [
"https://gardening.stackexchange.com/questions/36983",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/20675/"
] | This is two plants in one pot. A [spathiphyllum](https://gardening.stackexchange.com/a/5856/499) or peace lily and another succulent plant which I have seen but cannot identify. Possibly a member of the [Euphoribiacia](https://en.wikipedia.org/wiki/Euphorbiaceae) family. Many members of the family are quite hardier and... | What color were the spikes that did come up? Can you describe the blossoms? The leaves don't look right for an anthurium, but I know there are a ton, so maybe there are some with that type of leaf?
The other segmented plant could be a rhipsalis. I'm also not very familiar with them but have one. Very trouble free, tou... |
36,983 | I have had this plant for over 17 years sitting near my kitchen sink near 2 windows. Some say it looks like a peace lily however never had a white bloom on it. This had always been a hearty plant and these spikes would appear sometimes. I have looked for similar plants but haven't had any luck. These growing spikes are... | 2018/01/27 | [
"https://gardening.stackexchange.com/questions/36983",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/20675/"
] | The slender leafless plant shown is a *[Psilotum](http://herbaria.plants.ox.ac.uk/bol/plants400/Profiles/OP/Psilotum)*, commonly known as Whisk Fern.
There are two species in the genus, *Psilotum nudum* and *Psilotum complanatum*.
Following the key [here](http://plantnet.rbgsyd.nsw.gov.au/cgi-bin/NSWfl.pl?page=nswfl&lv... | What color were the spikes that did come up? Can you describe the blossoms? The leaves don't look right for an anthurium, but I know there are a ton, so maybe there are some with that type of leaf?
The other segmented plant could be a rhipsalis. I'm also not very familiar with them but have one. Very trouble free, tou... |
63,413,578 | Upon a fresh start of my ubuntu (on a virtualbox vm), I can build my images normally. Then very inconstantly, it can be the next time I try to build, or the 10th time, it will hang forever after running the command `docker build .`
Dockerfiles are in directories with 5~10 other files (which eliminates the issue with m... | 2020/08/14 | [
"https://Stackoverflow.com/questions/63413578",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11678017/"
] | Ok this bug was viscous.
Sometimes when I need to check how my nginx server behave in one of the containers, I open the VM's graphical interface and pop firefox to have a look.
I only figured today that firefox prompt a pop-up after a while, asking for the admin password in order to access the keychain. And turns out ... | On another terminal window, please check the Docker Daemon Log using `sudo journalctl -fu docker.service` at the time of build command hanging. Also, you can check the list of running processes during the build execution. |
36,520,588 | I need to get directory of both internal storage and SD card if exists. but I've searched and I didn't find something helpful. how can i do that? i need to scan both of them for specific type of files. this code gives me Internal Storage Directory and not my SD card:
```
File file = new File(Environment.getExternalSto... | 2016/04/09 | [
"https://Stackoverflow.com/questions/36520588",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5204833/"
] | There are thousands of links for tutorials, Android developer page is one of the many, below is the link ;
<http://developer.android.com/guide/topics/data/data-storage.html#filesExternal>
As far as I know, you can have access to your app internal dir and query whether sd card is mounted etc. But to get full access to... | Try this line:
```
File sd = Environment.getExternalStorageDirectory();
``` |
65,660,030 | So I am trying to implement an auto language changer for my webpage.
But it keeps refreshing the page as it keeps running.
I want to run this script only once so it doesn't refresh my page forever.
I have this script:
```
var language = navigator.language || navigator.userLanguage;
language = language.substring( 0, ... | 2021/01/11 | [
"https://Stackoverflow.com/questions/65660030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14223610/"
] | Think about it as if you have an infinite loop, like `while (true) {}` — what you need to do is break out of the loop at some point. To break out of this loop, you need to add a check to make sure you're not already on the intended page. That will stop the constant redirection.
```
var language = navigator.language ||... | Don't know if it is a best practice but you can use localStorage.
```
if((localStorage.getItem('pageLoaded') ?? 'true') === 'true') {
alert('dsds')
localStorage.setItem('pageLoaded', 'false')
}
```
The alert will be executed once |
65,660,030 | So I am trying to implement an auto language changer for my webpage.
But it keeps refreshing the page as it keeps running.
I want to run this script only once so it doesn't refresh my page forever.
I have this script:
```
var language = navigator.language || navigator.userLanguage;
language = language.substring( 0, ... | 2021/01/11 | [
"https://Stackoverflow.com/questions/65660030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14223610/"
] | Think about it as if you have an infinite loop, like `while (true) {}` — what you need to do is break out of the loop at some point. To break out of this loop, you need to add a check to make sure you're not already on the intended page. That will stop the constant redirection.
```
var language = navigator.language ||... | Refreshing the page is part of your code, as you can see here
```
var language = navigator.language || navigator.userLanguage;// get users default language
language = language.substring( 0, 2 );
if (language == "pt" || "pt-BR" || "pt-PT"){
window.location.href = "index.html";
}
else {
window.location.href = "indexE... |
642,153 | I have this store in a variable
```
sCellEventTrap-03-28 TRAP-TYPE -- CAC Code: 00
ENTERPRISE compaq
VARIABLES { scellNameDateTime,
scellSWComponent,
scellECode,
scellCAC,
scellEIP}
DESCRIPTION
... | 2015/06/29 | [
"https://askubuntu.com/questions/642153",
"https://askubuntu.com",
"https://askubuntu.com/users/418984/"
] | ### Using awk:
```
awk -v RS='"' -v ORS='"' 'NR==1{print} NR==2{print; printf"\n";exit}' file
```
This sets the record separator to `"`. So, we want to print the first two records and then we are done. In more detail:
* `-v RS='"'`
This sets the input record separator to a double quote.
* `-v ORS='"'`
This sets t... | Though many programs dont like very long lines as input, when your data is
not huge you can often simplify **multi-line matching** by first manipulating
the data to put it all on one line, doing the match, then restoring the newlines.
For example, use tr to replace newline `\n` by some character not in your data (I u... |
642,153 | I have this store in a variable
```
sCellEventTrap-03-28 TRAP-TYPE -- CAC Code: 00
ENTERPRISE compaq
VARIABLES { scellNameDateTime,
scellSWComponent,
scellECode,
scellCAC,
scellEIP}
DESCRIPTION
... | 2015/06/29 | [
"https://askubuntu.com/questions/642153",
"https://askubuntu.com",
"https://askubuntu.com/users/418984/"
] | ### Using awk:
```
awk -v RS='"' -v ORS='"' 'NR==1{print} NR==2{print; printf"\n";exit}' file
```
This sets the record separator to `"`. So, we want to print the first two records and then we are done. In more detail:
* `-v RS='"'`
This sets the input record separator to a double quote.
* `-v ORS='"'`
This sets t... | Using Perl:
```
< infile perl -0777 -pe 's/((.*?"){2}).*/$1/s' > outfile
```
* `-0777`: slurps the whole file at once instead of one line at the time
* `-p`: places a `while (<>) {[...]}` loop around the script and prints the processed file
* `-e`: reads the script from the arguments
Perl command breakdown:
* `s`:... |
642,153 | I have this store in a variable
```
sCellEventTrap-03-28 TRAP-TYPE -- CAC Code: 00
ENTERPRISE compaq
VARIABLES { scellNameDateTime,
scellSWComponent,
scellECode,
scellCAC,
scellEIP}
DESCRIPTION
... | 2015/06/29 | [
"https://askubuntu.com/questions/642153",
"https://askubuntu.com",
"https://askubuntu.com/users/418984/"
] | ### Using awk:
```
awk -v RS='"' -v ORS='"' 'NR==1{print} NR==2{print; printf"\n";exit}' file
```
This sets the record separator to `"`. So, we want to print the first two records and then we are done. In more detail:
* `-v RS='"'`
This sets the input record separator to a double quote.
* `-v ORS='"'`
This sets t... | Here's a shorter `awk` version: `awk '/TRAP-TYPE/,/[[:alpha:]]*"$/ '`
```
$ awk '/TRAP-TYPE/,/[[:alpha:]]*"$/ ' testfile.txt
sCellEventTrap-03-28 TRAP-TYPE -- CAC Code: 00
ENTERPRISE compaq
VARIABLES { scellNameDateTime,
scellSWComponent,
... |
642,153 | I have this store in a variable
```
sCellEventTrap-03-28 TRAP-TYPE -- CAC Code: 00
ENTERPRISE compaq
VARIABLES { scellNameDateTime,
scellSWComponent,
scellECode,
scellCAC,
scellEIP}
DESCRIPTION
... | 2015/06/29 | [
"https://askubuntu.com/questions/642153",
"https://askubuntu.com",
"https://askubuntu.com/users/418984/"
] | ### Using awk:
```
awk -v RS='"' -v ORS='"' 'NR==1{print} NR==2{print; printf"\n";exit}' file
```
This sets the record separator to `"`. So, we want to print the first two records and then we are done. In more detail:
* `-v RS='"'`
This sets the input record separator to a double quote.
* `-v ORS='"'`
This sets t... | Here is a little `python` script:
```py
#!/usr/bin/env python2
with open('/path/to/file.txt') as f:
print '"'.join(f.read().split('"')[:2]) + '"'
```
* `f.read().split('"')` will read the whole file as a string and then split it on `"` to get all the `"` separated portions
* As we are interested in only the firs... |
49,454,227 | Scenario:
I have received auto generated project in ASP.NET CORE from my colleague. There is auto-generated code for Account/Manage service. This code includes ApplicationUser Class, DBContext and migration folder with 00000000000000\_CreateIdentitySchema.cs and 20180323155805\_Snapshot.cs. I have been trying to chang... | 2018/03/23 | [
"https://Stackoverflow.com/questions/49454227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8748639/"
] | You'll need to update the generated migration to do it in steps. Replace the `AlterColumn` call with the following operations:
1. Add the new column with a temporary name
2. Drop the original column
3. Rename the new column using the original columns name
You may also have to rebuild (drop and re-create) all the cons... | I create an migration script what does the job. First I generated the script and made some changes.
```cs
migrationBuilder.DropForeignKey(name: "FK_AspNetUserTokens_AspNetUsers_UserId", table: "AspNetUserTokens");
migrationBuilder.DropForeignKey(name: "FK_AspNetUserRoles_AspNetUsers_UserId", ta... |
49,454,227 | Scenario:
I have received auto generated project in ASP.NET CORE from my colleague. There is auto-generated code for Account/Manage service. This code includes ApplicationUser Class, DBContext and migration folder with 00000000000000\_CreateIdentitySchema.cs and 20180323155805\_Snapshot.cs. I have been trying to chang... | 2018/03/23 | [
"https://Stackoverflow.com/questions/49454227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8748639/"
] | You'll need to update the generated migration to do it in steps. Replace the `AlterColumn` call with the following operations:
1. Add the new column with a temporary name
2. Drop the original column
3. Rename the new column using the original columns name
You may also have to rebuild (drop and re-create) all the cons... | Use CLI command to resolve it
```
dotnet ef migrations add CreateIdentitySchema
dotnet ef database update
``` |
49,454,227 | Scenario:
I have received auto generated project in ASP.NET CORE from my colleague. There is auto-generated code for Account/Manage service. This code includes ApplicationUser Class, DBContext and migration folder with 00000000000000\_CreateIdentitySchema.cs and 20180323155805\_Snapshot.cs. I have been trying to chang... | 2018/03/23 | [
"https://Stackoverflow.com/questions/49454227",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8748639/"
] | I create an migration script what does the job. First I generated the script and made some changes.
```cs
migrationBuilder.DropForeignKey(name: "FK_AspNetUserTokens_AspNetUsers_UserId", table: "AspNetUserTokens");
migrationBuilder.DropForeignKey(name: "FK_AspNetUserRoles_AspNetUsers_UserId", ta... | Use CLI command to resolve it
```
dotnet ef migrations add CreateIdentitySchema
dotnet ef database update
``` |
11,176,547 | When I resize my browser window and make it smaller, the navbar nicely creates a collapse menu with a button on the right top corner. When I view the same site on my android phone, the navbar menu is always collapsed and the top right corner button is not visible. How can this be solved? Thanks!
```
<!DOCTYPE html>
<h... | 2012/06/24 | [
"https://Stackoverflow.com/questions/11176547",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/481554/"
] | You're probably missing the meta tag required for mobile devices to properly scale.
So stick this in the `head` section of your page and try again:
```
<meta name="viewport" content="width=device-width, initial-scale=1.0">
``` | it seems to be a twitter bootstrap issue on opera mobile, it works on the default android browser. So my code seems OK.
<https://github.com/twitter/bootstrap/issues/3621> |
22,549,351 | I wrote a javascript function in which new row gets added in the table. For static data it is working fine, how to place Razor tags inside those javascript var
```
var count = "1";
var strHtml1 ="@Html.CheckBoxFor(x => x[count].isChecked)";
count++;
```
This line doesn't seem to work. How should I place the razor co... | 2014/03/21 | [
"https://Stackoverflow.com/questions/22549351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2104613/"
] | Here your `count` variable is javascript . Can you try to make whole count logic in razor and `strHtml` out like this ?
```
@{
var count = "1";
var strHtml1 =Html.CheckBoxFor(x => x[count].isChecked);
count++;
}
//and in js
var jsStrHmtl='@strHtml1';
``` | Just use single quotes
```
var count = "1";
var strHtml1 ='@Html.CheckBoxFor(x => x[count].isChecked)';
count++;
```
If it is just the value of checkbox then you can get the value using jquery
```
var count = $('.count:checked').val();
``` |
1,272,820 | I have a repeating table, and I want one of the fields to be a hyperlink. There doesn't seem to be any way to set the address of the hyperlink based on a formula, though. I want to be able to make the address equal to some base URL concatenated with one of the other fields in the table. Is there any way to do this? | 2009/08/13 | [
"https://Stackoverflow.com/questions/1272820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146563/"
] | ```
private string ChangeXmlContent(Uri url, XmlDocument xdoc, string description)
{
XmlNode group91 = xdoc.SelectSingleNode("//my:group91", NamespaceManager);
group91.SelectSingleNode("//my:Url1", NamespaceManager).InnerText = url.ToString();
}
```
Fast & easy | I have used the xpath function concat(my:field2,my:field3) with the hyperlink field. you will have to type in the xpath expression yourself as the designer for some reason will not allow it. |
1,272,820 | I have a repeating table, and I want one of the fields to be a hyperlink. There doesn't seem to be any way to set the address of the hyperlink based on a formula, though. I want to be able to make the address equal to some base URL concatenated with one of the other fields in the table. Is there any way to do this? | 2009/08/13 | [
"https://Stackoverflow.com/questions/1272820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146563/"
] | ```
private string ChangeXmlContent(Uri url, XmlDocument xdoc, string description)
{
XmlNode group91 = xdoc.SelectSingleNode("//my:group91", NamespaceManager);
group91.SelectSingleNode("//my:Url1", NamespaceManager).InnerText = url.ToString();
}
```
Fast & easy | I was able to use a custom field (as a Hyperlink field). I then populated the field with the corrected address (FULL ADDRESS!!! That was my problem. No relative URLs!!)
When my form loads, I have a rule that sets the hyperlink field like so:
* RootURL is a custom variable I have already defined in an XML
resource fil... |
22,802,039 | I'm working on an upgrade for our current application (asp.net mvc). Here my problem is, I have a existing css file name "styles.css". Now this file has lots of css classes and they are used in different pages.
Now as a part of the upgrade process, this css file will not be used anymore. But I still want certain css c... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22802039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336009/"
] | Use Chrometools Audits
In Chrome Press: `F12` -> `Audits` -> `Run`
It will let you know what is and is not used.
 | Use a Browser Debugger, click on the elements on site and see on the right corner which classes are machtes and copy them. |
22,802,039 | I'm working on an upgrade for our current application (asp.net mvc). Here my problem is, I have a existing css file name "styles.css". Now this file has lots of css classes and they are used in different pages.
Now as a part of the upgrade process, this css file will not be used anymore. But I still want certain css c... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22802039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336009/"
] | Use Chrometools Audits
In Chrome Press: `F12` -> `Audits` -> `Run`
It will let you know what is and is not used.
 | There are a lot of ways, for example:
* Firefox plugin, this will extract the used css
<https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/>
* for chrome
<https://chrome.google.com/webstore/detail/css-remove-and-combine/cdfmaaeapjmacolkojefhfollmphonoh?hl=en-GB>
* Manually: another way in the chrome (or... |
22,802,039 | I'm working on an upgrade for our current application (asp.net mvc). Here my problem is, I have a existing css file name "styles.css". Now this file has lots of css classes and they are used in different pages.
Now as a part of the upgrade process, this css file will not be used anymore. But I still want certain css c... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22802039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336009/"
] | Finding ones that are used in single page should be easy with multiple tools. **One good tool is called [UnCSS](https://github.com/giakki/uncss)**.
The trick is checking an entire site where CSS file is shared accross pages.
This approach was popular in social networks recently with some high profile guys sharing it ... | Use a Browser Debugger, click on the elements on site and see on the right corner which classes are machtes and copy them. |
22,802,039 | I'm working on an upgrade for our current application (asp.net mvc). Here my problem is, I have a existing css file name "styles.css". Now this file has lots of css classes and they are used in different pages.
Now as a part of the upgrade process, this css file will not be used anymore. But I still want certain css c... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22802039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336009/"
] | There are a lot of ways, for example:
* Firefox plugin, this will extract the used css
<https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/>
* for chrome
<https://chrome.google.com/webstore/detail/css-remove-and-combine/cdfmaaeapjmacolkojefhfollmphonoh?hl=en-GB>
* Manually: another way in the chrome (or... | Use a Browser Debugger, click on the elements on site and see on the right corner which classes are machtes and copy them. |
22,802,039 | I'm working on an upgrade for our current application (asp.net mvc). Here my problem is, I have a existing css file name "styles.css". Now this file has lots of css classes and they are used in different pages.
Now as a part of the upgrade process, this css file will not be used anymore. But I still want certain css c... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22802039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/336009/"
] | Finding ones that are used in single page should be easy with multiple tools. **One good tool is called [UnCSS](https://github.com/giakki/uncss)**.
The trick is checking an entire site where CSS file is shared accross pages.
This approach was popular in social networks recently with some high profile guys sharing it ... | There are a lot of ways, for example:
* Firefox plugin, this will extract the used css
<https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/>
* for chrome
<https://chrome.google.com/webstore/detail/css-remove-and-combine/cdfmaaeapjmacolkojefhfollmphonoh?hl=en-GB>
* Manually: another way in the chrome (or... |
572,608 | I'm trying to quantify some intuition I have about friction and rocket sled.
[](https://i.stack.imgur.com/lCIaE.png)
Suppose a rectangular sled with length $l$, weight $W$ on a surface with friction coefficient $\mu$. A rocket attached height $h$ from the ground on... | 2020/08/11 | [
"https://physics.stackexchange.com/questions/572608",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/242281/"
] | Your intuition is correct.
If the sled is not to tip over or otherwise lose contact with the ground, the sum of the vertical forces on the sled must equal zero and the sum of the moments about any point on the sled must be zero.
Neglecting the weight of the rocket, summing the vertical forces give us
$$-W+R\_{1}+R\_... | You are concerned about rotational stability. You have the vertical force equation: $N\_f$ + $N\_r$ - mg = 0 with two unknown N's at the front and rear. Combine that with a torque equation taken about the front support: Hh + $N\_r$L – mg(L/2) = 0. You need $N\_r$ to be greater than zero. |
26,112,188 | If I want to design a button that all java can use it without need to write it in every java,
what should I do?
For Example:
I design a Button.OnClickListener function to search bluetooth devices.
but another java also need to use this Button.OnClickListener function,
I don't want to write same way on two java.
ledW... | 2014/09/30 | [
"https://Stackoverflow.com/questions/26112188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3963169/"
] | You can use Python's `paramiko` package to launch a program on the server via ssh. That program would then in turn receive commands (perhaps via stdin) and return results (via stdout) from the controlling program. So basically you'll use `paramiko.SSHClient` to connect to the server and run a second Python program whic... | Use tunneling by setting up a `SSH` session that tunnels the `Telnet` traffic:
So ssh from `localhost` to `server` with the option `-L xxx:deviceip:23`
(xxx is a free port on localhost, device is the IP address of "device", 23 is the telnet port).
Then open a telnet session on your localhost to localhost:xxx. SSH will... |
1,771,074 | For our project, the group use Microsoft Access. The VBA class is capability limited. How can VBA class be made to support inheritance? | 2009/11/20 | [
"https://Stackoverflow.com/questions/1771074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215519/"
] | VBA does **not** support inheritance for user defined classes. It does offer a type of Interface though.
**More Info:**
1. This article includes an example of using VBA "Implements" interface keyword.
[Faking inheritance in VBA to remove code duplication](http://bytes.com/topic/access/answers/195390-faking-inheritanc... | In short, you can't. Although you can do 'mock' inheritance through the use of the Implements keyword - a bit like an Interface in .Net. |
1,771,074 | For our project, the group use Microsoft Access. The VBA class is capability limited. How can VBA class be made to support inheritance? | 2009/11/20 | [
"https://Stackoverflow.com/questions/1771074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215519/"
] | VBA does **not** support inheritance for user defined classes. It does offer a type of Interface though.
**More Info:**
1. This article includes an example of using VBA "Implements" interface keyword.
[Faking inheritance in VBA to remove code duplication](http://bytes.com/topic/access/answers/195390-faking-inheritanc... | VBA is a *scripting language*, not a fully featured *programming language*! It was never designed to support such things like inheritance, this is far beyond its intended scope. Rather, it is intended to be an automation client, that can invoke binary components (which in turn are written using a 'real' development sys... |
1,771,074 | For our project, the group use Microsoft Access. The VBA class is capability limited. How can VBA class be made to support inheritance? | 2009/11/20 | [
"https://Stackoverflow.com/questions/1771074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215519/"
] | VBA does **not** support inheritance for user defined classes. It does offer a type of Interface though.
**More Info:**
1. This article includes an example of using VBA "Implements" interface keyword.
[Faking inheritance in VBA to remove code duplication](http://bytes.com/topic/access/answers/195390-faking-inheritanc... | As mentioned, you can do inheritance with VBA. You can enforce an Interface using implements. But if you want a class to have the properties and method of another class, the best you are going to get is to use a public property of the the type of class you want to inherit. This obviously has some limitations, but it's ... |
1,771,074 | For our project, the group use Microsoft Access. The VBA class is capability limited. How can VBA class be made to support inheritance? | 2009/11/20 | [
"https://Stackoverflow.com/questions/1771074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215519/"
] | In short, you can't. Although you can do 'mock' inheritance through the use of the Implements keyword - a bit like an Interface in .Net. | VBA is a *scripting language*, not a fully featured *programming language*! It was never designed to support such things like inheritance, this is far beyond its intended scope. Rather, it is intended to be an automation client, that can invoke binary components (which in turn are written using a 'real' development sys... |
1,771,074 | For our project, the group use Microsoft Access. The VBA class is capability limited. How can VBA class be made to support inheritance? | 2009/11/20 | [
"https://Stackoverflow.com/questions/1771074",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215519/"
] | As mentioned, you can do inheritance with VBA. You can enforce an Interface using implements. But if you want a class to have the properties and method of another class, the best you are going to get is to use a public property of the the type of class you want to inherit. This obviously has some limitations, but it's ... | VBA is a *scripting language*, not a fully featured *programming language*! It was never designed to support such things like inheritance, this is far beyond its intended scope. Rather, it is intended to be an automation client, that can invoke binary components (which in turn are written using a 'real' development sys... |
16,010,833 | I have one div which has three other inline divs. I would like to align these three divs vertically in middle. Spend hours trying to understand why vertical-align: middle; do no work and how to solve the problem. Any suggestion how to solve the problem?
[example](http://jsfiddle.net/tomasr/Vwuam/)
```
<div id="result... | 2013/04/15 | [
"https://Stackoverflow.com/questions/16010833",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/281014/"
] | Use these two property with your cells
```
.cell1
{
display: table-cell;
vertical-align: middle;
// other properties
}
```
[JS Fiddle](http://jsfiddle.net/Vwuam/2/)
Update: Without `display:table-cell`
Use `vertical-align: middle;` with your cells
```
.cell2 {
display: inline-block;
vertical-... | I just came across this [what is vertical align?](http://css-tricks.com/what-is-vertical-align/) with regard to your question **why vertical-align: middle; do no work**
```
The confusion, in my opinion, sets in when people try to use vertical-align on
block level elements and get no results. If you have a small div ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.