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 |
|---|---|---|---|---|---|
31,409,149 | I am getting the following error when i try triggering a build using the following command:
curl <http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
Output:
>
> Authentication required
>
>
> <--
> You are authenticated as: anonymous
>
> Groups that you are in:
>
>
> Permission you need... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31409149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361089/"
] | I install Build Token Root Plugin to solve this issue before
<https://wiki.jenkins-ci.org/display/JENKINS/Build+Token+Root+Plugin>
Then as the same, setup Authentication Token
Finally, either use curl to trigger remote build (Be careful the escape character "\")
`curl http://JENKINS_URL/buildByToken/build?job=JOB_N... | On 1.625.3, giving Anonymous read access to almost everything worked for me.
**UPDATE**: I guess I should clarify since this got downvoted. I was able to reproduce that error message, and when I turned on read access for the Anonymous user on all of the access types, it resolved the problem. Just saying... |
31,409,149 | I am getting the following error when i try triggering a build using the following command:
curl <http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
Output:
>
> Authentication required
>
>
> <--
> You are authenticated as: anonymous
>
> Groups that you are in:
>
>
> Permission you need... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31409149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361089/"
] | I had the same problem after setting up a test Jenkins server. The solution was to authenticate using my Jenkins admin password:
```
curl -u admin:<mypassword> http://localhost:8080/job/Test/build?token=<mytoken>
```
Use the same username and password you use to login to Jenkins. There was no need to install additio... | On 1.625.3, giving Anonymous read access to almost everything worked for me.
**UPDATE**: I guess I should clarify since this got downvoted. I was able to reproduce that error message, and when I turned on read access for the Anonymous user on all of the access types, it resolved the problem. Just saying... |
31,409,149 | I am getting the following error when i try triggering a build using the following command:
curl <http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
Output:
>
> Authentication required
>
>
> <--
> You are authenticated as: anonymous
>
> Groups that you are in:
>
>
> Permission you need... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31409149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361089/"
] | I suggest you try [Jenkins Python API](https://python-jenkins.readthedocs.org/en/latest/api.html#module-jenkins). It provides an `build_job` action that is super easy to trigger a job.
```
build_job(name, parameters=None, token=None)
Trigger build job.
Parameters:
name – name of job
parameters – paramet... | I also have faced the same issue and resolved it.
Consider, you have 2 Jenkins A and B. If you want to execute a build job present in Jenkins B, then you have to give the API token of Jenkins B. If you provide the API token of Jenkins A, it will show the authentication issue only.
This is the mistake I have did and i... |
31,409,149 | I am getting the following error when i try triggering a build using the following command:
curl <http://jenkins_server:port/jenkins/job/job_name/build?token=token_name>
Output:
>
> Authentication required
>
>
> <--
> You are authenticated as: anonymous
>
> Groups that you are in:
>
>
> Permission you need... | 2015/07/14 | [
"https://Stackoverflow.com/questions/31409149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/361089/"
] | I install Build Token Root Plugin to solve this issue before
<https://wiki.jenkins-ci.org/display/JENKINS/Build+Token+Root+Plugin>
Then as the same, setup Authentication Token
Finally, either use curl to trigger remote build (Be careful the escape character "\")
`curl http://JENKINS_URL/buildByToken/build?job=JOB_N... | I suggest you try [Jenkins Python API](https://python-jenkins.readthedocs.org/en/latest/api.html#module-jenkins). It provides an `build_job` action that is super easy to trigger a job.
```
build_job(name, parameters=None, token=None)
Trigger build job.
Parameters:
name – name of job
parameters – paramet... |
1,875 | I recently installed a rear luggage rack and washed my bike, and now I get a buzzing rattle when I ride over bumps in the road, independent of whether I happen to be pedaling at the time. It sounds like it's coming from somewhere below me as I'm riding, which probably indicates somewhere between the bottom bracket and ... | 2010/10/23 | [
"https://bicycles.stackexchange.com/questions/1875",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/460/"
] | Since you don't hear the noise when the bike is up on the stand, the problem is probably linked to the load of your weight on the bike (trying to formulate this in a way that doesn't sound like I'm saying you're a problem or you're overweight but it's impossible! haha). Sit on the bike, swing on the saddle to simulate ... | You can pick the bike up and bounce it from an inch or two. Check all the joints of the rack. You can check any and all bolts and tighten them, including bottle cage bolts. Remember to check the lock-rings on the valve stem of your tube. If those are loose they will rattle. |
1,875 | I recently installed a rear luggage rack and washed my bike, and now I get a buzzing rattle when I ride over bumps in the road, independent of whether I happen to be pedaling at the time. It sounds like it's coming from somewhere below me as I'm riding, which probably indicates somewhere between the bottom bracket and ... | 2010/10/23 | [
"https://bicycles.stackexchange.com/questions/1875",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/460/"
] | Since you don't hear the noise when the bike is up on the stand, the problem is probably linked to the load of your weight on the bike (trying to formulate this in a way that doesn't sound like I'm saying you're a problem or you're overweight but it's impossible! haha). Sit on the bike, swing on the saddle to simulate ... | Try the following:
* Take your bike on your side, lift the rear wheel and let it fall from a short height, many times, while trying to find the noise;
* Pull the bike along an irregular surface (rocky) and try to figure out the source of noise;
* Grab the bike by the handlebars, brake rear wheel and lift front wheel u... |
1,875 | I recently installed a rear luggage rack and washed my bike, and now I get a buzzing rattle when I ride over bumps in the road, independent of whether I happen to be pedaling at the time. It sounds like it's coming from somewhere below me as I'm riding, which probably indicates somewhere between the bottom bracket and ... | 2010/10/23 | [
"https://bicycles.stackexchange.com/questions/1875",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/460/"
] | You can pick the bike up and bounce it from an inch or two. Check all the joints of the rack. You can check any and all bolts and tighten them, including bottle cage bolts. Remember to check the lock-rings on the valve stem of your tube. If those are loose they will rattle. | Try the following:
* Take your bike on your side, lift the rear wheel and let it fall from a short height, many times, while trying to find the noise;
* Pull the bike along an irregular surface (rocky) and try to figure out the source of noise;
* Grab the bike by the handlebars, brake rear wheel and lift front wheel u... |
11,384 | I am hoping someone can point me to a decent tutorial as to how to set up a Litecoin Pushpool server for windows. Im not trying to build anything big just so that my friends and I can mine together. I already have MySQL Community installed and working properly, downloaded the pushpool php files as well as the Mining Fa... | 2013/05/31 | [
"https://bitcoin.stackexchange.com/questions/11384",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/5351/"
] | It can be done. There are windows equivalents for all of the programs you need to install.
1. Cron. Normally, I'd tell you to use the task scheduler, but it looks like the program you linked needs to run stuff every 5 - 8 minutes. [This tool](http://cronw.sourceforge.net/) seems to do what you need. You'll need Perl t... | Iam not aware of a pool software that supports windows (except p2pool which is way different than pooled mining).
From my own experience i can suggest eloipool (channel on freenode irc: #eligius) as its as far as im aware the only maintained public pool software.
Please note, a pool and a frontend and a reward/payout... |
5,194,566 | I was wondering how can I redirect users to my hompage after they logged out when they hit the back button, kind of like facebook does. I was playing around with some javascript but nothing seemed to work.
PS: This will be for a Wordpress theme. | 2011/03/04 | [
"https://Stackoverflow.com/questions/5194566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455319/"
] | `s3cmd sync s3://from/this/bucket/ s3://to/this/bucket/`
For available options, please use:
`$s3cmd --help` | It's actually possible. This worked for me:
```
import boto
AWS_ACCESS_KEY = 'Your access key'
AWS_SECRET_KEY = 'Your secret key'
conn = boto.s3.connection.S3Connection(AWS_ACCESS_KEY, AWS_SECRET_KEY)
bucket = boto.s3.bucket.Bucket(conn, SRC_BUCKET_NAME)
for item in bucket:
# Note: here you can put also a path ... |
5,194,566 | I was wondering how can I redirect users to my hompage after they logged out when they hit the back button, kind of like facebook does. I was playing around with some javascript but nothing seemed to work.
PS: This will be for a Wordpress theme. | 2011/03/04 | [
"https://Stackoverflow.com/questions/5194566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455319/"
] | I needed to copy a very large bucket so I adapted the code in the question into a multi threaded version and put it up on GitHub.
<https://github.com/paultuckey/s3-bucket-to-bucket-copy-py> | Thanks - I use a slightly modified version, where I only copy files that don't exist or are a different size, and check on the destination if the key exists in the source. I found this a bit quicker for readying the test environment:
```
def botoSyncPath(path):
"""
Sync keys in specified path from source bu... |
5,194,566 | I was wondering how can I redirect users to my hompage after they logged out when they hit the back button, kind of like facebook does. I was playing around with some javascript but nothing seemed to work.
PS: This will be for a Wordpress theme. | 2011/03/04 | [
"https://Stackoverflow.com/questions/5194566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455319/"
] | The answer with the most upvotes as I write this is this one:
```
s3cmd sync s3://from/this/bucket s3://to/this/bucket
```
It's a useful answer. But sometimes sync is not what you need (it deletes files, etc.). It took me a long time to figure out this non-scripting alternative to simply copy multiple files between ... | I needed to copy a very large bucket so I adapted the code in the question into a multi threaded version and put it up on GitHub.
<https://github.com/paultuckey/s3-bucket-to-bucket-copy-py> |
5,194,566 | I was wondering how can I redirect users to my hompage after they logged out when they hit the back button, kind of like facebook does. I was playing around with some javascript but nothing seemed to work.
PS: This will be for a Wordpress theme. | 2011/03/04 | [
"https://Stackoverflow.com/questions/5194566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455319/"
] | AWS CLI seems to do the job perfectly, and has the bonus of being an officially supported tool.
```
aws s3 sync s3://mybucket s3://backup-mybucket
```
<http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html> | s3cmd won't cp with only prefixes or wildcards but you can script the behavior with 's3cmd ls sourceBucket', and awk to extract the object name. Then use 's3cmd cp sourceBucket/name destBucket' to copy each object name in the list.
I use these batch files in a DOS box on Windows:
s3list.bat
```
s3cmd ls %1 | gawk "/... |
5,194,566 | I was wondering how can I redirect users to my hompage after they logged out when they hit the back button, kind of like facebook does. I was playing around with some javascript but nothing seemed to work.
PS: This will be for a Wordpress theme. | 2011/03/04 | [
"https://Stackoverflow.com/questions/5194566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455319/"
] | `s3cmd sync s3://from/this/bucket/ s3://to/this/bucket/`
For available options, please use:
`$s3cmd --help` | I wrote a script that backs up an S3 bucket: <https://github.com/roseperrone/aws-backup-rake-task>
```
#!/usr/bin/env python
from boto.s3.connection import S3Connection
import re
import datetime
import sys
import time
def main():
s3_ID = sys.argv[1]
s3_key = sys.argv[2]
src_bucket_name = sys.argv[3]
n... |
5,194,566 | I was wondering how can I redirect users to my hompage after they logged out when they hit the back button, kind of like facebook does. I was playing around with some javascript but nothing seemed to work.
PS: This will be for a Wordpress theme. | 2011/03/04 | [
"https://Stackoverflow.com/questions/5194566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455319/"
] | The answer with the most upvotes as I write this is this one:
```
s3cmd sync s3://from/this/bucket s3://to/this/bucket
```
It's a useful answer. But sometimes sync is not what you need (it deletes files, etc.). It took me a long time to figure out this non-scripting alternative to simply copy multiple files between ... | I wrote a script that backs up an S3 bucket: <https://github.com/roseperrone/aws-backup-rake-task>
```
#!/usr/bin/env python
from boto.s3.connection import S3Connection
import re
import datetime
import sys
import time
def main():
s3_ID = sys.argv[1]
s3_key = sys.argv[2]
src_bucket_name = sys.argv[3]
n... |
5,194,566 | I was wondering how can I redirect users to my hompage after they logged out when they hit the back button, kind of like facebook does. I was playing around with some javascript but nothing seemed to work.
PS: This will be for a Wordpress theme. | 2011/03/04 | [
"https://Stackoverflow.com/questions/5194566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455319/"
] | mdahlman's code didn't work for me but this command copies all the files in the bucket1 to a new folder (command also creates this new folder) in bucket 2.
```
cp --recursive --include=file_prefix* s3://bucket1/ s3://bucket2/new_folder_name/
``` | You can also use s3funnel which uses multi-threading:
<https://github.com/neelakanta/s3funnel>
example (without the access key or secret key parameters shown):
s3funnel source-bucket-name list | s3funnel dest-bucket-name copy --source-bucket source-bucket-name --threads=10 |
5,194,566 | I was wondering how can I redirect users to my hompage after they logged out when they hit the back button, kind of like facebook does. I was playing around with some javascript but nothing seemed to work.
PS: This will be for a Wordpress theme. | 2011/03/04 | [
"https://Stackoverflow.com/questions/5194566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455319/"
] | `s3cmd sync s3://from/this/bucket/ s3://to/this/bucket/`
For available options, please use:
`$s3cmd --help` | I needed to copy a very large bucket so I adapted the code in the question into a multi threaded version and put it up on GitHub.
<https://github.com/paultuckey/s3-bucket-to-bucket-copy-py> |
5,194,566 | I was wondering how can I redirect users to my hompage after they logged out when they hit the back button, kind of like facebook does. I was playing around with some javascript but nothing seemed to work.
PS: This will be for a Wordpress theme. | 2011/03/04 | [
"https://Stackoverflow.com/questions/5194566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455319/"
] | `s3cmd sync s3://from/this/bucket/ s3://to/this/bucket/`
For available options, please use:
`$s3cmd --help` | Thanks - I use a slightly modified version, where I only copy files that don't exist or are a different size, and check on the destination if the key exists in the source. I found this a bit quicker for readying the test environment:
```
def botoSyncPath(path):
"""
Sync keys in specified path from source bu... |
5,194,566 | I was wondering how can I redirect users to my hompage after they logged out when they hit the back button, kind of like facebook does. I was playing around with some javascript but nothing seemed to work.
PS: This will be for a Wordpress theme. | 2011/03/04 | [
"https://Stackoverflow.com/questions/5194566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/455319/"
] | The answer with the most upvotes as I write this is this one:
```
s3cmd sync s3://from/this/bucket s3://to/this/bucket
```
It's a useful answer. But sometimes sync is not what you need (it deletes files, etc.). It took me a long time to figure out this non-scripting alternative to simply copy multiple files between ... | s3cmd won't cp with only prefixes or wildcards but you can script the behavior with 's3cmd ls sourceBucket', and awk to extract the object name. Then use 's3cmd cp sourceBucket/name destBucket' to copy each object name in the list.
I use these batch files in a DOS box on Windows:
s3list.bat
```
s3cmd ls %1 | gawk "/... |
2,394,697 | When using the MVC pattern, should I implement a seperate controller for each view? | 2010/03/07 | [
"https://Stackoverflow.com/questions/2394697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/144183/"
] | Create a new one if you need to. Don't if you don't.
Patterns are not about data structures, they're about organizational patterns among communicating components. If the same controller is appropriate for more than one view, great - especially if you can use it *without modification*.
If you have to change it, then y... | I believe there is no 'the' MVC pattern. There are almost as many MVC patterns as there are users of a MVC architecture. That being said, in my opinion, the answer to your question is 'no'. |
2,394,697 | When using the MVC pattern, should I implement a seperate controller for each view? | 2010/03/07 | [
"https://Stackoverflow.com/questions/2394697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/144183/"
] | Create a new one if you need to. Don't if you don't.
Patterns are not about data structures, they're about organizational patterns among communicating components. If the same controller is appropriate for more than one view, great - especially if you can use it *without modification*.
If you have to change it, then y... | I use to implement a controller for each module of my application, not for each view. A controller can call methods of other controller. I'm not sure if this is the better way to do it, but I think It's working well for me. |
2,394,697 | When using the MVC pattern, should I implement a seperate controller for each view? | 2010/03/07 | [
"https://Stackoverflow.com/questions/2394697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/144183/"
] | Create a new one if you need to. Don't if you don't.
Patterns are not about data structures, they're about organizational patterns among communicating components. If the same controller is appropriate for more than one view, great - especially if you can use it *without modification*.
If you have to change it, then y... | the idea is to separate/decoupling M, V and C, its not a problem if you want a single controller control multiple view, as long as the view and controller is decoupled |
14,564,069 | >
> **Possible Duplicate:**
>
> [how to match a number which is less than or equal to 100?](https://stackoverflow.com/questions/11011674/how-to-match-a-number-which-is-less-than-or-equal-to-100)
>
>
>
i need a regular expression between these two values 1000 <= x <= 500000 im trying with this one that i constr... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14564069",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/982959/"
] | ```
\b([1-9][0-9]{3,4}|[1-4][0-9]{5}|500000)\b
``` | Match the cases 1000-9999, 10000-99999, 100000-499999 or 500000:
```
([1-9]\d{3}|[1-9]\d{4}|[1-4]\d{5}|500000)
```
Or combining the two first:
```
([1-9]\d{3,4}|[1-4]\d{5}|500000)
``` |
14,564,069 | >
> **Possible Duplicate:**
>
> [how to match a number which is less than or equal to 100?](https://stackoverflow.com/questions/11011674/how-to-match-a-number-which-is-less-than-or-equal-to-100)
>
>
>
i need a regular expression between these two values 1000 <= x <= 500000 im trying with this one that i constr... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14564069",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/982959/"
] | Is there a particular reason you don't just test the numbers *as numbers*?
```
var yourNum = parseInt(yourString, 10); // use parseFloat if it has decimals
if (yourNum >= 1000 && yourNum <= 500000) {
// success
} else
// fail
}
``` | Match the cases 1000-9999, 10000-99999, 100000-499999 or 500000:
```
([1-9]\d{3}|[1-9]\d{4}|[1-4]\d{5}|500000)
```
Or combining the two first:
```
([1-9]\d{3,4}|[1-4]\d{5}|500000)
``` |
1,739,836 | I'm using Ruby 1.9.1 with Rails 2.3.4 My application is to handle text input
If I try something like (the inside quotation marks look different)
```
text = "”“"
```
I get the following error:
```
#<SyntaxError: /Users/tammam56/rubydev/favquote/lib/daemons/twitter_quotes_fetch.rb:54: invalid multibyte char (US-ASCI... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1739836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99694/"
] | Have you tried adding a magic comment in the script where you use non-ASCII chars? It should go on top of the script.
```
#!/bin/env ruby
# encoding: utf-8
```
It worked for me like a charm. | If you want to add magic comments on all the source files of a project easily, you can use the [`magic_encoding`](https://github.com/m-ryan/magic_encoding) gem
```
sudo gem install magic_encoding
```
then just call `magic_encoding` in the terminal from the root of your app. |
1,739,836 | I'm using Ruby 1.9.1 with Rails 2.3.4 My application is to handle text input
If I try something like (the inside quotation marks look different)
```
text = "”“"
```
I get the following error:
```
#<SyntaxError: /Users/tammam56/rubydev/favquote/lib/daemons/twitter_quotes_fetch.rb:54: invalid multibyte char (US-ASCI... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1739836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99694/"
] | Have you tried adding a magic comment in the script where you use non-ASCII chars? It should go on top of the script.
```
#!/bin/env ruby
# encoding: utf-8
```
It worked for me like a charm. | Just a note that as of Ruby 2.0 there is no need to add `# encoding: utf-8`. UTF-8 is automatically detected. |
1,739,836 | I'm using Ruby 1.9.1 with Rails 2.3.4 My application is to handle text input
If I try something like (the inside quotation marks look different)
```
text = "”“"
```
I get the following error:
```
#<SyntaxError: /Users/tammam56/rubydev/favquote/lib/daemons/twitter_quotes_fetch.rb:54: invalid multibyte char (US-ASCI... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1739836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99694/"
] | Have you tried adding a magic comment in the script where you use non-ASCII chars? It should go on top of the script.
```
#!/bin/env ruby
# encoding: utf-8
```
It worked for me like a charm. | That worked for me:
```
$ export LC_ALL=en_US.UTF-8
$ export LANG=en_US.UTF-8
``` |
1,739,836 | I'm using Ruby 1.9.1 with Rails 2.3.4 My application is to handle text input
If I try something like (the inside quotation marks look different)
```
text = "”“"
```
I get the following error:
```
#<SyntaxError: /Users/tammam56/rubydev/favquote/lib/daemons/twitter_quotes_fetch.rb:54: invalid multibyte char (US-ASCI... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1739836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99694/"
] | Have you tried adding a magic comment in the script where you use non-ASCII chars? It should go on top of the script.
```
#!/bin/env ruby
# encoding: utf-8
```
It worked for me like a charm. | Those slanted double quotes are not ASCII characters. The error message is misleading about them being 'multi-byte'. |
1,739,836 | I'm using Ruby 1.9.1 with Rails 2.3.4 My application is to handle text input
If I try something like (the inside quotation marks look different)
```
text = "”“"
```
I get the following error:
```
#<SyntaxError: /Users/tammam56/rubydev/favquote/lib/daemons/twitter_quotes_fetch.rb:54: invalid multibyte char (US-ASCI... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1739836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99694/"
] | If you want to add magic comments on all the source files of a project easily, you can use the [`magic_encoding`](https://github.com/m-ryan/magic_encoding) gem
```
sudo gem install magic_encoding
```
then just call `magic_encoding` in the terminal from the root of your app. | Those slanted double quotes are not ASCII characters. The error message is misleading about them being 'multi-byte'. |
1,739,836 | I'm using Ruby 1.9.1 with Rails 2.3.4 My application is to handle text input
If I try something like (the inside quotation marks look different)
```
text = "”“"
```
I get the following error:
```
#<SyntaxError: /Users/tammam56/rubydev/favquote/lib/daemons/twitter_quotes_fetch.rb:54: invalid multibyte char (US-ASCI... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1739836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99694/"
] | I just want to add my solution:
I use german umlauts like ö, ü, ä and got the same error.
@Jarek Zmudzinski just told you how it works, but here is mine:
Add this code to the top of your Controller: `# encoding: UTF-8`
(for example to use flash message with umlauts)
example of my Controller:
```
# encodin... | Just a note that as of Ruby 2.0 there is no need to add `# encoding: utf-8`. UTF-8 is automatically detected. |
1,739,836 | I'm using Ruby 1.9.1 with Rails 2.3.4 My application is to handle text input
If I try something like (the inside quotation marks look different)
```
text = "”“"
```
I get the following error:
```
#<SyntaxError: /Users/tammam56/rubydev/favquote/lib/daemons/twitter_quotes_fetch.rb:54: invalid multibyte char (US-ASCI... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1739836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99694/"
] | Have you tried adding a magic comment in the script where you use non-ASCII chars? It should go on top of the script.
```
#!/bin/env ruby
# encoding: utf-8
```
It worked for me like a charm. | I just want to add my solution:
I use german umlauts like ö, ü, ä and got the same error.
@Jarek Zmudzinski just told you how it works, but here is mine:
Add this code to the top of your Controller: `# encoding: UTF-8`
(for example to use flash message with umlauts)
example of my Controller:
```
# encodin... |
1,739,836 | I'm using Ruby 1.9.1 with Rails 2.3.4 My application is to handle text input
If I try something like (the inside quotation marks look different)
```
text = "”“"
```
I get the following error:
```
#<SyntaxError: /Users/tammam56/rubydev/favquote/lib/daemons/twitter_quotes_fetch.rb:54: invalid multibyte char (US-ASCI... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1739836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99694/"
] | I just want to add my solution:
I use german umlauts like ö, ü, ä and got the same error.
@Jarek Zmudzinski just told you how it works, but here is mine:
Add this code to the top of your Controller: `# encoding: UTF-8`
(for example to use flash message with umlauts)
example of my Controller:
```
# encodin... | Those slanted double quotes are not ASCII characters. The error message is misleading about them being 'multi-byte'. |
1,739,836 | I'm using Ruby 1.9.1 with Rails 2.3.4 My application is to handle text input
If I try something like (the inside quotation marks look different)
```
text = "”“"
```
I get the following error:
```
#<SyntaxError: /Users/tammam56/rubydev/favquote/lib/daemons/twitter_quotes_fetch.rb:54: invalid multibyte char (US-ASCI... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1739836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99694/"
] | That worked for me:
```
$ export LC_ALL=en_US.UTF-8
$ export LANG=en_US.UTF-8
``` | Just a note that as of Ruby 2.0 there is no need to add `# encoding: utf-8`. UTF-8 is automatically detected. |
1,739,836 | I'm using Ruby 1.9.1 with Rails 2.3.4 My application is to handle text input
If I try something like (the inside quotation marks look different)
```
text = "”“"
```
I get the following error:
```
#<SyntaxError: /Users/tammam56/rubydev/favquote/lib/daemons/twitter_quotes_fetch.rb:54: invalid multibyte char (US-ASCI... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1739836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/99694/"
] | That worked for me:
```
$ export LC_ALL=en_US.UTF-8
$ export LANG=en_US.UTF-8
``` | Those slanted double quotes are not ASCII characters. The error message is misleading about them being 'multi-byte'. |
537,909 | For my thesis at university, I'd like to draw a certain diagram, but I am not sure how I should go about it. I have drawn it by hand and it should be displayed down below. I have looked at Tikz/Tikz-cd as well as other questions asked, such as
[How can I draw commutative diagrams in LaTeX?](https://tex.stackexchange.co... | 2020/04/10 | [
"https://tex.stackexchange.com/questions/537909",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/212351/"
] | As pointed out by Torbjørn T. there is no real challenge. At least it is very much simpler to draw such diagrams than to understand Galois theory.
```
\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsmath}
\usepackage{amsfonts}
\DeclareMathOperator{\Frob}{Frob}
\usepackage{dsfont} % I personally like this b... | This is a starting point....
```
\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
A \arrow[r, "\beta"] \arrow["\alpha"', loop, distance=2em, in=305, out=235] \arrow[r, "\gamma", bend left=49] & B \arrow["\delta"', loop, distance=2em, in=305, out=235] \arrow[loo... |
346,380 | In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable `foo` equals `"Ted"` and you declare a string `"Hello, #{foo}"` it interpolates to `"Hello, Ted"`.
I've not been able to figure out how to perform the magic `"#{}"` interpolation on data re... | 2008/12/06 | [
"https://Stackoverflow.com/questions/346380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4061/"
] | Instead of interpolating, you could use [`erb`](http://ruby-doc.org/stdlib-2.1.1/libdoc/erb/rdoc/ERB.html). [This blog](https://web.archive.org/web/20160401113123/http://www.rrn.dk/rubys-erb-templating-system) gives simple example of ERB usage,
```
require 'erb'
name = "Rasmus"
template_string = "My name is <%= name %... | The 2 most obvious answers have already been given, but if they don't to it for some reason, there's the format operator:
```
>> x = 1
=> 1
>> File.read('temp') % ["#{x}", 'saddle']
=> "The number of horses is 1, where each horse has a saddle\n"
```
where instead of the #{} magic you have the older (but time-tested)... |
346,380 | In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable `foo` equals `"Ted"` and you declare a string `"Hello, #{foo}"` it interpolates to `"Hello, Ted"`.
I've not been able to figure out how to perform the magic `"#{}"` interpolation on data re... | 2008/12/06 | [
"https://Stackoverflow.com/questions/346380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4061/"
] | Well, I second stesch's answer of using erb in this situation. But you can use eval like this. If data.txt has contents:
```
he #{foo} he
```
Then you can load and interpolate like this:
```
str = File.read("data.txt")
foo = 3
result = eval("\"" + str + "\"")
```
And `result` will be:
```
"he 3 he"
``` | Using [daniel-lucraft](https://stackoverflow.com/users/11951/daniel-lucraft)'s answer as my base (as he seems to be the only one that answered the question) I decided to solve this problem in a robust manner. Below you will find the code for this solution.
```
# encoding: utf-8
class String
INTERPOLATE_DELIMETER_LI... |
346,380 | In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable `foo` equals `"Ted"` and you declare a string `"Hello, #{foo}"` it interpolates to `"Hello, Ted"`.
I've not been able to figure out how to perform the magic `"#{}"` interpolation on data re... | 2008/12/06 | [
"https://Stackoverflow.com/questions/346380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4061/"
] | I think this might be the easiest and safest way to do what you want in Ruby 1.9.x (sprintf doesn't support reference by name in 1.8.x): use Kernel.sprintf feature of "reference by name". Example:
```
>> mystring = "There are %{thing1}s and %{thing2}s here."
=> "There are %{thing1}s and %{thing2}s here."
>> vars = {... | Using [daniel-lucraft](https://stackoverflow.com/users/11951/daniel-lucraft)'s answer as my base (as he seems to be the only one that answered the question) I decided to solve this problem in a robust manner. Below you will find the code for this solution.
```
# encoding: utf-8
class String
INTERPOLATE_DELIMETER_LI... |
346,380 | In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable `foo` equals `"Ted"` and you declare a string `"Hello, #{foo}"` it interpolates to `"Hello, Ted"`.
I've not been able to figure out how to perform the magic `"#{}"` interpolation on data re... | 2008/12/06 | [
"https://Stackoverflow.com/questions/346380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4061/"
] | I think this might be the easiest and safest way to do what you want in Ruby 1.9.x (sprintf doesn't support reference by name in 1.8.x): use Kernel.sprintf feature of "reference by name". Example:
```
>> mystring = "There are %{thing1}s and %{thing2}s here."
=> "There are %{thing1}s and %{thing2}s here."
>> vars = {... | Ruby Facets provides a [String#interpolate](http://rubyworks.github.io/rubyfaux/?doc=http://rubyworks.github.io/facets/docs/facets-2.9.3/core.json#api-class-String/api-method-String-d-interpolate) method:
>
> Interpolate. Provides a means of
> extenally using Ruby string
> interpolation mechinism.
>
>
>
```
try... |
346,380 | In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable `foo` equals `"Ted"` and you declare a string `"Hello, #{foo}"` it interpolates to `"Hello, Ted"`.
I've not been able to figure out how to perform the magic `"#{}"` interpolation on data re... | 2008/12/06 | [
"https://Stackoverflow.com/questions/346380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4061/"
] | Well, I second stesch's answer of using erb in this situation. But you can use eval like this. If data.txt has contents:
```
he #{foo} he
```
Then you can load and interpolate like this:
```
str = File.read("data.txt")
foo = 3
result = eval("\"" + str + "\"")
```
And `result` will be:
```
"he 3 he"
``` | Might as well throw my own solution into the mix.
```
irb(main):001:0> str = '#{13*3} Music'
=> "\#{13*3} Music"
irb(main):002:0> str.gsub(/\#\{(.*?)\}/) { |match| eval($1) }
=> "39 Music"
```
The weakness is that the expression you want to evaluate may have further { } in it, so the regex should probably be improve... |
346,380 | In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable `foo` equals `"Ted"` and you declare a string `"Hello, #{foo}"` it interpolates to `"Hello, Ted"`.
I've not been able to figure out how to perform the magic `"#{}"` interpolation on data re... | 2008/12/06 | [
"https://Stackoverflow.com/questions/346380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4061/"
] | Well, I second stesch's answer of using erb in this situation. But you can use eval like this. If data.txt has contents:
```
he #{foo} he
```
Then you can load and interpolate like this:
```
str = File.read("data.txt")
foo = 3
result = eval("\"" + str + "\"")
```
And `result` will be:
```
"he 3 he"
``` | The 2 most obvious answers have already been given, but if they don't to it for some reason, there's the format operator:
```
>> x = 1
=> 1
>> File.read('temp') % ["#{x}", 'saddle']
=> "The number of horses is 1, where each horse has a saddle\n"
```
where instead of the #{} magic you have the older (but time-tested)... |
346,380 | In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable `foo` equals `"Ted"` and you declare a string `"Hello, #{foo}"` it interpolates to `"Hello, Ted"`.
I've not been able to figure out how to perform the magic `"#{}"` interpolation on data re... | 2008/12/06 | [
"https://Stackoverflow.com/questions/346380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4061/"
] | The 2 most obvious answers have already been given, but if they don't to it for some reason, there's the format operator:
```
>> x = 1
=> 1
>> File.read('temp') % ["#{x}", 'saddle']
=> "The number of horses is 1, where each horse has a saddle\n"
```
where instead of the #{} magic you have the older (but time-tested)... | Might as well throw my own solution into the mix.
```
irb(main):001:0> str = '#{13*3} Music'
=> "\#{13*3} Music"
irb(main):002:0> str.gsub(/\#\{(.*?)\}/) { |match| eval($1) }
=> "39 Music"
```
The weakness is that the expression you want to evaluate may have further { } in it, so the regex should probably be improve... |
346,380 | In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable `foo` equals `"Ted"` and you declare a string `"Hello, #{foo}"` it interpolates to `"Hello, Ted"`.
I've not been able to figure out how to perform the magic `"#{}"` interpolation on data re... | 2008/12/06 | [
"https://Stackoverflow.com/questions/346380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4061/"
] | Ruby Facets provides a [String#interpolate](http://rubyworks.github.io/rubyfaux/?doc=http://rubyworks.github.io/facets/docs/facets-2.9.3/core.json#api-class-String/api-method-String-d-interpolate) method:
>
> Interpolate. Provides a means of
> extenally using Ruby string
> interpolation mechinism.
>
>
>
```
try... | Might as well throw my own solution into the mix.
```
irb(main):001:0> str = '#{13*3} Music'
=> "\#{13*3} Music"
irb(main):002:0> str.gsub(/\#\{(.*?)\}/) { |match| eval($1) }
=> "39 Music"
```
The weakness is that the expression you want to evaluate may have further { } in it, so the regex should probably be improve... |
346,380 | In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable `foo` equals `"Ted"` and you declare a string `"Hello, #{foo}"` it interpolates to `"Hello, Ted"`.
I've not been able to figure out how to perform the magic `"#{}"` interpolation on data re... | 2008/12/06 | [
"https://Stackoverflow.com/questions/346380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4061/"
] | Ruby Facets provides a [String#interpolate](http://rubyworks.github.io/rubyfaux/?doc=http://rubyworks.github.io/facets/docs/facets-2.9.3/core.json#api-class-String/api-method-String-d-interpolate) method:
>
> Interpolate. Provides a means of
> extenally using Ruby string
> interpolation mechinism.
>
>
>
```
try... | Using [daniel-lucraft](https://stackoverflow.com/users/11951/daniel-lucraft)'s answer as my base (as he seems to be the only one that answered the question) I decided to solve this problem in a robust manner. Below you will find the code for this solution.
```
# encoding: utf-8
class String
INTERPOLATE_DELIMETER_LI... |
346,380 | In Ruby you can reference variables inside strings and they are interpolated at runtime.
For example if you declare a variable `foo` equals `"Ted"` and you declare a string `"Hello, #{foo}"` it interpolates to `"Hello, Ted"`.
I've not been able to figure out how to perform the magic `"#{}"` interpolation on data re... | 2008/12/06 | [
"https://Stackoverflow.com/questions/346380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4061/"
] | Well, I second stesch's answer of using erb in this situation. But you can use eval like this. If data.txt has contents:
```
he #{foo} he
```
Then you can load and interpolate like this:
```
str = File.read("data.txt")
foo = 3
result = eval("\"" + str + "\"")
```
And `result` will be:
```
"he 3 he"
``` | Ruby Facets provides a [String#interpolate](http://rubyworks.github.io/rubyfaux/?doc=http://rubyworks.github.io/facets/docs/facets-2.9.3/core.json#api-class-String/api-method-String-d-interpolate) method:
>
> Interpolate. Provides a means of
> extenally using Ruby string
> interpolation mechinism.
>
>
>
```
try... |
20,401,041 | I am using an asyncTask which runs for every 1 sec.
I must check a condition every 1 sec that the socket connection is available or not before asyncTask starts.
I used socket.isConnected() -> it always returning true.
How to do this.
Please help.. | 2013/12/05 | [
"https://Stackoverflow.com/questions/20401041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2085965/"
] | Once a connection is made, isConnected() will always return true.
To check if the connection is still avaialble, you can:
1. Use `socket.getInputStream().Read()`. This will block until either some data arrives or the connection closes in which case it will return `-1`. Otherwise it will return the received byte. If y... | Its too late but it may help someone else all you need to do is just check for your socket if it is not null and then in case if it is not null just disconnect your socket else create new socket and connect that
```
if(socket != null)
{
socket.disconnect();
}
else
{
socket.createSoc... |
20,401,041 | I am using an asyncTask which runs for every 1 sec.
I must check a condition every 1 sec that the socket connection is available or not before asyncTask starts.
I used socket.isConnected() -> it always returning true.
How to do this.
Please help.. | 2013/12/05 | [
"https://Stackoverflow.com/questions/20401041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2085965/"
] | Once a connection is made, isConnected() will always return true.
To check if the connection is still avaialble, you can:
1. Use `socket.getInputStream().Read()`. This will block until either some data arrives or the connection closes in which case it will return `-1`. Otherwise it will return the received byte. If y... | ```
public class CheckSocket extends AsyncTask<String,String,String>{
@Override
protected String doInBackground(String... strings) {
try {
socket = new Socket("192.168.15.101", 23);
} catch (IOException e) {
e.printStackTrace();
}
if(socket.isConnected()... |
70,391,967 | I have a dataset:
```
dummydata = data.frame(code = c("Aardenburg G 18", "Loon op Zand H 262"))
```
And I want to turn it into this:
```
enddata = data.frame(municipality = c("Aardenburg", "Loon op Zand"),
section = c("G", "H"),
number = c("18", "262"))
```
Because the mu... | 2021/12/17 | [
"https://Stackoverflow.com/questions/70391967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15659092/"
] | A possible solution:
```r
library(tidyverse)
dummydata = data.frame(code = c("Aardenburg G 18", "Loon op Zand H 262"))
dummydata %>%
separate(code, into=c("municipality", "section", "number"),
sep=" (?=\\d+)| (?=[A-Z] \\d+)", convert = T)
#> municipality section number
#> 1 Aardenburg G ... | Try this:
```
require(stringr)
endata <- dummydata %>%
mutate(section = word(code, -2),
number = word(code, -1))
```
changed a little your syntax, used `word` function from `stringr` instead. It selects the nth word, but by indicating a negative index, it reverses the order from the last to the first word... |
70,391,967 | I have a dataset:
```
dummydata = data.frame(code = c("Aardenburg G 18", "Loon op Zand H 262"))
```
And I want to turn it into this:
```
enddata = data.frame(municipality = c("Aardenburg", "Loon op Zand"),
section = c("G", "H"),
number = c("18", "262"))
```
Because the mu... | 2021/12/17 | [
"https://Stackoverflow.com/questions/70391967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15659092/"
] | Try this:
```
require(stringr)
endata <- dummydata %>%
mutate(section = word(code, -2),
number = word(code, -1))
```
changed a little your syntax, used `word` function from `stringr` instead. It selects the nth word, but by indicating a negative index, it reverses the order from the last to the first word... | Sometimes `regex` is an overkill:
```
enddata <- strsplit(dummydata$code, " ") |>
lapply(
\(x) data.frame(
municipality = paste(head(x, -2), collapse = " "),
section = tail(x, 2)[1],
number = tail(x, 1)
)
)
enddata <- do.call(rbind, enddata)
# municipality section number
# 1 Aard... |
70,391,967 | I have a dataset:
```
dummydata = data.frame(code = c("Aardenburg G 18", "Loon op Zand H 262"))
```
And I want to turn it into this:
```
enddata = data.frame(municipality = c("Aardenburg", "Loon op Zand"),
section = c("G", "H"),
number = c("18", "262"))
```
Because the mu... | 2021/12/17 | [
"https://Stackoverflow.com/questions/70391967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15659092/"
] | A possible solution:
```r
library(tidyverse)
dummydata = data.frame(code = c("Aardenburg G 18", "Loon op Zand H 262"))
dummydata %>%
separate(code, into=c("municipality", "section", "number"),
sep=" (?=\\d+)| (?=[A-Z] \\d+)", convert = T)
#> municipality section number
#> 1 Aardenburg G ... | **1)** Replace the last space with semicolon and then do it again. Now it can be read as semicolon separated strings. Note that "(.\*) " matches the longest string until and including the last space and \1; says to replace it with the part in parenthesis followed by semicolon. Backslashes need to be doubled within quot... |
70,391,967 | I have a dataset:
```
dummydata = data.frame(code = c("Aardenburg G 18", "Loon op Zand H 262"))
```
And I want to turn it into this:
```
enddata = data.frame(municipality = c("Aardenburg", "Loon op Zand"),
section = c("G", "H"),
number = c("18", "262"))
```
Because the mu... | 2021/12/17 | [
"https://Stackoverflow.com/questions/70391967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15659092/"
] | A possible solution:
```r
library(tidyverse)
dummydata = data.frame(code = c("Aardenburg G 18", "Loon op Zand H 262"))
dummydata %>%
separate(code, into=c("municipality", "section", "number"),
sep=" (?=\\d+)| (?=[A-Z] \\d+)", convert = T)
#> municipality section number
#> 1 Aardenburg G ... | Sometimes `regex` is an overkill:
```
enddata <- strsplit(dummydata$code, " ") |>
lapply(
\(x) data.frame(
municipality = paste(head(x, -2), collapse = " "),
section = tail(x, 2)[1],
number = tail(x, 1)
)
)
enddata <- do.call(rbind, enddata)
# municipality section number
# 1 Aard... |
70,391,967 | I have a dataset:
```
dummydata = data.frame(code = c("Aardenburg G 18", "Loon op Zand H 262"))
```
And I want to turn it into this:
```
enddata = data.frame(municipality = c("Aardenburg", "Loon op Zand"),
section = c("G", "H"),
number = c("18", "262"))
```
Because the mu... | 2021/12/17 | [
"https://Stackoverflow.com/questions/70391967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15659092/"
] | **1)** Replace the last space with semicolon and then do it again. Now it can be read as semicolon separated strings. Note that "(.\*) " matches the longest string until and including the last space and \1; says to replace it with the part in parenthesis followed by semicolon. Backslashes need to be doubled within quot... | Sometimes `regex` is an overkill:
```
enddata <- strsplit(dummydata$code, " ") |>
lapply(
\(x) data.frame(
municipality = paste(head(x, -2), collapse = " "),
section = tail(x, 2)[1],
number = tail(x, 1)
)
)
enddata <- do.call(rbind, enddata)
# municipality section number
# 1 Aard... |
62,127,452 | I was try to export an excel file using **ExcelJS**
Here is my **console** in VS Code terminal :
```
ERROR in node_modules/exceljs/index.d.ts:1398:22 - error TS2307: Cannot find module 'stream'.
1398 read(stream: import('stream').Stream): Promise<Workbook>;
~~~~~~~~
node_modules/exceljs/in... | 2020/06/01 | [
"https://Stackoverflow.com/questions/62127452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In your tsconfig.app.json file add "types": ["node"]
Note, that the "types" are in the compilerOptions section of the tsconfig. | while import the excel : try checking in tsconfig.app.json
where in pre-defined code add "types": ["node"].
```
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": ["node"]
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.t... |
62,127,452 | I was try to export an excel file using **ExcelJS**
Here is my **console** in VS Code terminal :
```
ERROR in node_modules/exceljs/index.d.ts:1398:22 - error TS2307: Cannot find module 'stream'.
1398 read(stream: import('stream').Stream): Promise<Workbook>;
~~~~~~~~
node_modules/exceljs/in... | 2020/06/01 | [
"https://Stackoverflow.com/questions/62127452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In your tsconfig.app.json file add "types": ["node"]
Note, that the "types" are in the compilerOptions section of the tsconfig. | I found a simple way to resolve this!
comment or remove the import `import * as Excel from 'exceljs'`
Now you can import like this:
`import * as Excel from 'exceljs/dist/exceljs.min.js'` |
62,127,452 | I was try to export an excel file using **ExcelJS**
Here is my **console** in VS Code terminal :
```
ERROR in node_modules/exceljs/index.d.ts:1398:22 - error TS2307: Cannot find module 'stream'.
1398 read(stream: import('stream').Stream): Promise<Workbook>;
~~~~~~~~
node_modules/exceljs/in... | 2020/06/01 | [
"https://Stackoverflow.com/questions/62127452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In your tsconfig.app.json file add "types": ["node"]
Note, that the "types" are in the compilerOptions section of the tsconfig. | if you are using angular 8 and below, you need to install excelJs version 1.12.0
see [step by step to use excejs with angular](https://dev.to/ankitprajapati/exporting-data-to-excel-file-in-angular-using-exceljs-k13) |
62,127,452 | I was try to export an excel file using **ExcelJS**
Here is my **console** in VS Code terminal :
```
ERROR in node_modules/exceljs/index.d.ts:1398:22 - error TS2307: Cannot find module 'stream'.
1398 read(stream: import('stream').Stream): Promise<Workbook>;
~~~~~~~~
node_modules/exceljs/in... | 2020/06/01 | [
"https://Stackoverflow.com/questions/62127452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can't write directly a file on client side. that method is mean to be used on backend side in nodejs. if your expectation is download this file on client side. your code should be like :-
```
import { Component } from "@angular/core";
import * as Excel from "exceljs";
@Component({
selector: "my-app",
template... | while import the excel : try checking in tsconfig.app.json
where in pre-defined code add "types": ["node"].
```
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": ["node"]
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.t... |
62,127,452 | I was try to export an excel file using **ExcelJS**
Here is my **console** in VS Code terminal :
```
ERROR in node_modules/exceljs/index.d.ts:1398:22 - error TS2307: Cannot find module 'stream'.
1398 read(stream: import('stream').Stream): Promise<Workbook>;
~~~~~~~~
node_modules/exceljs/in... | 2020/06/01 | [
"https://Stackoverflow.com/questions/62127452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can't write directly a file on client side. that method is mean to be used on backend side in nodejs. if your expectation is download this file on client side. your code should be like :-
```
import { Component } from "@angular/core";
import * as Excel from "exceljs";
@Component({
selector: "my-app",
template... | I found a simple way to resolve this!
comment or remove the import `import * as Excel from 'exceljs'`
Now you can import like this:
`import * as Excel from 'exceljs/dist/exceljs.min.js'` |
62,127,452 | I was try to export an excel file using **ExcelJS**
Here is my **console** in VS Code terminal :
```
ERROR in node_modules/exceljs/index.d.ts:1398:22 - error TS2307: Cannot find module 'stream'.
1398 read(stream: import('stream').Stream): Promise<Workbook>;
~~~~~~~~
node_modules/exceljs/in... | 2020/06/01 | [
"https://Stackoverflow.com/questions/62127452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can't write directly a file on client side. that method is mean to be used on backend side in nodejs. if your expectation is download this file on client side. your code should be like :-
```
import { Component } from "@angular/core";
import * as Excel from "exceljs";
@Component({
selector: "my-app",
template... | if you are using angular 8 and below, you need to install excelJs version 1.12.0
see [step by step to use excejs with angular](https://dev.to/ankitprajapati/exporting-data-to-excel-file-in-angular-using-exceljs-k13) |
62,127,452 | I was try to export an excel file using **ExcelJS**
Here is my **console** in VS Code terminal :
```
ERROR in node_modules/exceljs/index.d.ts:1398:22 - error TS2307: Cannot find module 'stream'.
1398 read(stream: import('stream').Stream): Promise<Workbook>;
~~~~~~~~
node_modules/exceljs/in... | 2020/06/01 | [
"https://Stackoverflow.com/questions/62127452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I found a simple way to resolve this!
comment or remove the import `import * as Excel from 'exceljs'`
Now you can import like this:
`import * as Excel from 'exceljs/dist/exceljs.min.js'` | while import the excel : try checking in tsconfig.app.json
where in pre-defined code add "types": ["node"].
```
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": ["node"]
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.t... |
62,127,452 | I was try to export an excel file using **ExcelJS**
Here is my **console** in VS Code terminal :
```
ERROR in node_modules/exceljs/index.d.ts:1398:22 - error TS2307: Cannot find module 'stream'.
1398 read(stream: import('stream').Stream): Promise<Workbook>;
~~~~~~~~
node_modules/exceljs/in... | 2020/06/01 | [
"https://Stackoverflow.com/questions/62127452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | while import the excel : try checking in tsconfig.app.json
where in pre-defined code add "types": ["node"].
```
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": ["node"]
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.t... | if you are using angular 8 and below, you need to install excelJs version 1.12.0
see [step by step to use excejs with angular](https://dev.to/ankitprajapati/exporting-data-to-excel-file-in-angular-using-exceljs-k13) |
62,127,452 | I was try to export an excel file using **ExcelJS**
Here is my **console** in VS Code terminal :
```
ERROR in node_modules/exceljs/index.d.ts:1398:22 - error TS2307: Cannot find module 'stream'.
1398 read(stream: import('stream').Stream): Promise<Workbook>;
~~~~~~~~
node_modules/exceljs/in... | 2020/06/01 | [
"https://Stackoverflow.com/questions/62127452",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I found a simple way to resolve this!
comment or remove the import `import * as Excel from 'exceljs'`
Now you can import like this:
`import * as Excel from 'exceljs/dist/exceljs.min.js'` | if you are using angular 8 and below, you need to install excelJs version 1.12.0
see [step by step to use excejs with angular](https://dev.to/ankitprajapati/exporting-data-to-excel-file-in-angular-using-exceljs-k13) |
3,826 | Which of the major authors or codifiers of *halacha*. . .
a) refer directly to or quote from *kabala* in their legal discussions?
b) employ conclusions based only on *kabala* in their legal argumentation and decisions? | 2010/11/04 | [
"https://judaism.stackexchange.com/questions/3826",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | If I'm not mistaken, the Shulchan Aruch/Beit Yosef's decision to not wear tefillin on Chol HaMoed is one of his only halachic decisions which is *solely* based on kabbala.
The GRA/Gaon MeVilna/Elijah of Vilna was particularly notable for integrating kabbalistic considerations into his rulings. | Two sources:
The Vilna Gaon on Shulchan Aruch Yoreh De'ah Siman 89 Seif Koton 11. Kabbalah can be a reason to be Machmir.
The Mishna Brura Siman 25 Seif Koton 42: Same as a Vilna Gaon. Also, if something is only mentioned in Kabbalah and not in the Poskim, we should act that way but "ein lakof" - we don't compel people... |
3,826 | Which of the major authors or codifiers of *halacha*. . .
a) refer directly to or quote from *kabala* in their legal discussions?
b) employ conclusions based only on *kabala* in their legal argumentation and decisions? | 2010/11/04 | [
"https://judaism.stackexchange.com/questions/3826",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | First as far as being posek al pi Kabbalah the inyan is only L'Humra not L'kula. For instance the Zohar says one needs only to wait a half hour between eating meat and eating milk, but we do not hold that way.
Aside from that the list becomes quite extensive as Chanoch also said, from the Ramban down to today amongst ... | [Reuvein Margolies](http://en.wikipedia.org/wiki/Reuvein_Margolies) wrote a book ([article](http://www.chabad.org/kabbalah/article_cdo/aid/380763/jewish/Other-Claims-and-Responses-Continued.htm)?) called HaRambam V'Hazohar, which apparently (I've never read it) shows places where the Rambam quotes the Zohar (translated... |
3,826 | Which of the major authors or codifiers of *halacha*. . .
a) refer directly to or quote from *kabala* in their legal discussions?
b) employ conclusions based only on *kabala* in their legal argumentation and decisions? | 2010/11/04 | [
"https://judaism.stackexchange.com/questions/3826",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | First as far as being posek al pi Kabbalah the inyan is only L'Humra not L'kula. For instance the Zohar says one needs only to wait a half hour between eating meat and eating milk, but we do not hold that way.
Aside from that the list becomes quite extensive as Chanoch also said, from the Ramban down to today amongst ... | If I'm not mistaken, the Shulchan Aruch/Beit Yosef's decision to not wear tefillin on Chol HaMoed is one of his only halachic decisions which is *solely* based on kabbala.
The GRA/Gaon MeVilna/Elijah of Vilna was particularly notable for integrating kabbalistic considerations into his rulings. |
3,826 | Which of the major authors or codifiers of *halacha*. . .
a) refer directly to or quote from *kabala* in their legal discussions?
b) employ conclusions based only on *kabala* in their legal argumentation and decisions? | 2010/11/04 | [
"https://judaism.stackexchange.com/questions/3826",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | It's a very important part of Sephardic psak. Among the authorities of interest to look at: The Gaon HIDA, R' Chaim Palagi, R' Yaakov Hayyim Sofer (Kaf HaHayyim), R' Yosef Hayyim (the Ben Ish Hai), and to a lesser extent R' Ovadia Yosef.
R' Shneur Zalman of Liadi and other Chassidic poskim also poskin based on on kabb... | The source to wind the hand tefillin 7 times around the arm is based on Kabbalah (Niglah doesn't mention any amount of times one winds it around (See [here](http://hebrewbooks.org/pdfpager.aspx?req=40431&st=&pgnum=52) and [here](http://hebrewbooks.org/pdfpager.aspx?req=14265&st=&pgnum=60))). Yet, the custom is to tie i... |
3,826 | Which of the major authors or codifiers of *halacha*. . .
a) refer directly to or quote from *kabala* in their legal discussions?
b) employ conclusions based only on *kabala* in their legal argumentation and decisions? | 2010/11/04 | [
"https://judaism.stackexchange.com/questions/3826",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | First as far as being posek al pi Kabbalah the inyan is only L'Humra not L'kula. For instance the Zohar says one needs only to wait a half hour between eating meat and eating milk, but we do not hold that way.
Aside from that the list becomes quite extensive as Chanoch also said, from the Ramban down to today amongst ... | It's a very important part of Sephardic psak. Among the authorities of interest to look at: The Gaon HIDA, R' Chaim Palagi, R' Yaakov Hayyim Sofer (Kaf HaHayyim), R' Yosef Hayyim (the Ben Ish Hai), and to a lesser extent R' Ovadia Yosef.
R' Shneur Zalman of Liadi and other Chassidic poskim also poskin based on on kabb... |
3,826 | Which of the major authors or codifiers of *halacha*. . .
a) refer directly to or quote from *kabala* in their legal discussions?
b) employ conclusions based only on *kabala* in their legal argumentation and decisions? | 2010/11/04 | [
"https://judaism.stackexchange.com/questions/3826",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | The Alter Rebbe writes in his [Shulchan Aruch HaRav Orach Chayim 25:28](http://chabadlibrary.org/books/adhaz/sh/sh1/5/25/28) (quoting the [Magen Avraham 25:20](http://hebrewbooks.org/pdfpager.aspx?req=9729&pgnum=121)): That when Kabbalah and Halacha conflict we only hold al pi Kabbalah when it is more stringent. In add... | If I'm not mistaken, the Shulchan Aruch/Beit Yosef's decision to not wear tefillin on Chol HaMoed is one of his only halachic decisions which is *solely* based on kabbala.
The GRA/Gaon MeVilna/Elijah of Vilna was particularly notable for integrating kabbalistic considerations into his rulings. |
3,826 | Which of the major authors or codifiers of *halacha*. . .
a) refer directly to or quote from *kabala* in their legal discussions?
b) employ conclusions based only on *kabala* in their legal argumentation and decisions? | 2010/11/04 | [
"https://judaism.stackexchange.com/questions/3826",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | The Alter Rebbe writes in his [Shulchan Aruch HaRav Orach Chayim 25:28](http://chabadlibrary.org/books/adhaz/sh/sh1/5/25/28) (quoting the [Magen Avraham 25:20](http://hebrewbooks.org/pdfpager.aspx?req=9729&pgnum=121)): That when Kabbalah and Halacha conflict we only hold al pi Kabbalah when it is more stringent. In add... | Two sources:
The Vilna Gaon on Shulchan Aruch Yoreh De'ah Siman 89 Seif Koton 11. Kabbalah can be a reason to be Machmir.
The Mishna Brura Siman 25 Seif Koton 42: Same as a Vilna Gaon. Also, if something is only mentioned in Kabbalah and not in the Poskim, we should act that way but "ein lakof" - we don't compel people... |
3,826 | Which of the major authors or codifiers of *halacha*. . .
a) refer directly to or quote from *kabala* in their legal discussions?
b) employ conclusions based only on *kabala* in their legal argumentation and decisions? | 2010/11/04 | [
"https://judaism.stackexchange.com/questions/3826",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | Regarding a - The Chofetz Chaim in Mishna Berura often mentions the Zohar. See for example [Volume 5 - 479:1:9:12](http://hebrewbooks.org/pdfpager.aspx?req=49627&st=&pgnum=179) and [Volume 3 - 290:1:3](http://hebrewbooks.org/pdfpager.aspx?req=49625&st=&pgnum=133&hilite=).
Regarding b - I do not think anyone employs co... | The source to wind the hand tefillin 7 times around the arm is based on Kabbalah (Niglah doesn't mention any amount of times one winds it around (See [here](http://hebrewbooks.org/pdfpager.aspx?req=40431&st=&pgnum=52) and [here](http://hebrewbooks.org/pdfpager.aspx?req=14265&st=&pgnum=60))). Yet, the custom is to tie i... |
3,826 | Which of the major authors or codifiers of *halacha*. . .
a) refer directly to or quote from *kabala* in their legal discussions?
b) employ conclusions based only on *kabala* in their legal argumentation and decisions? | 2010/11/04 | [
"https://judaism.stackexchange.com/questions/3826",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | It's a very important part of Sephardic psak. Among the authorities of interest to look at: The Gaon HIDA, R' Chaim Palagi, R' Yaakov Hayyim Sofer (Kaf HaHayyim), R' Yosef Hayyim (the Ben Ish Hai), and to a lesser extent R' Ovadia Yosef.
R' Shneur Zalman of Liadi and other Chassidic poskim also poskin based on on kabb... | [Reuvein Margolies](http://en.wikipedia.org/wiki/Reuvein_Margolies) wrote a book ([article](http://www.chabad.org/kabbalah/article_cdo/aid/380763/jewish/Other-Claims-and-Responses-Continued.htm)?) called HaRambam V'Hazohar, which apparently (I've never read it) shows places where the Rambam quotes the Zohar (translated... |
3,826 | Which of the major authors or codifiers of *halacha*. . .
a) refer directly to or quote from *kabala* in their legal discussions?
b) employ conclusions based only on *kabala* in their legal argumentation and decisions? | 2010/11/04 | [
"https://judaism.stackexchange.com/questions/3826",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/3/"
] | The Alter Rebbe writes in his [Shulchan Aruch HaRav Orach Chayim 25:28](http://chabadlibrary.org/books/adhaz/sh/sh1/5/25/28) (quoting the [Magen Avraham 25:20](http://hebrewbooks.org/pdfpager.aspx?req=9729&pgnum=121)): That when Kabbalah and Halacha conflict we only hold al pi Kabbalah when it is more stringent. In add... | The source to wind the hand tefillin 7 times around the arm is based on Kabbalah (Niglah doesn't mention any amount of times one winds it around (See [here](http://hebrewbooks.org/pdfpager.aspx?req=40431&st=&pgnum=52) and [here](http://hebrewbooks.org/pdfpager.aspx?req=14265&st=&pgnum=60))). Yet, the custom is to tie i... |
23,886,092 | The response of a web service is the following :
```
<span style="color:#DDFFEE;">You have to pay you bil before <b>12 june 2012</b> for your informations.</span></br></br> You have already a large time.
```
I want to display this in a TextView.
I can't just simply put the response below in a String and applicate
... | 2014/05/27 | [
"https://Stackoverflow.com/questions/23886092",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I found that I can do it by the following:
```
select * from TABLE_NAME where COLUMN_NAME = $P{PARAMETER_NAME} or $P{PARAMETER_NAME} is NULL
```
if there is better suggestions please provide. | try this : it is specific to oracle, but works for the situation mentioned by you
`SELECT *
FROM TABLE_NAME TM
WHERE (CASE
WHEN $P!{PARAMETER_NAME} IS NULL THEN
'TRUE'
ELSE
(DECODE(TM.COLUMN_NAME, '1001', 'TRUE', 'FALSE'))
END) = 'TRUE';`
Firstly, if the check of '$P!{PARAMETER\_NAME} IS NULL' fails and it moves... |
23,886,092 | The response of a web service is the following :
```
<span style="color:#DDFFEE;">You have to pay you bil before <b>12 june 2012</b> for your informations.</span></br></br> You have already a large time.
```
I want to display this in a TextView.
I can't just simply put the response below in a String and applicate
... | 2014/05/27 | [
"https://Stackoverflow.com/questions/23886092",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I found that I can do it by the following:
```
select * from TABLE_NAME where COLUMN_NAME = $P{PARAMETER_NAME} or $P{PARAMETER_NAME} is NULL
```
if there is better suggestions please provide. | I think using the UNION operator would be enough. For example:
```
select * from TABLE_NAME where COLUMN_NAME = $P!{PARAMETER_NAME} and $P!{PARAMETER_NAME} is not null
union
select * from TABLE_NAME
```
It means,in case the criteria for the first block is not meant (in this case when the parameter in not entered, so... |
34,883 | I have a question about the urlmapping property on a REST class. For the moment I have 3 REST classes with following urlmappings:
1. REST1.cls @RestResource(urlmapping='/invoices/\*/')
2. REST2.cls @RestResource(urlmapping='/invoices/\*/totals/')
3. REST3.cls @RestResource(urlmapping='/invoices/\*/related/')
I have 3... | 2014/05/12 | [
"https://salesforce.stackexchange.com/questions/34883",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/3158/"
] | *EDITED*: It works **sometimes without any problem** (even with the oldest Api 22.0 that supports RestResource) and **sometimes incorrectly**.
That **depends** on the order of classes sorted by the **time of the last modification**.
If you edit the class REST1.cls or generally that with the shortest urlMapping length... | The documentation is not clear but I believe that it will match
urlmapping='/invoices/\*/
over
urlmapping='/invoices/\*/totals/
This is because the wildcard character is not at the end. To fix this issue, you might have to vary your url format for REST2 and 3 to the following.
urlmapping='/invoices/totals/\*
url... |
51,447,903 | I have this code.
```
$value1 = '1';
$value2 = '2';
$value3 = '3';
$field = array ("field1", "field2", "field3");
$value = array ($value1, $value2, $value3);
$list = array ($field, $value);
$fp = fopen ('file.csv', 'w');
foreach ($list as $fields) {
fputcsv ($fp, $fields);
}
fclose ($fp);
```
But the result ... | 2018/07/20 | [
"https://Stackoverflow.com/questions/51447903",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10060533/"
] | I ran the code and the result is exactly what you want.
Which is:
```
field1,field2,field3
1,2,3
```
There is a line break (0x0A) after "field3" and another line break after "3".
IncredibleHat is correct, there is absolutely no comma after "field3".
See the output at <http://codepad.org/k6d0t8nU> | Based on your answers I downloaded other text editor most advanced and I can see the line-break.
For any reason, Notepad is not showing correct. |
43,342,433 | Currently I am testing the yolo 9000 model for object detection and in the Paper I understand that the image is splited in 13X13 boxes and in each boxes we calculate P(Object), but How can we calculate that ? how can the model know if there is an object in this boxe or not, please I need help to understand that
I am u... | 2017/04/11 | [
"https://Stackoverflow.com/questions/43342433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3425890/"
] | They train for the confidence score = P(object) \* IOU. For the ground truth box they take P(object)=1 and for rest of the grid pixels the ground truth P(object) is zero. You are training your network to tell you if some object in that grid location i.e. output 0 if not object, output IOU if partial object and output 1... | As they mentioned in the [paper](https://pjreddie.com/media/files/papers/yolo.pdf)(2nd page section 2) confident score is = P(object) \* IOU. But in that paragraph they have mentioned that if there's an object then confident score will be IOU otherwise zero. So it's just a guide line. |
43,342,433 | Currently I am testing the yolo 9000 model for object detection and in the Paper I understand that the image is splited in 13X13 boxes and in each boxes we calculate P(Object), but How can we calculate that ? how can the model know if there is an object in this boxe or not, please I need help to understand that
I am u... | 2017/04/11 | [
"https://Stackoverflow.com/questions/43342433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3425890/"
] | They train for the confidence score = P(object) \* IOU. For the ground truth box they take P(object)=1 and for rest of the grid pixels the ground truth P(object) is zero. You are training your network to tell you if some object in that grid location i.e. output 0 if not object, output IOU if partial object and output 1... | There are 13x13 grid cells, true, but P(object) is calculated for each of 5x13x13 anchor boxes. From the YOLO9000 paper:
>
> When we move to anchor boxes we also decouple the class prediction mechanism from the spatial location and instead predict class and objectness for every anchor box.
>
>
>
I can't comment y... |
43,342,433 | Currently I am testing the yolo 9000 model for object detection and in the Paper I understand that the image is splited in 13X13 boxes and in each boxes we calculate P(Object), but How can we calculate that ? how can the model know if there is an object in this boxe or not, please I need help to understand that
I am u... | 2017/04/11 | [
"https://Stackoverflow.com/questions/43342433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3425890/"
] | They train for the confidence score = P(object) \* IOU. For the ground truth box they take P(object)=1 and for rest of the grid pixels the ground truth P(object) is zero. You are training your network to tell you if some object in that grid location i.e. output 0 if not object, output IOU if partial object and output 1... | During test time the YOLO network gets the IOU from the default setted value. That is 0.5. |
36,474,691 | In python you can just pass a lambda function as an argument, like the following:
```
class Thing(object):
def __init__(self, a1, a2):
self.attr1 = a1
self.attr2 = a2
class ThingList(object):
def __init__(self):
self.things = [Thing(1,2), Thing(3,4), Thing(1,4)]
def getThingsByCon... | 2016/04/07 | [
"https://Stackoverflow.com/questions/36474691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4198328/"
] | Yes, you can pass lambdas to functions.
You can use templates:
```
template <typename Func>
void foo (Func f) {
f();
}
foo([]{ std::cout << "Hello"; });
```
Or `std::function`:
```
void foo (std::function<void()> f) {
f();
}
foo([]{ std::cout << "Hello"; });
```
If you want to search a `std::vector` fo... | You can design `getThingsByCondition` like
```
using things_vec = std::vector<std::reference_wrapper<Thing>>;
things_vec getThingsByCondition(std::function<bool(const Thing&)> condition);
```
You can call `getThingsByCondition` function using a `lambda` like
```
auto things = getThingsByCondition([](const Thing& ... |
5,142,967 | This is my Groovy code:
```
// ...
def xml = new XmlParser().parse(fileName)
xml.each { e ->
// some changes are being made to XML
xml.append("test", "test me")
}
def writer = new FileWriter(newFileName)
new XmlNodePrinter(new PrintWriter(writer)).print(xml)
```
The code works, but the output XML has a lot of un... | 2011/02/28 | [
"https://Stackoverflow.com/questions/5142967",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/187141/"
] | What happens if you replace:
```
def writer = new FileWriter(newFileName)
new XmlNodePrinter(new PrintWriter(writer)).print(xml)
```
with:
```
new File( newFilename ).withWriter { out ->
printer = new XmlNodePrinter( out )
printer.preserveWhitespace = true
printer.print( xml )
}
```
-- **edit** --
As point... | I ended up with this blurb:
```
new File(myFilename).withWriter {
def printer = new XmlNodePrinter(new PrintWriter(it))
printer.preserveWhitespace = true
printer.print(myXmlNode)
}
``` |
61,161,527 | I am doing some exercises in Go, and I have a strange behavior with my code. If someone could explain me the reason it could be really great.
Here is the code : <https://play.golang.org/p/4fQYHWpD6Cj>
```golang
package main
import (
"fmt"
"sort"
"strconv"
)
func sortList (list []int, c chan []int) {
... | 2020/04/11 | [
"https://Stackoverflow.com/questions/61161527",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7621718/"
] | With lots of effort, I found the solution to change the internal port of tomcat
container
my Dockerfile is
```
FROM tomcat:7.0.107
RUN sed -i 's/port="8080"/port="4287"/' ${CATALINA_HOME}/conf/server.xml
ADD ./tomcat-cas/war/ ${CATALINA_HOME}/webapps/
CMD ["catalina.sh", "run"]
```
Here
`ADD ./tomcat-cas/war/ ${CAT... | Checking the `tomcat:9.0.34` [Dockerfile in Dockerhub](https://hub.docker.com/layers/tomcat/library/tomcat/9.0.34/images/sha256-3a34e9f1cc093d9f2fcf9115c5674cb8a97c657c3c1c070c8721f00d16d0ef4f?context=explore), we can see that it is exposing port `8080`. What happens when you use this image as your parent image, is tha... |
29,056,147 | I'm having a problem with this code:
```
$(function () {
$('#city_input').autocomplete({
onSelect: function (suggestion) {
alert(suggestion.data);
window.latlng = suggestion.data;
}
});
$('#fs_input').autocomplete({
params: { "latlng" : window.latlng, "latln... | 2015/03/15 | [
"https://Stackoverflow.com/questions/29056147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559533/"
] | if I understand well the situation, maybe the problem is that you are replacing the same string,and storing in different var,
try that:
```
public static void main(String[] args) {
System.out.print("Phase: ");
Scanner sp = new Scanner(System.in);
String p;
p = sp.nextLine();
... | Even though I haven't written anything down so I haven't tested it, I think the problem is clearly seen in this part of the code:
```
String phase = oldtext.replaceAll("phase", "" + p);
String database = oldtext.replaceAll("db", "" + d);
String ips = oldtext.replaceAll("IP", "" + ip);
FileWriter... |
29,056,147 | I'm having a problem with this code:
```
$(function () {
$('#city_input').autocomplete({
onSelect: function (suggestion) {
alert(suggestion.data);
window.latlng = suggestion.data;
}
});
$('#fs_input').autocomplete({
params: { "latlng" : window.latlng, "latln... | 2015/03/15 | [
"https://Stackoverflow.com/questions/29056147",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559533/"
] | if I understand well the situation, maybe the problem is that you are replacing the same string,and storing in different var,
try that:
```
public static void main(String[] args) {
System.out.print("Phase: ");
Scanner sp = new Scanner(System.in);
String p;
p = sp.nextLine();
... | Better version of existing answers:
```
public static void main(String[] args)
{
Scanner sp = new Scanner(System.in);
System.out.print("Phase: ");
String pstr = s.nextLine();
System.out.print("Database: ");
String dstr = s.nextLine();
System.out.print("IP address: ");
String ipstr = String.... |
8,628,495 | I'm trying to include data files in distutils for my package and then refer to them using relative paths (following <http://docs.python.org/distutils/setupscript.html#distutils-additional-files>)
My dir structure is:
```
myproject/
mycode.py
data/
file1.dat
```
the code in `mycode.py`, which is actually a s... | 2011/12/25 | [
"https://Stackoverflow.com/questions/8628495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I think the confusion arises from the usage of scripts. Scripts should refer to a runnable executable, perhaps a utility script related to your package or perhaps an entry point into functionality for your package. In either case, you should expect that any scripts will not be installed alongside the rest of your packa... | You should be able to use [pkg\_resources.resource\_filename](http://setuptools.readthedocs.io/en/latest/pkg_resources.html#iresourceprovider) to get the filename of a file in your package\_data. |
8,628,495 | I'm trying to include data files in distutils for my package and then refer to them using relative paths (following <http://docs.python.org/distutils/setupscript.html#distutils-additional-files>)
My dir structure is:
```
myproject/
mycode.py
data/
file1.dat
```
the code in `mycode.py`, which is actually a s... | 2011/12/25 | [
"https://Stackoverflow.com/questions/8628495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I think the confusion arises from the usage of scripts. Scripts should refer to a runnable executable, perhaps a utility script related to your package or perhaps an entry point into functionality for your package. In either case, you should expect that any scripts will not be installed alongside the rest of your packa... | For a solution that'll work nicely inside/outside a `virtualenv` on Windows/Linux import `pip` and `os` then run:
```
os.path.split(os.path.split(pip.__file__)[0])[0]
```
### Full example
```
from setuptools import setup, find_packages
from os import path
from functools import partial
from pip import __file__ as pi... |
8,628,495 | I'm trying to include data files in distutils for my package and then refer to them using relative paths (following <http://docs.python.org/distutils/setupscript.html#distutils-additional-files>)
My dir structure is:
```
myproject/
mycode.py
data/
file1.dat
```
the code in `mycode.py`, which is actually a s... | 2011/12/25 | [
"https://Stackoverflow.com/questions/8628495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You should be able to use [pkg\_resources.resource\_filename](http://setuptools.readthedocs.io/en/latest/pkg_resources.html#iresourceprovider) to get the filename of a file in your package\_data. | For a solution that'll work nicely inside/outside a `virtualenv` on Windows/Linux import `pip` and `os` then run:
```
os.path.split(os.path.split(pip.__file__)[0])[0]
```
### Full example
```
from setuptools import setup, find_packages
from os import path
from functools import partial
from pip import __file__ as pi... |
73,304,836 | Hey All I am new to Laravel.
I have a table called dsp\_account\_fee.
[](https://i.stack.imgur.com/fmSqN.png)
[](https://i.stack.imgur.com/6jeGH.png)
This is what I have in my Model.
... | 2022/08/10 | [
"https://Stackoverflow.com/questions/73304836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8493186/"
] | Set it to true or remove it as Laravel by default set it to true.
```
public $timestamps = true;
``` | I think you need to change `$timestamps` to `true`
```
public $timestamps = true;
``` |
73,304,836 | Hey All I am new to Laravel.
I have a table called dsp\_account\_fee.
[](https://i.stack.imgur.com/fmSqN.png)
[](https://i.stack.imgur.com/6jeGH.png)
This is what I have in my Model.
... | 2022/08/10 | [
"https://Stackoverflow.com/questions/73304836",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8493186/"
] | Set it to true or remove it as Laravel by default set it to true.
```
public $timestamps = true;
``` | **Remove** this from *Model*
```
public $timestamps = false;
``` |
64,261,916 | Good morning all,
I have a little problem if someone can help me it would be too
Here I explain to you:
I have the 3 tables:
1. posts
2. users
3. teams
users can follow the posts with a `follow` button, the goal is to simply follow the post.
But a user can create a group (team), in order to follow the post as a g... | 2020/10/08 | [
"https://Stackoverflow.com/questions/64261916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9645953/"
] | ```
import 'package:flutter/material.dart';
class InvisibleExpandedHeader extends StatefulWidget {
final Widget child;
const InvisibleExpandedHeader({
Key? key,
required this.child,
}) : super(key: key);
@override
_InvisibleExpandedHeaderState createState() {
return _InvisibleExpandedHeaderState(... | You have to set the `pinned` property to false:
```dart
SliverAppBar(
expandedHeight: 250.0,
floating: false,
pinned: false,
title: Text("Coporate News"),
elevation: 8,
flexibleSpace: FlexibleSpaceBar(
centerTitle: true,
... |
41,705 | I have an SDR (RTL2832u) that connects to an antenna and can receive over the air just fine. I'm wondering if the signal of a home cable connection would be too strong to connect to the SDR input or is it safe?
Say for example my home cable modem transmit power is 35dBmv. Downstream power is showing around 10dbmv. Is... | 2012/09/19 | [
"https://electronics.stackexchange.com/questions/41705",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/1033/"
] | 35 dBmV means "35 decibels stronger than 1 mV", or about 10^(35/20) = 56 mV RMS. 56 mV is a pretty small signal, so it's unlikely to damage any input that wouldn't be completely destroyed by the ESD of casual handling.
There is still the possibility (though unlikely) that the input signal may be too strong for the rec... | No, the RTL2832u will not be damaged by the cable signal. After all, that's the application it was originally designed for! You'll probably have to reduce the gain settings in your SDR software to get useful results, though. |
278,618 | I have a lot of rows of data, and I want to use the field calculator to give a uniform assignment of
```
0
1
0
1
0
1
...
```
but I don't know how to implement it.
Can someone help me? | 2018/04/08 | [
"https://gis.stackexchange.com/questions/278618",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/117449/"
] | Use this advanced field calculator expression (Python):
```
i=0
def switch():
global i
i=1-i
return i
*-------
switch()
``` | As @PolyGeo mentioned, the modulo operator helps you determine whether a number is pair or not. You can check the "Show Codeblock" box in the field calculator and then write a simple function that determines wheter the row is pair or not and adds a 0 or a 1 depending on the condition
```
def calc(fid):
if fid % 2 ... |
53,079,886 | I am trying to assign the value of data attributes to the same elements srcset or src
```js
var is_chrome = (typeof window.chrome === 'object' && navigator.appVersion.indexOf('Edge') === -1);
if ($('.image-browsers').length > 0) {
if (is_chrome) {
var a = $('.mobileImages').attr('data-mobileImage'),
... | 2018/10/31 | [
"https://Stackoverflow.com/questions/53079886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10057999/"
] | When you call a function `f3(...)`, you will need to resolve the arguments you need to parse. Hence, `f2(f1)` will be called first.
Now in `f2` you log before returning the callback. Hence log start with `f2`.
---
If you want the output to start with `f3`, you will need to pass reference of function instead of funct... | JavaScript will execute `f3`, but you pass a parameter to `f3`.
So `f2` will execute and print `f2`.
`f2` return callback to `f3` as a parameter, so `f3` execute to print `f3` and execute callback(`f1`).
Finally `f1` execute to print `f1`. |
53,079,886 | I am trying to assign the value of data attributes to the same elements srcset or src
```js
var is_chrome = (typeof window.chrome === 'object' && navigator.appVersion.indexOf('Edge') === -1);
if ($('.image-browsers').length > 0) {
if (is_chrome) {
var a = $('.mobileImages').attr('data-mobileImage'),
... | 2018/10/31 | [
"https://Stackoverflow.com/questions/53079886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10057999/"
] | JavaScript will execute `f3`, but you pass a parameter to `f3`.
So `f2` will execute and print `f2`.
`f2` return callback to `f3` as a parameter, so `f3` execute to print `f3` and execute callback(`f1`).
Finally `f1` execute to print `f1`. | f3(f2(f1))
Before running function f3, first f3 will get the arguments, since the argument is function call(f2(f1)), it has to be executed to continue the execution of the function, that is calling f2(f1):
f1 is just callback not a function call, so it will not be executed
f2 will log('f2') and return f1 as callbac... |
53,079,886 | I am trying to assign the value of data attributes to the same elements srcset or src
```js
var is_chrome = (typeof window.chrome === 'object' && navigator.appVersion.indexOf('Edge') === -1);
if ($('.image-browsers').length > 0) {
if (is_chrome) {
var a = $('.mobileImages').attr('data-mobileImage'),
... | 2018/10/31 | [
"https://Stackoverflow.com/questions/53079886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10057999/"
] | When you call a function `f3(...)`, you will need to resolve the arguments you need to parse. Hence, `f2(f1)` will be called first.
Now in `f2` you log before returning the callback. Hence log start with `f2`.
---
If you want the output to start with `f3`, you will need to pass reference of function instead of funct... | f3(f2(f1))
Before running function f3, first f3 will get the arguments, since the argument is function call(f2(f1)), it has to be executed to continue the execution of the function, that is calling f2(f1):
f1 is just callback not a function call, so it will not be executed
f2 will log('f2') and return f1 as callbac... |
10,476,394 | I want my app to have a settings that can change image when user press a segment in a UISegmented Control, however, I only know to show it in Nav Bar. How will I implement it in a way that there is a specific View for the settings, that when a user press a segment then when done is pressed it will revert to a new view ... | 2012/05/07 | [
"https://Stackoverflow.com/questions/10476394",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Try this lines of code.
```
NSArray *ary=[sgmntControl subviews];
NSInteger intCount=0;
for (id seg in ary)
for (id imageview in [seg subviews])
if ([imageview isKindOfClass:[UIImageView class]])
{
if(intCount==1)
{
[imageview setimage:[UIImage imagenamed:@""];
}
else
{
[imagevie... | You can change the image of segmented control like this
UISegmentedControl \*segment;
```
[segment setImage:UIImage forSegmentAtIndex:segmentIndex];
```
or
```
[segment setBackgroundImage:UIImage forState:ControlState barMetrics:UIBarMetrics];
```
**EDIT:**
You can try this for passing value to newViewControl... |
10,476,394 | I want my app to have a settings that can change image when user press a segment in a UISegmented Control, however, I only know to show it in Nav Bar. How will I implement it in a way that there is a specific View for the settings, that when a user press a segment then when done is pressed it will revert to a new view ... | 2012/05/07 | [
"https://Stackoverflow.com/questions/10476394",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Try this lines of code.
```
NSArray *ary=[sgmntControl subviews];
NSInteger intCount=0;
for (id seg in ary)
for (id imageview in [seg subviews])
if ([imageview isKindOfClass:[UIImageView class]])
{
if(intCount==1)
{
[imageview setimage:[UIImage imagenamed:@""];
}
else
{
[imagevie... | ```
One of the solution is you can add imageView under UISegmented controller with same size , set alpha for UISegmented 0.01 and change the imageview image in UISegmented action method.like below
self.imageViewSegment.image = [UIImage imageNamed:[NSString stringWithFormat:@"segment%d.png",self.segmentedControl.selec... |
57,088,879 | Currently started to learn **MVVM Kotlin**. This youtube tutorial is pretty confusing but direct to the point.
<https://www.youtube.com/watch?v=0LaUXQcGuT0&t=254s>
I have this error in my title.
this code triggers the error in my `MainActivity`
[]... | 2019/07/18 | [
"https://Stackoverflow.com/questions/57088879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10947681/"
] | I had same issue. Problem is in your type `type="com.example.rnd.kotlinmvvmlogin.ViewModel.LoginViewModel"`
Remember in databinding only Viewmodel class name should start with Capital letter and other parent folder of a class should start with lower case. Just rename `ViewModel`with `viewModel`. Clear and Rebuild the p... | The problem is the package name that you're using for your view model classes
Although google call this structural design pattern "MVVM" and everybody want to make "Model", "ViewModel" and "View" packages in their project, but when data-binding library wants to generate the files for you will confront problem with pack... |
57,088,879 | Currently started to learn **MVVM Kotlin**. This youtube tutorial is pretty confusing but direct to the point.
<https://www.youtube.com/watch?v=0LaUXQcGuT0&t=254s>
I have this error in my title.
this code triggers the error in my `MainActivity`
[]... | 2019/07/18 | [
"https://Stackoverflow.com/questions/57088879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10947681/"
] | I had same issue. Problem is in your type `type="com.example.rnd.kotlinmvvmlogin.ViewModel.LoginViewModel"`
Remember in databinding only Viewmodel class name should start with Capital letter and other parent folder of a class should start with lower case. Just rename `ViewModel`with `viewModel`. Clear and Rebuild the p... | Yes it's quite unfortunate, even though it is referred to as a MVVM architecture, you can't have a package named "ViewModel", "ViewModels", "viewModels", or in any case similar to the sort, or else it just won't build, and it gives you a completely misleading error. |
57,088,879 | Currently started to learn **MVVM Kotlin**. This youtube tutorial is pretty confusing but direct to the point.
<https://www.youtube.com/watch?v=0LaUXQcGuT0&t=254s>
I have this error in my title.
this code triggers the error in my `MainActivity`
[]... | 2019/07/18 | [
"https://Stackoverflow.com/questions/57088879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10947681/"
] | Many people experiencing this have their packages named starting with a capital letter. Rename your package names to start with a small case letters such that in your path of reference to view Model class its only the view Model class that starts with a capital letter
i.e `type="com.example.rnd.kotlinmvvmlogin.viewMod... | **UPDATE**
hey, i see you did not include this library
```
implementation 'androidx.core:core-ktx:1.0.2'
```
my dependencies
[](https://i.stack.imgur.com/FIANG.png)
Have you try write code like below
```
activityMainBinding?.viewModel = ViewModel... |
57,088,879 | Currently started to learn **MVVM Kotlin**. This youtube tutorial is pretty confusing but direct to the point.
<https://www.youtube.com/watch?v=0LaUXQcGuT0&t=254s>
I have this error in my title.
this code triggers the error in my `MainActivity`
[]... | 2019/07/18 | [
"https://Stackoverflow.com/questions/57088879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10947681/"
] | I had same issue. Problem is in your type `type="com.example.rnd.kotlinmvvmlogin.ViewModel.LoginViewModel"`
Remember in databinding only Viewmodel class name should start with Capital letter and other parent folder of a class should start with lower case. Just rename `ViewModel`with `viewModel`. Clear and Rebuild the p... | **UPDATE**
hey, i see you did not include this library
```
implementation 'androidx.core:core-ktx:1.0.2'
```
my dependencies
[](https://i.stack.imgur.com/FIANG.png)
Have you try write code like below
```
activityMainBinding?.viewModel = ViewModel... |
57,088,879 | Currently started to learn **MVVM Kotlin**. This youtube tutorial is pretty confusing but direct to the point.
<https://www.youtube.com/watch?v=0LaUXQcGuT0&t=254s>
I have this error in my title.
this code triggers the error in my `MainActivity`
[]... | 2019/07/18 | [
"https://Stackoverflow.com/questions/57088879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10947681/"
] | Many people experiencing this have their packages named starting with a capital letter. Rename your package names to start with a small case letters such that in your path of reference to view Model class its only the view Model class that starts with a capital letter
i.e `type="com.example.rnd.kotlinmvvmlogin.viewMod... | Simply rename the package from `ViewModel` to `viewModel`. The first character just has to be lowercase and it'll work. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.