problem
stringlengths
26
131k
labels
class label
2 classes
Interfaces may not include member variables error : <p>I made an Interface for my project which is called <code>insert</code> and goes like this:</p> <pre><code>&lt;?php interface Insert { private $_db; public function __construct() { $this-&gt;_db = new Connection(); $this-&gt;_db = $this-&gt;_db-&gt;dbConnect(); } public function insert($table_name, $data) { $string = "INSERT INTO ".$table_name." ("; $string .= implode(",", array_keys($data)) . ') VALUES ('; $string .= "'" . implode("','", array_values($data)) . "')"; if(mysqli_query($this-&gt;_db, $string)) { return true; } else { echo mysqli_error($this-&gt;con); } } } ?&gt; </code></pre> <p>But it given me this error:</p> <p><strong>Fatal error: Interfaces may not include member variables</strong></p> <p>So what is my mistake here?</p>
0debug
Max size of the vector : I'm trying to read in numbers from a file and take the average of all the numbers but i'm unsure how to include the data.reserve() part into my code. How exactly do I use it to set the maximum size of the vector? // 1) Read in the size of the data to be read (use type size_t) // 2) Use data.reserve() to set the maximum size of the vector // 3) Use a for loop to read in the specified number of values, // storing them into the vector using data.push_back() void reserve(vector<int> &data) { cout << "Using reserve!" << endl; if (cin){ size_t max_size; //max_size = 12; data.reserve(max_size); cout << "max_size = " << max_size << endl; for (size_t i = 0; i < max_size; i++){ cin >> data[i]; data.push_back(data[i]); cout << data[i] << " "; } }
0debug
About class and object relationship : <p>Can I say that class is a manual for building up an object?</p> <p>I agreed that object is one of the instance of class.But if some properties that defined by classes may not make sense for particular object, for example,I have an object called "Duck" which use the class "Bird" for build, but Duck cannot fly,so if I use class "Bird" for build up an object "Duck".In the other words, the manual cannot provided the guideline for build up the object.</p> <p>So,can i say that class is a manual for building up an object?As well as the manual should provided all the functions that the users need,in case there shouldn 't have any defects inside. </p>
0debug
static void vc1_mc_4mv_chroma(VC1Context *v, int dir) { MpegEncContext *s = &v->s; H264ChromaContext *h264chroma = &v->h264chroma; uint8_t *srcU, *srcV; int uvmx, uvmy, uvsrc_x, uvsrc_y; int k, tx = 0, ty = 0; int mvx[4], mvy[4], intra[4], mv_f[4]; int valid_count; int chroma_ref_type = v->cur_field_type; int v_edge_pos = s->v_edge_pos >> v->field_mode; uint8_t (*lutuv)[256]; int use_ic; if (!v->field_mode && !v->s.last_picture.f.data[0]) return; if (s->flags & CODEC_FLAG_GRAY) return; for (k = 0; k < 4; k++) { mvx[k] = s->mv[dir][k][0]; mvy[k] = s->mv[dir][k][1]; intra[k] = v->mb_type[0][s->block_index[k]]; if (v->field_mode) mv_f[k] = v->mv_f[dir][s->block_index[k] + v->blocks_off]; } if (!v->field_mode || (v->field_mode && !v->numref)) { valid_count = get_chroma_mv(mvx, mvy, intra, 0, &tx, &ty); chroma_ref_type = v->reffield; if (!valid_count) { s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0; s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0; v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0; return; } } else { int dominant = 0; if (mv_f[0] + mv_f[1] + mv_f[2] + mv_f[3] > 2) dominant = 1; valid_count = get_chroma_mv(mvx, mvy, mv_f, dominant, &tx, &ty); if (dominant) chroma_ref_type = !v->cur_field_type; } if (v->field_mode && chroma_ref_type == 1 && v->cur_field_type == 1 && !v->s.last_picture.f.data[0]) return; s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = tx; s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = ty; uvmx = (tx + ((tx & 3) == 3)) >> 1; uvmy = (ty + ((ty & 3) == 3)) >> 1; v->luma_mv[s->mb_x][0] = uvmx; v->luma_mv[s->mb_x][1] = uvmy; if (v->fastuvmc) { uvmx = uvmx + ((uvmx < 0) ? (uvmx & 1) : -(uvmx & 1)); uvmy = uvmy + ((uvmy < 0) ? (uvmy & 1) : -(uvmy & 1)); } if (v->cur_field_type != chroma_ref_type) uvmy += 2 - 4 * chroma_ref_type; uvsrc_x = s->mb_x * 8 + (uvmx >> 2); uvsrc_y = s->mb_y * 8 + (uvmy >> 2); if (v->profile != PROFILE_ADVANCED) { uvsrc_x = av_clip(uvsrc_x, -8, s->mb_width * 8); uvsrc_y = av_clip(uvsrc_y, -8, s->mb_height * 8); } else { uvsrc_x = av_clip(uvsrc_x, -8, s->avctx->coded_width >> 1); uvsrc_y = av_clip(uvsrc_y, -8, s->avctx->coded_height >> 1); } if (!dir) { if (v->field_mode && (v->cur_field_type != chroma_ref_type) && v->second_field) { srcU = s->current_picture.f.data[1]; srcV = s->current_picture.f.data[2]; lutuv = v->curr_lutuv; use_ic = v->curr_use_ic; } else { srcU = s->last_picture.f.data[1]; srcV = s->last_picture.f.data[2]; lutuv = v->last_lutuv; use_ic = v->last_use_ic; } } else { srcU = s->next_picture.f.data[1]; srcV = s->next_picture.f.data[2]; lutuv = v->next_lutuv; use_ic = v->next_use_ic; } if (!srcU) { av_log(v->s.avctx, AV_LOG_ERROR, "Referenced frame missing.\n"); return; } srcU += uvsrc_y * s->uvlinesize + uvsrc_x; srcV += uvsrc_y * s->uvlinesize + uvsrc_x; if (v->field_mode) { if (chroma_ref_type) { srcU += s->current_picture_ptr->f.linesize[1]; srcV += s->current_picture_ptr->f.linesize[2]; } } if (v->rangeredfrm || use_ic || s->h_edge_pos < 18 || v_edge_pos < 18 || (unsigned)uvsrc_x > (s->h_edge_pos >> 1) - 9 || (unsigned)uvsrc_y > (v_edge_pos >> 1) - 9) { s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcU, s->uvlinesize, s->uvlinesize, 8 + 1, 8 + 1, uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1); s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, srcV, s->uvlinesize, s->uvlinesize, 8 + 1, 8 + 1, uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1); srcU = s->edge_emu_buffer; srcV = s->edge_emu_buffer + 16; if (v->rangeredfrm) { int i, j; uint8_t *src, *src2; src = srcU; src2 = srcV; for (j = 0; j < 9; j++) { for (i = 0; i < 9; i++) { src[i] = ((src[i] - 128) >> 1) + 128; src2[i] = ((src2[i] - 128) >> 1) + 128; } src += s->uvlinesize; src2 += s->uvlinesize; } } if (use_ic) { int i, j; uint8_t *src, *src2; src = srcU; src2 = srcV; for (j = 0; j < 9; j++) { int f = v->field_mode ? chroma_ref_type : ((j + uvsrc_y) & 1); for (i = 0; i < 9; i++) { src[i] = lutuv[f][src[i]]; src2[i] = lutuv[f][src2[i]]; } src += s->uvlinesize; src2 += s->uvlinesize; } } } uvmx = (uvmx & 3) << 1; uvmy = (uvmy & 3) << 1; if (!v->rnd) { h264chroma->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy); h264chroma->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy); } else { v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy); v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy); } }
1threat
what kind of html/layout is that? columns/table? : i'm pretty new in coding, my question is how to make this kind of layout ? https://www.carstensens-tehandel.dk/te-the.html is it possible just html/css ? what to type to find tutorial about it ? cause on w3 I just found columns. my purpose is to re create for a school project a page of a webshop.
0debug
How to embed YouTube videos without cookies? : <p>In the past we could embed YouTube videos without cookies by simply pointing to a different URL, so for example <a href="https://youtube-nocookie.com/embed/sRrqF8eXs38" rel="noreferrer">https://youtube-nocookie.com/embed/sRrqF8eXs38</a> to get the version without cookies.</p> <p>This does not work any longer. The URL returns a <em>404</em>, where the cookie version still exists.</p> <p>I could not find any reference on how to do it now.</p>
0debug
static void test_visitor_in_native_list_int16(TestInputVisitorData *data, const void *unused) { test_native_list_integer_helper(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_S16); }
1threat
The IDLE editor in Python will not output the result of my code. Instead a dialog box appears showing me Python Folder 37-32 : I have written code in a New file window in IDLE. When I run the code there is no output. Instead a dialog box appears showing a window accessing Python Folder 37-32. I have attached a screenshot showing the code and the dialog box that appears when the Module is run
0debug
static int posix_aio_init(void) { struct sigaction act; PosixAioState *s; int fds[2]; struct qemu_paioinit ai; if (posix_aio_state) return 0; s = qemu_malloc(sizeof(PosixAioState)); sigfillset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = aio_signal_handler; sigaction(SIGUSR2, &act, NULL); s->first_aio = NULL; if (pipe(fds) == -1) { fprintf(stderr, "failed to create pipe\n"); return -errno; } s->rfd = fds[0]; s->wfd = fds[1]; fcntl(s->rfd, F_SETFL, O_NONBLOCK); fcntl(s->wfd, F_SETFL, O_NONBLOCK); qemu_aio_set_fd_handler(s->rfd, posix_aio_read, NULL, posix_aio_flush, s); memset(&ai, 0, sizeof(ai)); ai.aio_threads = 64; ai.aio_num = 64; qemu_paio_init(&ai); posix_aio_state = s; return 0; }
1threat
static void rc4030_write(void *opaque, hwaddr addr, uint64_t data, unsigned int size) { rc4030State *s = opaque; uint32_t val = data; addr &= 0x3fff; trace_rc4030_write(addr, val); switch (addr & ~0x3) { case 0x0000: s->config = val; break; case 0x0018: rc4030_dma_tt_update(s, val, s->dma_tl_limit); break; case 0x0020: rc4030_dma_tt_update(s, s->dma_tl_base, val); break; case 0x0028: break; case 0x0030: s->cache_maint = val; break; case 0x0048: s->cache_ptag = val; break; case 0x0050: s->cache_ltag = val; break; case 0x0058: s->cache_bmask |= val; break; case 0x0060: if (s->cache_ltag == 0x80000001 && s->cache_bmask == 0xf0f0f0f) { hwaddr dest = s->cache_ptag & ~0x1; dest += (s->cache_maint & 0x3) << 3; cpu_physical_memory_write(dest, &val, 4); } break; case 0x0070: case 0x0078: case 0x0080: case 0x0088: case 0x0090: case 0x0098: case 0x00a0: case 0x00a8: case 0x00b0: case 0x00b8: case 0x00c0: case 0x00c8: case 0x00d0: case 0x00d8: case 0x00e0: case 0x00e8: s->rem_speed[(addr - 0x0070) >> 3] = val; break; case 0x0100: case 0x0108: case 0x0110: case 0x0118: case 0x0120: case 0x0128: case 0x0130: case 0x0138: case 0x0140: case 0x0148: case 0x0150: case 0x0158: case 0x0160: case 0x0168: case 0x0170: case 0x0178: case 0x0180: case 0x0188: case 0x0190: case 0x0198: case 0x01a0: case 0x01a8: case 0x01b0: case 0x01b8: case 0x01c0: case 0x01c8: case 0x01d0: case 0x01d8: case 0x01e0: case 0x01e8: case 0x01f0: case 0x01f8: { int entry = (addr - 0x0100) >> 5; int idx = (addr & 0x1f) >> 3; s->dma_regs[entry][idx] = val; } break; case 0x0210: s->memory_refresh_rate = val; break; case 0x0228: s->itr = val; qemu_irq_lower(s->timer_irq); set_next_tick(s); break; case 0x0238: break; default: qemu_log_mask(LOG_GUEST_ERROR, "rc4030: invalid write of 0x%02x at 0x%x", val, (int)addr); break; } }
1threat
Error while installing php 7.2 in ubuntu 17.04 : <p>I got this error when run below command</p> <pre><code>sudo apt install php7.2 php7.2-common php7.2-cli php7.2-fpm </code></pre> <p>Reading state information... Done</p> <pre><code>E: Unable to locate package php7.2 E: Couldn't find any package by glob 'php7.2' E: Couldn't find any package by regex 'php7.2' E: Unable to locate package php7.2-common E: Couldn't find any package by glob 'php7.2-common' E: Couldn't find any package by regex 'php7.2-common' E: Unable to locate package php7.2-cli E: Couldn't find any package by glob 'php7.2-cli' E: Couldn't find any package by regex 'php7.2-cli' E: Unable to locate package php7.2-fpm E: Couldn't find any package by glob 'php7.2-fpm' E: Couldn't find any package by regex 'php7.2-fpm' </code></pre>
0debug
jQuery if Statement with Multiple conditions : I need to check 3 conditions, sheet_exists = 1, recalc = 1 and qty_total and new_qty_total are not equal. The if statement works well if only the first 2 arguments are used: if(sheet_exists === 1 && recalc === 'yes'){ //do something } But when I try to add he 3rd argument it fails, the actions in the if statement are ignored I've tried.. if((sheet_exists === 1) && (recalc === 'yes') && (qty_total !== new_qty_total)){ //do something } And... if(sheet_exists === 1 && recalc === 'yes' && (qty_total !== new_qty_total)){ //do something } And... if(sheet_exists === 1 && recalc === 'yes' && qty_total !== new_qty_total){ //do something } Where am I going wrong?
0debug
Why does 1ul << 64 return 1 instead of 0? : <p>Consider the following piece of code:</p> <pre><code>// Simply loop over until 64 is hit. unsigned long x = 0; for (int i = 0; i &lt;= 64; i++) { if (i == 64) { x = 1ul &lt;&lt; i; printf("x: %d\n", x); } } </code></pre> <p>We know that unsigned long is 64-bit wide, and left shifting 1 by 64 positions would become 1000...000 (64 zeros behind one), and would have been truncated to 0. However, the actual printout gives:</p> <pre><code>x: 1 </code></pre> <p>The strange thing is, if we just do </p> <pre><code>printf("x: %d\n", (1ul &lt;&lt; 64)); </code></pre> <p>It would print 0. </p> <p>Can anyone explain why this is happening? Why in the first case, the program mistakenly produces 1 instead of 0, but in the second case it's correct? </p>
0debug
Display pdf image in markdown : <p>Is this possible? Everything I'm google leads me to converting markdown to PDF. But I want to display a PDF image in a markdown file. This is my example:</p> <pre><code>![hustlin_erd](erd.pdf) </code></pre> <p>If i use a regular image, it works just fine. Also I'm aware of converting PDF to image.</p>
0debug
float32 HELPER(ucf64_df2sf)(float64 x, CPUUniCore32State *env) { return float64_to_float32(x, &env->ucf64.fp_status); }
1threat
C# arrays scope : <p>I'm learning C# for job reasons and I have knowledge in C and C++ so I'm trying to skip as much theory as I can. I'm having a hard time figuring out why I cannot define arrays outside Main function. If I do this inside Main, It works.</p> <p>I have tryed some codes from online tutorials of super-basic array sintax; and somehow I can't make them work.</p> <p>Example:</p> <pre><code>int [] ages; ages= new int[2]; ages [0] = 20; ---&gt; until I fill the array. </code></pre>
0debug
Gradle mixing versions 27.1.1 and 26.1.0 : <p>I'm getting an error in my app-level build.gradle where on the first support library I am using, it tells me that all com.android.support libraries must use the exact same version specification and that it's found versions 27.1.1 and 26.0.2. In my app-level build.gradle, there is no line using 26.1.0. Also, all <code>compile</code> statements have been changed to <code>implementation</code>, the <code>compileSdkVersion</code> is 27 and the <code>targetSdkVersion</code> is 27. To attempt to find the culprit, I ran:</p> <pre><code>./gradlew -q dependencies app:dependencies --configuration debugAndroidTestCompileClasspath </code></pre> <p>And got the following output:</p> <pre><code>registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) ------------------------------------------------------------ Root project ------------------------------------------------------------ No configurations ------------------------------------------------------------ Project :app ------------------------------------------------------------ debugAndroidTestCompileClasspath - Resolved configuration for compilation for variant: debugAndroidTest +--- com.android.support.test:runner:1.0.1 | +--- com.android.support:support-annotations:25.4.0 -&gt; 27.1.1 | +--- junit:junit:4.12 | | \--- org.hamcrest:hamcrest-core:1.3 | \--- net.sf.kxml:kxml2:2.3.0 +--- com.android.support.test.espresso:espresso-core:3.0.1 | +--- com.android.support.test:runner:1.0.1 (*) | +--- com.android.support.test:rules:1.0.1 | | \--- com.android.support.test:runner:1.0.1 (*) | +--- com.android.support.test.espresso:espresso-idling-resource:3.0.1 | +--- com.squareup:javawriter:2.1.1 | +--- javax.inject:javax.inject:1 | +--- org.hamcrest:hamcrest-library:1.3 | | \--- org.hamcrest:hamcrest-core:1.3 | +--- org.hamcrest:hamcrest-integration:1.3 | | \--- org.hamcrest:hamcrest-library:1.3 (*) | \--- com.google.code.findbugs:jsr305:2.0.1 +--- com.android.support:appcompat-v7:27.1.1 | +--- com.android.support:support-annotations:27.1.1 | +--- com.android.support:support-core-utils:27.1.1 | | +--- com.android.support:support-annotations:27.1.1 | | \--- com.android.support:support-compat:27.1.1 | | +--- com.android.support:support-annotations:27.1.1 | | \--- android.arch.lifecycle:runtime:1.1.0 | | +--- android.arch.lifecycle:common:1.1.0 | | \--- android.arch.core:common:1.1.0 | +--- com.android.support:support-fragment:27.1.1 | | +--- com.android.support:support-compat:27.1.1 (*) | | +--- com.android.support:support-core-ui:27.1.1 | | | +--- com.android.support:support-annotations:27.1.1 | | | +--- com.android.support:support-compat:27.1.1 (*) | | | \--- com.android.support:support-core-utils:27.1.1 (*) | | +--- com.android.support:support-core-utils:27.1.1 (*) | | +--- com.android.support:support-annotations:27.1.1 | | +--- android.arch.lifecycle:livedata-core:1.1.0 | | | +--- android.arch.lifecycle:common:1.1.0 | | | +--- android.arch.core:common:1.1.0 | | | \--- android.arch.core:runtime:1.1.0 | | | \--- android.arch.core:common:1.1.0 | | \--- android.arch.lifecycle:viewmodel:1.1.0 | +--- com.android.support:support-vector-drawable:27.1.1 | | +--- com.android.support:support-annotations:27.1.1 | | \--- com.android.support:support-compat:27.1.1 (*) | \--- com.android.support:animated-vector-drawable:27.1.1 | +--- com.android.support:support-vector-drawable:27.1.1 (*) | \--- com.android.support:support-core-ui:27.1.1 (*) +--- com.android.support:design:27.1.1 | +--- com.android.support:support-v4:27.1.1 | | +--- com.android.support:support-compat:27.1.1 (*) | | +--- com.android.support:support-media-compat:27.1.1 | | | +--- com.android.support:support-annotations:27.1.1 | | | \--- com.android.support:support-compat:27.1.1 (*) | | +--- com.android.support:support-core-utils:27.1.1 (*) | | +--- com.android.support:support-core-ui:27.1.1 (*) | | \--- com.android.support:support-fragment:27.1.1 (*) | +--- com.android.support:appcompat-v7:27.1.1 (*) | +--- com.android.support:recyclerview-v7:27.1.1 | | +--- com.android.support:support-annotations:27.1.1 | | +--- com.android.support:support-compat:27.1.1 (*) | | \--- com.android.support:support-core-ui:27.1.1 (*) | \--- com.android.support:transition:27.1.1 | +--- com.android.support:support-annotations:27.1.1 | \--- com.android.support:support-compat:27.1.1 (*) +--- com.android.support.constraint:constraint-layout:1.1.0 | \--- com.android.support.constraint:constraint-layout-solver:1.1.0 +--- com.android.support:support-vector-drawable:27.1.1 (*) +--- com.android.support:support-v4:27.1.1 (*) +--- com.android.support:cardview-v7:27.1.1 | \--- com.android.support:support-annotations:27.1.1 +--- com.android.support:recyclerview-v7:27.1.1 (*) +--- com.google.android.gms:play-services-ads:15.0.0 | +--- com.android.support:customtabs:26.1.0 | | +--- com.android.support:support-compat:26.1.0 -&gt; 27.1.1 (*) | | \--- com.android.support:support-annotations:26.1.0 -&gt; 27.1.1 | +--- com.google.android.gms:play-services-ads-base:[15.0.0] -&gt; 15.0.0 | +--- com.google.android.gms:play-services-ads-identifier:[15.0.0,16.0.0) -&gt; 15.0.0 | | \--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 | | \--- com.android.support:support-v4:26.1.0 -&gt; 27.1.1 (*) | +--- com.google.android.gms:play-services-ads-lite:[15.0.0] -&gt; 15.0.0 | | +--- com.google.android.gms:play-services-ads-base:[15.0.0] -&gt; 15.0.0 | | \--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | +--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | \--- com.google.android.gms:play-services-gass:[15.0.0] -&gt; 15.0.0 | +--- com.google.android.gms:play-services-ads-base:[15.0.0] -&gt; 15.0.0 | \--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) +--- com.google.firebase:firebase-core:15.0.0 | \--- com.google.firebase:firebase-analytics:[15.0.0,16.0.0) -&gt; 15.0.0 | +--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | +--- com.google.android.gms:play-services-measurement-base:[15.0.0] -&gt; 15.0.0 | +--- com.google.android.gms:play-services-stats:[15.0.0,16.0.0) -&gt; 15.0.0 | | \--- com.google.android.gms:play-services-basement:[15.0.0] -&gt; 15.0.0 (*) | +--- com.google.firebase:firebase-analytics-impl:[15.0.0] -&gt; 15.0.0 | | +--- com.google.android.gms:play-services-ads-identifier:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | | +--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | | +--- com.google.android.gms:play-services-measurement-base:[15.0.0] -&gt; 15.0.0 | | +--- com.google.android.gms:play-services-stats:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | | +--- com.google.android.gms:play-services-tasks:[15.0.0,16.0.0) -&gt; 15.0.0 | | | \--- com.google.android.gms:play-services-basement:[15.0.0] -&gt; 15.0.0 (*) | | +--- com.google.firebase:firebase-common:[15.0.0,16.0.0) -&gt; 15.0.0 | | | +--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | | | \--- com.google.android.gms:play-services-tasks:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | | \--- com.google.firebase:firebase-iid:[15.0.0] -&gt; 15.0.0 | | +--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | | +--- com.google.android.gms:play-services-measurement-base:[15.0.0] -&gt; 15.0.0 | | +--- com.google.android.gms:play-services-stats:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | | +--- com.google.android.gms:play-services-tasks:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | | \--- com.google.firebase:firebase-common:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | \--- com.google.firebase:firebase-common:[15.0.0,16.0.0) -&gt; 15.0.0 (*) +--- com.google.firebase:firebase-database:15.0.0 | +--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | +--- com.google.android.gms:play-services-tasks:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | +--- com.google.firebase:firebase-common:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | +--- com.google.firebase:firebase-database-collection:[15.0.0,16.0.0) -&gt; 15.0.0 | | \--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | \--- com.google.firebase:firebase-database-connection:[15.0.0] -&gt; 15.0.0 | +--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | +--- com.google.firebase:firebase-analytics:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | \--- com.google.firebase:firebase-common:[15.0.0,16.0.0) -&gt; 15.0.0 (*) +--- com.google.firebase:firebase-firestore:15.0.0 | +--- com.google.android.gms:play-services-basement:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | +--- com.google.android.gms:play-services-tasks:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | +--- com.google.firebase:firebase-analytics:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | +--- com.google.firebase:firebase-common:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | +--- com.google.firebase:firebase-database-collection:[15.0.0,16.0.0) -&gt; 15.0.0 (*) | \--- com.squareup.okhttp:okhttp:2.7.2 | \--- com.squareup.okio:okio:1.6.0 +--- com.aurelhubert:ahbottomnavigation:2.1.0 | \--- com.android.support:design:25.3.1 -&gt; 27.1.1 (*) +--- com.github.bumptech.glide:glide:4.5.0 | +--- com.github.bumptech.glide:gifdecoder:4.5.0 | | \--- com.android.support:support-annotations:27.0.2 -&gt; 27.1.1 | +--- com.github.bumptech.glide:disklrucache:4.5.0 | +--- com.github.bumptech.glide:annotations:4.5.0 | \--- com.android.support:support-fragment:27.0.2 -&gt; 27.1.1 (*) +--- de.hdodenhof:circleimageview:2.2.0 +--- me.tankery.lib:circularSeekBar:1.1.4 +--- com.github.fiskurgit:ChipCloud:3.0.5 | \--- com.android.support:appcompat-v7:25.1.1 -&gt; 27.1.1 (*) \--- com.google.android:flexbox:0.3.2 (*) - dependencies omitted (listed previously) </code></pre> <p>Here it shows that <code>com.android.support:customtabs:26.1.0</code> in <code>com.google.android.gms:play-services-ads:15.0.0</code> is using 26.1.0 but in the drilldown it has <code>-&gt; 27.1.1 (*)</code> which I'm assuming means that it's using 27.1.1 instead? I'm getting the same thing from <code>com.android.support:support-v4:26.1.0</code> in play-services. What could be causing this error?</p>
0debug
static void do_video_out(AVFormatContext *s, OutputStream *ost, InputStream *ist, AVFrame *in_picture, int *frame_size, float quality) { int nb_frames, i, ret, format_video_sync; AVFrame *final_picture; AVCodecContext *enc; double sync_ipts; enc = ost->st->codec; sync_ipts = get_sync_ipts(ost) / av_q2d(enc->time_base); nb_frames = 1; *frame_size = 0; format_video_sync = video_sync_method; if (format_video_sync < 0) format_video_sync = (s->oformat->flags & AVFMT_NOTIMESTAMPS) ? 0 : (s->oformat->flags & AVFMT_VARIABLE_FPS) ? 2 : 1; if (format_video_sync) { double vdelta = sync_ipts - ost->sync_opts; if (vdelta < -1.1) nb_frames = 0; else if (format_video_sync == 2) { if(vdelta<=-0.6){ nb_frames=0; }else if(vdelta>0.6) ost->sync_opts= lrintf(sync_ipts); }else if (vdelta > 1.1) nb_frames = lrintf(vdelta); if (nb_frames == 0){ ++nb_frames_drop; av_log(NULL, AV_LOG_VERBOSE, "*** drop!\n"); }else if (nb_frames > 1) { nb_frames_dup += nb_frames - 1; av_log(NULL, AV_LOG_VERBOSE, "*** %d dup!\n", nb_frames-1); } }else ost->sync_opts= lrintf(sync_ipts); nb_frames = FFMIN(nb_frames, ost->max_frames - ost->frame_number); if (nb_frames <= 0) return; do_video_resample(ost, ist, in_picture, &final_picture); for(i=0;i<nb_frames;i++) { AVPacket pkt; av_init_packet(&pkt); pkt.stream_index= ost->index; if (s->oformat->flags & AVFMT_RAWPICTURE) { enc->coded_frame->interlaced_frame = in_picture->interlaced_frame; enc->coded_frame->top_field_first = in_picture->top_field_first; pkt.data= (uint8_t *)final_picture; pkt.size= sizeof(AVPicture); pkt.pts= av_rescale_q(ost->sync_opts, enc->time_base, ost->st->time_base); pkt.flags |= AV_PKT_FLAG_KEY; write_frame(s, &pkt, ost->st->codec, ost->bitstream_filters); } else { AVFrame big_picture; big_picture= *final_picture; big_picture.interlaced_frame = in_picture->interlaced_frame; if (ost->st->codec->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)) { if (ost->top_field_first == -1) big_picture.top_field_first = in_picture->top_field_first; else big_picture.top_field_first = !!ost->top_field_first; } big_picture.quality = quality; if (!enc->me_threshold) big_picture.pict_type = 0; big_picture.pts= ost->sync_opts; if (ost->forced_kf_index < ost->forced_kf_count && big_picture.pts >= ost->forced_kf_pts[ost->forced_kf_index]) { big_picture.pict_type = AV_PICTURE_TYPE_I; ost->forced_kf_index++; } ret = avcodec_encode_video(enc, bit_buffer, bit_buffer_size, &big_picture); if (ret < 0) { av_log(NULL, AV_LOG_FATAL, "Video encoding failed\n"); exit_program(1); } if(ret>0){ pkt.data= bit_buffer; pkt.size= ret; if(enc->coded_frame->pts != AV_NOPTS_VALUE) pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base); if(enc->coded_frame->key_frame) pkt.flags |= AV_PKT_FLAG_KEY; write_frame(s, &pkt, ost->st->codec, ost->bitstream_filters); *frame_size = ret; video_size += ret; if (ost->logfile && enc->stats_out) { fprintf(ost->logfile, "%s", enc->stats_out); } } } ost->sync_opts++; ost->frame_number++; } }
1threat
Column by column reading of data from a file in C++? : <p>Is it possible to read data from a file column by column instead of reading row by row in C++? I have data in a file which I want them to be read column by column and to be stored in an array in that order. Any help would be appreciated. THanks!</p>
0debug
Android cannot use CustomAdapter in Listview : I am new in Android programming and I am about to create listview app that will show the list of movies with pics, titles, ratings, and genres. When I run the app I see the white screen, that is empty. There is no problem wth layouts, I have created two layouts, one is activity_main and another one is custom_layout. MainActivity.java import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.ListViewCompat; import android.widget.ArrayAdapter; import android.widget.ListView; import java.util.ArrayList; import java.util.Arrays; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); int[] images = {R.drawable.dfg,R.drawable.godf,R.drawable.godf2,R.drawable.thedark,R.drawable.twelv,R.drawable.shindl}; String[] movie_titles = getResources().getStringArray(R.array.Movie_titles); String[] movie_ratings=getResources().getStringArray(R.array.Movie_ratings); String[] movie_janrs=getResources().getStringArray(R.array.Movie_janrs); setContentView(R.layout.activity_main); ListView mylist = (ListView) findViewById(R.id.list); ArrayList<String> rowItems = new ArrayList<>(); ArrayAdapter<String> myadapter = new ArrayAdapter<> (this,android.R.layout.simple_list_item_1,rowItems); if(mylist!=null){ mylist.setAdapter(myadapter); } } } CustomAdapter.java import android.content.Context; import android.support.annotation.IdRes; import android.support.annotation.LayoutRes; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; import java.util.List; public class CustomAdapter extends ArrayAdapter<RowItem> { public CustomAdapter(@NonNull Context context, @LayoutRes int resource, @NonNull List<RowItem> objects) { super(context, resource, objects); } @NonNull @Override public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { RowItem rowItem = getItem(position); if(convertView ==null){ LayoutInflater vi = LayoutInflater.from(getContext()); convertView = vi.inflate(R.layout.custom_layout,null); //convertView = LayoutInflater.from(getContext()).inflate(R.layout.custom_layout,parent,false); } if(rowItem!=null){ ImageView tvImage = (ImageView) convertView.findViewById(R.id.shekil); TextView tvTittle = (TextView) convertView.findViewById(R.id.ad); TextView tvRating = (TextView) convertView.findViewById(R.id.rating); TextView tvJanr = (TextView) convertView.findViewById(R.id.janr); if(tvImage!=null && tvTittle!=null && tvRating!=null && tvJanr!=null){ tvImage.setImageResource(rowItem.getImages()); tvTittle.setText(rowItem.getMovie_titles()); tvRating.setText(rowItem.getMovide_ratings()); tvJanr.setText(rowItem.getMovide_janrs()); } } return convertView; } RowItem.java public class RowItem { int images; String movie_titles; String movide_ratings; String movide_janrs; public RowItem(int images, String movie_titles, String movide_ratings, String movide_janrs) { this.images = images; this.movie_titles = movie_titles; this.movide_ratings = movide_ratings; this.movide_janrs = movide_janrs; } public int getImages() { return images; } public String getMovie_titles() { return movie_titles; } public String getMovide_ratings() { return movide_ratings; } public String getMovide_janrs() { return movide_janrs; } }
0debug
static void destroy_l2_mapping(PhysPageEntry *lp, unsigned level) { unsigned i; PhysPageEntry *p = lp->u.node; if (!p) { return; } for (i = 0; i < L2_SIZE; ++i) { if (level > 0) { destroy_l2_mapping(&p[i], level - 1); } else { destroy_page_desc(p[i].u.leaf); } } g_free(p); lp->u.node = NULL; }
1threat
How to declare a new variable, name it, and initialize this var to the value of different variable in JavaScript : <p>I need to declare a new variable and name it <strong>r4</strong>. Next, initialize <strong>r4</strong> to the value of variable <strong>r1</strong> incremented by <strong>5</strong>. Finally, print the value of <strong>r4</strong>. </p> <p><strong>Here is what I have tried so far:</strong></p> <pre><code>var r4; r4 = r1; // trying to use a For Loop. Don't know if it's a right way for (r4 = 0; r4 &lt;= r1; r4 = r4 + 5) { document.writeln(r4 + "&lt;br/&gt;"); } </code></pre> <p><strong>And</strong></p> <p>Declare a new variable and name it <strong>r5</strong>. Next, initialize the variable to the value of variable <strong>r1</strong> multiplied by <strong>7</strong>. Finally, print the value of <strong>r5</strong>.</p> <p><strong>Here is what I have tried so far:</strong></p> <pre><code>var r5; r5 = r1; // trying to use a For Loop. Don't know if it's a right way eather for (r5 = 0; r5 &lt;= r1; r5 = r5 * 7) { document.writeln(r5 + "&lt;br/&gt;"); } </code></pre> <p>I know that we might don't even need to use a for loop or any loop But I'm really don't know how to make it work as it requested.</p> <p>I'm new to JavaScript, so don't judge me hard!</p> <p>Please, advise me how can I solve this two task?</p> <p>Thank you!</p>
0debug
In Matplotlib, what axis attribute specifies the spacing between ticks? : <p>When generating a Matplotlib line or scatter plot, what axis attribute specifies the spacing between ticks? I do not want to <a href="https://stackoverflow.com/a/12608937/3585557">explicitly specify where each tick should be</a> as prompted by <a href="https://stackoverflow.com/q/12608788/3585557">this related question</a></p> <pre><code>ax.ticks(np.arange(-100, 100, 5)) </code></pre> <p>What is the matplotlib axis attribute that controls the tick spacing? It should behave something like the following.</p> <pre><code>ax.set_x_tick_spacing(5) </code></pre> <p>This would use the same default <code>xlim</code> and origin point (usually 0) as the default settings.</p>
0debug
Swift - search strings in TextView and make them bold : <p>I have an <code>UITextField</code> with long text inside, I need to find all the occurrences of a string inside the text and make them bold. I know I should use <code>NSMutableAttributedString</code> for making the text bold, but how can I search specific substring inside the text?</p>
0debug
How can I check if my pm2 app NODE_ENV is getting set? : <p>So I just deployed a site with node and pm2 for the first time and I'm going back and doing some optimization and reading best practices, etc.</p> <p>I read that you can get a lot of benefit by setting <code>NODE_ENV=production</code>.</p> <p>I found this in the pm2 docs:</p> <pre><code>[process.json] "env_production" : { "NODE_ENV": "production" } ... $ pm2 start process.json --env production </code></pre> <p>So, I did it but I have no idea if it is working. While trying to figure out how to check it I learned to try:</p> <pre><code>$ node &gt; process.env.NODE_ENV &gt; undefined </code></pre> <p>So, that's not a good sign.. but, with my limited understanding of how the low level stuff works, I can guess that maybe pm2 launches each app as a separate node process? So maybe I'm not in the right process when I try to check it.</p> <p>Also, I don't know if I have to make a new ~/.pm2/dump.pm2 file because maybe whenever that is maybe overriding the options I set? (because I used <code>pm2 startup</code>).</p> <p>How do I check if my pm2 app's NODE_ENV is set?</p>
0debug
Load different application.yml in SpringBoot Test : <p>I'm using a spring boot app which runs my src/main/resources/config/application.yml.</p> <p>When I run my test case by :</p> <pre><code>@RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = Application.class) @WebAppConfiguration @IntegrationTest public class MyIntTest{ } </code></pre> <p>The test codes still run my application.yml file to load properties. I wonder if it is possible to run another *.yml file when running the test case.</p>
0debug
How to Print pdf from html with php or js (codeigniter)? : I'm currently facing an issue I can't really solve. I'm using MVC scheme with codeigniter. I'd like to dynamically print a pdf from a html view (either using javascript while clicking on a button or doing it with php after an ajax request) with some custom parameters, css, positions of elements etc. The point is, all available libraries are not working for me. So far I've tried Tcpf, mpdf, html2pdf, dompdf, jspdf, fpdf. In most cases, they don't have a good rendering for the css, so the elements are more or less printed without the imposed features. Does anyone have any more suggestions? :) Thanks a lot!
0debug
float32 HELPER(ucf64_divs)(float32 a, float32 b, CPUUniCore32State *env) { return float32_div(a, b, &env->ucf64.fp_status); }
1threat
Export const arrow function or basic function? : <p>Which is better to do: export a <code>const</code> arrow function, like so:</p> <pre><code>export const foo = () =&gt; 'bar' </code></pre> <p>or export a regular function, like so:</p> <pre><code>export function baz() { return 'bar'; } </code></pre> <p>They compile like so:</p> <pre><code>exports.baz = baz; function baz() { return 'bar'; } var foo = exports.foo = function foo() { return 'bar'; }; </code></pre> <p>It looks like using the const/arrow function combination declares an extra variable (<code>foo</code>), which seems to be an unnecessary extra step over the simple function declaration.</p>
0debug
Numbers OCR (Optical Recognition) in javascript : <p>I am looking for Javascript API for OCR or Machine Learning example (Tensorflow.js or any other) which can recognize numbers from the picture. I tried tesseract.js and OCRAD.js, but both do not work well with this kind of image. I only need numbers from this picture like 2.243 and 0048. I also put to tesseract.js settings, that it is numbers only, but it did not help much.</p> <p>The picture is a photo of the digital device, which does not have API to connect and get data digitally. I would like to use webcam and javascript OCR and get these numbers periodically from this device to the list and build the graphs later.</p> <p>I found a lot of examples for Tensorflow recognition of handwritten digits, but all of them can recognize only one digit, they cannot recognize a number consisting of more than 1 digits.</p> <p>P.S. I do not want to spend a lot of time, actually I do not have this time :). Just want to reuse ready example.</p> <p><a href="https://i.stack.imgur.com/wIkjK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wIkjK.jpg" alt="enter image description here"></a></p>
0debug
import re def text_uppercase_lowercase(text): patterns = '[A-Z]+[a-z]+$' if re.search(patterns, text): return 'Found a match!' else: return ('Not matched!')
0debug
javascript join array to another : <p>I want to write a function to join an array to another but different way :</p> <pre><code>var myNumbers = [10,20,3,4,2] var myOperations = ['+','-','*','/'] </code></pre> <p>I want the operators locate between myNumbers element : 10+20-3*4/2 = 54</p> <p>thank you </p>
0debug
Matlab Plot in loop seeking names of the variables in an array : <p>I need help. I have the variables (matrix) zco, mgo, dco with 10x10 values. So, I have one variable tt={'zco','mgo','dco'}. I want to do the loop:</p> <pre><code>for i=1:3 plot (tt{i}) hold on end </code></pre> <p>I want to plot the variables zco,mgo,dco from tt{i}.</p> <p>Thanks for your help.</p>
0debug
static IOMMUTLBEntry amdvi_translate(MemoryRegion *iommu, hwaddr addr, bool is_write) { AMDVIAddressSpace *as = container_of(iommu, AMDVIAddressSpace, iommu); AMDVIState *s = as->iommu_state; IOMMUTLBEntry ret = { .target_as = &address_space_memory, .iova = addr, .translated_addr = 0, .addr_mask = ~(hwaddr)0, .perm = IOMMU_NONE }; if (!s->enabled) { ret.iova = addr & AMDVI_PAGE_MASK_4K; ret.translated_addr = addr & AMDVI_PAGE_MASK_4K; ret.addr_mask = ~AMDVI_PAGE_MASK_4K; ret.perm = IOMMU_RW; return ret; } else if (amdvi_is_interrupt_addr(addr)) { ret.iova = addr & AMDVI_PAGE_MASK_4K; ret.translated_addr = addr & AMDVI_PAGE_MASK_4K; ret.addr_mask = ~AMDVI_PAGE_MASK_4K; ret.perm = IOMMU_WO; return ret; } amdvi_do_translate(as, addr, is_write, &ret); trace_amdvi_translation_result(as->bus_num, PCI_SLOT(as->devfn), PCI_FUNC(as->devfn), addr, ret.translated_addr); return ret; }
1threat
static void openpic_gbl_write(void *opaque, hwaddr addr, uint64_t val, unsigned len) { OpenPICState *opp = opaque; IRQ_dst_t *dst; int idx; DPRINTF("%s: addr " TARGET_FMT_plx " <= %08x\n", __func__, addr, val); if (addr & 0xF) return; switch (addr) { case 0x00: break; case 0x40: case 0x50: case 0x60: case 0x70: case 0x80: case 0x90: case 0xA0: case 0xB0: openpic_cpu_write_internal(opp, addr, val, get_current_cpu()); break; case 0x1000: break; case 0x1020: if (val & GLBC_RESET) { openpic_reset(&opp->busdev.qdev); } break; case 0x1080: break; case 0x1090: for (idx = 0; idx < opp->nb_cpus; idx++) { if ((val & (1 << idx)) && !(opp->pint & (1 << idx))) { DPRINTF("Raise OpenPIC RESET output for CPU %d\n", idx); dst = &opp->dst[idx]; qemu_irq_raise(dst->irqs[OPENPIC_OUTPUT_RESET]); } else if (!(val & (1 << idx)) && (opp->pint & (1 << idx))) { DPRINTF("Lower OpenPIC RESET output for CPU %d\n", idx); dst = &opp->dst[idx]; qemu_irq_lower(dst->irqs[OPENPIC_OUTPUT_RESET]); } } opp->pint = val; break; case 0x10A0: case 0x10B0: case 0x10C0: case 0x10D0: { int idx; idx = (addr - 0x10A0) >> 4; write_IRQreg_ipvp(opp, opp->irq_ipi0 + idx, val); } break; case 0x10E0: opp->spve = val & opp->vector_mask; break; default: break; } }
1threat
error C2059: syntax error :"->" and ";" 0.o : When trying to compile this program,I got these errors: --------------------------------------------------------------------- 1>e:\workspace_for_c\02-3\02-3\02-3\02-3.cpp(83): error C2059: syntax error:“new” 1>e:\workspace_for_c\02-3\02-3\02-3\02-3.cpp(84): error C2059: syntax error:“->” 1>e:\workspace_for_c\02-3\02-3\02-3\02-3.cpp(89): error C2059: syntax error:“;” 1>e:\workspace_for_c\02-3\02-3\02-3\02-3.cpp(90): error C2059: syntax error:“->” 1>e:\workspace_for_c\02-3\02-3\02-3\02-3.cpp(105): error C2059: syntax error:“;” --------------------------------------------------------------------------------- My codes: [enter image description here][1] [enter image description here][2] Thanks! Note:I am using Windows 7 with VS 2010 [1]: https://i.stack.imgur.com/cosnz.jpg [2]: https://i.stack.imgur.com/gfYuT.jpg
0debug
Error when making my own stack : <p>So for learning python and just in general some data structures, I am creating a Stack to start with. This is a simple <strong>array-based</strong> stack.</p> <p>Here is my code:</p> <pre><code>class ArrayBasedStack: 'Class for an array-based stack implementation' def __init__(self): self.stackArray = [] def pop(): if not isEmpty(): # pop the stack array at the end obj = self.stackArray.pop() return obj else: print('Stack is empty!') return None def push(object): # push to stack array self.stackArray.append(object) def isEmpty(): if not self.stackArray: return True else: return False ''' Testing the array-based stack ''' abs = ArrayBasedStack() abs.push('HI') print(abs.pop()) </code></pre> <p>But I'm getting this error:</p> <blockquote> <p>Traceback (most recent call last):</p> <p>File "mypath/arrayStack.py", line 29, in abs.push('HI')</p> <p>TypeError: push() takes 1 positional argument but 2 were given [Finished in 0.092s]</p> </blockquote>
0debug
static struct omap_watchdog_timer_s *omap_wd_timer_init(MemoryRegion *memory, target_phys_addr_t base, qemu_irq irq, omap_clk clk) { struct omap_watchdog_timer_s *s = (struct omap_watchdog_timer_s *) g_malloc0(sizeof(struct omap_watchdog_timer_s)); s->timer.irq = irq; s->timer.clk = clk; s->timer.timer = qemu_new_timer_ns(vm_clock, omap_timer_tick, &s->timer); omap_wd_timer_reset(s); omap_timer_clk_setup(&s->timer); memory_region_init_io(&s->iomem, &omap_wd_timer_ops, s, "omap-wd-timer", 0x100); memory_region_add_subregion(memory, base, &s->iomem); return s; }
1threat
static inline bool vhost_needs_vring_endian(VirtIODevice *vdev) { if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { return false; } #ifdef TARGET_IS_BIENDIAN #ifdef HOST_WORDS_BIGENDIAN return !virtio_is_big_endian(vdev); #else return virtio_is_big_endian(vdev); #endif #else return false; #endif }
1threat
Only first link of css taking the effect : I have these three css links for three different size devices <link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/maxwidth959.css" rel='stylesheet'> <link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/maxwidth768.css" rel='stylesheet'> <link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/maxwidth600.css" rel='stylesheet'> And media queries for all: maxwidth959.css @media only screen and (max-width: 959px) { // styles here } maxwidth768.css @media only screen and (max-width: 768px) { // styles here } maxwidth600.css @media only screen and (max-width: 600px) { // styles here } But, only the first (maxwidth959.css) css is taking effect. other are overriding?
0debug
static void write_dump_header(DumpState *s, Error **errp) { Error *local_err = NULL; if (s->dump_info.d_class == ELFCLASS32) { create_header32(s, &local_err); } else { create_header64(s, &local_err); } if (local_err) { error_propagate(errp, local_err); } }
1threat
Running Visual Studio 2017 with Angular 4 and Angular CLI : <p>Is it possible to run an Angular CLI generated project in Visual Studio 2017?</p> <p>I tried generating a Hello World application and Visual Studio 2017 can't run it. </p> <pre><code>ng new HelloWorld </code></pre> <p>I opened the folder as a website and clicked start. Has anyone else solved this?</p> <p>The "Loading..." just runs forever.</p>
0debug
.animate keyword in Android Studio is showing in red and not working : I'm creating an animation bulb app in which there are two image views having blue and green bulb and two buttons(named blue and green), on pressing them the image1's opacity increases and images2's decreases, the opposite happens when the other button is tapped(alpha values are 1 for both initially), but the animate keyword is showing up in red and the code is not compiling. **MainActivity** package com.example.honey1.animatedbulb; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.AppCompatImageView; import android.view.View; import android.widget.Button; import android.widget.ImageView; public class MainActivity extends AppCompatActivity { public void greenTapped(View view) { ImageView blue=(ImageView)findViewById(R.id.bluebulb); ImageView green=(ImageView)findViewById(R.id.greenbulb); blue.animate.alpha(1).setDuration(2000); green.animate.alpha(0).setDuration(2000); } public void blueTapped(View view) { ImageView blue=(ImageView)findViewById(R.id.bluebulb); ImageView green=(ImageView)findViewById(R.id.greenbulb); blue.animate.alpha(0).setDuration(2000); green.animate.alpha(1).setDuration(2000); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } } [main activity screenshot][1] [XML file screenshot][2] [1]: https://i.stack.imgur.com/WBZmV.png [2]: https://i.stack.imgur.com/f0uQi.png
0debug
Define function in unix/linux command line (e.g. BASH) : <p>Sometimes I have a one-liner that I am repeating many times for a particular task, but will likely never use again in the exact same form. It includes a file name that I am pasting in from a directory listing. Somewhere in between and creating a bash script I thought maybe I could just create a one-liner function at the command line like:</p> <pre><code>numresults(){ ls "$1"/RealignerTargetCreator | wc -l } </code></pre> <p>I've tried a few things like using eval, using <code>numresults=function...</code>, but haven't stumbled on the right syntax, and haven't found anything on the web so far. (Everything coming up is just tutorials on bash functions).</p>
0debug
static int read_audio_mux_element(struct LATMContext *latmctx, GetBitContext *gb) { int err; uint8_t use_same_mux = get_bits(gb, 1); if (!use_same_mux) { if ((err = read_stream_mux_config(latmctx, gb)) < 0) return err; } else if (!latmctx->aac_ctx.avctx->extradata) { av_log(latmctx->aac_ctx.avctx, AV_LOG_DEBUG, "no decoder config found\n"); return AVERROR(EAGAIN); } if (latmctx->audio_mux_version_A == 0) { int mux_slot_length_bytes = read_payload_length_info(latmctx, gb); if (mux_slot_length_bytes * 8 > get_bits_left(gb)) { av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n"); return AVERROR_INVALIDDATA; } else if (mux_slot_length_bytes * 8 + 256 < get_bits_left(gb)) { av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, "frame length mismatch %d << %d\n", mux_slot_length_bytes * 8, get_bits_left(gb)); return AVERROR_INVALIDDATA; } } return 0; }
1threat
What are the programming tools used to build an Android game like Elevate? : <p>The idea is how to build an android game that contains inside it many small games like Snake, draw letters, Sudoku...(Elevate as an example)</p> <p>Should I use Android native, ionic, unity…?</p> <p>Note that Elevate has incredible animations. <a href="https://play.google.com/store/apps/details?id=com.wonder&amp;hl=en" rel="nofollow noreferrer">Elevate in Play Store</a></p>
0debug
How to create regular expression with \ on the source : <p>Help on how to create regular expression to extract data in JMeter.</p> <p>Data to be extracted from: <code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;ruleset id=\"8DEF7F30-165B-2C44-219E-DB7938283CD4\" locale=\"en\"&gt;\n\t&lt;baseQuestions id=\"life\"&gt;</code></p> <p>I need a regular expression that can extract the ruleset id from eg above.</p> <p>Here are the regular expressions that i tried to use: <code>*ruleset id=\"(.+?)\"</code> <code>*ruleset id=[^\\",]+</code> <code>*"ruleset id"=\"(.+?)\"</code></p> <p>I tried other variations not I keep getting no match.</p>
0debug
Get 2 Least Significant Bits from an uint16_t in C : I want to get the 2 least significant bits of an uint16_t(X) in C. Example: 20544 = 0x5040 0x40 = 64 I tried, (X & ((1<<2) - 1)). This doesn't work for me.
0debug
Error: RNFirebase core module was not found natively on iOS : <p>I created a new app and I am trying to use <code>react-native-firebase</code>. But I continually get this error: </p> <blockquote> <p>RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects 'Podfile' and have run 'pod install'. </p> <p>See <a href="http://invertase.link/ios" rel="noreferrer">http://invertase.link/ios</a> for the ios setup guide.</p> </blockquote> <p>Steps that I have done: </p> <ol> <li><p><code>yarn add react-native-firebase</code></p></li> <li><p><code>react-native link react-native-firebase</code></p></li> <li>Set up my .plist file from Google under .../myproject/ios/myproject </li> <li>Ran <code>pod update</code>after ensuring I was using Ruby 2.5.0</li> <li>Ran pod install</li> </ol> <p>The pod file that I am currently using is: </p> <pre><code># Uncomment the next line to define a global platform for your project platform :ios, '9.0' target 'MyProject' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! pod 'Firebase/Core' pod 'Firebase/Database' pod 'Firebase/Messaging' target 'MyProjectTests' do inherit! :search_paths # Pods for testing end end </code></pre> <p>These are the versions that I am using: </p> <pre><code>"react": "^16.3.0-alpha.1", "react-native": "0.54.2", "react-native-firebase": "^3.3.1", </code></pre>
0debug
Getting an Kubernetes Ingress endpoint/IP address : <pre><code>Base OS : CentOS (1 master 2 minions) K8S version : 1.9.5 (deployed using KubeSpray) </code></pre> <p>I am new to Kubernetes Ingress and am setting up 2 different services, each reachable with its own path.</p> <p>I have created 2 deployments :</p> <pre><code>kubectl run nginx --image=nginx --port=80 kubectl run echoserver --image=gcr.io/google_containers/echoserver:1.4 --port=8080 </code></pre> <p>I have also created their corresponding services :</p> <pre><code>kubectl expose deployment nginx --target-port=80 --type=NodePort kubectl expose deployment echoserver --target-port=8080 --type=NodePort </code></pre> <p>My <code>svc</code> are :</p> <pre><code>[root@node1 kubernetes]# kubectl get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE echoserver NodePort 10.233.48.121 &lt;none&gt; 8080:31250/TCP 47m nginx NodePort 10.233.44.54 &lt;none&gt; 80:32018/TCP 1h </code></pre> <p>My NodeIP address is <code>172.16.16.2</code> and I can access both pods using</p> <pre><code>http://172.16.16.2:31250 &amp; http://172.16.16.2:32018 </code></pre> <p>Now on top of this I want to deploy an Ingress so that I can reach both pods not using 2 IPs and 2 different ports BUT 1 IP address with different paths.</p> <p>So my Ingress file is :</p> <pre><code>apiVersion: extensions/v1beta1 kind: Ingress metadata: name: fanout-nginx-ingress spec: rules: - http: paths: - path: /nginx backend: serviceName: nginx servicePort: 80 - path: /echo backend: serviceName: echoserver servicePort: 8080 </code></pre> <p>This yields :</p> <pre><code>[root@node1 kubernetes]# kubectl describe ing fanout-nginx-ingress Name: fanout-nginx-ingress Namespace: development Address: Default backend: default-http-backend:80 (&lt;none&gt;) Rules: Host Path Backends ---- ---- -------- * /nginx nginx:80 (&lt;none&gt;) /echo echoserver:8080 (&lt;none&gt;) Annotations: Events: &lt;none&gt; </code></pre> <p>Now when I try accessing the Pods using the NodeIP address (172.16.16.2), I get nothing.</p> <pre><code>http://172.16.16.2/echo http://172.16.16.2/nginx </code></pre> <p>Is there something I have missed in my configs ? </p>
0debug
Play store do not accespt app less than oreo : From november 2018 onwards Google playstore won't accept app which are having minimum android version less than lollipop, . I wonder is there any chance for the oreo app to support android version less than oreo, becuause there are a huge number of customers out there under oreo.
0debug
why my lisview blinks when i perform notifydata setchange : This is the below code rowView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { for(int i=0;i<getCount();i++){ getItem(i).setSelected(false); } getItem(position).setSelected(true); mSelectedOption=getItem(position); notifyDataSetChanged(); } }); my listview blinks when this code is executed.Is there any method to avoid this.
0debug
what does operator precedence and associativity means in c#? : <p>I would like to know what precedence and associativity means. What is the order of the precedence? I have an expression and i dont understand how the answer is 8?</p> <pre><code>int a=5; int c=2; int b=a++ * (c+10)/ (a+1); Console.WriteLine(b); </code></pre> <p>Thanks for helping.</p>
0debug
static inline int halfpel_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr, int dmin, int xmin, int ymin, int xmax, int ymax, int pred_x, int pred_y, uint8_t *ref_picture) { UINT16 *mv_penalty= s->mv_penalty[s->f_code] + MAX_MV; const int quant= s->qscale; int pen_x, pen_y; int mx, my, mx1, my1, d, xx, yy, dminh; UINT8 *pix, *ptr; mx = *mx_ptr; my = *my_ptr; ptr = ref_picture + (my * s->linesize) + mx; xx = 16 * s->mb_x; yy = 16 * s->mb_y; pix = s->new_picture[0] + (yy * s->linesize) + xx; dminh = dmin; if (mx > xmin && mx < xmax && my > ymin && my < ymax) { mx= mx1= 2*(mx - xx); my= my1= 2*(my - yy); if(dmin < Z_THRESHOLD && mx==0 && my==0){ *mx_ptr = 0; *my_ptr = 0; return dmin; } pen_x= pred_x + mx; pen_y= pred_y + my; ptr-= s->linesize; CHECK_HALF_MV(xy2, -1, -1) CHECK_HALF_MV(y2 , 0, -1) CHECK_HALF_MV(xy2, +1, -1) ptr+= s->linesize; CHECK_HALF_MV(x2 , -1, 0) CHECK_HALF_MV(x2 , +1, 0) CHECK_HALF_MV(xy2, -1, +1) CHECK_HALF_MV(y2 , 0, +1) CHECK_HALF_MV(xy2, +1, +1) }else{ mx= 2*(mx - xx); my= 2*(my - yy); } *mx_ptr = mx; *my_ptr = my; return dminh; }
1threat
static void sd_response_r1_make(SDState *sd, uint8_t *response) { uint32_t status = sd->card_status; sd->card_status &= ~CARD_STATUS_C | APP_CMD; response[0] = (status >> 24) & 0xff; response[1] = (status >> 16) & 0xff; response[2] = (status >> 8) & 0xff; response[3] = (status >> 0) & 0xff; }
1threat
Can I initilizae 2d string array to a specific string in c#? : I want to initialize whole 2d array to a specific word say "word" i.e. every index has value of word by using some function without traversing whole array. I cant find any help in this regard.
0debug
How to create project in a firebase and download google-services.json file by command line : <p>How to create project in a firebase and download .json file by command line</p>
0debug
Anaconda3 activate.bat is not recognized as an internal or external command : <p>I have downloaded Anaconda3 for windows 64-bit operating system. After the download and install completed, I opened the Anaconda prompt but it give me this nice error:</p> <pre><code>'C:\Anaconda3\Scripts\activate.bat' is not recognized as an internal or external command,operable program or batch file. </code></pre> <p>I just surfed the internet and found a solution to uninstall all previous packages of python but did not work. I have searched for activate.bat file in my system " found it in one folders of anaconda directory " and copy, paste it to the Scripts folder but it gives me errors with conda packages and dependencies. Any solutions please!!<br> I cannot run any either jupyter notebook or conda as well. Actually, I do not know how to find them in those bunch of Anaconda files and packages.<br></p> <p>Thanks in advance,,,. </p>
0debug
int ff_vaapi_render_picture(FFVAContext *vactx, VASurfaceID surface) { VABufferID va_buffers[3]; unsigned int n_va_buffers = 0; if (!vactx->pic_param_buf_id) return 0; vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id); va_buffers[n_va_buffers++] = vactx->pic_param_buf_id; if (vactx->iq_matrix_buf_id) { vaUnmapBuffer(vactx->display, vactx->iq_matrix_buf_id); va_buffers[n_va_buffers++] = vactx->iq_matrix_buf_id; } if (vactx->bitplane_buf_id) { vaUnmapBuffer(vactx->display, vactx->bitplane_buf_id); va_buffers[n_va_buffers++] = vactx->bitplane_buf_id; } if (vaBeginPicture(vactx->display, vactx->context_id, surface) != VA_STATUS_SUCCESS) return -1; if (vaRenderPicture(vactx->display, vactx->context_id, va_buffers, n_va_buffers) != VA_STATUS_SUCCESS) return -1; if (vaRenderPicture(vactx->display, vactx->context_id, vactx->slice_buf_ids, vactx->n_slice_buf_ids) != VA_STATUS_SUCCESS) return -1; if (vaEndPicture(vactx->display, vactx->context_id) != VA_STATUS_SUCCESS) return -1; return 0; }
1threat
void qpci_io_writeb(QPCIDevice *dev, void *data, uint8_t value) { uintptr_t addr = (uintptr_t)data; if (addr < QPCI_PIO_LIMIT) { dev->bus->pio_writeb(dev->bus, addr, value); } else { dev->bus->memwrite(dev->bus, addr, &value, sizeof(value)); } }
1threat
def last_Digit(n) : return (n % 10)
0debug
How do you pass/bind a value through a RaisedButton in Flutter? : <p>I have a ListView of RaisedButtons, where each RaisedButton looks like this. The <code>name</code> variable is different for each RaisedButton:</p> <pre><code> new RaisedButton( onPressed: _navigateToRoute, child: new Text(name), ), </code></pre> <p>Tapping on a RaisedButton calls _navigateToRoute(): </p> <pre><code> void _navigateToRoute() { Navigator.of(context).push(new MaterialPageRoute&lt;Null&gt;( builder: (BuildContext context) { return new Scaffold( body: new Text('A value with the word "Hello" should go here'), ); }, )); } </code></pre> <p>When a specific RaisedButton is tapped (e.g. let's say we tap the first RaisedButton in the ListView, where <code>name = 'Hello'</code>), I would like to pass the <code>name</code> variable to the new route. How do I do that? Is there a way to store <code>name</code> in the <code>context</code> variable? Should I use another widget instead of RaisedButton?</p> <p>I could use a <a href="https://docs.flutter.io/flutter/widgets/Navigator-class.html" rel="noreferrer">Named Navigator Route</a> but I don't want to hardcode a route for each item in my ListView.</p> <p>I found <a href="https://github.com/flutter/flutter/issues/7877" rel="noreferrer">this Github issue</a>, and I'm not sure if it's the same thing I'm encountering.</p>
0debug
av_const int ff_h263_aspect_to_info(AVRational aspect){ int i; if(aspect.num==0) aspect= (AVRational){1,1}; for(i=1; i<6; i++){ if(av_cmp_q(ff_h263_pixel_aspect[i], aspect) == 0){ return i; } } return FF_ASPECT_EXTENDED; }
1threat
check if row allredy exists : I want to check in my sql table if row allredy existes. I want to save data if he is not existes in my table. I'm using in selsect qurey but it dosent worked this is my code: $sql = "INSERT INTO searchtable (word, position, count) VALUES (:word , :position, :count)"; $statement = $db->prepare($sql); $temp="SELECT COUNT(word) AS searchtableFromword FROM searchtable WHERE word=$title" ; echo mysql_num_rows($temp); if($checkTitle == 0 ) { $statement->execute(array( 'word' => $title, 'position' => $fileNum, 'count' => $titleVal )); }
0debug
Fetching Pdf specific columns to excel using macro : I have been given a PDF that has a table in it,I have to write three of its column to an excel sheet using macro.How do I do this??
0debug
My programme cannot run i have been trying 3days already : <p>I need to store all car information using array in class and print it out. Can anyone help me edit it T.T. I am using switch after they have register their car that how many car they want to register. It need to get back to menu and led them to the second choice to update their information. 3rd is to print out which one they wanted to print out and they can key in without printing out all 4th, but for this 4th is to print out all.</p> <pre><code>#include &lt;iostream&gt; #include &lt;string&gt; #include &lt;vector&gt; using namespace std; class Vehicle { protected: string Manufacturer; string Type; int Seatnumber; public: Vehicle() { Manufacturer=""; Type=""; Seatnumber=1; }; Vehicle(string manufacturer,string type,int seatnumber) { Manufacturer=manufacturer; Type=type; Seatnumber=seatnumber; }; void setmanufacturer(string manufacturer) { Manufacturer=manufacturer; }; void settype(string type) { Type=type; }; void setseatnumber(int seatnumber) { Seatnumber=seatnumber; }; string getmanufacturer() { return Manufacturer; } string gettype() { return Type; }; int getseatnumber() { return Seatnumber; }; }; class Car: public Vehicle { protected: string Carplatenumber; string Model; public: Car():Vehicle() { Carplatenumber=""; Model=""; }; Car(string carplatenumber, string model) { Carplatenumber=carplatenumber; Model=model; }; void setcarplatenumber(string carplatenumber) { Carplatenumber=carplatenumber; }; void setmodel(string model) { Model=model; }; string getcarplatenumber() { return Carplatenumber; }; string getmodel() { return Model; }; void display(); }; inline void Car::display(){ cout&lt;&lt;Manufacturer; cout&lt;&lt;Type; cout&lt;&lt;Seatnumber; cout&lt;&lt;Carplatenumber; cout&lt;&lt;Model; }; int main () { char choice; int size=0,seats; Car car[size]; string manufacturer,type,carplatenumber,model; cout&lt;&lt;"Please choice a selection: "; cin&gt;&gt;choice; bool True=true; while(True){ switch(choice){ case 'A': True=false; cout&lt;&lt;"How many cars information do you want to store in it : "; cin&gt;&gt;size; cout&lt;&lt;"\n"; for(int i=0;i&lt;size;i++){ cout &lt;&lt; "Enter car "&lt;&lt;i+1&lt;&lt;" Manufacturer : "; getline (cin,manufacturer); cin.ignore(); car[size].setmanufacturer(manufacturer); cout &lt;&lt; "Enter car "&lt;&lt;i+1&lt;&lt;" Type : "; getline (cin,type); cin.ignore(); car[size].settype(type); cout &lt;&lt; "Enter car "&lt;&lt;i+1&lt;&lt;" Seatsnumber of the car : "; cin &gt;&gt; seats; cin.ignore(); car[size].setseatnumber(seats); cout &lt;&lt; "Enter car "&lt;&lt;i+1&lt;&lt;" Model : "; getline (cin,model); cin.ignore(); car[size].setmodel(model); True=true; } break; case'B': True=false; cout &lt;&lt; "Hi,there please update your carplatenumber after u have gone through your new car!"; getline(cin,carplatenumber); car[size].setcarplatenumber(carplatenumber); True=true; break; case'c': True=false; for(int i=0;i&lt;size;i++){ car[i].display(); } True=true; break; default:cout&lt;&lt;"Invalid input"; } } return 0; } </code></pre>
0debug
How to write unit tests for python tornado application? : <p>I want to try to write some code following TDD practice. I want to create simple app based on python's tornado framework. I was looking through the internet how people write tests for tornado and found something like this:</p> <pre><code>class TestSomeHandler(AsyncHTTPTestCase): def test_success(self): response = self.fetch('/something') self.assertEqual(response.code, 200) </code></pre> <p>Correct me if I'm wrong but it looks more like integration tests. Instead of it I'm trying to write simple unit test for some dummy handler. For example such one:</p> <pre><code>class SomeHandler(BaseHandler): @gen.coroutine def get(self): try: from_date = self.get_query_argument("from", default=None) datetime.datetime.strptime(from_date, '%Y-%m-%d') except ValueError: raise ValueError("Incorrect argument value for from_date = %s, should be YYYY-MM-DD" % from_date) </code></pre> <p>And test would look like:</p> <pre><code>class TestSomeHandler(AsyncHTTPTestCase): def test_no_from_date_param(self): handler = SomeHandler() with self.assertRaises(ValueError): handler.get() </code></pre> <p>I know I miss at <code>get()</code> application and request. Not handled yet how to create them.</p> <p>But my question is, do people write tests for tornado like in first example or somebody calls handlers inside of app? What pattern to follow? It would be nice if somebody have relevant code to share. </p>
0debug
Mocking chain of methods in rspec : <p>There are a chain of methods which gets a <code>user</code> object. I am trying to mock the following to return a <code>user</code> in my <code>Factory Girl</code></p> <pre><code>@current_user = AuthorizeApiRequest.call(request.headers).result </code></pre> <p>I can mock the object up until the <code>call</code> method but I'm stuck at mocking the <code>result</code> method</p> <pre><code>allow(AuthorizeApiRequest).to receive(:call).and_return(:user) </code></pre>
0debug
How do you change the colour of a section title in a tableview? : <p>Here is what I have at the moment.</p> <p><a href="https://i.stack.imgur.com/JYNrd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/JYNrd.png" alt="enter image description here"></a></p> <p>How do I refer to this so that I can change the text colour to match my index list? The <strong>sectionForSectionIndexTitle</strong> worked well for adding in the correct section title but how exactly does one access the title element? </p> <p>Or is it impossible and I need to redraw the view and add it with <strong>viewForHeaderInSection</strong>?</p>
0debug
How to use XML with Android Studio : <p>I'm very new To Android Studio, but I am pretty good with Java but have never really tried out XML. Whenever I search the web I can't really find any good tutorials on XML, and when I do they are irrelevant and the code is different then the one Android Studio uses. Do any of you know any good tutorials that teach you how to use XML in Android Studio? Thanks.</p> <p>P.S This is the XML that I'm referring to: <a href="https://gyazo.com/9b86f01828dc130f964e126561049827" rel="nofollow noreferrer">https://gyazo.com/9b86f01828dc130f964e126561049827</a></p>
0debug
Creating Stored Proc getting Incorrect syntax near the keyword 'Declare' : I have no idea why I am getting this error > Msg 156, Level 15, State 1, Procedure usp_cloud_ClientAllSearch, Line 2 Incorrect syntax near the keyword 'Declare'. Because I have declared the variable. USE [The_Cloud] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create PROCEDURE [dbo].[usp_cloud_ClientAllSearch] Declare @Search NVARCHAR(30) SELECT client_Name, client_Surname, client_CompanyName, clientContact_TelephoneNo, clientContact_MobileNo, clientAddress_PostalCode FROM cloud_Client Inner Join dbo.cloud_ClientAddresses ON cloud_Client.client_ID = cloud_ClientAddresses.client_ID LEFT JOIN cloud_ClientContact ON cloud_Client.client_ID = cloud_ClientContact.client_ID WHERE cloud_Client.client_Name LIKE @Search + '%' or cloud_Client.client_Surname LIKE @Search + '%' or cloud_ClientContact.clientContact_MobileNo LIKE @Search + '%' or cloud_ClientAddresses.clientAddress_PostalCode LIKE @Search + '%'
0debug
Not able to see Pos when I create deployment as Job : When I try to create Deployment as Type Job, it's no pulling any image. Below is .yaml: --- apiVersion: batch/v1 kind: Job metadata: name: copyartifacts spec: backoffLimit: 1 template: metadata: name: copyartifacts spec: restartPolicy: "Never" volumes: - name: sharedvolume persistentVolumeClaim: claimName: shared-pvc - name: dockersocket hostPath: path: /var/run/docker.sock containers: - name: copyartifacts image: alpine:3.7 imagePullPolicy: Always command: ["sh", "-c", "ls -l /shared; rm -rf /shared/*; ls -l /shared; while [ ! -d /shared/artifacts ]; do echo Waiting for artifacts to be copied; sleep 2; done; sleep 10; ls -l /shared/artifacts; "] volumeMounts: - mountPath: /shared name: sharedvolume Can you please guide here? Regards, Vikas
0debug
why did my code stop working? : when I entered docmd. in my code it worked, until I closed it then it stoped working here is my code [here is my code][1] [1]: https://i.imgur.com/1B3kSfL.png
0debug
Can I lose "constness" in the return type of an override virtual function? : <p>The following code compiles and runs, and no warning is emitted by either gcc or clang:</p> <pre><code>#include &lt;iostream&gt; struct Base { virtual ~Base() = default; virtual std::string const&amp; get() = 0; }; struct Derived: Base { virtual std::string&amp; get() override { return m; } std::string m; }; int main() { Derived d; d.get() = "Hello, World"; Base&amp; b = d; std::cout &lt;&lt; b.get() &lt;&lt; "\n"; } </code></pre> <p>Is <code>std::string&amp;</code> covariant with <code>std::string const&amp;</code> then?</p>
0debug
static inline void gen_ins(DisasContext *s, TCGMemOp ot) { if (s->base.tb->cflags & CF_USE_ICOUNT) { gen_io_start(); } gen_string_movl_A0_EDI(s); tcg_gen_movi_tl(cpu_T0, 0); gen_op_st_v(s, ot, cpu_T0, cpu_A0); tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_regs[R_EDX]); tcg_gen_andi_i32(cpu_tmp2_i32, cpu_tmp2_i32, 0xffff); gen_helper_in_func(ot, cpu_T0, cpu_tmp2_i32); gen_op_st_v(s, ot, cpu_T0, cpu_A0); gen_op_movl_T0_Dshift(ot); gen_op_add_reg_T0(s->aflag, R_EDI); gen_bpt_io(s, cpu_tmp2_i32, ot); if (s->base.tb->cflags & CF_USE_ICOUNT) { gen_io_end(); } }
1threat
Finding 2nd largest number in array (one look at array) : <p>I did a class earlier where we went through this kind of algorithm but can't find my code. How do I find the 2nd biggest number in an array with only 1 scan?</p> <p>I was thinking about using nodes but that would screw up if the largest and 2nd largest one starts on same side. And an ugly way is to have two extra temp-variables and "find" the smaller one of them. </p> <p>So anyone got any tip? Oh and it's java if you have the code. In the meantime I'll try to search more on google!</p>
0debug
Printing all the integers from 0 to n in in descending order order using recursive method : <p>I made a little program to practice recursions, but I can't get it to work as intended as you can see. In its current state, the program kinda works but not like I want it to. </p> <p>What I am looking for is to print values from int N to 0 in descending order rather than from 10 to N as it is currently in the code.</p> <pre><code>private static void DescendingRecursion(int n) { if (n == 10) // Base case return; else { DescendingRecursion(n + 1); Console.Write(n + " "); } } static void Main(string[] args) { DescendingRecursion(0); } </code></pre> <p>(output: 9 8 7 6 5 4 3 2 1 0)</p>
0debug
Issue when accessing hash by key : <p>I am doing my first Python project and I have the following code:</p> <pre><code> response = urlopen(request) flights = response.read() text_file = open("Output.txt", "w") text_file.write(flights) text_file.close() minPrice = LARGE_CONSTANT for flight in flights["Quotes"] if(flight["MinPrice"] &lt; minPrice) minPrice = flight["MinPrice"] </code></pre> <p>I am getting this error:</p> <pre><code> for flight in flights["Quotes"] ^ SyntaxError: invalid syntax </code></pre> <p>It seems like a very basic issue, but I'm unable to figure out what's wrong. The hash <code>flights</code> has the following content:</p> <pre><code>{"Quotes":[{"QuoteId":1,"MinPrice":721.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":40074,"DepartureDate":"2016-05-15T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":40074,"DestinationId":60987,"DepartureDate":"2016-05-24T00:00:00"},"QuoteDateTime":"2016-04-16T13:58:00"},{"QuoteId":2,"MinPrice":490.0,"Direct":false,"OutboundLeg":{"CarrierIds":[835],"OriginId":50290,"DestinationId":42644,"DepartureDate":"2016-05-14T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":42563,"DestinationId":50290,"DepartureDate":"2016-05-23T00:00:00"},"QuoteDateTime":"2016-04-17T21:04:00"},{"QuoteId":3,"MinPrice":596.0,"Direct":false,"OutboundLeg":{"CarrierIds":[835],"OriginId":50290,"DestinationId":42644,"DepartureDate":"2016-05-28T00:00:00"},"InboundLeg":{"CarrierIds":[1710],"OriginId":42644,"DestinationId":50290,"DepartureDate":"2016-05-29T00:00:00"},"QuoteDateTime":"2016-04-07T22:10:00"},{"QuoteId":4,"MinPrice":574.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":60987,"DestinationId":42664,"DepartureDate":"2016-05-06T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":42664,"DestinationId":60987,"DepartureDate":"2016-05-08T00:00:00"},"QuoteDateTime":"2016-04-13T02:09:00"},{"QuoteId":5,"MinPrice":856.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1368],"OriginId":50290,"DestinationId":42664,"DepartureDate":"2016-05-05T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":42664,"DestinationId":50290,"DepartureDate":"2016-05-10T00:00:00"},"QuoteDateTime":"2016-04-15T23:11:00"},{"QuoteId":6,"MinPrice":741.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1033],"OriginId":60987,"DestinationId":43139,"DepartureDate":"2016-05-09T00:00:00"},"InboundLeg":{"CarrierIds":[1033],"OriginId":43139,"DestinationId":60987,"DepartureDate":"2016-05-16T00:00:00"},"QuoteDateTime":"2016-04-15T16:28:00"},{"QuoteId":7,"MinPrice":729.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":65633,"DestinationId":45676,"DepartureDate":"2016-05-07T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":45676,"DestinationId":60987,"DepartureDate":"2016-05-14T00:00:00"},"QuoteDateTime":"2016-04-07T05:58:00"},{"QuoteId":8,"MinPrice":848.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1033],"OriginId":60987,"DestinationId":47777,"DepartureDate":"2016-05-09T00:00:00"},"InboundLeg":{"CarrierIds":[1033],"OriginId":47777,"DestinationId":60987,"DepartureDate":"2016-05-16T00:00:00"},"QuoteDateTime":"2016-04-09T10:48:00"},{"QuoteId":9,"MinPrice":804.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1368],"OriginId":50290,"DestinationId":49369,"DepartureDate":"2016-05-27T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":49369,"DestinationId":50290,"DepartureDate":"2016-05-30T00:00:00"},"QuoteDateTime":"2016-04-18T09:39:00"},{"QuoteId":10,"MinPrice":576.0,"Direct":false,"OutboundLeg":{"CarrierIds":[838],"OriginId":50290,"DestinationId":49369,"DepartureDate":"2016-05-03T00:00:00"},"InboundLeg":{"CarrierIds":[838],"OriginId":49369,"DestinationId":60987,"DepartureDate":"2016-05-05T00:00:00"},"QuoteDateTime":"2016-04-09T15:12:00"},{"QuoteId":11,"MinPrice":726.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":60987,"DestinationId":49793,"DepartureDate":"2016-05-17T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":49793,"DestinationId":60987,"DepartureDate":"2016-05-24T00:00:00"},"QuoteDateTime":"2016-04-17T21:30:00"},{"QuoteId":12,"MinPrice":1172.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":50340,"DepartureDate":"2016-05-01T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":50340,"DestinationId":60987,"DepartureDate":"2016-05-04T00:00:00"},"QuoteDateTime":"2016-04-12T15:01:00"},{"QuoteId":13,"MinPrice":666.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1907],"OriginId":65633,"DestinationId":54353,"DepartureDate":"2016-05-10T00:00:00"},"InboundLeg":{"CarrierIds":[1907],"OriginId":54353,"DestinationId":65633,"DepartureDate":"2016-05-21T00:00:00"},"QuoteDateTime":"2016-04-04T01:14:00"},{"QuoteId":14,"MinPrice":802.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1368],"OriginId":50290,"DestinationId":54353,"DepartureDate":"2016-05-18T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":54353,"DestinationId":50290,"DepartureDate":"2016-05-25T00:00:00"},"QuoteDateTime":"2016-04-18T01:59:00"},{"QuoteId":15,"MinPrice":754.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":60987,"DestinationId":59078,"DepartureDate":"2016-05-15T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":59078,"DestinationId":60987,"DepartureDate":"2016-05-22T00:00:00"},"QuoteDateTime":"2016-04-15T01:55:00"},{"QuoteId":16,"MinPrice":1375.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":50290,"DestinationId":59117,"DepartureDate":"2016-05-06T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":59117,"DestinationId":50290,"DepartureDate":"2016-05-13T00:00:00"},"QuoteDateTime":"2016-04-06T09:28:00"},{"QuoteId":17,"MinPrice":893.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":50290,"DestinationId":60946,"DepartureDate":"2016-05-10T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":60946,"DestinationId":60987,"DepartureDate":"2016-05-17T00:00:00"},"QuoteDateTime":"2016-04-10T16:56:00"},{"QuoteId":18,"MinPrice":735.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":60987,"DestinationId":65393,"DepartureDate":"2016-05-16T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":65393,"DestinationId":60987,"DepartureDate":"2016-05-23T00:00:00"},"QuoteDateTime":"2016-04-16T15:37:00"},{"QuoteId":19,"MinPrice":520.0,"Direct":false,"OutboundLeg":{"CarrierIds":[858],"OriginId":60987,"DestinationId":65465,"DepartureDate":"2016-05-21T00:00:00"},"InboundLeg":{"CarrierIds":[858],"OriginId":65698,"DestinationId":60987,"DepartureDate":"2016-05-24T00:00:00"},"QuoteDateTime":"2016-04-09T18:44:00"},{"QuoteId":20,"MinPrice":538.0,"Direct":false,"OutboundLeg":{"CarrierIds":[858],"OriginId":60987,"DestinationId":65465,"DepartureDate":"2016-05-01T00:00:00"},"InboundLeg":{"CarrierIds":[858],"OriginId":65465,"DestinationId":60987,"DepartureDate":"2016-05-03T00:00:00"},"QuoteDateTime":"2016-04-17T17:29:00"},{"QuoteId":21,"MinPrice":602.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1081],"OriginId":60987,"DestinationId":65655,"DepartureDate":"2016-05-03T00:00:00"},"InboundLeg":{"CarrierIds":[1081],"OriginId":65655,"DestinationId":50290,"DepartureDate":"2016-05-12T00:00:00"},"QuoteDateTime":"2016-04-06T19:36:00"},{"QuoteId":22,"MinPrice":580.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1001],"OriginId":60987,"DestinationId":65655,"DepartureDate":"2016-05-06T00:00:00"},"InboundLeg":{"CarrierIds":[1001],"OriginId":65655,"DestinationId":60987,"DepartureDate":"2016-05-25T00:00:00"},"QuoteDateTime":"2016-04-12T06:36:00"},{"QuoteId":23,"MinPrice":494.0,"Direct":false,"OutboundLeg":{"CarrierIds":[835],"OriginId":50290,"DestinationId":65698,"DepartureDate":"2016-05-12T00:00:00"},"InboundLeg":{"CarrierIds":[835],"OriginId":65698,"DestinationId":65633,"DepartureDate":"2016-05-14T00:00:00"},"QuoteDateTime":"2016-04-17T00:26:00"},{"QuoteId":24,"MinPrice":666.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1859],"OriginId":60987,"DestinationId":65698,"DepartureDate":"2016-05-05T00:00:00"},"InboundLeg":{"CarrierIds":[838],"OriginId":65698,"DestinationId":60987,"DepartureDate":"2016-05-17T00:00:00"},"QuoteDateTime":"2016-04-07T12:21:00"},{"QuoteId":25,"MinPrice":733.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1033],"OriginId":60987,"DestinationId":66076,"DepartureDate":"2016-05-09T00:00:00"},"InboundLeg":{"CarrierIds":[1033],"OriginId":66076,"DestinationId":60987,"DepartureDate":"2016-05-16T00:00:00"},"QuoteDateTime":"2016-04-09T06:06:00"},{"QuoteId":26,"MinPrice":5673.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1385],"OriginId":60987,"DestinationId":66270,"DepartureDate":"2016-05-03T00:00:00"},"InboundLeg":{"CarrierIds":[1385],"OriginId":66270,"DestinationId":60987,"DepartureDate":"2016-05-25T00:00:00"},"QuoteDateTime":"2016-04-13T20:36:00"},{"QuoteId":27,"MinPrice":1379.0,"Direct":true,"OutboundLeg":{"CarrierIds":[2058],"OriginId":50290,"DestinationId":66270,"DepartureDate":"2016-05-06T00:00:00"},"InboundLeg":{"CarrierIds":[2058],"OriginId":66270,"DestinationId":50290,"DepartureDate":"2016-05-21T00:00:00"},"QuoteDateTime":"2016-04-13T04:57:00"},{"QuoteId":28,"MinPrice":505.0,"Direct":true,"OutboundLeg":{"CarrierIds":[105],"OriginId":60987,"DestinationId":67662,"DepartureDate":"2016-05-12T00:00:00"},"InboundLeg":{"CarrierIds":[105],"OriginId":67662,"DestinationId":60987,"DepartureDate":"2016-05-20T00:00:00"},"QuoteDateTime":"2016-04-13T10:12:00"},{"QuoteId":29,"MinPrice":551.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":60987,"DestinationId":67662,"DepartureDate":"2016-05-20T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":67662,"DestinationId":60987,"DepartureDate":"2016-05-22T00:00:00"},"QuoteDateTime":"2016-04-12T02:42:00"},{"QuoteId":30,"MinPrice":906.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":50290,"DestinationId":68229,"DepartureDate":"2016-05-17T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":68229,"DestinationId":50290,"DepartureDate":"2016-05-24T00:00:00"},"QuoteDateTime":"2016-04-17T15:23:00"},{"QuoteId":31,"MinPrice":804.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1368],"OriginId":50290,"DestinationId":70060,"DepartureDate":"2016-05-27T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":70060,"DestinationId":50290,"DepartureDate":"2016-05-31T00:00:00"},"QuoteDateTime":"2016-04-18T14:38:00"},{"QuoteId":32,"MinPrice":618.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":60987,"DestinationId":70060,"DepartureDate":"2016-05-19T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":70060,"DestinationId":60987,"DepartureDate":"2016-05-22T00:00:00"},"QuoteDateTime":"2016-04-09T17:33:00"},{"QuoteId":33,"MinPrice":823.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":70745,"DepartureDate":"2016-05-16T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":70745,"DestinationId":60987,"DepartureDate":"2016-05-23T00:00:00"},"QuoteDateTime":"2016-04-16T21:40:00"},{"QuoteId":34,"MinPrice":1129.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":60987,"DestinationId":71017,"DepartureDate":"2016-05-23T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":71017,"DestinationId":60987,"DepartureDate":"2016-05-27T00:00:00"},"QuoteDateTime":"2016-04-03T21:25:00"},{"QuoteId":35,"MinPrice":798.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":82165,"DepartureDate":"2016-05-10T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":82165,"DestinationId":60987,"DepartureDate":"2016-05-17T00:00:00"},"QuoteDateTime":"2016-04-10T03:23:00"},{"QuoteId":36,"MinPrice":726.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1523],"OriginId":60987,"DestinationId":82398,"DepartureDate":"2016-05-09T00:00:00"},"InboundLeg":{"CarrierIds":[1523],"OriginId":82398,"DestinationId":60987,"DepartureDate":"2016-05-14T00:00:00"},"QuoteDateTime":"2016-04-16T23:32:00"},{"QuoteId":37,"MinPrice":475.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1368],"OriginId":50290,"DestinationId":42563,"DepartureDate":"2016-05-18T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":42563,"DestinationId":50290,"DepartureDate":"2016-05-25T00:00:00"},"QuoteDateTime":"2016-04-18T02:26:00"},{"QuoteId":38,"MinPrice":795.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":60987,"DestinationId":63721,"DepartureDate":"2016-05-04T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":63721,"DestinationId":60987,"DepartureDate":"2016-05-09T00:00:00"},"QuoteDateTime":"2016-04-17T18:04:00"},{"QuoteId":39,"MinPrice":799.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":60987,"DestinationId":66217,"DepartureDate":"2016-05-16T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":66217,"DestinationId":60987,"DepartureDate":"2016-05-23T00:00:00"},"QuoteDateTime":"2016-04-10T19:24:00"},{"QuoteId":40,"MinPrice":819.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":82649,"DepartureDate":"2016-05-16T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":82649,"DestinationId":60987,"DepartureDate":"2016-05-23T00:00:00"},"QuoteDateTime":"2016-04-08T13:48:00"},{"QuoteId":41,"MinPrice":773.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":65633,"DestinationId":44620,"DepartureDate":"2016-05-09T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":44620,"DestinationId":65633,"DepartureDate":"2016-05-11T00:00:00"},"QuoteDateTime":"2016-04-08T22:21:00"},{"QuoteId":42,"MinPrice":995.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":47540,"DepartureDate":"2016-05-15T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":47540,"DestinationId":60987,"DepartureDate":"2016-05-24T00:00:00"},"QuoteDateTime":"2016-04-16T13:57:00"},{"QuoteId":43,"MinPrice":6835.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":42843,"DepartureDate":"2016-05-06T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":42843,"DestinationId":60987,"DepartureDate":"2016-05-21T00:00:00"},"QuoteDateTime":"2016-04-17T19:06:00"},{"QuoteId":44,"MinPrice":6826.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":54367,"DepartureDate":"2016-05-05T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":54367,"DestinationId":60987,"DepartureDate":"2016-05-11T00:00:00"},"QuoteDateTime":"2016-04-13T09:33:00"}],"Places":[{"PlaceId":40074,"IataCode":"ABZ","Name":"Aberdeen","Type":"Station","CityName":"Aberdeen","CityId":"ABER","CountryName":"United Kingdom"},{"PlaceId":42563,"IataCode":"BFS","Name":"Belfast International","Type":"Station","CityName":"Belfast","CityId":"BELF","CountryName":"United Kingdom"},{"PlaceId":42644,"IataCode":"BHD","Name":"Belfast City","Type":"Station","CityName":"Belfast","CityId":"BELF","CountryName":"United Kingdom"},{"PlaceId":42664,"IataCode":"BHX","Name":"Birmingham","Type":"Station","CityName":"Birmingham","CityId":"BIRM","CountryName":"United Kingdom"},{"PlaceId":42843,"IataCode":"BLK","Name":"Blackpool","Type":"Station","CityName":"Blackpool","CityId":"BLAC","CountryName":"United Kingdom"},{"PlaceId":43139,"IataCode":"BRS","Name":"Bristol","Type":"Station","CityName":"Bristol","CityId":"BRIS","CountryName":"United Kingdom"},{"PlaceId":44620,"IataCode":"CAL","Name":"Campbeltown","Type":"Station","CityName":"Campbeltown","CityId":"CAMP","CountryName":"United Kingdom"},{"PlaceId":45676,"IataCode":"CWL","Name":"Cardiff","Type":"Station","CityName":"Cardiff","CityId":"CARD","CountryName":"United Kingdom"},{"PlaceId":47540,"IataCode":"DND","Name":"Dundee","Type":"Station","CityName":"Dundee","CityId":"DUND","CountryName":"United Kingdom"},{"PlaceId":47777,"IataCode":"DSA","Name":"Doncaster Sheffield","Type":"Station","CityName":"Doncaster","CityId":"DONC","CountryName":"United Kingdom"},{"PlaceId":49369,"IataCode":"EDI","Name":"Edinburgh","Type":"Station","CityName":"Edinburgh","CityId":"EDIN","CountryName":"United Kingdom"},{"PlaceId":49793,"IataCode":"EMA","Name":"East Midlands","Type":"Station","CityName":"Nottingham","CityId":"NOTT","CountryName":"United Kingdom"},{"PlaceId":50290,"IataCode":"EWR","Name":"New York Newark","Type":"Station","CityName":"New York","CityId":"NYCA","CountryName":"United States"},{"PlaceId":50340,"IataCode":"EXT","Name":"Exeter","Type":"Station","CityName":"Exeter","CityId":"EXET","CountryName":"United Kingdom"},{"PlaceId":54353,"IataCode":"GLA","Name":"Glasgow International","Type":"Station","CityName":"Glasgow","CityId":"GLAS","CountryName":"United Kingdom"},{"PlaceId":54367,"IataCode":"GLO","Name":"Gloucestershire","Type":"Station","CityName":"Gloucester","CityId":"GLOA","CountryName":"United Kingdom"},{"PlaceId":57113,"IataCode":"HUY","Name":"Humberside","Type":"Station","CityName":"Humberside","CityId":"HUMB","CountryName":"United Kingdom"},{"PlaceId":59078,"IataCode":"INV","Name":"Inverness","Type":"Station","CityName":"Inverness","CityId":"INVE","CountryName":"United Kingdom"},{"PlaceId":59117,"IataCode":"IOM","Name":"Ronaldsway","Type":"Station","CityName":"Castletown","CityId":"CAST","CountryName":"United Kingdom"},{"PlaceId":60946,"IataCode":"JER","Name":"Jersey","Type":"Station","CityName":"Jersey","CityId":"JERS","CountryName":"United Kingdom"},{"PlaceId":60987,"IataCode":"JFK","Name":"New York John F. Kennedy","Type":"Station","CityName":"New York","CityId":"NYCA","CountryName":"United States"},{"PlaceId":63721,"IataCode":"KOI","Name":"Orkney Kirkwall","Type":"Station","CityName":"Orkney","CityId":"ORKN","CountryName":"United Kingdom"},{"PlaceId":65393,"IataCode":"LBA","Name":"Leeds Bradford","Type":"Station","CityName":"Leeds","CityId":"LEED","CountryName":"United Kingdom"},{"PlaceId":65465,"IataCode":"LCY","Name":"London City","Type":"Station","CityName":"London","CityId":"LOND","CountryName":"United Kingdom"},{"PlaceId":65633,"IataCode":"LGA","Name":"New York La Guardia","Type":"Station","CityName":"New York","CityId":"NYCA","CountryName":"United States"},{"PlaceId":65655,"IataCode":"LGW","Name":"London Gatwick","Type":"Station","CityName":"London","CityId":"LOND","CountryName":"United Kingdom"},{"PlaceId":65698,"IataCode":"LHR","Name":"London Heathrow","Type":"Station","CityName":"London","CityId":"LOND","CountryName":"United Kingdom"},{"PlaceId":66076,"IataCode":"LPL","Name":"Liverpool","Type":"Station","CityName":"Liverpool","CityId":"LIVE","CountryName":"United Kingdom"},{"PlaceId":66217,"IataCode":"LSI","Name":"Sumburgh Shetlands","Type":"Station","CityName":"Sumburgh","CityId":"SUMB","CountryName":"United Kingdom"},{"PlaceId":66270,"IataCode":"LTN","Name":"London Luton","Type":"Station","CityName":"London","CityId":"LOND","CountryName":"United Kingdom"},{"PlaceId":67662,"IataCode":"MAN","Name":"Manchester","Type":"Station","CityName":"Manchester","CityId":"MANC","CountryName":"United Kingdom"},{"PlaceId":68229,"IataCode":"MME","Name":"Durham Tees Valley","Type":"Station","CityName":"Durham","CityId":"MMEA","CountryName":"United Kingdom"},{"PlaceId":70060,"IataCode":"NCL","Name":"Newcastle","Type":"Station","CityName":"Newcastle","CityId":"NEWC","CountryName":"United Kingdom"},{"PlaceId":70745,"IataCode":"NQY","Name":"Newquay","Type":"Station","CityName":"Newquay","CityId":"NEWQ","CountryName":"United Kingdom"},{"PlaceId":71017,"IataCode":"NWI","Name":"Norwich","Type":"Station","CityName":"Norwich","CityId":"NORW","CountryName":"United Kingdom"},{"PlaceId":82165,"IataCode":"SOU","Name":"Southampton","Type":"Station","CityName":"Southampton","CityId":"SOUT","CountryName":"United Kingdom"},{"PlaceId":82398,"IataCode":"STN","Name":"London Stansted","Type":"Station","CityName":"London","CityId":"LOND","CountryName":"United Kingdom"},{"PlaceId":82649,"IataCode":"SYY","Name":"Stornoway","Type":"Station","CityName":"Stornoway","CityId":"STOR","CountryName":"United Kingdom"},{"PlaceId":91075,"IataCode":"WIC","Name":"Wick","Type":"Station","CityName":"Wick","CityId":"WICK","CountryName":"United Kingdom"},{"PlaceId":3413153,"IataCode":"NYC","Name":"New York","Type":"City","CityName":"New York","CityId":"NYCA"}],"Carriers":[{"CarrierId":105,"Name":"Thomas Cook Airlines"},{"CarrierId":835,"Name":"Air Canada"},{"CarrierId":838,"Name":"Air France"},{"CarrierId":858,"Name":"Alitalia"},{"CarrierId":881,"Name":"British Airways"},{"CarrierId":1001,"Name":"Norwegian"},{"CarrierId":1033,"Name":"Aer Lingus"},{"CarrierId":1081,"Name":"Icelandair"},{"CarrierId":1324,"Name":"KLM"},{"CarrierId":1368,"Name":"Lufthansa"},{"CarrierId":1385,"Name":"EL AL Israel Airlines"},{"CarrierId":1523,"Name":"Austrian Airlines"},{"CarrierId":1710,"Name":"Brussels Airlines"},{"CarrierId":1859,"Name":"Virgin Atlantic"},{"CarrierId":1907,"Name":"WestJet"},{"CarrierId":2058,"Name":"La Compagnie"}],"Currencies":[{"Code":"USD","Symbol":"$","ThousandsSeparator":",","DecimalSeparator":".","SymbolOnLeft":true,"SpaceBetweenAmountAndSymbol":false,"RoundingCoefficient":0,"DecimalDigits":2}]} </code></pre> <p>Why can I not access the hash like this <code>flights["Quotes"]</code>?</p>
0debug
def Check_Solution(a,b,c) : if ((b*b) - (4*a*c)) > 0 : return ("2 solutions") elif ((b*b) - (4*a*c)) == 0 : return ("1 solution") else : return ("No solutions")
0debug
Push Notification of update in Article in android : I have Converted Article Website to Android App using WebView. Now I want to use push notification for any update of Article in Android. Kindly help me out in an stuck on it. Waiting for Answers.
0debug
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); AVPicture dummy_pict; int ret; if ((ret = av_image_check_size(width, height, 0, NULL)) < 0) return ret; if (desc->flags & PIX_FMT_PSEUDOPAL) return width * height; return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height); }
1threat
perfomance mixing javascript and jquery : <p>There are lots of discussion about this topic, but I wanna clear my ambiguity or confusion - <strong>my mixed code make sense or not.</strong> </p> <p>Previously I thought <code>Jquery</code> is most comfortable in every aspects, from easiness to the level of flexibility. There is no doubt we can create the vast and robust client side application with the usage of Jquery.</p> <p>So I had been using <code>Jquery</code> even in small and simple tasks. But while concerning about performance, I found peoples are recommending pure JavaScript if you can. I read in lot of forums, question/answers about the performance, then I realized I am using Jquery unnecessarily.</p> <p>For example, I had using to do simple task </p> <pre><code>var value = $('#div').text(); </code></pre> <p>instead of </p> <pre><code>var value = document.getElementById('div').innerHTML; </code></pre> <p>In addition, I had used maximum <code>$.each</code> even in simple selection which can be done with <code>document.querySelector</code> or pure javascript <code>for</code> loop </p> <p>I can't avoid the usage of Jquery, but can minimize. So, browser have to load jquery. </p> <p>Now I have minimized jquery usage in external <code>.js</code> file, using pure javascript code for simple task and using jquery for only complex. </p> <p><em>Now my question is</em> </p> <p><strong>Now would my perfomance be better and fast than previous my way (where I had used jquery only) ?</strong></p> <p>OR</p> <p><strong>if $ is initialized once, does it affect other pure javascript code ?</strong></p> <p>To be more clear,</p> <p><strong>Does second one is faster than first one ?</strong></p> <p><strong>Jquery only</strong></p> <pre><code>function purchase(){ $.ajax({ url:"fetch.php", method:"POST", data:{prch_id:'pty'}, beforeSend: function() { $('.pty').html('Processsing'); }, success:function(data){ $('.pty').html(data); auto_select(); } }); } </code></pre> <p><strong>Javascript with Jquery</strong></p> <pre><code>function purchase(){ var http = null; if(window.XMLHttpRequest){ http = new XMLHttpRequest(); } else{ http = new ActiveXObject('Microsoft.XMLHTTP'); } var vars = "prch_id=pty"; http.open('POST','fetch.php',true); http.setRequestHeader('Content-type','application/x-www-form-urlencoded'); http.onreadystatechange = function(){ if(http.readyState==4 &amp;&amp; http.status==200){ var data = http.responseText; $('.pty').html(data); auto_select(); } } http.send(vars); $('.pty').html('Processsing'); } </code></pre> <p>if we used pure JavaScript only - it is sure it is speedy, but I want to know mixing of jquery and JavaScript improves or does not make any sense.</p>
0debug
Array - object or simple variable? : <p>In java, arrays can be created as int[] arr = {value1, value2, value3,.....}. Here we are not using the "new" keyword.So how do we say that array is an object in java?</p>
0debug
what is " fields: 'id' " in the below code? : /*In the below code I am trying to create folder*/ var fileMetadata = { 'name' : 'Project plan', 'mimeType' : 'application/vnd.google-apps.drive-sdk' }; // what is fields and resource key being used drive.files.create({ resource: fileMetadata, fields: 'id' }, function(err, file) { if(err) { // Handle error console.log(err); } else { console.log('File Id: ', file.id); } }); // what this fields: id represents.
0debug
change the background color of item in RecylerView , having position only : I have the positions for all the items in the RecyclerView and i want to write a code which programmatically gives background color of the item, just on the basis of position provided to it. So far i am able to scroll to the item by using this recyclerView.smoothScrollToPosition(Integer.parseInt(value));. But not able to highlight or give background color to that item.
0debug
static void vring_desc_read(VirtIODevice *vdev, VRingDesc *desc, hwaddr desc_pa, int i) { address_space_read(&address_space_memory, desc_pa + i * sizeof(VRingDesc), MEMTXATTRS_UNSPECIFIED, (void *)desc, sizeof(VRingDesc)); virtio_tswap64s(vdev, &desc->addr); virtio_tswap32s(vdev, &desc->len); virtio_tswap16s(vdev, &desc->flags); virtio_tswap16s(vdev, &desc->next); }
1threat
Angular 2 reactive form validate pattern for number with two decimal places : <p>I am trying to validate an input on an angular 2 reactive form so that only numbers with two decimal places are valid.</p> <p>I am using the <code>Validators.pattern('^\d+\.\d{2}$')</code> method to match against a regex pattern. According to <a href="https://regex101.com/r/1DbMZq/1" rel="noreferrer">https://regex101.com/r/1DbMZq/1</a> my regex matches correctly but when I use it in my form it is always invalid.</p> <p>Here is a plunker illustrating the problem: <a href="https://plnkr.co/edit/TpBZtgNNww4CnTwQFtef?p=preview" rel="noreferrer">https://plnkr.co/edit/TpBZtgNNww4CnTwQFtef?p=preview</a></p> <p>Any ideas what I'm doing wrong?</p>
0debug
Graphical Explainnation : ''' #include <stdio.h> int main() { int c; /* Present Charecter */ int old_c; /* Previous Charecter */ while((c = getchar()) != EOF) { if(old_c == ' ' && c != ' '){ putchar(' '); putchar(c); }else if(c != ' '){ putchar(c); } old_c = c; } return 0; } ''' I don't really understand how this code works. This is a solution for the C The programming language exercise 1.9; So here is my Problem For example i type in as Input : Hello World\n is the '\n' not the last character ? save into old_c : old_c = c; could someone please explain to me how to code works as i really want to learn the c programming language and programming. i am a very beginner;
0debug
static unsigned tget_short(GetByteContext *gb, int le) { unsigned v = le ? bytestream2_get_le16u(gb) : bytestream2_get_be16u(gb); return v; }
1threat
Why is reinitializing a variable out of method in class is an error? Why cant compiler just read and reassign the value to it? : <p>Like here why reinitializing variable i is an error?</p> <pre><code>class deleteme { int i=5; i=33; public static void main(String args[]) { } } </code></pre>
0debug
MemTxResult address_space_read_continue(AddressSpace *as, hwaddr addr, MemTxAttrs attrs, uint8_t *buf, int len, hwaddr addr1, hwaddr l, MemoryRegion *mr) { uint8_t *ptr; uint64_t val; MemTxResult result = MEMTX_OK; bool release_lock = false; for (;;) { if (!memory_access_is_direct(mr, false)) { release_lock |= prepare_mmio_access(mr); l = memory_access_size(mr, l, addr1); switch (l) { case 8: result |= memory_region_dispatch_read(mr, addr1, &val, 8, attrs); stq_p(buf, val); break; case 4: result |= memory_region_dispatch_read(mr, addr1, &val, 4, attrs); stl_p(buf, val); break; case 2: result |= memory_region_dispatch_read(mr, addr1, &val, 2, attrs); stw_p(buf, val); break; case 1: result |= memory_region_dispatch_read(mr, addr1, &val, 1, attrs); stb_p(buf, val); break; default: abort(); } } else { ptr = qemu_map_ram_ptr(mr->ram_block, addr1); memcpy(buf, ptr, l); } if (release_lock) { qemu_mutex_unlock_iothread(); release_lock = false; } len -= l; buf += l; addr += l; if (!len) { break; } l = len; mr = address_space_translate(as, addr, &addr1, &l, false); } return result; }
1threat
How to use APNs Auth Key (.p8 file) in C#? : <p>I'm trying to send push notifications to iOS devices, using token-based authentication.</p> <p>As required, I generated an APNs Auth Key in Apple's Dev Portal, and downloaded it (it's a file with p8 extension).</p> <p>To send push notifications from my C# server, I need to somehow use this p8 file to sign my JWT tokens. How do I do that?</p> <p>I tried to load the file to X509Certificate2, but X509Certificate2 doesn't seem to accept p8 files, so then I tried to convert the file to pfx/p12, but couldn't find a way to do that that actually works.</p>
0debug
Printf statment is producing weird output that doesnt make sense : This is all my code for listing the information from my array: private void listStudent() { { System.out.printf("%s %-7s %14s %10s","ID","First Name","Last Name","Age\n"); for (int i= 0; i<count; ++i) { System.out.println(arr[i]); } System.out.println(); Scanner scanner = new Scanner(System.in); scanner.nextLine(); public class Student { private String fname; private final String lname; double age; private final String id; int count; This is my code from the student.java file Student(String id, String fname, String lname, double age, int count) { this.id = id; this.fname = fname; this.lname = lname; this.age = age; this.count = count; } [This is what the output of the code i get is.][1] [1]: https://i.stack.imgur.com/6GbM0.png
0debug
static int drawgrid_filter_frame(AVFilterLink *inlink, AVFrame *frame) { DrawBoxContext *drawgrid = inlink->dst->priv; int plane, x, y; uint8_t *row[4]; if (drawgrid->have_alpha) { for (y = 0; y < frame->height; y++) { row[0] = frame->data[0] + y * frame->linesize[0]; row[3] = frame->data[3] + y * frame->linesize[3]; for (plane = 1; plane < 3; plane++) row[plane] = frame->data[plane] + frame->linesize[plane] * (y >> drawgrid->vsub); if (drawgrid->invert_color) { for (x = 0; x < frame->width; x++) if (pixel_belongs_to_grid(drawgrid, x, y)) row[0][x] = 0xff - row[0][x]; } else { for (x = 0; x < frame->width; x++) { if (pixel_belongs_to_grid(drawgrid, x, y)) { row[0][x ] = drawgrid->yuv_color[Y]; row[1][x >> drawgrid->hsub] = drawgrid->yuv_color[U]; row[2][x >> drawgrid->hsub] = drawgrid->yuv_color[V]; row[3][x ] = drawgrid->yuv_color[A]; } } } } } else { for (y = 0; y < frame->height; y++) { row[0] = frame->data[0] + y * frame->linesize[0]; for (plane = 1; plane < 3; plane++) row[plane] = frame->data[plane] + frame->linesize[plane] * (y >> drawgrid->vsub); if (drawgrid->invert_color) { for (x = 0; x < frame->width; x++) if (pixel_belongs_to_grid(drawgrid, x, y)) row[0][x] = 0xff - row[0][x]; } else { for (x = 0; x < frame->width; x++) { double alpha = (double)drawgrid->yuv_color[A] / 255; if (pixel_belongs_to_grid(drawgrid, x, y)) { row[0][x ] = (1 - alpha) * row[0][x ] + alpha * drawgrid->yuv_color[Y]; row[1][x >> drawgrid->hsub] = (1 - alpha) * row[1][x >> drawgrid->hsub] + alpha * drawgrid->yuv_color[U]; row[2][x >> drawgrid->hsub] = (1 - alpha) * row[2][x >> drawgrid->hsub] + alpha * drawgrid->yuv_color[V]; } } } } } return ff_filter_frame(inlink->dst->outputs[0], frame); }
1threat
Is there a easy way to get files from S3 by python? : <p>I tried to create a script which get a file from specific Bucket in S3, <br> <b>for example:</b> from <code>"s3://my-bucket/veryCoolFile.img"</code> I want to get veryCoolFile.img<br> what is the easiest way to do this?</p>
0debug
JavaScript Regex - check for enum value : <p>Currently I have a text field that allow user to enter an <code>Enum</code> value. Once they enter a value I need to validate those value first and throw an error message if not match.</p> <p>The <code>Enum</code> format will be - </p> <pre><code>yes|no|maybe#yes yes | no | maybe #yes 1|2|3|4|5#0 </code></pre> <ol> <li>string must have <code>|</code> symbol, so in the future I able to split the characters.</li> <li><code>#</code> symbol and the end. This will be a "default value" for enum. </li> </ol> <p>How to create this regex? Thanks in advance.</p>
0debug
int bdrv_make_zero(BdrvChild *child, BdrvRequestFlags flags) { int64_t target_size, ret, bytes, offset = 0; BlockDriverState *bs = child->bs; int n; target_size = bdrv_getlength(bs); if (target_size < 0) { return target_size; } for (;;) { bytes = MIN(target_size - offset, BDRV_REQUEST_MAX_BYTES); if (bytes <= 0) { return 0; } ret = bdrv_get_block_status(bs, offset >> BDRV_SECTOR_BITS, bytes >> BDRV_SECTOR_BITS, &n, NULL); if (ret < 0) { error_report("error getting block status at offset %" PRId64 ": %s", offset, strerror(-ret)); return ret; } if (ret & BDRV_BLOCK_ZERO) { offset += n * BDRV_SECTOR_BITS; continue; } ret = bdrv_pwrite_zeroes(child, offset, n * BDRV_SECTOR_SIZE, flags); if (ret < 0) { error_report("error writing zeroes at offset %" PRId64 ": %s", offset, strerror(-ret)); return ret; } offset += n * BDRV_SECTOR_SIZE; } }
1threat
static void rtas_nvram_fetch(sPAPREnvironment *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets) { sPAPRNVRAM *nvram = spapr->nvram; hwaddr offset, buffer, len; int alen; void *membuf; if ((nargs != 3) || (nret != 2)) { rtas_st(rets, 0, -3); return; } if (!nvram) { rtas_st(rets, 0, -1); rtas_st(rets, 1, 0); return; } offset = rtas_ld(args, 0); buffer = rtas_ld(args, 1); len = rtas_ld(args, 2); if (((offset + len) < offset) || ((offset + len) > nvram->size)) { rtas_st(rets, 0, -3); rtas_st(rets, 1, 0); return; } membuf = cpu_physical_memory_map(buffer, &len, 1); if (nvram->drive) { alen = bdrv_pread(nvram->drive, offset, membuf, len); } else { assert(nvram->buf); memcpy(membuf, nvram->buf + offset, len); alen = len; } cpu_physical_memory_unmap(membuf, len, 1, len); rtas_st(rets, 0, (alen < len) ? -1 : 0); rtas_st(rets, 1, (alen < 0) ? 0 : alen); }
1threat
Getting a footer to stay on the bottom : <p>I've been all over this website and I've read every question about footers not working that I can find. I've implemented every one of them to my page and I can't get a single solution for my site. I'm new to CSS and HTML, so please bear with me. </p> <p>I have a Big Cartel Page and I use the Sidecar theme. I have been playing with code, changing fonts, altering image sizes and mostly just adding small tweaks here and there. I would love to add a footer with my contact info (phone, email, copyright, etc) that sits at the bottom of every page. </p> <p>My homepage and FAQ pages are very long, and I need the footer to sit out of sight until the user scrolls all the way past the text to the bottom. But I also have many product pages that vary in length, but are sometimes short enough that I worry about the footer creeping up from the bottom. </p> <p>I have tried every answer on <a href="https://stackoverflow.com/questions/3443606/make-footer-stick-to-bottom-of-page-correctly?rq=1">this page</a>, and I'm sorry in advance for not knowing how to share all of my trials well. I have tried every position I can find (fixed, static, relative, absolute) and I don't know what else I should try. Every one of them has the footer stretched across the screen well above the bottom of the page. </p> <p>I can't figure out if it's the theme I'm using on Big Cartel to blame, or my own shortcomings with code. Probably the latter. Either way, I'd love any insight, as the main source of my trials is that link I posted, and it's from several years ago. </p>
0debug
static void test_acpi_fadt_table(test_data *data) { AcpiFadtDescriptorRev1 *fadt_table = &data->fadt_table; uint32_t addr; addr = data->rsdt_tables_addr[0]; ACPI_READ_TABLE_HEADER(fadt_table, addr); ACPI_READ_FIELD(fadt_table->firmware_ctrl, addr); ACPI_READ_FIELD(fadt_table->dsdt, addr); ACPI_READ_FIELD(fadt_table->model, addr); ACPI_READ_FIELD(fadt_table->reserved1, addr); ACPI_READ_FIELD(fadt_table->sci_int, addr); ACPI_READ_FIELD(fadt_table->smi_cmd, addr); ACPI_READ_FIELD(fadt_table->acpi_enable, addr); ACPI_READ_FIELD(fadt_table->acpi_disable, addr); ACPI_READ_FIELD(fadt_table->S4bios_req, addr); ACPI_READ_FIELD(fadt_table->reserved2, addr); ACPI_READ_FIELD(fadt_table->pm1a_evt_blk, addr); ACPI_READ_FIELD(fadt_table->pm1b_evt_blk, addr); ACPI_READ_FIELD(fadt_table->pm1a_cnt_blk, addr); ACPI_READ_FIELD(fadt_table->pm1b_cnt_blk, addr); ACPI_READ_FIELD(fadt_table->pm2_cnt_blk, addr); ACPI_READ_FIELD(fadt_table->pm_tmr_blk, addr); ACPI_READ_FIELD(fadt_table->gpe0_blk, addr); ACPI_READ_FIELD(fadt_table->gpe1_blk, addr); ACPI_READ_FIELD(fadt_table->pm1_evt_len, addr); ACPI_READ_FIELD(fadt_table->pm1_cnt_len, addr); ACPI_READ_FIELD(fadt_table->pm2_cnt_len, addr); ACPI_READ_FIELD(fadt_table->pm_tmr_len, addr); ACPI_READ_FIELD(fadt_table->gpe0_blk_len, addr); ACPI_READ_FIELD(fadt_table->gpe1_blk_len, addr); ACPI_READ_FIELD(fadt_table->gpe1_base, addr); ACPI_READ_FIELD(fadt_table->reserved3, addr); ACPI_READ_FIELD(fadt_table->plvl2_lat, addr); ACPI_READ_FIELD(fadt_table->plvl3_lat, addr); ACPI_READ_FIELD(fadt_table->flush_size, addr); ACPI_READ_FIELD(fadt_table->flush_stride, addr); ACPI_READ_FIELD(fadt_table->duty_offset, addr); ACPI_READ_FIELD(fadt_table->duty_width, addr); ACPI_READ_FIELD(fadt_table->day_alrm, addr); ACPI_READ_FIELD(fadt_table->mon_alrm, addr); ACPI_READ_FIELD(fadt_table->century, addr); ACPI_READ_FIELD(fadt_table->reserved4, addr); ACPI_READ_FIELD(fadt_table->reserved4a, addr); ACPI_READ_FIELD(fadt_table->reserved4b, addr); ACPI_READ_FIELD(fadt_table->flags, addr); ACPI_ASSERT_CMP(fadt_table->signature, "FACP"); g_assert(!acpi_calc_checksum((uint8_t *)fadt_table, fadt_table->length)); }
1threat