qid
int64
1
74.6M
question
stringlengths
45
24.2k
date
stringlengths
10
10
metadata
stringlengths
101
178
response_j
stringlengths
32
23.2k
response_k
stringlengths
21
13.2k
13,140,659
I have developed an app using Phonegap for Android and IPhone. Is there how to programm the functionality with the Phonegap Framework to share a URL to twitter and Facebook for Android and IPhone? Thanks
2012/10/30
['https://Stackoverflow.com/questions/13140659', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1551880/']
This is really amazing for iOS. Its working with Phonegap Cordova 2.3 <https://github.com/bfcam/phonegap-ios-social-plugin> For Android I'm using Android Share Plugin <https://github.com/phonegap/phonegap-plugins/tree/master/Android/Share>
Currently the best cross-platform social share widget is [this one](https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin) which is also [available on PhoneGap Build!](https://build.phonegap.com/plugins/382) It not only supports sharing via the native share widget, but you can also share directly to Facebook...
49,191,902
I have log data and I'm trying to back-fill the data as much as possible to help improve analytics. The log data contains a SessionId, which is the SessionId created by the browser, the Name of the logged in user (if they are logged in) and a LogTime. I'm trying to get all the related sessions, sessions that are with...
2018/03/09
['https://Stackoverflow.com/questions/49191902', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1070816/']
You haven't told the div how to handle the overflow caused by the width of the inner element. Add `overflow: auto`. ```css body { margin: 0; } .wrapper { background: yellow; overflow: auto; } h1 { width: 2000px; border: 2px solid red; } ``` ```html <!doctype html> <html> <body> <div class="wrapper"> ...
Yeah, you can use `width: fit-content;` [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/width) describes it as; > > **fit-content** > > The larger of: > > > * the intrinsic minimum width > * the smaller of the intrinsic preferred width and the available width > > > It works as expected; the contain...
49,191,902
I have log data and I'm trying to back-fill the data as much as possible to help improve analytics. The log data contains a SessionId, which is the SessionId created by the browser, the Name of the logged in user (if they are logged in) and a LogTime. I'm trying to get all the related sessions, sessions that are with...
2018/03/09
['https://Stackoverflow.com/questions/49191902', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1070816/']
Let's start with this: > > But the problem is, the parent **div.wrapper** does **not expand** to the > **width** of its contents – its yellow background only extends as far as > the width of the viewport. > > > By default a div is a block element and a block element takes up the **whole width** of it's parent c...
You haven't told the div how to handle the overflow caused by the width of the inner element. Add `overflow: auto`. ```css body { margin: 0; } .wrapper { background: yellow; overflow: auto; } h1 { width: 2000px; border: 2px solid red; } ``` ```html <!doctype html> <html> <body> <div class="wrapper"> ...
49,191,902
I have log data and I'm trying to back-fill the data as much as possible to help improve analytics. The log data contains a SessionId, which is the SessionId created by the browser, the Name of the logged in user (if they are logged in) and a LogTime. I'm trying to get all the related sessions, sessions that are with...
2018/03/09
['https://Stackoverflow.com/questions/49191902', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1070816/']
Let's start with this: > > But the problem is, the parent **div.wrapper** does **not expand** to the > **width** of its contents – its yellow background only extends as far as > the width of the viewport. > > > By default a div is a block element and a block element takes up the **whole width** of it's parent c...
Yeah, you can use `width: fit-content;` [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/width) describes it as; > > **fit-content** > > The larger of: > > > * the intrinsic minimum width > * the smaller of the intrinsic preferred width and the available width > > > It works as expected; the contain...
72,750
I want to write an Arduino code, that runs on several different Boards. The code can perform digitalRead/Write operations, but the pin number will be set from the user/outside. I want to include a check, if the selected pin exists. Is it possible, to read the amount of I/Os (digital and analog) of the Arduino the cod...
2020/02/24
['https://arduino.stackexchange.com/questions/72750', 'https://arduino.stackexchange.com', 'https://arduino.stackexchange.com/users/61344/']
It depends on the core, but most provide the macro `NUM_DIGITAL_PINS` which tells you the number of digital pins the board has. In general this doesn't equate to the actual number, but to one more than the highest number (there are boards with gaps in the pin number sequence). So you can use: ``` if (pinNumber < NUM_...
The number of the GPIO pins available depends on how the chip is wired on the Arduino Board and which microcontroller one is running on. For example, an Arduino Uno with a ATMega328p chip has 14 Digital I/O pins, whereas an Arduino Mega 2560 with a chip has 54 digital I/O pins.
10,754,359
I am posting this because i couldn't understand a bit how the boost tutorials work. I have a class whose objects are elements of a boost multi\_index container. I need to update the member variables of objects using member functions. I don't know how to do that. could you help me please. I prepared a simple example: ...
2012/05/25
['https://Stackoverflow.com/questions/10754359', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/805896/']
The solution you posted won't work: at best it'll get a garbled index and at worst your app will crash. As your last index depends on `employee_entry::id_`, you just cannot change it liberally because you're implicitly breaking the index order. For this kind of stuff Boost.MultiIndex provides updating functions `replac...
well, I am answering my question at least to debug the above mentioned code. My main concern was discussed and answered in the comments below the question. I the following code, I made `long id_` as `mutable` and changed `void change(){...}` to `void change()const{...}` ``` #include <string> #include <iostream> #inclu...
18,997
In einem englischsprachigen philosophischen Artikel von Iris Marion Young, über den ich in einem Seminar sprechen werde, heißt ein Abschnitt "Parameters of Reasoning". Wie würde das ins Deutsche übersetzt? Alle Möglichkeiten scheinen mir zu mathematisch zu sein. In dem Text ("Responsibility and Global Justice") schläg...
2015/01/06
['https://german.stackexchange.com/questions/18997', 'https://german.stackexchange.com', 'https://german.stackexchange.com/users/8769/']
Der Text ist [hier](https://books.google.de/books?id=aaNgZrMdx-UC&pg=PA144&lpg=PA144&dq=%22parameters%20of%20reasoning%22&source=bl&ots=JXHyfZL_dh&sig=beDdi6Gdmiy5U1awWf-sbba3QsI&hl=de&sa=X&ei=Z-KrVLHPEYbkUuiZgPAO&ved=0CE0Q6AEwBg#v=onepage&q=%22parameters%20of%20reasoning%22&f=false) und die vier Parameter sind: power,...
> > Die Grenzen der Vernunft > > > is my suggestion.
21,280,535
i have made a mistake of re-inventing the wheel. There are options but somehow i like the feel of this. Sorry but don't have enough rep to post an image. This is how the form looks like: SNO.-------ITEMS--------FROM--------TO---------QUANTITY // labels [ 1 ]-------[-----------▼]---[--------]----[--------]------[----...
2014/01/22
['https://Stackoverflow.com/questions/21280535', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2437356/']
Go to `FilterViewController.h` add a uiimage there `@property(nonatomic,strong)UIImage *dvImage;` Go to `FilterViewController.m` Synthesize it `@synthesize dvImage;` Go to the code Where you are calling the `FilterViewController` ``` FilterViewController *cvc = [segue destinationViewController]; UIImage *image = i...
You can't do this because it isn't ready yet. ``` cvc.desktopview.image = image; ``` Instead you need to store it in a `UIImage` property and use it in `viewDidLoad` method of your destination view controller. Something like this in `prepareForSegue` ``` cvc.image = image; ``` and in the view controller ``` - ...
21,280,535
i have made a mistake of re-inventing the wheel. There are options but somehow i like the feel of this. Sorry but don't have enough rep to post an image. This is how the form looks like: SNO.-------ITEMS--------FROM--------TO---------QUANTITY // labels [ 1 ]-------[-----------▼]---[--------]----[--------]------[----...
2014/01/22
['https://Stackoverflow.com/questions/21280535', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2437356/']
You can't do this because it isn't ready yet. ``` cvc.desktopview.image = image; ``` Instead you need to store it in a `UIImage` property and use it in `viewDidLoad` method of your destination view controller. Something like this in `prepareForSegue` ``` cvc.image = image; ``` and in the view controller ``` - ...
Optimized way ``` [segue.destinationViewController setAnotherImage:yourImage]; ``` Another view controller ``` -(void)setAnotherImage:(UIImage *)happiness { //get your image here } ```
21,280,535
i have made a mistake of re-inventing the wheel. There are options but somehow i like the feel of this. Sorry but don't have enough rep to post an image. This is how the form looks like: SNO.-------ITEMS--------FROM--------TO---------QUANTITY // labels [ 1 ]-------[-----------▼]---[--------]----[--------]------[----...
2014/01/22
['https://Stackoverflow.com/questions/21280535', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2437356/']
Go to `FilterViewController.h` add a uiimage there `@property(nonatomic,strong)UIImage *dvImage;` Go to `FilterViewController.m` Synthesize it `@synthesize dvImage;` Go to the code Where you are calling the `FilterViewController` ``` FilterViewController *cvc = [segue destinationViewController]; UIImage *image = i...
Optimized way ``` [segue.destinationViewController setAnotherImage:yourImage]; ``` Another view controller ``` -(void)setAnotherImage:(UIImage *)happiness { //get your image here } ```
21,280,535
i have made a mistake of re-inventing the wheel. There are options but somehow i like the feel of this. Sorry but don't have enough rep to post an image. This is how the form looks like: SNO.-------ITEMS--------FROM--------TO---------QUANTITY // labels [ 1 ]-------[-----------▼]---[--------]----[--------]------[----...
2014/01/22
['https://Stackoverflow.com/questions/21280535', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2437356/']
Go to `FilterViewController.h` add a uiimage there `@property(nonatomic,strong)UIImage *dvImage;` Go to `FilterViewController.m` Synthesize it `@synthesize dvImage;` Go to the code Where you are calling the `FilterViewController` ``` FilterViewController *cvc = [segue destinationViewController]; UIImage *image = i...
`ViewDidLoad` is called only after ALL outlets are loaded, so never try to set outlet/views value in prepare segue method, as `viewDidLoad` will be called after prepare segue method. Now you can do one that create an UIImage property in `filterViewController` and set its value. and In `viewDidLoad` method set it to spe...
21,280,535
i have made a mistake of re-inventing the wheel. There are options but somehow i like the feel of this. Sorry but don't have enough rep to post an image. This is how the form looks like: SNO.-------ITEMS--------FROM--------TO---------QUANTITY // labels [ 1 ]-------[-----------▼]---[--------]----[--------]------[----...
2014/01/22
['https://Stackoverflow.com/questions/21280535', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2437356/']
`ViewDidLoad` is called only after ALL outlets are loaded, so never try to set outlet/views value in prepare segue method, as `viewDidLoad` will be called after prepare segue method. Now you can do one that create an UIImage property in `filterViewController` and set its value. and In `viewDidLoad` method set it to spe...
Optimized way ``` [segue.destinationViewController setAnotherImage:yourImage]; ``` Another view controller ``` -(void)setAnotherImage:(UIImage *)happiness { //get your image here } ```
35,481,633
I am having `Entity` Called `EY_Appliances` with Attributes `applianceId` ,`applianceName`,`watts`,`amountPerWatts`.Also i am Having Arrays like this: Prefrence.h ``` #define APPLIANCENAME_ARRAY @[@"Fridge",@"Microwave",@"Mixie",@"Roti Maker",@"Coffee Machine",@"Dish Washer",@"Wet Grinder",@"Electric Stove",@"Ceiling...
2016/02/18
['https://Stackoverflow.com/questions/35481633', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
So, I was testing with `Genymotion` because I couldn't get my hands on a device with `Android` 6.0 but now, that I've borrowed one, I've tested this code in that physical device and I was happy to notice that it works. Guess it's a `Genymotion` problem. Oh well, code's working. Thanks!
could you please use the following code and feed me back with result :- ``` import android.Manifest; import android.content.pm.PackageManager; import android.os.Build; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompat; import android.support.v4.app.FragmentActivity; import android...
628,720
Inspired by a question I asked [here](https://math.stackexchange.com/questions/626927/how-a-group-represents-the-passage-of-time), I am rethinking about a question: > > Why heat equation is not time-reversible? > > > I don't know too much about PDE and physics but I guess there should be some "time arrow" in math...
2014/01/06
['https://math.stackexchange.com/questions/628720', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/62765/']
The heat equation $u\_t-u\_{xx}=0$ is not time-reversible because it involves an odd-order derivative of $t$. Under time reversal $t\mapsto-t$, we get $u\_t\mapsto-u\_t$. So if $u(x,t)$ is a solution to the heat equation, then $u(x,-t)$ is a solution to a different equation, namely $-u\_t-u\_{xx}=0$. The only way for $...
If you start with a spatial heat distribution $u(x)$ at $t=0$, then the solution at $t > 0$ is infinitely-differentiable because it is averaged by a Gaussian, and the Gaussian couldn't be more smooth. You shouldn't expect to be able to undo such a process. This is a diffusion equation, and the speed of propagation is, ...
628,720
Inspired by a question I asked [here](https://math.stackexchange.com/questions/626927/how-a-group-represents-the-passage-of-time), I am rethinking about a question: > > Why heat equation is not time-reversible? > > > I don't know too much about PDE and physics but I guess there should be some "time arrow" in math...
2014/01/06
['https://math.stackexchange.com/questions/628720', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/62765/']
If you start with a spatial heat distribution $u(x)$ at $t=0$, then the solution at $t > 0$ is infinitely-differentiable because it is averaged by a Gaussian, and the Gaussian couldn't be more smooth. You shouldn't expect to be able to undo such a process. This is a diffusion equation, and the speed of propagation is, ...
This is going to be more of a "Why I think it's not reversible" than a rigorous argument: At $t = 0$, let the temperature for a 1-dimensional homogeneous medium be piece-wise constant: $T(0,x) = 1$ for $x =< 0$ ; $T(0,x) = 3$ for $x > 0$ . For any value of x, as $t \to \infty$, $T(t,x) \to 2$ . Now, take any value...
628,720
Inspired by a question I asked [here](https://math.stackexchange.com/questions/626927/how-a-group-represents-the-passage-of-time), I am rethinking about a question: > > Why heat equation is not time-reversible? > > > I don't know too much about PDE and physics but I guess there should be some "time arrow" in math...
2014/01/06
['https://math.stackexchange.com/questions/628720', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/62765/']
The heat equation $u\_t-u\_{xx}=0$ is not time-reversible because it involves an odd-order derivative of $t$. Under time reversal $t\mapsto-t$, we get $u\_t\mapsto-u\_t$. So if $u(x,t)$ is a solution to the heat equation, then $u(x,-t)$ is a solution to a different equation, namely $-u\_t-u\_{xx}=0$. The only way for $...
This is going to be more of a "Why I think it's not reversible" than a rigorous argument: At $t = 0$, let the temperature for a 1-dimensional homogeneous medium be piece-wise constant: $T(0,x) = 1$ for $x =< 0$ ; $T(0,x) = 3$ for $x > 0$ . For any value of x, as $t \to \infty$, $T(t,x) \to 2$ . Now, take any value...
53,432,769
I'm working with Xcode 10.1 (10B61) on an app that needs permission to use the microphone. (Almost) Every time I start the app from Xcode (in simulator) I get a system popup: > > "Appname" would like to access the microphone > "Privacy - Microphone Usage Description""> > > > It doesn't matter if I select "Don't ...
2018/11/22
['https://Stackoverflow.com/questions/53432769', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2451537/']
After looking for a workaround this one seems to fix it for me: In Simulator go to Settings > Your App > Disable the Microphone Access Update: Not solving this issue but might be helpful: You can dismiss the popup via Esc key - that should be way faster than clicking a button
Another work around is to check if the app is running in the simulator and disable the audio code: ``` struct Platform { static var isSimulator: Bool { return TARGET_OS_SIMULATOR != 0 } } ```
53,432,769
I'm working with Xcode 10.1 (10B61) on an app that needs permission to use the microphone. (Almost) Every time I start the app from Xcode (in simulator) I get a system popup: > > "Appname" would like to access the microphone > "Privacy - Microphone Usage Description""> > > > It doesn't matter if I select "Don't ...
2018/11/22
['https://Stackoverflow.com/questions/53432769', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2451537/']
You can get rid of this following this steps: 1. Go to "Security & Privacy" Settings on macOS. 2. Select "Microphone" on the left panel. 3. Uncheck the Xcode option on the right panel.
After looking for a workaround this one seems to fix it for me: In Simulator go to Settings > Your App > Disable the Microphone Access Update: Not solving this issue but might be helpful: You can dismiss the popup via Esc key - that should be way faster than clicking a button
53,432,769
I'm working with Xcode 10.1 (10B61) on an app that needs permission to use the microphone. (Almost) Every time I start the app from Xcode (in simulator) I get a system popup: > > "Appname" would like to access the microphone > "Privacy - Microphone Usage Description""> > > > It doesn't matter if I select "Don't ...
2018/11/22
['https://Stackoverflow.com/questions/53432769', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2451537/']
### Edit: Unfortunately it looks like the following procedure is just a temporary fix. After some time the dialog started appearing again. Repeating the procedure fixes it for an additional period of time. --- I had the same problem and what helped in my case was disabling and then re-enabling microphone permissions...
Another work around is to check if the app is running in the simulator and disable the audio code: ``` struct Platform { static var isSimulator: Bool { return TARGET_OS_SIMULATOR != 0 } } ```
53,432,769
I'm working with Xcode 10.1 (10B61) on an app that needs permission to use the microphone. (Almost) Every time I start the app from Xcode (in simulator) I get a system popup: > > "Appname" would like to access the microphone > "Privacy - Microphone Usage Description""> > > > It doesn't matter if I select "Don't ...
2018/11/22
['https://Stackoverflow.com/questions/53432769', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2451537/']
You can get rid of this following this steps: 1. Go to "Security & Privacy" Settings on macOS. 2. Select "Microphone" on the left panel. 3. Uncheck the Xcode option on the right panel.
Another work around is to check if the app is running in the simulator and disable the audio code: ``` struct Platform { static var isSimulator: Bool { return TARGET_OS_SIMULATOR != 0 } } ```
53,432,769
I'm working with Xcode 10.1 (10B61) on an app that needs permission to use the microphone. (Almost) Every time I start the app from Xcode (in simulator) I get a system popup: > > "Appname" would like to access the microphone > "Privacy - Microphone Usage Description""> > > > It doesn't matter if I select "Don't ...
2018/11/22
['https://Stackoverflow.com/questions/53432769', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2451537/']
You can get rid of this following this steps: 1. Go to "Security & Privacy" Settings on macOS. 2. Select "Microphone" on the left panel. 3. Uncheck the Xcode option on the right panel.
### Edit: Unfortunately it looks like the following procedure is just a temporary fix. After some time the dialog started appearing again. Repeating the procedure fixes it for an additional period of time. --- I had the same problem and what helped in my case was disabling and then re-enabling microphone permissions...
3,326,042
**Problem:** Determine the number of positive integers such that: $$\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big] = a$$ (where [x] is the greatest integer function) **Attempted solution:** The greatest integer function is essentially the floor function. The largest integer that is less than...
2019/08/17
['https://math.stackexchange.com/questions/3326042', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/203291/']
$$ \frac{a}{2} + \frac{a}{3} + \frac{a}{5}-3<\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big]=a\leq \frac{a}{2} + \frac{a}{3} + \frac{a}{5}$$
Hint: use $$x-1<[x]\leq x$$ then you get $$ \frac{a}{2} + \frac{a}{3} + \frac{a}{5}-3\leq a\leq \frac{a}{2} + \frac{a}{3} + \frac{a}{5}$$ I get 29 solutions...
3,326,042
**Problem:** Determine the number of positive integers such that: $$\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big] = a$$ (where [x] is the greatest integer function) **Attempted solution:** The greatest integer function is essentially the floor function. The largest integer that is less than...
2019/08/17
['https://math.stackexchange.com/questions/3326042', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/203291/']
Hint: use $$x-1<[x]\leq x$$ then you get $$ \frac{a}{2} + \frac{a}{3} + \frac{a}{5}-3\leq a\leq \frac{a}{2} + \frac{a}{3} + \frac{a}{5}$$ I get 29 solutions...
**Hint** Let $a=30k+r$ where $k\in \Bbb N\cup\{0\}$ and $0\le r<30$. Therefore$$31k+\Big[\frac{r}{2}\Big] + \Big[\frac{r}{3}\Big] + \Big[\frac{r}{5}\Big] = 30k+r$$or$$k+\Big[\frac{r}{2}\Big] + \Big[\frac{r}{3}\Big] + \Big[\frac{r}{5}\Big] = r$$
3,326,042
**Problem:** Determine the number of positive integers such that: $$\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big] = a$$ (where [x] is the greatest integer function) **Attempted solution:** The greatest integer function is essentially the floor function. The largest integer that is less than...
2019/08/17
['https://math.stackexchange.com/questions/3326042', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/203291/']
Hint: use $$x-1<[x]\leq x$$ then you get $$ \frac{a}{2} + \frac{a}{3} + \frac{a}{5}-3\leq a\leq \frac{a}{2} + \frac{a}{3} + \frac{a}{5}$$ I get 29 solutions...
Sorry,I just made a mistake. I think the answer is 30. when a=2k,$k\in N$; Compared to$a\over2$+$a\over3$+$a\over5$,the left side may less $i\over3$+$j\over5$(i=0,1,2;j=0,1,2,3,4), so there are 1x3x5-1=14 numbers fitting it.(Because what the left side less will equal to($a\over2$+$a\over3$+$a\over5$-$a$) ,and i,j canno...
3,326,042
**Problem:** Determine the number of positive integers such that: $$\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big] = a$$ (where [x] is the greatest integer function) **Attempted solution:** The greatest integer function is essentially the floor function. The largest integer that is less than...
2019/08/17
['https://math.stackexchange.com/questions/3326042', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/203291/']
Hint: use $$x-1<[x]\leq x$$ then you get $$ \frac{a}{2} + \frac{a}{3} + \frac{a}{5}-3\leq a\leq \frac{a}{2} + \frac{a}{3} + \frac{a}{5}$$ I get 29 solutions...
Since $$ \left\lfloor x \right\rfloor = x - \left\{ x \right\}\quad \left| {\,0 \le \left\{ x \right\} < 1} \right. $$ then the equation becomes $$ \eqalign{ & 0 = \left\lfloor {{a \over 2}} \right\rfloor + \left\lfloor {{a \over 3}} \right\rfloor + \left\lfloor {{a \over 5}} \right\rfloor - a = \cr & = {a \over 2} ...
3,326,042
**Problem:** Determine the number of positive integers such that: $$\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big] = a$$ (where [x] is the greatest integer function) **Attempted solution:** The greatest integer function is essentially the floor function. The largest integer that is less than...
2019/08/17
['https://math.stackexchange.com/questions/3326042', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/203291/']
$$ \frac{a}{2} + \frac{a}{3} + \frac{a}{5}-3<\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big]=a\leq \frac{a}{2} + \frac{a}{3} + \frac{a}{5}$$
**Hint** Let $a=30k+r$ where $k\in \Bbb N\cup\{0\}$ and $0\le r<30$. Therefore$$31k+\Big[\frac{r}{2}\Big] + \Big[\frac{r}{3}\Big] + \Big[\frac{r}{5}\Big] = 30k+r$$or$$k+\Big[\frac{r}{2}\Big] + \Big[\frac{r}{3}\Big] + \Big[\frac{r}{5}\Big] = r$$
3,326,042
**Problem:** Determine the number of positive integers such that: $$\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big] = a$$ (where [x] is the greatest integer function) **Attempted solution:** The greatest integer function is essentially the floor function. The largest integer that is less than...
2019/08/17
['https://math.stackexchange.com/questions/3326042', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/203291/']
$$ \frac{a}{2} + \frac{a}{3} + \frac{a}{5}-3<\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big]=a\leq \frac{a}{2} + \frac{a}{3} + \frac{a}{5}$$
Sorry,I just made a mistake. I think the answer is 30. when a=2k,$k\in N$; Compared to$a\over2$+$a\over3$+$a\over5$,the left side may less $i\over3$+$j\over5$(i=0,1,2;j=0,1,2,3,4), so there are 1x3x5-1=14 numbers fitting it.(Because what the left side less will equal to($a\over2$+$a\over3$+$a\over5$-$a$) ,and i,j canno...
3,326,042
**Problem:** Determine the number of positive integers such that: $$\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big] = a$$ (where [x] is the greatest integer function) **Attempted solution:** The greatest integer function is essentially the floor function. The largest integer that is less than...
2019/08/17
['https://math.stackexchange.com/questions/3326042', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/203291/']
$$ \frac{a}{2} + \frac{a}{3} + \frac{a}{5}-3<\Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] + \Big[\frac{a}{5}\Big]=a\leq \frac{a}{2} + \frac{a}{3} + \frac{a}{5}$$
Since $$ \left\lfloor x \right\rfloor = x - \left\{ x \right\}\quad \left| {\,0 \le \left\{ x \right\} < 1} \right. $$ then the equation becomes $$ \eqalign{ & 0 = \left\lfloor {{a \over 2}} \right\rfloor + \left\lfloor {{a \over 3}} \right\rfloor + \left\lfloor {{a \over 5}} \right\rfloor - a = \cr & = {a \over 2} ...
654,064
If I have some servers set to static high performance mode, is there a way to generate a report on what power savings mode would have done, if it were enabled? I am looking to generate reports of the form, on this day we used this many kWh that we didn't really need to, summed across the estate. Or an alternate method ...
2014/12/21
['https://serverfault.com/questions/654064', 'https://serverfault.com', 'https://serverfault.com/users/58037/']
I'm unaware of any current server that holds this data and provides estimates based on it's history, nor any upcoming servers that do so. The only way to get close to a real answer would be to test it yourself with a power meter over a period of time with both settings. That said I buy HP servers and their 'balanced' p...
Measure it on typical servers and calculate that on this base. And/or ask your hardware manufactorer. Recent servers should be equipped with online power consumption measurement means and even statistics. (e.g. Dell PowerEdge x9xx or Rxxx models)
1,514,342
Is there a way to tell R# to apply different naming strategy for property backing fields (\_camelCase) vs class instance fields (camelCase)? Reason: I want my dependencies to be named just a any other variable. Especially if the type of the field is the same as the field name. For example ``` private readonly MetaSer...
2009/10/03
['https://Stackoverflow.com/questions/1514342', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/103682/']
No, I don't know of a way to do this. Frankly, I don't understand the distinction. 1. A private instance field may later be used as the backing field for a property. Would you then feel it necessary to change the name of that field? 2. The property may become disused and may then be removed. Do you then want to rena...
The naming convention for a property backing field should be the same as that for a class instance field. The only difference between the two is that one can be manipulated or accessed from the outside. If you feel the need to make a distinction, add a comment.
19,552,059
I'm trying to write my own apply function using variate template. Here is the code I have: ``` template<typename...> struct types{ }; template<typename T, typename... Args> struct Func{ template<typename F, typanem... Types> T call(F f, std::tuple<Types...>& params, Args... args){ ...
2013/10/23
['https://Stackoverflow.com/questions/19552059', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2913077/']
Your problem is, that without braces, the `if` applies *only* to the following statement: ``` if (q >= 0) e[q] = w; r[q] = w; // <---- here you get ArrayIndexOutOfBound Exception ``` add braces like: ``` if (q >= 0){ e[q] = w; r[q] = w; } ```
Put the opening and closing braces for the if condition.
19,552,059
I'm trying to write my own apply function using variate template. Here is the code I have: ``` template<typename...> struct types{ }; template<typename T, typename... Args> struct Func{ template<typename F, typanem... Types> T call(F f, std::tuple<Types...>& params, Args... args){ ...
2013/10/23
['https://Stackoverflow.com/questions/19552059', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2913077/']
Your problem is, that without braces, the `if` applies *only* to the following statement: ``` if (q >= 0) e[q] = w; r[q] = w; // <---- here you get ArrayIndexOutOfBound Exception ``` add braces like: ``` if (q >= 0){ e[q] = w; r[q] = w; } ```
Error is happening in following line: r[q] = w; As this out of if block, value of q is `-1` which is causing the error. Move it into if block: ``` if (q >= 0){ e[q] = w; r[q] = w; } ``` Cheers !!
19,552,059
I'm trying to write my own apply function using variate template. Here is the code I have: ``` template<typename...> struct types{ }; template<typename T, typename... Args> struct Func{ template<typename F, typanem... Types> T call(F f, std::tuple<Types...>& params, Args... args){ ...
2013/10/23
['https://Stackoverflow.com/questions/19552059', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2913077/']
Your problem is, that without braces, the `if` applies *only* to the following statement: ``` if (q >= 0) e[q] = w; r[q] = w; // <---- here you get ArrayIndexOutOfBound Exception ``` add braces like: ``` if (q >= 0){ e[q] = w; r[q] = w; } ```
You call method Ext with parameter `q` with value `-1`. Then you accesing the `r[q] = w;` with -1 which is not defined (array of size 5 is defined on index 0-4). Why you accesing that? ``` if (q >= 0) e[q] = w; r[q] = w; ``` This means that if-statement is only compared for the `e[q] = w;` If you want to have a...
19,552,059
I'm trying to write my own apply function using variate template. Here is the code I have: ``` template<typename...> struct types{ }; template<typename T, typename... Args> struct Func{ template<typename F, typanem... Types> T call(F f, std::tuple<Types...>& params, Args... args){ ...
2013/10/23
['https://Stackoverflow.com/questions/19552059', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2913077/']
Put the opening and closing braces for the if condition.
Error is happening in following line: r[q] = w; As this out of if block, value of q is `-1` which is causing the error. Move it into if block: ``` if (q >= 0){ e[q] = w; r[q] = w; } ``` Cheers !!
19,552,059
I'm trying to write my own apply function using variate template. Here is the code I have: ``` template<typename...> struct types{ }; template<typename T, typename... Args> struct Func{ template<typename F, typanem... Types> T call(F f, std::tuple<Types...>& params, Args... args){ ...
2013/10/23
['https://Stackoverflow.com/questions/19552059', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2913077/']
Put the opening and closing braces for the if condition.
You call method Ext with parameter `q` with value `-1`. Then you accesing the `r[q] = w;` with -1 which is not defined (array of size 5 is defined on index 0-4). Why you accesing that? ``` if (q >= 0) e[q] = w; r[q] = w; ``` This means that if-statement is only compared for the `e[q] = w;` If you want to have a...
73,438,985
I'm trying to send an email from Google Sheets to update staff if they have filled a particular form out. The emails I need to be sent are sitting in the google sheet with the finish the form. If there are 5 emails in the sheet, I need a draught email sent to them with a link attached. I know you can send an email ba...
2022/08/21
['https://Stackoverflow.com/questions/73438985', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/16903576/']
### A simple Example ``` function sendEmIfTheyreThere() { const ss = SpreadsheetApp.getActive(); const sh = ss.getSheetByName("Sheet0"); const vs = sh.getDataRange().getValues(); vs.forEach((r,i)=> {//for loop using arrow notation if(r[0] && r[1] && r[2] && !r[3]) {//look for truthiness of column1,column2 ...
Since you know how to send emails to a cell, you could jam all the addresses into a cell with `textjoin`, and separate them with `;` That would setup your addresses to send to... So say in cell `C1` you could put `=TEXTJOIN(";",true,A:A)` (assuming column a has addresses). Then you would have your addresses just as a...
63,401,726
I have a line of images and when I hover over an image, I want it to enlarge and overlap the other images. The way I did it, when I move the mouse over it, the row is all disfigured: [![enter image description here](https://i.stack.imgur.com/QmNBz.png)](https://i.stack.imgur.com/QmNBz.png) [![enter image description ...
2020/08/13
['https://Stackoverflow.com/questions/63401726', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8365573/']
As someone else has commented, the way to do this would be to use `transform:scale(2)` on `&:hover` - adjusting the number as necessary. This should avoid any layout shift, and it will be more performant than animating the width as you are currently doing. See this article: <https://pqina.nl/blog/animating-width-and-h...
I did it like this and it worked: [![enter image description here](https://i.stack.imgur.com/q57W4.png)](https://i.stack.imgur.com/q57W4.png) [![enter image description here](https://i.stack.imgur.com/8Q24s.png)](https://i.stack.imgur.com/8Q24s.png) code: ``` <div> <p>Fotos do anúncio</p> <div className="im...
35,983,961
I am using `CefSharp.Wpf` to display my Angular SPA in WPF. My authentication is based on JWT tokens, which are stored in browser local storage. I call dialog with CefSharp and login (save JWT in local storage). Then, I want my c# app to be able to make api calls to protected resources of API. For that purpose I nee...
2016/03/14
['https://Stackoverflow.com/questions/35983961', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2866189/']
`CEF` doesn't provide any `API` for this, so you can use `JS` or manupulate your `.localstorage` file on disk with use of `sqlLite`. I have achieved manipulation of `LocalStorage` with calling `JS` code. This article has helped a lot: <https://blog.logrocket.com/the-complete-guide-to-using-localstorage-in-javascript-a...
I also encountered this problem, which is the result of my research. First, `CEF` does not provide such a function of `API`. But we can use JavaScript object binding to realize this function. step 1:in c# Register a JavaScript object like this: ``` JavascriptObjectRepository.Register("localStorage_hook", Loca...
30,472,618
I am trying to check if in a square matrix there is more than one true value in all possible diagonals and anti-diagonals, and return true, otherwise false. So far I have tried as following but is not covering all possible diagonals: ``` n=8; %matrix dimension 8 x 8 diag= sum(A(1:n+1:end)); d1=diag>=2; antiDiag=sum(A(...
2015/05/27
['https://Stackoverflow.com/questions/30472618', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2280374/']
**One approach:** ``` n=8; %// size of square matrix A = logical(randi(2,n)-1); %// Create a logical matrix of 0s and 1s d1 = sum(A(1:n+1:end)); %// sum all the values of Main diagonal d2 = sum(A(n:n-1:end-1)); %// sum all the values of Main anti-diag result = d1>=2 | d2>=2 %//...
Using @Santhan Salai's generating technique, we can use the `diag` function (to pull out the main diagonal of the matrix), the `fliplr` to flip over the center column and `any` to reduced to a single value. ``` n=8; %// size of square matrix A = logical(randi(2,n)-1); %// Create a logical mat...
30,472,618
I am trying to check if in a square matrix there is more than one true value in all possible diagonals and anti-diagonals, and return true, otherwise false. So far I have tried as following but is not covering all possible diagonals: ``` n=8; %matrix dimension 8 x 8 diag= sum(A(1:n+1:end)); d1=diag>=2; antiDiag=sum(A(...
2015/05/27
['https://Stackoverflow.com/questions/30472618', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2280374/']
To detect if there are more than one nonzero value in *any* diagonal or anti-diagonal (not just the main diagonal and antidiagonal): get the row and column indices of nonzero values, `ii` and `jj`; and then check if any value of `ii-jj` (diagonals) or `ii+jj` (anti-diagonals) is repeated: ``` [ii, jj] = find(A); res =...
**One approach:** ``` n=8; %// size of square matrix A = logical(randi(2,n)-1); %// Create a logical matrix of 0s and 1s d1 = sum(A(1:n+1:end)); %// sum all the values of Main diagonal d2 = sum(A(n:n-1:end-1)); %// sum all the values of Main anti-diag result = d1>=2 | d2>=2 %//...
30,472,618
I am trying to check if in a square matrix there is more than one true value in all possible diagonals and anti-diagonals, and return true, otherwise false. So far I have tried as following but is not covering all possible diagonals: ``` n=8; %matrix dimension 8 x 8 diag= sum(A(1:n+1:end)); d1=diag>=2; antiDiag=sum(A(...
2015/05/27
['https://Stackoverflow.com/questions/30472618', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2280374/']
To detect if there are more than one nonzero value in *any* diagonal or anti-diagonal (not just the main diagonal and antidiagonal): get the row and column indices of nonzero values, `ii` and `jj`; and then check if any value of `ii-jj` (diagonals) or `ii+jj` (anti-diagonals) is repeated: ``` [ii, jj] = find(A); res =...
Using @Santhan Salai's generating technique, we can use the `diag` function (to pull out the main diagonal of the matrix), the `fliplr` to flip over the center column and `any` to reduced to a single value. ``` n=8; %// size of square matrix A = logical(randi(2,n)-1); %// Create a logical mat...
61,823,205
I have this Elastic query: ``` "aggs":{ "GroupByDomeinRelatieCode":{ "aggs":{ "SumNettoRegelBedrag":{ "sum":{ "script": { "lang": "painless", "source": "doc['nettoRegelbedrag'].value * (100 - doc['uitgesteldeKortingsPercentage']....
2020/05/15
['https://Stackoverflow.com/questions/61823205', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/731127/']
You can pass the script via `Script` property, like this ``` Aggregations = new SumAggregation("SumNettoRegelBedrag", null) { Script = new InlineScript("") } ``` Hope that helps.
Can you try this one? ``` { "aggs": { "GroupByDomeinRelatieCode": { "aggs": { "SumNettoRegelBedrag": { "sum": { "script": "doc['nettoRegelbedrag'].value * (100 - doc['uitgesteldeKortingsPercentage'].value) / 100 " } } }, "terms": { "field...
2,062,522
The question that I saw is as follows: > > In the Parliament of Sikinia, each member has at most three enemies. Prove that the house can be separated into two houses, so that each member has at most one enemy in his own house. > > > I built a graph where each person corresponds to a vertex and there is an edge be...
2016/12/17
['https://math.stackexchange.com/questions/2062522', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/314798/']
Split the house however you like. Let $E\_i$ be the number of enemies person $i$ has in their group, and let $E = \sum E\_i.$ For any person having more than $1$ enemy in their group, i.e. at least $2$, move them to the other group, where they will have at most $1$ enemy. This decreases $E.$ Since $E$ is always non-neg...
I will give a counter-example for the case where the enemy relationship is not assumed to be symmetric (but is assumed to be irreflexive). Imagine four kingdoms called North, South, East, and West. Each kingdom has many citizens and a king and a pretender to the throne (actually, the pretender to the throne might be th...
2,062,522
The question that I saw is as follows: > > In the Parliament of Sikinia, each member has at most three enemies. Prove that the house can be separated into two houses, so that each member has at most one enemy in his own house. > > > I built a graph where each person corresponds to a vertex and there is an edge be...
2016/12/17
['https://math.stackexchange.com/questions/2062522', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/314798/']
Split the house however you like. Let $E\_i$ be the number of enemies person $i$ has in their group, and let $E = \sum E\_i.$ For any person having more than $1$ enemy in their group, i.e. at least $2$, move them to the other group, where they will have at most $1$ enemy. This decreases $E.$ Since $E$ is always non-neg...
The question is ambiguous in two ways: we are not told whether being an enemy is a symmetric or asymmetric relation, nor whether the parliament has a finite or infinite number of members. I will show that the assertion is false for asymmetric relations, even in the finite case; in fact, I give an (asymmetric) example o...
2,062,522
The question that I saw is as follows: > > In the Parliament of Sikinia, each member has at most three enemies. Prove that the house can be separated into two houses, so that each member has at most one enemy in his own house. > > > I built a graph where each person corresponds to a vertex and there is an edge be...
2016/12/17
['https://math.stackexchange.com/questions/2062522', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/314798/']
Split the house however you like. Let $E\_i$ be the number of enemies person $i$ has in their group, and let $E = \sum E\_i.$ For any person having more than $1$ enemy in their group, i.e. at least $2$, move them to the other group, where they will have at most $1$ enemy. This decreases $E.$ Since $E$ is always non-neg...
Let's separate it into two houses, House A and House B. If person $1$ has two or more enemies in House A, then we put him or her in House B. Then we take care of person $2$, etc. After just finitely many house changes (because we don't have infinitely many people), we can get each member to have at most one enemy in hi...
2,062,522
The question that I saw is as follows: > > In the Parliament of Sikinia, each member has at most three enemies. Prove that the house can be separated into two houses, so that each member has at most one enemy in his own house. > > > I built a graph where each person corresponds to a vertex and there is an edge be...
2016/12/17
['https://math.stackexchange.com/questions/2062522', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/314798/']
The question is ambiguous in two ways: we are not told whether being an enemy is a symmetric or asymmetric relation, nor whether the parliament has a finite or infinite number of members. I will show that the assertion is false for asymmetric relations, even in the finite case; in fact, I give an (asymmetric) example o...
I will give a counter-example for the case where the enemy relationship is not assumed to be symmetric (but is assumed to be irreflexive). Imagine four kingdoms called North, South, East, and West. Each kingdom has many citizens and a king and a pretender to the throne (actually, the pretender to the throne might be th...
2,062,522
The question that I saw is as follows: > > In the Parliament of Sikinia, each member has at most three enemies. Prove that the house can be separated into two houses, so that each member has at most one enemy in his own house. > > > I built a graph where each person corresponds to a vertex and there is an edge be...
2016/12/17
['https://math.stackexchange.com/questions/2062522', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/314798/']
I will give a counter-example for the case where the enemy relationship is not assumed to be symmetric (but is assumed to be irreflexive). Imagine four kingdoms called North, South, East, and West. Each kingdom has many citizens and a king and a pretender to the throne (actually, the pretender to the throne might be th...
Let's separate it into two houses, House A and House B. If person $1$ has two or more enemies in House A, then we put him or her in House B. Then we take care of person $2$, etc. After just finitely many house changes (because we don't have infinitely many people), we can get each member to have at most one enemy in hi...
2,062,522
The question that I saw is as follows: > > In the Parliament of Sikinia, each member has at most three enemies. Prove that the house can be separated into two houses, so that each member has at most one enemy in his own house. > > > I built a graph where each person corresponds to a vertex and there is an edge be...
2016/12/17
['https://math.stackexchange.com/questions/2062522', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/314798/']
The question is ambiguous in two ways: we are not told whether being an enemy is a symmetric or asymmetric relation, nor whether the parliament has a finite or infinite number of members. I will show that the assertion is false for asymmetric relations, even in the finite case; in fact, I give an (asymmetric) example o...
Let's separate it into two houses, House A and House B. If person $1$ has two or more enemies in House A, then we put him or her in House B. Then we take care of person $2$, etc. After just finitely many house changes (because we don't have infinitely many people), we can get each member to have at most one enemy in hi...
17,603,784
This question is a bit difficult to explain. I have a textfield on top (where the navigation bar is usually is) and when I start editing text, the keyboard shows and auto dims the background. I want to add another UIView below the textfield but have that visible and not dimmed out. Perfect image that describes what I ...
2013/07/11
['https://Stackoverflow.com/questions/17603784', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1212530/']
It is getting the characters from left to right (low to high, 0 to length) It is appending the characters from right to left. that reverses them. ``` 1 2 3 | | | \ | / X / | \ 3 2 1 ``` First time through the loop, it takes '1' and puts it in the string. Second time through the loop, it takes '2' and puts it in...
It is actually a badly written program that constantly creates new (immutable) `String` objects while iterating over the characters of `input` from left to right, each time prepending the character to `result`. This is done by the code `input.charAt(i) + result` which puts the character in front of the previous result....
150,528
This is a code review for a set of loggers following [this](https://stackoverflow.com/questions/41175864/how-to-assure-contract-with-multiple-classes-that-are-similar-in-behavior-but-di/41230131?noredirect=1#comment69660624_41230131) question. The project is a universal windows application targeting Windows Phone. The...
2016/12/21
['https://codereview.stackexchange.com/questions/150528', 'https://codereview.stackexchange.com', 'https://codereview.stackexchange.com/users/42250/']
Interesting question, * I noticed that 9-3\*3 does not return 0, but 27, you are not following PEMDAS * Personally, I would make sure that the input only contains numbers, dots, and math operators, and then use `eval`. `eval("9-3*3")` does return correctly 0. * 0.0022 \* 2 returns zero. * I would assign html elements ...
To solve "There's no limit to amount of numbers in the display", If you change your javascript to: ``` if(content != "0"){ if (content.length < 16) content += btnNum; } else { content = btnNum; } ``` You'll be saying "only add more numbers if there is less than 16 numbers on my screen". (I put 16...
150,528
This is a code review for a set of loggers following [this](https://stackoverflow.com/questions/41175864/how-to-assure-contract-with-multiple-classes-that-are-similar-in-behavior-but-di/41230131?noredirect=1#comment69660624_41230131) question. The project is a universal windows application targeting Windows Phone. The...
2016/12/21
['https://codereview.stackexchange.com/questions/150528', 'https://codereview.stackexchange.com', 'https://codereview.stackexchange.com/users/42250/']
Interesting question, * I noticed that 9-3\*3 does not return 0, but 27, you are not following PEMDAS * Personally, I would make sure that the input only contains numbers, dots, and math operators, and then use `eval`. `eval("9-3*3")` does return correctly 0. * 0.0022 \* 2 returns zero. * I would assign html elements ...
The code looks pretty good. Here are a few suggestions: You reference `document.getElementById(numberScreen)` quite a few times. Why not assign it a shorter variable name at the top of your JavaScript file, like you did with `numBtns` and `operators`? You could group your code into sections, to make it easier to find...
150,528
This is a code review for a set of loggers following [this](https://stackoverflow.com/questions/41175864/how-to-assure-contract-with-multiple-classes-that-are-similar-in-behavior-but-di/41230131?noredirect=1#comment69660624_41230131) question. The project is a universal windows application targeting Windows Phone. The...
2016/12/21
['https://codereview.stackexchange.com/questions/150528', 'https://codereview.stackexchange.com', 'https://codereview.stackexchange.com/users/42250/']
Interesting question, * I noticed that 9-3\*3 does not return 0, but 27, you are not following PEMDAS * Personally, I would make sure that the input only contains numbers, dots, and math operators, and then use `eval`. `eval("9-3*3")` does return correctly 0. * 0.0022 \* 2 returns zero. * I would assign html elements ...
code layout =========== For code cleanliness, I recommend rearranging your code so that the function definitions are all together at the end, after the imperative commands. ``` // declare variables // set up event listeners // clear the screen // function definitions ``` avoiding global namespace pollution ========...
150,528
This is a code review for a set of loggers following [this](https://stackoverflow.com/questions/41175864/how-to-assure-contract-with-multiple-classes-that-are-similar-in-behavior-but-di/41230131?noredirect=1#comment69660624_41230131) question. The project is a universal windows application targeting Windows Phone. The...
2016/12/21
['https://codereview.stackexchange.com/questions/150528', 'https://codereview.stackexchange.com', 'https://codereview.stackexchange.com/users/42250/']
Interesting question, * I noticed that 9-3\*3 does not return 0, but 27, you are not following PEMDAS * Personally, I would make sure that the input only contains numbers, dots, and math operators, and then use `eval`. `eval("9-3*3")` does return correctly 0. * 0.0022 \* 2 returns zero. * I would assign html elements ...
Fundamentally, your problems lie in the way you are evaluating your input string. ### Problem 1: You only recognize one operator in the string to be evaluated, the last one that was typed. (i.e the contents of `operand`). We need something more sophisticated than `contents.split(operand)` here. The solution here is...
150,528
This is a code review for a set of loggers following [this](https://stackoverflow.com/questions/41175864/how-to-assure-contract-with-multiple-classes-that-are-similar-in-behavior-but-di/41230131?noredirect=1#comment69660624_41230131) question. The project is a universal windows application targeting Windows Phone. The...
2016/12/21
['https://codereview.stackexchange.com/questions/150528', 'https://codereview.stackexchange.com', 'https://codereview.stackexchange.com/users/42250/']
Interesting question, * I noticed that 9-3\*3 does not return 0, but 27, you are not following PEMDAS * Personally, I would make sure that the input only contains numbers, dots, and math operators, and then use `eval`. `eval("9-3*3")` does return correctly 0. * 0.0022 \* 2 returns zero. * I would assign html elements ...
Just a few side notes: To ordinary people, `%` means *percent*. Only programmers think of `%` being the modulus (or remainder, depending on the language) operator. Since your calculator is intended for ordinary people, the `%` means exactly what it should. You should add a function to display a result: ``` function ...
58,593,349
This comes from an exercise in book *Haskell from First Principles*. The exercise is to implement `Applicative` for `ZipList'`, which is analogous to the Prelude's `ZipList`. The book has this hint > > Check Prelude > for functions that can give you what you need. One starts > with the letter `z`, the other with th...
2019/10/28
['https://Stackoverflow.com/questions/58593349', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4281998/']
Using a combination of `ADDRESS` and `MATCH` should help: ``` =ADDRESS(MATCH(YEAR(L12),Table!$A$1:$A$26,0),MATCH(MONTH(L12),Table!$A$1:$M$1,0)) ``` [![enter image description here](https://i.stack.imgur.com/9i3DR.png)](https://i.stack.imgur.com/9i3DR.png) Table: [![enter image description here](https://i.stack.img...
I always suggest using `INDEX`/`MATCH` instead of `VLOOKUP`. `INDEX`/`MATCH` can do everything `VLOOKUP` (and `HLOOKUP`) can do but it is: * faster (important when used in many cells); * more versatile (the value you are looking up does not need to be in a column to the right); * more robust (inserting columns does n...
1,262,376
I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit? Also can any kind of text be sent through JSON. for example sometime I allow use...
2009/08/11
['https://Stackoverflow.com/questions/1262376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/143030/']
JSON is similar to other data formats like XML - if you need to transmit more data, you just send more data. There's no inherent size limitation to the JSON request. Any limitation would be set by the server parsing the request. (For instance, ASP.NET has the "MaxJsonLength" property of the serializer.)
Implementations are free to set limits on JSON documents, including the size, so choose your parser wisely. See [RFC 7159](https://www.rfc-editor.org/rfc/rfc7159), Section 9. Parsers: "An implementation may set limits on the size of texts that it accepts. An implementation may set limits on the maximum depth of nestin...
1,262,376
I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit? Also can any kind of text be sent through JSON. for example sometime I allow use...
2009/08/11
['https://Stackoverflow.com/questions/1262376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/143030/']
It depends on the implementation of your JSON writer/parser. Microsoft's DataContractJsonSerializer seems to have a hard limit around 8kb (8192 I think), and it will error out for larger strings. Edit: We were able to resolve the 8K limit for JSON strings by setting the MaxJsonLength property in the web config as desc...
What is the requirement? Are you trying to send a large SQL Table as JSON object? I think **it is not practical**. You will consume a **large chunk of server resource** if you push thru with this. You will also not be able to measure the progress with a progress bar because your App will just wait for the server to re...
1,262,376
I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit? Also can any kind of text be sent through JSON. for example sometime I allow use...
2009/08/11
['https://Stackoverflow.com/questions/1262376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/143030/']
There is no fixed limit on how large a JSON data block is or any of the fields. There are limits to how much JSON the JavaScript implementation of various browsers can handle (e.g. around 40MB in my experience). See [this question for example](https://stackoverflow.com/questions/4833480/have-i-reached-the-limits-of-t...
Surely everyone's missed a trick here. The current file size limit of a json file is 18,446,744,073,709,551,616 characters or if you prefer bytes, or even 2^64 bytes if you're looking at 64 bit infrastructures at least. For all intents, and purposes we can assume it's unlimited as you'll probably have a hard time hitt...
1,262,376
I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit? Also can any kind of text be sent through JSON. for example sometime I allow use...
2009/08/11
['https://Stackoverflow.com/questions/1262376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/143030/']
JSON is similar to other data formats like XML - if you need to transmit more data, you just send more data. There's no inherent size limitation to the JSON request. Any limitation would be set by the server parsing the request. (For instance, ASP.NET has the "MaxJsonLength" property of the serializer.)
It depends on the implementation of your JSON writer/parser. Microsoft's DataContractJsonSerializer seems to have a hard limit around 8kb (8192 I think), and it will error out for larger strings. Edit: We were able to resolve the 8K limit for JSON strings by setting the MaxJsonLength property in the web config as desc...
1,262,376
I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit? Also can any kind of text be sent through JSON. for example sometime I allow use...
2009/08/11
['https://Stackoverflow.com/questions/1262376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/143030/']
There is no fixed limit on how large a JSON data block is or any of the fields. There are limits to how much JSON the JavaScript implementation of various browsers can handle (e.g. around 40MB in my experience). See [this question for example](https://stackoverflow.com/questions/4833480/have-i-reached-the-limits-of-t...
What is the requirement? Are you trying to send a large SQL Table as JSON object? I think **it is not practical**. You will consume a **large chunk of server resource** if you push thru with this. You will also not be able to measure the progress with a progress bar because your App will just wait for the server to re...
1,262,376
I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit? Also can any kind of text be sent through JSON. for example sometime I allow use...
2009/08/11
['https://Stackoverflow.com/questions/1262376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/143030/']
Surely everyone's missed a trick here. The current file size limit of a json file is 18,446,744,073,709,551,616 characters or if you prefer bytes, or even 2^64 bytes if you're looking at 64 bit infrastructures at least. For all intents, and purposes we can assume it's unlimited as you'll probably have a hard time hitt...
What is the requirement? Are you trying to send a large SQL Table as JSON object? I think **it is not practical**. You will consume a **large chunk of server resource** if you push thru with this. You will also not be able to measure the progress with a progress bar because your App will just wait for the server to re...
1,262,376
I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit? Also can any kind of text be sent through JSON. for example sometime I allow use...
2009/08/11
['https://Stackoverflow.com/questions/1262376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/143030/']
There is really no limit on the size of JSON data to be send or receive. We can send Json data in file too. According to the capabilities of browser that you are working with, Json data can be handled.
The maximum length of JSON strings. The default is 2097152 characters, which is equivalent to 4 MB of Unicode string data. Refer below URL <https://learn.microsoft.com/en-us/dotnet/api/system.web.script.serialization.javascriptserializer.maxjsonlength?view=netframework-4.7.2>
1,262,376
I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit? Also can any kind of text be sent through JSON. for example sometime I allow use...
2009/08/11
['https://Stackoverflow.com/questions/1262376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/143030/']
Implementations are free to set limits on JSON documents, including the size, so choose your parser wisely. See [RFC 7159](https://www.rfc-editor.org/rfc/rfc7159), Section 9. Parsers: "An implementation may set limits on the size of texts that it accepts. An implementation may set limits on the maximum depth of nestin...
The maximum length of JSON strings. The default is 2097152 characters, which is equivalent to 4 MB of Unicode string data. Refer below URL <https://learn.microsoft.com/en-us/dotnet/api/system.web.script.serialization.javascriptserializer.maxjsonlength?view=netframework-4.7.2>
1,262,376
I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit? Also can any kind of text be sent through JSON. for example sometime I allow use...
2009/08/11
['https://Stackoverflow.com/questions/1262376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/143030/']
It depends on the implementation of your JSON writer/parser. Microsoft's DataContractJsonSerializer seems to have a hard limit around 8kb (8192 I think), and it will error out for larger strings. Edit: We were able to resolve the 8K limit for JSON strings by setting the MaxJsonLength property in the web config as desc...
The maximum length of JSON strings. The default is 2097152 characters, which is equivalent to 4 MB of Unicode string data. Refer below URL <https://learn.microsoft.com/en-us/dotnet/api/system.web.script.serialization.javascriptserializer.maxjsonlength?view=netframework-4.7.2>
1,262,376
I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit? Also can any kind of text be sent through JSON. for example sometime I allow use...
2009/08/11
['https://Stackoverflow.com/questions/1262376', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/143030/']
JSON is similar to other data formats like XML - if you need to transmit more data, you just send more data. There's no inherent size limitation to the JSON request. Any limitation would be set by the server parsing the request. (For instance, ASP.NET has the "MaxJsonLength" property of the serializer.)
Surely everyone's missed a trick here. The current file size limit of a json file is 18,446,744,073,709,551,616 characters or if you prefer bytes, or even 2^64 bytes if you're looking at 64 bit infrastructures at least. For all intents, and purposes we can assume it's unlimited as you'll probably have a hard time hitt...
40,901,121
I'm using AsyncTask to request json data through php which is uploaded in AWS cloud. Below is my code: `@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { new JsonTask().execute("http://XXX.qiykuanrge.us-west-2.elasticbeanstalk.com/index.php/?key=leg"); ret...
2016/12/01
['https://Stackoverflow.com/questions/40901121', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5538299/']
There is no need to use jquery. Just use **ng-class** and add a condition to show or hide that class to your post. Se snipped how content is shown or hidden with the hidden class according to property `post.readMore` in the controller ```js angular.module('myapp', []) .controller('foo', function($scope) { $scop...
give class name something like `class="blogOverlay_{{$index}}"` and then pass `$index` to JavaScript like `showReadMore($index)` This way Your class names are unique and they will change for only `index` you want to change
40,901,121
I'm using AsyncTask to request json data through php which is uploaded in AWS cloud. Below is my code: `@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { new JsonTask().execute("http://XXX.qiykuanrge.us-west-2.elasticbeanstalk.com/index.php/?key=leg"); ret...
2016/12/01
['https://Stackoverflow.com/questions/40901121', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5538299/']
There is no need to use jquery. Just use **ng-class** and add a condition to show or hide that class to your post. Se snipped how content is shown or hidden with the hidden class according to property `post.readMore` in the controller ```js angular.module('myapp', []) .controller('foo', function($scope) { $scop...
You need not complicate much Check out the below css and live plunker ``` .blue{ background-color:blue; } .red{ background-color:red; } .blue:hover { background-color:yellow; visibility:hidden } ``` [PLUNKER DEMO](https://plnkr.co/edit/7RRlxmvTnggyw2LnOzPq?p=preview) Update 1 : Hides and shows
14,297,940
I need help with making a certain MFC program. I need to make a program that will draw a line in the following way: the user chooses the starting point by left clicking, and the final point by left clicking the second time, after which the points are connected and the line is drawn. I've managed to get the coordinates ...
2013/01/12
['https://Stackoverflow.com/questions/14297940', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1973086/']
If you want to get two results from a same event, you have to keep a state variable to track wht click is it. On other words, your `CsemDoc` should have an `a_pos` and `b_pos` members, and `CsemView` a `bool is_b`, initialized as false. The `OnLButtonDow` method should: be something like ``` if(!is_b) { set the a_po...
You can push the mouse co-ordinates on each LButtonDown to a vector and draw the lines between P[i] and P[i+1] and upon a RButtonDown you can stop recording of the points after that and no more extra lines will be drawn. Have a separate button like any drawing toolbox to start the line drawing so that any LButtonDown e...
18,226,698
I have 2 pages when button in page1 is clicked it will linked to the page 2, then the page2 will load with transition. The page loads with fade in and doesnt work with slidedown. ``` $(document).ready(function() { $("body").css("display", "none"); $("body").fadeIn(2000); }); ``` The code...
2013/08/14
['https://Stackoverflow.com/questions/18226698', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2681621/']
Have you tried using shutil? ``` import shutil shutil.copy(src, dst) ```
There may be a problem with the way Python is passing the arguments to the shell command. Try using [subprocess.call](http://docs.python.org/2/library/subprocess.html#using-the-subprocess-module). This method takes arguments as an array and passes them that way to the command: ``` import subprocess subprocess.call(["c...
57,350,378
I'd like to see if it would be possible to convert a `BubbleSort` function, such as: ``` def BubbleSort(l): for i in range(len(l)-1): for j in range(len(l)-1-i): if (l[j]>l[j+1]): l[j],l[j+1]=l[j+1],l[j] return l ``` to a one-liner list comprehension, maybe similar to: ``...
2019/08/04
['https://Stackoverflow.com/questions/57350378', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6553328/']
A solution based on side-effects looks like this: ``` def bubblesort(l): [l.append(l.pop(0) if i == len(l) - 1 or l[0] < l[1] else l.pop(1)) for j in range(0, len(l)) for i in range(0, len(l))] return l ``` This will sort the list `l` in-place. The basic idea is to treat `l` as both the input and output-li...
Using a list comprehension to hide a for loop is kind of cheating given that the result produced by the comprehension is not the sorted list. But if you're going to do that, you might want to avoid building a list of None elements by performing the swaps in the condition rather than as the output value. For example: ...
57,350,378
I'd like to see if it would be possible to convert a `BubbleSort` function, such as: ``` def BubbleSort(l): for i in range(len(l)-1): for j in range(len(l)-1-i): if (l[j]>l[j+1]): l[j],l[j+1]=l[j+1],l[j] return l ``` to a one-liner list comprehension, maybe similar to: ``...
2019/08/04
['https://Stackoverflow.com/questions/57350378', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6553328/']
A solution based on side-effects looks like this: ``` def bubblesort(l): [l.append(l.pop(0) if i == len(l) - 1 or l[0] < l[1] else l.pop(1)) for j in range(0, len(l)) for i in range(0, len(l))] return l ``` This will sort the list `l` in-place. The basic idea is to treat `l` as both the input and output-li...
``` def bubblesort(l): [[l.insert(j+1, l.pop(j)) for j in range(i) if l[j] > l[j+1]] for i in range(len(l)-1,0,-1)] return l ``` I use the `l.insert(j+1, l.pop(j))` to swap the elements in the list. The rest are just the nested loops.
57,350,378
I'd like to see if it would be possible to convert a `BubbleSort` function, such as: ``` def BubbleSort(l): for i in range(len(l)-1): for j in range(len(l)-1-i): if (l[j]>l[j+1]): l[j],l[j+1]=l[j+1],l[j] return l ``` to a one-liner list comprehension, maybe similar to: ``...
2019/08/04
['https://Stackoverflow.com/questions/57350378', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6553328/']
Using a list comprehension to hide a for loop is kind of cheating given that the result produced by the comprehension is not the sorted list. But if you're going to do that, you might want to avoid building a list of None elements by performing the swaps in the condition rather than as the output value. For example: ...
``` def bubblesort(l): [[l.insert(j+1, l.pop(j)) for j in range(i) if l[j] > l[j+1]] for i in range(len(l)-1,0,-1)] return l ``` I use the `l.insert(j+1, l.pop(j))` to swap the elements in the list. The rest are just the nested loops.
29,813,126
So far i have a list view with a custom adapter, and each item in list has a button. Im really confused; Im trying to do the following: When user clicks on button(a delete button) in item in the list, i want to know in which item button was clicked so i can know which item to delete-how do i implement this? Ive seen s...
2015/04/23
['https://Stackoverflow.com/questions/29813126', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4725548/']
Use this inside your getView() method of adapter. ``` yourButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { System.out.println("button : "+position+ " clicked"); // Do you code here. } }); ```
You need to add the `onClick` in the `getView`. Example : <http://jmsliu.com/2444/click-button-in-listview-and-get-item-position.html> Theres a lot of tutorials for this out there.
29,813,126
So far i have a list view with a custom adapter, and each item in list has a button. Im really confused; Im trying to do the following: When user clicks on button(a delete button) in item in the list, i want to know in which item button was clicked so i can know which item to delete-how do i implement this? Ive seen s...
2015/04/23
['https://Stackoverflow.com/questions/29813126', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4725548/']
Use this inside your getView() method of adapter. ``` yourButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { System.out.println("button : "+position+ " clicked"); // Do you code here. } }); ```
``` public class SeekBarAdapter {private SeekBarListener mListener; private ClickListener mListenerClick; public interface SeekBarListener { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser, int positionInList); public void onStartTrackingTouch(SeekBar seekBar, int pos...
29,813,126
So far i have a list view with a custom adapter, and each item in list has a button. Im really confused; Im trying to do the following: When user clicks on button(a delete button) in item in the list, i want to know in which item button was clicked so i can know which item to delete-how do i implement this? Ive seen s...
2015/04/23
['https://Stackoverflow.com/questions/29813126', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4725548/']
Implement an `OnClickListener` for your `delete` button. When the `delete` button is clicked, remove the row in the data source at `position`, and then call `notifyDataSetChanged()` ``` @Override public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub H...
Use this inside your getView() method of adapter. ``` yourButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { System.out.println("button : "+position+ " clicked"); // Do you code here. } }); ```
29,813,126
So far i have a list view with a custom adapter, and each item in list has a button. Im really confused; Im trying to do the following: When user clicks on button(a delete button) in item in the list, i want to know in which item button was clicked so i can know which item to delete-how do i implement this? Ive seen s...
2015/04/23
['https://Stackoverflow.com/questions/29813126', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4725548/']
Use this inside your getView() method of adapter. ``` yourButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { System.out.println("button : "+position+ " clicked"); // Do you code here. } }); ```
You should not use Array. Array has fixed length so you cannot exactly remove its element. You need to use ArrayList in place of Array and implement ViewHolder pattern correctly: ``` ArrayList<Item> items = new ArrayList<>(); //merge both the content of a and n into one object "Item" //and use ArrayList @Override pu...
29,813,126
So far i have a list view with a custom adapter, and each item in list has a button. Im really confused; Im trying to do the following: When user clicks on button(a delete button) in item in the list, i want to know in which item button was clicked so i can know which item to delete-how do i implement this? Ive seen s...
2015/04/23
['https://Stackoverflow.com/questions/29813126', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4725548/']
Implement an `OnClickListener` for your `delete` button. When the `delete` button is clicked, remove the row in the data source at `position`, and then call `notifyDataSetChanged()` ``` @Override public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub H...
You need to add the `onClick` in the `getView`. Example : <http://jmsliu.com/2444/click-button-in-listview-and-get-item-position.html> Theres a lot of tutorials for this out there.
29,813,126
So far i have a list view with a custom adapter, and each item in list has a button. Im really confused; Im trying to do the following: When user clicks on button(a delete button) in item in the list, i want to know in which item button was clicked so i can know which item to delete-how do i implement this? Ive seen s...
2015/04/23
['https://Stackoverflow.com/questions/29813126', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4725548/']
Implement an `OnClickListener` for your `delete` button. When the `delete` button is clicked, remove the row in the data source at `position`, and then call `notifyDataSetChanged()` ``` @Override public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub H...
``` public class SeekBarAdapter {private SeekBarListener mListener; private ClickListener mListenerClick; public interface SeekBarListener { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser, int positionInList); public void onStartTrackingTouch(SeekBar seekBar, int pos...
29,813,126
So far i have a list view with a custom adapter, and each item in list has a button. Im really confused; Im trying to do the following: When user clicks on button(a delete button) in item in the list, i want to know in which item button was clicked so i can know which item to delete-how do i implement this? Ive seen s...
2015/04/23
['https://Stackoverflow.com/questions/29813126', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4725548/']
Implement an `OnClickListener` for your `delete` button. When the `delete` button is clicked, remove the row in the data source at `position`, and then call `notifyDataSetChanged()` ``` @Override public View getView(final int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub H...
You should not use Array. Array has fixed length so you cannot exactly remove its element. You need to use ArrayList in place of Array and implement ViewHolder pattern correctly: ``` ArrayList<Item> items = new ArrayList<>(); //merge both the content of a and n into one object "Item" //and use ArrayList @Override pu...
446,589
Given a continuous function $f\colon \mathbb R \to \mathbb R$ and the fact that $ \lim\_{x\rightarrow \infty} f(x)$ and $ \lim\_{x\rightarrow -\infty}f(x)$ exist (finite), prove that $f$ is bounded. I understand why it's true, but I have no idea how to formally prove this. I'd appreciate the help.
2013/07/18
['https://math.stackexchange.com/questions/446589', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/84007/']
There exists $x\_1$ with $|f(x)-\lim\_{y\to\infty}f(y)|<1$ for all $x>x\_1$. There exists $x\_2$ with $|f(x)-\lim\_{y\to-\infty}f(y)|<1$ for all $x<x\_2$. And $f$ is bounded on the compact interval $[x\_2,x\_1]$.
Clearly, it is sufficient to prove that $f$ is bounded on $\mathbb{R}\_+$, the problem being symmetric. Let $\ell\stackrel{\mathrm{def}}{=} \lim\_{+\infty} f$; wlog, $\ell=0$ (just by "considering" $g\stackrel{\mathrm{def}}{=}f-\ell$ instead). * By definition [1], there exists $A\geq 0$ such that $\forall x \geq A$ $...
67,646,455
```js for (var i = 1; i <= 4; i++) { var str = ""; for (var j = 1; j <= i; j++) { str = str + i; } console.log(str); } ``` This is the code I Perform But its Wrong ``` 1 23 456 78910 ``` anybody please help?
2021/05/22
['https://Stackoverflow.com/questions/67646455', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15997945/']
```js var current_value = 1; for (var i = 1; i <= 4; i++) { var str = ""; for (var j = 1; j <= i; j++) { str = str + current_value++; } console.log(str); } ```
This is how I would solve your problem. You can use [`Array.prototype.map()`](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/map) in order to create loops easily. If we now create an empty array with 5 indexes we can use the [`Array.prototype.keys()`](https://developer.mozilla.org/d...
55,663,305
I'am a begginer in Dart and i dont know how to acces to the values of the next Set ``` Set mySet = Set.from(['Please', 'Help', 'Me']); ```
2019/04/13
['https://Stackoverflow.com/questions/55663305', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11240739/']
*I didn't get the clarity of what you mean by accessing next set but, you can access your current set data in following ways.* ``` Set mySet = Set.from(['Please', 'Help', 'Me']); // declaration. ``` Accessing through index ``` print('mySet.elementAt(0): ${mySet.elementAt(0)}'); print('mySet.elementAt(1): ${mySet.el...
From Wikipedia: > > > > > > Unlike most other collection types, rather than retrieving a specific element from a set, one typically tests a value for membership in a set. > > > > > > > > > That is, if this is not possible (to acces to the values) then this does not mean that this data structure does not fulf...
65,708,307
I am uploading a static site using the `databricks` platform specifically using the below command for pushing `html` content to a location. ``` dbutils.fs.put("/mnt/$web/index.html", html, overwrite=True) ``` This is working but the HTML file is downloading instead of displaying. This is because the content type is ...
2021/01/13
['https://Stackoverflow.com/questions/65708307', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3331783/']
Finally, this code worked for me. First, I am getting connection string from databricks scope as ``` dbutils.secrets.get(scope = "generic-scope", key = "website-key") ``` If you don't have it then look for it inside Storage Account's Container Access Key [![access location in azure storage account](https://i.stack...
`dbutils.fs.put` works with files on DBFS and doesn't "know" about underlying implementation details, because you can mount different things - S3, ADLSv1/v2, etc. Changing of the content-type is specific to the blob storage API, so you will need to implement the code in Python (for [example](https://stackoverflow.com/q...
15,376,970
I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml Here is the code snippet: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/splash_bac...
2013/03/13
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
> > You can use this code. > > > Android: OnClickListener > ------------------------ > > > **In our activity class we add the onclick method.** > > In our activity class we add the onclick method. > > > ``` //On click event for button1 public void button1OnClick(View v) { //Inform the user the but...
``` Button button = (Button) findViewById(R.id.button1); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { Toast.makeText(MainActivity.this, "Button Clicked", Toast.LENGTH_SHORT).show(); } }); ```
15,376,970
I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml Here is the code snippet: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/splash_bac...
2013/03/13
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
For managing click activity in android ,you can do as below 1. Implement `OnClickListener` on **YourActivity.java** class like `public class MainActivity extends Activity implements OnClickListener` 2. Then, declare your button in .java class like `Button btn = (Button) findViewById(R.id.btnPlay);` 3. Then use butt...
I will give you just a little bit to get you started as this answer may help others that are having trouble with using `onClick()` this way but you really need to learn Java and go through the **[Android Docs](http://developer.android.com/index.html)** so you can ask better questions You need to read [Here](http://dev...
15,376,970
I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml Here is the code snippet: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/splash_bac...
2013/03/13
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
create another class goto your project right click and click class and create Home. In that Home class file extends activity and add code like this ``` public class Home extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.lay...
``` Button button = (Button) findViewById(R.id.button1); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { Toast.makeText(MainActivity.this, "Button Clicked", Toast.LENGTH_SHORT).show(); } }); ```
15,376,970
I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml Here is the code snippet: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/splash_bac...
2013/03/13
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
For managing click activity in android ,you can do as below 1. Implement `OnClickListener` on **YourActivity.java** class like `public class MainActivity extends Activity implements OnClickListener` 2. Then, declare your button in .java class like `Button btn = (Button) findViewById(R.id.btnPlay);` 3. Then use butt...
``` Button button = (Button) findViewById(R.id.button1); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { Toast.makeText(MainActivity.this, "Button Clicked", Toast.LENGTH_SHORT).show(); } }); ```
15,376,970
I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml Here is the code snippet: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/splash_bac...
2013/03/13
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
create another class goto your project right click and click class and create Home. In that Home class file extends activity and add code like this ``` public class Home extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.lay...
I will give you just a little bit to get you started as this answer may help others that are having trouble with using `onClick()` this way but you really need to learn Java and go through the **[Android Docs](http://developer.android.com/index.html)** so you can ask better questions You need to read [Here](http://dev...
15,376,970
I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml Here is the code snippet: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/splash_bac...
2013/03/13
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
> > You can use this code. > > > Android: OnClickListener > ------------------------ > > > **In our activity class we add the onclick method.** > > In our activity class we add the onclick method. > > > ``` //On click event for button1 public void button1OnClick(View v) { //Inform the user the but...
I will give you just a little bit to get you started as this answer may help others that are having trouble with using `onClick()` this way but you really need to learn Java and go through the **[Android Docs](http://developer.android.com/index.html)** so you can ask better questions You need to read [Here](http://dev...
15,376,970
I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml Here is the code snippet: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/splash_bac...
2013/03/13
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
> > You can use this code. > > > Android: OnClickListener > ------------------------ > > > **In our activity class we add the onclick method.** > > In our activity class we add the onclick method. > > > ``` //On click event for button1 public void button1OnClick(View v) { //Inform the user the but...
create another class goto your project right click and click class and create Home. In that Home class file extends activity and add code like this ``` public class Home extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.lay...
15,376,970
I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml Here is the code snippet: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/splash_bac...
2013/03/13
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
> > You can use this code. > > > Android: OnClickListener > ------------------------ > > > **In our activity class we add the onclick method.** > > In our activity class we add the onclick method. > > > ``` //On click event for button1 public void button1OnClick(View v) { //Inform the user the but...
`android:onClick` was added in API level 4 to make it easier, more Javascript-web-like, and drive everything from the XML. What it does internally is add an `OnClickListener` on the `Button`, which calls your home method. ``` <Button android:id="@+id/Home" android:layout_width="wrap_content" android:layout_heigh...
15,376,970
I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml Here is the code snippet: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/splash_bac...
2013/03/13
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
For managing click activity in android ,you can do as below 1. Implement `OnClickListener` on **YourActivity.java** class like `public class MainActivity extends Activity implements OnClickListener` 2. Then, declare your button in .java class like `Button btn = (Button) findViewById(R.id.btnPlay);` 3. Then use butt...
> > You can use this code. > > > Android: OnClickListener > ------------------------ > > > **In our activity class we add the onclick method.** > > In our activity class we add the onclick method. > > > ``` //On click event for button1 public void button1OnClick(View v) { //Inform the user the but...
15,376,970
I have 2 files: main\_activity.xml and home.xml. I made a button in main\_activity.xml Here is the code snippet: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:background="@drawable/splash_bac...
2013/03/13
['https://Stackoverflow.com/questions/15376970', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1978141/']
create another class goto your project right click and click class and create Home. In that Home class file extends activity and add code like this ``` public class Home extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.lay...
`android:onClick` was added in API level 4 to make it easier, more Javascript-web-like, and drive everything from the XML. What it does internally is add an `OnClickListener` on the `Button`, which calls your home method. ``` <Button android:id="@+id/Home" android:layout_width="wrap_content" android:layout_heigh...
15,482,231
I'm starting out learning Clojure, and was trying to implement some basic numerical derivative functions for practice. I'm trying to create a `gradient` function that accepts an n-variable function and the points at which to evaluate it. To do this in a "functional" style, I want to implement the gradient as a `map` of...
2013/03/18
['https://Stackoverflow.com/questions/15482231', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2136974/']
You can define `univariate-in-i` as shown below. (Assuming that all the other position values are defined in some var default which is a vector) ``` (fn [i] #(->> (assoc default i %) (apply f))) ```
if you find this abit difficult to comprehend (in the context of how to implement gradient), another variant of multivariable gradient implementation using clojure: [![enter image description here](https://i.stack.imgur.com/frt1S.png)](https://i.stack.imgur.com/frt1S.png) then, given `f and vector v of a1,....,aN`, wil...
63,071,294
I have a list view with item template formed of several elements, one of them is a frame with `TapGestureRecognizer` added to it as the following example: ```xml <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid Margin="10,5" HorizontalOptions="FillAndExpand" RowSpacing="0"> ...
2020/07/24
['https://Stackoverflow.com/questions/63071294', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9277972/']
In your case , the Frame is in a ViewCell , so it will never if you handle it in **ContentPage** directly . Firstly , make sure that the **MainPage** of the App is a **NavigationPage** ### in App.xaml.cs ``` public App() { InitializeComponent(); MainPage = new NavigationPage(new xxxPage()); ...
Try this one ``` Navigation.PushModalAsync(new NavigationPage(new DetailedView())); ```
63,071,294
I have a list view with item template formed of several elements, one of them is a frame with `TapGestureRecognizer` added to it as the following example: ```xml <ListView.ItemTemplate> <DataTemplate> <ViewCell> <Grid Margin="10,5" HorizontalOptions="FillAndExpand" RowSpacing="0"> ...
2020/07/24
['https://Stackoverflow.com/questions/63071294', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9277972/']
Thanks to [Lucas Zhang - MSFT](https://stackoverflow.com/users/10216982/lucas-zhang-msft)'s answer, I could come up with a solution. As he described, I cannot call navigation service inside a `ViewCell`, so, simply, I called the navigation service from the main page instead. ```cs private void TapGesture_Tapped(object...
Try this one ``` Navigation.PushModalAsync(new NavigationPage(new DetailedView())); ```
3,569,553
To give more context, we have $X\_i = 1$ if true, $0$ otherwise. The probability that the outcome will be true is 0.6. The sample is independent. This is my work so far, but I feel like it's wrong.$\DeclareMathOperator{\Var}{Var}$ $\Var(\frac{1}{n}Y) = E[(\frac{1}{n}\sum\_{i = 1}^nX\_i)^2] - E[\frac{1}{n}\sum\_{i = 1}...
2020/03/04
['https://math.stackexchange.com/questions/3569553', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/494405/']
$E[(\frac{1}{n}\sum\limits\_{i = 1}^nX\_i)^2] - E[\frac{1}{n}\sum\limits\_{i = 1}^nX\_i]^2$ Up to here it is OK. Then you cannot say that $E[(\frac{1}{n}\sum\_{i = 1}^nX\_i)^2]=E[\frac{1}{n}\sum\limits\_{i = 1}^nX\_i]E\cdot[\frac{1}{n}\sum\limits\_{i = 1}^nX\_i]$. It is just $\frac1{n^2} E(\sum\limits\_{i = 1}^nX\_i)^...
For independent RV's one has $$ Var(\sum\_1^n X\_i) = \sum\_1^n Var(X\_i)$$ hence $$ Var(\frac1n Y) =\frac1{n^2} n Var(X\_1)=\frac1n Var(X\_1) $$ since $X\_i$'s are identically distributed.
73,681,765
I am trying to remove text before specific brackets using REGEX in comma separated column using Pandas From this - ``` colA My Company Ltd [CS], address, nbc [LV], state [NP], pc [SS], country Business Plc [CS], address, abc [LV], state [NP], code [SS], country Work Harder Inc [CS], address, xyz[CS], state [NP], code...
2022/09/11
['https://Stackoverflow.com/questions/73681765', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/12989327/']
You can´t instantiate the `UIApplicationDelegateAdaptor` yourself. The system will do that for you. But there is a workaround. [From Documentation](https://developer.apple.com/documentation/swiftui/uiapplicationdelegateadaptor) > > If your app delegate conforms to the ObservableObject protocol, as in the example abo...
I'm just posting what I did in case anyone is curious. Instead of trying to use bindings, I just used notification center to post notifications from the app delegate and respond to them from the appropriate views with .onReceive
6,783,556
i want get all values in "Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" and put it in listbox via c# .
2011/07/21
['https://Stackoverflow.com/questions/6783556', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/856482/']
**EDIT AGAIN FOR Windows Form** Here's a complete listing, assuming you have a ListBox with an id of "lbKeys": ``` using Microsoft.Win32; using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.UI; using System.Text; using System.Windows.Forms...
Use OpenSubKey to open up Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU, and then call GetSubKeyNames to get the names of the subkeys. [Here](http://msdn.microsoft.com/en-us/library/microsoft.win32.registrykey%28VS.80%29.aspx) is a good example for you. I think putting them in a ListBox is fairly easy task...
472,805
Since moving a laptop when it's powered on can harm the HDD, so I choose to suspend it to memory before moving, so would this still harm the computer ?
2012/09/11
['https://superuser.com/questions/472805', 'https://superuser.com', 'https://superuser.com/users/73361/']
The problem is not that the hardware is not optimized for running Linux; rather, it is that Linux device drivers are not optimized for taking advantage of all the power management features of the hardware. Generally, you will see the most power management problems on Linux with graphics cards. Things like the motherbo...
Generally speaking hardware wear and tear come from fatigue due to heating up and cooling down rapidly over and over again. this causes the materials to develop microscopic cracks that can cause it to fail. I have never heard of one OS causing more or less fatigue than another unless fans and cooling are not configured...