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 |
|---|---|---|---|---|---|
19,697 | >
> **Possible Duplicate:**
>
> [When to use icons vs. icons with text vs. just text links?](https://ux.stackexchange.com/questions/1795/when-to-use-icons-vs-icons-with-text-vs-just-text-links)
>
>
>
I'm currently making a ticket system, but I don't know what would be better, icons for the main buttons or just... | 2012/04/05 | [
"https://ux.stackexchange.com/questions/19697",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/10707/"
] | If budget is not a problem, then use the same website having different styles for different devices. If you look at a good site on both web and mobile, you'll find that *almost* everything is there (browse to <http://ux.stackexchange.com> on your phone and be amazed).
You need to decide which features to leave out (*... | For your first query, I would recommend creating a full featured website without any mobile consideration at the outset. After which, move with distilling those features into the mobile space as a separate entity altogether. My reasoning is simply due to the fact that both web and mobile streams are becoming increasing... |
19,697 | >
> **Possible Duplicate:**
>
> [When to use icons vs. icons with text vs. just text links?](https://ux.stackexchange.com/questions/1795/when-to-use-icons-vs-icons-with-text-vs-just-text-links)
>
>
>
I'm currently making a ticket system, but I don't know what would be better, icons for the main buttons or just... | 2012/04/05 | [
"https://ux.stackexchange.com/questions/19697",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/10707/"
] | If budget is not a problem, then use the same website having different styles for different devices. If you look at a good site on both web and mobile, you'll find that *almost* everything is there (browse to <http://ux.stackexchange.com> on your phone and be amazed).
You need to decide which features to leave out (*... | I have used Bigcommerce platform in a few projects and I would give 8.5 out of 10.
The pros: It allows you to focus on UI design for the desktop version with total freedom and the mobile version is built automatically, sharing the same database of products and customers and one centralised CMS interface for administra... |
19,697 | >
> **Possible Duplicate:**
>
> [When to use icons vs. icons with text vs. just text links?](https://ux.stackexchange.com/questions/1795/when-to-use-icons-vs-icons-with-text-vs-just-text-links)
>
>
>
I'm currently making a ticket system, but I don't know what would be better, icons for the main buttons or just... | 2012/04/05 | [
"https://ux.stackexchange.com/questions/19697",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/10707/"
] | If budget is not a problem, then use the same website having different styles for different devices. If you look at a good site on both web and mobile, you'll find that *almost* everything is there (browse to <http://ux.stackexchange.com> on your phone and be amazed).
You need to decide which features to leave out (*... | The question of whether you should use a responsive design versus a purely mobile site is something only you can answer.
* Does one of the options take significantly more effort than the
other?
* How many users are visiting the current site today from a
mobile or tablet device?
I dislike the idea of mobile first. It... |
19,697 | >
> **Possible Duplicate:**
>
> [When to use icons vs. icons with text vs. just text links?](https://ux.stackexchange.com/questions/1795/when-to-use-icons-vs-icons-with-text-vs-just-text-links)
>
>
>
I'm currently making a ticket system, but I don't know what would be better, icons for the main buttons or just... | 2012/04/05 | [
"https://ux.stackexchange.com/questions/19697",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/10707/"
] | If budget is no object, and to best serve the needs of your users, I highly encourage you to take a mobile first philosophy. It will allow you to find the absolute essential features that users will need, that can be augmented for desktop and tablet, based on the available screen real estate and adding value to the exp... | For your first query, I would recommend creating a full featured website without any mobile consideration at the outset. After which, move with distilling those features into the mobile space as a separate entity altogether. My reasoning is simply due to the fact that both web and mobile streams are becoming increasing... |
19,697 | >
> **Possible Duplicate:**
>
> [When to use icons vs. icons with text vs. just text links?](https://ux.stackexchange.com/questions/1795/when-to-use-icons-vs-icons-with-text-vs-just-text-links)
>
>
>
I'm currently making a ticket system, but I don't know what would be better, icons for the main buttons or just... | 2012/04/05 | [
"https://ux.stackexchange.com/questions/19697",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/10707/"
] | If budget is no object, and to best serve the needs of your users, I highly encourage you to take a mobile first philosophy. It will allow you to find the absolute essential features that users will need, that can be augmented for desktop and tablet, based on the available screen real estate and adding value to the exp... | I have used Bigcommerce platform in a few projects and I would give 8.5 out of 10.
The pros: It allows you to focus on UI design for the desktop version with total freedom and the mobile version is built automatically, sharing the same database of products and customers and one centralised CMS interface for administra... |
19,697 | >
> **Possible Duplicate:**
>
> [When to use icons vs. icons with text vs. just text links?](https://ux.stackexchange.com/questions/1795/when-to-use-icons-vs-icons-with-text-vs-just-text-links)
>
>
>
I'm currently making a ticket system, but I don't know what would be better, icons for the main buttons or just... | 2012/04/05 | [
"https://ux.stackexchange.com/questions/19697",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/10707/"
] | If budget is no object, and to best serve the needs of your users, I highly encourage you to take a mobile first philosophy. It will allow you to find the absolute essential features that users will need, that can be augmented for desktop and tablet, based on the available screen real estate and adding value to the exp... | The question of whether you should use a responsive design versus a purely mobile site is something only you can answer.
* Does one of the options take significantly more effort than the
other?
* How many users are visiting the current site today from a
mobile or tablet device?
I dislike the idea of mobile first. It... |
2,441,078 | There seems to be a plethora of documentation tools for Python. Another one that I've run across is epydoc. It seems like Sphinx is the de facto standard, because it's used to generate the official Python docs. Can someone please sort out the current state of Python's documentation tools for me? | 2010/03/14 | [
"https://Stackoverflow.com/questions/2441078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62163/"
] | [epydoc](http://epydoc.sourceforge.net/) and [Sphinx](https://www.sphinx-doc.org) are different types of tools.
They are the same in that they:
* Both use [ReST](http://en.wikipedia.org/wiki/ReStructuredText) via [docutils](http://docutils.sourceforge.net/).
* Both are very Pythonic in their focus
* Both can generate... | It seems like [Epydoc](http://epydoc.sourceforge.net/) is, if not dead, at least pining for the fjords.
Sphynx with the [sphinx-apidoc](http://sphinx-doc.org/man/sphinx-apidoc.html) command and the [autodoc](http://sphinx-doc.org/ext/autodoc.html) extension looks to be the most popular option for API docs at this time... |
2,441,078 | There seems to be a plethora of documentation tools for Python. Another one that I've run across is epydoc. It seems like Sphinx is the de facto standard, because it's used to generate the official Python docs. Can someone please sort out the current state of Python's documentation tools for me? | 2010/03/14 | [
"https://Stackoverflow.com/questions/2441078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/62163/"
] | [epydoc](http://epydoc.sourceforge.net/) and [Sphinx](https://www.sphinx-doc.org) are different types of tools.
They are the same in that they:
* Both use [ReST](http://en.wikipedia.org/wiki/ReStructuredText) via [docutils](http://docutils.sourceforge.net/).
* Both are very Pythonic in their focus
* Both can generate... | I recently changed from Python2 to Python3 and found that there was no Epydoc package for Python3. So it seems with Python3 there is a clear focus on using Sphinx as API documentation. |
7,841,612 | I'm using nginx as a proxy server to forward requests onto my gunicorn server. When I run `sudo nginx -t -c /etc/nginx/sites-enabled/mysite` I get the following error.
```
[emerg]: unknown directive "upstream" in /etc/nginx/sites-enabled/mysite:1
configuration file /etc/nginx/sites-enabled/mysite test failed
```
Any... | 2011/10/20 | [
"https://Stackoverflow.com/questions/7841612",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288424/"
] | When you tell nginx to load that file directly, it starts at the global context. The upstream directive is only valid in the http context. When that file is included normally by nginx.conf, it is included already inside the http context:
```
events { }
http {
include /etc/nginx/sites-enabled/*;
}
```
You either ne... | Turns my nginx config was ok. The problem was with my gunicorn server was not running properly. |
7,841,612 | I'm using nginx as a proxy server to forward requests onto my gunicorn server. When I run `sudo nginx -t -c /etc/nginx/sites-enabled/mysite` I get the following error.
```
[emerg]: unknown directive "upstream" in /etc/nginx/sites-enabled/mysite:1
configuration file /etc/nginx/sites-enabled/mysite test failed
```
Any... | 2011/10/20 | [
"https://Stackoverflow.com/questions/7841612",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288424/"
] | When you tell nginx to load that file directly, it starts at the global context. The upstream directive is only valid in the http context. When that file is included normally by nginx.conf, it is included already inside the http context:
```
events { }
http {
include /etc/nginx/sites-enabled/*;
}
```
You either ne... | I am using nginx version: nginx/1.4.1 on EC2 Ubuntu. I was getting this error:
nginx: [emerg] "upstream" directive is not allowed here in /etc/nginx/nginx.conf
To get my instance running I had to wrap the upstream and server sections in an http { } section. It then complained about missing event section. So I added t... |
7,841,612 | I'm using nginx as a proxy server to forward requests onto my gunicorn server. When I run `sudo nginx -t -c /etc/nginx/sites-enabled/mysite` I get the following error.
```
[emerg]: unknown directive "upstream" in /etc/nginx/sites-enabled/mysite:1
configuration file /etc/nginx/sites-enabled/mysite test failed
```
Any... | 2011/10/20 | [
"https://Stackoverflow.com/questions/7841612",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288424/"
] | I am using nginx version: nginx/1.4.1 on EC2 Ubuntu. I was getting this error:
nginx: [emerg] "upstream" directive is not allowed here in /etc/nginx/nginx.conf
To get my instance running I had to wrap the upstream and server sections in an http { } section. It then complained about missing event section. So I added t... | Turns my nginx config was ok. The problem was with my gunicorn server was not running properly. |
46,173,552 | I would like to combine date and user email to one `base64` string, which now works like this:
```
public string GenerateUniqueToken(string email)
{
byte[] time = BitConverter.GetBytes(DateTime.UtcNow.ToBinary());
byte[] key = Encoding.ASCII.GetBytes(email);
string encoded = Convert.ToBase64String(time.Con... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46173552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2841351/"
] | As you know the length of the date you can read the time and email separately from the `byte[]`
```
//combine time and email
byte[] time = BitConverter.GetBytes(DateTime.UtcNow.ToBinary());
byte[] key = Encoding.ASCII.GetBytes("scottrobinson@notmyemail.com");
string encoded = Convert.ToBase64String(time.Concat(key).To... | Put a separator character between your date and your email name like # .
Then use the string.Split(), to break them off and put them on an string array.
The email will be on the index[1], of your array, while the date on the Index[0]. |
429,077 | I want to simply forward the RTP packet received from one IP:Port pair to another IP:Port pair. I have already done it with iptables. iptables use conntrack module. But there is no need of conntrack in my application. So I want to do it with stateless NAT.
I have found that statless NAT rules can be executed with "ip r... | 2018/03/08 | [
"https://unix.stackexchange.com/questions/429077",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/279664/"
] | By [mangling packet header fields](https://wiki.nftables.org/wiki-nftables/index.php/Mangle_packet_header_fields) with [nftables](https://wiki.nftables.org/wiki-nftables/index.php/What_is_nftables%3F) it's possible, without even using `ip route add nat` which, as a simple router functionality, is limited to layer 3 (IP... | It does not appear that Linux provides support for stateless NATing that allows you to restrict the behavior by a specific port or set of ports.
From the [iproute2 documentation](http://linux-ip.net/html/nat-stateless.html#idm140337856992368):
>
> Stateless NAT, occasionally maligned as dumb NAT, is the simplest for... |
429,077 | I want to simply forward the RTP packet received from one IP:Port pair to another IP:Port pair. I have already done it with iptables. iptables use conntrack module. But there is no need of conntrack in my application. So I want to do it with stateless NAT.
I have found that statless NAT rules can be executed with "ip r... | 2018/03/08 | [
"https://unix.stackexchange.com/questions/429077",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/279664/"
] | By [mangling packet header fields](https://wiki.nftables.org/wiki-nftables/index.php/Mangle_packet_header_fields) with [nftables](https://wiki.nftables.org/wiki-nftables/index.php/What_is_nftables%3F) it's possible, without even using `ip route add nat` which, as a simple router functionality, is limited to layer 3 (IP... | You need to edit the packets with tc pedit munge. Match the incoming port, rewrite packet destination as the LAN address, and reverse for the outgoing packet.
<https://www.man7.org/linux/man-pages/man8/tc-pedit.8.html>
The good side about tc is that it's fast, very fast. The bad side is the learning curve. |
20,712,270 | I upgraded to the latest version of vagrant
```
$ vagrant -v
Vagrant 1.4.1
```
Re-installed my plugins:
```
# Uninstall plugins
for i in vagrant-omnibus vagrant-chef-zero vagrant-berkshelf
do vagrant plugin uninstall $i
done
# Install plugins
for i in vagrant-omnibus vagrant-chef-zero vagrant-berkshelf
do vagrant... | 2013/12/20 | [
"https://Stackoverflow.com/questions/20712270",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/256618/"
] | You can also uninstall Ridley 2.4 via
```
env GEM_HOME=~/.vagrant.d/gems gem uninstall ridley -v 2.4.0
``` | This is a known issue. Until we have time to release a new version, you can use the "bleeding edge" as described here: <https://github.com/berkshelf/berkshelf/wiki/Howto:-Use-the-bleeding-edge>.
Sources:
* Core team member |
13,392,796 | I want to read VCard file .
I use [this](http://www.codeproject.com/Articles/17393/vCard-Reader-with-Lightweight-Approach) sample.
but when i use this solution for this file .
```
BEGIN:VCARD
VERSION:4.0
N:Gump;Forrest;;;
FN: Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO:http://www.example.com/dir_ph... | 2012/11/15 | [
"https://Stackoverflow.com/questions/13392796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1825829/"
] | You could try to find an existing library instead of reinventing the wheel. [This for instance](http://www.thoughtproject.com/Libraries/vCard/index.htm). | What options do you use?
If you don't use `IgnorePatternWhitespace`, then the spaces in your expression are a problem.
Another problem is, you check for a `;` before "VOICE", but in your string there is a `,`
Do you really need all those `*` quantifiers? If you want to make something optional, it is better to use th... |
13,392,796 | I want to read VCard file .
I use [this](http://www.codeproject.com/Articles/17393/vCard-Reader-with-Lightweight-Approach) sample.
but when i use this solution for this file .
```
BEGIN:VCARD
VERSION:4.0
N:Gump;Forrest;;;
FN: Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO:http://www.example.com/dir_ph... | 2012/11/15 | [
"https://Stackoverflow.com/questions/13392796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1825829/"
] | I use this regex for Address:
```
regex = new Regex(@"(?<strElement>(ADR)) (;(?<strAttr>[^\n\r]*))? (:(?<strPo>([^;]*))) (;(?<strBlock>([^;]*))) (;(?<strStreet>([^;]*))) (;(?<strCity>([^;]*))) (;(?<strRegion>([^;]*))) (;(?<strPostcode>([^;]*)))(;(?<strNation>[^\n\r]*))", options);
``` | What options do you use?
If you don't use `IgnorePatternWhitespace`, then the spaces in your expression are a problem.
Another problem is, you check for a `;` before "VOICE", but in your string there is a `,`
Do you really need all those `*` quantifiers? If you want to make something optional, it is better to use th... |
13,392,796 | I want to read VCard file .
I use [this](http://www.codeproject.com/Articles/17393/vCard-Reader-with-Lightweight-Approach) sample.
but when i use this solution for this file .
```
BEGIN:VCARD
VERSION:4.0
N:Gump;Forrest;;;
FN: Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO:http://www.example.com/dir_ph... | 2012/11/15 | [
"https://Stackoverflow.com/questions/13392796",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1825829/"
] | I use this regex for Address:
```
regex = new Regex(@"(?<strElement>(ADR)) (;(?<strAttr>[^\n\r]*))? (:(?<strPo>([^;]*))) (;(?<strBlock>([^;]*))) (;(?<strStreet>([^;]*))) (;(?<strCity>([^;]*))) (;(?<strRegion>([^;]*))) (;(?<strPostcode>([^;]*)))(;(?<strNation>[^\n\r]*))", options);
``` | You could try to find an existing library instead of reinventing the wheel. [This for instance](http://www.thoughtproject.com/Libraries/vCard/index.htm). |
7,454,983 | I'd like to sloothly move an image (or an element) from its actual X, Y location to X1, Y1.
When the **distance** between X and X1 **is equal** to that between Y and Y1 its easy.
But what if the X difference is say 100px and Y diff is 273px?
Being new to Javascript, I don't want to re-invent the wheel!
Besides, since... | 2011/09/17 | [
"https://Stackoverflow.com/questions/7454983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512602/"
] | One solution:
```
function translate( elem, x, y ) {
var left = parseInt( css( elem, 'left' ), 10 ),
top = parseInt( css( elem, 'top' ), 10 ),
dx = left - x,
dy = top - y,
i = 1,
count = 20,
delay = 20;
function loop() {
if ( i >= count ) { return; }
... | If you are targeting modern browsers, CSS transitions make the life easier (Example for firefox, for other browsers, change the -moz prefix):
```
<body>
<input type="button" onclick="move()" value="press" />
<div id="sq" style="position:absolute; top:50px; left:50px; height:50px; width:50px; background-color:B... |
7,454,983 | I'd like to sloothly move an image (or an element) from its actual X, Y location to X1, Y1.
When the **distance** between X and X1 **is equal** to that between Y and Y1 its easy.
But what if the X difference is say 100px and Y diff is 273px?
Being new to Javascript, I don't want to re-invent the wheel!
Besides, since... | 2011/09/17 | [
"https://Stackoverflow.com/questions/7454983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512602/"
] | One solution:
```
function translate( elem, x, y ) {
var left = parseInt( css( elem, 'left' ), 10 ),
top = parseInt( css( elem, 'top' ), 10 ),
dx = left - x,
dy = top - y,
i = 1,
count = 20,
delay = 20;
function loop() {
if ( i >= count ) { return; }
... | Doing smooth animation on systems with a variety of different capabilities (CPU, graphics power, other things going on on the computer) is not a trivial task. A proper implementation involves developing an effective "tweening" algorithm that can figure out adaptively (as the animation runs) what increments to be using ... |
7,454,983 | I'd like to sloothly move an image (or an element) from its actual X, Y location to X1, Y1.
When the **distance** between X and X1 **is equal** to that between Y and Y1 its easy.
But what if the X difference is say 100px and Y diff is 273px?
Being new to Javascript, I don't want to re-invent the wheel!
Besides, since... | 2011/09/17 | [
"https://Stackoverflow.com/questions/7454983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512602/"
] | One solution:
```
function translate( elem, x, y ) {
var left = parseInt( css( elem, 'left' ), 10 ),
top = parseInt( css( elem, 'top' ), 10 ),
dx = left - x,
dy = top - y,
i = 1,
count = 20,
delay = 20;
function loop() {
if ( i >= count ) { return; }
... | If I was going to write it from scratch I would start with something like this:
```
function linearEase(start, end, percent) {
return start + ((end - start) * percent);
}
function animateTo(settings) {
var elem = settings.element;
var ease = settings.ease;
var start = { left: elem.offsetLeft, top: e... |
7,454,983 | I'd like to sloothly move an image (or an element) from its actual X, Y location to X1, Y1.
When the **distance** between X and X1 **is equal** to that between Y and Y1 its easy.
But what if the X difference is say 100px and Y diff is 273px?
Being new to Javascript, I don't want to re-invent the wheel!
Besides, since... | 2011/09/17 | [
"https://Stackoverflow.com/questions/7454983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512602/"
] | Doing smooth animation on systems with a variety of different capabilities (CPU, graphics power, other things going on on the computer) is not a trivial task. A proper implementation involves developing an effective "tweening" algorithm that can figure out adaptively (as the animation runs) what increments to be using ... | If you are targeting modern browsers, CSS transitions make the life easier (Example for firefox, for other browsers, change the -moz prefix):
```
<body>
<input type="button" onclick="move()" value="press" />
<div id="sq" style="position:absolute; top:50px; left:50px; height:50px; width:50px; background-color:B... |
7,454,983 | I'd like to sloothly move an image (or an element) from its actual X, Y location to X1, Y1.
When the **distance** between X and X1 **is equal** to that between Y and Y1 its easy.
But what if the X difference is say 100px and Y diff is 273px?
Being new to Javascript, I don't want to re-invent the wheel!
Besides, since... | 2011/09/17 | [
"https://Stackoverflow.com/questions/7454983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512602/"
] | If you are targeting modern browsers, CSS transitions make the life easier (Example for firefox, for other browsers, change the -moz prefix):
```
<body>
<input type="button" onclick="move()" value="press" />
<div id="sq" style="position:absolute; top:50px; left:50px; height:50px; width:50px; background-color:B... | If I was going to write it from scratch I would start with something like this:
```
function linearEase(start, end, percent) {
return start + ((end - start) * percent);
}
function animateTo(settings) {
var elem = settings.element;
var ease = settings.ease;
var start = { left: elem.offsetLeft, top: e... |
7,454,983 | I'd like to sloothly move an image (or an element) from its actual X, Y location to X1, Y1.
When the **distance** between X and X1 **is equal** to that between Y and Y1 its easy.
But what if the X difference is say 100px and Y diff is 273px?
Being new to Javascript, I don't want to re-invent the wheel!
Besides, since... | 2011/09/17 | [
"https://Stackoverflow.com/questions/7454983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/512602/"
] | Doing smooth animation on systems with a variety of different capabilities (CPU, graphics power, other things going on on the computer) is not a trivial task. A proper implementation involves developing an effective "tweening" algorithm that can figure out adaptively (as the animation runs) what increments to be using ... | If I was going to write it from scratch I would start with something like this:
```
function linearEase(start, end, percent) {
return start + ((end - start) * percent);
}
function animateTo(settings) {
var elem = settings.element;
var ease = settings.ease;
var start = { left: elem.offsetLeft, top: e... |
55,084,003 | I am attempting to install `pyproj`, although am getting a `Proj executable not found. Please set PROJ_DIR variable` error.
COMMAND
-------
`$ pipenv install pyproj`
I have also tried `pipenv git+https://github.com/jswhit/pyproj.git#egg=pyproj` for the same result.
OUTPUT
------
`$ pipenv install pyproj
Installati... | 2019/03/10 | [
"https://Stackoverflow.com/questions/55084003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9330449/"
] | ```
pip install pyproj==1.9.6
```
Same issues, used above.
Installs the latest version previous to March 8th, 2019, if that suits your needs. | [Installation instructions](https://pyproj4.github.io/pyproj/v2.2.0rel/installation.html) recommend to install precompiled wheels or use conda package manager.
In case you still want to compile PyProj from sources you need to [setup PROJ.4](https://pyproj4.github.io/pyproj/v2.2.0rel/installation.html#setup-proj) (plea... |
39,038,079 | I'm totally stumped. I have a array holding all the files in a directory on my website. I use an `if` statement within a `foreach` loop to filter the results. If the file name begins with a certain combination of three letters `("wwa" or "wea" or "swa" or "hta" or "cta" or "twa" or "fra")` then that file name is assign... | 2016/08/19 | [
"https://Stackoverflow.com/questions/39038079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5799119/"
] | Your if syntax is wrong.
You can simplify the logic using an array:
```
//array of allowed substrings, used as index for quicker lookup
$substringKeys = array_flip(["wwa","wea","swa","hta","cta","twa","fra"]);
$alert_string='';
$alert_files = scandir("/home/prww/public_html/blog/");
foreach ($alert_files as $filena... | ```
("wwa" or "wea" or "swa" or "hta" or "cta" or "twa" or "fra")
```
yields a boolean TRUE. As long as `substr($values, 0, 3)` returns something, your conditional expression will always be TRUE.
You can't write code that looks like it makes sense in English without understanding how the operators actually work. And... |
39,038,079 | I'm totally stumped. I have a array holding all the files in a directory on my website. I use an `if` statement within a `foreach` loop to filter the results. If the file name begins with a certain combination of three letters `("wwa" or "wea" or "swa" or "hta" or "cta" or "twa" or "fra")` then that file name is assign... | 2016/08/19 | [
"https://Stackoverflow.com/questions/39038079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5799119/"
] | ```
("wwa" or "wea" or "swa" or "hta" or "cta" or "twa" or "fra")
```
yields a boolean TRUE. As long as `substr($values, 0, 3)` returns something, your conditional expression will always be TRUE.
You can't write code that looks like it makes sense in English without understanding how the operators actually work. And... | You can use function to achieve this with help for `array_map`
```
$alert_files = scandir("/home/prww/public_html/blog/");
$fileNames = array_filter(array_map("checkName",$alert_files));
print_r($fileNames);
function checkName($fileName)
{
$file = substr($fileName,0,3);
$conditionArray = array("wwa","wea","s... |
39,038,079 | I'm totally stumped. I have a array holding all the files in a directory on my website. I use an `if` statement within a `foreach` loop to filter the results. If the file name begins with a certain combination of three letters `("wwa" or "wea" or "swa" or "hta" or "cta" or "twa" or "fra")` then that file name is assign... | 2016/08/19 | [
"https://Stackoverflow.com/questions/39038079",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5799119/"
] | Your if syntax is wrong.
You can simplify the logic using an array:
```
//array of allowed substrings, used as index for quicker lookup
$substringKeys = array_flip(["wwa","wea","swa","hta","cta","twa","fra"]);
$alert_string='';
$alert_files = scandir("/home/prww/public_html/blog/");
foreach ($alert_files as $filena... | You can use function to achieve this with help for `array_map`
```
$alert_files = scandir("/home/prww/public_html/blog/");
$fileNames = array_filter(array_map("checkName",$alert_files));
print_r($fileNames);
function checkName($fileName)
{
$file = substr($fileName,0,3);
$conditionArray = array("wwa","wea","s... |
32,170,443 | In my android project, I have to include a class file **"X"** from library **"L"**. One dependency project also using the same Library **"L"** but older version.
Now my problem is when I include **"X"** it always imports latest version of **"L"**. But in some areas I need to include older version. How to achieve this ... | 2015/08/23 | [
"https://Stackoverflow.com/questions/32170443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3764306/"
] | You should not use the two different versions of same classes with same package structure in your project.
As ClassLoader will get confused which one to load.
Still if you really need to load two different versions of same class, refer [this](https://stackoverflow.com/questions/11759414/java-how-to-load-different-v... | I agree with comments and answers. There must be only one version of a library, suggested approach is to use of latest one.
Normally, libraries should support backward competibility (if no major release difference) with deprected annotation for warnings.
If you add both, it's not guaranteed which version your classlo... |
57,522,645 | We are dealing with a scenario where we need different retry strategies for different consumers in same application.
Please refer to below figure (a brief architecture diagram):
[](https://i.stack.imgur.com/CNwxg.png)
The `main_consumer` consumes p... | 2019/08/16 | [
"https://Stackoverflow.com/questions/57522645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6908062/"
] | This works fine for me...
```java
@SpringBootApplication
@EnableBinding(Inputs.class)
public class So57522645Application {
public static void main(String[] args) {
SpringApplication.run(So57522645Application.class, args);
}
@StreamListener("input1")
public void listen1(String in) {
Sy... | Per spring documentation - <https://docs.spring.io/spring-cloud-stream/docs/current/reference/html/_configuration_options.html>, maxAttempts configuration should be under
>
> "spring.cloud.stream.bindings.<channelName>.consumer."
>
>
>
In your configuration, it looks like is under
>
> "spring.cloud.stream.**k... |
25,354 | >
> **Possible Duplicate:**
>
> [What should I look for when shopping for my first DSLR?](https://photo.stackexchange.com/questions/2876/what-should-i-look-for-when-shopping-for-my-first-dslr)
>
>
>
I love taking photographs and simple digital cameras don't satisfy me. So I'd like something better.
I have neve... | 2012/07/16 | [
"https://photo.stackexchange.com/questions/25354",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/10660/"
] | Camera
------
Any entry-level DSLR will be excellent. The questions Akram Mellice pointed out:
* [Which DSLR brand should I pick as a beginning photographer?](https://photo.stackexchange.com/questions/6277/which-dslr-brand-should-i-pick-as-a-beginning-photographer)
* [What should I look for when shopping for my first... | You don't want to choose a camera on the basis of "easiness"!!!
While some cameras have more complex than average dark magic hidden underneath, most modern DSLRs in your price range will have "Automatic" modes and scene selections and more that allow you to use them in a similar manner to "point & shoots" while you ... |
25,354 | >
> **Possible Duplicate:**
>
> [What should I look for when shopping for my first DSLR?](https://photo.stackexchange.com/questions/2876/what-should-i-look-for-when-shopping-for-my-first-dslr)
>
>
>
I love taking photographs and simple digital cameras don't satisfy me. So I'd like something better.
I have neve... | 2012/07/16 | [
"https://photo.stackexchange.com/questions/25354",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/10660/"
] | Camera
------
Any entry-level DSLR will be excellent. The questions Akram Mellice pointed out:
* [Which DSLR brand should I pick as a beginning photographer?](https://photo.stackexchange.com/questions/6277/which-dslr-brand-should-i-pick-as-a-beginning-photographer)
* [What should I look for when shopping for my first... | My advice is to first identify which brand you want because that kind of locks you in lens-wise (all of your lenses should be compatible as you upgrade bodies, for the most part). Once you do that just get the cheapest one. The less features you have to confuse you the easier it will be to learn (crawl, walk, run). I'v... |
12,593,033 | I have an Ajax page with some large images which are preloaded. I feel the need to display a div with a loading message, and then to fade it out when all images are loaded. Currently I use this code:
```
$(function () {
$(window).load(function () {
$('#images-loading').css({
visibility: 'hidde... | 2012/09/26 | [
"https://Stackoverflow.com/questions/12593033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1404035/"
] | If you want to locally check for images loading, you could traverse over all `img` elements and check their `load` event or use a plugin such as [waitForImages](https://github.com/alexanderdickson/waitForImages) (disclaimer: written by me).
In the success callback, simply do...
```
$imagesLoading = $('#images-loading... | Currently you are doing a few little things wrong:
```
/// this first line basically says run my contents when the DOM is ready
$(function () {
/// this second line says run my contents when the window is fully loaded
/// but you are enabling this only after the DOM has loaded. Depending on
/// the browser these... |
38,958,659 | My listview item consists of three columns and three rows.I used TableLayout for it.The space between columns was not uniform but i managed by setting margins.Now the layout looks perfect.
```
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:la... | 2016/08/15 | [
"https://Stackoverflow.com/questions/38958659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3753273/"
] | `TableLayout` is advantageous or `LinearLayout` is depends on the application and layout you require.
Well, you can achieve everything by `LinearLayout`, which you can get from `TableLayout` as it `extends LinearLayout`.
>
> So, what’s the purpose of TableLayout?
>
>
>
Obviously, it gives more flexibility as you... | I think it is not about performance or optimization, but about convenient way to create tables. TableLayout and TableRow is like every utils class. It is not necessary, but nice to have as it is providing several useful features (like layout\_column).
If you will make your own Table with a horrible utils part then It ... |
38,958,659 | My listview item consists of three columns and three rows.I used TableLayout for it.The space between columns was not uniform but i managed by setting margins.Now the layout looks perfect.
```
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:la... | 2016/08/15 | [
"https://Stackoverflow.com/questions/38958659",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3753273/"
] | `TableLayout` is advantageous or `LinearLayout` is depends on the application and layout you require.
Well, you can achieve everything by `LinearLayout`, which you can get from `TableLayout` as it `extends LinearLayout`.
>
> So, what’s the purpose of TableLayout?
>
>
>
Obviously, it gives more flexibility as you... | This is depends on what your objective.
Yes, TableLayout extends from LinearLayout. But in TableLayout has more features which LinearLayout doesn't have. So if your requirements meet some exiting implemented functions, you can reduce your code and use it directly.
[TableLayout](https://developer.android.com/reference/... |
69,869,978 | Assume the following string:
```
@twitter @handles @hello
```
Using the code below, I can replace the strings and generate links
```
preg_replace(
'/(?:^|[^>])(@' . $data->entities->user_mentions[$i]->screen_name . ')/',
'<a href="https://twitter.com/' . $data->entities->user_mentions[$i]->screen_name . '">... | 2021/11/07 | [
"https://Stackoverflow.com/questions/69869978",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14603492/"
] | removed code duplication
```html
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Andreas</title>
<!-- styles -->
<link rel="stylesheet" href="stil.css" />
</head>
<body>
<div class="menu">
<div class="la... | Welcome @user17319549, you already add logic which is good, only some more lines.
You can just simply hide others when you are showing one.
The below code is pure javascript, while below in jquery. Right now jquery is used in the industry very widely.
```js
var vkabling = document.getElementById('KablingText');
var ... |
2,767,573 | I'm a little stumped by how I should go about proving that $\frac{1}{n+1}$ is a Cauchy sequence. I know that $\frac{1}{n}$ is a Cauchy sequence and understand the proof for that, but don't quite get how I can use that to show this is a Cauchy sequence.
I know that the definition of a Cauchy sequence is that for any se... | 2018/05/05 | [
"https://math.stackexchange.com/questions/2767573",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/559091/"
] | **Hint**
$$|a\_n-a\_m|= \frac{1}{n+1}-\frac{1}{m+1} \leq \frac{1}{n+1}+\frac{1}{m+1} \leq \frac{2}{N+1} < \epsilon $$ | Every convergent series in $\mathbb R$ is a Cauchy-sequence.
Let $a\_n$ be a convergent series with limit $a \in \mathbb R$. Then there exist an $N \in \mathbb R$ such that $|a\_n-a|\lt \frac{\epsilon}{2}$ and $|a\_m-a|\lt \frac{\epsilon}{2}$ for all $n,m\gt N$
Hence $|a\_n -a\_m|=|a\_n-a+a-a\_m|\le|a\_n-a|+|a\_m-a|... |
2,767,573 | I'm a little stumped by how I should go about proving that $\frac{1}{n+1}$ is a Cauchy sequence. I know that $\frac{1}{n}$ is a Cauchy sequence and understand the proof for that, but don't quite get how I can use that to show this is a Cauchy sequence.
I know that the definition of a Cauchy sequence is that for any se... | 2018/05/05 | [
"https://math.stackexchange.com/questions/2767573",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/559091/"
] | **Hint**
$$|a\_n-a\_m|= \frac{1}{n+1}-\frac{1}{m+1} \leq \frac{1}{n+1}+\frac{1}{m+1} \leq \frac{2}{N+1} < \epsilon $$ | *I'm a little stumped by how I should go about proving that $\frac{1}{n+1}$ is a Cauchy sequence. I know that $\frac{1}{n}$ is a Cauchy sequence and understand the proof for that, but don't quite get how I can use that to show this is a Cauchy sequence.*
Well, $\frac{1}{n+1}$ is a subsequence of $\frac{1}{n}$. And [a ... |
4,954 | I've been using ISO 9241 [(Ergonomics of Human System Interaction)](http://en.wikipedia.org/wiki/ISO_9241) over the years to provide some structure and rigour to my UX process. It suits the (standards driven) industry I'm currently working in and seems to help shift the perception from UX as 'look and feel' to somethin... | 2010/03/01 | [
"https://ux.stackexchange.com/questions/4954",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/682/"
] | **Short answer**
It matters if you are serious about improving your UX processes, even if only from a philosophical point of view that you can't improve something if there isn't a standard or benchmark to measure your progress against.
**Long answer**
I think in the earlier days of the UX field (even though many see... | I think it does matter - in that it provides good guidance on cententious issues like capitalisation of form label fields.
Anything that helps to standardise such things, reduces time spent having the same old conversations with visual designers, and allows us to do the important stuff - like solving problems - has to... |
4,954 | I've been using ISO 9241 [(Ergonomics of Human System Interaction)](http://en.wikipedia.org/wiki/ISO_9241) over the years to provide some structure and rigour to my UX process. It suits the (standards driven) industry I'm currently working in and seems to help shift the perception from UX as 'look and feel' to somethin... | 2010/03/01 | [
"https://ux.stackexchange.com/questions/4954",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/682/"
] | **Short answer**
It matters if you are serious about improving your UX processes, even if only from a philosophical point of view that you can't improve something if there isn't a standard or benchmark to measure your progress against.
**Long answer**
I think in the earlier days of the UX field (even though many see... | *Does ISO 9241 really matter?*
It matters to some kinds of organisations. (You'll see who by googling it) |
4,954 | I've been using ISO 9241 [(Ergonomics of Human System Interaction)](http://en.wikipedia.org/wiki/ISO_9241) over the years to provide some structure and rigour to my UX process. It suits the (standards driven) industry I'm currently working in and seems to help shift the perception from UX as 'look and feel' to somethin... | 2010/03/01 | [
"https://ux.stackexchange.com/questions/4954",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/682/"
] | I work as a usability engineer in Europe for a software developer company, and many of our customers come from the medical sector. And medical software has to be certified, although ISO 62366 is the usability norm for the medical sector. This means they have a need for usability experts that help get them through certi... | **Short answer**
It matters if you are serious about improving your UX processes, even if only from a philosophical point of view that you can't improve something if there isn't a standard or benchmark to measure your progress against.
**Long answer**
I think in the earlier days of the UX field (even though many see... |
4,954 | I've been using ISO 9241 [(Ergonomics of Human System Interaction)](http://en.wikipedia.org/wiki/ISO_9241) over the years to provide some structure and rigour to my UX process. It suits the (standards driven) industry I'm currently working in and seems to help shift the perception from UX as 'look and feel' to somethin... | 2010/03/01 | [
"https://ux.stackexchange.com/questions/4954",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/682/"
] | It's worth looking at the people who attend ISO working group meetings and examining the companies that they are from. Presumably, if their company sends them along to the meeting, then their company must be getting some benefit from it. At the ISO meetings I've attended, I've met people from IBM, HP, Philips, BT, NEC,... | No it does not matter. It's organizational candy for in-house teams fighting for position in corporations and some under-rated agencies stuggling to get some clients.
What does matter is... results. |
4,954 | I've been using ISO 9241 [(Ergonomics of Human System Interaction)](http://en.wikipedia.org/wiki/ISO_9241) over the years to provide some structure and rigour to my UX process. It suits the (standards driven) industry I'm currently working in and seems to help shift the perception from UX as 'look and feel' to somethin... | 2010/03/01 | [
"https://ux.stackexchange.com/questions/4954",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/682/"
] | No it does not matter. It's organizational candy for in-house teams fighting for position in corporations and some under-rated agencies stuggling to get some clients.
What does matter is... results. | *Does ISO 9241 really matter?*
It matters to some kinds of organisations. (You'll see who by googling it) |
4,954 | I've been using ISO 9241 [(Ergonomics of Human System Interaction)](http://en.wikipedia.org/wiki/ISO_9241) over the years to provide some structure and rigour to my UX process. It suits the (standards driven) industry I'm currently working in and seems to help shift the perception from UX as 'look and feel' to somethin... | 2010/03/01 | [
"https://ux.stackexchange.com/questions/4954",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/682/"
] | It's worth looking at the people who attend ISO working group meetings and examining the companies that they are from. Presumably, if their company sends them along to the meeting, then their company must be getting some benefit from it. At the ISO meetings I've attended, I've met people from IBM, HP, Philips, BT, NEC,... | **Short answer**
It matters if you are serious about improving your UX processes, even if only from a philosophical point of view that you can't improve something if there isn't a standard or benchmark to measure your progress against.
**Long answer**
I think in the earlier days of the UX field (even though many see... |
4,954 | I've been using ISO 9241 [(Ergonomics of Human System Interaction)](http://en.wikipedia.org/wiki/ISO_9241) over the years to provide some structure and rigour to my UX process. It suits the (standards driven) industry I'm currently working in and seems to help shift the perception from UX as 'look and feel' to somethin... | 2010/03/01 | [
"https://ux.stackexchange.com/questions/4954",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/682/"
] | I think it does matter - in that it provides good guidance on cententious issues like capitalisation of form label fields.
Anything that helps to standardise such things, reduces time spent having the same old conversations with visual designers, and allows us to do the important stuff - like solving problems - has to... | *Does ISO 9241 really matter?*
It matters to some kinds of organisations. (You'll see who by googling it) |
4,954 | I've been using ISO 9241 [(Ergonomics of Human System Interaction)](http://en.wikipedia.org/wiki/ISO_9241) over the years to provide some structure and rigour to my UX process. It suits the (standards driven) industry I'm currently working in and seems to help shift the perception from UX as 'look and feel' to somethin... | 2010/03/01 | [
"https://ux.stackexchange.com/questions/4954",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/682/"
] | It's worth looking at the people who attend ISO working group meetings and examining the companies that they are from. Presumably, if their company sends them along to the meeting, then their company must be getting some benefit from it. At the ISO meetings I've attended, I've met people from IBM, HP, Philips, BT, NEC,... | I think it does matter - in that it provides good guidance on cententious issues like capitalisation of form label fields.
Anything that helps to standardise such things, reduces time spent having the same old conversations with visual designers, and allows us to do the important stuff - like solving problems - has to... |
4,954 | I've been using ISO 9241 [(Ergonomics of Human System Interaction)](http://en.wikipedia.org/wiki/ISO_9241) over the years to provide some structure and rigour to my UX process. It suits the (standards driven) industry I'm currently working in and seems to help shift the perception from UX as 'look and feel' to somethin... | 2010/03/01 | [
"https://ux.stackexchange.com/questions/4954",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/682/"
] | I work as a usability engineer in Europe for a software developer company, and many of our customers come from the medical sector. And medical software has to be certified, although ISO 62366 is the usability norm for the medical sector. This means they have a need for usability experts that help get them through certi... | No it does not matter. It's organizational candy for in-house teams fighting for position in corporations and some under-rated agencies stuggling to get some clients.
What does matter is... results. |
4,954 | I've been using ISO 9241 [(Ergonomics of Human System Interaction)](http://en.wikipedia.org/wiki/ISO_9241) over the years to provide some structure and rigour to my UX process. It suits the (standards driven) industry I'm currently working in and seems to help shift the perception from UX as 'look and feel' to somethin... | 2010/03/01 | [
"https://ux.stackexchange.com/questions/4954",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/682/"
] | I work as a usability engineer in Europe for a software developer company, and many of our customers come from the medical sector. And medical software has to be certified, although ISO 62366 is the usability norm for the medical sector. This means they have a need for usability experts that help get them through certi... | *Does ISO 9241 really matter?*
It matters to some kinds of organisations. (You'll see who by googling it) |
21,831,009 | I would like to know what the difference between "Leaks" and "Allocations > # Living" shown in Instruments.app of Xcode 5 is. I used `iprofiler` command to check the memory leaks of my C++ command line application built with Clang++, and opened a `.dtps` file with Instrunents.app.
```
$ iprofiler -leaks ./a.out
$ open... | 2014/02/17 | [
"https://Stackoverflow.com/questions/21831009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1600278/"
] | Allocated and still living objects are those, that are still used by the app and a reference is hold onto. Using this number you may identify objects that you are still holding onto and thus use up memory. The allocation analysis helps you to improve memory usage issues. They are not leaked thug, but still referenced.
... | Thanks to Rob pointing out in the comments of this [question](https://stackoverflow.com/questions/56261915/does-xcode-memory-graph-offer-any-smart-visual-indicators-for-strong-references) I found this [WWDC 2012: iOS App performance: Memory; Minute 30](https://developer.apple.com/videos/play/wwdc2012/242/?time=1798). M... |
21,405,928 | Let's pretend I have
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10);
mIds.add(2,10);
```
I want to remove only one item of the `listview` but when I do this it removes all the items from the `ArrayList`. Do you know why?
```
int j=-1;
for (int i=0; i < mIds.size(); i++){
if... | 2014/01/28 | [
"https://Stackoverflow.com/questions/21405928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2650707/"
] | I guess you're using wrong argument in remove method. In the Collection interface you have this method:
* [remove(Object)](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html#remove%28java.lang.Object%29)
List has also a remove method:
* [remove(int index)](http://docs.oracle.com/javase/7/docs/api/jav... | I think you're mixing up two implementations of `remove()`. One receives an `Object`, the other an `int`, ant the behavior is distinct on each case. |
21,405,928 | Let's pretend I have
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10);
mIds.add(2,10);
```
I want to remove only one item of the `listview` but when I do this it removes all the items from the `ArrayList`. Do you know why?
```
int j=-1;
for (int i=0; i < mIds.size(); i++){
if... | 2014/01/28 | [
"https://Stackoverflow.com/questions/21405928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2650707/"
] | If you consider the value to remove element from the `List`, all element in the `List` will remove since all element has same value.
Consider the `index` to remove element
So just use
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10); // *
mIds.add(2,10);
mIds.remove(1); // 1 is... | I think you're mixing up two implementations of `remove()`. One receives an `Object`, the other an `int`, ant the behavior is distinct on each case. |
21,405,928 | Let's pretend I have
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10);
mIds.add(2,10);
```
I want to remove only one item of the `listview` but when I do this it removes all the items from the `ArrayList`. Do you know why?
```
int j=-1;
for (int i=0; i < mIds.size(); i++){
if... | 2014/01/28 | [
"https://Stackoverflow.com/questions/21405928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2650707/"
] | I guess you're using wrong argument in remove method. In the Collection interface you have this method:
* [remove(Object)](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html#remove%28java.lang.Object%29)
List has also a remove method:
* [remove(int index)](http://docs.oracle.com/javase/7/docs/api/jav... | ```
List_Of_Array.remove(index);
```
then update it
```
notifyDataSetChanged();
``` |
21,405,928 | Let's pretend I have
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10);
mIds.add(2,10);
```
I want to remove only one item of the `listview` but when I do this it removes all the items from the `ArrayList`. Do you know why?
```
int j=-1;
for (int i=0; i < mIds.size(); i++){
if... | 2014/01/28 | [
"https://Stackoverflow.com/questions/21405928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2650707/"
] | If you consider the value to remove element from the `List`, all element in the `List` will remove since all element has same value.
Consider the `index` to remove element
So just use
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10); // *
mIds.add(2,10);
mIds.remove(1); // 1 is... | I guess you're using wrong argument in remove method. In the Collection interface you have this method:
* [remove(Object)](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html#remove%28java.lang.Object%29)
List has also a remove method:
* [remove(int index)](http://docs.oracle.com/javase/7/docs/api/jav... |
21,405,928 | Let's pretend I have
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10);
mIds.add(2,10);
```
I want to remove only one item of the `listview` but when I do this it removes all the items from the `ArrayList`. Do you know why?
```
int j=-1;
for (int i=0; i < mIds.size(); i++){
if... | 2014/01/28 | [
"https://Stackoverflow.com/questions/21405928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2650707/"
] | I guess you're using wrong argument in remove method. In the Collection interface you have this method:
* [remove(Object)](http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html#remove%28java.lang.Object%29)
List has also a remove method:
* [remove(int index)](http://docs.oracle.com/javase/7/docs/api/jav... | mIds.remove(2) will remove the element on index 2.
mIds.remove(Integer.valueOf(10)) will remove the first occurrence, if present. In this case it is present. |
21,405,928 | Let's pretend I have
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10);
mIds.add(2,10);
```
I want to remove only one item of the `listview` but when I do this it removes all the items from the `ArrayList`. Do you know why?
```
int j=-1;
for (int i=0; i < mIds.size(); i++){
if... | 2014/01/28 | [
"https://Stackoverflow.com/questions/21405928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2650707/"
] | If you consider the value to remove element from the `List`, all element in the `List` will remove since all element has same value.
Consider the `index` to remove element
So just use
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10); // *
mIds.add(2,10);
mIds.remove(1); // 1 is... | ```
List_Of_Array.remove(index);
```
then update it
```
notifyDataSetChanged();
``` |
21,405,928 | Let's pretend I have
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10);
mIds.add(2,10);
```
I want to remove only one item of the `listview` but when I do this it removes all the items from the `ArrayList`. Do you know why?
```
int j=-1;
for (int i=0; i < mIds.size(); i++){
if... | 2014/01/28 | [
"https://Stackoverflow.com/questions/21405928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2650707/"
] | If you consider the value to remove element from the `List`, all element in the `List` will remove since all element has same value.
Consider the `index` to remove element
So just use
```
List<Integer> mIds = new ArrayList<Integer>();
mIds.add(0,10);
mIds.add(1,10); // *
mIds.add(2,10);
mIds.remove(1); // 1 is... | mIds.remove(2) will remove the element on index 2.
mIds.remove(Integer.valueOf(10)) will remove the first occurrence, if present. In this case it is present. |
56,496,809 | I have an app based on a vue.js webpack template. I needed to use the syntax of private fields and private methods of classes. For this, I installed @babel/plugin-proposal-private-methods ^7.4.4 and @babel/core^7.0.0. After installing the packages, I tried to build a development version, but I got the following errors.... | 2019/06/07 | [
"https://Stackoverflow.com/questions/56496809",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5691643/"
] | It looks like you are loading @babel/core@7.X.X with babel 6.
In other words you are calling the core compiler of babel seven with the api of babel 6.
Releasing babel 7, the babel team went on a major revamp and it's great but not retro compatible.
Your template was probably working with babel 6 and you need some ba... | Add the following to your nuxt.config.js file under the build section.
```
build: {
babel:{
plugins: [
['@babel/plugin-proposal-private-methods', { loose: true }]
]
}
}
``` |
11,646,745 | I am testing iphone application in xcode but it is giving unkonwo error
pplications are expected to have a root view controller at the end of application launch
wait\_fences: failed to receive reply: 10004003
i don't know why when view is loaded it breaks the application and gives this error
```
My code where it ... | 2012/07/25 | [
"https://Stackoverflow.com/questions/11646745",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1520252/"
] | You have to set the rootController in the AppDelegate
```
[self.window setRootViewController:tabBarController];
```
Use %i instead of %d
```
int count =[surveyList count];
NSLog(@"Total is %i",count);
``` | You have to set following method in AppDelegate.m file.
```
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after applicatio... |
1,948,596 | I've been using MSTest so far for my unit-tests, and found that it would sometimes randomly break my builds for no reason. The builds would fail in VS but compile fine in MSBuild - with error like 'option strict does not allow IFoo to cast to type IFoo'. I believe I have finally fixed it, but after the bug coming back ... | 2009/12/22 | [
"https://Stackoverflow.com/questions/1948596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/191206/"
] | At [Safewhere](http://www.safewhere.net) we currently use MSTest for TDD, and it works out okay.
Personally, I love the **IDE integration**, but dislike the API. If it ever becomes possible to integrate [xUnit.NET](http://xunit.codeplex.com/) with the VS test runner, we will migrate very soon thereafter.
At least wit... | I've been using MS Test since VS 2008 came out, but I haven't managed to strong-arm anything like TDD or CI here at work, although I've messed with Cruise Control a little in an attempt to build a CI server on my local box.
In general I've found MS Test to be pretty decent for testing locally, but there are some pain... |
1,948,596 | I've been using MSTest so far for my unit-tests, and found that it would sometimes randomly break my builds for no reason. The builds would fail in VS but compile fine in MSBuild - with error like 'option strict does not allow IFoo to cast to type IFoo'. I believe I have finally fixed it, but after the bug coming back ... | 2009/12/22 | [
"https://Stackoverflow.com/questions/1948596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/191206/"
] | At [Safewhere](http://www.safewhere.net) we currently use MSTest for TDD, and it works out okay.
Personally, I love the **IDE integration**, but dislike the API. If it ever becomes possible to integrate [xUnit.NET](http://xunit.codeplex.com/) with the VS test runner, we will migrate very soon thereafter.
At least wit... | I have been using MSTest very successfully in our company. We are currently setting up standardised build processes within our company and so far, we have had good success with TeamCity. For Continuous integration, we use out the box TeamCity configurations. For the actual release builds, we set up large msbuild script... |
1,948,596 | I've been using MSTest so far for my unit-tests, and found that it would sometimes randomly break my builds for no reason. The builds would fail in VS but compile fine in MSBuild - with error like 'option strict does not allow IFoo to cast to type IFoo'. I believe I have finally fixed it, but after the bug coming back ... | 2009/12/22 | [
"https://Stackoverflow.com/questions/1948596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/191206/"
] | At [Safewhere](http://www.safewhere.net) we currently use MSTest for TDD, and it works out okay.
Personally, I love the **IDE integration**, but dislike the API. If it ever becomes possible to integrate [xUnit.NET](http://xunit.codeplex.com/) with the VS test runner, we will migrate very soon thereafter.
At least wit... | I have successfully deployed several FinalBuilder installations and the customers have been very happy with the outcome. I can highly recommend it. |
1,948,596 | I've been using MSTest so far for my unit-tests, and found that it would sometimes randomly break my builds for no reason. The builds would fail in VS but compile fine in MSBuild - with error like 'option strict does not allow IFoo to cast to type IFoo'. I believe I have finally fixed it, but after the bug coming back ... | 2009/12/22 | [
"https://Stackoverflow.com/questions/1948596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/191206/"
] | I've been using MS Test since VS 2008 came out, but I haven't managed to strong-arm anything like TDD or CI here at work, although I've messed with Cruise Control a little in an attempt to build a CI server on my local box.
In general I've found MS Test to be pretty decent for testing locally, but there are some pain... | I have successfully deployed several FinalBuilder installations and the customers have been very happy with the outcome. I can highly recommend it. |
1,948,596 | I've been using MSTest so far for my unit-tests, and found that it would sometimes randomly break my builds for no reason. The builds would fail in VS but compile fine in MSBuild - with error like 'option strict does not allow IFoo to cast to type IFoo'. I believe I have finally fixed it, but after the bug coming back ... | 2009/12/22 | [
"https://Stackoverflow.com/questions/1948596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/191206/"
] | I have been using MSTest very successfully in our company. We are currently setting up standardised build processes within our company and so far, we have had good success with TeamCity. For Continuous integration, we use out the box TeamCity configurations. For the actual release builds, we set up large msbuild script... | I have successfully deployed several FinalBuilder installations and the customers have been very happy with the outcome. I can highly recommend it. |
1,583,553 | Has anyone got practical experience or a reference for a scheme that implements a key management scheme that would comply with the [PCI DSS](https://www.pcisecuritystandards.org/security_standards/pci_dss_download.html) security standard?
There are obviously quite a few implementations around given the number of compa... | 2009/10/17 | [
"https://Stackoverflow.com/questions/1583553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/75658/"
] | I'm familiar with the pain you're going through. We struggled to update an old EFT system towards PCI compliance. Key management was certainly (from my software point of view) the most challenging part.
I think I also stumbled into the [NIST Recommendations for Key Management](http://csrc.nist.gov/groups/ST/toolkit/ke... | Have you seen NIST [SP 800-57](http://csrc.nist.gov/groups/ST/toolkit/key_management.html), Recommendation for Key Management? |
52,473,635 | I am new to elasticsearch.I am using elasticsearch with django.I successfully created elasticsearch index,
```
{
"productcategories": {
"aliases": {},
"mappings": {
"product_categories": {
"properties": {
"categoryName": {
"type": "text"
}... | 2018/09/24 | [
"https://Stackoverflow.com/questions/52473635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9944683/"
] | You need convert dates to datetimes first - by parameter `parse_dates` in [`read_csv`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html) or [`pandas.to_datetime`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.to_datetime.html), last use [`Series.dt.month_name`](http://pandas.pyd... | ```
dataset['Date'] = pd.to_datetime(dataset['Date'])
## returns month
dataset['monthname'] = dataset['Date'].dt.month_name()
## returns day
dataset['day'] = dataset['Date'].dt.dayofweek()
## creating a map of dayofweek to day
s = {6 : 'Sunday', 0: 'Monday', 1: 'Tuesday',
2: 'Wednesday', 3: 'Thursday', 4: 'Frida... |
276,825 | I am looking for a correct expression for an activity when a person is injured or in a bad leath condition for any reason and is doing special exercises to feel better. Is it reeducate? Rehabilitate? Vindicate? Thank you. | 2015/09/29 | [
"https://english.stackexchange.com/questions/276825",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/139576/"
] | Of the words you've given "rehabilitate" is the best. However, rehabilitate has the connotation of recovery from drug use.
I would offer up "Physical therapy" as an alternative. E.g. "After my surgery I needed to do physical therapy on my shoulder for six months."
"re-learn" or "re-educate" could be used in an inform... | Rehabilitate is a word widely used in the medical profession for what you're describing. |
30,168,503 | How any query is processed in DSpace and data is managed between front end and PostgreSQL | 2015/05/11 | [
"https://Stackoverflow.com/questions/30168503",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4817979/"
] | Like every other webapp running in a Servlet Container like Tomcat, the file WEB-INF/web.xml controls how a query is processed. In case of DSpace's JSPUI you'll find this file in [dspace-install]/webapps/jspui/WEB-INF/web.xml. The JSPUI defines several filters, listeners and servlets to process a request.
The filters ... | It depends on the version of DSpace you are running, along with your configuration.
* In DSpace 4.0 or above, by default, the DSpace JSPUI uses [Apache Solr](http://lucene.apache.org/solr/) for all searching and browsing. DSpace performs all indexing and querying of Solr via its [Discovery module](https://wiki.duraspa... |
6,515,047 | What steps are needed to get a simple OpenCL enabled program to compile and run using emacs? We're developing with the C++ bindings right now and I have never used emacs but my teammate is very fond of it.
I just need to know how to set up the linker with ATI Stream SDK and basic OpenCL C++ bindings. The actual coding... | 2011/06/29 | [
"https://Stackoverflow.com/questions/6515047",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/578023/"
] | OpenCL doesn't change anything about the C/C++ project, you can use any build system you would otherwise use (vanilla Makefiles, autotools, cmake, etc).
For .cl files I have this in my .emacs:
`(setq auto-mode-alist (cons '("\.cl$" . c-mode) auto-mode-alist))`
...which forces Emacs to treat them as C files.
>
> I ... | Care trying to make this more precise? OpenCL programs (kernels) are usually compiled using the API calls from a program written in C or C++. Running the program, as well as transferring data back and forth to the memory of the host program, are likewise handled through the API. |
2,890,675 | Proving, using the definition of a limit that the function is continuous everywhere
where $z,a \in C$
$$f(z) = \operatorname{Re}(z) $$
$f:S$ $\subset C \to C$
So I got to $|\operatorname{Re}(z) - \operatorname{Re}(a)| = 0.5|z - a + \bar z - \bar a|$
but I don't know how I can use this expression to show that if $|z ... | 2018/08/22 | [
"https://math.stackexchange.com/questions/2890675",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/506677/"
] | It is easy to show that $z\_n \to z$ implies $\overline{z}\_n \to \overline{z}$. Hence, $z\_n \to z$ implies $$\operatorname{Re} z\_n = z\_n + \overline{z}\_n \ \to \ z + \overline{z} = \operatorname{Re} z.$$
This shows that $\operatorname{Re}(\cdot)$ is continuous. | Forgot about the Triangle Inequality
$|\operatorname{Re}(z) - \operatorname{Re}(a)| = 0.5|z - a + \bar z - \bar a| \leq 0.5(|z - a| + |\bar z - \bar a|) = 0.5(2|z - a|) = |z-a|$ using triangle inequality
then pick $\delta = \varepsilon$
Therefore if $|z - a| < \delta$
$|\operatorname{Re}(z) - \operatorname{Re}(a)| <... |
2,890,675 | Proving, using the definition of a limit that the function is continuous everywhere
where $z,a \in C$
$$f(z) = \operatorname{Re}(z) $$
$f:S$ $\subset C \to C$
So I got to $|\operatorname{Re}(z) - \operatorname{Re}(a)| = 0.5|z - a + \bar z - \bar a|$
but I don't know how I can use this expression to show that if $|z ... | 2018/08/22 | [
"https://math.stackexchange.com/questions/2890675",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/506677/"
] | Let $z=(x+iy)$ and $w=(a+ib)$
Note that your function is $$ f(x+iy)=x$$and $$ f(a+ib)=a$$
$$ |f(z)-f(w)|=|f(x+iy)-f(a+ib)|=|x-a|\le \sqrt {(x-a)^2+(y-b)^2}=|z-w|$$
For a given $\epsilon >0$ let $\delta = \epsilon $
If $$|z-w|<\delta$$ then $$ |f(z)-f(w)|\le |z-w|<\delta =\epsilon$$
Thus $ f $ is continuous. | Forgot about the Triangle Inequality
$|\operatorname{Re}(z) - \operatorname{Re}(a)| = 0.5|z - a + \bar z - \bar a| \leq 0.5(|z - a| + |\bar z - \bar a|) = 0.5(2|z - a|) = |z-a|$ using triangle inequality
then pick $\delta = \varepsilon$
Therefore if $|z - a| < \delta$
$|\operatorname{Re}(z) - \operatorname{Re}(a)| <... |
2,890,675 | Proving, using the definition of a limit that the function is continuous everywhere
where $z,a \in C$
$$f(z) = \operatorname{Re}(z) $$
$f:S$ $\subset C \to C$
So I got to $|\operatorname{Re}(z) - \operatorname{Re}(a)| = 0.5|z - a + \bar z - \bar a|$
but I don't know how I can use this expression to show that if $|z ... | 2018/08/22 | [
"https://math.stackexchange.com/questions/2890675",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/506677/"
] | Let $z=(x+iy)$ and $w=(a+ib)$
Note that your function is $$ f(x+iy)=x$$and $$ f(a+ib)=a$$
$$ |f(z)-f(w)|=|f(x+iy)-f(a+ib)|=|x-a|\le \sqrt {(x-a)^2+(y-b)^2}=|z-w|$$
For a given $\epsilon >0$ let $\delta = \epsilon $
If $$|z-w|<\delta$$ then $$ |f(z)-f(w)|\le |z-w|<\delta =\epsilon$$
Thus $ f $ is continuous. | It is easy to show that $z\_n \to z$ implies $\overline{z}\_n \to \overline{z}$. Hence, $z\_n \to z$ implies $$\operatorname{Re} z\_n = z\_n + \overline{z}\_n \ \to \ z + \overline{z} = \operatorname{Re} z.$$
This shows that $\operatorname{Re}(\cdot)$ is continuous. |
25,348 | We all know the OTP is unbreakable and we all love the OTP (judging by the amount of question on this site).
The strength of the OTP is not that it is unable to find a word without the key but you can find any word. Now obviously if we could create a cipher which output would be only letters and several keys would out... | 2015/04/30 | [
"https://crypto.stackexchange.com/questions/25348",
"https://crypto.stackexchange.com",
"https://crypto.stackexchange.com/users/23012/"
] | You need to understand that any variation on the OTP would ultimately be equivalent to the OTP security-wise, since it is unconditionally "secure" (the ciphertext leaks zero information about the plaintext or the key), and so you'd just making it harder to compute for now reason. So, sure, you can use the OTP, or some ... | With a OTP you need at least as much key material as you have plaintext. See Thomas' answer. That means you need a way to distribute as much key material as you have plaintext, securely. If you can do that, you can just distribute the plaintext over the same channel, and dispense with the OTP.
The one situation where... |
55,245,795 | Given I have a struct *something* like this:
```
struct arr {
int len;
void *item[]; // still playing with this
};
typedef struct arr my_array;
```
I'm wondering how you initialize it.
```
my_array foo = { 0, 1000 }; // 1000 spaces reserved.
// or perhaps...
my_array foo = { 0, [1000] };
```
Because when you... | 2019/03/19 | [
"https://Stackoverflow.com/questions/55245795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/169992/"
] | Flexible array members are only really useful when the structure is dynamically allocated. If the structure is allocated statically or automatically (i.e. on the stack), the amount of memory allocated is `sizeof(struct arr)` which is calculated with 0 members in `item`. There is no syntax to define a variable whose typ... | A `struct` type with a *flexible array member* needs to be allocated dynamically if you want the array to have any space allocated to it:
```
struct arr *foo = malloc( sizeof *foo + (sizeof foo->item[0] * 1000) );
if ( foo )
{
foo->len = 1000;
for ( int i = 0; i < foo->len; i++ )
foo->item[i] = some_value();
... |
1,811,383 | I'm trying to hook a 3rd party app so that I can draw to its screen. Drawing to the screen is easy, and I need no help with it, but I seem to be having issues with using `SetWindowsHookEx` to handle `WH_GETMESSAGE`. I can't figure out what to pass for the last two parameters.
```
using System;
using System.Collections... | 2009/11/28 | [
"https://Stackoverflow.com/questions/1811383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149358/"
] | The following suggests this won't work:
>
> "Global hooks are not supported in the .NET Framework. Except for the WH\_KEYBOARD\_LL low-level hook and the WH\_MOUSE\_LL low-level hook, you cannot implement global hooks in the Microsoft .NET Framework."
>
>
>
From ["How to set a Windows hook in Visual C# .NET"](htt... | ```
internal enum HookType : uint {
WH_JOURNALRECORD = 0,
WH_JOURNALPLAYBACK = 1,
WH_KEYBOARD = 2,
WH_GETMESSAGE = 3,
WH_CALLWNDPROC = 4,
WH_CBT = 5,
WH_SYSMSGFILTER = 6,
WH_MOUSE = 7,
WH_HARDWARE = 8,
WH_DEBUG = 9,
WH_SHELL = 10,
WH_FOREGROUNDIDLE = 11,
WH_CALLWNDP... |
1,811,383 | I'm trying to hook a 3rd party app so that I can draw to its screen. Drawing to the screen is easy, and I need no help with it, but I seem to be having issues with using `SetWindowsHookEx` to handle `WH_GETMESSAGE`. I can't figure out what to pass for the last two parameters.
```
using System;
using System.Collections... | 2009/11/28 | [
"https://Stackoverflow.com/questions/1811383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149358/"
] | [SetWindowsHookEx](http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx) specifies the last two parameters thusly:
* `hMod`
>
> [in] Handle to the DLL containing the
> hook procedure pointed to by the lpfn
> parameter. The hMod parameter must be
> set to NULL if the dwThreadId
> parameter specifies a thread ... | ```
internal enum HookType : uint {
WH_JOURNALRECORD = 0,
WH_JOURNALPLAYBACK = 1,
WH_KEYBOARD = 2,
WH_GETMESSAGE = 3,
WH_CALLWNDPROC = 4,
WH_CBT = 5,
WH_SYSMSGFILTER = 6,
WH_MOUSE = 7,
WH_HARDWARE = 8,
WH_DEBUG = 9,
WH_SHELL = 10,
WH_FOREGROUNDIDLE = 11,
WH_CALLWNDP... |
1,811,383 | I'm trying to hook a 3rd party app so that I can draw to its screen. Drawing to the screen is easy, and I need no help with it, but I seem to be having issues with using `SetWindowsHookEx` to handle `WH_GETMESSAGE`. I can't figure out what to pass for the last two parameters.
```
using System;
using System.Collections... | 2009/11/28 | [
"https://Stackoverflow.com/questions/1811383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149358/"
] | The following suggests this won't work:
>
> "Global hooks are not supported in the .NET Framework. Except for the WH\_KEYBOARD\_LL low-level hook and the WH\_MOUSE\_LL low-level hook, you cannot implement global hooks in the Microsoft .NET Framework."
>
>
>
From ["How to set a Windows hook in Visual C# .NET"](htt... | This work for me use 13...
```
private static IntPtr SetHook(LowLevelKeyboardProc proc)
{
using (Process curProcess = Process.GetCurrentProcess())
using (ProcessModule curModule = curProcess.MainModule)
{
return SetWindowsHookEx(13, proc,
Ge... |
1,811,383 | I'm trying to hook a 3rd party app so that I can draw to its screen. Drawing to the screen is easy, and I need no help with it, but I seem to be having issues with using `SetWindowsHookEx` to handle `WH_GETMESSAGE`. I can't figure out what to pass for the last two parameters.
```
using System;
using System.Collections... | 2009/11/28 | [
"https://Stackoverflow.com/questions/1811383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149358/"
] | [SetWindowsHookEx](http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx) specifies the last two parameters thusly:
* `hMod`
>
> [in] Handle to the DLL containing the
> hook procedure pointed to by the lpfn
> parameter. The hMod parameter must be
> set to NULL if the dwThreadId
> parameter specifies a thread ... | I believe you need to P/Invoke [`GetModuleHandle`](http://msdn.microsoft.com/en-us/library/ms644990%28VS.85%29.aspx) and use the handle it returns for the third parameter of `SetWindowsHookEx`. I also believe `0` is correct for the fourth parameter, as you don't want to hook any one specific thread in the third-party a... |
1,811,383 | I'm trying to hook a 3rd party app so that I can draw to its screen. Drawing to the screen is easy, and I need no help with it, but I seem to be having issues with using `SetWindowsHookEx` to handle `WH_GETMESSAGE`. I can't figure out what to pass for the last two parameters.
```
using System;
using System.Collections... | 2009/11/28 | [
"https://Stackoverflow.com/questions/1811383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149358/"
] | The following suggests this won't work:
>
> "Global hooks are not supported in the .NET Framework. Except for the WH\_KEYBOARD\_LL low-level hook and the WH\_MOUSE\_LL low-level hook, you cannot implement global hooks in the Microsoft .NET Framework."
>
>
>
From ["How to set a Windows hook in Visual C# .NET"](htt... | I believe you need to P/Invoke [`GetModuleHandle`](http://msdn.microsoft.com/en-us/library/ms644990%28VS.85%29.aspx) and use the handle it returns for the third parameter of `SetWindowsHookEx`. I also believe `0` is correct for the fourth parameter, as you don't want to hook any one specific thread in the third-party a... |
1,811,383 | I'm trying to hook a 3rd party app so that I can draw to its screen. Drawing to the screen is easy, and I need no help with it, but I seem to be having issues with using `SetWindowsHookEx` to handle `WH_GETMESSAGE`. I can't figure out what to pass for the last two parameters.
```
using System;
using System.Collections... | 2009/11/28 | [
"https://Stackoverflow.com/questions/1811383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149358/"
] | The following suggests this won't work:
>
> "Global hooks are not supported in the .NET Framework. Except for the WH\_KEYBOARD\_LL low-level hook and the WH\_MOUSE\_LL low-level hook, you cannot implement global hooks in the Microsoft .NET Framework."
>
>
>
From ["How to set a Windows hook in Visual C# .NET"](htt... | I know that this is an old question but I'm hoping that there is still someone who will find this useful. I think that you are mixing up `int` and `IntPtr`
```
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern int CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
``` |
1,811,383 | I'm trying to hook a 3rd party app so that I can draw to its screen. Drawing to the screen is easy, and I need no help with it, but I seem to be having issues with using `SetWindowsHookEx` to handle `WH_GETMESSAGE`. I can't figure out what to pass for the last two parameters.
```
using System;
using System.Collections... | 2009/11/28 | [
"https://Stackoverflow.com/questions/1811383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149358/"
] | I believe you need to P/Invoke [`GetModuleHandle`](http://msdn.microsoft.com/en-us/library/ms644990%28VS.85%29.aspx) and use the handle it returns for the third parameter of `SetWindowsHookEx`. I also believe `0` is correct for the fourth parameter, as you don't want to hook any one specific thread in the third-party a... | ```
internal enum HookType : uint {
WH_JOURNALRECORD = 0,
WH_JOURNALPLAYBACK = 1,
WH_KEYBOARD = 2,
WH_GETMESSAGE = 3,
WH_CALLWNDPROC = 4,
WH_CBT = 5,
WH_SYSMSGFILTER = 6,
WH_MOUSE = 7,
WH_HARDWARE = 8,
WH_DEBUG = 9,
WH_SHELL = 10,
WH_FOREGROUNDIDLE = 11,
WH_CALLWNDP... |
1,811,383 | I'm trying to hook a 3rd party app so that I can draw to its screen. Drawing to the screen is easy, and I need no help with it, but I seem to be having issues with using `SetWindowsHookEx` to handle `WH_GETMESSAGE`. I can't figure out what to pass for the last two parameters.
```
using System;
using System.Collections... | 2009/11/28 | [
"https://Stackoverflow.com/questions/1811383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149358/"
] | I don't know but if you're using parameter values which specify that you want to, as the API helps says, "inject a DLL into another process", then for all I know it might work only if you write an unmanaged DLL from which to call it. | ```
internal enum HookType : uint {
WH_JOURNALRECORD = 0,
WH_JOURNALPLAYBACK = 1,
WH_KEYBOARD = 2,
WH_GETMESSAGE = 3,
WH_CALLWNDPROC = 4,
WH_CBT = 5,
WH_SYSMSGFILTER = 6,
WH_MOUSE = 7,
WH_HARDWARE = 8,
WH_DEBUG = 9,
WH_SHELL = 10,
WH_FOREGROUNDIDLE = 11,
WH_CALLWNDP... |
1,811,383 | I'm trying to hook a 3rd party app so that I can draw to its screen. Drawing to the screen is easy, and I need no help with it, but I seem to be having issues with using `SetWindowsHookEx` to handle `WH_GETMESSAGE`. I can't figure out what to pass for the last two parameters.
```
using System;
using System.Collections... | 2009/11/28 | [
"https://Stackoverflow.com/questions/1811383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149358/"
] | I know that this is an old question but I'm hoping that there is still someone who will find this useful. I think that you are mixing up `int` and `IntPtr`
```
[System.Runtime.InteropServices.DllImport("user32.dll")]
static extern int CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
``` | This work for me use 13...
```
private static IntPtr SetHook(LowLevelKeyboardProc proc)
{
using (Process curProcess = Process.GetCurrentProcess())
using (ProcessModule curModule = curProcess.MainModule)
{
return SetWindowsHookEx(13, proc,
Ge... |
1,811,383 | I'm trying to hook a 3rd party app so that I can draw to its screen. Drawing to the screen is easy, and I need no help with it, but I seem to be having issues with using `SetWindowsHookEx` to handle `WH_GETMESSAGE`. I can't figure out what to pass for the last two parameters.
```
using System;
using System.Collections... | 2009/11/28 | [
"https://Stackoverflow.com/questions/1811383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/149358/"
] | [SetWindowsHookEx](http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx) specifies the last two parameters thusly:
* `hMod`
>
> [in] Handle to the DLL containing the
> hook procedure pointed to by the lpfn
> parameter. The hMod parameter must be
> set to NULL if the dwThreadId
> parameter specifies a thread ... | This work for me use 13...
```
private static IntPtr SetHook(LowLevelKeyboardProc proc)
{
using (Process curProcess = Process.GetCurrentProcess())
using (ProcessModule curModule = curProcess.MainModule)
{
return SetWindowsHookEx(13, proc,
Ge... |
8,874,458 | Following info I found on another SO question, I have improved my autocomplete to display the list of available values when a field gets focus. This works perfectly well in Firefox and Chrome, but not on IE9.
I have created a code example [here](http://jsfiddle.net/PEhdP/2/). It works if you open it with Firefox or C... | 2012/01/15 | [
"https://Stackoverflow.com/questions/8874458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/520957/"
] | your `if` condition should like this, use `==` instead of using `===`
```
if (this.value == "") {
$(this).autocomplete("search", "");
}
```
== is equal to(values only)
=== is exactly equal to (value and type)
---
EDIT
Just comment the `console.log(this.value);` then it will work.
<http://jsfiddle.net/PEhdP/... | `$(function()
{
var cache = {},
lastXhr;
$( "#birds" ).autocomplete({
minLength: 2,
source: function( request, response ) {
var term = request.term;
if ( term in cache ) {
response( cache[ term ] );
return;
}
lastXhr = $.getJSON( "search.php", request, function( data, status, xhr ) {
cache[ term ] = data;
... |
805,075 | I would like to compute the cardinality of an elliptic curve group over the finite field $\mathbb{F}\_{991}$. I'm trying to use sage but I still have an error in the syntax (I never used it before and I tryed to adapt a code). Here is what I have:
sage: E = EllipticCurve(GF(991))
sage: E
Elliptic Curve defined by y^... | 2014/05/22 | [
"https://math.stackexchange.com/questions/805075",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/77885/"
] | This is the wrong place to ask and in future, you should ask on ask.sagemath.org.
To answer your question, you can find the cardinality by typing
```
sage: E.cardinality()
```
But, you need to first input your curve, say you have an elliptic curve given by
$$E: y^2+a\_1xy+a\_3y=x^3+a\_2x^2+a\_4x+a\_6 \text{ over } ... | Alternatively, you can use [MAGMA online](http://magma.maths.usyd.edu.au/calc/). I usually do it like this:
>
> K:=GF(991);
>
>
> g:=Generator(K);
>
>
> E:=EllipticCurve([0,0,0,446\*g,471\*g]);
>
>
> #E;
>
>
>
and MAGMA returns 984. |
17,624,106 | I'm running into problems with CSP. I've tried adding firebase to permissions, and sandboxing.
I am trying to convert this firebase sample chrome extension(<https://github.com/firebase/firebase-chrome-extension>) to a chrome packaged app. The packaged app doesn't like to connect to firebase. I just keep getting secur... | 2013/07/12 | [
"https://Stackoverflow.com/questions/17624106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2576244/"
] | I was also running to the same issue. It seems "**chrome packaged app**" does not allow adding "content\_security\_policy" and re-defining the policies in manifest.json
Try adding it and re-loading the app via extension manager and you should see the following message:
>
> There were warnings when trying to install... | Last year I'd exchange with the Firebase developer team, and they were not even aware of this problem, they were focused in the extensions other than the apps. Please find below the email exchange between me and firebase team:
>
> firebase-support@google.com 9 Jan
>
>
> to me Hey Ruvenss,
>
>
> Thanks for the cla... |
17,624,106 | I'm running into problems with CSP. I've tried adding firebase to permissions, and sandboxing.
I am trying to convert this firebase sample chrome extension(<https://github.com/firebase/firebase-chrome-extension>) to a chrome packaged app. The packaged app doesn't like to connect to firebase. I just keep getting secur... | 2013/07/12 | [
"https://Stackoverflow.com/questions/17624106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2576244/"
] | I was also running to the same issue. It seems "**chrome packaged app**" does not allow adding "content\_security\_policy" and re-defining the policies in manifest.json
Try adding it and re-loading the app via extension manager and you should see the following message:
>
> There were warnings when trying to install... | for the webSdk the answer appears to be no, which is surprising.
as of right now 2017-10-03 it appears that the firebase api is dependent on the browsers localStorage and document.open (which could be fixed with a polyfill). firebase also loads scripts that it downloads from the internet (yourdatabase.firebaseio.com) ... |
67,328,545 | ##database intialization in apache airflow.
I have installed apache airflow in linux with python 3.8 version. while running airflow commands it showing version name. error occured while initializing database in airflow. explain the error below and solution, thanks
```
/home/hduser/apache_airflow/venv/lib/python3.6/sit... | 2021/04/30 | [
"https://Stackoverflow.com/questions/67328545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12775406/"
] | This can be fixed by rolling back the version of SQLAlchemy. Try uninstalling SQLAlchemy and installing an older version of it. I used SQLAlchemy 1.3.20 and was able to get it working. | I came across this (and many other) problems while trying to implement a dockerized airflow for our data engineering team. I'm not sure what the exact cause was, but somewhere along the line of troubleshooting I think the database got bad data (I had to remove the volume that persisted the psql container's data).
Asid... |
67,328,545 | ##database intialization in apache airflow.
I have installed apache airflow in linux with python 3.8 version. while running airflow commands it showing version name. error occured while initializing database in airflow. explain the error below and solution, thanks
```
/home/hduser/apache_airflow/venv/lib/python3.6/sit... | 2021/04/30 | [
"https://Stackoverflow.com/questions/67328545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12775406/"
] | This can be fixed by rolling back the version of SQLAlchemy. Try uninstalling SQLAlchemy and installing an older version of it. I used SQLAlchemy 1.3.20 and was able to get it working. | If you have `sqlalchemy > 1.4`, this can be fixed by upgrading `marshmallow-sqlalchemy`
>
> pip install -U marshmallow-sqlalchemy
>
>
> |
9,050,876 | In my c++ extension i have a public method called:
map getMap();
I have include the header files in to the Example.i interface file.
But how can i interate thru the map hwhen i am in python? | 2012/01/29 | [
"https://Stackoverflow.com/questions/9050876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/931037/"
] | Working example (Windows). An important point is you must instantiate each template you want to expose with the `%template` statement (see `x.i` file) and assign it a legal Python name.
### x.cpp
```
#define X_EXPORTS
#include "x.h"
X_API mapii_t getMap()
{
mapii_t m;
m[1]=2;
m[4]=8;
m[5]=10;
ret... | You should be able to use the map just like you would a python dict. It supports iteritems, iterkeys, etc. Do you have a `%include "std_map.i"` in your code? do you have a %template statement? It's pretty tough to guess since you didn't show your code. |
26,790,554 | I sent an app yesterday for review, with no problem. I then realized that I had a very little fix to do (changing the max zoom level of a map from 19 to 18, nothing else), so I removed the binary from iTunes Connect, and tried to resubmit.
Now I'm having this warning :
, so I removed the binary from iTunes Connect, and tried to resubmit.
Now I'm having this warning :

like this:
, so I removed the binary from iTunes Connect, and tried to resubmit.
Now I'm having this warning :

(Archived with real device) | Please check Build Active Architecture option. Set it to NO.
It works for me. |
26,790,554 | I sent an app yesterday for review, with no problem. I then realized that I had a very little fix to do (changing the max zoom level of a map from 19 to 18, nothing else), so I removed the binary from iTunes Connect, and tried to resubmit.
Now I'm having this warning :

like this:
 project was created yet before arm64 was added to standard, it is not reflected in "Valid Architectures" even if it is *shown* as Standard.
What I did:
* I went to Project (vs. Target) configuration
* *Typed* "arm64" in ... |
26,790,554 | I sent an app yesterday for review, with no problem. I then realized that I had a very little fix to do (changing the max zoom level of a map from 19 to 18, nothing else), so I removed the binary from iTunes Connect, and tried to resubmit.
Now I'm having this warning :
, so I removed the binary from iTunes Connect, and tried to resubmit.
Now I'm having this warning :
 project was created yet before arm64 was added to standard, it is not reflected in "Valid Architectures" even if it is *shown* as Standard.
What I did:
* I went to Project (vs. Target) configuration
* *Typed* "arm64" in ... | Okay this was insane.
I tried **every** single answer. But it worked only when I placed `arm64` before `armv7` and `armv7s` in Valid Architectures.
P.S. : `xcode version : 7.2` |
26,790,554 | I sent an app yesterday for review, with no problem. I then realized that I had a very little fix to do (changing the max zoom level of a map from 19 to 18, nothing else), so I removed the binary from iTunes Connect, and tried to resubmit.
Now I'm having this warning :
 project was created yet before arm64 was added to standard, it is not reflected in "Valid Architectures" even if it is *shown* as Standard.
What I did:
* I went to Project (vs. Target) configuration
* *Typed* "arm64" in ... | I solved the problem by changing,
Architectures: arm7,arm64
Valid architecture: arm7,arm64
Build active architecture only : Yes |
26,790,554 | I sent an app yesterday for review, with no problem. I then realized that I had a very little fix to do (changing the max zoom level of a map from 19 to 18, nothing else), so I removed the binary from iTunes Connect, and tried to resubmit.
Now I'm having this warning :
 - $(ARCH\_STANDARD)
**Valid Architectures:** armv7 armv7s arm64
1. Clean and build your app with the iPhone connected
2. Disconnect your iPhone and check the top bar if is in "iOS Device... | I solved the problem by changing,
Architectures: arm7,arm64
Valid architecture: arm7,arm64
Build active architecture only : Yes |
26,790,554 | I sent an app yesterday for review, with no problem. I then realized that I had a very little fix to do (changing the max zoom level of a map from 19 to 18, nothing else), so I removed the binary from iTunes Connect, and tried to resubmit.
Now I'm having this warning :
 - $(ARCH\_STANDARD)
**Valid Architectures:** armv7 armv7s arm64
1. Clean and build your app with the iPhone connected
2. Disconnect your iPhone and check the top bar if is in "iOS Device... | Got rid of every warning. Went through everything over and over. Found the one word answer here above.
"Build Active Architecture Only - NO (specially... if your connected device is not arm64 compatible)"
My iPad is not 64 bit. Put in NO for Build Active Architecture and my submission worked! |
26,790,554 | I sent an app yesterday for review, with no problem. I then realized that I had a very little fix to do (changing the max zoom level of a map from 19 to 18, nothing else), so I removed the binary from iTunes Connect, and tried to resubmit.
Now I'm having this warning :
 project was created yet before arm64 was added to standard, it is not reflected in "Valid Architectures" even if it is *shown* as Standard.
What I did:
* I went to Project (vs. Target) configuration
* *Typed* "arm64" in ... | Please check Build Active Architecture option. Set it to NO.
It works for me. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.