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
15,516,429
I just want to create a dynamic URL. I am calling the listServices method and it is working as expected where as the getPortNumber which i am calling from listService is not working. I added dubug point in getPortNumber method. I am getting value for domainValue but I am not able to debug after $(document).ready(functi...
2013/03/20
[ "https://Stackoverflow.com/questions/15516429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2189478/" ]
you don't need to call `document.ready` inside a function.....since (i bet) that function is called after document is ready... remove that ``` function getPortNumber() { var portNumber; var domainValue = $("#domain").val(); $.getJSON(port_url, function(result) { $.each(result, function() { ...
After removing $(document).ready(function() from getPortNumber the debug skip code after $.getJSON(port\_url, function(result) {. Firebug is not reporting any errors.
15,516,429
I just want to create a dynamic URL. I am calling the listServices method and it is working as expected where as the getPortNumber which i am calling from listService is not working. I added dubug point in getPortNumber method. I am getting value for domainValue but I am not able to debug after $(document).ready(functi...
2013/03/20
[ "https://Stackoverflow.com/questions/15516429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2189478/" ]
It sounds like you need to learn the art of stepping into callback functions in the javascript debugger. It doesn't quite work the simple way you'd like. It won't step into a callback function even thought the callback function looks like the logical next line of execution. Technically it isn't. When you say to step ov...
If some error exist there then it will skip. Why you used `$(document).ready(function()`
15,516,429
I just want to create a dynamic URL. I am calling the listServices method and it is working as expected where as the getPortNumber which i am calling from listService is not working. I added dubug point in getPortNumber method. I am getting value for domainValue but I am not able to debug after $(document).ready(functi...
2013/03/20
[ "https://Stackoverflow.com/questions/15516429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2189478/" ]
It sounds like you need to learn the art of stepping into callback functions in the javascript debugger. It doesn't quite work the simple way you'd like. It won't step into a callback function even thought the callback function looks like the logical next line of execution. Technically it isn't. When you say to step ov...
After removing $(document).ready(function() from getPortNumber the debug skip code after $.getJSON(port\_url, function(result) {. Firebug is not reporting any errors.
54,740,667
I have a "source.fasta" file that contains information in the following format: ``` >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAA...
2019/02/18
[ "https://Stackoverflow.com/questions/54740667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296702/" ]
Only with GNU grep and sed: ``` grep -A 1 -w -F -f ids.txt source.fasta | sed 's/ .*//' ``` --- See: `man grep`
First group all id's as one expression separated by | like this ``` cat ids.txt | tr '\n' '|' | awk "{print "\"" $0 "\""}' ``` Remove the last | symbol from the expression. Now you can grep using the output you got from previous command like this ``` egrep -E ">TRINITY_DN14840_c10_g1_i1|>TRINITY_DN8506_c0_g1_i1|>T...
54,740,667
I have a "source.fasta" file that contains information in the following format: ``` >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAA...
2019/02/18
[ "https://Stackoverflow.com/questions/54740667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296702/" ]
Repeatedly looping over a large file is inefficient; you really want to avoid running `grep` (or `sed` or `awk`) more than once if you can avoid it. Generally speaking, `sed` and Awk will often easily allow you to specify actions for individual lines in a file, and then you run the script on the file just once. For th...
Only with GNU grep and sed: ``` grep -A 1 -w -F -f ids.txt source.fasta | sed 's/ .*//' ``` --- See: `man grep`
54,740,667
I have a "source.fasta" file that contains information in the following format: ``` >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAA...
2019/02/18
[ "https://Stackoverflow.com/questions/54740667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296702/" ]
the best way to do this is using either python or perl. I was able to make a script for extracting the ids using python as follows. ``` #script to extract sequences from a source file based on ids in another file #the source is a fasta file with a header and a sequence that follows in one line #the ids file contains o...
This might work for you (GNU sed): ``` sed 's#.*#/^&/{s/ .*//;N;p}#' idFile | sed -nf - fastafile ``` Convert the idFile into a sed script and run it against the fastaFile.
54,740,667
I have a "source.fasta" file that contains information in the following format: ``` >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAA...
2019/02/18
[ "https://Stackoverflow.com/questions/54740667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296702/" ]
Repeatedly looping over a large file is inefficient; you really want to avoid running `grep` (or `sed` or `awk`) more than once if you can avoid it. Generally speaking, `sed` and Awk will often easily allow you to specify actions for individual lines in a file, and then you run the script on the file just once. For th...
This might work for you (GNU sed): ``` sed 's#.*#/^&/{s/ .*//;N;p}#' idFile | sed -nf - fastafile ``` Convert the idFile into a sed script and run it against the fastaFile.
54,740,667
I have a "source.fasta" file that contains information in the following format: ``` >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAA...
2019/02/18
[ "https://Stackoverflow.com/questions/54740667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296702/" ]
Repeatedly looping over a large file is inefficient; you really want to avoid running `grep` (or `sed` or `awk`) more than once if you can avoid it. Generally speaking, `sed` and Awk will often easily allow you to specify actions for individual lines in a file, and then you run the script on the file just once. For th...
First group all id's as one expression separated by | like this ``` cat ids.txt | tr '\n' '|' | awk "{print "\"" $0 "\""}' ``` Remove the last | symbol from the expression. Now you can grep using the output you got from previous command like this ``` egrep -E ">TRINITY_DN14840_c10_g1_i1|>TRINITY_DN8506_c0_g1_i1|>T...
54,740,667
I have a "source.fasta" file that contains information in the following format: ``` >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAA...
2019/02/18
[ "https://Stackoverflow.com/questions/54740667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296702/" ]
Only with GNU grep and sed: ``` grep -A 1 -w -F -f ids.txt source.fasta | sed 's/ .*//' ``` --- See: `man grep`
This might work for you (GNU sed): ``` sed 's#.*#/^&/{s/ .*//;N;p}#' idFile | sed -nf - fastafile ``` Convert the idFile into a sed script and run it against the fastaFile.
54,740,667
I have a "source.fasta" file that contains information in the following format: ``` >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAA...
2019/02/18
[ "https://Stackoverflow.com/questions/54740667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296702/" ]
Repeatedly looping over a large file is inefficient; you really want to avoid running `grep` (or `sed` or `awk`) more than once if you can avoid it. Generally speaking, `sed` and Awk will often easily allow you to specify actions for individual lines in a file, and then you run the script on the file just once. For th...
``` $ awk 'NR==FNR{a[$1];next} $1 in a{c=2} c&&c--' ids.txt source.fasta >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAAAGTCATCAGGTT...
54,740,667
I have a "source.fasta" file that contains information in the following format: ``` >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAA...
2019/02/18
[ "https://Stackoverflow.com/questions/54740667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296702/" ]
the best way to do this is using either python or perl. I was able to make a script for extracting the ids using python as follows. ``` #script to extract sequences from a source file based on ids in another file #the source is a fasta file with a header and a sequence that follows in one line #the ids file contains o...
First group all id's as one expression separated by | like this ``` cat ids.txt | tr '\n' '|' | awk "{print "\"" $0 "\""}' ``` Remove the last | symbol from the expression. Now you can grep using the output you got from previous command like this ``` egrep -E ">TRINITY_DN14840_c10_g1_i1|>TRINITY_DN8506_c0_g1_i1|>T...
54,740,667
I have a "source.fasta" file that contains information in the following format: ``` >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAA...
2019/02/18
[ "https://Stackoverflow.com/questions/54740667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296702/" ]
Repeatedly looping over a large file is inefficient; you really want to avoid running `grep` (or `sed` or `awk`) more than once if you can avoid it. Generally speaking, `sed` and Awk will often easily allow you to specify actions for individual lines in a file, and then you run the script on the file just once. For th...
the best way to do this is using either python or perl. I was able to make a script for extracting the ids using python as follows. ``` #script to extract sequences from a source file based on ids in another file #the source is a fasta file with a header and a sequence that follows in one line #the ids file contains o...
54,740,667
I have a "source.fasta" file that contains information in the following format: ``` >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAA...
2019/02/18
[ "https://Stackoverflow.com/questions/54740667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296702/" ]
``` $ awk 'NR==FNR{a[$1];next} $1 in a{c=2} c&&c--' ids.txt source.fasta >TRINITY_DN80_c0_g1_i1 len=723 path=[700:0-350 1417:351-368 1045:369-722] [-1, 700, 1417, 1045, -2] CGTGGATAACACATAAGTCACTGTAATTTAAAAACTGTAGGACTTAGATCTCCTTTCTATATTTTTCTGATAACATATGGAACCCTGCCGATCATCCGATTTGTAATATACTTAACTGCTGGATAACTAGCCAAAAGTCATCAGGTT...
This might work for you (GNU sed): ``` sed 's#.*#/^&/{s/ .*//;N;p}#' idFile | sed -nf - fastafile ``` Convert the idFile into a sed script and run it against the fastaFile.
47,717,708
I have 3 tables STUDENT, SUBJECT and GRADE. STUDENT ``` +------------+------------+------------+ | student_id | first_name | last_name | +------------+------------+------------+ | 0 | Arthur | Pain | | 1 | Richard | Gordon | | 2 | Jennifer | Adelaide | +------------+--...
2017/12/08
[ "https://Stackoverflow.com/questions/47717708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7671013/" ]
The errors are right there. You don't have enough space on your host; and the `entrypoint.sh` file is being denied. Ensure your host has enough disk space (Shell in and `df -h` to check and expand the volume or just bring up a new instance with more space) and for the `entrypoint.sh` ensure that when building your im...
If it's too many tasks running and they have consumed the space then you will need to shell in to the host and do the following. Don't use `-f` on the `docker rm` as that will remove the running ECS agent container ``` docker rm $(docker ps -aq) ```
47,717,708
I have 3 tables STUDENT, SUBJECT and GRADE. STUDENT ``` +------------+------------+------------+ | student_id | first_name | last_name | +------------+------------+------------+ | 0 | Arthur | Pain | | 1 | Richard | Gordon | | 2 | Jennifer | Adelaide | +------------+--...
2017/12/08
[ "https://Stackoverflow.com/questions/47717708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7671013/" ]
The errors are right there. You don't have enough space on your host; and the `entrypoint.sh` file is being denied. Ensure your host has enough disk space (Shell in and `df -h` to check and expand the volume or just bring up a new instance with more space) and for the `entrypoint.sh` ensure that when building your im...
Do docker ps -a Which results in all the stopped containers which are excited, these also consumes disk space.use below command to remove those zoombie docker rm $(docker ps -a | grep Exited | awk '{print $1}') And also remove older images or unused images these takes more DiskStation size than containers docker r...
47,717,708
I have 3 tables STUDENT, SUBJECT and GRADE. STUDENT ``` +------------+------------+------------+ | student_id | first_name | last_name | +------------+------------+------------+ | 0 | Arthur | Pain | | 1 | Richard | Gordon | | 2 | Jennifer | Adelaide | +------------+--...
2017/12/08
[ "https://Stackoverflow.com/questions/47717708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7671013/" ]
The errors are right there. You don't have enough space on your host; and the `entrypoint.sh` file is being denied. Ensure your host has enough disk space (Shell in and `df -h` to check and expand the volume or just bring up a new instance with more space) and for the `entrypoint.sh` ensure that when building your im...
I realize this answer isn't 100% relevant to the question asked, but some googling brought me here due to the title and I figure my solution might help someone later down the line. I also had this issue, but the reason why my containers kept restarting wasn't a lack of space or other resources, it was because I had en...
47,717,708
I have 3 tables STUDENT, SUBJECT and GRADE. STUDENT ``` +------------+------------+------------+ | student_id | first_name | last_name | +------------+------------+------------+ | 0 | Arthur | Pain | | 1 | Richard | Gordon | | 2 | Jennifer | Adelaide | +------------+--...
2017/12/08
[ "https://Stackoverflow.com/questions/47717708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7671013/" ]
I realize this answer isn't 100% relevant to the question asked, but some googling brought me here due to the title and I figure my solution might help someone later down the line. I also had this issue, but the reason why my containers kept restarting wasn't a lack of space or other resources, it was because I had en...
If it's too many tasks running and they have consumed the space then you will need to shell in to the host and do the following. Don't use `-f` on the `docker rm` as that will remove the running ECS agent container ``` docker rm $(docker ps -aq) ```
47,717,708
I have 3 tables STUDENT, SUBJECT and GRADE. STUDENT ``` +------------+------------+------------+ | student_id | first_name | last_name | +------------+------------+------------+ | 0 | Arthur | Pain | | 1 | Richard | Gordon | | 2 | Jennifer | Adelaide | +------------+--...
2017/12/08
[ "https://Stackoverflow.com/questions/47717708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7671013/" ]
I realize this answer isn't 100% relevant to the question asked, but some googling brought me here due to the title and I figure my solution might help someone later down the line. I also had this issue, but the reason why my containers kept restarting wasn't a lack of space or other resources, it was because I had en...
Do docker ps -a Which results in all the stopped containers which are excited, these also consumes disk space.use below command to remove those zoombie docker rm $(docker ps -a | grep Exited | awk '{print $1}') And also remove older images or unused images these takes more DiskStation size than containers docker r...
6,806,037
Is it possible that I can view the line number and file name (for my program running with ltrace/strace) along with the library call/system call information. Eg: ``` code section :: ptr = malloc(sizeof(int)*5); (file:code.c, line:21) ``` ltrace or any other tool: `malloc(20) :: code.c::21` I have tried all the op...
2011/07/24
[ "https://Stackoverflow.com/questions/6806037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/720094/" ]
You may be able to use the `-i` option (to output the instruction pointer at the time of the call) in `strace` and `ltrace`, combined with `addr2line` to resolve the calls to lines of code.
No It's not possible. Why don't you use gdb for this purpose? When you are compiling application with gcc use -ggdb flags to get debugger info into your program and then run your program with gdb or equivalent frontend (ddd or similar) Here is quick gdb manual to help you out a bit. <http://www.cs.cmu.edu/~gilpin/tut...
6,806,037
Is it possible that I can view the line number and file name (for my program running with ltrace/strace) along with the library call/system call information. Eg: ``` code section :: ptr = malloc(sizeof(int)*5); (file:code.c, line:21) ``` ltrace or any other tool: `malloc(20) :: code.c::21` I have tried all the op...
2011/07/24
[ "https://Stackoverflow.com/questions/6806037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/720094/" ]
No It's not possible. Why don't you use gdb for this purpose? When you are compiling application with gcc use -ggdb flags to get debugger info into your program and then run your program with gdb or equivalent frontend (ddd or similar) Here is quick gdb manual to help you out a bit. <http://www.cs.cmu.edu/~gilpin/tut...
You can use strace-plus that can collects stack traces associated with each system call. <http://code.google.com/p/strace-plus/>
6,806,037
Is it possible that I can view the line number and file name (for my program running with ltrace/strace) along with the library call/system call information. Eg: ``` code section :: ptr = malloc(sizeof(int)*5); (file:code.c, line:21) ``` ltrace or any other tool: `malloc(20) :: code.c::21` I have tried all the op...
2011/07/24
[ "https://Stackoverflow.com/questions/6806037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/720094/" ]
No It's not possible. Why don't you use gdb for this purpose? When you are compiling application with gcc use -ggdb flags to get debugger info into your program and then run your program with gdb or equivalent frontend (ddd or similar) Here is quick gdb manual to help you out a bit. <http://www.cs.cmu.edu/~gilpin/tut...
Pretty old question, but I found a way to accomplish what OP wanted: First use strace with `-k` option, which will generate a stack trace like this: ``` openat(AT_FDCWD, NULL, O_RDONLY) = -1 EFAULT (Bad address) > /usr/lib/libc-2.33.so(__open64+0x5b) [0xefeab] > /usr/lib/libc-2.33.so(_IO_file_open+0x26) [0x8...
6,806,037
Is it possible that I can view the line number and file name (for my program running with ltrace/strace) along with the library call/system call information. Eg: ``` code section :: ptr = malloc(sizeof(int)*5); (file:code.c, line:21) ``` ltrace or any other tool: `malloc(20) :: code.c::21` I have tried all the op...
2011/07/24
[ "https://Stackoverflow.com/questions/6806037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/720094/" ]
You may be able to use the `-i` option (to output the instruction pointer at the time of the call) in `strace` and `ltrace`, combined with `addr2line` to resolve the calls to lines of code.
You can use strace-plus that can collects stack traces associated with each system call. <http://code.google.com/p/strace-plus/>
6,806,037
Is it possible that I can view the line number and file name (for my program running with ltrace/strace) along with the library call/system call information. Eg: ``` code section :: ptr = malloc(sizeof(int)*5); (file:code.c, line:21) ``` ltrace or any other tool: `malloc(20) :: code.c::21` I have tried all the op...
2011/07/24
[ "https://Stackoverflow.com/questions/6806037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/720094/" ]
You may be able to use the `-i` option (to output the instruction pointer at the time of the call) in `strace` and `ltrace`, combined with `addr2line` to resolve the calls to lines of code.
Pretty old question, but I found a way to accomplish what OP wanted: First use strace with `-k` option, which will generate a stack trace like this: ``` openat(AT_FDCWD, NULL, O_RDONLY) = -1 EFAULT (Bad address) > /usr/lib/libc-2.33.so(__open64+0x5b) [0xefeab] > /usr/lib/libc-2.33.so(_IO_file_open+0x26) [0x8...
36,368,711
I am keep on getting the following error when I build, > > use of undeclared identifier 'make\_unique' > m\_planet = make\_unique(); > > > My Header File which gives out the error, ``` #include "planet.h" #include <memory> using namespace std; class PlanetBuilder { public: PlanetBuilder(); virtual ~...
2016/04/02
[ "https://Stackoverflow.com/questions/36368711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5077684/" ]
make\_unique requires `#include <memory>` But since you have done that, I would think you are not using C++14 or above. Try adding following flag on your make file. ``` -std=c++14 ```
For current QT which is 5.7 I'm using a #include . By following a link bellow you find out more. [QScopedPointer link](http://doc.qt.io/qt-5/qscopedpointer.html)
7,322,878
I,m creating a quiz to Android, and my questions and answers are stored in the SQLite DB. Now I realized that maybe users can browse the db and see all questions and answers from the device if they have the apropriate tools, am I right? How can I prevent them from users from seeing my data? Is it possible to use a pass...
2011/09/06
[ "https://Stackoverflow.com/questions/7322878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/931090/" ]
Consider using the [`javax.crypto`](http://developer.android.com/reference/javax/crypto/package-summary.html) api. Store your answers in the database as encrypted strings, and then use the encryption key in your app's code to decrypt the data after it's read from the database. Remember that a determined user *will* fi...
Yes, it's definitely possible! You can [encode and decode the data with a key](http://practicalcryptography.com/ciphers/caesar-cipher/). At least, it will be not directly readable. Each time you write data in your DB, you encode it. Each time you read it, you decode it.
10,251,328
I have a task scheduled as such: ``` <task:scheduler id="notification.scheduler" pool-size="15" /> <task:scheduled-tasks scheduler="notification.scheduler"> <task:scheduled ref="notificationProcessor" method="sendNextQueueEvent" fixed-rate="500" /> <task:scheduled ref="notificationProcessor" method="deleteNex...
2012/04/20
[ "https://Stackoverflow.com/questions/10251328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/366447/" ]
First of all `<task:scheduler/>` is a wrapper around `ScheduledThreadPoolExecutor` extending `ThreadPoolExecutor`. JavaDoc for the latter says: > > even core threads are initially created and started only when new tasks arrive > > > Secondly you must understand that scheduled tasks (this is a Java feature, not Sp...
Spring's [`task:scheduler`](http://static.springsource.org/spring/docs/3.0.5.RELEASE/reference/scheduling.html#threadPoolTaskExecutor) is by default a bean properties wrapper for [`java.util.concurrent.ThreadPoolExecutor`](http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html): > > cor...
51,871,706
I have an automation project and it's working fine with java-client 5.0.4, while updating it to java-client: 6.1.0 in `pom.xml` file, then it's showing below error on IDE `java.lang.NoClassDefFoundError: org/openqa/selenium/remote/internal/OkHttpClient$Factory` above error showing within a second, seems like no inter...
2018/08/16
[ "https://Stackoverflow.com/questions/51871706", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6333173/" ]
You can use pattern: ``` [!,.:;-](?= |$) ``` To match any characters `!`,`,`,`.`,`:`,`;` and `-` that are followed by whitespace or end of string. --- In Python: ``` import re text = "Hi! We are looking for smart, young and hard-working c++ developer. Our perfect candidate should know: - c++, c#, .NET in expert l...
My solution ``` def clean(s: str, keep=None, remove=None): """ delete punctuation from "s" except special words """ if keep is None: keep = [] if remove is None: remove = [] protected = [False for _ in s] # True if you keep # compute protected chars for w in keep: # for eve...
3,019
The thing I dislike most about MPI is dealing with datatypes (i.e. data maps/masks) because they don't fit that nicely with object oriented C++. `boost::mpi` only supports MPI 1.1, however, from their website: > > boost::mpi is a C++ friendly interface to the standard Message Passing Interface… Boost.MPI can build MP...
2012/08/08
[ "https://scicomp.stackexchange.com/questions/3019", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/1831/" ]
I have always thought that we should use it in our own project, deal.II, because it is higher level than pure MPI and can save a few lines of code here and there. That said, what I learned over the years is that most high-level code doesn't actually have that much MPI code to begin with -- the 600,000 lines of code in ...
As far as I know, `boost::mpi` is just a `c++` wrapper around the `C` API. As such, you should be able to use `boost::mpi` and switch to the `C` API whenever some functionality is not implemented. Indeed, from their webpage: > > The thin abstractions in Boost.MPI allow one to easily combine it with calls to the under...
8,770,425
I am retrieving data from database depending upon the texboxes input and storing in a datatable , after then from datatable im sending data into dynamic table and displaying table in a panel,in the table all the data of the first column are of linkbuttons, i wrote event handler for dynamic link buttons , but the event ...
2012/01/07
[ "https://Stackoverflow.com/questions/8770425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1135997/" ]
You must have to use `Page_Init` or `Page_Load` event handler to write code that create controls dynamically. Please read MSDN pages on [How to add controls dynamically](http://msdn.microsoft.com/en-us/library/kyt0fzt1.aspx) and ASP.NET Page life cycle articles.
You can add event handlers to the `Page_Load` event but the important think to remember is that they must be added on every page load. It is common to do setup type tasks such as this in a !`Page.IsPostBack` clause. When wiring up event handlers that's not the case otherwise they will seem to disappear ``` if(!Page.Po...
61,248,748
I'm pretty new to java streams and am trying to determine how to find the max from each list, in a list of lists, and end with a single list that contains the max from each sublist. I can accomplish this by using a `for` loop and `stream` like so: ``` // databaseRecordsLists is a List<List<DatabaseRecord>> List<Data...
2020/04/16
[ "https://Stackoverflow.com/questions/61248748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4954435/" ]
You don't need `flatMap`. Create a `Stream<List<DatabaseRecord>>`, and map each `List<DatabaseRecord>` of the `Stream` to the max element. Then collect all the max elements into the output `List`. ``` List<DatabaseRecord> mostRecentRecords = databaseRecordsLists.stream() .map(list -> list.s...
Based on the comments, I suggested to rather ignore the empty collection, otherwise, no result would be returned and `NoSuchElementException` thrown even the empty collection *might* (?) be a valid state. If so, you can improve the current solution: ``` databaseRecordsLists.stream() .filter(list -> !list.isEmpty()...
2,658,106
``` int arr[ 5 ] = { 0 }; int i = 8; // out of bounds arr[ i ] = 8; ``` I know that I can just check i like this if( i < 0 || i > 5 ) .... I also know about SEH in Visual Studio, but it looks like not working solution. ``` __try { /* code */ } __except(GetExceptionCode() == EXCEPTION_ARRAY_BOUNDS_EXCEEDED) ```...
2010/04/17
[ "https://Stackoverflow.com/questions/2658106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181797/" ]
There is no guarantee that SEH will catch this - it depends on your hardware detecting the access , which does not happen for all invalid array accesses. If you want to be sure of catching it, use the standard C++ `std::vector` container instead of an array, and access it via its `at()` member function, rather than the...
Use proper containers like std::vector and catch the exceptions?
2,658,106
``` int arr[ 5 ] = { 0 }; int i = 8; // out of bounds arr[ i ] = 8; ``` I know that I can just check i like this if( i < 0 || i > 5 ) .... I also know about SEH in Visual Studio, but it looks like not working solution. ``` __try { /* code */ } __except(GetExceptionCode() == EXCEPTION_ARRAY_BOUNDS_EXCEEDED) ```...
2010/04/17
[ "https://Stackoverflow.com/questions/2658106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181797/" ]
You cannot protect yourself from this. If you want, you have to use another language that checks for you. C and C++ demand that you check yourself that you write safe code. An alternative may be to wrap the array into a struct... ``` template<typename E, std::size_t s> struct array { E &operator[](std::ptrdiff_t i...
Use proper containers like std::vector and catch the exceptions?
2,658,106
``` int arr[ 5 ] = { 0 }; int i = 8; // out of bounds arr[ i ] = 8; ``` I know that I can just check i like this if( i < 0 || i > 5 ) .... I also know about SEH in Visual Studio, but it looks like not working solution. ``` __try { /* code */ } __except(GetExceptionCode() == EXCEPTION_ARRAY_BOUNDS_EXCEEDED) ```...
2010/04/17
[ "https://Stackoverflow.com/questions/2658106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181797/" ]
Use proper containers like std::vector and catch the exceptions?
You have a couple of options: * don't use raw arrays (use std::vector or boost::array instead) * don't use C++ the only other option is to write code that **does not contain any out-of-bounds errors** There is absolutely no way to reliably detect out-of-bounds errors on raw arrays in C++. You could just catch the a...
2,658,106
``` int arr[ 5 ] = { 0 }; int i = 8; // out of bounds arr[ i ] = 8; ``` I know that I can just check i like this if( i < 0 || i > 5 ) .... I also know about SEH in Visual Studio, but it looks like not working solution. ``` __try { /* code */ } __except(GetExceptionCode() == EXCEPTION_ARRAY_BOUNDS_EXCEEDED) ```...
2010/04/17
[ "https://Stackoverflow.com/questions/2658106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181797/" ]
There is no guarantee that SEH will catch this - it depends on your hardware detecting the access , which does not happen for all invalid array accesses. If you want to be sure of catching it, use the standard C++ `std::vector` container instead of an array, and access it via its `at()` member function, rather than the...
You cannot protect yourself from this. If you want, you have to use another language that checks for you. C and C++ demand that you check yourself that you write safe code. An alternative may be to wrap the array into a struct... ``` template<typename E, std::size_t s> struct array { E &operator[](std::ptrdiff_t i...
2,658,106
``` int arr[ 5 ] = { 0 }; int i = 8; // out of bounds arr[ i ] = 8; ``` I know that I can just check i like this if( i < 0 || i > 5 ) .... I also know about SEH in Visual Studio, but it looks like not working solution. ``` __try { /* code */ } __except(GetExceptionCode() == EXCEPTION_ARRAY_BOUNDS_EXCEEDED) ```...
2010/04/17
[ "https://Stackoverflow.com/questions/2658106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181797/" ]
There is no guarantee that SEH will catch this - it depends on your hardware detecting the access , which does not happen for all invalid array accesses. If you want to be sure of catching it, use the standard C++ `std::vector` container instead of an array, and access it via its `at()` member function, rather than the...
You have a couple of options: * don't use raw arrays (use std::vector or boost::array instead) * don't use C++ the only other option is to write code that **does not contain any out-of-bounds errors** There is absolutely no way to reliably detect out-of-bounds errors on raw arrays in C++. You could just catch the a...
2,658,106
``` int arr[ 5 ] = { 0 }; int i = 8; // out of bounds arr[ i ] = 8; ``` I know that I can just check i like this if( i < 0 || i > 5 ) .... I also know about SEH in Visual Studio, but it looks like not working solution. ``` __try { /* code */ } __except(GetExceptionCode() == EXCEPTION_ARRAY_BOUNDS_EXCEEDED) ```...
2010/04/17
[ "https://Stackoverflow.com/questions/2658106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181797/" ]
You cannot protect yourself from this. If you want, you have to use another language that checks for you. C and C++ demand that you check yourself that you write safe code. An alternative may be to wrap the array into a struct... ``` template<typename E, std::size_t s> struct array { E &operator[](std::ptrdiff_t i...
You have a couple of options: * don't use raw arrays (use std::vector or boost::array instead) * don't use C++ the only other option is to write code that **does not contain any out-of-bounds errors** There is absolutely no way to reliably detect out-of-bounds errors on raw arrays in C++. You could just catch the a...
23,711,272
How Do I achieve this result ? What I need is calculate total cost of a Product when a product is made up of components. New for me, I should add a 100$ to total cost if customer chooses for a service called Delivery. This is what I have tried so far. ``` Select Sum(Component.Cost*ProductComponent.Quantity) as TotCos...
2014/05/17
[ "https://Stackoverflow.com/questions/23711272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2380004/" ]
The problem is that you've got a `Content-Length` header claiming that you're going to send the server `5142` bytes in the `POST` body but you're not sending any body content at all. As a consequence, the server hangs waiting for the body; it will probably fail with a time out in a few minutes. To fix this, ensure tha...
Please try `print(res.status)` Otherwise what I'm using is: <http://docs.python-requests.org/en/latest/>
33,325,383
Guys when I attended a C quiz online, I came across a statement `while(s++,6);` where *s* is initialized to zero. I don't know what the *while* loop will exactly do when there is a comma operator in between. When I ran it on my gcc compiler it ran with no output. But when I changed the *while* condition as `while(1,s++...
2015/10/25
[ "https://Stackoverflow.com/questions/33325383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5484867/" ]
The comma operator evaluates the left side and then throws away the result. The while condition keeps looping for any value other than zero. The first will be an infinite loop; the second will increment s and then stop. I suspect in this case the comma was a typo and they meant to type a less-than.
From C11 standard §6.5.17: > > The left operand of a comma operator is evaluated as a void expression; there is a sequence point between its evaluation and that of the right operand. Then the right operand is evaluated; the result has its type and value. > > > This means that `1,s++` evaluates `1` (so nothing hap...
36,329,164
While working on a program, I made some of my fields static i.e. a `JTextField` for a `E-Number`. But now this field behaves not as expected, on some of my pages it appears, on some others it disappears. Since I am not very experienced working with a lot of statics, there might be a concept I am not understanding. I ...
2016/03/31
[ "https://Stackoverflow.com/questions/36329164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368690/" ]
Probably because when you create your "pages" with this code ``` OverviewPage overviewPage = new OverviewPage(); TrackingPage trackingPage = new TrackingPage(); ``` the `TrackingPage` will be the last one to execute the following line ``` mainWorkNumberPanel.add(txtWorkNumber); ``` in `private void createEquipm...
Here you instantiate a `OverviewPage`, then a `TrackingPage` . ``` OverviewPage overviewPage = new OverviewPage(); TrackingPage trackingPage = new TrackingPage(); ``` Both of these classes instantiate a `WorkNumberPanel` . `WorkNumberPanel` add the static `JTextField` (txtWorkNumber) to their display panel (*mainWo...
36,329,164
While working on a program, I made some of my fields static i.e. a `JTextField` for a `E-Number`. But now this field behaves not as expected, on some of my pages it appears, on some others it disappears. Since I am not very experienced working with a lot of statics, there might be a concept I am not understanding. I ...
2016/03/31
[ "https://Stackoverflow.com/questions/36329164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368690/" ]
Probably because when you create your "pages" with this code ``` OverviewPage overviewPage = new OverviewPage(); TrackingPage trackingPage = new TrackingPage(); ``` the `TrackingPage` will be the last one to execute the following line ``` mainWorkNumberPanel.add(txtWorkNumber); ``` in `private void createEquipm...
First off you need to understand what a static field is. A static field is not related to a particular instance of an object. The field is related to the class itself. There's quite a good explanation [here](https://stackoverflow.com/questions/797964/what-is-the-exact-meaning-of-static-fields-in-java) and [here](htt...
36,329,164
While working on a program, I made some of my fields static i.e. a `JTextField` for a `E-Number`. But now this field behaves not as expected, on some of my pages it appears, on some others it disappears. Since I am not very experienced working with a lot of statics, there might be a concept I am not understanding. I ...
2016/03/31
[ "https://Stackoverflow.com/questions/36329164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368690/" ]
Here you instantiate a `OverviewPage`, then a `TrackingPage` . ``` OverviewPage overviewPage = new OverviewPage(); TrackingPage trackingPage = new TrackingPage(); ``` Both of these classes instantiate a `WorkNumberPanel` . `WorkNumberPanel` add the static `JTextField` (txtWorkNumber) to their display panel (*mainWo...
First off you need to understand what a static field is. A static field is not related to a particular instance of an object. The field is related to the class itself. There's quite a good explanation [here](https://stackoverflow.com/questions/797964/what-is-the-exact-meaning-of-static-fields-in-java) and [here](htt...
65,143,408
I have an Arraylist with the values: was - 2 it - 2 the - 2 times - 2 of - 2 best - 1 worst - 1 This list has just been sorted by the count value at the end of the string(using selection sort), but now I want to sort the words that have the same count alphabetically and I have no idea how to do ...
2020/12/04
[ "https://Stackoverflow.com/questions/65143408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Overview -------- For sorting there are always two approaches: 1. Make the class `Comparable` 2. Use a `Comparator` I'll assume your values are some sort of class like ``` public class Entry { private final String text; private final int count; // getters, constructor, toString, ... } ``` --- Compar...
``` 1:- With Use Comparator Collections.sort(creatorIdList, (Object o1,Object o2)->{ //return 0; }); ```
65,143,408
I have an Arraylist with the values: was - 2 it - 2 the - 2 times - 2 of - 2 best - 1 worst - 1 This list has just been sorted by the count value at the end of the string(using selection sort), but now I want to sort the words that have the same count alphabetically and I have no idea how to do ...
2020/12/04
[ "https://Stackoverflow.com/questions/65143408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Split the strings on `\s+-\s+` which means one or more whitespace characters (i.e. `\s+`) followed by `-` which in turn is followed by one or more whitespace characters. Perform the first level of comparison for the descending order of the numeric (second) parts and then perform the second level of comparison for the ...
``` 1:- With Use Comparator Collections.sort(creatorIdList, (Object o1,Object o2)->{ //return 0; }); ```
65,143,408
I have an Arraylist with the values: was - 2 it - 2 the - 2 times - 2 of - 2 best - 1 worst - 1 This list has just been sorted by the count value at the end of the string(using selection sort), but now I want to sort the words that have the same count alphabetically and I have no idea how to do ...
2020/12/04
[ "https://Stackoverflow.com/questions/65143408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Split the strings on `\s+-\s+` which means one or more whitespace characters (i.e. `\s+`) followed by `-` which in turn is followed by one or more whitespace characters. Perform the first level of comparison for the descending order of the numeric (second) parts and then perform the second level of comparison for the ...
Overview -------- For sorting there are always two approaches: 1. Make the class `Comparable` 2. Use a `Comparator` I'll assume your values are some sort of class like ``` public class Entry { private final String text; private final int count; // getters, constructor, toString, ... } ``` --- Compar...
10,797,773
I am trying to create a screen recording app in Android. For this, i am using FFmpeg. I have created the libffmpeg.so file. Now i would like to use the same in Android project for calling it's native function. How can i do that..?
2012/05/29
[ "https://Stackoverflow.com/questions/10797773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/776284/" ]
This tutorial provides a detail explanation about this topic. [How to Build Android Applications Based on FFmpeg by An Example](http://www.roman10.net/how-to-build-android-applications-based-on-ffmpeg-by-an-example/)
You can find the example [How to load another .so file in your android project?](https://stackoverflow.com/questions/20063397/how-to-load-another-so-file-in-your-android-project/20063480#20063480) That is the good way to show you how to load \*.so file. > > 1 - Add folder jni/libs/\*.so > > > 2 - Use "Right-click...
20,835,534
I was trying to declare a function pointer that points to any function that returns the same type. I omitted the arguments types in the pointer declaration to see what error will be generated. But the program was compiled successfully and executed without any issue. Is this a correct declaration? Shouldn't we specify ...
2013/12/30
[ "https://Stackoverflow.com/questions/20835534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2727656/" ]
Empty parentheses within a type name means unspecified arguments. Note that this is an obsolescent feature. > > ### C11(ISO/IEC 9899:201x) §6.11.6 Function declarators > > > The use of function declarators with empty parentheses (not prototype-format parameter > type declarators) is an obsolescent feature. > > >
`void (*pointer)()` explains function pointed have unspecified number of argument. It is not similar to `void (*pointer)(void)`. So later when you used two arguments that fits successfully according to definition.
20,835,534
I was trying to declare a function pointer that points to any function that returns the same type. I omitted the arguments types in the pointer declaration to see what error will be generated. But the program was compiled successfully and executed without any issue. Is this a correct declaration? Shouldn't we specify ...
2013/12/30
[ "https://Stackoverflow.com/questions/20835534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2727656/" ]
`void (*pointer)()` explains function pointed have unspecified number of argument. It is not similar to `void (*pointer)(void)`. So later when you used two arguments that fits successfully according to definition.
There are couple of things you should know here... **Function declaration:** ``` int myFunction(); ``` **Function prototype:** ``` int myFunction(int a, float b); ``` * A `prototype` is a special kind of declaration that describes the number and the types of function parameters. * A `non-prototype` function decl...
20,835,534
I was trying to declare a function pointer that points to any function that returns the same type. I omitted the arguments types in the pointer declaration to see what error will be generated. But the program was compiled successfully and executed without any issue. Is this a correct declaration? Shouldn't we specify ...
2013/12/30
[ "https://Stackoverflow.com/questions/20835534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2727656/" ]
Empty parentheses within a type name means unspecified arguments. Note that this is an obsolescent feature. > > ### C11(ISO/IEC 9899:201x) §6.11.6 Function declarators > > > The use of function declarators with empty parentheses (not prototype-format parameter > type declarators) is an obsolescent feature. > > >
There are couple of things you should know here... **Function declaration:** ``` int myFunction(); ``` **Function prototype:** ``` int myFunction(int a, float b); ``` * A `prototype` is a special kind of declaration that describes the number and the types of function parameters. * A `non-prototype` function decl...
35,673,172
I have a simple script that is trying to register a click on a button. However, I keep getting the error `*element*.addEventListener` is not a function. Can anyone explain what I'm doing wrong? **HTML** ``` <div id="game"> <canvas id="gameScreen" width="550" height="500"></canvas> <div id="output"><p></p></...
2016/02/27
[ "https://Stackoverflow.com/questions/35673172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The **[getElementsByTagName()](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByTagName)** method will return a list of nodes and you should loop through them and attach listener to every one : ``` function my_click(){ alert(this.id); } var directionButtons = controls.getElementsByTagName("bu...
Variable `directionButtons` is an array of multiple elements. You'll need to use loop here in order to add listeners. ```js window.addEventListener("load", function() { var canvas = document.getElementById("gameScreen"); var ctx = canvas.getContext("2d"); var output = document.getElementById("output"); var...
52,028,664
While coding for competitions in codechef, I face this problem with python, to read > > > ``` > 3 # number of required input > 1 4 2 # inputs > > ``` > > to read input i used: ``` data=list(map(int,input().split())) ``` but it will read any number of inputs and will store as list. How to restrict size...
2018/08/26
[ "https://Stackoverflow.com/questions/52028664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8901248/" ]
`System.out.println(fun(20)+" "+fun(21l));` is passed a `String` that is the result of concatenating the values returned by `fun(20)` and `fun(21l)`. Therefore, these two methods are executed before this `println` statement, each of them printing its own `String`. * first `fun(20)` prints "float called " and returns 2...
This is an example of method overloading. The example shows that an class can have several methods with the same name. Some more examples are listed here: <https://beginnersbook.com/2013/05/method-overloading/>
8,767,201
I'd like to create a motion blur effect by rendering and additively blending moving objects at multiple points in their trajectory over the course of a frame. I was thinking that the calculation for determining the draw location could be performed in a vertex shader. It seems to me, though, that I might need to emplo...
2012/01/07
[ "https://Stackoverflow.com/questions/8767201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340947/" ]
> > I'd like to create a motion blur effect by rendering and additively blending moving objects at multiple points in their trajectory over the course of a frame. > > > That's certainly one way to do implement motion blur. But these days motion blur is implementy by a vector blur postprocessing filter in the fragm...
1. Software render the sub-frames - Consider this the "baseline" case. 2. Vertex shader - You could do this, but don't try to send geometry velocity, just send the vertex velocity: Render the frame to a VBO, calling glVertexAttrib to include the current velocity and acceleration of each vertex. Render the VBO repeated...
14,530,887
Is there a workaround to get D3.js to parse datetimes that have milliseconds included? I can't get this to work: ``` var parseDate = d3.time.format("%Y-%m-%dT%H:%M:%S").parse parseDate("2011-01-01T12:14:35") //that works parseDate("2011-01-01T12:14:35.3456") //returns null ```
2013/01/25
[ "https://Stackoverflow.com/questions/14530887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443118/" ]
If your dateTime strings are already in that format, you don't need d3 to parse it into an actual date object. For example: ``` new Date("2011-01-01T12:14:35") # Sat Jan 01 2011 04:14:35 GMT-0800 (PST) ``` results in a correct date object.
Try looking at the `d3.time.format.iso` formatting function, shown on the wiki page: [d3.time.format.iso](https://github.com/mbostock/d3/wiki/Time-Formatting#wiki-format_iso).
14,530,887
Is there a workaround to get D3.js to parse datetimes that have milliseconds included? I can't get this to work: ``` var parseDate = d3.time.format("%Y-%m-%dT%H:%M:%S").parse parseDate("2011-01-01T12:14:35") //that works parseDate("2011-01-01T12:14:35.3456") //returns null ```
2013/01/25
[ "https://Stackoverflow.com/questions/14530887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443118/" ]
Include format to parse the miliseconds which uses %L [source](https://github.com/mbostock/d3/wiki/Time-Formatting). For your case: ``` var parseDate = d3.time.format("%Y-%m-%dT%H:%M:%S").parse parseDate("2011-01-01T12:14:35") //that works var parseDate = d3.time.format("%Y-%m-%dT%H:%M:%S.%L").parse parseDate("20...
Try looking at the `d3.time.format.iso` formatting function, shown on the wiki page: [d3.time.format.iso](https://github.com/mbostock/d3/wiki/Time-Formatting#wiki-format_iso).
233,471
Whats wrong with this statement? why it gives below error message **Error Message:** > > SELECT failed because the following SET options have incorrect > settings: 'QUOTED\_IDENTIFIER'. Verify that SET options are correct for > use with indexed views and/or indexes on computed columns and/or > filtered indexes a...
2019/03/29
[ "https://dba.stackexchange.com/questions/233471", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/164767/" ]
As documented in [SET QUOTED\_IDENTIFIER (Transact-SQL)](https://learn.microsoft.com/en-us/sql/t-sql/statements/set-quoted-identifier-transact-sql?view=sql-server-2017) > > SET QUOTED\_IDENTIFIER must be ON when you invoke XML data type > methods. > > > A simple test ``` set quoted_identifier off DECLARE @xmlR...
Check results from command: ``` DBCC useroptions ``` There are other very important settings to observe here too: ``` language us_english dateformat mdy datefirst 7 ``` Here in Australia am using settings as per: ``` language British dateformat dmy datefirst 1 ``` Strangely, my process worked on a ...
7,418,490
I have a string of text like this: ``` This is a[WAIT] test. ``` What I want to do is search the string for a substring that starts with [ and ends with ] Each one I find I want to add it to an ArrayList and replace substring in original string with a ^ Here is my regex: ``` String regex_script = "/^\\[\\]$/"; //...
2011/09/14
[ "https://Stackoverflow.com/questions/7418490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917009/" ]
you can do: ``` String regex_script = "\\[([^\\]]*)\\]"; String line = "This is a[WAIT] testThis is a[WAIT] test"; StringBuffer sb = new StringBuffer(); List<String> list = new ArrayList<String>(); //use to record Pattern p = Pattern.compile(regex_script); // Create a pattern to match Match...
If you are searching a substring, don't use ^ and $. Those are for beginning and at end at a string (not a word) Try: ``` String regex_script = "/\[.*\]/"; ```
29,130
We are virtualizing our license servers and have to start using network USB hubs for the authentication keys. The ones I've found will be messy in a rack. Has anyone ever seen a rackmountable version? If that's not an option, are there any rackmountable normals hubs? Or maybe some setup I haven't come up with?
2009/06/20
[ "https://serverfault.com/questions/29130", "https://serverfault.com", "https://serverfault.com/users/1565/" ]
You mean something like this: [**Metal 7-Port USB 2.0 Powered Slim Hub for PC-MAC with Power Adapter**](http://www.qualitycables.com/productdetails1.cfm?sku=USBG-7U2ML&cats=&catid=104%2C653%2C210%2C212) ![alt text](https://www.coolgear.com/images/USBG-7U2ML.jpg) > > Industrial USB Hub with 7 Ports > feature a rugg...
Well even at 1U having splattnes suggested devices occupy a rack space seems a bit of a waste - these devices seem easy enough to mount inside a rack cabinet but outside of the actual 19" mount-space. Mounting them to a rack shelf first if you really need them inside that space should also be easy and cheap. Actual ra...
29,130
We are virtualizing our license servers and have to start using network USB hubs for the authentication keys. The ones I've found will be messy in a rack. Has anyone ever seen a rackmountable version? If that's not an option, are there any rackmountable normals hubs? Or maybe some setup I haven't come up with?
2009/06/20
[ "https://serverfault.com/questions/29130", "https://serverfault.com", "https://serverfault.com/users/1565/" ]
You mean something like this: [**Metal 7-Port USB 2.0 Powered Slim Hub for PC-MAC with Power Adapter**](http://www.qualitycables.com/productdetails1.cfm?sku=USBG-7U2ML&cats=&catid=104%2C653%2C210%2C212) ![alt text](https://www.coolgear.com/images/USBG-7U2ML.jpg) > > Industrial USB Hub with 7 Ports > feature a rugg...
What i've discovered on gearslutz.com: <http://www.gearslutz.com/board/so-much-gear-so-little-time/71862-rackmount-usb-hub-16-ports-2.html>
29,130
We are virtualizing our license servers and have to start using network USB hubs for the authentication keys. The ones I've found will be messy in a rack. Has anyone ever seen a rackmountable version? If that's not an option, are there any rackmountable normals hubs? Or maybe some setup I haven't come up with?
2009/06/20
[ "https://serverfault.com/questions/29130", "https://serverfault.com", "https://serverfault.com/users/1565/" ]
You mean something like this: [**Metal 7-Port USB 2.0 Powered Slim Hub for PC-MAC with Power Adapter**](http://www.qualitycables.com/productdetails1.cfm?sku=USBG-7U2ML&cats=&catid=104%2C653%2C210%2C212) ![alt text](https://www.coolgear.com/images/USBG-7U2ML.jpg) > > Industrial USB Hub with 7 Ports > feature a rugg...
I know this is an old thread, but thought I'd make an updated answer. USBGear/Coolgear now has several direct rack-mount models: [Industrial 16-Port USB 2.0 Rack Mount Hub with Built-in Power Supply](http://usbgear.com/CG-1600i-RM.html) [Industrial 16-Port USB 3.0 Din-Rail/WallMount Hub with output up to 1.5A Chargin...
37,076,966
Trying to enroll IOS device (IPhone 6s, ios 9.3) in WSO2 but unfortunately failing. I am using registered csr file and Apple MDM certificate. Followed instructions mentioned in document. Failing at step 2 on IOS device after entering Domain, username and password. On UI, below is the error > > "An unexpected error oc...
2016/05/06
[ "https://Stackoverflow.com/questions/37076966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6301187/" ]
Make sure you have configured the all the config files where the local IP address is used you need to check that and reconfigure all the files to utilize the IP mask or domain you are using.
1. You need to follow the steps given [here](https://docs.wso2.com/display/EMM200/General+iOS+Server+Configurations) in order to configure IOS in WSO2 EMM. 2. You need to obtain a singed CSR from WSO2 by following steps provided [here](https://docs.wso2.com/display/EMM200/Obtaining+the+Signed+CSR+File) 3. If the server...
37,076,966
Trying to enroll IOS device (IPhone 6s, ios 9.3) in WSO2 but unfortunately failing. I am using registered csr file and Apple MDM certificate. Followed instructions mentioned in document. Failing at step 2 on IOS device after entering Domain, username and password. On UI, below is the error > > "An unexpected error oc...
2016/05/06
[ "https://Stackoverflow.com/questions/37076966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6301187/" ]
Make sure you have configured the all the config files where the local IP address is used you need to check that and reconfigure all the files to utilize the IP mask or domain you are using.
Adding to Kachiecx's answer, I assume you are using a self-signed SSL certificate. When creating a SSL certificate, make sure you provide the common name of the certificate to match your IP/hostname. This is mentioned in the doc [1] under step 6. Also make sure, you follow the step given in step 3 of general server con...
30,452,561
So, I have following html. ``` <div id="a" class="a_button"> <a class="a_link" href="#"> <div class="icon_container"> <img class="icon_image" src="#"> </div> <div class="title_container"> <span class="title_inactive"> Title ...
2015/05/26
[ "https://Stackoverflow.com/questions/30452561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4456697/" ]
add this to CSS: ``` .title_container > .title_inactive:hover{color:white} ```
``` <div class="title_container" style="color:red"> <span class="title inactive"> Title </span> </div> ``` by applying inline style as shown above the text color will change.
30,452,561
So, I have following html. ``` <div id="a" class="a_button"> <a class="a_link" href="#"> <div class="icon_container"> <img class="icon_image" src="#"> </div> <div class="title_container"> <span class="title_inactive"> Title ...
2015/05/26
[ "https://Stackoverflow.com/questions/30452561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4456697/" ]
As you hover the `a` tag you need to change the color of the span in the title\_container class. Add this to your css : ``` a:hover .title_container span{ color:#fff; } ``` or for the [jsfiddle](https://jsfiddle.net/8wfhnupk/4/) ``` .royal_button a:hover .royal_menu_title{ color:#fff; } ```
add this to CSS: ``` .title_container > .title_inactive:hover{color:white} ```
30,452,561
So, I have following html. ``` <div id="a" class="a_button"> <a class="a_link" href="#"> <div class="icon_container"> <img class="icon_image" src="#"> </div> <div class="title_container"> <span class="title_inactive"> Title ...
2015/05/26
[ "https://Stackoverflow.com/questions/30452561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4456697/" ]
add this to CSS: ``` .title_container > .title_inactive:hover{color:white} ```
This would be the solution: ``` .royal_button:hover div { color:#fff; } ``` [**JSFiddle**](https://jsfiddle.net/8wfhnupk/6/)
30,452,561
So, I have following html. ``` <div id="a" class="a_button"> <a class="a_link" href="#"> <div class="icon_container"> <img class="icon_image" src="#"> </div> <div class="title_container"> <span class="title_inactive"> Title ...
2015/05/26
[ "https://Stackoverflow.com/questions/30452561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4456697/" ]
As you hover the `a` tag you need to change the color of the span in the title\_container class. Add this to your css : ``` a:hover .title_container span{ color:#fff; } ``` or for the [jsfiddle](https://jsfiddle.net/8wfhnupk/4/) ``` .royal_button a:hover .royal_menu_title{ color:#fff; } ```
``` <div class="title_container" style="color:red"> <span class="title inactive"> Title </span> </div> ``` by applying inline style as shown above the text color will change.
30,452,561
So, I have following html. ``` <div id="a" class="a_button"> <a class="a_link" href="#"> <div class="icon_container"> <img class="icon_image" src="#"> </div> <div class="title_container"> <span class="title_inactive"> Title ...
2015/05/26
[ "https://Stackoverflow.com/questions/30452561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4456697/" ]
This would be the solution: ``` .royal_button:hover div { color:#fff; } ``` [**JSFiddle**](https://jsfiddle.net/8wfhnupk/6/)
``` <div class="title_container" style="color:red"> <span class="title inactive"> Title </span> </div> ``` by applying inline style as shown above the text color will change.
30,452,561
So, I have following html. ``` <div id="a" class="a_button"> <a class="a_link" href="#"> <div class="icon_container"> <img class="icon_image" src="#"> </div> <div class="title_container"> <span class="title_inactive"> Title ...
2015/05/26
[ "https://Stackoverflow.com/questions/30452561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4456697/" ]
alternatively you can use this, ``` <style> .icon_container:hover{ color:#000; background-color:#fff; } .title_container:hover{ color:#FFF; background-color:green; } </style> ```
``` <div class="title_container" style="color:red"> <span class="title inactive"> Title </span> </div> ``` by applying inline style as shown above the text color will change.
30,452,561
So, I have following html. ``` <div id="a" class="a_button"> <a class="a_link" href="#"> <div class="icon_container"> <img class="icon_image" src="#"> </div> <div class="title_container"> <span class="title_inactive"> Title ...
2015/05/26
[ "https://Stackoverflow.com/questions/30452561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4456697/" ]
As you hover the `a` tag you need to change the color of the span in the title\_container class. Add this to your css : ``` a:hover .title_container span{ color:#fff; } ``` or for the [jsfiddle](https://jsfiddle.net/8wfhnupk/4/) ``` .royal_button a:hover .royal_menu_title{ color:#fff; } ```
This would be the solution: ``` .royal_button:hover div { color:#fff; } ``` [**JSFiddle**](https://jsfiddle.net/8wfhnupk/6/)
30,452,561
So, I have following html. ``` <div id="a" class="a_button"> <a class="a_link" href="#"> <div class="icon_container"> <img class="icon_image" src="#"> </div> <div class="title_container"> <span class="title_inactive"> Title ...
2015/05/26
[ "https://Stackoverflow.com/questions/30452561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4456697/" ]
As you hover the `a` tag you need to change the color of the span in the title\_container class. Add this to your css : ``` a:hover .title_container span{ color:#fff; } ``` or for the [jsfiddle](https://jsfiddle.net/8wfhnupk/4/) ``` .royal_button a:hover .royal_menu_title{ color:#fff; } ```
alternatively you can use this, ``` <style> .icon_container:hover{ color:#000; background-color:#fff; } .title_container:hover{ color:#FFF; background-color:green; } </style> ```
30,452,561
So, I have following html. ``` <div id="a" class="a_button"> <a class="a_link" href="#"> <div class="icon_container"> <img class="icon_image" src="#"> </div> <div class="title_container"> <span class="title_inactive"> Title ...
2015/05/26
[ "https://Stackoverflow.com/questions/30452561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4456697/" ]
alternatively you can use this, ``` <style> .icon_container:hover{ color:#000; background-color:#fff; } .title_container:hover{ color:#FFF; background-color:green; } </style> ```
This would be the solution: ``` .royal_button:hover div { color:#fff; } ``` [**JSFiddle**](https://jsfiddle.net/8wfhnupk/6/)
53,481,818
I'm trying to write an test function for mbedtls which randomly generates a key for AES encryption. I use the original tutorial Code from mbedtls. My Programm always stops when executing "mbedtls\_ctr\_drbg\_seed()". About my environmet: Basic Sourcefiles from STM\_CUBEmx, Board: ST32F767 Nucleo, Compiling based on Ma...
2018/11/26
[ "https://Stackoverflow.com/questions/53481818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8378096/" ]
I combined [this answer **(1)**](https://codereview.stackexchange.com/a/158929/185595) and [this answer **(2)**](https://codereview.stackexchange.com/a/158928/185595) to speed up the function. The two key ideas are: When testing primality of a candidate ... * ... do not divide by every number (2, 3, 4, 5, 6, ...) but ...
``` def SieveOfEratosthenes(): n = 1000000 prime = [True for i in range(n+1)] p = 2 count = 0 while (p * p <= n): if (prime[p] == True): count = count + 1 for i in range(p * p, n+1, p): prime[i] = False p += 1 seive = [] for p in r...
30,559,608
I'm new to Beanstalk. I've created a Rails application and set the database production configuration to use the environment variables hopefully provided by AWS. I'm using Mysql (mysql2 gem), and want to use RDS and Passenger (I have no preference there). On my development environment I can run the rails application wi...
2015/05/31
[ "https://Stackoverflow.com/questions/30559608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1614089/" ]
In Elastic Beanstalk (both the web console and the cli), you can pass environnement variables. If you pass the `RAKE_ENV` variable, you will change your environnement. After that you still need to pass your database parameters (db password, name, ...) which should not be hardcoded into the code.
Have you tried to run ``` bin/rake db:migrate RAILS_ENV=development ``` ? I got the same issue and that worked for me.
30,559,608
I'm new to Beanstalk. I've created a Rails application and set the database production configuration to use the environment variables hopefully provided by AWS. I'm using Mysql (mysql2 gem), and want to use RDS and Passenger (I have no preference there). On my development environment I can run the rails application wi...
2015/05/31
[ "https://Stackoverflow.com/questions/30559608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1614089/" ]
In Elastic Beanstalk (both the web console and the cli), you can pass environnement variables. If you pass the `RAKE_ENV` variable, you will change your environnement. After that you still need to pass your database parameters (db password, name, ...) which should not be hardcoded into the code.
I recommend you enter to EC2 instance through this command "**eb ssh**" (The first time you need specified you **.pem** file, if you have not one you can create in **IAM services**) and check your logs for more information about yours error. If you have problems when you are uploading your code (eb deploy) you have th...
30,559,608
I'm new to Beanstalk. I've created a Rails application and set the database production configuration to use the environment variables hopefully provided by AWS. I'm using Mysql (mysql2 gem), and want to use RDS and Passenger (I have no preference there). On my development environment I can run the rails application wi...
2015/05/31
[ "https://Stackoverflow.com/questions/30559608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1614089/" ]
In Elastic Beanstalk (both the web console and the cli), you can pass environnement variables. If you pass the `RAKE_ENV` variable, you will change your environnement. After that you still need to pass your database parameters (db password, name, ...) which should not be hardcoded into the code.
I believed that Elastic Beanstalk will run 'rake db:migrate' by itself. Indeed it seems to try, but that is failing. I gave my bounty to 'Yahs Hef', even though I will only try this evening (UK). My disorientation with AWS caused me to forget this easy solution, of running the migration by myself. If this does not work...
30,559,608
I'm new to Beanstalk. I've created a Rails application and set the database production configuration to use the environment variables hopefully provided by AWS. I'm using Mysql (mysql2 gem), and want to use RDS and Passenger (I have no preference there). On my development environment I can run the rails application wi...
2015/05/31
[ "https://Stackoverflow.com/questions/30559608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1614089/" ]
Have you tried to run ``` bin/rake db:migrate RAILS_ENV=development ``` ? I got the same issue and that worked for me.
I believed that Elastic Beanstalk will run 'rake db:migrate' by itself. Indeed it seems to try, but that is failing. I gave my bounty to 'Yahs Hef', even though I will only try this evening (UK). My disorientation with AWS caused me to forget this easy solution, of running the migration by myself. If this does not work...
30,559,608
I'm new to Beanstalk. I've created a Rails application and set the database production configuration to use the environment variables hopefully provided by AWS. I'm using Mysql (mysql2 gem), and want to use RDS and Passenger (I have no preference there). On my development environment I can run the rails application wi...
2015/05/31
[ "https://Stackoverflow.com/questions/30559608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1614089/" ]
I recommend you enter to EC2 instance through this command "**eb ssh**" (The first time you need specified you **.pem** file, if you have not one you can create in **IAM services**) and check your logs for more information about yours error. If you have problems when you are uploading your code (eb deploy) you have th...
I believed that Elastic Beanstalk will run 'rake db:migrate' by itself. Indeed it seems to try, but that is failing. I gave my bounty to 'Yahs Hef', even though I will only try this evening (UK). My disorientation with AWS caused me to forget this easy solution, of running the migration by myself. If this does not work...
18,433,856
I want to get my location if phone is connected to Wifi or mobile network. However if phone is on mobile network things dont run as wanted. Nothing is happening until if i enable GPS. Can i get location without enabling GPS or i have to do that ? And if GPS is must, how could i warn user to enable GPS ? ``` private vo...
2013/08/25
[ "https://Stackoverflow.com/questions/18433856", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1889451/" ]
Please refer this [Demo](http://www.androidhive.info/2012/07/android-gps-location-manager-tutorial/). You have to create one **GPSTracker** Services which is track your last location. I think 100% solve your issue if you concentrate on demo. If work like charm then accept answer.
You have a very loaded question. ``` Can i get location without enabling GPS or i have to do that ? ``` Of course you can. Location comes from Location Providers. Examples includes Network, Wifi and GPS. You do not need all 3. Just any one will do. ``` And if GPS is must, how could i warn user to enable GPS ? ``...
17,279,726
I want to create a generic super class called **Vista** that extends android Activity, and then create all my activities extending my class Vista (thus to inherit all my common methods in all my activities). But in the project I have some FragmentActivity classes and I can't extend these from the class Vista. Any solu...
2013/06/24
[ "https://Stackoverflow.com/questions/17279726", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1241276/" ]
You need to make the *Vista* class a standalone helper class. Then create an *ActivityVista* class that extends *Activity* and includes an instance of the *Vista* helper class as a private member. And also create a *FragmentActivityVista* class that extends *FragmentActivity* and includes an instance of the *Vista* hel...
You have 2 ways : 1. Add VistaFragmentActivity and extend it for Fragments 2. Make yout Vista to extend FragmentActivity Best wishes.
71,726,164
Basically what I am trying to achieve is to enforce function to return a correct type based on the key passed to the function. So if the key is `service1` the correct return type should be `Payloads['service1']`. How can I achieve this? ```js interface Payloads { service1: { a: boolean; }; service2...
2022/04/03
[ "https://Stackoverflow.com/questions/71726164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13269713/" ]
The type `Payloads[S]` is an [indexed access type](https://www.typescriptlang.org/docs/handbook/2/indexed-access-types.html) that depends on an as-yet unspecified [generic](https://www.typescriptlang.org/docs/handbook/2/generics.html) type parameter `S`. In your implementation, the compiler is unable to use [control f...
TypeScript doesn't know the type of `S` in the body of the function, so it expects you to pass *all* properties to make sure `Payloads[S]` is fulfilled. But you can trick TypeScript! By changing the return type to `Payloads[keyof Payloads]` it means *one of the options*, and you don't get any error. Now this has chang...
48,841,854
I'm having a problem presenting data in the required way. My dataframe is formatted and then sorted by 'Site ID'. I need to present the data by Site ID with all date instances grouped alongside. I'm 90% there in terms of how I want it to look using pivot\_table ``` df_pivot = pd.pivot_table(df, index=['Site Ref','Sit...
2018/02/17
[ "https://Stackoverflow.com/questions/48841854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9373483/" ]
It's sorted [lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order), because `Date` has object (string) dtype Workaround - add a new column of `datetime` dtype, use it before `Date` in the `pivot_table` and drop it afterwards: ``` In [74]: (df.assign(x=pd.to_datetime(df['Date'])) .pivot_t...
You need to convert your dates to datetime values rather than strings. Something like the following would work on your current pivot table: ``` df_pivot.reset_index(inplace=True) df_pivot['Date'] = pd.to_datetime(df_pivot['Date']) df_pivot.sort_values(by=['Site Ref', 'Date'], inplace=True) ```
48,841,854
I'm having a problem presenting data in the required way. My dataframe is formatted and then sorted by 'Site ID'. I need to present the data by Site ID with all date instances grouped alongside. I'm 90% there in terms of how I want it to look using pivot\_table ``` df_pivot = pd.pivot_table(df, index=['Site Ref','Sit...
2018/02/17
[ "https://Stackoverflow.com/questions/48841854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9373483/" ]
It's sorted [lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order), because `Date` has object (string) dtype Workaround - add a new column of `datetime` dtype, use it before `Date` in the `pivot_table` and drop it afterwards: ``` In [74]: (df.assign(x=pd.to_datetime(df['Date'])) .pivot_t...
Sort the values by Site Ref, groupby mean using `sort = False` i.e ``` df.sort_values('Site Ref').groupby(['Site Ref','Site Name','Date'],sort=False).mean() Duration Site Ref Site Name Date 1123456 Building D Thu Jan 11 2018 10:43:20 ...
13,077,227
What will be the context for CONNECTIVITY\_SERVICE in a Fragment? I have checked getActivity also but it is giving an error. ``` public boolean isOnline() { ConnectivityManager connectionManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); try { if (connectionManager...
2012/10/25
[ "https://Stackoverflow.com/questions/13077227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1744952/" ]
`getSystemService()` is a method on `Context`. A `Fragment` would call it using `getActivity()`: ``` getActivity().getSystemService(Context.CONNECTIVITY_SERVICE); ```
I faced a similar problem when trying to implement a Google map offline tile provider within a fragment (based on 0ne\_Up's answer [here](https://stackoverflow.com/questions/48938723/google-maps-offline-mode-on-android-application?rq=1)). I solved it by using the following: ``` private ConnectivityManager connectivity...
265,569
i've come across a lot of questions recently that ask you whether or not there exist certain kinds of ideal, say; does there exist an ideal$ J $of $\mathbb{Z}[i]$ for which $\mathbb{Z}[i] /J$ is a field of 8 elements? or for $R ={\{a + bi\sqrt3: a,b \in Z}\} $show there is an ideal $I$ of $R$ so that $R/I$ is isomorph...
2012/12/26
[ "https://math.stackexchange.com/questions/265569", "https://math.stackexchange.com", "https://math.stackexchange.com/users/36016/" ]
For the case of $\, \Bbb Z[i]\,$: try to prove the nice **Claim:** For any $\,a+bi\in\Bbb Z[i]\,\,,\,\,\gcd(a,b)=1\,$ , we have that $$\Bbb Z[i]/\langle a+bi\rangle\,\cong\Bbb Z/(a^2+b^2)\Bbb Z=:\Bbb Z\_{a^2+b^2}$$ Assuming the above, the question is now whether we can write $\,8=a^2+b^2\,,\,a,b\in\Bbb Z\,,\,(a,b)=1...
The ring $\Bbb{Z}[i]$ is the ring of integers of $\Bbb{Q}(i)$. Hence finding an ideal such that the quotient is a field of 8 elements is impossible. This is because such an ideal must be prime, lies over $2\Bbb{Z}$ and is of inertia degree 3 but this is impossible because it violates the formula $\sum e\_if\_i = n$. We...
42,875,328
I want to add onblur function to html code inside in my javascript code and below my code is not working. can anyone advice me on this please ``` <script type="text/javascript"> $(document).ready(function() { var max_fields = 15; //maximum input boxes allowed var wrapper = $(".input_fields_wra...
2017/03/18
[ "https://Stackoverflow.com/questions/42875328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7366435/" ]
With this bit of information, you can generate queries flexibly. ``` In [2]: User.email Out[2]: <sqlalchemy.orm.attributes.InstrumentedAttribute at 0x7f42cd4b7410> In [3]: User.email == '' Out[3]: <sqlalchemy.sql.elements.BinaryExpression object at 0x7f42ca640550> In [4]: User.email.in_([]) ...warning Out[4]: <sqlal...
You can use. `declarative_base` and `filter_by`. ``` from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String engine = create_engine('sqlite:///test.db', convert_unicode=True) db...
1,094
How can I create hindrances to radio waves?
2010/11/19
[ "https://physics.stackexchange.com/questions/1094", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/547/" ]
Any conductive material will block any EM radiation, including radio waves. However, the thickness of material required to fully block the radiation depends on the wavelength of the radiation and the properties of the material. With a perfect conductor, the radiation is stopped completely by any thickness of the materi...
A large sheet or volume of matter that contains plenty of freely moveable charge carriers. Examples: metal, which contains electrons not assigned to particular atoms, but free to move; plasmas which consist of electrons and positive ions free to move in space; or a cloud of charged dust particles. If you just want to s...
1,094
How can I create hindrances to radio waves?
2010/11/19
[ "https://physics.stackexchange.com/questions/1094", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/547/" ]
A large sheet or volume of matter that contains plenty of freely moveable charge carriers. Examples: metal, which contains electrons not assigned to particular atoms, but free to move; plasmas which consist of electrons and positive ions free to move in space; or a cloud of charged dust particles. If you just want to s...
Let's go for a somewhat more unconventional answer. Consider this: if you have a radio wave of certain frequency and wavelength, you can *"cancel out"* its effect by emitting another wave of same frequency, wavelength and amplitude, just offset by half of its period. Something like this: (forgive the crude drawing) [...
1,094
How can I create hindrances to radio waves?
2010/11/19
[ "https://physics.stackexchange.com/questions/1094", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/547/" ]
Any conductive material will block any EM radiation, including radio waves. However, the thickness of material required to fully block the radiation depends on the wavelength of the radiation and the properties of the material. With a perfect conductor, the radiation is stopped completely by any thickness of the materi...
In short, just build a [Faraday Cage](http://en.wikipedia.org/wiki/Faraday_cage) out of conducting material with a mesh size much smaller than the wavelength of the electromagnetic wave you want to block.
1,094
How can I create hindrances to radio waves?
2010/11/19
[ "https://physics.stackexchange.com/questions/1094", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/547/" ]
Any conductive material will block any EM radiation, including radio waves. However, the thickness of material required to fully block the radiation depends on the wavelength of the radiation and the properties of the material. With a perfect conductor, the radiation is stopped completely by any thickness of the materi...
Let's go for a somewhat more unconventional answer. Consider this: if you have a radio wave of certain frequency and wavelength, you can *"cancel out"* its effect by emitting another wave of same frequency, wavelength and amplitude, just offset by half of its period. Something like this: (forgive the crude drawing) [...
1,094
How can I create hindrances to radio waves?
2010/11/19
[ "https://physics.stackexchange.com/questions/1094", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/547/" ]
In short, just build a [Faraday Cage](http://en.wikipedia.org/wiki/Faraday_cage) out of conducting material with a mesh size much smaller than the wavelength of the electromagnetic wave you want to block.
Let's go for a somewhat more unconventional answer. Consider this: if you have a radio wave of certain frequency and wavelength, you can *"cancel out"* its effect by emitting another wave of same frequency, wavelength and amplitude, just offset by half of its period. Something like this: (forgive the crude drawing) [...
45,788,700
I have a textfield in the `MyCustomCell`, and set the textfield delegate in the `cellForRowIndexPath` tableview delegate. When user changes the textfield value and it calls `textFieldShouldEndEditing`. All it works. However, I wonder how to know which textfield (indexPath) is changed? ``` - (UITableViewCell *)tableVi...
2017/08/21
[ "https://Stackoverflow.com/questions/45788700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1669996/" ]
Set `UITextField` tag in your `cellForRowAtIndexPath` method. If there is only one section in your tableview you can set the row as tag. Like this. ``` cell.textField.delegate = self; cell.textField.tag = indexPath.row; ``` And in your `textFieldShouldEndEditing` method you can check the tag. ``` - (BOOL)textFieldS...
You Can Try this: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier = @"Cell"; MyCustomCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) { // use this if you...
45,788,700
I have a textfield in the `MyCustomCell`, and set the textfield delegate in the `cellForRowIndexPath` tableview delegate. When user changes the textfield value and it calls `textFieldShouldEndEditing`. All it works. However, I wonder how to know which textfield (indexPath) is changed? ``` - (UITableViewCell *)tableVi...
2017/08/21
[ "https://Stackoverflow.com/questions/45788700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1669996/" ]
Set `UITextField` tag in your `cellForRowAtIndexPath` method. If there is only one section in your tableview you can set the row as tag. Like this. ``` cell.textField.delegate = self; cell.textField.tag = indexPath.row; ``` And in your `textFieldShouldEndEditing` method you can check the tag. ``` - (BOOL)textFieldS...
`- (BOOL)textFieldShouldEndEditing:(UITextField *)textField { if ([[[textField superview] superview] isKindOfClass:[MyCustomCell class]]) { MyCustomCell *cell = (MyCustomCell *)[[textField superview] superview]; NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; // this is what you want. } return YE...
45,788,700
I have a textfield in the `MyCustomCell`, and set the textfield delegate in the `cellForRowIndexPath` tableview delegate. When user changes the textfield value and it calls `textFieldShouldEndEditing`. All it works. However, I wonder how to know which textfield (indexPath) is changed? ``` - (UITableViewCell *)tableVi...
2017/08/21
[ "https://Stackoverflow.com/questions/45788700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1669996/" ]
`- (BOOL)textFieldShouldEndEditing:(UITextField *)textField { if ([[[textField superview] superview] isKindOfClass:[MyCustomCell class]]) { MyCustomCell *cell = (MyCustomCell *)[[textField superview] superview]; NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; // this is what you want. } return YE...
You Can Try this: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier = @"Cell"; MyCustomCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) { // use this if you...
17,576,135
I have a textfield, which I want to have a 'dynamic' placeholder text (definied and managed in the view), but I also want it to have an action defined for it. I tried the two following lines: ``` {{ input id="test" placeholder=view.text action expand target="view"}} <input type="text" id="test" placeholder="{{view.te...
2013/07/10
[ "https://Stackoverflow.com/questions/17576135", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085007/" ]
If you want to stick to input helpers, you can do something like this: ``` {{input placeholder=view.text action="expand" targetObject=view}} ``` Notice that targetObject should **not** be a string.
You could try to do it like this: ``` <input type="text" id="test" {{bindAttr placeholder=view.text}} {{action expand target="view"}} /> ``` See [here](http://jsbin.com/axihur/7/edit) for a working example. Hope it helps
70,097,154
I recently started working on a project and I'm trying NextJS for the first time for this project. In the past I have already coded a website with plain ReactJS and used mongoose to connect to my mongodb. Now for NextJS I can only find explanations and tutorials where the are not using "mongoose" but "mongodb". I fi...
2021/11/24
[ "https://Stackoverflow.com/questions/70097154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13575279/" ]
<https://docs.nestjs.com/techniques/mongodb> They Reference it as mongodb... But they natively use mongoose to facilitate it -> and right down to the schemas... I know what you mean, the documentation is lacking all the parts that make it work... however after watching this video. I was able to see how he made it work...
1. You create schema ``` import mongoose from 'mongoose'; var Schema = mongoose.Schema; var user = new Schema({ name: {type: String, required: true}, email: {type: String, required: true}, password: {type: String, required: true}, }); mongoose.models = {}; var User = mongoose.model('User', user); export defau...
10,721,951
I have the following jQuery script to intialise a jQuery plugin called poshytips. I want configure the plugin using Html5 data attributes. I am repeating myself big time, can anyone come up with a better way to do this? ``` $('.poshytip-trigger').each(function (index) { var $this = $(this); var data = $this.da...
2012/05/23
[ "https://Stackoverflow.com/questions/10721951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52360/" ]
Something like this - **It does convert `offset-x` to `offsetX`:** <http://jsfiddle.net/8C4rZ/1/> HTML: ``` <p data-test="sdsd" data-test2="4434"></p>​ ``` JavaScript: ``` $(document).ready(function() { var options = {}; for (var key in $("p").data()) { options[key] = $("p").data(key); } ...
Try using a for in loop. ``` var array = ['class-name', 'align-x', 'align-y', 'offset-y', 'offset-x']; for (x in array) { if(data[array[x]]) { options[array[x]] = data[array[x]]; } } ``` **Update:** In response to the OP's clarification, he could write something like this: ``` var Pair = function(hy...
10,721,951
I have the following jQuery script to intialise a jQuery plugin called poshytips. I want configure the plugin using Html5 data attributes. I am repeating myself big time, can anyone come up with a better way to do this? ``` $('.poshytip-trigger').each(function (index) { var $this = $(this); var data = $this.da...
2012/05/23
[ "https://Stackoverflow.com/questions/10721951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52360/" ]
I would use a for..in loop to read the data-\* tags.. Also you don't need to camelcase as jQuery converts it to camelCase internally... [Source code reference](https://github.com/jquery/jquery/blob/master/src/data.js#L102). ``` $('.poshytip-trigger').each(function (index) { var $this = $(this); var data = $thi...
Try using a for in loop. ``` var array = ['class-name', 'align-x', 'align-y', 'offset-y', 'offset-x']; for (x in array) { if(data[array[x]]) { options[array[x]] = data[array[x]]; } } ``` **Update:** In response to the OP's clarification, he could write something like this: ``` var Pair = function(hy...
10,721,951
I have the following jQuery script to intialise a jQuery plugin called poshytips. I want configure the plugin using Html5 data attributes. I am repeating myself big time, can anyone come up with a better way to do this? ``` $('.poshytip-trigger').each(function (index) { var $this = $(this); var data = $this.da...
2012/05/23
[ "https://Stackoverflow.com/questions/10721951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52360/" ]
I would use a for..in loop to read the data-\* tags.. Also you don't need to camelcase as jQuery converts it to camelCase internally... [Source code reference](https://github.com/jquery/jquery/blob/master/src/data.js#L102). ``` $('.poshytip-trigger').each(function (index) { var $this = $(this); var data = $thi...
Something like this - **It does convert `offset-x` to `offsetX`:** <http://jsfiddle.net/8C4rZ/1/> HTML: ``` <p data-test="sdsd" data-test2="4434"></p>​ ``` JavaScript: ``` $(document).ready(function() { var options = {}; for (var key in $("p").data()) { options[key] = $("p").data(key); } ...
10,721,951
I have the following jQuery script to intialise a jQuery plugin called poshytips. I want configure the plugin using Html5 data attributes. I am repeating myself big time, can anyone come up with a better way to do this? ``` $('.poshytip-trigger').each(function (index) { var $this = $(this); var data = $this.da...
2012/05/23
[ "https://Stackoverflow.com/questions/10721951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52360/" ]
Something like this - **It does convert `offset-x` to `offsetX`:** <http://jsfiddle.net/8C4rZ/1/> HTML: ``` <p data-test="sdsd" data-test2="4434"></p>​ ``` JavaScript: ``` $(document).ready(function() { var options = {}; for (var key in $("p").data()) { options[key] = $("p").data(key); } ...
``` var names = ["className", "alignY", ...]; $(names).each(function(ind, name){ var dataName = name.replace(/[A-Z]/, function(letter){ return letter.toLowerCase(); }); if(data[dataName]){ options[name] = data[dataName]; } }); ``` Does this work? Unlike the other answers, this piece of...
10,721,951
I have the following jQuery script to intialise a jQuery plugin called poshytips. I want configure the plugin using Html5 data attributes. I am repeating myself big time, can anyone come up with a better way to do this? ``` $('.poshytip-trigger').each(function (index) { var $this = $(this); var data = $this.da...
2012/05/23
[ "https://Stackoverflow.com/questions/10721951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52360/" ]
I would use a for..in loop to read the data-\* tags.. Also you don't need to camelcase as jQuery converts it to camelCase internally... [Source code reference](https://github.com/jquery/jquery/blob/master/src/data.js#L102). ``` $('.poshytip-trigger').each(function (index) { var $this = $(this); var data = $thi...
``` var names = ["className", "alignY", ...]; $(names).each(function(ind, name){ var dataName = name.replace(/[A-Z]/, function(letter){ return letter.toLowerCase(); }); if(data[dataName]){ options[name] = data[dataName]; } }); ``` Does this work? Unlike the other answers, this piece of...
68,961,129
I have some multithreaded code that involves using a nested loop, where the inner one is run in parallel. "Shared" across each thread is a `Sender` that will return results. Notably `Sender` implements `Send` so there should be no problem cloning it and sending it using Rayon's `for_each_with()`. However, compiling thi...
2021/08/28
[ "https://Stackoverflow.com/questions/68961129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2148718/" ]
AFAIK, Rayon use a threadpool, this mean that rayon require the item to implement `Send` cause it will send it to a thread. rayon doesn't clone for each item but for each thread: ```rust fn for_each_with<OP, T>(self, init: T, op: OP) where OP: Fn(&mut T, Self::Item) + Sync + Send, T: Send + Clone, ``` We can...
`Sender` is made to be cloned, its literally [in the docs](https://doc.rust-lang.org/std/sync/mpsc/fn.channel.html). Each child thread has to have its own sender.
68,694,853
When I tried to implement an express get service call with a mongoose find method it is giving me '*Product.find*' is not a function error. FYI-'Product' is the mongoose model which I imported . ROUTES FILE ----------- ``` const express = require('express'); const routes = express.Router(); const Product = require('...
2021/08/07
[ "https://Stackoverflow.com/questions/68694853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7697231/" ]
When you are exporting the model like `exports.Product`,you need to import the model in routes file as an object. ``` const {Product} = require('../models/product'); ``` OR we can use `module.exports` instead of `exports.Product` without making any changes in the import of routes file.
Because you are not importing your model in route file. Better if you can use `module.exports` instead of exports.Product.