problem
stringlengths 26
131k
| labels
class label 2
classes |
|---|---|
what difference there are between x 509 certificate and X509CertificateHolder java? : So i have a problem, i cant´t understand the difference between x509certificate and X509CertificateHolder java, because there are not who explain, of correct form, everybody do code but, they are not specific, what do in those lines, and the documentation is a little hard to understand, if someone can help me, i'll be very grateful, thanks.
| 0debug
|
Fill in bash array with script arguments : <p>I got a request to pass a list of ip's as an array in a bash script. For example:</p>
<p>./myscript.sh 192.168.0.1,192.168.0.10,192.168.0.15......</p>
<p>The ip's in the above parameter should properly populate the array present in the bash script. I would like it if anyone can show it in conjunction with the getopts utlity.</p>
<p>FYI - I'm fairly new to bash, so please be understanding......</p>
| 0debug
|
void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq)
{
assert(dev->nirqs < ARRAY_SIZE(dev->isairq));
if (isabus->assigned & (1 << isairq)) {
hw_error("isa irq %d already assigned", isairq);
}
isabus->assigned |= (1 << isairq);
dev->isairq[dev->nirqs] = isairq;
*p = isabus->irqs[isairq];
dev->nirqs++;
}
| 1threat
|
I want to the copy content of a txt file to another file after I match a string in C# : I have a Console File,
I need to match a string ("Seq Started"), And if I get the string I want to copy all text till I get another string("Seq Ended") in a txt file.
| 0debug
|
Can't import PostgreSQL10 dump into 9.6 database : <p><strong><em>I need to somehow convert a v10 dump file into one which is 9.6 compatible</em></strong> </p>
<p>Google's Cloud SQL runs PostgreSQL version 9.6 and my database has been running on version 10 since its creation. </p>
<p><strong>THE ISSUE</strong>: When trying to import the database into Cloud SQL, I get the <code>an unknown error has occurred.</code> message of death.</p>
<p><em>I have already tried commenting out my postgis / other extensions when importing to Cloud SQL but, to no avail.</em></p>
<p>I have tried using using <code>psql my_96_db < my_10.sql</code> and get tons of errors like this:</p>
<pre><code>...
CREATE TABLE
ERROR: syntax error at or near "AS"
LINE 2: AS integer
^
ERROR: relation "authentication_phonecontact_id_seq" does not exist
CREATE TABLE
...
</code></pre>
<p>I have tried using postgres 9.6's pg_restore on my v10 <code>pg_dump -Fc</code> command, but it will not successfully import into a 9.6 database. An example of one of the many failures in the output is </p>
<pre><code>pg_restore: [archiver (db)] could not execute query: ERROR: relation "public.authentication_referral_id_seq" does not exist
LINE 1: SELECT pg_catalog.setval('public.authentication_referral_id_...
^
Command was: SELECT pg_catalog.setval('public.authentication_referral_id_seq', 1, false);
</code></pre>
| 0debug
|
document.location = 'http://evil.com?username=' + user_input;
| 1threat
|
X86CPU *cpu_x86_create(const char *cpu_model, Error **errp)
{
X86CPU *cpu = NULL;
ObjectClass *oc;
CPUClass *cc;
gchar **model_pieces;
char *name, *features;
Error *error = NULL;
const char *typename;
model_pieces = g_strsplit(cpu_model, ",", 2);
if (!model_pieces[0]) {
error_setg(&error, "Invalid/empty CPU model name");
goto out;
}
name = model_pieces[0];
features = model_pieces[1];
oc = x86_cpu_class_by_name(name);
if (oc == NULL) {
error_setg(&error, "Unable to find CPU definition: %s", name);
goto out;
}
cc = CPU_CLASS(oc);
typename = object_class_get_name(oc);
cc->parse_features(typename, features, &error);
cpu = X86_CPU(object_new(typename));
if (error) {
goto out;
}
out:
if (error != NULL) {
error_propagate(errp, error);
if (cpu) {
object_unref(OBJECT(cpu));
cpu = NULL;
}
}
g_strfreev(model_pieces);
return cpu;
}
| 1threat
|
Hi, When i update my info the session is destroyed if i remove destroy session then the mesage does not vanish on refresh : When i update my info the session is destroyed if i remove destroy
session
then the mesage does not vanish on refresh
<?php if(isset($_SESSION['loginfail']))
{$msg = $_SESSION['loginfail']; ?>
<div class="alert alert-success alert-dismissable">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×
</a>
<?php echo $msg; ?>
</div>
<?php }
session_unset();
session_destroy();`enter code here`
?>
| 0debug
|
How to distinguish variables which have same ASCII character codes : As I said in title, how can I distinguish two variables which have same ASCII codes. In this code block, K's and left arrow key's ASCII codes are same, so when I type capital k case 75 works. How can I fix it? Also I got this problem with some other words.
switch( ch2 = getch())
{
case 75: printf("LEFT WAS PRESSED\n");
break;
default:
for(i=' ';i<'}';i++)
{
if(i == ch2)
{
blabla
}
break;
}
| 0debug
|
I want to stroed data of client side slider in temporary using javascript : 1. I have using one slider from client side that slider containing 4
question n question having 4 option of the answer.
2. user have select any one from them n go to next question.
3. i want to that user selected answer in temporarily stored in some where using javascript.
4. Please help me how to create the javascript for that.end
sorry for my english language.
------------------------------------------------------------------------
[enter image description here][1][enter image description here][2]
[1]: http://i.stack.imgur.com/qYNE7.png
[2]: http://i.stack.imgur.com/4I1lJ.png
**code:**
<div class='home' style="background-color: #e4ceb4 !important">
<section class='start-invest'>
<div class='wrapper'>
<div class='unslider' data-unslider='true' id='unslider' style='display:none;'>
<ul class='nolist'>
<li>
<div class='slide-counter'>
<div class='inner-d'>
<span>1/4</span>
</div>
</div>
<!-- 1 -->
<div class='hide' data-slide-no='1'></div>
<div class='start-heading'>Start your Investment Plan</div>
<!-- For Mobile -->
<div class='slider-nav'>
<span>1</span>/4
</div>
<div class='age-income'>
I am
<input autocomplete='off' autofocus class='age' id='age' maxlength='2' placeholder='' tabindex='1' type='text'>
years old &
<br class='br'>
earn
<br class='break'>a
Gross annual income
<br class='br'>of
<i class='fa fa-inr'></i>
<input class='income' id='income' maxlength='13' placeholder='' tabindex='2' type='text'>
</div>
<div class='cta-next'>
<button class='btn' id='next-btn' tabindex='3'>
Next
</button>
</div>
</li>
<li>
<div class='slide-counter'>
<div class='inner-d'>
<span>2/4</span>
</div>
</div>
<!-- 2 -->
<div class='hide' data-slide-no='2'></div>
<div class='start-heading'>Start your Investment Plan</div>
<!-- For Mobile -->
<div class='slider-nav'>
<span>2</span>/4
</div>
<div class='age-income'>
How long do you intend
<br class='br'>to
remain invested?
</div>
<div class='btn-set' id="Opt1">
<button id="Opt5" name="button" type="submit" class="wh-btn optn-btn risk-by-time-btns" data-risk-factor="10.5" value="1 to 3 yrs">1 to 3 yrs</button>
<button id="Opt2" name="button" type="submit" class="wh-btn optn-btn risk-by-time-btns" data-risk-factor="24.5" value="3 to 5 yrs">3 to 5 yrs</button>
<button id="Opt3" name="button" type="submit" class="wh-btn optn-btn risk-by-time-btns" data-risk-factor="28" value="5 to 7 yrs">5 to 7 yrs</button>
<button id="Opt4" name="button" type="submit" class="wh-btn optn-btn risk-by-time-btns" data-risk-factor="31.5" value="Greater than 7 yrs">Greater than 7 yrs</button>
</div>
</li>
<li>
<div class='slide-counter'>
<div class='inner-d'>
<span>3/4</span>
</div>
</div>
<!-- 3 -->
<div class='hide' data-slide-no='3'></div>
<div class='start-heading'>Start your Investment Plan</div>
<!-- For Mobile -->
<div class='slider-nav'>
<span>3</span>/4
</div>
<div class='age-income'>
What are you looking at from your
<br class='br'>investment?
</div>
<div class='btn-set'>
<button name="button" type="submit" class="wh-btn optn-btn goal-btns" data-risk-factor="10.5">
Safety
<br class='br'>
<span class='tip'>I prioritise safety of my principal at the top and expect to achieve returns that equal inflation</span>
</button><button name="button" type="submit" class="wh-btn optn-btn lg goal-btns" data-risk-factor="17.5">
Safety +
<br class='br-lg'>
Moderate Growth
<br class='br'>
<span class='tip'>While I would like to protect my principal, I will be happy with returns that beat inflation</span>
</button><button name="button" type="submit" class="wh-btn optn-btn goal-btns" data-risk-factor="26.25">
Growth
<br class='br'>
<span class='tip'>I seek to grow my capital in line with the stock market performance over a longer period of time while being able to accept short term volatilities</span>
</button><button name="button" type="submit" class="wh-btn optn-btn goal-btns lg" data-risk-factor="31.5">
Aggressive
<br class='br-lg'>
Growth
<br class='br'>
<span class='tip'>I would like to take the stock market returns and beat them hands down with my portfolio performance! I will digest the volatility that accompanies my style</span>
</button>
</div>
</li>
<li id='risk-buttons'>
<div class='slide-counter'>
<div class='inner-d'>
<span>4/4</span>
</div>
</div>
<!-- 4 -->
<div class='hide' data-slide-no='4'></div>
<div class='start-heading'>Start your Investment Plan</div>
<!-- For Mobile -->
<div class='slider-nav'>
<span>4</span>/4
</div>
<div class='age-income'>
How do you rate yourself
<br class='br'>
on Risk Tolerance?
<sup>*</sup>
</div>
<!-- For Mobile -->
<div class='risk-sm'>
* Risk tolerance is an important component in investing. An individual should have a realistic understanding of
<br class='br-lg'>
his or her ability and willingness to stomach large swings in the value of his or her investments.
</div>
<div class='btn-set'>
<button name="button" type="submit" class="wh-btn sure risk-willingness-btns" data-risk-factor="3">
Very Low
<span class='tip'>I cannot tolerate any loss</span>
</button><button name="button" type="submit" class="wh-btn sure risk-willingness-btns" data-risk-factor="6">
Low
<span class='tip'>I can tolerate up to 5% loss in a short term dip</span>
</button><button name="button" type="submit" class="wh-btn sure risk-willingness-btns" data-risk-factor="9">
Medium
<span class='tip'>I can tolerate up to a 10% loss in a short term dip</span>
</button><button name="button" type="submit" class="wh-btn sure risk-willingness-btns" data-risk-factor="11.25">
High
<span class='tip'>I can tolerate up to a 25% loss in a short term dip</span>
</button><button name="button" type="submit" class="wh-btn sure risk-willingness-btns" id="very_high_tolerance" data-risk-factor="13.5">
Very High
<span class='tip'>I can tolerate greater than 25% loss in a short term dip</span>
</button><button name="button" type="submit" class="wh-btn unsure risk-willingness-btns" data-risk-factor="0">
Unsure
<span class='tip'></span>
</button>
</div>
<div class='cta hide' id='okay-cta'>
<small>Still unsure? Answer a few more questions for us!</small>
<br>
<button class='btn' id='okay-btn'>OKAY</button>
</div>
<div class='cta hide' id='compute-cta'>
<button class='btncompute btn compute' id="compute" onclick=" Progressbar()">COMPUTE</button><div>
</div>
</div>
<!-- For Desktop -->
<div class='risk-lg'>
* Risk tolerance is an important component in investing. An individual should have a realistic understanding of
<br class='br-lg'>
his or her ability and willingness to stomach large swings in the value of his or her investments.
</div>
</li>
<!-- 4.1 -->
<li>
<div class='slide-counter'>
<div class='inner-d'>
<span>
4.1 /
<br>4.4</br>
</span>
</div>
</div>
<div class='hide' data-slide-no='5'></div>
<div class='start-heading'>Start your Investment Plan</div>
<!-- For Mobile -->
<div class='slider-nav'>
<span>4</span>/4
</div>
<div class='age-income'>
By how much would your investments need
<br class='break'>
to go down to cause you discomfort?
</div>
<div class='btn-set'>
<button name="button" type="submit" class="wh-btn optn-btn investment-fall-threshold-btns" data-risk-factor="0.75">
Any fall
</button><button name="button" type="submit" class="wh-btn optn-btn investment-fall-threshold-btns" data-risk-factor="1.5">
By 10%
</button><button name="button" type="submit" class="wh-btn optn-btn investment-fall-threshold-btns" data-risk-factor="2.25">
By 25%
</button><button name="button" type="submit" class="wh-btn optn-btn investment-fall-threshold-btns" data-risk-factor="3.375">
By more than 25%
</button>
</div>
</li>
<!-- 4.2 -->
<li>
<div class='slide-counter'>
<div class='inner-d'>
<span>
4.2 /
<br>4.4</br>
</span>
</div>
</div>
<div class='hide' data-slide-no='6'></div>
<div class='start-heading'>Start your Investment Plan</div>
<!-- For Mobile -->
<div class='slider-nav'>
<span>4</span>/4
</div>
<div class='age-income'>
While making investments, what do you care for most?
</div>
<div class='btn-set'>
<button name="button" type="submit" class="wh-btn optn-btn lg investment-care-btns" data-risk-factor="0.75">
Minimizing Losses
</button><button name="button" type="submit" class="wh-btn optn-btn lg investment-care-btns" data-risk-factor="1.875">
Both Equally
</button><button name="button" type="submit" class="wh-btn optn-btn lg investment-care-btns" data-risk-factor="3.375">
Maximising Gains
</button>
</div>
</li>
<!-- 4.3 -->
<li>
<div class='slide-counter'>
<div class='inner-d'>
<span>
4.3 /
<br>4.4</br>
</span>
</div>
</div>
<div class='hide' data-slide-no='7'></div>
<div class='start-heading'>Start your Investment Plan</div>
<!-- For Mobile -->
<div class='slider-nav'>
<span>4</span>/4
</div>
<div class='age-income'>
While deciding between two jobs,
<br class='break'>
which will you go for?
</div>
<div class='btn-set'>
<button name="button" type="submit" class="wh-btn optn-btn lg job-choice-btns" data-risk-factor="0.75">
The one with high job security
<br class='break'>
and low pay increase
</br>
</button><button name="button" type="submit" class="wh-btn optn-btn lg job-choice-btns" data-risk-factor="1.875">
Can't say as it depends on
<br class='break'>
other factors as well
</br>
</button><button name="button" type="submit" class="wh-btn optn-btn lg job-choice-btns" data-risk-factor="3.375">
The one with less job security
<br class='break'>
but high pay increase
</br>
</button>
</div>
</li>
<!-- 4.4t -->
<li>
<div class='slide-counter'>
<div class='inner-d'>
<span>
4.4 /
<br>4.4</br>
</span>
</div>
</div>
<div class='hide' data-slide-no='8'></div>
<div class='start-heading'>Start your Investment Plan</div>
<!-- For Mobile -->
<div class='slider-nav'>
<span>4</span>/4
</div>
<div class='age-income'>
How do you rate your willingness to take investment
<br class='break'>
risks relative to the general population?
</div>
<div class='btn-set'>
<button name="button" type="submit" class="wh-btn relative-risk-willingness-btns" data-risk-factor="0.75">
Very Low
<br class='break risk-rel-pop'>
Risk-taker
</br>
</button><button name="button" type="submit" class="wh-btn relative-risk-willingness-btns" data-risk-factor="1.5">
Low
<br class='break risk-rel-pop'>
Risk-taker
</br>
</button><button name="button" type="submit" class="wh-btn relative-risk-willingness-btns" data-risk-factor="2.25">
Medium
<br class='break risk-rel-pop'>
Risk-taker
</br>
</button><button name="button" type="submit" class="wh-btn relative-risk-willingness-btns" data-risk-factor="2.8125">
High
<br class='break risk-rel-pop'>
Risk-taker
</br>
</button><button name="button" type="submit" class="wh-btn relative-risk-willingness-btns" data-risk-factor="3.375">
Very High
<br class='break risk-rel-pop'>
Risk-taker
</br>
</button>
</div>
<div class='cta'>
<button class='btn compute hide btncompute' onclick=" Progressbar()" id="compute">COMPUTE</button>
</div>
</li>
</ul>
<a class="unslider-arrow next tooltip" href="#">
<span class='error-message'>
ZAPP!
<br>
Please pick an
<br>
option before we
<br>
move ahead.
</span>
<span class='error-message-input'></span>
</a><a class="unslider-arrow prev" href="#"></a>
</div>
</div>
</section>
<div class='hide' id='progress'>
<div class='wrapper of-hidden'>
<div class='orange-text'></div>
<div class='white-text'></div>
<div class="safari chart" data-percent="100" style="align-content: center ;margin-left: auto; margin-right: auto; width: 6em">
<img class="tag" src="~/Image/spinner.gif" style="align-content: center ;margin-left: auto; margin-right: auto; width: 6em" />
</div>
</div>
</div>
</div>
| 0debug
|
Why do js files sometins load with errors? : I use several script libraries on [this site][1], including Amcharts for instance.
I have noticed that sometimes they don't load properly and there can be no table oк no chart. I have tried to place them both in head and footer, but it doesn't change anything. Is there a way to make it correct?
[1]: https://quanthill.ru/
| 0debug
|
C index in string inside array : <p>How can I access char from strings inside array of strings in index 1, but with pointer way I mean this way *(abc + i) for e.g:</p>
<pre><code>int main(int argc, char** argv)// argc =2, argv = file name and "abcd"
{
printf("%c",____)//<--- here i want b from argv
...
}
</code></pre>
| 0debug
|
Evaluating pytorch models: `with torch.no_grad` vs `model.eval()` : <p>When I want to evaluate the performance of my model on the validation set, is it preferred to use:</p>
<ul>
<li><code>with torch.no_grad:</code></li>
</ul>
<p>Or</p>
<ul>
<li><code>model.eval()</code></li>
</ul>
| 0debug
|
import math
def get_Pos_Of_Right_most_Set_Bit(n):
return int(math.log2(n&-n)+1)
def set_Right_most_Unset_Bit(n):
if (n == 0):
return 1
if ((n & (n + 1)) == 0):
return n
pos = get_Pos_Of_Right_most_Set_Bit(~n)
return ((1 << (pos - 1)) | n)
| 0debug
|
static int coroutine_fn bdrv_co_do_pwritev(BlockDriverState *bs,
int64_t offset, unsigned int bytes, QEMUIOVector *qiov,
BdrvRequestFlags flags)
{
BdrvTrackedRequest req;
uint64_t align = MAX(BDRV_SECTOR_SIZE, bs->request_alignment);
uint8_t *head_buf = NULL;
uint8_t *tail_buf = NULL;
QEMUIOVector local_qiov;
bool use_local_qiov = false;
int ret;
if (!bs->drv) {
return -ENOMEDIUM;
}
if (bs->read_only) {
return -EACCES;
}
if (bdrv_check_byte_request(bs, offset, bytes)) {
return -EIO;
}
if (bs->io_limits_enabled) {
bdrv_io_limits_intercept(bs, bytes >> BDRV_SECTOR_BITS, true);
}
tracked_request_begin(&req, bs, offset, bytes, true);
if (offset & (align - 1)) {
QEMUIOVector head_qiov;
struct iovec head_iov;
mark_request_serialising(&req, align);
wait_serialising_requests(&req);
head_buf = qemu_blockalign(bs, align);
head_iov = (struct iovec) {
.iov_base = head_buf,
.iov_len = align,
};
qemu_iovec_init_external(&head_qiov, &head_iov, 1);
ret = bdrv_aligned_preadv(bs, &req, offset & ~(align - 1), align,
align, &head_qiov, 0);
if (ret < 0) {
goto fail;
}
qemu_iovec_init(&local_qiov, qiov->niov + 2);
qemu_iovec_add(&local_qiov, head_buf, offset & (align - 1));
qemu_iovec_concat(&local_qiov, qiov, 0, qiov->size);
use_local_qiov = true;
bytes += offset & (align - 1);
offset = offset & ~(align - 1);
}
if ((offset + bytes) & (align - 1)) {
QEMUIOVector tail_qiov;
struct iovec tail_iov;
size_t tail_bytes;
mark_request_serialising(&req, align);
wait_serialising_requests(&req);
tail_buf = qemu_blockalign(bs, align);
tail_iov = (struct iovec) {
.iov_base = tail_buf,
.iov_len = align,
};
qemu_iovec_init_external(&tail_qiov, &tail_iov, 1);
ret = bdrv_aligned_preadv(bs, &req, (offset + bytes) & ~(align - 1), align,
align, &tail_qiov, 0);
if (ret < 0) {
goto fail;
}
if (!use_local_qiov) {
qemu_iovec_init(&local_qiov, qiov->niov + 1);
qemu_iovec_concat(&local_qiov, qiov, 0, qiov->size);
use_local_qiov = true;
}
tail_bytes = (offset + bytes) & (align - 1);
qemu_iovec_add(&local_qiov, tail_buf + tail_bytes, align - tail_bytes);
bytes = ROUND_UP(bytes, align);
}
ret = bdrv_aligned_pwritev(bs, &req, offset, bytes,
use_local_qiov ? &local_qiov : qiov,
flags);
fail:
tracked_request_end(&req);
if (use_local_qiov) {
qemu_iovec_destroy(&local_qiov);
qemu_vfree(head_buf);
qemu_vfree(tail_buf);
}
return ret;
}
| 1threat
|
unqualified-id error before ')' token : <p>I am new to stack overflow and I would appreciate feedback. I am creating a template graph class and have split it into two files graph.h and graph.hpp, but everytime I compile I get this error:</p>
<pre><code> In file included from graph.h:97:0,
from main.cpp:2:
graph.hpp:4:26: error: expected unqualified-id before ‘)’ token
typename graph<T>::graph(){
^
makefile:2: recipe for target 'executable.x' failed
</code></pre>
<p>Here is my graph.hpp file so far:</p>
<pre><code>#include "graph.h"
//template <typename T>
typename graph<T>::graph(){
numVertices = 0;
graphWeight = 0;
}
</code></pre>
<p>And my graph.h file looks something like:</p>
<pre><code>template <typename T>
class graph{
public:
graph();
.
.
.
private:
};
</code></pre>
<p>Also, my main.cpp is just simply:</p>
<pre><code>#include "graph.h"
int main(){
graph<int> g;
}
</code></pre>
<p>What could possibly be wrong? I know it's probably something simple that has to do with the template.</p>
<p>Thanks</p>
| 0debug
|
How to create a a:d:b vector to create and display "sin(0), sin(pi/n), sin((2*pi)/n), . . . , sin(2*pi)]" : <p>I have been trying for a while to get this to work but I don't seem to be getting any closer to a solution.</p>
<p>I'm not sure of what the pattern is and what to write for the "d" value in a:d:b</p>
| 0debug
|
av_cold int avcodec_close(AVCodecContext *avctx)
{
if (ff_lockmgr_cb) {
if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
return -1;
}
entangled_thread_counter++;
if (entangled_thread_counter != 1) {
av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n");
entangled_thread_counter--;
return -1;
}
if (avcodec_is_open(avctx)) {
if (HAVE_THREADS && avctx->internal->frame_thread_encoder && avctx->thread_count > 1) {
entangled_thread_counter --;
ff_frame_thread_encoder_free(avctx);
entangled_thread_counter ++;
}
if (HAVE_THREADS && avctx->thread_opaque)
ff_thread_free(avctx);
if (avctx->codec && avctx->codec->close)
avctx->codec->close(avctx);
avcodec_default_free_buffers(avctx);
avctx->coded_frame = NULL;
avctx->internal->byte_buffer_size = 0;
av_freep(&avctx->internal->byte_buffer);
av_freep(&avctx->internal);
}
if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)
av_opt_free(avctx->priv_data);
av_opt_free(avctx);
av_freep(&avctx->priv_data);
if (av_codec_is_encoder(avctx->codec))
av_freep(&avctx->extradata);
avctx->codec = NULL;
avctx->active_thread_type = 0;
entangled_thread_counter--;
if (ff_lockmgr_cb) {
(*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_RELEASE);
}
return 0;
}
| 1threat
|
Using decltype to declare the entire function type itself (not pointer!) : <p>So I have a function with a specific signature in a header file, and I want to declare another function with the exact same signature inside a class <strong>without</strong> typing the parameters again, and of course, hopefully without a macro... The member function should also have an extra hidden parameter obviously, the <code>this</code> pointer (since it's not a static member function).</p>
<p>Now, I'm actually surprised that the following hack/trick <em>works</em> in both GCC and ICC, but I'm not sure if it's "legal" C++. I'm not particularly concerned with legality <em>if it's a supported extension</em>, but unfortunately I do not want it to break on a compiler version update because some people decided to <em>arbitrarily block</em> this useful feature since the standard says "no" (that kind of stuff really annoys me to be honest).</p>
<p>Here's what I mean:</p>
<pre><code>// test.hpp
int func(int x) { return x; }
struct foo
{
decltype(func) fn; // <-- legal?
};
int test()
{
return foo().fn(6);
}
// then in test.cpp
int foo::fn(int x) { return x + 42; }
</code></pre>
<p>This <em>works</em> (with GCC and ICC), but I don't know if it's "legal" in the standard. I'm asking just to be assured that it is legal and it won't suddenly stop working in the future.</p>
<p>(if it's not legal and you want to report it as a bug, please mark it as a suggestion to make it a legal compiler extension instead of killing it...)</p>
<p>Basically, it's the same as declaring <code>int fn(int x);</code> in the struct, and that's how it works currently.</p>
<p>If you ask me for a use case: it's to declare a wrapper member function for the other free function which does something with the <code>this</code> pointer before passing it to the free function. Its parameters must match exactly, obviously. Again, I don't want to type the parameters again.</p>
| 0debug
|
code not finished but whenever I try to run the code all I see is a black screen I dont see any of the lines or the x drawings that I made? : I'm creating a tic tac toe game in open gl Im not finished yet but whenever I run my code all I see is a black screen I do not see the lines that I have drawn or the X?
#include<stdlib.h>
#include<math.h>
#include<time.h>
#include<string.h>
#include <GLut/glut.h>
using namespace std;
int matrix [3][3]; // board for the gameplay of tic tac toe we are using a 3x3 matrix board
int turn; // indicates whose turn it is going to be
bool gameover; // is the game over would you like to end the game
int result;// the ending result of the game
void begin()
{
turn=1;
for(int i=0;i<3;i++) // setting up the board and clearing the matrix we start at 1, basically clearing our matrix
{
for(int j=0;j<3;j++)
matrix[i][j]=0;
}
}
void drawxo() // setting up our X and O if it is 1 then we want to use x and if it is 2 then 0
{
for(int i = 0; i <= 2; i++)
{
for(int j = 0; j <= 2; j++)
{
if(matrix[i][j] == 1) //if it is 1 then draw x
{
glBegin(GL_LINES);
glVertex2f(50 + j * 100 - 25, 100 + i * 100 - 25);
glVertex2f(50 + j * 100 + 25, 100 + i * 100 + 25);
glVertex2f(50 + j * 100 - 25, 100 + i * 100 + 25);
glVertex2f(50 + j * 100 + 25, 100 + i * 100 - 25);
glEnd();
}
else if(matrix[i][j] == 2) //if it is 2 then draw o
{
glBegin(GL_LINE_LOOP);
glVertex2f(50 + j * 100 - 25, 100 + i * 100 - 25);
glVertex2f(50 + j * 100 - 25, 100 + i * 100 + 25);
glVertex2f(50 + j * 100 + 25, 100 + i * 100 + 25);
glVertex2f(50 + j * 100 + 25, 100 + i * 100 - 25);
glEnd();
}
}
}
}
void DrawString(void *font,const char s[],float x,float y)
{
unsigned int i;
glRasterPos2f(x,y);
for(i=0;i<strlen(s);i++)
{
glutBitmapCharacter(font,s[i]);
}
}
void drawLines()
{
glBegin(GL_LINES);
glColor3f(0, 0, 0);
//2 vertical lines
glVertex2f(100, 50);
glVertex2f(100, 340);
glVertex2f(200, 340);
glVertex2f(200, 50);
//2 horizontal lines
glVertex2f(0, 150);
glVertex2f(300, 150);
glVertex2f(0, 250);
glVertex2f(300, 250);
glEnd();
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(1, 1, 1, 1);
glColor3f(0, 0, 0);
if(turn == 1)
DrawString(GLUT_BITMAP_HELVETICA_18, "Player1's turn", 100, 30);
drawxo();
drawLines();
glutSwapBuffers();
}
void KeyPress(unsigned char key, int x, int y)
{
switch (key)
{
case 27: // the escape key to exit the program
exit (0);
break;
case 'y':
if (gameover = true) {
gameover = false;
begin();
}
break;
case 'n' :
if (gameover = true) {
exit(0);
}
break;
}
}
int main(int argc, char **argv)
{
begin();
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE);
glutInitWindowPosition(550,200);
glutInitWindowSize(300,350);
glutCreateWindow("Tic tac toe");
glutDisplayFunc(display);
glutKeyboardFunc(KeyPress);
glutIdleFunc(display);
glutMainLoop();
}
| 0debug
|
Basic plot in python : I have a data frame looks like -
id age_bucket state gender duration category1 is_active
1 (40, 70] Jammu and Kashmir m 123 ABB 1
2 (17, 24] West Bengal m 72 ABB 0
3 (40, 70] Bihar f 109 CA 0
4 (17, 24] Bihar f 52 CA 1
5 (24, 30] MP m 23 ACC 1
6 (24, 30] AP m 103 ACC 1
7 (30, 40] West Bengal f 182 GF 0
In this dataframe my dependent column is 'is_active'. I want bar plot (for age_bucket, state (top 10) and pie chart (for gender and category1) in python. Top of the bar it will display the total count for active and inactive members and similarly % should be display on pie chart based on is_active.
How to do it in python?
| 0debug
|
void aio_set_event_notifier(AioContext *ctx,
EventNotifier *e,
bool is_external,
EventNotifierHandler *io_notify,
AioPollFn *io_poll)
{
AioHandler *node;
qemu_lockcnt_lock(&ctx->list_lock);
QLIST_FOREACH(node, &ctx->aio_handlers, node) {
if (node->e == e && !node->deleted) {
break;
}
}
if (!io_notify) {
if (node) {
g_source_remove_poll(&ctx->source, &node->pfd);
if (qemu_lockcnt_count(&ctx->list_lock)) {
node->deleted = 1;
node->pfd.revents = 0;
} else {
QLIST_REMOVE(node, node);
g_free(node);
}
}
} else {
if (node == NULL) {
node = g_new0(AioHandler, 1);
node->e = e;
node->pfd.fd = (uintptr_t)event_notifier_get_handle(e);
node->pfd.events = G_IO_IN;
node->is_external = is_external;
QLIST_INSERT_HEAD_RCU(&ctx->aio_handlers, node, node);
g_source_add_poll(&ctx->source, &node->pfd);
}
node->io_notify = io_notify;
}
qemu_lockcnt_unlock(&ctx->list_lock);
aio_notify(ctx);
}
| 1threat
|
rxjs-tslint vs rxjs-tslint-rules packages : <p>I used to use <a href="https://cartant.github.io/rxjs-tslint-rules/" rel="noreferrer"><code>rxjs-tslint-rules</code></a> package to be aware of RxJS-related issues in my projects. It was added to <code>devDependencies</code> section of my projects' <code>package.json</code> files.</p>
<p>Now, there is <a href="https://github.com/ReactiveX/rxjs-tslint" rel="noreferrer"><code>rxjs-tslint</code></a> package which adds a few more rules specific to RxJS 6 and <code>rxjs-5-to-6-migrate</code> tool.</p>
<p>After migration, if I still want those</p>
<ul>
<li><code>rxjs-collapse-imports</code></li>
<li><code>rxjs-pipeable-operators-only</code></li>
<li><code>rxjs-no-static-observable-methods</code></li>
<li><code>rxjs-proper-imports</code></li>
</ul>
<p>rules to be checked by TSLint, do I need to add them to my <code>tslint.json</code> and <code>rxjs-tslint</code> package to my <code>devDependencies</code>? Or <code>rxjs-tslint</code> package is intended to be a one time migration assistant and rules it currently provides are covered by the bigger <code>rxjs-tslint-rules</code> package?</p>
| 0debug
|
how to export and import style in npm package? : <p>I have a react component and I publish the component in NPM registry that I build with webpack. In my main project I consumed the component npm package JS like that:</p>
<pre><code>Import myComp from 'myComp';
</code></pre>
<p>The problem is that myComp also have CSS, that I build into <code>dist/index.css</code> with the help of webpack and ExtractTextPlugin (which build all the css into one file).</p>
<p>And I want to consume the style like this:</p>
<pre><code>Import 'myComp/index.css';
</code></pre>
<p>Or</p>
<pre><code>Import 'myComp/index';
</code></pre>
<p>And in myComp npm package I want to expose it in a way that will support this import method.</p>
<p>NOTE: i don't want to import it directly from <code>node_modules</code></p>
<pre><code>Import '../../../node_modules/myComp/index.css'; // bad
</code></pre>
<p>Thanks!</p>
| 0debug
|
static void slavio_check_interrupts(SLAVIO_INTCTLState *s, int set_irqs)
{
uint32_t pending = s->intregm_pending, pil_pending;
unsigned int i, j;
pending &= ~s->intregm_disabled;
trace_slavio_check_interrupts(pending, s->intregm_disabled);
for (i = 0; i < MAX_CPUS; i++) {
pil_pending = 0;
if (pending && !(s->intregm_disabled & MASTER_DISABLE) &&
(i == s->target_cpu)) {
for (j = 0; j < 32; j++) {
if ((pending & (1 << j)) && intbit_to_level[j]) {
pil_pending |= 1 << intbit_to_level[j];
}
}
}
s->slaves[i].intreg_pending &= CPU_SOFTIRQ_MASK | CPU_IRQ_INT15_IN |
CPU_IRQ_TIMER_IN;
if (i == s->target_cpu) {
for (j = 0; j < 32; j++) {
if ((s->intregm_pending & (1 << j)) && intbit_to_level[j]) {
s->slaves[i].intreg_pending |= 1 << intbit_to_level[j];
}
}
}
if (!(s->intregm_disabled & MASTER_DISABLE)) {
pil_pending |= s->slaves[i].intreg_pending &
(CPU_IRQ_INT15_IN | CPU_IRQ_TIMER_IN);
}
pil_pending |= (s->slaves[i].intreg_pending & CPU_SOFTIRQ_MASK) >> 16;
if (set_irqs) {
for (j = MAX_PILS; j > 0; j--) {
if (pil_pending & (1 << j)) {
if (!(s->slaves[i].irl_out & (1 << j))) {
qemu_irq_raise(s->cpu_irqs[i][j]);
}
} else {
if (s->slaves[i].irl_out & (1 << j)) {
qemu_irq_lower(s->cpu_irqs[i][j]);
}
}
}
}
s->slaves[i].irl_out = pil_pending;
}
}
| 1threat
|
Gridlayout Manager With Recycerview android : <p><a href="https://i.stack.imgur.com/pFihc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pFihc.png" alt="Real Image"></a></p>
<p>I want to create this type of layout using Recycerview.but i am gettting some issue with it.</p>
<pre><code> recyclerView.setLayoutManager(new GridLayoutManager(parentActivity, 2));
</code></pre>
<p>using above line ,i have display list in 2 column .but when height of some view is small then getting blank space..i want to remove that blank space. </p>
<p>issue screenshot:</p>
<p><a href="https://i.stack.imgur.com/zkBva.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zkBva.png" alt="Current Screen"></a></p>
<p>Please give solution to remove that space.</p>
| 0debug
|
document.getElementById('input').innerHTML = user_input;
| 1threat
|
How to create random number every minute : <p>I have a question.
"random number of customers arriving for a check out is between 5 and 10 every minute."
I need to put these customers in a list based on their order of their arrival time. </p>
<p>I don't know how to generate a random numbers of customers every minute, and I don't know how to assume their arrival time. </p>
<p>this is for Nachos server using c++ code and using threadtest.c code</p>
| 0debug
|
static void pflash_cfi01_realize(DeviceState *dev, Error **errp)
{
pflash_t *pfl = CFI_PFLASH01(dev);
uint64_t total_len;
int ret;
uint64_t blocks_per_device, device_len;
int num_devices;
Error *local_err = NULL;
total_len = pfl->sector_len * pfl->nb_blocs;
num_devices = pfl->device_width ? (pfl->bank_width / pfl->device_width) : 1;
blocks_per_device = pfl->nb_blocs / num_devices;
device_len = pfl->sector_len * blocks_per_device;
#if 0
if (total_len != (8 * 1024 * 1024) && total_len != (16 * 1024 * 1024) &&
total_len != (32 * 1024 * 1024) && total_len != (64 * 1024 * 1024))
return NULL;
#endif
memory_region_init_rom_device(
&pfl->mem, OBJECT(dev),
pfl->be ? &pflash_cfi01_ops_be : &pflash_cfi01_ops_le, pfl,
pfl->name, total_len, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
}
vmstate_register_ram(&pfl->mem, DEVICE(pfl));
pfl->storage = memory_region_get_ram_ptr(&pfl->mem);
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &pfl->mem);
if (pfl->bs) {
ret = bdrv_read(pfl->bs, 0, pfl->storage, total_len >> 9);
if (ret < 0) {
vmstate_unregister_ram(&pfl->mem, DEVICE(pfl));
error_setg(errp, "failed to read the initial flash content");
return;
}
}
if (pfl->bs) {
pfl->ro = bdrv_is_read_only(pfl->bs);
} else {
pfl->ro = 0;
}
if (!pfl->max_device_width) {
pfl->max_device_width = pfl->device_width;
}
pfl->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, pflash_timer, pfl);
pfl->wcycle = 0;
pfl->cmd = 0;
pfl->status = 0;
pfl->cfi_len = 0x52;
pfl->cfi_table[0x10] = 'Q';
pfl->cfi_table[0x11] = 'R';
pfl->cfi_table[0x12] = 'Y';
pfl->cfi_table[0x13] = 0x01;
pfl->cfi_table[0x14] = 0x00;
pfl->cfi_table[0x15] = 0x31;
pfl->cfi_table[0x16] = 0x00;
pfl->cfi_table[0x17] = 0x00;
pfl->cfi_table[0x18] = 0x00;
pfl->cfi_table[0x19] = 0x00;
pfl->cfi_table[0x1A] = 0x00;
pfl->cfi_table[0x1B] = 0x45;
pfl->cfi_table[0x1C] = 0x55;
pfl->cfi_table[0x1D] = 0x00;
pfl->cfi_table[0x1E] = 0x00;
pfl->cfi_table[0x1F] = 0x07;
pfl->cfi_table[0x20] = 0x07;
pfl->cfi_table[0x21] = 0x0a;
pfl->cfi_table[0x22] = 0x00;
pfl->cfi_table[0x23] = 0x04;
pfl->cfi_table[0x24] = 0x04;
pfl->cfi_table[0x25] = 0x04;
pfl->cfi_table[0x26] = 0x00;
pfl->cfi_table[0x27] = ctz32(device_len);
pfl->cfi_table[0x28] = 0x02;
pfl->cfi_table[0x29] = 0x00;
if (pfl->bank_width == 1) {
pfl->cfi_table[0x2A] = 0x08;
} else {
pfl->cfi_table[0x2A] = 0x0B;
}
pfl->writeblock_size = 1 << pfl->cfi_table[0x2A];
pfl->cfi_table[0x2B] = 0x00;
pfl->cfi_table[0x2C] = 0x01;
pfl->cfi_table[0x2D] = blocks_per_device - 1;
pfl->cfi_table[0x2E] = (blocks_per_device - 1) >> 8;
pfl->cfi_table[0x2F] = pfl->sector_len >> 8;
pfl->cfi_table[0x30] = pfl->sector_len >> 16;
pfl->cfi_table[0x31] = 'P';
pfl->cfi_table[0x32] = 'R';
pfl->cfi_table[0x33] = 'I';
pfl->cfi_table[0x34] = '1';
pfl->cfi_table[0x35] = '0';
pfl->cfi_table[0x36] = 0x00;
pfl->cfi_table[0x37] = 0x00;
pfl->cfi_table[0x38] = 0x00;
pfl->cfi_table[0x39] = 0x00;
pfl->cfi_table[0x3a] = 0x00;
pfl->cfi_table[0x3b] = 0x00;
pfl->cfi_table[0x3c] = 0x00;
pfl->cfi_table[0x3f] = 0x01;
}
| 1threat
|
test_opts_range_unvisited(void)
{
intList *list = NULL;
intList *tail;
QemuOpts *opts;
Visitor *v;
opts = qemu_opts_parse(qemu_find_opts("userdef"), "ilist=0-2", false,
&error_abort);
v = opts_visitor_new(opts);
visit_start_struct(v, NULL, NULL, 0, &error_abort);
visit_start_list(v, "ilist", (GenericList **)&list, sizeof(*list),
&error_abort);
tail = list;
visit_type_int(v, NULL, &tail->value, &error_abort);
g_assert_cmpint(tail->value, ==, 0);
tail = (intList *)visit_next_list(v, (GenericList *)tail, sizeof(*list));
g_assert(tail);
visit_type_int(v, NULL, &tail->value, &error_abort);
g_assert_cmpint(tail->value, ==, 1);
tail = (intList *)visit_next_list(v, (GenericList *)tail, sizeof(*list));
g_assert(tail);
visit_end_list(v, (void **)&list);
visit_check_struct(v, &error_abort);
visit_end_struct(v, NULL);
qapi_free_intList(list);
visit_free(v);
qemu_opts_del(opts);
}
| 1threat
|
Which kind of servers are for VueJS : <p>I know VueJS is a side server rendering (SSR) technology, so, which servers are for this framework? Can you give some examples?</p>
| 0debug
|
python , changing dictionary values with iteration : <p>I have the following:</p>
<pre><code>max_id = 10
for i in range(max_id):
payload = "{\"text\": 'R'+str(i),\"count\":\"1 \",}"
print(payload)
</code></pre>
<p>I want to iterate through this , and have the value of text be set to "R1", "R2" ... Upon debugging the output is:</p>
<pre><code>{"text": 'R'+str(i),"count":"1",}
</code></pre>
<p>What am I doing wrong?</p>
| 0debug
|
void net_check_clients(void)
{
VLANState *vlan;
VLANClientState *vc;
int i;
if (default_net) {
return;
}
QTAILQ_FOREACH(vlan, &vlans, next) {
int has_nic = 0, has_host_dev = 0;
QTAILQ_FOREACH(vc, &vlan->clients, next) {
switch (vc->info->type) {
case NET_CLIENT_OPTIONS_KIND_NIC:
has_nic = 1;
break;
case NET_CLIENT_OPTIONS_KIND_USER:
case NET_CLIENT_OPTIONS_KIND_TAP:
case NET_CLIENT_OPTIONS_KIND_SOCKET:
case NET_CLIENT_OPTIONS_KIND_VDE:
has_host_dev = 1;
break;
default: ;
}
}
if (has_host_dev && !has_nic)
fprintf(stderr, "Warning: vlan %d with no nics\n", vlan->id);
if (has_nic && !has_host_dev)
fprintf(stderr,
"Warning: vlan %d is not connected to host network\n",
vlan->id);
}
QTAILQ_FOREACH(vc, &non_vlan_clients, next) {
if (!vc->peer) {
fprintf(stderr, "Warning: %s %s has no peer\n",
vc->info->type == NET_CLIENT_OPTIONS_KIND_NIC ? "nic" : "netdev",
vc->name);
}
}
for (i = 0; i < MAX_NICS; i++) {
NICInfo *nd = &nd_table[i];
if (nd->used && !nd->instantiated) {
fprintf(stderr, "Warning: requested NIC (%s, model %s) "
"was not created (not supported by this machine?)\n",
nd->name ? nd->name : "anonymous",
nd->model ? nd->model : "unspecified");
}
}
}
| 1threat
|
AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int perms,
enum AVSampleFormat sample_fmt, int size,
int64_t channel_layout, int planar)
{
AVFilterBuffer *samples = av_mallocz(sizeof(AVFilterBuffer));
AVFilterBufferRef *ref = NULL;
int i, sample_size, chans_nb, bufsize, per_channel_size, step_size = 0;
char *buf;
if (!samples || !(ref = av_mallocz(sizeof(AVFilterBufferRef))))
goto fail;
ref->buf = samples;
ref->format = sample_fmt;
ref->audio = av_mallocz(sizeof(AVFilterBufferRefAudioProps));
if (!ref->audio)
goto fail;
ref->audio->channel_layout = channel_layout;
ref->audio->size = size;
ref->audio->planar = planar;
ref->perms = perms | AV_PERM_READ;
samples->refcount = 1;
samples->free = ff_avfilter_default_free_buffer;
sample_size = av_get_bytes_per_sample(sample_fmt);
chans_nb = av_get_channel_layout_nb_channels(channel_layout);
per_channel_size = size/chans_nb;
ref->audio->nb_samples = per_channel_size/sample_size;
for (i = 0; i < chans_nb; i++)
samples->linesize[i] = planar > 0 ? per_channel_size : sample_size;
memset(&samples->linesize[chans_nb], 0, (8-chans_nb) * sizeof(samples->linesize[0]));
bufsize = (size + 15)&~15;
buf = av_malloc(bufsize);
if (!buf)
goto fail;
samples->data[0] = buf;
if (buf && planar) {
for (i = 1; i < chans_nb; i++) {
step_size += per_channel_size;
samples->data[i] = buf + step_size;
}
} else {
for (i = 1; i < chans_nb; i++)
samples->data[i] = buf;
}
memset(&samples->data[chans_nb], 0, (8-chans_nb) * sizeof(samples->data[0]));
memcpy(ref->data, samples->data, sizeof(ref->data));
memcpy(ref->linesize, samples->linesize, sizeof(ref->linesize));
return ref;
fail:
if (ref)
av_free(ref->audio);
av_free(ref);
av_free(samples);
return NULL;
}
| 1threat
|
How do I change page title based on heading? : <p>I would like to change the title of my page based on the name of </p>
<p>for example,
<code><h1>lorem imsum<h1></code>
would set the page title to <code>lorem ipsum</code></p>
| 0debug
|
iOS: Get displayed image size in pixels : <p>In my app, I'm displaying an image of a rectangle from the assets library. The image is 100x100 pixels. I'm only using the 1x slot for this asset.</p>
<p>I want to display this image at 300x300 pixels. Doing this using points is quite simple but I can't figure out how to get UIImageView to set the size in pixels.</p>
<p>Alternatively, if I can't set the size in pixels to display, I'd like to get the size in pixels that the image is being displayed.</p>
<p>I have tried using <code>.scale</code> on the UIImageView and UIImage instances, but it's always 1. Even though I have set constraints to 150 and 300.</p>
| 0debug
|
Python Websockets Module has no attribute : <p>I have this python file that sends a websocket message to my python-server. But it keeps getting errors, I have seen these errors before, but I cant seem to fix them my python version is python2.7</p>
<pre><code>#!/usr/bin/python
import websocket
import sys
val = sys.argv[1]
ws = websocket.create_connection("ws://ipaddress:9001")
ws.send(val)
ws.close()
</code></pre>
<p>The Error</p>
<pre><code>Traceback (most recent call last):
File "./test.py", line 5, in <module>
ws = websocket.create_connection("ws://ipaddress:9001")
AttributeError: 'module' object has no attribute 'create_connection'
</code></pre>
| 0debug
|
Html Post Chopping Input : Hey all i am writing a website where i need a sql query passed around to bring the user back to a page i had it working fine until i added to it
its input is being chopped where here ....eventStatus =
(i know it needs to be post, running as get to debug)
(row internal id is gotten from a sql query)
(the sql normally is also a variable passed in)
Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.6
Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id:241ae00989d1995ffcbbf63d579943635faf9972 $
PHP extension: mysqli Documentation
PHP version: 7.0.6
Server Windows 7 64 (Its a school project)
am i doing something wrong with the hidden input?
<form action='' method='get'>
<textarea name ='comment' rows='4' cols = '50' value =''></textarea>
<button type='createcomment' name='createcomment' value='createcomment'>
Comment
<input type = 'hidden' name = 'internal_id' value ={$row["internal_id"]}</>
<input type = 'hidden' name = 'sql' value ='"SELECT * FROM `create_event` WHERE `eventStatus` = 'Happening' and 'approved' = 'Approved'"'</>
</button>
</form>
| 0debug
|
static void spr_read_tbl (DisasContext *ctx, int gprn, int sprn)
{
if (use_icount) {
gen_io_start();
}
gen_helper_load_tbl(cpu_gpr[gprn], cpu_env);
if (use_icount) {
gen_io_end();
gen_stop_exception(ctx);
}
}
| 1threat
|
How to stop execution of piece of code in android until data is retrieved from firebase? : I am trying to perform some task based on the data retrieved from firebase.
for (inti=0;i<dateList.size();i++)
{
attendanceDateRef= attendanceRef.child(dateList.get(i));
attendanceClassRef= attendanceDateRef.child(ViewAttendanceSelectClassActivity.selectedClass);
attendanceClassRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshotdataSnapshot) {
for (DataSnapshotdsp : dataSnapshot.getChildren())
{
attendanceList.add(dsp.getValue(String.class));
Log.e("attendanceListValues",dsp.getValue(String.class));
}
}
@Override
public void onCancelled(DatabaseErrordatabaseError) {
}
});
}
intindex=1;
for (inti=1;i<=attendanceList.size();i++)
{
if(i%4==0)
{
fullDateRangeList.add(dateList.get(index));
index++;
}
else
{
fullDateRangeList.add(dateList.get(index));
}
}
Log.e("fullDateRangeList",String.valueOf(fullDateRangeList.size()));
Log.e("attendanceList",String.valueOf(attendanceList.size()));
above code is written on the OnClick event of a button, when I click on the button following output is generated on logcat:
fullDateRangeList:0
attendanceList:0
attendanceListValues:Value1
attendanceListValues:Value2
attendanceListValues:Value3
attendanceListValues:Value4
.
.
.
attendanceListValues:ValueN
from the above output it looks like second loop is executing before data is retrieved from firebase and that is why value of fullDateRange and attendanceList is 0.
is there any way i can prevent second loop from executing until data is stored in attendanceList?
| 0debug
|
React-Native fetch API aggressive cache : <p>I'm using fetch API for interacting with server in my react-native@0.28 app, but facing with quite aggressive caching.</p>
<p>Call which I proceed can be expressed like:</p>
<pre><code>fetch(route + '&_t=' + Date.now(), {
headers: {
'Cache-Control': 'no-cache',
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json',
'Custom-Auth-Header': 'secret-token'
},
method: 'POST',
body: data,
cache: 'no-store'
})
</code></pre>
<p>In IOS simulator response get cached for 15-20 mins, can be cleared via Reset Content and Settings.</p>
<p>In result I just don't want to have any cache for any of my calls (including GET requests).</p>
<p>I tried all options which I know in order to avoid caching, but seems there is something else, any help would be very appreciated!</p>
| 0debug
|
When program is running, file is not read : <p>Can someone help me with understanding why this code isn't working, when program is running, "booklist.txt" can't be loaded. </p>
<p>When I call function listbooks while the program is running, it doesn't
display anything on the screen, so that's the main problem. (file is not empty.)</p>
<pre><code> #include <iostream>
#include <cstdlib>
#include <fstream>
using namespace std;
void listbooks()
{
ifstream TheFile("booklist.txt");
char autor;
char bookname;
long int isbn;
while (TheFile >> autor >> bookname >> isbn)
{
cout << autor << " " << bookname << " " << isbn << endl;
}
}
int main()
{
int choice;
do {
cout << "1.List all books" << endl;
cout << "2.Borrow book" << endl;
cout << "3. Exit" << endl;
cout << "Enter your choice: ";
cin >> choice;
switch (choice)
{
case 1:
listbooks;
break;
case 2:
break;
default:
cout << "";
}
} while (choice != 3);
system("pause");
return 0;
}
</code></pre>
| 0debug
|
static int decode_plane10(UtvideoContext *c, int plane_no,
uint16_t *dst, int step, ptrdiff_t stride,
int width, int height,
const uint8_t *src, const uint8_t *huff,
int use_pred)
{
int i, j, slice, pix, ret;
int sstart, send;
VLC vlc;
GetBitContext gb;
int prev, fsym;
if ((ret = build_huff10(huff, &vlc, &fsym)) < 0) {
av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n");
return ret;
}
if (fsym >= 0) {
send = 0;
for (slice = 0; slice < c->slices; slice++) {
uint16_t *dest;
sstart = send;
send = (height * (slice + 1) / c->slices);
dest = dst + sstart * stride;
prev = 0x200;
for (j = sstart; j < send; j++) {
for (i = 0; i < width * step; i += step) {
pix = fsym;
if (use_pred) {
prev += pix;
prev &= 0x3FF;
pix = prev;
}
dest[i] = pix;
}
dest += stride;
}
}
return 0;
}
send = 0;
for (slice = 0; slice < c->slices; slice++) {
uint16_t *dest;
int slice_data_start, slice_data_end, slice_size;
sstart = send;
send = (height * (slice + 1) / c->slices);
dest = dst + sstart * stride;
slice_data_start = slice ? AV_RL32(src + slice * 4 - 4) : 0;
slice_data_end = AV_RL32(src + slice * 4);
slice_size = slice_data_end - slice_data_start;
if (!slice_size) {
av_log(c->avctx, AV_LOG_ERROR, "Plane has more than one symbol "
"yet a slice has a length of zero.\n");
goto fail;
}
memset(c->slice_bits + slice_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
c->bdsp.bswap_buf((uint32_t *) c->slice_bits,
(uint32_t *)(src + slice_data_start + c->slices * 4),
(slice_data_end - slice_data_start + 3) >> 2);
init_get_bits(&gb, c->slice_bits, slice_size * 8);
prev = 0x200;
for (j = sstart; j < send; j++) {
for (i = 0; i < width * step; i += step) {
pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3);
if (pix < 0) {
av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n");
goto fail;
}
if (use_pred) {
prev += pix;
prev &= 0x3FF;
pix = prev;
}
dest[i] = pix;
}
dest += stride;
if (get_bits_left(&gb) < 0) {
av_log(c->avctx, AV_LOG_ERROR,
"Slice decoding ran out of bits\n");
goto fail;
}
}
if (get_bits_left(&gb) > 32)
av_log(c->avctx, AV_LOG_WARNING,
"%d bits left after decoding slice\n", get_bits_left(&gb));
}
ff_free_vlc(&vlc);
return 0;
fail:
ff_free_vlc(&vlc);
return AVERROR_INVALIDDATA;
}
| 1threat
|
Coroutine vs Fiber difference clarification : <p>In the book <code>Linux System Programming, 2nd Edition</code>, the difference between coroutines and fiber is explained as follows:</p>
<blockquote>
<p>Coroutines and fibers provide a unit of execution even lighter in weight than the thread (with the former being their name when they are a programming language construct, and the latter when they are a system construct).</p>
</blockquote>
<p>I have some example of Coroutines (language constructs) but unable to find the example of Fibers.</p>
<p>Can anyone provide me some example of Fiber (a system construct)?</p>
| 0debug
|
Android Studio Change background color multiple times with 1 button click : I am brand new to android studio and what i am trying to figure out is how to change the background color of my start up app.
The moment the app loads i see a button on the screen and when i click it goes to the color red.
What my employer wants is when you click the button it goes from Red to Green to Blue than back to red.
Can somebody help me figure this out please and thank you.
| 0debug
|
def remove_length(test_str, K):
temp = test_str.split()
res = [ele for ele in temp if len(ele) != K]
res = ' '.join(res)
return (res)
| 0debug
|
Why does R round natural logarithms as it does? : <p>I was perplexed by the difference in R:</p>
<pre><code>log(0.0001)/0.0001
-92103.4
</code></pre>
<p>and, e.g., Google calculator rendering:</p>
<pre><code> ln(0.0001)/0.0001
-92103.4037198
</code></pre>
<p>why is the rounding so different?</p>
| 0debug
|
How do you get total contributions with Githubs API v4 : <p>I have been looking through the Github V4 API docs and I cannot seem to find a way to query total contributions for the year (as displayed on your github profile). Has anyone managed to use the new API to grab some statistics from your personal profile?</p>
<p>I am using graphQL and a Personal Access Token on github, and managed to get minimal user profile data; username, profile name etc.</p>
| 0debug
|
Firebase React Native -- how to grab and transmit Device ID/Token? : <p>First time Firebase and RN user here, trying to figure out how to transmit the Device ID/Token of the app user. </p>
<p>I'm using something basic like this to transmit information to my firebase database right now (using <code>firebase.database().ref()</code>).</p>
<pre><code> updateDB = (timestamp_key, item_name, item_url) => {
firebase.database().ref(timestamp_key).set({
item_name: item_name,
item_url: item_url
})
}
</code></pre>
<p>I haven't been able to find a simple straightforward answer as to how to fetch one's device token and transmit that as well (so I know whose action is whose later).</p>
<p>Is there a (what I think should be) a relatively straightforward way to do that? Thanks!</p>
<p>P.S. I am calling this higher up in the script in addition to the configs to initialize the connection -- maybe it's somewhere around here I need to grab the device token?</p>
<pre><code>// Initialize Firebase
const firebaseConfig = {
apiKey: "blah",
authDomain: "blah",
databaseURL: "blah",
storageBucket: "blah",
messagingSenderId: "blah"
};
firebase.initializeApp(firebaseConfig);
</code></pre>
| 0debug
|
void bdrv_close(BlockDriverState *bs)
{
BdrvAioNotifier *ban, *ban_next;
if (bs->job) {
block_job_cancel_sync(bs->job);
}
if (bs->io_limits_enabled) {
bdrv_io_limits_disable(bs);
}
bdrv_drain(bs);
bdrv_flush(bs);
bdrv_drain(bs);
notifier_list_notify(&bs->close_notifiers, bs);
if (bs->drv) {
BdrvChild *child, *next;
bs->drv->bdrv_close(bs);
bs->drv = NULL;
bdrv_set_backing_hd(bs, NULL);
if (bs->file != NULL) {
bdrv_unref_child(bs, bs->file);
bs->file = NULL;
}
QLIST_FOREACH_SAFE(child, &bs->children, next, next) {
if (child->bs->inherits_from == bs) {
child->bs->inherits_from = NULL;
}
bdrv_detach_child(child);
}
g_free(bs->opaque);
bs->opaque = NULL;
bs->copy_on_read = 0;
bs->backing_file[0] = '\0';
bs->backing_format[0] = '\0';
bs->total_sectors = 0;
bs->encrypted = 0;
bs->valid_key = 0;
bs->sg = 0;
bs->zero_beyond_eof = false;
QDECREF(bs->options);
bs->options = NULL;
QDECREF(bs->full_open_options);
bs->full_open_options = NULL;
}
if (bs->blk) {
blk_dev_change_media_cb(bs->blk, false);
}
QLIST_FOREACH_SAFE(ban, &bs->aio_notifiers, list, ban_next) {
g_free(ban);
}
QLIST_INIT(&bs->aio_notifiers);
}
| 1threat
|
Automate Microsoft Microsoft Visual C# / Basic .NET : <p>I have to test a desktop application (it has login field/password field/settings/text box etc).Is there any free tool /perl /python module which can be used to automate application written in Microsoft Visual C# ?Sikuli is not an option as per our company .Please help</p>
| 0debug
|
Repeat the content in jquery slick : I have to display dynamically added content using jquery slick carousel. Min and Max I have to display 6 content in the slide. If content is less than 6 it should repeat the same content. for example if the slideToShow:6 but if there is only 4 contents are there. It should repeat the 1st and 2nd content in the last. I cant find out the method in slick for repetition.
| 0debug
|
Why would a C# regex credit card validation function validate with invalid values? : <p>I am creating a payment processor WinForms app which of course pushes the results to the gateway API. I am simply trying to validate the credit card number before sending it out. I just need a working 'prototype' so I can finish designing the UI before I dive into learning the Luhn and Base 10 Algorithms so I found the ValidateCreditCard() method in a forum and I just need to get it to be functional.</p>
<pre><code>using System;
using System.Text;
using System.Windows.Forms;
namespace PaymentPlanCalculator
{
public partial class paymentPlanCalculator : Form
{
public paymentPlanCalculator()
{
InitializeComponent();
}
public void Form1_Load(object sender, EventArgs e)
{
/****************************************** //
/* DEFINE VARIABLES //
/****************************************** */
//I have a bunch of variables defined here, nothing relevant to the question
}
public void Button1_Click(object sender, EventArgs e)
{
string creditCardNumber = txtCreditCardNumber.Text;
if (ValidateCreditCard(creditCardNumber))
{
lblCardValid.Text = "VALID!";
}
else
{
lblCardValid.Text = "INVALID!";
}
}
public bool ValidateCreditCard(string creditCardNumber)
{
//Strip any non-numeric values
creditCardNumber = Regex.Replace(creditCardNumber, @"[^\d]", "");
//Build your Regular Expression
Regex expression = new Regex(@"^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$");
//Return if it was a match or not
return expression.IsMatch(creditCardNumber);
}
}
}
</code></pre>
<p>It appears to work but I have a STRONG feeling that it is validating invalid card numbers as long as they're 16 digits and begin with a 4 or 5.</p>
<p>I have never used regex before and I'm a relatively green C# programmer so I'm assuming that there is something wrong with my implementation as opposed to the function I found online.</p>
| 0debug
|
How to get a number in a string? : <p>I want to get a integer value in a string. Any suggessions?<br>
Take this as an example. </p>
<blockquote>
<p>768 - Hello World </p>
</blockquote>
<p>According to the preceding string i want to get the 768 to a variable. How to do so?</p>
| 0debug
|
How set Response body in javax.ws.rs.core.Response : <p>There is a REST API endpoint which needs to be implemented is used to get some information and send backend request to an another server and response which is coming from backend server has to set the to final response. My problem is <strong>how to set response body in javax.ws.rs.core.Response?</strong> </p>
<pre><code>@Path("analytics")
@GET
@Produces("application/json")
public Response getDeviceStats(@QueryParam("deviceType") String deviceType,
@QueryParam("deviceIdentifier") String deviceIdentifier,
@QueryParam("username") String user, @QueryParam("from") long from,
@QueryParam("to") long to) {
// Trust own CA and all self-signed certs
SSLContext sslcontext = null;
try {
sslcontext = SSLContexts.custom()
.loadTrustMaterial(new File(getClientTrustStoretFilePath()), "password## Heading ##".toCharArray(),
new TrustSelfSignedStrategy())
.build();
} catch (NoSuchAlgorithmException e) {
log.error(e);
} catch (KeyManagementException e) {
log.error(e);
} catch (KeyStoreException e) {
log.error(e);
} catch (CertificateException e) {
log.error(e);
} catch (IOException e) {
log.error(e);
}
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
sslcontext,
new String[] { "TLSv1" },
null,
SSLConnectionSocketFactory.getDefaultHostnameVerifier());
CloseableHttpClient httpclient = HttpClients.custom()
.setSSLSocketFactory(sslsf)
.build();
HttpResponse response = null;
try {
HttpGet httpget = new HttpGet(URL);
httpget.setHeader("Authorization", "Basic YWRtaW46YWRtaW4=");
httpget.addHeader("content-type", "application/json");
response = httpclient.execute(httpget);
String message = EntityUtils.toString(response.getEntity(), "UTF-8");
} catch (ClientProtocolException e) {
log.error(e);
} catch (IOException e) {
log.error(e);
}
}
</code></pre>
<p>Here <strong>message</strong> is the one I need to set. But I tried several methods. Didn't work any of them. </p>
| 0debug
|
static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state,
int is_signed)
{
if (get_rac(c, state + 0))
return 0;
else {
int i, e, a;
e = 0;
while (get_rac(c, state + 1 + FFMIN(e, 9))) {
e++;
if (e > 31)
return AVERROR_INVALIDDATA;
}
a = 1;
for (i = e - 1; i >= 0; i--)
a += a + get_rac(c, state + 22 + FFMIN(i, 9));
e = -(is_signed && get_rac(c, state + 11 + FFMIN(e, 10)));
return (a ^ e) - e;
}
}
| 1threat
|
Why is my array empty after appending it? : <p>Here is the code: </p>
<pre><code>var array:[String] = []
var second:[String] = [" "]
override func viewDidLoad() {
super.viewDidLoad()
search.delegate = self //HELP
let query = PFQuery(className: "Classes")
query.whereKey("name", notEqualTo: " ")
query.findObjectsInBackground(block: { (objects, error) in
if error != nil{
print("cannot retrieve classes")
} else {
for object in objects!{
self.array.append(object["name"] as! String)
self.second = self.array
self.classList.reloadData()
print(self.array)
}
}
})
print(second)
print(array)
}
</code></pre>
<p>After printing self.array, there are elements in the array, but if I just print(array) at the end, the array is still empty. Why is this? Can someone help clarify?</p>
| 0debug
|
Iterate two lists simultaneously and create another using streams : <p>I want to achieve following using streams:</p>
<pre><code>List<MyObject> list1 = Arrays.asList(obj1, obj2, obj3);
List<Boolean> list2 = Arrays.asList(true, false, true);
List<MyObject> list = new ArrayList<>();
for(int i=0; i<list1.size();i++) {
if(list2.get(i))
list.add(list1.get(i));
}
</code></pre>
<p>Can anyone help? It should be easy but I am new to java streams.</p>
<p><strong>Note:</strong> The length of list1 and list2 would be same always.</p>
| 0debug
|
Linked list in c displayed with same values : <p>I have a CSV file containing lines separated by ','</p>
<p>The file looks like this:</p>
<pre><code>FIRST,00-92-93,1,0,1
SECOND,53-12-53,5,1,5
THIRD,12-33-51,5,0,51
</code></pre>
<p>Linked list looks like this:</p>
<pre><code>struct Data{
char *dat;
char *uname;
bool war_dep;
int edu_period;
bool dorms;
};
struct llist{
Data d;
llist *next;
};
</code></pre>
<p>I have a function that itterates over this file, separating each line into chunks and
adding them to a structure. </p>
<p>Here's my programm:</p>
<pre><code>void showi(llist *u){
while(u){
printf("Name: %s\t Date: %s\n", u->d.dat, u->d.uname);
u=u->next;
}
}
void inserti(llist **head, char *line){
char *tok;
llist *p=new llist;
int i=0;
tok = strtok(line, ",");
while(tok!=NULL){
switch(i){
case 0:
p->d.dat=tok;
break;
case 1:
p->d.uname=tok;
break;
case 2:
p->d.war_dep=atoi(tok);
break;
case 3:
p->d.edu_period=atoi(tok);
break;
case 4:
p->d.dorms=atoi(tok);
break;
}
i++;
tok=strtok(NULL, ",");
}
p->next=NULL;
if(*head!=NULL)
p->next=*head;
*head=p;
printf("Callback: %s\n", p->d.dat);
}
int main()
{
FILE *fp;
char line[128], *tok;
llist *head;
head = NULL;
int i=0;
fp=fopen("data.txt", "r");
while(fgets(line, sizeof(line), fp))
{
inserti(&head, line);
}
fclose(fp);
showi(head);
return 0;
}
</code></pre>
<p>When above code is executed I get callbacks from <strong>inserti</strong> (just to make sure each line is processed properly), however when I try to display my list I got only the last value (in this case I get 3 <strong>THIRD</strong>). I don't know why it happens, maybe something wrong with this piece of code in <strong>inserti</strong></p>
<pre><code>p->next=NULL;
if(*head!=NULL)
p->next=*head;
*head=p;
</code></pre>
| 0debug
|
import re
def extract_quotation(text1):
return (re.findall(r'"(.*?)"', text1))
| 0debug
|
Is Jquery a replacement for JavaScript? : <p>I am new to coding websites with HTML, CSS, and Javascript. I used W3 schools recently to learn more in depth and have started coding my portfolio. But then noticed jquery tutorials and they didnt mention this. </p>
| 0debug
|
How I use an external javasrript file inside .ts file without converting it? : <p>i have external javascript file. I want to use it in .ts file without converting it. Anyone have idea to use it inside typescript without converting.</p>
| 0debug
|
Search UITableView and ignore dot, coma etc : Is there a way to search through a UITableView and ignore certain characters like coma or dot?
i.e I would like to search for "St George" but my data set contains "St. George" so my result is always zero.
| 0debug
|
What is the advantage of Deterministic Policy Gradient over Stochastic Policy Gradient? : <p>Deep Deterministic Policy Gradient (<a href="https://arxiv.org/pdf/1509.02971.pdf" rel="noreferrer">DDPG</a>) is the state-of-the-art method for reinforcement learning when the action space is continuous. Its core algorithm is <a href="http://www.jmlr.org/proceedings/papers/v32/silver14.pdf" rel="noreferrer">Deterministic Policy Gradient</a>.</p>
<p>However, after reading the papers and listening to the talk (<a href="http://techtalks.tv/talks/deterministic-policy-gradient-algorithms/61098/" rel="noreferrer">http://techtalks.tv/talks/deterministic-policy-gradient-algorithms/61098/</a>), I still cannot figure out what the fundamental advantage for Deterministic PG over Stochastic PG is. The talk says it is more suitable for high dimensional actions and easier to train, but why is that?</p>
| 0debug
|
static void memory_region_initfn(Object *obj)
{
MemoryRegion *mr = MEMORY_REGION(obj);
ObjectProperty *op;
mr->ops = &unassigned_mem_ops;
mr->enabled = true;
mr->romd_mode = true;
mr->global_locking = true;
mr->destructor = memory_region_destructor_none;
QTAILQ_INIT(&mr->subregions);
QTAILQ_INIT(&mr->coalesced);
op = object_property_add(OBJECT(mr), "container",
"link<" TYPE_MEMORY_REGION ">",
memory_region_get_container,
NULL,
NULL, NULL, &error_abort);
op->resolve = memory_region_resolve_container;
object_property_add(OBJECT(mr), "addr", "uint64",
memory_region_get_addr,
NULL,
NULL, NULL, &error_abort);
object_property_add(OBJECT(mr), "priority", "uint32",
memory_region_get_priority,
NULL,
NULL, NULL, &error_abort);
object_property_add_bool(OBJECT(mr), "may-overlap",
memory_region_get_may_overlap,
NULL,
&error_abort);
object_property_add(OBJECT(mr), "size", "uint64",
memory_region_get_size,
NULL,
NULL, NULL, &error_abort);
}
| 1threat
|
void ff_avg_h264_qpel8_mc32_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_midh_qrt_and_aver_dst_8w_msa(src - (2 * stride) - 2,
stride, dst, stride, 8, 1);
}
| 1threat
|
python3: make a list unique in-place : How can one make a list contain only unique items while preserving order AND updating it in-place?
PS - I know that a set can be used, but it will not guarantee ordering.
| 0debug
|
binarySearch in int array does not find properly value 0 and less : <p>I have performed following tests:</p>
<pre><code>int[] test1 = {1, 2, 3};
System.out.println(Arrays.binarySearch(test1, 3)); //prints 2
int[] test2 = {1, 0, 3};
System.out.println(Arrays.binarySearch(test2, 0)); //prints 1
int[] test3 = {1, 2, 0};
System.out.println(Arrays.binarySearch(test3, 0)); //prints -1 (item not found), expected value: 2
</code></pre>
<p>I just found bug in Java implementation or I am doing something wrong?</p>
| 0debug
|
void mips_cpu_unassigned_access(CPUState *cs, hwaddr addr,
bool is_write, bool is_exec, int unused,
unsigned size)
{
MIPSCPU *cpu = MIPS_CPU(cs);
CPUMIPSState *env = &cpu->env;
if (is_exec) {
helper_raise_exception(env, EXCP_IBE);
} else {
helper_raise_exception(env, EXCP_DBE);
| 1threat
|
Component unit test: By.css() does not match when in SVG namespace : <p>In short, I'm looking for a way to make the predicate <code>By.css([css-selector])</code> (see <a href="https://angular.io/docs/ts/latest/api/platform-browser/index/By-class.html">https://angular.io/docs/ts/latest/api/platform-browser/index/By-class.html</a>) work in Angular2 (v2.0.1+) component unit tests when a namespace (SVG) is involved.</p>
<p>(The related predicates <code>By.all()</code> and <code>By.directive(DirectiveClass)</code> work fine.)</p>
<p>Below is a self-contained spec to demonstrate the issue. The result is</p>
<pre><code>DivComponent class specs:
✔ NG should evaluate component and template.
✔ Div should be locatable by tag.
✔ Div should be locatable by id.
✔ Div should be locatable by class.
✔ Match should fail a negative.
ShapesComponent class specs:
✔ NG should evaluate the component and template.
✖ Circle should be locatable by tag.
✖ Circle should be locatable by ns:tag.
✖ Circle should be locatable by id.
✖ Circle should be locatable by class.
</code></pre>
<p>Spec:</p>
<pre><code>import {TestBed, ComponentFixture} from '@angular/core/testing';
import {Component, DebugElement} from '@angular/core';
import {By} from '@angular/platform-browser';
/*
* A simple component in HTML namespace
*/
@Component({
selector: '[app-div]',
template: '<div class="myDivClass" id="myDivId">Hello World</div>'
})
export class DivComponent {
}
/*
* A simple component in SVG namespace
*/
@Component({
selector: '[app-shape]',
template: '<svg:circle class="myCircleClass" id="myCircleId" ' +
'cx="80" cy="80" r="20"></svg:circle>'
})
export class ShapesComponent {
}
function dumpElements(elements: DebugElement[]) {
console.log('Matcher found ' + elements.length + ' elements.');
for (let i = 0; i < elements.length; i++) {
console.log('element[' + i + '] = '
+ elements[i].nativeElement.tagName
+ ': ' + elements[i].nativeElement.outerHTML);
}
}
/*
* Test "By.css()" on the DivComponent.
*/
describe('DivComponent class specs:', () => {
let divComponent: DivComponent;
let fixture: ComponentFixture<DivComponent>;
let de: DebugElement;
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
DivComponent
]
});
TestBed.compileComponents();
fixture = TestBed.createComponent(DivComponent);
fixture.detectChanges();
de = fixture.debugElement;
});
it('NG should evaluate component and template.', () => {
// Dump elements if needed:
// dumpElements(de.queryAll(By.all()));
expect(de.queryAll(By.all()).length).toBe(1);
});
it('Div should be locatable by tag.', () => {
expect(de.queryAll(By.css('div')).length).toBe(1);
});
it('Div should be locatable by id.', () => {
expect(de.queryAll(By.css('#myDivId')).length).toBe(1);
});
it('Div should be locatable by class.', () => {
expect(de.queryAll(By.css('.myDivClass')).length).toBe(1);
});
it('Match should fail a negative.', () => {
expect(de.queryAll(By.css('#negative')).length).toBe(0);
});
});
/*
* Use the same "By.css()" syntax on the ShapeComponent.
*/
describe('ShapesComponent class specs:', () => {
let divComponent: ShapesComponent;
let fixture: ComponentFixture<ShapesComponent>;
let de: DebugElement;
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
ShapesComponent
]
});
TestBed.compileComponents();
fixture = TestBed.createComponent(ShapesComponent);
fixture.detectChanges();
de = fixture.debugElement;
});
it('NG should evaluate the component and template.', () => {
// Dump elements if needed:
// dumpElements(de.queryAll(By.all()));
expect(de.queryAll(By.all()).length).toBe(1); // pass
});
it('Circle should be locatable by tag.', () => {
expect(de.queryAll(By.css('circle')).length).toBe(1);
});
it('Circle should be locatable by ns:tag.', () => {
expect(de.queryAll(By.css('svg:circle')).length).toBe(1);
});
it('Circle should be locatable by id.', () => {
expect(de.queryAll(By.css('#myCircleId')).length).toBe(1);
});
it('Circle should be locatable by class.', () => {
expect(de.queryAll(By.css('.myCircleClass')).length).toBe(1);
});
});
</code></pre>
| 0debug
|
Limit file type upload video : <p>how do I add that only mp4 is accepted?</p>
<pre><code><?php
if(isset($_POST['submit']))
{
$name = $_FILES['file']['name'];
$temp = $_FILES['file']['tmp_name'];
move_uploaded_file($temp,"uploaded/".$name);
$url = "/uploaded/$name";
$db->query("INSERT INTO `videos` VALUES ('','$name','$url')");
$query = $db->query("SELECT * FROM videos WHERE name = '".$name."'");
$row = $query->fetch_assoc();
echo "<center>Your upload is created <a href='watch.php?id=".$row['id']. "' target='blank_'>CLICK</a></center>";
}
?>
</code></pre>
<p>Can you repost the php with right php script</p>
| 0debug
|
SQL(query) error or missing database. (near "autoincrement": syntax error : # O ERRO IS IN THE TABLE CARTAO #
public class BD_BDCORE extends SQLiteOpenHelper {
private static final String NOME_BANCO = "immunize_db";
private static final int VERSAO_BANCO = 1;
public BD_BDCORE(Context ctx){
super(ctx, NOME_BANCO, null, VERSAO_BANCO);
}
//Cria um novo banco
@Override
public void onCreate(SQLiteDatabase db){
db.execSQL("create table cartao(_id integer primary autoincrement, nome text not null);");
db.execSQL("create table vacina(idCartao long not null, _id integer primary autoincrement, nome text not null, descricao text not null);");
db.execSQL("create table remedio(_id integer primary autoincrement, nome text not null);");
db.execSQL("SELECT * FROM CARTAO;");
}
@Override
public void onUpgrade(SQLiteDatabase db, int versaoAntiga, int novaVersao) {
db.execSQL("drop table cartao;");
onCreate(db);
}
================================================================================
public class BD_BD {
private static SQLiteDatabase bd;
private static int CARTAO_ID = 0;
private static int CARTAO_PERIODO = 1;
private static int VACINA_ID = 1;
private static int VACINA_NOME = 2;
private static int VACINA_LEGENDA = 3;
public BD_BD(Context context){
BD_BDCORE auxDb = new BD_BDCORE(context);
bd = auxDb.getWritableDatabase();
}
public static List<Cartao> getCartoes(Context ctx){
List<Cartao> list = new ArrayList<Cartao>();
String[] colunas = new String[]{"_id", "nome"};
Cursor cursor = bd.query("cartao", colunas, null, null, null, null, null);
if(cursor.getCount() > 0){
cursor.moveToFirst();
do{
Cartao c = new Cartao();
c.setId(cursor.getLong(CARTAO_ID));
c.setPeriodo(cursor.getString(CARTAO_PERIODO));
list.add(c);
}while (cursor.moveToNext());
}
return (list);
}
================================================================================
public class CartaoActivity extends AppCompatActivity implements AdapterView.OnItemClickListener{
BD_BD banco;
CartaoAdapter adapter;
List<Cartao> cartoes;
public static String ID_CARTAO_SELECTED = "ID_CARTAO_SELECTED";
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.cartao);
super.onCreate(savedInstanceState);
ActionBar ab = getSupportActionBar();
ab.setDisplayHomeAsUpEnabled(true);
ab.setBackgroundDrawable(getResources().getDrawable(R.drawable.cartao_de_vacina_meses_titulo));
banco = new BD_BD(this);
cartoes = banco.getCartoes(this);
ListView cartaoList = (ListView) findViewById(R.id.listaCartao);
cartaoList.setOnItemClickListener(this);
CartaoAdapter adapter = new CartaoAdapter(this, cartoes);
cartaoList.setAdapter(adapter);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Cartao cartao = cartoes.get(position);
if (cartao != null) {
Intent intent = new Intent(this, VacinasActivity.class);
intent.putExtra(ID_CARTAO_SELECTED, cartao.getId());
startActivity(intent);
}
}strong text
| 0debug
|
WARNING : "SDK Version Issue". xcode 10.1 : <p>when upload my app with xcode 10.1 i'm getting the Warning </p>
<blockquote>
<p>WARNING ITMS-90725: "SDK Version Issue. This app was built with the iOS 12.0 SDK. Starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later.</p>
</blockquote>
<p>My project was developed in swift 4.2.1 and xcode 10.1</p>
| 0debug
|
static void validate_thread_parameters(AVCodecContext *avctx)
{
int frame_threading_supported = (avctx->codec->capabilities & CODEC_CAP_FRAME_THREADS)
&& !(avctx->flags & CODEC_FLAG_TRUNCATED)
&& !(avctx->flags & CODEC_FLAG_LOW_DELAY)
&& !(avctx->flags2 & CODEC_FLAG2_CHUNKS);
if (avctx->thread_count == 1) {
avctx->active_thread_type = 0;
} else if (frame_threading_supported && (avctx->thread_type & FF_THREAD_FRAME)) {
avctx->active_thread_type = FF_THREAD_FRAME;
} else {
avctx->active_thread_type = FF_THREAD_SLICE;
}
}
| 1threat
|
android studio download for android phone : <p>Looking for a android studio / sdk that will download to a smartphone. Have been to the android site and selected download but it does not seem to complete and it does not download. Please assist.</p>
| 0debug
|
static void raw_probe_alignment(BlockDriverState *bs)
{
BDRVRawState *s = bs->opaque;
DWORD sectorsPerCluster, freeClusters, totalClusters, count;
DISK_GEOMETRY_EX dg;
BOOL status;
if (s->type == FTYPE_CD) {
bs->request_alignment = 2048;
return;
}
if (s->type == FTYPE_HARDDISK) {
status = DeviceIoControl(s->hfile, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX,
NULL, 0, &dg, sizeof(dg), &count, NULL);
if (status != 0) {
bs->request_alignment = dg.Geometry.BytesPerSector;
return;
}
}
if (s->drive_path[0]) {
GetDiskFreeSpace(s->drive_path, §orsPerCluster,
&dg.Geometry.BytesPerSector,
&freeClusters, &totalClusters);
bs->request_alignment = dg.Geometry.BytesPerSector;
}
}
| 1threat
|
not subscriptable error when not trying to subscript : We begin with a user inputted string containing only lower-case letters
```
for letter in encoded_input:
if letter == ' ':
decoded_output.append(' ')
continue
decoded_output.append(map_input(letter,tpos1,tpos2,tpos3))
```
and then pass to this function
```
def map_input(value,r1,r2,r3,wr=wiring,rf=reflector):#Use reflector as well
pass1 = rf[r3[r2[r1[wr[ALPH.index(value)]]]]]
r1,r2,r3 = reverse_rotors(r1,r2,r3)
return ALPH[wr[r1[r2[r3[pass1]]]]]
```
where all of the variables passed are lists containing numbers 0-25 in a unique arrangement.
#Problem
When I do this, however, I get an error telling me
```
pass1 = rf[r3[r2[r1[wr[ALPH.index(value)]]]]]
TypeError: 'int' object is not subscriptable
```
Am I missing the obvious or is something subtle going on? Value is indeed a lower case letter in ALPH (which is just a list containing the alphabet).
| 0debug
|
static void qemu_gluster_complete_aio(void *opaque)
{
GlusterAIOCB *acb = (GlusterAIOCB *)opaque;
qemu_bh_delete(acb->bh);
acb->bh = NULL;
qemu_coroutine_enter(acb->coroutine, NULL);
}
| 1threat
|
Django Rest framework, how to include '__all__' fields and a related field in ModelSerializer ? : <p>I have two models, one with M2M relation and a related name. I want to include <strong>all</strong> fields in the serializer and the related field.</p>
<p>models.py:</p>
<pre><code>class Pizza(models.Model):
name = models.CharField(max_length=50, unique=True)
toppings = models.ManyToManyField(Topping, null=True, blank=True, related_name='pizzas')
class Topping(models.Model):
name = models.CharField(max_length=50, unique=True)
price = models.IntegerField(default=0)
</code></pre>
<p>serializer.py:</p>
<pre><code>class ToppingSerializer(serializers.ModelSerializer):
class Meta:
model = Topping
fields = '__all__'
</code></pre>
<p>This works but it doesn't include the related field.</p>
<pre><code> fields = ['name', 'price', 'pizzas']
</code></pre>
<p>This works exactly as I want, but what happens when Toppings model has a lot of fields. I want to do something like :</p>
<pre><code>fields = ['__all__', 'pizzas']
</code></pre>
<p>This syntax results in an error saying:</p>
<blockquote>
<p>Field name <code>__all__</code> is not valid for model</p>
</blockquote>
<p>Is there a way to achieve the wanted behavior? Or the fields must be typed manually when using a related name ?</p>
| 0debug
|
How to check if a link is a file or document while using Selenium? : I am making a web crawler using selenium in Python3.5, the problem I am having is that while crawling it clicks on the links that are some sort of file like ".pdf" or ".zip" or ".exe". I have already tried looking for these strings in the links and most of the time it works but I want 100% results. What should I do?
| 0debug
|
how to read specific line from the text file in C# : <p>how to read particular line (for eg line no 2) from the text file in C#.</p>
<p>abc.txt is the filename contains
line 1- xyz
line 2- pqr</p>
<p>I want to read pqr from abc.txt</p>
| 0debug
|
Getting Podfile by Cocoa installation... Is a directory...why? : [enter image description here][1]
[1]: https://i.stack.imgur.com/jiQnk.jpg
Trying to get Pod file, I am always having the same mistake with this part.
bash...." is a directory" by terminal. Whan can I do?
Thanks
| 0debug
|
void timerlist_free(QEMUTimerList *timer_list)
{
assert(!timerlist_has_timers(timer_list));
if (timer_list->clock) {
QLIST_REMOVE(timer_list, list);
}
qemu_mutex_destroy(&timer_list->active_timers_lock);
g_free(timer_list);
}
| 1threat
|
How do i remove all numbers in python script *Take a look please* : # Help all numbers in this list need to be removed all help will be greatly appreciated thanks again !
# Note this list is 88779 lines long(If you want this list for any of your own purposes let me know and i will send you a download link ;) )
#.....EXAMPLE..BELOW.....
SMITH 1.006 1.006 1
JOHNSON 0.810 1.816 2
WILLIAMS 0.699 2.515 3
JONES 0.621 3.136 4
BROWN 0.621 3.757 5
DAVIS 0.480 4.237 6
MILLER 0.424 4.660 7
WILSON 0.339 5.000 8
MOORE 0.312 5.312 9
TAYLOR 0.311 5.623 10
ANDERSON 0.311 5.934 11
THOMAS 0.311 6.245 12
JACKSON 0.310 6.554 13
WHITE 0.279 6.834 14
HARRIS 0.275 7.109 15
MARTIN 0.273 7.382 16
THOMPSON 0.269 7.651 17
GARCIA 0.254 7.905 18
MARTINEZ 0.234 8.140 19
ROBINSON 0.233 8.372 20
CLARK 0.231 8.603 21
RODRIGUEZ 0.229 8.832 22
LEWIS 0.226 9.058 23
LEE 0.220 9.278 24
WALKER 0.219 9.497 25
HALL 0.200 9.698 26
ALLEN 0.199 9.897 27
YOUNG 0.193 10.090 28
HERNANDEZ 0.192 10.282 29
KING 0.190 10.472 30
WRIGHT 0.189 10.662 31
LOPEZ 0.187 10.849 32
HILL 0.187 11.035 33
SCOTT 0.185 11.220 34
GREEN 0.183 11.403 35
ADAMS 0.174 11.577 36
BAKER 0.171 11.748 37
GONZALEZ 0.166 11.915 38
NELSON 0.162 12.077 39
CARTER 0.162 12.239 40
MITCHELL 0.160 12.399 41
PEREZ 0.155 12.554 42
ROBERTS 0.153 12.707 43
TURNER 0.152 12.859 44
PHILLIPS 0.149 13.008 45
CAMPBELL 0.149 13.157 46
PARKER 0.146 13.302 47
EVANS 0.141 13.443 48
EDWARDS 0.137 13.580 49
COLLINS 0.134 13.714 50
STEWART 0.133 13.847 51
SANCHEZ 0.130 13.977 52
MORRIS 0.125 14.102 53
ROGERS 0.123 14.225 54
REED 0.122 14.347 55
COOK 0.120 14.467 56
MORGAN 0.118 14.585 57
BELL 0.117 14.702 58
MURPHY 0.117 14.819 59
BAILEY 0.115 14.934 60
RIVERA 0.113 15.047 61
COOPER 0.113 15.160 62
RICHARDSON 0.112 15.272 63
COX 0.110 15.382 64
HOWARD 0.110 15.492 65
WARD 0.108 15.600 66
TORRES 0.108 15.708 67
PETERSON 0.107 15.815 68
GRAY 0.106 15.921 69
RAMIREZ 0.105 16.026 70
JAMES 0.105 16.131 71
WATSON 0.103 16.233 72
BROOKS 0.103 16.336 73
KELLY 0.102 16.438 74
SANDERS 0.100 16.537 75
PRICE 0.099 16.637 76
BENNETT 0.099 16.736 77
WOOD 0.098 16.834 78
BARNES 0.097 16.931 79
ROSS 0.096 17.027 80
HENDERSON 0.095 17.122 81
COLEMAN 0.095 17.217 82
JENKINS 0.095 17.312 83
PERRY 0.094 17.406 84
POWELL 0.093 17.499 85
LONG 0.092 17.591 86
PATTERSON 0.092 17.684 87
HUGHES 0.092 17.776 88
FLORES 0.092 17.868 89
WASHINGTON 0.092 17.959 90
BUTLER 0.091 18.050 91
SIMMONS 0.091 18.141 92
FOSTER 0.091 18.231 93
GONZALES 0.087 18.318 94
BRYANT 0.087 18.405 95
ALEXANDER 0.085 18.490 96
RUSSELL 0.085 18.574 97
GRIFFIN 0.084 18.659 98
DIAZ 0.084 18.742 99
HAYES 0.083 18.825 100
MYERS 0.083 18.908 101
FORD 0.082 18.990 102
HAMILTON 0.082 19.072 103
GRAHAM 0.082 19.154 104
SULLIVAN 0.081 19.234 105
WALLACE 0.081 19.315 106
WOODS 0.080 19.395 107
COLE 0.080 19.476 108
WEST 0.080 19.555 109
JORDAN 0.078 19.634 110
OWENS 0.078 19.711 111
REYNOLDS 0.078 19.789 112
FISHER 0.077 19.866 113
ELLIS 0.077 19.943 114
HARRISON 0.076 20.019 115
GIBSON 0.075 20.094 116
MCDONALD 0.075 20.169 117
CRUZ 0.075 20.244 118
MARSHALL 0.075 20.319 119
ORTIZ 0.075 20.394 120
GOMEZ 0.075 20.468 121
MURRAY 0.074 20.543 122
FREEMAN 0.074 20.617 123
WELLS 0.073 20.690 124
WEBB 0.072 20.762 125
SIMPSON 0.070 20.832 126
STEVENS 0.070 20.902 127
TUCKER 0.070 20.971 128
PORTER 0.069 21.041 129
HUNTER 0.069 21.110 130
HICKS 0.069 21.178 131
CRAWFORD 0.068 21.246 132
HENRY 0.068 21.314 133
BOYD 0.068 21.381 134
MASON 0.068 21.449 135
MORALES 0.067 21.516 136
KENNEDY 0.067 21.582 137
WARREN 0.067 21.649 138
DIXON 0.066 21.715 139
RAMOS 0.066 21.782 140
REYES 0.066 21.848 141
BURNS 0.065 21.913 142
GORDON 0.065 21.978 143
SHAW 0.065 22.043 144
HOLMES 0.065 22.108 145
RICE 0.064 22.172 146
ROBERTSON 0.064 22.236 147
HUNT 0.063 22.299 148
BLACK 0.063 22.362 149
DANIELS 0.062 22.425 150
PALMER 0.062 22.487 151
MILLS 0.061 22.547 152
NICHOLS 0.060 22.607 153
GRANT 0.060 22.667 154
KNIGHT 0.060 22.727 155
FERGUSON 0.059 22.786 156
ROSE 0.059 22.845 157
STONE 0.059 22.904 158
HAWKINS 0.059 22.963 159
DUNN 0.058 23.022 160
PERKINS 0.058 23.079 161
HUDSON 0.058 23.137 162
SPENCER 0.057 23.194 163
GARDNER 0.057 23.251 164
STEPHENS 0.057 23.308 165
PAYNE 0.057 23.365 166
PIERCE 0.056 23.421 167
BERRY 0.056 23.477 168
MATTHEWS 0.056 23.533 169
ARNOLD 0.056 23.589 170
WAGNER 0.055 23.645 171
WILLIS 0.055 23.700 172
RAY 0.055 23.755 173
WATKINS 0.055 23.811 174
OLSON 0.055 23.866 175
CARROLL 0.055 23.921 176
DUNCAN 0.055 23.976 177
SNYDER 0.055 24.031 178
HART 0.054 24.086 179
CUNNINGHAM 0.054 24.140 180
BRADLEY 0.054 24.194 181
LANE 0.054 24.247 182
ANDREWS 0.054 24.301 183
RUIZ 0.054 24.355 184
HARPER 0.054 24.408 185
FOX 0.053 24.462 186
RILEY 0.053 24.515 187
ARMSTRONG 0.053 24.568 188
CARPENTER 0.053 24.621 189
WEAVER 0.053 24.673 190
GREENE 0.053 24.726 191
LAWRENCE 0.052 24.779 192
ELLIOTT 0.052 24.831 193
CHAVEZ 0.052 24.883 194
SIMS 0.052 24.936 195
AUSTIN 0.052 24.988 196
PETERS 0.052 25.040 197
KELLEY 0.052 25.092 198
FRANKLIN 0.051 25.143 199
LAWSON 0.051 25.195 200
FIELDS 0.051 25.246 201
GUTIERREZ 0.051 25.297 202
RYAN 0.051 25.348 203
SCHMIDT 0.051 25.400 204
CARR 0.051 25.451 205
VASQUEZ 0.051 25.502 206
CASTILLO 0.051 25.552 207
WHEELER 0.051 25.603 208
CHAPMAN 0.050 25.653 209
OLIVER 0.050 25.703 210
MONTGOMERY 0.049 25.753 211
RICHARDS 0.049 25.802 212
WILLIAMSON 0.049 25.851 213
JOHNSTON 0.049 25.900 214
BANKS 0.048 25.948 215
MEYER 0.048 25.996 216
BISHOP 0.048 26.045 217
MCCOY 0.048 26.093 218
HOWELL 0.048 26.140 219
ALVAREZ 0.048 26.188 220
MORRISON 0.048 26.235 221
HANSEN 0.047 26.283 222
FERNANDEZ 0.047 26.330 223
GARZA 0.047 26.377 224
HARVEY 0.047 26.424 225
LITTLE 0.046 26.470 226
BURTON 0.046 26.516 227
STANLEY 0.046 26.562 228
NGUYEN 0.046 26.608 229
GEORGE 0.046 26.653 230
JACOBS 0.046 26.699 231
REID 0.046 26.745 232
KIM 0.045 26.790 233
FULLER 0.045 26.835 234
LYNCH 0.045 26.880 235
DEAN 0.045 26.925 236
GILBERT 0.045 26.970 237
GARRETT 0.045 27.015 238
ROMERO 0.045 27.059 239
WELCH 0.044 27.104 240
LARSON 0.044 27.148 241
FRAZIER 0.044 27.192 242
BURKE 0.044 27.235 243
HANSON 0.043 27.279 244
DAY 0.043 27.322 245
MENDOZA 0.043 27.365 246
MORENO 0.043 27.407 247
BOWMAN 0.043 27.450 248
MEDINA 0.042 27.492 249
FOWLER 0.042 27.535 250
BREWER 0.042 27.577 251
HOFFMAN 0.042 27.619 252
CARLSON 0.042 27.661 253
SILVA 0.042 27.703 254
PEARSON 0.042 27.744 255
HOLLAND 0.042 27.786 256
DOUGLAS 0.041 27.827 257
FLEMING 0.041 27.868 258
JENSEN 0.041 27.909 259
VARGAS 0.041 27.950 260
BYRD 0.041 27.991 261
DAVIDSON 0.041 28.032 262
HOPKINS 0.041 28.072 263
MAY 0.040 28.113 264
TERRY 0.040 28.153 265
HERRERA 0.040 28.193 266
WADE 0.040 28.233 267
SOTO 0.040 28.273 268
WALTERS 0.040 28.313 269
CURTIS 0.040 28.352 270
NEAL 0.039 28.392 271
CALDWELL 0.039 28.431 272
LOWE 0.039 28.471 273
JENNINGS 0.039 28.510 274
BARNETT 0.039 28.549 275
GRAVES 0.039 28.588 276
JIMENEZ 0.039 28.628 277
HORTON 0.039 28.667 278
SHELTON 0.039 28.706 279
BARRETT 0.039 28.745 280
OBRIEN 0.039 28.783 281
CASTRO 0.039 28.822 282
SUTTON 0.038 28.860 283
GREGORY 0.038 28.899 284
MCKINNEY 0.038 28.937 285
LUCAS 0.038 28.975 286
MILES 0.038 29.013 287
CRAIG 0.038 29.051 288
RODRIQUEZ 0.037 29.088 289
CHAMBERS 0.037 29.126 290
HOLT 0.037 29.163 291
LAMBERT 0.037 29.200 292
FLETCHER 0.037 29.237 293
WATTS 0.037 29.274 294
BATES 0.037 29.311 295
HALE 0.037 29.348 296
RHODES 0.037 29.385 297
PENA 0.037 29.421 298
BECK 0.037 29.458 299
NEWMAN 0.036 29.494 300
HAYNES 0.036 29.531 301
MCDANIEL 0.036 29.567 302
MENDEZ 0.036 29.603 303
BUSH 0.036 29.639 304
VAUGHN 0.036 29.675 305
PARKS 0.035 29.711 306
DAWSON 0.035 29.746 307
SANTIAGO 0.035 29.781 308
NORRIS 0.035 29.817 309
HARDY 0.035 29.852 310
LOVE 0.035 29.887 311
STEELE 0.035 29.921 312
CURRY 0.035 29.956 313
POWERS 0.035 29.991 314
SCHULTZ 0.035 30.025 315
BARKER 0.035 30.060 316
GUZMAN 0.034 30.094 317
PAGE 0.034 30.129 318
MUNOZ 0.034 30.163 319
BALL 0.034 30.197 320
KELLER 0.034 30.231 321
CHANDLER 0.034 30.265 322
WEBER 0.034 30.299 323
LEONARD 0.034 30.333 324
WALSH 0.033 30.366 325
LYONS 0.033 30.400 326
RAMSEY 0.033 30.433 327
WOLFE 0.033 30.466 328
SCHNEIDER 0.033 30.499 329
MULLINS 0.033 30.532 330
BENSON 0.033 30.565 331
SHARP 0.033 30.598 332
BOWEN 0.033 30.631 333
DANIEL 0.033 30.663 334
BARBER 0.032 30.696 335
CUMMINGS 0.032 30.728 336
HINES 0.032 30.760 337
BALDWIN 0.032 30.793 338
GRIFFITH 0.032 30.824 339
VALDEZ 0.032 30.856 340
HUBBARD 0.032 30.888 341
SALAZAR 0.032 30.920 342
REEVES 0.032 30.951 343
WARNER 0.031 30.983 344
STEVENSON 0.031 31.014 345
BURGESS 0.031 31.045 346
SANTOS 0.031 31.076 347
TATE 0.031 31.107 348
CROSS 0.031 31.138 349
GARNER 0.031 31.169 350
MANN 0.031 31.200 351
MACK 0.031 31.231 352
MOSS 0.031 31.262 353
THORNTON 0.031 31.292 354
DENNIS 0.031 31.323 355
MCGEE 0.031 31.354 356
FARMER 0.030 31.384 357
DELGADO 0.030 31.415 358
AGUILAR 0.030 31.445 359
VEGA 0.030 31.475 360
GLOVER 0.030 31.505 361
MANNING 0.030 31.535 362
COHEN 0.030 31.566 363
HARMON 0.030 31.596 364
RODGERS 0.030 31.626 365
ROBBINS 0.030 31.656 366
NEWTON 0.030 31.686 367
TODD 0.030 31.716 368
BLAIR 0.030 31.746 369
HIGGINS 0.030 31.776 370
INGRAM 0.030 31.806 371
REESE 0.030 31.836 372
CANNON 0.030 31.865 373
STRICKLAND 0.030 31.895 374
TOWNSEND 0.030 31.925 375
POTTER 0.030 31.955 376
GOODWIN 0.030 31.984 377
WALTON 0.030 32.014 378
ROWE 0.029 32.043 379
HAMPTON 0.029 32.073 380
ORTEGA 0.029 32.102 381
PATTON 0.029 32.131 382
SWANSON 0.029 32.161 383
JOSEPH 0.029 32.190 384
FRANCIS 0.029 32.219 385
GOODMAN 0.029 32.248 386
MALDONADO 0.029 32.277 387
YATES 0.029 32.305 388
BECKER 0.029 32.334 389
ERICKSON 0.029 32.363 390
HODGES 0.029 32.392 391
RIOS 0.029 32.421 392
CONNER 0.029 32.449 393
ADKINS 0.029 32.478 394
WEBSTER 0.028 32.506 395
NORMAN 0.028 32.535 396
MALONE 0.028 32.563 397
HAMMOND 0.028 32.591 398
FLOWERS 0.028 32.620 399
COBB 0.028 32.648 400
MOODY 0.028 32.676 401
QUINN 0.028 32.704 402
BLAKE 0.028 32.732 403
MAXWELL 0.028 32.759 404
POPE 0.028 32.787 405
FLOYD 0.027 32.814 406
OSBORNE 0.027 32.842 407
PAUL 0.027 32.869 408
MCCARTHY 0.027 32.896 409
GUERRERO 0.027 32.924 410
LINDSEY 0.027 32.951 411
ESTRADA 0.027 32.978 412
SANDOVAL 0.027 33.005 413
GIBBS 0.027 33.032 414
TYLER 0.027 33.059 415
GROSS 0.027 33.086 416
FITZGERALD 0.027 33.113 417
STOKES 0.027 33.140 418
DOYLE 0.027 33.167 419
SHERMAN 0.027 33.193 420
SAUNDERS 0.027 33.220 421
WISE 0.027 33.247 422
COLON 0.027 33.274 423
GILL 0.027 33.300 424
ALVARADO 0.027 33.327 425
GREER 0.026 33.353 426
PADILLA 0.026 33.380 427
SIMON 0.026 33.406 428
WATERS 0.026 33.432 429
NUNEZ 0.026 33.459 430
BALLARD 0.026 33.485 431
SCHWARTZ 0.026 33.511 432
MCBRIDE 0.026 33.536 433
HOUSTON 0.026 33.562 434
CHRISTENSEN 0.026 33.588 435
KLEIN 0.026 33.614 436
PRATT 0.026 33.640 437
BRIGGS 0.026 33.666 438
PARSONS 0.026 33.692 439
MCLAUGHLIN 0.026 33.717 440
ZIMMERMAN 0.026 33.743 441
FRENCH 0.026 33.769 442
BUCHANAN 0.026 33.794 443
MORAN 0.026 33.820 444
COPELAND 0.025 33.845 445
ROY 0.025 33.871 446
PITTMAN 0.025 33.896 447
BRADY 0.025 33.922 448
MCCORMICK 0.025 33.947 449
HOLLOWAY 0.025 33.972 450
BROCK 0.025 33.998 451
POOLE 0.025 34.023 452
FRANK 0.025 34.048 453
LOGAN 0.025 34.073 454
OWEN 0.025 34.098 455
BASS 0.025 34.122 456
MARSH 0.025 34.147 457
DRAKE 0.025 34.172 458
WONG 0.025 34.197 459
JEFFERSON 0.025 34.221 460
PARK 0.025 34.246 461
MORTON 0.025 34.271 462
ABBOTT 0.025 34.295 463
SPARKS 0.025 34.320 464
PATRICK 0.024 34.344 465
NORTON 0.024 34.369 466
HUFF 0.024 34.393 467
CLAYTON 0.024 34.417 468
MASSEY 0.024 34.442 469
LLOYD 0.024 34.466 470
FIGUEROA 0.024 34.490 471
CARSON 0.024 34.514 472
BOWERS 0.024 34.538 473
ROBERSON 0.024 34.563 474
BARTON 0.024 34.587 475
TRAN 0.024 34.611 476
LAMB 0.024 34.635 477
HARRINGTON 0.024 34.659 478
CASEY 0.024 34.683 479
BOONE 0.024 34.706 480
CORTEZ 0.024 34.730 481
CLARKE 0.024 34.754 482
MATHIS 0.024 34.778 483
SINGLETON 0.024 34.801 484
WILKINS 0.024 34.825 485
CAIN 0.024 34.849 486
BRYAN 0.024 34.872 487
UNDERWOOD 0.024 34.896 488
HOGAN 0.024 34.920 489
MCKENZIE 0.023 34.943 490
COLLIER 0.023 34.966 491
LUNA 0.023 34.990 492
PHELPS 0.023 35.013 493
MCGUIRE 0.023 35.036 494
ALLISON 0.023 35.059 495
BRIDGES 0.023 35.083 496
WILKERSON 0.023 35.106 497
NASH 0.023 35.129 498
SUMMERS 0.023 35.152 499
ATKINS 0.023 35.175 500
WILCOX 0.023 35.198 501
PITTS 0.023 35.221 502
CONLEY 0.023 35.244 503
MARQUEZ 0.023 35.267 504
BURNETT 0.023 35.290 505
RICHARD 0.023 35.313 506
COCHRAN 0.023 35.335 507
CHASE 0.023 35.358 508
DAVENPORT 0.023 35.381 509
HOOD 0.023 35.404 510
GATES 0.023 35.427 511
CLAY 0.023 35.449 512
AYALA 0.023 35.472 513
SAWYER 0.023 35.495 514
ROMAN 0.023 35.517 515
VAZQUEZ 0.023 35.540 516
DICKERSON 0.023 35.562 517
HODGE 0.022 35.585 518
ACOSTA 0.022 35.607 519
FLYNN 0.022 35.630 520
ESPINOZA 0.022 35.652 521
NICHOLSON 0.022 35.675 522
MONROE 0.022 35.697 523
WOLF 0.022 35.719 524
MORROW 0.022 35.741 525
KIRK 0.022 35.763 526
RANDALL 0.022 35.785 527
ANTHONY 0.022 35.807 528
WHITAKER 0.022 35.829 529
OCONNOR 0.022 35.851 530
SKINNER 0.022 35.873 531
WARE 0.022 35.895 532
MOLINA 0.022 35.916 533
KIRBY 0.022 35.938 534
HUFFMAN 0.022 35.960 535
BRADFORD 0.022 35.982 536
CHARLES 0.022 36.003 537
GILMORE 0.022 36.025 538
DOMINGUEZ 0.022 36.046 539
ONEAL 0.022 36.068 540
BRUCE 0.022 36.090 541
LANG 0.021 36.111 542
COMBS 0.021 36.132 543
KRAMER 0.021 36.154 544
HEATH 0.021 36.175 545
HANCOCK 0.021 36.196 546
GALLAGHER 0.021 36.218 547
GAINES 0.021 36.239 548
SHAFFER 0.021 36.260 549
SHORT 0.021 36.281 550
WIGGINS 0.021 36.302 551
MATHEWS 0.021 36.323 552
MCCLAIN 0.021 36.344 553
FISCHER 0.021 36.365 554
WALL 0.021 36.386 555
SMALL 0.021 36.407 556
MELTON 0.021 36.428 557
HENSLEY 0.021 36.449 558
BOND 0.021 36.470 559
DYER 0.021 36.491 560
CAMERON 0.021 36.511 561
GRIMES 0.021 36.532 562
CONTRERAS 0.021 36.553 563
CHRISTIAN 0.021 36.573 564
WYATT 0.021 36.594 565
BAXTER 0.021 36.615 566
SNOW 0.021 36.635 567
MOSLEY 0.021 36.656 568
SHEPHERD 0.021 36.677 569
LARSEN 0.021 36.697 570
HOOVER 0.021 36.718 571
BEASLEY 0.020 36.738 572
GLENN 0.020 36.758 573
PETERSEN 0.020 36.779 574
WHITEHEAD 0.020 36.799 575
MEYERS 0.020 36.819 576
KEITH 0.020 36.840 577
GARRISON 0.020 36.860 578
VINCENT 0.020 36.880 579
SHIELDS 0.020 36.900 580
HORN 0.020 36.920 581
SAVAGE 0.020 36.941 582
OLSEN 0.020 36.961 583
SCHROEDER 0.020 36.981 584
HARTMAN 0.020 37.001 585
WOODARD 0.020 37.021 586
MUELLER 0.020 37.041 587
KEMP 0.020 37.061 588
DELEON 0.020 37.081 589
BOOTH 0.020 37.101 590
PATEL 0.020 37.121 591
CALHOUN 0.020 37.140 592
WILEY 0.020 37.160 593
EATON 0.020 37.180 594
CLINE 0.020 37.200 595
NAVARRO 0.020 37.220 596
HARRELL 0.020 37.240 597
LESTER 0.020 37.259 598
HUMPHREY 0.020 37.279 599
PARRISH 0.020 37.299 600
DURAN 0.020 37.318 601
HUTCHINSON 0.020 37.338 602
HESS 0.020 37.358 603
DORSEY 0.020 37.377 604
BULLOCK 0.020 37.397 605
ROBLES 0.020 37.416 606
BEARD 0.019 37.436 607
DALTON 0.019 37.455 608
AVILA 0.019 37.475 609
VANCE 0.019 37.494 610
RICH 0.019 37.514 611
BLACKWELL 0.019 37.533 612
YORK 0.019 37.552 613
JOHNS 0.019 37.572 614
BLANKENSHIP 0.019 37.591 615
TREVINO 0.019 37.610 616
SALINAS 0.019 37.630 617
CAMPOS 0.019 37.649 618
PRUITT 0.019 37.668 619
MOSES 0.019 37.688 620
CALLAHAN 0.019 37.707 621
GOLDEN 0.019 37.726 622
MONTOYA 0.019 37.745 623
HARDIN 0.019 37.764 624
GUERRA 0.019 37.783 625
MCDOWELL 0.019 37.802 626
CAREY 0.019 37.821 627
STAFFORD 0.019 37.840 628
GALLEGOS 0.019 37.859 629
HENSON 0.019 37.878 630
WILKINSON 0.019 37.897 631
BOOKER 0.019 37.916 632
MERRITT 0.019 37.935 633
MIRANDA 0.019 37.953 634
ATKINSON 0.019 37.972 635
ORR 0.019 37.991 636
DECKER 0.019 38.010 637
HOBBS 0.019 38.028 638
PRESTON 0.019 38.047 639
TANNER 0.019 38.066 640
KNOX 0.019 38.084 641
PACHECO 0.019 38.103 642
STEPHENSON 0.018 38.121 643
GLASS 0.018 38.140 644
ROJAS 0.018 38.158 645
SERRANO 0.018 38.176 646
MARKS 0.018 38.195 647
HICKMAN 0.018 38.213 648
ENGLISH 0.018 38.231 649
SWEENEY 0.018 38.249 650
STRONG 0.018 38.267 651
PRINCE 0.018 38.285 652
MCCLURE 0.018 38.304 653
CONWAY 0.018 38.322 654
WALTER 0.018 38.340 655
ROTH 0.018 38.358 656
MAYNARD 0.018 38.376 657
FARRELL 0.018 38.394 658
LOWERY 0.018 38.411 659
HURST 0.018 38.429 660
NIXON 0.018 38.447 661
WEISS 0.018 38.465 662
TRUJILLO 0.018 38.483 663
ELLISON 0.018 38.500 664
SLOAN 0.018 38.518 665
JUAREZ 0.018 38.536 666
WINTERS 0.018 38.553 667
MCLEAN 0.018 38.571 668
RANDOLPH 0.018 38.588 669
LEON 0.018 38.606 670
BOYER 0.018 38.624 671
VILLARREAL 0.018 38.641 672
MCCALL 0.018 38.659 673
GENTRY 0.018 38.676 674
CARRILLO 0.017 38.694 675
KENT 0.017 38.711 676
AYERS 0.017 38.729 677
LARA 0.017 38.746 678
SHANNON 0.017 38.763 679
SEXTON 0.017 38.781 680
PACE 0.017 38.798 681
HULL 0.017 38.815 682
LEBLANC 0.017 38.833 683
BROWNING 0.017 38.850 684
VELASQUEZ 0.017 38.867 685
LEACH 0.017 38.884 686
CHANG 0.017 38.901 687
HOUSE 0.017 38.918 688
SELLERS 0.017 38.936 689
HERRING 0.017 38.953 690
NOBLE 0.017 38.970 691
FOLEY 0.017 38.987 692
BARTLETT 0.017 39.004 693
MERCADO 0.017 39.021 694
LANDRY 0.017 39.037 695
DURHAM 0.017 39.054 696
WALLS 0.017 39.071 697
BARR 0.017 39.088 698
MCKEE 0.017 39.105 699
BAUER 0.017 39.122 700
RIVERS 0.017 39.139 701
EVERETT 0.017 39.155 702
BRADSHAW 0.017 39.172 703
PUGH 0.017 39.189 704
VELEZ 0.017 39.206 705
RUSH 0.017 39.222 706
ESTES 0.017 39.239 707
DODSON 0.017 39.255 708
MORSE 0.017 39.272 709
SHEPPARD 0.017 39.289 710
WEEKS 0.017 39.305 711
CAMACHO 0.017 39.322 712
BEAN 0.017 39.338 713
BARRON 0.017 39.355 714
LIVINGSTON 0.017 39.371 715
MIDDLETON 0.016 39.388 716
SPEARS 0.016 39.404 717
BRANCH 0.016 39.420 718
BLEVINS 0.016 39.437 719
CHEN 0.016 39.453 720
KERR 0.016 39.469 721
MCCONNELL 0.016 39.486 722
HATFIELD 0.016 39.502 723
HARDING 0.016 39.518 724
ASHLEY 0.016 39.535 725
SOLIS 0.016 39.551 726
HERMAN 0.016 39.567 727
FROST 0.016 39.583 728
GILES 0.016 39.599 729
BLACKBURN 0.016 39.616 730
WILLIAM 0.016 39.632 731
PENNINGTON 0.016 39.648 732
WOODWARD 0.016 39.664 733
FINLEY 0.016 39.680 734
MCINTOSH 0.016 39.696 735
KOCH 0.016 39.713 736
BEST 0.016 39.729 737
SOLOMON 0.016 39.745 738
MCCULLOUGH 0.016 39.761 739
DUDLEY 0.016 39.777 740
NOLAN 0.016 39.793 741
BLANCHARD 0.016 39.809 742
RIVAS 0.016 39.825 743
BRENNAN 0.016 39.841 744
MEJIA 0.016 39.856 745
KANE 0.016 39.872 746
BENTON 0.016 39.888 747
JOYCE 0.016 39.904 748
BUCKLEY 0.016 39.920 749
HALEY 0.016 39.936 750
VALENTINE 0.016 39.952 751
MADDOX 0.016 39.967 752
RUSSO 0.016 39.983 753
MCKNIGHT 0.016 39.999 754
BUCK 0.016 40.015 755
MOON 0.016 40.030 756
| 0debug
|
How to create nested routes with parameters using NestJS : <p>I need to build an API where most of the routes are prefixed with a common URL part which also has a parameter.</p>
<p>In my specific case, my routes need to look like:</p>
<p><code>/accounts/:account/resource1/:someParam</code> </p>
<p><code>/accounts/:account/resource2/:someParam/whatever</code></p>
<p><code>/accounts/:account/resource3/</code></p>
<p><code>/accounts/:account/resource4/subResource/</code></p>
<p>and so on..</p>
<p>So ideally I would create a <em>parent</em> route <code>/accounts/:account/</code> which will contain the <em>children</em> routes (<code>resource1</code>, <code>resource2</code>, <code>resource3</code>, <code>resource4</code>, etc...).</p>
<p>I also need the <code>:account</code> parameter to be accessible from all the children routes.</p>
<p>What is the best way to achieve this with NestJS ?</p>
| 0debug
|
Download property for link? : <p>There is a following code:</p>
<pre><code>var a = document.createElement("a");
a.href = url;
a.download = fileName;
document.body.appendChild(a);
</code></pre>
<p>What is property <code>download</code>, how does it work?</p>
| 0debug
|
Push fails in GitKraken with errormessage "Push Failed cannot read property 'fullName' of undefined" : <p>I was trying to push and create a pull-request from my local feature-branch, as usual, being in my feature-branch and right-clicking on the remote origin/develop -branch (I'm using Git Flow), and this error message popped out:</p>
<p><a href="https://i.stack.imgur.com/Ady3S.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Ady3S.png" alt="enter image description here"></a></p>
<p>Can't find anything with that error message. Any ideas?</p>
| 0debug
|
javascript includes() case insensitive : <p>lets say I have an array of filter strings that I need to loop and check against with other passed in string.</p>
<pre><code>var filterstrings = ['firststring','secondstring','thridstring'];
var passedinstring = localStorage.getItem("passedinstring");
for (i = 0; i < filterstrings.lines.length; i++) {
if (passedinstring.includes(filterstrings[i])) {
alert("string detected");
}
}
</code></pre>
<p>How do I ensure that case sensitivity is ignored here (preferably by using regex) when filtering, if the <code>var passedinstring</code> were to have strings like <code>FirsTsTriNg</code> or <code>fiRSTStrING</code>?</p>
| 0debug
|
static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code, int frame_type){
AVFormatContext *s= nut->avf;
StreamContext *stream;
ByteIOContext *bc = &s->pb;
int size, flags, size_mul, size_lsb, stream_id;
int key_frame = 0;
int64_t pts = 0;
const int prefix_len= frame_type == 2 ? 8+1 : 1;
const int64_t frame_start= url_ftell(bc) - prefix_len;
flags= nut->frame_code[frame_code].flags;
size_mul= nut->frame_code[frame_code].size_mul;
size_lsb= nut->frame_code[frame_code].size_lsb;
stream_id= nut->frame_code[frame_code].stream_id_plus1 - 1;
if(flags & FLAG_FRAME_TYPE){
reset(s);
if(get_packetheader(nut, bc, prefix_len, 0) < 0)
return -1;
if(frame_type!=2)
frame_type= 1;
}
if(stream_id==-1)
stream_id= get_v(bc);
if(stream_id >= s->nb_streams){
av_log(s, AV_LOG_ERROR, "illegal stream_id\n");
return -1;
}
stream= &nut->stream[stream_id];
if(flags & FLAG_PRED_KEY_FRAME){
if(flags & FLAG_KEY_FRAME)
key_frame= !stream->last_key_frame;
else
key_frame= stream->last_key_frame;
}else{
key_frame= !!(flags & FLAG_KEY_FRAME);
}
if(flags & FLAG_PTS){
if(flags & FLAG_FULL_PTS){
pts= get_v(bc);
if(frame_type && key_frame){
av_add_index_entry(
s->streams[stream_id],
frame_start,
pts,
frame_start - nut->stream[stream_id].last_sync_pos,
AVINDEX_KEYFRAME);
nut->stream[stream_id].last_sync_pos= frame_start;
assert(nut->packet_start == frame_start);
}
}else{
int64_t mask = (1<<stream->msb_timestamp_shift)-1;
int64_t delta= stream->last_pts - mask/2;
pts= ((get_v(bc) - delta)&mask) + delta;
}
}else{
pts= stream->last_pts + stream->lru_pts_delta[(flags&12)>>2];
}
if(size_mul <= size_lsb){
size= stream->lru_size[size_lsb - size_mul];
}else{
if(flags & FLAG_DATA_SIZE)
size= size_mul*get_v(bc) + size_lsb;
else
size= size_lsb;
}
if(url_ftell(bc) - nut->packet_start + size > nut->written_packet_size){
av_log(s, AV_LOG_ERROR, "frame size too large\n");
return -1;
}
av_new_packet(pkt, size);
get_buffer(bc, pkt->data, size);
pkt->stream_index = stream_id;
if (key_frame)
pkt->flags |= PKT_FLAG_KEY;
pkt->pts = pts * AV_TIME_BASE * stream->rate_den / stream->rate_num;
update(nut, stream_id, frame_start, frame_type, frame_code, key_frame, size, pts);
return 0;
}
| 1threat
|
view and data API about use、upload、pricing : <ol>
<li>view and data API有中国区联系人吗</li>
<li>如果想长期显示模型可以存储到自己服务器吗</li>
<li>对于中国区域是否有费用</li>
<li>加载的css、js是否有国内CDN</li>
<li>对一些后缀.SLDASM解析不好,怎么解决</li>
</ol>
| 0debug
|
I want to use bootstrap only on the video. :
<div class="wrapper">
<div class="overlay active">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/DtNAqK_V-lg" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
</body>
</html>
I have a lot of other elements in my html file, and I don't want to tha bootstrap rules change them! I just want the bootstrap to the "wrapper" div and its inside.
But when I paste the link of bootstrap on the <head> tag, it changes everything.
Is it possible?
Thank you for all help. :))
| 0debug
|
Now i got the problem "Internet Server Error 500" : There is only 1 page called "index.php" <br>
and it only echo "testing"
<br>
Also there is no error log <br>
Any idea what cause the server 500?
| 0debug
|
static inline bool media_is_dvd(SCSIDiskState *s)
{
uint64_t nb_sectors;
if (s->qdev.type != TYPE_ROM) {
return false;
}
if (!bdrv_is_inserted(s->qdev.conf.bs)) {
return false;
}
bdrv_get_geometry(s->qdev.conf.bs, &nb_sectors);
return nb_sectors > CD_MAX_SECTORS;
}
| 1threat
|
Java BigInteger OR function : <p>I am using Java and have some problems.
I made two BigInteger variables, p and q.
In my code, I want to add if function, like if(p=1 \ q=1).
I tried many ways but there was error. Do you know how to solve this?</p>
| 0debug
|
How to capitalize part of an element in html/css? : <p>there I have the following element:</p>
<pre><code><h1> Welcome in our flat. </h1>
</code></pre>
<p>And I would like to modify it with CSS so that what it gonna be displayed will be:</p>
<p>Welcome to OUR flat.</p>
<p>So, I wanna capitalize the word OUR. Does anyone know how I can do that?</p>
| 0debug
|
static int sd_parse_uri(BDRVSheepdogState *s, const char *filename,
char *vdi, uint32_t *snapid, char *tag)
{
URI *uri;
QueryParams *qp = NULL;
int ret = 0;
uri = uri_parse(filename);
if (!uri) {
return -EINVAL;
}
if (!strcmp(uri->scheme, "sheepdog")) {
s->is_unix = false;
} else if (!strcmp(uri->scheme, "sheepdog+tcp")) {
s->is_unix = false;
} else if (!strcmp(uri->scheme, "sheepdog+unix")) {
s->is_unix = true;
} else {
ret = -EINVAL;
goto out;
}
if (uri->path == NULL || !strcmp(uri->path, "/")) {
ret = -EINVAL;
goto out;
}
pstrcpy(vdi, SD_MAX_VDI_LEN, uri->path + 1);
qp = query_params_parse(uri->query);
if (qp->n > 1 || (s->is_unix && !qp->n) || (!s->is_unix && qp->n)) {
ret = -EINVAL;
goto out;
}
if (s->is_unix) {
if (uri->server || uri->port || strcmp(qp->p[0].name, "socket")) {
ret = -EINVAL;
goto out;
}
s->host_spec = g_strdup(qp->p[0].value);
} else {
s->host_spec = g_strdup_printf("%s:%d", uri->server ?: SD_DEFAULT_ADDR,
uri->port ?: SD_DEFAULT_PORT);
}
if (uri->fragment) {
*snapid = strtoul(uri->fragment, NULL, 10);
if (*snapid == 0) {
pstrcpy(tag, SD_MAX_VDI_TAG_LEN, uri->fragment);
}
} else {
*snapid = CURRENT_VDI_ID;
}
out:
if (qp) {
query_params_free(qp);
}
uri_free(uri);
return ret;
}
| 1threat
|
How to read in words from file into a string : <p>for a lab i am working on, we are supposed to read in words from a file and get the length of each, and then store it in an array. Would reading in each word into a string and then storing the length in the array be the best way of going about this? And if so, could someone give me a pointer on how to do this? I am a bit lost..</p>
<p>Thanks!</p>
| 0debug
|
static void gen_dcbi(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
TCGv EA, val;
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
EA = tcg_temp_new();
gen_set_access_type(ctx, ACCESS_CACHE);
gen_addr_reg_index(ctx, EA);
val = tcg_temp_new();
gen_qemu_ld8u(ctx, val, EA);
gen_qemu_st8(ctx, val, EA);
tcg_temp_free(val);
tcg_temp_free(EA);
#endif
}
| 1threat
|
Auto increment Number inside 'span' tag Boostrap : Below is the code that I am going to use,
{{#each tasks}}
<span class="label label-default css-serial"></span>
{{/if}}
I want auto serial number to be generated inside the span tag just like below.
[![enter image description here][1]][1]
I am trying to acheive it using css with below code.
.css-serial {
counter-reset: serial-number; /* Set the serial number counter to 0 */
}
.css-serial {
counter-increment: serial-number; /* Increment the serial number counter */
content: counter(serial-number); /* Display the counter */
}
I am missing the element mapping, that's it! any help would be deeply appreciated.
[1]: https://i.stack.imgur.com/Pv9rL.png
| 0debug
|
How to add custom message to Jest expect? : <p>Image following test case:</p>
<pre><code>it('valid emails checks', () => {
['abc@y.com', 'a@b.nz'/*, ...*/].map(mail => {
expect(isValid(mail)).toBe(true);
});
});
</code></pre>
<p>I would like to add auto-generated message for each email like <code>Email 'f@f.com' should be valid</code> so that it's easy to find failing test cases.</p>
<p>Something like:</p>
<pre><code>// .map(email =>
expect(isValid(email), `Email ${email} should be valid`).toBe(true);
</code></pre>
<p>Is it possible in <strong>Jest</strong> ?</p>
<p>In Chai it was possible to do with second parameter like <code>expect(value, 'custom fail message').to.be...</code> and in Jasmine seems like it's done with <code>.because</code> clause. But cannot find solution in Jest.</p>
| 0debug
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.