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 |
|---|---|---|---|---|---|
33,202,966 | This is a simplified version of a problem I am having. I'm trying to create an an array of ProduceItem inside of class database. I have outlined the warnings and problems I've encountered in my attempts. Thank you for your help in advance.
```
import javax.swing.*;
import java.awt.*;
public class Test{
public stat... | 2015/10/18 | [
"https://Stackoverflow.com/questions/33202966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5460495/"
] | The file is created (or truncated) so the output of `ls` can be redirected to it.
Hence, `ls` sees the file. | Understanding that the output of `ls` is being redirected to a file c, we need to look at the procedure the shell uses to execute such command.
When the shell process a command line (very simplified):
1. Divides the line into tokens (usually at spaces).
2. Interprets all tokens (which are commands, arguments, redirec... |
33,202,966 | This is a simplified version of a problem I am having. I'm trying to create an an array of ProduceItem inside of class database. I have outlined the warnings and problems I've encountered in my attempts. Thank you for your help in advance.
```
import javax.swing.*;
import java.awt.*;
public class Test{
public stat... | 2015/10/18 | [
"https://Stackoverflow.com/questions/33202966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5460495/"
] | When you redirect the output of `ls` to the file `c`, it's a chicken and egg problem:
If `c` would not be created upfront, that would mean the shell would need to store the output in a buffer and (in the end) write that buffer to the file.
Since this is not the best approach in many cases (because of memory managemen... | The redirection of standard output for the command
```
ls > c
```
Creates the file handle for `c` before the command `ls` executes. The `touch b` (and visibility of `b` are a red-herring). For example,
```
mkdir t ; cd t ; ls > a ; cat a
```
Will display `a` (**because** the `>` creates the `a` before `ls` is [`e... |
33,202,966 | This is a simplified version of a problem I am having. I'm trying to create an an array of ProduceItem inside of class database. I have outlined the warnings and problems I've encountered in my attempts. Thank you for your help in advance.
```
import javax.swing.*;
import java.awt.*;
public class Test{
public stat... | 2015/10/18 | [
"https://Stackoverflow.com/questions/33202966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5460495/"
] | When you redirect the output of `ls` to the file `c`, it's a chicken and egg problem:
If `c` would not be created upfront, that would mean the shell would need to store the output in a buffer and (in the end) write that buffer to the file.
Since this is not the best approach in many cases (because of memory managemen... | Understanding that the output of `ls` is being redirected to a file c, we need to look at the procedure the shell uses to execute such command.
When the shell process a command line (very simplified):
1. Divides the line into tokens (usually at spaces).
2. Interprets all tokens (which are commands, arguments, redirec... |
33,202,966 | This is a simplified version of a problem I am having. I'm trying to create an an array of ProduceItem inside of class database. I have outlined the warnings and problems I've encountered in my attempts. Thank you for your help in advance.
```
import javax.swing.*;
import java.awt.*;
public class Test{
public stat... | 2015/10/18 | [
"https://Stackoverflow.com/questions/33202966",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5460495/"
] | The redirection of standard output for the command
```
ls > c
```
Creates the file handle for `c` before the command `ls` executes. The `touch b` (and visibility of `b` are a red-herring). For example,
```
mkdir t ; cd t ; ls > a ; cat a
```
Will display `a` (**because** the `>` creates the `a` before `ls` is [`e... | Understanding that the output of `ls` is being redirected to a file c, we need to look at the procedure the shell uses to execute such command.
When the shell process a command line (very simplified):
1. Divides the line into tokens (usually at spaces).
2. Interprets all tokens (which are commands, arguments, redirec... |
25,742,997 | I have several threads in my application - where one is waiting to be notified in some changes in the database. My problem is that once I persist some object and notify the other thread - when it queries the database for new object since last change, the persisted object is not found.
```
@Transactional()
public v... | 2014/09/09 | [
"https://Stackoverflow.com/questions/25742997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/922584/"
] | You problem is the transaction demarcation.
You notify your other thread before the transaction is completed. The data in a database can only be queried when the transaction creating the data is ended (with a commit) (there are some exceptions for some databases but I will not go into depth for this).
To solve your p... | You could register a `TransactionSynchronization` with a `TransactionSynchronizationManager`. This allows you to be called back when the trx is commited successfully. |
66,356,594 | I want to create a Javascript app but I want to do that only using Javascript.
Because the node js is framework and I don't want to use any framework,
can I create a Javascript app without a browser and without any framework?
Only using Javascript? | 2021/02/24 | [
"https://Stackoverflow.com/questions/66356594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15108002/"
] | A property is a wrapper around a field, i.e., a class or struct variable. It provides a getter and/or a setter method to access this variable. (You can also have a read-only property returning the result of a simple evaluation not bound to a single field.)
The getters and setters are implicitly called when reading fro... | **Dynamically Calculated Values**
I didn't read those links, but one reason you might want to implement your own getters & setters is that you may want to return something that requires some type of calculation or manipulation. For example, suppose you have item `Sale` with properties `RawPrice`, `SalesTax`, and `Fina... |
30,786,743 | I'm trying to extract data from two tables that counts the number of orders that each client has placed. The SQL below works fine without the `S.Name` in the `SELECT`, but I would like the Name of the client in the output which is more meaningful than their StoreID. When I add S.Name, I get the following error:
>
> C... | 2015/06/11 | [
"https://Stackoverflow.com/questions/30786743",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/384091/"
] | You have to include *all* non-aggregated columns in the group by list; you've selected `S.Name`, which is not an aggregate but not in the `GROUP BY`:
```
SELECT O.StoreID, COUNT(O.StoreID) AS OrderCount, S.Name
FROM Orders AS O
JOIN Stores AS S ON O.StoreID = S.StoreID
GROUP BY O.StoreID, S.Name -- Added "S.Name" to t... | ```
SELECT
O.StoreID,
COUNT(O.StoreID) AS OrderCount,
S.Name
FROM Orders AS O
JOIN Stores AS S
ON O.StoreID = S.StoreID
GROUP BY O.StoreID,
S.Name
ORDER BY OrderCount DESC
```
When you use count, or sum etc. function then should be group by all fields, in your case `O.StoreID, S.Name`
for more inform... |
870,447 | Running 16.04 w/ USB ethernet running `ifconfig -a` lists the interface named as `enx00051ba6daff` however when I try to bring that interface down with:
```
sudo ifdown enx00051ba6daff
```
I get:
```
Unknown interface enx00051ba6daff
```
I know its up because I'm writing this post from this connection. My ifconf... | 2017/01/10 | [
"https://askubuntu.com/questions/870447",
"https://askubuntu.com",
"https://askubuntu.com/users/640817/"
] | Try
```
sudo ifconfig enx00051ba6daff down
```
I had the exact same problem and this worked. Here is the link I used.
<https://ubuntuforums.org/showthread.php?t=1323646> | `sudo ifdown enx00051ba6daff` or `sudo ifup enx00051ba6daff`, will not work because enx00051ba6daff is not explicitly defined inside `/etc/network/interfaces` file.
So `ifup | ifdown | ifquery` family of functions is pretty unaware of what is inside the system unless this is written inside `/etc/network/interfaces`, b... |
870,447 | Running 16.04 w/ USB ethernet running `ifconfig -a` lists the interface named as `enx00051ba6daff` however when I try to bring that interface down with:
```
sudo ifdown enx00051ba6daff
```
I get:
```
Unknown interface enx00051ba6daff
```
I know its up because I'm writing this post from this connection. My ifconf... | 2017/01/10 | [
"https://askubuntu.com/questions/870447",
"https://askubuntu.com",
"https://askubuntu.com/users/640817/"
] | Try
```
sudo ifconfig enx00051ba6daff down
```
I had the exact same problem and this worked. Here is the link I used.
<https://ubuntuforums.org/showthread.php?t=1323646> | The commands `ifdown` and `ifup` listen to the file `/etc/network/interfaces`. In your case, it cannot find the interfaces, because they are not defined within this file.
You can fix this by:
1. Use the command
```
sudo nano /etc/network/interfaces
```
or vi instead of nano, if you prefer.
2. Here you can add an... |
870,447 | Running 16.04 w/ USB ethernet running `ifconfig -a` lists the interface named as `enx00051ba6daff` however when I try to bring that interface down with:
```
sudo ifdown enx00051ba6daff
```
I get:
```
Unknown interface enx00051ba6daff
```
I know its up because I'm writing this post from this connection. My ifconf... | 2017/01/10 | [
"https://askubuntu.com/questions/870447",
"https://askubuntu.com",
"https://askubuntu.com/users/640817/"
] | Try
```
sudo ifconfig enx00051ba6daff down
```
I had the exact same problem and this worked. Here is the link I used.
<https://ubuntuforums.org/showthread.php?t=1323646> | In my case:
Go to `/etc/network/interfaces.d/`
I didn't found the setup file.
i created one
```
nano /etc/network/interfaces.d/setup
```
with below contents:
```
auto lo
iface lo inet loopback
auto wlp2s0
iface wlp2s0 inet dhcp
```
Then restart the service.
```
/etc/init.d/networking restart
```
Then try... |
870,447 | Running 16.04 w/ USB ethernet running `ifconfig -a` lists the interface named as `enx00051ba6daff` however when I try to bring that interface down with:
```
sudo ifdown enx00051ba6daff
```
I get:
```
Unknown interface enx00051ba6daff
```
I know its up because I'm writing this post from this connection. My ifconf... | 2017/01/10 | [
"https://askubuntu.com/questions/870447",
"https://askubuntu.com",
"https://askubuntu.com/users/640817/"
] | `sudo ifdown enx00051ba6daff` or `sudo ifup enx00051ba6daff`, will not work because enx00051ba6daff is not explicitly defined inside `/etc/network/interfaces` file.
So `ifup | ifdown | ifquery` family of functions is pretty unaware of what is inside the system unless this is written inside `/etc/network/interfaces`, b... | The commands `ifdown` and `ifup` listen to the file `/etc/network/interfaces`. In your case, it cannot find the interfaces, because they are not defined within this file.
You can fix this by:
1. Use the command
```
sudo nano /etc/network/interfaces
```
or vi instead of nano, if you prefer.
2. Here you can add an... |
870,447 | Running 16.04 w/ USB ethernet running `ifconfig -a` lists the interface named as `enx00051ba6daff` however when I try to bring that interface down with:
```
sudo ifdown enx00051ba6daff
```
I get:
```
Unknown interface enx00051ba6daff
```
I know its up because I'm writing this post from this connection. My ifconf... | 2017/01/10 | [
"https://askubuntu.com/questions/870447",
"https://askubuntu.com",
"https://askubuntu.com/users/640817/"
] | `sudo ifdown enx00051ba6daff` or `sudo ifup enx00051ba6daff`, will not work because enx00051ba6daff is not explicitly defined inside `/etc/network/interfaces` file.
So `ifup | ifdown | ifquery` family of functions is pretty unaware of what is inside the system unless this is written inside `/etc/network/interfaces`, b... | In my case:
Go to `/etc/network/interfaces.d/`
I didn't found the setup file.
i created one
```
nano /etc/network/interfaces.d/setup
```
with below contents:
```
auto lo
iface lo inet loopback
auto wlp2s0
iface wlp2s0 inet dhcp
```
Then restart the service.
```
/etc/init.d/networking restart
```
Then try... |
870,447 | Running 16.04 w/ USB ethernet running `ifconfig -a` lists the interface named as `enx00051ba6daff` however when I try to bring that interface down with:
```
sudo ifdown enx00051ba6daff
```
I get:
```
Unknown interface enx00051ba6daff
```
I know its up because I'm writing this post from this connection. My ifconf... | 2017/01/10 | [
"https://askubuntu.com/questions/870447",
"https://askubuntu.com",
"https://askubuntu.com/users/640817/"
] | The commands `ifdown` and `ifup` listen to the file `/etc/network/interfaces`. In your case, it cannot find the interfaces, because they are not defined within this file.
You can fix this by:
1. Use the command
```
sudo nano /etc/network/interfaces
```
or vi instead of nano, if you prefer.
2. Here you can add an... | In my case:
Go to `/etc/network/interfaces.d/`
I didn't found the setup file.
i created one
```
nano /etc/network/interfaces.d/setup
```
with below contents:
```
auto lo
iface lo inet loopback
auto wlp2s0
iface wlp2s0 inet dhcp
```
Then restart the service.
```
/etc/init.d/networking restart
```
Then try... |
22,052,479 | I'm having a rather mysterious error:
All of my imports have been redlined with the message "the import cannot be resolved". However, the types referenced by those same imports are also redlined, and the auto fix suggests adding those exact imports.
?
Some programs such as `curl` has an option for choosing a specific network interface.
In Windows, [ForceBindIP](https://r1ch.net/projects/forcebindip) allows you to force an application to use a specific network interface / IP address.
I wonder... | 2021/02/05 | [
"https://askubuntu.com/questions/1313755",
"https://askubuntu.com",
"https://askubuntu.com/users/25034/"
] | This is the perfect use case for network namespaces, which have been part of Linux since 2016 or earlier. Here's an example with comments to get you started:
```
# enable forwarding
sysctl -w net.ipv4.ip_forward=1
# create the network namespace
ip netns add chrome
# create the virtual nic and it's peer
ip link add c... | Background
==========
Linux has `SO_BINDTODEVICE` option to bind a socket to a specific network interface.
Idea
====
Chromium uses libc function wrappers to invoke a syscall, including the `connect()` syscall that's used to perform a network request. We can patch the `connect()` function to call `setsockopt(SO_BINDT... |
16,624,921 | I made a *Search Box*, roughly coding is like this
```
<table id="searchBox" style="border:1px solid #555;">
<tr>
<td>
<input type="text" style="border:none" id="myTextBox" onclick="makeActive();" />
</td>
<td>
<select onclick="makeActive();">
<option>Option 1</option>
<option>Option 2</option>
... | 2013/05/18 | [
"https://Stackoverflow.com/questions/16624921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2319513/"
] | You're having issues with Cross-origin resource sharing. Read these [Wikipedia CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) and [MDN CORS](https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS) articles.
As for your snippet,
```
<?php
header('X-Frame-Options: GOFORIT');
?>
```
n... | Some websites like google, yahoo have been disabled the iframe embedding for their site. If you want to do that then grab their html using curl or file\_get\_conents on server side and show it.
check the HTTP response header X-Frame-Option. I think for yahoo it should be deny or sameorigin that means only the page of ... |
16,624,921 | I made a *Search Box*, roughly coding is like this
```
<table id="searchBox" style="border:1px solid #555;">
<tr>
<td>
<input type="text" style="border:none" id="myTextBox" onclick="makeActive();" />
</td>
<td>
<select onclick="makeActive();">
<option>Option 1</option>
<option>Option 2</option>
... | 2013/05/18 | [
"https://Stackoverflow.com/questions/16624921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2319513/"
] | You're out of luck: yahoo.com doesn't allow you to embed their site in an iframe. Nor does facebook or other popular sites.
The reason for this restriction is [clickjacking](http://en.wikipedia.org/wiki/Clickjacking).
You can verify this by checking the response headers from their site; they specify `X-Frame-Options:... | You're having issues with Cross-origin resource sharing. Read these [Wikipedia CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) and [MDN CORS](https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS) articles.
As for your snippet,
```
<?php
header('X-Frame-Options: GOFORIT');
?>
```
n... |
16,624,921 | I made a *Search Box*, roughly coding is like this
```
<table id="searchBox" style="border:1px solid #555;">
<tr>
<td>
<input type="text" style="border:none" id="myTextBox" onclick="makeActive();" />
</td>
<td>
<select onclick="makeActive();">
<option>Option 1</option>
<option>Option 2</option>
... | 2013/05/18 | [
"https://Stackoverflow.com/questions/16624921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2319513/"
] | You're having issues with Cross-origin resource sharing. Read these [Wikipedia CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) and [MDN CORS](https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS) articles.
As for your snippet,
```
<?php
header('X-Frame-Options: GOFORIT');
?>
```
n... | Add '**Ignore X-Frame headers**' plugin in google chorme then its working fine. |
16,624,921 | I made a *Search Box*, roughly coding is like this
```
<table id="searchBox" style="border:1px solid #555;">
<tr>
<td>
<input type="text" style="border:none" id="myTextBox" onclick="makeActive();" />
</td>
<td>
<select onclick="makeActive();">
<option>Option 1</option>
<option>Option 2</option>
... | 2013/05/18 | [
"https://Stackoverflow.com/questions/16624921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2319513/"
] | You're out of luck: yahoo.com doesn't allow you to embed their site in an iframe. Nor does facebook or other popular sites.
The reason for this restriction is [clickjacking](http://en.wikipedia.org/wiki/Clickjacking).
You can verify this by checking the response headers from their site; they specify `X-Frame-Options:... | Some websites like google, yahoo have been disabled the iframe embedding for their site. If you want to do that then grab their html using curl or file\_get\_conents on server side and show it.
check the HTTP response header X-Frame-Option. I think for yahoo it should be deny or sameorigin that means only the page of ... |
16,624,921 | I made a *Search Box*, roughly coding is like this
```
<table id="searchBox" style="border:1px solid #555;">
<tr>
<td>
<input type="text" style="border:none" id="myTextBox" onclick="makeActive();" />
</td>
<td>
<select onclick="makeActive();">
<option>Option 1</option>
<option>Option 2</option>
... | 2013/05/18 | [
"https://Stackoverflow.com/questions/16624921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2319513/"
] | Some websites like google, yahoo have been disabled the iframe embedding for their site. If you want to do that then grab their html using curl or file\_get\_conents on server side and show it.
check the HTTP response header X-Frame-Option. I think for yahoo it should be deny or sameorigin that means only the page of ... | Add '**Ignore X-Frame headers**' plugin in google chorme then its working fine. |
16,624,921 | I made a *Search Box*, roughly coding is like this
```
<table id="searchBox" style="border:1px solid #555;">
<tr>
<td>
<input type="text" style="border:none" id="myTextBox" onclick="makeActive();" />
</td>
<td>
<select onclick="makeActive();">
<option>Option 1</option>
<option>Option 2</option>
... | 2013/05/18 | [
"https://Stackoverflow.com/questions/16624921",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2319513/"
] | You're out of luck: yahoo.com doesn't allow you to embed their site in an iframe. Nor does facebook or other popular sites.
The reason for this restriction is [clickjacking](http://en.wikipedia.org/wiki/Clickjacking).
You can verify this by checking the response headers from their site; they specify `X-Frame-Options:... | Add '**Ignore X-Frame headers**' plugin in google chorme then its working fine. |
4,720,454 | Here's the end result I am trying to:
I have over 15 users of an cloned instance of my application, sometimes I need to update files (they pretty much all stay the same--everything is dynamic. This is for updates/new features). I wrote a pretty simple bash script that I had to manually put each user from /home/ into t... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4720454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/494901/"
] | Do this:
```
webUsers=(/home/*/)
```
and the contents will look like:
```
$ declare -p webUsers
declare -a webUsers='([0]="/home/adam/" [1]="/home/jack/" [2]="/home/john")'
$ echo ${webUsers[1]}
/home/jack/
```
Or, if you don't want the parent directory:
```
pushd /home
webUsers=(*/)
popd
```
and you'll get:
... | The following script will loop over all users with directories in `/home`. It will also unconditionally try to create the `/public_html/templates` directory. If it doesn't yet exist, it will get created. If it *does* exist, this command does essentially nothing.
```
#!/bin/bash
cd /home
userarr=( */ );
for user in "... |
4,720,454 | Here's the end result I am trying to:
I have over 15 users of an cloned instance of my application, sometimes I need to update files (they pretty much all stay the same--everything is dynamic. This is for updates/new features). I wrote a pretty simple bash script that I had to manually put each user from /home/ into t... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4720454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/494901/"
] | The following script will loop over all users with directories in `/home`. It will also unconditionally try to create the `/public_html/templates` directory. If it doesn't yet exist, it will get created. If it *does* exist, this command does essentially nothing.
```
#!/bin/bash
cd /home
userarr=( */ );
for user in "... | It may be easier to make a link to the source directory, and then you can just update it in one place.
Just set up each users directory so that the common files are all pulled from a directory called common\_files (or whatever you like), and then run this command in each home directory:
```
ln -s /location/of/files/t... |
4,720,454 | Here's the end result I am trying to:
I have over 15 users of an cloned instance of my application, sometimes I need to update files (they pretty much all stay the same--everything is dynamic. This is for updates/new features). I wrote a pretty simple bash script that I had to manually put each user from /home/ into t... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4720454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/494901/"
] | The following script will loop over all users with directories in `/home`. It will also unconditionally try to create the `/public_html/templates` directory. If it doesn't yet exist, it will get created. If it *does* exist, this command does essentially nothing.
```
#!/bin/bash
cd /home
userarr=( */ );
for user in "... | With bash you can actually make this pretty short and simple. To list the current directory and store it into an array:
```
ls . | readarray i
```
or
`ls . | bash -c 'readarray i'`
To use the data:
`ls . | bash -c 'readarray i && for j in ${i[*]}; do <-command->; done'` |
4,720,454 | Here's the end result I am trying to:
I have over 15 users of an cloned instance of my application, sometimes I need to update files (they pretty much all stay the same--everything is dynamic. This is for updates/new features). I wrote a pretty simple bash script that I had to manually put each user from /home/ into t... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4720454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/494901/"
] | Do this:
```
webUsers=(/home/*/)
```
and the contents will look like:
```
$ declare -p webUsers
declare -a webUsers='([0]="/home/adam/" [1]="/home/jack/" [2]="/home/john")'
$ echo ${webUsers[1]}
/home/jack/
```
Or, if you don't want the parent directory:
```
pushd /home
webUsers=(*/)
popd
```
and you'll get:
... | It may be easier to make a link to the source directory, and then you can just update it in one place.
Just set up each users directory so that the common files are all pulled from a directory called common\_files (or whatever you like), and then run this command in each home directory:
```
ln -s /location/of/files/t... |
4,720,454 | Here's the end result I am trying to:
I have over 15 users of an cloned instance of my application, sometimes I need to update files (they pretty much all stay the same--everything is dynamic. This is for updates/new features). I wrote a pretty simple bash script that I had to manually put each user from /home/ into t... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4720454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/494901/"
] | Do this:
```
webUsers=(/home/*/)
```
and the contents will look like:
```
$ declare -p webUsers
declare -a webUsers='([0]="/home/adam/" [1]="/home/jack/" [2]="/home/john")'
$ echo ${webUsers[1]}
/home/jack/
```
Or, if you don't want the parent directory:
```
pushd /home
webUsers=(*/)
popd
```
and you'll get:
... | With bash you can actually make this pretty short and simple. To list the current directory and store it into an array:
```
ls . | readarray i
```
or
`ls . | bash -c 'readarray i'`
To use the data:
`ls . | bash -c 'readarray i && for j in ${i[*]}; do <-command->; done'` |
4,720,454 | Here's the end result I am trying to:
I have over 15 users of an cloned instance of my application, sometimes I need to update files (they pretty much all stay the same--everything is dynamic. This is for updates/new features). I wrote a pretty simple bash script that I had to manually put each user from /home/ into t... | 2011/01/18 | [
"https://Stackoverflow.com/questions/4720454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/494901/"
] | It may be easier to make a link to the source directory, and then you can just update it in one place.
Just set up each users directory so that the common files are all pulled from a directory called common\_files (or whatever you like), and then run this command in each home directory:
```
ln -s /location/of/files/t... | With bash you can actually make this pretty short and simple. To list the current directory and store it into an array:
```
ls . | readarray i
```
or
`ls . | bash -c 'readarray i'`
To use the data:
`ls . | bash -c 'readarray i && for j in ${i[*]}; do <-command->; done'` |
65,447,020 | I am not really clear about the response I am getting here. It looks incomplete. I was wondering if this is the wrong approach and should switch to selenium. I am trying to get all the menu items along with the prices and the addons here. I was just checking the response. Any guidance would be immensely helpful. Thanks... | 2020/12/25 | [
"https://Stackoverflow.com/questions/65447020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12319746/"
] | Try this:
```
<View style={{flexDirection: 'row'}}>
<View style={{flex: 1, marginRight: 10, height: 50, backgroundColor: 'powderblue'}}>
<TextInput label="Password" />
</View>
<View style={{flex: 1, marginRight: 10, height: 50, backgroundColor: 'powderblue'}}>
<TextInput label="Password" />... | Please try this. That is a CSS problem. Give some margins to button view.
```
<View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
<View style={{ margin: 5, width: 100, height: 50, backgroundColor: 'powderblue' }} >
<TextInput
label=... |
3,601,692 | can use static methods/ classes safely in WCF due to the fact that WCF creates a new thread for each user, so if i'll have a static variable
```
public static int = 5
```
and if two clients will try to change it simultaneously, will one of them will be able to change it for the other?
thanks... | 2010/08/30 | [
"https://Stackoverflow.com/questions/3601692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272185/"
] | There'll be a race condition here.
The static field will be shared in all service instances. If two instances will access it "simultaneously" you may get unpredicted result.
For example, if two threads will run the code with no synchronization a non deterministic result might appear:
```
void Foo()
{
filed++;
... | I assume you are asking if two clients call a service method that changes the static field on the server, will this work? I'm not sure what you are trying to accomplish, but if you want to share the value you need to do some work to make it thread safe (locking). |
3,601,692 | can use static methods/ classes safely in WCF due to the fact that WCF creates a new thread for each user, so if i'll have a static variable
```
public static int = 5
```
and if two clients will try to change it simultaneously, will one of them will be able to change it for the other?
thanks... | 2010/08/30 | [
"https://Stackoverflow.com/questions/3601692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272185/"
] | Well anyone can modify static field and they will see the latest value set depending upon thread and processor scheduling. However for safe implementation you should define one more static object and use it for lock and provide your access to variable through static property.
```
private static object lockObject = new... | There'll be a race condition here.
The static field will be shared in all service instances. If two instances will access it "simultaneously" you may get unpredicted result.
For example, if two threads will run the code with no synchronization a non deterministic result might appear:
```
void Foo()
{
filed++;
... |
3,601,692 | can use static methods/ classes safely in WCF due to the fact that WCF creates a new thread for each user, so if i'll have a static variable
```
public static int = 5
```
and if two clients will try to change it simultaneously, will one of them will be able to change it for the other?
thanks... | 2010/08/30 | [
"https://Stackoverflow.com/questions/3601692",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/272185/"
] | Well anyone can modify static field and they will see the latest value set depending upon thread and processor scheduling. However for safe implementation you should define one more static object and use it for lock and provide your access to variable through static property.
```
private static object lockObject = new... | I assume you are asking if two clients call a service method that changes the static field on the server, will this work? I'm not sure what you are trying to accomplish, but if you want to share the value you need to do some work to make it thread safe (locking). |
3,045,783 | Let $f:[a,b]\to \mathbb{R}$. We know that if $f$ is convex function then $f$ is continuous in $(a,b)$. Ιn which cases is $f$ continuous at $a$ and $b$? | 2018/12/18 | [
"https://math.stackexchange.com/questions/3045783",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/625810/"
] | say $c$ is a finite real number then
$\lim\limits\_{x\downarrow0}\,f(x) = c $ means :
$\forall \epsilon > 0, \exists \delta > 0\, \text{such that } \, |x | < \delta \implies |f(x)|<\epsilon $
meaning
$\forall \epsilon > 0, \exists \delta > 0\, \text{such that } \, |\frac1x | < \delta \implies |f(\frac1x)|<\epsilo... | It is true.
First assume that $\lim\_{x \in \mathbb{R}^+ \rightarrow 0} = K$ for some finite $K$.
Then for all $\epsilon >0$ there is an $x' > 0$ such that $|f(x'') - K| \leq \epsilon$ for all positive $x'' \le x'$. This implies that $|f(\frac{1}{y}) - K| \le \epsilon$ for all $y \geq \frac{1}{x'}$. Which implies $\l... |
296,946 | After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
```
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
runlevel:/var/run/utmp: No such file or dire... | 2013/05/18 | [
"https://askubuntu.com/questions/296946",
"https://askubuntu.com",
"https://askubuntu.com/users/39789/"
] | Looks like many applications rely on `/var/run/utmp` for logon session information.
```
sudo touch /var/run/utmp
sudo chmod 664 /var/run/utmp
sudo reboot
```
after the reboot, execute these commands, as @coteyr suggested, to clean install mysql
```
sudo apt-get purge mysql-server
sudo apt-get update
sudo apt-get in... | ```
sudo apt-get install mysql-server
```
Then once it's installed make sure `/var/lib/mysql` exists and that `/etc/init.d/mysql` exists. `/usr/bin/mysqld` and `/usr/bin/mysqld_safe` should also exist.
If your still having problems then there's a problem with package (assuming you get no errors there). You can "pur... |
296,946 | After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
```
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
runlevel:/var/run/utmp: No such file or dire... | 2013/05/18 | [
"https://askubuntu.com/questions/296946",
"https://askubuntu.com",
"https://askubuntu.com/users/39789/"
] | about the unknown job, mine solved using this
```
sudo /etc/init.d/mysql start
```
instead of this
```
sudo service mysql start
```
[Here where I refer](https://stackoverflow.com/a/20583979/4709265) | This is probably not a tech solution but more a work around. I've tried this and everything else that's making rounds on the internet to fix this problem. Nothing worked.
At last I downgraded the packages back to MYSQL 5.29 and it worked like a charm.
Thanks. |
296,946 | After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
```
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
runlevel:/var/run/utmp: No such file or dire... | 2013/05/18 | [
"https://askubuntu.com/questions/296946",
"https://askubuntu.com",
"https://askubuntu.com/users/39789/"
] | Looks like many applications rely on `/var/run/utmp` for logon session information.
```
sudo touch /var/run/utmp
sudo chmod 664 /var/run/utmp
sudo reboot
```
after the reboot, execute these commands, as @coteyr suggested, to clean install mysql
```
sudo apt-get purge mysql-server
sudo apt-get update
sudo apt-get in... | This is probably not a tech solution but more a work around. I've tried this and everything else that's making rounds on the internet to fix this problem. Nothing worked.
At last I downgraded the packages back to MYSQL 5.29 and it worked like a charm.
Thanks. |
296,946 | After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
```
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
runlevel:/var/run/utmp: No such file or dire... | 2013/05/18 | [
"https://askubuntu.com/questions/296946",
"https://askubuntu.com",
"https://askubuntu.com/users/39789/"
] | Looks like many applications rely on `/var/run/utmp` for logon session information.
```
sudo touch /var/run/utmp
sudo chmod 664 /var/run/utmp
sudo reboot
```
after the reboot, execute these commands, as @coteyr suggested, to clean install mysql
```
sudo apt-get purge mysql-server
sudo apt-get update
sudo apt-get in... | The problem is not directly related to MySql. The init daemon control tool is not starting the mysql server daemon into `/etc/init`.
You can restore by hand:
```
sudo initctl reload-configuration
```
Now mysql server starts as expected. |
296,946 | After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
```
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
runlevel:/var/run/utmp: No such file or dire... | 2013/05/18 | [
"https://askubuntu.com/questions/296946",
"https://askubuntu.com",
"https://askubuntu.com/users/39789/"
] | The problem is not directly related to MySql. The init daemon control tool is not starting the mysql server daemon into `/etc/init`.
You can restore by hand:
```
sudo initctl reload-configuration
```
Now mysql server starts as expected. | ```
sudo apt-get install mysql-server
```
Then once it's installed make sure `/var/lib/mysql` exists and that `/etc/init.d/mysql` exists. `/usr/bin/mysqld` and `/usr/bin/mysqld_safe` should also exist.
If your still having problems then there's a problem with package (assuming you get no errors there). You can "pur... |
296,946 | After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
```
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
runlevel:/var/run/utmp: No such file or dire... | 2013/05/18 | [
"https://askubuntu.com/questions/296946",
"https://askubuntu.com",
"https://askubuntu.com/users/39789/"
] | about the unknown job, mine solved using this
```
sudo /etc/init.d/mysql start
```
instead of this
```
sudo service mysql start
```
[Here where I refer](https://stackoverflow.com/a/20583979/4709265) | ```
sudo apt-get install mysql-server
```
Then once it's installed make sure `/var/lib/mysql` exists and that `/etc/init.d/mysql` exists. `/usr/bin/mysqld` and `/usr/bin/mysqld_safe` should also exist.
If your still having problems then there's a problem with package (assuming you get no errors there). You can "pur... |
296,946 | After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
```
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
runlevel:/var/run/utmp: No such file or dire... | 2013/05/18 | [
"https://askubuntu.com/questions/296946",
"https://askubuntu.com",
"https://askubuntu.com/users/39789/"
] | Looks like many applications rely on `/var/run/utmp` for logon session information.
```
sudo touch /var/run/utmp
sudo chmod 664 /var/run/utmp
sudo reboot
```
after the reboot, execute these commands, as @coteyr suggested, to clean install mysql
```
sudo apt-get purge mysql-server
sudo apt-get update
sudo apt-get in... | I just had this problem now and solved it.
Although you installed mysql-server, the daemon needs to be running in order for the client to connect to it.
First check to see if mysql server is running:
```
netstat -tap | grep mysql
```
You should see something like this:
```
$ sudo netstat -tap | grep mysql
tcp... |
296,946 | After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
```
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
runlevel:/var/run/utmp: No such file or dire... | 2013/05/18 | [
"https://askubuntu.com/questions/296946",
"https://askubuntu.com",
"https://askubuntu.com/users/39789/"
] | about the unknown job, mine solved using this
```
sudo /etc/init.d/mysql start
```
instead of this
```
sudo service mysql start
```
[Here where I refer](https://stackoverflow.com/a/20583979/4709265) | I just had this problem now and solved it.
Although you installed mysql-server, the daemon needs to be running in order for the client to connect to it.
First check to see if mysql server is running:
```
netstat -tap | grep mysql
```
You should see something like this:
```
$ sudo netstat -tap | grep mysql
tcp... |
296,946 | After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
```
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
runlevel:/var/run/utmp: No such file or dire... | 2013/05/18 | [
"https://askubuntu.com/questions/296946",
"https://askubuntu.com",
"https://askubuntu.com/users/39789/"
] | Looks like many applications rely on `/var/run/utmp` for logon session information.
```
sudo touch /var/run/utmp
sudo chmod 664 /var/run/utmp
sudo reboot
```
after the reboot, execute these commands, as @coteyr suggested, to clean install mysql
```
sudo apt-get purge mysql-server
sudo apt-get update
sudo apt-get in... | about the unknown job, mine solved using this
```
sudo /etc/init.d/mysql start
```
instead of this
```
sudo service mysql start
```
[Here where I refer](https://stackoverflow.com/a/20583979/4709265) |
296,946 | After an installation of MySQL, I get a few errors and I can't run the MySQL daemon. I've tried uninstalling and reinstalling several times, and I'm not sure what's going on.
Here's a snippit of what I'm seeing:
```
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
runlevel:/var/run/utmp: No such file or dire... | 2013/05/18 | [
"https://askubuntu.com/questions/296946",
"https://askubuntu.com",
"https://askubuntu.com/users/39789/"
] | ```
sudo apt-get install mysql-server
```
Then once it's installed make sure `/var/lib/mysql` exists and that `/etc/init.d/mysql` exists. `/usr/bin/mysqld` and `/usr/bin/mysqld_safe` should also exist.
If your still having problems then there's a problem with package (assuming you get no errors there). You can "pur... | I just had this problem now and solved it.
Although you installed mysql-server, the daemon needs to be running in order for the client to connect to it.
First check to see if mysql server is running:
```
netstat -tap | grep mysql
```
You should see something like this:
```
$ sudo netstat -tap | grep mysql
tcp... |
179,247 | I have been having some fun lately exploring the development of language parsers in the context of how they fit into the Chomsky Hierarchy.
What is a good real-world (ie not theoretical) example of a context-sensitive grammar? | 2012/12/13 | [
"https://softwareengineering.stackexchange.com/questions/179247",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/1256/"
] | Good question. Although as mentioned in the comments very many programming languages are context-sensitive, that context-sensitivity is often not resolved in the parsing phase but in later phases -- that is, a superset of the language is parsed using a context-free grammar, and some of those parse trees are later filte... | As far as I know, context-sensitive grammars are used in natural language processing, *only*. Programming language interpreters and compilers do not try to parse a context-sensitive grammar because of the complexity (even if some attempt has been done in the past).
Maybe, you can find some example of real use in one o... |
179,247 | I have been having some fun lately exploring the development of language parsers in the context of how they fit into the Chomsky Hierarchy.
What is a good real-world (ie not theoretical) example of a context-sensitive grammar? | 2012/12/13 | [
"https://softwareengineering.stackexchange.com/questions/179247",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/1256/"
] | Good question. Although as mentioned in the comments very many programming languages are context-sensitive, that context-sensitivity is often not resolved in the parsing phase but in later phases -- that is, a superset of the language is parsed using a context-free grammar, and some of those parse trees are later filte... | Context sensitive grammars are sometimes used in descriptions of programming language semantics. Perhaps the most comprehensive use of context sensitive grammars was the Algol68 language definition. It used a two-level context free grammer (see <http://en.wikipedia.org/wiki/Two-level_grammar>) to describe both the synt... |
26,342,905 | This is my output.
```
Name Start End
------ -------- --------
Mary 09-04-01 10-04-30
John 08-05-25 11-07-24
Alisa 07-07-07 11-06-28
Mary 06-06-06 12-12-20
John 05-05-05 12-12-20
Alex 04-04-04 11-12-20
Alisa 03-03-03 13-12-20
Mary... | 2014/10/13 | [
"https://Stackoverflow.com/questions/26342905",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4137845/"
] | Well, you do need to group by the `name` column only. But one issue with your query is that the months between calculation needs to be using the `MAX` and `MIN` values. You are also using some reserved words as column names:
```
SELECT T.name,
MIN(T.Start) AS Start,
MAX(T."end") AS "End",
RO... | All non-aggregates need to be in the Grouping, and `Round(MONTHS_BETWEEN....` doesn't introduce `tableDate.Start` and `tableDate.End` with an aggregate. Depending on the interpretation of the data, it seems you want to use the already calculated `MIN` and `MAX` values in the `MONTHS_BETWEEN` calculation. How about this... |
137,739 | I am working on client application for which I **don't** want to use Server Object Model of SharePoint 2013. I am ready to go for anything other that SOM.
I want to get a complete list of site collections using either CSOM API or REST API or WebServices. Is it possible ? If yes, what is API from Client Object model (... | 2015/04/09 | [
"https://sharepoint.stackexchange.com/questions/137739",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/41207/"
] | Sahil Malik has written a blog post on how to "Get list of site collections using CSOM in Office365". It may help you.
Below is the code snippet from his blog:
```
var token = TokenHelper.GetAppOnlyAccessToken("00000003-0000-0ff1-ce00-000000000000", tenantAdminUri.Authority, null).AccessToken;
using (var clientContex... | Using CSOM it is possible to get list of all site collections in sharepoint online.
But in sharepoint on-premises(2016/2013/2010) it is not possible. |
59,490,259 | i have a strange problem with WCAG 2.0 (Level AA).
The error below
3.3 Input Assistance: Help users avoid and correct mistakes.
Success Criteria 3.3.2 Labels or Instructions (A)
Check 187: input element has more than one associated label.
Repair: Remove or modify the label elements so there is only one associated la... | 2019/12/26 | [
"https://Stackoverflow.com/questions/59490259",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11466671/"
] | >
> Check 187: input element has more than one associated label. Repair:
> Remove or modify the label elements so there is only one associated
> label for each form control. Error Line 1443, Column 1:
>
>
>
There are only two ways I can think of to receive this error.
1. You have two labels with the same `for="... | I can reproduce the same error (in the same tool you are using) by inserting two `label` for the same element:
```
<!DOCTYPE html>
<html lang="en">
<head><title>ok</title>
</head>
<body>
<label for="input_id">say</label>
<label for="input_id">say</label>
<input id="input_id" value="text" type="text" />
</body>
</html>... |
2,631,205 | Can I evaluate this integral:
$$
\int\_0^1\frac{\log(x)}{x-1}dx
$$
without knowing the value of $\zeta(2)$? In particular can I use methods of complex analysis? | 2018/02/01 | [
"https://math.stackexchange.com/questions/2631205",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/483385/"
] | $\begin{align} \int\_0^1 \frac{\ln x}{x-1}\,dx&=\Big[\ln(1-x)\ln x\Big]\_0^1-\int\_0^1 \frac{\ln(1-x)}{x}\,dx\\
&=-\int\_0^1 \frac{\ln(1-x)}{x}\,dx\end{align}$
and read my answer,
<https://math.stackexchange.com/a/2632547/186817> | $$-\int^{1}\_{0}\frac{\ln x}{1-x}dx=-\int^{1}\_{0}\ln x\sum^{\infty}\_{n=0}x^ndx$$
$$=-\sum^{\infty}\_{n=0}\int^{1}\_{0}x^n\ln(x)dx$$
By parts method
$$
\sum^{\infty}\_{n=0}\frac{1}{(n+1)^2}=\frac{\pi^2}{6}=\zeta(2)$$ |
16,260,738 | I have a site using the Flex Slider 2 component. It is working fine but the navigation buttons are not showing. When I move the mouse over the area where the buttons are supposed to be, the cursor behaves as if they actually were there. I can slide the images by clicking on the point where the buttons are supposed to b... | 2013/04/28 | [
"https://Stackoverflow.com/questions/16260738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2120143/"
] | Same issue.Found the problem. They have replaced graphic .png with a font file. Soooo, copy the font directory included in the download onto your server. Remap path in CSS. I had to add '/' to src:url('fonts/flexslider-icon.eot'); before 'fonts...' So this: src:url('/fonts/flexslider-icon.eot'); Works like a charm now. | in flexslider.css line 55 you have opacity set to 0 for these buttons and background set to non-existing image |
38,541,607 | I have a php/mysql application in which I have a database broadly having the following fields:
* Employee No.
* Employee Name
* Year of Joining
* Location
* Job Profile
I am able to display the records using the SELECT statement with no problem.
Now, I want to be able to do the following and this is where I need yo... | 2016/07/23 | [
"https://Stackoverflow.com/questions/38541607",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3993361/"
] | it is fine:
>
> Exported identifiers:
>
>
> An identifier may be exported to permit access to it from another
> package. An identifier is exported if both:
>
>
> * the first character of the identifier's name is a Unicode upper case
> letter (Unicode class "Lu"); and
> * the identifier is declared in the
> pa... | Essentially, it's a singleton pattern. The package exports a single instance of `person` but because the type is private you can't create another instance out of it.
Better implementation would be to export a function that returns a singleton instance of a private type. On first invocation it will create the instance ... |
8,439,962 | I have to read from a file, so made:
```
cod_order (int)
cod_cliente (int)
cod_pizza (int)
num_pizza (int)
cod_pizza
num_pizza
...
$FINE
```
here is an example:
```
1
1107
02
1
01
5
03
2
$FINE
```
I created this method to read from this text file:
```
private void loadOrdini(String fname){
try{
Buf... | 2011/12/09 | [
"https://Stackoverflow.com/questions/8439962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1055637/"
] | Every time you call reader.readLine(), you are moving to the next line in the file.
Thus, when you call
```
Cliente cl=listaclienti.get(Integer.parseInt(reader.readLine()));
```
You are actually moving to the next line and getting 02 when you meant to parse 1107. | You've called `readLine()` too many times:
```
String cod_ordine = reader.readLine();
while(cod_ordine!=null){
String cod_cliente=reader.readLine();
Cliente cl=listaclienti.get(Integer.parseInt(reader.readLine()));
```
You populate `cod_ordine` with the first `readLine()` call.
You populat... |
8,439,962 | I have to read from a file, so made:
```
cod_order (int)
cod_cliente (int)
cod_pizza (int)
num_pizza (int)
cod_pizza
num_pizza
...
$FINE
```
here is an example:
```
1
1107
02
1
01
5
03
2
$FINE
```
I created this method to read from this text file:
```
private void loadOrdini(String fname){
try{
Buf... | 2011/12/09 | [
"https://Stackoverflow.com/questions/8439962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1055637/"
] | Every time you call reader.readLine(), you are moving to the next line in the file.
Thus, when you call
```
Cliente cl=listaclienti.get(Integer.parseInt(reader.readLine()));
```
You are actually moving to the next line and getting 02 when you meant to parse 1107. | ```
cl.getListaOrdini().put(Integer.parseInt(cod_ordine), ord);
```
because all the value you put into this map use the same key, which is `cod_ordine`, so every time you call this method, you replace the old `ordine` with new one, that's why you only have last record. |
8,439,962 | I have to read from a file, so made:
```
cod_order (int)
cod_cliente (int)
cod_pizza (int)
num_pizza (int)
cod_pizza
num_pizza
...
$FINE
```
here is an example:
```
1
1107
02
1
01
5
03
2
$FINE
```
I created this method to read from this text file:
```
private void loadOrdini(String fname){
try{
Buf... | 2011/12/09 | [
"https://Stackoverflow.com/questions/8439962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1055637/"
] | I think the other answers have missed the point: you want a mapping from order IDs to pizzas.
The problem is, a map (such as a HashMap) must have a unique mapping for each key. What that means is, you can only map a **single** `Ordine` to the order ID, a map doesn't support having multiple `Ordine`s for the same order... | Every time you call reader.readLine(), you are moving to the next line in the file.
Thus, when you call
```
Cliente cl=listaclienti.get(Integer.parseInt(reader.readLine()));
```
You are actually moving to the next line and getting 02 when you meant to parse 1107. |
8,439,962 | I have to read from a file, so made:
```
cod_order (int)
cod_cliente (int)
cod_pizza (int)
num_pizza (int)
cod_pizza
num_pizza
...
$FINE
```
here is an example:
```
1
1107
02
1
01
5
03
2
$FINE
```
I created this method to read from this text file:
```
private void loadOrdini(String fname){
try{
Buf... | 2011/12/09 | [
"https://Stackoverflow.com/questions/8439962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1055637/"
] | I think the other answers have missed the point: you want a mapping from order IDs to pizzas.
The problem is, a map (such as a HashMap) must have a unique mapping for each key. What that means is, you can only map a **single** `Ordine` to the order ID, a map doesn't support having multiple `Ordine`s for the same order... | You've called `readLine()` too many times:
```
String cod_ordine = reader.readLine();
while(cod_ordine!=null){
String cod_cliente=reader.readLine();
Cliente cl=listaclienti.get(Integer.parseInt(reader.readLine()));
```
You populate `cod_ordine` with the first `readLine()` call.
You populat... |
8,439,962 | I have to read from a file, so made:
```
cod_order (int)
cod_cliente (int)
cod_pizza (int)
num_pizza (int)
cod_pizza
num_pizza
...
$FINE
```
here is an example:
```
1
1107
02
1
01
5
03
2
$FINE
```
I created this method to read from this text file:
```
private void loadOrdini(String fname){
try{
Buf... | 2011/12/09 | [
"https://Stackoverflow.com/questions/8439962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1055637/"
] | I think the other answers have missed the point: you want a mapping from order IDs to pizzas.
The problem is, a map (such as a HashMap) must have a unique mapping for each key. What that means is, you can only map a **single** `Ordine` to the order ID, a map doesn't support having multiple `Ordine`s for the same order... | ```
cl.getListaOrdini().put(Integer.parseInt(cod_ordine), ord);
```
because all the value you put into this map use the same key, which is `cod_ordine`, so every time you call this method, you replace the old `ordine` with new one, that's why you only have last record. |
70,782,911 | Our application runs on a Raspberry Pi and is installed on many places on customer sites. The Pi is cheap and good enough for our purposes. However, we have a problenm that for storing the user's login password on disk generating a secret with something like 50.000 iterations to be reasonably safe takes way too much ti... | 2022/01/20 | [
"https://Stackoverflow.com/questions/70782911",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1537246/"
] | >
> However, we have a problem that for storing the user's login password on disk generating a secret
>
>
>
I hope you mean hashing (non-reversible mangle) the password
>
> with something like 50.000 iterations to be reasonably safe
>
> 50.000 iterations have to be executed again which takes minutes on the P... | Haveged will do the job in this case. Just let it run for a while and it will generate enough entropy. |
55,299,874 | I am looping through html content and displaying in other table. while reading, if div element is display:none then i want to skip the entire div section.
in the below example, need to hide "Property size, 100" row.
Please let me know the best option.
thanks you so much.
Surya.
```js
$('#tblWorksheet tbody').empty... | 2019/03/22 | [
"https://Stackoverflow.com/questions/55299874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2600459/"
] | You can check visibility of a div using jQuery's `.is()` combined with the `:visible` selector. It looks like you also want to make sure it's a div, so your conditional would be something like this:
```
var $parent = $(this).parent();
if($parent.is('div') && !$parent.is(':visible')) {
return true; // continue to ... | Here the completed code.
```js
$('#tblWorksheet tbody').empty();
var tdworksheet;
$('#Worksheet label, #Worksheet input, #Worksheet select').each(function(index, element) { // context is
var theTag = this.tagName;
var TF;
if($(this).parent().is('div') && !$(this).parent().is(':visible'))
{
... |
4,137,145 | I have this regular expression to help me validate a form input.
```
var nrExp = /^\d{6}\-\d{4}$/;
```
This allows only 10 digits, where the last 4 digits are separated with a "minus sign".
```
012345-6789
```
I need to make it also allow it without the minus-sign AND with a space instead of a minus-sign:
``... | 2010/11/09 | [
"https://Stackoverflow.com/questions/4137145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
/^\d{6}[ \-]?\d{4}$/
``` | `var nrExp = /^\d{6}\[\- ]?\d{4}$/;`
That should do it - either a blank space or a dash, made optional by the ? |
4,137,145 | I have this regular expression to help me validate a form input.
```
var nrExp = /^\d{6}\-\d{4}$/;
```
This allows only 10 digits, where the last 4 digits are separated with a "minus sign".
```
012345-6789
```
I need to make it also allow it without the minus-sign AND with a space instead of a minus-sign:
``... | 2010/11/09 | [
"https://Stackoverflow.com/questions/4137145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
/^\d{6}[ \-]?\d{4}$/
``` | ```
var re = /^\d{6}[\- ]?\d{4}$/
console.log(re.test('012345-6789'));
console.log(re.test('012345 6789'));
console.log(re.test('0123456789'));
``` |
4,137,145 | I have this regular expression to help me validate a form input.
```
var nrExp = /^\d{6}\-\d{4}$/;
```
This allows only 10 digits, where the last 4 digits are separated with a "minus sign".
```
012345-6789
```
I need to make it also allow it without the minus-sign AND with a space instead of a minus-sign:
``... | 2010/11/09 | [
"https://Stackoverflow.com/questions/4137145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
/^\d{6}[ \-]?\d{4}$/
``` | Sure. You just want to make the minus optional, along with a couple of other characters.
Try this one:
```
var nrExp = /^\d{6}(\-| )?\d{4}$/;
```
Notice the `?` after the `(\-| )`. This allows that match portion to be optional. |
4,137,145 | I have this regular expression to help me validate a form input.
```
var nrExp = /^\d{6}\-\d{4}$/;
```
This allows only 10 digits, where the last 4 digits are separated with a "minus sign".
```
012345-6789
```
I need to make it also allow it without the minus-sign AND with a space instead of a minus-sign:
``... | 2010/11/09 | [
"https://Stackoverflow.com/questions/4137145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | `var nrExp = /^\d{6}\[\- ]?\d{4}$/;`
That should do it - either a blank space or a dash, made optional by the ? | Sure. You just want to make the minus optional, along with a couple of other characters.
Try this one:
```
var nrExp = /^\d{6}(\-| )?\d{4}$/;
```
Notice the `?` after the `(\-| )`. This allows that match portion to be optional. |
4,137,145 | I have this regular expression to help me validate a form input.
```
var nrExp = /^\d{6}\-\d{4}$/;
```
This allows only 10 digits, where the last 4 digits are separated with a "minus sign".
```
012345-6789
```
I need to make it also allow it without the minus-sign AND with a space instead of a minus-sign:
``... | 2010/11/09 | [
"https://Stackoverflow.com/questions/4137145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
/^\d{6}[- ]?\d{4}$/
```
You don't need to escape the minus sign inside the brackets, as it does not give a range. | `var nrExp = /^\d{6}\[\- ]?\d{4}$/;`
That should do it - either a blank space or a dash, made optional by the ? |
4,137,145 | I have this regular expression to help me validate a form input.
```
var nrExp = /^\d{6}\-\d{4}$/;
```
This allows only 10 digits, where the last 4 digits are separated with a "minus sign".
```
012345-6789
```
I need to make it also allow it without the minus-sign AND with a space instead of a minus-sign:
``... | 2010/11/09 | [
"https://Stackoverflow.com/questions/4137145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
var re = /^\d{6}[\- ]?\d{4}$/
console.log(re.test('012345-6789'));
console.log(re.test('012345 6789'));
console.log(re.test('0123456789'));
``` | Sure. You just want to make the minus optional, along with a couple of other characters.
Try this one:
```
var nrExp = /^\d{6}(\-| )?\d{4}$/;
```
Notice the `?` after the `(\-| )`. This allows that match portion to be optional. |
4,137,145 | I have this regular expression to help me validate a form input.
```
var nrExp = /^\d{6}\-\d{4}$/;
```
This allows only 10 digits, where the last 4 digits are separated with a "minus sign".
```
012345-6789
```
I need to make it also allow it without the minus-sign AND with a space instead of a minus-sign:
``... | 2010/11/09 | [
"https://Stackoverflow.com/questions/4137145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
/^\d{6}[- ]?\d{4}$/
```
You don't need to escape the minus sign inside the brackets, as it does not give a range. | ```
var re = /^\d{6}[\- ]?\d{4}$/
console.log(re.test('012345-6789'));
console.log(re.test('012345 6789'));
console.log(re.test('0123456789'));
``` |
4,137,145 | I have this regular expression to help me validate a form input.
```
var nrExp = /^\d{6}\-\d{4}$/;
```
This allows only 10 digits, where the last 4 digits are separated with a "minus sign".
```
012345-6789
```
I need to make it also allow it without the minus-sign AND with a space instead of a minus-sign:
``... | 2010/11/09 | [
"https://Stackoverflow.com/questions/4137145",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
/^\d{6}[- ]?\d{4}$/
```
You don't need to escape the minus sign inside the brackets, as it does not give a range. | Sure. You just want to make the minus optional, along with a couple of other characters.
Try this one:
```
var nrExp = /^\d{6}(\-| )?\d{4}$/;
```
Notice the `?` after the `(\-| )`. This allows that match portion to be optional. |
31,912,912 | I want to send just the month (in string format) to the database.
```
<div class="col-md-12">
<?php
$months = array();
$currentMonth = date('m');
for ($x = 1; $x < 13; $x++) {
$months[] = date('F', mktime(0, 0, 0, $x, 1));
}
... | 2015/08/10 | [
"https://Stackoverflow.com/questions/31912912",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5129784/"
] | Try
```
v <- (1:10)^2
# [1] 1 4 9 16 25 36 49 64 81 100
```
All of the mathematical operations are vectorized in R, so just square the vector and you're good to go. | For the second sequence the `rep` function will be helpful. The code
```
rep(c(1,-1,1),33)*(1:99)
```
generates the required sequence from 1 to 99. |
42,972 | Is it possible to define package procedure/function outside of package body block (for Oracle)?
Simplified syntax for [defining package body](http://docs.oracle.com/cd/B12037_01/appdev.101/b10795/adfns_pc.htm) is:
```
create or replace package body <package_name> IS
function <function_name>
<function_body>
p... | 2013/05/24 | [
"https://dba.stackexchange.com/questions/42972",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/20423/"
] | You always need to compile the entire package body -- it is one item of code. You can create functions and procedures inside other procedures, but that does not change the need to recompile the package body.
What problem are you trying to solve here? | Not there. But your idea is a good one....
In Ada, which was the origin of PL/SQL, you could define a part of a package body, like a procedure, as ["separate"](http://www.adaic.org/resources/add_content/standards/12aarm/html/AA-10-1-3.html#S0258).
This would allow you to break up overly long package bodies (in Ada) w... |
23,224,618 | How can I count number of elements that satisfies lower\_bound(42), upper\_bound(137)
from this code??
```
accumulate(values.lower_bound(42), values.upper_bound(137), 0);
``` | 2014/04/22 | [
"https://Stackoverflow.com/questions/23224618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1340661/"
] | `accumulate` does not count, it *accumulates*. You can of course accumulate 1s instead of the elements but that’s rather backwards. The direct answer is [`std::distance`](http://en.cppreference.com/w/cpp/iterator/distance), which gives you the number of elements between two iterators (i.e. between the lower and upper b... | I think the solution you are looking for is `std::count_if` from the `algorithm` header. If you have a container `cont`, you could use it like this:
```
bool is_in_range(int x){
return 42 <= x && x >= 137;
}
std::count_if(cont.begin(), cont.end(), is_in_range);
``` |
19,550,468 | When I try to draw rectangle over a board painted with a blue rectangle on top I see the rectangle is drawn under the blue one but the method for draw red rectangle is called after red one..

```
@Override
protected void paintComponent(Graphics g) {... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19550468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2651401/"
] | Your code is choking on a variant of [Shlemiel The Painter's Algorithm](http://en.wikipedia.org/wiki/Schlemiel_the_Painter%27s_algorithm). Every time you add two strings together like that, the Delphi RTL has to increase the size of the string, which possibly involves allocating a new, larger string and copying the old... | Obviously this is a silly example but there's a few things you can do:
1. Know what happens when you call a Delphi function
2. Know your data
3. Move stuff outside the loop
4. Don't jump unless its predictable
Let me elaborate
**Know what happens when you call a Delphi function**
When you call an RTL function, l... |
19,550,468 | When I try to draw rectangle over a board painted with a blue rectangle on top I see the rectangle is drawn under the blue one but the method for draw red rectangle is called after red one..

```
@Override
protected void paintComponent(Graphics g) {... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19550468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2651401/"
] | Your code is choking on a variant of [Shlemiel The Painter's Algorithm](http://en.wikipedia.org/wiki/Schlemiel_the_Painter%27s_algorithm). Every time you add two strings together like that, the Delphi RTL has to increase the size of the string, which possibly involves allocating a new, larger string and copying the old... | You are trying to do arbitrary precision arithmetic using strings.
This is a bad idea.
Use a bigint library instead.
It uses arrays of integer to do the job.
A nice one is downloadable at: <http://www.delphiforfun.org/Programs/Library/big_integers.htm>
Or at LURD's suggestion: <https://code.google.com/p/gmp-wr... |
19,550,468 | When I try to draw rectangle over a board painted with a blue rectangle on top I see the rectangle is drawn under the blue one but the method for draw red rectangle is called after red one..

```
@Override
protected void paintComponent(Graphics g) {... | 2013/10/23 | [
"https://Stackoverflow.com/questions/19550468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2651401/"
] | You are trying to do arbitrary precision arithmetic using strings.
This is a bad idea.
Use a bigint library instead.
It uses arrays of integer to do the job.
A nice one is downloadable at: <http://www.delphiforfun.org/Programs/Library/big_integers.htm>
Or at LURD's suggestion: <https://code.google.com/p/gmp-wr... | Obviously this is a silly example but there's a few things you can do:
1. Know what happens when you call a Delphi function
2. Know your data
3. Move stuff outside the loop
4. Don't jump unless its predictable
Let me elaborate
**Know what happens when you call a Delphi function**
When you call an RTL function, l... |
48,422,110 | How can I send email birthday to all contact in CRM 365 with workflow [c#](/questions/tagged/c%23 "show questions tagged 'c#'") ?
The code I wrote:
```
var today = DateTime.Today.AddYears(-90);
var contacts = from c in orgContext.CreateQuery<Contact>()
where (c.BirthDate != null && c.BirthDate.Value.Month == toda... | 2018/01/24 | [
"https://Stackoverflow.com/questions/48422110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9261862/"
] | I am not sure why this doesn't work.
However can you make this one change and check if this works? In your child component, instead of having @Input can you try this?
```
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-seating-order',
inputs: ['childMessage'],
template: `
... | There is no error in the Console or Webpack.
But if I end ng serve,
the Console shows Errors, but not sure if that's related:
[](https://i.stack.imgur.com/O5s81.png)
There is no html, there are component.html files with code, but I commented it out ... |
48,422,110 | How can I send email birthday to all contact in CRM 365 with workflow [c#](/questions/tagged/c%23 "show questions tagged 'c#'") ?
The code I wrote:
```
var today = DateTime.Today.AddYears(-90);
var contacts = from c in orgContext.CreateQuery<Contact>()
where (c.BirthDate != null && c.BirthDate.Value.Month == toda... | 2018/01/24 | [
"https://Stackoverflow.com/questions/48422110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9261862/"
] | You should change the template of the child, place it inside some element. For example:
```
template: `
<div><h1>{{childMessage}}</h1></div>
`,
```
**[DEMO](https://stackblitz.com/edit/angular-parent-child-interaction-u6hsn1?file=index.html)** | There is no error in the Console or Webpack.
But if I end ng serve,
the Console shows Errors, but not sure if that's related:
[](https://i.stack.imgur.com/O5s81.png)
There is no html, there are component.html files with code, but I commented it out ... |
69,737,045 | [1][I write a simple program in dart to print multiplication table but the output was not I Except[][1]](https://i.stack.imgur.com/LGOpe.png)
void main{
```
int num=10;
for(var i=1;i<=10;++i){
print('$num*$i=$num');
}
}
```
this was my code | 2021/10/27 | [
"https://Stackoverflow.com/questions/69737045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16029361/"
] | I took your code and removed all (new) and all (Constructors). It is best to let Springboot Autowire everything for you:
Pay attention to how ServerService and NettyServerHandler are implemented.
```
package com.example.socketchannel;
import org.springframework.boot.SpringApplication;
import org.springframework.boot... | try to use spring-boot-starter-jdbc, you will not face the issue. |
41,295,766 | I'm trying to do something like this:
```
Stream<Object> stream = IntStream.of(...)
.flatMapToObj(i -> getStreamOfObjects(i));
```
Unfortunately, `IntStream.flatMapToObj()` doesn't exist, even in Java 9.
1. Why was it left out?
2. What's a recommended workaround? | 2016/12/23 | [
"https://Stackoverflow.com/questions/41295766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1553851/"
] | Using a boxed stream would work if you don't mind the cost of boxing each `int` value.
```
Stream<Object> stream = IntStream.of(...).boxed().flatMap(i -> getStreamOfObjects(i));
``` | Just write
```
IntStream.of(...)
.mapToObj(i -> getStreamOfObjects(i))
.flatMap(stream -> stream)
``` |
41,295,766 | I'm trying to do something like this:
```
Stream<Object> stream = IntStream.of(...)
.flatMapToObj(i -> getStreamOfObjects(i));
```
Unfortunately, `IntStream.flatMapToObj()` doesn't exist, even in Java 9.
1. Why was it left out?
2. What's a recommended workaround? | 2016/12/23 | [
"https://Stackoverflow.com/questions/41295766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1553851/"
] | >
> Why was it was left out?
>
>
>
The API provides reusable building blocks. The relevant building blocks here are `IntStream`, `mapToObj`, `flatMap`. From these you can achieve what you want: map an in stream to objects, and then get a flat map. Providing permutations of building blocks would not be practical, a... | Just write
```
IntStream.of(...)
.mapToObj(i -> getStreamOfObjects(i))
.flatMap(stream -> stream)
``` |
41,295,766 | I'm trying to do something like this:
```
Stream<Object> stream = IntStream.of(...)
.flatMapToObj(i -> getStreamOfObjects(i));
```
Unfortunately, `IntStream.flatMapToObj()` doesn't exist, even in Java 9.
1. Why was it left out?
2. What's a recommended workaround? | 2016/12/23 | [
"https://Stackoverflow.com/questions/41295766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1553851/"
] | >
> Why was it was left out?
>
>
>
The API provides reusable building blocks. The relevant building blocks here are `IntStream`, `mapToObj`, `flatMap`. From these you can achieve what you want: map an in stream to objects, and then get a flat map. Providing permutations of building blocks would not be practical, a... | Using a boxed stream would work if you don't mind the cost of boxing each `int` value.
```
Stream<Object> stream = IntStream.of(...).boxed().flatMap(i -> getStreamOfObjects(i));
``` |
34,346,028 | I'm trying to create a simple scatter plot in d3 (similar to this one from [matplotlib](http://matplotlib.org/examples/shapes_and_collections/scatter_demo.html)):
[](https://i.stack.imgur.com/cP7pU.png)
I use `extent()` to set the scale's input domai... | 2015/12/17 | [
"https://Stackoverflow.com/questions/34346028",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1077294/"
] | In general, the best way of handling this is to call the scale's [`.nice()`](https://github.com/mbostock/d3/wiki/Quantitative-Scales#linear_nice) function, which will round the ends of the domain of the scale to nice values. In your particular case, this doesn't work, as the values are "nice" already.
In this case I w... | In your matplotlib image, the dots are not overlapping and the x scale has negative value.
In d3:
```
var xScale = d3.scale.linear()
.domain([
d3.min(data, function(d) {
return d.val;
})-10, //so the domain is wider enough for the zero value
... |
51,760,903 | I'm trying to adjust the padding in a Button so when the user presses the button the text shifts downward to help visually indicate a press was made.
styles.xml
```
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Img_Button">
<item name="android:layout_width">@dimen/img_button_... | 2018/08/09 | [
"https://Stackoverflow.com/questions/51760903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612697/"
] | You're right, you'll gain nothing from going from 20 to 40. If you're really totally CPU-bound, you'll probably gain a tiny bit scaling back to 8 actually. As always in these kind of situation, a good benchmark is the way to go !
If you want to make this scaling dependent on the computer running the code, `Runtime.get... | Yes, increasing the number of actors does impact the performance of the system. Hence whenever we specify the akka resizer, we specify the upper and lower limit. Ideally, a lot of thought must be given to configuring this limit as if we set a very high upper limit on actor instances, then it creates a huge performance ... |
51,760,903 | I'm trying to adjust the padding in a Button so when the user presses the button the text shifts downward to help visually indicate a press was made.
styles.xml
```
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Img_Button">
<item name="android:layout_width">@dimen/img_button_... | 2018/08/09 | [
"https://Stackoverflow.com/questions/51760903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612697/"
] | Instead of increasing the actor pool size, decrease it to a size of, at most, eight and use a custom [dispatcher](https://doc.akka.io/docs/akka/2.5/dispatchers.html) that is limited to, at most, eight threads. For example, in your `application.conf`:
```
my-thread-pool-dispatcher {
type = Dispatcher
executor = "th... | Yes, increasing the number of actors does impact the performance of the system. Hence whenever we specify the akka resizer, we specify the upper and lower limit. Ideally, a lot of thought must be given to configuring this limit as if we set a very high upper limit on actor instances, then it creates a huge performance ... |
51,760,903 | I'm trying to adjust the padding in a Button so when the user presses the button the text shifts downward to help visually indicate a press was made.
styles.xml
```
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Img_Button">
<item name="android:layout_width">@dimen/img_button_... | 2018/08/09 | [
"https://Stackoverflow.com/questions/51760903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/612697/"
] | You're right, you'll gain nothing from going from 20 to 40. If you're really totally CPU-bound, you'll probably gain a tiny bit scaling back to 8 actually. As always in these kind of situation, a good benchmark is the way to go !
If you want to make this scaling dependent on the computer running the code, `Runtime.get... | Instead of increasing the actor pool size, decrease it to a size of, at most, eight and use a custom [dispatcher](https://doc.akka.io/docs/akka/2.5/dispatchers.html) that is limited to, at most, eight threads. For example, in your `application.conf`:
```
my-thread-pool-dispatcher {
type = Dispatcher
executor = "th... |
24,580 | I read [here](http://dorilu.net/itiran4zyukugo.htm) the following explanation about 一朝{いっちょう}一夕{いっせき}, [a 四字熟語{よじじゅくご}](http://en.wikipedia.org/wiki/Yojijukugo) :
>
> 一日や半日{はんにち}、朝{あさ}から夕程度{ゆうていど}の、短{みじか}い期間{きかん}のこと
>
>
>
I don't feel confident about the grammar in this sentence, specially about the の particle af... | 2015/05/27 | [
"https://japanese.stackexchange.com/questions/24580",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/4550/"
] | >
> [一日や半日][[朝から夕程度の][短い]期間]のこと
>
> "a half or full day; a morning-to-evening-scale, short time interval"
>
>
>
1. The の in 朝から夕程度の can be understood as である.
2. The comma after 朝から夕程度の makes it so that 朝から夕程度の and 短い are two separate ways of describing the interval, as opposed to further refining the type of "... | Well, first off, that's not really a complete sentence, it's just a brief definition. This grammar is everything up to the の modifies the 短い期間 which by itself is already pretty good defintion. The commas like in English is just reiterating or defining the same thing, so in this case it's like saying:
A small period of... |
8,038,874 | I'm been happily synthesizing audio (at 44.1khz) and sending it out through the RemoteIO audio unit. It's come to my attention that my app's audio is "garbled" when going out via HDMI to a certain model of TV. It looks to me like the problem is related to the fact that this TV is looking for audio data at 48khz.
Here... | 2011/11/07 | [
"https://Stackoverflow.com/questions/8038874",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/44683/"
] | Fixed my problem. I was incorrectly assuming that the number of frames requested by the render callback would be a power of two. Changed my code to accommodate any arbitrary number of frames and all seems to work fine now. | If you want sample rate conversion, try using the Audio Queue API, or do the conversion within your own app using some DSP code.
Whether the RemoteIO buffer size or sample rate can be configured or not might depend on iOS device model, OS version, audio routes, background modes, etc., so an app must accomodate differ... |
217,126 | I am new to this company and they have 2 farms for SharePoint 2010 (regular portal and Business Intel). The portal authentication is windows ntlm and BI farm is setup with kerberos.
There are no documentations as why they have the BI farm setup with Kerberos.
The farm is small 15 small sites and total 12 GB data.
I ... | 2017/06/02 | [
"https://sharepoint.stackexchange.com/questions/217126",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/67593/"
] | You need to activate community site feature in a team site to get all Discussion board features and it will create a Discussion board app with activating. It comes with all your expected features.
But the Discussion board app that you added to team site is not giving all features.
1. Go to site settings.
2. Click "Ma... | SharePoint by default only displays 3 of the N Views in the ViewSelector
You have to add some JavaScript code to the page to change that ViewSelector
See:
[How do I display all my document views on 1 page for a document library](https://sharepoint.stackexchange.com/questions/171642/how-do-i-display-all-my-document-vi... |
73,805,703 | I'm trying to use a separate dataframe to match values to a focal dataframe. I can easily do this with a `for` loop but trying to do it all in a `dplyr::case_when()` to be consistent with the rest of my code.
Here are the two dataframes I'm using:
```
df_1 = data.frame(
year = rep(c(2001:2020), 5),
area = c(rep("... | 2022/09/21 | [
"https://Stackoverflow.com/questions/73805703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10475274/"
] | Hate to be the person that takes someone's comment and makes an answer out of it, but as @dandavis has suggested, you need to, in someway, default to a value if the 'a' key doensn't exist.
This can be done in a variety of ways:
**[Short circuit evaluation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer... | Not all elements have an `a` key. If you want to dynamically get whichever key is present, this should work:
```js
const numbers = [{ a: 1 }, { a: 6 }, { a: 3 }, { d: 4 }, { e: 5 }, { f: 5 }];
const filterNumbers = numbers.reduce((currenttotal, item) => {
let keys = Object.keys(item);
return item... |
73,805,703 | I'm trying to use a separate dataframe to match values to a focal dataframe. I can easily do this with a `for` loop but trying to do it all in a `dplyr::case_when()` to be consistent with the rest of my code.
Here are the two dataframes I'm using:
```
df_1 = data.frame(
year = rep(c(2001:2020), 5),
area = c(rep("... | 2022/09/21 | [
"https://Stackoverflow.com/questions/73805703",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10475274/"
] | Hate to be the person that takes someone's comment and makes an answer out of it, but as @dandavis has suggested, you need to, in someway, default to a value if the 'a' key doensn't exist.
This can be done in a variety of ways:
**[Short circuit evaluation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer... | Since not all fields have an `a` key the reduce does not find a value and return `NAN`.
The solution it`s the same as the previous answer, but i rather use immutability in variables since prevents future erros.
```
const numbers = [{ a: 1 }, { a: 6 }, { a: 3 }, { d: 4 }, { e: 5 }, { f: 5 }];
const filterNumbers = nu... |
3,346,070 | Currently, I use PayPal for payment processing. Almost 90% of the items are sold for $.99 and would like to use Paypals's Micropayment account, but PayPal states "support for Micropayments to merchants for US to US, GB to GB, AU to AU, and EU to EU transactions". My company is located in the US but the customers are ve... | 2010/07/27 | [
"https://Stackoverflow.com/questions/3346070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/401561/"
] | Unless you have insanely high volume like fast-food chains do, it is very difficult to obtain a merchant account where the transaction pricing is feasible for micro-payments. Most providers will suggest an aggregation model where you sell your content but only bill your customers periodically, i.e. bill them once a mon... | Take a look at www.carrot.org which runs a micropayment system. Customers using carrotPay load funds into an electronic purse - WebPurse - and can make payments with 2 clicks if you have a Carrot buy button installed on your site. The buy button can be set up along side other payment methods on your site. The webpurse ... |
3,346,070 | Currently, I use PayPal for payment processing. Almost 90% of the items are sold for $.99 and would like to use Paypals's Micropayment account, but PayPal states "support for Micropayments to merchants for US to US, GB to GB, AU to AU, and EU to EU transactions". My company is located in the US but the customers are ve... | 2010/07/27 | [
"https://Stackoverflow.com/questions/3346070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/401561/"
] | Unless you have insanely high volume like fast-food chains do, it is very difficult to obtain a merchant account where the transaction pricing is feasible for micro-payments. Most providers will suggest an aggregation model where you sell your content but only bill your customers periodically, i.e. bill them once a mon... | Take a look at Google's In-App Payments. The fee is a flat 5% which is great for transactions
<http://code.google.com/apis/inapppayments/>
I do work for Google, but I've taken a look at other similar products and can honestly say that In-App Payments is a very competitive product. |
3,346,070 | Currently, I use PayPal for payment processing. Almost 90% of the items are sold for $.99 and would like to use Paypals's Micropayment account, but PayPal states "support for Micropayments to merchants for US to US, GB to GB, AU to AU, and EU to EU transactions". My company is located in the US but the customers are ve... | 2010/07/27 | [
"https://Stackoverflow.com/questions/3346070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/401561/"
] | Unless you have insanely high volume like fast-food chains do, it is very difficult to obtain a merchant account where the transaction pricing is feasible for micro-payments. Most providers will suggest an aggregation model where you sell your content but only bill your customers periodically, i.e. bill them once a mon... | You can use Randpay - scalable micro-payment system, based on blockchain: <https://medium.com/@emer.tech/randpay-6a028f16c82a> |
3,346,070 | Currently, I use PayPal for payment processing. Almost 90% of the items are sold for $.99 and would like to use Paypals's Micropayment account, but PayPal states "support for Micropayments to merchants for US to US, GB to GB, AU to AU, and EU to EU transactions". My company is located in the US but the customers are ve... | 2010/07/27 | [
"https://Stackoverflow.com/questions/3346070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/401561/"
] | Take a look at www.carrot.org which runs a micropayment system. Customers using carrotPay load funds into an electronic purse - WebPurse - and can make payments with 2 clicks if you have a Carrot buy button installed on your site. The buy button can be set up along side other payment methods on your site. The webpurse ... | You can use Randpay - scalable micro-payment system, based on blockchain: <https://medium.com/@emer.tech/randpay-6a028f16c82a> |
3,346,070 | Currently, I use PayPal for payment processing. Almost 90% of the items are sold for $.99 and would like to use Paypals's Micropayment account, but PayPal states "support for Micropayments to merchants for US to US, GB to GB, AU to AU, and EU to EU transactions". My company is located in the US but the customers are ve... | 2010/07/27 | [
"https://Stackoverflow.com/questions/3346070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/401561/"
] | Take a look at Google's In-App Payments. The fee is a flat 5% which is great for transactions
<http://code.google.com/apis/inapppayments/>
I do work for Google, but I've taken a look at other similar products and can honestly say that In-App Payments is a very competitive product. | You can use Randpay - scalable micro-payment system, based on blockchain: <https://medium.com/@emer.tech/randpay-6a028f16c82a> |
10,320,922 | Is there a way I can change the Connection for a particular table in PowerPivot? All things I've researched talk about changing the Connection object itself. But I have 5 tables that refer to a single connection and I only need to change connection data for one of these tables. | 2012/04/25 | [
"https://Stackoverflow.com/questions/10320922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1356892/"
] | If you want to change a table's connection go to the "Design" ribbon in PowerPivot then select "Existing Connections" then select "PowerPivot Data Connections" which will list all your existing connections. Select the connection you want to modify and click "Edit". You can then chose to reload all the tables from the n... | 1. Delete the table (right click the tab in grid view and select delete).
2. Re-import the table using one of the options in Get External Data, but do not use an existing connection. For example, if you are pulling from a data base, use the *From Database* drop down. This will cause a new connection to be created and u... |
10,320,922 | Is there a way I can change the Connection for a particular table in PowerPivot? All things I've researched talk about changing the Connection object itself. But I have 5 tables that refer to a single connection and I only need to change connection data for one of these tables. | 2012/04/25 | [
"https://Stackoverflow.com/questions/10320922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1356892/"
] | If you want to change a table's connection go to the "Design" ribbon in PowerPivot then select "Existing Connections" then select "PowerPivot Data Connections" which will list all your existing connections. Select the connection you want to modify and click "Edit". You can then chose to reload all the tables from the n... | Use PowerPivot -> Design tab, select a table and click Table Properties. In the dialog you can change the name of the table that's being used.
<https://support.office.com/en-us/article/make-changes-to-an-existing-data-source-in-power-pivot-9cb508d3-1a83-4d83-a944-700ce41332b6> |
19,800 | Will employers look at the "Public Activity" section of your Github account? I was messing around with the command line and made a repo with the name of a bad word, and I realize that employers might view me as immature for calling a test repo this name. I didn't save the repo or anything, I just very quickly made it o... | 2014/02/26 | [
"https://workplace.stackexchange.com/questions/19800",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13101/"
] | It depends entirely on the employer. I've had some flat out ask me in the initial contact email if I had a github account and what was it and I've had others who weren't even aware that I knew how to use GIT version control until I got the gig. I've found that generally speaking newer companies and/or ones with younger... | Having a github or similar with publicly available code is a good way to show employers your skill and something you should add to your resume.
Having a project named something offensive is a bad idea, but if it's just test code, I don't think it will turn away too many employers.
Now you deleted the project, so I do... |
19,800 | Will employers look at the "Public Activity" section of your Github account? I was messing around with the command line and made a repo with the name of a bad word, and I realize that employers might view me as immature for calling a test repo this name. I didn't save the repo or anything, I just very quickly made it o... | 2014/02/26 | [
"https://workplace.stackexchange.com/questions/19800",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/13101/"
] | It depends entirely on the employer. I've had some flat out ask me in the initial contact email if I had a github account and what was it and I've had others who weren't even aware that I knew how to use GIT version control until I got the gig. I've found that generally speaking newer companies and/or ones with younger... | It sounds to me like your real question is whether they will be offended by your repo name, not just whether or not they will look at github.
I may be old school, but I am a hiring manager, so I will share my thoughts on your question. When I am interviewing candidates, I am looking at the entire candidate, not just t... |
25,756 | >
> **Possible Duplicates:**
>
> [Any way to manage and keep track of answers and questions?](https://meta.stackexchange.com/questions/18506/any-way-to-manage-and-keep-track-of-answers-and-questions)
>
> [Can I bookmark a question on Stack Overflow?](https://meta.stackexchange.com/questions/23670/can-i-bookmark-... | 2009/10/14 | [
"https://meta.stackexchange.com/questions/25756",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/-1/"
] | Click the star icon below the vote buttons.
You can see all of your bookmarked questions in your user page. | Yes, it's the star under the up/down vote. Next time, questions like these go on [meta](https://meta.stackoverflow.com/). |
25,756 | >
> **Possible Duplicates:**
>
> [Any way to manage and keep track of answers and questions?](https://meta.stackexchange.com/questions/18506/any-way-to-manage-and-keep-track-of-answers-and-questions)
>
> [Can I bookmark a question on Stack Overflow?](https://meta.stackexchange.com/questions/23670/can-i-bookmark-... | 2009/10/14 | [
"https://meta.stackexchange.com/questions/25756",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/-1/"
] | Click the star icon below the vote buttons.
You can see all of your bookmarked questions in your user page. | Click that little star icon on the left, beneath the rating. FAVE'D! |
25,019,301 | I have this code:
```
package teste;
public class Teste {
public static void main(String[] args) {
String arroz = "abc";
Integer banana = 123;
vaiBuscar();
}
private static void vaiBuscar() {
Object[] obj = theMagicMethod();
System.out.println(((String) obj[0]));... | 2014/07/29 | [
"https://Stackoverflow.com/questions/25019301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2207729/"
] | Within the methods, the variable names are lost.
Java is a stack based machine, and so a method that looks like
```
public int add(int first, int second) {
int sum = first + second;
return sum;
}
```
is going to lose the naming of sum in bytecode that roughly reads as
```
pushInt firstParameter
pushInt sec... | This is impossible to do. Reflection doesn't let you look at the inner implementation of methods.
There is no way in Java to look at the stack and extract variables or any values declared in stacked method stack frames. |
25,019,301 | I have this code:
```
package teste;
public class Teste {
public static void main(String[] args) {
String arroz = "abc";
Integer banana = 123;
vaiBuscar();
}
private static void vaiBuscar() {
Object[] obj = theMagicMethod();
System.out.println(((String) obj[0]));... | 2014/07/29 | [
"https://Stackoverflow.com/questions/25019301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2207729/"
] | Most likely it's a bad idea to use something like this in production code.
That said, I have to admit I've been looking for a way to inspect the variables on the stack trace, too :). It may be a stupid idea, but it's also an interesting one.
It can't be *completely* impossible. True, the byte code seems to be compile... | This is impossible to do. Reflection doesn't let you look at the inner implementation of methods.
There is no way in Java to look at the stack and extract variables or any values declared in stacked method stack frames. |
25,019,301 | I have this code:
```
package teste;
public class Teste {
public static void main(String[] args) {
String arroz = "abc";
Integer banana = 123;
vaiBuscar();
}
private static void vaiBuscar() {
Object[] obj = theMagicMethod();
System.out.println(((String) obj[0]));... | 2014/07/29 | [
"https://Stackoverflow.com/questions/25019301",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2207729/"
] | Within the methods, the variable names are lost.
Java is a stack based machine, and so a method that looks like
```
public int add(int first, int second) {
int sum = first + second;
return sum;
}
```
is going to lose the naming of sum in bytecode that roughly reads as
```
pushInt firstParameter
pushInt sec... | Most likely it's a bad idea to use something like this in production code.
That said, I have to admit I've been looking for a way to inspect the variables on the stack trace, too :). It may be a stupid idea, but it's also an interesting one.
It can't be *completely* impossible. True, the byte code seems to be compile... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.