problem
stringlengths
26
131k
labels
class label
2 classes
Angular. Is there a way to skip enter animation on initial render? : <p><code>:enter</code> animation is applied to an element when component is rendered the first time. Is there a way to prevent it?</p> <p>Check <a href="https://plnkr.co/edit/ALlR9FhOn9N96WYlySKp?p=preview" rel="noreferrer">this plunker</a> for simple example of <code>width</code> animation:</p> <pre class="lang-ts prettyprint-override"><code>transition(':enter', [ style({width: 0}), animate(250, style({width: '*'})), ]), </code></pre>
0debug
Convert OptionalDouble to Optional <java.lang.Double> : <p>I have a method that builds a list and I want it to return the average of the list as an Optional value.</p> <p>However, when I calculate the average value using Java 8, I always get the return value as an OptionalDouble.</p> <p>How do I convert </p> <pre><code>OptionalDouble to Optional&lt;Double&gt;? </code></pre> <p>Below are my code for average calculation:</p> <pre><code>private static Optional&lt;Double&gt; averageListValue() { // Build list List&lt;Double&gt; testList = new ArrayList&lt;&gt;(); testList.add(...); ... ... return testList.stream().mapToDouble(value -&gt; value).average(); } </code></pre> <p>Thanks.</p>
0debug
static void decode_b(AVCodecContext *ctx, int row, int col, struct VP9Filter *lflvl, ptrdiff_t yoff, ptrdiff_t uvoff, enum BlockLevel bl, enum BlockPartition bp) { VP9Context *s = ctx->priv_data; VP9Block *b = s->b; enum BlockSize bs = bl * 3 + bp; int bytesperpixel = s->bytesperpixel; int w4 = bwh_tab[1][bs][0], h4 = bwh_tab[1][bs][1], lvl; int emu[2]; AVFrame *f = s->frames[CUR_FRAME].tf.f; s->row = row; s->row7 = row & 7; s->col = col; s->col7 = col & 7; s->min_mv.x = -(128 + col * 64); s->min_mv.y = -(128 + row * 64); s->max_mv.x = 128 + (s->cols - col - w4) * 64; s->max_mv.y = 128 + (s->rows - row - h4) * 64; if (s->pass < 2) { b->bs = bs; b->bl = bl; b->bp = bp; decode_mode(ctx); b->uvtx = b->tx - ((s->ss_h && w4 * 2 == (1 << b->tx)) || (s->ss_v && h4 * 2 == (1 << b->tx))); if (!b->skip) { int has_coeffs; if (bytesperpixel == 1) { has_coeffs = decode_coeffs_8bpp(ctx); } else { has_coeffs = decode_coeffs_16bpp(ctx); } if (!has_coeffs && b->bs <= BS_8x8 && !b->intra) { b->skip = 1; memset(&s->above_skip_ctx[col], 1, w4); memset(&s->left_skip_ctx[s->row7], 1, h4); } } else { int row7 = s->row7; #define SPLAT_ZERO_CTX(v, n) \ switch (n) { \ case 1: v = 0; break; \ case 2: AV_ZERO16(&v); break; \ case 4: AV_ZERO32(&v); break; \ case 8: AV_ZERO64(&v); break; \ case 16: AV_ZERO128(&v); break; \ } #define SPLAT_ZERO_YUV(dir, var, off, n, dir2) \ do { \ SPLAT_ZERO_CTX(s->dir##_y_##var[off * 2], n * 2); \ if (s->ss_##dir2) { \ SPLAT_ZERO_CTX(s->dir##_uv_##var[0][off], n); \ SPLAT_ZERO_CTX(s->dir##_uv_##var[1][off], n); \ } else { \ SPLAT_ZERO_CTX(s->dir##_uv_##var[0][off * 2], n * 2); \ SPLAT_ZERO_CTX(s->dir##_uv_##var[1][off * 2], n * 2); \ } \ } while (0) switch (w4) { case 1: SPLAT_ZERO_YUV(above, nnz_ctx, col, 1, h); break; case 2: SPLAT_ZERO_YUV(above, nnz_ctx, col, 2, h); break; case 4: SPLAT_ZERO_YUV(above, nnz_ctx, col, 4, h); break; case 8: SPLAT_ZERO_YUV(above, nnz_ctx, col, 8, h); break; } switch (h4) { case 1: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 1, v); break; case 2: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 2, v); break; case 4: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 4, v); break; case 8: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 8, v); break; } } if (s->pass == 1) { s->b++; s->block += w4 * h4 * 64 * bytesperpixel; s->uvblock[0] += w4 * h4 * 64 * bytesperpixel >> (s->ss_h + s->ss_v); s->uvblock[1] += w4 * h4 * 64 * bytesperpixel >> (s->ss_h + s->ss_v); s->eob += 4 * w4 * h4; s->uveob[0] += 4 * w4 * h4 >> (s->ss_h + s->ss_v); s->uveob[1] += 4 * w4 * h4 >> (s->ss_h + s->ss_v); return; } } emu[0] = (col + w4) * 8 > f->linesize[0] || (row + h4) > s->rows; emu[1] = (col + w4) * 4 > f->linesize[1] || (row + h4) > s->rows; if (emu[0]) { s->dst[0] = s->tmp_y; s->y_stride = 128; } else { s->dst[0] = f->data[0] + yoff; s->y_stride = f->linesize[0]; } if (emu[1]) { s->dst[1] = s->tmp_uv[0]; s->dst[2] = s->tmp_uv[1]; s->uv_stride = 128; } else { s->dst[1] = f->data[1] + uvoff; s->dst[2] = f->data[2] + uvoff; s->uv_stride = f->linesize[1]; } if (b->intra) { if (s->bpp > 8) { intra_recon_16bpp(ctx, yoff, uvoff); } else { intra_recon_8bpp(ctx, yoff, uvoff); } } else { if (s->bpp > 8) { inter_recon_16bpp(ctx); } else { inter_recon_8bpp(ctx); } } if (emu[0]) { int w = FFMIN(s->cols - col, w4) * 8, h = FFMIN(s->rows - row, h4) * 8, n, o = 0; for (n = 0; o < w; n++) { int bw = 64 >> n; av_assert2(n <= 4); if (w & bw) { s->dsp.mc[n][0][0][0][0](f->data[0] + yoff + o * bytesperpixel, f->linesize[0], s->tmp_y + o * bytesperpixel, 128, h, 0, 0); o += bw; } } } if (emu[1]) { int w = FFMIN(s->cols - col, w4) * 8 >> s->ss_h; int h = FFMIN(s->rows - row, h4) * 8 >> s->ss_v, n, o = 0; for (n = s->ss_h; o < w; n++) { int bw = 64 >> n; av_assert2(n <= 4); if (w & bw) { s->dsp.mc[n][0][0][0][0](f->data[1] + uvoff + o * bytesperpixel, f->linesize[1], s->tmp_uv[0] + o * bytesperpixel, 128, h, 0, 0); s->dsp.mc[n][0][0][0][0](f->data[2] + uvoff + o * bytesperpixel, f->linesize[2], s->tmp_uv[1] + o * bytesperpixel, 128, h, 0, 0); o += bw; } } } if (s->filter.level && (lvl = s->segmentation.feat[b->seg_id].lflvl[b->intra ? 0 : b->ref[0] + 1] [b->mode[3] != ZEROMV]) > 0) { int x_end = FFMIN(s->cols - col, w4), y_end = FFMIN(s->rows - row, h4); int skip_inter = !b->intra && b->skip, col7 = s->col7, row7 = s->row7; setctx_2d(&lflvl->level[row7 * 8 + col7], w4, h4, 8, lvl); mask_edges(lflvl->mask[0], 0, 0, row7, col7, x_end, y_end, 0, 0, b->tx, skip_inter); if (s->ss_h || s->ss_v) mask_edges(lflvl->mask[1], s->ss_h, s->ss_v, row7, col7, x_end, y_end, s->cols & 1 && col + w4 >= s->cols ? s->cols & 7 : 0, s->rows & 1 && row + h4 >= s->rows ? s->rows & 7 : 0, b->uvtx, skip_inter); if (!s->filter.lim_lut[lvl]) { int sharp = s->filter.sharpness; int limit = lvl; if (sharp > 0) { limit >>= (sharp + 3) >> 2; limit = FFMIN(limit, 9 - sharp); } limit = FFMAX(limit, 1); s->filter.lim_lut[lvl] = limit; s->filter.mblim_lut[lvl] = 2 * (lvl + 2) + limit; } } if (s->pass == 2) { s->b++; s->block += w4 * h4 * 64 * bytesperpixel; s->uvblock[0] += w4 * h4 * 64 * bytesperpixel >> (s->ss_v + s->ss_h); s->uvblock[1] += w4 * h4 * 64 * bytesperpixel >> (s->ss_v + s->ss_h); s->eob += 4 * w4 * h4; s->uveob[0] += 4 * w4 * h4 >> (s->ss_v + s->ss_h); s->uveob[1] += 4 * w4 * h4 >> (s->ss_v + s->ss_h); } }
1threat
Why the array is undefined? : <p>In following code snippet why I see undefined logged?However if I separate call to range method and store in some local variable then perform <code>foreach</code> ,it works fine.</p> <pre><code> var range = function (max) { var result = []; var index; for (index = 0; index &lt;= max; index = index + 1) { result.push(index); } return result; }; var arr= range(100).forEach(function (number, index,array) { if (number % 3 == 0) { array[index] = "c"; } }); console.log(arr); </code></pre>
0debug
Boolean not inheriting : <p>I created a boolean method in a super class, but when I call on that method to use it in the sub class, it is giving me a type mismatch error saying it can't convert a boolean to A. I'm probably missing something minor, but is there another way to use the method in an inherited class? </p> <pre><code>public class A{ public boolean Proper(String expression){ //body of method that determines if an expression is proper return true; } } public class B extends A { static BalancedExpressions Proper = new BalancedExpressions(); public static void main(String[] args) { try { Scanner scanner = new Scanner(new File("src/Expressions.txt")); FileWriter output = new FileWriter(new File("Output.txt")); while (scanner.hasNextLine()) { String nextLine = scanner.nextLine(); output.write(nextLine + "\t"); //following line is giving the error if(Proper = true) { output.write("proper" + "\n"); } else { output.write("improper" + "\n"); } scanner.close(); output.close(); } } catch (FileNotFoundException e) { e.printStackTrace(); } }//end main } </code></pre>
0debug
static av_cold int raw_init_decoder(AVCodecContext *avctx) { RawVideoContext *context = avctx->priv_data; const AVPixFmtDescriptor *desc; ff_bswapdsp_init(&context->bbdsp); if ( avctx->codec_tag == MKTAG('r','a','w',' ') || avctx->codec_tag == MKTAG('N','O','1','6')) avctx->pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_mov, avctx->bits_per_coded_sample); else if (avctx->codec_tag == MKTAG('W', 'R', 'A', 'W')) avctx->pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_avi, avctx->bits_per_coded_sample); else if (avctx->codec_tag && (avctx->codec_tag & 0xFFFFFF) != MKTAG('B','I','T', 0)) avctx->pix_fmt = avpriv_find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag); else if (avctx->pix_fmt == AV_PIX_FMT_NONE && avctx->bits_per_coded_sample) avctx->pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_avi, avctx->bits_per_coded_sample); desc = av_pix_fmt_desc_get(avctx->pix_fmt); if (!desc) { av_log(avctx, AV_LOG_ERROR, "Invalid pixel format.\n"); return AVERROR(EINVAL); } if (desc->flags & (AV_PIX_FMT_FLAG_PAL | AV_PIX_FMT_FLAG_PSEUDOPAL)) { context->palette = av_buffer_alloc(AVPALETTE_SIZE); if (!context->palette) return AVERROR(ENOMEM); if (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) avpriv_set_systematic_pal2((uint32_t*)context->palette->data, avctx->pix_fmt); else memset(context->palette->data, 0, AVPALETTE_SIZE); } if ((avctx->extradata_size >= 9 && !memcmp(avctx->extradata + avctx->extradata_size - 9, "BottomUp", 9)) || avctx->codec_tag == MKTAG('c','y','u','v') || avctx->codec_tag == MKTAG(3, 0, 0, 0) || avctx->codec_tag == MKTAG('W','R','A','W')) context->flip = 1; if (avctx->codec_tag == AV_RL32("yuv2") && avctx->pix_fmt == AV_PIX_FMT_YUYV422) context->is_yuv2 = 1; return 0; }
1threat
How to save data from an array : <p>I'm making a simple application to save school grades and displays it back to you when requested. How can I save this data so you do not have to reenter it every time the application is run?</p>
0debug
Why does b get the value 100? : <p><strong>This is on C:</strong></p> <pre><code>#include &lt;stdio.h&gt; int main() { int a=100,b; b= (a&gt;100)?a++:a--; printf("%d %d\n",a,b); } </code></pre> <p>b assigned the value 100 but when trying </p> <pre><code>int main() { int a=100,b; b= (a&gt;100) printf("%d %d\n",a,b); } </code></pre> <p>b prints the value 1 as it returns true. why is it different when using '?:' operator?</p>
0debug
Not able to install openpyxl in windows 7 64 bit : I am using windows 7 64 bit. when I install openpyxl library from the link below, it is a file.tar.gz file. 1. first conern is I am unable to extract this file. ? Since I am unable to extact the file, Cant install the same. Can any one help me to get this openpyxl installed as I need to work with some of the excel file asap. Thank you very much. https://openpyxl.readthedocs.io/en/stable/
0debug
"PDB format is not supported" with .NET portable debugging information : <p>The last couple of days I've been <a href="https://github.com/Azure/service-fabric-aspnetcore/issues/17" rel="noreferrer">hunting down a problem</a> - with the conclusion: </p> <p><em>My Visual Studio 2017 debugger can't work with PDBs in "portable" format in .NET Framework projects.</em></p> <p>With portable format I mean going to a project's settings, then to <code>Build</code> <code>-&gt;</code> <code>Advanced</code> and then selecting <code>portable</code> under <code>Debugging information</code>.</p> <p>When I start debugging a .NET Framework project built like this, breakpoints don't get hit.</p> <p><img src="https://i.stack.imgur.com/eGCby.png" alt="The breakpoint will not currently be hit. No symbols have been loaded for this document."></p> <p>When I pause the debugger and look for the reason why it didn't load the symbols, it says (under <code>Symbol load information</code>):</p> <blockquote> <p>PDB format is not supported</p> </blockquote> <p>I can reproduce this with any .NET <em>Framework</em> project. The target framework doesn't seem to matter. I tried .NET 4.5.2 and 4.6.2.</p> <p>It works fine, though, for .NET <em>Core</em> projects.</p> <p>Now, the strange thing is that the exact same project works fine on another computer.</p> <p>So, it seems that my computer is missing something or has something misconfigured. But my Google search didn't turn up anything. Any ideas how to fix this problem?</p>
0debug
Basic HTML and CSS banner : <p>With the example HTML / CSS below, I cannot work out why this doesnt display the expected results in any browser (hosted in Visual Studio), however works perfectly when done as a <a href="https://jsfiddle.net/nyLxuL2y/" rel="nofollow noreferrer">JSFiddle</a>. I'm probably missing something pretty obvious, but can anyone point out what that might be?</p> <p>HTML:</p> <pre><code>&lt;body&gt; &lt;div class="wrapper"&gt; &lt;div class="navbar"&gt; &lt;p&gt;Random white text which should appear in a grey banner at the top of the page.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>CSS:</p> <pre><code>body { width: 100%; margin: 0; } .wrapper { display: table; width: 100%; } .navbar { width: 100%; height: 200px; background-color: #292929; color: #ffffff; text-align: center; vertical-align: middle; display: table-cell; } </code></pre> <p>EDIT: I have tried this in various different browsers, including Firefox, Direfox Dev Edition, Edge, and IE, all with the same results (just plan black text on white screen).</p>
0debug
How to replace two tags with php and regular expression into one : <p>I need help if you can help me. I need regular expression pattern to replace this: </p> <pre><code>&lt;/table&gt; &lt;br /&gt; or this (without space in between) &lt;/table&gt;&lt;br /&gt; (it can be &lt;br /&gt; or &lt;br&gt;) </code></pre> <p>with only table close tag, to remove br tag at the end.</p>
0debug
void qemu_file_reset_rate_limit(QEMUFile *f) { f->bytes_xfer = 0; }
1threat
C# sort points not currect : i want to sort my output points with c# this is my visual output [enter image description here][1] [1]: https://i.stack.imgur.com/pYIjr.jpg and my console output is : 388, 380 388, 380 220, 379 388, 380 220, 379 53, 379 388, 380 220, 379 53, 379 53, 211 388, 380 220, 379 53, 379 53, 211 391, 206 388, 380 220, 379 53, 379 53, 211 220, 211 391, 206 388, 380 220, 379 53, 379 53, 211 220, 211 391, 206 220, 43 388, 380 220, 379 53, 379 53, 211 220, 211 391, 206 220, 43 52, 43 388, 380 220, 379 53, 379 53, 211 220, 211 391, 206 220, 43 52, 43 389, 42 and my code is here: PosList.Add(cog); PosList = PosList.OrderByDescending(p=>p.Y).ToList(); i cant sorted my point please help me to create a sort .. thank you
0debug
List of "Always wrong" snippets in C : <p>Was talking to a colleague today on one-spot errors - I.e. errors (or at least patterns that should ring an alarm bell) in code that a decent programmer should be able to spot at a single glance like</p> <pre><code>x = malloc (strlen(y)); while (!feof (f)) { ... } char *f(){ char x[100]; ... return x; } </code></pre> <p>Who has similar snippets of such patterns? I would suggest anyone who has been on SO for a while will have his personal favourites of those</p>
0debug
static void do_info_block(int argc, const char **argv) { bdrv_info(); }
1threat
input a directory to java to be proceed : > I have a problem in here, whenever I entered the directory path that I copy from my computer to input a txt file to my program it always said that the file is not found. is there something wrong from my code? System.out.println("insert directory file = "); FileReader file = null; try { file = new FileReader(input.next()); BufferedReader readfile = new BufferedReader(file); StringBuffer sb = new StringBuffer(); try { while ((text = readfile.readLine()) != null) { sb.append(text); sb.append("\n"); } readfile.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } text = sb.toString(); //System.out.println(text); System.out.println("Data entered"); System.out.println("Data length = "+text.length()+"\n"); } catch (FileNotFoundException e1) { // TODO Auto-generated catch block System.out.println("File not found. Pease insert the proper file directory.\n"); }
0debug
Why is the escape syntax different between two Javascript functions: search vs replace? : <p>Use this string as example</p> <pre><code>s = "a(b" </code></pre> <p>These two work as expected</p> <pre><code>s.search("\\(") 1 s.replace("\(", "") "ab" </code></pre> <p>But these don't</p> <pre><code>s.search("\(") Uncaught SyntaxError: Invalid regular expression: /(/: Unterminated group s.replace("\\(", "") "a(b" </code></pre> <p>Huh? Why does search require one more escape than replace?</p> <p>Also, shouldn't string input give a literal search, instead of being interpreted as a regexp? In theory, I shouldn't have to use escape characters at all.</p>
0debug
Javascript - How To Load An Image Into A Canvas : I'm a beginner and trying to learn to code html here by playing around the codes I found online. And I came across a javascript that basically snip image into several boxes. The code goes like this: <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" media="all" href="css/reset.css" /> <!-- reset css --> <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"> </script> <style> body{ background-color: ivory; } canvas{border:1px solid red;} #clips{border:1px solid blue; padding:5px;} img{margin:3px;} </style> <script> $(function(){ var canvas=document.getElementById("canvas"); var ctx=canvas.getContext("2d"); var cw,ch; // background definition // OPTION: look at the top-left pixel and assume == background // then set these vars automatically var isTransparent=false; var bkColor={r:255,g:255,b:255}; var bkFillColor="rgb("+bkColor.r+","+bkColor.g+","+bkColor.b+")"; // load test image var img=new Image(); img.crossOrigin="anonymous"; img.onload=start; img.src="http://nedroid.com/comics/2010-09-06-guest-comic-jay-fuller.png"; function start(){ // draw the test image on the canvas cw=canvas.width=img.width/2; ch=canvas.height=img.width/2; ctx.drawImage(img,0,0,cw,ch); } function clipBox(data){ var pos=findEdge(data); if(!pos.valid){return;} var bb=findBoundary(pos,data); clipToImage(bb.x,bb.y,bb.width,bb.height); if(isTransparent){ // clear the clipped area // plus a few pixels to clear any anti-aliasing ctx.clearRect(bb.x-2,bb.y-2,bb.width+4,bb.height+4); }else{ // fill the clipped area with the bkColor // plus a few pixels to clear any anti-aliasing ctx.fillStyle=bkFillColor; ctx.fillRect(bb.x-2,bb.y-2,bb.width+4,bb.height+4); } } function xyIsInImage(data,x,y){ // find the starting index of the r,g,b,a of pixel x,y var start=(y*cw+x)*4; if(isTransparent){ return(data[start+3]>25); }else{ var r=data[start+0]; var g=data[start+1]; var b=data[start+2]; var a=data[start+3]; // pixel alpha (opacity) var deltaR=Math.abs(bkColor.r-r); var deltaG=Math.abs(bkColor.g-g); var deltaB=Math.abs(bkColor.b-b); return(!(deltaR<5 && deltaG<5 && deltaB<5 && a>25)); } } function findEdge(data){ for(var y=0;y<ch;y++){ for(var x=0;x<cw;x++){ if(xyIsInImage(data,x,y)){ return({x:x,y:y,valid:true}); } }} return({x:-100,y:-100,valid:false}); } function findBoundary(pos,data){ var x0=x1=pos.x; var y0=y1=pos.y; while(y1<=ch && xyIsInImage(data,x1,y1)){y1++;} var x2=x1; var y2=y1-1; while(x2<=cw && xyIsInImage(data,x2,y2)){x2++;} return({x:x0,y:y0,width:x2-x0,height:y2-y0+1}); } function drawLine(x1,y1,x2,y2){ ctx.beginPath(); ctx.moveTo(x1,y1); ctx.lineTo(x2,y2); ctx.strokeStyle="red"; ctx.lineWidth=0.50; ctx.stroke(); } function clipToImage(x,y,w,h){ // don't save anti-alias slivers if(w<3 || h<3){ return; } // save clipped area to an img element var tempCanvas=document.createElement("canvas"); var tempCtx=tempCanvas.getContext("2d"); tempCanvas.width=w; tempCanvas.height=h; tempCtx.drawImage(canvas,x,y,w,h,0,0,w,h); var image=new Image(); image.width=w; image.height=h; image.src=tempCanvas.toDataURL(); $("#clips").append(image); } $("#unbox").click(function(){ var imgData=ctx.getImageData(0,0,cw,ch); var data=imgData.data; clipBox(data); }); }); // end $(function(){}); </script> </head> <body> <button id="unbox">Clip next sub-image</button><br> <canvas id="canvas" width=300 height=150></canvas><br> <h4>Below are images clipped from the canvas above.</h4><br> <div id="clips"></div> </body> </html> Nothing happen when I click the button, not even the image is loaded onto the canvas. I searched through various online tutorials and that leads to nothing. I have tried forcefully call out the function using `start();` in the `<body>` section but still it's not working.
0debug
static void test_event_c(TestEventData *data, const void *unused) { QDict *d, *d_data, *d_b; UserDefOne b; UserDefZero z; z.integer = 2; b.base = &z; b.string = g_strdup("test1"); b.has_enum1 = false; d_b = qdict_new(); qdict_put(d_b, "integer", qint_from_int(2)); qdict_put(d_b, "string", qstring_from_str("test1")); d_data = qdict_new(); qdict_put(d_data, "a", qint_from_int(1)); qdict_put(d_data, "b", d_b); qdict_put(d_data, "c", qstring_from_str("test2")); d = data->expect; qdict_put(d, "event", qstring_from_str("EVENT_C")); qdict_put(d, "data", d_data); qapi_event_send_event_c(true, 1, true, &b, "test2", &error_abort); g_free(b.string); }
1threat
static target_long monitor_get_msr (const struct MonitorDef *md, int val) { CPUState *env = mon_get_cpu(); if (!env) return 0; return env->msr; }
1threat
Xcode 8 cannot run on device, provisioning profile problems mentioning Apple Watch : <p>I am running OS X El Capitan and using the Xcode 8 GM seed (8A218a) and I am trying to run my app on my iPhone 6 with iOS 10 GM seed, 10.01 (14A403), which is paired to my Apple Watch running watchOS 3 GM seed (14S326).</p> <p>I am using Match for handling provisioning profiles and certificates, it has been working beautifully so far.</p> <p>I recently changed the bundle identifier, so created a new App Id in member center and reconfigured match etc. I have the development certificate and provisioning profile installed on my Mac. I have deleted the old certificates and the old provisioning profiles.</p> <p>Everything is just working fine running on the simulator. But when I try to run it on my iPhone Xcode 8 is displaying on error:</p> <blockquote> <p>Provisioning profile "match Development com.XXX.YYY" doesn't include the currently selected device "ZZZ's Apple Watch".</p> </blockquote> <p>It shows another error as well:</p> <blockquote> <p>Code signing is required for product type 'Application' in SDK 'iOS 10.0'</p> </blockquote> <p>This is under <em>Target -> General</em>: <a href="https://i.stack.imgur.com/pSvC5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pSvC5.png" alt="enter image description here"></a></p> <p><em>Target -> Build Settings</em> looks like this: <a href="https://i.stack.imgur.com/UXmSz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/UXmSz.png" alt="target_build_settings"></a></p> <p>I don't have an Apple Watch extension for this app. So why is Xcode 8 giving me errors relating to my Apple Watch?</p> <p>Also what does the second error mean? <em>Code signing is required for product type 'Application' in SDK 'iOS 10.0'</em>? </p> <p>Thanks!!</p>
0debug
php preg_match get string : The original text ``` window.DATA_STORE = { isMobile: false, data: {"visitsList":{"data":[{"userId":"NkEQmWDdKzwyXKbGMJZj","userName":"GeroChile","userGender":1,"userAge":36,"userCity":"","userPicId":"axe63o2ak7xhqa6ng86ucxoaxgf75na29bqgw9ol","userPictures":{"small":"\/content\/u\/a\/x\/axe63o2ak7xhqa6ng86ucxoaxgf75na29bqgw9ol_12.jpg","medium":"\/content\/u\/a\/x\/axe63o2ak7xhqa6ng86ucxoaxgf75na29bqgw9ol_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=NkEQmWDdKzwyXKbGMJZj&c=513cf8852f2a335b5a6b0dbd21c7df5fcf6c543c","userLastVisited":"heute, 02:30 Uhr"},{"userId":"rjLvKgNbDmznPrdmYGWo","userName":"Zuckerstange1","userGender":1,"userAge":56,"userCity":"","userPicId":"5g8cpfsxrlq1689cebzasodzehcyed4wx81ja21z","userPictures":{"small":"\/content\/u\/5\/g\/5g8cpfsxrlq1689cebzasodzehcyed4wx81ja21z_12.jpg","medium":"\/content\/u\/5\/g\/5g8cpfsxrlq1689cebzasodzehcyed4wx81ja21z_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=rjLvKgNbDmznPrdmYGWo&c=8011959c2842141f6dfb066ee4cfbf46aba59196","userLastVisited":"gestern, 01:44 Uhr"},{"userId":"knjlBZmawrnmMWeMxLpW","userName":"Tom_0990","userGender":1,"userAge":29,"userCity":"","userPicId":"gbjo38nz31a9ahjn11hozj5mh7tzd1tq27re71yc","userPictures":{"small":"\/content\/u\/g\/b\/gbjo38nz31a9ahjn11hozj5mh7tzd1tq27re71yc_12.jpg","medium":"\/content\/u\/g\/b\/gbjo38nz31a9ahjn11hozj5mh7tzd1tq27re71yc_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=knjlBZmawrnmMWeMxLpW&c=10dd411df2eeeeffb793d9472b842c98c4928ee1","userLastVisited":"gestern, 00:55 Uhr"},{"userId":"qlBWrvxbzBBYkmbKZjPJ","userName":"Lieblingsjunge","userGender":1,"userAge":49,"userCity":"","userPicId":"lsxkyko6ay412dt057zziy3u62umswgxm2e6xwp8","userPictures":{"small":"\/content\/u\/l\/s\/lsxkyko6ay412dt057zziy3u62umswgxm2e6xwp8_12.jpg","medium":"\/content\/u\/l\/s\/lsxkyko6ay412dt057zziy3u62umswgxm2e6xwp8_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=qlBWrvxbzBBYkmbKZjPJ&c=89da3babf04a621b8474ece8585073b38d1c0c54","userLastVisited":"gestern, 00:24 Uhr"},{"userId":"VWKqlByarzzmRxaNLYjZ","userName":"Triskell","userGender":1,"userAge":48,"userCity":"","userPicId":"co5fzvna3ph464bd1mit9c344pmjf1fxaqf35spz","userPictures":{"small":"\/content\/u\/c\/o\/co5fzvna3ph464bd1mit9c344pmjf1fxaqf35spz_12.jpg","medium":"\/content\/u\/c\/o\/co5fzvna3ph464bd1mit9c344pmjf1fxaqf35spz_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=VWKqlByarzzmRxaNLYjZ&c=d25c234771e97ba2c348089e09bc1abf6018d693","userLastVisited":"gestern, 19:13 Uhr"}],"count":5,"settings":{"m":1,"g":0,"v":2}},"onlineList":{"data":[{"userId":"wRGYvAQdklgEYJemzENj","userName":"Chaosmak3r","userGender":1,"userAge":24,"userCity":"Chemnitz","userPicId":"ua6mjj8qrrgqwwm9yn64914alfwhv7925oavqjb0","userPictures":{"small":"\/content\/u\/u\/a\/ua6mjj8qrrgqwwm9yn64914alfwhv7925oavqjb0_12.jpg","medium":"\/content\/u\/u\/a\/ua6mjj8qrrgqwwm9yn64914alfwhv7925oavqjb0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=wRGYvAQdklgEYJemzENj&c=aeb85869ec7398deb60c7e2cc11b5fbc35ff3133","userLastVisited":""},{"userId":"AJDqGPgbQJJXJYdpRWvj","userName":"Sv_Pro","userGender":1,"userAge":26,"userCity":"Freiberg","userPicId":"nbv7opbdtsmtia1phx2zije1plss6fhdkgt34tks","userPictures":{"small":"\/content\/u\/n\/b\/nbv7opbdtsmtia1phx2zije1plss6fhdkgt34tks_12.jpg","medium":"\/content\/u\/n\/b\/nbv7opbdtsmtia1phx2zije1plss6fhdkgt34tks_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=AJDqGPgbQJJXJYdpRWvj&c=8fabf3ad40118c62f6e5a7b1c78fd0b4bf875941","userLastVisited":""},{"userId":"mZEWKkpbjjNgRPbQRLrD","userName":"Jonas13","userGender":1,"userAge":26,"userCity":"W\u00fcrzburg","userPicId":"l6w56bjht51xfb82t1v1p8f55o1m81n5auyu7f6e","userPictures":{"small":"\/content\/u\/l\/6\/l6w56bjht51xfb82t1v1p8f55o1m81n5auyu7f6e_12.jpg","medium":"\/content\/u\/l\/6\/l6w56bjht51xfb82t1v1p8f55o1m81n5auyu7f6e_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=mZEWKkpbjjNgRPbQRLrD&c=80185000c609e075542f2e5275657aae87ee812d","userLastVisited":""},{"userId":"kvgNmRKdGgLjgodLJjlX","userName":"Schrauber-93","userGender":1,"userAge":26,"userCity":"Meerane","userPicId":"kgqueqjcjylct9eovlxgcu1ieyuxmpmovujdpa5j","userPictures":{"small":"\/content\/u\/k\/g\/kgqueqjcjylct9eovlxgcu1ieyuxmpmovujdpa5j_12.jpg","medium":"\/content\/u\/k\/g\/kgqueqjcjylct9eovlxgcu1ieyuxmpmovujdpa5j_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=kvgNmRKdGgLjgodLJjlX&c=60b0bea55b4bdf6b4d33f3134c51a53ec98d3d6b","userLastVisited":""},{"userId":"YMwlJyRaMroxGPbPLpkW","userName":"Martin993","userGender":1,"userAge":25,"userCity":"Darmstadt","userPicId":"no5aorjkha2h2oo5btwit4ffky1vdao86eehh9b0","userPictures":{"small":"\/content\/u\/n\/o\/no5aorjkha2h2oo5btwit4ffky1vdao86eehh9b0_12.jpg","medium":"\/content\/u\/n\/o\/no5aorjkha2h2oo5btwit4ffky1vdao86eehh9b0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=YMwlJyRaMroxGPbPLpkW&c=2c5cf6795f85cbc2a6f2b8181fae4aaa427431f0","userLastVisited":""},{"userId":"lvrEojzayvvlyPbPnWBX","userName":"Thommy06","userGender":1,"userAge":21,"userCity":"Chemnitz","userPicId":"3hzs7fw2rnnj86tlanonsd6wmnzj833qxg7o0cqm","userPictures":{"small":"\/content\/u\/3\/h\/3hzs7fw2rnnj86tlanonsd6wmnzj833qxg7o0cqm_12.jpg","medium":"\/content\/u\/3\/h\/3hzs7fw2rnnj86tlanonsd6wmnzj833qxg7o0cqm_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=lvrEojzayvvlyPbPnWBX&c=84b645c5e04ecc0661aa12c3b1c232ab38c86bec","userLastVisited":""},{"userId":"rmxkNywanlpNEgdAXjpM","userName":"Furkan","userGender":1,"userAge":26,"userCity":"Heppenheim","userPicId":"a4p6qizw6pc8t2x4der3tbh60i7whal3zvfq3hr0","userPictures":{"small":"\/content\/u\/a\/4\/a4p6qizw6pc8t2x4der3tbh60i7whal3zvfq3hr0_12.jpg","medium":"\/content\/u\/a\/4\/a4p6qizw6pc8t2x4der3tbh60i7whal3zvfq3hr0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=rmxkNywanlpNEgdAXjpM&c=d1e85439cf80704a95d6cbf2eeccc399392f5204","userLastVisited":""},{"userId":"GpgXMNmbxnBQqKeJzqRw","userName":"Keksian","userGender":1,"userAge":24,"userCity":"Leipzig","userPicId":"5uh9dhfe39272oo6ub1wwskfvfvt5jjprqh5aihl","userPictures":{"small":"\/content\/u\/5\/u\/5uh9dhfe39272oo6ub1wwskfvfvt5jjprqh5aihl_12.jpg","medium":"\/content\/u\/5\/u\/5uh9dhfe39272oo6ub1wwskfvfvt5jjprqh5aihl_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=GpgXMNmbxnBQqKeJzqRw&c=500212e2e649fef4ed13a4d80b601664afdea77e","userLastVisited":""},{"userId":"NqDMnwpapqqmAYbyJQPZ","userName":"Felixmagicetea","userGender":1,"userAge":26,"userCity":"Schwalmstadt","userPicId":"sgps7lk67shsdfgjndqzb8hdgrqlavb06pp74742","userPictures":{"small":"\/content\/u\/s\/g\/sgps7lk67shsdfgjndqzb8hdgrqlavb06pp74742_12.jpg","medium":"\/content\/u\/s\/g\/sgps7lk67shsdfgjndqzb8hdgrqlavb06pp74742_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=NqDMnwpapqqmAYbyJQPZ&c=212f0a9ab1193108e6a8809b3e84577c9e1c903e","userLastVisited":""},{"userId":"NpEQvGqaWBBWXkewPBAj","userName":"Flint93","userGender":1,"userAge":25,"userCity":"Helmstedt","userPicId":"vmq19yu3kw24u11g4flqzihw6jnlc5m5npndyptx","userPictures":{"small":"\/content\/u\/v\/m\/vmq19yu3kw24u11g4flqzihw6jnlc5m5npndyptx_12.jpg","medium":"\/content\/u\/v\/m\/vmq19yu3kw24u11g4flqzihw6jnlc5m5npndyptx_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=NpEQvGqaWBBWXkewPBAj&c=97afffd0a631005cd82465ad20b692e82839e63e","userLastVisited":""},{"userId":"GpgXMNmaxrrJqwdJzqRw","userName":"FitteFimmel","userGender":1,"userAge":22,"userCity":"Erlensee","userPicId":"8wttu8sd6iqmyxocfsgr3a8kg8i0cv0tq6f0qty0","userPictures":{"small":"\/content\/u\/8\/w\/8wttu8sd6iqmyxocfsgr3a8kg8i0cv0tq6f0qty0_12.jpg","medium":"\/content\/u\/8\/w\/8wttu8sd6iqmyxocfsgr3a8kg8i0cv0tq6f0qty0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=GpgXMNmaxrrJqwdJzqRw&c=76d7567c4dc34451240bee64bedaeb3b8a991305","userLastVisited":""},{"userId":"NqDMnwpepjXyyybyJQPZ","userName":"Matatta","userGender":1,"userAge":25,"userCity":"Kirchberg","userPicId":"adv23qwo4rcbosnpwd4wb2bt7kfzksw7v47d10zq","userPictures":{"small":"\/content\/u\/a\/d\/adv23qwo4rcbosnpwd4wb2bt7kfzksw7v47d10zq_12.jpg","medium":"\/content\/u\/a\/d\/adv23qwo4rcbosnpwd4wb2bt7kfzksw7v47d10zq_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=NqDMnwpepjXyyybyJQPZ&c=1371068df70bcd7bfac071fc9d0584a11e72069e","userLastVisited":""},{"userId":"rjLvKgNbDmmvEPdmYGWo","userName":"LautundDrau\u00dfen","userGender":1,"userAge":26,"userCity":"Erfurt","userPicId":"5y0d0vzxanjjjgwsprbahdp4i9zxwt9f4tvaxfh0","userPictures":{"small":"\/content\/u\/5\/y\/5y0d0vzxanjjjgwsprbahdp4i9zxwt9f4tvaxfh0_12.jpg","medium":"\/content\/u\/5\/y\/5y0d0vzxanjjjgwsprbahdp4i9zxwt9f4tvaxfh0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=rjLvKgNbDmmvEPdmYGWo&c=ab801a62580085f365128d564f75b56e9a3fcc62","userLastVisited":""},{"userId":"xENlwKBeJwzMZKaWkLGy","userName":"michi27z","userGender":1,"userAge":21,"userCity":"Gro\u00df-Zimmern","userPicId":"jmoiu2oa2io99x805sr78b7of261wnj7y60o2r7e","userPictures":{"small":"\/content\/u\/j\/m\/jmoiu2oa2io99x805sr78b7of261wnj7y60o2r7e_12.jpg","medium":"\/content\/u\/j\/m\/jmoiu2oa2io99x805sr78b7of261wnj7y60o2r7e_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=xENlwKBeJwzMZKaWkLGy&c=8b66ca15c6df77a031b087457c363cf011667403","userLastVisited":""},{"userId":"xENlwKBaJlDVpJdWkLGy","userName":"roger007","userGender":1,"userAge":21,"userCity":"G\u00f6ttingen","userPicId":"1k64izt75xajcx6ghd8mar4on7skzd0xjmp2jzef","userPictures":{"small":"\/content\/u\/1\/k\/1k64izt75xajcx6ghd8mar4on7skzd0xjmp2jzef_12.jpg","medium":"\/content\/u\/1\/k\/1k64izt75xajcx6ghd8mar4on7skzd0xjmp2jzef_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=xENlwKBaJlDVpJdWkLGy&c=d9f0b63b9f46d6439bceb99715c49f85592ba8fb","userLastVisited":""},{"userId":"qlBWrvxdzBBAnMdKZjPJ","userName":"Samy20","userGender":1,"userAge":20,"userCity":"Regensburg","userPicId":"fb85lk1osol8cgvga3o7hrfaosa0fbkskpgtmtv2","userPictures":{"small":"\/content\/u\/f\/b\/fb85lk1osol8cgvga3o7hrfaosa0fbkskpgtmtv2_12.jpg","medium":"\/content\/u\/f\/b\/fb85lk1osol8cgvga3o7hrfaosa0fbkskpgtmtv2_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=qlBWrvxdzBBAnMdKZjPJ&c=e7c6ea2e85059413bdcda620e57282cebfdcf84a","userLastVisited":""},{"userId":"QwrXmEvePrWZnZbPNKYl","userName":"themanno","userGender":1,"userAge":24,"userCity":"Marbach","userPicId":"vj57hx7h6yb47zjarlb1xqnx6grqbd8u7lz8dpo7","userPictures":{"small":"\/content\/u\/v\/j\/vj57hx7h6yb47zjarlb1xqnx6grqbd8u7lz8dpo7_12.jpg","medium":"\/content\/u\/v\/j\/vj57hx7h6yb47zjarlb1xqnx6grqbd8u7lz8dpo7_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=QwrXmEvePrWZnZbPNKYl&c=36baed1660b0738c8e1d94866761ebb9ba9c1795","userLastVisited":""},{"userId":"rmxkNywenlLpmrbAXjpM","userName":"SlimFelix","userGender":1,"userAge":26,"userCity":"Butzbach","userPicId":"a94xbhq7t6z403n8tjuptn2rekjzrspluotdh5jk","userPictures":{"small":"\/content\/u\/a\/9\/a94xbhq7t6z403n8tjuptn2rekjzrspluotdh5jk_12.jpg","medium":"\/content\/u\/a\/9\/a94xbhq7t6z403n8tjuptn2rekjzrspluotdh5jk_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=rmxkNywenlLpmrbAXjpM&c=3ec55bd03374bc48410360726626cf2d31d61dbe","userLastVisited":""},{"userId":"xENlwKBeJPkNMAbWkLGy","userName":"Magicdrinkmix","userGender":1,"userAge":23,"userCity":"N\u00fcrnberg","userPicId":"yc8wzs7c0nrnt8e0mq7ai97vjfszyj93obvj4or0","userPictures":{"small":"\/content\/u\/y\/c\/yc8wzs7c0nrnt8e0mq7ai97vjfszyj93obvj4or0_12.jpg","medium":"\/content\/u\/y\/c\/yc8wzs7c0nrnt8e0mq7ai97vjfszyj93obvj4or0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=xENlwKBeJPkNMAbWkLGy&c=11154131780def40accd9d70a92d789436fec79d","userLastVisited":""},{"userId":"NkEQmWDbKpLQpNdGMJZj","userName":"Thommy96","userGender":1,"userAge":23,"userCity":"Gotha","userPicId":"7xcgqzna0tp8h3tdk5y95dopad9m85ybmcpckmou","userPictures":{"small":"\/content\/u\/7\/x\/7xcgqzna0tp8h3tdk5y95dopad9m85ybmcpckmou_12.jpg","medium":"\/content\/u\/7\/x\/7xcgqzna0tp8h3tdk5y95dopad9m85ybmcpckmou_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=NkEQmWDbKpLQpNdGMJZj&c=84861a1ac988775acf71e35c5771cb3ae91664ff","userLastVisited":""},{"userId":"NpEQvGqaWMRBMldwPBAj","userName":"wabb93","userGender":1,"userAge":25,"userCity":"Eltville","userPicId":"7a9n68fm0reo7pwz0yjg4alvas5zxtq2ex5gffe0","userPictures":{"small":"\/content\/u\/7\/a\/7a9n68fm0reo7pwz0yjg4alvas5zxtq2ex5gffe0_12.jpg","medium":"\/content\/u\/7\/a\/7a9n68fm0reo7pwz0yjg4alvas5zxtq2ex5gffe0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=NpEQvGqaWMRBMldwPBAj&c=4dc1d4de6d84ca82e1e0f7db9ae5956b6ea24b56","userLastVisited":""},{"userId":"VMvxkKXaYJPDywbGrZNA","userName":"ag01","userGender":1,"userAge":25,"userCity":"Bad Rappenau","userPicId":"jpyn10kvo65yzu79yo3bzc97ne2vt5p82xj747ke","userPictures":{"small":"\/content\/u\/j\/p\/jpyn10kvo65yzu79yo3bzc97ne2vt5p82xj747ke_12.jpg","medium":"\/content\/u\/j\/p\/jpyn10kvo65yzu79yo3bzc97ne2vt5p82xj747ke_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=VMvxkKXaYJPDywbGrZNA&c=7face200cafb74d3258ddc7534fec9924c65a423","userLastVisited":""},{"userId":"lvrEojzaynkpkwbPnWBX","userName":"Ullyses","userGender":1,"userAge":26,"userCity":"Heidelberg","userPicId":"bhugirynumzsshdo810qqtc73kkro7yvaiwna062","userPictures":{"small":"\/content\/u\/b\/h\/bhugirynumzsshdo810qqtc73kkro7yvaiwna062_12.jpg","medium":"\/content\/u\/b\/h\/bhugirynumzsshdo810qqtc73kkro7yvaiwna062_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=lvrEojzaynkpkwbPnWBX&c=7a35caca31aa4649f7be04e445564eaff40287ff","userLastVisited":""},{"userId":"mZEWKkpejjQnYqeQRLrD","userName":"Tjoram","userGender":1,"userAge":23,"userCity":"Breitenstein","userPicId":"nd9nh79utpmh72ftvmjg7alyb1nyb7zayczefn36","userPictures":{"small":"\/content\/u\/n\/d\/nd9nh79utpmh72ftvmjg7alyb1nyb7zayczefn36_12.jpg","medium":"\/content\/u\/n\/d\/nd9nh79utpmh72ftvmjg7alyb1nyb7zayczefn36_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=mZEWKkpejjQnYqeQRLrD&c=8cd13591aa66512c9a1e3cb9878130027be2593c","userLastVisited":""},{"userId":"ZVlQXBpeXMmkwwagnzYy","userName":"David1998","userGender":1,"userAge":20,"userCity":"Nordhausen","userPicId":"o12mquwzsb90g38vhqlrihtz0vwqjvt8ds79y5yj","userPictures":{"small":"\/content\/u\/o\/1\/o12mquwzsb90g38vhqlrihtz0vwqjvt8ds79y5yj_12.jpg","medium":"\/content\/u\/o\/1\/o12mquwzsb90g38vhqlrihtz0vwqjvt8ds79y5yj_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=ZVlQXBpeXMmkwwagnzYy&c=88dff6b62ee053584614d555a19dfeade9e305f1","userLastVisited":""},{"userId":"ZVlQXBpaXMMqkVbgnzYy","userName":"Tong888","userGender":1,"userAge":27,"userCity":"Wendeburg","userPicId":"ld5u2if97c3w7sfbztjqhkpgvs5donba8mbfmmsb","userPictures":{"small":"\/content\/u\/l\/d\/ld5u2if97c3w7sfbztjqhkpgvs5donba8mbfmmsb_12.jpg","medium":"\/content\/u\/l\/d\/ld5u2if97c3w7sfbztjqhkpgvs5donba8mbfmmsb_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=ZVlQXBpaXMMqkVbgnzYy&c=a949f31628241f4fddef9f7da7609fc15067bb70","userLastVisited":""},{"userId":"GpgXMNmaxrrKzEdJzqRw","userName":"RWa99","userGender":1,"userAge":19,"userCity":"Bad Nauheim","userPicId":"h5yfkebxej1ccbszb5zwki2ve6m7frm4v83428ip","userPictures":{"small":"\/content\/u\/h\/5\/h5yfkebxej1ccbszb5zwki2ve6m7frm4v83428ip_12.jpg","medium":"\/content\/u\/h\/5\/h5yfkebxej1ccbszb5zwki2ve6m7frm4v83428ip_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=GpgXMNmaxrrKzEdJzqRw&c=c7f302870f6139d66c4de0997ac49bad4a7c1708","userLastVisited":""},{"userId":"qoyVNXZdLRnpnRaPgYWv","userName":"malte99","userGender":1,"userAge":19,"userCity":"Gie\u00dfen","userPicId":"lmwoo5l3qd5do09suyvsd06ab37qk1qjepoddcy0","userPictures":{"small":"\/content\/u\/l\/m\/lmwoo5l3qd5do09suyvsd06ab37qk1qjepoddcy0_12.jpg","medium":"\/content\/u\/l\/m\/lmwoo5l3qd5do09suyvsd06ab37qk1qjepoddcy0_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":false,"userLinkToProfile":"\/User\/profile\/?id=qoyVNXZdLRnpnRaPgYWv&c=cae66604fa7aa6ea514e70d87a215dc43d764ca0","userLastVisited":""},{"userId":"NqDMnwpbpqqmDgdyJQPZ","userName":"MarcSchneider","userGender":1,"userAge":27,"userCity":"Wetzlar","userPicId":"bnpp58irqzwinl2k76oppjesmsp2mpfy72valgne","userPictures":{"small":"\/content\/u\/b\/n\/bnpp58irqzwinl2k76oppjesmsp2mpfy72valgne_12.jpg","medium":"\/content\/u\/b\/n\/bnpp58irqzwinl2k76oppjesmsp2mpfy72valgne_3.jpg"},"userWasOnline":false,"userIsOnline":true,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=NqDMnwpbpqqmDgdyJQPZ&c=2edb9524fa70168fe93ae247c3833b80e0e7fda4","userLastVisited":""},{"userId":"VWKqlByerzgqqjeNLYjZ","userName":"Erzwo93","userGender":1,"userAge":25,"userCity":"Weiterstadt","userPicId":"47kg45gyoqfs65gklaevshc2dmeieuaa7fclqt34","userPictures":{"small":"\/content\/u\/4\/7\/47kg45gyoqfs65gklaevshc2dmeieuaa7fclqt34_12.jpg","medium":"\/content\/u\/4\/7\/47kg45gyoqfs65gklaevshc2dmeieuaa7fclqt34_3.jpg"},"userWasOnline":true,"userIsOnline":false,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=VWKqlByerzgqqjeNLYjZ&c=88acd872c5561d9c91427b4fbfc49bb7ff551e10","userLastVisited":""}],"count":199,"ts":"1559181753","settings":{"v":2}},"user":{"hasFavoritesOnline":false,"hasNewMessages":true,"hasNewNotifications":false,"hasNewHearts":false,"hasNewFeed":true,"hasProfilePic":false,"nickname":"sabhbau14","id_pic":"","gender":2,"id":"ogmJyDPalmEqPmbYEVRr","lastlogin":1559167342},"userSettings":{"bubbles":{"feed-visitors":0,"feed-visited":0,"feed-favorites":0,"info-gallery":0,"info-matching":0,"info-search":0,"info-mobile-likes":0,"info-mobile-search-custom":0,"info-mobile-search-newbies":0,"info-mobile-search-online":0,"info-mobile-favorites":0,"info-heart-sent":0,"deprecate-ie":1}},"context":"default","page":1,"pages_total":1,"userlist":[{"userId":"","userName":"vybz-kartel28","userGender":1,"userAge":26,"userCity":"Duisburg","userPicId":"wp24e3tn8m1rqlor90f3ithrwaqzsnoxv5zp6abj","userPictures":{"small":"\/content\/u\/w\/p\/wp24e3tn8m1rqlor90f3ithrwaqzsnoxv5zp6abj_12.jpg","medium":"\/content\/u\/w\/p\/wp24e3tn8m1rqlor90f3ithrwaqzsnoxv5zp6abj_3.jpg"},"userWasOnline":false,"userIsOnline":true,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=knjlBZmdwrLzvVbMxLpW&c=48e7012db31d2944b912f83ff24af9dbee8fd7c3","userLastVisited":""},{"userId":"","userName":"Hanni89","userGender":1,"userAge":29,"userCity":"Laatzen","userPicId":"xiyx3e1bck1u033278wsp53xonxvhf5l9jy7n56q","userPictures":{"small":"\/content\/u\/x\/i\/xiyx3e1bck1u033278wsp53xonxvhf5l9jy7n56q_12.jpg","medium":"\/content\/u\/x\/i\/xiyx3e1bck1u033278wsp53xonxvhf5l9jy7n56q_3.jpg"},"userWasOnline":false,"userIsOnline":true,"userIsFavorite":false,"userIsNew":true,"userLinkToProfile":"\/User\/profile\/?id=rmxkNywbnvvNVAbAXjpM&c=554a87e863f1b8f65a95a91575fed925e775dcca","userLastVisited":""},],"params":{"a1":"18","a2":"30","ct":"100006207","di":"200","g":"1","nm":"1","o":"1","pc":"1","ct_meta":{"id":"100006207","country":"de","city":"Paderborn","state":"Nordrhein-Westfalen","state_short":"NW","locality":"","id_zip_center":"7071","id_city_proxy":"100006207"}},"results_total":9,"max_per_page":30,"position":1,"getvars":{"ct":"100006207","g":"1","a1":"18","a2":"30","di":"200","ec":"","rx":"","sh":"","v1":"","hs":"","hc":"","h1":"","h2":"","ch":"","cp":"","ed":"","sm":"","zo":"","se":"","mo":"","o":"1","nm":"1","im":"","nn":""},"base_url":"\/Search","nopage_url":"\/Search\/?ct=100006207&g=1&a1=18&a2=30&di=200&ec=&rx=&sh=&v1=&hs=&hc=&h1=&h2=&ch=&cp=&ed=&sm=&zo=&se=&mo=&o=1&nm=1&im=&nn=&","msg":"few_results","countries":{"de":"Deutschland","at":"\u00d6sterreich","ch":"Schweiz","eg":"\u00c4gypten","gq":"\u00c4quartorialguinea","et":"\u00c4thiopien","af":"Afghanistan","al":"Albanien","dz":"Algerien","ad":"Andorra","ao":"Angola","ag":"Antigua und Barbuda","ar":"Argentinien","am":"Armenien","az":"Aserbeidschan","au":"Australien","bs":"Bahamas","bh":"Bahrein","bd":"Bangladesch","bb":"Barbados","by":"Belarus","be":"Belgien","bz":"Belize","bj":"Benin","bt":"Bhutan","bo":"Bolivien","ba":"Bosnien und Herzegowina","bw":"Botsuana","br":"Brasilien","bn":"Brunei","bg":"Bulgarien","bf":"Burkina Faso","bi":"Burundi","cl":"Chile","cn":"China","cr":"Costa Rica","ci":"Cote d'Ivoire","dk":"D\u00e4nemark","dm":"Dominica","do":"Dominikanische Republik","dj":"Dschibuti","ec":"Ecuador","sv":"El Salvador","er":"Eritrea","ee":"Estland","fo":"Far\u00f6er","fj":"Fidschi","fi":"Finnland","fr":"Frankreich","ga":"Gabun","gm":"Gambia","ge":"Georgien","gh":"Ghana","gi":"Gibraltar","gd":"Grenada","gr":"Griechenland","gb":"Gro\u00dfbritannien","gt":"Guatemala","gn":"Guinea","gw":"Guinea-Bissau","gy":"Guyana","ht":"Haiti","hn":"Honduras","hk":"Hongkong","in":"Indien","id":"Indonesien","iq":"Irak","ir":"Iran","ie":"Irland","is":"Island","il":"Israel","it":"Italien","jm":"Jamaika","jp":"Japan","ye":"Jemen","jo":"Jordanien","kh":"Kambodscha","cm":"Kamerun","ca":"Kanada","cv":"Kap Verde","kz":"Kasachstan","qa":"Katar","ke":"Kenia","kg":"Kirgisistan","ki":"Kiribati","co":"Kolumbien","km":"Komoren","cg":"Kongo (Republik)","cd":"Kongo Dem. Republik","kp":"Korea (Nord) Dem. Volksrep.","kr":"Korea (S\u00fcd) Republik","hr":"Kroatien","cu":"Kuba","kw":"Kuwait","la":"Laotische Dem. Volksrep.","ls":"Lesotho","lv":"Lettland","lb":"Libanon","lr":"Liberia","ly":"Libysch-Arabische Republik","li":"Liechtenstein","lt":"Litauen","lu":"Luxemburg","mo":"Macao","mg":"Madagaskar","mw":"Malawi","my":"Malaysia","mv":"Malediven","ml":"Mali","mt":"Malta","ma":"Marokko","mh":"Marshallinseln","mr":"Mauretanien","mu":"Mauritius","mk":"Mazedonien","mx":"Mexiko","fm":"Mikronesien","md":"Moldau","mc":"Monaco","mn":"Mongolei","me":"Montenegro","mz":"Mosambik","mm":"Myanmar","na":"Namibia","nr":"Nauru","np":"Nepal","nz":"Neuseeland","ni":"Nicaragua","nl":"Niederlande","ne":"Niger","ng":"Nigeria","nu":"Niue","mp":"N\u00f6rdliche Marianen","no":"Norwegen","om":"Oman","pk":"Pakistan","pw":"Palau","ps":"Pal\u00e4stina","pa":"Panama","pg":"Papua-Neuguinea","py":"Paraguay","pe":"Peru","ph":"Philippinen","pl":"Polen","pt":"Portugal","rw":"Ruanda","ro":"Rum\u00e4nien","ru":"Russische F\u00f6deration","sb":"Salomonen","zm":"Sambia","ws":"Samoa","sm":"San Marino","st":"Sao Tome und Principe","sa":"Saudi Arabien","se":"Schweden","sn":"Senegal","rs":"Serbien","sc":"Seychellen","sl":"Sierra Leone","zw":"Simbabwe","sg":"Singapur","sk":"Slowakische Republik","si":"Slowenien","so":"Somalia","es":"Spanien","lk":"Sri Lanka","kn":"St. Kitts und Nevis","lc":"St. Lucia","vc":"St. Vincent","sd":"Sudan","za":"S\u00fcdafrika","sr":"Suriname","sz":"Swasiland","sy":"Syrien","tj":"Tadschikistan","tw":"Taiwan","tz":"Tansania","tl":"Timor-Leste","th":"Thailand","tg":"Togo","to":"Tonga","tt":"Trinidad und Tobago","td":"Tschad","cz":"Tschechische Republik","tr":"T\u00fcrkei","tn":"Tunesien","tm":"Turkmenistan","tv":"Tuvalu","ug":"Uganda","ua":"Ukraine","hu":"Ungarn","uy":"Uruguay","us":"USA","uz":"Usbekistan","vu":"Vanuatu","va":"Vatikanstadt","ve":"Venezuela","ae":"Vereinigte Arab. Emirate","vn":"Vietnam","cf":"Zentralafrik. Republik"},"requestUri":"\/Search?ct=100006207&g=1&a1=18&a2=30&di=200&ec=&rx=&sh=&v1=&hs=&hc=&h1=&h2=&ch=&cp=&ed=&sm=&zo=&se=&mo=&o=1&nm=1&im=&nn=","bubble_search":"\n<div class=\"tooltip tt-scheme1 tt-size2\" id=\"bubbleExpireNotice\" style=\"margin: 10px 0 20px;\">\n <a href=\"javascript:void(0);\" class=\"tt-close\" data-closeaction=\"\/Ajax\/hideBubble\" data-closedata=\"info-search\" title=\"Diesen Hinweis nicht mehr anzeigen\"><\/a>\n <div class=\"tt-title tt-title-info\">Sie suchen \u2013 wir finden f\u00fcr Sie<\/div>\n <p>\n Wie stellen Sie sich Ihren Traumpartner vor? Wie alt, wie jung, wie gro\u00df? Nutzen Sie die umfangreichen\n M\u00f6glichkeiten der Partnersuche, und lassen Sie sich \u00fcberraschen.\n <\/p>\n<\/div>\n"}, }; (function() { var run = function() ``` how can I get string between <h3>window.DATA_STORE =</h3> and <h3>;(function() { var run = function()</h3>
0debug
how can I do if condition in php with multiple conditions in php : I have 4 $var how can i do this : $x1='on'; $x2=''; $x3=''; $x4=''; if $x1=='on' and $x2 is empty and $x3 is empty and $x4 is empty , do this else do that ?
0debug
static void encode_signal_range(VC2EncContext *s) { int idx; AVCodecContext *avctx = s->avctx; const AVPixFmtDescriptor *fmt = av_pix_fmt_desc_get(avctx->pix_fmt); const int depth = fmt->comp[0].depth; if (depth == 8 && avctx->color_range == AVCOL_RANGE_JPEG) { idx = 1; s->bpp = 1; s->diff_offset = 128; } else if (depth == 8 && (avctx->color_range == AVCOL_RANGE_MPEG || avctx->color_range == AVCOL_RANGE_UNSPECIFIED)) { idx = 2; s->bpp = 1; s->diff_offset = 128; } else if (depth == 10) { idx = 3; s->bpp = 2; s->diff_offset = 512; } else { idx = 4; s->bpp = 2; s->diff_offset = 2048; } put_bits(&s->pb, 1, !s->strict_compliance); if (!s->strict_compliance) put_vc2_ue_uint(&s->pb, idx); }
1threat
Open, remove text, and save a text file C# : I want to edit some text files automatically but I don't know what to used to do it. I want to open a file, check all lines, if one line begins with a 'C', I remove first 39-characters, etc .. then save all the file with an other name. I already have a portion of code : var car = ligne[0]; if(car != 'C') { continue; } ligne.Remove(0, 39); I use StreamReader to read, but what is the simple way to read and save in another file ?
0debug
static void mcf5208evb_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; M68kCPU *cpu; CPUM68KState *env; int kernel_size; uint64_t elf_entry; hwaddr entry; qemu_irq *pic; MemoryRegion *address_space_mem = get_system_memory(); MemoryRegion *ram = g_new(MemoryRegion, 1); MemoryRegion *sram = g_new(MemoryRegion, 1); if (!cpu_model) { cpu_model = "m5208"; } cpu = M68K_CPU(cpu_generic_init(TYPE_M68K_CPU, cpu_model)); if (!cpu) { fprintf(stderr, "Unable to find m68k CPU definition\n"); exit(1); } env = &cpu->env; env->vbr = 0; memory_region_allocate_system_memory(ram, NULL, "mcf5208.ram", ram_size); memory_region_add_subregion(address_space_mem, 0x40000000, ram); memory_region_init_ram(sram, NULL, "mcf5208.sram", 16384, &error_fatal); memory_region_add_subregion(address_space_mem, 0x80000000, sram); pic = mcf_intc_init(address_space_mem, 0xfc048000, cpu); mcf_uart_mm_init(0xfc060000, pic[26], serial_hds[0]); mcf_uart_mm_init(0xfc064000, pic[27], serial_hds[1]); mcf_uart_mm_init(0xfc068000, pic[28], serial_hds[2]); mcf5208_sys_init(address_space_mem, pic); if (nb_nics > 1) { fprintf(stderr, "Too many NICs\n"); exit(1); } if (nd_table[0].used) { mcf_fec_init(address_space_mem, &nd_table[0], 0xfc030000, pic + 36); } if (!kernel_filename) { if (qtest_enabled()) { return; } fprintf(stderr, "Kernel image must be specified\n"); exit(1); } kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry, NULL, NULL, 1, EM_68K, 0, 0); entry = elf_entry; if (kernel_size < 0) { kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL, NULL, NULL); } if (kernel_size < 0) { kernel_size = load_image_targphys(kernel_filename, 0x40000000, ram_size); entry = 0x40000000; } if (kernel_size < 0) { fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename); exit(1); } env->pc = entry; }
1threat
Access email inbox using php : <p>I want to display email inbox of any free email service like yahoo or rediff using php. How can i do this ?</p>
0debug
Angular - 'Listen' on @ViewChild changes : <p>How can be a function like <code>onElChanged</code> be implemented, so that this functions gets executed each time properties of <code>&lt;div #plot id="plot-container"&gt;&lt;/div&gt;</code> changed?</p> <p><strong><em>component.html</em></strong></p> <pre><code>&lt;div #plot id="plot-container"&gt;&lt;/div&gt; </code></pre> <p><strong><em>component.ts</em></strong></p> <pre><code>@ViewChild('plot') el: ElementRef; onElChanged(){ console.log(this.el.nativeElement.clientWidth); } </code></pre>
0debug
javascript storage class for reloading page : <p>Hi is it possible to add class to element and storage it in element if the page reloads ?</p> <pre><code>&lt;button&gt;&lt;/button&gt; &lt;div class=""&gt;&lt;/div&gt; $(document).ready(function () { $("button").click(function() { $("div").addClass("test"); }); }); </code></pre>
0debug
static void test_panic(void) { uint8_t val; QDict *response, *data; val = inb(0x505); g_assert_cmpuint(val, ==, 1); outb(0x505, 0x1); response = qmp_receive(); g_assert(qdict_haskey(response, "event")); g_assert_cmpstr(qdict_get_str(response, "event"), ==, "GUEST_PANICKED"); g_assert(qdict_haskey(response, "data")); data = qdict_get_qdict(response, "data"); g_assert(qdict_haskey(data, "action")); g_assert_cmpstr(qdict_get_str(data, "action"), ==, "pause"); }
1threat
void mips_malta_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; ram_addr_t ram_low_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initrd_filename; char *filename; pflash_t *fl; MemoryRegion *system_memory = get_system_memory(); MemoryRegion *ram_high = g_new(MemoryRegion, 1); MemoryRegion *ram_low_preio = g_new(MemoryRegion, 1); MemoryRegion *ram_low_postio; MemoryRegion *bios, *bios_copy = g_new(MemoryRegion, 1); target_long bios_size = FLASH_SIZE; const size_t smbus_eeprom_size = 8 * 256; uint8_t *smbus_eeprom_buf = g_malloc0(smbus_eeprom_size); int64_t kernel_entry, bootloader_run_addr; PCIBus *pci_bus; ISABus *isa_bus; MIPSCPU *cpu; CPUMIPSState *env; qemu_irq *isa_irq; qemu_irq *cpu_exit_irq; int piix4_devfn; I2CBus *smbus; int i; DriveInfo *dinfo; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; DriveInfo *fd[MAX_FD]; int fl_idx = 0; int fl_sectors = bios_size >> 16; int be; DeviceState *dev = qdev_create(NULL, TYPE_MIPS_MALTA); MaltaState *s = MIPS_MALTA(dev); empty_slot_init(0, 0x20000000); qdev_init_nofail(dev); for(i = 0; i < 3; i++) { if (!serial_hds[i]) { char label[32]; snprintf(label, sizeof(label), "serial%d", i); serial_hds[i] = qemu_chr_new(label, "null", NULL); } } if (cpu_model == NULL) { #ifdef TARGET_MIPS64 cpu_model = "20Kc"; #else cpu_model = "24Kf"; #endif } for (i = 0; i < smp_cpus; i++) { cpu = cpu_mips_init(cpu_model); if (cpu == NULL) { fprintf(stderr, "Unable to find CPU definition\n"); exit(1); } env = &cpu->env; cpu_mips_irq_init_cpu(env); cpu_mips_clock_init(env); qemu_register_reset(main_cpu_reset, cpu); } cpu = MIPS_CPU(first_cpu); env = &cpu->env; if (ram_size > (2048u << 20)) { fprintf(stderr, "qemu: Too much memory for this machine: %d MB, maximum 2048 MB\n", ((unsigned int)ram_size / (1 << 20))); exit(1); } memory_region_allocate_system_memory(ram_high, NULL, "mips_malta.ram", ram_size); memory_region_add_subregion(system_memory, 0x80000000, ram_high); memory_region_init_alias(ram_low_preio, NULL, "mips_malta_low_preio.ram", ram_high, 0, MIN(ram_size, (256 << 20))); memory_region_add_subregion(system_memory, 0, ram_low_preio); if (ram_size > (512 << 20)) { ram_low_postio = g_new(MemoryRegion, 1); memory_region_init_alias(ram_low_postio, NULL, "mips_malta_low_postio.ram", ram_high, 512 << 20, ram_size - (512 << 20)); memory_region_add_subregion(system_memory, 512 << 20, ram_low_postio); } generate_eeprom_spd(&smbus_eeprom_buf[0 * 256], ram_size); generate_eeprom_serial(&smbus_eeprom_buf[6 * 256]); #ifdef TARGET_WORDS_BIGENDIAN be = 1; #else be = 0; #endif malta_fpga_init(system_memory, FPGA_ADDRESS, env->irq[4], serial_hds[2]); dinfo = drive_get(IF_PFLASH, 0, fl_idx); #ifdef DEBUG_BOARD_INIT if (dinfo) { printf("Register parallel flash %d size " TARGET_FMT_lx " at " "addr %08llx '%s' %x\n", fl_idx, bios_size, FLASH_ADDRESS, blk_name(dinfo->bdrv), fl_sectors); } #endif fl = pflash_cfi01_register(FLASH_ADDRESS, NULL, "mips_malta.bios", BIOS_SIZE, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, 65536, fl_sectors, 4, 0x0000, 0x0000, 0x0000, 0x0000, be); bios = pflash_cfi01_get_memory(fl); fl_idx++; if (kernel_filename) { ram_low_size = MIN(ram_size, 256 << 20); if (kvm_enabled()) { ram_low_size -= 0x100000; bootloader_run_addr = 0x40000000 + ram_low_size; } else { bootloader_run_addr = 0xbfc00000; } loaderparams.ram_size = ram_low_size; loaderparams.kernel_filename = kernel_filename; loaderparams.kernel_cmdline = kernel_cmdline; loaderparams.initrd_filename = initrd_filename; kernel_entry = load_kernel(); write_bootloader(env, memory_region_get_ram_ptr(bios), bootloader_run_addr, kernel_entry); if (kvm_enabled()) { write_bootloader(env, memory_region_get_ram_ptr(ram_low_preio) + ram_low_size, bootloader_run_addr, kernel_entry); } } else { if (kvm_enabled()) { error_report("KVM enabled but no -kernel argument was specified. " "Booting from flash is not supported with KVM."); exit(1); } if (!dinfo) { if (bios_name == NULL) { bios_name = BIOS_FILENAME; } filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (filename) { bios_size = load_image_targphys(filename, FLASH_ADDRESS, BIOS_SIZE); g_free(filename); } else { bios_size = -1; } if ((bios_size < 0 || bios_size > BIOS_SIZE) && !kernel_filename && !qtest_enabled()) { error_report("Could not load MIPS bios '%s', and no " "-kernel argument was specified", bios_name); exit(1); } } #ifndef TARGET_WORDS_BIGENDIAN { uint32_t *end, *addr = rom_ptr(FLASH_ADDRESS); if (!addr) { addr = memory_region_get_ram_ptr(bios); } end = (void *)addr + MIN(bios_size, 0x3e0000); while (addr < end) { bswap32s(addr); addr++; } } #endif } memory_region_init_ram(bios_copy, NULL, "bios.1fc", BIOS_SIZE, &error_abort); if (!rom_copy(memory_region_get_ram_ptr(bios_copy), FLASH_ADDRESS, BIOS_SIZE)) { memcpy(memory_region_get_ram_ptr(bios_copy), memory_region_get_ram_ptr(bios), BIOS_SIZE); } memory_region_set_readonly(bios_copy, true); memory_region_add_subregion(system_memory, RESET_ADDRESS, bios_copy); stl_p(memory_region_get_ram_ptr(bios_copy) + 0x10, 0x00000420); cpu_mips_irq_init_cpu(env); cpu_mips_clock_init(env); isa_irq = qemu_irq_proxy(&s->i8259, 16); pci_bus = gt64120_register(isa_irq); ide_drive_get(hd, ARRAY_SIZE(hd)); piix4_devfn = piix4_init(pci_bus, &isa_bus, 80); s->i8259 = i8259_init(isa_bus, env->irq[2]); isa_bus_irqs(isa_bus, s->i8259); pci_piix4_ide_init(pci_bus, hd, piix4_devfn + 1); pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci"); smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, isa_get_irq(NULL, 9), NULL, 0, NULL, NULL); smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size); g_free(smbus_eeprom_buf); pit = pit_init(isa_bus, 0x40, 0, NULL); cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1); DMA_init(0, cpu_exit_irq); isa_create_simple(isa_bus, "i8042"); rtc_init(isa_bus, 2000, NULL); serial_hds_isa_init(isa_bus, 2); parallel_hds_isa_init(isa_bus, 1); for(i = 0; i < MAX_FD; i++) { fd[i] = drive_get(IF_FLOPPY, 0, i); } fdctrl_init_isa(isa_bus, fd); network_init(pci_bus); pci_vga_init(pci_bus); }
1threat
Kotlin RxJava Nullable Bug : <p>I've run into an issue in my Android app using Kotlin and RxJava. It's presented below.</p> <pre><code>import rx.Observable data class TestUser(val name: String) fun getTestUser(): Observable&lt;TestUser&gt; { return Observable.just(TestUser("Brian")).flatMap { getUser() } // this compiles } fun getTestUser2(): Observable&lt;TestUser&gt; { val observable = Observable.just(TestUser("Brian")).flatMap { getUser() } return observable // this does not compile } fun getUser(): Observable&lt;TestUser?&gt; { return Observable.just(null) } </code></pre> <p>In <code>getTestUser2</code>, the compiler infers the final return type as <code>Observable&lt;TestUser?&gt;</code> and doesn't compile. However in <code>getTestUser</code> the code does compile, and when it's run, any subscriber to that observable may be in for a surprise when the <code>TestUser</code> comes back <code>null</code>.</p> <p>I'm guessing it's something to do with going back and forth between Kotlin and Java. But, the fact that the compiler <em>can</em> see the difference in <code>getTestUser2</code> makes me think this could be fixable.</p> <p>Edit</p> <p>This is on Kotlin 1.0, the final version released just yesterday (Feb 15, 2016).</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; ZmbvContext * const c = avctx->priv_data; int zret = Z_OK; int len = buf_size; int hi_ver, lo_ver, ret; if (c->pic.data[0]) avctx->release_buffer(avctx, &c->pic); c->pic.reference = 3; c->pic.buffer_hints = FF_BUFFER_HINTS_VALID; if ((ret = avctx->get_buffer(avctx, &c->pic)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } c->flags = buf[0]; buf++; len--; if (c->flags & ZMBV_KEYFRAME) { void *decode_intra = NULL; c->decode_intra= NULL; hi_ver = buf[0]; lo_ver = buf[1]; c->comp = buf[2]; c->fmt = buf[3]; c->bw = buf[4]; c->bh = buf[5]; buf += 6; len -= 6; av_log(avctx, AV_LOG_DEBUG, "Flags=%X ver=%i.%i comp=%i fmt=%i blk=%ix%i\n", c->flags,hi_ver,lo_ver,c->comp,c->fmt,c->bw,c->bh); if (hi_ver != 0 || lo_ver != 1) { av_log_ask_for_sample(avctx, "Unsupported version %i.%i\n", hi_ver, lo_ver); return AVERROR_PATCHWELCOME; } if (c->bw == 0 || c->bh == 0) { av_log_ask_for_sample(avctx, "Unsupported block size %ix%i\n", c->bw, c->bh); return AVERROR_PATCHWELCOME; } if (c->comp != 0 && c->comp != 1) { av_log_ask_for_sample(avctx, "Unsupported compression type %i\n", c->comp); return AVERROR_PATCHWELCOME; } switch (c->fmt) { case ZMBV_FMT_8BPP: c->bpp = 8; decode_intra = zmbv_decode_intra; c->decode_xor = zmbv_decode_xor_8; break; case ZMBV_FMT_15BPP: case ZMBV_FMT_16BPP: c->bpp = 16; decode_intra = zmbv_decode_intra; c->decode_xor = zmbv_decode_xor_16; break; #ifdef ZMBV_ENABLE_24BPP case ZMBV_FMT_24BPP: c->bpp = 24; decode_intra = zmbv_decode_intra; c->decode_xor = zmbv_decode_xor_24; break; #endif case ZMBV_FMT_32BPP: c->bpp = 32; decode_intra = zmbv_decode_intra; c->decode_xor = zmbv_decode_xor_32; break; default: c->decode_xor = NULL; av_log_ask_for_sample(avctx, "Unsupported (for now) format %i\n", c->fmt); return AVERROR_PATCHWELCOME; } zret = inflateReset(&c->zstream); if (zret != Z_OK) { av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret); return -1; } c->cur = av_realloc_f(c->cur, avctx->width * avctx->height, (c->bpp / 8)); c->prev = av_realloc_f(c->prev, avctx->width * avctx->height, (c->bpp / 8)); c->bx = (c->width + c->bw - 1) / c->bw; c->by = (c->height+ c->bh - 1) / c->bh; if (!c->cur || !c->prev) return -1; c->decode_intra= decode_intra; } if (c->decode_intra == NULL) { av_log(avctx, AV_LOG_ERROR, "Error! Got no format or no keyframe!\n"); return AVERROR_INVALIDDATA; } if (c->comp == 0) { memcpy(c->decomp_buf, buf, len); c->decomp_size = 1; } else { c->zstream.total_in = c->zstream.total_out = 0; c->zstream.next_in = (uint8_t*)buf; c->zstream.avail_in = len; c->zstream.next_out = c->decomp_buf; c->zstream.avail_out = c->decomp_size; zret = inflate(&c->zstream, Z_SYNC_FLUSH); if (zret != Z_OK && zret != Z_STREAM_END) { av_log(avctx, AV_LOG_ERROR, "inflate error %d\n", zret); return AVERROR_INVALIDDATA; } c->decomp_len = c->zstream.total_out; } if (c->flags & ZMBV_KEYFRAME) { c->pic.key_frame = 1; c->pic.pict_type = AV_PICTURE_TYPE_I; c->decode_intra(c); } else { c->pic.key_frame = 0; c->pic.pict_type = AV_PICTURE_TYPE_P; if (c->decomp_len) c->decode_xor(c); } { uint8_t *out, *src; int i, j; out = c->pic.data[0]; src = c->cur; switch (c->fmt) { case ZMBV_FMT_8BPP: for (j = 0; j < c->height; j++) { for (i = 0; i < c->width; i++) { out[i * 3 + 0] = c->pal[(*src) * 3 + 0]; out[i * 3 + 1] = c->pal[(*src) * 3 + 1]; out[i * 3 + 2] = c->pal[(*src) * 3 + 2]; src++; } out += c->pic.linesize[0]; } break; case ZMBV_FMT_15BPP: for (j = 0; j < c->height; j++) { for (i = 0; i < c->width; i++) { uint16_t tmp = AV_RL16(src); src += 2; out[i * 3 + 0] = (tmp & 0x7C00) >> 7; out[i * 3 + 1] = (tmp & 0x03E0) >> 2; out[i * 3 + 2] = (tmp & 0x001F) << 3; } out += c->pic.linesize[0]; } break; case ZMBV_FMT_16BPP: for (j = 0; j < c->height; j++) { for (i = 0; i < c->width; i++) { uint16_t tmp = AV_RL16(src); src += 2; out[i * 3 + 0] = (tmp & 0xF800) >> 8; out[i * 3 + 1] = (tmp & 0x07E0) >> 3; out[i * 3 + 2] = (tmp & 0x001F) << 3; } out += c->pic.linesize[0]; } break; #ifdef ZMBV_ENABLE_24BPP case ZMBV_FMT_24BPP: for (j = 0; j < c->height; j++) { memcpy(out, src, c->width * 3); src += c->width * 3; out += c->pic.linesize[0]; } break; #endif case ZMBV_FMT_32BPP: for (j = 0; j < c->height; j++) { for (i = 0; i < c->width; i++) { uint32_t tmp = AV_RL32(src); src += 4; AV_WB24(out+(i*3), tmp); } out += c->pic.linesize[0]; } break; default: av_log(avctx, AV_LOG_ERROR, "Cannot handle format %i\n", c->fmt); } FFSWAP(uint8_t *, c->cur, c->prev); } *data_size = sizeof(AVFrame); *(AVFrame*)data = c->pic; return buf_size; }
1threat
mixed numbers programming not working : <pre><code>def main(): num = int(input("Enter the Numerator:")) den = int(input("Enter the Denominator:")) whole_num = num // den fract_num = num % den print('The mixed number is {} and {}/{}', format (whole_num, fract_num,den)) main () </code></pre> <p>This is currently how I have my program written, so that when a person enters 23 as the numerator and 6 as the denominator is prints out the solution as a mixed number. But when I run my code it is still coming back with an error. Did I make a mistake somewhere? </p>
0debug
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; int ret; int slice_ret = 0; AVFrame *pict = data; s->flags = avctx->flags; s->flags2 = avctx->flags2; if (buf_size == 0) { if (s->low_delay == 0 && s->next_picture_ptr) { if ((ret = av_frame_ref(pict, &s->next_picture_ptr->f)) < 0) return ret; s->next_picture_ptr = NULL; *got_frame = 1; } return 0; } if (s->flags & CODEC_FLAG_TRUNCATED) { int next; if (CONFIG_MPEG4_DECODER && s->codec_id == AV_CODEC_ID_MPEG4) { next = ff_mpeg4_find_frame_end(&s->parse_context, buf, buf_size); } else if (CONFIG_H263_DECODER && s->codec_id == AV_CODEC_ID_H263) { next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size); } else if (CONFIG_H263P_DECODER && s->codec_id == AV_CODEC_ID_H263P) { next = ff_h263_find_frame_end(&s->parse_context, buf, buf_size); } else { av_log(s->avctx, AV_LOG_ERROR, "this codec does not support truncated bitstreams\n"); return AVERROR(ENOSYS); } if (ff_combine_frame(&s->parse_context, next, (const uint8_t **)&buf, &buf_size) < 0) return buf_size; } retry: if (s->divx_packed && s->bitstream_buffer_size) { int i; for(i=0; i < buf_size-3; i++) { if (buf[i]==0 && buf[i+1]==0 && buf[i+2]==1) { if (buf[i+3]==0xB0) { av_log(s->avctx, AV_LOG_WARNING, "Discarding excessive bitstream in packed xvid\n"); s->bitstream_buffer_size = 0; } break; } } } if (s->bitstream_buffer_size && (s->divx_packed || buf_size < 20)) ret = init_get_bits8(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size); else ret = init_get_bits8(&s->gb, buf, buf_size); s->bitstream_buffer_size = 0; if (ret < 0) return ret; if (!s->context_initialized) if ((ret = ff_MPV_common_init(s)) < 0) return ret; if (s->current_picture_ptr == NULL || s->current_picture_ptr->f.data[0]) { int i = ff_find_unused_picture(s, 0); if (i < 0) return i; s->current_picture_ptr = &s->picture[i]; } if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) { ret = ff_wmv2_decode_picture_header(s); } else if (CONFIG_MSMPEG4_DECODER && s->msmpeg4_version) { ret = ff_msmpeg4_decode_picture_header(s); } else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) { if (s->avctx->extradata_size && s->picture_number == 0) { GetBitContext gb; if (init_get_bits8(&gb, s->avctx->extradata, s->avctx->extradata_size) >= 0 ) ff_mpeg4_decode_picture_header(avctx->priv_data, &gb); } ret = ff_mpeg4_decode_picture_header(avctx->priv_data, &s->gb); } else if (CONFIG_H263I_DECODER && s->codec_id == AV_CODEC_ID_H263I) { ret = ff_intel_h263_decode_picture_header(s); } else if (CONFIG_FLV_DECODER && s->h263_flv) { ret = ff_flv_decode_picture_header(s); } else { ret = ff_h263_decode_picture_header(s); } if (ret < 0 || ret == FRAME_SKIPPED) { if ( s->width != avctx->coded_width || s->height != avctx->coded_height) { av_log(s->avctx, AV_LOG_WARNING, "Reverting picture dimensions change due to header decoding failure\n"); s->width = avctx->coded_width; s->height= avctx->coded_height; } } if (ret == FRAME_SKIPPED) return get_consumed_bytes(s, buf_size); if (ret < 0) { av_log(s->avctx, AV_LOG_ERROR, "header damaged\n"); return ret; } avctx->has_b_frames = !s->low_delay; if (ff_mpeg4_workaround_bugs(avctx) == 1) goto retry; if (s->width != avctx->coded_width || s->height != avctx->coded_height || s->context_reinit) { s->context_reinit = 0; ret = ff_set_dimensions(avctx, s->width, s->height); if (ret < 0) return ret; if ((ret = ff_MPV_common_frame_size_change(s))) return ret; } if (s->codec_id == AV_CODEC_ID_H263 || s->codec_id == AV_CODEC_ID_H263P || s->codec_id == AV_CODEC_ID_H263I) s->gob_index = ff_h263_get_gob_height(s); s->current_picture.f.pict_type = s->pict_type; s->current_picture.f.key_frame = s->pict_type == AV_PICTURE_TYPE_I; if (s->last_picture_ptr == NULL && (s->pict_type == AV_PICTURE_TYPE_B || s->droppable)) return get_consumed_bytes(s, buf_size); if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) || avctx->skip_frame >= AVDISCARD_ALL) return get_consumed_bytes(s, buf_size); if (s->next_p_frame_damaged) { if (s->pict_type == AV_PICTURE_TYPE_B) return get_consumed_bytes(s, buf_size); else s->next_p_frame_damaged = 0; } if ((!s->no_rounding) || s->pict_type == AV_PICTURE_TYPE_B) { s->me.qpel_put = s->dsp.put_qpel_pixels_tab; s->me.qpel_avg = s->dsp.avg_qpel_pixels_tab; } else { s->me.qpel_put = s->dsp.put_no_rnd_qpel_pixels_tab; s->me.qpel_avg = s->dsp.avg_qpel_pixels_tab; } if ((ret = ff_MPV_frame_start(s, avctx)) < 0) return ret; if (!s->divx_packed && !avctx->hwaccel) ff_thread_finish_setup(avctx); if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)) { ff_vdpau_mpeg4_decode_picture(s, s->gb.buffer, s->gb.buffer_end - s->gb.buffer); goto frame_end; } if (avctx->hwaccel) { ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer, s->gb.buffer_end - s->gb.buffer); if (ret < 0 ) return ret; } ff_mpeg_er_frame_start(s); if (CONFIG_WMV2_DECODER && s->msmpeg4_version == 5) { ret = ff_wmv2_decode_secondary_picture_header(s); if (ret < 0) return ret; if (ret == 1) goto frame_end; } s->mb_x = 0; s->mb_y = 0; slice_ret = decode_slice(s); while (s->mb_y < s->mb_height) { if (s->msmpeg4_version) { if (s->slice_height == 0 || s->mb_x != 0 || (s->mb_y % s->slice_height) != 0 || get_bits_left(&s->gb) < 0) break; } else { int prev_x = s->mb_x, prev_y = s->mb_y; if (ff_h263_resync(s) < 0) break; if (prev_y * s->mb_width + prev_x < s->mb_y * s->mb_width + s->mb_x) s->er.error_occurred = 1; } if (s->msmpeg4_version < 4 && s->h263_pred) ff_mpeg4_clean_buffers(s); if (decode_slice(s) < 0) slice_ret = AVERROR_INVALIDDATA; } if (s->msmpeg4_version && s->msmpeg4_version < 4 && s->pict_type == AV_PICTURE_TYPE_I) if (!CONFIG_MSMPEG4_DECODER || ff_msmpeg4_decode_ext_header(s, buf_size) < 0) s->er.error_status_table[s->mb_num - 1] = ER_MB_ERROR; av_assert1(s->bitstream_buffer_size == 0); frame_end: ff_er_frame_end(&s->er); if (avctx->hwaccel) { ret = avctx->hwaccel->end_frame(avctx); if (ret < 0) return ret; } ff_MPV_frame_end(s); if (s->codec_id == AV_CODEC_ID_MPEG4 && s->divx_packed) { int current_pos = s->gb.buffer == s->bitstream_buffer ? 0 : (get_bits_count(&s->gb) >> 3); int startcode_found = 0; if (buf_size - current_pos > 7) { int i; for (i = current_pos; i < buf_size - 4; i++) if (buf[i] == 0 && buf[i + 1] == 0 && buf[i + 2] == 1 && buf[i + 3] == 0xB6) { startcode_found = !(buf[i + 4] & 0x40); break; } } if (startcode_found) { av_fast_malloc(&s->bitstream_buffer, &s->allocated_bitstream_buffer_size, buf_size - current_pos + FF_INPUT_BUFFER_PADDING_SIZE); if (!s->bitstream_buffer) return AVERROR(ENOMEM); memcpy(s->bitstream_buffer, buf + current_pos, buf_size - current_pos); s->bitstream_buffer_size = buf_size - current_pos; } } if (!s->divx_packed && avctx->hwaccel) ff_thread_finish_setup(avctx); av_assert1(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type); av_assert1(s->current_picture.f.pict_type == s->pict_type); if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) { if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0) return ret; ff_print_debug_info(s, s->current_picture_ptr, pict); ff_mpv_export_qp_table(s, pict, s->current_picture_ptr, FF_QSCALE_TYPE_MPEG1); } else if (s->last_picture_ptr != NULL) { if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0) return ret; ff_print_debug_info(s, s->last_picture_ptr, pict); ff_mpv_export_qp_table(s, pict, s->last_picture_ptr, FF_QSCALE_TYPE_MPEG1); } if (s->last_picture_ptr || s->low_delay) { if ( pict->format == AV_PIX_FMT_YUV420P && (s->codec_tag == AV_RL32("GEOV") || s->codec_tag == AV_RL32("GEOX"))) { int x, y, p; av_frame_make_writable(pict); for (p=0; p<3; p++) { int w = FF_CEIL_RSHIFT(pict-> width, !!p); int h = FF_CEIL_RSHIFT(pict->height, !!p); int linesize = pict->linesize[p]; for (y=0; y<(h>>1); y++) for (x=0; x<w; x++) FFSWAP(int, pict->data[p][x + y*linesize], pict->data[p][x + (h-1-y)*linesize]); } } *got_frame = 1; } if (slice_ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) return ret; else return get_consumed_bytes(s, buf_size); }
1threat
Regex in React email validation : <p>I'm trying to set an error for when the email isn't correct. When I'm checking if the string is empty the form alerts with the proper message. But when I'm checking if the email matches the regular expression it doesn't work. Any ideas?</p> <pre><code>import React, { Component } from 'react'; import { Link } from 'react-router'; // Our custom input component, which uses label, id and tabIndex properties var MyInput = React.createClass({ render: function() { // Get the error message by calling a function, passed to this // component through getError property var errorMessage = this.props.getError(this.props.id); return ( &lt;fieldset className={"form-fieldset ui-input first " + (errorMessage ? "erroneous" : "")}&gt; &lt;input type="text" name={this.props.id} id={this.props.id} tabIndex={this.props.tabIndex} /&gt; &lt;label htmlFor={this.props.id}&gt; &lt;span data-text={this.props.label}&gt;{this.props.label}&lt;/span&gt; &lt;/label&gt; &lt;span className="error"&gt;{errorMessage ? errorMessage : null}&lt;/span&gt; &lt;/fieldset&gt; ) } }); // Form var SendForm = React.createClass ({ getError: function (fieldName) { return this.state[fieldName+"Error"]; }, setError: function (fieldName, error) { var update = {}; update[fieldName+"Error"] = error; this.setState(update); }, getInitialState: function() { return { isMailSent: false, errorMessage: null, }; }, componentDidMount: function () { // This will be called right when the form element is displayed $('form').parsley() }, validateForm: function(){ var hasErrors = false; if ($('#company').val().length &lt; 1){ this.setError("company", "Please enter your company name"); hasErrors = true; } else this.setError("company", null) if ($('#industry').val().length &lt; 1){ this.setError("industry", "Please enter the industry"); hasErrors = true; } else this.setError("industry", null) if ($('#firstName').val().length &lt; 1){ this.setError("firstName", "Please enter your first name"); hasErrors = true; } else this.setError("firstName", null) if ($('#lastName').val().length &lt; 1) { this.setError("lastName", "Please enter your last name"); hasErrors = true; } else this.setError("lastName", null) if ($('#email').val() == '') { this.setError("email", "Please enter your email address"); hasErrors = true; } else this.setError("email", null) if ($('#email').val() !== /^[a-zA-Z0-9]+@+[a-zA-Z0-9]+.+[A-z]/) { this.setError("email", "Please enter a valid email address"); hasErrors = true; } else this.setError("email", null) if ($('#phone').val().length &lt; 1) { this.setError("phone", "Please enter your phone number"); hasErrors = true; } else this.setError("phone", null) return !hasErrors; }, handleSubmit: function (e) { e.preventDefault(); // Check if data is valid if (!this.validateForm()) { //return if not valid return; } // Get the form. var form = $('form'); // Serialize the form data. var formData = $(form).serialize(); var self = this; console.log(formData) // Submit the form using AJAX. $.ajax({ type: 'POST', url: 'email-handler.php', data: formData }).done(function(response) { // Update the state, notifying that mail was sent // This value will be used in the form when rendering self.setState({isMailSent: true}) // Hide the form $('.formCont').hide(); }).fail(function(data) { // Make sure that the formMessages div has the 'error' class. self.setState({errorMessage : "Something went wrong. Please try again."}); }); }, render: function(){ return ( &lt;div className="companyForm"&gt; &lt;h2 className="header compFormHead"&gt;Form&lt;/h2&gt; { this.state.isMailSent ? &lt;div className="success"&gt;Thank you for submission. Someone will be in contact with you shortly.&lt;/div&gt; : null } &lt;div className="container formCont"&gt; &lt;form method="post" acceptCharset="utf-8" autoComplete="off" onSubmit={this.handleSubmit}&gt; &lt;MyInput id="company" label="Company" tabIndex="1" getError={this.getError}/&gt; &lt;MyInput id="industry" label="Industry" tabIndex="2" getError={this.getError}/&gt; &lt;div className="two-column"&gt; &lt;MyInput id="firstName" label="First Name" tabIndex="3" getError={this.getError}/&gt; &lt;MyInput id="lastName" label="Last Name" tabIndex="4" getError={this.getError}/&gt; &lt;/div&gt; &lt;div className="two-column"&gt; &lt;MyInput id="email" type="email" label="Email" tabIndex="5" getError={this.getError}/&gt; &lt;MyInput id="phone" label="Phone" tabIndex="6" getError={this.getError}/&gt; &lt;/div&gt; {this.state.errorMessage ? &lt;div className="fail"&gt;{this.state.errorMessage}&lt;/div&gt; : null} &lt;div className="form"&gt; &lt;input type="submit" name="submit" className="btn btn-primary" value="APPLY" tabIndex="7" /&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; ); } }); export default SendForm; </code></pre>
0debug
What should ls $GOROOT and ls $GOPATH look like (not a repeat)? : This is not a repeat of this question: http://stackoverflow.com/questions/7970390/what-should-be-the-values-of-gopath-and-goroot I don't want to know what the values should be. I want to know what I should see when I type `ls $GOROOT` or `ls $GOPATH` into console. I'm pretty sure I set things up wrong following a tutorial almost a year ago, and I want to be able to confirm that these two are pointing to where they should be by simply checking that what they point to looks right. Here's where I am right now. It looks like `$GOROOT` is pointing nowhere. I'm pretty sure it should be pointing at `usr/local/go`, but it would be a lot easier to confirm if I knew what the expected result of `ls $GOROOT` is supposed to be. As for `$GOPATH` I'm not totally sure if my "workspace" is where all my go code is, or maybe just the github stuff, or maybe the particular folder I'm working within. I know it's supposed to point to my "work space," but I don't know what that work space I'm looking for looks like. Sephs-MBP:ThumbzArt seph$ $GOROOT Sephs-MBP:ThumbzArt seph$ $GOPATH -bash: /Users/seph/code/golang: is a directory Sephs-MBP:ThumbzArt seph$ ls $GOROOT Bman.jpg README.md ThumbzArt.sublime-workspacescripts thumbzart.go LICENSE.md ThumbzArt.sublime-project public templates ticktock.go Sephs-MBP:ThumbzArt seph$ $GOPATH -bash: /Users/seph/code/golang: is a directory Sephs-MBP:ThumbzArt seph$ ls $GOPATH - bin p pkg src Sephs-MBP:ThumbzArt seph$ ls /usr/local/go AUTHORS CONTRIBUTORS PATENTS VERSION bin doc lib pkg src CONTRIBUTING.md LICENSE README.md api blog favicon.ico misc robots.txt test Sephs-MBP:ThumbzArt seph$ I know this question seems ridiculous, but it's hard to confirm things for which you have no expected results. Thanks you
0debug
int bdrv_pwrite(BlockDriverState *bs, int64_t offset, const void *buf1, int count1) { BlockDriver *drv = bs->drv; if (!drv) return -ENOMEDIUM; if (!drv->bdrv_pwrite) return bdrv_pwrite_em(bs, offset, buf1, count1); return drv->bdrv_pwrite(bs, offset, buf1, count1); }
1threat
what will be the valuse of i when it already initialize with 0 & with if condition & why? : **this code give the valuse of i = 1 but why it give this value when there is 5 and also initialize with 3.** > C language int main(){ int i = 0; if(i==0){ i=((5,(i=3)),i=1); printf("%d",i); } else{ printf("Hello"); } }
0debug
def check_monthnumb_number(monthnum2): if(monthnum2==1 or monthnum2==3 or monthnum2==5 or monthnum2==7 or monthnum2==8 or monthnum2==10 or monthnum2==12): return True else: return False
0debug
How can I add text multiple text views to the list view items in android? : <p>How can I add text multiple text views to the list view items in android?Please add the code</p>
0debug
Multiplying a for loop in C : I am preparing for an upcoming exam when I came across this: char a = 'a'; char b = 'b'; int ai[] = { 1, 2 }; int i = 0; Assume that word size is 32 bits, that an int is 32 bits and that memory allocations are made in the reverse order to the declarations starting at address location 68. ii) Draw a diagram that shows the effect of executing the following lines of code. for (i = 0; i < 8; i++) *(&a – i) = 'z'; It might sound weird,but I am a newbie to C and it is the first time I see multiplication of a for loop.Explanation to this for loop and the multiplication applied to it would be appreciated.
0debug
What is exit status 42? : <p>I would like to know what that means, Im doing a program with matrix, kinda like pacman, but whenever I try to interact with the program it ends and returns "Exit status 42"</p>
0debug
Print every N-th Element from an Array JS : <ol> <li>Print every N-th Element from an Array Write a JS function that collects every element of an array, on a given step. The input comes as array of strings. The last element is N - the step. The collections are every element on the N-th step starting from the first one. If the step is "3", you need to print the 1-st, the 4-th, the 7-th … and so on, until you reach the end of the array. Then, print elements in a row, separated by single space.</li> </ol> <p>Example: Input Output ['5', '20', '31', '4', '20', '2'] 5 31 20</p>
0debug
Make an image rotate depending on menu hover mouse position : OK, so This may have parallel questions like [this one][1] but I still have not quite got what I am aiming at. I want to make a png image of an arrow rotate to point to the tabs of the menu in a wordpress site - so if you hover over the menu link, the image points at it too, but when you mouse away, the image returns to normal orientation. So, I don't want it to totally follow the mouse, just when the mouse is over a menu item. Thanks. [1]: http://stackoverflow.com/questions/7143806/make-an-image-follow-mouse-pointer
0debug
what should be the regex, if i need the text withing the quotes as one element? : my input string is: apple, orange, "banana,cherry", peach i need the output as: apple orange banana,cherry peach
0debug
Using Intellij Java Apache Poi, how to get rid of java.lang.nullpointerexception reading non-empty integer value from Excel file : <p>I want to read two integer values 100 and 200 in cell A1 and A2 using Intellij with Apache Poi. </p> <p>Issue: I am getting java.lang.nullpointerexception at the line num1 below.</p> <p>I've checked that I have apache poi jars added and correct import directives added. Excel row and column index starts at 1. Hence, getRow(1).getCell(1) refers to cell A1. Also, getSheetAt(0) refers to the first and only sheet that I have in my excel file. </p> <pre><code>import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFSheet; import java.io.File; import java.io.FileInputStream; import java.lang.Exception; int num1, num2, sum1; File src=new File("C:/test/testdata.xlsx"); FileInputStream fis=new FileInputStream(src); XSSFWorkbook wb=new XSSFWorkbook(fis); XSSFSheet sheet = wb.getSheetAt(0); num1 = Integer.parseInt(sheet.getRow(1).getCell(1).getStringCellValue()); num2 = Integer.parseInt(sheet.getRow(2).getCell(1).getStringCellValue()); sum1 = num1 + num2; System.out.println("The sum: " + sum1); </code></pre> <p>When running the code successfully, I should see num1 and num2 populated from excel file, and the sum is printed in the console.</p>
0debug
def sequential_search(dlist, item): pos = 0 found = False while pos < len(dlist) and not found: if dlist[pos] == item: found = True else: pos = pos + 1 return found, pos
0debug
CPUState *cpu_generic_init(const char *typename, const char *cpu_model) { const char *cpu_type = cpu_parse_cpu_model(typename, cpu_model); if (cpu_type) { return cpu_create(cpu_type); } return NULL; }
1threat
static inline void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { TranslationBlock *tb; tb = ctx->tb; if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) { if (n == 0) gen_op_goto_tb0(TBPARAM(tb)); else gen_op_goto_tb1(TBPARAM(tb)); gen_op_set_T1(dest); gen_op_b_T1(); gen_op_set_T0((long)tb + n); if (ctx->singlestep_enabled) gen_op_debug(); gen_op_exit_tb(); } else { gen_op_set_T1(dest); gen_op_b_T1(); gen_op_reset_T0(); if (ctx->singlestep_enabled) gen_op_debug(); gen_op_exit_tb(); } }
1threat
can I export a database that I only have access through "select" (oracle database) : If someone give me access to "select" his oracle database, can I export all his data using sqldeveloper? How? He gave me access through grant statement.
0debug
static void omap_pwl_update(struct omap_pwl_s *s) { int output = (s->clk && s->enable) ? s->level : 0; if (output != s->output) { s->output = output; printf("%s: Backlight now at %i/256\n", __FUNCTION__, output); } }
1threat
static int ftp_close(URLContext *h) { FTPContext *s = h->priv_data; av_dlog(h, "ftp protocol close\n"); ftp_close_both_connections(s); av_freep(&s->user); av_freep(&s->password); av_freep(&s->hostname); av_freep(&s->path); av_freep(&s->features); return 0; }
1threat
how is this program printing in reverse direction? : <p>output : 123456789987654321 I understand 123456789 but how its printing 987654321</p> <pre><code> #include &lt;iostream&gt; using namespace std; void printNum ( int num ) { cout &lt;&lt; num; if ( num &lt; 9 ) { printNum ( num + 1 ); } cout &lt;&lt; num; } int main() { printNum ( 1 ); } </code></pre>
0debug
yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, int y, enum AVPixelFormat target, int hasAlpha) { int i; int step = (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) ? 3 : 4; int err[4] = {0}; if( target == AV_PIX_FMT_BGR4_BYTE || target == AV_PIX_FMT_RGB4_BYTE || target == AV_PIX_FMT_BGR8 || target == AV_PIX_FMT_RGB8) step = 1; for (i = 0; i < dstW; i++) { int j; int Y = 1<<9; int U = (1<<9)-(128 << 19); int V = (1<<9)-(128 << 19); int A; for (j = 0; j < lumFilterSize; j++) { Y += lumSrc[j][i] * lumFilter[j]; } for (j = 0; j < chrFilterSize; j++) { U += chrUSrc[j][i] * chrFilter[j]; V += chrVSrc[j][i] * chrFilter[j]; } Y >>= 10; U >>= 10; V >>= 10; if (hasAlpha) { A = 1 << 18; for (j = 0; j < lumFilterSize; j++) { A += alpSrc[j][i] * lumFilter[j]; } A >>= 19; if (A & 0x100) A = av_clip_uint8(A); } yuv2rgb_write_full(c, dest, i, Y, A, U, V, y, target, hasAlpha, err); dest += step; } c->dither_error[0][i] = err[0]; c->dither_error[1][i] = err[1]; c->dither_error[2][i] = err[2]; }
1threat
static void coroutine_fn sd_write_done(SheepdogAIOCB *acb) { BDRVSheepdogState *s = acb->common.bs->opaque; struct iovec iov; AIOReq *aio_req; uint32_t offset, data_len, mn, mx; mn = s->min_dirty_data_idx; mx = s->max_dirty_data_idx; if (mn <= mx) { offset = sizeof(s->inode) - sizeof(s->inode.data_vdi_id) + mn * sizeof(s->inode.data_vdi_id[0]); data_len = (mx - mn + 1) * sizeof(s->inode.data_vdi_id[0]); s->min_dirty_data_idx = UINT32_MAX; s->max_dirty_data_idx = 0; iov.iov_base = &s->inode; iov.iov_len = sizeof(s->inode); aio_req = alloc_aio_req(s, acb, vid_to_vdi_oid(s->inode.vdi_id), data_len, offset, 0, 0, offset); QLIST_INSERT_HEAD(&s->inflight_aio_head, aio_req, aio_siblings); add_aio_request(s, aio_req, &iov, 1, false, AIOCB_WRITE_UDATA); acb->aio_done_func = sd_finish_aiocb; acb->aiocb_type = AIOCB_WRITE_UDATA; return; } sd_finish_aiocb(acb); }
1threat
how to use this subquary : i want to see if time is below 0 with this quary select * from voorwerp WHERE (Select (((Cast(((DATEADD(dd, looptijd, datum)) - getdate()) as float) * 24.0)*60.0)*60.0) AS tijd from voorwerp) <= 0 i get this error : Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
0debug
How to test an exception was not thrown with Jest? : <p>The Jest docs do not demonstrate a way of asserting that no exception was thrown, only that one was.</p> <p><code>expect(() =&gt; ...error...).toThrow(error)</code></p> <p>How do I assert if one was <strong>not</strong> thrown?</p>
0debug
static void cmv_decode_inter(CmvContext * s, const uint8_t *buf, const uint8_t *buf_end){ const uint8_t *raw = buf + (s->avctx->width*s->avctx->height/16); int x,y,i; i = 0; for(y=0; y<s->avctx->height/4; y++) for(x=0; x<s->avctx->width/4 && buf+i<buf_end; x++) { if (buf[i]==0xFF) { unsigned char *dst = s->frame.data[0] + (y*4)*s->frame.linesize[0] + x*4; if (raw+16<buf_end && *raw==0xFF) { raw++; memcpy(dst, raw, 4); memcpy(dst+s->frame.linesize[0], raw+4, 4); memcpy(dst+2*s->frame.linesize[0], raw+8, 4); memcpy(dst+3*s->frame.linesize[0], raw+12, 4); raw+=16; }else if(raw<buf_end) { int xoffset = (*raw & 0xF) - 7; int yoffset = ((*raw >> 4)) - 7; if (s->last2_frame.data[0]) cmv_motcomp(s->frame.data[0], s->frame.linesize[0], s->last2_frame.data[0], s->last2_frame.linesize[0], x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height); raw++; } }else{ int xoffset = (buf[i] & 0xF) - 7; int yoffset = ((buf[i] >> 4)) - 7; cmv_motcomp(s->frame.data[0], s->frame.linesize[0], s->last_frame.data[0], s->last_frame.linesize[0], x*4, y*4, xoffset, yoffset, s->avctx->width, s->avctx->height); } i++; } }
1threat
connection.query('SELECT * FROM users WHERE username = ' + input_string)
1threat
Sort a array to form three array : I want to sort an array in a way that it give back three arrays. So` ``` var myArray = ['1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3','1','2','3']; ``` here the values can be numbers, string, objects etc. I want three arrays Like : ``` var myArray1 = ['1','1','1','1','1','1','1','1','1','1']; var myArray2 = ['2','2','2','2','2','2','2','2','2','2']; var myArray3 = ['3','3','3','3','3','3','3','3','3','3']; ``` I want to know the Logic.
0debug
Count the number of true members in an array of boolean values : <p>New to javascript and I'm having trouble counting the number of trues in an array of boolean values. I'm trying to use the reduce() function. Can someone tell me what I'm doing wrong?</p> <pre><code> //trying to count the number of true in an array myCount = [false,false,true,false,true].reduce(function(a,b){ return b?a++:a; },0); alert("myCount ="+ myCount); // this is always 0 </code></pre>
0debug
Alarm Functionality In ReactNative For Android And iOS : <p>I want to make app that play music every day at specific time (for example : 07:00) even if the app in background or turned off</p> <p>I had done it in android with <code>Java &amp; Android SDK</code> using <code>Alarm Manager</code> , i'm looking for something like that for ReactNative</p> <p>I had searched for libraries but i did not found useful resources</p>
0debug
int qemu_add_polling_cb(PollingFunc *func, void *opaque) { PollingEntry **ppe, *pe; pe = g_malloc0(sizeof(PollingEntry)); pe->func = func; pe->opaque = opaque; for(ppe = &first_polling_entry; *ppe != NULL; ppe = &(*ppe)->next); *ppe = pe; return 0; }
1threat
static int MP3lame_encode_frame(AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data) { Mp3AudioContext *s = avctx->priv_data; int len; int lame_result; if(data){ if (s->stereo) { lame_result = lame_encode_buffer_interleaved( s->gfp, data, avctx->frame_size, s->buffer + s->buffer_index, BUFFER_SIZE - s->buffer_index ); } else { lame_result = lame_encode_buffer( s->gfp, data, data, avctx->frame_size, s->buffer + s->buffer_index, BUFFER_SIZE - s->buffer_index ); } }else{ lame_result= lame_encode_flush( s->gfp, s->buffer + s->buffer_index, BUFFER_SIZE - s->buffer_index ); } if(lame_result==-1) { av_log(avctx, AV_LOG_ERROR, "lame: output buffer too small (buffer index: %d, free bytes: %d)\n", s->buffer_index, BUFFER_SIZE - s->buffer_index); return 0; } s->buffer_index += lame_result; if(s->buffer_index<4) return 0; len= mp3len(s->buffer, NULL, NULL); if(len <= s->buffer_index){ memcpy(frame, s->buffer, len); s->buffer_index -= len; memmove(s->buffer, s->buffer+len, s->buffer_index); return len; }else return 0; }
1threat
JOIN with GROUP BY in a Normalized DB (ie. Owww, my head!) : I've normalized my DB but can't seem to return the data I'm looking for in the right way. I've got 5 tables: 1. Resources (5 resources) 2. Topics (10 topics) 3. Chapters (10 chapters) 4. Topics-to-Resources (18 topic to resource links) 5. Topics-to-Chapters (18 topic to chapter links) Check out this [SQL Fiddle][1]... I need to collect all the records in the Resources table and group each of them with their corresponding topics and chapters (from the Topics-to-Resources and Topics-to-Chapters tables) Can anyone suggest the right SQL query to return the 5 resource records with their attending topics and chapters? Many thanks in advance!! [1]: http://sqlfiddle.com/#!9/af2462/13
0debug
static unsigned int crisv32_decoder(CPUCRISState *env, DisasContext *dc) { int insn_len = 2; int i; if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP | CPU_LOG_TB_OP_OPT))) { tcg_gen_debug_insn_start(dc->pc); } dc->ir = cris_fetch(env, dc, dc->pc, 2, 0); dc->opcode = EXTRACT_FIELD(dc->ir, 4, 11); dc->op1 = EXTRACT_FIELD(dc->ir, 0, 3); dc->op2 = EXTRACT_FIELD(dc->ir, 12, 15); dc->zsize = EXTRACT_FIELD(dc->ir, 4, 4); dc->zzsize = EXTRACT_FIELD(dc->ir, 4, 5); dc->postinc = EXTRACT_FIELD(dc->ir, 10, 10); for (i = 0; i < ARRAY_SIZE(decinfo); i++) { if ((dc->opcode & decinfo[i].mask) == decinfo[i].bits) { insn_len = decinfo[i].dec(env, dc); break; } } #if !defined(CONFIG_USER_ONLY) if (dc->tb_flags & S_FLAG) { int l1; l1 = gen_new_label(); tcg_gen_brcondi_tl(TCG_COND_NE, cpu_PR[PR_SPC], dc->pc, l1); cris_evaluate_flags(dc); t_gen_mov_env_TN(trap_vector, tcg_const_tl(3)); tcg_gen_movi_tl(env_pc, dc->pc + insn_len); tcg_gen_movi_tl(cpu_PR[PR_SPC], dc->pc + insn_len); t_gen_raise_exception(EXCP_BREAK); gen_set_label(l1); } #endif return insn_len; }
1threat
Java - Finding the Highest Value Card of the Same Suit : I am trying to program a card game, but am stuck on one step. I have four card objects c1, c2, c3, c4 of random values and suits. Structured : Card(int Suit, int Value); I'm trying to find the highest Value card of the SAME suit as c1, in other words. The person who put down the highest card that has the same suit as card c1, i.e. Spades, Hearts, Clubs, Diamonds, wins the pile of those four cards. The person that put down the c1 card can still win the pile if they have the highest value card since it has the same suit as the original (it being the original). I have methods already coded for returning the suit and value of the cards i.e. getSuit() & getValue(). Is there an easy way to do this? I can only imagine lots of nested if conditions to attain this.
0debug
Difference between ToCharArray and ToArray : <p>What is the difference between <code>ToCharArray</code> and <code>ToArray</code></p> <pre><code>string mystring = "abcdef"; char[] items1 = mystring.ToCharArray(); char[] items2 = mystring.ToArray(); </code></pre> <p>The result seems to be the same.</p>
0debug
void add_boot_device_path(int32_t bootindex, DeviceState *dev, const char *suffix) { FWBootEntry *node, *i; if (bootindex < 0) { return; } assert(dev != NULL || suffix != NULL); node = g_malloc0(sizeof(FWBootEntry)); node->bootindex = bootindex; node->suffix = suffix ? g_strdup(suffix) : NULL; node->dev = dev; QTAILQ_FOREACH(i, &fw_boot_order, link) { if (i->bootindex == bootindex) { fprintf(stderr, "Two devices with same boot index %d\n", bootindex); exit(1); } else if (i->bootindex < bootindex) { continue; } QTAILQ_INSERT_BEFORE(i, node, link); return; } QTAILQ_INSERT_TAIL(&fw_boot_order, node, link); }
1threat
Get Id from clickable list. : I'm trying to create a list in HTML where each item in the list can be clicked. But I need to know the ID of the item that was clicked. I have been trying to have a div surround the list item and have an onClick and a ID tag associated. Then get the ID tag from the synthetic event. But my list items are complex so they have sub dom elements. Meaning if I click the p tag it will not return the ID associated with the div tag. I'm not sure what the best would be to do this? strong text
0debug
javascript select all data-attributes : <p>How can select all data-attributes and return an array </p> <pre><code>&lt;ul data-cars="ford"&gt; &lt;li data-model="mustang"&gt;&lt;/li&gt; &lt;li data-color="blue"&gt;&lt;/li&gt; &lt;li data-doors="5"&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Array should return model, color and doors.</p>
0debug
How can I reference a specific row(s) in a data frame using an instance of a column variable in r? : <p>Lets say I have the following data frame in r:</p> <pre><code>&gt; patientData patientID age diabetes status 1 1 25 Type 1 Poor 2 2 34 Type 2 Improved 3 3 28 Type 1 Excellent 4 4 52 Type 1 Poor </code></pre> <p>How can I reference a specific row or group of rows by using the specific value/level of a particular column rather than the row index? For instance, if I wanted to set a variable x to equal all of the rows which contain a patient with Type 1 diabetes or all of the rows that contain a patient in "Improved" status, how would I do that?</p>
0debug
how to create a new column, which tells if a value is uniquely contained in another column? : I'm working with power query language (M) for Excel, and I would like to create a new column based on a condition like: New_column = if [Order number] is unique, then "1" else "0" How can I check uniqueness with M code? Order number is a column I have in my dataset (where different order numbers appear many times depending on what production phase they are in), and I would like to create a new column with dummy values 1, 0 which tells me if a the order number in the current row is unique or not (as some only undergo one production phase).
0debug
void qmp_x_blockdev_insert_medium(const char *device, const char *node_name, Error **errp) { BlockDriverState *bs; bs = bdrv_find_node(node_name); if (!bs) { error_setg(errp, "Node '%s' not found", node_name); return; } if (bs->blk) { error_setg(errp, "Node '%s' is already in use by '%s'", node_name, blk_name(bs->blk)); return; } qmp_blockdev_insert_anon_medium(device, bs, errp); }
1threat
How to match a pattern and replace another : <p>I have a .pro file which contains a line "Max_length: 123". I need to take a usser input value, eg: 145, and reframe line like"Max_length: 145". How?</p>
0debug
Shape sheet formula for resizing only the parent shape not the sub shapes of the parent shape : A parent shape has 3 sub shapes in it. When parent shape is resized the sub shapes(3) are also getting resized. So, when I resize the parent shape only particular sub shapes should resize not all. A shape sheet formula is required to above situation.
0debug
null.jpg being returned for carousel posts via Instagram API : <p>It looks like the Instagram API does not support the new Instagram carousel feature. The images results only contain <a href="https://instagramstatic-a.akamaihd.net/null.jpg" rel="noreferrer">https://instagramstatic-a.akamaihd.net/null.jpg</a> and not the cover image.</p> <p>Any ideas how to retrieve these via the API?</p>
0debug
static av_always_inline void thread_park_workers(ThreadContext *c, int thread_count) { while (c->current_job != thread_count + c->job_count) pthread_cond_wait(&c->last_job_cond, &c->current_job_lock); pthread_mutex_unlock(&c->current_job_lock); }
1threat
How to include jQuery properly in angular cli 1.0.0-rc.0? : <p>I use jQuery-based select2 component in my AngularJS project. I had similar issue as guys here: <a href="https://github.com/fronteed/icheck/issues/322" rel="noreferrer">https://github.com/fronteed/icheck/issues/322</a>, and solved it using advice from there. To be accurate, I received error <code>TypeError: $(...).select2 is not a function</code> when not using that advice.</p> <p>i.e. I added next lines to configuration of Webpack in <code>@angular/cli/models/webpack-configs/common.js</code>.</p> <pre><code>plugins: [ new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery" }) ] </code></pre> <p>Is it the best possible way to enable jQuery in angular/cli?</p> <p>I don't think that doing same as in <a href="https://github.com/angular/angular-cli/wiki/stories-global-lib" rel="noreferrer">https://github.com/angular/angular-cli/wiki/stories-global-lib</a> is correct way, because </p> <p>a) webpack bundles jQuery without need to specify it in scripts </p> <p>b) it still throws <code>TypeError: $(...).select2 is not a function</code> error when you include it as described in story.</p>
0debug
Error message in c invalid binary : hi I am a college student working on a c program i have most of it done but with one error msg in c Im getting a error Type invalid operands to binary & (have 'int *' and 'int') here is my program problem occurs line 34 or the fscanf num1 #include <stdio.h> #include <stdlib.h> FILE *infile; FILE *prnt; main() { int num1, num2, nums; char complex; float fcost; char name [11]; infile = fopen ("F:/DATA.txt", "r"); prnt = fopen ("F:/income.txt", "w"); if (infile == 0) { printf ("FILE NOT ON DISK\n"); system("pause"); return 0; } fprintf (prnt, "%-15s %-23s %6s\n\n", "ABAHLMAN", "Program 1", "PAGE 1"); fprintf (prnt, "\n"); fscanf (infile, " %i %i %i %f %c", &nums &num1 &num2 &fcost &name); while (!feof (infile)) { int area = (nums * 200) + (num1 * 300) + (num2 * 450); float cost = fcost + (area * 75.00); double income = 12 * ((nums *450) + (num1 * 550) + (num2 *700)); float payback = cost/ income; fprintf (prnt, "%-10s %5f %7c %9.2f\n", name, payback, area, cost); fscanf (infile, " %d %d %d %f %c", &nums &num1 &num2 &fcost &name); } fclose (infile); fclose (prnt); return 0; }
0debug
Docker - what does `docker run --restart always` actually do? : <p>Although it seems like the --restart flag is simple and straightforward, I came up with a number of questions when experimenting with it: </p> <ol> <li>With respect to <code>ENTRYPOINT</code> definitions - what are the actual defined semantics during restart?</li> <li>If I <code>exec</code> into the container (I am on a DDC) and kill -9 the process, it restarts, but if I do <code>docker kill</code> it does not. Why?</li> <li>How does restart interact with Shared Data Containers / Named Volumes?</li> </ol>
0debug
Swift 3 Getting nil value when I shouldn't be - MKMapView : <p>Below is my code to placing an annotation on a Map View. I'm getting a "unexpectedly found nil while unwrapping optional value error". I do not know why my annotation value is giving a nil value.</p> <pre><code> import UIKit import MapKit class MapViewcontroller: UIViewController { var itemStore: ItemStore! @IBOutlet weak var mapView: MKMapView! override func viewDidLoad() { super.viewDidLoad() print("test") let annotation = MKPointAnnotation() annotation.coordinate = CLLocationCoordinate2D(latitude: 40.71304, longitude: -74.0072) annotation.title = "Test" self.mapView.addAnnotation(annotation) //error here } </code></pre>
0debug
How to cout with input in c++? : <p>Hello guys actually i want to show output with input e.g:</p> <pre><code>int main() int a, b, c; cin &gt;&gt;a &gt;&gt;b; c = a-b; cout &lt;&lt;"Here would be input e.g: 4+5=" &lt;&lt; c &lt;&lt;endl; cout &lt;&lt;"Here would be input e.g: 4-5=" &lt;&lt; e &lt;&lt;endl; </code></pre> <p>If input is in this format a+b and user enter input's then output show after input like this 4+5= and after equal answer would there. Thanx in advance</p>
0debug
MutationObserver class changes : <p>I am using <code>MutationObserver</code> to detect when a specific class has been added to an element. </p> <pre><code>const observer = new MutationObserver((mutations) =&gt; { mutations.forEach((mutation) =&gt; { const el = mutation.target; if ((!mutation.oldValue || !mutation.oldValue.match(/\bis-busy\b/)) &amp;&amp; mutation.target.classList &amp;&amp; mutation.target.classList.contains('is-busy')){ alert('is-busy class added'); } }); }); observer.observe(document.querySelector('div'), { attributes: true, attributeOldValue: true, attributeFilter: ['class'] }); </code></pre> <p>My question is: <strong>Is there a better way to verify that this is a newly added class?</strong> Currently I am using regex to check that the class didn't exist previously and <code>classList</code> to check that the class exists now. Seems messy</p> <p><a href="https://jsfiddle.net/s53o8dLe/12/" rel="noreferrer">Fiddle</a></p>
0debug
Asynchronous Requests in Python : I want to distribute some image files to APIs. The way I'm doing it right now is by using http POST requests from a controller, but that ends up taking too much time. What is the best way to do such a thing, Requests? Messages? Shared Memory? What are the best libraries to implement it?
0debug
Pandas Dataframe or similar in C#.NET : <p>I am currently working on implement the C# version of a Gurobi linear program model that was earlier built in Python. I have a number of CSV files from which I was importing the data and creating pandas dataframes, and I was fetching columns from those dataframes to create variables that I was using in my Linear Program. The python code for creating the variables using dataframes is as follows:</p> <pre><code>dataPath = "C:/Users/XYZ/Desktop/LinearProgramming/TestData" routeData = pd.DataFrame.from_csv(os.path.join(dataPath, "DirectLink.csv"), index_col=None) #Creating 3 Python-dictionaries from Python Multi-Dict using column names and keeping RouteID as the key routeID, transportCost, routeType = multidict({x[0]:[x[1],x[2]] for x in routeData[['RouteID', 'TransportCost','RouteType']].values}) </code></pre> <p>Example: If the csv structure is as follows:</p> <pre><code>RouteID RouteEfficiency TransportCost RouteType 1 0.8 2.00 F 2 0.9 5.00 D 3 0.7 6.00 R 4 0.6 3.00 T </code></pre> <p>The 3 variables should be: RouteID: 1 2 3 4</p> <p>TransportCost:</p> <pre><code>1:2.00 2:5.00 3:6.00 4:3.00 </code></pre> <p>RouteType:</p> <pre><code>1:F 2:D 3:R 4:T </code></pre> <p>Now, I want to create a C# version of the above code that does the same task, but I learnt that C# doesn't support dataframes. I tried looking for a few alternatives, but am unable to find anything. Please help me with this.</p>
0debug
HOW TO ANIMATE UIVIEW WITH A FOR LOOP : I'm a bit new to swift and iOS programming. I would like to move a rectangle within a for loop to create a random walk. But I only get the end position not motion in between. What do I have to do to see the individual steps? import UIKit import PlaygroundSupport class ViewController:UIViewController{ override func viewDidLoad() { super.viewDidLoad() } } class bird: UIView { var x:CGFloat var y:CGFloat override init(frame: CGRect){ self.x=0 self.y=0 super.init(frame: frame) } func stepit(dx: CGFloat, dy: CGFloat ){ self.frame.origin.x += dx self.frame.origin.y += dy } override func draw(_ rect: CGRect) { self.backgroundColor = #colorLiteral(red: 0.960784316062927, green: 0.705882370471954, blue: 0.200000002980232, alpha: 1.0) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } } let viewController = ViewController() PlaygroundPage.current.liveView = viewController PlaygroundPage.current.needsIndefiniteExecution = true let b=bird(frame: CGRect(x: 0, y: 0, width: 20, height: 20)) viewController.view.addSubview(b) for i in i... 100 { b.stepit(dx: CGFloat(arc4random_uniform(10)), dy: CGFloat(arc4random_uniform(10) )) }
0debug
ES6 what is the code source of the methode filter() : So i've tryed to reproduce the method filter i got this and i know it's not the good. function filter(array,function){ let array2; for (let v of array){ if (funcion(v)){array2.puts(v) ;} } return array2; }
0debug
static int decode_packet(int *got_frame, int cached) { int ret = 0; int decoded = pkt.size; *got_frame = 0; if (pkt.stream_index == video_stream_idx) { ret = avcodec_decode_video2(video_dec_ctx, frame, got_frame, &pkt); if (ret < 0) { fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(ret)); return ret; } if (video_dec_ctx->width != width || video_dec_ctx->height != height || video_dec_ctx->pix_fmt != pix_fmt) { fprintf(stderr, "Error: Width, height and pixel format have to be " "constant in a rawvideo file, but the width, height or " "pixel format of the input video changed:\n" "old: width = %d, height = %d, format = %s\n" "new: width = %d, height = %d, format = %s\n", width, height, av_get_pix_fmt_name(pix_fmt), video_dec_ctx->width, video_dec_ctx->height, av_get_pix_fmt_name(video_dec_ctx->pix_fmt)); return -1; } if (*got_frame) { printf("video_frame%s n:%d coded_n:%d pts:%s\n", cached ? "(cached)" : "", video_frame_count++, frame->coded_picture_number, av_ts2timestr(frame->pts, &video_dec_ctx->time_base)); av_image_copy(video_dst_data, video_dst_linesize, (const uint8_t **)(frame->data), frame->linesize, pix_fmt, width, height); fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file); } } else if (pkt.stream_index == audio_stream_idx) { ret = avcodec_decode_audio4(audio_dec_ctx, frame, got_frame, &pkt); if (ret < 0) { fprintf(stderr, "Error decoding audio frame (%s)\n", av_err2str(ret)); return ret; } decoded = FFMIN(ret, pkt.size); if (*got_frame) { size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format); printf("audio_frame%s n:%d nb_samples:%d pts:%s\n", cached ? "(cached)" : "", audio_frame_count++, frame->nb_samples, av_ts2timestr(frame->pts, &audio_dec_ctx->time_base)); fwrite(frame->extended_data[0], 1, unpadded_linesize, audio_dst_file); } } if (*got_frame && api_mode == API_MODE_NEW_API_REF_COUNT) av_frame_unref(frame); return decoded; }
1threat
static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun, int evpd, int pc, void **inq, Error **errp) { int full_size; struct scsi_task *task = NULL; task = iscsi_inquiry_sync(iscsi, lun, evpd, pc, 64); if (task == NULL || task->status != SCSI_STATUS_GOOD) { goto fail; } full_size = scsi_datain_getfullsize(task); if (full_size > task->datain.size) { scsi_free_scsi_task(task); task = iscsi_inquiry_sync(iscsi, lun, evpd, pc, full_size); if (task == NULL || task->status != SCSI_STATUS_GOOD) { goto fail; } } *inq = scsi_datain_unmarshall(task); if (*inq == NULL) { error_setg(errp, "iSCSI: failed to unmarshall inquiry datain blob"); goto fail; } return task; fail: if (!error_is_set(errp)) { error_setg(errp, "iSCSI: Inquiry command failed : %s", iscsi_get_error(iscsi)); } if (task != NULL) { scsi_free_scsi_task(task); } return NULL; }
1threat
C# Return XML Attribute Value from String to Label : <p>I need to return the values for ID="3" and ID="4" to Labels</p> <p>The xml string is stored in the database column exactly like this:</p> <pre><code>&lt;Attributes&gt;&lt;CheckoutAttribute ID="3"&gt;&lt;CheckoutAttributeValue&gt;&lt;Value&gt;dear jason, wishing you a happy easter&lt;/Value&gt;&lt;/CheckoutAttributeValue&gt;&lt;/CheckoutAttribute&gt;&lt;CheckoutAttribute ID="4"&gt;&lt;CheckoutAttributeValue&gt;&lt;Value&gt;Thursday, 31-03-2016&lt;/Value&gt;&lt;/CheckoutAttributeValue&gt;&lt;/CheckoutAttribute&gt;&lt;/Attributes&gt; </code></pre> <p>I'm looking to get the output as follows.</p> <p>Label1.Text = "dear jason, wishing you a happy easter";</p> <p>Label2.Text = "Thursday, 31-03-2016";</p> <p>Label1 will always be for ID="3" Label2 will always be for ID="4"</p> <p>Thanks</p>
0debug
How to hide element when click outside element? : I now there are many answer for detect click outside element. But I don't now how to hide element when click outside element in this code. In this code I add to all li element click function. This function shows child element. How can I detect click outside with prue javasctipt using FOR LOOP for hide element. I'am newbie js. Sorry my bad English. <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> let lis = document.querySelectorAll('li'); for (let i = 0; i < lis.length; i++) { lis[i].addEventListener('click', function() { lis[i].children[0].style.display = 'block'; }); } <!-- language: lang-css --> ul > li > ul { display: none; } li { cursor: pointer; } <!-- language: lang-html --> <body> <ul> <li>list</li> <li>list <ul> <li>list</li> <li>list</li> </ul> </li> <li>list <ul> <li>list</li> <li>list</li> </ul> </li> </ul> </body> <!-- end snippet -->
0debug
invalid redeclaration in auto code generate NSManagedObject Subclass Swift 3 : <p>Using Version 8.1 of Xcode.</p> <p>Create an entity named "MapRegionObject" in .xcdatamodeld file.<a href="https://i.stack.imgur.com/iAwn7.png"><img src="https://i.stack.imgur.com/iAwn7.png" alt="enter image description here"></a></p> <p>Using auto code generator, click Editor on the navigation bar -> create NSManagedOject Subclass... </p> <p>Got two files : MapRegionObject+CoreDataClass.swift and MapRegionObject+CoreDataProperties</p> <p>Errors in two files showing in the screenshot: MapRegionObject+CoreDataClass.swift <a href="https://i.stack.imgur.com/M7VPp.png"><img src="https://i.stack.imgur.com/M7VPp.png" alt="enter image description here"></a></p> <p>MapRegionObject+CoreDataProperties <a href="https://i.stack.imgur.com/80t6Z.png"><img src="https://i.stack.imgur.com/80t6Z.png" alt="enter image description here"></a></p> <p>Please help me fix this bugs, thank you so much!</p>
0debug
I wont copy txt file,like in the lynda java Esential course,but not work : I copied all this code from Lynda Java Essential Treining 2016 Episode 70.I run aplication and i see this problem: java.io.FileNotFoundException: files\copytest.txt (The system can not find the path specified) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(Unknown Source) at java.io.FileInputStream.<init>(Unknown Source) at java.io.FileInputStream.<init>(Unknown Source) at java.io.FileReader.<init>(Unknown Source) at de.exercise.copyfile.Copyfile.main(Copyfile.java:108) This is the code: String sourceFile="files/copytest.txt"; String targetFile="files/copied.txt"; try( FileReader fReader=new FileReader(sourceFile); BufferedReader bReader=new BufferedReader(fReader); FileWriter writer=new FileWriter(targetFile) ) { while(true){ String line=bReader.readLine(); if(line==null){ break; } else{ writer.write("jarek"+"\n"); } } System.out.println("File copied succesfull!"); }catch(Exception e){ e.printStackTrace(); } } I copy new code,to read from txt file: File file = new File("files/copytest.txt"); Scanner in = null; try { in = new Scanner(file); String zdanie = in.nextLine(); System.out.println(zdanie); } catch (FileNotFoundException e1) { e1.printStackTrace(); } But this is the same problem: java.io.FileNotFoundException: files\copytest.txt (The system can not find the path specified) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(Unknown Source) at java.io.FileInputStream.<init>(Unknown Source) at java.util.Scanner.<init>(Unknown Source) at de.exercise.copyfile.Copyfile.main(Copyfile.java:18) Can you tell me what i doing bad??
0debug
Jenkins JobDSL multibranchPipelineJob change script path : <p>I am trying to create a multibranchPipelineJob in jobDSL, however the Jenkinsfile is at an alternative location to the default. I have looked through the docs <a href="https://jenkinsci.github.io/job-dsl-plugin/#path/multibranchPipelineJob" rel="noreferrer">https://jenkinsci.github.io/job-dsl-plugin/#path/multibranchPipelineJob</a> and I cannot see a way to do this. Looking at the config.xml for a manually created multibranchPipelineJob the scriptPath is in the section, but I cannot find a DSL method to set this.</p> <p>Can anyone offer any help on how to do this? Cheers</p>
0debug
I have this undefined property error in code igniter : I have seen it run on other system. I couldnt sort it out plsease help. Same issue is for the last_name. the update is giving issue. Below is the error it shows and then the whole code. Please help Severity: Notice Message: Undefined property: mysqli::$first_name Filename: views/main_view.php Line Number: 39 Backtrace: File: C:\xampp\htdocs\test\application\views\main_view.php Line: 39 Function: _error_handler ****This is the code**** <!DOCTYPE html> <html> <head> <title>View</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> </head> <body> <form method="post" action="<?php echo base_url("main/form_validation")?>"> <?php if($this->uri->segment(2)=="inserted") { echo '<p> Data Inserted</p>'; } ?> <?php if(isset($user_data)) { foreach ($user_data as $row) { ?> <div> First Name:<input type="text" name="first_name" value="<?php echo $row->first_name; ?>"/> <span class="text-danger"> <?php echo form_error("first_name"); ?></span> </br></br> </div> <div> Last Name:<input type="text" name="last_name" value="<?php echo $row->last_name; ?>"> <span class="text-danger"> <?php echo form_error("last_name"); ?></span> </br></br> </div> <div> <input type="hidden" name="hidden_id" value="<?php echo $row->id; ?>" > <input type="submit" name="update" value="Update" > </div> <?php } }else{ ?> <div> First Name:<input type="text" name="first_name"> <span class="text-danger"> <?php echo form_error("first_name"); ?></span> </br></br> </div> <div> Last Name:<input type="text" name="last_name"> <span class="text-danger"> <?php echo form_error("last_name"); ?></span> </br></br> </div> <div> <input type="submit" name="hidde" value="Insert" > <input type="hidden" name="insert" value="Insert" > </div> <?php } ?> </form> <br><br> <div> <table> <tr> <th>ID</th> <th> First Name</th> <th> Last Name </th> <th> Delete </th> <th> Update </th> </tr> <?php if($fetch_data->num_rows()>0) { foreach ($fetch_data->result() as $row ) { ?> <tr> <td><?php echo $row->id; ?> </td> <td><?php echo $row->first_name; ?> </td> <td><?php echo $row->last_name; ?> </td> <td> <a href="#" class="delete_data" id="<?php echo $row->id; ?>"> Delete </a></td> <td> <a href=" <?php echo base_url(); ?>main/update_data/ <?php echo $row->id; ?>"> Edit </a></td> </tr> <?php } }else{ ?> <tr> <th colspan="4"> No data Found </th> </tr> <?php } ?> </table> </div> <script type="text/javascript"> $(document).ready(function(){ $('.delete_data').click(function(){ var id = $(this).attr("id"); if(confirm("Delete? or not?")) { window.location="<?php echo base_url(); ?>main/delete_data/"+id; }else{ return false; } }); }); </script> </body> </html>
0debug
void OPPROTO op_fdivr_STN_ST0(void) { CPU86_LDouble *p; p = &ST(PARAM1); *p = ST0 / *p; }
1threat
Make my application logout if user connected to inetrnet : Can i identify whether my system connected to internet(not intranet) using c# or sharepoint without using ping technique
0debug