qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
24,689,560 | I'm having this problem accessing the Contact entity using LINQ.
I have the 2 functions below.
If I ran the 1st function and then call the 2nd one, I seemed to be missing a lot of fields in the 2nd query. Like firstname and lastname are not showing up. They just shows up as null values. If I ran the 2nd function on i... | 2014/07/11 | [
"https://Stackoverflow.com/questions/24689560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1790598/"
] | It is because you are reusing the same CRM context when you call both methods (in your case \_flinsafeContext)
What the context does is cache records, so the first method is returning your contact but only bringing back the new\_username field.
The second method wants to return the whole record, but when it is called... | And here's how you return just the fields you want:
```
IEnumerable<ptl_billpayerapportionment> bpas = context.ptl_billpayerapportionmentSet
.Where(bm => bm.ptl_bill.Id == billId)
.Select(bm => new ptl_billpayerapportionment()
{
Id = bm.Id,
ptl_contact = bm.ptl_contact
})
```
This will ensure a much smaller ... |
7,947,999 | Is it a bug that Firefox doesn't seem to support background-image swapping in pseudo-classes or is it that the other browsers are doing more than they should be?
I'm trying to figure out if I'm doing something wrong... this works in Opera and Chrome (haven't tested in IE yet)...
```
.myClass{
background-image:url('... | 2011/10/30 | [
"https://Stackoverflow.com/questions/7947999",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/59947/"
] | Your page is in quirks mode, presumably, and `:hover` has some weird behavior in terms of when it applies or not in quirks mode. I suggest putting your web page in standards mode if you want browsers to actually behave compatibly on it, instead of explicitly asking them for buggy backwards-compatible behavior. | What version of FF are you using? A quick search revealed this possible issue similar to yours: <http://support.mozilla.com/en-US/questions/746770>
Try this to see if it works:
```
.myClass{
background-image:url('off.jpg');
}
.myClass:hover{
background-image:url('on.jpg');
}
[class="myClass"]:hover{ /* firefox... |
44,803,815 | I'm not new to Excel and or Access, but have never come across this before. A report was sent to me where a date field is being stored as text, but is outputted as 6/2/2017 9:24 AM EDT. I'm trying to convert this column into a date field so that I can do calculations off of it in Access. I wold love to do this in Acces... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44803815",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2946730/"
] | Use this:
```
=--LEFT(A1,LEN(A1)-3)
```
Then format the cell as you wish.
[](https://i.stack.imgur.com/INsyF.png)
Note, this only works if your local date format is `d/m/y` not `m/d/y` if that is the case you will need to parse the data bit by bit... | You can use substitue. Like this:
```
=SUBSTITUTE(A1;"EDT";"")
``` |
44,803,815 | I'm not new to Excel and or Access, but have never come across this before. A report was sent to me where a date field is being stored as text, but is outputted as 6/2/2017 9:24 AM EDT. I'm trying to convert this column into a date field so that I can do calculations off of it in Access. I wold love to do this in Acces... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44803815",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2946730/"
] | Use this:
```
=--LEFT(A1,LEN(A1)-3)
```
Then format the cell as you wish.
[](https://i.stack.imgur.com/INsyF.png)
Note, this only works if your local date format is `d/m/y` not `m/d/y` if that is the case you will need to parse the data bit by bit... | If you are saving it as a CSV or doing any copy/paste and want to make sure Excel doesn't convert it into a date type at reimport, you can add an apostrophe before the value which tells Excel to explicitly ignore what follows it. Here is one way to do it automatically using a macro.
Format the column/rows as text and ... |
1,249,741 | I would like to enable or disable the microphone in the Terminal. How can I do it? For example, I use `sudo modprobe -r uvcvideo` to disable the webcam and `sudo modprobe uvcvideo` to enable it. Is there a command to to the same thing with the microphone? | 2020/06/12 | [
"https://askubuntu.com/questions/1249741",
"https://askubuntu.com",
"https://askubuntu.com/users/1033858/"
] | You could try
```none
amixer set Capture toggle
```
which will toggle the capture of your mic (on/off). You could even connect it to a key (e.g. `XF86AudioMicMute` -if you've got a key that invokes this event), so you would not even have to open a terminal for this. | ```none
wutang@shaolin:~$ gsettings list-recursively | grep mic
org.gnome.desktop.privacy disable-microphone false
org.gnome.shell.overrides dynamic-workspaces true
org.gnome.settings-daemon.plugins.media-keys mic-mute ['']
org.gnome.settings-daemon.plugins.media-keys mic-mute-static ['XF86AudioMicMute']
com.canonical.... |
69,573,428 | I have been working on a weather app that displays live weather data. I am relatively new to flutter and dart.
When I run the code, the app builds and instead of showing the three values on the screen, all three values are displayed as null.
But when I hot reload, the values appear.
Anyone?
```
import 'dart:convert';... | 2021/10/14 | [
"https://Stackoverflow.com/questions/69573428",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14761493/"
] | We can refactor your code slightly to achieve this - the `if` statement which checks whether there are more than 3 breadcrumbs doesn't need to be inside the `for` loop - it's redundant to keep checking the same value multiple times.
If we move that outside the loop then it can
a) prevent unnecessary looping when ther... | It looks like some small initialization issues. This should correct it:
Change this:
```
let hiddenbreadcrumb = document.querySelectorAll('.c-breadcrumb-item:nth-child(1n+2):nth-last-child(n+3)');
// Loop through select breadcrumbs, if length is greater than x hide them.
for (var i = 0; i < hiddenbreadcrumb.length; ... |
69,573,428 | I have been working on a weather app that displays live weather data. I am relatively new to flutter and dart.
When I run the code, the app builds and instead of showing the three values on the screen, all three values are displayed as null.
But when I hot reload, the values appear.
Anyone?
```
import 'dart:convert';... | 2021/10/14 | [
"https://Stackoverflow.com/questions/69573428",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14761493/"
] | We can refactor your code slightly to achieve this - the `if` statement which checks whether there are more than 3 breadcrumbs doesn't need to be inside the `for` loop - it's redundant to keep checking the same value multiple times.
If we move that outside the loop then it can
a) prevent unnecessary looping when ther... | Try this... it allows 3 li items as item1 ... item2ndLast, itemLast
```
(function () {
"use strict";
function breadcrumb() {
let hiddenbreadcrumb = document.querySelectorAll(".c-breadcrumb-item:nth-child(1n+2)");
if (hiddenbreadcrumb.length <= 3) return;
for (var i = 1; i < hiddenbreadcrumb.length -... |
19,712,919 | I have three Numpy matrices
`a = np.matrix('1 2; 3 4')`
`b = np.matrix('5 6 7; 8 9 10')`
`c = np.matrix('1 2 3; 4 5 6; 7 8 9')`
and I would like to make the following block matrix:
`M = [a b ; 0 c]`,
where `0` stands for a matrix of zeros with the relevant dimensions. | 2013/10/31 | [
"https://Stackoverflow.com/questions/19712919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2933461/"
] | An easy way to create a block matrix is [`numpy.bmat`](http://docs.scipy.org/doc/numpy/reference/generated/numpy.bmat.html) (as pointed out by @inquisitiveIdiot). Judging by the block matrix you're looking to create, you need a 3x2 matrix of zeros:
```
>>> import numpy as np
>>> z = np.zeros( (3, 2) )
```
You can th... | My method to generate and join block-wise matrix:
```
def blockwise(matrix, block=(3, 3)):
shape = (int(matrix.shape[0] / block[0]), int(matrix.shape[1] / block[1])) + block
strides = (matrix.strides[0] * block[0], matrix.strides[1] * block[1]) + matrix.strides
return as_strided(matrix, shape=shape, stride... |
31,426,443 | Can I declare more than one php properties in one line, especially if I have no need to initialize them right there, like we can declare in jquery.
JQuery Example
```
var a, b, c;
```
May I expect inside php class like below?
```
var $a, $b, $c;
```
I have searched for my question but unfortunately didn't find a... | 2015/07/15 | [
"https://Stackoverflow.com/questions/31426443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2119008/"
] | Yes, you can
```
class myclass {
public $a, $b = 3, $c;
}
$i = new myclass();
$i->a = 2;
echo $i->a; // 2
echo $i->b; // 3
``` | The use of `var` will raise no E\_STRICT in PHP 5.3, this said if you want to create this kind declaration you could use `list`
```
$info = array('coffee', 'brown', 'caffeine');
list($drink, $color, $power) = $info;
//you can use it like this
echo "I like to drink {$brown} {$coffee} with 100% {$caffeine}";
```
Also ... |
25,130,048 | I want to be able to select a specific array within an array without using a number position. The reason I don't want to a use a number position because the position will not always be equal based on the user logged in.
For instance, with the following array, I want to select only that of which has the `x` value of `Y... | 2014/08/05 | [
"https://Stackoverflow.com/questions/25130048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2285969/"
] | >
> I wonder, as Im trying to weed out whats not wrong, is if windows when connecting to the same ip and port, from within the same jvm, would give two processes the same port?
>
>
>
No. Windows will always allocate a new local port for outbound connections.
>
> This would make it look like to the server that th... | There was a bug in Java 7 some time back which allowed multiple applications to use same port.
[JDK-7179799](http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7179799). Also, check similar question [Can two applications listen to the same port](https://stackoverflow.com/questions/1694144/can-two-applications-listen-t... |
192,120 | I am writing an academic report and I am trying to figure out how to punctuate the following:
>
> The previous results cannot provide an answer to questions like, *what is the probability of* X *given* Y *and* Z *?*, because the precise correlations between the variables are still unknown.
>
>
>
My questions are:... | 2014/08/19 | [
"https://english.stackexchange.com/questions/192120",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/88660/"
] | In British English, one *makes out* a cheque, so you could ask:
>
> Who should I make the cheque out to, please?
>
>
> | I agree that *make out* is the most common formulation. A more traditional phrase is to 'write a cheque in favour of somebody'. So the question would be: who should the cheque be written in favour of? |
192,120 | I am writing an academic report and I am trying to figure out how to punctuate the following:
>
> The previous results cannot provide an answer to questions like, *what is the probability of* X *given* Y *and* Z *?*, because the precise correlations between the variables are still unknown.
>
>
>
My questions are:... | 2014/08/19 | [
"https://english.stackexchange.com/questions/192120",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/88660/"
] | In British English, one *makes out* a cheque, so you could ask:
>
> Who should I make the cheque out to, please?
>
>
> | Another tortured but colloquial phrase is "Who do I make it payable to?" |
192,120 | I am writing an academic report and I am trying to figure out how to punctuate the following:
>
> The previous results cannot provide an answer to questions like, *what is the probability of* X *given* Y *and* Z *?*, because the precise correlations between the variables are still unknown.
>
>
>
My questions are:... | 2014/08/19 | [
"https://english.stackexchange.com/questions/192120",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/88660/"
] | In British English, one *makes out* a cheque, so you could ask:
>
> Who should I make the cheque out to, please?
>
>
> | "To whom should I make out the cheque?"
or
"How exactly should I write the payee name?"
or simply and less formally,
"How should I spell your name on this cheque, please?"
are all reasonable alternatives. |
192,120 | I am writing an academic report and I am trying to figure out how to punctuate the following:
>
> The previous results cannot provide an answer to questions like, *what is the probability of* X *given* Y *and* Z *?*, because the precise correlations between the variables are still unknown.
>
>
>
My questions are:... | 2014/08/19 | [
"https://english.stackexchange.com/questions/192120",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/88660/"
] | In British English, one *makes out* a cheque, so you could ask:
>
> Who should I make the cheque out to, please?
>
>
> | Please confirm the named payee so the check may be issued. |
192,120 | I am writing an academic report and I am trying to figure out how to punctuate the following:
>
> The previous results cannot provide an answer to questions like, *what is the probability of* X *given* Y *and* Z *?*, because the precise correlations between the variables are still unknown.
>
>
>
My questions are:... | 2014/08/19 | [
"https://english.stackexchange.com/questions/192120",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/88660/"
] | I agree that *make out* is the most common formulation. A more traditional phrase is to 'write a cheque in favour of somebody'. So the question would be: who should the cheque be written in favour of? | "To whom should I make out the cheque?"
or
"How exactly should I write the payee name?"
or simply and less formally,
"How should I spell your name on this cheque, please?"
are all reasonable alternatives. |
192,120 | I am writing an academic report and I am trying to figure out how to punctuate the following:
>
> The previous results cannot provide an answer to questions like, *what is the probability of* X *given* Y *and* Z *?*, because the precise correlations between the variables are still unknown.
>
>
>
My questions are:... | 2014/08/19 | [
"https://english.stackexchange.com/questions/192120",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/88660/"
] | I agree that *make out* is the most common formulation. A more traditional phrase is to 'write a cheque in favour of somebody'. So the question would be: who should the cheque be written in favour of? | Please confirm the named payee so the check may be issued. |
192,120 | I am writing an academic report and I am trying to figure out how to punctuate the following:
>
> The previous results cannot provide an answer to questions like, *what is the probability of* X *given* Y *and* Z *?*, because the precise correlations between the variables are still unknown.
>
>
>
My questions are:... | 2014/08/19 | [
"https://english.stackexchange.com/questions/192120",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/88660/"
] | Another tortured but colloquial phrase is "Who do I make it payable to?" | "To whom should I make out the cheque?"
or
"How exactly should I write the payee name?"
or simply and less formally,
"How should I spell your name on this cheque, please?"
are all reasonable alternatives. |
192,120 | I am writing an academic report and I am trying to figure out how to punctuate the following:
>
> The previous results cannot provide an answer to questions like, *what is the probability of* X *given* Y *and* Z *?*, because the precise correlations between the variables are still unknown.
>
>
>
My questions are:... | 2014/08/19 | [
"https://english.stackexchange.com/questions/192120",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/88660/"
] | Another tortured but colloquial phrase is "Who do I make it payable to?" | Please confirm the named payee so the check may be issued. |
3,998 | I'm searching a framework that allows to... [cut]. I fear that such a question would be closed on stackexchange wordpress. Where can I ask it and hope to receive some useful answers? Thank you. | 2015/04/06 | [
"https://wordpress.meta.stackexchange.com/questions/3998",
"https://wordpress.meta.stackexchange.com",
"https://wordpress.meta.stackexchange.com/users/20109/"
] | Recommendations are indeed considered to be not in scope here.
I think social media groups, such as [WordPress Developers at Google+](https://plus.google.com/communities/110928980572284315377), are typically recommended for questions that don't fit too well here. | There is a stack in beta that looks appropriate, though I have not read through the stack's specific terms: softwarerecs.stackexchange.com |
8,871,166 | I want to download a file in flex. Here is my desired flow
* User clicks "view"
* Code goes to backend and get the file as an array of bytes
* bytes sent from java to flex via a callback
* flex then opens dialog and user decides where to save the file
Unfortunately the last part is not on a user event but on the cal... | 2012/01/15 | [
"https://Stackoverflow.com/questions/8871166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/846476/"
] | You should use a [`download()` method of the `FileReference`](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#download%28%29). | How can I download a file from an FTP site (not HHTP). I can't use URLRequest for that.
I found some infos about using the socket, but all of them are for UPLOADING. I need to DOWNLOAD |
8,871,166 | I want to download a file in flex. Here is my desired flow
* User clicks "view"
* Code goes to backend and get the file as an array of bytes
* bytes sent from java to flex via a callback
* flex then opens dialog and user decides where to save the file
Unfortunately the last part is not on a user event but on the cal... | 2012/01/15 | [
"https://Stackoverflow.com/questions/8871166",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/846476/"
] | FileReference.save() method is not used when you want to save the result.. this method is called only when the mouse or keyboard event occurs. so my advice to you that don't use this method. You can use that method in other way like save the file using JAVA in on back end side. and the method will return you the path o... | How can I download a file from an FTP site (not HHTP). I can't use URLRequest for that.
I found some infos about using the socket, but all of them are for UPLOADING. I need to DOWNLOAD |
18,400,073 | I have strange WPF ObservableCollection behavior. By unclear reason when collection modified and there is another condition in getter-method in some property of my class, it does't modify View. Although CollectionChanged event was invoked!
Without condition in getter method collection works good.
Too complicated and ... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18400073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931033/"
] | If you are impatient type you can do a quick fix yourself.
* Open the FireBug xpi file with your favourite archive/zip manager. For linux users, you should find the file here:
~/.mozilla/firefox/[unique-id].default/extensions/firebug@software.joehewitt.com.xpi
* Navigate to `/content/firebug/console/` in the archive/... | Firefox 23.0.1 + Firebug 1.12.0 + FirePHP 0.7.2 - the same versions set and the same problem... I checked [FirePHP forum](http://forum.firephp.org/) and there is [a topic about this issue](http://firephp.842658.n2.nabble.com/FirePHP-0-7-2-does-not-work-with-Firebug-1-12-0-under-Firefox-23-0-1-td7572767.html). Add-on au... |
18,400,073 | I have strange WPF ObservableCollection behavior. By unclear reason when collection modified and there is another condition in getter-method in some property of my class, it does't modify View. Although CollectionChanged event was invoked!
Without condition in getter method collection works good.
Too complicated and ... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18400073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931033/"
] | Firefox 23.0.1 + Firebug 1.12.0 + FirePHP 0.7.2 - the same versions set and the same problem... I checked [FirePHP forum](http://forum.firephp.org/) and there is [a topic about this issue](http://firephp.842658.n2.nabble.com/FirePHP-0-7-2-does-not-work-with-Firebug-1-12-0-under-Firefox-23-0-1-td7572767.html). Add-on au... | It appears that this issue with firePHP isn't being fixed any time soon and firebug has been updated again. Tom's answer does work but as he only specified a line number that part doesn't work in the newer version of firebug as the line numbers doesn't line up with the old ones SO here is how to find the correct place ... |
18,400,073 | I have strange WPF ObservableCollection behavior. By unclear reason when collection modified and there is another condition in getter-method in some property of my class, it does't modify View. Although CollectionChanged event was invoked!
Without condition in getter method collection works good.
Too complicated and ... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18400073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931033/"
] | Firefox 23.0.1 + Firebug 1.12.0 + FirePHP 0.7.2 - the same versions set and the same problem... I checked [FirePHP forum](http://forum.firephp.org/) and there is [a topic about this issue](http://firephp.842658.n2.nabble.com/FirePHP-0-7-2-does-not-work-with-Firebug-1-12-0-under-Firefox-23-0-1-td7572767.html). Add-on au... | [The problem](http://code.google.com/p/fbug/issues/detail?id=6803) is fixed with Firebug 1.12.3. |
18,400,073 | I have strange WPF ObservableCollection behavior. By unclear reason when collection modified and there is another condition in getter-method in some property of my class, it does't modify View. Although CollectionChanged event was invoked!
Without condition in getter method collection works good.
Too complicated and ... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18400073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931033/"
] | If you are impatient type you can do a quick fix yourself.
* Open the FireBug xpi file with your favourite archive/zip manager. For linux users, you should find the file here:
~/.mozilla/firefox/[unique-id].default/extensions/firebug@software.joehewitt.com.xpi
* Navigate to `/content/firebug/console/` in the archive/... | It appears that this issue with firePHP isn't being fixed any time soon and firebug has been updated again. Tom's answer does work but as he only specified a line number that part doesn't work in the newer version of firebug as the line numbers doesn't line up with the old ones SO here is how to find the correct place ... |
18,400,073 | I have strange WPF ObservableCollection behavior. By unclear reason when collection modified and there is another condition in getter-method in some property of my class, it does't modify View. Although CollectionChanged event was invoked!
Without condition in getter method collection works good.
Too complicated and ... | 2013/08/23 | [
"https://Stackoverflow.com/questions/18400073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931033/"
] | If you are impatient type you can do a quick fix yourself.
* Open the FireBug xpi file with your favourite archive/zip manager. For linux users, you should find the file here:
~/.mozilla/firefox/[unique-id].default/extensions/firebug@software.joehewitt.com.xpi
* Navigate to `/content/firebug/console/` in the archive/... | [The problem](http://code.google.com/p/fbug/issues/detail?id=6803) is fixed with Firebug 1.12.3. |
35,359,770 | I want to `get_post_type` of current post.
If I try `get_post_type()`, it does not return anything.
I tried `get_post_type(124)` and it works. 124 is the current post\_id.
In my function.php of child theme
```
<?php
global $post;
$my_post_type = get_post_type($post->ID);
?>
```
Can anybody tell me how to make `g... | 2016/02/12 | [
"https://Stackoverflow.com/questions/35359770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/496837/"
] | You could use the `FILTER` operator with the `EXCEPT WHERE` addition to filter out any rows that match the where clause:
```
lt_reducedresult = FILTER # ( lt_hugeresult EXCEPT WHERE col1 = 'a value'
AND col2 <> 'another value'
... | I compared old-fashioned syntax of your above example with table comprehension technique and got exactly the same result.
Actually, your sample is not functional because it lacks row specification for constructed table `reduced`.
Try this one, which worked for me.
```
DATA(reduced) = VALUE tty_mytype( FOR checklin... |
35,359,770 | I want to `get_post_type` of current post.
If I try `get_post_type()`, it does not return anything.
I tried `get_post_type(124)` and it works. 124 is the current post\_id.
In my function.php of child theme
```
<?php
global $post;
$my_post_type = get_post_type($post->ID);
?>
```
Can anybody tell me how to make `g... | 2016/02/12 | [
"https://Stackoverflow.com/questions/35359770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/496837/"
] | The Table Iterations may be a lot confusing when you use WHERE, because of parenthesis groups.
The "NOT EQUAL" condition is very well supported, as I show below in the solution of your first example. The issue you observe is due to misproper use of parenthesis groups.
You must absolutely define the whole logical expr... | I compared old-fashioned syntax of your above example with table comprehension technique and got exactly the same result.
Actually, your sample is not functional because it lacks row specification for constructed table `reduced`.
Try this one, which worked for me.
```
DATA(reduced) = VALUE tty_mytype( FOR checklin... |
35,359,770 | I want to `get_post_type` of current post.
If I try `get_post_type()`, it does not return anything.
I tried `get_post_type(124)` and it works. 124 is the current post\_id.
In my function.php of child theme
```
<?php
global $post;
$my_post_type = get_post_type($post->ID);
?>
```
Can anybody tell me how to make `g... | 2016/02/12 | [
"https://Stackoverflow.com/questions/35359770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/496837/"
] | The Table Iterations may be a lot confusing when you use WHERE, because of parenthesis groups.
The "NOT EQUAL" condition is very well supported, as I show below in the solution of your first example. The issue you observe is due to misproper use of parenthesis groups.
You must absolutely define the whole logical expr... | You could use the `FILTER` operator with the `EXCEPT WHERE` addition to filter out any rows that match the where clause:
```
lt_reducedresult = FILTER # ( lt_hugeresult EXCEPT WHERE col1 = 'a value'
AND col2 <> 'another value'
... |
28,305 | Say I have $f=x^2$ (surjective) and $g=e^x$ (injective), what would $f\circ g$ and $g\circ f$ be? (injective or surjective?)
Both $f$ and $g : \mathbb{R} \to \mathbb{R}$.
I've graphed these out using Maple but I don't know how to write the proof, please help me! | 2011/03/21 | [
"https://math.stackexchange.com/questions/28305",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8366/"
] | Examples to keep in mind for questions like this:
* Take $X = \{1\}$, $Y = \{a,b\}$, $Z =\{\bullet\}$. Let $f\colon X\to Y$ be given by $f(1)=a$, and $g\colon Y\to Z$ given by $g(a)=g(b)=\bullet$.
Then $g\circ f\colon X\to Z$ is bijective; note that $f$ is injective but not surjective, and that $g$ is surjective but ... | When you write $x$ in $f(x)=x^2$, it is a "dummy variable" in that you can put in anything in the proper range (here presumably the real numbers). So $f(g(x))=(g(x))^2$. Then you can expand the right side by inserting what you know about $g(x)$. Getting $g(f(x))$ is similar. Then for the injective/surjective part you c... |
28,305 | Say I have $f=x^2$ (surjective) and $g=e^x$ (injective), what would $f\circ g$ and $g\circ f$ be? (injective or surjective?)
Both $f$ and $g : \mathbb{R} \to \mathbb{R}$.
I've graphed these out using Maple but I don't know how to write the proof, please help me! | 2011/03/21 | [
"https://math.stackexchange.com/questions/28305",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8366/"
] | Examples to keep in mind for questions like this:
* Take $X = \{1\}$, $Y = \{a,b\}$, $Z =\{\bullet\}$. Let $f\colon X\to Y$ be given by $f(1)=a$, and $g\colon Y\to Z$ given by $g(a)=g(b)=\bullet$.
Then $g\circ f\colon X\to Z$ is bijective; note that $f$ is injective but not surjective, and that $g$ is surjective but ... | You should specify the domains and codomains of your functions.
I guess that
$f:\mathbb{R}\rightarrow\mathbb{R}\_{\geq 0}$ and $g:\mathbb{R}\rightarrow\mathbb{R}$, but there are some other natural definitions you could make.
You can write down the compositions explicitly:
$f\circ g:\mathbb{R}\rightarrow\mathbb{R}\_{\g... |
54,483,432 | I'm currently having issues with dynamic\_cast<> and how I've structured my code. So I have the Manager class, which gets a pointer and attempts to check if its a Derived object, and if it is, run some additional codes in the if statement. But in order for the dynamic\_cast<> to work, it requires the class definition t... | 2019/02/01 | [
"https://Stackoverflow.com/questions/54483432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10888246/"
] | Usually, you put declarations into the `.h` files of your project and the implementations of the methods into the `.cpp` files.
If you follow this way, all class definitions are known and you can, without issues, use dynamic cast in this case. | I had to clean up the code, you should at least have well formed code to work with or your error messages will be meaningless.
```
class BaseClass
{
virtual void VirtualClassName() = 0;
};
class Manager
{
void FunctionNameOne(const BaseClass* const ClassPointer);
};
class Derived : public BaseClass
{
voi... |
31,874,556 | I'm opening some old VB.NET projects in Visual Studio 2015 and when I edit the code, VS changes the syntax:
It removes "\_" in concatenations:
```
'Before
myString = "ABC" & _
"DEF"
'After
myString = "ABC" &
"DEF"
```
or add a space before !:
```
'Before
myDatatable.Rows(0)!myColumn
'After... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2693640/"
] | I had the same problem, and I was able to fix it by disabling the "Pretty listing" option in the editor. You can find this option here:
```
Tools > Options > Text Editor > Basic > Advanced > Editor Help > Pretty listing (reformatting) of code
```
I'm not sure what other auto-reformatting this option disables, but at... | Just CTRL-Z to undo the removal of the underscores right after Visual Studio (2015-19) "fixes" it for you. This leaves the "Pretty Listing" feature turned on but restores the missing underscores. Thanks David Carta for the answer left as a comment. |
31,874,556 | I'm opening some old VB.NET projects in Visual Studio 2015 and when I edit the code, VS changes the syntax:
It removes "\_" in concatenations:
```
'Before
myString = "ABC" & _
"DEF"
'After
myString = "ABC" &
"DEF"
```
or add a space before !:
```
'Before
myDatatable.Rows(0)!myColumn
'After... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2693640/"
] | I had the same problem, and I was able to fix it by disabling the "Pretty listing" option in the editor. You can find this option here:
```
Tools > Options > Text Editor > Basic > Advanced > Editor Help > Pretty listing (reformatting) of code
```
I'm not sure what other auto-reformatting this option disables, but at... | The official way to address this is modifying the .vbproj file to include
```
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
```
10 is for VS2010 as described at <https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/configure-language-version> |
31,874,556 | I'm opening some old VB.NET projects in Visual Studio 2015 and when I edit the code, VS changes the syntax:
It removes "\_" in concatenations:
```
'Before
myString = "ABC" & _
"DEF"
'After
myString = "ABC" &
"DEF"
```
or add a space before !:
```
'Before
myDatatable.Rows(0)!myColumn
'After... | 2015/08/07 | [
"https://Stackoverflow.com/questions/31874556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2693640/"
] | The official way to address this is modifying the .vbproj file to include
```
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
```
10 is for VS2010 as described at <https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/configure-language-version> | Just CTRL-Z to undo the removal of the underscores right after Visual Studio (2015-19) "fixes" it for you. This leaves the "Pretty Listing" feature turned on but restores the missing underscores. Thanks David Carta for the answer left as a comment. |
73,066,115 | I'm trying to set up a very basic scoreboard system which should work on every Windows machine without having to install anything (like Python). I'm not sure if a batch file is the way to go there, since it's really outdated, but I just went for it here. This is what I'm trying to do:
* Have a script that lets the ope... | 2022/07/21 | [
"https://Stackoverflow.com/questions/73066115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19594121/"
] | If as you say PowerShell is an option for you, you could do this:
```
$scores = while ($true) {
cls
$player = Read-Host "Please enter the name of a player. (an empty input exits)"
if ([string]::IsNullOrWhiteSpace($player)) {
break # exit the outer loop
}
while ($true) {
$points = ... | Seeing as this is a comma separated list, you can use `Import-Csv` as long as you assign it headers:
```
@"
500,Bob
390,Thomas
650,Sam
100,Nick
20,Olivia
"@ | ConvertFrom-Csv -Header "Numbers","Name" | Sort-Object -Property {[int]$_.Numbers}
```
I use `ConvertFrom-Csv` for this example but, `Import-Csv` will work th... |
73,066,115 | I'm trying to set up a very basic scoreboard system which should work on every Windows machine without having to install anything (like Python). I'm not sure if a batch file is the way to go there, since it's really outdated, but I just went for it here. This is what I'm trying to do:
* Have a script that lets the ope... | 2022/07/21 | [
"https://Stackoverflow.com/questions/73066115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19594121/"
] | If as you say PowerShell is an option for you, you could do this:
```
$scores = while ($true) {
cls
$player = Read-Host "Please enter the name of a player. (an empty input exits)"
if ([string]::IsNullOrWhiteSpace($player)) {
break # exit the outer loop
}
while ($true) {
$points = ... | An idea : Add 100000000 to `_points` before saving it. That way, you would have for instance
```
100000500,Bob
100000390,Thomas
```
Which will sort quite nicely. If you were analysing the data, you could use
```
for/f "tokens=1*delims=," %%b in (filename) do (
set /a points=%%b-100000000
echo !points! %%c
)
```
... |
73,066,115 | I'm trying to set up a very basic scoreboard system which should work on every Windows machine without having to install anything (like Python). I'm not sure if a batch file is the way to go there, since it's really outdated, but I just went for it here. This is what I'm trying to do:
* Have a script that lets the ope... | 2022/07/21 | [
"https://Stackoverflow.com/questions/73066115",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19594121/"
] | If as you say PowerShell is an option for you, you could do this:
```
$scores = while ($true) {
cls
$player = Read-Host "Please enter the name of a player. (an empty input exits)"
if ([string]::IsNullOrWhiteSpace($player)) {
break # exit the outer loop
}
while ($true) {
$points = ... | A Batch approach that uses nested for loops in conjunction with a temporary array to effect sorting via conditional assessment:
```bat
@Echo off & Cls
For /f "delims=" %%e in ('echo Prompt $E^|Cmd')Do Set "\E=%%e"
Setlocal EnableDelayedExpansion
Set "Players[i]=0"
REM substitue %~f0 below with the filep... |
1,281,184 | How do global variables work in Python? I know global variables are evil, I'm just experimenting.
This does not work in python:
```
G = None
def foo():
if G is None:
G = 1
foo()
```
I get an error:
```
UnboundLocalError: local variable 'G' referenced before assignment
```
What am I doing wrong? | 2009/08/15 | [
"https://Stackoverflow.com/questions/1281184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You need the [`global`](https://docs.python.org/3/reference/simple_stmts.html#global) statement:
```
def foo():
global G
if G is None:
G = 1
```
In Python, variables *that you assign to* become local variables by default. You need to use `global` to declare them as global variables. On the other hand... | You still have to declare G as global, from within that function:
```
G = None
def foo():
global G
if G is None:
G = 1
foo()
print G
```
which simply outputs
```
1
``` |
1,281,184 | How do global variables work in Python? I know global variables are evil, I'm just experimenting.
This does not work in python:
```
G = None
def foo():
if G is None:
G = 1
foo()
```
I get an error:
```
UnboundLocalError: local variable 'G' referenced before assignment
```
What am I doing wrong? | 2009/08/15 | [
"https://Stackoverflow.com/questions/1281184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You need the [`global`](https://docs.python.org/3/reference/simple_stmts.html#global) statement:
```
def foo():
global G
if G is None:
G = 1
```
In Python, variables *that you assign to* become local variables by default. You need to use `global` to declare them as global variables. On the other hand... | Define G as global in the function like this:
```
#!/usr/bin/python
G = None;
def foo():
global G
if G is None:
G = 1;
print G;
foo();
```
The above python prints `1`.
Using global variables like this is bad practice because: <http://c2.com/cgi/wiki?GlobalVariablesAreBad> |
1,281,184 | How do global variables work in Python? I know global variables are evil, I'm just experimenting.
This does not work in python:
```
G = None
def foo():
if G is None:
G = 1
foo()
```
I get an error:
```
UnboundLocalError: local variable 'G' referenced before assignment
```
What am I doing wrong? | 2009/08/15 | [
"https://Stackoverflow.com/questions/1281184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You need the [`global`](https://docs.python.org/3/reference/simple_stmts.html#global) statement:
```
def foo():
global G
if G is None:
G = 1
```
In Python, variables *that you assign to* become local variables by default. You need to use `global` to declare them as global variables. On the other hand... | You need to declare `G` as `global`, but as for why: whenever you refer to a variable inside a function, if you *set* the variable anywhere in that function, Python assumes that it's a local variable. So if a local variable by that name doesn't exist at that point in the code, you'll get the `UnboundLocalError`. If you... |
1,281,184 | How do global variables work in Python? I know global variables are evil, I'm just experimenting.
This does not work in python:
```
G = None
def foo():
if G is None:
G = 1
foo()
```
I get an error:
```
UnboundLocalError: local variable 'G' referenced before assignment
```
What am I doing wrong? | 2009/08/15 | [
"https://Stackoverflow.com/questions/1281184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You still have to declare G as global, from within that function:
```
G = None
def foo():
global G
if G is None:
G = 1
foo()
print G
```
which simply outputs
```
1
``` | Define G as global in the function like this:
```
#!/usr/bin/python
G = None;
def foo():
global G
if G is None:
G = 1;
print G;
foo();
```
The above python prints `1`.
Using global variables like this is bad practice because: <http://c2.com/cgi/wiki?GlobalVariablesAreBad> |
1,281,184 | How do global variables work in Python? I know global variables are evil, I'm just experimenting.
This does not work in python:
```
G = None
def foo():
if G is None:
G = 1
foo()
```
I get an error:
```
UnboundLocalError: local variable 'G' referenced before assignment
```
What am I doing wrong? | 2009/08/15 | [
"https://Stackoverflow.com/questions/1281184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You need to declare `G` as `global`, but as for why: whenever you refer to a variable inside a function, if you *set* the variable anywhere in that function, Python assumes that it's a local variable. So if a local variable by that name doesn't exist at that point in the code, you'll get the `UnboundLocalError`. If you... | Define G as global in the function like this:
```
#!/usr/bin/python
G = None;
def foo():
global G
if G is None:
G = 1;
print G;
foo();
```
The above python prints `1`.
Using global variables like this is bad practice because: <http://c2.com/cgi/wiki?GlobalVariablesAreBad> |
34,056,771 | I have the following code which I use to modify the node that is passed into the function recursively (the node is wrapped in an array so that the modification is persistent after the function returns):
Is there a better or cleaner way to modify the argument?
`
```
class node(object):
def __init__(self, value, ... | 2015/12/03 | [
"https://Stackoverflow.com/questions/34056771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5463834/"
] | To modify something, that thing has to be mutable. Your `node` instances are mutable:
```
n = node(3)
assert n.value == 3
n.value = 5
assert n.value == 5 # it was modified!
```
Also, your function fails to return any values. In your case it may be a wrong approach. Also, I frankly don't see why you would use number... | Because the parameter your are operating is object. You could use `__dict__` to change the whole property of the object. It is equivalent to change every property of the project. You could try the following code:
```
class node(object):
def __init__(self, value, next=None):
self._value = value
self... |
62,474,338 | I had this as part of an input tag:
```
onkeyup = "this.value = '#' + this.value;"
```
Which adds a hashtag with each letter. I only want 1 hashtag.
I also tried this:
```
onkeyup = "if (this.charAt(0) != '#') this.value = '#' + this.value;"
```
and this:
```
onkeyup = "if (this.charAt(0) != '#') this.value = '... | 2020/06/19 | [
"https://Stackoverflow.com/questions/62474338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12894604/"
] | Here is an example
```html
<input onkeyup="if (this.value[0] !== '#') this.value = '#' + this.value"></input>
```
The problem was that you needed to do `this.value.charAt(0)` or `this.value[0]` not `this.charAt(0)`
Hopefully, this helps.
EDIT: As [@epascarello](https://stackoverflow.com/users/14104/epascarello) [su... | Just get the final value and add it to before the first letter!
something like:
```
let finalword = "#" + this.value.toString.trim();
```
What do you actually need to do with that? |
62,474,338 | I had this as part of an input tag:
```
onkeyup = "this.value = '#' + this.value;"
```
Which adds a hashtag with each letter. I only want 1 hashtag.
I also tried this:
```
onkeyup = "if (this.charAt(0) != '#') this.value = '#' + this.value;"
```
and this:
```
onkeyup = "if (this.charAt(0) != '#') this.value = '... | 2020/06/19 | [
"https://Stackoverflow.com/questions/62474338",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12894604/"
] | Here is an example
```html
<input onkeyup="if (this.value[0] !== '#') this.value = '#' + this.value"></input>
```
The problem was that you needed to do `this.value.charAt(0)` or `this.value[0]` not `this.charAt(0)`
Hopefully, this helps.
EDIT: As [@epascarello](https://stackoverflow.com/users/14104/epascarello) [su... | I would just see if the string includes a `#` and if not, use a ternary operator to concatenate like below:
```
return this.value.includes('#') ? true : '#' + value
``` |
4,534,658 | Prove that $a^2+ab+b^2\geq 0$ for all $a,b$. My attempt
I supossed by contradiction that exist $a,b$ such that $a^2+b^2<-ab$ then $a^2+2ab+b^2\leq ab$ implies that
$(a+b)^2\leq ab$ therefore $a+b<\sqrt{ab}$ but
$\sqrt{ab}\leq \frac{a+b}{2}$ then $a+b<\frac{a+b}{2}$ contradiction.
Is fine my proof? Or exist other form... | 2022/09/19 | [
"https://math.stackexchange.com/questions/4534658",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/616791/"
] | Hint: Under $u=\tan x$, one has
\begin{eqnarray}
&&\int\_{0}^{\frac{\pi}{2}}{\frac{\tan{x}}{1+\tan^4{x}}}\frac{dx}{\cos^2x}\\
&=&\int\_{0}^{\infty}{\frac{udu}{1+u^4}}\\
&=&\frac12\arctan (u^2)\bigg|\_0^\infty\\
&=&\frac{\pi}{4}.
\end{eqnarray} | Another way:
$$I=\int\_{0}^{\pi/2} \frac{\sin x \cos x dx}{\sin^4 x+\cos^4x}=\int\_{0}^{\pi/2} \frac{2\sin x \cos x dx}{2[(\sin^2x+\cos^2 x)^2-2\sin^2 x \cos^2 x]}=\int\_{0}^{\pi/2} \frac{\sin 2x dx}{1+\cos^2 2x}$$
Use $t=\cos 2x$
$$\implies I=-\frac{1}{2}\int\_{1}^{-1}\frac{ dt}{1+t^2}=\frac{\pi}{4}. $$ |
4,534,658 | Prove that $a^2+ab+b^2\geq 0$ for all $a,b$. My attempt
I supossed by contradiction that exist $a,b$ such that $a^2+b^2<-ab$ then $a^2+2ab+b^2\leq ab$ implies that
$(a+b)^2\leq ab$ therefore $a+b<\sqrt{ab}$ but
$\sqrt{ab}\leq \frac{a+b}{2}$ then $a+b<\frac{a+b}{2}$ contradiction.
Is fine my proof? Or exist other form... | 2022/09/19 | [
"https://math.stackexchange.com/questions/4534658",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/616791/"
] | Hint: Under $u=\tan x$, one has
\begin{eqnarray}
&&\int\_{0}^{\frac{\pi}{2}}{\frac{\tan{x}}{1+\tan^4{x}}}\frac{dx}{\cos^2x}\\
&=&\int\_{0}^{\infty}{\frac{udu}{1+u^4}}\\
&=&\frac12\arctan (u^2)\bigg|\_0^\infty\\
&=&\frac{\pi}{4}.
\end{eqnarray} | \begin{align}
\int\_{0}^{\frac{\pi}{2}}{\frac{\sin{x}\cos{x}}{\cos^4{x}+\sin^4{x}}}dx
= \int\_{0}^{\frac{\pi}{2}}{\frac{\sin{2x}}{1+\cos^2{2x}}} \overset{\tan t=\cos 2x}{dx}
=\frac12\int\_{-\pi/4}^{\pi/4}dt=\frac\pi4
\end{align} |
4,534,658 | Prove that $a^2+ab+b^2\geq 0$ for all $a,b$. My attempt
I supossed by contradiction that exist $a,b$ such that $a^2+b^2<-ab$ then $a^2+2ab+b^2\leq ab$ implies that
$(a+b)^2\leq ab$ therefore $a+b<\sqrt{ab}$ but
$\sqrt{ab}\leq \frac{a+b}{2}$ then $a+b<\frac{a+b}{2}$ contradiction.
Is fine my proof? Or exist other form... | 2022/09/19 | [
"https://math.stackexchange.com/questions/4534658",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/616791/"
] | Another way:
$$I=\int\_{0}^{\pi/2} \frac{\sin x \cos x dx}{\sin^4 x+\cos^4x}=\int\_{0}^{\pi/2} \frac{2\sin x \cos x dx}{2[(\sin^2x+\cos^2 x)^2-2\sin^2 x \cos^2 x]}=\int\_{0}^{\pi/2} \frac{\sin 2x dx}{1+\cos^2 2x}$$
Use $t=\cos 2x$
$$\implies I=-\frac{1}{2}\int\_{1}^{-1}\frac{ dt}{1+t^2}=\frac{\pi}{4}. $$ | \begin{align}
\int\_{0}^{\frac{\pi}{2}}{\frac{\sin{x}\cos{x}}{\cos^4{x}+\sin^4{x}}}dx
= \int\_{0}^{\frac{\pi}{2}}{\frac{\sin{2x}}{1+\cos^2{2x}}} \overset{\tan t=\cos 2x}{dx}
=\frac12\int\_{-\pi/4}^{\pi/4}dt=\frac\pi4
\end{align} |
396,241 | I am working with a multicolumn document, in which I write a set of equations, and my tex file is producing equation that is stretched as follows
[](https://i.stack.imgur.com/wiqoO.png)
```
$(\int\limits_{-\infty}^\infty e^{-ax^2 + bx + c} =\sqrt{\df... | 2017/10/15 | [
"https://tex.stackexchange.com/questions/396241",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/141696/"
] | It's not good typographic practice to use `\int\limits` and `\dfrac` in inline-math formulas. I would also use `\exp(....)` notation instead of `e^{....}` notation, and I would use inline-fraction notation instead of `\frac` (let alone `\dfrac`. I'm pretty sure your readers will agree. :-)
I've tried to approximate th... | If you have so bad line, the following:
```
$(\int\limits_{-\infty}^\infty e^{-ax^2 + bx + c}
=\sqrt{\dfrac{\pi}{a}} e^{b^2/4a + c})$\hfill
```
at least moves undesired spaces to the end of line. |
396,241 | I am working with a multicolumn document, in which I write a set of equations, and my tex file is producing equation that is stretched as follows
[](https://i.stack.imgur.com/wiqoO.png)
```
$(\int\limits_{-\infty}^\infty e^{-ax^2 + bx + c} =\sqrt{\df... | 2017/10/15 | [
"https://tex.stackexchange.com/questions/396241",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/141696/"
] | There is a simple mechanism for this provided by TeX itself - just put `{...}` around the math expression (inside the dollars) that should not be broken or stretched.
[](https://i.stack.imgur.com/ty2Zc.png)
```
\documentclass[twocolumn]{article}
\usepackage{amsma... | If you have so bad line, the following:
```
$(\int\limits_{-\infty}^\infty e^{-ax^2 + bx + c}
=\sqrt{\dfrac{\pi}{a}} e^{b^2/4a + c})$\hfill
```
at least moves undesired spaces to the end of line. |
396,241 | I am working with a multicolumn document, in which I write a set of equations, and my tex file is producing equation that is stretched as follows
[](https://i.stack.imgur.com/wiqoO.png)
```
$(\int\limits_{-\infty}^\infty e^{-ax^2 + bx + c} =\sqrt{\df... | 2017/10/15 | [
"https://tex.stackexchange.com/questions/396241",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/141696/"
] | There is a simple mechanism for this provided by TeX itself - just put `{...}` around the math expression (inside the dollars) that should not be broken or stretched.
[](https://i.stack.imgur.com/ty2Zc.png)
```
\documentclass[twocolumn]{article}
\usepackage{amsma... | It's not good typographic practice to use `\int\limits` and `\dfrac` in inline-math formulas. I would also use `\exp(....)` notation instead of `e^{....}` notation, and I would use inline-fraction notation instead of `\frac` (let alone `\dfrac`. I'm pretty sure your readers will agree. :-)
I've tried to approximate th... |
5,945,527 | I've used example from [here](http://www.swamicharan.com/blog/air/minimizing-an-air-app-to-systemtray/comment-page-1/)
App doesn't open with double click.
Works
```
SystemTrayIcon(NativeApplication.nativeApplication.icon).addEventListener(MouseEvent.CLICK, unDock);
```
Doesn't work
```
SystemTrayIcon(NativeAppl... | 2011/05/10 | [
"https://Stackoverflow.com/questions/5945527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/642178/"
] | As alxx mentioned, this is not a bug, just a limitation.
What you should do is just listen for the click event and compare a the timestamp (getTimer()) between the 2 clicks, if under 400ms, then undock. | Thanks J\_A\_X. :)
```
SystemTrayIcon(NativeApplication.nativeApplication.icon).addEventListener(MouseEvent.CLICK, openWindow);
private var previousTimeStamp:int;
private function openWindow(event:Event):void
{
var currentTimeStamp:int = getTimer();
if(current... |
57,536,347 | I'm displaying certain dates from an ArrayList and using a formatter to shorten the date to "dd/MM" but when I compare the dates it doesn't work for the months. e.g. 17/08 IS before 19/08, 21/08 IS after 19/08 but 17/09 IS before 19/08. What my program achieves is showing any of the dates within the next 8 days.
I've ... | 2019/08/17 | [
"https://Stackoverflow.com/questions/57536347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11939706/"
] | When you format it converts to `String`. You are formatting and comparing. Hence it is doing `String` comparison. Hence, the result.
If you want the expected result, you must compare `Date` objects. I have modified your code to compare both `Strings` and `Dates`.
```
import java.text.SimpleDateFormat;
import java.uti... | You are comparing the strings of the date. The Calendar class implements the `Comparable` interface. It will compare correctly.
See <https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html>
So your code in the fixed version:
```
for (int i=0; i < arDat.size(); i++){
recDate = formatter.parse(arDat(i));... |
57,536,347 | I'm displaying certain dates from an ArrayList and using a formatter to shorten the date to "dd/MM" but when I compare the dates it doesn't work for the months. e.g. 17/08 IS before 19/08, 21/08 IS after 19/08 but 17/09 IS before 19/08. What my program achieves is showing any of the dates within the next 8 days.
I've ... | 2019/08/17 | [
"https://Stackoverflow.com/questions/57536347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11939706/"
] | `java.time.MonthDay`
====================
Instead of using outdated `Calendar` class you can use modern `java.time` classes. If you are interested in days and months you can use [`MonthDay`](https://docs.oracle.com/javase/8/docs/api/java/time/MonthDay.html) class and it's compareTo method :
```
MonthDay monthDay = Mo... | You are comparing the strings of the date. The Calendar class implements the `Comparable` interface. It will compare correctly.
See <https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html>
So your code in the fixed version:
```
for (int i=0; i < arDat.size(); i++){
recDate = formatter.parse(arDat(i));... |
57,536,347 | I'm displaying certain dates from an ArrayList and using a formatter to shorten the date to "dd/MM" but when I compare the dates it doesn't work for the months. e.g. 17/08 IS before 19/08, 21/08 IS after 19/08 but 17/09 IS before 19/08. What my program achieves is showing any of the dates within the next 8 days.
I've ... | 2019/08/17 | [
"https://Stackoverflow.com/questions/57536347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11939706/"
] | `java.time.MonthDay`
====================
Instead of using outdated `Calendar` class you can use modern `java.time` classes. If you are interested in days and months you can use [`MonthDay`](https://docs.oracle.com/javase/8/docs/api/java/time/MonthDay.html) class and it's compareTo method :
```
MonthDay monthDay = Mo... | When you format it converts to `String`. You are formatting and comparing. Hence it is doing `String` comparison. Hence, the result.
If you want the expected result, you must compare `Date` objects. I have modified your code to compare both `Strings` and `Dates`.
```
import java.text.SimpleDateFormat;
import java.uti... |
64,520,737 | I'm very new to the world of coding and C++. I'm tasked with taking numbers from a .txt doc with different lines of values. I need to do error checks on each line to make sure the file is in the correct format. I was hoping to make a class that I can reuse in order to do these checks. i,e:
1. get data from first line
... | 2020/10/25 | [
"https://Stackoverflow.com/questions/64520737",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7731109/"
] | @Jeff I found aditional steps (without documentation) to complete the merge process. After createMergeRequest you need to get mergeCommitId with [get merge](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/merges/get?view=azure-devops-rest-7.1) and update you branch with [update ref](https://learn.microsoft.... | I would recommend using the Git Api, instead...<https://learn.microsoft.com/en-us/dotnet/api/microsoft.teamfoundation.sourcecontrol.webapi.githttpclient?view=azure-devops-dotnet> |
17,808,558 | I have 2 columns inside a container div both with a `width of 50%`, 1 column has dummy text etc the other has a google map iframe. I have wrapped a fluid container around the map and applied `position absolute;` to the iframe to expand the map inside its container but I notice the map seems to shrink and expand a lot b... | 2013/07/23 | [
"https://Stackoverflow.com/questions/17808558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1977333/"
] | If the Sonar plugin is connecting to localhost that's an indication that it's using the default settings.
Using Maven, there are several ways to configure Sonar.
Jenkins plugin
==============
The [sonar plugin](https://wiki.jenkins-ci.org/display/JENKINS/Sonar+plugin) for jenkins is the simplest way to enable Sonar... | Looking at the similar issue over here, getting
```
...
[DEBUG] To prevent a memory leak, the JDBC Driver [com.mysql.jdbc.Driver] has been forcibly deregistered
[DEBUG] Delete temporary directories
...
```
and later
```
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli)... |
4,591,292 | I had searched a lot of examples, but none work perfect for me. I am using C#.
My application need to remove the files in folder, only when the file is closed.
The try-catch File.Open(...) method only works for certain filetype like doc, xls, ppt, pdf, mp3 etc, but not work for txt, zip, html etc... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4591292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415885/"
] | The behavior your are seeing doesn't have anything to do with the file's extension or contents. It has to do with the way the associated applications treat those files. For example, Notepad, Internet Explorer, etc will not hold a lock on an opened file once the contents are read. That's why .txt and .html files are abl... | Open the file in the binary mode File.Open(...) will work for all files. |
4,591,292 | I had searched a lot of examples, but none work perfect for me. I am using C#.
My application need to remove the files in folder, only when the file is closed.
The try-catch File.Open(...) method only works for certain filetype like doc, xls, ppt, pdf, mp3 etc, but not work for txt, zip, html etc... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4591292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415885/"
] | The behavior your are seeing doesn't have anything to do with the file's extension or contents. It has to do with the way the associated applications treat those files. For example, Notepad, Internet Explorer, etc will not hold a lock on an opened file once the contents are read. That's why .txt and .html files are abl... | Try opening the file in write mode, I think there is something to specify that the lock is exculsive..but for some reason if your thread dies..dunno if that lock will be released automatically... |
4,591,292 | I had searched a lot of examples, but none work perfect for me. I am using C#.
My application need to remove the files in folder, only when the file is closed.
The try-catch File.Open(...) method only works for certain filetype like doc, xls, ppt, pdf, mp3 etc, but not work for txt, zip, html etc... | 2011/01/04 | [
"https://Stackoverflow.com/questions/4591292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415885/"
] | The behavior your are seeing doesn't have anything to do with the file's extension or contents. It has to do with the way the associated applications treat those files. For example, Notepad, Internet Explorer, etc will not hold a lock on an opened file once the contents are read. That's why .txt and .html files are abl... | all you need is to delete the file that is not in use ... rigth ... Simply ignore the exception thrown by [File.Delete](http://msdn.microsoft.com/en-us/library/system.io.file.delete.aspx). Since it will not delete the file that is in use ..
```
try
{
File.Delete(path);
}
catch(Exception e)
{
// ignore ... or whate... |
3,553,492 | Let's say we have two sentences:
>
> Some cats are mammals
>
>
> Some cats are not mammals
>
>
>
Does this show that $\exists x P(x)$ and $\exists x\neg P(x)$ are logically equivalent? | 2020/02/20 | [
"https://math.stackexchange.com/questions/3553492",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/752554/"
] | Let $\lambda\_1, \dots, \lambda\_n$ be the eigenvalues of $T$. Then
$$\det(T) = \prod\_{i = 1}^n \lambda\_i.$$
Assume $T$ is invertible. Then $\det(T) \neq 0$. Now use the fact that in a field a product is zero if and only if at least one factor is zero. Hence, $\lambda\_i \neq 0$ for all $i$. This also proves the b... | It is not entirely true say that $\textsf{T}(v) = Av$ for some $A\in\textsf{M}\_{n \times n}(F)$ since we don't know that $v$ is a column vector that can be multiplied with $A$, $v$ could be anything!
Now, let me help you with the proof. For the $(\Rightarrow)$ direction, prove the contrapositive, that is, prove that ... |
33,913 | I was wondering when to use one over the other, when talking about a girl. I've seen 女の子 more often, but would like to know the nuances.
Interesting enough, I've only come across 男の子 for boys. But then again I haven't had the chance to read a lot of "real" Japanese text yet. | 2016/05/03 | [
"https://japanese.stackexchange.com/questions/33913",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/11369/"
] | 女の子 literally means "female child", thus *girl*. Despite the hiragana in the middle, it's already one solid word, always pronounced as おんなのこ{LHHLL}. The same applies to 男の子 (*boy*, おとこのこ{LHHLL}).
On the other hand, 子【し】 in 女子【じょし】 doesn't mean "child". The kanji here roughly means "one (who —)" (In Chinese, 男 and 女 ar... | 女の子 is younger than 女子 in my feeling. I feel 女の子 is around elementary school kids, and 女子 is around junior and senior high school students because we refer to them like 女子中学生 and 女子高校生.
However this feeling may vary from person to person and we sometimes use these words for adult women. |
33,913 | I was wondering when to use one over the other, when talking about a girl. I've seen 女の子 more often, but would like to know the nuances.
Interesting enough, I've only come across 男の子 for boys. But then again I haven't had the chance to read a lot of "real" Japanese text yet. | 2016/05/03 | [
"https://japanese.stackexchange.com/questions/33913",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/11369/"
] | 女の子 literally means "female child", thus *girl*. Despite the hiragana in the middle, it's already one solid word, always pronounced as おんなのこ{LHHLL}. The same applies to 男の子 (*boy*, おとこのこ{LHHLL}).
On the other hand, 子【し】 in 女子【じょし】 doesn't mean "child". The kanji here roughly means "one (who —)" (In Chinese, 男 and 女 ar... | 女子 is one that's categorized as female from a standpoint of some authority technically regardless of age like "women" as in sport or toilet. In this sense, 子 means "element".
女の子 is "girl". In this sense, 子 means "child". |
508,725 | Is it possible to install **terminology** on Ubuntu 14.04?
I didn't find anything helpful. Thanks! | 2014/08/08 | [
"https://askubuntu.com/questions/508725",
"https://askubuntu.com",
"https://askubuntu.com/users/275557/"
] | Run the following commands:
```
sudo add-apt-repository ppa:enlightenment-git/ppa
sudo apt-get update
sudo apt-get install terminology
```
This will install the latest Terminology (currently, version 0.6.99).

This is not the stable release though. If you want the stable releas... | For Ubuntu 14.10, the correct [installation sequence](https://www.enlightenment.org/distros/ubuntu-start) is:
```
sudo add-apt-repository ppa:niko2040/e19
sudo apt-get update
sudo apt-get install enlightenment
sudo apt-get install terminology
``` |
7,040,197 | I'm using a fileBrowser to find the files on the phone, but I wanted to show all files that my app can open to the user, and then the user chooses one. Like the Music Player, that show all songs on phone, on the sdcard and in the internal memory, not only the ones in the folder where the user is. | 2011/08/12 | [
"https://Stackoverflow.com/questions/7040197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/891775/"
] | Use file name filters while listing out the files. The below sample lists out all mp3 files in a given `root` directory (Note - The below code doesn't do it recursively for all folders under `root`) -
```
String files[] = root.list(audioFilter);
FilenameFilter audioFilter = new FilenameFilter() {
File f;
publ... | I don't know what FileBrowser implementation you are using but a good one should accept a [FileFilter](http://developer.android.com/reference/java/io/FileFilter.html). You can implement your own filter providing code for `public abstract boolean accept (File pathname)` |
37,330,359 | Nuget in Visual studio can't access a custom package source location on a shared network drive. I am able to browse the nuget.org and microsoft packages just fine. I just can't browse the local network share we have setup for custom nuget packages. When I try I get the error:
`the path '\\someserver\somefolder' for th... | 2016/05/19 | [
"https://Stackoverflow.com/questions/37330359",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/151325/"
] | Finally!... the answer!
**The problem was running visual studio as administrator.**
The network share nuget was trying to access required my own user credentials, but running visual studio as administrator uses the local administrator credentials which didn't have access to the share.
There are a few ways to preven... | Package Source must be given as wrong path.
Try this
* Go to references
* Right and Click on Manage Nu-get Packages
* On the top right you will see Package Source
* Package Source drop down will have a settings button over there
* Remove available packages
* In Machine wide package, **tick** Microsoft and .Net
* Remov... |
37,330,359 | Nuget in Visual studio can't access a custom package source location on a shared network drive. I am able to browse the nuget.org and microsoft packages just fine. I just can't browse the local network share we have setup for custom nuget packages. When I try I get the error:
`the path '\\someserver\somefolder' for th... | 2016/05/19 | [
"https://Stackoverflow.com/questions/37330359",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/151325/"
] | Finally!... the answer!
**The problem was running visual studio as administrator.**
The network share nuget was trying to access required my own user credentials, but running visual studio as administrator uses the local administrator credentials which didn't have access to the share.
There are a few ways to preven... | I also tried to access a mapped drive. The fix for me was rather than accessing it by letter, to use IP:
`P:\NuGet\packages` change to `\\10.10.1.11\NuGet\packages` |
37,330,359 | Nuget in Visual studio can't access a custom package source location on a shared network drive. I am able to browse the nuget.org and microsoft packages just fine. I just can't browse the local network share we have setup for custom nuget packages. When I try I get the error:
`the path '\\someserver\somefolder' for th... | 2016/05/19 | [
"https://Stackoverflow.com/questions/37330359",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/151325/"
] | Package Source must be given as wrong path.
Try this
* Go to references
* Right and Click on Manage Nu-get Packages
* On the top right you will see Package Source
* Package Source drop down will have a settings button over there
* Remove available packages
* In Machine wide package, **tick** Microsoft and .Net
* Remov... | I also tried to access a mapped drive. The fix for me was rather than accessing it by letter, to use IP:
`P:\NuGet\packages` change to `\\10.10.1.11\NuGet\packages` |
5,631,892 | If I click the treeview in master page's leftside menu, the file should open in contect place holder (main). Below is my code.
```
<form id="form1" runat="server">
<table>
<tr>
<td>
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
... | 2011/04/12 | [
"https://Stackoverflow.com/questions/5631892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/563537/"
] | Master pages were designed for page inheritance, not as a page to load other pages. What you should be doing is using aspx pages which inherit from the master page.
Here are some guides on them:
<http://www.asp.net/master-pages/tutorials>
If you really must load in html files I suggest using an iframe or opening them... | ```
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
Response.Redirect("Here goes the code that process the TreeView1.SelectedNode to get the appropriate URL");
}
``` |
20,946,067 | i have problem in below code any body can help me?
it's shows (DATEDIFE' is not a recognized built-in function name.) Error
```
com.CommandText = "select DATEDIFE(year,'2008-06-05','2010-06-05') AS XXX";
da = new SqlDataAdapter(com);
dt = new DataTable();
da.Fill(dt);
```
Best Regar... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20946067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3164702/"
] | You have a typo, Datedife -> Datediff. Try:
```
select Datediff(year,'2008-06-05','2010-06-05') AS XXX
``` | Its `DATEDIFF`
```
com.CommandText = "select DATEDIFF(year,'2008-06-05','2010-06-05') AS XXX";
da = new SqlDataAdapter(com);
dt = new DataTable();
da.Fill(dt);
``` |
20,946,067 | i have problem in below code any body can help me?
it's shows (DATEDIFE' is not a recognized built-in function name.) Error
```
com.CommandText = "select DATEDIFE(year,'2008-06-05','2010-06-05') AS XXX";
da = new SqlDataAdapter(com);
dt = new DataTable();
da.Fill(dt);
```
Best Regar... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20946067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3164702/"
] | You have a typo, Datedife -> Datediff. Try:
```
select Datediff(year,'2008-06-05','2010-06-05') AS XXX
``` | use `DATEDIFF`
```
com.CommandText = "select DATEDIFF(year,'2008-06-05','2010-06-05') AS XXX";
``` |
20,946,067 | i have problem in below code any body can help me?
it's shows (DATEDIFE' is not a recognized built-in function name.) Error
```
com.CommandText = "select DATEDIFE(year,'2008-06-05','2010-06-05') AS XXX";
da = new SqlDataAdapter(com);
dt = new DataTable();
da.Fill(dt);
```
Best Regar... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20946067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3164702/"
] | You have a typo, Datedife -> Datediff. Try:
```
select Datediff(year,'2008-06-05','2010-06-05') AS XXX
``` | use DATEDIFF(instead of DATEDIFE its a wrong keyword)
There is a spelling mistake in your query
```
SELECT DATEDIFF(YEAR,'2008-06-05','2010-06-05') AS XXX
``` |
20,946,067 | i have problem in below code any body can help me?
it's shows (DATEDIFE' is not a recognized built-in function name.) Error
```
com.CommandText = "select DATEDIFE(year,'2008-06-05','2010-06-05') AS XXX";
da = new SqlDataAdapter(com);
dt = new DataTable();
da.Fill(dt);
```
Best Regar... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20946067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3164702/"
] | Its `DATEDIFF`
```
com.CommandText = "select DATEDIFF(year,'2008-06-05','2010-06-05') AS XXX";
da = new SqlDataAdapter(com);
dt = new DataTable();
da.Fill(dt);
``` | use `DATEDIFF`
```
com.CommandText = "select DATEDIFF(year,'2008-06-05','2010-06-05') AS XXX";
``` |
20,946,067 | i have problem in below code any body can help me?
it's shows (DATEDIFE' is not a recognized built-in function name.) Error
```
com.CommandText = "select DATEDIFE(year,'2008-06-05','2010-06-05') AS XXX";
da = new SqlDataAdapter(com);
dt = new DataTable();
da.Fill(dt);
```
Best Regar... | 2014/01/06 | [
"https://Stackoverflow.com/questions/20946067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3164702/"
] | Its `DATEDIFF`
```
com.CommandText = "select DATEDIFF(year,'2008-06-05','2010-06-05') AS XXX";
da = new SqlDataAdapter(com);
dt = new DataTable();
da.Fill(dt);
``` | use DATEDIFF(instead of DATEDIFE its a wrong keyword)
There is a spelling mistake in your query
```
SELECT DATEDIFF(YEAR,'2008-06-05','2010-06-05') AS XXX
``` |
69,389,145 | All my projects report this error? Is there a setting or option I need to change to resolve this error?
```
app: failed At 9/30/2021 2:47 PM with 1 error
Task 'wrapper' not found in project ':app'.
Task 'wrapper' not found in project ':app'
* Try:
Run gradle tasks to get a list of available tasks.
Run with --stac... | 2021/09/30 | [
"https://Stackoverflow.com/questions/69389145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16918196/"
] | This is because your build.gradle file doesn't have a wrapper task. Add this code to build.gradle:
```
task wrapper(type: Wrapper){
gradleVersion = '7.2'
}
```
You can replace 7.2 with the gradle version you want, then run `gradle wrapper` task. | maybe your project's structure is :
---
```
yourProjectDir:
--> app:
--> build.gradle
--> otherModule1:
--> otherModule2:
--> build.gradle
```
---
The correct way to open the project is :
Click *build.gradle* in the root directory 'yourProjectDir', not *build.gradle* in the 'app' dir. |
65,139,605 | I am trying to get data from the API and it doesnot return any value. I have tried to put the apiUrl in the browser directly it works there. Even a get request via postman returns request.
```
fetch(apiUrl)
.then((response) => {
let data = JSON.parse(response)
console.log(data)
return data;... | 2020/12/04 | [
"https://Stackoverflow.com/questions/65139605",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10725274/"
] | Calling the API with Fetch gives a promise, and converting it to JSON will return yet another promise, which you need to "await" for again. This is how it should look like
```js
fetch(URL)
.then(response => response.json())
.then(json => console.log(json))
``` | ```
fetch(apiUrl)
.then((response) => {
return response.json().then( res => {
let data = res;
console.log(data)
return data;
})
})
```
try this |
48,954,024 | I have a custom `edittext` control which has a clear `(x)` icon set on the right when it's in focus and has text. Clicking the clear icon removes the text from the `textbox`. Unfortunately, when you click into the `textbox`, the focus change event is fired infinitely, as changing the compound `drawable` within the `foc... | 2018/02/23 | [
"https://Stackoverflow.com/questions/48954024",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98814/"
] | I learnt that the feature is not supported yet in cloudformation template. The console/APIs supports it. | Yes As of today AWS CloudFormation doesn't support option to specify "Encryption at rest". besides its available with AWS CLI and aws sdks like java or boto3.
<http://boto3.readthedocs.io/en/latest/reference/services/es.html>
<https://docs.aws.amazon.com/cli/latest/reference/es/create-elasticsearch-domain.html> |
48,954,024 | I have a custom `edittext` control which has a clear `(x)` icon set on the right when it's in focus and has text. Clicking the clear icon removes the text from the `textbox`. Unfortunately, when you click into the `textbox`, the focus change event is fired infinitely, as changing the compound `drawable` within the `foc... | 2018/02/23 | [
"https://Stackoverflow.com/questions/48954024",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98814/"
] | I learnt that the feature is not supported yet in cloudformation template. The console/APIs supports it. | Found that we can use terraform to deploy aws resources with all the options needed (including encryption at rest). Below is documentation.
<https://www.terraform.io/docs/providers/aws/r/elasticsearch_domain.html>
Hope that helps. |
48,954,024 | I have a custom `edittext` control which has a clear `(x)` icon set on the right when it's in focus and has text. Clicking the clear icon removes the text from the `textbox`. Unfortunately, when you click into the `textbox`, the focus change event is fired infinitely, as changing the compound `drawable` within the `foc... | 2018/02/23 | [
"https://Stackoverflow.com/questions/48954024",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98814/"
] | I learnt that the feature is not supported yet in cloudformation template. The console/APIs supports it. | Already added to CloudFormation <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain-encryptionatrestoptions.html> |
48,954,024 | I have a custom `edittext` control which has a clear `(x)` icon set on the right when it's in focus and has text. Clicking the clear icon removes the text from the `textbox`. Unfortunately, when you click into the `textbox`, the focus change event is fired infinitely, as changing the compound `drawable` within the `foc... | 2018/02/23 | [
"https://Stackoverflow.com/questions/48954024",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/98814/"
] | I learnt that the feature is not supported yet in cloudformation template. The console/APIs supports it. | Supported now by Cloudformation :
<https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html>
if you are trying to enable fine grained access then you will need:
Advanced Security Options:
<https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticsearch-domain... |
18,467,193 | In my angularjs app I am rendering my "navigation-bar" div for every page.
After user logs in and redirect to details page, then I want I am updating $scope which is not reflected into the view.
To reflect the change of $scope I am calling $digest by using $scope.$apply(). Seems it not updating and the $scope update ... | 2013/08/27 | [
"https://Stackoverflow.com/questions/18467193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2364090/"
] | Use [std::iterator\_traits](http://en.cppreference.com/w/cpp/iterator/iterator_traits)
```
template<class ITR>
void f(ITR begin, ITR end)
{
typename std::iterator_traits<ITR>::value_type temp = *begin;
}
``` | ```
typedef typename std::iterator_traits<ITR>::value_type value_type;
``` |
8,130 | Can anyone explain or post any link to a simple example and introduction about the
Security Token Service (STS)? | 2011/10/14 | [
"https://security.stackexchange.com/questions/8130",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/5436/"
] | Some posts I've written (.NET based, but basic enough):
* <http://blogs.objectsharp.com/cs/blogs/steve/archive/2010/10/30/the-basics-of-building-a-security-token-service.aspx>
* <http://blogs.objectsharp.com/cs/blogs/steve/archive/2011/07/04/part-4-secure-architecture.aspx> (section on *authentication*)
* <http://blog... | I don't know if there's anything I'd call "simple", but there are [Kerberos](http://www.gria.org/documentation/5.3/manual/client-management-user-guide/tt/using-the-kerberos-sts), [Sharepoint](http://technet.microsoft.com/en-us/library/ee806864.aspx), and [Apache](http://axis.apache.org/axis2/java/rampart/setting-up-sts... |
26,112,057 | I'm trying to upload an image via AJAX, but, the controller doesn't respond.
Error: uninitialized constant CarrierWave::MiniMagic.
Here is my code:
```
# encoding: utf-8
class ImagesUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
include Carrier... | 2014/09/30 | [
"https://Stackoverflow.com/questions/26112057",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4093364/"
] | ```
include CarrierWave::MiniMagick
```
You missed a 'k' at the end. | I guess you have forgot to mount the image up loader. Hope this link will help you
<http://railscasts.com/episodes/253-carrierwave-file-uploads> |
369,912 | Mysteriously, our connection is now ***very*** slow (10 KiB/s),
so it takes a very long time to download large files (>= 900 MB).
I'm searching for an online service that will:
1. **Download** the original file (given an URL)
2. **Compress** it (using GZIP, 7Z, RAR, PAQ, etc.)
3. Send me a **link to a compressed f... | 2011/12/20 | [
"https://superuser.com/questions/369912",
"https://superuser.com",
"https://superuser.com/users/78989/"
] | Most web-servers today implement the gzip compression on the data stream. Perhaps your remote web-server doesn't have that turned on?
Compressing files prior to sending them across the wire will yield little/no improvements on the actual amount of the data going over the wire. Rather than trying to transfer 900mb ... ... | I think that what you really need to do is figure out why your connection is unusually slow. Get in contact with your ISP if you must.
Beyond that, I'm not aware of any services that do what you ask, and most software distributed online is already compressed. In your particular example of an ISO, most of the time the ... |
369,912 | Mysteriously, our connection is now ***very*** slow (10 KiB/s),
so it takes a very long time to download large files (>= 900 MB).
I'm searching for an online service that will:
1. **Download** the original file (given an URL)
2. **Compress** it (using GZIP, 7Z, RAR, PAQ, etc.)
3. Send me a **link to a compressed f... | 2011/12/20 | [
"https://superuser.com/questions/369912",
"https://superuser.com",
"https://superuser.com/users/78989/"
] | Most web-servers today implement the gzip compression on the data stream. Perhaps your remote web-server doesn't have that turned on?
Compressing files prior to sending them across the wire will yield little/no improvements on the actual amount of the data going over the wire. Rather than trying to transfer 900mb ... ... | Try [Opera Turbo](http://www.opera.com/browser/turbo/). It is an online service provided by Opera. You can only use it through the Opera browser but it has been around a while and works fine. |
906,814 | Now I know that with positive powers of $i$ the cycle is: $i , -1 , -i , 1\ldots$
The negative power cycle is: $-i , -1 , i , 1 \ldots$
Can someone explain to me how $\frac 1 {\sqrt{-1}}$ is equal to $-i$ and $\frac 1 {-\sqrt{-1}}$ is equal to $i$? | 2014/08/23 | [
"https://math.stackexchange.com/questions/906814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/171256/"
] | For the first part of your question, multiply the fraction by $\frac{i}{i}$ & observe that:
$$\frac{1}{i}=\frac{i}{i\cdot i}=\frac{i}{-1}=-i$$
For the second part of the question, observe that:
$$\frac{1}{-i}=-\frac{1}{i}$$
Then use the reasoning that that $\frac{1}{i}=-i$ from the part one. If I've misunderstood wha... | $$i^{-1}=\frac1i=\frac i{i\cdot i}=\frac i{i^2}=\frac i{-1}=-i\quad\text{QED}$$
$$i^{-3}=\frac1{i^3}=\frac{i}{i^3\cdot i}=\frac{i}{i^4}=\frac{i}1=i\quad\text{QED}$$ |
906,814 | Now I know that with positive powers of $i$ the cycle is: $i , -1 , -i , 1\ldots$
The negative power cycle is: $-i , -1 , i , 1 \ldots$
Can someone explain to me how $\frac 1 {\sqrt{-1}}$ is equal to $-i$ and $\frac 1 {-\sqrt{-1}}$ is equal to $i$? | 2014/08/23 | [
"https://math.stackexchange.com/questions/906814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/171256/"
] | For the first part of your question, multiply the fraction by $\frac{i}{i}$ & observe that:
$$\frac{1}{i}=\frac{i}{i\cdot i}=\frac{i}{-1}=-i$$
For the second part of the question, observe that:
$$\frac{1}{-i}=-\frac{1}{i}$$
Then use the reasoning that that $\frac{1}{i}=-i$ from the part one. If I've misunderstood wha... | You know that $i^2 = -1$ (this is almost the definition of $i$, and anyway you've already written as much with your list of powers of $i$), and rearranging gives
$i(-i) = 1$,
so by definition $i^{-1} = -i$. Similarly, factoring the left-hand side of $i^4 = 1$ gives
$i(i^3) = 1$,
so
$i^{-3} = (i^3)^{-1} = i$.
Thou... |
906,814 | Now I know that with positive powers of $i$ the cycle is: $i , -1 , -i , 1\ldots$
The negative power cycle is: $-i , -1 , i , 1 \ldots$
Can someone explain to me how $\frac 1 {\sqrt{-1}}$ is equal to $-i$ and $\frac 1 {-\sqrt{-1}}$ is equal to $i$? | 2014/08/23 | [
"https://math.stackexchange.com/questions/906814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/171256/"
] | For the first part of your question, multiply the fraction by $\frac{i}{i}$ & observe that:
$$\frac{1}{i}=\frac{i}{i\cdot i}=\frac{i}{-1}=-i$$
For the second part of the question, observe that:
$$\frac{1}{-i}=-\frac{1}{i}$$
Then use the reasoning that that $\frac{1}{i}=-i$ from the part one. If I've misunderstood wha... | $\frac{1}i=i^{-1}$ is true by definition and $n+\frac{1}n=\frac{n^2+1}n$ (since $n=\frac{n^2}n$ and $\frac{n^2}n+\frac{1}n=\frac{n^2+1}n$) is also true. If you plug $i$ in $\frac{i^2+1}i=\frac{-1+1}i=\frac{0}i=0$.
Therefore $i+\frac{1}i=0$ and $\frac{1}i=-i$. By our original statement (namely $i^{-1}=\frac{1}i$) we can... |
906,814 | Now I know that with positive powers of $i$ the cycle is: $i , -1 , -i , 1\ldots$
The negative power cycle is: $-i , -1 , i , 1 \ldots$
Can someone explain to me how $\frac 1 {\sqrt{-1}}$ is equal to $-i$ and $\frac 1 {-\sqrt{-1}}$ is equal to $i$? | 2014/08/23 | [
"https://math.stackexchange.com/questions/906814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/171256/"
] | $$i^{-1}=\frac1i=\frac i{i\cdot i}=\frac i{i^2}=\frac i{-1}=-i\quad\text{QED}$$
$$i^{-3}=\frac1{i^3}=\frac{i}{i^3\cdot i}=\frac{i}{i^4}=\frac{i}1=i\quad\text{QED}$$ | You know that $i^2 = -1$ (this is almost the definition of $i$, and anyway you've already written as much with your list of powers of $i$), and rearranging gives
$i(-i) = 1$,
so by definition $i^{-1} = -i$. Similarly, factoring the left-hand side of $i^4 = 1$ gives
$i(i^3) = 1$,
so
$i^{-3} = (i^3)^{-1} = i$.
Thou... |
906,814 | Now I know that with positive powers of $i$ the cycle is: $i , -1 , -i , 1\ldots$
The negative power cycle is: $-i , -1 , i , 1 \ldots$
Can someone explain to me how $\frac 1 {\sqrt{-1}}$ is equal to $-i$ and $\frac 1 {-\sqrt{-1}}$ is equal to $i$? | 2014/08/23 | [
"https://math.stackexchange.com/questions/906814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/171256/"
] | $$i^{-1}=\frac1i=\frac i{i\cdot i}=\frac i{i^2}=\frac i{-1}=-i\quad\text{QED}$$
$$i^{-3}=\frac1{i^3}=\frac{i}{i^3\cdot i}=\frac{i}{i^4}=\frac{i}1=i\quad\text{QED}$$ | $\frac{1}i=i^{-1}$ is true by definition and $n+\frac{1}n=\frac{n^2+1}n$ (since $n=\frac{n^2}n$ and $\frac{n^2}n+\frac{1}n=\frac{n^2+1}n$) is also true. If you plug $i$ in $\frac{i^2+1}i=\frac{-1+1}i=\frac{0}i=0$.
Therefore $i+\frac{1}i=0$ and $\frac{1}i=-i$. By our original statement (namely $i^{-1}=\frac{1}i$) we can... |
906,814 | Now I know that with positive powers of $i$ the cycle is: $i , -1 , -i , 1\ldots$
The negative power cycle is: $-i , -1 , i , 1 \ldots$
Can someone explain to me how $\frac 1 {\sqrt{-1}}$ is equal to $-i$ and $\frac 1 {-\sqrt{-1}}$ is equal to $i$? | 2014/08/23 | [
"https://math.stackexchange.com/questions/906814",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/171256/"
] | $\frac{1}i=i^{-1}$ is true by definition and $n+\frac{1}n=\frac{n^2+1}n$ (since $n=\frac{n^2}n$ and $\frac{n^2}n+\frac{1}n=\frac{n^2+1}n$) is also true. If you plug $i$ in $\frac{i^2+1}i=\frac{-1+1}i=\frac{0}i=0$.
Therefore $i+\frac{1}i=0$ and $\frac{1}i=-i$. By our original statement (namely $i^{-1}=\frac{1}i$) we can... | You know that $i^2 = -1$ (this is almost the definition of $i$, and anyway you've already written as much with your list of powers of $i$), and rearranging gives
$i(-i) = 1$,
so by definition $i^{-1} = -i$. Similarly, factoring the left-hand side of $i^4 = 1$ gives
$i(i^3) = 1$,
so
$i^{-3} = (i^3)^{-1} = i$.
Thou... |
48,701,719 | Within HTTP2:
So when request one html page, with multiple domains(www.example.com, api.example.com...), it is said, there will be multiple connections.
but what if these domains share one same IP? Are there still multiple connections? | 2018/02/09 | [
"https://Stackoverflow.com/questions/48701719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2038901/"
] | That depends on the client.
<http://httpwg.org/specs/rfc7540.html#HttpExtra>
>
> Clients **SHOULD NOT** open more than one HTTP/2 connection to a given host and port pair, where the host is derived from a URI, a selected alternative service [ALT-SVC], or a configured proxy.
>
>
> ...
>
>
> A client **MAY** open ... | We had issues with this
Test setup with multiple environments on different servers behind a load balancer
* test1.domain
* test2.domain
* testx.domain
e.g. switching from test1.domain.com to test2.domain.com gave a 404 error or not authorized
The issue occurs because the load balancer expects the client to add an S... |
48,701,719 | Within HTTP2:
So when request one html page, with multiple domains(www.example.com, api.example.com...), it is said, there will be multiple connections.
but what if these domains share one same IP? Are there still multiple connections? | 2018/02/09 | [
"https://Stackoverflow.com/questions/48701719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2038901/"
] | As @mata says this is up to the client.
However one clear use case is in connection coalescing.
Under HTTP/1.1 domains were often sharded (e.g. [www.example.com](http://www.example.com) might also have a static.example.com domain for serving static assets). This was for two reasons:
1. To break the 6-8 connection li... | We had issues with this
Test setup with multiple environments on different servers behind a load balancer
* test1.domain
* test2.domain
* testx.domain
e.g. switching from test1.domain.com to test2.domain.com gave a 404 error or not authorized
The issue occurs because the load balancer expects the client to add an S... |
18,185,542 | OK, here's my issue and ~~I bet it'll be super-easy for you~~ (I guess it wasn't... lol).
So, let's say I'm having several `div`s. Once the user clicks on one of them, I want to highlight just this one. In a few words : a) remove (if exists) a specific class from all `div`s, b) add it to the `div` being clicked.
And ... | 2013/08/12 | [
"https://Stackoverflow.com/questions/18185542",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1270812/"
] | ```
$(function() {
$('div').on( "click", function() {
$(this).addClass('msp-selected');
$(this).siblings().removeClass('msp-selected');
})
``` | Try something like:
```
$(".box").click( function() {
if($(".activeBox").length > 0) { //check if there is an activeBox element
$(".activeBox").removeClass("activeBox"); //if there is, remove it
}
$(this).addClass("activeBox"); //make the clicked div the activeBox
});
```
`.box` and `.activeBox` classes... |
46,079,414 | I have a url that parts of it are converted into variables through htaccess and other parts are variables sent in GET.
```
mydomain.com/page/5/string?v2=foo&v3=bar
```
.httaccess sends 5 as a variable, let's call it v1
```
RewriteRule ^([^/]*)/([0-9]+)/(.*)$ page.php?v1=$2 [L,QSA]
```
And the rest of the query st... | 2017/09/06 | [
"https://Stackoverflow.com/questions/46079414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1243679/"
] | I think you can read `$_SERVER['REQUEST_URI']` and use proper regex to take the GET variables from URL. And then (if you need) you could write function to split them to array of variables:
```
$get = array(); //array for GET values
$uri = $_SERVER['REQUEST_URI'];
$uri_parts = explode('?', $uri, 2);
$get_string = $uri... | [how can I define variable in .htaccess file and use it?](https://stackoverflow.com/questions/30399109/how-can-i-define-variable-in-htaccess-file-and-use-it)
Example
```
SetEnv SPECIAL_PATH /foo/bin
```
<http://httpd.apache.org/docs/current/mod/mod_env.html#setenv> |
46,079,414 | I have a url that parts of it are converted into variables through htaccess and other parts are variables sent in GET.
```
mydomain.com/page/5/string?v2=foo&v3=bar
```
.httaccess sends 5 as a variable, let's call it v1
```
RewriteRule ^([^/]*)/([0-9]+)/(.*)$ page.php?v1=$2 [L,QSA]
```
And the rest of the query st... | 2017/09/06 | [
"https://Stackoverflow.com/questions/46079414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1243679/"
] | I think you can read `$_SERVER['REQUEST_URI']` and use proper regex to take the GET variables from URL. And then (if you need) you could write function to split them to array of variables:
```
$get = array(); //array for GET values
$uri = $_SERVER['REQUEST_URI'];
$uri_parts = explode('?', $uri, 2);
$get_string = $uri... | >
> I need to find a way to only get the variables sent in GET ignoring the ones from .htaccess.
>
>
>
You can use an environment variable to pass original query string to your `php` file:
```
RewriteRule ^([^/]+)/([0-9]+)/(.*)$ page.php?v1=$2 [E=qs:%{QUERY_STRING},L,QSA]
```
Now access original query string us... |
46,079,414 | I have a url that parts of it are converted into variables through htaccess and other parts are variables sent in GET.
```
mydomain.com/page/5/string?v2=foo&v3=bar
```
.httaccess sends 5 as a variable, let's call it v1
```
RewriteRule ^([^/]*)/([0-9]+)/(.*)$ page.php?v1=$2 [L,QSA]
```
And the rest of the query st... | 2017/09/06 | [
"https://Stackoverflow.com/questions/46079414",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1243679/"
] | >
> I need to find a way to only get the variables sent in GET ignoring the ones from .htaccess.
>
>
>
You can use an environment variable to pass original query string to your `php` file:
```
RewriteRule ^([^/]+)/([0-9]+)/(.*)$ page.php?v1=$2 [E=qs:%{QUERY_STRING},L,QSA]
```
Now access original query string us... | [how can I define variable in .htaccess file and use it?](https://stackoverflow.com/questions/30399109/how-can-i-define-variable-in-htaccess-file-and-use-it)
Example
```
SetEnv SPECIAL_PATH /foo/bin
```
<http://httpd.apache.org/docs/current/mod/mod_env.html#setenv> |
20,088,272 | I have a requirement to Transfer the Amount from `Paypal Merchant Account` to `End User Paypal account` in my `asp.net web application using C#`. Is it possible?
Here is the Scenario:
1. Consumers visits a website and want to sell some Products listed online on a website.
2. Login to website and choose the product to... | 2013/11/20 | [
"https://Stackoverflow.com/questions/20088272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1047280/"
] | there are a number of options available when it comes to transferring funds from a merchant account to another account (sending money).
1. MassPay API --> This is a robust solution you can use to send funds from one merchant to up to 250 recipients per call. This can be done via an API request and via the PayPal Accou... | download code in this link
asp.net code for paypal
<http://www.codeguru.com/dbfiles/get_file/Use_of_the_PayPal_VB_NET_src.zip?id=13851&lbl=USE_OF_THE_PAYPAL_VB_NET_SRC_ZIP> |
15,928,640 | The following query takes around 200 seconds to complete. What i'm trying to achieve is get users who have made 6 or more payments, who have not made any orders yet (there are 2 orders tables for different marketplaces).
`u.id`, `ju.id` are both primary keys.
I've indexed the `user_id` and `order_status` combined int... | 2013/04/10 | [
"https://Stackoverflow.com/questions/15928640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695408/"
] | You don't need to COUNT the rows of your orders, you need to retrieve users which doesn't have orders, that's not really the same thing.
Instead of counting, filter the users which have no orders :
```
SELECT
u.id,
ju.name,
COUNT(p.id) as payment_count
FROM users as u
INNER JOIN users2 as ju
... | Try removing the `COUNT() = 0` by a `IS NULL` check instead:
```
SELECT
u.id,
ju.name,
COUNT(p.id) as payment_count,
0 as order_count,
0 as marketplace_order_count
FROM users as u
INNER JOIN users2 as ju
ON u.id = ju.id
INNER JOIN payments as p
ON u.id = p.user_id
LEF... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.