problem
stringlengths
26
131k
labels
class label
2 classes
static int get_unused_buffer(QEMUFile *f, void *pv, size_t size) { qemu_fseek(f, size, SEEK_CUR); return 0; }
1threat
How we can convert Zthes format of Ontology in RDF/XML format? : I have used smartlogic semaphore, which uses ZThes Format for Ontologies. Now, i have Zthes Format of an Ontology. I want to convert this into RDF/XML format.
0debug
Split a string into 2 parts using js : <p>I have string:</p> <pre><code>str= "less than some value"; </code></pre> <p>I want to get "less than" separated from "some value", something like:</p> <pre><code>var a = "less than"; var b ="some value"; </code></pre> <p>how can i do this? Thanks!</p>
0debug
page overflowing from the right margin : This is my css code: if you have any questions regarding the code plz do ask or if you want the html i can add to it. Thank you! ----------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------asdaasasdasadsdassaddsadasdassdasdadasdaskjdbajskdbjkasdjkasdjkasdjkabjksdbajkdbjabsjkabjsdajkdjasdbjasdjasbdjkabsdjkabsdabsdjkabsdjkabsjkdabjksdbajsdbjaksdjkabsdjkabjskdabjskdajsdjaksdkjasdkjasbdjkasbdjkasbdjasdasdjajdajkdbjkabdjkasbdjkasbdjkabsjkdbasjkdbasjkdbjkasdnasdasdasdasdasdasdasdasdasdasdasdasda asdasdasasdasdjkkjsadbjkabskjdbak sbkjdabkjbadskj bajksbd jkasb kbakj bakjb jabk jabkjs bajk bkjasb kjabjk absjk bakj bjkasb jkdasbjk bdjka bjksa bkdj baksj dbkja bkjsbd jkasbd jkasb jkabs dbas jkba dkbjas dja jbk adsjkd asasdsad . ds ds ads nav.navbar { color: white !important; background-color: #d82c2e; font-weight: bold; } html { margin-right: 70px !important; } .introSec { height: 750px; } .hr { width: 100px; border-top: 1px solid red; } .navbar-flat li a:focus, .navbar-flat li a:hover, .navbar-flat li.active a, .navbar-brand { background-color: #c12728; color: #fff; } .navbar-flat a { transition: all .3s ease-in, 1s; } nav.navbar { padding-left: 35%; } .nav-link { color: #fff; /*font-size:calc(15px + 0.6vw);*/ } .navbar-brand { color: white; } .introLine { text-align: center; padding-top: 30px; font-size:calc(15px + 0.6vw); } .pieImage { border-radius: 100%; margin: 40px 45%; height: calc(20% + 0.6vw); min-width: calc(13% + 0.6vw); } .pieImage2 { border-radius: 100%; margin-top: 20px; width: 300px !important; height: 600; display: inline-block; } .coolOne { margin-left: 17%; } #landing-header { margin-top: -80px; } .myName { text-align: center; color: white; font-family: Lato, sans-serif; letter-spacing: -2px; } .title { text-align: center; color: black; word-spacing: 3px; padding: 10px; margin: 15px auto; font-family: 'Pontano Sans', sans-serif; font-size:calc(30px + 0.6vw); } .firstSec { background-color: #d82c2e; height: 725px; } .aboutTitle { text-align: center; color: #d82c2e; font-family: Lato, sans-serif; font-weight: 700; font-size: 30px; } .firstSec { margin-top: 57px; } .aboutIntro { text-align: center; font-family: Lato, sans-serif; } .aboutMe { padding: 20px 90px 0 90px; } .activities-inner { padding-top: 50px; margin: 50px; width: 100%; } .activities { border: 1px solid #e3e5e5; display: inline; padding: 50px; } .column { float: left; width: 25%; border: 1px solid lightgray; height: 200px; text-align: center; } .row:after { content: ""; display: table; clear: both; } .column { font-weight: 500; font-size: 30px; padding-top: 30px; } .icon { font-size: 40px; color: #d82c2e; } .technicalSkills { text-align: center; font-family: Lato, sans-serif; } .thirdSec { background-color: #d82c2e; } .technicalSkills { margin-top: 50px; color: white; padding-top: 20px; } .portfolioHeading { text-align: center; color: #d82c2e; font-weight: 700; font-family: 700; font-size: 30px; } .hr { margin-top: 20px; color: #d82c2e; } .portfolioPic { margin: 20px 35%; width: 30%; } .text-center { display:flex; flex-wrap: wrap; } .lastHr { float: left; } .contact { text-align: center; } .lastSec { background-color: #d82c2e; margin-top: 20px; } .contactDetails { padding-top: 20px; } .white { color: white; } .space { padding-top: 5px; } .row { padding-left: 100px; padding-right: 130px; } .dev { font-size:calc(18px + 1.0vw); } .secondDev { font-size:calc(15px + 0.6vw); } #landing-header { z-index: 1; position: relative; text-align: center; padding-top: 40vh; } #landing-header h1 { color: #fff; } .slideshow { position: inherit; width: 100%; height: 100%; top: 0; left: 0; z-index: 0; list-style: none; margin: 0; margin-top: -23.1%; padding: 0; } .slideshow li { width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-size: cover; background-position: 50% 50%; background-repeat: no-repeat; opacity: 0; z-index: 0; animation: imageAnimation 50s linear infinite; } .slideshow li:nth-child(1) { background-image: url(https://bearlake.org/wp- content/uploads/cache/images/garden-city-logan-campgrounds/garden-city-logan-campgrounds-987998613.jpg) } .slideshow li:nth-child(2) { background-image: url(https://bearlake.org/wp-content/uploads/cache/images/garden-city-logan-campgrounds/garden-city-logan-campgrounds-987998613.jpg); animation-delay: 10s; } .slideshow li:nth-child(3) { background-image: url(https://bearlake.org/wp-content/uploads/cache/images/garden-city-logan-campgrounds/garden-city-logan-campgrounds-987998613.jpg); animation-delay: 20s; } .slideshow li:nth-child(4) { background-image: url(https://bearlake.org/wp-content/uploads/cache/images/garden-city-logan-campgrounds/garden-city-logan-campgrounds-987998613.jpg); animation-delay: 30s; } .slideshow li:nth-child(5) { background-image: url(https://bearlake.org/wp-content/uploads/cache/images/garden-city-logan-campgrounds/garden-city-logan-campgrounds-987998613.jpg); animation-delay: 40s; } @keyframes imageAnimation { 0% { opacity: 0; animation-timing-function: ease-in; } 10% { opacity: 1; animation-timing-function: ease-out; } 20% { opacity: 1 } 30% { opacity: 0 } } .no-cssanimations .slideshow li { opacity: 1; } .nav-link { color: white !important; } .navbar-toggler { border-color: white; /*margin-left: -50%;*/ } .navbar-fixed-top { top: 0; } .navbar-light .navbar-toggler { border-color: transparent !important; } [![enter image description here][1]][1] Please go through the image. This is how my page looks like. [1]: https://i.stack.imgur.com/OemwN.jpg Notice from navbar section, the margin on the right is way out. I need all the sections to have the same margin and the page not to overflow. Thanks.
0debug
Clone filter gallery jquery plugin in a single page : Does anyone know how to clone/duplicate this (demo URL is given below) filter gallery jquery plugin multiple times in a single page? Any help would be appreciated Demo : http://dev.ktimes.co/was20378/tabs/index-nw2.html
0debug
static void trigger_prot_fault(CPUS390XState *env, target_ulong vaddr, uint64_t asc, int rw, bool exc) { uint64_t tec; tec = vaddr | (rw == MMU_DATA_STORE ? FS_WRITE : FS_READ) | 4 | asc >> 46; DPRINTF("%s: trans_exc_code=%016" PRIx64 "\n", __func__, tec); if (!exc) { return; } trigger_access_exception(env, PGM_PROTECTION, ILEN_LATER_INC, tec); }
1threat
Iterate through array of objects and print out property value : <p>If I have this:</p> <pre><code> myArr = [{name: 'rich', secondName: 'james'}, {name: 'brian', secondName: 'chris'}]; mySecondArr = []; </code></pre> <p>how can I loop over this so that <code>mySecondArr = ['rich', 'brian']</code></p> <p>I was thinking of doing something like:</p> <pre><code>for (var key in myArr){ if (Object.hasOwnProperty(name){ mySecondArr.push(name[value]) } </code></pre> <p>I know that is pseudo code but cant quite thing of the syntax for doing this as simply as possible</p> <p>NO JQUERY PLEASE</p>
0debug
Android Support Library 27.1.0 new methods requireActivity(), requireContext() : <p>According to the support library changelog and the Fragment class documentation (<a href="https://developer.android.com/reference/android/support/v4/app/Fragment.html" rel="noreferrer">https://developer.android.com/reference/android/support/v4/app/Fragment.html</a>), there are now new methods like requreActivity() and requireContext().</p> <p>What is the purpose of these methods compared to getActivity() and getContext(), since they can still throw IllegalStateExceptions? Is this preferable to returning null when an activity or context cannot be found? And should I simply replace every getActivity() with requireActivity()?</p>
0debug
How to change slides in slick slider without animation ? I : <p>I need to set slide in slick slider in input without animation effect.</p>
0debug
It don't working to upload file in php : [File form myupload.html][1] [File: uploadfile.php][2] [1]: https://i.stack.imgur.com/1uD6j.jpg [2]: https://i.stack.imgur.com/IFLys.jpg It don't working upload file !.Please help me!
0debug
How to combine two lists in one list? using notepad++ regex? : <p>I have a list of textfile such as below example:</p> <pre><code>username1 username2 username3 </code></pre> <p>I want a regex that can make it like following example:</p> <pre><code>username1:username1 username2:username2 username3:username3 </code></pre> <p>etc..</p> <p>I've tried many regex with failed attempts.</p> <p>hopefully somebody can help me..</p> <p>thank you in advance. regards.</p>
0debug
What are row types? Are they algebraic data types? : <p>I often hear that F# lacks support for OCaml row types, that makes the language more powerful than F#.</p> <p>What are they? Are they algebraic data types, such as sum types (discriminated unions) or product types (tuples, records)? And is it possible to write row types in other dialects, such as F#?</p>
0debug
Julia function argument by reference : <p>The docs say</p> <blockquote> <p>In Julia, all arguments to functions are passed by reference.</p> </blockquote> <p>so I was quite surprised to see a difference in the behaviour of these two functions:</p> <pre><code>function foo!(r::Array{Int64}) r=r+1 end function foobar!(r::Array{Int64}) for i=1:length(r) r[i]=r[i]+1 end end </code></pre> <p>here is the unexpectedly different output:</p> <pre><code>julia&gt; myarray 2-element Array{Int64,1}: 0 0 julia&gt; foo!(myarray); julia&gt; myarray 2-element Array{Int64,1}: 0 0 julia&gt; foobar!(myarray); julia&gt; myarray 2-element Array{Int64,1}: 1 1 </code></pre> <p>if the array is passed by reference, I would have expected foo! to change the zeros to ones.</p>
0debug
build_tpm_tcpa(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) { Acpi20Tcpa *tcpa = acpi_data_push(table_data, sizeof *tcpa); tcpa->platform_class = cpu_to_le16(TPM_TCPA_ACPI_CLASS_CLIENT); tcpa->log_area_minimum_length = cpu_to_le32(TPM_LOG_AREA_MINIMUM_SIZE); acpi_data_push(tcpalog, le32_to_cpu(tcpa->log_area_minimum_length)); bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1, false ); bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE, ACPI_BUILD_TPMLOG_FILE, &tcpa->log_area_start_address, sizeof(tcpa->log_area_start_address)); build_header(linker, table_data, (void *)tcpa, "TCPA", sizeof(*tcpa), 2, NULL, NULL); }
1threat
FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port, hwaddr ctl_addr, hwaddr data_addr) { DeviceState *dev; SysBusDevice *d; FWCfgState *s; dev = qdev_create(NULL, TYPE_FW_CFG); qdev_prop_set_uint32(dev, "ctl_iobase", ctl_port); qdev_prop_set_uint32(dev, "data_iobase", data_port); d = SYS_BUS_DEVICE(dev); s = FW_CFG(dev); assert(!object_resolve_path(FW_CFG_PATH, NULL)); object_property_add_child(qdev_get_machine(), FW_CFG_NAME, OBJECT(s), NULL); qdev_init_nofail(dev); if (ctl_addr) { sysbus_mmio_map(d, 0, ctl_addr); } if (data_addr) { sysbus_mmio_map(d, 1, data_addr); } fw_cfg_add_bytes(s, FW_CFG_SIGNATURE, (char *)"QEMU", 4); fw_cfg_add_bytes(s, FW_CFG_UUID, qemu_uuid, 16); fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)(display_type == DT_NOGRAPHIC)); fw_cfg_add_i16(s, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); fw_cfg_add_i16(s, FW_CFG_BOOT_MENU, (uint16_t)boot_menu); fw_cfg_bootsplash(s); fw_cfg_reboot(s); s->machine_ready.notify = fw_cfg_machine_ready; qemu_add_machine_init_done_notifier(&s->machine_ready); return s; }
1threat
static int read_f(BlockBackend *blk, int argc, char **argv) { struct timeval t1, t2; int Cflag = 0, pflag = 0, qflag = 0, vflag = 0; int Pflag = 0, sflag = 0, lflag = 0, bflag = 0; int c, cnt; char *buf; int64_t offset; int count; int total = 0; int pattern = 0, pattern_offset = 0, pattern_count = 0; while ((c = getopt(argc, argv, "bCl:pP:qs:v")) != EOF) { switch (c) { case 'b': bflag = 1; break; case 'C': Cflag = 1; break; case 'l': lflag = 1; pattern_count = cvtnum(optarg); if (pattern_count < 0) { printf("non-numeric length argument -- %s\n", optarg); return 0; } break; case 'p': pflag = 1; break; case 'P': Pflag = 1; pattern = parse_pattern(optarg); if (pattern < 0) { return 0; } break; case 'q': qflag = 1; break; case 's': sflag = 1; pattern_offset = cvtnum(optarg); if (pattern_offset < 0) { printf("non-numeric length argument -- %s\n", optarg); return 0; } break; case 'v': vflag = 1; break; default: return qemuio_command_usage(&read_cmd); } } if (optind != argc - 2) { return qemuio_command_usage(&read_cmd); } if (bflag && pflag) { printf("-b and -p cannot be specified at the same time\n"); return 0; } offset = cvtnum(argv[optind]); if (offset < 0) { printf("non-numeric length argument -- %s\n", argv[optind]); return 0; } optind++; count = cvtnum(argv[optind]); if (count < 0) { printf("non-numeric length argument -- %s\n", argv[optind]); return 0; } if (!Pflag && (lflag || sflag)) { return qemuio_command_usage(&read_cmd); } if (!lflag) { pattern_count = count - pattern_offset; } if ((pattern_count < 0) || (pattern_count + pattern_offset > count)) { printf("pattern verification range exceeds end of read data\n"); return 0; } if (!pflag) { if (offset & 0x1ff) { printf("offset %" PRId64 " is not sector aligned\n", offset); return 0; } if (count & 0x1ff) { printf("count %d is not sector aligned\n", count); return 0; } } buf = qemu_io_alloc(blk, count, 0xab); gettimeofday(&t1, NULL); if (pflag) { cnt = do_pread(blk, buf, offset, count, &total); } else if (bflag) { cnt = do_load_vmstate(blk, buf, offset, count, &total); } else { cnt = do_read(blk, buf, offset, count, &total); } gettimeofday(&t2, NULL); if (cnt < 0) { printf("read failed: %s\n", strerror(-cnt)); goto out; } if (Pflag) { void *cmp_buf = g_malloc(pattern_count); memset(cmp_buf, pattern, pattern_count); if (memcmp(buf + pattern_offset, cmp_buf, pattern_count)) { printf("Pattern verification failed at offset %" PRId64 ", %d bytes\n", offset + pattern_offset, pattern_count); } g_free(cmp_buf); } if (qflag) { goto out; } if (vflag) { dump_buffer(buf, offset, count); } t2 = tsub(t2, t1); print_report("read", &t2, offset, count, total, cnt, Cflag); out: qemu_io_free(buf); return 0; }
1threat
how to show and hide the div on button click using jquery : <p>In my application i have a html button where i need to hide few elements which are in div on button click and show the same elements on again click the same button i am able to hide the div but how can i again show the div elements.Belo is my html and jquery code</p> <p>Html</p> <pre><code>&lt;button type="button" id="btnsearch" style="background-color: white"&gt;Search&lt;/button&gt; &lt;div id="Show"&gt;&lt;/div&gt; </code></pre> <p>JQuery</p> <pre><code>$("#btnsearch").click(function () { $("#Show").hide(); }); </code></pre>
0debug
static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane, unsigned char *ref_plane, unsigned char *decoded_plane, int width, int height, int src_stride, int stride) { int x, y; int i; int block_width, block_height; int level; int threshold[6]; const int lambda= (s->picture.quality*s->picture.quality) >> (2*FF_LAMBDA_SHIFT); threshold[5] = QUALITY_THRESHOLD; for (level = 4; level >= 0; level--) threshold[level] = threshold[level + 1] * THRESHOLD_MULTIPLIER; block_width = (width + 15) / 16; block_height = (height + 15) / 16; if(s->picture.pict_type == FF_P_TYPE){ s->m.avctx= s->avctx; s->m.current_picture_ptr= &s->m.current_picture; s->m.last_picture_ptr = &s->m.last_picture; s->m.last_picture.data[0]= ref_plane; s->m.linesize= s->m.last_picture.linesize[0]= s->m.new_picture.linesize[0]= s->m.current_picture.linesize[0]= stride; s->m.width= width; s->m.height= height; s->m.mb_width= block_width; s->m.mb_height= block_height; s->m.mb_stride= s->m.mb_width+1; s->m.b8_stride= 2*s->m.mb_width+1; s->m.f_code=1; s->m.pict_type= s->picture.pict_type; s->m.me_method= s->avctx->me_method; s->m.me.scene_change_score=0; s->m.flags= s->avctx->flags; s->m.lambda= s->picture.quality; s->m.qscale= (s->m.lambda*139 + FF_LAMBDA_SCALE*64) >> (FF_LAMBDA_SHIFT + 7); s->m.lambda2= (s->m.lambda*s->m.lambda + FF_LAMBDA_SCALE/2) >> FF_LAMBDA_SHIFT; if(!s->motion_val8[plane]){ s->motion_val8 [plane]= av_mallocz((s->m.b8_stride*block_height*2 + 2)*2*sizeof(int16_t)); s->motion_val16[plane]= av_mallocz((s->m.mb_stride*(block_height + 2) + 1)*2*sizeof(int16_t)); } s->m.mb_type= s->mb_type; s->m.current_picture.mb_mean= (uint8_t *)s->dummy; s->m.current_picture.mb_var= (uint16_t*)s->dummy; s->m.current_picture.mc_mb_var= (uint16_t*)s->dummy; s->m.current_picture.mb_type= s->dummy; s->m.current_picture.motion_val[0]= s->motion_val8[plane] + 2; s->m.p_mv_table= s->motion_val16[plane] + s->m.mb_stride + 1; s->m.dsp= s->dsp; ff_init_me(&s->m); s->m.me.dia_size= s->avctx->dia_size; s->m.first_slice_line=1; for (y = 0; y < block_height; y++) { uint8_t src[stride*16]; s->m.new_picture.data[0]= src - y*16*stride; s->m.mb_y= y; for(i=0; i<16 && i + 16*y<height; i++){ memcpy(&src[i*stride], &src_plane[(i+16*y)*src_stride], width); for(x=width; x<16*block_width; x++) src[i*stride+x]= src[i*stride+x-1]; } for(; i<16 && i + 16*y<16*block_height; i++) memcpy(&src[i*stride], &src[(i-1)*stride], 16*block_width); for (x = 0; x < block_width; x++) { s->m.mb_x= x; ff_init_block_index(&s->m); ff_update_block_index(&s->m); ff_estimate_p_frame_motion(&s->m, x, y); } s->m.first_slice_line=0; } ff_fix_long_p_mvs(&s->m); ff_fix_long_mvs(&s->m, NULL, 0, s->m.p_mv_table, s->m.f_code, CANDIDATE_MB_TYPE_INTER, 0); } s->m.first_slice_line=1; for (y = 0; y < block_height; y++) { uint8_t src[stride*16]; for(i=0; i<16 && i + 16*y<height; i++){ memcpy(&src[i*stride], &src_plane[(i+16*y)*src_stride], width); for(x=width; x<16*block_width; x++) src[i*stride+x]= src[i*stride+x-1]; } for(; i<16 && i + 16*y<16*block_height; i++) memcpy(&src[i*stride], &src[(i-1)*stride], 16*block_width); s->m.mb_y= y; for (x = 0; x < block_width; x++) { uint8_t reorder_buffer[3][6][7*32]; int count[3][6]; int offset = y * 16 * stride + x * 16; uint8_t *decoded= decoded_plane + offset; uint8_t *ref= ref_plane + offset; int score[4]={0,0,0,0}, best; uint8_t *temp = s->scratchbuf; if(s->pb.buf_end - s->pb.buf - (put_bits_count(&s->pb)>>3) < 3000){ av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); return -1; } s->m.mb_x= x; ff_init_block_index(&s->m); ff_update_block_index(&s->m); if(s->picture.pict_type == FF_I_TYPE || (s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTRA)){ for(i=0; i<6; i++){ init_put_bits(&s->reorder_pb[i], reorder_buffer[0][i], 7*32); } if(s->picture.pict_type == FF_P_TYPE){ const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTRA]; put_bits(&s->reorder_pb[5], vlc[1], vlc[0]); score[0]= vlc[1]*lambda; } score[0]+= encode_block(s, src+16*x, NULL, temp, stride, 5, 64, lambda, 1); for(i=0; i<6; i++){ count[0][i]= put_bits_count(&s->reorder_pb[i]); flush_put_bits(&s->reorder_pb[i]); } }else score[0]= INT_MAX; best=0; if(s->picture.pict_type == FF_P_TYPE){ const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTER]; int mx, my, pred_x, pred_y, dxy; int16_t *motion_ptr; motion_ptr= h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y); if(s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTER){ for(i=0; i<6; i++) init_put_bits(&s->reorder_pb[i], reorder_buffer[1][i], 7*32); put_bits(&s->reorder_pb[5], vlc[1], vlc[0]); s->m.pb= s->reorder_pb[5]; mx= motion_ptr[0]; my= motion_ptr[1]; assert(mx>=-32 && mx<=31); assert(my>=-32 && my<=31); assert(pred_x>=-32 && pred_x<=31); assert(pred_y>=-32 && pred_y<=31); ff_h263_encode_motion(&s->m, mx - pred_x, 1); ff_h263_encode_motion(&s->m, my - pred_y, 1); s->reorder_pb[5]= s->m.pb; score[1] += lambda*put_bits_count(&s->reorder_pb[5]); dxy= (mx&1) + 2*(my&1); s->dsp.put_pixels_tab[0][dxy](temp+16, ref + (mx>>1) + stride*(my>>1), stride, 16); score[1]+= encode_block(s, src+16*x, temp+16, decoded, stride, 5, 64, lambda, 0); best= score[1] <= score[0]; vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_SKIP]; score[2]= s->dsp.sse[0](NULL, src+16*x, ref, stride, 16); score[2]+= vlc[1]*lambda; if(score[2] < score[best] && mx==0 && my==0){ best=2; s->dsp.put_pixels_tab[0][0](decoded, ref, stride, 16); for(i=0; i<6; i++){ count[2][i]=0; } put_bits(&s->pb, vlc[1], vlc[0]); } } if(best==1){ for(i=0; i<6; i++){ count[1][i]= put_bits_count(&s->reorder_pb[i]); flush_put_bits(&s->reorder_pb[i]); } }else{ motion_ptr[0 ] = motion_ptr[1 ]= motion_ptr[2 ] = motion_ptr[3 ]= motion_ptr[0+2*s->m.b8_stride] = motion_ptr[1+2*s->m.b8_stride]= motion_ptr[2+2*s->m.b8_stride] = motion_ptr[3+2*s->m.b8_stride]=0; } } s->rd_total += score[best]; for(i=5; i>=0; i--){ ff_copy_bits(&s->pb, reorder_buffer[best][i], count[best][i]); } if(best==0){ s->dsp.put_pixels_tab[0][0](decoded, temp, stride, 16); } } s->m.first_slice_line=0; } return 0; }
1threat
static int tak_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt) { TAKDecContext *s = avctx->priv_data; AVFrame *frame = data; ThreadFrame tframe = { .f = data }; GetBitContext *gb = &s->gb; int chan, i, ret, hsize; if (pkt->size < TAK_MIN_FRAME_HEADER_BYTES) return AVERROR_INVALIDDATA; if ((ret = init_get_bits8(gb, pkt->data, pkt->size)) < 0) return ret; if ((ret = ff_tak_decode_frame_header(avctx, gb, &s->ti, 0)) < 0) return ret; hsize = get_bits_count(gb) / 8; if (avctx->err_recognition & (AV_EF_CRCCHECK|AV_EF_COMPLIANT)) { if (ff_tak_check_crc(pkt->data, hsize)) { av_log(avctx, AV_LOG_ERROR, "CRC error\n"); if (avctx->err_recognition & AV_EF_EXPLODE) return AVERROR_INVALIDDATA; } } if (s->ti.codec != TAK_CODEC_MONO_STEREO && s->ti.codec != TAK_CODEC_MULTICHANNEL) { avpriv_report_missing_feature(avctx, "TAK codec type %d", s->ti.codec); return AVERROR_PATCHWELCOME; } if (s->ti.data_type) { av_log(avctx, AV_LOG_ERROR, "unsupported data type: %d\n", s->ti.data_type); return AVERROR_INVALIDDATA; } if (s->ti.codec == TAK_CODEC_MONO_STEREO && s->ti.channels > 2) { av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n", s->ti.channels); return AVERROR_INVALIDDATA; } if (s->ti.channels > 6) { av_log(avctx, AV_LOG_ERROR, "unsupported number of channels: %d\n", s->ti.channels); return AVERROR_INVALIDDATA; } if (s->ti.frame_samples <= 0) { av_log(avctx, AV_LOG_ERROR, "unsupported/invalid number of samples\n"); return AVERROR_INVALIDDATA; } avctx->bits_per_raw_sample = s->ti.bps; if ((ret = set_bps_params(avctx)) < 0) return ret; if (s->ti.sample_rate != avctx->sample_rate) { avctx->sample_rate = s->ti.sample_rate; set_sample_rate_params(avctx); } if (s->ti.ch_layout) avctx->channel_layout = s->ti.ch_layout; avctx->channels = s->ti.channels; s->nb_samples = s->ti.last_frame_samples ? s->ti.last_frame_samples : s->ti.frame_samples; frame->nb_samples = s->nb_samples; if ((ret = ff_thread_get_buffer(avctx, &tframe, 0)) < 0) return ret; ff_thread_finish_setup(avctx); if (avctx->bits_per_raw_sample <= 16) { int buf_size = av_samples_get_buffer_size(NULL, avctx->channels, s->nb_samples, AV_SAMPLE_FMT_S32P, 0); if (buf_size < 0) return buf_size; av_fast_malloc(&s->decode_buffer, &s->decode_buffer_size, buf_size); if (!s->decode_buffer) return AVERROR(ENOMEM); ret = av_samples_fill_arrays((uint8_t **)s->decoded, NULL, s->decode_buffer, avctx->channels, s->nb_samples, AV_SAMPLE_FMT_S32P, 0); if (ret < 0) return ret; } else { for (chan = 0; chan < avctx->channels; chan++) s->decoded[chan] = (int32_t *)frame->extended_data[chan]; } if (s->nb_samples < 16) { for (chan = 0; chan < avctx->channels; chan++) { int32_t *decoded = s->decoded[chan]; for (i = 0; i < s->nb_samples; i++) decoded[i] = get_sbits(gb, avctx->bits_per_raw_sample); } } else { if (s->ti.codec == TAK_CODEC_MONO_STEREO) { for (chan = 0; chan < avctx->channels; chan++) if (ret = decode_channel(s, chan)) return ret; if (avctx->channels == 2) { s->nb_subframes = get_bits(gb, 1) + 1; if (s->nb_subframes > 1) { s->subframe_len[1] = get_bits(gb, 6); } s->dmode = get_bits(gb, 3); if (ret = decorrelate(s, 0, 1, s->nb_samples - 1)) return ret; } } else if (s->ti.codec == TAK_CODEC_MULTICHANNEL) { if (get_bits1(gb)) { int ch_mask = 0; chan = get_bits(gb, 4) + 1; if (chan > avctx->channels) return AVERROR_INVALIDDATA; for (i = 0; i < chan; i++) { int nbit = get_bits(gb, 4); if (nbit >= avctx->channels) return AVERROR_INVALIDDATA; if (ch_mask & 1 << nbit) return AVERROR_INVALIDDATA; s->mcdparams[i].present = get_bits1(gb); if (s->mcdparams[i].present) { s->mcdparams[i].index = get_bits(gb, 2); s->mcdparams[i].chan2 = get_bits(gb, 4); if (s->mcdparams[i].chan2 >= avctx->channels) { av_log(avctx, AV_LOG_ERROR, "invalid channel 2 (%d) for %d channel(s)\n", s->mcdparams[i].chan2, avctx->channels); return AVERROR_INVALIDDATA; } if (s->mcdparams[i].index == 1) { if ((nbit == s->mcdparams[i].chan2) || (ch_mask & 1 << s->mcdparams[i].chan2)) return AVERROR_INVALIDDATA; ch_mask |= 1 << s->mcdparams[i].chan2; } else if (!(ch_mask & 1 << s->mcdparams[i].chan2)) { return AVERROR_INVALIDDATA; } } s->mcdparams[i].chan1 = nbit; ch_mask |= 1 << nbit; } } else { chan = avctx->channels; for (i = 0; i < chan; i++) { s->mcdparams[i].present = 0; s->mcdparams[i].chan1 = i; } } for (i = 0; i < chan; i++) { if (s->mcdparams[i].present && s->mcdparams[i].index == 1) if (ret = decode_channel(s, s->mcdparams[i].chan2)) return ret; if (ret = decode_channel(s, s->mcdparams[i].chan1)) return ret; if (s->mcdparams[i].present) { s->dmode = mc_dmodes[s->mcdparams[i].index]; if (ret = decorrelate(s, s->mcdparams[i].chan2, s->mcdparams[i].chan1, s->nb_samples - 1)) return ret; } } } for (chan = 0; chan < avctx->channels; chan++) { int32_t *decoded = s->decoded[chan]; if (s->lpc_mode[chan]) decode_lpc(decoded, s->lpc_mode[chan], s->nb_samples); if (s->sample_shift[chan] > 0) for (i = 0; i < s->nb_samples; i++) decoded[i] *= 1 << s->sample_shift[chan]; } } align_get_bits(gb); skip_bits(gb, 24); if (get_bits_left(gb) < 0) av_log(avctx, AV_LOG_DEBUG, "overread\n"); else if (get_bits_left(gb) > 0) av_log(avctx, AV_LOG_DEBUG, "underread\n"); if (avctx->err_recognition & (AV_EF_CRCCHECK | AV_EF_COMPLIANT)) { if (ff_tak_check_crc(pkt->data + hsize, get_bits_count(gb) / 8 - hsize)) { av_log(avctx, AV_LOG_ERROR, "CRC error\n"); if (avctx->err_recognition & AV_EF_EXPLODE) return AVERROR_INVALIDDATA; } } switch (avctx->sample_fmt) { case AV_SAMPLE_FMT_U8P: for (chan = 0; chan < avctx->channels; chan++) { uint8_t *samples = (uint8_t *)frame->extended_data[chan]; int32_t *decoded = s->decoded[chan]; for (i = 0; i < s->nb_samples; i++) samples[i] = decoded[i] + 0x80; } break; case AV_SAMPLE_FMT_S16P: for (chan = 0; chan < avctx->channels; chan++) { int16_t *samples = (int16_t *)frame->extended_data[chan]; int32_t *decoded = s->decoded[chan]; for (i = 0; i < s->nb_samples; i++) samples[i] = decoded[i]; } break; case AV_SAMPLE_FMT_S32P: for (chan = 0; chan < avctx->channels; chan++) { int32_t *samples = (int32_t *)frame->extended_data[chan]; for (i = 0; i < s->nb_samples; i++) samples[i] *= 1 << 8; } break; } *got_frame_ptr = 1; return pkt->size; }
1threat
Using purrr::pmap within mutate to create list-column : <p>I understand how to use map to iterate over arguments in a df and create a new list column.</p> <p>For example, </p> <pre><code>params &lt;- expand.grid(param_a = c(2, 4, 6) ,param_b = c(3, 6, 9) ,param_c = c(50, 100) ,param_d = c(1, 0) ) df.preprocessed &lt;- dplyr::as.tbl(params) %&gt;% dplyr::mutate(test_var = purrr::map(param_a, function(x){ rep(5, x) } )) </code></pre> <p>However, how do I use the analogous syntax with pmap in the event that I want to specify more than 2 parameters?</p> <pre><code>df.preprocessed &lt;- dplyr::as.tbl(params) %&gt;% dplyr::mutate(test_var = purrr::pmap(list(x = param_a ,y = param_b ,z = param_c ,u = param_d), function(x, y){ rep(5,x)*y } ) ) </code></pre> <p>Error output:</p> <blockquote> <p>Error in mutate_impl(.data, dots) : Evaluation error: unused arguments (z = .l[[c(3, i)]], u = .l[[c(4, i)]]).</p> </blockquote>
0debug
document.write('<script src="evil.js"></script>');
1threat
QString *qobject_to_qstring(const QObject *obj) { if (qobject_type(obj) != QTYPE_QSTRING) return NULL; return container_of(obj, QString, base); }
1threat
static void rate_start (SpiceRateCtl *rate) { memset (rate, 0, sizeof (*rate)); rate->start_ticks = qemu_get_clock (vm_clock); }
1threat
static void vfio_msi_interrupt(void *opaque) { VFIOMSIVector *vector = opaque; VFIODevice *vdev = vector->vdev; int nr = vector - vdev->msi_vectors; if (!event_notifier_test_and_clear(&vector->interrupt)) { return; } DPRINTF("%s(%04x:%02x:%02x.%x) vector %d\n", __func__, vdev->host.domain, vdev->host.bus, vdev->host.slot, vdev->host.function, nr); if (vdev->interrupt == VFIO_INT_MSIX) { msix_notify(&vdev->pdev, nr); } else if (vdev->interrupt == VFIO_INT_MSI) { msi_notify(&vdev->pdev, nr); } else { error_report("vfio: MSI interrupt receieved, but not enabled?"); } }
1threat
How to use graphql : How to use graphql. How to intercept and sent http request. How philippeharewood find bugs by graphql on Facebook, What tools are available for pentesting graphql. How can sent json requests for testing graphql.
0debug
static AddrRange addrrange_make(uint64_t start, uint64_t size) { return (AddrRange) { start, size }; }
1threat
How to save a line of user inputted integers into an array? : <p>How would I be able to take a group of numbers inputted on a single line by the user (however many they want) and put them in to an array? </p>
0debug
static void mov_build_index(MOVContext *mov, AVStream *st) { MOVStreamContext *sc = st->priv_data; int64_t current_offset; int64_t current_dts = 0; unsigned int stts_index = 0; unsigned int stsc_index = 0; unsigned int stss_index = 0; unsigned int stps_index = 0; unsigned int i, j; uint64_t stream_size = 0; if (sc->time_offset && mov->time_scale > 0) { if (sc->time_offset < 0) sc->time_offset = av_rescale(sc->time_offset, sc->time_scale, mov->time_scale); current_dts = -sc->time_offset; if (sc->ctts_data && sc->stts_data && sc->ctts_data[0].duration / sc->stts_data[0].duration > 16) { sc->wrong_dts = 1; st->codec->has_b_frames = 1; } } if (!(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && sc->stts_count == 1 && sc->stts_data[0].duration == 1)) { unsigned int current_sample = 0; unsigned int stts_sample = 0; unsigned int sample_size; unsigned int distance = 0; int key_off = sc->keyframes && sc->keyframes[0] == 1; current_dts -= sc->dts_shift; if (sc->sample_count >= UINT_MAX / sizeof(*st->index_entries)) return; st->index_entries = av_malloc(sc->sample_count*sizeof(*st->index_entries)); if (!st->index_entries) return; st->index_entries_allocated_size = sc->sample_count*sizeof(*st->index_entries); for (i = 0; i < sc->chunk_count; i++) { current_offset = sc->chunk_offsets[i]; while (stsc_index + 1 < sc->stsc_count && i + 1 == sc->stsc_data[stsc_index + 1].first) stsc_index++; for (j = 0; j < sc->stsc_data[stsc_index].count; j++) { int keyframe = 0; if (current_sample >= sc->sample_count) { av_log(mov->fc, AV_LOG_ERROR, "wrong sample count\n"); return; } if (!sc->keyframe_count || current_sample+key_off == sc->keyframes[stss_index]) { keyframe = 1; if (stss_index + 1 < sc->keyframe_count) stss_index++; } else if (sc->stps_count && current_sample+key_off == sc->stps_data[stps_index]) { keyframe = 1; if (stps_index + 1 < sc->stps_count) stps_index++; } if (keyframe) distance = 0; sample_size = sc->sample_size > 0 ? sc->sample_size : sc->sample_sizes[current_sample]; if (sc->pseudo_stream_id == -1 || sc->stsc_data[stsc_index].id - 1 == sc->pseudo_stream_id) { AVIndexEntry *e = &st->index_entries[st->nb_index_entries++]; e->pos = current_offset; e->timestamp = current_dts; e->size = sample_size; e->min_distance = distance; e->flags = keyframe ? AVINDEX_KEYFRAME : 0; av_dlog(mov->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", " "size %d, distance %d, keyframe %d\n", st->index, current_sample, current_offset, current_dts, sample_size, distance, keyframe); } current_offset += sample_size; stream_size += sample_size; current_dts += sc->stts_data[stts_index].duration; distance++; stts_sample++; current_sample++; if (stts_index + 1 < sc->stts_count && stts_sample == sc->stts_data[stts_index].count) { stts_sample = 0; stts_index++; } } } if (st->duration > 0) st->codec->bit_rate = stream_size*8*sc->time_scale/st->duration; } else { unsigned chunk_samples, total = 0; for (i = 0; i < sc->stsc_count; i++) { unsigned count, chunk_count; chunk_samples = sc->stsc_data[i].count; if (sc->samples_per_frame && chunk_samples % sc->samples_per_frame) { av_log(mov->fc, AV_LOG_ERROR, "error unaligned chunk\n"); return; } if (sc->samples_per_frame >= 160) { count = chunk_samples / sc->samples_per_frame; } else if (sc->samples_per_frame > 1) { unsigned samples = (1024/sc->samples_per_frame)*sc->samples_per_frame; count = (chunk_samples+samples-1) / samples; } else { count = (chunk_samples+1023) / 1024; } if (i < sc->stsc_count - 1) chunk_count = sc->stsc_data[i+1].first - sc->stsc_data[i].first; else chunk_count = sc->chunk_count - (sc->stsc_data[i].first - 1); total += chunk_count * count; } av_dlog(mov->fc, "chunk count %d\n", total); if (total >= UINT_MAX / sizeof(*st->index_entries)) return; st->index_entries = av_malloc(total*sizeof(*st->index_entries)); if (!st->index_entries) return; st->index_entries_allocated_size = total*sizeof(*st->index_entries); for (i = 0; i < sc->chunk_count; i++) { current_offset = sc->chunk_offsets[i]; if (stsc_index + 1 < sc->stsc_count && i + 1 == sc->stsc_data[stsc_index + 1].first) stsc_index++; chunk_samples = sc->stsc_data[stsc_index].count; while (chunk_samples > 0) { AVIndexEntry *e; unsigned size, samples; if (sc->samples_per_frame >= 160) { samples = sc->samples_per_frame; size = sc->bytes_per_frame; } else { if (sc->samples_per_frame > 1) { samples = FFMIN((1024 / sc->samples_per_frame)* sc->samples_per_frame, chunk_samples); size = (samples / sc->samples_per_frame) * sc->bytes_per_frame; } else { samples = FFMIN(1024, chunk_samples); size = samples * sc->sample_size; } } if (st->nb_index_entries >= total) { av_log(mov->fc, AV_LOG_ERROR, "wrong chunk count %d\n", total); return; } e = &st->index_entries[st->nb_index_entries++]; e->pos = current_offset; e->timestamp = current_dts; e->size = size; e->min_distance = 0; e->flags = AVINDEX_KEYFRAME; av_dlog(mov->fc, "AVIndex stream %d, chunk %d, offset %"PRIx64", dts %"PRId64", " "size %d, duration %d\n", st->index, i, current_offset, current_dts, size, samples); current_offset += size; current_dts += samples; chunk_samples -= samples; } } } }
1threat
How to check nvidia-docker version? : <p>I have tried <code>nvidia-docker --version</code>, but it seems just showing docker's version.<br> After some investigation of official documents, I could not find any information about this.</p> <p>How to check <code>nvidia-docker</code> 's version?</p>
0debug
C++ gives strange error during structure initialization with an array inside : <p>I try to compile very simple code:</p> <pre><code>struct T { int a[3]; int b; int c; }; int main() { const int as[3] = { 5, 6, 7, }; const T t { as, 2, 3, }; return 0; } </code></pre> <p>But it gives me very strange errors:</p> <pre><code>t.cpp: In function 'int main()': t.cpp:11:5: error: array must be initialized with a brace-enclosed initializer }; ^ </code></pre> <p>As from what I understand the compiler wants me to initialize everything in one single place. How do I initialize fields separately and then use them during initiliazation the structure later?</p>
0debug
infinite loop c++ with while and vector of pairs : <p>this program gives infinit loop when i try the input 1 3 7 1 2 2 3 3 1 i run it manually and it seemed to me that it works , i can't understand why the while gives infinite loop (at least in this case of input)</p> <pre><code> #include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;algorithm&gt; using namespace std; int main() { unsigned long long T,N , M ,p , m ; vector &lt;pair&lt;unsigned long long, unsigned long long &gt; &gt; v; cin&gt;&gt;T ; for (unsigned long long i=0 ; i&lt;T;i++) { v={}; cin&gt;&gt;N&gt;&gt;M ; for (unsigned long long j=0 ; j&lt; N ; j++) { cin&gt;&gt;p&gt;&gt;m ; v.push_back({p,m}); } sort(v.begin(),v.end()); while (M&gt;=v[0].second) { while (v[0].first&lt;=v[1].first) { v[0].first+=1 ; M-=v[0].second; } sort(v.begin(),v.end()); } } cout&lt;&lt;"ans"&lt;&lt;v[0].first ; } </code></pre> <p>can you please tell me what's wrong ??</p>
0debug
What are the advantages of @ControllerAdvice over @ExceptionHandler or HandlerExceptionResolver for handling exceptions? : <p><strong>Spring 3.2</strong> introduced <code>@ControllerAdvice</code> annotation for handling exceptions in a Spring MVC application. But prior to this version Spring had <code>@ExceptionHandler</code> or <code>HandlerExceptionResolver</code> to handling exceptions in a Spring MVC application. Then why <strong>Spring 3.2</strong> introduced <code>@ControllerAdvice</code> annotation for handling exceptions? I strongly believe that <strong>Spring 3.2</strong> introduced <code>@ControllerAdvice</code> annotation <strong><em>to address the limitations of</em></strong> <code>@ExceptionHandler</code> or <code>HandlerExceptionResolver</code> or make the <strong><em>exceptions handling more stronger</em></strong>.</p> <p>Can any one explain the advantages of <code>@ControllerAdvice</code> over <code>@ExceptionHandler</code> or <code>HandlerExceptionResolver</code> for handling exceptions?</p>
0debug
c# Transfer multiple records in list in class : I want to pass class to front angular app from backend c# for that I made special class where I pass some params. PLease take a look at the last one. There is seperate table in DB which stores pics. And I want to pass list of pictures with other data. for that in transfer class I tried to declare list of piclass. > public List<PicsClass> PicsClass{ get; set; } This gave me error and after some googling I've found this > public List<Type> PicsClass{ get; set; } So here are my transfer and pic classes. public class TransferClass { public int TransferClassID { get; set; } public string param1{ get; set; } public int param2{ get; set; } public List<Type> PicsClass{ get; set; } } public class PicsClass { public int PicsClassID{ get; set; } public int param1ID { get; set; } public int param2ID{ get; set; } } Now in controller I query DB for pics and put them into list of TransferClass object List<PicsClass> Images = _context.PicsClasses.Where(u => u.param2ID== param2ID).ToList(); TransferClass.Images = Images; And get error > Cannot implicitly convert type > system.coolection.......Entities.PicsClass to > system.coolections.generic.list<system.type> How can I fix this ?
0debug
cac_new_pki_applet(int i, const unsigned char *cert, int cert_len, VCardKey *key) { VCardAppletPrivate *applet_private = NULL; VCardApplet *applet = NULL; unsigned char pki_aid[] = { 0xa0, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00 }; int pki_aid_len = sizeof(pki_aid); pki_aid[pki_aid_len-1] = i; applet_private = cac_new_pki_applet_private(cert, cert_len, key); if (applet_private == NULL) { goto failure; } applet = vcard_new_applet(cac_applet_pki_process_apdu, cac_applet_pki_reset, pki_aid, pki_aid_len); if (applet == NULL) { goto failure; } vcard_set_applet_private(applet, applet_private, cac_delete_pki_applet_private); applet_private = NULL; return applet; failure: if (applet_private != NULL) { cac_delete_pki_applet_private(applet_private); } return NULL; }
1threat
Only allowing one keypress : <p>How can I make sure the user only gets one key press and disable them from holding the key so value will not grow? The user can press the key down again, but cant not hold it down.thx</p>
0debug
Docker internals/architecture : <p>I've started using Docker but I want to understand it better ( a bit better). So, I am searching for a book/article to get information how it works internally ( on the OS level). I suppose that it cannot be easy subject but it should be easier than real virtualization. </p> <p>I am asking for referencing me to any book/an article. I tried to find any book but I didn't find something about Docker internals.</p>
0debug
I have made simple Android Calculator in Android Studio And Faced Some issue Explained in Body : MainActivity import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends AppCompatActivity { Button b1,b2,b3,b4,b5,b6,b7,b8,b9,b0,badd,bsub,bmul,bdiv,bdot,bans,bclear,b_bs; TextView ans; String a; int lenght; double var1,var2; boolean add,sub,mul,div; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); b1=(Button)findViewById(R.id.btn1); b2=(Button)findViewById(R.id.btn_2); b3=(Button)findViewById(R.id.btn_3); b4=(Button)findViewById(R.id.btn4); b5=(Button)findViewById(R.id.btn_5); b6=(Button)findViewById(R.id.btn_6); b7=(Button)findViewById(R.id.btn_7); b8=(Button)findViewById(R.id.btn_8); b9=(Button)findViewById(R.id.btn_9); b0=(Button)findViewById(R.id.btn_0); badd=(Button)findViewById(R.id.btn_Add); bsub=(Button)findViewById(R.id.btn_Sub); bmul=(Button)findViewById(R.id.btn_Multiply); bdiv=(Button)findViewById(R.id.btn_div); bdot=(Button)findViewById(R.id.btn_dot); bans=(Button)findViewById(R.id.btn_equal); bclear=(Button)findViewById(R.id.btn_Clear); ans=(TextView)findViewById(R.id.Answer); b_bs=(Button) findViewById(R.id.btn_bs); b1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(""); ans.setText(ans.getText().toString()+"1"); } }); b2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(ans.getText()+ "2"); } }); b3.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(ans.getText()+ "3"); } }); b4.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(ans.getText()+ "4"); } }); b5.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(ans.getText()+ "5"); } }); b6.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(ans.getText()+ "6"); } }); b7.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(ans.getText()+ "7"); } }); b8.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(ans.getText()+ "8"); } }); b9.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(ans.getText()+ "9"); } }); b0.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(ans.getText()+ "0"); } }); bdot.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText(ans.getText()+ ".");//this is the place where i need help } }); b_bs.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String str=ans.getText().toString(); if (str.length() >1 ) { str = str.substring(0, str.length() - 1); ans.setText(str); } else if (str.length() <=1 ) { ans.setText("0"); } } }); badd.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { var1=Double.parseDouble(ans.getText()+""); add=true; ans.setText(null); } }); bsub.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { var1=Double.parseDouble(ans.getText()+""); sub=true; ans.setText(null); } }); bmul.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { var1=Double.parseDouble(ans.getText()+""); mul=true; ans.setText(null); } }); bdiv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { var1=Double.parseDouble(ans.getText()+""); div=true; ans.setText(null); } }); bans.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { var2=Double.parseDouble(ans.getText()+""); if(add==true){ ans.setText(var1+var2+""); add=false; } if(sub==true){ ans.setText(var1-var2+""); sub=false; } if(mul==true){ ans.setText(var1*var2+""); mul=false; } if(div==true){ ans.setText(var1/var2+""); div=false; } } }); bclear.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { ans.setText("0"); // a=ans.length(); } }); } } I have made simple Android Calculator Now I have Some Problems Kindly Solved these 1. My dot Button Pressed More Than One Time durring First input number and its show like 4....5...... i want that its not pressed or show more than 1 time in first time and after i select the operation of addition subtraction not its will be enable for me ? 2. I want to set a default Value of Calculator 0 And When i press Any button zero will be override ....? - List item
0debug
int kvm_arch_add_msi_route_post(struct kvm_irq_routing_entry *route, int vector, PCIDevice *dev) { static bool notify_list_inited = false; MSIRouteEntry *entry; if (!dev) { return 0; entry = g_new0(MSIRouteEntry, 1); entry->dev = dev; entry->vector = vector; entry->virq = route->gsi; QLIST_INSERT_HEAD(&msi_route_list, entry, list); trace_kvm_x86_add_msi_route(route->gsi); return 0;
1threat
static uint32_t regtype_to_ss(uint8_t type) { if (type & PCI_BASE_ADDRESS_MEM_TYPE_64) { return 3; } if (type == PCI_BASE_ADDRESS_SPACE_IO) { return 1; } return 2; }
1threat
static void apic_mem_writew(void *opaque, target_phys_addr_t addr, uint32_t val) { }
1threat
static void vc1_decode_i_blocks_adv(VC1Context *v) { int k; MpegEncContext *s = &v->s; int cbp, val; uint8_t *coded_val; int mb_pos; int mquant = v->pq; int mqdiff; GetBitContext *gb = &s->gb; switch(v->y_ac_table_index){ case 0: v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA; break; case 1: v->codingset = CS_HIGH_MOT_INTRA; break; case 2: v->codingset = CS_MID_RATE_INTRA; break; } switch(v->c_ac_table_index){ case 0: v->codingset2 = (v->pqindex <= 8) ? CS_HIGH_RATE_INTER : CS_LOW_MOT_INTER; break; case 1: v->codingset2 = CS_HIGH_MOT_INTER; break; case 2: v->codingset2 = CS_MID_RATE_INTER; break; } s->mb_x = s->mb_y = 0; s->mb_intra = 1; s->first_slice_line = 1; s->mb_y = s->start_mb_y; if (s->start_mb_y) { s->mb_x = 0; ff_init_block_index(s); memset(&s->coded_block[s->block_index[0]-s->b8_stride], 0, s->b8_stride * sizeof(*s->coded_block)); } for(; s->mb_y < s->end_mb_y; s->mb_y++) { s->mb_x = 0; ff_init_block_index(s); for(;s->mb_x < s->mb_width; s->mb_x++) { DCTELEM (*block)[64] = v->block[v->cur_blk_idx]; ff_update_block_index(s); s->dsp.clear_blocks(block[0]); mb_pos = s->mb_x + s->mb_y * s->mb_stride; s->current_picture.f.mb_type[mb_pos] = MB_TYPE_INTRA; s->current_picture.f.motion_val[1][s->block_index[0]][0] = 0; s->current_picture.f.motion_val[1][s->block_index[0]][1] = 0; cbp = get_vlc2(&v->s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2); if(v->acpred_is_raw) v->s.ac_pred = get_bits1(&v->s.gb); else v->s.ac_pred = v->acpred_plane[mb_pos]; if (v->condover == CONDOVER_SELECT && v->overflg_is_raw) v->over_flags_plane[mb_pos] = get_bits1(&v->s.gb); GET_MQUANT(); s->current_picture.f.qscale_table[mb_pos] = mquant; s->y_dc_scale = s->y_dc_scale_table[mquant]; s->c_dc_scale = s->c_dc_scale_table[mquant]; for(k = 0; k < 6; k++) { val = ((cbp >> (5 - k)) & 1); if (k < 4) { int pred = vc1_coded_block_pred(&v->s, k, &coded_val); val = val ^ pred; *coded_val = val; } cbp |= val << (5 - k); v->a_avail = !s->first_slice_line || (k==2 || k==3); v->c_avail = !!s->mb_x || (k==1 || k==3); vc1_decode_i_block_adv(v, block[k], k, val, (k<4)? v->codingset : v->codingset2, mquant); if (k > 3 && (s->flags & CODEC_FLAG_GRAY)) continue; v->vc1dsp.vc1_inv_trans_8x8(block[k]); } vc1_smooth_overlap_filter_iblk(v); vc1_put_signed_blocks_clamped(v); if(v->s.loop_filter) vc1_loop_filter_iblk_delayed(v, v->pq); if(get_bits_count(&s->gb) > v->bits) { ff_er_add_slice(s, 0, s->start_mb_y, s->mb_x, s->mb_y, (AC_END|DC_END|MV_END)); av_log(s->avctx, AV_LOG_ERROR, "Bits overconsumption: %i > %i\n", get_bits_count(&s->gb), v->bits); return; } } if (!v->s.loop_filter) ff_draw_horiz_band(s, s->mb_y * 16, 16); else if (s->mb_y) ff_draw_horiz_band(s, (s->mb_y-1) * 16, 16); s->first_slice_line = 0; } s->mb_x = 0; ff_init_block_index(s); for(;s->mb_x < s->mb_width; s->mb_x++) { ff_update_block_index(s); vc1_put_signed_blocks_clamped(v); if(v->s.loop_filter) vc1_loop_filter_iblk_delayed(v, v->pq); } if (v->s.loop_filter) ff_draw_horiz_band(s, (s->mb_height-1)*16, 16); ff_er_add_slice(s, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, (AC_END|DC_END|MV_END)); }
1threat
connection.query('SELECT * FROM users WHERE username = ' + input_string)
1threat
Angular life-cycle hooks : <p>i draw a sketch that represent the flow of the component life-cycle </p> <blockquote> <p>using <a href="http://sketch.io" rel="noreferrer">sketch.io</a></p> </blockquote> <p>after finishing <a href="http://angular.io" rel="noreferrer" >the docs</a> about life-cycle hooks<br> i came up with this sketch. now is this is the right order of the life-cycle hooks in a component?<a href="https://i.stack.imgur.com/yzaYJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/yzaYJ.png" alt="enter image description here"></a></p>
0debug
static int qemu_rbd_open(BlockDriverState *bs, const char *filename, int flags) { BDRVRBDState *s = bs->opaque; char pool[RBD_MAX_POOL_NAME_SIZE]; char snap_buf[RBD_MAX_SNAP_NAME_SIZE]; char conf[RBD_MAX_CONF_SIZE]; char clientname_buf[RBD_MAX_CONF_SIZE]; char *clientname; int r; if (qemu_rbd_parsename(filename, pool, sizeof(pool), snap_buf, sizeof(snap_buf), s->name, sizeof(s->name), conf, sizeof(conf)) < 0) { return -EINVAL; } s->snap = NULL; if (snap_buf[0] != '\0') { s->snap = g_strdup(snap_buf); } clientname = qemu_rbd_parse_clientname(conf, clientname_buf); r = rados_create(&s->cluster, clientname); if (r < 0) { error_report("error initializing"); return r; } if (strstr(conf, "conf=") == NULL) { r = rados_conf_read_file(s->cluster, NULL); if (r < 0) { error_report("error reading config file"); rados_shutdown(s->cluster); return r; } } if (conf[0] != '\0') { r = qemu_rbd_set_conf(s->cluster, conf); if (r < 0) { error_report("error setting config options"); rados_shutdown(s->cluster); return r; } } r = rados_connect(s->cluster); if (r < 0) { error_report("error connecting"); rados_shutdown(s->cluster); return r; } r = rados_ioctx_create(s->cluster, pool, &s->io_ctx); if (r < 0) { error_report("error opening pool %s", pool); rados_shutdown(s->cluster); return r; } r = rbd_open(s->io_ctx, s->name, &s->image, s->snap); if (r < 0) { error_report("error reading header from %s", s->name); rados_ioctx_destroy(s->io_ctx); rados_shutdown(s->cluster); return r; } bs->read_only = (s->snap != NULL); s->event_reader_pos = 0; r = qemu_pipe(s->fds); if (r < 0) { error_report("error opening eventfd"); goto failed; } fcntl(s->fds[0], F_SETFL, O_NONBLOCK); fcntl(s->fds[1], F_SETFL, O_NONBLOCK); qemu_aio_set_fd_handler(s->fds[RBD_FD_READ], qemu_rbd_aio_event_reader, NULL, qemu_rbd_aio_flush_cb, NULL, s); return 0; failed: rbd_close(s->image); rados_ioctx_destroy(s->io_ctx); rados_shutdown(s->cluster); return r; }
1threat
php- parse error, expecting `"function (T_FUNCTION)"' : <p>I'm getting this error and when I'm looking the ide its says </p> <blockquote> <p>Unexpected: error silence</p> </blockquote> <p>This is my code. </p> <p>I'm just trying to make classmap.</p> <pre><code>class GetEntityLocation { /** * @var integer */ @protected $Region_ID; /** * @var integer */ @protected $Match_ID; /** * GetEntityLocation constructor. * @param integer $Region_ID * @param integer $Match_ID */ public function __construct($Region_ID, $Match_ID) { $this-&gt;Region_ID = $Region_ID; $this-&gt;Match_ID = $Match_ID; } /** * @return integer */ public function getRegionID() { return $this-&gt;Region_ID; } } </code></pre>
0debug
python linear regression predict by date : <p>I want to predict a value at a date in the future with simple linear regression, but I can't due to the date format. </p> <p>This is the dataframe I have: </p> <pre><code>data_df = date value 2016-01-15 1555 2016-01-16 1678 2016-01-17 1789 ... y = np.asarray(data_df['value']) X = data_df[['date']] X_train, X_test, y_train, y_test = train_test_split (X,y,train_size=.7,random_state=42) model = LinearRegression() #create linear regression object model.fit(X_train, y_train) #train model on train data model.score(X_train, y_train) #check score print (‘Coefficient: \n’, model.coef_) print (‘Intercept: \n’, model.intercept_) coefs = zip(model.coef_, X.columns) model.__dict__ print "sl = %.1f + " % model.intercept_ + \ " + ".join("%.1f %s" % coef for coef in coefs) #linear model </code></pre> <p>I tried to convert the date unsuccessfully</p> <pre><code>data_df['conv_date'] = data_df.date.apply(lambda x: x.toordinal()) data_df['conv_date'] = pd.to_datetime(data_df.date, format="%Y-%M-%D") </code></pre>
0debug
static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos, int *outFilterSize, int xInc, int srcW, int dstW, int filterAlign, int one, int flags, int cpu_flags, SwsVector *srcFilter, SwsVector *dstFilter, double param[2], int srcPos, int dstPos) { int i; int filterSize; int filter2Size; int minFilterSize; int64_t *filter = NULL; int64_t *filter2 = NULL; const int64_t fone = 1LL << (54 - FFMIN(av_log2(srcW/dstW), 8)); int ret = -1; emms_c(); FF_ALLOC_ARRAY_OR_GOTO(NULL, *filterPos, (dstW + 3), sizeof(**filterPos), fail); if (FFABS(xInc - 0x10000) < 10 && srcPos == dstPos) { int i; filterSize = 1; FF_ALLOCZ_ARRAY_OR_GOTO(NULL, filter, dstW, sizeof(*filter) * filterSize, fail); for (i = 0; i < dstW; i++) { filter[i * filterSize] = fone; (*filterPos)[i] = i; } } else if (flags & SWS_POINT) { int i; int64_t xDstInSrc; filterSize = 1; FF_ALLOC_ARRAY_OR_GOTO(NULL, filter, dstW, sizeof(*filter) * filterSize, fail); xDstInSrc = ((dstPos*(int64_t)xInc)>>8) - ((srcPos*0x8000LL)>>7); for (i = 0; i < dstW; i++) { int xx = (xDstInSrc - ((filterSize - 1) << 15) + (1 << 15)) >> 16; (*filterPos)[i] = xx; filter[i] = fone; xDstInSrc += xInc; } } else if ((xInc <= (1 << 16) && (flags & SWS_AREA)) || (flags & SWS_FAST_BILINEAR)) { int i; int64_t xDstInSrc; filterSize = 2; FF_ALLOC_ARRAY_OR_GOTO(NULL, filter, dstW, sizeof(*filter) * filterSize, fail); xDstInSrc = ((dstPos*(int64_t)xInc)>>8) - ((srcPos*0x8000LL)>>7); for (i = 0; i < dstW; i++) { int xx = (xDstInSrc - ((filterSize - 1) << 15) + (1 << 15)) >> 16; int j; (*filterPos)[i] = xx; / linear interpolate / area averaging for (j = 0; j < filterSize; j++) { int64_t coeff= fone - FFABS(((int64_t)xx<<16) - xDstInSrc)*(fone>>16); if (coeff < 0) coeff = 0; filter[i * filterSize + j] = coeff; xx++; } xDstInSrc += xInc; } } else { int64_t xDstInSrc; int sizeFactor = -1; for (i = 0; i < FF_ARRAY_ELEMS(scale_algorithms); i++) { if (flags & scale_algorithms[i].flag && scale_algorithms[i].size_factor > 0) { sizeFactor = scale_algorithms[i].size_factor; break; } } if (flags & SWS_LANCZOS) sizeFactor = param[0] != SWS_PARAM_DEFAULT ? ceil(2 * param[0]) : 6; av_assert0(sizeFactor > 0); if (xInc <= 1 << 16) filterSize = 1 + sizeFactor; else filterSize = 1 + (sizeFactor * srcW + dstW - 1) / dstW; filterSize = FFMIN(filterSize, srcW - 2); filterSize = FFMAX(filterSize, 1); FF_ALLOC_ARRAY_OR_GOTO(NULL, filter, dstW, sizeof(*filter) * filterSize, fail); xDstInSrc = ((dstPos*(int64_t)xInc)>>7) - ((srcPos*0x10000LL)>>7); for (i = 0; i < dstW; i++) { int xx = (xDstInSrc - ((int64_t)(filterSize - 2) << 16)) / (1 << 17); int j; (*filterPos)[i] = xx; for (j = 0; j < filterSize; j++) { int64_t d = (FFABS(((int64_t)xx << 17) - xDstInSrc)) << 13; double floatd; int64_t coeff; if (xInc > 1 << 16) d = d * dstW / srcW; floatd = d * (1.0 / (1 << 30)); if (flags & SWS_BICUBIC) { int64_t B = (param[0] != SWS_PARAM_DEFAULT ? param[0] : 0) * (1 << 24); int64_t C = (param[1] != SWS_PARAM_DEFAULT ? param[1] : 0.6) * (1 << 24); if (d >= 1LL << 31) { coeff = 0.0; } else { int64_t dd = (d * d) >> 30; int64_t ddd = (dd * d) >> 30; if (d < 1LL << 30) coeff = (12 * (1 << 24) - 9 * B - 6 * C) * ddd + (-18 * (1 << 24) + 12 * B + 6 * C) * dd + (6 * (1 << 24) - 2 * B) * (1 << 30); else coeff = (-B - 6 * C) * ddd + (6 * B + 30 * C) * dd + (-12 * B - 48 * C) * d + (8 * B + 24 * C) * (1 << 30); } coeff /= (1LL<<54)/fone; } #if 0 else if (flags & SWS_X) { double p = param ? param * 0.01 : 0.3; coeff = d ? sin(d * M_PI) / (d * M_PI) : 1.0; coeff *= pow(2.0, -p * d * d); } #endif else if (flags & SWS_X) { double A = param[0] != SWS_PARAM_DEFAULT ? param[0] : 1.0; double c; if (floatd < 1.0) c = cos(floatd * M_PI); else c = -1.0; if (c < 0.0) c = -pow(-c, A); else c = pow(c, A); coeff = (c * 0.5 + 0.5) * fone; } else if (flags & SWS_AREA) { int64_t d2 = d - (1 << 29); if (d2 * xInc < -(1LL << (29 + 16))) coeff = 1.0 * (1LL << (30 + 16)); else if (d2 * xInc < (1LL << (29 + 16))) coeff = -d2 * xInc + (1LL << (29 + 16)); else coeff = 0.0; coeff *= fone >> (30 + 16); } else if (flags & SWS_GAUSS) { double p = param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0; coeff = (pow(2.0, -p * floatd * floatd)) * fone; } else if (flags & SWS_SINC) { coeff = (d ? sin(floatd * M_PI) / (floatd * M_PI) : 1.0) * fone; } else if (flags & SWS_LANCZOS) { double p = param[0] != SWS_PARAM_DEFAULT ? param[0] : 3.0; coeff = (d ? sin(floatd * M_PI) * sin(floatd * M_PI / p) / (floatd * floatd * M_PI * M_PI / p) : 1.0) * fone; if (floatd > p) coeff = 0; } else if (flags & SWS_BILINEAR) { coeff = (1 << 30) - d; if (coeff < 0) coeff = 0; coeff *= fone >> 30; } else if (flags & SWS_SPLINE) { double p = -2.196152422706632; coeff = getSplineCoeff(1.0, 0.0, p, -p - 1.0, floatd) * fone; } else { av_assert0(0); } filter[i * filterSize + j] = coeff; xx++; } xDstInSrc += 2 * xInc; } } av_assert0(filterSize > 0); filter2Size = filterSize; if (srcFilter) filter2Size += srcFilter->length - 1; if (dstFilter) filter2Size += dstFilter->length - 1; av_assert0(filter2Size > 0); FF_ALLOCZ_ARRAY_OR_GOTO(NULL, filter2, dstW, filter2Size * sizeof(*filter2), fail); for (i = 0; i < dstW; i++) { int j, k; if (srcFilter) { for (k = 0; k < srcFilter->length; k++) { for (j = 0; j < filterSize; j++) filter2[i * filter2Size + k + j] += srcFilter->coeff[k] * filter[i * filterSize + j]; } } else { for (j = 0; j < filterSize; j++) filter2[i * filter2Size + j] = filter[i * filterSize + j]; } (*filterPos)[i] += (filterSize - 1) / 2 - (filter2Size - 1) / 2; } av_freep(&filter); minFilterSize = 0; for (i = dstW - 1; i >= 0; i--) { int min = filter2Size; int j; int64_t cutOff = 0.0; for (j = 0; j < filter2Size; j++) { int k; cutOff += FFABS(filter2[i * filter2Size]); if (cutOff > SWS_MAX_REDUCE_CUTOFF * fone) break; if (i < dstW - 1 && (*filterPos)[i] >= (*filterPos)[i + 1]) break; for (k = 1; k < filter2Size; k++) filter2[i * filter2Size + k - 1] = filter2[i * filter2Size + k]; filter2[i * filter2Size + k - 1] = 0; (*filterPos)[i]++; } cutOff = 0; for (j = filter2Size - 1; j > 0; j--) { cutOff += FFABS(filter2[i * filter2Size + j]); if (cutOff > SWS_MAX_REDUCE_CUTOFF * fone) break; min--; } if (min > minFilterSize) minFilterSize = min; } if (PPC_ALTIVEC(cpu_flags)) { if (minFilterSize < 5) filterAlign = 4; if (minFilterSize < 3) filterAlign = 1; } if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) { if (minFilterSize == 1 && filterAlign == 2) filterAlign = 1; } av_assert0(minFilterSize > 0); filterSize = (minFilterSize + (filterAlign - 1)) & (~(filterAlign - 1)); av_assert0(filterSize > 0); filter = av_malloc_array(dstW, filterSize * sizeof(*filter)); if (!filter) goto fail; if (filterSize >= MAX_FILTER_SIZE * 16 / ((flags & SWS_ACCURATE_RND) ? APCK_SIZE : 16)) { ret = RETCODE_USE_CASCADE; goto fail; } *outFilterSize = filterSize; if (flags & SWS_PRINT_INFO) av_log(NULL, AV_LOG_VERBOSE, "SwScaler: reducing / aligning filtersize %d -> %d\n", filter2Size, filterSize); for (i = 0; i < dstW; i++) { int j; for (j = 0; j < filterSize; j++) { if (j >= filter2Size) filter[i * filterSize + j] = 0; else filter[i * filterSize + j] = filter2[i * filter2Size + j]; if ((flags & SWS_BITEXACT) && j >= minFilterSize) filter[i * filterSize + j] = 0; } } for (i = 0; i < dstW; i++) { int j; if ((*filterPos)[i] < 0) { to compensate for filterPos for (j = 1; j < filterSize; j++) { int left = FFMAX(j + (*filterPos)[i], 0); filter[i * filterSize + left] += filter[i * filterSize + j]; filter[i * filterSize + j] = 0; } (*filterPos)[i]= 0; } if ((*filterPos)[i] + filterSize > srcW) { int shift = (*filterPos)[i] + FFMIN(filterSize - srcW, 0); for (j = filterSize - 2; j >= 0; j--) { int right = FFMIN(j + shift, filterSize - 1); filter[i * filterSize + right] += filter[i * filterSize + j]; filter[i * filterSize + j] = 0; } (*filterPos)[i]-= shift; } } FF_ALLOCZ_ARRAY_OR_GOTO(NULL, *outFilter, (dstW + 3), *outFilterSize * sizeof(int16_t), fail); for (i = 0; i < dstW; i++) { int j; int64_t error = 0; int64_t sum = 0; for (j = 0; j < filterSize; j++) { sum += filter[i * filterSize + j]; } sum = (sum + one / 2) / one; if (!sum) { av_log(NULL, AV_LOG_WARNING, "SwScaler: zero vector in scaling\n"); sum = 1; } for (j = 0; j < *outFilterSize; j++) { int64_t v = filter[i * filterSize + j] + error; int intV = ROUNDED_DIV(v, sum); (*outFilter)[i * (*outFilterSize) + j] = intV; error = v - intV * sum; } } (*filterPos)[dstW + 0] = (*filterPos)[dstW + 1] = (*filterPos)[dstW + 2] = (*filterPos)[dstW - 1]; for (i = 0; i < *outFilterSize; i++) { int k = (dstW - 1) * (*outFilterSize) + i; (*outFilter)[k + 1 * (*outFilterSize)] = (*outFilter)[k + 2 * (*outFilterSize)] = (*outFilter)[k + 3 * (*outFilterSize)] = (*outFilter)[k]; } ret = 0; fail: if(ret < 0) av_log(NULL, ret == RETCODE_USE_CASCADE ? AV_LOG_DEBUG : AV_LOG_ERROR, "sws: initFilter failed\n"); av_free(filter); av_free(filter2); return ret; }
1threat
Converting NSDictionary to JSON in Objective C : <p>i want to generate a JSON in Objective C , below is an example, one dictionary which has some fields, and within that dictionary i want to add another dictionary. i.e. Student dictionary can have subjects dictionary(which can have multiple items.</p> <pre><code>{ "student": { "name": "b", "std": "d", "subjects": [{"id":"1","id":"2","id":"3"}] }} </code></pre> <p>I am trying using NSJSONSerialization , i tried first creating json string of subjects dictionary but, after converting final JSON of main dictionary its showing (Slash) which is breaking json. i added subjects inside main dictionary then after converting its showing subjects json starting with <strong>(</strong></p> <p>Any suggestion what m i missing?</p> <p>Thanks</p>
0debug
static void imdct36(INTFLOAT *out, INTFLOAT *buf, INTFLOAT *in, INTFLOAT *win) { int i, j; INTFLOAT t0, t1, t2, t3, s0, s1, s2, s3; INTFLOAT tmp[18], *tmp1, *in1; for (i = 17; i >= 1; i--) in[i] += in[i-1]; for (i = 17; i >= 3; i -= 2) in[i] += in[i-2]; for (j = 0; j < 2; j++) { tmp1 = tmp + j; in1 = in + j; t2 = in1[2*4] + in1[2*8] - in1[2*2]; t3 = in1[2*0] + SHR(in1[2*6],1); t1 = in1[2*0] - in1[2*6]; tmp1[ 6] = t1 - SHR(t2,1); tmp1[16] = t1 + t2; t0 = MULH3(in1[2*2] + in1[2*4] , C2, 2); t1 = MULH3(in1[2*4] - in1[2*8] , -2*C8, 1); t2 = MULH3(in1[2*2] + in1[2*8] , -C4, 2); tmp1[10] = t3 - t0 - t2; tmp1[ 2] = t3 + t0 + t1; tmp1[14] = t3 + t2 - t1; tmp1[ 4] = MULH3(in1[2*5] + in1[2*7] - in1[2*1], -C3, 2); t2 = MULH3(in1[2*1] + in1[2*5], C1, 2); t3 = MULH3(in1[2*5] - in1[2*7], -2*C7, 1); t0 = MULH3(in1[2*3], C3, 2); t1 = MULH3(in1[2*1] + in1[2*7], -C5, 2); tmp1[ 0] = t2 + t3 + t0; tmp1[12] = t2 + t1 - t0; tmp1[ 8] = t3 - t1 - t0; } i = 0; for (j = 0; j < 4; j++) { t0 = tmp[i]; t1 = tmp[i + 2]; s0 = t1 + t0; s2 = t1 - t0; t2 = tmp[i + 1]; t3 = tmp[i + 3]; s1 = MULH3(t3 + t2, icos36h[ j], 2); s3 = MULLx(t3 - t2, icos36 [8 - j], FRAC_BITS); t0 = s0 + s1; t1 = s0 - s1; out[(9 + j) * SBLIMIT] = MULH3(t1, win[ 9 + j], 1) + buf[4*(9 + j)]; out[(8 - j) * SBLIMIT] = MULH3(t1, win[ 8 - j], 1) + buf[4*(8 - j)]; buf[4 * ( 9 + j )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + 9 + j], 1); buf[4 * ( 8 - j )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + 8 - j], 1); t0 = s2 + s3; t1 = s2 - s3; out[(9 + 8 - j) * SBLIMIT] = MULH3(t1, win[ 9 + 8 - j], 1) + buf[4*(9 + 8 - j)]; out[ j * SBLIMIT] = MULH3(t1, win[ j], 1) + buf[4*( j)]; buf[4 * ( 9 + 8 - j )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + 9 + 8 - j], 1); buf[4 * ( j )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + j], 1); i += 4; } s0 = tmp[16]; s1 = MULH3(tmp[17], icos36h[4], 2); t0 = s0 + s1; t1 = s0 - s1; out[(9 + 4) * SBLIMIT] = MULH3(t1, win[ 9 + 4], 1) + buf[4*(9 + 4)]; out[(8 - 4) * SBLIMIT] = MULH3(t1, win[ 8 - 4], 1) + buf[4*(8 - 4)]; buf[4 * ( 9 + 4 )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + 9 + 4], 1); buf[4 * ( 8 - 4 )] = MULH3(t0, win[MDCT_BUF_SIZE/2 + 8 - 4], 1); }
1threat
void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len) { PCIDevice *pci_dev = pci_dev_find_by_addr(s, addr); uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1); if (!pci_dev) return; PCI_DPRINTF("%s: %s: addr=%02" PRIx32 " val=%08" PRIx32 " len=%d\n", __func__, pci_dev->name, config_addr, val, len); pci_dev->config_write(pci_dev, config_addr, val, len); }
1threat
Python 2.7.13 Unit Conversions : #The table below contains some lengths in terms of feet. 1 inch = .083333 foot; 1 rod = 16. 5 feet; 1 yard = 3.28155 feet; 1 furlong = 660 feet; 1 meter = 3.28155 feet; 1 kilometer = 3281.5 feet; 1 fathom = 6 feet; 1 mile = 5280 feet. Write a program that displays the nine different units of measure; requests the unit to convert from, the unit to convert to, and the quantity to be converted; and then displays the converted quantity. Use the file Conversions.txt to create a dictionary that provides the number of feet for a given unit of length.The conversions.txt file reads: inches, .083333; furlongs, 660; yards, 3; fathoms, 6; feet, 1; kilometers, 3281.5; meters, 3.2815; miles, 5280; rods, 16.5 print 'UNITS OF LENGTH' print 'Inches', 'furlongs', 'yards' print 'rods', 'miles', 'fathoms' print 'meters', 'kilometers', 'feet' conversions = {} with open('Units.txt') as fname: for line in fname: (keys, values) = line.split(',') conversions[keys] = float(values) def convert(from_unit, to_unit, values): from__unit1 = conversions[from_unit1] to__unit2 = conversions[to_unit2] new_values = values * (from__unit1 / to__unit2) return str(new_value) + to__unit2 unit1 = raw_input('Units to convert from: ') unit2 = raw_input('Units to convert to: ') num1 = raw_input('Enter your value: ') print(convert(unit1, unit2, (num1)))
0debug
Please help me fix my attempt to put the current time into a long : public void Clik(View view){ Calendar c = Calendar.getInstance(); long seconds = c.get(Calendar.SECOND); TextView calenderTest = (TextView) findViewById(R.id.textView); String myTime = (String) String.valueOf(calenderTest); calenderTest.setText(myTime); } This app uses a button to get the current time, puts it into a long, and displays it. However I am receiving an output I was not expecting. [Error Received][1] [1]: https://i.stack.imgur.com/M8Lnm.png
0debug
My code keeps printing a certain part of the code, instead of continuing with the rest of the program : <p>After I type in any username and password (doesn't matter whether it's correct or not), it keeps printing another part of the code.</p> <p>The login part works fine but it doesn't show the correct output afterwards. It continuously shows: "Incorrect login details entered Have you made an account? Yes or No"</p> <p>This has stumped both my teacher and I. I have looked at different websites with examples of login/registration systems. I have also tried re-arranging the code differently. </p> <p>This is the code:</p> <pre><code>username = input("Please enter your username: ") password = input("Please enter your password: ") file = open("Usernames.txt","r") found = False for line in file: user = line.split(",") if user[0] == username and user[1] == password: found = True print("Username: " + user[0]) print("~~~~~") print("Welcome to the game, " + user[0]) else: found == False print("Incorrect login details entered") print("Have you made an account?") ans = input("Yes or No ") while ans not in ("Yes", "No"): if ans == "Yes": print ("Please sign in again") username = input("Please enter your correct username: ") password = input("Please enter your correct password: ") elif ans == "No": print("Would you like to make an account? ") else: ans = input("Please enter Yes or No ") </code></pre> <p>The expected result when the username and password is correct:</p> <pre><code>Username: Smartic ~~~~~ Welcome to the game, Smartic </code></pre> <p>The expected result when the username and password is incorrect:</p> <pre><code>Incorrect login details entered Have you made an account? Yes or No </code></pre> <p>The expected result when the user enters <code>Yes</code>:</p> <pre><code>Please sign in again Please enter your correct username: Please enter your correct password: </code></pre> <p>The expected result when the user enters <code>No</code>:</p> <pre><code>Would you like to make an account? </code></pre> <p>The expected result when the user enters something other than <code>Yes</code> or <code>No</code>:</p> <pre><code>Please enter Yes or No </code></pre>
0debug
static BlockDriverAIOCB *rbd_aio_rw_vector(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque, int write) { RBDAIOCB *acb; RADOSCB *rcb; rbd_completion_t c; int64_t off, size; char *buf; BDRVRBDState *s = bs->opaque; acb = qemu_aio_get(&rbd_aio_pool, bs, cb, opaque); acb->write = write; acb->qiov = qiov; acb->bounce = qemu_blockalign(bs, qiov->size); acb->ret = 0; acb->error = 0; acb->s = s; acb->cancelled = 0; acb->bh = NULL; if (write) { qemu_iovec_to_buffer(acb->qiov, acb->bounce); } buf = acb->bounce; off = sector_num * BDRV_SECTOR_SIZE; size = nb_sectors * BDRV_SECTOR_SIZE; s->qemu_aio_count++; rcb = qemu_malloc(sizeof(RADOSCB)); rcb->done = 0; rcb->acb = acb; rcb->buf = buf; rcb->s = acb->s; rcb->size = size; if (write) { rbd_aio_create_completion(rcb, (rbd_callback_t) rbd_finish_aiocb, &c); rbd_aio_write(s->image, off, size, buf, c); } else { rbd_aio_create_completion(rcb, (rbd_callback_t) rbd_finish_aiocb, &c); rbd_aio_read(s->image, off, size, buf, c); } return &acb->common; }
1threat
db.execute('SELECT * FROM employees WHERE id = ' + user_input)
1threat
'SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens' : <p>I am receiving the error of SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens</p> <pre><code>if (isset($_POST['cadastrar'])){ $nome = trim(strip_tags($_POST['nome'])); $usuario = trim(strip_tags($_POST['usuario'])); $email = trim(strip_tags($_POST['email'])); $senha = trim(strip_tags($_POST['senha'])); $cpf = trim(strip_tags($_POST['cpf'])); $rg = trim(strip_tags($_POST['rg'])); $select = "INSERT INTO registro (nome, usuario, email, senha, cpf, rg) VALUES (:nome, :usuario, email, :senha, :cpf, :rg)"; try{ $result = $conexao-&gt;prepare($select); $result-&gt;bindParam(':nome', $nome, PDO::PARAM_STR); $result-&gt;bindParam(':usuario', $nome, PDO::PARAM_STR); $result-&gt;bindParam(':senha', $nome, PDO::PARAM_STR); $result-&gt;bindParam(':email', $nome, PDO::PARAM_STR); $result-&gt;bindParam(':cpf', $nome, PDO::PARAM_STR); $result-&gt;bindParam(':rg', $nome, PDO::PARAM_STR); $result-&gt;execute(); $contar = $result-&gt;rowCount(); if($contar&gt;0){ echo 'logado com sucesso'; }else{ echo "Os dados digitados estão incorretos"; } }catch(PDOException $e){ echo $e; } } </code></pre>
0debug
How to make nginx print full log for tcp stream : <p>I'm using nginx-1.11.8 with the following configuration.</p> <pre><code>stream { log_format basic '$time_iso8601 $remote_addr ' '$protocol $status $bytes_sent $bytes_received ' '$session_time $upstream_addr ' '"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"'; access_log logs/stream.log basic buffer=1k flush=5s; include *.stream.conf; } </code></pre> <p>Now I can only get IP and other unimportant stuff in the tcp log. There are some important information related to the IP in the tcp data packet that I want to know. What should I do to get the full tcp packet in the tcp log? Thanks in advance.</p>
0debug
FizzBuzz Test Assignment C# TDD : <p>Recently I did a FizzBuzz Test Assignment using C# and TDD but I was told that I didn't meet their exceptions on this exercise to get a second stage interview. Can someone please let me know why I didn't meet their exceptions? What could I have done better and what did I do wrong? Source code and exercise details can be found here: <a href="https://github.com/PMVDias/FizzBuzz" rel="nofollow noreferrer">https://github.com/PMVDias/FizzBuzz</a></p>
0debug
static void vfio_pci_reset_handler(void *opaque) { VFIOGroup *group; VFIOPCIDevice *vdev; QLIST_FOREACH(group, &group_list, next) { QLIST_FOREACH(vdev, &group->device_list, next) { if (!vdev->reset_works || (!vdev->has_flr && vdev->has_pm_reset)) { vdev->needs_reset = true; } } } QLIST_FOREACH(group, &group_list, next) { QLIST_FOREACH(vdev, &group->device_list, next) { if (vdev->needs_reset) { vfio_pci_hot_reset_multi(vdev); } } } }
1threat
Caret in sql server : Consider the below query: Select Case when left(‘152rew’,5) not like ‘%[^A-Za-z]%’ then ‘true’ else ‘false’ end How ^ this is working in above sql statement as it is returning false. Can someone help me with this?
0debug
Rails data-disable-with re-enabling button : <p>I have a Rails Devise form that has javascript validation. When the user presses submit, the validation works and the user is refocused on the form where they need to be. </p> <p>However, rails uses the data-disable-with to disable the button after it has been clicked, so after the validation the user cannot click submit anymore. I am trying to set up some kind of listener to check when the button has been disabled, wait a little while to prevent double clicks, then re-enable the button.</p> <p>I have tried many iterations of code, the latest I tried was:</p> <pre><code> $(document.on("ajax:success", "new_supplier", function() { var button; button = $(this).find('.btn-sign-up'); setTimeout((function() { return button.disabled=false; }),1); }); </code></pre> <p>But had no success, previously I tried just adding a listener to the button: </p> <pre><code> var button = document.getElementById('btn-sign-up'); button.addEventListener("click", enableButton); function enableButton() { if (button.disabled) { window.setTimeout(enable(), 2000); } } function enable() { button.disabled=false; } </code></pre> <p>But this failed because it ran before the function (hidden in rails ether) that disabled the button so did not work.</p> <p>My submit button is a simple: </p> <pre><code> &lt;%= f.submit "Create my account", class: 'btn-sign-up', id: 'btn-sign-up' %&gt; </code></pre> <p>Can anyone help me out here? I think if I can disable the jQuery_ujs for this page that would work, but not sure if I can do that. </p>
0debug
static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; KmvcContext *const ctx = avctx->priv_data; uint8_t *out, *src; int i; int header; int blocksize; const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL); if (ctx->pic.data[0]) avctx->release_buffer(avctx, &ctx->pic); ctx->pic.reference = 1; ctx->pic.buffer_hints = FF_BUFFER_HINTS_VALID; if (avctx->get_buffer(avctx, &ctx->pic) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } header = *buf++; if (buf[0] == 127) { buf += 3; for (i = 0; i < 127; i++) { ctx->pal[i + (header & 0x81)] = AV_RB24(buf); buf += 4; } buf -= 127 * 4 + 3; } if (header & KMVC_KEYFRAME) { ctx->pic.key_frame = 1; ctx->pic.pict_type = AV_PICTURE_TYPE_I; } else { ctx->pic.key_frame = 0; ctx->pic.pict_type = AV_PICTURE_TYPE_P; } if (header & KMVC_PALETTE) { ctx->pic.palette_has_changed = 1; for (i = 1; i <= ctx->palsize; i++) { ctx->pal[i] = bytestream_get_be24(&buf); } } if (pal) { ctx->pic.palette_has_changed = 1; memcpy(ctx->pal, pal, AVPALETTE_SIZE); } if (ctx->setpal) { ctx->setpal = 0; ctx->pic.palette_has_changed = 1; } memcpy(ctx->pic.data[1], ctx->pal, 1024); blocksize = *buf++; if (blocksize != 8 && blocksize != 127) { av_log(avctx, AV_LOG_ERROR, "Block size = %i\n", blocksize); return -1; } memset(ctx->cur, 0, 320 * 200); switch (header & KMVC_METHOD) { case 0: case 1: memcpy(ctx->cur, ctx->prev, 320 * 200); break; case 3: kmvc_decode_intra_8x8(ctx, buf, buf_size, avctx->width, avctx->height); break; case 4: kmvc_decode_inter_8x8(ctx, buf, buf_size, avctx->width, avctx->height); break; default: av_log(avctx, AV_LOG_ERROR, "Unknown compression method %i\n", header & KMVC_METHOD); return -1; } out = ctx->pic.data[0]; src = ctx->cur; for (i = 0; i < avctx->height; i++) { memcpy(out, src, avctx->width); src += 320; out += ctx->pic.linesize[0]; } if (ctx->cur == ctx->frm0) { ctx->cur = ctx->frm1; ctx->prev = ctx->frm0; } else { ctx->cur = ctx->frm0; ctx->prev = ctx->frm1; } *data_size = sizeof(AVFrame); *(AVFrame *) data = ctx->pic; return buf_size; }
1threat
Build React components library with Webpack 4 : <p>I'm currently building a library of React components and bundling it with Webpack 4.</p> <p>Everything works just fine from building the library's bundle to publishing it on an npm registry.</p> <p>But then, I'm not able to import any of its components in an other React application and get this error message at runtime:</p> <blockquote> <p>Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.</p> </blockquote> <p>And here is the related code:</p> <p>A dumb component from my components library: <code>button/index.js</code></p> <pre><code>import React from "react"; const Button = () =&gt; &lt;button&gt;Foobar&lt;/button&gt;; export { Button }; </code></pre> <p>The main entry point of my library <code>index.js</code>:</p> <pre><code>import { Button } from "./src/components/Button"; export { Button }; </code></pre> <p>My Webpack config <code>webpack.config.js</code>:</p> <pre><code>const path = require("path"); const { CleanWebpackPlugin } = require("clean-webpack-plugin"); module.exports = { entry: "./index.js", plugins: [new CleanWebpackPlugin()], module: { rules: [ { test: /\.m?js$/, exclude: /node_modules/, use: { loader: "babel-loader" } } ] }, output: { filename: "index.js", path: path.resolve(__dirname, "dist"), libraryTarget: "commonjs", library: "" } }; </code></pre> <p>And finally, the import of this component in an other application:</p> <pre><code>import { Button } from "my-design-system"; </code></pre> <p>I guess I'm missing something in my Webpack config or one of the property may be wrong, but after reading multiple posts and tutorials, I can't figure which one.</p>
0debug
how th compile and run a new c++ actor framework project? : I use Ubunutu. I have installed CAF from github. I've follow step by step this instructions: https://actor-framework.readthedocs.io/en/stable/FirstSteps.html I want to compile and run the hello world file. No specific indication for the compilation are given. I made just g++ hello_world.cpp -std=c++11 But i have a very long error message. (i have cut the middle of the message, otherwise it's to long) Can anybody tell me how to fix y problem? g++ hello_world.cpp -std=c++11 /tmp/ccbpYkaB.o : Dans la fonction « mirror(caf::event_based_actor*)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const » : hello_world.cpp:(.text+0x16a) : référence indéfinie vers « caf::aout(caf::local_actor*) » hello_world.cpp:(.text+0x182) : référence indéfinie vers « std::endl(caf::actor_ostream&) » /tmp/ccbpYkaB.o : Dans la fonction « hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const » : hello_world.cpp:(.text+0x305) : référence indéfinie vers « caf::aout(caf::local_actor*) » hello_world.cpp:(.text+0x31d) : référence indéfinie vers « std::endl(caf::actor_ostream&) » /tmp/ccbpYkaB.o : Dans la fonction « main » : hello_world.cpp:(.text+0x443) : référence indéfinie vers « caf::actor_system_config::actor_system_config() » hello_world.cpp:(.text+0x45c) : référence indéfinie vers « caf::actor_system::actor_system(caf::actor_system_config&) » hello_world.cpp:(.text+0x4cc) : référence indéfinie vers « caf::actor_system::~actor_system() » hello_world.cpp:(.text+0x4db) : référence indéfinie vers « caf::actor_system_config::~actor_system_config() » hello_world.cpp:(.text+0x517) : référence indéfinie vers « caf::actor_system::~actor_system() » hello_world.cpp:(.text+0x52b) : référence indéfinie vers « caf::actor_system_config::~actor_system_config() » /tmp/ccbpYkaB.o : Dans la fonction « void caf::response_handle<caf::event_based_actor, caf::message, false>::then_impl<hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>(hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}&) const » : hello_world.cpp:(.text+0x6bb) : référence indéfinie vers « caf::scheduled_actor::add_multiplexed_response_handler(caf::message_id, caf::behavior) » /tmp/ccbpYkaB.o : Dans la fonction « caf::trivial_match_case<mirror(caf::event_based_actor*)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>::~trivial_match_case() » : hello_world.cpp:(.text+0x974) : référence indéfinie vers « caf::match_case::~match_case() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::default_behavior_impl<std::tuple<caf::trivial_match_case<mirror(caf::event_based_actor*)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}> > >::default_behavior_impl<{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>({lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}&&) » : hello_world.cpp:(.text+0xadd) : référence indéfinie vers « caf::detail::behavior_impl::behavior_impl(caf::duration) » hello_world.cpp:(.text+0xb3d) : référence indéfinie vers « caf::detail::behavior_impl::~behavior_impl() » /tmp/ccbpYkaB.o : Dans la fonction « caf::trivial_match_case<mirror(caf::event_based_actor*)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>::trivial_match_case({lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}) » : hello_world.cpp:(.text+0xc69) : référence indéfinie vers « caf::match_case::match_case(unsigned int) » /tmp/ccbpYkaB.o : Dans la fonction « caf::trivial_match_case<hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>::~trivial_match_case() » : hello_world.cpp:(.text+0xed8) : référence indéfinie vers « caf::match_case::~match_case() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::default_behavior_impl<std::tuple<caf::trivial_match_case<hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}> > >::default_behavior_impl<{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>({lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}&&) » : hello_world.cpp:(.text+0x1041) : référence indéfinie vers « caf::detail::behavior_impl::behavior_impl(caf::duration) » hello_world.cpp:(.text+0x10a1) : référence indéfinie vers « caf::detail::behavior_impl::~behavior_impl() » /tmp/ccbpYkaB.o : Dans la fonction « caf::trivial_match_case<hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>::trivial_match_case({lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}) » : hello_world.cpp:(.text+0x11bd) : référence indéfinie vers « caf::match_case::match_case(unsigned int) » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::default_behavior_impl<std::tuple<caf::trivial_match_case<hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}> > >::~default_behavior_impl() » : hello_world.cpp:(.text+0x1446) : référence indéfinie vers « caf::detail::behavior_impl::~behavior_impl() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::default_behavior_impl<std::tuple<caf::trivial_match_case<mirror(caf::event_based_actor*)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}> > >::~default_behavior_impl() » : hello_world.cpp:(.text+0x14b8) : référence indéfinie vers « caf::detail::behavior_impl::~behavior_impl() » /tmp/ccbpYkaB.o : Dans la fonction « caf::trivial_match_case<hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>::invoke(caf::detail::invoke_result_visitor&, caf::type_erased_tuple&) » : hello_world.cpp:(.text+0x1659) : référence indéfinie vers « caf::detail::try_match(caf::type_erased_tuple const&, caf::detail::meta_element const*, unsigned long) » hello_world.cpp:(.text+0x16b2) : référence indéfinie vers « caf::message::copy(caf::type_erased_tuple const&) » hello_world.cpp:(.text+0x16c5) : référence indéfinie vers « caf::message::operator=(caf::message&&) » hello_world.cpp:(.text+0x16d1) : référence indéfinie vers « caf::message::~message() » hello_world.cpp:(.text+0x1757) : référence indéfinie vers « caf::message::~message() » hello_world.cpp:(.text+0x1779) : référence indéfinie vers « caf::message::~message() » /tmp/ccbpYkaB.o : Dans la fonction « caf::trivial_match_case<mirror(caf::event_based_actor*)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>::invoke(caf::detail::invoke_result_visitor&, caf::type_erased_tuple&) » : hello_world.cpp:(.text+0x18b7) : référence indéfinie vers « caf::detail::try_match(caf::type_erased_tuple const&, caf::detail::meta_element const*, unsigned long) » hello_world.cpp:(.text+0x1916) : référence indéfinie vers « caf::message::copy(caf::type_erased_tuple const&) » hello_world.cpp:(.text+0x192c) : référence indéfinie vers « caf::message::operator=(caf::message&&) » hello_world.cpp:(.text+0x1938) : référence indéfinie vers « caf::message::~message() » hello_world.cpp:(.text+0x19cd) : référence indéfinie vers « caf::message::~message() » hello_world.cpp:(.text+0x1a03) : référence indéfinie vers « caf::message::~message() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::default_behavior_impl<std::tuple<caf::trivial_match_case<hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>, caf::timeout_definition<std::function<void ()> > > >::default_behavior_impl<hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1} const&, std::function<void ()> const&>(hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1} const&, std::function<void ()> const&) » : hello_world.cpp:(.text+0x21eb) : référence indéfinie vers « caf::detail::behavior_impl::behavior_impl(caf::duration) » hello_world.cpp:(.text+0x225d) : référence indéfinie vers « caf::detail::behavior_impl::~behavior_impl() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::default_behavior_impl<std::tuple<caf::trivial_match_case<mirror(caf::event_based_actor*)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>, caf::timeout_definition<std::function<void ()> > > >::default_behavior_impl<mirror(caf::event_based_actor*)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1} const&, std::function<void ()> const&>(mirror(caf::event_based_actor*)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1} const&, std::function<void ()> const&) » : hello_world.cpp:(.text+0x2445) : référence indéfinie vers « caf::detail::behavior_impl::behavior_impl(caf::duration) » hello_world.cpp:(.text+0x24b7) : référence indéfinie vers « caf::detail::behavior_impl::~behavior_impl() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::default_behavior_impl<std::tuple<caf::trivial_match_case<mirror(caf::event_based_actor*)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>, caf::timeout_definition<std::function<void ()> > > >::~default_behavior_impl() » : hello_world.cpp:(.text+0x2a1a) : référence indéfinie vers « caf::detail::behavior_impl::~behavior_impl() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::default_behavior_impl<std::tuple<caf::trivial_match_case<hello_world(caf::event_based_actor*, caf::actor const&)::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>, caf::timeout_definition<std::function<void ()> > > >::~default_behavior_impl() » : hello_world.cpp:(.text+0x2a8c) : référence indéfinie vers « caf::detail::behavior_impl::~behavior_impl() » /tmp/ccbpYkaB.o:(.rodata+0x190) : référence indéfinie vers « caf::memory_managed::request_deletion(bool) » /tmp/ccbpYkaB.o:(.rodata+0x1a8) : référence indéfinie vers « caf::detail::behavior_impl::invoke_empty(caf::detail::invoke_result_visitor&) » /tmp/ccbpYkaB.o:(.rodata+0x1b0) : référence indéfinie vers « caf::detail::behavior_impl::invoke(caf::detail::invoke_result_visitor&, caf::type_erased_tuple&) » /tmp/ccbpYkaB.o:(.rodata+0x200) : référence indéfinie vers « caf::memory_managed::request_deletion(bool) » /tmp/ccbpYkaB.o:(.rodata+0x218) : référence indéfinie vers « caf::detail::behavior_impl::invoke_empty(caf::detail::invoke_result_visitor&) » /tmp/ccbpYkaB.o:(.rodata+0x220) : référence indéfinie vers « caf::detail::behavior_impl::invoke(caf::detail::invoke_result_visitor&, caf::type_erased_tuple&) » /tmp/ccbpYkaB.o:(.rodata+0x330) : référence indéfinie vers « typeinfo for caf::detail::behavior_impl » /tmp/ccbpYkaB.o:(.rodata+0x3e0) : référence indéfinie vers « typeinfo for caf::match_case » /tmp/ccbpYkaB.o:(.rodata+0x4c0) : référence indéfinie vers « typeinfo for caf::detail::behavior_impl » /tmp/ccbpYkaB.o:(.rodata+0x570) : référence indéfinie vers « typeinfo for caf::match_case » /tmp/ccbpYkaB.o:(.rodata+0x598) : référence indéfinie vers « caf::memory_managed::request_deletion(bool) » /tmp/ccbpYkaB.o:(.rodata+0x5b0) : référence indéfinie vers « caf::detail::behavior_impl::invoke_empty(caf::detail::invoke_result_visitor&) » /tmp/ccbpYkaB.o:(.rodata+0x5b8) : référence indéfinie vers « caf::detail::behavior_impl::invoke(caf::detail::invoke_result_visitor&, caf::type_erased_tuple&) » /tmp/ccbpYkaB.o:(.rodata+0x5e0) : référence indéfinie vers « caf::memory_managed::request_deletion(bool) » /tmp/ccbpYkaB.o:(.rodata+0x5f8) : référence indéfinie vers « caf::detail::behavior_impl::invoke_empty(caf::detail::invoke_result_visitor&) » /tmp/ccbpYkaB.o:(.rodata+0x600) : référence indéfinie vers « caf::detail::behavior_impl::invoke(caf::detail::invoke_result_visitor&, caf::type_erased_tuple&) » /tmp/ccbpYkaB.o:(.rodata+0x708) : référence indéfinie vers « typeinfo for caf::detail::behavior_impl » /tmp/ccbpYkaB.o:(.rodata+0x818) : référence indéfinie vers « typeinfo for caf::detail::behavior_impl » /tmp/ccbpYkaB.o : Dans la fonction « caf::intrusive_ptr_release(caf::ref_counted*) » : hello_world.cpp:(.text._ZN3caf21intrusive_ptr_releaseEPNS_11ref_countedE[_ZN3caf21intrusive_ptr_releaseEPNS_11ref_countedE]+0x14) : référence indéfinie vers « caf::ref_counted::deref() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::message_data::cow_ptr::operator*() » : hello_world.cpp:(.text._ZN3caf6detail12message_data7cow_ptrdeEv[_ZN3caf6detail12message_data7cow_ptrdeEv]+0x14) : référence indéfinie vers « caf::detail::message_data::cow_ptr::get_unshared() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::stringification_inspector::consume(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) » : hello_world.cpp:(.text._ZN3caf6detail25stringification_inspector7consumeERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN3caf6detail25stringification_inspector7consumeERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2a) : référence indéfinie vers « caf::detail::stringification_inspector::consume(char const*) » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::invoke_result_visitor::operator()(caf::unit_t const&) » : hello_world.cpp:(.text._ZN3caf6detail21invoke_result_visitorclERKNS_6unit_tE[_ZN3caf6detail21invoke_result_visitorclERKNS_6unit_tE]+0x4e) : référence indéfinie vers « caf::message::~message() » hello_world.cpp:(.text._ZN3caf6detail21invoke_result_visitorclERKNS_6unit_tE[_ZN3caf6detail21invoke_result_visitorclERKNS_6unit_tE]+0x6f) : référence indéfinie vers « caf::message::~message() » /tmp/ccbpYkaB.o : Dans la fonction « caf::actor_ostream::operator<<(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) » : hello_world.cpp:(.text._ZN3caf13actor_ostreamlsENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN3caf13actor_ostreamlsENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x4d) : référence indéfinie vers « caf::actor_ostream::write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) » /tmp/ccbpYkaB.o : Dans la fonction « caf::intrusive_ptr<caf::actor_control_block>::~intrusive_ptr() » : hello_world.cpp:(.text._ZN3caf13intrusive_ptrINS_19actor_control_blockEED2Ev[_ZN3caf13intrusive_ptrINS_19actor_control_blockEED5Ev]+0x23) : référence indéfinie vers « caf::intrusive_ptr_release(caf::actor_control_block*) » /tmp/ccbpYkaB.o : Dans la fonction « caf::infer_handle_from_fun<caf::behavior (*)(caf::event_based_actor*), caf::detail::get_callable_trait<caf::behavior (*)(caf::event_based_actor*)>::type>::type caf::actor_system::spawn<(caf::spawn_options)0, caf::behavior (*)(caf::event_based_actor*)>(caf::behavior (*)(caf::event_based_actor*)) » : hello_world.cpp:(.text._ZN3caf12actor_system5spawnILNS_13spawn_optionsE0EPFNS_8behaviorEPNS_17event_based_actorEEJEEENS_21infer_handle_from_funIT0_NS_6detail18get_callable_traitIS9_E4typeEE4typeES9_DpOT1_[_ZN3caf12actor_system5spawnILNS_13spawn_optionsE0EPFNS_8behaviorEPNS_17event_based_actorEEJEEENS_21infer_handle_from_funIT0_NS_6detail18get_callable_traitIS9_E4typeEE4typeES9_DpOT1_]+0x3d) : référence indéfinie vers « caf::actor_config::actor_config(caf::execution_unit*) » /tmp/ccbpYkaB.o : Dans la fonction « caf::infer_handle_from_fun<void (*)(caf::event_based_actor*, caf::actor const&), caf::detail::get_callable_trait<void (*)(caf::event_based_actor*, caf::actor const&)>::type>::type caf::actor_system::spawn<(caf::spawn_options)0, void (*)(caf::event_based_actor*, caf::actor const&), caf::actor&>(void (*)(caf::event_based_actor*, caf::actor const&), caf::actor&) » : hello_world.cpp:(.text._ZN3caf12actor_system5spawnILNS_13spawn_optionsE0EPFvPNS_17event_based_actorERKNS_5actorEEJRS5_EEENS_21infer_handle_from_funIT0_NS_6detail18get_callable_traitISC_E4typeEE4typeESC_DpOT1_[_ZN3caf12actor_system5spawnILNS_13spawn_optionsE0EPFvPNS_17event_based_actorERKNS_5actorEEJRS5_EEENS_21infer_handle_from_funIT0_NS_6detail18get_callable_traitISC_E4typeEE4typeESC_DpOT1_]+0x41) : référence indéfinie vers « caf::actor_config::actor_config(caf::execution_unit*) » /tmp/ccbpYkaB.o : Dans la fonction « caf::response_handle<caf::event_based_actor, caf::response_type<caf::actor::signatures, caf::detail::implicit_conversions<std::decay<char const (&) [13]>::type>::type>::type, false> caf::mixin::requester<caf::mixin::sender<caf::scheduled_actor, caf::event_based_actor>, caf::event_based_actor>::request<(caf::message_priority)0, caf::actor, char const (&) [13]>(caf::actor const&, caf::duration const&, char const (&) [13]) » : hello_world.cpp:(.text._ZN3caf5mixin9requesterINS0_6senderINS_15scheduled_actorENS_17event_based_actorEEES4_E7requestILNS_16message_priorityE0ENS_5actorEJRA13_KcEEENS_15response_handleIS4_NS_13response_typeINT0_10signaturesEJDpNS_6detail20implicit_conversionsINSt5decayIT1_E4typeEE4typeEEE4typeELb0EEERKSF_RKNS_8durationEDpOSK_[_ZN3caf5mixin9requesterINS0_6senderINS_15scheduled_actorENS_17event_based_actorEEES4_E7requestILNS_16message_priorityE0ENS_5actorEJRA13_KcEEENS_15response_handleIS4_NS_13response_typeINT0_10signaturesEJDpNS_6detail20implicit_conversionsINSt5decayIT1_E4typeEE4typeEEE4typeELb0EEERKSF_RKNS_8durationEDpOSK_]+0x3f) : référence indéfinie vers « caf::local_actor::new_request_id(caf::message_priority) » hello_world.cpp:(.text._ZN3caf5mixin9requesterINS0_6senderINS_15scheduled_actorENS_17event_based_actorEEES4_E7requestILNS_16message_priorityE0ENS_5actorEJRA13_KcEEENS_15response_handleIS4_NS_13response_typeINT0_10signaturesEJDpNS_6detail20implicit_conversionsINSt5decayIT1_E4typeEE4typeEEE4typeELb0EEERKSF_RKNS_8durationEDpOSK_[_ZN3caf5mixin9requesterINS0_6senderINS_15scheduled_actorENS_17event_based_actorEEES4_E7requestILNS_16message_priorityE0ENS_5actorEJRA13_KcEEENS_15response_handleIS4_NS_13response_typeINT0_10signaturesEJDpNS_6detail20implicit_conversionsINSt5decayIT1_E4typeEE4typeEEE4typeELb0EEERKSF_RKNS_8durationEDpOSK_]+0x81) : référence indéfinie vers « caf::abstract_actor::ctrl() const » inie vers « caf::mailbox_element::~mailbox_element() » /tmp/ccbpYkaB.o : Dans la fonction « std::_Head_base<0ul, caf::error, false>::~_Head_base() » : hello_world.cpp:(.text._ZNSt10_Head_baseILm0EN3caf5errorELb0EED2Ev[_ZNSt10_Head_baseILm0EN3caf5errorELb0EED5Ev]+0x14) : référence indéfinie vers « caf::error::~error() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::tuple_vals_impl<caf::type_erased_tuple, caf::error>::~tuple_vals_impl() » : hello_world.cpp:(.text._ZN3caf6detail15tuple_vals_implINS_17type_erased_tupleEJNS_5errorEEED2Ev[_ZN3caf6detail15tuple_vals_implINS_17type_erased_tupleEJNS_5errorEEED5Ev]+0x30) : référence indéfinie vers « caf::type_erased_tuple::~type_erased_tuple() » /tmp/ccbpYkaB.o : Dans la fonction « caf::mailbox_element_vals<caf::error>::mailbox_element_vals<caf::error>(caf::intrusive_ptr<caf::actor_control_block>&&, caf::message_id, std::vector<caf::intrusive_ptr<caf::actor_control_block>, std::allocator<caf::intrusive_ptr<caf::actor_control_block> > >&&, caf::error&&) » : hello_world.cpp:(.text._ZN3caf20mailbox_element_valsIJNS_5errorEEEC2IJS1_EEEONS_13intrusive_ptrINS_19actor_control_blockEEENS_10message_idEOSt6vectorIS6_SaIS6_EEDpOT_[_ZN3caf20mailbox_element_valsIJNS_5errorEEEC5IJS1_EEEONS_13intrusive_ptrINS_19actor_control_blockEEENS_10message_idEOSt6vectorIS6_SaIS6_EEDpOT_]+0x4a) : référence indéfinie vers « caf::mailbox_element::mailbox_element(caf::intrusive_ptr<caf::actor_control_block>&&, caf::message_id, std::vector<caf::intrusive_ptr<caf::actor_control_block>, std::allocator<caf::intrusive_ptr<caf::actor_control_block> > >&&) » /tmp/ccbpYkaB.o : Dans la fonction « caf::actor caf::make_actor<caf::event_based_actor, caf::actor, caf::actor_config&>(unsigned long, caf::node_id, caf::actor_system*, caf::actor_config&) » : hello_world.cpp:(.text._ZN3caf10make_actorINS_17event_based_actorENS_5actorEJRNS_12actor_configEEEET0_mNS_7node_idEPNS_12actor_systemEDpOT1_[_ZN3caf10make_actorINS_17event_based_actorENS_5actorEJRNS_12actor_configEEEET0_mNS_7node_idEPNS_12actor_systemEDpOT1_]+0x96) : référence indéfinie vers « caf::node_id::~node_id() » hello_world.cpp:(.text._ZN3caf10make_actorINS_17event_based_actorENS_5actorEJRNS_12actor_configEEEET0_mNS_7node_idEPNS_12actor_systemEDpOT1_[_ZN3caf10make_actorINS_17event_based_actorENS_5actorEJRNS_12actor_configEEEET0_mNS_7node_idEPNS_12actor_systemEDpOT1_]+0xae) : référence indéfinie vers « caf::actor::actor(caf::actor_control_block*, bool) » hello_world.cpp:(.text._ZN3caf10make_actorINS_17event_based_actorENS_5actorEJRNS_12actor_configEEEET0_mNS_7node_idEPNS_12actor_systemEDpOT1_[_ZN3caf10make_actorINS_17event_based_actorENS_5actorEJRNS_12actor_configEEEET0_mNS_7node_idEPNS_12actor_systemEDpOT1_]+0xe2) : référence indéfinie vers « caf::node_id::~node_id() » /tmp/ccbpYkaB.o : Dans la fonction « caf::detail::tuple_vals_impl<caf::type_erased_tuple, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::tuple_vals_impl<char const (&) [13]>(char const (&) [13]) » : hello_world.cpp:(.text._ZN3caf6detail15tuple_vals_implINS_17type_erased_tupleEJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEC2IJRA13_KcEEEDpOT_[_ZN3caf6detail15tuple_vals_implINS_17type_erased_tupleEJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEC5IJRA13_KcEEEDpOT_]+0x6d) : référence indéfinie vers « caf::type_erased_tuple::~type_erased_tuple() » /tmp/ccbpYkaB.o : Dans la fonction « std::_Head_base<0ul, caf::error, false>::_Head_base<caf::error>(caf::error&&) » : hello_world.cpp:(.text._ZNSt10_Head_baseILm0EN3caf5errorELb0EEC2IS1_EEOT_[_ZNSt10_Head_baseILm0EN3caf5errorELb0EEC5IS1_EEOT_]+0x2a) : référence indéfinie vers « caf::error::error(caf::error&&) » /tmp/ccbpYkaB.o : Dans la fonction « caf::actor_control_block::~actor_control_block() » : hello_world.cpp:(.text._ZN3caf19actor_control_blockD2Ev[_ZN3caf19actor_control_blockD5Ev]+0x18) : référence indéfinie vers « caf::node_id::~node_id() » /tmp/ccbpYkaB.o : Dans la fonction « caf::actor_storage<caf::event_based_actor>::actor_storage<caf::actor_config&>(unsigned long, caf::node_id, caf::actor_system*, caf::actor_config&) » : hello_world.cpp:(.text._ZN3caf13actor_storageINS_17event_based_actorEEC2IJRNS_12actor_configEEEEmNS_7node_idEPNS_12actor_systemEDpOT_[_ZN3caf13actor_storageINS_17event_based_actorEEC5IJRNS_12actor_configEEEEmNS_7node_idEPNS_12actor_systemEDpOT_]+0x73) : référence indéfinie vers « caf::event_based_actor::event_based_actor(caf::actor_config&) » /tJRKS2_EEEDpOT_]+0x58) : référence indéfinie vers « caf::type_erased_value::~type_erased_value() » /tmp/ccbpYkaB.o : Dans la fonction « std::enable_if<!caf::meta::is_annotation<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>::value, void>::type caf::detail::stringification_inspector::traverse<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) » : hello_world.cpp:(.text._ZN3caf6detail25stringification_inspector8traverseIRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJEEENSt9enable_ifIXntsrNS_4meta13is_annotationIT_EE5valueEvE4typeEOSE_DpOT0_[_ZN3caf6detail25stringification_inspector8traverseIRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJEEENSt9enable_ifIXntsrNS_4meta13is_annotationIT_EE5valueEvE4typeEOSE_DpOT0_]+0x18) : référence indéfinie vers « caf::detail::stringification_inspector::sep() » /tmp/ccbpYkaB.o : Dans la fonction « std::enable_if<!caf::meta::is_annotation<caf::error const&>::value, void>::type caf::detail::stringification_inspector::traverse<caf::error const&>(caf::error const&) » : hello_world.cpp:(.text._ZN3caf6detail25stringification_inspector8traverseIRKNS_5errorEJEEENSt9enable_ifIXntsrNS_4meta13is_annotationIT_EE5valueEvE4typeEOS9_DpOT0_[_ZN3caf6detail25stringification_inspector8traverseIRKNS_5errorEJEEENSt9enable_ifIXntsrNS_4meta13is_annotationIT_EE5valueEvE4typeEOS9_DpOT0_]+0x18) : référence indéfinie vers « caf::detail::stringification_inspector::sep() » collect2: error: ld returned 1 exit status
0debug
static void virtio_pci_reset(void *opaque) { VirtIOPCIProxy *proxy = opaque; virtio_reset(proxy->vdev); msix_reset(&proxy->pci_dev); }
1threat
static void qxl_realize_primary(PCIDevice *dev, Error **errp) { PCIQXLDevice *qxl = PCI_QXL(dev); VGACommonState *vga = &qxl->vga; Error *local_err = NULL; qxl->id = 0; qxl_init_ramsize(qxl); vga->vbe_size = qxl->vgamem_size; vga->vram_size_mb = qxl->vga.vram_size >> 20; vga_common_init(vga, OBJECT(dev), true); vga_init(vga, OBJECT(dev), pci_address_space(dev), pci_address_space_io(dev), false); portio_list_init(&qxl->vga_port_list, OBJECT(dev), qxl_vga_portio_list, vga, "vga"); portio_list_set_flush_coalesced(&qxl->vga_port_list); portio_list_add(&qxl->vga_port_list, pci_address_space_io(dev), 0x3b0); vga->con = graphic_console_init(DEVICE(dev), 0, &qxl_ops, qxl); qemu_spice_display_init_common(&qxl->ssd); qxl_realize_common(qxl, &local_err); if (local_err) { error_propagate(errp, local_err); return; } qxl->ssd.dcl.ops = &display_listener_ops; qxl->ssd.dcl.con = vga->con; register_displaychangelistener(&qxl->ssd.dcl); }
1threat
void breakpoint_handler(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); CPUX86State *env = &cpu->env; CPUBreakpoint *bp; if (cs->watchpoint_hit) { if (cs->watchpoint_hit->flags & BP_CPU) { cs->watchpoint_hit = NULL; if (check_hw_breakpoints(env, false)) { raise_exception(env, EXCP01_DB); } else { cpu_resume_from_signal(cs, NULL); } } } else { QTAILQ_FOREACH(bp, &cs->breakpoints, entry) { if (bp->pc == env->eip) { if (bp->flags & BP_CPU) { check_hw_breakpoints(env, true); raise_exception(env, EXCP01_DB); } break; } } } }
1threat
Android send data to javascript methods : Hi can someone point me in right direction on How to send data to javascript methods/functions. i saw toast examples with javascriptInterface But unable to relate it to my scenarion Below is my javascript function function printInfo() { var request = new AudioFileRequest('1.wav'); request.send(); } i want to record the sound in mobile and send that sound file to the method **"AudioFileRequest"**
0debug
int inet_aton (const char * str, struct in_addr * add) { const char * pch = str; unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0; add1 = atoi(pch); pch = strpbrk(pch,"."); if (pch == 0 || ++pch == 0) goto done; add2 = atoi(pch); pch = strpbrk(pch,"."); if (pch == 0 || ++pch == 0) goto done; add3 = atoi(pch); pch = strpbrk(pch,"."); if (pch == 0 || ++pch == 0) goto done; add4 = atoi(pch); done: add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1; return 1; }
1threat
Why does using a virtual base class change the behavior of the copy constructor : <p>In the following program the <code>a</code> member variable is not copied when B is virtually derived from A and instances of C (not B) are copied.</p> <pre><code>#include &lt;stdio.h&gt; class A { public: A() { a = 0; printf("A()\n"); } int a; }; class B : virtual public A { }; class C : public B { public: C() {} C(const C &amp;from) : B(from) {} }; template&lt;typename T&gt; void test() { T t1; t1.a = 3; printf("pre-copy\n"); T t2(t1); printf("post-copy\n"); printf("t1.a=%d\n", t1.a); printf("t2.a=%d\n", t2.a); } int main() { printf("B:\n"); test&lt;B&gt;(); printf("\n"); printf("C:\n"); test&lt;C&gt;(); } </code></pre> <p>output:</p> <pre><code>B: A() pre-copy post-copy t1.a=3 t2.a=3 C: A() pre-copy A() post-copy t1.a=3 t2.a=0 </code></pre> <p>Note that if B is normally derived from A (you delete the <code>virtual</code>) then <code>a</code> is copied.</p> <p>Why isn't <code>a</code> copied in the first case (<code>test&lt;C&gt;()</code> with B virtually derived from A?</p>
0debug
static int coroutine_fn bdrv_driver_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { BlockDriver *drv = bs->drv; int64_t sector_num = offset >> BDRV_SECTOR_BITS; unsigned int nb_sectors = bytes >> BDRV_SECTOR_BITS; int ret; assert((offset & (BDRV_SECTOR_SIZE - 1)) == 0); assert((bytes & (BDRV_SECTOR_SIZE - 1)) == 0); assert((bytes >> BDRV_SECTOR_BITS) <= BDRV_REQUEST_MAX_SECTORS); if (drv->bdrv_co_writev_flags) { ret = drv->bdrv_co_writev_flags(bs, sector_num, nb_sectors, qiov, flags); } else { assert(drv->supported_write_flags == 0); ret = drv->bdrv_co_writev(bs, sector_num, nb_sectors, qiov); } if (ret == 0 && (flags & BDRV_REQ_FUA) && !(drv->supported_write_flags & BDRV_REQ_FUA)) { ret = bdrv_co_flush(bs); } return ret; }
1threat
Functions return NaN in JavaScript : <p>I'm trying to write a game in JavaScript, and it has some simple car physics that determines that RPM, torque, speed of the car, etc. I have some functions that convert RPM/hp values into different units, and when the RPM gets past a certain point the gear is incremented. However, for some reason, when the car passes the RPM at which it's supposed to shift up on the final gear, the functions start returning NaN and the object disappears from the canvas. What could be the problem? Here is the code: </p> <pre><code>function gameObject(width, height, color, x, y) { this.width = width; this.height = height; this.speedX = 0; this.speedY = 0; this.x = x; this.y = y; this.weight = 2500; this.health = 100; this.hp = 276; this.accelTime = 1; this.gearRatios = [1.98, 1.64, 1.4, 1.23, 1.04]; this.gear = 1; this.RPM = 0; this.shiftUpRPM = 7000; this.shiftDownRPM = 1100; ctx = game.canvas.getContext('2d'); ctx.fillStyle = color; ctx.fillRect(this.x, this.y, this.width, this.height); this.update = function() { if (this.RPM &gt;= this.shiftUpRPM &amp;&amp; this.gear &lt; 5) { this.RPM = 1400; this.gear += 1; } else if (this.RPM &lt;= this.shiftDownRPM &amp;&amp; this.gear &gt; 1) { this.RPM = 5200; this.gear -= 1; } ctx = game.context; ctx.fillStyle = color; ctx.fillRect(this.x, this.y, this.width, this.height); } this.newPos = function() { this.x += this.speedX; this.y += this.speedY; }; } var torqueToNewton = function(torque) { return torque * 1.36; } var calculateTorqueOutput = function(hp, RPM) { console.log("cTO:" + (hp * 5252) / RPM) return (hp * 5252) / RPM; } var velocity = function(kn_energy, mass) { var v = Math.sqrt(2*kn_energy/mass); return v; } var detectCollision = function(object1, object2) { object1.left = object1.x; object1.right = object1.x + object1.width; object1.bottom = object1.y object1.top = object1.y + object1.height; object2.left = object2.x; object2.right = object2.x + object2.width; object2.bottom = object2.y object2.top = object2.y + object2.height; } var updateGame = function() { game.clear(); if (window.key &amp;&amp; window.key == 83) { yourObject.speedX = -1; } if (window.key &amp;&amp; window.key == 87) { yourObject.RPM += 1; nm_s = torqueToNewton(calculateTorqueOutput(yourObject.hp, yourObject.RPM)); yourObject.speedX += velocity(nm_s, yourObject.weight)/10; yourObject.RPM /= (1/yourObject.gearRatios[yourObject.gear]); console.log(yourObject.speedX + ":" + yourObject.RPM + ":" + yourObject.gear); } else { if (yourObject.RPM &gt; 0 &amp;&amp; yourObject.speedX &gt; 0) { yourObject.RPM -= yourObject.speedX * (.25 / yourObject.speedX); yourObject.speedX -= .25; console.log(yourObject.speedX + ":" + yourObject.RPM + ":" + yourObject.gear); } else { yourObject.RPM = 0; yourObject.speedX = 0; } } if (window.key &amp;&amp; window.key == 38) {yourObject.speedY = -1; } if (window.key &amp;&amp; window.key == 39) {yourObject.speedY = 1; } yourObject.newPos(); yourObject.update(); </code></pre>
0debug
Insert an item in javascript object at perticular position : I have an object in javascript whose structure is like Comment : "Test" DefaultWt : "0" Label : "O" Wt : "1680" Aft: "0" lat : "0" lon: "0" Button : "false" position : "0" I want to add an element after button and before position. How to do it?
0debug
static void coroutine_fn bdrv_get_block_status_co_entry(void *opaque) { BdrvCoGetBlockStatusData *data = opaque; BlockDriverState *bs = data->bs; data->ret = bdrv_co_get_block_status(bs, data->sector_num, data->nb_sectors, data->pnum); data->done = true; }
1threat
Can someone please help translate this postgresql function from plpy to plsql : I have a function written in PL/Python. It is a database function that runs in Python, which is permitted because of a procedural language installed via: CREATE PROCEDURAL LANGUAGE 'plpythonu' HANDLER plpython_call_handler (I found a nice trick, to allow non-admin users permission to run, by using a unique name, though it has not much to do with my question, I'm sure some of you will wonder how I am doing this, so below is the answer) CREATE TRUSTED PROCEDURAL LANGUAGE 'plpythonu2' HANDLER plpython_call_handler GRANT USAGE ON LANGUAGE plpythonu2 TO admin; Now to the question at hand, my "hack" above works for me, but if I want to use Amazon's RDS service, I cannot install languages, and plpython is not available. SQL however, is. Therefore, I need help translating the following function, written in Python into pure SQL. CREATE OR REPLACE FUNCTION "public"."human_readable_bits" ( "b" bigint = 0 ) RETURNS varchar AS $body$ import math if b: exponent = math.floor(math.log(b)/math.log(1024)) val = b/pow(1024, math.floor(exponent)) val = round(val*2)/2 -- This rounds to the nearest HALF (X.5) B, Kb, Mb, Gb, etc. return "%.2f %s" % (val, ('B','Kb','Mb','Gb','Tb','Pb','Eb','Zb','Yb')[int(exponent)]) else: return "0 Gb" $body$ LANGUAGE 'plpythonu2' VOLATILE RETURNS NULL ON NULL INPUT SECURITY INVOKER COST 100; This function allows me to perform queries such as: => SELECT human_readable_bits(3285824466906); human_readable_bits --------------------- 3.00 Tb (1 row) OR => SELECT human_readable_bits(5920466906); human_readable_bits --------------------- 5.50 Gb (1 row) Also, as a side-note/secondary question, after I created the function, when I look at the DDL, it has a line in it that says "SECURITY INVOKER," does anyone know what that means/does?
0debug
im developing asp .net web api to use it in my adnroid app, : I'm developing restful webservice using asp.net web api to use it in my android app and here what I get when I run my api [ { "id": 41, "firstName": "ahmed", "lastName": "jallad", "gender": "male", "salary": 6000, "img": "C:\\Users\\ahmed\\Desktop\\hi.png" }, { "id": 46, "firstName": "ali", "lastName": "ali", "gender": "male ", "salary": 5000, "img": "C:\\Users\\ahmed\\Desktop\\hi.png" }, { "id": 47, "firstName": "wael", "lastName": "wael", "gender": "male", "salary": 6000, "img": "C:\\Users\\ahmed\\Desktop\\hi.png" }, { "id": 48, "firstName": "sara", "lastName": "sara", "gender": "female", "salary": 5000, "img": "C:\\Users\\ahmed\\Desktop\\hi.png" }, { "id": 49, "firstName": null, "lastName": null, "gender": null, "salary": null, "img": "C:\\Users\\ahmed\\Desktop\\hi.png" } ] I'm storing the path of the image in sql database, and here is .net code public HttpResponseMessage Get(string gender = "ALL") { using (EmployeeDBEntities entities = new EmployeeDBEntities()) { int a = 0; switch (gender.ToLower()) { case "all": return Request.CreateResponse(HttpStatusCode.OK, entities.Employees.ToList()); case "male": return Request.CreateResponse(HttpStatusCode.OK, entities.Employees.Where(e => e.Gender.ToLower() == "male").ToList()); case "female": return Request.CreateResponse(HttpStatusCode.OK, entities.Employees.Where(e => e.Gender.ToLower() == "female").ToList()); default: return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "value for gender must be Male, Femle or ALL. " + gender + " is not valid"); } } } my question is how can open the image from its path when I call from an android application thanks in advance
0debug
static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr) { CPUARMState *env = &cpu->env; uint32_t addr; armv7m_nvic_acknowledge_irq(env->nvic); write_v7m_control_spsel(env, 0); arm_clear_exclusive(env); env->condexec_bits = 0; env->regs[14] = lr; addr = arm_v7m_load_vector(cpu); env->regs[15] = addr & 0xfffffffe; env->thumb = addr & 1; }
1threat
How to run my Angular site on mobile device that is running localhost on my windows desktop : <p>I know from this question and answer on Super User <a href="https://superuser.com/questions/1193168/site-running-on-localhost-on-desktop-is-unreachable-on-android-device/">Site running on localhost on desktop is unreachable on android device</a> <em>(<strong>PS:</strong> this question continues on the question in the link)</em> that the command <code>ng serve</code> opens a bad configured webserver.</p> <p>The question is how could I run my site on an Android device without deploying my site. I'll try to run the site on this url <code>http://192.168.0.168:4200</code> using Angular-CLI.</p>
0debug
How to create an user-defined header file ? Hope , I would get that either in C/C++ : <p>I am an beginner in C++ language. I was able to understand the concept of header file , but facing the problem when i wanted to deal with them. I want to create a user-defined header files ? Expecting someone to show me a sample of it!</p> <p>Thanks in advance,</p>
0debug
java.util.ConcurrentModificationException in activity onCreate : <p>In a recent release where I added MoPub via Admob ad mediation I am seeing a bunch of ConcurrentModificationException in crash logs. It all seems to be native code and I am on the latest version of all ad related and google/android related libraries. Anyone run in to this before?</p> <pre><code>java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3121) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3264) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1955) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loop (Looper.java:214) at android.app.ActivityThread.main (ActivityThread.java:7078) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:964) Caused by: java.util.ConcurrentModificationException: at androidx.c.g.put (SimpleArrayMap.java:482) at com.google.android.gms.measurement.internal.hs.a at com.google.android.gms.measurement.internal.hi.onActivityCreated at android.app.Application.dispatchActivityCreated (Application.java:245) at android.app.Activity.onCreate (Activity.java:1108) at androidx.core.app.e.onCreate (ComponentActivity.java:81) at androidx.activity.b.onCreate (ComponentActivity.java:149) at androidx.fragment.app.c.onCreate (FragmentActivity.java:313) at androidx.appcompat.app.e.onCreate (AppCompatActivity.java:106) at com.teamtol.livedota.BaseActivity.onCreate (BaseActivity.java:21) at com.teamtol.livedota.RecentGameActivity.onCreate (RecentGameActivity.java:70) at android.app.Activity.performCreate (Activity.java:7327) at android.app.Activity.performCreate (Activity.java:7318) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1275) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3101) </code></pre> <p>This is what the code looks like up to line 21 of BaseActivity:</p> <pre><code>protected void onCreate(Bundle savedInstanceState) { supportRequestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); super.onCreate(savedInstanceState); </code></pre> <p>This is what the code looks like up to line 70 of RecentGameActivity</p> <pre><code>public class RecentGameActivity extends BaseActivity implements AdapterView.OnItemSelectedListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); </code></pre>
0debug
static inline int onenand_erase(OneNANDState *s, int sec, int num) { uint8_t *blankbuf, *tmpbuf; blankbuf = g_malloc(512); tmpbuf = g_malloc(512); memset(blankbuf, 0xff, 512); for (; num > 0; num--, sec++) { if (s->blk_cur) { int erasesec = s->secs_cur + (sec >> 5); if (blk_write(s->blk_cur, sec, blankbuf, 1) < 0) { goto fail; } if (blk_read(s->blk_cur, erasesec, tmpbuf, 1) < 0) { goto fail; } memcpy(tmpbuf + ((sec & 31) << 4), blankbuf, 1 << 4); if (blk_write(s->blk_cur, erasesec, tmpbuf, 1) < 0) { goto fail; } } else { if (sec + 1 > s->secs_cur) { goto fail; } memcpy(s->current + (sec << 9), blankbuf, 512); memcpy(s->current + (s->secs_cur << 9) + (sec << 4), blankbuf, 1 << 4); } } g_free(tmpbuf); g_free(blankbuf); return 0; fail: g_free(tmpbuf); g_free(blankbuf); return 1; }
1threat
static void t_gen_lz_i32(TCGv d, TCGv x) { TCGv y, m, n; y = tcg_temp_new(TCG_TYPE_I32); m = tcg_temp_new(TCG_TYPE_I32); n = tcg_temp_new(TCG_TYPE_I32); tcg_gen_shri_i32(y, x, 16); tcg_gen_neg_i32(y, y); tcg_gen_sari_i32(m, y, 16); tcg_gen_andi_i32(m, m, 16); tcg_gen_sub_i32(n, tcg_const_i32(16), m); tcg_gen_shr_i32(x, x, m); tcg_gen_subi_i32(y, x, 0x100); tcg_gen_sari_i32(m, y, 16); tcg_gen_andi_i32(m, m, 8); tcg_gen_add_i32(n, n, m); tcg_gen_shl_i32(x, x, m); tcg_gen_subi_i32(y, x, 0x1000); tcg_gen_sari_i32(m, y, 16); tcg_gen_andi_i32(m, m, 4); tcg_gen_add_i32(n, n, m); tcg_gen_shl_i32(x, x, m); tcg_gen_subi_i32(y, x, 0x4000); tcg_gen_sari_i32(m, y, 16); tcg_gen_andi_i32(m, m, 2); tcg_gen_add_i32(n, n, m); tcg_gen_shl_i32(x, x, m); tcg_gen_shri_i32(y, x, 14); tcg_gen_sari_i32(m, y, 1); tcg_gen_not_i32(m, m); tcg_gen_and_i32(m, m, y); tcg_gen_addi_i32(d, n, 2); tcg_gen_sub_i32(d, d, m); tcg_temp_free(y); tcg_temp_free(m); tcg_temp_free(n); }
1threat
Validate Date for eligibility above 18 year's : <p>I have used the following for date input</p> <pre><code>&lt;tr&gt; &lt;td&gt;Date of Birth :&lt;/td&gt; &lt;td&gt;&lt;input type="date" name="dob" required="required" /&gt;&lt;/td&gt; </code></pre> <p> </p> <p>I want to validate the Date of birth whether it's above 18 years or not. I have no idea how to code for that.</p>
0debug
How can I list a pivotfield with orientation xlColumnField in a specific custom order in c# : I pivot on a field Sport. Assume there are 4 sports (Tennis, Baseball, Softball, Football). When the pivot table is created I want the column labels to be displayed in a custom order. How can I do that in C#. [enter image description here][1] [1]: https://i.stack.imgur.com/QaId4.png
0debug
static int mkv_write_trailer(AVFormatContext *s) { MatroskaMuxContext *mkv = s->priv_data; AVIOContext *pb = s->pb; int64_t currentpos, cuespos; int ret; if (mkv->cur_audio_pkt.size > 0) { ret = mkv_write_packet_internal(s, &mkv->cur_audio_pkt); mkv->cur_audio_pkt.size = 0; if (ret < 0) { av_log(s, AV_LOG_ERROR, "Could not write cached audio packet ret:%d\n", ret); return ret; } } if (mkv->dyn_bc) { end_ebml_master(mkv->dyn_bc, mkv->cluster); mkv_flush_dynbuf(s); } else if (mkv->cluster_pos) { end_ebml_master(pb, mkv->cluster); } if (pb->seekable) { if (mkv->cues->num_entries) { cuespos = mkv_write_cues(pb, mkv->cues, s->nb_streams); ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES, cuespos); if (ret < 0) return ret; } mkv_write_seekhead(pb, mkv->main_seekhead); av_log(s, AV_LOG_DEBUG, "end duration = %" PRIu64 "\n", mkv->duration); currentpos = avio_tell(pb); avio_seek(pb, mkv->duration_offset, SEEK_SET); put_ebml_float(pb, MATROSKA_ID_DURATION, mkv->duration); avio_seek(pb, currentpos, SEEK_SET); } end_ebml_master(pb, mkv->segment); av_free(mkv->tracks); av_freep(&mkv->cues->entries); av_freep(&mkv->cues); av_destruct_packet(&mkv->cur_audio_pkt); avio_flush(pb); return 0; }
1threat
Using (:send) in Ruby with keyword arguments? : <p>I have a private method that I am trying to use #send to in Ruby to do some testing. The method is complicated and I don't want exposed outside of the class and so I want to test the method but I also don't need to list it as a public method. It has keyword arguments. How can I use <code>send</code> to call the method but also pass it keyword arguments/named parameters? Is there a way?</p> <p>The method looks like this:</p> <p><code>def some_method(keyword_arg1:, keyword_arg2:, keyword_arg3: nil)</code></p>
0debug
i keep getting an expected ; error and i'm not sure as to why : <p>i finish writing my code and i am unable to figure out why i am getting an expected ; error </p> <p>i tried adding the ; where it expects me too but it kicks back other errors instead</p> <p>here is my code </p> <pre><code>int main() { int* expandArray(int *arr, int SIZE) { //this is the error line //dynamically allocate an array twice the size int *expPtr = new int[2 * SIZE]; //initialize elements of new array for (int i = 0; i &lt; 2 * SIZE; i++) { //first add elements of old array if (i &lt; SIZE) { *(expPtr + i) = *(arr + i); } //all next elements should be 0 else { *(expPtr + i) = 0; } } return expPtr; } </code></pre> <p>}</p>
0debug
static void avc_loopfilter_luma_intra_edge_ver_msa(uint8_t *data, uint8_t alpha_in, uint8_t beta_in, uint32_t img_width) { uint8_t *src; v16u8 alpha, beta, p0_asub_q0; v16u8 is_less_than_alpha, is_less_than; v16u8 is_less_than_beta, negate_is_less_than_beta; v8i16 p2_r = { 0 }; v8i16 p1_r = { 0 }; v8i16 p0_r = { 0 }; v8i16 q0_r = { 0 }; v8i16 q1_r = { 0 }; v8i16 q2_r = { 0 }; v8i16 p2_l = { 0 }; v8i16 p1_l = { 0 }; v8i16 p0_l = { 0 }; v8i16 q0_l = { 0 }; v8i16 q1_l = { 0 }; v8i16 q2_l = { 0 }; v16u8 p3_org, p2_org, p1_org, p0_org, q0_org, q1_org, q2_org, q3_org; v8i16 p1_org_r, p0_org_r, q0_org_r, q1_org_r; v8i16 p1_org_l, p0_org_l, q0_org_l, q1_org_l; v16i8 zero = { 0 }; v16u8 tmp_flag; src = data - 4; { v16u8 row0, row1, row2, row3, row4, row5, row6, row7; v16u8 row8, row9, row10, row11, row12, row13, row14, row15; LOAD_8VECS_UB(src, img_width, row0, row1, row2, row3, row4, row5, row6, row7); LOAD_8VECS_UB(src + (8 * img_width), img_width, row8, row9, row10, row11, row12, row13, row14, row15); TRANSPOSE16x8_B_UB(row0, row1, row2, row3, row4, row5, row6, row7, row8, row9, row10, row11, row12, row13, row14, row15, p3_org, p2_org, p1_org, p0_org, q0_org, q1_org, q2_org, q3_org); } p1_org_r = (v8i16) __msa_ilvr_b(zero, (v16i8) p1_org); p0_org_r = (v8i16) __msa_ilvr_b(zero, (v16i8) p0_org); q0_org_r = (v8i16) __msa_ilvr_b(zero, (v16i8) q0_org); q1_org_r = (v8i16) __msa_ilvr_b(zero, (v16i8) q1_org); p1_org_l = (v8i16) __msa_ilvl_b(zero, (v16i8) p1_org); p0_org_l = (v8i16) __msa_ilvl_b(zero, (v16i8) p0_org); q0_org_l = (v8i16) __msa_ilvl_b(zero, (v16i8) q0_org); q1_org_l = (v8i16) __msa_ilvl_b(zero, (v16i8) q1_org); { v16u8 p1_asub_p0, q1_asub_q0; p0_asub_q0 = __msa_asub_u_b(p0_org, q0_org); p1_asub_p0 = __msa_asub_u_b(p1_org, p0_org); q1_asub_q0 = __msa_asub_u_b(q1_org, q0_org); alpha = (v16u8) __msa_fill_b(alpha_in); beta = (v16u8) __msa_fill_b(beta_in); is_less_than_alpha = (p0_asub_q0 < alpha); is_less_than_beta = (p1_asub_p0 < beta); is_less_than = is_less_than_beta & is_less_than_alpha; is_less_than_beta = (q1_asub_q0 < beta); is_less_than = is_less_than_beta & is_less_than; } if (!__msa_test_bz_v(is_less_than)) { tmp_flag = alpha >> 2; tmp_flag = tmp_flag + 2; tmp_flag = (p0_asub_q0 < tmp_flag); { v16u8 p2_asub_p0; p2_asub_p0 = __msa_asub_u_b(p2_org, p0_org); is_less_than_beta = (p2_asub_p0 < beta); } is_less_than_beta = tmp_flag & is_less_than_beta; negate_is_less_than_beta = __msa_xori_b(is_less_than_beta, 0xff); is_less_than_beta = is_less_than_beta & is_less_than; negate_is_less_than_beta = negate_is_less_than_beta & is_less_than; { v16u8 is_less_than_beta_r; is_less_than_beta_r = (v16u8) __msa_sldi_b((v16i8) is_less_than_beta, zero, 8); if (!__msa_test_bz_v(is_less_than_beta_r)) { v8i16 p3_org_r; p3_org_r = (v8i16) __msa_ilvr_b(zero, (v16i8) p3_org); p2_r = (v8i16) __msa_ilvr_b(zero, (v16i8) p2_org); AVC_LOOP_FILTER_P0P1P2_OR_Q0Q1Q2(p3_org_r, p0_org_r, q0_org_r, p1_org_r, p2_r, q1_org_r, p0_r, p1_r, p2_r); } } { v16u8 is_less_than_beta_l; is_less_than_beta_l = (v16u8) __msa_sldi_b(zero, (v16i8) is_less_than_beta, 8); if (!__msa_test_bz_v(is_less_than_beta_l)) { v8i16 p3_org_l; p3_org_l = (v8i16) __msa_ilvl_b(zero, (v16i8) p3_org); p2_l = (v8i16) __msa_ilvl_b(zero, (v16i8) p2_org); AVC_LOOP_FILTER_P0P1P2_OR_Q0Q1Q2(p3_org_l, p0_org_l, q0_org_l, p1_org_l, p2_l, q1_org_l, p0_l, p1_l, p2_l); } } if (!__msa_test_bz_v(is_less_than_beta)) { v16u8 p0, p2, p1; p0 = (v16u8) __msa_pckev_b((v16i8) p0_l, (v16i8) p0_r); p1 = (v16u8) __msa_pckev_b((v16i8) p1_l, (v16i8) p1_r); p2 = (v16u8) __msa_pckev_b((v16i8) p2_l, (v16i8) p2_r); p0_org = __msa_bmnz_v(p0_org, p0, is_less_than_beta); p1_org = __msa_bmnz_v(p1_org, p1, is_less_than_beta); p2_org = __msa_bmnz_v(p2_org, p2, is_less_than_beta); } { v16u8 negate_is_less_than_beta_r; negate_is_less_than_beta_r = (v16u8) __msa_sldi_b((v16i8) negate_is_less_than_beta, zero, 8); if (!__msa_test_bz_v(negate_is_less_than_beta_r)) { AVC_LOOP_FILTER_P0_OR_Q0(p0_org_r, q1_org_r, p1_org_r, p0_r); } } { v16u8 negate_is_less_than_beta_l; negate_is_less_than_beta_l = (v16u8) __msa_sldi_b(zero, (v16i8) negate_is_less_than_beta, 8); if (!__msa_test_bz_v(negate_is_less_than_beta_l)) { AVC_LOOP_FILTER_P0_OR_Q0(p0_org_l, q1_org_l, p1_org_l, p0_l); } } if (!__msa_test_bz_v(negate_is_less_than_beta)) { v16u8 p0; p0 = (v16u8) __msa_pckev_b((v16i8) p0_l, (v16i8) p0_r); p0_org = __msa_bmnz_v(p0_org, p0, negate_is_less_than_beta); } { v16u8 q2_asub_q0; q2_asub_q0 = __msa_asub_u_b(q2_org, q0_org); is_less_than_beta = (q2_asub_q0 < beta); } is_less_than_beta = is_less_than_beta & tmp_flag; negate_is_less_than_beta = __msa_xori_b(is_less_than_beta, 0xff); is_less_than_beta = is_less_than_beta & is_less_than; negate_is_less_than_beta = negate_is_less_than_beta & is_less_than; { v16u8 is_less_than_beta_r; is_less_than_beta_r = (v16u8) __msa_sldi_b((v16i8) is_less_than_beta, zero, 8); if (!__msa_test_bz_v(is_less_than_beta_r)) { v8i16 q3_org_r; q3_org_r = (v8i16) __msa_ilvr_b(zero, (v16i8) q3_org); q2_r = (v8i16) __msa_ilvr_b(zero, (v16i8) q2_org); AVC_LOOP_FILTER_P0P1P2_OR_Q0Q1Q2(q3_org_r, q0_org_r, p0_org_r, q1_org_r, q2_r, p1_org_r, q0_r, q1_r, q2_r); } } { v16u8 is_less_than_beta_l; is_less_than_beta_l = (v16u8) __msa_sldi_b(zero, (v16i8) is_less_than_beta, 8); if (!__msa_test_bz_v(is_less_than_beta_l)) { v8i16 q3_org_l; q3_org_l = (v8i16) __msa_ilvl_b(zero, (v16i8) q3_org); q2_l = (v8i16) __msa_ilvl_b(zero, (v16i8) q2_org); AVC_LOOP_FILTER_P0P1P2_OR_Q0Q1Q2(q3_org_l, q0_org_l, p0_org_l, q1_org_l, q2_l, p1_org_l, q0_l, q1_l, q2_l); } } if (!__msa_test_bz_v(is_less_than_beta)) { v16u8 q0, q1, q2; q0 = (v16u8) __msa_pckev_b((v16i8) q0_l, (v16i8) q0_r); q1 = (v16u8) __msa_pckev_b((v16i8) q1_l, (v16i8) q1_r); q2 = (v16u8) __msa_pckev_b((v16i8) q2_l, (v16i8) q2_r); q0_org = __msa_bmnz_v(q0_org, q0, is_less_than_beta); q1_org = __msa_bmnz_v(q1_org, q1, is_less_than_beta); q2_org = __msa_bmnz_v(q2_org, q2, is_less_than_beta); } { v16u8 negate_is_less_than_beta_r; negate_is_less_than_beta_r = (v16u8) __msa_sldi_b((v16i8) negate_is_less_than_beta, zero, 8); if (!__msa_test_bz_v(negate_is_less_than_beta_r)) { AVC_LOOP_FILTER_P0_OR_Q0(q0_org_r, p1_org_r, q1_org_r, q0_r); } } { v16u8 negate_is_less_than_beta_l; negate_is_less_than_beta_l = (v16u8) __msa_sldi_b(zero, (v16i8) negate_is_less_than_beta, 8); if (!__msa_test_bz_v(negate_is_less_than_beta_l)) { AVC_LOOP_FILTER_P0_OR_Q0(q0_org_l, p1_org_l, q1_org_l, q0_l); } } if (!__msa_test_bz_v(negate_is_less_than_beta)) { v16u8 q0; q0 = (v16u8) __msa_pckev_b((v16i8) q0_l, (v16i8) q0_r); q0_org = __msa_bmnz_v(q0_org, q0, negate_is_less_than_beta); } } { v16u8 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; uint32_t out0, out2; uint16_t out1, out3; tmp0 = (v16u8) __msa_ilvr_b((v16i8) p1_org, (v16i8) p2_org); tmp1 = (v16u8) __msa_ilvr_b((v16i8) q0_org, (v16i8) p0_org); tmp2 = (v16u8) __msa_ilvr_b((v16i8) q2_org, (v16i8) q1_org); tmp3 = (v16u8) __msa_ilvr_h((v8i16) tmp1, (v8i16) tmp0); tmp4 = (v16u8) __msa_ilvl_h((v8i16) tmp1, (v8i16) tmp0); tmp0 = (v16u8) __msa_ilvl_b((v16i8) p1_org, (v16i8) p2_org); tmp1 = (v16u8) __msa_ilvl_b((v16i8) q0_org, (v16i8) p0_org); tmp5 = (v16u8) __msa_ilvl_b((v16i8) q2_org, (v16i8) q1_org); tmp6 = (v16u8) __msa_ilvr_h((v8i16) tmp1, (v8i16) tmp0); tmp7 = (v16u8) __msa_ilvl_h((v8i16) tmp1, (v8i16) tmp0); src = data - 3; out0 = __msa_copy_u_w((v4i32) tmp3, 0); out1 = __msa_copy_u_h((v8i16) tmp2, 0); out2 = __msa_copy_u_w((v4i32) tmp3, 1); out3 = __msa_copy_u_h((v8i16) tmp2, 1); STORE_WORD(src, out0); STORE_HWORD((src + 4), out1); src += img_width; STORE_WORD(src, out2); STORE_HWORD((src + 4), out3); out0 = __msa_copy_u_w((v4i32) tmp3, 2); out1 = __msa_copy_u_h((v8i16) tmp2, 2); out2 = __msa_copy_u_w((v4i32) tmp3, 3); out3 = __msa_copy_u_h((v8i16) tmp2, 3); src += img_width; STORE_WORD(src, out0); STORE_HWORD((src + 4), out1); src += img_width; STORE_WORD(src, out2); STORE_HWORD((src + 4), out3); out0 = __msa_copy_u_w((v4i32) tmp4, 0); out1 = __msa_copy_u_h((v8i16) tmp2, 4); out2 = __msa_copy_u_w((v4i32) tmp4, 1); out3 = __msa_copy_u_h((v8i16) tmp2, 5); src += img_width; STORE_WORD(src, out0); STORE_HWORD((src + 4), out1); src += img_width; STORE_WORD(src, out2); STORE_HWORD((src + 4), out3); out0 = __msa_copy_u_w((v4i32) tmp4, 2); out1 = __msa_copy_u_h((v8i16) tmp2, 6); out2 = __msa_copy_u_w((v4i32) tmp4, 3); out3 = __msa_copy_u_h((v8i16) tmp2, 7); src += img_width; STORE_WORD(src, out0); STORE_HWORD((src + 4), out1); src += img_width; STORE_WORD(src, out2); STORE_HWORD((src + 4), out3); out0 = __msa_copy_u_w((v4i32) tmp6, 0); out1 = __msa_copy_u_h((v8i16) tmp5, 0); out2 = __msa_copy_u_w((v4i32) tmp6, 1); out3 = __msa_copy_u_h((v8i16) tmp5, 1); src += img_width; STORE_WORD(src, out0); STORE_HWORD((src + 4), out1); src += img_width; STORE_WORD(src, out2); STORE_HWORD((src + 4), out3); out0 = __msa_copy_u_w((v4i32) tmp6, 2); out1 = __msa_copy_u_h((v8i16) tmp5, 2); out2 = __msa_copy_u_w((v4i32) tmp6, 3); out3 = __msa_copy_u_h((v8i16) tmp5, 3); src += img_width; STORE_WORD(src, out0); STORE_HWORD((src + 4), out1); src += img_width; STORE_WORD(src, out2); STORE_HWORD((src + 4), out3); out0 = __msa_copy_u_w((v4i32) tmp7, 0); out1 = __msa_copy_u_h((v8i16) tmp5, 4); out2 = __msa_copy_u_w((v4i32) tmp7, 1); out3 = __msa_copy_u_h((v8i16) tmp5, 5); src += img_width; STORE_WORD(src, out0); STORE_HWORD((src + 4), out1); src += img_width; STORE_WORD(src, out2); STORE_HWORD((src + 4), out3); out0 = __msa_copy_u_w((v4i32) tmp7, 2); out1 = __msa_copy_u_h((v8i16) tmp5, 6); out2 = __msa_copy_u_w((v4i32) tmp7, 3); out3 = __msa_copy_u_h((v8i16) tmp5, 7); src += img_width; STORE_WORD(src, out0); STORE_HWORD((src + 4), out1); src += img_width; STORE_WORD(src, out2); STORE_HWORD((src + 4), out3); } }
1threat
string literal doesn't close properly in Java : <p>Why this doesn't work in Java?</p> <pre><code>driver.findElement(By.xpath("//*[@id='mm-0']/div[1]/div/div/div/div[5]/div[1]/div/div[1]/div/div/form/fieldset/div[1]/span/span/input')).click(); </code></pre> <p>this won't have problem in javascript. </p>
0debug
Javascript IIFE - back door? : <p>There anyone try or know how to get acces to variable in anonymous function??</p> <p>Example</p> <pre><code>var test = "Hi"; (function() { var test = "Bye"; // Outputs "Bye" console.log(test); })(); // Outputs "Hi" console.log(test); </code></pre> <p>As you can see last log return "Hi" but i want to get "Bye" anyone know way to get value "Bye" in this example ??</p>
0debug
static void qcow2_invalidate_cache(BlockDriverState *bs, Error **errp) { BDRVQcowState *s = bs->opaque; int flags = s->flags; AES_KEY aes_encrypt_key; AES_KEY aes_decrypt_key; uint32_t crypt_method = 0; QDict *options; Error *local_err = NULL; int ret; if (s->crypt_method) { crypt_method = s->crypt_method; memcpy(&aes_encrypt_key, &s->aes_encrypt_key, sizeof(aes_encrypt_key)); memcpy(&aes_decrypt_key, &s->aes_decrypt_key, sizeof(aes_decrypt_key)); } qcow2_close(bs); bdrv_invalidate_cache(bs->file, &local_err); if (local_err) { error_propagate(errp, local_err); return; } memset(s, 0, sizeof(BDRVQcowState)); options = qdict_clone_shallow(bs->options); ret = qcow2_open(bs, options, flags, &local_err); QDECREF(options); if (local_err) { error_setg(errp, "Could not reopen qcow2 layer: %s", error_get_pretty(local_err)); error_free(local_err); return; } else if (ret < 0) { error_setg_errno(errp, -ret, "Could not reopen qcow2 layer"); return; } if (crypt_method) { s->crypt_method = crypt_method; memcpy(&s->aes_encrypt_key, &aes_encrypt_key, sizeof(aes_encrypt_key)); memcpy(&s->aes_decrypt_key, &aes_decrypt_key, sizeof(aes_decrypt_key)); } }
1threat
static void qcow2_invalidate_cache(BlockDriverState *bs, Error **errp) { BDRVQcow2State *s = bs->opaque; int flags = s->flags; QCryptoCipher *cipher = NULL; QDict *options; Error *local_err = NULL; int ret; cipher = s->cipher; s->cipher = NULL; qcow2_close(bs); bdrv_invalidate_cache(bs->file->bs, &local_err); if (local_err) { error_propagate(errp, local_err); bs->drv = NULL; return; } memset(s, 0, sizeof(BDRVQcow2State)); options = qdict_clone_shallow(bs->options); flags &= ~BDRV_O_INACTIVE; ret = qcow2_open(bs, options, flags, &local_err); QDECREF(options); if (local_err) { error_propagate(errp, local_err); error_prepend(errp, "Could not reopen qcow2 layer: "); bs->drv = NULL; return; } else if (ret < 0) { error_setg_errno(errp, -ret, "Could not reopen qcow2 layer"); bs->drv = NULL; return; } s->cipher = cipher; }
1threat
What do those statements mean to do? : <p>I was going through a Python script, and I couldn't understand very well this portion of the code. The first part of the code portion are the following declarations:</p> <pre><code>image_paths = [] image_classes = [] class_id = 0 </code></pre> <p>Those declarations are clear so far.</p> <p>Then it enters a for-loop, in which I couldn't understand this part:</p> <pre><code>image_classes+=[class_id]*len(class_path) class_id+=1 </code></pre> <p>What could be the meaning of this code portion?</p> <p>Thanks.</p>
0debug
static void new_connection(int server_fd, int is_rtsp) { struct sockaddr_in from_addr; int fd, len; HTTPContext *c = NULL; len = sizeof(from_addr); fd = accept(server_fd, (struct sockaddr *)&from_addr, &len); if (fd < 0) return; fcntl(fd, F_SETFL, O_NONBLOCK); if (nb_connections >= nb_max_connections) goto fail; c = av_mallocz(sizeof(HTTPContext)); if (!c) goto fail; c->next = first_http_ctx; first_http_ctx = c; c->fd = fd; c->poll_entry = NULL; c->from_addr = from_addr; c->buffer_size = IOBUFFER_INIT_SIZE; c->buffer = av_malloc(c->buffer_size); if (!c->buffer) goto fail; nb_connections++; start_wait_request(c, is_rtsp); return; fail: if (c) { av_free(c->buffer); av_free(c); } close(fd); }
1threat
could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[...] : <p>I am trying to write some use cases for Apache Flink. One error I run into pretty often is</p> <pre><code>could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[SomeType] </code></pre> <p>My problem is that I cant really nail down when they happen and when they dont.</p> <p>The most recent example of this would be the following</p> <pre><code>... val largeJoinDataGen = new LargeJoinDataGen(dataSetSize, dataGen, hitRatio) val see = StreamExecutionEnvironment.getExecutionEnvironment val newStreamInput = see.addSource(largeJoinDataGen) ... </code></pre> <p>where <code>LargeJoinDataGen extends GeneratorSource[(Int, String)]</code> and <code>GeneratorSource[T] extends SourceFunction[T]</code>, both defined in separate files.</p> <p>When trying to build this I get</p> <pre><code>Error:(22, 39) could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[(Int, String)] val newStreamInput = see.addSource(largeJoinDataGen) </code></pre> <p><strong>1. Why is there an error in the given example?</strong></p> <p><strong>2. What would be a general guideline when these errors happen and how to avoid them in the future?</strong></p> <p>P.S.: first scala project and first flink project so please be patient</p>
0debug
static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum, BlockDriverState **file) { BDRVRawState *s = bs->opaque; *pnum = nb_sectors; *file = bs->file->bs; sector_num += s->offset / BDRV_SECTOR_SIZE; return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA | (sector_num << BDRV_SECTOR_BITS); }
1threat
static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) { IscsiLun *iscsilun = bs->opaque; bdi->unallocated_blocks_are_zero = !!iscsilun->lbprz; bdi->can_write_zeroes_with_unmap = iscsilun->lbprz && iscsilun->lbp.lbpws; if (iscsilun->bl.opt_unmap_gran * iscsilun->block_size >= 64 * 1024 && iscsilun->bl.opt_unmap_gran * iscsilun->block_size <= 16 * 1024 * 1024) { bdi->cluster_size = iscsilun->bl.opt_unmap_gran * iscsilun->block_size; } return 0; }
1threat
static int vnc_continue_handshake(struct VncState *vs) { int ret; if ((ret = gnutls_handshake(vs->tls_session)) < 0) { if (!gnutls_error_is_fatal(ret)) { VNC_DEBUG("Handshake interrupted (blocking)\n"); if (!gnutls_record_get_direction(vs->tls_session)) qemu_set_fd_handler(vs->csock, vnc_handshake_io, NULL, vs); else qemu_set_fd_handler(vs->csock, NULL, vnc_handshake_io, vs); return 0; } VNC_DEBUG("Handshake failed %s\n", gnutls_strerror(ret)); vnc_client_error(vs); return -1; } if (vs->vd->x509verify) { if (vnc_validate_certificate(vs) < 0) { VNC_DEBUG("Client verification failed\n"); vnc_client_error(vs); return -1; } else { VNC_DEBUG("Client verification passed\n"); } } VNC_DEBUG("Handshake done, switching to TLS data mode\n"); vs->wiremode = VNC_WIREMODE_TLS; qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, vnc_client_write, vs); return start_auth_vencrypt_subauth(vs); }
1threat
Firefox rendering my images as the wrong color - but fine in other browsers : <p>I have built a website however I am having problems with the png's in firefox as it is rendering the images as the wrong color. When I inspect the element in dev tool on firefox the images display as the right color which is what I don't understand.</p> <p>Could someone help </p> <p>www.forestroad.co.uk</p>
0debug
Trying to make a point to point calculator. Unsupported operand types? : <p>Im trying to make a program which calculates the distance between two user inputted points. How can I fix this so that it works? So far I have this</p> <pre><code>import math p1 = [int(input("PLease enter point 1x\n")), (input("Please enter point 1y\n"))] p2 = [int(input("PLease enter point 2x\n")), (input("Please enter point 2y\n"))] distance = math.sqrt( ((p1[0]-p2[0])**2)+((p1[1]-p2[1])**2) ) print(distance) </code></pre> <p>The error that it spits out at me is: TypeError: unsupported operand type(s) for -: 'str' and 'str'</p> <p>Am I going about this in the right way at all?</p>
0debug