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 |
|---|---|---|---|---|---|
22,583,941 | I have shipped an online (grid-based) videogame that uses the TCP protocol to ensure reliable communication in a server-client network topology. My game works fairly well, but suffers from higher than expected latency (similar TCP games in the genre seem to do a better job at keeping latency to a minimal).
While inve... | 2014/03/22 | [
"https://Stackoverflow.com/questions/22583941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1362135/"
] | There should be nothing you need to do. All of the workarounds you're suggesting are to help protocols that weren't properly designed to work over TCP. Presumably your protocol was designed to work over TCP, right?
Your problem is almost definitely one or both of these:
1. You are calling TCP send functions with smal... | To solve the problem, it's necessary to understand the normal functioning of TCP connections. Telnet is a good example to analyze.
TCP guarantees delivery by acknowledging successful data transmission. The " Ack" can be sent as a message by itself, but this introduces quite some overhead - an Ack is very small message... |
22,583,941 | I have shipped an online (grid-based) videogame that uses the TCP protocol to ensure reliable communication in a server-client network topology. My game works fairly well, but suffers from higher than expected latency (similar TCP games in the genre seem to do a better job at keeping latency to a minimal).
While inve... | 2014/03/22 | [
"https://Stackoverflow.com/questions/22583941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1362135/"
] | Since Windows Vista, TCP\_NODELAY option must be set prior to calling `connect`, or (on the server) prior to calling `listen`. If you set `TCP_NODELAY` after calling `connect`, it will not *actually* disable Nagle algorithm, yet `GetSocketOption` will state that Nagle has been disabled! This all appears to be undocumen... | Use reliable UDP libraries and write your own congestion control algorithm, this will definitely overcome your TCP latency problem.
this the following library, which i use for reliable UDP transfers:
<http://udt.sourceforge.net/> |
22,583,941 | I have shipped an online (grid-based) videogame that uses the TCP protocol to ensure reliable communication in a server-client network topology. My game works fairly well, but suffers from higher than expected latency (similar TCP games in the genre seem to do a better job at keeping latency to a minimal).
While inve... | 2014/03/22 | [
"https://Stackoverflow.com/questions/22583941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1362135/"
] | To solve the problem, it's necessary to understand the normal functioning of TCP connections. Telnet is a good example to analyze.
TCP guarantees delivery by acknowledging successful data transmission. The " Ack" can be sent as a message by itself, but this introduces quite some overhead - an Ack is very small message... | >
> every packet I send needs to arrive (and be in order);
>
>
>
This requirement is the cause of your latency.
Either you have a network with negligible packet loss, in which UDP would be delivering every packet, or you have loss, in which TCP is doing retransmit, delaying everything by (multiples of) the retra... |
22,583,941 | I have shipped an online (grid-based) videogame that uses the TCP protocol to ensure reliable communication in a server-client network topology. My game works fairly well, but suffers from higher than expected latency (similar TCP games in the genre seem to do a better job at keeping latency to a minimal).
While inve... | 2014/03/22 | [
"https://Stackoverflow.com/questions/22583941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1362135/"
] | There should be nothing you need to do. All of the workarounds you're suggesting are to help protocols that weren't properly designed to work over TCP. Presumably your protocol was designed to work over TCP, right?
Your problem is almost definitely one or both of these:
1. You are calling TCP send functions with smal... | Use reliable UDP libraries and write your own congestion control algorithm, this will definitely overcome your TCP latency problem.
this the following library, which i use for reliable UDP transfers:
<http://udt.sourceforge.net/> |
22,583,941 | I have shipped an online (grid-based) videogame that uses the TCP protocol to ensure reliable communication in a server-client network topology. My game works fairly well, but suffers from higher than expected latency (similar TCP games in the genre seem to do a better job at keeping latency to a minimal).
While inve... | 2014/03/22 | [
"https://Stackoverflow.com/questions/22583941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1362135/"
] | Since Windows Vista, TCP\_NODELAY option must be set prior to calling `connect`, or (on the server) prior to calling `listen`. If you set `TCP_NODELAY` after calling `connect`, it will not *actually* disable Nagle algorithm, yet `GetSocketOption` will state that Nagle has been disabled! This all appears to be undocumen... | I would suggest you leave the Nagle alogithm and buffers turned on, as its basic purpose is to collect small writes into full/larger packets (this improves performance a lot), but at the same time use [FlushFileBuffers](http://msdn.microsoft.com/en-us/library/windows/desktop/aa364439%28v=vs.85%29.aspx)() on the socket ... |
38,743,695 | Im trying to use Update set like above, i try different kind of syntaxes but no success
```
update
pc_discount
set
ceza_ucret_turu_id=pc_discount_ceza.CEZA_ALT_UCRET_KODU
from
(select CEZA_ALT_UCRET_KODU from pc_discount_ceza where CEZA_ALT_UCRET_KODU is not null) pdc
where
pc_discount.id=pdc.discount_id
ceza_ucr... | 2016/08/03 | [
"https://Stackoverflow.com/questions/38743695",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3331668/"
] | There are a couple of things I would change
* there are two conditions, they need joining with an "AND" set should
* use the table alias in the set
* add the joining condition into the subquery
Try something like
```
update
pc_discount
set
ceza_ucret_turu_id = pcd.CEZA_ALT_UCRET_KODU
from
(
select ... | Try this - I'm not sure you're using correct syntax for Oracle
```
UPDATE pc_discount pd
SET ceza_ucret_turu_id =
(SELECT
MAX(ceza_alt_ucret_kodu)
FROM
pc_discount_ceza pdc
WHERE pd.id = pdc.discount_id
)
WHERE pd.ceza_ucret_turu_id IS NULL
;
```
The above has been updated with your new business rul... |
40,703,615 | i am using dotnet core 1.1 on linux, and i am having issues when i want to split up the identityContext from my regular dbContext, whenever i run the following line in my startup.cs --> configure:
```
//... some other services
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>()... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40703615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2992311/"
] | Okay. So i will try to answer my own question, because i did get past it. Its still possible to follow the github link in the OP, and see the project i got the error in.
Mainly what was wrong, was that i thouth i got this error trying to migrate the `ApplicationDbContext : IDentityContext` but actually the error was ... | I had a similar issue relating to your initial problem where
>
> The entity type 'IdentityUserLogin' requires a primary key to
> be defined.
>
>
>
And while I think your solution to ignore entities seems to work, I just wanted to provide another solution for those who actually do want to assign a primary key to ... |
40,703,615 | i am using dotnet core 1.1 on linux, and i am having issues when i want to split up the identityContext from my regular dbContext, whenever i run the following line in my startup.cs --> configure:
```
//... some other services
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>()... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40703615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2992311/"
] | keys of Identity tables are mapped in `OnModelCreating` method of `IdentityDbContext` and if this method is not called, you will end up getting the error that you got.
All you need to do is call.
```
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
}
```
Th... | Okay. So i will try to answer my own question, because i did get past it. Its still possible to follow the github link in the OP, and see the project i got the error in.
Mainly what was wrong, was that i thouth i got this error trying to migrate the `ApplicationDbContext : IDentityContext` but actually the error was ... |
40,703,615 | i am using dotnet core 1.1 on linux, and i am having issues when i want to split up the identityContext from my regular dbContext, whenever i run the following line in my startup.cs --> configure:
```
//... some other services
using (var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>()... | 2016/11/20 | [
"https://Stackoverflow.com/questions/40703615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2992311/"
] | keys of Identity tables are mapped in `OnModelCreating` method of `IdentityDbContext` and if this method is not called, you will end up getting the error that you got.
All you need to do is call.
```
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
}
```
Th... | I had a similar issue relating to your initial problem where
>
> The entity type 'IdentityUserLogin' requires a primary key to
> be defined.
>
>
>
And while I think your solution to ignore entities seems to work, I just wanted to provide another solution for those who actually do want to assign a primary key to ... |
49,978 | I cast [Ixalan's Binding](http://gatherer.wizards.com/Pages/Search/Default.aspx?name=%2b%5bIxalan%27s%5d%2b%5bBinding%5d), and its etb targets and exiles my opponent's [Rampaging Baloths](http://gatherer.wizards.com/Pages/Search/Default.aspx?name=%2b%5bRampaging%20Baloths%5d). Later in the game I use the -7 on [Ashiok,... | 2020/01/16 | [
"https://boardgames.stackexchange.com/questions/49978",
"https://boardgames.stackexchange.com",
"https://boardgames.stackexchange.com/users/26427/"
] | From a ruling on Gatherer:
>
> If there is no exiled card (perhaps because the exiled permanent was a
> token or was a commander that moved to the command zone in the
> Commander variant), Ixalan’s Binding won’t stop players from casting
> spells.
>
>
>
If you cast the card from exile using Ashiok then there i... | They will now be able to cast Rampaging Baloths again.
Ixalan's Binding has linked abilities on it; and in order for the second ability to do anything, the card exiled by the first ability must still be in exile.
>
> 607. Linked Abilities
>
>
> >
> > 607.2a If an object has an activated or triggered ability pri... |
2,358,684 | Say I have 2 processes, ProcessA and ProcessB. If I perform `int fd=open(somefile)` in ProcessA, can I then pass the value of file descriptor `fd` over IPC to ProcessB and have it manipulate the same file? | 2010/03/01 | [
"https://Stackoverflow.com/questions/2358684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272934/"
] | You can pass a file descriptor to another process over [unix domain](http://en.wikipedia.org/wiki/Unix_domain_socket) sockets.
Here's the code to pass such a file descriptor, taken from [Unix Network Programming](http://www.kohala.com/start/unpv12e.html)
```
ssize_t
write_fd(int fd, void *ptr, size_t nbytes, int sendf... | In 2020, on Linux versions 5.6 and above, a new system call was added to Linux that’ll enable a process to obtain a duplicate of a file descriptor of another process referred to by a pidfd with the `pidfd_getfd()` system call. |
2,358,684 | Say I have 2 processes, ProcessA and ProcessB. If I perform `int fd=open(somefile)` in ProcessA, can I then pass the value of file descriptor `fd` over IPC to ProcessB and have it manipulate the same file? | 2010/03/01 | [
"https://Stackoverflow.com/questions/2358684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272934/"
] | If both processes belong the the same user, then you can simply make use of the procfs.
```
char fd_path[64]; // actual maximal length: 37 for 64bit systems
snprintf(fd_path, sizeof(fd_path), "/proc/%d/fd/%d", SOURCE_PID, SOURCE_FD);
int new_fd = open(fd_path, O_RDWR);
```
Of course you would need to some IPC mecha... | Note that in the example of above, the setting of variables when receiving, like:
```
msg.msg_name = NULL;
msg.msg_namelen = 0;
iov[0].iov_base = ptr;
iov[0].iov_len = nbytes;
msg.msg_iov = iov;
msg.msg_iovlen = 1;
```
is not required. The whole idea of a message structure with headers is that the receiving site do... |
2,358,684 | Say I have 2 processes, ProcessA and ProcessB. If I perform `int fd=open(somefile)` in ProcessA, can I then pass the value of file descriptor `fd` over IPC to ProcessB and have it manipulate the same file? | 2010/03/01 | [
"https://Stackoverflow.com/questions/2358684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272934/"
] | In 2020, on Linux versions 5.6 and above, a new system call was added to Linux that’ll enable a process to obtain a duplicate of a file descriptor of another process referred to by a pidfd with the `pidfd_getfd()` system call. | Note that in the example of above, the setting of variables when receiving, like:
```
msg.msg_name = NULL;
msg.msg_namelen = 0;
iov[0].iov_base = ptr;
iov[0].iov_len = nbytes;
msg.msg_iov = iov;
msg.msg_iovlen = 1;
```
is not required. The whole idea of a message structure with headers is that the receiving site do... |
2,358,684 | Say I have 2 processes, ProcessA and ProcessB. If I perform `int fd=open(somefile)` in ProcessA, can I then pass the value of file descriptor `fd` over IPC to ProcessB and have it manipulate the same file? | 2010/03/01 | [
"https://Stackoverflow.com/questions/2358684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272934/"
] | If both processes belong the the same user, then you can simply make use of the procfs.
```
char fd_path[64]; // actual maximal length: 37 for 64bit systems
snprintf(fd_path, sizeof(fd_path), "/proc/%d/fd/%d", SOURCE_PID, SOURCE_FD);
int new_fd = open(fd_path, O_RDWR);
```
Of course you would need to some IPC mecha... | You can use the method nos described in this thread, or the (more conventional) way, by sharing it between related processes (typically parent-child or siblings) by having it created, the forked processes automatically receive a copy.
Indeed, forked processes get all your FDs and can use them unless they close them (w... |
2,358,684 | Say I have 2 processes, ProcessA and ProcessB. If I perform `int fd=open(somefile)` in ProcessA, can I then pass the value of file descriptor `fd` over IPC to ProcessB and have it manipulate the same file? | 2010/03/01 | [
"https://Stackoverflow.com/questions/2358684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272934/"
] | In 2020, on Linux versions 5.6 and above, a new system call was added to Linux that’ll enable a process to obtain a duplicate of a file descriptor of another process referred to by a pidfd with the `pidfd_getfd()` system call. | **Short Answer:**
Try [pidfd\_getfd](https://man7.org/linux/man-pages/man2/pidfd_getfd.2.html)
**Long Answer**
The *pidfd\_getfd()* system call allocates a new file descriptor in the calling process (Process B). This new file descriptor is a duplicate of an existing file descriptor, *targetfd*, in the process (Proce... |
2,358,684 | Say I have 2 processes, ProcessA and ProcessB. If I perform `int fd=open(somefile)` in ProcessA, can I then pass the value of file descriptor `fd` over IPC to ProcessB and have it manipulate the same file? | 2010/03/01 | [
"https://Stackoverflow.com/questions/2358684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272934/"
] | You can pass a file descriptor to another process over [unix domain](http://en.wikipedia.org/wiki/Unix_domain_socket) sockets.
Here's the code to pass such a file descriptor, taken from [Unix Network Programming](http://www.kohala.com/start/unpv12e.html)
```
ssize_t
write_fd(int fd, void *ptr, size_t nbytes, int sendf... | **Short Answer:**
Try [pidfd\_getfd](https://man7.org/linux/man-pages/man2/pidfd_getfd.2.html)
**Long Answer**
The *pidfd\_getfd()* system call allocates a new file descriptor in the calling process (Process B). This new file descriptor is a duplicate of an existing file descriptor, *targetfd*, in the process (Proce... |
2,358,684 | Say I have 2 processes, ProcessA and ProcessB. If I perform `int fd=open(somefile)` in ProcessA, can I then pass the value of file descriptor `fd` over IPC to ProcessB and have it manipulate the same file? | 2010/03/01 | [
"https://Stackoverflow.com/questions/2358684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272934/"
] | In 2020, on Linux versions 5.6 and above, a new system call was added to Linux that’ll enable a process to obtain a duplicate of a file descriptor of another process referred to by a pidfd with the `pidfd_getfd()` system call. | You can use the method nos described in this thread, or the (more conventional) way, by sharing it between related processes (typically parent-child or siblings) by having it created, the forked processes automatically receive a copy.
Indeed, forked processes get all your FDs and can use them unless they close them (w... |
2,358,684 | Say I have 2 processes, ProcessA and ProcessB. If I perform `int fd=open(somefile)` in ProcessA, can I then pass the value of file descriptor `fd` over IPC to ProcessB and have it manipulate the same file? | 2010/03/01 | [
"https://Stackoverflow.com/questions/2358684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272934/"
] | You can use the method nos described in this thread, or the (more conventional) way, by sharing it between related processes (typically parent-child or siblings) by having it created, the forked processes automatically receive a copy.
Indeed, forked processes get all your FDs and can use them unless they close them (w... | **Short Answer:**
Try [pidfd\_getfd](https://man7.org/linux/man-pages/man2/pidfd_getfd.2.html)
**Long Answer**
The *pidfd\_getfd()* system call allocates a new file descriptor in the calling process (Process B). This new file descriptor is a duplicate of an existing file descriptor, *targetfd*, in the process (Proce... |
2,358,684 | Say I have 2 processes, ProcessA and ProcessB. If I perform `int fd=open(somefile)` in ProcessA, can I then pass the value of file descriptor `fd` over IPC to ProcessB and have it manipulate the same file? | 2010/03/01 | [
"https://Stackoverflow.com/questions/2358684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272934/"
] | You can pass a file descriptor to another process over [unix domain](http://en.wikipedia.org/wiki/Unix_domain_socket) sockets.
Here's the code to pass such a file descriptor, taken from [Unix Network Programming](http://www.kohala.com/start/unpv12e.html)
```
ssize_t
write_fd(int fd, void *ptr, size_t nbytes, int sendf... | Note that in the example of above, the setting of variables when receiving, like:
```
msg.msg_name = NULL;
msg.msg_namelen = 0;
iov[0].iov_base = ptr;
iov[0].iov_len = nbytes;
msg.msg_iov = iov;
msg.msg_iovlen = 1;
```
is not required. The whole idea of a message structure with headers is that the receiving site do... |
2,358,684 | Say I have 2 processes, ProcessA and ProcessB. If I perform `int fd=open(somefile)` in ProcessA, can I then pass the value of file descriptor `fd` over IPC to ProcessB and have it manipulate the same file? | 2010/03/01 | [
"https://Stackoverflow.com/questions/2358684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272934/"
] | You can pass a file descriptor to another process over [unix domain](http://en.wikipedia.org/wiki/Unix_domain_socket) sockets.
Here's the code to pass such a file descriptor, taken from [Unix Network Programming](http://www.kohala.com/start/unpv12e.html)
```
ssize_t
write_fd(int fd, void *ptr, size_t nbytes, int sendf... | If both processes belong the the same user, then you can simply make use of the procfs.
```
char fd_path[64]; // actual maximal length: 37 for 64bit systems
snprintf(fd_path, sizeof(fd_path), "/proc/%d/fd/%d", SOURCE_PID, SOURCE_FD);
int new_fd = open(fd_path, O_RDWR);
```
Of course you would need to some IPC mecha... |
51,187,029 | Let's assume I pass a new object to a function like this:
```
loadContainer->addControlView( new BmpView( BMP_PICTURE ) );
```
Now, I want to change a specific characteristic of the BmpView before I pass it to addControlView. The way I do this is like this:
```
Control* newView = new BmpView( BMP_PICTURE );
newView... | 2018/07/05 | [
"https://Stackoverflow.com/questions/51187029",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9198982/"
] | So your error is actually not that complicated you have wrongly used the [()] braces
1. [] is to bind a value to a variable
2. () is for event handling
you used a eventhandler and "databinder" on value `[(value)]`, but you only want to bind
`[value] = "selected option"`
the event is handled with the `(selectionOn... | You can transform your object into a string with JSON.stringify to bind it and after reparse it into an object with JSON.parse to use it in your TS file.
```
In your ts file :
stringifyValue(value) {
return JSON.stringify(value);
}
parseValue(value) {
let selectedObj = JSON.parse(value);
}
in your html :... |
4,544,272 | When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the `$lng` and `$lat` from the query string and it works fine locally.
```
$lng=$_GET['lng'];
$lat=$_GET['lat'];
$conn=new LoginSystem();
$conn->connect();
$dom = new DOMD... | 2010/12/28 | [
"https://Stackoverflow.com/questions/4544272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501751/"
] | I think you are creating a document that looks like this:
```
<mycatch>
....
</mycatch>
<mycatch>
....
</mycatch>
```
This is not a valid XML document as it has more than one root element. You must have a single top-level element, as in
```
<mydocument>
<mycatch>
....
</mycatch>
<mycatch>
... | I Had the same error before but I saw I was using the
```
header('Content-Type: text/html');
```
Please check on your template file if there you are suing the Content Type. |
4,544,272 | When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the `$lng` and `$lat` from the query string and it works fine locally.
```
$lng=$_GET['lng'];
$lat=$_GET['lat'];
$conn=new LoginSystem();
$conn->connect();
$dom = new DOMD... | 2010/12/28 | [
"https://Stackoverflow.com/questions/4544272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501751/"
] | You might have output (maybe error/debug output) that precedes your call to
```
header("Content-type: text/xml");
```
Therefore, the content being delivered to the browser is not "xml"... that's what the error message is trying to tell you (at least that was the case for me and I had the same error message as you've... | Add on to @john-erck 's answer <https://stackoverflow.com/a/11463891/418439>, where my issue was due to an external library is using deprecated (since PHP 7.2) `assert(string)` function, which generated extra characters before my xml. The solution for `assert(string)` is to set `error_reporting(E_ALL ^ E_DEPRECATED);` ... |
4,544,272 | When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the `$lng` and `$lat` from the query string and it works fine locally.
```
$lng=$_GET['lng'];
$lat=$_GET['lat'];
$conn=new LoginSystem();
$conn->connect();
$dom = new DOMD... | 2010/12/28 | [
"https://Stackoverflow.com/questions/4544272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501751/"
] | The problem is database connection string, one of your MySQL database connection function parameter is not correct ,so there is an error message in the browser output, Just right click output webpage and view html source code you will see error line followed by correct XML output data(file).
I had same problem and the ... | I Had the same error before but I saw I was using the
```
header('Content-Type: text/html');
```
Please check on your template file if there you are suing the Content Type. |
4,544,272 | When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the `$lng` and `$lat` from the query string and it works fine locally.
```
$lng=$_GET['lng'];
$lat=$_GET['lat'];
$conn=new LoginSystem();
$conn->connect();
$dom = new DOMD... | 2010/12/28 | [
"https://Stackoverflow.com/questions/4544272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501751/"
] | I think you are creating a document that looks like this:
```
<mycatch>
....
</mycatch>
<mycatch>
....
</mycatch>
```
This is not a valid XML document as it has more than one root element. You must have a single top-level element, as in
```
<mydocument>
<mycatch>
....
</mycatch>
<mycatch>
... | You might have output (maybe error/debug output) that precedes your call to
```
header("Content-type: text/xml");
```
Therefore, the content being delivered to the browser is not "xml"... that's what the error message is trying to tell you (at least that was the case for me and I had the same error message as you've... |
4,544,272 | When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the `$lng` and `$lat` from the query string and it works fine locally.
```
$lng=$_GET['lng'];
$lat=$_GET['lat'];
$conn=new LoginSystem();
$conn->connect();
$dom = new DOMD... | 2010/12/28 | [
"https://Stackoverflow.com/questions/4544272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501751/"
] | I think you are creating a document that looks like this:
```
<mycatch>
....
</mycatch>
<mycatch>
....
</mycatch>
```
This is not a valid XML document as it has more than one root element. You must have a single top-level element, as in
```
<mydocument>
<mycatch>
....
</mycatch>
<mycatch>
... | On each loop of the result set, you're appending a new root element to the document, creating an XML document like this:
```
<?xml version="1.0"?>
<mycatch>...</mycatch>
<mycatch>...</mycatch>
...
```
An XML document can only have one root element, which is why the error is stating there is "extra content". Create a... |
4,544,272 | When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the `$lng` and `$lat` from the query string and it works fine locally.
```
$lng=$_GET['lng'];
$lat=$_GET['lat'];
$conn=new LoginSystem();
$conn->connect();
$dom = new DOMD... | 2010/12/28 | [
"https://Stackoverflow.com/questions/4544272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501751/"
] | The problem is database connection string, one of your MySQL database connection function parameter is not correct ,so there is an error message in the browser output, Just right click output webpage and view html source code you will see error line followed by correct XML output data(file).
I had same problem and the ... | Add on to @john-erck 's answer <https://stackoverflow.com/a/11463891/418439>, where my issue was due to an external library is using deprecated (since PHP 7.2) `assert(string)` function, which generated extra characters before my xml. The solution for `assert(string)` is to set `error_reporting(E_ALL ^ E_DEPRECATED);` ... |
4,544,272 | When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the `$lng` and `$lat` from the query string and it works fine locally.
```
$lng=$_GET['lng'];
$lat=$_GET['lat'];
$conn=new LoginSystem();
$conn->connect();
$dom = new DOMD... | 2010/12/28 | [
"https://Stackoverflow.com/questions/4544272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501751/"
] | The problem is database connection string, one of your MySQL database connection function parameter is not correct ,so there is an error message in the browser output, Just right click output webpage and view html source code you will see error line followed by correct XML output data(file).
I had same problem and the ... | On each loop of the result set, you're appending a new root element to the document, creating an XML document like this:
```
<?xml version="1.0"?>
<mycatch>...</mycatch>
<mycatch>...</mycatch>
...
```
An XML document can only have one root element, which is why the error is stating there is "extra content". Create a... |
4,544,272 | When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the `$lng` and `$lat` from the query string and it works fine locally.
```
$lng=$_GET['lng'];
$lat=$_GET['lat'];
$conn=new LoginSystem();
$conn->connect();
$dom = new DOMD... | 2010/12/28 | [
"https://Stackoverflow.com/questions/4544272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501751/"
] | You might have output (maybe error/debug output) that precedes your call to
```
header("Content-type: text/xml");
```
Therefore, the content being delivered to the browser is not "xml"... that's what the error message is trying to tell you (at least that was the case for me and I had the same error message as you've... | On each loop of the result set, you're appending a new root element to the document, creating an XML document like this:
```
<?xml version="1.0"?>
<mycatch>...</mycatch>
<mycatch>...</mycatch>
...
```
An XML document can only have one root element, which is why the error is stating there is "extra content". Create a... |
4,544,272 | When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the `$lng` and `$lat` from the query string and it works fine locally.
```
$lng=$_GET['lng'];
$lat=$_GET['lat'];
$conn=new LoginSystem();
$conn->connect();
$dom = new DOMD... | 2010/12/28 | [
"https://Stackoverflow.com/questions/4544272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501751/"
] | I think you are creating a document that looks like this:
```
<mycatch>
....
</mycatch>
<mycatch>
....
</mycatch>
```
This is not a valid XML document as it has more than one root element. You must have a single top-level element, as in
```
<mydocument>
<mycatch>
....
</mycatch>
<mycatch>
... | Add on to @john-erck 's answer <https://stackoverflow.com/a/11463891/418439>, where my issue was due to an external library is using deprecated (since PHP 7.2) `assert(string)` function, which generated extra characters before my xml. The solution for `assert(string)` is to set `error_reporting(E_ALL ^ E_DEPRECATED);` ... |
4,544,272 | When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.
Note: I retrieved the `$lng` and `$lat` from the query string and it works fine locally.
```
$lng=$_GET['lng'];
$lat=$_GET['lat'];
$conn=new LoginSystem();
$conn->connect();
$dom = new DOMD... | 2010/12/28 | [
"https://Stackoverflow.com/questions/4544272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/501751/"
] | I think you are creating a document that looks like this:
```
<mycatch>
....
</mycatch>
<mycatch>
....
</mycatch>
```
This is not a valid XML document as it has more than one root element. You must have a single top-level element, as in
```
<mydocument>
<mycatch>
....
</mycatch>
<mycatch>
... | The problem is database connection string, one of your MySQL database connection function parameter is not correct ,so there is an error message in the browser output, Just right click output webpage and view html source code you will see error line followed by correct XML output data(file).
I had same problem and the ... |
19,183,105 | I´m trying to follow the tutorial ["Handling shape files in the spatstat package" by Adrian Baddeley](http://cran.r-project.org/web/packages/spatstat/vignettes/shapefiles.pdf) where a shape as SpatialPolygonsDataFrame is converted to a collection of owin´s.
The key attributes of shape are summarized below and my objec... | 2013/10/04 | [
"https://Stackoverflow.com/questions/19183105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2346991/"
] | Assuming that `;` marks the end of a line:
```
// Build your final resulting list
List<String> dane = new List<String>();
// use StreamReader to read the file
using (StreamReader sr = new StreamReader(ms))
{
// create a string builder that we can use to store each
// line's content... | I'd suggest you simply use some existing code/lib instead of going to this huddle your self
<http://csvfile.codeplex.com/>
<http://www.codeproject.com/Articles/12170/FileHelpers-v2-0-Delimited-CSV-or-Fixed-Data-Impor>
Are just 2 out there
I would also recommend using the ServiceStack.Text nuget
<https://www.nuget.or... |
19,183,105 | I´m trying to follow the tutorial ["Handling shape files in the spatstat package" by Adrian Baddeley](http://cran.r-project.org/web/packages/spatstat/vignettes/shapefiles.pdf) where a shape as SpatialPolygonsDataFrame is converted to a collection of owin´s.
The key attributes of shape are summarized below and my objec... | 2013/10/04 | [
"https://Stackoverflow.com/questions/19183105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2346991/"
] | Assuming that `;` marks the end of a line:
```
// Build your final resulting list
List<String> dane = new List<String>();
// use StreamReader to read the file
using (StreamReader sr = new StreamReader(ms))
{
// create a string builder that we can use to store each
// line's content... | Use an existing CSV parser from Nuget.
"CSVTools" on Nuget (<http://www.nuget.org/packages/CsvTools/> ) handles this and is pretty fast an supports binding to strong .NET types for easy parsing.
<http://blogs.msdn.com/b/jmstall/archive/2012/03/24/opensource-csv-reader-on-nuget.aspx>
Usage is like this:
```
var d... |
19,183,105 | I´m trying to follow the tutorial ["Handling shape files in the spatstat package" by Adrian Baddeley](http://cran.r-project.org/web/packages/spatstat/vignettes/shapefiles.pdf) where a shape as SpatialPolygonsDataFrame is converted to a collection of owin´s.
The key attributes of shape are summarized below and my objec... | 2013/10/04 | [
"https://Stackoverflow.com/questions/19183105",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2346991/"
] | Use an existing CSV parser from Nuget.
"CSVTools" on Nuget (<http://www.nuget.org/packages/CsvTools/> ) handles this and is pretty fast an supports binding to strong .NET types for easy parsing.
<http://blogs.msdn.com/b/jmstall/archive/2012/03/24/opensource-csv-reader-on-nuget.aspx>
Usage is like this:
```
var d... | I'd suggest you simply use some existing code/lib instead of going to this huddle your self
<http://csvfile.codeplex.com/>
<http://www.codeproject.com/Articles/12170/FileHelpers-v2-0-Delimited-CSV-or-Fixed-Data-Impor>
Are just 2 out there
I would also recommend using the ServiceStack.Text nuget
<https://www.nuget.or... |
11,754,119 | I have multiple Java projects (packaged to jars) in my product which have a single `pom` combining them as modules. Each of the projects has different dependencies and their combined dependencies are defined in the parent `pom`. I want to prepare the output for production and do the following:
1. deploy (copy) all my ... | 2012/08/01 | [
"https://Stackoverflow.com/questions/11754119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/716599/"
] | You need to use Maven assembly plugin for this - here is example of zipping distributive (on production you need then just to unzip):
```xml
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
... | I have the same requirements in my project.
There is a difference between using the Jenkins with ClearCase and SVN.
If you were using SVN you should have checked out your projects into your main project, and worked on them like there were on the same dir.
After checking out my child projects I can work on them, in th... |
11,754,119 | I have multiple Java projects (packaged to jars) in my product which have a single `pom` combining them as modules. Each of the projects has different dependencies and their combined dependencies are defined in the parent `pom`. I want to prepare the output for production and do the following:
1. deploy (copy) all my ... | 2012/08/01 | [
"https://Stackoverflow.com/questions/11754119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/716599/"
] | You need to use Maven assembly plugin for this - here is example of zipping distributive (on production you need then just to unzip):
```xml
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
... | I will summarize What I did in the assembly XML (to answer all of my issues) in addition to Andrey Borisov answer.
1. deploy (copy) all my jars to a single location **[Used the "moduleset" element]**
2. copy the 3rd party jars from all projects to a different **[Used the "dependencySets" element]**
3. copy the configu... |
11,754,119 | I have multiple Java projects (packaged to jars) in my product which have a single `pom` combining them as modules. Each of the projects has different dependencies and their combined dependencies are defined in the parent `pom`. I want to prepare the output for production and do the following:
1. deploy (copy) all my ... | 2012/08/01 | [
"https://Stackoverflow.com/questions/11754119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/716599/"
] | I will summarize What I did in the assembly XML (to answer all of my issues) in addition to Andrey Borisov answer.
1. deploy (copy) all my jars to a single location **[Used the "moduleset" element]**
2. copy the 3rd party jars from all projects to a different **[Used the "dependencySets" element]**
3. copy the configu... | I have the same requirements in my project.
There is a difference between using the Jenkins with ClearCase and SVN.
If you were using SVN you should have checked out your projects into your main project, and worked on them like there were on the same dir.
After checking out my child projects I can work on them, in th... |
1,260,953 | I want to use the redsocks2 software to allow for internet redirection thru a proxy. I have managed to install it and in the git documentation the configuration for this appears easy.
Redsocks2 respository:
<https://github.com/semigodking/redsocks>
My problem is that i just don't know where to put the config file or... | 2020/07/21 | [
"https://askubuntu.com/questions/1260953",
"https://askubuntu.com",
"https://askubuntu.com/users/1071302/"
] | ```
awk 'NR<3 || /s__/' yourfile > newfile
```
or
```
sed -n -e '1,2p' -e '/s__/p' yourfile > newfile
``` | ```
grep -m2 "" your.file > test.txt; grep "s__" your.file >> test.txt
``` |
64,751,415 | I have 2 apps, 1 for dashboard (VueJS) and 1 for api (Laravel)...
In my laravel, I have an api function that uploads an image to my s3 bucket :
```
class ImageController extends Controller
{
public function __construct()
{
$this->middleware('auth:api', ['except' => ['uploadimage']]);
$this->mi... | 2020/11/09 | [
"https://Stackoverflow.com/questions/64751415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14339880/"
] | Solved the issue, it was just that I forgot to populate the `s3` properties in the `filesystems.php`.
To resolve the issue, follow the steps:
**1.** Go to `filesystems.php`
**2.** Find the `disk` array and inside it is the `s3` array
**3.** In the `s3` array, fill the following properties with the values the sa... | I just had the same error this morning (everything was still working the day before). After searching on Google, I found this question on Stackoverflow (lol).
It took about 30 minutes, I found that the problem is I reinstalled my project on a new computer and forgot to update the .env file with the config info for AWS... |
64,751,415 | I have 2 apps, 1 for dashboard (VueJS) and 1 for api (Laravel)...
In my laravel, I have an api function that uploads an image to my s3 bucket :
```
class ImageController extends Controller
{
public function __construct()
{
$this->middleware('auth:api', ['except' => ['uploadimage']]);
$this->mi... | 2020/11/09 | [
"https://Stackoverflow.com/questions/64751415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14339880/"
] | I follow the first answer and I just change the default value in s3 to '' like this:
```
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID', ''),
'secret' => env('AWS_SECRET_ACCESS_KEY', ''),
'region' => env('AWS_DEFAULT_REGION', ''),
'bucket' => en... | I just had the same error this morning (everything was still working the day before). After searching on Google, I found this question on Stackoverflow (lol).
It took about 30 minutes, I found that the problem is I reinstalled my project on a new computer and forgot to update the .env file with the config info for AWS... |
64,751,415 | I have 2 apps, 1 for dashboard (VueJS) and 1 for api (Laravel)...
In my laravel, I have an api function that uploads an image to my s3 bucket :
```
class ImageController extends Controller
{
public function __construct()
{
$this->middleware('auth:api', ['except' => ['uploadimage']]);
$this->mi... | 2020/11/09 | [
"https://Stackoverflow.com/questions/64751415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14339880/"
] | Solved the issue, it was just that I forgot to populate the `s3` properties in the `filesystems.php`.
To resolve the issue, follow the steps:
**1.** Go to `filesystems.php`
**2.** Find the `disk` array and inside it is the `s3` array
**3.** In the `s3` array, fill the following properties with the values the sa... | I follow the first answer and I just change the default value in s3 to '' like this:
```
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID', ''),
'secret' => env('AWS_SECRET_ACCESS_KEY', ''),
'region' => env('AWS_DEFAULT_REGION', ''),
'bucket' => en... |
64,751,415 | I have 2 apps, 1 for dashboard (VueJS) and 1 for api (Laravel)...
In my laravel, I have an api function that uploads an image to my s3 bucket :
```
class ImageController extends Controller
{
public function __construct()
{
$this->middleware('auth:api', ['except' => ['uploadimage']]);
$this->mi... | 2020/11/09 | [
"https://Stackoverflow.com/questions/64751415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14339880/"
] | Solved the issue, it was just that I forgot to populate the `s3` properties in the `filesystems.php`.
To resolve the issue, follow the steps:
**1.** Go to `filesystems.php`
**2.** Find the `disk` array and inside it is the `s3` array
**3.** In the `s3` array, fill the following properties with the values the sa... | For me it turns out my .env was not being read. I was able to solve it by placing the values directly in the filesystems.php. It worked...
```
's3' => [
'driver' => 's3',
'key' => 'KJHKHKJHKJHKJ',
'secret' => 'Khkgjhbjhjkgg87576',
'region' => 'us-east-1',
'b... |
64,751,415 | I have 2 apps, 1 for dashboard (VueJS) and 1 for api (Laravel)...
In my laravel, I have an api function that uploads an image to my s3 bucket :
```
class ImageController extends Controller
{
public function __construct()
{
$this->middleware('auth:api', ['except' => ['uploadimage']]);
$this->mi... | 2020/11/09 | [
"https://Stackoverflow.com/questions/64751415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14339880/"
] | Solved the issue, it was just that I forgot to populate the `s3` properties in the `filesystems.php`.
To resolve the issue, follow the steps:
**1.** Go to `filesystems.php`
**2.** Find the `disk` array and inside it is the `s3` array
**3.** In the `s3` array, fill the following properties with the values the sa... | I had the same issues found out i had no credentials on .env file.
Make sure to fill env with AWS S3 Credentials and make sure to update on "s3" Array at config/filesystems.php.
```
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY... |
64,751,415 | I have 2 apps, 1 for dashboard (VueJS) and 1 for api (Laravel)...
In my laravel, I have an api function that uploads an image to my s3 bucket :
```
class ImageController extends Controller
{
public function __construct()
{
$this->middleware('auth:api', ['except' => ['uploadimage']]);
$this->mi... | 2020/11/09 | [
"https://Stackoverflow.com/questions/64751415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14339880/"
] | I follow the first answer and I just change the default value in s3 to '' like this:
```
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID', ''),
'secret' => env('AWS_SECRET_ACCESS_KEY', ''),
'region' => env('AWS_DEFAULT_REGION', ''),
'bucket' => en... | For me it turns out my .env was not being read. I was able to solve it by placing the values directly in the filesystems.php. It worked...
```
's3' => [
'driver' => 's3',
'key' => 'KJHKHKJHKJHKJ',
'secret' => 'Khkgjhbjhjkgg87576',
'region' => 'us-east-1',
'b... |
64,751,415 | I have 2 apps, 1 for dashboard (VueJS) and 1 for api (Laravel)...
In my laravel, I have an api function that uploads an image to my s3 bucket :
```
class ImageController extends Controller
{
public function __construct()
{
$this->middleware('auth:api', ['except' => ['uploadimage']]);
$this->mi... | 2020/11/09 | [
"https://Stackoverflow.com/questions/64751415",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14339880/"
] | I follow the first answer and I just change the default value in s3 to '' like this:
```
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID', ''),
'secret' => env('AWS_SECRET_ACCESS_KEY', ''),
'region' => env('AWS_DEFAULT_REGION', ''),
'bucket' => en... | I had the same issues found out i had no credentials on .env file.
Make sure to fill env with AWS S3 Credentials and make sure to update on "s3" Array at config/filesystems.php.
```
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY... |
71,505 | In 1971 before the United States left the gold standard, the median home price was approximately $24,000. Now, the median home price is approximately $180,000.
For people who were alive then and remember the zeitgeist, what was considered "a lot of money" then, like my generation tends to think about one million dolla... | 2016/10/07 | [
"https://money.stackexchange.com/questions/71505",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/49220/"
] | First, from [The Inflation Calculator](http://www.westegg.com/inflation/infl.cgi) -
>
> What cost $24,000 in 1971 would cost $141,898.11 in 2015.
>
>
>
But. In 1970, mortgage rates were 8.5% vs 3.5% today. The payment on $24K (let me just do the math on 100% of price) was $185, which 'inflates' to $1141, but $180... | I found a report online from 1971 titled [Money Income in 1971 of Families and Persons in the United States](https://www2.census.gov/prod2/popscan/p60-085.pdf) (PDF). Table A on page 1 shows that 2.8 million families out of 53.3 million families in 1971 had a family income of $25,000 or more. This works out to about th... |
71,505 | In 1971 before the United States left the gold standard, the median home price was approximately $24,000. Now, the median home price is approximately $180,000.
For people who were alive then and remember the zeitgeist, what was considered "a lot of money" then, like my generation tends to think about one million dolla... | 2016/10/07 | [
"https://money.stackexchange.com/questions/71505",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/49220/"
] | To answer your specific question about income, the answer is: about **$20,000** (or a little less) in yearly income put you in the top 10% of income earners in the United States in 1970. This information is provided by [this US Census Document](https://www2.census.gov/prod2/popscan/p60-104.pdf) (PDF page 13, labeled as... | First, from [The Inflation Calculator](http://www.westegg.com/inflation/infl.cgi) -
>
> What cost $24,000 in 1971 would cost $141,898.11 in 2015.
>
>
>
But. In 1970, mortgage rates were 8.5% vs 3.5% today. The payment on $24K (let me just do the math on 100% of price) was $185, which 'inflates' to $1141, but $180... |
71,505 | In 1971 before the United States left the gold standard, the median home price was approximately $24,000. Now, the median home price is approximately $180,000.
For people who were alive then and remember the zeitgeist, what was considered "a lot of money" then, like my generation tends to think about one million dolla... | 2016/10/07 | [
"https://money.stackexchange.com/questions/71505",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/49220/"
] | First, from [The Inflation Calculator](http://www.westegg.com/inflation/infl.cgi) -
>
> What cost $24,000 in 1971 would cost $141,898.11 in 2015.
>
>
>
But. In 1970, mortgage rates were 8.5% vs 3.5% today. The payment on $24K (let me just do the math on 100% of price) was $185, which 'inflates' to $1141, but $180... | I was a high school junior in 1971 (17 y.o.). At that time, a worker could support a family of 6 on a $3.50 - $4.00 per hour wage (~ $7-8K per year). A family would be considered "well off" if earning $10K -$20K per year and some might consider wealthy if earning more than $20K per year.
"A lot of money" to me then ... |
71,505 | In 1971 before the United States left the gold standard, the median home price was approximately $24,000. Now, the median home price is approximately $180,000.
For people who were alive then and remember the zeitgeist, what was considered "a lot of money" then, like my generation tends to think about one million dolla... | 2016/10/07 | [
"https://money.stackexchange.com/questions/71505",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/49220/"
] | To answer your specific question about income, the answer is: about **$20,000** (or a little less) in yearly income put you in the top 10% of income earners in the United States in 1970. This information is provided by [this US Census Document](https://www2.census.gov/prod2/popscan/p60-104.pdf) (PDF page 13, labeled as... | I found a report online from 1971 titled [Money Income in 1971 of Families and Persons in the United States](https://www2.census.gov/prod2/popscan/p60-085.pdf) (PDF). Table A on page 1 shows that 2.8 million families out of 53.3 million families in 1971 had a family income of $25,000 or more. This works out to about th... |
71,505 | In 1971 before the United States left the gold standard, the median home price was approximately $24,000. Now, the median home price is approximately $180,000.
For people who were alive then and remember the zeitgeist, what was considered "a lot of money" then, like my generation tends to think about one million dolla... | 2016/10/07 | [
"https://money.stackexchange.com/questions/71505",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/49220/"
] | I found a report online from 1971 titled [Money Income in 1971 of Families and Persons in the United States](https://www2.census.gov/prod2/popscan/p60-085.pdf) (PDF). Table A on page 1 shows that 2.8 million families out of 53.3 million families in 1971 had a family income of $25,000 or more. This works out to about th... | I was a high school junior in 1971 (17 y.o.). At that time, a worker could support a family of 6 on a $3.50 - $4.00 per hour wage (~ $7-8K per year). A family would be considered "well off" if earning $10K -$20K per year and some might consider wealthy if earning more than $20K per year.
"A lot of money" to me then ... |
71,505 | In 1971 before the United States left the gold standard, the median home price was approximately $24,000. Now, the median home price is approximately $180,000.
For people who were alive then and remember the zeitgeist, what was considered "a lot of money" then, like my generation tends to think about one million dolla... | 2016/10/07 | [
"https://money.stackexchange.com/questions/71505",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/49220/"
] | To answer your specific question about income, the answer is: about **$20,000** (or a little less) in yearly income put you in the top 10% of income earners in the United States in 1970. This information is provided by [this US Census Document](https://www2.census.gov/prod2/popscan/p60-104.pdf) (PDF page 13, labeled as... | I was a high school junior in 1971 (17 y.o.). At that time, a worker could support a family of 6 on a $3.50 - $4.00 per hour wage (~ $7-8K per year). A family would be considered "well off" if earning $10K -$20K per year and some might consider wealthy if earning more than $20K per year.
"A lot of money" to me then ... |
12,128,844 | I have two queries.
First query returning 11 rows and second query returning 6 rows when i use the minus operator on them it should return 5 rows as far as my understanding
```
SELECT location from uploads where username='Gates'
MINUS
SELECT fileshare FROM `whiteboard` where username='Gates' and friend='Curlyclou... | 2012/08/26 | [
"https://Stackoverflow.com/questions/12128844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1529342/"
] | MySQL does not support `EXCEPT` or `MINUS`.
You can use `NOT EXISTS` , `OUTER JOIN ... NULL` or `NOT IN` (be careful of NULLs) to do an anti semi join.
[See examples and performance comparisons here](http://explainextended.com/2009/09/18/not-in-vs-not-exists-vs-left-join-is-null-mysql/) | Using a "not in" or "not exists" to perform a "minus" query on very large data sets can result in extremely long query times. I came up with a method that mimics the set based operations performed by other databases (merge, sort, remove duplicates).
```
select column1, count(*), min(setnum)
from
(
select distinc... |
36,642,157 | On our MVC 3 Web Application we define the `Thread.CurrentThread.CurrentCulture` with the current user's preferences. However, in one View we submit the data via Ajax always in the format `mm/dd/yyyy` this works fine as long as the user's culture is `en_US`. (obviously)
The surprising thing, it works for all users, wh... | 2016/04/15 | [
"https://Stackoverflow.com/questions/36642157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/621366/"
] | >
> Any ideas why HTTP-POST calls would be handled differently than
> HTTP-GET?
>
>
>
The default model binder uses the following cultures depending on the HTTPVERB
* InvariantCulture for your HTTPGET
* CurrentCulture for your HTTPPOST requests.
This is because users will share their URLS (HTTPGET) with other u... | Can you please check whether your request handler is `GET or POST`, if it was set to POST then the GET request can't be processed.
**edit** \*\* Ignore below one \*\* : since URL encoding is same in both methods
"The only difference that in `GET` request is all the special characters will be encoded `for. ex / to %2f... |
463,197 | >
> Prove that, for $n>k$, $$\sum\limits\_{i=1}^{n-k} (-1)^{i+1} \cdot \frac{(k-1+i)!}{k! \cdot(i-1)!} \cdot \frac{n!}{(k+i)! \cdot (n-k-i)!}=1$$
>
>
>
I found this problem in a book at the library of my my university, but sadly the book doesn't show a solution. I worked on it quite a long time, but now I have to ... | 2013/08/08 | [
"https://math.stackexchange.com/questions/463197",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Note first that two factorials nearly cancel out, leaving us with $\frac1{k+i}=\int\_0^1t^{k+i-1}\mathrm dt$, hence the sum to be computed is
$$
S=\sum\_{i=1}^{n-k}(-1)^{i+1}n{n-1\choose k}{n-k-1\choose i-1}\int\_0^1t^{k+i-1}\mathrm dt
$$
Second, note that
$$
\sum\_{i=1}^{n-k}(-1)^{i+1}{n-k-1\choose i-1}t^{k+i-1}=t^k\s... | We can use a [generating-function](http://en.wikipedia.org/wiki/Generating_function) approach.
For any $k$, define
$$
a\_n=\sum\_{i=1}^{n-k}(-1)^{i-1}\frac{(k+i-1)!}{k!\,(i-1)!}\frac{n!}{(k+i)!\,(n-k-i)!}\tag{1}
$$
Consider the sum
$$
\begin{align}
\sum\_{n=k}^\infty a\_nx^n
&=\sum\_{n=k}^\infty\sum\_{i=1}^{n-k}(-1)^{... |
3,362,218 | can I remove the "Choose forum dropdown field" from my forum nodes content types ?
I have only 1 forum and there is only 1 choice I would like my users not have to select it as additional step.
If there is not any option to remove it I would like to know how I can submit the form with that value.
I've tried to hide ... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3362218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/257022/"
] | Are you implementing this delegate method in your App Delegate:
```
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
```
Try breakpointing there and see if it gets called.
See the [API docs for the UIApplicationDelegate](http://developer.apple.com/iphone/library... | My guess is that you implement `application:didFinishLaunchingWithOptions:` To get the push during launch while your app is closed. To receive them while you are running, you need to implement `application:didReceiveRemoteNotification`. |
28,884,729 | This is my string:
```
<address>tel+1234567890</address>
```
This is my regex:
```
([\d].*<)
```
which matches this:
>
> 1234567890<
>
>
>
but I dont want to match the last `<`character. | 2015/03/05 | [
"https://Stackoverflow.com/questions/28884729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can use a [positive lookahead](http://www.regular-expressions.info/lookaround.html):
```
\d+(?=<)
```
The `(?=`...`)` syntax makes sure what's inside the parens matches at that position, without moving the match cursor forward, thus without consuming the input string. It's also called a *zero-width assertion*.
... | ```
([\d]+)
```
This should work , try it out and let me know
Check the [demo](https://regex101.com/r/dB8tU4/1)
Also as @LucasTrzesniewski said , you can use the look ahead
```
(\d+.(?=<))
```
Here is the [demo](https://regex101.com/r/jK9iT8/1) |
18,587,019 | I'm looking for some help in a matter i can't solve it.
i created a stored procedure to select data from a table called "applicant"
and it work great
this is the code below:
```
USE [Josons]
GO
/****** Object: StoredProcedure [dbo].[PROC_GETALLAPPLICANTS] Script Date: 09/03/2013 10:50:58 ******/
SET... | 2013/09/03 | [
"https://Stackoverflow.com/questions/18587019",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2691407/"
] | What your looking for is [`os.path.exists(path)`](http://docs.python.org/2/library/os.path.html#os.path.exists) and [`os.path.isdir(path)`](http://docs.python.org/2/library/os.path.html#os.path.isdir) to check if a particular path exists and points to a directory. | Try this:
```
for root, dirs, files in os.walk('/home/cmp/Desktop/GIT_REFERENCE_REPOSITORIES'):
dirs[:] = [os.path.join(root, d) for d in dirs]
for dir in dirs:
if dir.endswith("test"):
print "test is in dirs"
``` |
1,648,320 | I need to prove that the subset relation “$⊆$” on all subsets of $\mathbb Z$ is not a total order and I'm going to do this by finding $A$ and $B$ such that $A⊈B$ and $B⊈A$?
Is there a simple solution for this? | 2016/02/09 | [
"https://math.stackexchange.com/questions/1648320",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/190190/"
] | Yes. For instance
$$
A = \{1\}, B = \{2\}\\
A = \text{All the negative integers},B = \text{All the positive integers}\\
A = \{2n \mid n \in \Bbb Z\}, B = \{2n+1\mid n \in \Bbb Z\}\\
A = \Bbb Z \setminus \{1\}, B = \Bbb Z \setminus \{2\}\\
A = \{5n \mid n \in \Bbb Z\}, B = \{3n \mid n \in \Bbb Z\}
$$ | Any two subsets with a non-empty symmetric difference ($A \setminus B) \cup (B \setminus A$) satisfy your requirements. |
1,648,320 | I need to prove that the subset relation “$⊆$” on all subsets of $\mathbb Z$ is not a total order and I'm going to do this by finding $A$ and $B$ such that $A⊈B$ and $B⊈A$?
Is there a simple solution for this? | 2016/02/09 | [
"https://math.stackexchange.com/questions/1648320",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/190190/"
] | Yes. For instance
$$
A = \{1\}, B = \{2\}\\
A = \text{All the negative integers},B = \text{All the positive integers}\\
A = \{2n \mid n \in \Bbb Z\}, B = \{2n+1\mid n \in \Bbb Z\}\\
A = \Bbb Z \setminus \{1\}, B = \Bbb Z \setminus \{2\}\\
A = \{5n \mid n \in \Bbb Z\}, B = \{3n \mid n \in \Bbb Z\}
$$ | Yes. For instance,
$A=n\mathbb{Z}$ and $B=m\mathbb{Z}$, with $gcd(m,n)=1.$ |
1,648,320 | I need to prove that the subset relation “$⊆$” on all subsets of $\mathbb Z$ is not a total order and I'm going to do this by finding $A$ and $B$ such that $A⊈B$ and $B⊈A$?
Is there a simple solution for this? | 2016/02/09 | [
"https://math.stackexchange.com/questions/1648320",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/190190/"
] | Yes. For instance
$$
A = \{1\}, B = \{2\}\\
A = \text{All the negative integers},B = \text{All the positive integers}\\
A = \{2n \mid n \in \Bbb Z\}, B = \{2n+1\mid n \in \Bbb Z\}\\
A = \Bbb Z \setminus \{1\}, B = \Bbb Z \setminus \{2\}\\
A = \{5n \mid n \in \Bbb Z\}, B = \{3n \mid n \in \Bbb Z\}
$$ | Example of subsets can be chosen from the smaller sets $\{1,2,\ldots 30\}$.
Let $A$ be the set of dates in a calendar month when Alice is going to have pizza for dinner, and let $B$ be the set of dates Bob is going to have pizza.
Now $A\subset B$ means, on all the dates Bob had pizza Alice had it too.
Now you can dra... |
1,648,320 | I need to prove that the subset relation “$⊆$” on all subsets of $\mathbb Z$ is not a total order and I'm going to do this by finding $A$ and $B$ such that $A⊈B$ and $B⊈A$?
Is there a simple solution for this? | 2016/02/09 | [
"https://math.stackexchange.com/questions/1648320",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/190190/"
] | Any two subsets with a non-empty symmetric difference ($A \setminus B) \cup (B \setminus A$) satisfy your requirements. | Yes. For instance,
$A=n\mathbb{Z}$ and $B=m\mathbb{Z}$, with $gcd(m,n)=1.$ |
1,648,320 | I need to prove that the subset relation “$⊆$” on all subsets of $\mathbb Z$ is not a total order and I'm going to do this by finding $A$ and $B$ such that $A⊈B$ and $B⊈A$?
Is there a simple solution for this? | 2016/02/09 | [
"https://math.stackexchange.com/questions/1648320",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/190190/"
] | Any two subsets with a non-empty symmetric difference ($A \setminus B) \cup (B \setminus A$) satisfy your requirements. | Example of subsets can be chosen from the smaller sets $\{1,2,\ldots 30\}$.
Let $A$ be the set of dates in a calendar month when Alice is going to have pizza for dinner, and let $B$ be the set of dates Bob is going to have pizza.
Now $A\subset B$ means, on all the dates Bob had pizza Alice had it too.
Now you can dra... |
15,088,356 | I'm just starting out with mvc and have the following code:
```
@model AzureDemo.Models.User
@{
ViewBag.Title = "Interests";
}
<h2>Interests</h2>
<p>
@Html.ActionLink("Logout", "Logout")
</p>
<table>
<tr>
<th>
Interests
</th>
</tr>
@foreach (var interest in Model.Interes... | 2013/02/26 | [
"https://Stackoverflow.com/questions/15088356",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/674701/"
] | If you want to override the clicking of links in the `WebView`, you can use the [`shouldOverrideUrlLoading`](http://developer.android.com/reference/android/webkit/WebViewClient.html#shouldOverrideKeyEvent%28android.webkit.WebView%2C%20android.view.KeyEvent%29) method of the [`WebViewClient`](http://developer.android.co... | simply add this to your webview in layout
`android:focusableInTouchMode="false"` |
22,144,189 | I have installed Django server and it can be accessed as below
```
http://localhost:8000/get-sms/
http://127.0.0.1:8000/get-sms/
```
suppose My IP is `x.x.x.x` .
From another PC under the same network when I do
```
my-ip:8000/get-sms/
```
but it is not working.
I can easily ping my IP with that computer.
Moreo... | 2014/03/03 | [
"https://Stackoverflow.com/questions/22144189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1355249/"
] | [Running the Django Development Server](https://docs.djangoproject.com/en/2.0/ref/django-admin/#runserver)
This is what you're looking for. To help you further, here is what you should do:
```
python manage.py runserver 0.0.0.0:8000
```
By the way, this may be a duplicate of [this](https://stackoverflow.com/ques... | You can use <https://ngrok.com/> this will expose your local web server to the internet/public. |
22,144,189 | I have installed Django server and it can be accessed as below
```
http://localhost:8000/get-sms/
http://127.0.0.1:8000/get-sms/
```
suppose My IP is `x.x.x.x` .
From another PC under the same network when I do
```
my-ip:8000/get-sms/
```
but it is not working.
I can easily ping my IP with that computer.
Moreo... | 2014/03/03 | [
"https://Stackoverflow.com/questions/22144189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1355249/"
] | [Running the Django Development Server](https://docs.djangoproject.com/en/2.0/ref/django-admin/#runserver)
This is what you're looking for. To help you further, here is what you should do:
```
python manage.py runserver 0.0.0.0:8000
```
By the way, this may be a duplicate of [this](https://stackoverflow.com/ques... | To add to @Depado 's answer you may need to add your LAN IP address to `ALLOWED_HOSTS` in the `settings.py` along with `localhost`. it would look like,
```
ALLOWED_HOSTS = ["localhost", "192.168.8.160"]
```
(if `localhost` isn't working use `127.0.0.1` as suggested by @Sabito 錆兎) |
22,144,189 | I have installed Django server and it can be accessed as below
```
http://localhost:8000/get-sms/
http://127.0.0.1:8000/get-sms/
```
suppose My IP is `x.x.x.x` .
From another PC under the same network when I do
```
my-ip:8000/get-sms/
```
but it is not working.
I can easily ping my IP with that computer.
Moreo... | 2014/03/03 | [
"https://Stackoverflow.com/questions/22144189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1355249/"
] | [Running the Django Development Server](https://docs.djangoproject.com/en/2.0/ref/django-admin/#runserver)
This is what you're looking for. To help you further, here is what you should do:
```
python manage.py runserver 0.0.0.0:8000
```
By the way, this may be a duplicate of [this](https://stackoverflow.com/ques... | Everywhere I looked, I kept seeing the answer to use the terminal command:
`python manage.py runserver 0.0.0.0:8000`
That works, but not if you want to run a remote debugger across the LAN (in my case VSCode), which launches the server automatically without a chance to modify the host ip address. However, I found a p... |
22,144,189 | I have installed Django server and it can be accessed as below
```
http://localhost:8000/get-sms/
http://127.0.0.1:8000/get-sms/
```
suppose My IP is `x.x.x.x` .
From another PC under the same network when I do
```
my-ip:8000/get-sms/
```
but it is not working.
I can easily ping my IP with that computer.
Moreo... | 2014/03/03 | [
"https://Stackoverflow.com/questions/22144189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1355249/"
] | To add to @Depado 's answer you may need to add your LAN IP address to `ALLOWED_HOSTS` in the `settings.py` along with `localhost`. it would look like,
```
ALLOWED_HOSTS = ["localhost", "192.168.8.160"]
```
(if `localhost` isn't working use `127.0.0.1` as suggested by @Sabito 錆兎) | You can use <https://ngrok.com/> this will expose your local web server to the internet/public. |
22,144,189 | I have installed Django server and it can be accessed as below
```
http://localhost:8000/get-sms/
http://127.0.0.1:8000/get-sms/
```
suppose My IP is `x.x.x.x` .
From another PC under the same network when I do
```
my-ip:8000/get-sms/
```
but it is not working.
I can easily ping my IP with that computer.
Moreo... | 2014/03/03 | [
"https://Stackoverflow.com/questions/22144189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1355249/"
] | You can use <https://ngrok.com/> this will expose your local web server to the internet/public. | Everywhere I looked, I kept seeing the answer to use the terminal command:
`python manage.py runserver 0.0.0.0:8000`
That works, but not if you want to run a remote debugger across the LAN (in my case VSCode), which launches the server automatically without a chance to modify the host ip address. However, I found a p... |
22,144,189 | I have installed Django server and it can be accessed as below
```
http://localhost:8000/get-sms/
http://127.0.0.1:8000/get-sms/
```
suppose My IP is `x.x.x.x` .
From another PC under the same network when I do
```
my-ip:8000/get-sms/
```
but it is not working.
I can easily ping my IP with that computer.
Moreo... | 2014/03/03 | [
"https://Stackoverflow.com/questions/22144189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1355249/"
] | To add to @Depado 's answer you may need to add your LAN IP address to `ALLOWED_HOSTS` in the `settings.py` along with `localhost`. it would look like,
```
ALLOWED_HOSTS = ["localhost", "192.168.8.160"]
```
(if `localhost` isn't working use `127.0.0.1` as suggested by @Sabito 錆兎) | Everywhere I looked, I kept seeing the answer to use the terminal command:
`python manage.py runserver 0.0.0.0:8000`
That works, but not if you want to run a remote debugger across the LAN (in my case VSCode), which launches the server automatically without a chance to modify the host ip address. However, I found a p... |
23,961,399 | Now this is a very elementary question still I want to ask it. I want to know how can I find d the prime factorization of a number (<=10^12) quickly.
Please help me.
Please don't just post the code please explain too I am just a novice (that to don't know) | 2014/05/30 | [
"https://Stackoverflow.com/questions/23961399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3650050/"
] | I just had the same problem and fixed it by running the command `heroku restart`. | The first answer works great and I know this should be a comment but I don't have the reputation yet to comment.
[Heroku recommends](https://devcenter.heroku.com/articles/rake) running `heroku restart` after a migration, "to reload the schema and pickup any schema changes." Really important, but this was the first ti... |
56,206 | I'm writing a paper about a movie.
I would like to start like this:
>
> *Monsters* is a 2010 independent science-fiction film directed by Gareth Edwards and set in the Mexico-U.S. border region. It is set in the present; however, a significant event has changed human history six years before ....
>
>
>
I would... | 2012/01/28 | [
"https://english.stackexchange.com/questions/56206",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/239/"
] | The film *takes place* in the present. | * about *X* in the Mexico-U.S. border region
* which takes place in the Mexico-U.S. border region
Perhaps you could reword along the lines of
>
> Monsters is a 2010 independent science-fiction film directed by Gareth Edwards. It is set in the present Mexico-U.S. border region; however, a significant event has chang... |
51,142,559 | I have my file path as follows:
```
+------------+ +-----------------+ +------------------+
| | | | | |
| src +-----------> com +--+---> application |
| | | | | | ... | 2018/07/02 | [
"https://Stackoverflow.com/questions/51142559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Problem was that `tf.getSingleton()` does not return a `twitter` instance apparently.
it should be just `Twitter twitter = tf.getInstance();` and then it works. | Your code appears to be cut and pasted from known working code. Check again that there are no extra characters, such as a space at the end of a string. |
50,680,705 | I'm working on a chat function where I want the users messages appear on the *right side* and messages from others on the *left side*. The *right side* is giving some trouble.
As the message is short, it should stick to the right side of the screen, then the name of the user should be right next to it as shown below (... | 2018/06/04 | [
"https://Stackoverflow.com/questions/50680705",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1973005/"
] | Maybe this could help you, if you already have a `ConstraintLayout`, play a little bit more with the possible constraint attributes.
```
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.andro... | You should be able to manage this functionality by implementing the `constraint` `Guideline`.
With this, you can split your entire layout vertically and separate user messages and responses while formatting each side individually.
```
<android.support.constraint.Guideline
android:layout_width="wrap_content"
android:l... |
4,109,173 | I'm trying to work with producer/consumer threads in a bounded buffer. The buffer length is 5. I have 1 mutex and 2 semaphores, empty which starts out at the size of the buffer, and full, which starts out at 0.
When I run my code without sleep() at the end, it continually produces until the buffer is completely fully... | 2010/11/05 | [
"https://Stackoverflow.com/questions/4109173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/498696/"
] | The parameter to `sleep()` is the number of seconds to sleep for. `rand()` returns an integer between 0 and `RAND_MAX` (typically 32767 or 231-1), and when you multiply that by 10, you're sleeping for an absurdly large amount of time. You're not deadlocking, just sleeping for a very long time. | I don't know if that is the reason for your deadlock, but you have to be careful with `sem_t` functions they are subject to interrupts, in particular due to IO and things like that.
Never ignore returns from system functions. Here, you'd have to check the return and then `errno` for `EINTR`.
Then, I don't know if you... |
4,109,173 | I'm trying to work with producer/consumer threads in a bounded buffer. The buffer length is 5. I have 1 mutex and 2 semaphores, empty which starts out at the size of the buffer, and full, which starts out at 0.
When I run my code without sleep() at the end, it continually produces until the buffer is completely fully... | 2010/11/05 | [
"https://Stackoverflow.com/questions/4109173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/498696/"
] | I don't know if that is the reason for your deadlock, but you have to be careful with `sem_t` functions they are subject to interrupts, in particular due to IO and things like that.
Never ignore returns from system functions. Here, you'd have to check the return and then `errno` for `EINTR`.
Then, I don't know if you... | I assume both your threads have the same priority? And is this on a machine with multiple cores, or just one? Just signaling a semaphore will not preempt your current thread, so it is to be expected for the current thread to carry on until its slice expires.
Also, I would definitely unlock the mutex before signaling t... |
4,109,173 | I'm trying to work with producer/consumer threads in a bounded buffer. The buffer length is 5. I have 1 mutex and 2 semaphores, empty which starts out at the size of the buffer, and full, which starts out at 0.
When I run my code without sleep() at the end, it continually produces until the buffer is completely fully... | 2010/11/05 | [
"https://Stackoverflow.com/questions/4109173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/498696/"
] | I don't know if that is the reason for your deadlock, but you have to be careful with `sem_t` functions they are subject to interrupts, in particular due to IO and things like that.
Never ignore returns from system functions. Here, you'd have to check the return and then `errno` for `EINTR`.
Then, I don't know if you... | `Do you have any idea why when I don't include sleep it always produces and consumes in blocks instead of every other?`
Thats probably because the ~30 ms time slice each thread is given is more than enough to have the producer produce everything, before a context switch had a chance to occur. |
4,109,173 | I'm trying to work with producer/consumer threads in a bounded buffer. The buffer length is 5. I have 1 mutex and 2 semaphores, empty which starts out at the size of the buffer, and full, which starts out at 0.
When I run my code without sleep() at the end, it continually produces until the buffer is completely fully... | 2010/11/05 | [
"https://Stackoverflow.com/questions/4109173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/498696/"
] | The parameter to `sleep()` is the number of seconds to sleep for. `rand()` returns an integer between 0 and `RAND_MAX` (typically 32767 or 231-1), and when you multiply that by 10, you're sleeping for an absurdly large amount of time. You're not deadlocking, just sleeping for a very long time. | I assume both your threads have the same priority? And is this on a machine with multiple cores, or just one? Just signaling a semaphore will not preempt your current thread, so it is to be expected for the current thread to carry on until its slice expires.
Also, I would definitely unlock the mutex before signaling t... |
4,109,173 | I'm trying to work with producer/consumer threads in a bounded buffer. The buffer length is 5. I have 1 mutex and 2 semaphores, empty which starts out at the size of the buffer, and full, which starts out at 0.
When I run my code without sleep() at the end, it continually produces until the buffer is completely fully... | 2010/11/05 | [
"https://Stackoverflow.com/questions/4109173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/498696/"
] | The parameter to `sleep()` is the number of seconds to sleep for. `rand()` returns an integer between 0 and `RAND_MAX` (typically 32767 or 231-1), and when you multiply that by 10, you're sleeping for an absurdly large amount of time. You're not deadlocking, just sleeping for a very long time. | `Do you have any idea why when I don't include sleep it always produces and consumes in blocks instead of every other?`
Thats probably because the ~30 ms time slice each thread is given is more than enough to have the producer produce everything, before a context switch had a chance to occur. |
4,109,173 | I'm trying to work with producer/consumer threads in a bounded buffer. The buffer length is 5. I have 1 mutex and 2 semaphores, empty which starts out at the size of the buffer, and full, which starts out at 0.
When I run my code without sleep() at the end, it continually produces until the buffer is completely fully... | 2010/11/05 | [
"https://Stackoverflow.com/questions/4109173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/498696/"
] | `Do you have any idea why when I don't include sleep it always produces and consumes in blocks instead of every other?`
Thats probably because the ~30 ms time slice each thread is given is more than enough to have the producer produce everything, before a context switch had a chance to occur. | I assume both your threads have the same priority? And is this on a machine with multiple cores, or just one? Just signaling a semaphore will not preempt your current thread, so it is to be expected for the current thread to carry on until its slice expires.
Also, I would definitely unlock the mutex before signaling t... |
3,064,378 | I am beginner in GWT. My web-application need to save information, that user was typed, to txt file - how to implement this?
Thanks in advance. | 2010/06/17 | [
"https://Stackoverflow.com/questions/3064378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369625/"
] | The question is: where do want to save the txt file? The GWT app is running in the browser, so you don't have access to the file system via the API (JavaScript is sandboxed), so your only option is to send the text to the server (using RPC or a HTTP POST) and save it there using your RemoteServiceServlet. | If it is a small enough text file you could create a [Date URL](http://en.wikipedia.org/wiki/Data_URI_scheme) on the client which the client would then see as a downloadable file.
You can use this [utility](http://dataurl.net/#dataurlmaker) to try it out. |
23,335,661 | I have a fasta file which contains protein sequences. How can I count the number of residues in each sequence with awk?
```
>seq1
PESDFA
>seq2
>seq3
GFCSSWWR
```
Desired Output
```
seq1 6
seq2 0
seq3 8
``` | 2014/04/28 | [
"https://Stackoverflow.com/questions/23335661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3580414/"
] | This `awk` gives you some:
```
awk -v FS="" '!/^>/ {print f,NF} {f=substr($0,2)}' file
seq1 6
seq3 8
```
---
To get `seq2` you can do this:
```
awk '{printf (/^>/&&NR>1?RS:"")"%s ",$0} END {print ""}' file | awk '{print substr($1,2),length($2)}'
seq1 6
seq2 0
seq3 8
```
First part change all `seq` and info to on... | ```
$ awk -F'>' '
NF==2 { seq=$2; lgth[seq]=0; next }
{ lgth[seq]=length($0) }
END { for (seq in lgth) print seq, lgth[seq] }
' file
seq1 6
seq2 0
seq3 8
```
If you care about the order of output, just keep a separate array of `seq` values
```
$ awk -F'>' '
NF==2 { seq=$2; seqs[++numSeqs]=seq; next}
... |
23,335,661 | I have a fasta file which contains protein sequences. How can I count the number of residues in each sequence with awk?
```
>seq1
PESDFA
>seq2
>seq3
GFCSSWWR
```
Desired Output
```
seq1 6
seq2 0
seq3 8
``` | 2014/04/28 | [
"https://Stackoverflow.com/questions/23335661",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3580414/"
] | this line is not nice, but works for your example:
```
kent$ paste f <(sed '1d' f)|awk '/^>/{print $1, ($2~/^>/?0:length($2))}'
>seq1 6
>seq2 0
>seq3 8
``` | ```
$ awk -F'>' '
NF==2 { seq=$2; lgth[seq]=0; next }
{ lgth[seq]=length($0) }
END { for (seq in lgth) print seq, lgth[seq] }
' file
seq1 6
seq2 0
seq3 8
```
If you care about the order of output, just keep a separate array of `seq` values
```
$ awk -F'>' '
NF==2 { seq=$2; seqs[++numSeqs]=seq; next}
... |
50,468,122 | Is it possible to specify private nuget feed server while using msbuild 15.0 in vs 2017?
The current powershell command I am using is following:
```
&$msbuild /t:restore /tv:15.0 /t:Rebuild /p:Configuration=Release
```
This is by default fetching only nuget.org's feed. | 2018/05/22 | [
"https://Stackoverflow.com/questions/50468122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5810078/"
] | >
> How to specify private nuget package source in msbuild 15.0 command line?
>
>
>
If you want to restore the nuget package only from the specify private nuget package source, you could use the property `RestoreSources` to specify private source:
```
msbuild /t:restore /p:RestoreSources=xxx /tv:15.0 /t:Rebuild /... | you can use `/p:RestoreAdditionalProjectSources=…` to specify other sources.
Also, use `/restore` (MSBuild 15.3+) instead of specifying `Restore` together with other targets so all changed files generated by NuGet are properly reloaded. |
50,468,122 | Is it possible to specify private nuget feed server while using msbuild 15.0 in vs 2017?
The current powershell command I am using is following:
```
&$msbuild /t:restore /tv:15.0 /t:Rebuild /p:Configuration=Release
```
This is by default fetching only nuget.org's feed. | 2018/05/22 | [
"https://Stackoverflow.com/questions/50468122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5810078/"
] | you can use `/p:RestoreAdditionalProjectSources=…` to specify other sources.
Also, use `/restore` (MSBuild 15.3+) instead of specifying `Restore` together with other targets so all changed files generated by NuGet are properly reloaded. | I added a new package source to nuget.config file located in '%appdata%\NuGet\NuGet.Config' like that:
```
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="anotherSource" value="http://10.... |
50,468,122 | Is it possible to specify private nuget feed server while using msbuild 15.0 in vs 2017?
The current powershell command I am using is following:
```
&$msbuild /t:restore /tv:15.0 /t:Rebuild /p:Configuration=Release
```
This is by default fetching only nuget.org's feed. | 2018/05/22 | [
"https://Stackoverflow.com/questions/50468122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5810078/"
] | >
> How to specify private nuget package source in msbuild 15.0 command line?
>
>
>
If you want to restore the nuget package only from the specify private nuget package source, you could use the property `RestoreSources` to specify private source:
```
msbuild /t:restore /p:RestoreSources=xxx /tv:15.0 /t:Rebuild /... | MS Build reads NuGet.Config files from the solution root. You can add a new Nuget.config file and specify the external repositories inside that.
[nuget.config reference](https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file#example-config-file) |
50,468,122 | Is it possible to specify private nuget feed server while using msbuild 15.0 in vs 2017?
The current powershell command I am using is following:
```
&$msbuild /t:restore /tv:15.0 /t:Rebuild /p:Configuration=Release
```
This is by default fetching only nuget.org's feed. | 2018/05/22 | [
"https://Stackoverflow.com/questions/50468122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5810078/"
] | >
> How to specify private nuget package source in msbuild 15.0 command line?
>
>
>
If you want to restore the nuget package only from the specify private nuget package source, you could use the property `RestoreSources` to specify private source:
```
msbuild /t:restore /p:RestoreSources=xxx /tv:15.0 /t:Rebuild /... | I added a new package source to nuget.config file located in '%appdata%\NuGet\NuGet.Config' like that:
```
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="anotherSource" value="http://10.... |
50,468,122 | Is it possible to specify private nuget feed server while using msbuild 15.0 in vs 2017?
The current powershell command I am using is following:
```
&$msbuild /t:restore /tv:15.0 /t:Rebuild /p:Configuration=Release
```
This is by default fetching only nuget.org's feed. | 2018/05/22 | [
"https://Stackoverflow.com/questions/50468122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5810078/"
] | MS Build reads NuGet.Config files from the solution root. You can add a new Nuget.config file and specify the external repositories inside that.
[nuget.config reference](https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file#example-config-file) | I added a new package source to nuget.config file located in '%appdata%\NuGet\NuGet.Config' like that:
```
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="anotherSource" value="http://10.... |
20,883,425 | While reading a different topic I came across this piece of code:
```
function loadme() {
var arr = ["a", "b", "c"];
var fs = [];
for (var i in arr) {
var x = arr[i];
var f = function() { console.log(x) };
f();
fs.push(f);
}
for (var j in fs) {
fs[j]();
}
}
```
This will output: a,b,c,c,c,c. The... | 2014/01/02 | [
"https://Stackoverflow.com/questions/20883425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1295369/"
] | ```
var x = arr[i];
var f = function() { console.log(x) };
```
In these two lines, `console.log(x)` thinks that it just has to print `x`. So, all the three functions are created that way only. So, when you immediately execute the functions, the value of `x` is different in each of the iterations. But when the looping... | This situation is, in fact, quite easy to explain and it occurs in many programming languages, not just JavaScript.
Let's first take the output sequense `a,b,c,c,c,c` and discard the first three elements - `a,b,c` because this is what gets printed when you execute your function `f()` inside the first `for` loop.
So... |
42,728,484 | Quick question!
I have a macro that uses Application.AciveSheet to reference the current worksheet since I want it to run in any of our numerous worksheets. It copies data from Application.ActiveSheet to another sheet "Labels". I would like to actually create the sheet labels in the macro and then return to Applicatio... | 2017/03/10 | [
"https://Stackoverflow.com/questions/42728484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3574510/"
] | add this code at the beginning of your code (1st line after Sub)
```
Sub LabelCreation()
Set aws = ActiveSheet 'aws is current active sheet
Sheets.Add 'add a new sheet
ActiveSheet.Name = "Labels" 'name it "labels"
aws.Activate 'reactivate initial active sheet
'uses the active sheet and Z range to 1... | Would add a small tweak to the existing good answer to check that the *labels* sheet doesn't already exist (ie stop code running more than once)
```
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim ws3 As Worksheet
Set ws1 = ActiveSheet
Set ws2 = Sheets.Add
On Error Resume Next
Set ws3 = Sheets("labels")
On Error GoTo 0... |
15,579 | I have been thinking of rebuilding my portfolio since its pretty outdated and I wanted some views on the approach I should take
Option 1 : Have an approach in which I list all the projects (major ones) on the front page and allow visitors to go through them
Option 2 : I build it like a conventional site and allow u... | 2011/12/30 | [
"https://ux.stackexchange.com/questions/15579",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/5113/"
] | I have worked on my own site through countless iterations and have never been happy. I'll paraphrase the old adage, "A designer who designs their own site has a fool for a client" :)
This is what I have learned through feedback on my own site, from hiring and seeing the successful sites of people who have been hired.
... | This is a target group question. My guess is that you want to get a new job and that is why you want to build a portfolio site? Where do you want to work? At an IT-company? At an a markering department or a e-commerce business? At an advertising agency? Ask people at those places what they look for when they How well d... |
15,579 | I have been thinking of rebuilding my portfolio since its pretty outdated and I wanted some views on the approach I should take
Option 1 : Have an approach in which I list all the projects (major ones) on the front page and allow visitors to go through them
Option 2 : I build it like a conventional site and allow u... | 2011/12/30 | [
"https://ux.stackexchange.com/questions/15579",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/5113/"
] | I have worked on my own site through countless iterations and have never been happy. I'll paraphrase the old adage, "A designer who designs their own site has a fool for a client" :)
This is what I have learned through feedback on my own site, from hiring and seeing the successful sites of people who have been hired.
... | More importantly than the way of presentation is the portfolio development itself, which touches more complex issues like your methodology as a UX designer.
A good methodology could be the following:
* you start mining for an online business that could use your help
* ideally, that business should have the exact issu... |
15,579 | I have been thinking of rebuilding my portfolio since its pretty outdated and I wanted some views on the approach I should take
Option 1 : Have an approach in which I list all the projects (major ones) on the front page and allow visitors to go through them
Option 2 : I build it like a conventional site and allow u... | 2011/12/30 | [
"https://ux.stackexchange.com/questions/15579",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/5113/"
] | More importantly than the way of presentation is the portfolio development itself, which touches more complex issues like your methodology as a UX designer.
A good methodology could be the following:
* you start mining for an online business that could use your help
* ideally, that business should have the exact issu... | This is a target group question. My guess is that you want to get a new job and that is why you want to build a portfolio site? Where do you want to work? At an IT-company? At an a markering department or a e-commerce business? At an advertising agency? Ask people at those places what they look for when they How well d... |
30,169,449 | I have a Matrix and I want to replace values of a column (or row) by an another single value.
I tried this:
```
m = Matrix.empty(5, 0)
n = Matrix.empty(0, 5)
g = m *n
puts g.column(3).map! { 3 }
```
But `map!` isn't working with **Vector**, and `map` doesn't change values of the column in the Matrix. So how can I ... | 2015/05/11 | [
"https://Stackoverflow.com/questions/30169449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2274530/"
] | Had this problem this answer [here](https://stackoverflow.com/questions/16388772/maintain-scroll-position-of-large-html-page-when-client-returns) helped me.
Download from GitHub and dump it in your scripts folder and reference it in `@section Scripts`
Like so at the bottom of your view:
```
@section Scripts
{
<scri... | Use ajax form ... you will need jquery.unobtrusive-ajax.js for it to woork & jquery ofcourse. ( use nuget).
To use it you need to define it like Html.BeginForm but you define an id ( preferably a div ) where the response html will be written. So the page never reloads but ajax inserts the response HTML in the element ... |
62,401,889 | As it is quite easy to get data from database in admin panel,but the case is that how can i get/view those data to front view , front view contains the data from several table. Could you please help me ? How can i manage those front pages easily ? | 2020/06/16 | [
"https://Stackoverflow.com/questions/62401889",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7501972/"
] | This depends on what you mean by "clear observable". You can just reassign `cacheSettingsData$` to an empty Observable:
```
this.cacheSettingsData$ = EMPTY;
```
But this will affect only new observers.
If you want to notify all subscribed observers you can merge a Subject into the chain:
```
loggedOut$ = new Subje... | You can clear observable on log-out event handler.
```
this.cacheSettingsData$ = of([]);
``` |
17,900,122 | As it can be seen in the following fiddle, I have two `div`s, contained in a parent `div` that have stretched to contain the big div, my goal is to make those child `div`s equal in height.
<http://fiddle.jshell.net/y9bM4/>
 | 2013/07/27 | [
"https://Stackoverflow.com/questions/17900122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1657309/"
] | The solution is to use `display: table-cell` to bring those elements inline instead of using `display: inline-block` or `float: left`.
```css
div#container {
padding: 20px;
background: #F1F1F1
}
.content {
width: 150px;
background: #ddd;
padding: 10px;
display: table-cell;
vertical-align: top;
... | Use `display: flex` to stretch your `div`s:
```
div#container {
padding:20px;
background:#F1F1F1;
display: flex;
}
.content {
width:150px;
background:#ddd;
padding:10px;
margin-left: 10px;
}
```
[JSFIDDLE](https://jsfiddle.net/lampt2509/m7tu4c25/4/) |
17,900,122 | As it can be seen in the following fiddle, I have two `div`s, contained in a parent `div` that have stretched to contain the big div, my goal is to make those child `div`s equal in height.
<http://fiddle.jshell.net/y9bM4/>
 | 2013/07/27 | [
"https://Stackoverflow.com/questions/17900122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1657309/"
] | The solution is to use `display: table-cell` to bring those elements inline instead of using `display: inline-block` or `float: left`.
```css
div#container {
padding: 20px;
background: #F1F1F1
}
.content {
width: 150px;
background: #ddd;
padding: 10px;
display: table-cell;
vertical-align: top;
... | You can do it easily with a bit of jQuery
```
$(document).ready(function(){
var parentHeight = $("#parentDiv").parent().height();
$("#childDiv").height(parentHeight);
});
``` |
17,900,122 | As it can be seen in the following fiddle, I have two `div`s, contained in a parent `div` that have stretched to contain the big div, my goal is to make those child `div`s equal in height.
<http://fiddle.jshell.net/y9bM4/>
 | 2013/07/27 | [
"https://Stackoverflow.com/questions/17900122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1657309/"
] | The solution is to use `display: table-cell` to bring those elements inline instead of using `display: inline-block` or `float: left`.
```css
div#container {
padding: 20px;
background: #F1F1F1
}
.content {
width: 150px;
background: #ddd;
padding: 10px;
display: table-cell;
vertical-align: top;
... | Add the following CSS:
For the parent div:
```
style="display: flex;"
```
For child div:
```
style="align-items: stretch;"
``` |
17,900,122 | As it can be seen in the following fiddle, I have two `div`s, contained in a parent `div` that have stretched to contain the big div, my goal is to make those child `div`s equal in height.
<http://fiddle.jshell.net/y9bM4/>
 | 2013/07/27 | [
"https://Stackoverflow.com/questions/17900122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1657309/"
] | The solution is to use `display: table-cell` to bring those elements inline instead of using `display: inline-block` or `float: left`.
```css
div#container {
padding: 20px;
background: #F1F1F1
}
.content {
width: 150px;
background: #ddd;
padding: 10px;
display: table-cell;
vertical-align: top;
... | <https://www.youtube.com/watch?v=jV8B24rSN5o>
I think you can use display as grid:
```
.parent { display: grid };
``` |
17,900,122 | As it can be seen in the following fiddle, I have two `div`s, contained in a parent `div` that have stretched to contain the big div, my goal is to make those child `div`s equal in height.
<http://fiddle.jshell.net/y9bM4/>
 | 2013/07/27 | [
"https://Stackoverflow.com/questions/17900122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1657309/"
] | Use `display: flex` to stretch your `div`s:
```
div#container {
padding:20px;
background:#F1F1F1;
display: flex;
}
.content {
width:150px;
background:#ddd;
padding:10px;
margin-left: 10px;
}
```
[JSFIDDLE](https://jsfiddle.net/lampt2509/m7tu4c25/4/) | You can do it easily with a bit of jQuery
```
$(document).ready(function(){
var parentHeight = $("#parentDiv").parent().height();
$("#childDiv").height(parentHeight);
});
``` |
17,900,122 | As it can be seen in the following fiddle, I have two `div`s, contained in a parent `div` that have stretched to contain the big div, my goal is to make those child `div`s equal in height.
<http://fiddle.jshell.net/y9bM4/>
 | 2013/07/27 | [
"https://Stackoverflow.com/questions/17900122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1657309/"
] | Use `display: flex` to stretch your `div`s:
```
div#container {
padding:20px;
background:#F1F1F1;
display: flex;
}
.content {
width:150px;
background:#ddd;
padding:10px;
margin-left: 10px;
}
```
[JSFIDDLE](https://jsfiddle.net/lampt2509/m7tu4c25/4/) | Add the following CSS:
For the parent div:
```
style="display: flex;"
```
For child div:
```
style="align-items: stretch;"
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.