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 |
|---|---|---|---|---|---|
8,957,028 | Let's say I have a triangle given by the three integer vertices (x1,y1), (x2,y2) and (x3,y3). What sort of algorithm can I use to return a comprehensive list of ALL (x,y) integer pairs that lie inside the triangle. | 2012/01/21 | [
"https://Stackoverflow.com/questions/8957028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412082/"
] | The following algorithm should be appropriate:
1. Sort the triangle vertices by x coordinate in increasing order. Now we have two segments (1-2 and 2-3) on the one side (top or bottom), and one segment from the other one (1-3).
2. Compute coefficients of equations of lines (which contain the segments):
```
A * x + B ... | I suppose you have a list of pairs you want to test (if this is not what your problem is about, please specify your question clearly). You should store the pairs into quad-tree or kd-tree structure first, in order to have a set of candidates which is small enough. If you have few points, this is probably not worth the ... |
8,957,028 | Let's say I have a triangle given by the three integer vertices (x1,y1), (x2,y2) and (x3,y3). What sort of algorithm can I use to return a comprehensive list of ALL (x,y) integer pairs that lie inside the triangle. | 2012/01/21 | [
"https://Stackoverflow.com/questions/8957028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412082/"
] | The proper name for this problem is triangle [rasterization](http://en.wikipedia.org/wiki/Rasterisation).
It's a well researched problem and there's variety of methods to do it. The two popular methods are:
1. Scan line by scan line.
For each scan-line you require some basic geometry to recalculate
the start and th... | I suppose you have a list of pairs you want to test (if this is not what your problem is about, please specify your question clearly). You should store the pairs into quad-tree or kd-tree structure first, in order to have a set of candidates which is small enough. If you have few points, this is probably not worth the ... |
8,957,028 | Let's say I have a triangle given by the three integer vertices (x1,y1), (x2,y2) and (x3,y3). What sort of algorithm can I use to return a comprehensive list of ALL (x,y) integer pairs that lie inside the triangle. | 2012/01/21 | [
"https://Stackoverflow.com/questions/8957028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412082/"
] | The following algorithm should be appropriate:
1. Sort the triangle vertices by x coordinate in increasing order. Now we have two segments (1-2 and 2-3) on the one side (top or bottom), and one segment from the other one (1-3).
2. Compute coefficients of equations of lines (which contain the segments):
```
A * x + B ... | I like ray casting, nicely described in [this Wikipedia article](http://en.wikipedia.org/wiki/Point_in_polygon). Used it in my project for the same purpose. That method scales on other polygons too, including concave. Not sure about the performance, but it is easily coded, so you could try it yourself (I had no perform... |
8,957,028 | Let's say I have a triangle given by the three integer vertices (x1,y1), (x2,y2) and (x3,y3). What sort of algorithm can I use to return a comprehensive list of ALL (x,y) integer pairs that lie inside the triangle. | 2012/01/21 | [
"https://Stackoverflow.com/questions/8957028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412082/"
] | The proper name for this problem is triangle [rasterization](http://en.wikipedia.org/wiki/Rasterisation).
It's a well researched problem and there's variety of methods to do it. The two popular methods are:
1. Scan line by scan line.
For each scan-line you require some basic geometry to recalculate
the start and th... | I like ray casting, nicely described in [this Wikipedia article](http://en.wikipedia.org/wiki/Point_in_polygon). Used it in my project for the same purpose. That method scales on other polygons too, including concave. Not sure about the performance, but it is easily coded, so you could try it yourself (I had no perform... |
8,957,028 | Let's say I have a triangle given by the three integer vertices (x1,y1), (x2,y2) and (x3,y3). What sort of algorithm can I use to return a comprehensive list of ALL (x,y) integer pairs that lie inside the triangle. | 2012/01/21 | [
"https://Stackoverflow.com/questions/8957028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/412082/"
] | The following algorithm should be appropriate:
1. Sort the triangle vertices by x coordinate in increasing order. Now we have two segments (1-2 and 2-3) on the one side (top or bottom), and one segment from the other one (1-3).
2. Compute coefficients of equations of lines (which contain the segments):
```
A * x + B ... | The proper name for this problem is triangle [rasterization](http://en.wikipedia.org/wiki/Rasterisation).
It's a well researched problem and there's variety of methods to do it. The two popular methods are:
1. Scan line by scan line.
For each scan-line you require some basic geometry to recalculate
the start and th... |
189,188 | I was tiding yo my base when I came across this

I know that during Christmas there was a special object that could spawn which was a Christmas tree but it also had an extra benefit, I think it was a spell.
I am wondering, is there anything special ... | 2014/10/24 | [
"https://gaming.stackexchange.com/questions/189188",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/30879/"
] | THe `Halloween Headstone` is the same as the `Christmas tree` it only gives a different reward.
I just removed an `Halloween Headstone` and I got `75000 Elixer`.
[Here](https://www.youtube.com/watch?v=i5Y4cdAwkds) is a video about it.
I found multiple video's and on all of the video's people got `75000 Elixer`
So a... | The first time when I removed Halloween Headstone, I got 75,000 Gold, and the second time was 75,000 Elixir! |
3,591,002 | I need some help on this because I can't figure it out.
Given only +, -, /, \* (arithmetic operations) and the value x where x > 0, Is there a way to write 787 with at most 28 arithmetic operations?
Best I could come up with is 29 operations with a dynamic programming code (i can post it here upon request). I know th... | 2020/03/23 | [
"https://math.stackexchange.com/questions/3591002",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/268446/"
] | A similar sequence is <https://oeis.org/A005245>, where they use $1$s and just addition and multiplication. They count the number of $1$s, which I think should be no less than yours because they don't need to divide by $x$ at the end.
In that sequence, they seem to be working with
$$787=2\cdot 3(2\cdot 5 \cdot (4 \c... | With Ross Millikan's answer, I replaced the constants with (x+x+..)/x then distruted the common divisions between addends to reduce the operations. I got this:
`((x+x)/x*(x+x+x)*(((x+x)/x*(x+x+x+x+x)*(((x+x+x+x)/x*(x+x+x)+x)/x)+x)/x)+x)/x` which has 27 operations.
So I guess, what's missing in my DP is the ability to ... |
298,829 | The output resistance of small signal model for common drain JFET amplifier equals $$ \frac{1}{g\_\text{m}} || R\_{\text{ds(on)}} \parallel R\_\text{S} $$ and since $$ R\_{\text{ds(on)}} =\frac{1}{g\_\text{m}} $$ we can also write this formula as \$\frac{1}{g\_m} \parallel \frac{1}{g\_m} \parallel R\_\text{S}\$ right?
... | 2017/04/10 | [
"https://electronics.stackexchange.com/questions/298829",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/133145/"
] | As an EE that works with lithium-ion, we don't charge our batteries at temperatures that low, typically the software is set to disable charging below -20C to 0C, depending on the application. We make some batteries with resistive heaters in them, which allow operation at temperatures as low as -40C to -60C after a shor... | Yes, you will damage the battery if you charge at low temperatures (beyond the product specification). You can read this if you only believe research papers: <https://www.researchgate.net/publication/282407632_Optimal_Low_Temperature_Charging_of_Lithium-ion_Batteries>
If you are using solar to charge the battery, then... |
20,119,399 | I want to retrieve the value of label field by clicking on link button. it has to be fired only in onclick event only. i have tried with this , but it is giving null value.
```
protected void verifycount_Click(object sender, EventArgs e)
{
GridViewRow link = ((LinkButton)sender).NamingContainer as GridViewRow; ... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20119399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959592/"
] | You don't need to keep around your old migration files in a Rails app, because your database schema should be captured either in schema.rb or an equivalent SQL file that can be used to regenerate your schema.
Migrations are not the authoritative source for your database schema. That role falls to either db/schema.rb o... | You can delete your old migrations. After you have done this, when you are setting up your app you will need to run:
```
rake db:schema:load
```
Instead of:
```
rake db:migrate
``` |
20,119,399 | I want to retrieve the value of label field by clicking on link button. it has to be fired only in onclick event only. i have tried with this , but it is giving null value.
```
protected void verifycount_Click(object sender, EventArgs e)
{
GridViewRow link = ((LinkButton)sender).NamingContainer as GridViewRow; ... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20119399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959592/"
] | You don't need to keep around your old migration files in a Rails app, because your database schema should be captured either in schema.rb or an equivalent SQL file that can be used to regenerate your schema.
Migrations are not the authoritative source for your database schema. That role falls to either db/schema.rb o... | here is what I did, I found the last version migrated on production `ActiveRecord::SchemaMigration.last.version` and deleted all the migrations before that in my source code.
not the best way but I did `find db/migrate -type f`, copied the list of files before the last version and `pbpaste | rm` (macos). |
20,119,399 | I want to retrieve the value of label field by clicking on link button. it has to be fired only in onclick event only. i have tried with this , but it is giving null value.
```
protected void verifycount_Click(object sender, EventArgs e)
{
GridViewRow link = ((LinkButton)sender).NamingContainer as GridViewRow; ... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20119399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2959592/"
] | You can delete your old migrations. After you have done this, when you are setting up your app you will need to run:
```
rake db:schema:load
```
Instead of:
```
rake db:migrate
``` | here is what I did, I found the last version migrated on production `ActiveRecord::SchemaMigration.last.version` and deleted all the migrations before that in my source code.
not the best way but I did `find db/migrate -type f`, copied the list of files before the last version and `pbpaste | rm` (macos). |
192,839 | In the Flashpoint episode "The Farm," there's a scene where you can see one of the officers run a jumper cable from one contact on an electric fence to another, then cut the line of the fence (not breaking the circuit, mind you). Based on context clues, one could assume the fence surrounds a large, multi-acre plot of l... | 2015/09/30 | [
"https://electronics.stackexchange.com/questions/192839",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/86477/"
] | Theoretically, yes. You can measure the amount of resistance and determine the length of the fence.
However, there are some practical limitations to this. Doing this accurately would require quite an investment while the resistance won't be stable. Even the weather would influence it. Compensating for all those fluctu... | The only way a detection could be feasible is looking for changes in signal reflection. Neither resistance nor inductance will provide reliable information of bypassing activities, especially not with a mile long fence wire. However, with a sharp peaking signal (already present due to the nature of the electric fence) ... |
192,839 | In the Flashpoint episode "The Farm," there's a scene where you can see one of the officers run a jumper cable from one contact on an electric fence to another, then cut the line of the fence (not breaking the circuit, mind you). Based on context clues, one could assume the fence surrounds a large, multi-acre plot of l... | 2015/09/30 | [
"https://electronics.stackexchange.com/questions/192839",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/86477/"
] | Theoretically, yes. You can measure the amount of resistance and determine the length of the fence.
However, there are some practical limitations to this. Doing this accurately would require quite an investment while the resistance won't be stable. Even the weather would influence it. Compensating for all those fluctu... | I am not going to show this to my family (we meet monthly at the family farm where there are multiple electric fences), because they would laugh at it. Electric fences are designed for maximum reliability when installed by someone with only the barest understanding of electricity. As such they have no components not ne... |
192,839 | In the Flashpoint episode "The Farm," there's a scene where you can see one of the officers run a jumper cable from one contact on an electric fence to another, then cut the line of the fence (not breaking the circuit, mind you). Based on context clues, one could assume the fence surrounds a large, multi-acre plot of l... | 2015/09/30 | [
"https://electronics.stackexchange.com/questions/192839",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/86477/"
] | Theoretically, yes. You can measure the amount of resistance and determine the length of the fence.
However, there are some practical limitations to this. Doing this accurately would require quite an investment while the resistance won't be stable. Even the weather would influence it. Compensating for all those fluctu... | Even if we ignore all the mentioned variables and assume an ideal fence, the change in resistance would be very small. Assuming the wire's total length of 4,000 ft, at a height of 6 ft. To bypass it, one would need to add only about 10 ft (5 ft down, 5 ft up). With a resistance of 1 ohm per 10 ft, the initial total res... |
192,839 | In the Flashpoint episode "The Farm," there's a scene where you can see one of the officers run a jumper cable from one contact on an electric fence to another, then cut the line of the fence (not breaking the circuit, mind you). Based on context clues, one could assume the fence surrounds a large, multi-acre plot of l... | 2015/09/30 | [
"https://electronics.stackexchange.com/questions/192839",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/86477/"
] | Theoretically, yes. You can measure the amount of resistance and determine the length of the fence.
However, there are some practical limitations to this. Doing this accurately would require quite an investment while the resistance won't be stable. Even the weather would influence it. Compensating for all those fluctu... | Some car engine controls look at wave forms in ignition secondary wires to learn if & how fuel-air mixture is burning. Some can spark again if burn is not as desired. A fence monitor could measure wave forms of voltage applied & current to detect fence changes. Measuring between pulses is not the only option.
Sorry I d... |
192,839 | In the Flashpoint episode "The Farm," there's a scene where you can see one of the officers run a jumper cable from one contact on an electric fence to another, then cut the line of the fence (not breaking the circuit, mind you). Based on context clues, one could assume the fence surrounds a large, multi-acre plot of l... | 2015/09/30 | [
"https://electronics.stackexchange.com/questions/192839",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/86477/"
] | The only way a detection could be feasible is looking for changes in signal reflection. Neither resistance nor inductance will provide reliable information of bypassing activities, especially not with a mile long fence wire. However, with a sharp peaking signal (already present due to the nature of the electric fence) ... | Even if we ignore all the mentioned variables and assume an ideal fence, the change in resistance would be very small. Assuming the wire's total length of 4,000 ft, at a height of 6 ft. To bypass it, one would need to add only about 10 ft (5 ft down, 5 ft up). With a resistance of 1 ohm per 10 ft, the initial total res... |
192,839 | In the Flashpoint episode "The Farm," there's a scene where you can see one of the officers run a jumper cable from one contact on an electric fence to another, then cut the line of the fence (not breaking the circuit, mind you). Based on context clues, one could assume the fence surrounds a large, multi-acre plot of l... | 2015/09/30 | [
"https://electronics.stackexchange.com/questions/192839",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/86477/"
] | The only way a detection could be feasible is looking for changes in signal reflection. Neither resistance nor inductance will provide reliable information of bypassing activities, especially not with a mile long fence wire. However, with a sharp peaking signal (already present due to the nature of the electric fence) ... | Some car engine controls look at wave forms in ignition secondary wires to learn if & how fuel-air mixture is burning. Some can spark again if burn is not as desired. A fence monitor could measure wave forms of voltage applied & current to detect fence changes. Measuring between pulses is not the only option.
Sorry I d... |
192,839 | In the Flashpoint episode "The Farm," there's a scene where you can see one of the officers run a jumper cable from one contact on an electric fence to another, then cut the line of the fence (not breaking the circuit, mind you). Based on context clues, one could assume the fence surrounds a large, multi-acre plot of l... | 2015/09/30 | [
"https://electronics.stackexchange.com/questions/192839",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/86477/"
] | I am not going to show this to my family (we meet monthly at the family farm where there are multiple electric fences), because they would laugh at it. Electric fences are designed for maximum reliability when installed by someone with only the barest understanding of electricity. As such they have no components not ne... | Even if we ignore all the mentioned variables and assume an ideal fence, the change in resistance would be very small. Assuming the wire's total length of 4,000 ft, at a height of 6 ft. To bypass it, one would need to add only about 10 ft (5 ft down, 5 ft up). With a resistance of 1 ohm per 10 ft, the initial total res... |
192,839 | In the Flashpoint episode "The Farm," there's a scene where you can see one of the officers run a jumper cable from one contact on an electric fence to another, then cut the line of the fence (not breaking the circuit, mind you). Based on context clues, one could assume the fence surrounds a large, multi-acre plot of l... | 2015/09/30 | [
"https://electronics.stackexchange.com/questions/192839",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/86477/"
] | I am not going to show this to my family (we meet monthly at the family farm where there are multiple electric fences), because they would laugh at it. Electric fences are designed for maximum reliability when installed by someone with only the barest understanding of electricity. As such they have no components not ne... | Some car engine controls look at wave forms in ignition secondary wires to learn if & how fuel-air mixture is burning. Some can spark again if burn is not as desired. A fence monitor could measure wave forms of voltage applied & current to detect fence changes. Measuring between pulses is not the only option.
Sorry I d... |
192,839 | In the Flashpoint episode "The Farm," there's a scene where you can see one of the officers run a jumper cable from one contact on an electric fence to another, then cut the line of the fence (not breaking the circuit, mind you). Based on context clues, one could assume the fence surrounds a large, multi-acre plot of l... | 2015/09/30 | [
"https://electronics.stackexchange.com/questions/192839",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/86477/"
] | Even if we ignore all the mentioned variables and assume an ideal fence, the change in resistance would be very small. Assuming the wire's total length of 4,000 ft, at a height of 6 ft. To bypass it, one would need to add only about 10 ft (5 ft down, 5 ft up). With a resistance of 1 ohm per 10 ft, the initial total res... | Some car engine controls look at wave forms in ignition secondary wires to learn if & how fuel-air mixture is burning. Some can spark again if burn is not as desired. A fence monitor could measure wave forms of voltage applied & current to detect fence changes. Measuring between pulses is not the only option.
Sorry I d... |
45,225,830 | I'm using a KendoUI for Angular datepicker; to define todays date, I use:
```
public value: Date = new Date();
```
What do I do if I want to display the date as todays date, minus 180 days?
This is in typescript/angular 4, etc.. as in my component.ts file:
```
import { Component, OnInit } from '@angular/core';
@C... | 2017/07/20 | [
"https://Stackoverflow.com/questions/45225830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/935578/"
] | JavaScript class `Date` may be constructed passing milliseconds since 1 January 1970 00:00:00 UTC, so you can use it like:
```js
let date180DaysAgo = new Date(new Date().getTime() - 180 * 24 * 60 * 60 * 1000);
console.log(date180DaysAgo);
```
180 in the constructor is number of days to subtract, `180 * 24 * 60 * 60 ... | ```
let today = new Date();
let day = this.today.getDate() - 180;
console.log(day);
``` |
45,225,830 | I'm using a KendoUI for Angular datepicker; to define todays date, I use:
```
public value: Date = new Date();
```
What do I do if I want to display the date as todays date, minus 180 days?
This is in typescript/angular 4, etc.. as in my component.ts file:
```
import { Component, OnInit } from '@angular/core';
@C... | 2017/07/20 | [
"https://Stackoverflow.com/questions/45225830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/935578/"
] | I very much appreciate the replies from everyone, however, they did not function as expected with KendoUI for Angular. The currently undocumented way to manipulate the date in the Kendo datePicker object is:
You'll require the 'addDays' @progress module:
```
import { addDays } from '@progress/kendo-date-math';
```
... | ```
let today = new Date();
let day = this.today.getDate() - 180;
console.log(day);
``` |
45,225,830 | I'm using a KendoUI for Angular datepicker; to define todays date, I use:
```
public value: Date = new Date();
```
What do I do if I want to display the date as todays date, minus 180 days?
This is in typescript/angular 4, etc.. as in my component.ts file:
```
import { Component, OnInit } from '@angular/core';
@C... | 2017/07/20 | [
"https://Stackoverflow.com/questions/45225830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/935578/"
] | JavaScript class `Date` may be constructed passing milliseconds since 1 January 1970 00:00:00 UTC, so you can use it like:
```js
let date180DaysAgo = new Date(new Date().getTime() - 180 * 24 * 60 * 60 * 1000);
console.log(date180DaysAgo);
```
180 in the constructor is number of days to subtract, `180 * 24 * 60 * 60 ... | Use Javascript's Date
`var date180 = new Date(date.getTime());
date180.setDate(date.getDate() - 180);` |
45,225,830 | I'm using a KendoUI for Angular datepicker; to define todays date, I use:
```
public value: Date = new Date();
```
What do I do if I want to display the date as todays date, minus 180 days?
This is in typescript/angular 4, etc.. as in my component.ts file:
```
import { Component, OnInit } from '@angular/core';
@C... | 2017/07/20 | [
"https://Stackoverflow.com/questions/45225830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/935578/"
] | I very much appreciate the replies from everyone, however, they did not function as expected with KendoUI for Angular. The currently undocumented way to manipulate the date in the Kendo datePicker object is:
You'll require the 'addDays' @progress module:
```
import { addDays } from '@progress/kendo-date-math';
```
... | JavaScript class `Date` may be constructed passing milliseconds since 1 January 1970 00:00:00 UTC, so you can use it like:
```js
let date180DaysAgo = new Date(new Date().getTime() - 180 * 24 * 60 * 60 * 1000);
console.log(date180DaysAgo);
```
180 in the constructor is number of days to subtract, `180 * 24 * 60 * 60 ... |
45,225,830 | I'm using a KendoUI for Angular datepicker; to define todays date, I use:
```
public value: Date = new Date();
```
What do I do if I want to display the date as todays date, minus 180 days?
This is in typescript/angular 4, etc.. as in my component.ts file:
```
import { Component, OnInit } from '@angular/core';
@C... | 2017/07/20 | [
"https://Stackoverflow.com/questions/45225830",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/935578/"
] | I very much appreciate the replies from everyone, however, they did not function as expected with KendoUI for Angular. The currently undocumented way to manipulate the date in the Kendo datePicker object is:
You'll require the 'addDays' @progress module:
```
import { addDays } from '@progress/kendo-date-math';
```
... | Use Javascript's Date
`var date180 = new Date(date.getTime());
date180.setDate(date.getDate() - 180);` |
470,352 | Say I want to play a game like Go or Go Bang or Chess on a the surface of a sphere ([see here for a question about examples](https://boardgames.stackexchange.com/questions/12729/what-are-examples-of-go-played-on-non-flat-surfaces-like-on-a-sphere)).
The grid on the sphere should have the following characterisitcs:
* ... | 2013/08/18 | [
"https://math.stackexchange.com/questions/470352",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/90773/"
] | A quick calculation using Euler's $V-E+F=2$, and the fact that since each edge joins two vertices and we have four edges at each vertex, $E=2V$ gives $F-V=2$ ie that there are two more faces than vertices.
Now suppose there are $f\_r$ faces with $r$ vertices. We know that each vertex adjoins 4 faces, so that $$\sum\_{... | I found one way to do it myself: I took a buckyball-like structure, the grid consists of hexagons that are surrounded by (alternating) hexagons and pentagons, so that they share sides. Now, if I define each shared edge of hexagons as a node, each new node is connected to four neighbors.The whole thing looks like triang... |
470,352 | Say I want to play a game like Go or Go Bang or Chess on a the surface of a sphere ([see here for a question about examples](https://boardgames.stackexchange.com/questions/12729/what-are-examples-of-go-played-on-non-flat-surfaces-like-on-a-sphere)).
The grid on the sphere should have the following characterisitcs:
* ... | 2013/08/18 | [
"https://math.stackexchange.com/questions/470352",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/90773/"
] | A quick calculation using Euler's $V-E+F=2$, and the fact that since each edge joins two vertices and we have four edges at each vertex, $E=2V$ gives $F-V=2$ ie that there are two more faces than vertices.
Now suppose there are $f\_r$ faces with $r$ vertices. We know that each vertex adjoins 4 faces, so that $$\sum\_{... | **Option 1:** Give up on a sphere and use a torus. I think the answer is trivial there: imagine a 2-D chess or go board with the left stitched to the right, and the top stitched to the bottom. (The same way old 2-D video games work: fly off the "top" of the screen, and reappear at the bottom at the same horizontal offs... |
470,352 | Say I want to play a game like Go or Go Bang or Chess on a the surface of a sphere ([see here for a question about examples](https://boardgames.stackexchange.com/questions/12729/what-are-examples-of-go-played-on-non-flat-surfaces-like-on-a-sphere)).
The grid on the sphere should have the following characterisitcs:
* ... | 2013/08/18 | [
"https://math.stackexchange.com/questions/470352",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/90773/"
] | A quick calculation using Euler's $V-E+F=2$, and the fact that since each edge joins two vertices and we have four edges at each vertex, $E=2V$ gives $F-V=2$ ie that there are two more faces than vertices.
Now suppose there are $f\_r$ faces with $r$ vertices. We know that each vertex adjoins 4 faces, so that $$\sum\_{... | The general problem of "how do I pack N points on a sphere, where I maximize the minimum distance between any two points" is known as "finding spherical codes".
More info on Spherical Codes from:
[Wikipedia](https://en.wikipedia.org/wiki/Spherical_code)
[Mathworld](http://mathworld.wolfram.com/SphericalCode.html)
[... |
443,921 | Another name for this question could be: How to TDD the main function?
My situation: I'm writing a program from scratch that runs a sort of simulation, and I want to apply TDD to the whole development process. It seems straightforward to me when I think about the small detailed features, but at some point the program ... | 2023/02/12 | [
"https://softwareengineering.stackexchange.com/questions/443921",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/187165/"
] | TDD isn't limited to unit tests, it can be applied at any granularity. What you're trying to do is covered by [acceptance test-driven development](https://en.wikipedia.org/wiki/Acceptance_test-driven_development) (ATDD) which adds an outer loop to the classic red-green-refactor cycle: you write a failing acceptance tes... | >
> How to TDD the main function?
>
>
> one solution is just to not strictly follow TDD for this part
>
>
>
For what it is worth, on my own authority this is precisely what I've given myself permission to do.
---
>
> I conclude that there are two ways of constructing a software design: One way is to make it s... |
443,921 | Another name for this question could be: How to TDD the main function?
My situation: I'm writing a program from scratch that runs a sort of simulation, and I want to apply TDD to the whole development process. It seems straightforward to me when I think about the small detailed features, but at some point the program ... | 2023/02/12 | [
"https://softwareengineering.stackexchange.com/questions/443921",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/187165/"
] | If you really want follow the "don't write code unless .." rule dogmatically, make your "main program" a class of its own, with injected dependencies for the 3 steps you scetched in your question, and mocks which are designed to allow verifying that the main processing functions were called:
```
TestMain()
{
... | I think the point is being missed here.
You have two questions in fact:
* One is how to test a function/class.
* The other is what a test means in TDD
---
Testing a function/class should already be quite well practiced by you based on the question.
The answer is dependency injection.
The problem is that your main... |
443,921 | Another name for this question could be: How to TDD the main function?
My situation: I'm writing a program from scratch that runs a sort of simulation, and I want to apply TDD to the whole development process. It seems straightforward to me when I think about the small detailed features, but at some point the program ... | 2023/02/12 | [
"https://softwareengineering.stackexchange.com/questions/443921",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/187165/"
] | >
> I'm tempted to write a test like `testLoopProducesValidOutput` but that's basically just checking to see if the entire program ran correctly, which doesn't seem very unit-like for a unit test.
>
>
>
You're specifically talking about unit testing, so "let's test the whole lot in one go" is not in the spirit of ... | I am not a big fan of mocking. It is useful in certain very special scenarios, but if you need a mocking *framework*, in my opinion you are doing something wrong.
Certain things need to be mocked because they cannot (should not...) be done in a unit test. For example accessing the file system to write output files. Or... |
443,921 | Another name for this question could be: How to TDD the main function?
My situation: I'm writing a program from scratch that runs a sort of simulation, and I want to apply TDD to the whole development process. It seems straightforward to me when I think about the small detailed features, but at some point the program ... | 2023/02/12 | [
"https://softwareengineering.stackexchange.com/questions/443921",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/187165/"
] | >
> How to TDD the main function?
>
>
> one solution is just to not strictly follow TDD for this part
>
>
>
For what it is worth, on my own authority this is precisely what I've given myself permission to do.
---
>
> I conclude that there are two ways of constructing a software design: One way is to make it s... | I think the point is being missed here.
You have two questions in fact:
* One is how to test a function/class.
* The other is what a test means in TDD
---
Testing a function/class should already be quite well practiced by you based on the question.
The answer is dependency injection.
The problem is that your main... |
443,921 | Another name for this question could be: How to TDD the main function?
My situation: I'm writing a program from scratch that runs a sort of simulation, and I want to apply TDD to the whole development process. It seems straightforward to me when I think about the small detailed features, but at some point the program ... | 2023/02/12 | [
"https://softwareengineering.stackexchange.com/questions/443921",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/187165/"
] | >
> How to apply TDD to very high level functionality?
>
>
>
TDD doesn't care what level you're at. Levels are in our heads.
>
> I want to apply TDD to the whole development process.
>
>
>
Then start with tests. Tests that mean something.
>
> this is a rough outline of how the program will run:
>
>
> 1. ... | I am not a big fan of mocking. It is useful in certain very special scenarios, but if you need a mocking *framework*, in my opinion you are doing something wrong.
Certain things need to be mocked because they cannot (should not...) be done in a unit test. For example accessing the file system to write output files. Or... |
443,921 | Another name for this question could be: How to TDD the main function?
My situation: I'm writing a program from scratch that runs a sort of simulation, and I want to apply TDD to the whole development process. It seems straightforward to me when I think about the small detailed features, but at some point the program ... | 2023/02/12 | [
"https://softwareengineering.stackexchange.com/questions/443921",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/187165/"
] | >
> How to apply TDD to very high level functionality?
>
>
>
TDD doesn't care what level you're at. Levels are in our heads.
>
> I want to apply TDD to the whole development process.
>
>
>
Then start with tests. Tests that mean something.
>
> this is a rough outline of how the program will run:
>
>
> 1. ... | I think the point is being missed here.
You have two questions in fact:
* One is how to test a function/class.
* The other is what a test means in TDD
---
Testing a function/class should already be quite well practiced by you based on the question.
The answer is dependency injection.
The problem is that your main... |
443,921 | Another name for this question could be: How to TDD the main function?
My situation: I'm writing a program from scratch that runs a sort of simulation, and I want to apply TDD to the whole development process. It seems straightforward to me when I think about the small detailed features, but at some point the program ... | 2023/02/12 | [
"https://softwareengineering.stackexchange.com/questions/443921",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/187165/"
] | TDD isn't limited to unit tests, it can be applied at any granularity. What you're trying to do is covered by [acceptance test-driven development](https://en.wikipedia.org/wiki/Acceptance_test-driven_development) (ATDD) which adds an outer loop to the classic red-green-refactor cycle: you write a failing acceptance tes... | I am not a big fan of mocking. It is useful in certain very special scenarios, but if you need a mocking *framework*, in my opinion you are doing something wrong.
Certain things need to be mocked because they cannot (should not...) be done in a unit test. For example accessing the file system to write output files. Or... |
443,921 | Another name for this question could be: How to TDD the main function?
My situation: I'm writing a program from scratch that runs a sort of simulation, and I want to apply TDD to the whole development process. It seems straightforward to me when I think about the small detailed features, but at some point the program ... | 2023/02/12 | [
"https://softwareengineering.stackexchange.com/questions/443921",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/187165/"
] | TDD isn't limited to unit tests, it can be applied at any granularity. What you're trying to do is covered by [acceptance test-driven development](https://en.wikipedia.org/wiki/Acceptance_test-driven_development) (ATDD) which adds an outer loop to the classic red-green-refactor cycle: you write a failing acceptance tes... | I think the point is being missed here.
You have two questions in fact:
* One is how to test a function/class.
* The other is what a test means in TDD
---
Testing a function/class should already be quite well practiced by you based on the question.
The answer is dependency injection.
The problem is that your main... |
443,921 | Another name for this question could be: How to TDD the main function?
My situation: I'm writing a program from scratch that runs a sort of simulation, and I want to apply TDD to the whole development process. It seems straightforward to me when I think about the small detailed features, but at some point the program ... | 2023/02/12 | [
"https://softwareengineering.stackexchange.com/questions/443921",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/187165/"
] | TDD isn't limited to unit tests, it can be applied at any granularity. What you're trying to do is covered by [acceptance test-driven development](https://en.wikipedia.org/wiki/Acceptance_test-driven_development) (ATDD) which adds an outer loop to the classic red-green-refactor cycle: you write a failing acceptance tes... | If you really want follow the "don't write code unless .." rule dogmatically, make your "main program" a class of its own, with injected dependencies for the 3 steps you scetched in your question, and mocks which are designed to allow verifying that the main processing functions were called:
```
TestMain()
{
... |
443,921 | Another name for this question could be: How to TDD the main function?
My situation: I'm writing a program from scratch that runs a sort of simulation, and I want to apply TDD to the whole development process. It seems straightforward to me when I think about the small detailed features, but at some point the program ... | 2023/02/12 | [
"https://softwareengineering.stackexchange.com/questions/443921",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/187165/"
] | >
> How to TDD the main function?
>
>
> one solution is just to not strictly follow TDD for this part
>
>
>
For what it is worth, on my own authority this is precisely what I've given myself permission to do.
---
>
> I conclude that there are two ways of constructing a software design: One way is to make it s... | I am not a big fan of mocking. It is useful in certain very special scenarios, but if you need a mocking *framework*, in my opinion you are doing something wrong.
Certain things need to be mocked because they cannot (should not...) be done in a unit test. For example accessing the file system to write output files. Or... |
218,332 | Is this sentence, "I wish I had a little less problems" grammatically correct? Especially the phrase, "... a little less problems". I know there are other ways to say the same thing like, "I wish I didn't have as much problems" or "I wish I had less problems" but it changes the feel of the sentence. The feel I'm tryna ... | 2019/07/15 | [
"https://ell.stackexchange.com/questions/218332",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/82587/"
] | I would write *"I wish I had **fewer** problems"*.
In theory, **less** is supposed to be used to describe a smaller amount of a single entity, while **fewer** is supposed to be used to describe a smaller number of entities.
In practice, what you have written is likely to be understood, if a little awkward.
For more ... | The following would apply to normal phrasing:
>
> ✔ fewer problems
>
> ✘ less problems
>
>
> ✘ fewer of a problem
>
> ✔ less of a problem
>
>
>
The use of adjectives should not be influencing the word used.
In other words, I would say one of the following:
>
> 1. a little **less** ***of a problem***
... |
59,929,158 | For reference, I'm trying to re-learn programming and python basics after years away.
I recently downloaded Anaconda as part of an online Python Course. However, every time I open Spyder or the Navigator they instantly create folders for what I assume are all the relevant libraries in C:Users/Myself. These include .co... | 2020/01/27 | [
"https://Stackoverflow.com/questions/59929158",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12790420/"
] | You get all kinds of weird messgages if node/ npm versions are not compatible.
Make sure you are using the correct version of node/ npm
eg:
PS C:\Windows\system32> npm -v
6.4.1
PS C:\Windows\system32> node -v
v10.13.0 | Delete the node modules and update the angular cli version and do the following:
```
npm install
ng serve
``` |
24,562,119 | I need to retrieve an extended attribute from Active Directory, for
which there is a private method in the `ComputerPrincipal` class. I
understand I can only access the private method through a derived
class, so I've derived a class `ComputerPrincipalEx` from the base
class. I've then created (defined?) a method in the... | 2014/07/03 | [
"https://Stackoverflow.com/questions/24562119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3803053/"
] | I was able to figure this out based on information I found [here](http://www.codeproject.com/Articles/118122/How-to-use-AD-Attributes-not-represented-in-UserPr) and [here](https://stackoverflow.com/questions/23504921/problems-with-extending-s-ds-am-userprincipal-class).
In the derived `ComputerPrincipalEx` class, I ne... | Change to this:
```
public string GetExtendedAttribute(string attributeName)
{
PrincipalContext ctx = new PrincipalContext(ContextType.Domain);
var cp = ComputerPrincipalEx.FindByIdentity(ctx, Name);
return cp.ExtensionGet(attributeName);
}
``` |
24,562,119 | I need to retrieve an extended attribute from Active Directory, for
which there is a private method in the `ComputerPrincipal` class. I
understand I can only access the private method through a derived
class, so I've derived a class `ComputerPrincipalEx` from the base
class. I've then created (defined?) a method in the... | 2014/07/03 | [
"https://Stackoverflow.com/questions/24562119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3803053/"
] | I was able to figure this out based on information I found [here](http://www.codeproject.com/Articles/118122/How-to-use-AD-Attributes-not-represented-in-UserPr) and [here](https://stackoverflow.com/questions/23504921/problems-with-extending-s-ds-am-userprincipal-class).
In the derived `ComputerPrincipalEx` class, I ne... | In my impression, you need a constructor (or static method) in ComputerPrincipalEx which creates it from an instance of the base class. |
19,746,173 | I thought array and pointer are basically the same thing, until I run this program:
```
int main() {
int* a = new int(19);
int b[1];
b[0] = 19;
printf("*a: %d\n a: %p\n &a:%p\n", *a, a, &a);
printf("*b: %d\n b: %p\n &b:%p\n", *b, b, &b);
delete a;
}
```
output is:
```
*a: 19
a: 0x7f94524000e0
&a:0x7f... | 2013/11/02 | [
"https://Stackoverflow.com/questions/19746173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723946/"
] | Well, `b` is an array. Under the slightest excuse it will decay into a pointer to the first element of `b`. Note, however, that the expression `b` and `&b` are *not* equivalent: `b` decays into a pointer the first element, i.e., it is of type `int*` while `&b` is a pointer to the array, i.e., it is of type `int(*)[1]`. | `a` is a variable. You are allocating memory using `new` and assigning the result to this pointer. You might decide to store something else in `a` later in your program.
`b` is different. It's not a variable in the sense that it cannot store different addresses. It's an array, having a fixed start location.
Thus, `b... |
19,746,173 | I thought array and pointer are basically the same thing, until I run this program:
```
int main() {
int* a = new int(19);
int b[1];
b[0] = 19;
printf("*a: %d\n a: %p\n &a:%p\n", *a, a, &a);
printf("*b: %d\n b: %p\n &b:%p\n", *b, b, &b);
delete a;
}
```
output is:
```
*a: 19
a: 0x7f94524000e0
&a:0x7f... | 2013/11/02 | [
"https://Stackoverflow.com/questions/19746173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1723946/"
] | Arrays and pointers are not the same. A pointer can behave *like* an array (e.g. accessing by index).
`&b` is a pointer to the whole array and `b` is a pointer to the first element. They may point to a same address in memory but they are totally different things.
```
+-------------------------------+
... | `a` is a variable. You are allocating memory using `new` and assigning the result to this pointer. You might decide to store something else in `a` later in your program.
`b` is different. It's not a variable in the sense that it cannot store different addresses. It's an array, having a fixed start location.
Thus, `b... |
25,828 | I have upgraded Magento from Version 1.5.1.0 to 1.8.1.0
And now the order graph in the admin dashboard is showing misleading data. The number of sales has shifted by 2 months considering what it was in 1.5 version.
To be specific, in the earlier version of Magento the sales in my website reached peak on August and now... | 2014/07/03 | [
"https://magento.stackexchange.com/questions/25828",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/9820/"
] | **Here the Solution**
Edit the file at app/design/adminhtml/default/default/template/dashboard/graph.phtml
Find this line
```
"getChartUrl(false)"
```
change to
"getChartUrl(true)" | This code needs to be change in api url.
```
const API_URL = 'http://chart.apis.google.com/chart';
```
I think this [LINK](https://magento.stackexchange.com/questions/23881/graph-is-not-showing-magento-admin-dashboard/23894#23894), may be your answer |
224,000 | Is it generally better to have a small number of fully upgraded rooms? Or have a larger number of not-so-upgraded ones? (Provided of course, that we have Power to spare.)
Wondering if the massive costs for upgrading are worth it. For example, I had a dweller training in a level 2 Strength Center with 2.00 hours to go.... | 2015/06/17 | [
"https://gaming.stackexchange.com/questions/224000",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/115740/"
] | I won't upgrade those rooms. You have later more than enough people to get others for hours in the training room. Buy 2-3 rooms and put the people in them instead one fast room. It's much cheaper and efficient.
By the way. You can further improve this. Just make a woman pregnant and put her inside the training room (n... | Up until this point in my progress. All Ive done is upgraded my vault little by little, collecting a few caps, couple of uniforms, and some pretty decent weaponary. Currently on a new game. I've got 25 dwellers, I'm able to maintain my power, food, and my water all at full capacity. I've already got Lucas Simms legenda... |
224,000 | Is it generally better to have a small number of fully upgraded rooms? Or have a larger number of not-so-upgraded ones? (Provided of course, that we have Power to spare.)
Wondering if the massive costs for upgrading are worth it. For example, I had a dweller training in a level 2 Strength Center with 2.00 hours to go.... | 2015/06/17 | [
"https://gaming.stackexchange.com/questions/224000",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/115740/"
] | Regardless of caps costs, you shouldn't upgrade training rooms. The reason is that higher level rooms get more severe incidents. The dwellers in your training rooms are usually low level, so if you don't upgrade your training rooms your rookies will be able to handle incidents unattended. If your training rooms are upg... | Build across then in. It's much cheaper to build across 2-3 rooms than it is to upgrade. You DO want to upgrade though, it increases your storage which is your main buffer against disaster. Also by building across first you save yourself the grief of having to delete a room just to expand one you really need. |
224,000 | Is it generally better to have a small number of fully upgraded rooms? Or have a larger number of not-so-upgraded ones? (Provided of course, that we have Power to spare.)
Wondering if the massive costs for upgrading are worth it. For example, I had a dweller training in a level 2 Strength Center with 2.00 hours to go.... | 2015/06/17 | [
"https://gaming.stackexchange.com/questions/224000",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/115740/"
] | I won't upgrade those rooms. You have later more than enough people to get others for hours in the training room. Buy 2-3 rooms and put the people in them instead one fast room. It's much cheaper and efficient.
By the way. You can further improve this. Just make a woman pregnant and put her inside the training room (n... | Just to put some numbers here:
```
Strength Level | Base | 1st Upgrade | 2nd Upgrade
----------------------------------------------------
1 >>> 2 | 26m | 25m | 24m
2 >>> 3 | 1h 20m | 1h 16m | 1h 13m
3 >>> 4 | 2h 40m | 2h 32m | 2h 26m
4 >>> 5 | 4h 27m | 4h 14m ... |
224,000 | Is it generally better to have a small number of fully upgraded rooms? Or have a larger number of not-so-upgraded ones? (Provided of course, that we have Power to spare.)
Wondering if the massive costs for upgrading are worth it. For example, I had a dweller training in a level 2 Strength Center with 2.00 hours to go.... | 2015/06/17 | [
"https://gaming.stackexchange.com/questions/224000",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/115740/"
] | Just to put some numbers here:
```
Strength Level | Base | 1st Upgrade | 2nd Upgrade
----------------------------------------------------
1 >>> 2 | 26m | 25m | 24m
2 >>> 3 | 1h 20m | 1h 16m | 1h 13m
3 >>> 4 | 2h 40m | 2h 32m | 2h 26m
4 >>> 5 | 4h 27m | 4h 14m ... | Later on, with large vaults, I'd say time is more important than money, and every little bit helps and are well worth upgrading the training rooms. Especially once you realize that having a Dweller's Endurance maxed out BEFORE they start leveling up drastically increases their hit points and start trying to max out lev... |
224,000 | Is it generally better to have a small number of fully upgraded rooms? Or have a larger number of not-so-upgraded ones? (Provided of course, that we have Power to spare.)
Wondering if the massive costs for upgrading are worth it. For example, I had a dweller training in a level 2 Strength Center with 2.00 hours to go.... | 2015/06/17 | [
"https://gaming.stackexchange.com/questions/224000",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/115740/"
] | Later on, with large vaults, I'd say time is more important than money, and every little bit helps and are well worth upgrading the training rooms. Especially once you realize that having a Dweller's Endurance maxed out BEFORE they start leveling up drastically increases their hit points and start trying to max out lev... | Up until this point in my progress. All Ive done is upgraded my vault little by little, collecting a few caps, couple of uniforms, and some pretty decent weaponary. Currently on a new game. I've got 25 dwellers, I'm able to maintain my power, food, and my water all at full capacity. I've already got Lucas Simms legenda... |
224,000 | Is it generally better to have a small number of fully upgraded rooms? Or have a larger number of not-so-upgraded ones? (Provided of course, that we have Power to spare.)
Wondering if the massive costs for upgrading are worth it. For example, I had a dweller training in a level 2 Strength Center with 2.00 hours to go.... | 2015/06/17 | [
"https://gaming.stackexchange.com/questions/224000",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/115740/"
] | I won't upgrade those rooms. You have later more than enough people to get others for hours in the training room. Buy 2-3 rooms and put the people in them instead one fast room. It's much cheaper and efficient.
By the way. You can further improve this. Just make a woman pregnant and put her inside the training room (n... | Regardless of caps costs, you shouldn't upgrade training rooms. The reason is that higher level rooms get more severe incidents. The dwellers in your training rooms are usually low level, so if you don't upgrade your training rooms your rookies will be able to handle incidents unattended. If your training rooms are upg... |
224,000 | Is it generally better to have a small number of fully upgraded rooms? Or have a larger number of not-so-upgraded ones? (Provided of course, that we have Power to spare.)
Wondering if the massive costs for upgrading are worth it. For example, I had a dweller training in a level 2 Strength Center with 2.00 hours to go.... | 2015/06/17 | [
"https://gaming.stackexchange.com/questions/224000",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/115740/"
] | Just to put some numbers here:
```
Strength Level | Base | 1st Upgrade | 2nd Upgrade
----------------------------------------------------
1 >>> 2 | 26m | 25m | 24m
2 >>> 3 | 1h 20m | 1h 16m | 1h 13m
3 >>> 4 | 2h 40m | 2h 32m | 2h 26m
4 >>> 5 | 4h 27m | 4h 14m ... | Build across then in. It's much cheaper to build across 2-3 rooms than it is to upgrade. You DO want to upgrade though, it increases your storage which is your main buffer against disaster. Also by building across first you save yourself the grief of having to delete a room just to expand one you really need. |
224,000 | Is it generally better to have a small number of fully upgraded rooms? Or have a larger number of not-so-upgraded ones? (Provided of course, that we have Power to spare.)
Wondering if the massive costs for upgrading are worth it. For example, I had a dweller training in a level 2 Strength Center with 2.00 hours to go.... | 2015/06/17 | [
"https://gaming.stackexchange.com/questions/224000",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/115740/"
] | I won't upgrade those rooms. You have later more than enough people to get others for hours in the training room. Buy 2-3 rooms and put the people in them instead one fast room. It's much cheaper and efficient.
By the way. You can further improve this. Just make a woman pregnant and put her inside the training room (n... | Build across then in. It's much cheaper to build across 2-3 rooms than it is to upgrade. You DO want to upgrade though, it increases your storage which is your main buffer against disaster. Also by building across first you save yourself the grief of having to delete a room just to expand one you really need. |
224,000 | Is it generally better to have a small number of fully upgraded rooms? Or have a larger number of not-so-upgraded ones? (Provided of course, that we have Power to spare.)
Wondering if the massive costs for upgrading are worth it. For example, I had a dweller training in a level 2 Strength Center with 2.00 hours to go.... | 2015/06/17 | [
"https://gaming.stackexchange.com/questions/224000",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/115740/"
] | I won't upgrade those rooms. You have later more than enough people to get others for hours in the training room. Buy 2-3 rooms and put the people in them instead one fast room. It's much cheaper and efficient.
By the way. You can further improve this. Just make a woman pregnant and put her inside the training room (n... | Later on, with large vaults, I'd say time is more important than money, and every little bit helps and are well worth upgrading the training rooms. Especially once you realize that having a Dweller's Endurance maxed out BEFORE they start leveling up drastically increases their hit points and start trying to max out lev... |
224,000 | Is it generally better to have a small number of fully upgraded rooms? Or have a larger number of not-so-upgraded ones? (Provided of course, that we have Power to spare.)
Wondering if the massive costs for upgrading are worth it. For example, I had a dweller training in a level 2 Strength Center with 2.00 hours to go.... | 2015/06/17 | [
"https://gaming.stackexchange.com/questions/224000",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/115740/"
] | Regardless of caps costs, you shouldn't upgrade training rooms. The reason is that higher level rooms get more severe incidents. The dwellers in your training rooms are usually low level, so if you don't upgrade your training rooms your rookies will be able to handle incidents unattended. If your training rooms are upg... | Up until this point in my progress. All Ive done is upgraded my vault little by little, collecting a few caps, couple of uniforms, and some pretty decent weaponary. Currently on a new game. I've got 25 dwellers, I'm able to maintain my power, food, and my water all at full capacity. I've already got Lucas Simms legenda... |
11,609,821 | can I use `sed` or `awk` to append to the previous line if a match is found ?
I have a file which has the format :
```
INT32
FSHL (const TP Buffer)
{
INT32
FSHL_lm (const TP Buffer)
{ WORD32 ugo = 0; ...
```
What I am trying to do is scan for indepen... | 2012/07/23 | [
"https://Stackoverflow.com/questions/11609821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1457118/"
] | This might work for you (GNU sed):
```
sed '$!N;s/\n\s*{\s*$/{/;P;D' file
```
Explanation:
* `$!N` unless the last line append the next line to the pattern space.
* `s/\n\s*{\s*$/{/` replace a linefeed followed by no or any amount of white space followed by an opening curly brace followed by no or any amount of whi... | One way using `perl`. I read all file in slurp mode and use a regular expression to search lines with only a curly brace and remove its leading spaces.
```
perl -ne '
do {
local $/ = undef;
$data = <>;
};
$data =~ s/\n^\s*(\{\s*)$/\1/mg;
print $data
' infile
```
Assuming `infile` with... |
11,609,821 | can I use `sed` or `awk` to append to the previous line if a match is found ?
I have a file which has the format :
```
INT32
FSHL (const TP Buffer)
{
INT32
FSHL_lm (const TP Buffer)
{ WORD32 ugo = 0; ...
```
What I am trying to do is scan for indepen... | 2012/07/23 | [
"https://Stackoverflow.com/questions/11609821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1457118/"
] | This might work for you (GNU sed):
```
sed '$!N;s/\n\s*{\s*$/{/;P;D' file
```
Explanation:
* `$!N` unless the last line append the next line to the pattern space.
* `s/\n\s*{\s*$/{/` replace a linefeed followed by no or any amount of white space followed by an opening curly brace followed by no or any amount of whi... | One way using `awk`:
```
awk '!(NF == 1 && $1 == "{") { if (line) print line; line = $0; next; } { sub(/^[ \t]+/, "", $0); line = line $0; } END { print line }' file.txt
```
Or broken out on multiple lines:
```
!(NF == 1 && $1 == "{") {
if (line) print line
line = $0
next
}
{
sub(/^[ \t]+/, "", $0... |
11,609,821 | can I use `sed` or `awk` to append to the previous line if a match is found ?
I have a file which has the format :
```
INT32
FSHL (const TP Buffer)
{
INT32
FSHL_lm (const TP Buffer)
{ WORD32 ugo = 0; ...
```
What I am trying to do is scan for indepen... | 2012/07/23 | [
"https://Stackoverflow.com/questions/11609821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1457118/"
] | This might work for you (GNU sed):
```
sed '$!N;s/\n\s*{\s*$/{/;P;D' file
```
Explanation:
* `$!N` unless the last line append the next line to the pattern space.
* `s/\n\s*{\s*$/{/` replace a linefeed followed by no or any amount of white space followed by an opening curly brace followed by no or any amount of whi... | [shyam@localhost ~]$ perl -lne 's/^/\n/ if $.>1 && /^\d+/; printf "%s",$\_' appendDateText.txt
that will work
i/p:
06/12/2016 20:30 Test Test Test
TestTest
06/12/2019 20:30 abbs abcbcb abcbc
06/11/2016 20:30 test test
i123312331233123312331233123312331233123312331233Test
06/12/2016 20:30 abc
o/p:
06/12/2016 2... |
11,609,821 | can I use `sed` or `awk` to append to the previous line if a match is found ?
I have a file which has the format :
```
INT32
FSHL (const TP Buffer)
{
INT32
FSHL_lm (const TP Buffer)
{ WORD32 ugo = 0; ...
```
What I am trying to do is scan for indepen... | 2012/07/23 | [
"https://Stackoverflow.com/questions/11609821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1457118/"
] | One way using `perl`. I read all file in slurp mode and use a regular expression to search lines with only a curly brace and remove its leading spaces.
```
perl -ne '
do {
local $/ = undef;
$data = <>;
};
$data =~ s/\n^\s*(\{\s*)$/\1/mg;
print $data
' infile
```
Assuming `infile` with... | [shyam@localhost ~]$ perl -lne 's/^/\n/ if $.>1 && /^\d+/; printf "%s",$\_' appendDateText.txt
that will work
i/p:
06/12/2016 20:30 Test Test Test
TestTest
06/12/2019 20:30 abbs abcbcb abcbc
06/11/2016 20:30 test test
i123312331233123312331233123312331233123312331233Test
06/12/2016 20:30 abc
o/p:
06/12/2016 2... |
11,609,821 | can I use `sed` or `awk` to append to the previous line if a match is found ?
I have a file which has the format :
```
INT32
FSHL (const TP Buffer)
{
INT32
FSHL_lm (const TP Buffer)
{ WORD32 ugo = 0; ...
```
What I am trying to do is scan for indepen... | 2012/07/23 | [
"https://Stackoverflow.com/questions/11609821",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1457118/"
] | One way using `awk`:
```
awk '!(NF == 1 && $1 == "{") { if (line) print line; line = $0; next; } { sub(/^[ \t]+/, "", $0); line = line $0; } END { print line }' file.txt
```
Or broken out on multiple lines:
```
!(NF == 1 && $1 == "{") {
if (line) print line
line = $0
next
}
{
sub(/^[ \t]+/, "", $0... | [shyam@localhost ~]$ perl -lne 's/^/\n/ if $.>1 && /^\d+/; printf "%s",$\_' appendDateText.txt
that will work
i/p:
06/12/2016 20:30 Test Test Test
TestTest
06/12/2019 20:30 abbs abcbcb abcbc
06/11/2016 20:30 test test
i123312331233123312331233123312331233123312331233Test
06/12/2016 20:30 abc
o/p:
06/12/2016 2... |
66,668,097 | I've just started reading about C and currently playing around with format specifiers.
Here is the code example:
```
#include <stdio.h>
int main(void) {
char code = 'a' - 'A';
printf("\n>>>%c (%d)", code, code);
printf("\n>>>%c", 32);
char incode;
printf("\n\nGive me some char: ");
scanf("%c"... | 2021/03/17 | [
"https://Stackoverflow.com/questions/66668097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1984680/"
] | ASCII 32 is `' '` (space). It is printed alright, you just can't see it.
If you change the format string to `"\n>>>%c<< (%d)"` you will see it in the (pun) negative space.
You can also pass the output through `od -a` to confirm. | Assume that your character encoding is [ASCII](https://en.wikipedia.org/wiki/ASCII). Then `a` is encoded as 97 (decimal) and `A` is encoded as 65 (decimal). Their difference is 32, which encodes the space character.
So `char code = 'a' - 'A';` is the same as `char code = 32;` which is the same as the declaration `cha... |
71,325,338 | In my project, there are network requests that require authentication via bearer tokens and some requests that don't. Is there a way to specify the urls that do not need bearer tokens? If I just add the Auth plugin, then I always get a 401 response for the network calls that don't require bearer tokens.
This is my imp... | 2022/03/02 | [
"https://Stackoverflow.com/questions/71325338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13258270/"
] | You can filter requests by some condition that should include the `Authorization` header initially. For each other request, the second request with the `Authorization` header will be made if a server replied with `401 Unauthorized` status. Here is an example configuration:
```
val client = HttpClient {
install(Aut... | A bearer token is nothing but a header `Authorization: Bearer XXX` - If you're looking for a tech specific way to handle this (drop in some module, etc) then you may be out-of-luck
However, this problem occurs frequently enough in my life - the solution is to actually dynamically manipulate the headers - Basically, us... |
66,884,273 | I Need a short advise please about LUA script for modification object in Redis.
I Have Redis List with entities like that:
```
{
"@class": "com.myproject.model.Book",
"bookId": "someId",
"author": "someAuthor"
}
```
now, I need to change my entity to allow multiple authors for certain book, and create migratio... | 2021/03/31 | [
"https://Stackoverflow.com/questions/66884273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12080584/"
] | [sklearn](https://scikit-learn.org/stable/faq.html#how-do-i-deal-with-string-data-or-trees-graphs) actually does show this example using DBSCAN, just like [Luke](https://stackoverflow.com/questions/38720283/python-string-clustering-with-scikit-learns-dbscan-using-levenshtein-distance) once answered here.
This is based... | Try this.
```
import numpy as np
from sklearn.cluster import AffinityPropagation
import distance
words = 'XYZ,LDPELDKSL,DFKLKSLFD,ABC,DLFKFKDLD,XYZ,LDPELDKSL,DFKLKSLFD,ABC,DLFKFKDLD,XYZ,LDPELDKSL,XYZ,LDPELDKSL,DFKLKSLFD,ABC,DLFKFKDLD,XYZ,LDPELDKSL,DFKLKSLFD,ABC,DLFKFKDLD,XYZ,LDPELDKSL'.split(',') #Replace this line
w... |
66,884,273 | I Need a short advise please about LUA script for modification object in Redis.
I Have Redis List with entities like that:
```
{
"@class": "com.myproject.model.Book",
"bookId": "someId",
"author": "someAuthor"
}
```
now, I need to change my entity to allow multiple authors for certain book, and create migratio... | 2021/03/31 | [
"https://Stackoverflow.com/questions/66884273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12080584/"
] | [sklearn](https://scikit-learn.org/stable/faq.html#how-do-i-deal-with-string-data-or-trees-graphs) actually does show this example using DBSCAN, just like [Luke](https://stackoverflow.com/questions/38720283/python-string-clustering-with-scikit-learns-dbscan-using-levenshtein-distance) once answered here.
This is based... | ```
common_words = kmeans.cluster_centers_.argsort()[:,-1:-11:-1]
for num, centroid in enumerate(common_words):
print(str(num) + ' : ' + ', '.join(words[word] for word in centroid))
``` |
7,980,322 | I was curious if someone could explain to me from a programming perspective what makes bunny hopping possible. What techniques, shortcuts or approaches are being used by the physics engine that seem to universally result in bunny hopping being possible in a game unless it is somehow specifically prevented.
Thanks! | 2011/11/02 | [
"https://Stackoverflow.com/questions/7980322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/52551/"
] | Spencer - I'm assuming you're talking about the fact that in many games where when you start bunny hopping, it picks up speed / momentum. I'm assuming that because it's the corner case where I usually hear to it referred to as bunny hopping - not simply jumping over and over.
In the events where bunny hopping picks up... | Assuming you speak of a 2D game like Super Mario:
Treat the x and the y axis seperately and use one variable for friction.
```
hop() {
xSpeed *= friction;
ySpeed *= -friction;
}
move() {
x += xSpeed;
y += ySpeed;
}
```
`hop()` should be called everytime you hit a horizontal wall, `move()` every fra... |
40,437,971 | I have develop a node restful api. i need to upload some image files and save file names in to the database. how do it. this is my code
```
var express = require('express');
var multer = require('multer')
var upload = multer({ dest: 'uploads/' })
var router = express.Router();
var path = require('path');
var storage... | 2016/11/05 | [
"https://Stackoverflow.com/questions/40437971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5580446/"
] | req.body.car\_photos = car\_photos;
next();
these lines should be in the upload function call back. In the else block after the for loop. | This example applies for anyone using the library node-restful
<https://github.com/baugarten/node-restful>
For the model add a field with:
```
car_photos: Array
```
---
```
var express = require('express');
var multer = require('multer')
var upload = multer({ dest: 'uploads/' })
var router = express.Router();
... |
49,617,543 | Still new, I searched google but I didn't really find an explanation so thank you in advance. When writing Python, why is is that during a while loop, a variable that is assigned a list outside of the while loop can be modified and retain it's modifications with each iteration, but a variable that is assigned a list du... | 2018/04/02 | [
"https://Stackoverflow.com/questions/49617543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9525011/"
] | It's because `a` is redefined at each iteration, while `b` isn't. When you write `b = x`, you only link b to x, and modifying `b` in your loop is in fact changing only the list that it refers to, the same list that `x` refers to which isn't redefined at each iteration (unlike `a`). | This is a classic case of Shallow Copy vs Deep Copy.
This code below will give you results as expected by you.
```
import copy
x = [1,1,1]
while True:
a = [1,1,1]
b = copy.deepcopy(x)
a.append(1)
b.append(2)
print(a)
print(b)
```
Assignment statements by default do not copy objects, they cr... |
49,617,543 | Still new, I searched google but I didn't really find an explanation so thank you in advance. When writing Python, why is is that during a while loop, a variable that is assigned a list outside of the while loop can be modified and retain it's modifications with each iteration, but a variable that is assigned a list du... | 2018/04/02 | [
"https://Stackoverflow.com/questions/49617543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9525011/"
] | Since `b` and `x` are references to the same list object, your code is equivalent to
```
x = [1,1,1]
while True:
a = [1,1,1]
a.append(1)
x.append(2)
print(a)
print(x)
```
In each iteration of the loop, the list referenced by `x` gains another element. `a` is a reference to a new 3-element list i... | It's because `a` is redefined at each iteration, while `b` isn't. When you write `b = x`, you only link b to x, and modifying `b` in your loop is in fact changing only the list that it refers to, the same list that `x` refers to which isn't redefined at each iteration (unlike `a`). |
49,617,543 | Still new, I searched google but I didn't really find an explanation so thank you in advance. When writing Python, why is is that during a while loop, a variable that is assigned a list outside of the while loop can be modified and retain it's modifications with each iteration, but a variable that is assigned a list du... | 2018/04/02 | [
"https://Stackoverflow.com/questions/49617543",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9525011/"
] | Since `b` and `x` are references to the same list object, your code is equivalent to
```
x = [1,1,1]
while True:
a = [1,1,1]
a.append(1)
x.append(2)
print(a)
print(x)
```
In each iteration of the loop, the list referenced by `x` gains another element. `a` is a reference to a new 3-element list i... | This is a classic case of Shallow Copy vs Deep Copy.
This code below will give you results as expected by you.
```
import copy
x = [1,1,1]
while True:
a = [1,1,1]
b = copy.deepcopy(x)
a.append(1)
b.append(2)
print(a)
print(b)
```
Assignment statements by default do not copy objects, they cr... |
71,474,752 | I am trying to create a 2d-array with values taken from the array's previous value, added to values computed from a function. I am however getting the error :
```
ValueError: operands could not be broadcast together with shapes (2,) (0,)
```
Now while I know what the error means, I can't seem to find where the prob... | 2022/03/14 | [
"https://Stackoverflow.com/questions/71474752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15086520/"
] | The issue was that the pend\_func function was returning an array of a different shape than the rest of the arrays. This was fixed by changing
```
return [[d1], [d2]]
```
to
```
return [d1, d2]
``` | You're either missing a pair of parentheses:
```
for i in range(len(time_arr)):
# v v
res_arr[i+1] = (res_arr[i] + pend_func(res_arr[i-1], time_arr[i-1], l, m, g, mu)) * dt
# ^ ... |
28,323,095 | How do we integrate SagePay with .NET MVC
When we try to use in MVC its returning vpsprotocol as 2.23 only instead of 3.00
Can someone let us know how to include the reference for the dll properly in .NET MVC
Thanks
Srini | 2015/02/04 | [
"https://Stackoverflow.com/questions/28323095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4528848/"
] | you will have to download and build the [opencv\_contrib](https://github.com/Itseez/opencv_contrib) repo.
after running cmake, make, make install,
```
#include <opencv2/face.hpp>
// note the additional namespace:
cv::Ptr <cv::face::FaceRecognizer> model = cv::face::createLBPHFaceRecognizer();
// proceed as usua... | from <https://github.com/opencv/opencv_contrib>:
1. Start cmake-gui
2. Select the opencv source code folder and the folder where binaries
will be built (the 2 upper forms of the interface)
3. Press the configure button. you will see all the opencv build
parameters in the central interface
4. Browse the parameters and ... |
28,323,095 | How do we integrate SagePay with .NET MVC
When we try to use in MVC its returning vpsprotocol as 2.23 only instead of 3.00
Can someone let us know how to include the reference for the dll properly in .NET MVC
Thanks
Srini | 2015/02/04 | [
"https://Stackoverflow.com/questions/28323095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4528848/"
] | you will have to download and build the [opencv\_contrib](https://github.com/Itseez/opencv_contrib) repo.
after running cmake, make, make install,
```
#include <opencv2/face.hpp>
// note the additional namespace:
cv::Ptr <cv::face::FaceRecognizer> model = cv::face::createLBPHFaceRecognizer();
// proceed as usua... | On my Debian installation
```
$ dpkg -l libopencv-contrib-dev
ii libopencv-contrib-dev:amd64 3.2.0+dfsg-6 amd64 development files for libopencv-contrib3.2
```
enables me to use contributed modules with just an additional include. For example:
```
#include <opencv2/opencv.hpp>
#include <opencv2/face.hpp>
aut... |
70,145,974 | I want to follow up on this question: [What is the difference between a definition and a declaration?](https://stackoverflow.com/questions/1410563/what-is-the-difference-between-a-definition-and-a-declaration), there is answer about definition and a declaration, but nothing about implementation.
I want also know what ... | 2021/11/28 | [
"https://Stackoverflow.com/questions/70145974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8517655/"
] | Perhaps you are looking for stacked classifiers.
In this approach, the predictions of earlier models are available as features for later models.
Look into [StackingClassifiers](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.StackingClassifier.html).
Adapted from the documentation:
```
from sklea... | Unfortunately this is not possible at present. According to the doc at <https://lightgbm.readthedocs.io/en/latest/pythonapi/lightgbm.LGBMClassifier.html?highlight=init_model>, you can continue training the model if the model is from lightgbm.
I did try this setup with:
```
# dtc
dtc_model = DecisionTreeClassifier()
d... |
70,145,974 | I want to follow up on this question: [What is the difference between a definition and a declaration?](https://stackoverflow.com/questions/1410563/what-is-the-difference-between-a-definition-and-a-declaration), there is answer about definition and a declaration, but nothing about implementation.
I want also know what ... | 2021/11/28 | [
"https://Stackoverflow.com/questions/70145974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8517655/"
] | Perhaps you are looking for stacked classifiers.
In this approach, the predictions of earlier models are available as features for later models.
Look into [StackingClassifiers](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.StackingClassifier.html).
Adapted from the documentation:
```
from sklea... | As [@Ferdy](https://stackoverflow.com/a/70193071/4574633) explained in his post, there is no simple way to perform this operation and it is understandable.
Scikit-learn `DecisionTreeClassifier` takes only numerical features and cannot handle `nan` values whereas `LGBMClassifier` can handle those.
By looking at the de... |
2,704,771 | Suppose I am inserting a string into a table as follows:
```
table.insert(tbl, mystring)
```
and that `mystring` is generated by replacing all occurrences of "a" with "b" in `input`:
```
mystring = string.gsub(input, "a", "b")
```
The obvious way to combine the two into one statement doesn't work, because `gsub` ... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33080/"
] | You can surround the expression by parentheses:
```
table.insert(tbl, (string.gsub(input, "a", "b")))
```
This will select only the first result.
To get the nth result, you can use `select` and surround it by parentheses:
```
func1( (select(n, func2())) )
``` | Putting an expression into parentheses like this:
`table.insert(tbl, (string.gsub(input, "a", "b")))`
will force one return value. Or you could catch them both like this:
```
str,cnt = string.gsub(input, "a", "b")
table.insert(tbl, str)
```
or even better, dummy catch it to save a variable:
```
str,_ = string.g... |
2,704,771 | Suppose I am inserting a string into a table as follows:
```
table.insert(tbl, mystring)
```
and that `mystring` is generated by replacing all occurrences of "a" with "b" in `input`:
```
mystring = string.gsub(input, "a", "b")
```
The obvious way to combine the two into one statement doesn't work, because `gsub` ... | 2010/04/24 | [
"https://Stackoverflow.com/questions/2704771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33080/"
] | You can surround the expression by parentheses:
```
table.insert(tbl, (string.gsub(input, "a", "b")))
```
This will select only the first result.
To get the nth result, you can use `select` and surround it by parentheses:
```
func1( (select(n, func2())) )
``` | In one line: `({ funct(args) })[n]` would return the n'th result without declaring any named variables. |
27,945,319 | Can I, somehow, based on time stamp and how much is done, estimate time and date for when a job is complete? I got this log that a bot I've made writes in column A time [yyy-mm-dd hh:mm], and in column B it wrights how much is done. It sorts it all with newest on top. | 2015/01/14 | [
"https://Stackoverflow.com/questions/27945319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3660858/"
] | You can easily do that if you use the `boot` package as follows:
Example dataset:
```
y <- rep(c(0,1),50)
x1 <- runif(100)
x2 <- runif(100)
df <- data.frame(y,x1,x2)
```
Run logistic regression:
```
model.m <- glm(y~x1+x2,data=df,family=binomial)
```
Run residual diagnostics and plot them:
```
library(boot)
m... | In Zuur (2013) p.101 the following code is provided for the validation of a binomial GLM:
```
# Residual vs. fitted
E2 <- resid(model.m, type="pearson")
F2 <- fitted(model.m, type="response")
plot(x=F2, y=E2, xlab="fitted values", ylab="Pearson residuals")
abline(h=0, lty=2)
# Cook's distance
plot(cooks.distance(mode... |
1,154,242 | I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.
I know that `axes = false` will get rid of the entire axis, but I would only like to get rid of the numbering. | 2009/07/20 | [
"https://Stackoverflow.com/questions/1154242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130633/"
] | Remove numbering on x-axis or y-axis:
```
plot(1:10, xaxt='n')
plot(1:10, yaxt='n')
```
If you want to remove the labels as well:
```
plot(1:10, xaxt='n', ann=FALSE)
plot(1:10, yaxt='n', ann=FALSE)
``` | Using base graphics, the standard way to do this is to use axes=FALSE, then create your own axes using Axis (or axis). For example,
```
x <- 1:20
y <- runif(20)
plot(x, y, axes=FALSE, frame.plot=TRUE)
Axis(side=1, labels=FALSE)
Axis(side=2, labels=FALSE)
```
The lattice equivalent is
```
library(lattice)
xyplot(y ... |
1,154,242 | I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.
I know that `axes = false` will get rid of the entire axis, but I would only like to get rid of the numbering. | 2009/07/20 | [
"https://Stackoverflow.com/questions/1154242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130633/"
] | Using base graphics, the standard way to do this is to use axes=FALSE, then create your own axes using Axis (or axis). For example,
```
x <- 1:20
y <- runif(20)
plot(x, y, axes=FALSE, frame.plot=TRUE)
Axis(side=1, labels=FALSE)
Axis(side=2, labels=FALSE)
```
The lattice equivalent is
```
library(lattice)
xyplot(y ... | @Richie Cotton has a pretty good answer above. I can only add that this [page](http://www.statmethods.net/advgraphs/axes.html) provides some examples. Try the following:
```
x <- 1:20
y <- runif(20)
plot(x,y,xaxt = "n")
axis(side = 1, at = x, labels = FALSE, tck = -0.01)
``` |
1,154,242 | I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.
I know that `axes = false` will get rid of the entire axis, but I would only like to get rid of the numbering. | 2009/07/20 | [
"https://Stackoverflow.com/questions/1154242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130633/"
] | Using base graphics, the standard way to do this is to use axes=FALSE, then create your own axes using Axis (or axis). For example,
```
x <- 1:20
y <- runif(20)
plot(x, y, axes=FALSE, frame.plot=TRUE)
Axis(side=1, labels=FALSE)
Axis(side=2, labels=FALSE)
```
The lattice equivalent is
```
library(lattice)
xyplot(y ... | you can also put labels inside plot:
```
plot(spline(sub$day, sub$counts), type ='l', labels = FALSE)
```
you'll get a warning. i think this is because labels is actually a parameter that's being passed down to a subroutine that plot runs (axes?). the warning will pop up because it wasn't directly a parameter of the... |
1,154,242 | I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.
I know that `axes = false` will get rid of the entire axis, but I would only like to get rid of the numbering. | 2009/07/20 | [
"https://Stackoverflow.com/questions/1154242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130633/"
] | Using base graphics, the standard way to do this is to use axes=FALSE, then create your own axes using Axis (or axis). For example,
```
x <- 1:20
y <- runif(20)
plot(x, y, axes=FALSE, frame.plot=TRUE)
Axis(side=1, labels=FALSE)
Axis(side=2, labels=FALSE)
```
The lattice equivalent is
```
library(lattice)
xyplot(y ... | Change the axis\_colour to match the background and if you are modifying the background dynamically you will need to update the axis\_colour simultaneously.
\* The shared picture shows the graph/plot example using mock data ()
```
### Main Plotting Function ###
plotXY <- function(time, value){
### Plot Style Sett... |
1,154,242 | I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.
I know that `axes = false` will get rid of the entire axis, but I would only like to get rid of the numbering. | 2009/07/20 | [
"https://Stackoverflow.com/questions/1154242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130633/"
] | Remove numbering on x-axis or y-axis:
```
plot(1:10, xaxt='n')
plot(1:10, yaxt='n')
```
If you want to remove the labels as well:
```
plot(1:10, xaxt='n', ann=FALSE)
plot(1:10, yaxt='n', ann=FALSE)
``` | @Richie Cotton has a pretty good answer above. I can only add that this [page](http://www.statmethods.net/advgraphs/axes.html) provides some examples. Try the following:
```
x <- 1:20
y <- runif(20)
plot(x,y,xaxt = "n")
axis(side = 1, at = x, labels = FALSE, tck = -0.01)
``` |
1,154,242 | I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.
I know that `axes = false` will get rid of the entire axis, but I would only like to get rid of the numbering. | 2009/07/20 | [
"https://Stackoverflow.com/questions/1154242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130633/"
] | Remove numbering on x-axis or y-axis:
```
plot(1:10, xaxt='n')
plot(1:10, yaxt='n')
```
If you want to remove the labels as well:
```
plot(1:10, xaxt='n', ann=FALSE)
plot(1:10, yaxt='n', ann=FALSE)
``` | you can also put labels inside plot:
```
plot(spline(sub$day, sub$counts), type ='l', labels = FALSE)
```
you'll get a warning. i think this is because labels is actually a parameter that's being passed down to a subroutine that plot runs (axes?). the warning will pop up because it wasn't directly a parameter of the... |
1,154,242 | I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.
I know that `axes = false` will get rid of the entire axis, but I would only like to get rid of the numbering. | 2009/07/20 | [
"https://Stackoverflow.com/questions/1154242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130633/"
] | Remove numbering on x-axis or y-axis:
```
plot(1:10, xaxt='n')
plot(1:10, yaxt='n')
```
If you want to remove the labels as well:
```
plot(1:10, xaxt='n', ann=FALSE)
plot(1:10, yaxt='n', ann=FALSE)
``` | Change the axis\_colour to match the background and if you are modifying the background dynamically you will need to update the axis\_colour simultaneously.
\* The shared picture shows the graph/plot example using mock data ()
```
### Main Plotting Function ###
plotXY <- function(time, value){
### Plot Style Sett... |
1,154,242 | I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.
I know that `axes = false` will get rid of the entire axis, but I would only like to get rid of the numbering. | 2009/07/20 | [
"https://Stackoverflow.com/questions/1154242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130633/"
] | @Richie Cotton has a pretty good answer above. I can only add that this [page](http://www.statmethods.net/advgraphs/axes.html) provides some examples. Try the following:
```
x <- 1:20
y <- runif(20)
plot(x,y,xaxt = "n")
axis(side = 1, at = x, labels = FALSE, tck = -0.01)
``` | you can also put labels inside plot:
```
plot(spline(sub$day, sub$counts), type ='l', labels = FALSE)
```
you'll get a warning. i think this is because labels is actually a parameter that's being passed down to a subroutine that plot runs (axes?). the warning will pop up because it wasn't directly a parameter of the... |
1,154,242 | I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.
I know that `axes = false` will get rid of the entire axis, but I would only like to get rid of the numbering. | 2009/07/20 | [
"https://Stackoverflow.com/questions/1154242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130633/"
] | @Richie Cotton has a pretty good answer above. I can only add that this [page](http://www.statmethods.net/advgraphs/axes.html) provides some examples. Try the following:
```
x <- 1:20
y <- runif(20)
plot(x,y,xaxt = "n")
axis(side = 1, at = x, labels = FALSE, tck = -0.01)
``` | Change the axis\_colour to match the background and if you are modifying the background dynamically you will need to update the axis\_colour simultaneously.
\* The shared picture shows the graph/plot example using mock data ()
```
### Main Plotting Function ###
plotXY <- function(time, value){
### Plot Style Sett... |
1,154,242 | I was just wondering if there is a way to get rid of axis values, either the x-axis or y-axis respectively, in an r-plot graph.
I know that `axes = false` will get rid of the entire axis, but I would only like to get rid of the numbering. | 2009/07/20 | [
"https://Stackoverflow.com/questions/1154242",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/130633/"
] | you can also put labels inside plot:
```
plot(spline(sub$day, sub$counts), type ='l', labels = FALSE)
```
you'll get a warning. i think this is because labels is actually a parameter that's being passed down to a subroutine that plot runs (axes?). the warning will pop up because it wasn't directly a parameter of the... | Change the axis\_colour to match the background and if you are modifying the background dynamically you will need to update the axis\_colour simultaneously.
\* The shared picture shows the graph/plot example using mock data ()
```
### Main Plotting Function ###
plotXY <- function(time, value){
### Plot Style Sett... |
52,683,992 | First, I just used union, and I don't really understand it.
basically, to change the name of the month I usually use
```
select MONTHNAME (date)
```
But in this case I dont know Union more deeply so it is very confusing to change the number of months to the name of the month. Can you help me? please don't just give... | 2018/10/06 | [
"https://Stackoverflow.com/questions/52683992",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7590238/"
] | You can just use `CONCAT` to convert your month number into a date string that you can then pass to `MONTHNAME` i.e. change the first line of your query to:
```
SELECT MONTHNAME(CONCAT('2018-', m.month, '-01')) month_table,
```
Output (for your sample data from your [previous question](https://stackoverflow.com/ques... | Most people just create look up table for this kind of thing, populate it once then use it. Not only does it perform vastly better, but it’s easily understood and reused.
Another common tick is to create a “calendar” table that contains all the dates within a decade or so, with day names, public holiday indicators, et... |
20,838,315 | I want to save my data into an array and then sort it and display to user
Please help me out i am new in php
My code is :
```
$sql = "Select * FROM contact_info WHERE user_id = $userid AND name LIKE 'a%' ORDER BY name ASC";
$result=mysqli_query($con,$sql);
$a = array ();
$i=0;
while ($row=mysqli_fetch_array($result... | 2013/12/30 | [
"https://Stackoverflow.com/questions/20838315",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3146137/"
] | ```
while ($row=mysqli_fetch_array($result))
{
$a[$i]=$row['name'];
$i++; // forgot this
}
``` | Inside the while you need to increment $i. |
20,838,315 | I want to save my data into an array and then sort it and display to user
Please help me out i am new in php
My code is :
```
$sql = "Select * FROM contact_info WHERE user_id = $userid AND name LIKE 'a%' ORDER BY name ASC";
$result=mysqli_query($con,$sql);
$a = array ();
$i=0;
while ($row=mysqli_fetch_array($result... | 2013/12/30 | [
"https://Stackoverflow.com/questions/20838315",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3146137/"
] | ```
while ($row=mysqli_fetch_array($result))
{
$a[$i]=$row['name'];
$i++; // forgot this
}
``` | You don't have to do it because you have an `ORDER BY` in your SQL ... |
20,838,315 | I want to save my data into an array and then sort it and display to user
Please help me out i am new in php
My code is :
```
$sql = "Select * FROM contact_info WHERE user_id = $userid AND name LIKE 'a%' ORDER BY name ASC";
$result=mysqli_query($con,$sql);
$a = array ();
$i=0;
while ($row=mysqli_fetch_array($result... | 2013/12/30 | [
"https://Stackoverflow.com/questions/20838315",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3146137/"
] | ```
while ($row=mysqli_fetch_array($result))
{
$a[$i]=$row['name'];
$i++; // forgot this
}
``` | Instead of the below code:
```
$a[$i]=$row['name'];
```
use the below code:
```
$a[]=$row['name'];
```
this will automatically assign the incremented index. |
65,755,653 | ```
ListTile(
leading: Icon(FontAwesomeIcons.qrcode,
size: 50),
title: Text(record.hes, style: (
TextStyle(
fontSize: 30,
color: Color(0xFF545F61),
)
),),
subtitle: Text(record.name + " " + record.sname, ... | 2021/01/16 | [
"https://Stackoverflow.com/questions/65755653",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14649383/"
] | Maybe you can try this
```
record.name.replaceRange(2, record.name.length, "*" * (record.name.length - 2))
// or
record.sname.replaceRange(2, record.sname.length, "*" * (record.sname.length - 2))
``` | try this
```
int visibleCharacters = 2;
var hiddenName = record.name.substring(0, visibleCharacters) +
('*' * (record.name.length - visibleCharacters));
var hiddenSurname = record.sname.substring(0, visibleCharacters) +
('*' * (record.sname.length - visibleCharacters));
``` |
40,108,967 | I have an issue with the `presentViewController`function.
I have a login menu (A) and a button who display a login form (B). On success login, I present a third view with `self.presentViewController` (C).
Login menu (A) -> Login form (B) -> Content (C)
It's work, I can present the third view (C) but the login menu (... | 2016/10/18 | [
"https://Stackoverflow.com/questions/40108967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5594337/"
] | `presentViewController`, presents a view controller modally. In other words, over the current view controller’s content, and the current view controller will not get deallocated.
Use the following code for your sample:
```
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let vc = storyboard.instantiateViewCon... | I think this tutorial has your answer <https://www.youtube.com/watch?v=WIaRs2d6Xm0> |
40,108,967 | I have an issue with the `presentViewController`function.
I have a login menu (A) and a button who display a login form (B). On success login, I present a third view with `self.presentViewController` (C).
Login menu (A) -> Login form (B) -> Content (C)
It's work, I can present the third view (C) but the login menu (... | 2016/10/18 | [
"https://Stackoverflow.com/questions/40108967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5594337/"
] | If we consider the **presentVieController** mechanism, this is not a problem or bug. Still if you feel that you don not want your previous controller's remain in Hierarchy, Then you have to change the flow.
Currently your flow is :
A -> RootViewController.
B -> LoginScreen
C -> Container
I would suggest to refer bel... | I think this tutorial has your answer <https://www.youtube.com/watch?v=WIaRs2d6Xm0> |
60,370 | According to [http://apps.tsa.dhs.gov](http://apps.tsa.dhs.gov/mytsa/cib_results.aspx?search=Liquid) it says the following:
>
> **You may carry liquids, gels and aerosols in your carry-on bags only if
> they adhere to the 3-1-1 rule: containers must be 3.4 ounces or less;
> stored in a 1 quart/liter zip-top bag; 1 zi... | 2015/12/23 | [
"https://travel.stackexchange.com/questions/60370",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/24390/"
] | You quote the TSA:
>
> Medically required liquids, such as baby formula and food, breast milk and medications are allowed in excess of 3.4 ounces in reasonable quantities for the flight.
>
>
>
The key is "reasonable quantities for the flight." For most people, 3.4 ounces of contact lens solution is far more than... | I don't believe that security should have allowed you to carry the contact lens solution on board on either flight.
In December 1994, Ramzi Yousef smuggled nitroglycerin on board [Philippine Airlines flight 434](https://en.wikipedia.org/wiki/Philippine_Airlines_Flight_434) inside a bottle of contact lens solution, wit... |
60,370 | According to [http://apps.tsa.dhs.gov](http://apps.tsa.dhs.gov/mytsa/cib_results.aspx?search=Liquid) it says the following:
>
> **You may carry liquids, gels and aerosols in your carry-on bags only if
> they adhere to the 3-1-1 rule: containers must be 3.4 ounces or less;
> stored in a 1 quart/liter zip-top bag; 1 zi... | 2015/12/23 | [
"https://travel.stackexchange.com/questions/60370",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/24390/"
] | I don't believe that security should have allowed you to carry the contact lens solution on board on either flight.
In December 1994, Ramzi Yousef smuggled nitroglycerin on board [Philippine Airlines flight 434](https://en.wikipedia.org/wiki/Philippine_Airlines_Flight_434) inside a bottle of contact lens solution, wit... | The TSA is unclear on this. Quoting the TSA:
>
> 3-1-1 Liquids Rule Exemption
>
>
> You may bring medically necessary liquids, medications and creams in
> excess of 3.4 ounces or 100 milliliters in your carry-on bag. Remove
> them from your carry-on bag to be screened separately from the rest of
> your belonging... |
60,370 | According to [http://apps.tsa.dhs.gov](http://apps.tsa.dhs.gov/mytsa/cib_results.aspx?search=Liquid) it says the following:
>
> **You may carry liquids, gels and aerosols in your carry-on bags only if
> they adhere to the 3-1-1 rule: containers must be 3.4 ounces or less;
> stored in a 1 quart/liter zip-top bag; 1 zi... | 2015/12/23 | [
"https://travel.stackexchange.com/questions/60370",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/24390/"
] | You quote the TSA:
>
> Medically required liquids, such as baby formula and food, breast milk and medications are allowed in excess of 3.4 ounces in reasonable quantities for the flight.
>
>
>
The key is "reasonable quantities for the flight." For most people, 3.4 ounces of contact lens solution is far more than... | The TSA is unclear on this. Quoting the TSA:
>
> 3-1-1 Liquids Rule Exemption
>
>
> You may bring medically necessary liquids, medications and creams in
> excess of 3.4 ounces or 100 milliliters in your carry-on bag. Remove
> them from your carry-on bag to be screened separately from the rest of
> your belonging... |
5,671,296 | I want to open a new window for each $url created how could I do that?
```
<?php
require_once('sql.php');
$result = mysql_query("SELECT * FROM gamertags ORDER BY id DESC LIMIT 10");
while($row = mysql_fetch_array($result)){
// Prepare gamertag for url
$gamertag = strtolower($row['gamertag']);
$url = "htt... | 2011/04/15 | [
"https://Stackoverflow.com/questions/5671296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/604168/"
] | you can do it with a combo of javascript and ur current script:
```
<?php
require_once('sql.php');
$result = mysql_query("SELECT * FROM gamertags ORDER BY id DESC LIMIT 10");
echo "<script>";
while($row = mysql_fetch_array($result)){
// Prepare gamertag for url
$gamertag = strtolower($row['gamertag']);
$u... | In your generated HTML, use `target="_blank"` to cause a new new window to be launched when the link is clicked.
```
<a href="url" target="_blank">Link</a>
```
You can't do it in PHP since it's a server since it's server side. You might also do it from JavaScript but more information would be useful.
In JavaScript,... |
5,671,296 | I want to open a new window for each $url created how could I do that?
```
<?php
require_once('sql.php');
$result = mysql_query("SELECT * FROM gamertags ORDER BY id DESC LIMIT 10");
while($row = mysql_fetch_array($result)){
// Prepare gamertag for url
$gamertag = strtolower($row['gamertag']);
$url = "htt... | 2011/04/15 | [
"https://Stackoverflow.com/questions/5671296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/604168/"
] | **Warning ~ Will attempt to open 10 windows on load:**
**[Live Demo](http://jsfiddle.net/zhehg/)**
```
$("#gamertags a").each(function() {
window.open($(this).attr('href'), 'Player Details', 'width=500,height=500');
});
``` | In your generated HTML, use `target="_blank"` to cause a new new window to be launched when the link is clicked.
```
<a href="url" target="_blank">Link</a>
```
You can't do it in PHP since it's a server since it's server side. You might also do it from JavaScript but more information would be useful.
In JavaScript,... |
5,671,296 | I want to open a new window for each $url created how could I do that?
```
<?php
require_once('sql.php');
$result = mysql_query("SELECT * FROM gamertags ORDER BY id DESC LIMIT 10");
while($row = mysql_fetch_array($result)){
// Prepare gamertag for url
$gamertag = strtolower($row['gamertag']);
$url = "htt... | 2011/04/15 | [
"https://Stackoverflow.com/questions/5671296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/604168/"
] | you can do it with a combo of javascript and ur current script:
```
<?php
require_once('sql.php');
$result = mysql_query("SELECT * FROM gamertags ORDER BY id DESC LIMIT 10");
echo "<script>";
while($row = mysql_fetch_array($result)){
// Prepare gamertag for url
$gamertag = strtolower($row['gamertag']);
$u... | **Warning ~ Will attempt to open 10 windows on load:**
**[Live Demo](http://jsfiddle.net/zhehg/)**
```
$("#gamertags a").each(function() {
window.open($(this).attr('href'), 'Player Details', 'width=500,height=500');
});
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.