qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
1,516,994
$f = ax^2 - b$ and $g = cx + d$ Where $a,b,c,d$ are all coefficients. Find $a,b,c,d$ when $f◦g = g◦f$. Here is what I have: \begin{align\*} f◦g &= a(cx + d)^2 -b = a(c^2)(x^2) + 2acdx + ad^2 - b\\ g◦f &= c(ax^2 - b) + d = acx^2 - bc + d \end{align\*} And then I get stuck... I tried manipulating variables to make them...
2015/11/07
[ "https://math.stackexchange.com/questions/1516994", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287751/" ]
It has no precise meaning. It's just a shorthand for saying "sufficiently small" or "easily seen to be so much smaller that the following argument will work" -- and shouldn't be expected to have a more precise technical content than it would have to write those fuzzy descriptions out in words.
Much less than, much more than is useful in mathematical formulas applying to everyday life. If I must find a life saving value using a formula, which has a part that doesn't contribute significantly to the end result, there it has a meaning.(<< or >>). Otherwise you might lose precious life saving time It doesn't hav...
1,516,994
$f = ax^2 - b$ and $g = cx + d$ Where $a,b,c,d$ are all coefficients. Find $a,b,c,d$ when $f◦g = g◦f$. Here is what I have: \begin{align\*} f◦g &= a(cx + d)^2 -b = a(c^2)(x^2) + 2acdx + ad^2 - b\\ g◦f &= c(ax^2 - b) + d = acx^2 - bc + d \end{align\*} And then I get stuck... I tried manipulating variables to make them...
2015/11/07
[ "https://math.stackexchange.com/questions/1516994", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287751/" ]
Let me chip in from a physicists vantage... It's all about orders of magnitude. Are the observed effects so different in order that your simplified model is *sufficiently* accurate? In this case, sufficient depends on how closely you need to look and how feasible it is to even look deeper. You'll rarely if ever see th...
A (too) simple definition would be $$ a \ll b ~ \Leftrightarrow ~ \frac{a}{b} \approx 0 $$ There may be some context implied: a variable tending toward $0$ or $\infty$, or a certain imprecision level that the user is willing to accept.
1,516,994
$f = ax^2 - b$ and $g = cx + d$ Where $a,b,c,d$ are all coefficients. Find $a,b,c,d$ when $f◦g = g◦f$. Here is what I have: \begin{align\*} f◦g &= a(cx + d)^2 -b = a(c^2)(x^2) + 2acdx + ad^2 - b\\ g◦f &= c(ax^2 - b) + d = acx^2 - bc + d \end{align\*} And then I get stuck... I tried manipulating variables to make them...
2015/11/07
[ "https://math.stackexchange.com/questions/1516994", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287751/" ]
A (too) simple definition would be $$ a \ll b ~ \Leftrightarrow ~ \frac{a}{b} \approx 0 $$ There may be some context implied: a variable tending toward $0$ or $\infty$, or a certain imprecision level that the user is willing to accept.
Par example: Choose a priori positive number $N>1$ such that $0<x\ll y$. If $\frac{y-x}{x}>N$ for then $y>x\cdot(1+N)$. With repect to N, your 2nd example does not fit this requirement: $10^{10^{10^{10^{11}}}}\ll10^{10^{10^{10^{11}}}}+9999999999$. I had in mind $\frac{N-O}{O}\times 100\%$, the relative change has to ov...
1,516,994
$f = ax^2 - b$ and $g = cx + d$ Where $a,b,c,d$ are all coefficients. Find $a,b,c,d$ when $f◦g = g◦f$. Here is what I have: \begin{align\*} f◦g &= a(cx + d)^2 -b = a(c^2)(x^2) + 2acdx + ad^2 - b\\ g◦f &= c(ax^2 - b) + d = acx^2 - bc + d \end{align\*} And then I get stuck... I tried manipulating variables to make them...
2015/11/07
[ "https://math.stackexchange.com/questions/1516994", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287751/" ]
"Much less than" is a qualitative assessment of comparative inequality. $a\ll b$ means that $a$ is not only less than $b$, but *muchly* so by *some* convention. That convention is fairly arbitrary, or rather *contextual*; there is no fixed quantitative basis.   Sometimes it is based on additive position, sometimes on...
Let me chip in from a physicists vantage... It's all about orders of magnitude. Are the observed effects so different in order that your simplified model is *sufficiently* accurate? In this case, sufficient depends on how closely you need to look and how feasible it is to even look deeper. You'll rarely if ever see th...
1,516,994
$f = ax^2 - b$ and $g = cx + d$ Where $a,b,c,d$ are all coefficients. Find $a,b,c,d$ when $f◦g = g◦f$. Here is what I have: \begin{align\*} f◦g &= a(cx + d)^2 -b = a(c^2)(x^2) + 2acdx + ad^2 - b\\ g◦f &= c(ax^2 - b) + d = acx^2 - bc + d \end{align\*} And then I get stuck... I tried manipulating variables to make them...
2015/11/07
[ "https://math.stackexchange.com/questions/1516994", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287751/" ]
"Much less than" is a qualitative assessment of comparative inequality. $a\ll b$ means that $a$ is not only less than $b$, but *muchly* so by *some* convention. That convention is fairly arbitrary, or rather *contextual*; there is no fixed quantitative basis.   Sometimes it is based on additive position, sometimes on...
Par example: Choose a priori positive number $N>1$ such that $0<x\ll y$. If $\frac{y-x}{x}>N$ for then $y>x\cdot(1+N)$. With repect to N, your 2nd example does not fit this requirement: $10^{10^{10^{10^{11}}}}\ll10^{10^{10^{10^{11}}}}+9999999999$. I had in mind $\frac{N-O}{O}\times 100\%$, the relative change has to ov...
1,516,994
$f = ax^2 - b$ and $g = cx + d$ Where $a,b,c,d$ are all coefficients. Find $a,b,c,d$ when $f◦g = g◦f$. Here is what I have: \begin{align\*} f◦g &= a(cx + d)^2 -b = a(c^2)(x^2) + 2acdx + ad^2 - b\\ g◦f &= c(ax^2 - b) + d = acx^2 - bc + d \end{align\*} And then I get stuck... I tried manipulating variables to make them...
2015/11/07
[ "https://math.stackexchange.com/questions/1516994", "https://math.stackexchange.com", "https://math.stackexchange.com/users/287751/" ]
Much less than, much more than is useful in mathematical formulas applying to everyday life. If I must find a life saving value using a formula, which has a part that doesn't contribute significantly to the end result, there it has a meaning.(<< or >>). Otherwise you might lose precious life saving time It doesn't hav...
Par example: Choose a priori positive number $N>1$ such that $0<x\ll y$. If $\frac{y-x}{x}>N$ for then $y>x\cdot(1+N)$. With repect to N, your 2nd example does not fit this requirement: $10^{10^{10^{10^{11}}}}\ll10^{10^{10^{10^{11}}}}+9999999999$. I had in mind $\frac{N-O}{O}\times 100\%$, the relative change has to ov...
5,060,958
I'm wondering, is there a way to get a delegate or something, when a particular `UIView` has been shown on the screen ?
2011/02/20
[ "https://Stackoverflow.com/questions/5060958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552312/" ]
Try these: ``` – didAddSubview: – willRemoveSubview: – willMoveToSuperview: – didMoveToSuperview – willMoveToWindow: – didMoveToWindow - viewDidAppear: ```
If you are managing the `UIView` via a `UIViewController`, then you can use the `-viewDidAppear:` method: ``` - (void) viewDidAppear:(BOOL) animated { //do stuff... [super viewDidAppear:animated]; } ```
5,060,958
I'm wondering, is there a way to get a delegate or something, when a particular `UIView` has been shown on the screen ?
2011/02/20
[ "https://Stackoverflow.com/questions/5060958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552312/" ]
Try these: ``` – didAddSubview: – willRemoveSubview: – willMoveToSuperview: – didMoveToSuperview – willMoveToWindow: – didMoveToWindow - viewDidAppear: ```
Another way to find out when a control is on screen is to subclass the View or Control and override `drawRect`... However, it's called when it's drawn and not only when first shown. So it's only sometimes what you want. It worked for my case. Make sure to call super as well! =)
5,060,958
I'm wondering, is there a way to get a delegate or something, when a particular `UIView` has been shown on the screen ?
2011/02/20
[ "https://Stackoverflow.com/questions/5060958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552312/" ]
If you are managing the `UIView` via a `UIViewController`, then you can use the `-viewDidAppear:` method: ``` - (void) viewDidAppear:(BOOL) animated { //do stuff... [super viewDidAppear:animated]; } ```
Another way to find out when a control is on screen is to subclass the View or Control and override `drawRect`... However, it's called when it's drawn and not only when first shown. So it's only sometimes what you want. It worked for my case. Make sure to call super as well! =)
5,060,958
I'm wondering, is there a way to get a delegate or something, when a particular `UIView` has been shown on the screen ?
2011/02/20
[ "https://Stackoverflow.com/questions/5060958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552312/" ]
If you manage your logic directly inside the UIView, use: ``` - didMoveToSuperview ``` If you manage your logic inside a UIViewController, use : ``` - viewDidAppear:(BOOL)animated ```
If you are managing the `UIView` via a `UIViewController`, then you can use the `-viewDidAppear:` method: ``` - (void) viewDidAppear:(BOOL) animated { //do stuff... [super viewDidAppear:animated]; } ```
5,060,958
I'm wondering, is there a way to get a delegate or something, when a particular `UIView` has been shown on the screen ?
2011/02/20
[ "https://Stackoverflow.com/questions/5060958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552312/" ]
Swift version. Inside your UIView class just: ``` override func willMove(toWindow newWindow: UIWindow?) { super.willMove(toWindow: newWindow) if newWindow == nil { // UIView disappear } else { // UIView appear } } ```
If you are managing the `UIView` via a `UIViewController`, then you can use the `-viewDidAppear:` method: ``` - (void) viewDidAppear:(BOOL) animated { //do stuff... [super viewDidAppear:animated]; } ```
5,060,958
I'm wondering, is there a way to get a delegate or something, when a particular `UIView` has been shown on the screen ?
2011/02/20
[ "https://Stackoverflow.com/questions/5060958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552312/" ]
If you manage your logic directly inside the UIView, use: ``` - didMoveToSuperview ``` If you manage your logic inside a UIViewController, use : ``` - viewDidAppear:(BOOL)animated ```
Another way to find out when a control is on screen is to subclass the View or Control and override `drawRect`... However, it's called when it's drawn and not only when first shown. So it's only sometimes what you want. It worked for my case. Make sure to call super as well! =)
5,060,958
I'm wondering, is there a way to get a delegate or something, when a particular `UIView` has been shown on the screen ?
2011/02/20
[ "https://Stackoverflow.com/questions/5060958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552312/" ]
Swift version. Inside your UIView class just: ``` override func willMove(toWindow newWindow: UIWindow?) { super.willMove(toWindow: newWindow) if newWindow == nil { // UIView disappear } else { // UIView appear } } ```
Another way to find out when a control is on screen is to subclass the View or Control and override `drawRect`... However, it's called when it's drawn and not only when first shown. So it's only sometimes what you want. It worked for my case. Make sure to call super as well! =)
6,946,649
Can anyone suggest how I can access then animate the red polyline here using javascript: <http://gymloop.lukem.co.uk> (login: User2/pass2, then select 'Challenges') I want to animate the polyline from the first marker to the end of the red line (think Indiana jones but without the map moving and NOT using google maps...
2011/08/04
[ "https://Stackoverflow.com/questions/6946649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69346/" ]
I've checked out your code and it seems you're using the leaflet API to draw the lines. Because of that, I've decided to write a somewhat generic function that animated those kinds of lines. (By the way, I'm confused why that API uses path tags instead of line tags, but I've rolled with it.) Here's the code: <http://j...
I highly recommend [jquery\_svg plugin](http://keith-wood.name/svg.html). I've been using it and there are plenty of features, including animation, text on path, user interaction.
24,179,027
I want to subtract 273 from the received values of array to view the temperature in Celsius. ``` cell.textLabel.text = [NSString stringWithFormat:@"Kelvin: %@",[day objectAtIndex:indexPath.row]]; ``` Here day is an array of values from which I want to substract value 273
2014/06/12
[ "https://Stackoverflow.com/questions/24179027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3702516/" ]
The think you need to understand is that GPS differs from network so even though you put your mobile in airplane mode the GPS will work and brings you the location. Try to change your code as follows ``` if (lm != null){ gpsEnabled = lm.isProviderEnabled(LocationManager.GPS_PROVIDER); } if(gpsEnabled && isNetwork...
The Google Maps API has location stuff, you can do it using that, for example: ``` private GoogleMap.OnMyLocationChangeListener myLocationChangeListener = new GoogleMap.OnMyLocationChangeListener() { @Override public void onMyLocationChange(Location location) { LatLng loc = new LatLng(location.getLatit...
68,946,516
I have an OrderedDict in Python, and I only want to get the first key-vale pairs. How to get it? For example, to get the first 4 elements, i did the following: ``` subdict = {} for index, pair in enumerate(my_ordered_dict.items()): if index < 4: subdict[pair[0]] = pair[1] ``` Is this the good way to do i...
2021/08/26
[ "https://Stackoverflow.com/questions/68946516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3943868/" ]
That approach involves running over the whole dictionary even though you only need the first four elements, checking the index over and over, and manually unpacking the pairs, and manually performing index checking unnecessarily. Making it short-circuit is easy: ``` subdict = {} for index, pair in enumerate(my_ordere...
Here is one approach: ``` sub_dict = dict(pair for i, pair in zip(range(4), my_ordered_dict.items())) ``` The length of `zip(a,b)` is equal to the length of the shortest of `a` and `b`, so if `my_ordered_dict.items()` is longer than `4`, `zip(range(4), my_ordered_dict.items()` just takes the first `4` items. These k...
68,946,516
I have an OrderedDict in Python, and I only want to get the first key-vale pairs. How to get it? For example, to get the first 4 elements, i did the following: ``` subdict = {} for index, pair in enumerate(my_ordered_dict.items()): if index < 4: subdict[pair[0]] = pair[1] ``` Is this the good way to do i...
2021/08/26
[ "https://Stackoverflow.com/questions/68946516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3943868/" ]
That approach involves running over the whole dictionary even though you only need the first four elements, checking the index over and over, and manually unpacking the pairs, and manually performing index checking unnecessarily. Making it short-circuit is easy: ``` subdict = {} for index, pair in enumerate(my_ordere...
You can use a map function, like this ``` item = dict(map(lambda x: (x, subdict[x]),[*subdict][:4])) ```
68,946,516
I have an OrderedDict in Python, and I only want to get the first key-vale pairs. How to get it? For example, to get the first 4 elements, i did the following: ``` subdict = {} for index, pair in enumerate(my_ordered_dict.items()): if index < 4: subdict[pair[0]] = pair[1] ``` Is this the good way to do i...
2021/08/26
[ "https://Stackoverflow.com/questions/68946516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3943868/" ]
You can use a map function, like this ``` item = dict(map(lambda x: (x, subdict[x]),[*subdict][:4])) ```
Here is one approach: ``` sub_dict = dict(pair for i, pair in zip(range(4), my_ordered_dict.items())) ``` The length of `zip(a,b)` is equal to the length of the shortest of `a` and `b`, so if `my_ordered_dict.items()` is longer than `4`, `zip(range(4), my_ordered_dict.items()` just takes the first `4` items. These k...
45,804,147
I have a series of files that have changed some header naming and column counts over time. However, the files always have the first column as the start date and second column as the end date. I would like to get just these two columns, but the name has changed over time. What I have tried is this: ``` $FileContents=...
2017/08/21
[ "https://Stackoverflow.com/questions/45804147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3217145/" ]
How about this: ``` $FileContents=get-content -Path "$InputFilePath" for ($i=0;$i -lt $FileContents.count;$i++){ $textrow = ($FileContents[$i]).split(",") $StartDate=$textrow[0] $EndDate=$textrow[1] #do what you want with the variables write-host $startdate write-host $EndDate } ``` pendin...
Other solution with foreach (%=alias of foreach) and split : ``` Get-Content "example.csv" | select -skip 1 | %{$row=$_ -split ',', 3; [pscustomobject]@{NewCol1=$row[0];NewCol2=$row[1]}} ```
45,804,147
I have a series of files that have changed some header naming and column counts over time. However, the files always have the first column as the start date and second column as the end date. I would like to get just these two columns, but the name has changed over time. What I have tried is this: ``` $FileContents=...
2017/08/21
[ "https://Stackoverflow.com/questions/45804147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3217145/" ]
How about this: ``` $FileContents=get-content -Path "$InputFilePath" for ($i=0;$i -lt $FileContents.count;$i++){ $textrow = ($FileContents[$i]).split(",") $StartDate=$textrow[0] $EndDate=$textrow[1] #do what you want with the variables write-host $startdate write-host $EndDate } ``` pendin...
You can build predicate into the select too like this : ``` Get-Content "example.csv" | select @{N="Newcol1";E={($_ -split ',', 3)[0]}}, @{N="Newcol2";E={($_ -split ',', 3)[1]}} -skip 1 ```
45,804,147
I have a series of files that have changed some header naming and column counts over time. However, the files always have the first column as the start date and second column as the end date. I would like to get just these two columns, but the name has changed over time. What I have tried is this: ``` $FileContents=...
2017/08/21
[ "https://Stackoverflow.com/questions/45804147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3217145/" ]
How about this: ``` $FileContents=get-content -Path "$InputFilePath" for ($i=0;$i -lt $FileContents.count;$i++){ $textrow = ($FileContents[$i]).split(",") $StartDate=$textrow[0] $EndDate=$textrow[1] #do what you want with the variables write-host $startdate write-host $EndDate } ``` pendin...
With convertfrom-string ``` Get-Content "example.csv" | ConvertFrom-Csv -Delimiter ',' -Header col1, col2 | select -skip 1 ```
45,804,147
I have a series of files that have changed some header naming and column counts over time. However, the files always have the first column as the start date and second column as the end date. I would like to get just these two columns, but the name has changed over time. What I have tried is this: ``` $FileContents=...
2017/08/21
[ "https://Stackoverflow.com/questions/45804147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3217145/" ]
You could use the `-Header` parameter to give the first to columns of the csv the header names you want. Then you'll skip the first line that has the old header. ``` $FileContents = Import-CSV -Path "$InputFilePath" -Header "StartDate","EndDate" | Select-Object "StartDate","EndDate" -Skip 1 foreach ($line in $FileCon...
Other solution with foreach (%=alias of foreach) and split : ``` Get-Content "example.csv" | select -skip 1 | %{$row=$_ -split ',', 3; [pscustomobject]@{NewCol1=$row[0];NewCol2=$row[1]}} ```
45,804,147
I have a series of files that have changed some header naming and column counts over time. However, the files always have the first column as the start date and second column as the end date. I would like to get just these two columns, but the name has changed over time. What I have tried is this: ``` $FileContents=...
2017/08/21
[ "https://Stackoverflow.com/questions/45804147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3217145/" ]
You could use the `-Header` parameter to give the first to columns of the csv the header names you want. Then you'll skip the first line that has the old header. ``` $FileContents = Import-CSV -Path "$InputFilePath" -Header "StartDate","EndDate" | Select-Object "StartDate","EndDate" -Skip 1 foreach ($line in $FileCon...
You can build predicate into the select too like this : ``` Get-Content "example.csv" | select @{N="Newcol1";E={($_ -split ',', 3)[0]}}, @{N="Newcol2";E={($_ -split ',', 3)[1]}} -skip 1 ```
45,804,147
I have a series of files that have changed some header naming and column counts over time. However, the files always have the first column as the start date and second column as the end date. I would like to get just these two columns, but the name has changed over time. What I have tried is this: ``` $FileContents=...
2017/08/21
[ "https://Stackoverflow.com/questions/45804147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3217145/" ]
You could use the `-Header` parameter to give the first to columns of the csv the header names you want. Then you'll skip the first line that has the old header. ``` $FileContents = Import-CSV -Path "$InputFilePath" -Header "StartDate","EndDate" | Select-Object "StartDate","EndDate" -Skip 1 foreach ($line in $FileCon...
With convertfrom-string ``` Get-Content "example.csv" | ConvertFrom-Csv -Delimiter ',' -Header col1, col2 | select -skip 1 ```
45,804,147
I have a series of files that have changed some header naming and column counts over time. However, the files always have the first column as the start date and second column as the end date. I would like to get just these two columns, but the name has changed over time. What I have tried is this: ``` $FileContents=...
2017/08/21
[ "https://Stackoverflow.com/questions/45804147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3217145/" ]
If you use `Import-Csv`, PowerShell will indeed create an object for you. The "columns" are calles *properties*. You can select properties with `Select-Object`. You have to name the properties, you want to select. Since you don't know the property names in advance, you can get the names with `Get-Member`. The first two...
Other solution with foreach (%=alias of foreach) and split : ``` Get-Content "example.csv" | select -skip 1 | %{$row=$_ -split ',', 3; [pscustomobject]@{NewCol1=$row[0];NewCol2=$row[1]}} ```
45,804,147
I have a series of files that have changed some header naming and column counts over time. However, the files always have the first column as the start date and second column as the end date. I would like to get just these two columns, but the name has changed over time. What I have tried is this: ``` $FileContents=...
2017/08/21
[ "https://Stackoverflow.com/questions/45804147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3217145/" ]
If you use `Import-Csv`, PowerShell will indeed create an object for you. The "columns" are calles *properties*. You can select properties with `Select-Object`. You have to name the properties, you want to select. Since you don't know the property names in advance, you can get the names with `Get-Member`. The first two...
You can build predicate into the select too like this : ``` Get-Content "example.csv" | select @{N="Newcol1";E={($_ -split ',', 3)[0]}}, @{N="Newcol2";E={($_ -split ',', 3)[1]}} -skip 1 ```
45,804,147
I have a series of files that have changed some header naming and column counts over time. However, the files always have the first column as the start date and second column as the end date. I would like to get just these two columns, but the name has changed over time. What I have tried is this: ``` $FileContents=...
2017/08/21
[ "https://Stackoverflow.com/questions/45804147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3217145/" ]
If you use `Import-Csv`, PowerShell will indeed create an object for you. The "columns" are calles *properties*. You can select properties with `Select-Object`. You have to name the properties, you want to select. Since you don't know the property names in advance, you can get the names with `Get-Member`. The first two...
With convertfrom-string ``` Get-Content "example.csv" | ConvertFrom-Csv -Delimiter ',' -Header col1, col2 | select -skip 1 ```
1,756,548
I'm trying to bind a `Textbox.Text` to `Form.Text` (which sets the title of the form). The binding itself works. But, the title isn't updated until I move the entire form. How can I achieve `Form.Text` being updated without moving the form? I'd like `Form.Text` being updated directly when I type something in the Textb...
2009/11/18
[ "https://Stackoverflow.com/questions/1756548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/196646/" ]
> > Classic problem, you're not updating the existing form's Text property but a new one that is not visible. Call the Show() method after you change the Text. > > > [Source](http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/b525de56-5c74-4db6-9cc4-31a0dbffa857) You can also try invalidating your form...
What about using the TextChanged event of the TextBox, like this: ``` public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void textBox1_TextChanged(object sender, EventArgs e) { this.Text = this.textBox1.Text; } } ```
1,756,548
I'm trying to bind a `Textbox.Text` to `Form.Text` (which sets the title of the form). The binding itself works. But, the title isn't updated until I move the entire form. How can I achieve `Form.Text` being updated without moving the form? I'd like `Form.Text` being updated directly when I type something in the Textb...
2009/11/18
[ "https://Stackoverflow.com/questions/1756548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/196646/" ]
What about using the TextChanged event of the TextBox, like this: ``` public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void textBox1_TextChanged(object sender, EventArgs e) { this.Text = this.textBox1.Text; } } ```
I had the same problem that almost freaks me out. Eventually I found that my form title update request by "this.text = " was blocked by the method "WndProc(ref Message message)". At the end of WndProc method I added "base.WndProc(ref message)", which passes along all messages to the base also. After that I could update...
1,756,548
I'm trying to bind a `Textbox.Text` to `Form.Text` (which sets the title of the form). The binding itself works. But, the title isn't updated until I move the entire form. How can I achieve `Form.Text` being updated without moving the form? I'd like `Form.Text` being updated directly when I type something in the Textb...
2009/11/18
[ "https://Stackoverflow.com/questions/1756548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/196646/" ]
What about using the TextChanged event of the TextBox, like this: ``` public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void textBox1_TextChanged(object sender, EventArgs e) { this.Text = this.textBox1.Text; } } ```
None of the traditional items worked (invalidate & refresh); nor was I able to readily determine where the message might have been blocked. However, sleeping the thread took care of this. ``` fForm1->Text = Title; Thread::Sleep(0); //Allow release for title to update ```
1,756,548
I'm trying to bind a `Textbox.Text` to `Form.Text` (which sets the title of the form). The binding itself works. But, the title isn't updated until I move the entire form. How can I achieve `Form.Text` being updated without moving the form? I'd like `Form.Text` being updated directly when I type something in the Textb...
2009/11/18
[ "https://Stackoverflow.com/questions/1756548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/196646/" ]
> > Classic problem, you're not updating the existing form's Text property but a new one that is not visible. Call the Show() method after you change the Text. > > > [Source](http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/b525de56-5c74-4db6-9cc4-31a0dbffa857) You can also try invalidating your form...
I had the same problem that almost freaks me out. Eventually I found that my form title update request by "this.text = " was blocked by the method "WndProc(ref Message message)". At the end of WndProc method I added "base.WndProc(ref message)", which passes along all messages to the base also. After that I could update...
1,756,548
I'm trying to bind a `Textbox.Text` to `Form.Text` (which sets the title of the form). The binding itself works. But, the title isn't updated until I move the entire form. How can I achieve `Form.Text` being updated without moving the form? I'd like `Form.Text` being updated directly when I type something in the Textb...
2009/11/18
[ "https://Stackoverflow.com/questions/1756548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/196646/" ]
> > Classic problem, you're not updating the existing form's Text property but a new one that is not visible. Call the Show() method after you change the Text. > > > [Source](http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/b525de56-5c74-4db6-9cc4-31a0dbffa857) You can also try invalidating your form...
None of the traditional items worked (invalidate & refresh); nor was I able to readily determine where the message might have been blocked. However, sleeping the thread took care of this. ``` fForm1->Text = Title; Thread::Sleep(0); //Allow release for title to update ```
10,189,953
I am using the explorer feature for classification. My .arff data file has 10 features of numeric and binary values; (only the ID of instances is nominal).I have abt 16 instances. The class to predict is Yes/No.i have used Naive bayes but i cantnot interpret the results,,does anyone know how to interpret results from n...
2012/04/17
[ "https://Stackoverflow.com/questions/10189953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1337481/" ]
You want to minimize a differentiable real-valued function `f` on a smooth hypersurface `S`. If such a minimum exists - in the situation after the edit it is guaranteed to exist because the hypersurface is compact - it occurs at a critical point of the restriction `f|S` of `f` to `S`. The critical points of a differen...
Each complex variable `x` can be considered as two *real* variables, representing the real and imaginary part, respectively, of `x`. My recommendation is that you reformulate your objective function and constraint using the real and imaginary parts of each variable or coefficient as independent components. According ...
55,804,104
I'm having difficulty creating the loop for this problem. Calculating the income tax requires the app to accumulate all the taxes from all the preceding tax brackets to the income’s bracket as shown in the table. a) Also, you must use loops to solve this problem. This is what I have so far ``` int[] upper =...
2019/04/23
[ "https://Stackoverflow.com/questions/55804104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Too many problems with this little code. * You are over-writing the "Tax", while you want to sum up the value of all taxes to make one resultant tax * your condition `income <= upper[i]` to calculate the tax is not proper in this context * you are not calculating tax on the delta `(upper[i] - upper[i -1])` but on `upp...
The following is a self-contained static function calculating the required result. While it probably does not make a difference for the sake of the exercise, in general it is advisable not to use floating point numbers for calculations with currency because you may lose precision when working with large amounts; either...
45,524,655
I have a df with nations as index and years(1990-2015) as header. I want to make a new df2 where every column is the sum of 5 year, eg: 1995-1999, 2000-2004 etc I have done this: ``` df2 = pd.DataFrame(index=df.index[:], columns=['1995', '2000', '2005', '2010', '2015']) df2['1995'] = df.iloc[0:4].sum(axis=1) ``` But...
2017/08/05
[ "https://Stackoverflow.com/questions/45524655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5178905/" ]
**Step 1** Transpose and reset index with [`df.T.reset_index`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.reset_index.html) ``` df2 = df.T.reset_index(drop=True) ``` **Step 2** Using [`df.groupby`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.groupby.html),...
I think you are looking for sum of every 5 columns after a specific column. One way of doing it is using a for loop for concatinating data after slicing i.e if you have a dataframe ``` df = pd.DataFrame({'Country':['IN','EG'],'1990':[2,4],'1991':[4,5],'1992':[2,4],'1993':[2,4],'1994':[62,14],'1995':[21,4],'1996':[2,1...
45,524,655
I have a df with nations as index and years(1990-2015) as header. I want to make a new df2 where every column is the sum of 5 year, eg: 1995-1999, 2000-2004 etc I have done this: ``` df2 = pd.DataFrame(index=df.index[:], columns=['1995', '2000', '2005', '2010', '2015']) df2['1995'] = df.iloc[0:4].sum(axis=1) ``` But...
2017/08/05
[ "https://Stackoverflow.com/questions/45524655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5178905/" ]
**Step 1** Transpose and reset index with [`df.T.reset_index`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.reset_index.html) ``` df2 = df.T.reset_index(drop=True) ``` **Step 2** Using [`df.groupby`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.groupby.html),...
You can use: * convert columns [`to_datetime`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Index.to_datetime.html) * [`resample`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.resample.html) by columns (`axis=1`) by `5A` (`years`) and aggregate `sum` * last get years from colu...
71,199,622
I want to search across all possible refs (commits/branches/tags), all commit messages, all branch names, and all commit contents.
2022/02/20
[ "https://Stackoverflow.com/questions/71199622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/565877/" ]
Since noone suggested a chain of commands yet, and in case you did not craft it yourself already : ``` git config alias.findall '!f() { echo -e "\nFound in refs:\n"; git for-each-ref refs/ | grep $1; echo -e "\nFound in commit messages:\n"; git log --all --oneline --grep="$1"; echo -e "\nFound in commit contents:\n"; ...
You can try printing everything to the terminal, and then searching output with your terminal application: ``` git log -5000 -p --all --decorate --oneline --graph ``` For performance reasons, this is limited to 5,000 commits. [![sample output from command](https://i.stack.imgur.com/GZ7vh.png)](https://i.stack.imgur...
59,937,391
I am looking for a way to Add an Intent to a List of Items or Buttons or Banners and the Intent to the Activity is decided by the Server. Take an Example. I have a List of Items(Suppose 4) with an Image that is coming from the Server. Each Item takes the user to a different Activity using Intent. I can pre-set the Int...
2020/01/27
[ "https://Stackoverflow.com/questions/59937391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5339829/" ]
```java private Class[] mClasses = { One.class, Two.class, Three.class, Four.class }; ``` Be careful, your list should be `mClasses.length>=yourList.size()` And, on your item click listener: ```java onItemClick(YourList item) { new Intent(getActivity(), mClasses[item.getPosition]); } ```
You can use `Class.forName` However, in that case your backend will have to know exact package name of each class to use. Or you can use some ordinals, to use in a switch case. ``` switch(activityNumber){ case One: new Intent(getActivity(), One.class); ... } ```
14,195,327
### Is it possible to crash a regular user-mode process on Windows-7 without getting the Windows Error Reporting (WER) dialog? (When and if WER is normally enabled and no specific flags are applied.) *Note: I'm **not** interested in **disabling WER**, I'm interested in crash scenarios where **WER isn't launched althou...
2013/01/07
[ "https://Stackoverflow.com/questions/14195327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/321013/" ]
I took a look at my edition of Windows Internals, but it doesn't have a whole lot to say on the subject. In earlier versions, the windows error reporting routine took place in the context of the crashing thread. This means that if the stack is trashed (as in your example), it might not be able to run. In Vista and lat...
You already know how to crash a process, so I answer regarding hiding the WER dialog. Way to hide WER dialog since Windows XP: ``` UINT WINAPI SetErrorMode(_In_ UINT uMode); ``` > > SEM\_NOGPFAULTERRORBOX > 0x0002 The system does not display the Windows Error Reporting dialog. > > > Note that there are also...
77,589
At first sight there is no abstract (= structural) definition of "product" in set theory. E.g. the Cartesian product of sets $A$ and $B$ is defined as the set of all ordered pairs $(x,y)$, $x \in A$, $y \in B$, and thus depends on the definition of "ordered pair" which is notoriously arbitrary. I wonder if the followi...
2011/10/09
[ "https://mathoverflow.net/questions/77589", "https://mathoverflow.net", "https://mathoverflow.net/users/2672/" ]
How do you define an equivalence relation in ZF without refering to products or ordered pairs? In case you want to define products via the usual universal property: There you have to use maps, which probably also cannot defined without ordered pairs in ZF. Anyway, if you are interested in a category theoretic foundati...
From your first part of definition from a couple $x,\ y$ of elements of $S$, there is (uniquely) associated an element $z$ of $S$ still, then essentially we have that $ S \times S \subset S $ (exist a subset of $S$ in bijection by the usual $S\times S$) and from second part this inclusion is a equality. Then your defin...
11,520,666
> > **Possible Duplicate:** > > [LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value](https://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret) > > > I have the following class: ``` cl...
2012/07/17
[ "https://Stackoverflow.com/questions/11520666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/675082/" ]
If you can do this: ``` class Product : IComparable<Product> { public string ProductName { get; set; } public DateTime ActivationDate { get; set; } public int CompareTo(Product other) { return this.ActivationDate.CompareTo(other.ActivationDate); } } ``` Then it is just this: ``` var max...
A non-LINQ solution is easy enough, in case you need it in only one place so the general [MaxBy](http://code.google.com/p/morelinq/source/browse/MoreLinq/MaxBy.cs) would be an overkill: ``` Product max_product = null; foreach (var product in products) { if (max_product == null || max_product.ActivationDate < prod...
11,520,666
> > **Possible Duplicate:** > > [LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value](https://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret) > > > I have the following class: ``` cl...
2012/07/17
[ "https://Stackoverflow.com/questions/11520666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/675082/" ]
You can `OrderByDescending` the `List<Product>` on the ActivationDate Field and then take `FirstOrDefault()` ``` Product.OrderByDescending(p => p.ActivationDate).FirstOrDefault(); ``` For a more simpler version there is an extension method [`MaxBy`](http://code.google.com/p/morelinq/source/browse/MoreLinq/MaxBy.cs)...
A non-LINQ solution is easy enough, in case you need it in only one place so the general [MaxBy](http://code.google.com/p/morelinq/source/browse/MoreLinq/MaxBy.cs) would be an overkill: ``` Product max_product = null; foreach (var product in products) { if (max_product == null || max_product.ActivationDate < prod...
11,520,666
> > **Possible Duplicate:** > > [LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value](https://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret) > > > I have the following class: ``` cl...
2012/07/17
[ "https://Stackoverflow.com/questions/11520666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/675082/" ]
If you can do this: ``` class Product : IComparable<Product> { public string ProductName { get; set; } public DateTime ActivationDate { get; set; } public int CompareTo(Product other) { return this.ActivationDate.CompareTo(other.ActivationDate); } } ``` Then it is just this: ``` var max...
How about writting an extension Function called Max which internally does the simple search logic presented by Branko Dimitrijevic. ``` /// <param name="comparer">Func<T current, T currentMax, long> </param> public static T Max<T>(this List<T> collection, Func<T, T, long> comparer) where T : class { T ...
11,520,666
> > **Possible Duplicate:** > > [LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value](https://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret) > > > I have the following class: ``` cl...
2012/07/17
[ "https://Stackoverflow.com/questions/11520666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/675082/" ]
How about writting an extension Function called Max which internally does the simple search logic presented by Branko Dimitrijevic. ``` /// <param name="comparer">Func<T current, T currentMax, long> </param> public static T Max<T>(this List<T> collection, Func<T, T, long> comparer) where T : class { T ...
A non-LINQ solution is easy enough, in case you need it in only one place so the general [MaxBy](http://code.google.com/p/morelinq/source/browse/MoreLinq/MaxBy.cs) would be an overkill: ``` Product max_product = null; foreach (var product in products) { if (max_product == null || max_product.ActivationDate < prod...
11,520,666
> > **Possible Duplicate:** > > [LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value](https://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret) > > > I have the following class: ``` cl...
2012/07/17
[ "https://Stackoverflow.com/questions/11520666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/675082/" ]
Here we go; a single pass of the list: ``` public static TSource MaxBy<TSource,TValue>( this IEnumerable<TSource> source, Func<TSource,TValue> selector) { using(var iter = source.GetEnumerator()) { if (!iter.MoveNext()) throw new InvalidOperationException("Empty sequence"); ...
Try this one ``` ProductList.Where(m => m.ActivationDate == ProductList.Max(pl => pl.ActivationDate)).FirstOrDefault().ProductName; ```
11,520,666
> > **Possible Duplicate:** > > [LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value](https://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret) > > > I have the following class: ``` cl...
2012/07/17
[ "https://Stackoverflow.com/questions/11520666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/675082/" ]
How about writting an extension Function called Max which internally does the simple search logic presented by Branko Dimitrijevic. ``` /// <param name="comparer">Func<T current, T currentMax, long> </param> public static T Max<T>(this List<T> collection, Func<T, T, long> comparer) where T : class { T ...
Try this one ``` ProductList.Where(m => m.ActivationDate == ProductList.Max(pl => pl.ActivationDate)).FirstOrDefault().ProductName; ```
11,520,666
> > **Possible Duplicate:** > > [LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value](https://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret) > > > I have the following class: ``` cl...
2012/07/17
[ "https://Stackoverflow.com/questions/11520666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/675082/" ]
You can `OrderByDescending` the `List<Product>` on the ActivationDate Field and then take `FirstOrDefault()` ``` Product.OrderByDescending(p => p.ActivationDate).FirstOrDefault(); ``` For a more simpler version there is an extension method [`MaxBy`](http://code.google.com/p/morelinq/source/browse/MoreLinq/MaxBy.cs)...
If you can do this: ``` class Product : IComparable<Product> { public string ProductName { get; set; } public DateTime ActivationDate { get; set; } public int CompareTo(Product other) { return this.ActivationDate.CompareTo(other.ActivationDate); } } ``` Then it is just this: ``` var max...
11,520,666
> > **Possible Duplicate:** > > [LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value](https://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret) > > > I have the following class: ``` cl...
2012/07/17
[ "https://Stackoverflow.com/questions/11520666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/675082/" ]
You can `OrderByDescending` the `List<Product>` on the ActivationDate Field and then take `FirstOrDefault()` ``` Product.OrderByDescending(p => p.ActivationDate).FirstOrDefault(); ``` For a more simpler version there is an extension method [`MaxBy`](http://code.google.com/p/morelinq/source/browse/MoreLinq/MaxBy.cs)...
Try this one ``` ProductList.Where(m => m.ActivationDate == ProductList.Max(pl => pl.ActivationDate)).FirstOrDefault().ProductName; ```
11,520,666
> > **Possible Duplicate:** > > [LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value](https://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret) > > > I have the following class: ``` cl...
2012/07/17
[ "https://Stackoverflow.com/questions/11520666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/675082/" ]
If you can do this: ``` class Product : IComparable<Product> { public string ProductName { get; set; } public DateTime ActivationDate { get; set; } public int CompareTo(Product other) { return this.ActivationDate.CompareTo(other.ActivationDate); } } ``` Then it is just this: ``` var max...
Try this one ``` ProductList.Where(m => m.ActivationDate == ProductList.Max(pl => pl.ActivationDate)).FirstOrDefault().ProductName; ```
11,520,666
> > **Possible Duplicate:** > > [LINQ: How to perform .Max() on a property of all objects in a collection and return the object with maximum value](https://stackoverflow.com/questions/1101841/linq-how-to-perform-max-on-a-property-of-all-objects-in-a-collection-and-ret) > > > I have the following class: ``` cl...
2012/07/17
[ "https://Stackoverflow.com/questions/11520666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/675082/" ]
Here we go; a single pass of the list: ``` public static TSource MaxBy<TSource,TValue>( this IEnumerable<TSource> source, Func<TSource,TValue> selector) { using(var iter = source.GetEnumerator()) { if (!iter.MoveNext()) throw new InvalidOperationException("Empty sequence"); ...
How about writting an extension Function called Max which internally does the simple search logic presented by Branko Dimitrijevic. ``` /// <param name="comparer">Func<T current, T currentMax, long> </param> public static T Max<T>(this List<T> collection, Func<T, T, long> comparer) where T : class { T ...
41,244,681
I have two DataFrames, one looks something like this: df1: ``` x y Counts a b 1 a c 3 b c 2 c d 1 ``` The other one has both as index and as columns the list of unique values in the first two columns: df2 ``` a b c d a b c d ``` What I wouldl like to do is to fill in the seco...
2016/12/20
[ "https://Stackoverflow.com/questions/41244681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7320529/" ]
You can do something like this: ``` import pandas as pd #df = pd.read_clipboard() #df2 = df.copy() df3=df2.pivot(index='x',columns='y',values='Counts') print df3 print new=sorted((set(df3.columns.tolist()+df3.index.tolist()))) df3 = df3.reindex(new,columns=new).fillna(0).applymap(int) print df3 ``` output: ``` y ...
`stack` `df2` and `fillna` with `df1` ``` idx = pd.Index(np.unique(df1[['x', 'y']])) df2 = pd.DataFrame(index=idx, columns=idx) df2.stack(dropna=False).fillna(df1.set_index(['x', 'y']).Counts) \ .unstack().fillna(0).astype(int) a b c d a 0 1 3 0 b 0 0 2 0 c 0 0 0 1 d 0 0 0 0 ```
55,790,824
I want to search an user by "firstname" and "lastname" so at first i have an input text where i put the lastname and firstname in the same input and second i have created this query ``` public function findListByName($name) { return $this->createQueryBuilder('c') ->where('c.firstname LIKE :name') ...
2019/04/22
[ "https://Stackoverflow.com/questions/55790824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11345650/" ]
Could be because You are using two times a param so try assign assign two param eg: try this way ``` public function findListByName($name) { return $this->createQueryBuilder('c') ->where('c.firstname LIKE concat('%',:name1', '%') ) ->orWhere('c.lastname LIKE concat('%',:name2', '%') ) ...
you can check if $name have space ``` $qb = $this->createQueryBuilder('c') $isMultiple = false; if (strpos($name, ' ')) { $isMultiple = true; $name = explode(' ', $name); } if ($isMultiple) { $qb->andWhere('c.firstname LIKE :firstname') ->andW...
616,225
I am working on a problem and I am lead to prove the following inequality which is true based on writing out the sequence and on the fact that it should be true based on what I am trying to prove. Let $s\_0,s\_1,s\_2,....$ be a sequence of positive numbers satisfying $s\_0=s\_1=1$ and $s\_n = s\_{n-1} - \alpha s\_{n-...
2013/12/23
[ "https://math.stackexchange.com/questions/616225", "https://math.stackexchange.com", "https://math.stackexchange.com/users/103943/" ]
Letting $A\lt B$ be the roots of the equation $x^2-x+\alpha=0,$ we have $$s\_{n+1}-As\_{n}=B(s\_{n}-As\_{n-1})=\cdots=B^n(s\_1-As\_0)=B^n(1-A).$$ $$s\_{n+1}-Bs\_{n}=A(s\_{n}-Bs\_{n-1})=\cdots=A^n(s\_1-Bs\_0)=A^n(1-B).$$ Hence, we have $$s\_n=\frac{B^n(1-A)-A^n(1-B)}{B-A}.$$ Hence, $$2s\_{n+1}-s\_n\ge 0$$ $$\iff 2\cdot...
$t\_n = (2s\_n - s\_{n-1})$ satisfies $t\_n \geq \frac{t\_{n-1}}{2}$.
9,875,456
One of my customers is experiencing a crash in my WPF application when saving a file. My save file code is: ``` var saveFileDialog = new SaveFileDialog { InitialDirectory = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"\MyApp"), FileName = "MyFile", OverwritePrompt = true, ...
2012/03/26
[ "https://Stackoverflow.com/questions/9875456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672827/" ]
I found that using ``` fullPath = System.IO.Path.GetFullPath(relPath); ``` eliminated the problem for me. Apparently, `FileDialog.ShowDialog` does not like relative `InitialDirectory` values.
Found it. ``` InitialDirectory = string.Concat( Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"\MyApp" ) ``` `Environment.SpecialFolder.MyDocuments` was being returned on my customer's machine with a trailing '\' character, and so the complete concatenated path had a double '\' in it. `...
9,875,456
One of my customers is experiencing a crash in my WPF application when saving a file. My save file code is: ``` var saveFileDialog = new SaveFileDialog { InitialDirectory = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"\MyApp"), FileName = "MyFile", OverwritePrompt = true, ...
2012/03/26
[ "https://Stackoverflow.com/questions/9875456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672827/" ]
Found it. ``` InitialDirectory = string.Concat( Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"\MyApp" ) ``` `Environment.SpecialFolder.MyDocuments` was being returned on my customer's machine with a trailing '\' character, and so the complete concatenated path had a double '\' in it. `...
For those who had the same problem: The exception also happens when `Environment.SpecialFolder.MyDocuments` points to a network drive (domain environment) and it somehow is not reachable. Then `GetFullPath` or `Path.Combine` does not help. I solved it catching the exception and calling ShowDialog a second time after ...
9,875,456
One of my customers is experiencing a crash in my WPF application when saving a file. My save file code is: ``` var saveFileDialog = new SaveFileDialog { InitialDirectory = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"\MyApp"), FileName = "MyFile", OverwritePrompt = true, ...
2012/03/26
[ "https://Stackoverflow.com/questions/9875456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672827/" ]
I found that using ``` fullPath = System.IO.Path.GetFullPath(relPath); ``` eliminated the problem for me. Apparently, `FileDialog.ShowDialog` does not like relative `InitialDirectory` values.
For those who had the same problem: The exception also happens when `Environment.SpecialFolder.MyDocuments` points to a network drive (domain environment) and it somehow is not reachable. Then `GetFullPath` or `Path.Combine` does not help. I solved it catching the exception and calling ShowDialog a second time after ...
65,341
I shoot both 6x6 and 6x7 formats. There are no problems with 6x6 - I cut it as 3,3,3,3 frame pieces to fill a 4-row sleeve and have no problem scanning them in my Nikon 9000. However, if I cut 6x7 film using 3,3,2,2 scheme I'm in trouble: * 3 frame pieces barely fit a sleeve row (can live with it though) * I don't kno...
2015/07/11
[ "https://photo.stackexchange.com/questions/65341", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/27441/" ]
As the author of StolenCameraFinder, I am somewhat biased ;) Both sites have published success stories. Here are [my success stories](http://www.stolencamerafinder.com/successes.jsp), and here is one from [CameraTrace](http://gadgettrak.com/blog/2011/08/photographer-recovers-9k-stolen-camera-equipment-thanks-to-gadget...
Another service to check out is [lenstag](https://www.lenstag.com/gear). It's free, and there is an app for your iOS or Android phone. Apparently it works... [here is a story about a camera being recovered](http://petapixel.com/2014/03/31/exclusive-lenstag-recovers-first-item-stolen-lens-returned-happy-owner/). As an ...
65,341
I shoot both 6x6 and 6x7 formats. There are no problems with 6x6 - I cut it as 3,3,3,3 frame pieces to fill a 4-row sleeve and have no problem scanning them in my Nikon 9000. However, if I cut 6x7 film using 3,3,2,2 scheme I'm in trouble: * 3 frame pieces barely fit a sleeve row (can live with it though) * I don't kno...
2015/07/11
[ "https://photo.stackexchange.com/questions/65341", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/27441/" ]
As the author of StolenCameraFinder, I am somewhat biased ;) Both sites have published success stories. Here are [my success stories](http://www.stolencamerafinder.com/successes.jsp), and here is one from [CameraTrace](http://gadgettrak.com/blog/2011/08/photographer-recovers-9k-stolen-camera-equipment-thanks-to-gadget...
1. CameraTrace only searches for serial numbers on Flickr, 500px, Panoromio, Twitter and Twitpic according to the FAQ, but internet is much larger. 2. StolenCamera only says that their software "crawls the internet searching for photos, collecting the serial numbers of the cameras that took them" - no more information....
65,341
I shoot both 6x6 and 6x7 formats. There are no problems with 6x6 - I cut it as 3,3,3,3 frame pieces to fill a 4-row sleeve and have no problem scanning them in my Nikon 9000. However, if I cut 6x7 film using 3,3,2,2 scheme I'm in trouble: * 3 frame pieces barely fit a sleeve row (can live with it though) * I don't kno...
2015/07/11
[ "https://photo.stackexchange.com/questions/65341", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/27441/" ]
Another service to check out is [lenstag](https://www.lenstag.com/gear). It's free, and there is an app for your iOS or Android phone. Apparently it works... [here is a story about a camera being recovered](http://petapixel.com/2014/03/31/exclusive-lenstag-recovers-first-item-stolen-lens-returned-happy-owner/). As an ...
1. CameraTrace only searches for serial numbers on Flickr, 500px, Panoromio, Twitter and Twitpic according to the FAQ, but internet is much larger. 2. StolenCamera only says that their software "crawls the internet searching for photos, collecting the serial numbers of the cameras that took them" - no more information....
21,563,367
I've looked around and not found quite what I'm looking for. Basically I want a function template specialized by a base class. I don't know how to make it use the specialized function. Meaning... ``` class IBase { public: virtual std::string func() const = 0; }; class MyClass : public IBase { public: std::st...
2014/02/04
[ "https://Stackoverflow.com/questions/21563367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2189130/" ]
Just use an overloaded function instead. ``` std::string get_func(const IBase *t) { return t->func(); } ``` Overloaded functions are always selected before templates.
Using function overloads in the accepted answer to replace function template specialization isn't always a good idea. For the example code in the question, function overloading cannot provide a default implementation which prints "Unknown" for non-specialized classes. Other examples where function overloading is insuff...
599,977
I routinely need to completely erase SD cards. This process is greatly speed up using [SD Memory Card Formatter](https://www.sdcard.org/downloads/formatter/). Unfortunately said program seems to be unavailable under Linux and alternatives (e.g.: `dd` or `shred`) take a LOOOONG time. AFAIK SD/MMC cards have specific ...
2020/07/23
[ "https://unix.stackexchange.com/questions/599977", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/130498/" ]
If you use `dd` correctly it's extremely fast: There is no reason to overwrite the whole card, that will always take a long time, no matter what software you use. You just have to remove the first sectors (partition table): ``` dd if=/dev/zero of=/dev/locationofcard bs=1024 count=1000 ``` A way lower count will als...
SD cards do not need to be formatted. "Formatting" is an old term specific for magnetic disks, where you prepare the tracks and sectors for actual data (they are not defined by disk, but by the head when you format the disk. So formatting is very slow. Now "formatting" is not more such slow process, so it is not reall...
599,977
I routinely need to completely erase SD cards. This process is greatly speed up using [SD Memory Card Formatter](https://www.sdcard.org/downloads/formatter/). Unfortunately said program seems to be unavailable under Linux and alternatives (e.g.: `dd` or `shred`) take a LOOOONG time. AFAIK SD/MMC cards have specific ...
2020/07/23
[ "https://unix.stackexchange.com/questions/599977", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/130498/" ]
Use blkdiscard ============== In short: ``` blkdiscard /dev/mmcblk0 ``` Discussion ---------- To quickly erase an entire SD card, you can use the `blkdiscard`[(8)](https://www.man7.org/linux/man-pages/man8/blkdiscard.8.html) command. This calls the Linux BLKDISCARD ioctl, which in turn passes CMD38, the same as [S...
If you use `dd` correctly it's extremely fast: There is no reason to overwrite the whole card, that will always take a long time, no matter what software you use. You just have to remove the first sectors (partition table): ``` dd if=/dev/zero of=/dev/locationofcard bs=1024 count=1000 ``` A way lower count will als...
599,977
I routinely need to completely erase SD cards. This process is greatly speed up using [SD Memory Card Formatter](https://www.sdcard.org/downloads/formatter/). Unfortunately said program seems to be unavailable under Linux and alternatives (e.g.: `dd` or `shred`) take a LOOOONG time. AFAIK SD/MMC cards have specific ...
2020/07/23
[ "https://unix.stackexchange.com/questions/599977", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/130498/" ]
Just to make the point of the reporter: <https://forum.armbian.com/topic/3776-the-partition-is-not-resized-to-full-sd-card-size/?do=findComment&comment=27413> > > tkaiser > > > Posted March 13, 2017 > > > Regarding 'reserve sectors' and overprovisioning: If a card claims it's n bytes in capacity it has internally...
SD cards do not need to be formatted. "Formatting" is an old term specific for magnetic disks, where you prepare the tracks and sectors for actual data (they are not defined by disk, but by the head when you format the disk. So formatting is very slow. Now "formatting" is not more such slow process, so it is not reall...
599,977
I routinely need to completely erase SD cards. This process is greatly speed up using [SD Memory Card Formatter](https://www.sdcard.org/downloads/formatter/). Unfortunately said program seems to be unavailable under Linux and alternatives (e.g.: `dd` or `shred`) take a LOOOONG time. AFAIK SD/MMC cards have specific ...
2020/07/23
[ "https://unix.stackexchange.com/questions/599977", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/130498/" ]
Use blkdiscard ============== In short: ``` blkdiscard /dev/mmcblk0 ``` Discussion ---------- To quickly erase an entire SD card, you can use the `blkdiscard`[(8)](https://www.man7.org/linux/man-pages/man8/blkdiscard.8.html) command. This calls the Linux BLKDISCARD ioctl, which in turn passes CMD38, the same as [S...
SD cards do not need to be formatted. "Formatting" is an old term specific for magnetic disks, where you prepare the tracks and sectors for actual data (they are not defined by disk, but by the head when you format the disk. So formatting is very slow. Now "formatting" is not more such slow process, so it is not reall...
599,977
I routinely need to completely erase SD cards. This process is greatly speed up using [SD Memory Card Formatter](https://www.sdcard.org/downloads/formatter/). Unfortunately said program seems to be unavailable under Linux and alternatives (e.g.: `dd` or `shred`) take a LOOOONG time. AFAIK SD/MMC cards have specific ...
2020/07/23
[ "https://unix.stackexchange.com/questions/599977", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/130498/" ]
Use blkdiscard ============== In short: ``` blkdiscard /dev/mmcblk0 ``` Discussion ---------- To quickly erase an entire SD card, you can use the `blkdiscard`[(8)](https://www.man7.org/linux/man-pages/man8/blkdiscard.8.html) command. This calls the Linux BLKDISCARD ioctl, which in turn passes CMD38, the same as [S...
Just to make the point of the reporter: <https://forum.armbian.com/topic/3776-the-partition-is-not-resized-to-full-sd-card-size/?do=findComment&comment=27413> > > tkaiser > > > Posted March 13, 2017 > > > Regarding 'reserve sectors' and overprovisioning: If a card claims it's n bytes in capacity it has internally...
3,103,180
I am trying to evaluate $$J(n)=\int\_{-\infty}^{\infty} \frac{\mathrm dx}{\cosh(x)^n}=2\int\_{0}^{\infty} \frac{\mathrm dx}{\cosh(x)^n}$$ for $n\in\Bbb N$. I started with $t=\tanh\frac{x}2$: $$J(n)=4\int\_0^1\frac{(1-t^2)^{n-1}}{(1+t^2)^n}\mathrm dt$$ then I used the binomial theorem to get $$J(n)=4\sum\_{k=0}^{n-1}(-1...
2019/02/06
[ "https://math.stackexchange.com/questions/3103180", "https://math.stackexchange.com", "https://math.stackexchange.com/users/583016/" ]
For a quicker way, substitute $e^x = \tan(\theta/2)$ to obtain $$ \int\_{-\infty}^{\infty} \frac{\mathrm{d}x}{\cosh^n x} = \int\_{0}^{\pi} \sin^{n-1}\theta \, \mathrm{d}\theta = \frac{\Gamma(\frac{n}{2})\Gamma(\frac{1}{2})}{\Gamma(\frac{n+1}{2})}. $$ The second step follows from the beta function identity, although a...
$$J(n)=2\int\_0^\infty \frac{dx}{\cosh^n(x)}$$Using the sub: $u=\frac{1}{\cosh(x)}$ $dx=\frac{-du}{u\sqrt{1-u^2}}$, it is easy to convert the integral into the one @Zacky provided in the comments. $$J(n)=2\int\_0^1 \frac{u^{n-1}}{\sqrt{1-u^2}}du$$ From there we can make another sub $u=\sqrt{x}$, $du=\frac{dx}{2\sqrt{x}...
57,870,203
I want to use Navigation component in my android project, in order to achieve this, I have refactored my app to be fragment-based, but it raises a problem that I don't know how to pass `onNewIntent()` in my `MainActivity` to my Navigation Fragments. So `MainActivity` is a `NavHost`, to make it simple, saying that I ha...
2019/09/10
[ "https://Stackoverflow.com/questions/57870203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11076656/" ]
On new intent , you can do something like ``` val navigationController = nav_host_fragment.findNavController() if (navigationController.currentDestination?.id == R.id.fragmentA) { (nav_host_fragment.childFragmentManager.fragments[0] as FragmentA).doSomething() } ``` Here you can pass any value...
You can use in MainAcitivy class this: ``` private Fragment fragment; fragment = new FragmentTry(); getSupportFragmentManager() .beginTransaction() .replace(R.id.fragmentid, fragment) .commit(); ```
1,154,448
All the applications I have ever seen, that use UINavigationBars, have the UINavigationBar right at the top of the app. If you want to use a UISearchBar then it's usually in the 'header' of the UITableView such as this... [addressbook http://www.freeimagehosting.net/uploads/d715f77301.png](http://www.freeimagehosting....
2009/07/20
[ "https://Stackoverflow.com/questions/1154448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135537/" ]
So I re-thought my layout and design, and then realised I didn't have to include the search bar in the table view header. The table UISearchBar sits above the UITableView and doesn't scroll. Winner winner chicken dinner.
You should be able to add the search bar and the navigation view to a root view/controller, and then manage the flow from there. Might end up in a complex flow though, so I'd only do this if that change in layout is really that important to you.
10,971,810
Hello I am writing an Android app and I have set up Proguard to obfuscate my application. I however use a classloader to dynamically load different extensions to my application. The problem is that these don't load correctly if their names are changed. How do I keep Proguard from obfuscating specific class names?
2012/06/10
[ "https://Stackoverflow.com/questions/10971810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1202634/" ]
Use the `-keepnames` option in your proguard.cfg Refer to the manual <https://www.guardsquare.com/manual/configuration/usage#keepoptions> > > `-keepnames` class\_specification > > > Short for `-keep,allowshrinking` class\_specification > > > Specifies classes and class members whose names are to be preserved, if...
This keeps classnames intact: ``` -keepnames class com.somepackage.* ```
10,971,810
Hello I am writing an Android app and I have set up Proguard to obfuscate my application. I however use a classloader to dynamically load different extensions to my application. The problem is that these don't load correctly if their names are changed. How do I keep Proguard from obfuscating specific class names?
2012/06/10
[ "https://Stackoverflow.com/questions/10971810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1202634/" ]
Use the `-keepnames` option in your proguard.cfg Refer to the manual <https://www.guardsquare.com/manual/configuration/usage#keepoptions> > > `-keepnames` class\_specification > > > Short for `-keep,allowshrinking` class\_specification > > > Specifies classes and class members whose names are to be preserved, if...
Handy tip for everyone who does not want ProGuard to change **any** class name: ``` # please KEEP ALL THE NAMES -keepnames class ** { *; } ``` This way you will get readable stack traces while still throwing out things you don't need. :-)
10,971,810
Hello I am writing an Android app and I have set up Proguard to obfuscate my application. I however use a classloader to dynamically load different extensions to my application. The problem is that these don't load correctly if their names are changed. How do I keep Proguard from obfuscating specific class names?
2012/06/10
[ "https://Stackoverflow.com/questions/10971810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1202634/" ]
Use the `-keepnames` option in your proguard.cfg Refer to the manual <https://www.guardsquare.com/manual/configuration/usage#keepoptions> > > `-keepnames` class\_specification > > > Short for `-keep,allowshrinking` class\_specification > > > Specifies classes and class members whose names are to be preserved, if...
If anyone is interested how to specify multiple class names to keep, then these classes can be separated by a comma. Example: ``` -keepnames class com.foo.**,com.bar.** { *; } ``` It is also possible to use negation with this because usually only own classes would be obfuscated and 3rd party libraries can be kept: ...
10,971,810
Hello I am writing an Android app and I have set up Proguard to obfuscate my application. I however use a classloader to dynamically load different extensions to my application. The problem is that these don't load correctly if their names are changed. How do I keep Proguard from obfuscating specific class names?
2012/06/10
[ "https://Stackoverflow.com/questions/10971810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1202634/" ]
This keeps classnames intact: ``` -keepnames class com.somepackage.* ```
Handy tip for everyone who does not want ProGuard to change **any** class name: ``` # please KEEP ALL THE NAMES -keepnames class ** { *; } ``` This way you will get readable stack traces while still throwing out things you don't need. :-)
10,971,810
Hello I am writing an Android app and I have set up Proguard to obfuscate my application. I however use a classloader to dynamically load different extensions to my application. The problem is that these don't load correctly if their names are changed. How do I keep Proguard from obfuscating specific class names?
2012/06/10
[ "https://Stackoverflow.com/questions/10971810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1202634/" ]
This keeps classnames intact: ``` -keepnames class com.somepackage.* ```
If anyone is interested how to specify multiple class names to keep, then these classes can be separated by a comma. Example: ``` -keepnames class com.foo.**,com.bar.** { *; } ``` It is also possible to use negation with this because usually only own classes would be obfuscated and 3rd party libraries can be kept: ...
10,971,810
Hello I am writing an Android app and I have set up Proguard to obfuscate my application. I however use a classloader to dynamically load different extensions to my application. The problem is that these don't load correctly if their names are changed. How do I keep Proguard from obfuscating specific class names?
2012/06/10
[ "https://Stackoverflow.com/questions/10971810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1202634/" ]
Handy tip for everyone who does not want ProGuard to change **any** class name: ``` # please KEEP ALL THE NAMES -keepnames class ** { *; } ``` This way you will get readable stack traces while still throwing out things you don't need. :-)
If anyone is interested how to specify multiple class names to keep, then these classes can be separated by a comma. Example: ``` -keepnames class com.foo.**,com.bar.** { *; } ``` It is also possible to use negation with this because usually only own classes would be obfuscated and 3rd party libraries can be kept: ...
33,166,124
I want to implement material design in android for versions lower than lollipop but i dont know whether it is possible? If it is possible then can someone help me on how to implement material design for kitkat and lower versions? Please help providing some reference material to implement material design for kitkat or ...
2015/10/16
[ "https://Stackoverflow.com/questions/33166124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5303944/" ]
Here is a very usefull [link](http://inthecheesefactory.com/blog/android-design-support-library-codelab/en?utm_source=Android%20Weekly&utm_campaign=404735061d-Android_Weekly_159&utm_medium=email&utm_term=0_4eb677ad19-404735061d-337832373) about using the support library. I hope it will help you.
Design Support library is what you are looking for! Below link we help you get started.. <http://android-developers.blogspot.in/2015/05/android-design-support-library.html> Go through all the components introduced in the library and for the detailed know how you could google search each and every component as pe...
25,326,874
I want to use beautifulsoup to get multiple tags and attributes from following HTML 1)div id= home\_1039509 2)div id="guest\_1039509 3)id="odds\_3\_1039509 4)id="gs\_1039509 5)id="hs\_1039509 6)id="time\_1039509 HTML: ``` <tr align="center" height="15" id="tr_1039509" bgcolor="#F7F3F7" index="0"> <td widt...
2014/08/15
[ "https://Stackoverflow.com/questions/25326874", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can pass [a function](http://www.crummy.com/software/BeautifulSoup/bs4/doc/#a-function) and check if `id` [starts with](https://docs.python.org/2/library/stdtypes.html#str.startswith) `home_`, `guest_` etc: ``` from bs4 import BeautifulSoup f = lambda x: x and x.startswith(('home_', 'guest_', 'odds_', 'gs_', 'hs_...
You can get list of **cols** like ``` import re from bs4 import BeautifulSoup soup = BeautifulSoup(html) soup.find_all(["div", "span"], id=re.compile('[home|guest|odds_3|gs|hs|time]_\d+')) ``` regex above just an example In your case it can be ``` cols = tr.find_all(["div", "span"], id=re.compile('[home|guest|odd...
3,499,003
The question here is: "Find the PDF of e^x in terms of PDF of X. Specialize the answer to the case where X is uniformly distributed between 0 and 1 (Problem 4.1 of the book "Introduction to Probability, 2nd edition"). Using the fact that px(x) is 1/2 (1/(1-0+1) = 1/2), I come out with 1/2y for fy(y). However, the solut...
2020/01/06
[ "https://math.stackexchange.com/questions/3499003", "https://math.stackexchange.com", "https://math.stackexchange.com/users/676553/" ]
Let $f(x)=\int\_0^{x}\frac {t^{2}} {1+t^{4}} dt-2x+1$. Let us show that $f(0) >0, f(1) <0$ and $f$ is strictly decreasing. These facts would imply that $f(x)=0$ for exactly one value of $x$. $f(0) >0$ is obvious. $f(1)= \int\_0^{1}\frac {t^{2}} {1+t^{4}}dt -1<\int\_0^{1}1 dt -1=0$ (since $(t^{2}-1)^{2} \geq 0$ so $t^{...
**Hint**: Notice, that: $$\int\frac{x^2dx}{x^4+1}= \frac{1}{2}\int\frac{2x}{x^4+1}xdx$$ Now knowing, that $\frac{d}{dx}x=1$ and $\frac{d}{dx}\arctan{x^2}=\frac{2x}{x^4+1}$, we can solve it by parts.
3,499,003
The question here is: "Find the PDF of e^x in terms of PDF of X. Specialize the answer to the case where X is uniformly distributed between 0 and 1 (Problem 4.1 of the book "Introduction to Probability, 2nd edition"). Using the fact that px(x) is 1/2 (1/(1-0+1) = 1/2), I come out with 1/2y for fy(y). However, the solut...
2020/01/06
[ "https://math.stackexchange.com/questions/3499003", "https://math.stackexchange.com", "https://math.stackexchange.com/users/676553/" ]
**Hint**: Notice, that: $$\int\frac{x^2dx}{x^4+1}= \frac{1}{2}\int\frac{2x}{x^4+1}xdx$$ Now knowing, that $\frac{d}{dx}x=1$ and $\frac{d}{dx}\arctan{x^2}=\frac{2x}{x^4+1}$, we can solve it by parts.
$x \in [0,1]$; $F(x):=\displaystyle{\int\_{0}^{x}}\dfrac{t^2}{1+t^4}dt -2x+1$; 1) $F'(x)=\dfrac{x^2}{1+x^4} -2 < x^2-2<$ $1-2<0$; Since $F$ is decreasing there is at most one zero in $[0,1]$. 2) $F(1)< \displaystyle{\int\_{0}^{1}}t^2dt -1=-2/3$; $(1/2)\displaystyle{\int\_{0}^{1}}t^2dt-1=$ $(1/6)-1=-5/6<F(1)$, i....
3,499,003
The question here is: "Find the PDF of e^x in terms of PDF of X. Specialize the answer to the case where X is uniformly distributed between 0 and 1 (Problem 4.1 of the book "Introduction to Probability, 2nd edition"). Using the fact that px(x) is 1/2 (1/(1-0+1) = 1/2), I come out with 1/2y for fy(y). However, the solut...
2020/01/06
[ "https://math.stackexchange.com/questions/3499003", "https://math.stackexchange.com", "https://math.stackexchange.com/users/676553/" ]
**Hint**: Notice, that: $$\int\frac{x^2dx}{x^4+1}= \frac{1}{2}\int\frac{2x}{x^4+1}xdx$$ Now knowing, that $\frac{d}{dx}x=1$ and $\frac{d}{dx}\arctan{x^2}=\frac{2x}{x^4+1}$, we can solve it by parts.
Actually you do not need to perform any explicit computation. $\frac{x^2}{1+x^4}=\frac{d}{dx}\int\_{0}^{x}\frac{t^2}{1+t^4}\,dt$ is an increasing function over $[0,1]$ and it is bounded between $0$ and $\frac{1}{2}$, so $f(x)=\int\_{0}^{x}\frac{t^2}{1+t^4}\,dt$ is a non-negative, increasing and convex function over $[0...
3,499,003
The question here is: "Find the PDF of e^x in terms of PDF of X. Specialize the answer to the case where X is uniformly distributed between 0 and 1 (Problem 4.1 of the book "Introduction to Probability, 2nd edition"). Using the fact that px(x) is 1/2 (1/(1-0+1) = 1/2), I come out with 1/2y for fy(y). However, the solut...
2020/01/06
[ "https://math.stackexchange.com/questions/3499003", "https://math.stackexchange.com", "https://math.stackexchange.com/users/676553/" ]
Let $f(x)=\int\_0^{x}\frac {t^{2}} {1+t^{4}} dt-2x+1$. Let us show that $f(0) >0, f(1) <0$ and $f$ is strictly decreasing. These facts would imply that $f(x)=0$ for exactly one value of $x$. $f(0) >0$ is obvious. $f(1)= \int\_0^{1}\frac {t^{2}} {1+t^{4}}dt -1<\int\_0^{1}1 dt -1=0$ (since $(t^{2}-1)^{2} \geq 0$ so $t^{...
$x \in [0,1]$; $F(x):=\displaystyle{\int\_{0}^{x}}\dfrac{t^2}{1+t^4}dt -2x+1$; 1) $F'(x)=\dfrac{x^2}{1+x^4} -2 < x^2-2<$ $1-2<0$; Since $F$ is decreasing there is at most one zero in $[0,1]$. 2) $F(1)< \displaystyle{\int\_{0}^{1}}t^2dt -1=-2/3$; $(1/2)\displaystyle{\int\_{0}^{1}}t^2dt-1=$ $(1/6)-1=-5/6<F(1)$, i....
3,499,003
The question here is: "Find the PDF of e^x in terms of PDF of X. Specialize the answer to the case where X is uniformly distributed between 0 and 1 (Problem 4.1 of the book "Introduction to Probability, 2nd edition"). Using the fact that px(x) is 1/2 (1/(1-0+1) = 1/2), I come out with 1/2y for fy(y). However, the solut...
2020/01/06
[ "https://math.stackexchange.com/questions/3499003", "https://math.stackexchange.com", "https://math.stackexchange.com/users/676553/" ]
Let $f(x)=\int\_0^{x}\frac {t^{2}} {1+t^{4}} dt-2x+1$. Let us show that $f(0) >0, f(1) <0$ and $f$ is strictly decreasing. These facts would imply that $f(x)=0$ for exactly one value of $x$. $f(0) >0$ is obvious. $f(1)= \int\_0^{1}\frac {t^{2}} {1+t^{4}}dt -1<\int\_0^{1}1 dt -1=0$ (since $(t^{2}-1)^{2} \geq 0$ so $t^{...
Actually you do not need to perform any explicit computation. $\frac{x^2}{1+x^4}=\frac{d}{dx}\int\_{0}^{x}\frac{t^2}{1+t^4}\,dt$ is an increasing function over $[0,1]$ and it is bounded between $0$ and $\frac{1}{2}$, so $f(x)=\int\_{0}^{x}\frac{t^2}{1+t^4}\,dt$ is a non-negative, increasing and convex function over $[0...
36,092,943
I am currently working on a web application to feature the interface in django and how the content loads. In my database, potentially thousands of these entries, and I want to make sure that only has to load a given number at a time to reduce stress on the servers etc. lets say I have 5000 records and initially Load ...
2016/03/18
[ "https://Stackoverflow.com/questions/36092943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5996047/" ]
I believe this combines the django pagination, but utilizes it in an ajax function to add to the existing page without a reload: <http://django-endless-pagination.readthedocs.org/en/latest/twitter_pagination.html>
For Django 1.8 and above use: **Django EL(Endless) Pagination:** > > This app django-el-pagination created from > django-endless-pagination==2.0. > > > <https://github.com/shtalinberg/django-el-pagination> **Django Endless Pagination** says: > > This project is abandoned. > > > Thanks to the community tha...
1,650,797
I got bit hard by this today: ``` function mk_input( name, val ) { var inp = document.createElement( 'input' ); inp.name = name; inp.value = val; inp.type = 'hidden'; return inp; } ``` As it turns out, setting the `name` of an element created via `createElement` doesn't work in IE. It doesn't ca...
2009/10/30
[ "https://Stackoverflow.com/questions/1650797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20745/" ]
Just to re-iterate the problem: in IE, programatically setting the `name` attribute on an element created via `document.createElement('input')` is not reflected in `getElementsByName`, `form.elements` (if appending to a form), and is not submitted with the `form` (again, if appending to a form) [[Reference](http://webb...
They fixed this in IE8. In previous versions, you need to include the name when you call createElement. From [MSDN](http://msdn.microsoft.com/en-us/library/aa703821(VS.85).aspx): > > Internet Explorer 8 and later can set > the NAME attribute at run time on > elements dynamically created with the > IHTMLDocument2::...
186,114
I'm not much of a unix guy so I'll just go ahead and ask: I have a following problem - two folders with plenty of subfolders. I need to diff them. I tried this: ``` diff -drupN vanila_kernel_3.0.8 my_kernel_3.0.8 > kernel.patch ``` and that results in a 85mb file... and not really what I want. I want the result o...
2012/09/10
[ "https://askubuntu.com/questions/186114", "https://askubuntu.com", "https://askubuntu.com/users/88679/" ]
You can use the original format that creates the huge diff file which you can subsequently split into the small files. You might be interested in `csplit` for the splitting, or you can use a scripting language like Perl: ``` perl -ne 'if(/^diff -drupN (.*) (.*)/) { my $f = $1; $f =~ s{/}{_}...
I have wrote a small Perl script to patch the files. This script is very basic, which goes through the directories recursively and fetch the file and creates a diff. ``` Usage: script_name.pl <source_dir> <dest_dir> <dir_2_create_diffs> ``` testpatch.pl ``` #!/usr/bin/perl use File::Find; my $source = $ARGV[0]; my...
1,301,513
I got this question from a student of mine, who is participating in a math olympiad competition: How can we construct a point D in a triangle ABC such that $\angle DAB= \angle DBC= \angle DCA$? I've tried with the most common points such as barycenter or orthocenter, but nothing. I appreciate any hint. Thanks in advanc...
2015/05/27
[ "https://math.stackexchange.com/questions/1301513", "https://math.stackexchange.com", "https://math.stackexchange.com/users/24362/" ]
draw a line $l$ at $A$ that is perpendicular to $AB.$ draw perpendicular bisector $m$ of the side $AC.$ let the lines cut at $B'.$ now draw a circle $\beta$ with center $B'$ and radius $B'A = B'C.$ the circle $\beta$ is tangent to the side $AB$ and goes through $C.$ in addition, if $D$ is point inside the triangle $ABC...
Construct an equilateral triangle on the outside of two of the edges and find its midpoint. Use this to draw an arc through the two associated vertices of your original triangle. Repeat this for another side of the triangle ABC. The required point D is at the intersection of these two arcs. ![enter image description h...
1,301,513
I got this question from a student of mine, who is participating in a math olympiad competition: How can we construct a point D in a triangle ABC such that $\angle DAB= \angle DBC= \angle DCA$? I've tried with the most common points such as barycenter or orthocenter, but nothing. I appreciate any hint. Thanks in advanc...
2015/05/27
[ "https://math.stackexchange.com/questions/1301513", "https://math.stackexchange.com", "https://math.stackexchange.com/users/24362/" ]
You are asking for so called Brocard's point of the triangle. One of constructions can be found on Wikipedia: <http://en.m.wikipedia.org/wiki/Brocard_points>
draw a line $l$ at $A$ that is perpendicular to $AB.$ draw perpendicular bisector $m$ of the side $AC.$ let the lines cut at $B'.$ now draw a circle $\beta$ with center $B'$ and radius $B'A = B'C.$ the circle $\beta$ is tangent to the side $AB$ and goes through $C.$ in addition, if $D$ is point inside the triangle $ABC...
1,301,513
I got this question from a student of mine, who is participating in a math olympiad competition: How can we construct a point D in a triangle ABC such that $\angle DAB= \angle DBC= \angle DCA$? I've tried with the most common points such as barycenter or orthocenter, but nothing. I appreciate any hint. Thanks in advanc...
2015/05/27
[ "https://math.stackexchange.com/questions/1301513", "https://math.stackexchange.com", "https://math.stackexchange.com/users/24362/" ]
You are asking for so called Brocard's point of the triangle. One of constructions can be found on Wikipedia: <http://en.m.wikipedia.org/wiki/Brocard_points>
Construct an equilateral triangle on the outside of two of the edges and find its midpoint. Use this to draw an arc through the two associated vertices of your original triangle. Repeat this for another side of the triangle ABC. The required point D is at the intersection of these two arcs. ![enter image description h...
56,756,977
Using `cell_spec` it is possible to conditionally format numeric cells in a `kable` table based on value, but is there a way to format cells based on patterns within a string? ``` library(dplyr) library(kableExtra) df <- data.frame(x = c("bbb", "bba", "bbb"), y = c(-7, -7, 7)) %>% mutate(x = cell_spec(x, "html", co...
2019/06/25
[ "https://Stackoverflow.com/questions/56756977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9704976/" ]
Try out this method, string manipulation is not abused (I think). The method extracts the Query part, selects the values of the Key specified except the values to remove, then rebuilds the Query using the [UriBuilder.Query](https://learn.microsoft.com/en-us/dotnet/api/system.uribuilder.query) property (which can be s...
You can use the [GetValues(String)](https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.namevaluecollection.getvalues?view=netframework-4.8#System_Collections_Specialized_NameValueCollection_GetValues_System_String_) method to get an array of the values. You can then create a new list or whateve...
47,703,592
I can't figure out how to complete this function. I have filtered through to find the variable that matches the id but now I need to match that item to the delItem var and delete it. ``` function deleteToDo(tot) { let delItem = toDos.filter((remove) => remove.id === tot); /// i need to remove item from t...
2017/12/07
[ "https://Stackoverflow.com/questions/47703592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8062018/" ]
Array#filter returns an array, with all items that match the predicate. Instead of getting the item that you want to remove, get an array without the item by checking that the `id` is not equal to `tot`. Then use the filtered array in `renderTheUI`: ``` function deleteToDo(tot) { const filteredToDos = toDos.filter((...
You do not need to find the element with `filter` but its index in the array. ``` function deleteToDo(tot) { let delIndex = toDos.findIndex((remove) => remove.id === tot); if (delIndex !== -1){ // if element was found toDos.splice(delIndex,1); // remove the element from the toDos array } rend...
5,293,699
Im trying to make a quite simple game but its having an error. I have three forms. bounce, ball and Option in the option form I have 3 radiobuttons . Easy, medium and hard. But when im trying to get my If to work in bounce. I get an error under easyradio that says 'bounce.options.easyradio' is inaccessible due its pr...
2011/03/14
[ "https://Stackoverflow.com/questions/5293699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658073/" ]
Html5 is the latest version of html. So if you know html you know a lot of html5. Html5 adds new features to html like location awareness, audio, video and canvases. We would need to know more information about what specific part of html5 you are considering to tell you how it would work. But just about anything you do...
That all depends on wether or not you are planning to actually use HTML5 features. There certainly is a strong case for HTML5 when building Javascript games with features like localStorage, WebSQL and Canvas. But if you don't plan on using there technologies you might as well stick with the technologies you are using r...
5,293,699
Im trying to make a quite simple game but its having an error. I have three forms. bounce, ball and Option in the option form I have 3 radiobuttons . Easy, medium and hard. But when im trying to get my If to work in bounce. I get an error under easyradio that says 'bounce.options.easyradio' is inaccessible due its pr...
2011/03/14
[ "https://Stackoverflow.com/questions/5293699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658073/" ]
It is never logical to use every feature of a technology just because you can. There may be some features in HTML 5 that can help you — for example, local storage and offline support in particular might be nice for regular users, since they'll allow your game to work even without a network connection.
That all depends on wether or not you are planning to actually use HTML5 features. There certainly is a strong case for HTML5 when building Javascript games with features like localStorage, WebSQL and Canvas. But if you don't plan on using there technologies you might as well stick with the technologies you are using r...
5,293,699
Im trying to make a quite simple game but its having an error. I have three forms. bounce, ball and Option in the option form I have 3 radiobuttons . Easy, medium and hard. But when im trying to get my If to work in bounce. I get an error under easyradio that says 'bounce.options.easyradio' is inaccessible due its pr...
2011/03/14
[ "https://Stackoverflow.com/questions/5293699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658073/" ]
Html5 is the latest version of html. So if you know html you know a lot of html5. Html5 adds new features to html like location awareness, audio, video and canvases. We would need to know more information about what specific part of html5 you are considering to tell you how it would work. But just about anything you do...
Take a look at <http://www.w3.org/TR/html5-diff/#new-elements> to decide whether HTML 5 has enough new features useful to you to make it harder for people using old browsers. Be aware though that most modern browsers have only implemented bits of HTML 5. The `video` and `audio` tags are relevant to games but browser i...
5,293,699
Im trying to make a quite simple game but its having an error. I have three forms. bounce, ball and Option in the option form I have 3 radiobuttons . Easy, medium and hard. But when im trying to get my If to work in bounce. I get an error under easyradio that says 'bounce.options.easyradio' is inaccessible due its pr...
2011/03/14
[ "https://Stackoverflow.com/questions/5293699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658073/" ]
It is never logical to use every feature of a technology just because you can. There may be some features in HTML 5 that can help you — for example, local storage and offline support in particular might be nice for regular users, since they'll allow your game to work even without a network connection.
Take a look at <http://www.w3.org/TR/html5-diff/#new-elements> to decide whether HTML 5 has enough new features useful to you to make it harder for people using old browsers. Be aware though that most modern browsers have only implemented bits of HTML 5. The `video` and `audio` tags are relevant to games but browser i...
5,293,699
Im trying to make a quite simple game but its having an error. I have three forms. bounce, ball and Option in the option form I have 3 radiobuttons . Easy, medium and hard. But when im trying to get my If to work in bounce. I get an error under easyradio that says 'bounce.options.easyradio' is inaccessible due its pr...
2011/03/14
[ "https://Stackoverflow.com/questions/5293699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658073/" ]
Html5 is the latest version of html. So if you know html you know a lot of html5. Html5 adds new features to html like location awareness, audio, video and canvases. We would need to know more information about what specific part of html5 you are considering to tell you how it would work. But just about anything you do...
I choose to stick to html and javascript and use cookies to store my data.
5,293,699
Im trying to make a quite simple game but its having an error. I have three forms. bounce, ball and Option in the option form I have 3 radiobuttons . Easy, medium and hard. But when im trying to get my If to work in bounce. I get an error under easyradio that says 'bounce.options.easyradio' is inaccessible due its pr...
2011/03/14
[ "https://Stackoverflow.com/questions/5293699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658073/" ]
It is never logical to use every feature of a technology just because you can. There may be some features in HTML 5 that can help you — for example, local storage and offline support in particular might be nice for regular users, since they'll allow your game to work even without a network connection.
Html5 is the latest version of html. So if you know html you know a lot of html5. Html5 adds new features to html like location awareness, audio, video and canvases. We would need to know more information about what specific part of html5 you are considering to tell you how it would work. But just about anything you do...
5,293,699
Im trying to make a quite simple game but its having an error. I have three forms. bounce, ball and Option in the option form I have 3 radiobuttons . Easy, medium and hard. But when im trying to get my If to work in bounce. I get an error under easyradio that says 'bounce.options.easyradio' is inaccessible due its pr...
2011/03/14
[ "https://Stackoverflow.com/questions/5293699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/658073/" ]
It is never logical to use every feature of a technology just because you can. There may be some features in HTML 5 that can help you — for example, local storage and offline support in particular might be nice for regular users, since they'll allow your game to work even without a network connection.
I choose to stick to html and javascript and use cookies to store my data.
34,564,203
I am having this issue since last some days i have tried lot. I have found many solution but none of it works. I have also tried to reinstall Android Studio and SDK. I have updated SDK too. Still same error. Here is the Error Which I got when App Crash. ``` ATAL EXCEPTION: IntentService[GCMRegistrationService] Proc...
2016/01/02
[ "https://Stackoverflow.com/questions/34564203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2417081/" ]
There must be some issue with your SDK, remove your current SDK fully and Reinstall it and Update your node-js and phoneGap version.
Finally After long research i found the solution. Issue was due to Facebook Plugin. As its using old jar files to it was creating problems. Here is the steps I follow. Hope fully it help someone else. 1. Update All the Sdk. 2. Add Push Plugin. And Remove existing Facebook plugin (if you have) 3. Now install This Face...
22,536
If I have the spectrogram and waveform of a clip of audio what sort of information can I gather by looking at those two things?
2013/01/20
[ "https://sound.stackexchange.com/questions/22536", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/-1/" ]
I'll start from the very beginning: sine signals. ![(from wikipedia)](https://i.stack.imgur.com/IRN61.png) Also known as pure tones, these kind of signals are periodic (i.e. repeat the same pattern over and over again). Anything that is periodic can be said to have a **frequency**, which is in fact f=1/T, being T the...
Here below is an image of a waveform (top part) and a spectogram (lower part). ![enter image description here](https://i.stack.imgur.com/cLcLe.gif) Waveform -------- This is a two-dimensional graph where the amplitude of the signal (your audio) is shown over time. The amplitude is interpreted as the volume, so you s...
44,587,800
I use javascript to read an large image and append to the document, the image is vertical, with the size of 3024 \* 4032: [![Here is the original image](https://i.stack.imgur.com/a2q7B.png)](https://i.stack.imgur.com/a2q7B.png) here was my code: ``` var image = new Image() image.onload = function () { var width = ...
2017/06/16
[ "https://Stackoverflow.com/questions/44587800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4715721/" ]
You can rotate your image: ```js let image = new Image() image.onload = function (e) { let width = image.width; let height = image.height; document.body.appendChild(image); let el = e ? e.target : window.event.srcElement; el.style.transform = 'rotate(+90deg)'; console.log('width: ' + wid...
You can either change the image's meta information so the browser displays it in the correct orientation, or use CSS `transform` to rotate the image. ``` img{ -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotat...
44,587,800
I use javascript to read an large image and append to the document, the image is vertical, with the size of 3024 \* 4032: [![Here is the original image](https://i.stack.imgur.com/a2q7B.png)](https://i.stack.imgur.com/a2q7B.png) here was my code: ``` var image = new Image() image.onload = function () { var width = ...
2017/06/16
[ "https://Stackoverflow.com/questions/44587800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4715721/" ]
Thanks for the answer from @jonLuci , this library fixed my issue: <https://github.com/blueimp/JavaScript-Load-Image> and I update my code as bellow: ``` var imageUrl = 'images/01vertical.jpg' loadImage( imageUrl, function (img) { if (img.type === 'error') { console.log('Error loading image ' + imageUrl...
You can either change the image's meta information so the browser displays it in the correct orientation, or use CSS `transform` to rotate the image. ``` img{ -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotat...