problem
stringlengths
26
131k
labels
class label
2 classes
Angular 2 add multiple classes via [class.className] binding : <p>While adding a single class works great in this way - </p> <p><code>[class.loading-state]="loading"</code></p> <p>But how do I add multiple classes Ex if <code>loading</code> is <code>true</code> add class - <code>"loading-state" &amp; "my-class"</code> </p> <p>How do I get it done via the <code>[class] binding</code></p>
0debug
Need to dynamically generate UITableView items from JSON. What is the best approach? : <p>Lets say I have an array of JSON objects like this:</p> <pre><code>{ "views": [ { "type": "UILabel", "data": "Here is a headline", "id": "label1" }, { "type": "UIImage", "data": "http://doge2048.com/meta/doge-600.png", "id": "image1" }, { "type": "UIButton", "data": "Click me", "id": "button1" } ] } </code></pre> <p>This is how this item should look like for example. <a href="https://i.stack.imgur.com/XvTtT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XvTtT.png" alt="This is how this item should look like for example."></a></p> <ul> <li>Each table cell will have different JSON, so I can't design them in Storyboard.</li> <li>Dynamic views can even be UIStackViews, so I can't just create a main UIStackView and add these in it. (Because it lags very bad.)</li> <li>Data source and structure is not a problem. My question is how to construct the UI and constraints.</li> </ul>
0debug
static int encode_mode(CinepakEncContext *s, int h, AVPicture *scratch_pict, AVPicture *last_pict, strip_info *info, unsigned char *buf) { int x, y, z, flags, bits, temp_size, header_ofs, ret = 0, mb_count = s->w * h / MB_AREA; int needs_extra_bit, should_write_temp; unsigned char temp[64]; mb_info *mb; AVPicture sub_scratch, sub_last; if(info->v4_size || !s->skip_empty_cb) ret += encode_codebook(s, info->v4_codebook, info->v4_size, 0x20, 0x24, buf + ret); if(info->v1_size || !s->skip_empty_cb) ret += encode_codebook(s, info->v1_codebook, info->v1_size, 0x22, 0x26, buf + ret); for(z = y = 0; y < h; y += MB_SIZE) { for(x = 0; x < s->w; x += MB_SIZE, z++) { mb = &s->mb[z]; get_sub_picture(s, x, y, scratch_pict, &sub_scratch); if(info->mode == MODE_MC && mb->best_encoding == ENC_SKIP) { get_sub_picture(s, x, y, last_pict, &sub_last); copy_mb(s, &sub_scratch, &sub_last); } else if(info->mode == MODE_V1_ONLY || mb->best_encoding == ENC_V1) decode_v1_vector(s, &sub_scratch, mb->v1_vector, info); else decode_v4_vector(s, &sub_scratch, mb->v4_vector, info); } } switch(info->mode) { case MODE_V1_ONLY: ret += write_chunk_header(buf + ret, 0x32, mb_count); for(x = 0; x < mb_count; x++) buf[ret++] = s->mb[x].v1_vector; break; case MODE_V1_V4: header_ofs = ret; ret += CHUNK_HEADER_SIZE; for(x = 0; x < mb_count; x += 32) { flags = 0; for(y = x; y < FFMIN(x+32, mb_count); y++) if(s->mb[y].best_encoding == ENC_V4) flags |= 1 << (31 - y + x); AV_WB32(&buf[ret], flags); ret += 4; for(y = x; y < FFMIN(x+32, mb_count); y++) { mb = &s->mb[y]; if(mb->best_encoding == ENC_V1) buf[ret++] = mb->v1_vector; else for(z = 0; z < 4; z++) buf[ret++] = mb->v4_vector[z]; } } write_chunk_header(buf + header_ofs, 0x30, ret - header_ofs - CHUNK_HEADER_SIZE); break; case MODE_MC: header_ofs = ret; ret += CHUNK_HEADER_SIZE; flags = bits = temp_size = 0; for(x = 0; x < mb_count; x++) { mb = &s->mb[x]; flags |= (mb->best_encoding != ENC_SKIP) << (31 - bits++); needs_extra_bit = 0; should_write_temp = 0; if(mb->best_encoding != ENC_SKIP) { if(bits < 32) flags |= (mb->best_encoding == ENC_V4) << (31 - bits++); else needs_extra_bit = 1; } if(bits == 32) { AV_WB32(&buf[ret], flags); ret += 4; flags = bits = 0; if(mb->best_encoding == ENC_SKIP || needs_extra_bit) { memcpy(&buf[ret], temp, temp_size); ret += temp_size; temp_size = 0; } else should_write_temp = 1; } if(needs_extra_bit) { flags = (mb->best_encoding == ENC_V4) << 31; bits = 1; } if(mb->best_encoding == ENC_V1) temp[temp_size++] = mb->v1_vector; else if(mb->best_encoding == ENC_V4) for(z = 0; z < 4; z++) temp[temp_size++] = mb->v4_vector[z]; if(should_write_temp) { memcpy(&buf[ret], temp, temp_size); ret += temp_size; temp_size = 0; } } if(bits > 0) { AV_WB32(&buf[ret], flags); ret += 4; memcpy(&buf[ret], temp, temp_size); ret += temp_size; } write_chunk_header(buf + header_ofs, 0x31, ret - header_ofs - CHUNK_HEADER_SIZE); break; } return ret; }
1threat
static void test_visitor_in_any(TestInputVisitorData *data, const void *unused) { QObject *res = NULL; Error *err = NULL; Visitor *v; QInt *qint; QBool *qbool; QString *qstring; QDict *qdict; QObject *qobj; v = visitor_input_test_init(data, "-42"); visit_type_any(v, &res, NULL, &err); g_assert(!err); qint = qobject_to_qint(res); g_assert(qint); g_assert_cmpint(qint_get_int(qint), ==, -42); qobject_decref(res); v = visitor_input_test_init(data, "{ 'integer': -42, 'boolean': true, 'string': 'foo' }"); visit_type_any(v, &res, NULL, &err); g_assert(!err); qdict = qobject_to_qdict(res); g_assert(qdict && qdict_size(qdict) == 3); qobj = qdict_get(qdict, "integer"); g_assert(qobj); qint = qobject_to_qint(qobj); g_assert(qint); g_assert_cmpint(qint_get_int(qint), ==, -42); qobj = qdict_get(qdict, "boolean"); g_assert(qobj); qbool = qobject_to_qbool(qobj); g_assert(qbool); g_assert(qbool_get_bool(qbool) == true); qobj = qdict_get(qdict, "string"); g_assert(qobj); qstring = qobject_to_qstring(qobj); g_assert(qstring); g_assert_cmpstr(qstring_get_str(qstring), ==, "foo"); qobject_decref(res); }
1threat
I'm having trouble shoveling all my objects into an array in ruby : so I'm working on my first scraping project in Ruby and I'm having some trouble placing my scraped data into the empty array I created. I'm not sure where my code is incorrect. So far it's only pushing one of the schools_1 etc. to the schools array. Does anyone have any suggestions on how to fix this. Thanks for any help. class MMA::School attr_accessor :name, :location_info, :url def self.today self.schools end def self.schools schools = [] schools << self.scrape_cbs schools end def self.scrape_cbs doc = Nokogiri::HTML(open("http://newyork.cbslocal.com/top-lists/5-best-mma-and-martial-arts-studios-in-new-york/")) schools_1 = self.new schools_1.name = doc.search("//div/p/strong/span").text.strip schools_1.location_info = doc.search("//div/p")[4].text.strip schools_1.url = doc.search("//div/p/a")[0].text.strip schools_1 schools_2 = self.new schools_2.name = doc.search("//div/p/span")[0].text.strip schools_2.location_info = doc.search("//div/p")[7].text.strip schools_2.url = doc.search("//div/p/a")[2].text.strip schools_2 schools_3 = self.new schools_3.name = doc.search("//div/p/span")[1].text.strip schools_3.location_info = doc.search("//div/p")[9].text.strip schools_3.url = doc.search("//div/p/a")[3].text.strip schools_3 schools_4 = self.new schools_4.name = doc.search("//div/p/span")[2].text.strip schools_4.location_info = doc.search("//div/p")[12].text.strip schools_4.url = doc.search("//div/p/a")[5].text.strip schools_4 schools_5 = self.new schools_5.name = doc.search("//div/p/span")[3].text.strip schools_5.location_info = doc.search("//div/p")[14].text.strip schools_5.url = doc.search("//div/p/a")[6].text.strip schools_5 end end
0debug
static void decode_mb(MpegEncContext *s, int ref) { s->dest[0] = s->current_picture.f.data[0] + (s->mb_y * 16 * s->linesize) + s->mb_x * 16; s->dest[1] = s->current_picture.f.data[1] + (s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16 >> s->chroma_x_shift); s->dest[2] = s->current_picture.f.data[2] + (s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16 >> s->chroma_x_shift); ff_init_block_index(s); ff_update_block_index(s); s->dest[1] += (16 >> s->chroma_x_shift) - 8; s->dest[2] += (16 >> s->chroma_x_shift) - 8; if (CONFIG_H264_DECODER && s->codec_id == AV_CODEC_ID_H264) { H264Context *h = (void*)s; h->mb_xy = s->mb_x + s->mb_y * s->mb_stride; memset(h->non_zero_count_cache, 0, sizeof(h->non_zero_count_cache)); av_assert1(ref >= 0); if (ref >= h->ref_count[0]) ref = 0; if (!h->ref_list[0][ref].f.data[0]) { av_log(s->avctx, AV_LOG_DEBUG, "Reference not available for error concealing\n"); ref = 0; fill_rectangle(&s->current_picture.f.ref_index[0][4 * h->mb_xy], 2, 2, 2, ref, 1); fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1); fill_rectangle(h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(s->mv[0][0][0], s->mv[0][0][1]), 4); h->mb_mbaff = h->mb_field_decoding_flag = 0; ff_h264_hl_decode_mb(h); } else { assert(ref == 0); ff_MPV_decode_mb(s, s->block);
1threat
Angular 6 - Keep scroll position when the route changes : <p><strong>Previous Behavior:</strong></p> <p>Changing the route or navigation path would not affect the scroll position when navigating to another route. I.e the contents can change without the scroll position changing.</p> <p><strong>Current Behavior:</strong></p> <p>Changing the route will put you right back to the top of the page.</p> <p><strong>Action Done So Far:</strong></p> <p>Tested on current and a fresh new Angular 6 project</p> <p>Is this a bug? change in feature? or is there a parameter I am missing.</p>
0debug
Kafka optimal retention and deletion policy : <p>I am fairly new to kafka so forgive me if this question is trivial. I have a very simple setup for purposes of timing tests as follows:</p> <p>Machine A -> writes to topic 1 (Broker) -> Machine B reads from topic 1 Machine B -> writes message just read to topic 2 (Broker) -> Machine A reads from topic 2</p> <p>Now I am sending messages of roughly 1400 bytes in an infinite loop filling up the space on my small broker very quickly. I'm experimenting with setting different values for log.retention.ms, log.retention.bytes, log.segment.bytes and log.segment.delete.delay.ms. First I set all of the values to the minimum allowed, but it seemed this degraded performance, then I set them to the maximum my broker could take before being completely full, but again the performance degrades when a deletion occurs. Is there a best practice for setting these values to get the absolute minimum delay?</p> <p>Thanks for the help!</p>
0debug
int64_t cpu_get_ticks(void) { if (use_icount) { return cpu_get_icount(); } if (!timers_state.cpu_ticks_enabled) { return timers_state.cpu_ticks_offset; } else { int64_t ticks; ticks = cpu_get_real_ticks(); if (timers_state.cpu_ticks_prev > ticks) { timers_state.cpu_ticks_offset += timers_state.cpu_ticks_prev - ticks; } timers_state.cpu_ticks_prev = ticks; return ticks + timers_state.cpu_ticks_offset; } }
1threat
static void av_noinline filter_mb_edgech( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) { const unsigned int index_a = 52 + qp + h->slice_alpha_c0_offset; const int alpha = alpha_table[index_a]; const int beta = (beta_table+52)[qp + h->slice_beta_offset]; if (alpha ==0 || beta == 0) return; if( bS[0] < 4 ) { int8_t tc[4]; tc[0] = tc0_table[index_a][bS[0]]+1; tc[1] = tc0_table[index_a][bS[1]]+1; tc[2] = tc0_table[index_a][bS[2]]+1; tc[3] = tc0_table[index_a][bS[3]]+1; h->s.dsp.h264_v_loop_filter_chroma(pix, stride, alpha, beta, tc); } else { h->s.dsp.h264_v_loop_filter_chroma_intra(pix, stride, alpha, beta); } }
1threat
'React' must be in scope when using JSX error in routes.js file : <p>ESlint is showing me the above-mentioned error when writing a <code>routes.js</code> file.</p> <pre><code>module.exports = { 'env': { 'browser': true, 'es6': true }, 'extends': ['plugin:react/recommended', 'standard'], 'globals': { 'Atomics': 'readonly', 'SharedArrayBuffer': 'readonly' }, 'parser': 'babel-eslint', 'parserOptions': { 'ecmaFeatures': { 'jsx': true }, 'ecmaVersion': 2018, 'sourceType': 'module' }, 'plugins': [ 'react' ], 'rules': { } } </code></pre> <p>My <code>routes.js</code></p> <pre><code>import { Switch, Route } from 'react-router-dom' import Feed from './pages/Feed' import Post from './pages/Post' function Routes () { return ( &lt;Switch&gt; // -&gt; red line &lt;Route path="/" component={Feed} /&gt; // -&gt; red line &lt;Route path="/post" component={Post} /&gt; // -&gt; red line &lt;/Switch&gt; ) } export default Routes </code></pre> <p>Cannot find a clear solution for such issue.</p>
0debug
M = 100 def maxAverageOfPath(cost, N): dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + cost[i][j] return dp[N - 1][N - 1] / (2 * N - 1)
0debug
static inline int coupling_strategy(AC3DecodeContext *s, int blk, uint8_t *bit_alloc_stages) { GetBitContext *bc = &s->gbc; int fbw_channels = s->fbw_channels; int channel_mode = s->channel_mode; int ch; memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS); if (!s->eac3) s->cpl_in_use[blk] = get_bits1(bc); if (s->cpl_in_use[blk]) { int cpl_start_subband, cpl_end_subband; if (channel_mode < AC3_CHMODE_STEREO) { av_log(s->avctx, AV_LOG_ERROR, "coupling not allowed in mono or dual-mono\n"); return AVERROR_INVALIDDATA; } if (s->eac3 && get_bits1(bc)) { avpriv_request_sample(s->avctx, "Enhanced coupling"); return AVERROR_PATCHWELCOME; } if (s->eac3 && s->channel_mode == AC3_CHMODE_STEREO) { s->channel_in_cpl[1] = 1; s->channel_in_cpl[2] = 1; } else { for (ch = 1; ch <= fbw_channels; ch++) s->channel_in_cpl[ch] = get_bits1(bc); } if (channel_mode == AC3_CHMODE_STEREO) s->phase_flags_in_use = get_bits1(bc); cpl_start_subband = get_bits(bc, 4); cpl_end_subband = s->spx_in_use ? (s->spx_src_start_freq - 37) / 12 : get_bits(bc, 4) + 3; if (cpl_start_subband >= cpl_end_subband) { av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d >= %d)\n", cpl_start_subband, cpl_end_subband); return AVERROR_INVALIDDATA; } s->start_freq[CPL_CH] = cpl_start_subband * 12 + 37; s->end_freq[CPL_CH] = cpl_end_subband * 12 + 37; decode_band_structure(bc, blk, s->eac3, 0, cpl_start_subband, cpl_end_subband, ff_eac3_default_cpl_band_struct, &s->num_cpl_bands, s->cpl_band_sizes); } else { for (ch = 1; ch <= fbw_channels; ch++) { s->channel_in_cpl[ch] = 0; s->first_cpl_coords[ch] = 1; } s->first_cpl_leak = s->eac3; s->phase_flags_in_use = 0; } return 0; }
1threat
def rectangle_perimeter(l,b): perimeter=2*(l+b) return perimeter
0debug
HTTP Google Sheets API v4 how to access without OAuth 2.0? : <p>my idea is to create a google sheet, make it public and then access it from my work computer linux/bash to read/write values on a daily basis. </p> <p>i have a public google doc sheet that anyone can find/edit. this is the sheet ID: <code>1F6jh6756xNDlDYIvZm_3TrXb59EFEFHGEC7jdWz-Nx0</code> </p> <p>doing it by the book <a href="https://developers.google.com/sheets/api/samples/reading" rel="noreferrer">https://developers.google.com/sheets/api/samples/reading</a> </p> <p><code>curl 'https://sheets.googleapis.com/v4/spreadsheets/1F6jh6756xNDlDYIvZm_3TrXb59EFEFHGEC7jdWz-Nx0/values/Sheet1!A1:A3'</code></p> <p>returns: </p> <pre><code>{ "error": { "code": 403, "message": "The request is missing a valid API key.", "status": "PERMISSION_DENIED" } } </code></pre> <p>i've read a lot and especialy here <a href="https://stackoverflow.com/questions/44750946/google-sheet-api-v4">Google Sheet API v4</a> i've found a complicated solution. that is if you want to access your public sheet in a short 1 hour period. </p> <p>you browse to <a href="https://developers.google.com/oauthplayground/" rel="noreferrer">https://developers.google.com/oauthplayground/</a> get authorization for the v4 api, then get "Authorization code", then get "Refresh token", and finally "Access token". </p> <p>using this "Access token" you can access the public sheet like this<br> <code>curl 'https://sheets.googleapis.com/v4/spreadsheets/1F6jh6756xNDlDYIvZm_3TrXb59EFEFHGEC7jdWz-Nx0/values/Sheet1!A1:A3' -H "Authorization: Bearer ya29.GlvaBLjrTdsSuSllr3u2nAiC-BOsjvIOE1x5afU3xiafB-FTOdLWDtfabuIMGF1rId5BsZxiTXxrx7VDEtxww4Q1uvW9zRndkfm3I2LZnT1HK2nTWzX_6oXu-NAG"</code> </p> <p>returns: </p> <pre><code>{ "range": "Sheet1!A1:A3", "majorDimension": "ROWS", "values": [ [ "a1" ], [ "a2" ], [ "a3" ] ] } </code></pre> <p>perfect. in theory the "Access token" expires after an hour, the "Refresh token" never expires. so you would save the tokens, try to read the sheet with the "Access token", if it fails use the "Refresh token" to gain a new "Access token" and carry on.</p> <p>but, i've had a dozen of "Refresh token"s that were redeemed/expired, "Authorization code"s expired, all in all nothing works after a few hours. why?</p> <p>how can i access my google sheet form bash with curl without this kind of authorization? especially since my sheet is public and can be edited by anyone with a browser.</p> <p>is there another way to do this with some other permanent authorization? why not use email and pass?</p> <p>"API key" is mentioned but never explained. can some one please explain this method step by step?</p>
0debug
Auto Versioning in Visual Studio 2017 (.NET Core) : <p>I have spent the better part of a few hours trying to find a way to auto-increment versions in a .NETCoreApp 1.1 (Visual Studio 2017).</p> <p>I know the the AssemblyInfo.cs is being created dynamically in the folder: <code>obj/Debug/netcoreapp1.1/</code></p> <p>It does not accept the old method of: <code>[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.*")]</code></p> <p>If I set the project to package I can set versions there but this seems to be used to build the AssemblyInfo.cs file.</p> <p>My question is, has anyone figured out how to control version in .NET Core (or .NETStandard for that matter) projects.</p>
0debug
Dynamically generate html files to display image and video : <p>I am uploading some images and videos to upload folder and then I display those to my webpage using array. that takes extra load on browser. so I want when I upload any image/video to upload folder it should create dynamic html or php file to display for each image/video. Can anyone tell me how to do?</p>
0debug
Google Maps crashing on Android Pie : <p>I am testing Google Map on Google Pixel running the latest version of Android Pie. </p> <pre><code>Caused by java.lang.ClassNotFoundException Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/0000000e/MapsDynamite.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/0000000e/MapsDynamite.apk!/lib/arm64-v8a, /system/lib64]] </code></pre>
0debug
Error in my python cipher : <p>I'm using the code</p> <pre><code>a = 1 b = 2 c = 3 d = 4 e = 5 f = 6 g = 7 h = 8 i = 9 j = 10 k = 11 l = 12 m = 13 n = 14 o = 15 p = 16 q = 17 r = 18 s = 19 t = 20 u = 21 v = 22 w = 23 x = 24 y = 25 z = 26 fullstring = raw_input('Cipher-thing:') if fullstring.isalpha and len(fullstring) &gt; 0: fullstring[0] = (fullstring[0] * pow(len(fullstring)) / len(fullstring) if len(fullstring) &gt;= 1: fullstring[1] = (fullstring[1]^len(fullstring))/len(fullstring) if len(fullstring) &gt;= 2: fullstring[2] = (fullstring[2]^len(fullstring))/len(fullstring) if len(fullstring) &gt;= 3: fullstring[3] = (fullstring[3]^len(fullstring))/len(fullstring) if len(fullstring) &gt;= 4: fullstring[4] = (fullstring[4]^len(fullstring))/(fullstring) if len(fullstring) &gt;= 5: fullstring[5] = (fullstring[5]^len(fullstring))/len(fullstring) if len(fullstring) &gt;= 6: fullstring[6] = (fullstring[6]^len(fullstring))/len(fullstring) if len(fullstring) &gt;= 7: fullstring[7] = (fullstring[7]^len(fullstring))/len(fullstring) if len(fullstring) &gt;= 8: fullstring[8] = (fullstring[8]^len(fullstring))/len(fullstring) if len(fullstring) &gt;= 9: print 'Error: string length overloaded cipher' else: fullstring = fullstring[1:len(fullstring)] print fullstring </code></pre> <p>and getting error:</p> <pre><code> File "python", line 30 if len(fullstring) &gt;= 1: ^ SyntaxError: invalid syntax </code></pre> <p>I'm not entirely sure whether it's a problem with line 29,(fullstring[0] = (fullstring[0] * pow(len(fullstring)) / len(fullstring)), or with line 30 itself. It used to run, but after I put in a word, it would crash, as one of my >='s were =>'s instead. However, this is no longer the case.</p> <p>If anyone has any suggestions for how to make this better, I would greatly appreciate it, myself being a bit of a python novice. </p> <p>Thanks in advance.</p>
0debug
how can execute other contextmenu in console with javascripte or other js : **i want to change this top in console log with other menucontext other there i tried but no solution any one have a solution please** check this image please ! https://i.imgur.com/bienKZ0.png <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header mh-clearfix"><?php the_title('<h1 class="entry-title">', '</h1>'); mh_post_header(); ?> <br>
0debug
av_cold int swr_init(struct SwrContext *s){ int ret; char l1[1024], l2[1024]; clear_context(s); if(s-> in_sample_fmt >= AV_SAMPLE_FMT_NB){ av_log(s, AV_LOG_ERROR, "Requested input sample format %d is invalid\n", s->in_sample_fmt); return AVERROR(EINVAL); } if(s->out_sample_fmt >= AV_SAMPLE_FMT_NB){ av_log(s, AV_LOG_ERROR, "Requested output sample format %d is invalid\n", s->out_sample_fmt); return AVERROR(EINVAL); } s->out.ch_count = s-> user_out_ch_count; s-> in.ch_count = s-> user_in_ch_count; s->used_ch_count = s->user_used_ch_count; s-> in_ch_layout = s-> user_in_ch_layout; s->out_ch_layout = s->user_out_ch_layout; if(av_get_channel_layout_nb_channels(s-> in_ch_layout) > SWR_CH_MAX) { av_log(s, AV_LOG_WARNING, "Input channel layout 0x%"PRIx64" is invalid or unsupported.\n", s-> in_ch_layout); s->in_ch_layout = 0; } if(av_get_channel_layout_nb_channels(s->out_ch_layout) > SWR_CH_MAX) { av_log(s, AV_LOG_WARNING, "Output channel layout 0x%"PRIx64" is invalid or unsupported.\n", s->out_ch_layout); s->out_ch_layout = 0; } switch(s->engine){ #if CONFIG_LIBSOXR case SWR_ENGINE_SOXR: s->resampler = &swri_soxr_resampler; break; #endif case SWR_ENGINE_SWR : s->resampler = &swri_resampler; break; default: av_log(s, AV_LOG_ERROR, "Requested resampling engine is unavailable\n"); return AVERROR(EINVAL); } if(!s->used_ch_count) s->used_ch_count= s->in.ch_count; if(s->used_ch_count && s-> in_ch_layout && s->used_ch_count != av_get_channel_layout_nb_channels(s-> in_ch_layout)){ av_log(s, AV_LOG_WARNING, "Input channel layout has a different number of channels than the number of used channels, ignoring layout\n"); s-> in_ch_layout= 0; } if(!s-> in_ch_layout) s-> in_ch_layout= av_get_default_channel_layout(s->used_ch_count); if(!s->out_ch_layout) s->out_ch_layout= av_get_default_channel_layout(s->out.ch_count); s->rematrix= s->out_ch_layout !=s->in_ch_layout || s->rematrix_volume!=1.0 || s->rematrix_custom; if(s->int_sample_fmt == AV_SAMPLE_FMT_NONE){ if(av_get_planar_sample_fmt(s->in_sample_fmt) <= AV_SAMPLE_FMT_S16P){ s->int_sample_fmt= AV_SAMPLE_FMT_S16P; }else if( av_get_planar_sample_fmt(s-> in_sample_fmt) == AV_SAMPLE_FMT_S32P && av_get_planar_sample_fmt(s->out_sample_fmt) == AV_SAMPLE_FMT_S32P && !s->rematrix && s->engine != SWR_ENGINE_SOXR){ s->int_sample_fmt= AV_SAMPLE_FMT_S32P; }else if(av_get_planar_sample_fmt(s->in_sample_fmt) <= AV_SAMPLE_FMT_FLTP){ s->int_sample_fmt= AV_SAMPLE_FMT_FLTP; }else{ av_log(s, AV_LOG_DEBUG, "Using double precision mode\n"); s->int_sample_fmt= AV_SAMPLE_FMT_DBLP; } } if( s->int_sample_fmt != AV_SAMPLE_FMT_S16P &&s->int_sample_fmt != AV_SAMPLE_FMT_S32P &&s->int_sample_fmt != AV_SAMPLE_FMT_FLTP &&s->int_sample_fmt != AV_SAMPLE_FMT_DBLP){ av_log(s, AV_LOG_ERROR, "Requested sample format %s is not supported internally, S16/S32/FLT/DBL is supported\n", av_get_sample_fmt_name(s->int_sample_fmt)); return AVERROR(EINVAL); } set_audiodata_fmt(&s-> in, s-> in_sample_fmt); set_audiodata_fmt(&s->out, s->out_sample_fmt); if (s->firstpts_in_samples != AV_NOPTS_VALUE) { if (!s->async && s->min_compensation >= FLT_MAX/2) s->async = 1; s->firstpts = s->outpts = s->firstpts_in_samples * s->out_sample_rate; } else s->firstpts = AV_NOPTS_VALUE; if (s->async) { if (s->min_compensation >= FLT_MAX/2) s->min_compensation = 0.001; if (s->async > 1.0001) { s->max_soft_compensation = s->async / (double) s->in_sample_rate; } } if (s->out_sample_rate!=s->in_sample_rate || (s->flags & SWR_FLAG_RESAMPLE)){ s->resample = s->resampler->init(s->resample, s->out_sample_rate, s->in_sample_rate, s->filter_size, s->phase_shift, s->linear_interp, s->cutoff, s->int_sample_fmt, s->filter_type, s->kaiser_beta, s->precision, s->cheby); if (!s->resample) { av_log(s, AV_LOG_ERROR, "Failed to initilaize resampler\n"); return AVERROR(ENOMEM); } }else s->resampler->free(&s->resample); if( s->int_sample_fmt != AV_SAMPLE_FMT_S16P && s->int_sample_fmt != AV_SAMPLE_FMT_S32P && s->int_sample_fmt != AV_SAMPLE_FMT_FLTP && s->int_sample_fmt != AV_SAMPLE_FMT_DBLP && s->resample){ av_log(s, AV_LOG_ERROR, "Resampling only supported with internal s16/s32/flt/dbl\n"); return -1; } #define RSC 1 if(!s-> in.ch_count) s-> in.ch_count= av_get_channel_layout_nb_channels(s-> in_ch_layout); if(!s->used_ch_count) s->used_ch_count= s->in.ch_count; if(!s->out.ch_count) s->out.ch_count= av_get_channel_layout_nb_channels(s->out_ch_layout); if(!s-> in.ch_count){ av_assert0(!s->in_ch_layout); av_log(s, AV_LOG_ERROR, "Input channel count and layout are unset\n"); return -1; } av_get_channel_layout_string(l1, sizeof(l1), s-> in.ch_count, s-> in_ch_layout); av_get_channel_layout_string(l2, sizeof(l2), s->out.ch_count, s->out_ch_layout); if (s->out_ch_layout && s->out.ch_count != av_get_channel_layout_nb_channels(s->out_ch_layout)) { av_log(s, AV_LOG_ERROR, "Output channel layout %s mismatches specified channel count %d\n", l2, s->out.ch_count); return AVERROR(EINVAL); } if (s->in_ch_layout && s->used_ch_count != av_get_channel_layout_nb_channels(s->in_ch_layout)) { av_log(s, AV_LOG_ERROR, "Input channel layout %s mismatches specified channel count %d\n", l1, s->used_ch_count); return AVERROR(EINVAL); } if ((!s->out_ch_layout || !s->in_ch_layout) && s->used_ch_count != s->out.ch_count && !s->rematrix_custom) { av_log(s, AV_LOG_ERROR, "Rematrix is needed between %s and %s " "but there is not enough information to do it\n", l1, l2); return -1; } av_assert0(s->used_ch_count); av_assert0(s->out.ch_count); s->resample_first= RSC*s->out.ch_count/s->in.ch_count - RSC < s->out_sample_rate/(float)s-> in_sample_rate - 1.0; s->in_buffer= s->in; s->silence = s->in; s->drop_temp= s->out; if(!s->resample && !s->rematrix && !s->channel_map && !s->dither.method){ s->full_convert = swri_audio_convert_alloc(s->out_sample_fmt, s-> in_sample_fmt, s-> in.ch_count, NULL, 0); return 0; } s->in_convert = swri_audio_convert_alloc(s->int_sample_fmt, s-> in_sample_fmt, s->used_ch_count, s->channel_map, 0); s->out_convert= swri_audio_convert_alloc(s->out_sample_fmt, s->int_sample_fmt, s->out.ch_count, NULL, 0); if (!s->in_convert || !s->out_convert) return AVERROR(ENOMEM); s->postin= s->in; s->preout= s->out; s->midbuf= s->in; if(s->channel_map){ s->postin.ch_count= s->midbuf.ch_count= s->used_ch_count; if(s->resample) s->in_buffer.ch_count= s->used_ch_count; } if(!s->resample_first){ s->midbuf.ch_count= s->out.ch_count; if(s->resample) s->in_buffer.ch_count = s->out.ch_count; } set_audiodata_fmt(&s->postin, s->int_sample_fmt); set_audiodata_fmt(&s->midbuf, s->int_sample_fmt); set_audiodata_fmt(&s->preout, s->int_sample_fmt); if(s->resample){ set_audiodata_fmt(&s->in_buffer, s->int_sample_fmt); } if ((ret = swri_dither_init(s, s->out_sample_fmt, s->int_sample_fmt)) < 0) return ret; if(s->rematrix || s->dither.method) return swri_rematrix_init(s); return 0; }
1threat
C++ Random Number Generator With the Random Header : I have probably been through 20 different sites looking for a solution. I have been trying to make a random number generator (as the title says) but whenever I try something with an integer, it will return the same number. Here is some code that apparently works. (uses the <random> header and everything else) default_random_engine e; cout << e<< endl; but when i try it, I will only get the number 1. I have tried this with the mac terminal, clion, and Visual Studio. I really don't know what to do.
0debug
Cannot resolve method findViewById for progress-bar : Cannot resolve method findViewById for progress-bar i want show a progress-bar for my webview, and it should stop once the loading is finished ,here is my code , but when i call progressbar it showing **Cannot resolve method findViewById** package com.fb.jaisonjoseph.facebookbasic; import android.content.Context; import android.graphics.Bitmap; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.ViewGroup; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ProgressBar; /** * A simple {@link Fragment} subclass. */ public class Home_Fragment extends Fragment { public WebView mwebView; public Home_Fragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment View rootView = inflater.inflate(R.layout.fragment_home_, null); WebView view=(WebView) rootView.findViewById(R.id.webView); view.loadUrl("https://mbasic.facebook.com"); view.getSettings().setJavaScriptEnabled(true); view.setWebViewClient(new MyWebViewClient()); return rootView; } private class MyWebViewClient extends WebViewClient { ProgressBar bar=(ProgressBar)findViewById(R.id.progressBar); @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { return false; } @Override public void onPageStarted(final WebView view, final String url, final Bitmap favicon) { bar.setVisibility(View.VISIBLE); super.onPageStarted(view, url, favicon); } @Override public void onPageFinished(WebView view, String url) { bar.setVisibility(View.GONE); super.onPageFinished(view, url); } } }
0debug
static int64_t mmsh_read_seek(URLContext *h, int stream_index, int64_t timestamp, int flags) { MMSHContext *mmsh = h->priv_data; MMSContext *mms = &mmsh->mms; int ret; ret= mmsh_open_internal(h, mmsh->location, 0, timestamp, 0); if(ret>=0){ if (mms->mms_hd) ffurl_close(mms->mms_hd); av_freep(&mms->streams); av_freep(&mms->asf_header); av_free(mmsh); mmsh = h->priv_data; mms = &mmsh->mms; mms->asf_header_read_size= mms->asf_header_size; }else h->priv_data= mmsh; return ret; }
1threat
static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s, void *data, uint32_t length, uint64_t offset) { int ret = 0; void *buffer = NULL; void *merged_sector = NULL; void *data_tmp, *sector_write; unsigned int i; int sector_offset; uint32_t desc_sectors, sectors, total_length; uint32_t sectors_written = 0; uint32_t aligned_length; uint32_t leading_length = 0; uint32_t trailing_length = 0; uint32_t partial_sectors = 0; uint32_t bytes_written = 0; uint64_t file_offset; VHDXHeader *header; VHDXLogEntryHeader new_hdr; VHDXLogDescriptor *new_desc = NULL; VHDXLogDataSector *data_sector = NULL; MSGUID new_guid = { 0 }; header = s->headers[s->curr_header]; if (length > header->log_length) { ret = -EINVAL; goto exit; } if (guid_eq(header->log_guid, zero_guid)) { vhdx_guid_generate(&new_guid); vhdx_update_headers(bs, s, false, &new_guid); } else { ret = -ENOTSUP; goto exit; } if (s->log.sequence == 0) { s->log.sequence = 1; } sector_offset = offset % VHDX_LOG_SECTOR_SIZE; file_offset = (offset / VHDX_LOG_SECTOR_SIZE) * VHDX_LOG_SECTOR_SIZE; aligned_length = length; if (sector_offset) { leading_length = (VHDX_LOG_SECTOR_SIZE - sector_offset); leading_length = leading_length > length ? length : leading_length; aligned_length -= leading_length; partial_sectors++; } sectors = aligned_length / VHDX_LOG_SECTOR_SIZE; trailing_length = aligned_length - (sectors * VHDX_LOG_SECTOR_SIZE); if (trailing_length) { partial_sectors++; } sectors += partial_sectors; new_hdr = (VHDXLogEntryHeader) { .signature = VHDX_LOG_SIGNATURE, .tail = s->log.tail, .sequence_number = s->log.sequence, .descriptor_count = sectors, .reserved = 0, .flushed_file_offset = bdrv_getlength(bs->file), .last_file_offset = bdrv_getlength(bs->file), }; new_hdr.log_guid = header->log_guid; desc_sectors = vhdx_compute_desc_sectors(new_hdr.descriptor_count); total_length = (desc_sectors + sectors) * VHDX_LOG_SECTOR_SIZE; new_hdr.entry_length = total_length; vhdx_log_entry_hdr_le_export(&new_hdr); buffer = qemu_blockalign(bs, total_length); memcpy(buffer, &new_hdr, sizeof(new_hdr)); new_desc = (VHDXLogDescriptor *) (buffer + sizeof(new_hdr)); data_sector = buffer + (desc_sectors * VHDX_LOG_SECTOR_SIZE); data_tmp = data; merged_sector = qemu_blockalign(bs, VHDX_LOG_SECTOR_SIZE); for (i = 0; i < sectors; i++) { new_desc->signature = VHDX_LOG_DESC_SIGNATURE; new_desc->sequence_number = s->log.sequence; new_desc->file_offset = file_offset; if (i == 0 && leading_length) { ret = bdrv_pread(bs->file, file_offset, merged_sector, VHDX_LOG_SECTOR_SIZE); if (ret < 0) { goto exit; } memcpy(merged_sector + sector_offset, data_tmp, leading_length); bytes_written = leading_length; sector_write = merged_sector; } else if (i == sectors - 1 && trailing_length) { ret = bdrv_pread(bs->file, file_offset, merged_sector + trailing_length, VHDX_LOG_SECTOR_SIZE - trailing_length); if (ret < 0) { goto exit; } memcpy(merged_sector, data_tmp, trailing_length); bytes_written = trailing_length; sector_write = merged_sector; } else { bytes_written = VHDX_LOG_SECTOR_SIZE; sector_write = data_tmp; } vhdx_log_raw_to_le_sector(new_desc, data_sector, sector_write, s->log.sequence); data_tmp += bytes_written; data_sector++; new_desc++; file_offset += VHDX_LOG_SECTOR_SIZE; } vhdx_update_checksum(buffer, total_length, offsetof(VHDXLogEntryHeader, checksum)); cpu_to_le32s((uint32_t *)(buffer + 4)); vhdx_log_write_sectors(bs, &s->log, &sectors_written, buffer, desc_sectors + sectors); if (ret < 0) { goto exit; } if (sectors_written != desc_sectors + sectors) { ret = -EINVAL; goto exit; } s->log.sequence++; s->log.tail = s->log.write; exit: qemu_vfree(buffer); qemu_vfree(merged_sector); return ret; }
1threat
vim: difference between :n and :bn : <p>If I started vim with multiple files like so <code>vim *.java</code>, I can cycle through opened files using either <code>:n</code> or <code>:bn</code> (and other related commands). </p> <p>But if I start with only one file and load other files using <code>:split</code> (and later close the split window), I can cycle the buffers using <code>:bn</code> but not <code>:n</code>. </p> <p>What is the difference between these two situations? If I do :buffers in both cases, there is no difference whatsoever in the buffer list. It might seem like I am asking unnecessary question but I would like to understand if there is any gotchas lurking under the hood. Thanks. </p>
0debug
void mpeg1_init_vlc(MpegEncContext *s) { static int done = 0; if (!done) { init_vlc(&dc_lum_vlc, 9, 12, vlc_dc_lum_bits, 1, 1, vlc_dc_lum_code, 2, 2); init_vlc(&dc_chroma_vlc, 9, 12, vlc_dc_chroma_bits, 1, 1, vlc_dc_chroma_code, 2, 2); init_vlc(&mv_vlc, 9, 17, &mbMotionVectorTable[0][1], 2, 1, &mbMotionVectorTable[0][0], 2, 1); init_vlc(&mbincr_vlc, 9, 35, &mbAddrIncrTable[0][1], 2, 1, &mbAddrIncrTable[0][0], 2, 1); init_vlc(&mb_pat_vlc, 9, 63, &mbPatTable[0][1], 2, 1, &mbPatTable[0][0], 2, 1); init_vlc(&mb_ptype_vlc, 6, 32, &table_mb_ptype[0][1], 2, 1, &table_mb_ptype[0][0], 2, 1); init_vlc(&mb_btype_vlc, 6, 32, &table_mb_btype[0][1], 2, 1, &table_mb_btype[0][0], 2, 1); init_rl(&rl_mpeg1); init_rl(&rl_mpeg2); init_vlc(&rl_mpeg1.vlc, 9, rl_mpeg1.n + 2, &rl_mpeg1.table_vlc[0][1], 4, 2, &rl_mpeg1.table_vlc[0][0], 4, 2); init_vlc(&rl_mpeg2.vlc, 9, rl_mpeg2.n + 2, &rl_mpeg2.table_vlc[0][1], 4, 2, &rl_mpeg2.table_vlc[0][0], 4, 2); } }
1threat
static void qemu_net_queue_append_iov(NetQueue *queue, NetClientState *sender, unsigned flags, const struct iovec *iov, int iovcnt, NetPacketSent *sent_cb) { NetPacket *packet; size_t max_len = 0; int i; if (queue->nq_count >= queue->nq_maxlen && !sent_cb) { return; } for (i = 0; i < iovcnt; i++) { max_len += iov[i].iov_len; } packet = g_malloc(sizeof(NetPacket) + max_len); packet->sender = sender; packet->sent_cb = sent_cb; packet->flags = flags; packet->size = 0; for (i = 0; i < iovcnt; i++) { size_t len = iov[i].iov_len; memcpy(packet->data + packet->size, iov[i].iov_base, len); packet->size += len; } QTAILQ_INSERT_TAIL(&queue->packets, packet, entry); }
1threat
In computer vision, what does MVS do that SFM can't? : <p>I'm a dev with about a decade of enterprise software engineering under his belt, and my hobbyist interests have steered me into the vast and scary realm of computer vision (CV).</p> <p>One thing that is not immediately clear to me is the division of labor between <strong>Structure from Motion (SFM)</strong> tools and <strong>Multi View Stereo (MVS)</strong> tools.</p> <p>Specifically, <a href="http://www.di.ens.fr/cmvs/" rel="noreferrer">CMVS</a> appears to be the best-in-show MVS tool, and <a href="http://www.cs.cornell.edu/~snavely/bundler/" rel="noreferrer">Bundler</a> seems to be one of the better open source SFM tools out there.</p> <p>Taken from CMVS's own homepage:</p> <blockquote> <p>You should ALWAYS use CMVS after Bundler and before PMVS2</p> </blockquote> <p>I'm wondering: <strong>why?!?</strong> My <em>understanding</em> of SFM tools is that they perform the 3D reconstruction for you, so why do we need MVS tools in the first place? What value/processing/features do they add that SFM tools like Bundler can't address? Why the proposed pipeline of:</p> <pre><code>Bundler -&gt; CMVS -&gt; PMVS2 </code></pre> <p>?</p>
0debug
static int udp_read(URLContext *h, uint8_t *buf, int size) { UDPContext *s = h->priv_data; int ret; int avail; #if HAVE_PTHREADS if (s->fifo) { pthread_mutex_lock(&s->mutex); do { avail = av_fifo_size(s->fifo); if (avail) { uint8_t tmp[4]; pthread_mutex_unlock(&s->mutex); av_fifo_generic_read(s->fifo, tmp, 4, NULL); avail= AV_RL32(tmp); if(avail > size){ av_log(h, AV_LOG_WARNING, "Part of datagram lost due to insufficient buffer size\n"); avail= size; } av_fifo_generic_read(s->fifo, buf, avail, NULL); av_fifo_drain(s->fifo, AV_RL32(tmp) - avail); return avail; } else if(s->circular_buffer_error){ pthread_mutex_unlock(&s->mutex); return s->circular_buffer_error; } else if(h->flags & AVIO_FLAG_NONBLOCK) { pthread_mutex_unlock(&s->mutex); return AVERROR(EAGAIN); } else { pthread_cond_wait(&s->cond, &s->mutex); } } while( 1); } #endif if (!(h->flags & AVIO_FLAG_NONBLOCK)) { ret = ff_network_wait_fd(s->udp_fd, 0); if (ret < 0) return ret; } ret = recv(s->udp_fd, buf, size, 0); return ret < 0 ? ff_neterrno() : ret; }
1threat
How to adapt my data to a recycler view in kotlin : <p>I wrote a wrapper for a website that has a method get_page(pag: Int, cat: Int), and ot returns a list of maps and each map has keys like "name" "price" and "id". How do I adapt this data to a recycler view ?</p>
0debug
C# - Removing new lines in pipe-separated file : I have some files in CSV format, delimited with pipe. I need every row of the file to be in one single line, but I have some files like this: |0001|Some text|Some longer text that \n has new lines on it|1234 So, this means that the first row is now in two lines. I'm talking about 5000 rows files that now have around 12000 lines. I need to replace the `\n` in some columns of the file for just a space. How can I do this in Microsoft C#?
0debug
static inline void downmix_2f_1r_to_dolby(float *samples) { int i; for (i = 0; i < 256; i++) { samples[i] -= samples[i + 512]; samples[i + 256] += samples[i + 512]; samples[i + 512] = 0; } }
1threat
elasticsearch data lost when running nodejs script : <p>i have an elasticsearch running on my localmachine (only there, no other shards/replicas), and it took me awhile but i got to a state where i had all my data (~9 million documents) on it. then, i wrote a small nodejs script that went throw all the documents in the index and if a certain field had a hyphen '-' in it i changed it to be a space instead, and add the document to a list of documents i wanted to update. and then i've sended there docs to update using bulk update notice, from the 9 million record, most of them whould not have had this condition met and would not have tried to update.</p> <p>after this script ren a few hours, i was amazed to find only 146 docs are left in my index,when i run:<a href="http://localhost:9200/_cat/indices?v" rel="nofollow noreferrer">http://localhost:9200/_cat/indices?v</a> i get:</p> <p>health status index pri rep docs.count docs.deleted store.size pri.store.size yellow open persons 5 1 146 137 202.4kb 202.4kb yellow open please_read 5 1 1 0 4.9kb 4.9kb </p> <p>and i can see the size of the elasticseach data folder is too small to have the original data hiding there somhow..</p> <p>needless to say i have no snapshot to restore from..</p> <p>i'll add the script i ran+the es logs, and i'll be very very happy if anyone can find a way to restore the data, or at the least tell me what happend..</p> <p><a href="https://drive.google.com/drive/folders/0B9CrlDDC98YQSXQyaFhLb0VWY0U?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/drive/folders/0B9CrlDDC98YQSXQyaFhLb0VWY0U?usp=sharing</a></p>
0debug
LinkedIn in-app browser forcing video to fullscreen on iPhone : <p>We are using LinkedIn to share a link to an HTML5 interactive video. When the link is shared, by default it opens in LinkedIn's browser inside the app. The problem is that when the user starts playing the video, the browser automatically switches to fullscreen, hiding our custom controls. iOS allows inline video playback nowadays with <em>playsinline</em> attribute on the video element, but LinkedIn browser doesn't support the attribute. On iPad the video does play inline though and does not switch to fullscreen. We have tested this bug on iOS versions 10 and 11. On native Safari browser or Google Chrome there's no problem, the video plays inline as intended. The video plays inline in other apps, for example Facebook Messenger's in-app browser. The only problem we have had is with the LinkedIn browser.</p> <p>Is there any way to play a video inline on iPhone when using the in-app browser without going fullscreen? Or, is there any url scheme that could be used to launch Safari from the in-app browser? Currently the user experience is quite bad when the users have to manually exit fullscreen, which also pauses the video.</p>
0debug
static int ne2000_can_receive(void *opaque) { NE2000State *s = opaque; int avail, index, boundary; if (s->cmd & E8390_STOP) return 0; index = s->curpag << 8; boundary = s->boundary << 8; if (index < boundary) avail = boundary - index; else avail = (s->stop - s->start) - (index - boundary); if (avail < (MAX_ETH_FRAME_SIZE + 4)) return 0; return MAX_ETH_FRAME_SIZE; }
1threat
static int nbd_co_writev_1(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov, int offset) { BDRVNBDState *s = bs->opaque; struct nbd_request request; struct nbd_reply reply; request.type = NBD_CMD_WRITE; if (!bdrv_enable_write_cache(bs) && (s->nbdflags & NBD_FLAG_SEND_FUA)) { request.type |= NBD_CMD_FLAG_FUA; } request.from = sector_num * 512; request.len = nb_sectors * 512; nbd_coroutine_start(s, &request); if (nbd_co_send_request(s, &request, qiov->iov, offset) == -1) { reply.error = errno; } else { nbd_co_receive_reply(s, &request, &reply, NULL, 0); } nbd_coroutine_end(s, &request); return -reply.error; }
1threat
How to convert class objects to named tuples? I am learning named tuples any one help me in this : I really want to use namedtuples instead of class objects class objects class ZoneFileObject(object): def __init__( self, descriptor='', name='', filehandle='', ): self.descriptor = descriptor self.name = name self.filehandle = filehandle optimized namedtuple in single line
0debug
What's wrong in my code? (Array and Scanner)(Java) : import java.util.*; public class RandomAddArray { public static void main (String[] args){ AddArray ad = new AddArray(); int [] Ar = new int [4]; ad.AddArray(Ar); } } class AddArray{ public void AddArray(int a[] ){ for(int i=0; i<a.length; i++){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); a[i]=n+2; System.out.print(a[i]); } } } Hey everybody, I'm not a native english speaker so my english can be little bit strange to you. I have a problem in my java. I want If I type 4 numbers using scanner, the array should read all the numbers firstly and than add two to each numbers. I mean if I type number "1" 4 times, System.out.print should show me "3" four times. But my java shows so : [enter image description here][1] [1]: https://i.stack.imgur.com/pu0Ux.png Why?? What's wrong in my code?
0debug
How are files stored in memory and how can i use that knowledge in C++? : <p>How are files stored in memory? I suppose that when i write in a text file something like Hello World, the file in memory looks like this: <code>01001000 01100101 01101100 01101100 01101111</code> 1 Byte 1 Char?</p> <p>Well... I'm 90% sure I'm wrong about this and that's why I put this question.</p> <p>The actual thing is that I really want to know how Images are stored into memory because I want to use this to edit images or create ASCII art, and i feel like i could do this without a 3rd party library.</p> <p>The reason I didn't put my time into learning a library is that there are lots of them(I don't know which one to pick) and i don't know at what point I should looking into them... Well, this would be a different question</p>
0debug
delete column of whole table. using mysql : <p>I am a newbie in php and just learning about it. in between this my sir give me one task to delete column of the table. how can we delete only one column of table. for example my table have 3 fields. ID,NAME,STATUS. it have 500 of data. and i just have to delete status from whole table using mysql query. what can i do? </p>
0debug
Boostrap collapse not working : Attempting to use Boostrap collapse in a form and it is non-responsive. Copy & pasted directly from the Boostrap website but still does not work. Please help! <a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" data-target="firstname" aria-expanded="false" aria-controls="collapseExample"> Test </a> <form> <div class="form-row mb-1 collapse" id="firstname"> <div class="form-group col-md-6"> <input type="email" class="form-control" placeholder="Legal first name"> </div> </div> <div class="form-group col-md-6"> <input type="password" class="form-control" id="inputPassword4" placeholder="Legal last name"> </div> </div> </form>
0debug
static void acpi_get_pm_info(AcpiPmInfo *pm) { Object *piix = piix4_pm_find(); Object *lpc = ich9_lpc_find(); Object *obj = NULL; QObject *o; pm->pcihp_io_base = 0; pm->pcihp_io_len = 0; if (piix) { obj = piix; pm->cpu_hp_io_base = PIIX4_CPU_HOTPLUG_IO_BASE; pm->pcihp_io_base = object_property_get_int(obj, ACPI_PCIHP_IO_BASE_PROP, NULL); pm->pcihp_io_len = object_property_get_int(obj, ACPI_PCIHP_IO_LEN_PROP, NULL); } if (lpc) { obj = lpc; pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE; } assert(obj); pm->cpu_hp_io_len = ACPI_GPE_PROC_LEN; pm->mem_hp_io_base = ACPI_MEMORY_HOTPLUG_BASE; pm->mem_hp_io_len = ACPI_MEMORY_HOTPLUG_IO_LEN; o = object_property_get_qobject(obj, ACPI_PM_PROP_S3_DISABLED, NULL); if (o) { pm->s3_disabled = qint_get_int(qobject_to_qint(o)); } else { pm->s3_disabled = false; } qobject_decref(o); o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_DISABLED, NULL); if (o) { pm->s4_disabled = qint_get_int(qobject_to_qint(o)); } else { pm->s4_disabled = false; } qobject_decref(o); o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_VAL, NULL); if (o) { pm->s4_val = qint_get_int(qobject_to_qint(o)); } else { pm->s4_val = false; } qobject_decref(o); pm->sci_int = object_property_get_int(obj, ACPI_PM_PROP_SCI_INT, NULL); pm->acpi_enable_cmd = object_property_get_int(obj, ACPI_PM_PROP_ACPI_ENABLE_CMD, NULL); pm->acpi_disable_cmd = object_property_get_int(obj, ACPI_PM_PROP_ACPI_DISABLE_CMD, NULL); pm->io_base = object_property_get_int(obj, ACPI_PM_PROP_PM_IO_BASE, NULL); pm->gpe0_blk = object_property_get_int(obj, ACPI_PM_PROP_GPE0_BLK, NULL); pm->gpe0_blk_len = object_property_get_int(obj, ACPI_PM_PROP_GPE0_BLK_LEN, NULL); pm->pcihp_bridge_en = object_property_get_bool(obj, "acpi-pci-hotplug-with-bridge-support", NULL); }
1threat
how to get data from another web site : how to get an specific data from another web site, using curl with PHP. This is my code: $page = curl_init('http://lookup.cla.base8tech.com/'); $encoded =''; foreach($_GET as $name=>$value){ $encoded .= urlencode($name) .'=' .urlencode($value).'&'; } foreach ($_POST as $name=>$value){ $encoded .= urlencode($name) .'=' .urlencode($value).'&'; } preg_match('!\d+!', $encoded, $zip); print_r($zip); $encoded = substr($encoded, 0, strlen($encoded)-1 ); curl_setopt($page, CURLOPT_POSTFIELDS, $encoded); curl_setopt($page, CURLOPT_HEADER, 0); curl_setopt($page, CURLOPT_POST, 1 ); curl_exec($page); curl_close($page);
0debug
sort array of objects according to month name? : <p>I have a array of objects with months and i want to sort them in a specific order such as fiscal year format how do i do that?</p> <pre><code>(12) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] 0:{subscribedCustomers: 1, req_count: 1, revenue: 1532.82, getMonth: "April", totalComp: 1} 1:{subscribedCustomers: 0, req_count: 0, revenue: null, getMonth: "June", totalComp: 0} 2:{subscribedCustomers: 1, req_count: 1, revenue: 2948.82, getMonth: "May", totalComp: 1} 3:{getMonth: "July", totalComp: 0} 4:{getMonth: "August", totalComp: 0} 5:{getMonth: "September", totalComp: 0} 6:{getMonth: "October", totalComp: 0} 7:{getMonth: "November", totalComp: 0} 8:{getMonth: "December", totalComp: 0} 9:{getMonth: "January", totalComp: 0} 10:{getMonth: "February", totalComp: 0} 11:{getMonth: "March", totalComp: 0} </code></pre> <p>How do i sort it to months in the following format</p> <p>[ 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', 'January', 'February', 'March'];</p>
0debug
How does Pandas to_sql determine what dataframe column is placed into what database field? : <p>I'm currently using Pandas to_sql in order to place a large dataframe into an SQL database. I'm using sqlalchemy in order to connect with the database and part of that process is defining the columns of the database tables.</p> <p>My question is, when I'm running to_sql on a dataframe, how does it know what column from the dataframe goes into what field in the database? Is it looking at column names in the dataframe and looking for the same fields in the database? Is it the order that the variables are in?</p> <p>Here's some example code to facilitate discussion:</p> <pre><code>engine = create_engine('sqlite:///store_data.db') meta = MetaData() table_pop = Table('xrf_str_geo_ta4_1511', meta, Column('TDLINX',Integer, nullable=True, index=True), Column('GEO_ID',Integer, nullable=True), Column('PERCINCL', Numeric, nullable=True) ) meta.create_all(engine) for df in pd.read_csv(file, chunksize=50000, iterator=True, encoding='utf-8', sep=',') df.to_sql('table_name', engine, flavor='sqlite', if_exists='append', index=index) </code></pre> <p>The dataframe in question has 3 columns TDLINX, GEO_ID, and PERCINCL</p>
0debug
Remove the web apps using google apps script : Suppose i have list of web apps in Google admin console. I want to remove the webapps from the list.I know i can remove my webapp from admin console one by one. But i want to remove(or revoke) the web apps using google apps script. Can we do it? if yes,can you please post the code. Thanks.
0debug
int xen_be_init(void) { xenstore = xs_daemon_open(); if (!xenstore) { xen_be_printf(NULL, 0, "can't connect to xenstored\n"); return -1; } if (qemu_set_fd_handler(xs_fileno(xenstore), xenstore_update, NULL, NULL) < 0) { goto err; } xen_xc = xc_interface_open(); if (xen_xc == -1) { xen_be_printf(NULL, 0, "can't open xen interface\n"); goto err; } return 0; err: qemu_set_fd_handler(xs_fileno(xenstore), NULL, NULL, NULL); xs_daemon_close(xenstore); xenstore = NULL; return -1; }
1threat
play video extention files on server : hey i would like for files with .3gp or mp4 to play in the browser when you type the url path insted of giving you the download option i want somthing like this http://www.html5videoplayer.net/videos/toystory.mp4 this is what i currently have http://www.reelychat.com/img/1/profileVid/SampleVideo.3gp also i am using godaddy web server
0debug
static bool elf_check_ehdr(struct elfhdr *ehdr) { return (elf_check_arch(ehdr->e_machine) && ehdr->e_ehsize == sizeof(struct elfhdr) && ehdr->e_phentsize == sizeof(struct elf_phdr) && ehdr->e_shentsize == sizeof(struct elf_shdr) && (ehdr->e_type == ET_EXEC || ehdr->e_type == ET_DYN)); }
1threat
How to change the flex order when wrapping : <p>I would like to achieve something that renders like this depending on the screen size:</p> <pre><code>+---------------------------+ | A | B | C | +---------------------------+ +---------------+ | A | C | | B | +---------------+ </code></pre> <p>if all size are fixed, i can manage using the flex <code>order</code> property but the size of my C container is not fixed and so I can't use a static media query.</p> <p>Is there a way to achieve this?</p> <p>Edit: I managed a good enough approximation: In a media query selecting all screens that <em>might</em> need wrapping, I change the <code>order</code> of the B container to something big, and at the same time, I set its <code>min-width</code> to 100% which forces the wrap.</p>
0debug
Change default 'delimiters' in excel : <p>I am using Excel for Mac 2016 on macOS Sierra software. Although I have been successfully copying and pasting CSV files into excel for some time now, recently, they have begun to behave in an odd way. When I paste the data, the content of each row seems to split over many columns. Where as before one cell would have been able to contain many words, it seems now as though each cell is only able to contain one word, so it splits the content of what would normally be in one cell, over many cells, making some rows of data spread out over up to 100 columns! </p> <p>I have tried Data tab>> From text>> which takes me through a Text Wizard. There I choose Delimited>> Choose Delimiters: Untick the 'Space' box ('Tab' box is still ticked)>> Column data as 'General'>> Finish. Following this process appears to import the data into its correct columns. It works. BUT, a lot of work to get there!</p> <p>Question: Is there any way to change the default settings of Delimiters, so that the 'Space' delimiter does not automatically divide the data?</p>
0debug
Python: How to append a file in python using inputs? : <p>I am fairly new to python, and have been trying to create a program where I create a file from user inputs. However, I cannot seem to get it to work, and keep getting the error:</p> <pre><code>Traceback (most recent call last): File "my_program.py", line 7, in &lt;module&gt; my_file.append(x) AttributeError: '_io.TextIOWrapper' object has no attribute 'append' </code></pre> <p>I think this means that I cannot append the file, but I am not sure at all why. Here is the relevant part of my program:</p> <pre><code>my_file = "my_file" with open(my_file, 'a') as my_file: lines = True counting_variable = 0 while lines: x = input() my_file.append(x) </code></pre> <p>Thank you very much for any help in advance!</p>
0debug
Is it possible for a hacker to find the value of a session variable on my server ? : <p>Is it possible for someone (hacker), to somehow get a hold of the value of a session variable that is active.</p>
0debug
static unsigned int dec_bound_m(DisasContext *dc) { TCGv l[2]; int memsize = memsize_zz(dc); int insn_len; DIS(fprintf (logfile, "bound.%d [$r%u%s, $r%u\n", memsize_char(memsize), dc->op1, dc->postinc ? "+]" : "]", dc->op2)); l[0] = tcg_temp_local_new(TCG_TYPE_TL); l[1] = tcg_temp_local_new(TCG_TYPE_TL); insn_len = dec_prep_alu_m(dc, 0, memsize, l[0], l[1]); cris_cc_mask(dc, CC_MASK_NZ); cris_alu(dc, CC_OP_BOUND, cpu_R[dc->op2], l[0], l[1], 4); do_postinc(dc, memsize); tcg_temp_free(l[0]); tcg_temp_free(l[1]); return insn_len; }
1threat
How do I grant Git 'ForcePush' permissions for pushing bfg-repo-cleaner results to VSTS? : <p>A person in my company who's an admin on the company's VSTS project created a repo for me, and granted me all permissions on the <code>master</code> branch.</p> <p>Now I need to run <a href="https://rtyley.github.io/bfg-repo-cleaner/" rel="noreferrer">BFG Repro-Cleaner</a> on my repo. It worked great locally, but when I tried to <code>git push</code> my mirrored clone, I got:</p> <pre><code>! [remote rejected] user/&lt;someone_else&gt;/&lt;branch&gt; -&gt; user/&lt;someone_else&gt;/&lt;branch&gt; (TF401027: You need the Git 'ForcePush' permission to perform this action. Details: identity &lt;my identity&gt;, scope 'branch'.) ! [remote rejected] refs/pull/&lt;number&gt;/merge -&gt; refs/pull/&lt;number&gt;/merge (TF401027: You need the Git 'ForcePush' permission to perform this action. Details: identity &lt;my identity&gt;, scope 'branch'.) error: failed to push some refs to 'https://&lt;repo&gt;' </code></pre> <p>What permissions should I ask my admin to grant me so I can complete this? How would she do that from VSTS web UI?</p>
0debug
New to AWS S3, confusion on file storage : Lets say I want to make a server in Node.js that allows users to upload files and it stores them in AWS S3. I have something like this given by default: https://s3.amazonaws.com/aws-website-test-psjjm/about.html But this means anyone can view it and access it. How does AWS S3 work in this case? If I want uploading possible but also security? Thanks!
0debug
I HAVE CREATED A PL/SQL FUNCTION , WHEN I AM USING TEO CONDITION UNDER WHEN WITH AND , IT IS NOT GETTING COMPLIED : I HAVE CREATED A PL/SQL FUNCTION , HERE I AM USING CASE STATEMENT IN WHICH I AM USING A SQL QUERY AS AN EXPRESSION. THIS IS WORKING FINE BUT , WHEN I AM USING AND UNDER WHEN CONDITION IT IS NOT GETTING COMPLIED . EVEN IF I SAY WHEN .... AND 2 > 1 , THIS IS ALSO NOT GETTING COMPILED . IN THE BELOW CODE , COMMENTED PART IS NOT WORKING PROPERLY . WHAT I WANT IS TO ADD ONE MORE CHECK IN MY WHEN CLAUSE . PLS ADVISE create or replace function FUNCTION_NAME (date1 in varchar2,value1 in varchar2) RETURN date IS date2 date ; BEGIN SELECT D DATE2 INTO DATE2 FROM( SELECT CASE (SELECT TO_DATE(MAX(G.DATE3),'DD-MON-YYYY') FROM TABLE1 G , TABLE2 N WHERE G.DATE3=N.DATE3) WHEN LAST_DAY(TO_DATE(DATE1,'DD-MON-YYYY')) /* AND MONTHS_BETWEEN (LAST_DAY(TO_DATE(SYSDATE)), LAST_DAY(TO_DATE(TO_CHAR(DATE1),'DD-MON-YYYY'))) */ THEN LAST_DAY(TO_DATE(DATE1,'DD-MON-YYYY')) ELSE TO_DATE('31-DEC-99','DD-MON-YYYY') END D FROM DUAL ); RETURN DATE2 ; END ;
0debug
static float quantize_and_encode_band_cost(struct AACEncContext *s, PutBitContext *pb, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits) { const float IQ = ff_aac_pow2sf_tab[200 + scale_idx - SCALE_ONE_POS + SCALE_DIV_512]; const float Q = ff_aac_pow2sf_tab[200 - scale_idx + SCALE_ONE_POS - SCALE_DIV_512]; const float CLIPPED_ESCAPE = 165140.0f*IQ; int i, j, k; float cost = 0; const int dim = cb < FIRST_PAIR_BT ? 4 : 2; int resbits = 0; #ifndef USE_REALLY_FULL_SEARCH const float Q34 = sqrtf(Q * sqrtf(Q)); const int range = aac_cb_range[cb]; const int maxval = aac_cb_maxval[cb]; int offs[4]; #endif if (!cb) { for (i = 0; i < size; i++) cost += in[i]*in[i]; if (bits) *bits = 0; return cost * lambda; } #ifndef USE_REALLY_FULL_SEARCH offs[0] = 1; for (i = 1; i < dim; i++) offs[i] = offs[i-1]*range; if (!scaled) { abs_pow34_v(s->scoefs, in, size); scaled = s->scoefs; } quantize_bands(s->qcoefs, in, scaled, size, Q34, !IS_CODEBOOK_UNSIGNED(cb), maxval); #endif for (i = 0; i < size; i += dim) { float mincost; int minidx = 0; int minbits = 0; const float *vec; #ifndef USE_REALLY_FULL_SEARCH int (*quants)[2] = &s->qcoefs[i]; mincost = 0.0f; for (j = 0; j < dim; j++) mincost += in[i+j]*in[i+j]; minidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40; minbits = ff_aac_spectral_bits[cb-1][minidx]; mincost = mincost * lambda + minbits; for (j = 0; j < (1<<dim); j++) { float rd = 0.0f; int curbits; int curidx = IS_CODEBOOK_UNSIGNED(cb) ? 0 : 40; int same = 0; for (k = 0; k < dim; k++) { if ((j & (1 << k)) && quants[k][0] == quants[k][1]) { same = 1; break; } } if (same) continue; for (k = 0; k < dim; k++) curidx += quants[k][!!(j & (1 << k))] * offs[dim - 1 - k]; curbits = ff_aac_spectral_bits[cb-1][curidx]; vec = &ff_aac_codebook_vectors[cb-1][curidx*dim]; #else mincost = INFINITY; vec = ff_aac_codebook_vectors[cb-1]; for (j = 0; j < ff_aac_spectral_sizes[cb-1]; j++, vec += dim) { float rd = 0.0f; int curbits = ff_aac_spectral_bits[cb-1][j]; int curidx = j; #endif if (IS_CODEBOOK_UNSIGNED(cb)) { for (k = 0; k < dim; k++) { float t = fabsf(in[i+k]); float di; if (vec[k] == 64.0f) { if (t < 39.0f*IQ) { rd = INFINITY; break; } if (t >= CLIPPED_ESCAPE) { di = t - CLIPPED_ESCAPE; curbits += 21; } else { int c = av_clip(quant(t, Q), 0, 8191); di = t - c*cbrtf(c)*IQ; curbits += av_log2(c)*2 - 4 + 1; } } else { di = t - vec[k]*IQ; } if (vec[k] != 0.0f) curbits++; rd += di*di; } } else { for (k = 0; k < dim; k++) { float di = in[i+k] - vec[k]*IQ; rd += di*di; } } rd = rd * lambda + curbits; if (rd < mincost) { mincost = rd; minidx = curidx; minbits = curbits; } } cost += mincost; resbits += minbits; if (cost >= uplim) return uplim; if (pb) { put_bits(pb, ff_aac_spectral_bits[cb-1][minidx], ff_aac_spectral_codes[cb-1][minidx]); if (IS_CODEBOOK_UNSIGNED(cb)) for (j = 0; j < dim; j++) if (ff_aac_codebook_vectors[cb-1][minidx*dim+j] != 0.0f) put_bits(pb, 1, in[i+j] < 0.0f); if (cb == ESC_BT) { for (j = 0; j < 2; j++) { if (ff_aac_codebook_vectors[cb-1][minidx*2+j] == 64.0f) { int coef = av_clip(quant(fabsf(in[i+j]), Q), 0, 8191); int len = av_log2(coef); put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2); put_bits(pb, len, coef & ((1 << len) - 1)); } } } } } if (bits) *bits = resbits; return cost; }
1threat
Create a list of dictionary under donditional : I got a json format data.I want to extract some useful data from it, so I need to use some loop to do it. here is my code: `data=json.loads(res.text)` `for item in data['leagues'][0]['events']:` `for xx in item['periods']:` `if 'moneyline' in xx.keys():` `md=xx['moneyline']` `print(md)` I got result like this: >{'away': 303.0, 'home': 116.0, 'draw': 223.0} >{'away': 1062.0, 'home': -369.0, 'draw': 577.0} >{'away': 337.0, 'home': 109.0, 'draw': 217.0} >{'away': 297.0, 'home': 110.0, 'draw': 244.0} >{'away': 731.0, 'home': -240.0, 'draw': 415.0} How can I combine this separate data into a Dictionary form? Thanks
0debug
All MySQL records from yesterday : <p>What is the most efficient way to get all records with a datetime field that falls somewhere between yesterday at <code>00:00:00</code> and yesterday at <code>23:59:59</code>?</p> <p>Table:</p> <pre><code>id created_at 1 2016-01-19 20:03:00 2 2016-01-19 11:12:05 3 2016-01-20 03:04:01 </code></pre> <p>Suppose yesterday was 2016-01-19, then in this case all I'd want to return is rows 1 and 2.</p>
0debug
long do_sigreturn(CPUAlphaState *env) { struct target_sigcontext *sc; abi_ulong sc_addr = env->ir[IR_A0]; target_sigset_t target_set; sigset_t set; if (!lock_user_struct(VERIFY_READ, sc, sc_addr, 1)) { goto badframe; } target_sigemptyset(&target_set); __get_user(target_set.sig[0], &sc->sc_mask); target_to_host_sigset_internal(&set, &target_set); do_sigprocmask(SIG_SETMASK, &set, NULL); restore_sigcontext(env, sc); unlock_user_struct(sc, sc_addr, 0); return env->ir[IR_V0]; badframe: force_sig(TARGET_SIGSEGV); }
1threat
void rgb32tobgr24(const uint8_t *src, uint8_t *dst, long src_size) { long i; long num_pixels = src_size >> 2; for(i=0; i<num_pixels; i++) { #ifdef WORDS_BIGENDIAN dst[3*i + 0] = src[4*i + 1]; dst[3*i + 1] = src[4*i + 2]; dst[3*i + 2] = src[4*i + 3]; #else dst[3*i + 0] = src[4*i + 2]; dst[3*i + 1] = src[4*i + 1]; dst[3*i + 2] = src[4*i + 0]; #endif } }
1threat
Add New Post potion wodpress did not work ad media : [enter image description here][1]i sent my screan short pleased help me [enter image description here][2] see my problem [1]: https://i.stack.imgur.com/MQYca.png [2]: https://i.stack.imgur.com/SF7rR.png
0debug
I have created two functions in php both the function returning an array I want to merge both the array and return a JSON : I have created two functions in PHP both the function returning an array I want to merge both the array and return a JSON. Thanks! Regards, Jitender
0debug
how to control NodeMCU without web but with GUI like Qt (through wifi) : I want to make a GUI which controls an LED over wifi (using Qt gui) the same way it is done using web servers but instead of a URL based controlling i want to control it using a Qt GUI. I have searched everywhere and could not find any answers, how can this be done?
0debug
static void gen_sse(DisasContext *s, int b, target_ulong pc_start, int rex_r) { int b1, op1_offset, op2_offset, is_xmm, val, ot; int modrm, mod, rm, reg, reg_addr, offset_addr; GenOpFunc2 *sse_op2; GenOpFunc3 *sse_op3; b &= 0xff; if (s->prefix & PREFIX_DATA) b1 = 1; else if (s->prefix & PREFIX_REPZ) b1 = 2; else if (s->prefix & PREFIX_REPNZ) b1 = 3; else b1 = 0; sse_op2 = sse_op_table1[b][b1]; if (!sse_op2) goto illegal_op; if ((b <= 0x5f && b >= 0x10) || b == 0xc6 || b == 0xc2) { is_xmm = 1; } else { if (b1 == 0) { is_xmm = 0; } else { is_xmm = 1; } } if (s->flags & HF_TS_MASK) { gen_exception(s, EXCP07_PREX, pc_start - s->cs_base); return; } if (s->flags & HF_EM_MASK) { illegal_op: gen_exception(s, EXCP06_ILLOP, pc_start - s->cs_base); return; } if (is_xmm && !(s->flags & HF_OSFXSR_MASK)) goto illegal_op; if (b == 0x77 || b == 0x0e) { gen_op_emms(); return; } if (!is_xmm) { gen_op_enter_mmx(); } modrm = ldub_code(s->pc++); reg = ((modrm >> 3) & 7); if (is_xmm) reg |= rex_r; mod = (modrm >> 6) & 3; if (sse_op2 == SSE_SPECIAL) { b |= (b1 << 8); switch(b) { case 0x0e7: if (mod == 3) goto illegal_op; gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_stq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,fpregs[reg].mmx)); break; case 0x1e7: case 0x02b: case 0x12b: case 0x3f0: if (mod == 3) goto illegal_op; gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_sto_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg])); break; case 0x6e: #ifdef TARGET_X86_64 if (s->dflag == 2) { gen_ldst_modrm(s, modrm, OT_QUAD, OR_TMP0, 0); gen_op_movq_mm_T0_mmx(offsetof(CPUX86State,fpregs[reg].mmx)); } else #endif { gen_ldst_modrm(s, modrm, OT_LONG, OR_TMP0, 0); gen_op_movl_mm_T0_mmx(offsetof(CPUX86State,fpregs[reg].mmx)); } break; case 0x16e: #ifdef TARGET_X86_64 if (s->dflag == 2) { gen_ldst_modrm(s, modrm, OT_QUAD, OR_TMP0, 0); gen_op_movq_mm_T0_xmm(offsetof(CPUX86State,xmm_regs[reg])); } else #endif { gen_ldst_modrm(s, modrm, OT_LONG, OR_TMP0, 0); gen_op_movl_mm_T0_xmm(offsetof(CPUX86State,xmm_regs[reg])); } break; case 0x6f: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_ldq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,fpregs[reg].mmx)); } else { rm = (modrm & 7); gen_op_movq(offsetof(CPUX86State,fpregs[reg].mmx), offsetof(CPUX86State,fpregs[rm].mmx)); } break; case 0x010: case 0x110: case 0x028: case 0x128: case 0x16f: case 0x26f: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_ldo_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg])); } else { rm = (modrm & 7) | REX_B(s); gen_op_movo(offsetof(CPUX86State,xmm_regs[reg]), offsetof(CPUX86State,xmm_regs[rm])); } break; case 0x210: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_op_ld_T0_A0(OT_LONG + s->mem_index); gen_op_movl_env_T0(offsetof(CPUX86State,xmm_regs[reg].XMM_L(0))); gen_op_movl_T0_0(); gen_op_movl_env_T0(offsetof(CPUX86State,xmm_regs[reg].XMM_L(1))); gen_op_movl_env_T0(offsetof(CPUX86State,xmm_regs[reg].XMM_L(2))); gen_op_movl_env_T0(offsetof(CPUX86State,xmm_regs[reg].XMM_L(3))); } else { rm = (modrm & 7) | REX_B(s); gen_op_movl(offsetof(CPUX86State,xmm_regs[reg].XMM_L(0)), offsetof(CPUX86State,xmm_regs[rm].XMM_L(0))); } break; case 0x310: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_ldq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0))); gen_op_movl_T0_0(); gen_op_movl_env_T0(offsetof(CPUX86State,xmm_regs[reg].XMM_L(2))); gen_op_movl_env_T0(offsetof(CPUX86State,xmm_regs[reg].XMM_L(3))); } else { rm = (modrm & 7) | REX_B(s); gen_op_movq(offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0)), offsetof(CPUX86State,xmm_regs[rm].XMM_Q(0))); } break; case 0x012: case 0x112: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_ldq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0))); } else { rm = (modrm & 7) | REX_B(s); gen_op_movq(offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0)), offsetof(CPUX86State,xmm_regs[rm].XMM_Q(1))); } break; case 0x212: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_ldo_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg])); } else { rm = (modrm & 7) | REX_B(s); gen_op_movl(offsetof(CPUX86State,xmm_regs[reg].XMM_L(0)), offsetof(CPUX86State,xmm_regs[rm].XMM_L(0))); gen_op_movl(offsetof(CPUX86State,xmm_regs[reg].XMM_L(2)), offsetof(CPUX86State,xmm_regs[rm].XMM_L(2))); } gen_op_movl(offsetof(CPUX86State,xmm_regs[reg].XMM_L(1)), offsetof(CPUX86State,xmm_regs[reg].XMM_L(0))); gen_op_movl(offsetof(CPUX86State,xmm_regs[reg].XMM_L(3)), offsetof(CPUX86State,xmm_regs[reg].XMM_L(2))); break; case 0x312: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_ldq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0))); } else { rm = (modrm & 7) | REX_B(s); gen_op_movq(offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0)), offsetof(CPUX86State,xmm_regs[rm].XMM_Q(0))); } gen_op_movq(offsetof(CPUX86State,xmm_regs[reg].XMM_Q(1)), offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0))); break; case 0x016: case 0x116: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_ldq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg].XMM_Q(1))); } else { rm = (modrm & 7) | REX_B(s); gen_op_movq(offsetof(CPUX86State,xmm_regs[reg].XMM_Q(1)), offsetof(CPUX86State,xmm_regs[rm].XMM_Q(0))); } break; case 0x216: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_ldo_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg])); } else { rm = (modrm & 7) | REX_B(s); gen_op_movl(offsetof(CPUX86State,xmm_regs[reg].XMM_L(1)), offsetof(CPUX86State,xmm_regs[rm].XMM_L(1))); gen_op_movl(offsetof(CPUX86State,xmm_regs[reg].XMM_L(3)), offsetof(CPUX86State,xmm_regs[rm].XMM_L(3))); } gen_op_movl(offsetof(CPUX86State,xmm_regs[reg].XMM_L(0)), offsetof(CPUX86State,xmm_regs[reg].XMM_L(1))); gen_op_movl(offsetof(CPUX86State,xmm_regs[reg].XMM_L(2)), offsetof(CPUX86State,xmm_regs[reg].XMM_L(3))); break; case 0x7e: #ifdef TARGET_X86_64 if (s->dflag == 2) { gen_op_movq_T0_mm_mmx(offsetof(CPUX86State,fpregs[reg].mmx)); gen_ldst_modrm(s, modrm, OT_QUAD, OR_TMP0, 1); } else #endif { gen_op_movl_T0_mm_mmx(offsetof(CPUX86State,fpregs[reg].mmx)); gen_ldst_modrm(s, modrm, OT_LONG, OR_TMP0, 1); } break; case 0x17e: #ifdef TARGET_X86_64 if (s->dflag == 2) { gen_op_movq_T0_mm_xmm(offsetof(CPUX86State,xmm_regs[reg])); gen_ldst_modrm(s, modrm, OT_QUAD, OR_TMP0, 1); } else #endif { gen_op_movl_T0_mm_xmm(offsetof(CPUX86State,xmm_regs[reg])); gen_ldst_modrm(s, modrm, OT_LONG, OR_TMP0, 1); } break; case 0x27e: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_ldq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0))); } else { rm = (modrm & 7) | REX_B(s); gen_op_movq(offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0)), offsetof(CPUX86State,xmm_regs[rm].XMM_Q(0))); } gen_op_movq_env_0(offsetof(CPUX86State,xmm_regs[reg].XMM_Q(1))); break; case 0x7f: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_stq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,fpregs[reg].mmx)); } else { rm = (modrm & 7); gen_op_movq(offsetof(CPUX86State,fpregs[rm].mmx), offsetof(CPUX86State,fpregs[reg].mmx)); } break; case 0x011: case 0x111: case 0x029: case 0x129: case 0x17f: case 0x27f: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_sto_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg])); } else { rm = (modrm & 7) | REX_B(s); gen_op_movo(offsetof(CPUX86State,xmm_regs[rm]), offsetof(CPUX86State,xmm_regs[reg])); } break; case 0x211: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_op_movl_T0_env(offsetof(CPUX86State,xmm_regs[reg].XMM_L(0))); gen_op_st_T0_A0(OT_LONG + s->mem_index); } else { rm = (modrm & 7) | REX_B(s); gen_op_movl(offsetof(CPUX86State,xmm_regs[rm].XMM_L(0)), offsetof(CPUX86State,xmm_regs[reg].XMM_L(0))); } break; case 0x311: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_stq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0))); } else { rm = (modrm & 7) | REX_B(s); gen_op_movq(offsetof(CPUX86State,xmm_regs[rm].XMM_Q(0)), offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0))); } break; case 0x013: case 0x113: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_stq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0))); } else { goto illegal_op; } break; case 0x017: case 0x117: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_stq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg].XMM_Q(1))); } else { goto illegal_op; } break; case 0x71: case 0x72: case 0x73: case 0x171: case 0x172: case 0x173: val = ldub_code(s->pc++); if (is_xmm) { gen_op_movl_T0_im(val); gen_op_movl_env_T0(offsetof(CPUX86State,xmm_t0.XMM_L(0))); gen_op_movl_T0_0(); gen_op_movl_env_T0(offsetof(CPUX86State,xmm_t0.XMM_L(1))); op1_offset = offsetof(CPUX86State,xmm_t0); } else { gen_op_movl_T0_im(val); gen_op_movl_env_T0(offsetof(CPUX86State,mmx_t0.MMX_L(0))); gen_op_movl_T0_0(); gen_op_movl_env_T0(offsetof(CPUX86State,mmx_t0.MMX_L(1))); op1_offset = offsetof(CPUX86State,mmx_t0); } sse_op2 = sse_op_table2[((b - 1) & 3) * 8 + (((modrm >> 3)) & 7)][b1]; if (!sse_op2) goto illegal_op; if (is_xmm) { rm = (modrm & 7) | REX_B(s); op2_offset = offsetof(CPUX86State,xmm_regs[rm]); } else { rm = (modrm & 7); op2_offset = offsetof(CPUX86State,fpregs[rm].mmx); } sse_op2(op2_offset, op1_offset); break; case 0x050: rm = (modrm & 7) | REX_B(s); gen_op_movmskps(offsetof(CPUX86State,xmm_regs[rm])); gen_op_mov_reg_T0(OT_LONG, reg); break; case 0x150: rm = (modrm & 7) | REX_B(s); gen_op_movmskpd(offsetof(CPUX86State,xmm_regs[rm])); gen_op_mov_reg_T0(OT_LONG, reg); break; case 0x02a: case 0x12a: gen_op_enter_mmx(); if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); op2_offset = offsetof(CPUX86State,mmx_t0); gen_ldq_env_A0[s->mem_index >> 2](op2_offset); } else { rm = (modrm & 7); op2_offset = offsetof(CPUX86State,fpregs[rm].mmx); } op1_offset = offsetof(CPUX86State,xmm_regs[reg]); switch(b >> 8) { case 0x0: gen_op_cvtpi2ps(op1_offset, op2_offset); break; default: case 0x1: gen_op_cvtpi2pd(op1_offset, op2_offset); break; } break; case 0x22a: case 0x32a: ot = (s->dflag == 2) ? OT_QUAD : OT_LONG; gen_ldst_modrm(s, modrm, ot, OR_TMP0, 0); op1_offset = offsetof(CPUX86State,xmm_regs[reg]); sse_op_table3[(s->dflag == 2) * 2 + ((b >> 8) - 2)](op1_offset); break; case 0x02c: case 0x12c: case 0x02d: case 0x12d: gen_op_enter_mmx(); if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); op2_offset = offsetof(CPUX86State,xmm_t0); gen_ldo_env_A0[s->mem_index >> 2](op2_offset); } else { rm = (modrm & 7) | REX_B(s); op2_offset = offsetof(CPUX86State,xmm_regs[rm]); } op1_offset = offsetof(CPUX86State,fpregs[reg & 7].mmx); switch(b) { case 0x02c: gen_op_cvttps2pi(op1_offset, op2_offset); break; case 0x12c: gen_op_cvttpd2pi(op1_offset, op2_offset); break; case 0x02d: gen_op_cvtps2pi(op1_offset, op2_offset); break; case 0x12d: gen_op_cvtpd2pi(op1_offset, op2_offset); break; } break; case 0x22c: case 0x32c: case 0x22d: case 0x32d: ot = (s->dflag == 2) ? OT_QUAD : OT_LONG; if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); if ((b >> 8) & 1) { gen_ldq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_t0.XMM_Q(0))); } else { gen_op_ld_T0_A0(OT_LONG + s->mem_index); gen_op_movl_env_T0(offsetof(CPUX86State,xmm_t0.XMM_L(0))); } op2_offset = offsetof(CPUX86State,xmm_t0); } else { rm = (modrm & 7) | REX_B(s); op2_offset = offsetof(CPUX86State,xmm_regs[rm]); } sse_op_table3[(s->dflag == 2) * 2 + ((b >> 8) - 2) + 4 + (b & 1) * 4](op2_offset); gen_op_mov_reg_T0(ot, reg); break; case 0xc4: case 0x1c4: s->rip_offset = 1; gen_ldst_modrm(s, modrm, OT_WORD, OR_TMP0, 0); val = ldub_code(s->pc++); if (b1) { val &= 7; gen_op_pinsrw_xmm(offsetof(CPUX86State,xmm_regs[reg]), val); } else { val &= 3; gen_op_pinsrw_mmx(offsetof(CPUX86State,fpregs[reg].mmx), val); } break; case 0xc5: case 0x1c5: if (mod != 3) goto illegal_op; val = ldub_code(s->pc++); if (b1) { val &= 7; rm = (modrm & 7) | REX_B(s); gen_op_pextrw_xmm(offsetof(CPUX86State,xmm_regs[rm]), val); } else { val &= 3; rm = (modrm & 7); gen_op_pextrw_mmx(offsetof(CPUX86State,fpregs[rm].mmx), val); } reg = ((modrm >> 3) & 7) | rex_r; gen_op_mov_reg_T0(OT_LONG, reg); break; case 0x1d6: if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); gen_stq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0))); } else { rm = (modrm & 7) | REX_B(s); gen_op_movq(offsetof(CPUX86State,xmm_regs[rm].XMM_Q(0)), offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0))); gen_op_movq_env_0(offsetof(CPUX86State,xmm_regs[rm].XMM_Q(1))); } break; case 0x2d6: gen_op_enter_mmx(); rm = (modrm & 7); gen_op_movq(offsetof(CPUX86State,xmm_regs[reg].XMM_Q(0)), offsetof(CPUX86State,fpregs[rm].mmx)); gen_op_movq_env_0(offsetof(CPUX86State,xmm_regs[reg].XMM_Q(1))); break; case 0x3d6: gen_op_enter_mmx(); rm = (modrm & 7) | REX_B(s); gen_op_movq(offsetof(CPUX86State,fpregs[reg & 7].mmx), offsetof(CPUX86State,xmm_regs[rm].XMM_Q(0))); break; case 0xd7: case 0x1d7: if (mod != 3) goto illegal_op; if (b1) { rm = (modrm & 7) | REX_B(s); gen_op_pmovmskb_xmm(offsetof(CPUX86State,xmm_regs[rm])); } else { rm = (modrm & 7); gen_op_pmovmskb_mmx(offsetof(CPUX86State,fpregs[rm].mmx)); } reg = ((modrm >> 3) & 7) | rex_r; gen_op_mov_reg_T0(OT_LONG, reg); break; default: goto illegal_op; } } else { switch(b) { case 0xf7: if (mod != 3) goto illegal_op; #ifdef TARGET_X86_64 if (s->aflag == 2) { gen_op_movq_A0_reg(R_EDI); } else #endif { gen_op_movl_A0_reg(R_EDI); if (s->aflag == 0) gen_op_andl_A0_ffff(); } gen_add_A0_ds_seg(s); break; case 0x70: case 0xc6: case 0xc2: s->rip_offset = 1; break; default: break; } if (is_xmm) { op1_offset = offsetof(CPUX86State,xmm_regs[reg]); if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); op2_offset = offsetof(CPUX86State,xmm_t0); if (b1 >= 2 && ((b >= 0x50 && b <= 0x5f && b != 0x5b) || b == 0xc2)) { if (b1 == 2) { gen_op_ld_T0_A0(OT_LONG + s->mem_index); gen_op_movl_env_T0(offsetof(CPUX86State,xmm_t0.XMM_L(0))); } else { gen_ldq_env_A0[s->mem_index >> 2](offsetof(CPUX86State,xmm_t0.XMM_D(0))); } } else { gen_ldo_env_A0[s->mem_index >> 2](op2_offset); } } else { rm = (modrm & 7) | REX_B(s); op2_offset = offsetof(CPUX86State,xmm_regs[rm]); } } else { op1_offset = offsetof(CPUX86State,fpregs[reg].mmx); if (mod != 3) { gen_lea_modrm(s, modrm, &reg_addr, &offset_addr); op2_offset = offsetof(CPUX86State,mmx_t0); gen_ldq_env_A0[s->mem_index >> 2](op2_offset); } else { rm = (modrm & 7); op2_offset = offsetof(CPUX86State,fpregs[rm].mmx); } } switch(b) { case 0x0f: val = ldub_code(s->pc++); sse_op2 = sse_op_table5[val]; if (!sse_op2) goto illegal_op; sse_op2(op1_offset, op2_offset); break; case 0x70: case 0xc6: val = ldub_code(s->pc++); sse_op3 = (GenOpFunc3 *)sse_op2; sse_op3(op1_offset, op2_offset, val); break; case 0xc2: val = ldub_code(s->pc++); if (val >= 8) goto illegal_op; sse_op2 = sse_op_table4[val][b1]; sse_op2(op1_offset, op2_offset); break; default: sse_op2(op1_offset, op2_offset); break; } if (b == 0x2e || b == 0x2f) { s->cc_op = CC_OP_EFLAGS; } } }
1threat
static void q35_host_get_pci_hole64_start(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { PCIHostState *h = PCI_HOST_BRIDGE(obj); Range w64; pci_bus_get_w64_range(h->bus, &w64); visit_type_uint64(v, name, &w64.begin, errp); }
1threat
PHP Updatable Variable : <p>I am working on a site that has a variable for the current year. This variable is used throughout the website. The variable needs to be manually updated every year in the middle of the summer. I want to allow the admin to update that variable but it seems wasteful to create an entire table for one value.</p> <p>The site is written in php and so I was wondering, is there anyway to update a variable with PHP through a form or something like that?</p>
0debug
float32 HELPER(ucf64_si2sf)(float32 x, CPUUniCore32State *env) { return int32_to_float32(ucf64_stoi(x), &env->ucf64.fp_status); }
1threat
static void gen_window_check2(DisasContext *dc, unsigned r1, unsigned r2) { gen_window_check1(dc, r1 > r2 ? r1 : r2); }
1threat
void helper_discard_movcal_backup(CPUSH4State *env) { memory_content *current = env->movcal_backup; while(current) { memory_content *next = current->next; free (current); env->movcal_backup = current = next; if (current == NULL) env->movcal_backup_tail = &(env->movcal_backup); } }
1threat
void bdrv_reset_dirty_bitmap(BdrvDirtyBitmap *bitmap, int64_t cur_sector, int64_t nr_sectors) { assert(bdrv_dirty_bitmap_enabled(bitmap)); hbitmap_reset(bitmap->bitmap, cur_sector, nr_sectors); }
1threat
How to set two adapters to one RecyclerView? : <p>I am developing an android app in which I'm storing two different types of information on 'FirebaseDatabase`.</p> <p>Then in the <code>MainActivity</code>, I'm retrieving them and showing to users in a <code>RecyclerView</code>. Both information are meant to be shown in different layouts, i.e., the layouts for both of them are different and that's why I have two make two different Model class and now have 2 different adapters. I'm using <a href="https://github.com/mikepenz/FastAdapter" rel="noreferrer">FastAdapter</a> by @MikePenz</p> <p>So, what I did is I set the adapter on recyclerview in the same sequence as the information is fetched from database:</p> <p>1.</p> <pre><code>public void prepareDataOfSRequests() { gModelClass = new GModelClass(postedBy, ***, ***, ***, "error", ***, formattedTime, currentLatitude, currentLongitude, utcFormatDateTime, userEmail, userID, null, ***, itemID); fastItemAdapter.add(0, gModelClass); recyclerView.setAdapter(fastItemAdapter); recyclerView.smoothScrollToPosition(0); emptyRVtext.setVisibility(View.INVISIBLE); } </code></pre> <p>2.</p> <pre><code>public void prepareDataOfERequests() { eModelClass = new EModelClass(***, ***, ***, ***, "error", ***, formattedTimeE, currentLatitudeE, currentLongitudeE, utcFormatDateTimeE, userEmailE, userIDE, null, ***, ***, ***, ***, itemID); fastItemAdapterER.add(eventRequestsModelClass); recyclerView.setAdapter(fastItemAdapterER); recyclerView.smoothScrollToPosition(0); emptyRVtext.setVisibility(View.INVISIBLE); } </code></pre> <p>as the recyclerview is only one and I'm setting 2 different adapters one by one, the recyclerview is getting updated with the 2nd adapter and showing only it's content.</p> <p>So, how can I show or set both the adapter to the same 'RecyclerView' and can show the content stored in both the adapters.</p>
0debug
Gradle error : Could not find com.android.tools.build:gradle:2.2.3 : <p>I'm trying to build my android project using gradle and circleCI, but I've got this error :</p> <pre><code>* What went wrong: A problem occurred configuring root project '&lt;myproject&gt;'. &gt; Could not resolve all dependencies for configuration ':classpath'. &gt; Could not find com.android.tools.build:gradle:2.2.3. Searched in the following locations: file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar Required by: :&lt;myproject&gt;:unspecified </code></pre> <p>Can someone explain me why I've got this problem please?</p>
0debug
static int decode_init_mp3on4(AVCodecContext * avctx) { MP3On4DecodeContext *s = avctx->priv_data; MPEG4AudioConfig cfg; int i; if ((avctx->extradata_size < 2) || (avctx->extradata == NULL)) { av_log(avctx, AV_LOG_ERROR, "Codec extradata missing or too short.\n"); return -1; } avpriv_mpeg4audio_get_config(&cfg, avctx->extradata, avctx->extradata_size); if (!cfg.chan_config || cfg.chan_config > 7) { av_log(avctx, AV_LOG_ERROR, "Invalid channel config number.\n"); return -1; } s->frames = mp3Frames[cfg.chan_config]; s->coff = chan_offset[cfg.chan_config]; avctx->channels = ff_mpeg4audio_channels[cfg.chan_config]; avctx->channel_layout = chan_layout[cfg.chan_config]; if (cfg.sample_rate < 16000) s->syncword = 0xffe00000; else s->syncword = 0xfff00000; s->mp3decctx[0] = av_mallocz(sizeof(MPADecodeContext)); avctx->priv_data = s->mp3decctx[0]; decode_init(avctx); avctx->priv_data = s; s->mp3decctx[0]->adu_mode = 1; for (i = 1; i < s->frames; i++) { s->mp3decctx[i] = av_mallocz(sizeof(MPADecodeContext)); if (!s->mp3decctx[i]) s->mp3decctx[i]->adu_mode = 1; s->mp3decctx[i]->avctx = avctx; s->mp3decctx[i]->mpadsp = s->mp3decctx[0]->mpadsp; } if (s->frames > 1) { s->decoded_buf = av_malloc(MPA_FRAME_SIZE * MPA_MAX_CHANNELS * sizeof(*s->decoded_buf)); if (!s->decoded_buf) } return 0; alloc_fail: decode_close_mp3on4(avctx); return AVERROR(ENOMEM); }
1threat
Angular 2: check if shift key is down when an element is clicked : <p>In an Angular 2 app, i want the click event to trigger something different when <em>the shift key is being held down</em>. how to achieve this?</p> <p>html is below:</p> <pre><code>&lt;div class="item" *ngFor="#obj of available" (click)="toggleSelected(obj)"&gt;&lt;/div&gt; </code></pre> <p>and i want to do something like this:</p> <pre><code> toggleSelected(obj) { if(shift is pressed) { do this } else { do that } } </code></pre> <p>so how can i detect if shift key is pressed? thanks!</p>
0debug
Import only type information from module : <p>Let's say I have two files, A.js and B.js. Both need references to each other like this.</p> <p><em>A.js</em></p> <pre><code>import { B } from "b" export class A { constructor(public name: string) {} } let b = new B(); b.print(new A("This is a random name")); </code></pre> <p><em>B.js</em></p> <pre><code>import { A } from "a" export class B { print(a: A) { console.log(a.name); } } </code></pre> <p>The example above will create a circular reference which currently does not work in the JavaScript runtime I'm using. The file <em>B.js</em> really only need the type information, not the actual export object). I want the type from <em>A.js</em> to get static type checking. Is this possible?</p>
0debug
static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata) { AVFormatContext *is = ifile->ctx; AVFormatContext *os = ofile->ctx; AVChapter **tmp; int i; tmp = av_realloc(os->chapters, sizeof(*os->chapters) * (is->nb_chapters + os->nb_chapters)); if (!tmp) return AVERROR(ENOMEM); os->chapters = tmp; for (i = 0; i < is->nb_chapters; i++) { AVChapter *in_ch = is->chapters[i], *out_ch; int64_t ts_off = av_rescale_q(ofile->start_time - ifile->ts_offset, AV_TIME_BASE_Q, in_ch->time_base); int64_t rt = (ofile->recording_time == INT64_MAX) ? INT64_MAX : av_rescale_q(ofile->recording_time, AV_TIME_BASE_Q, in_ch->time_base); if (in_ch->end < ts_off) continue; if (rt != INT64_MAX && in_ch->start > rt + ts_off) break; out_ch = av_mallocz(sizeof(AVChapter)); if (!out_ch) return AVERROR(ENOMEM); out_ch->id = in_ch->id; out_ch->time_base = in_ch->time_base; out_ch->start = FFMAX(0, in_ch->start - ts_off); out_ch->end = FFMIN(rt, in_ch->end - ts_off); if (copy_metadata) av_dict_copy(&out_ch->metadata, in_ch->metadata, 0); os->chapters[os->nb_chapters++] = out_ch; } return 0; }
1threat
Deleting from the start of a line to a colon regex(notepad++) : <p>I am trying to delete from the start of a line to the first colon. The dark gray area designates the area I am trying to get rid of. </p> <p><a href="https://i.stack.imgur.com/wkFDF.png" rel="nofollow noreferrer">.txt file list</a></p>
0debug
Codeigniter framework : stdClass Object ( [enq_id] => 10008 [enq_userid] => 3 [enq_catid] => 43 [enq_attachid] => 8 [enq_name] => werwer [enq_desc] => werwerwerewr [enq_end_date] => 22/08/2016 [enq_budget] => 1212 [enq_quantity] => 1212 [enq_city] => Alpy [enq_feedback_rate] => 0 [enq_activity_id] => {"165":"Restaurants and coffee shops","215":"studio - proffesional license"} [enq_imgid] => 0 [enq_date_added] => 2016-08-08 22:47:19 [enq_date_modified] => 2016-08-08 22:47:26 [enq_status] => 1 [enq_url] => werwer-10008 [enq_unique_id] => 0 [subenquries] => Array ( [0] => stdClass Object ( [subenq_id] => 33 [enq_id] => 10008 [subenq_name] => wqeqweqwqwe [subenq_desc] => qweqweqweqweq [subenq_cat_id] => 44 [subenq_budget] => 12312 [subenq_quantity] => 1234 [subenq_date_added] => 2016-08-08 22:47:19 [subenq_date_modified] => 2016-08-08 22:47:26 [subenq_status] => 1 ) ) ) this is my result. i want to list it with looping can any one help me with this??
0debug
PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name) { PCIDevice *dev = pci_create(bus, devfn, name); qdev_init(&dev->qdev); return dev; }
1threat
How to persist a list of strings with Entity Framework Core? : <p>Let us suppose that we have one class which looks like the following:</p> <pre><code>public class Entity { public IList&lt;string&gt; SomeListOfValues { get; set; } // Other code } </code></pre> <p>Now, suppose we want to persist this using EF Core Code First and that we are using a RDMBS like SQL Server.</p> <p>One possible approach is obviously to create a wraper class <code>Wraper</code> which wraps the string:</p> <pre><code>public class Wraper { public int Id { get; set; } public string Value { get; set; } } </code></pre> <p>And to refactor the class so that it now depends on a list of <code>Wraper</code> objects. In that case EF would generate a table for <code>Entity</code>, a table for <code>Wraper</code> and stablish a "one-to-many" relation: for each entity there is a bunch of wrapers.</p> <p>Although this works, I don't quite like the approach because we are changing a very simple model because of persistence concerns. Indeed, thinking just about the domain model, and the code, without the persistence, the <code>Wraper</code> class is quite meaningless there.</p> <p>Is there any other way persist one entity with a list of strings to a RDBMS using EF Core Code First other than creating a wraper class? Of course, in the end the same thing must be done: another table must be created to hold the strings and a "one-to-many" relationship must be in place. I just want to do this with EF Core without needing to code the wraper class in the domain model.</p>
0debug
Find all possible increasing subsequences of a given length in scala : What is the efficient way to find all possible increasing subsequences of a given length in scala ? For eg: Suppose there is a sequence of numbers as follows: 7 6 9 11 16 10 12 The possible increasing subsequences of size 3 for the above sequence are : 7 9 11 7 9 16 7 9 10 7 9 12 7 11 16 7 11 12 7 10 12 6 9 11 6 9 16 etc… I would like to know which scala data structures would help in finding the subsequences quickly.
0debug
how to select element text with react+enzyme : <p>Just what it says. Some example code:</p> <pre><code>let wrapper = shallow(&lt;div&gt;&lt;button class='btn btn-primary'&gt;OK&lt;/button&gt;&lt;/div&gt;); const b = wrapper.find('.btn'); expect(b.text()).to.be.eql('OK'); // fails, </code></pre> <p>Also the <code>html</code> method returns the contents of the element but also the element itself plus all the attributes, e.g. it gives <code>&lt;button class='btn btn-primary'&gt;OK&lt;/button&gt;</code>. So I guess, worst case, I can call <code>html</code> and regex it, but...</p> <p>Is there a way to just get the contents of the element, so I can assert on it. </p>
0debug
How do I get past IndentationError with try and except in a for loop in Python? : given_items = ["one", "two", 3, 4, "five", ["six", "seven", "eight"]] for item in given_items: try: for element in item: except TypeError: pass else: print(element) prints: o n e t w o (Vertically) then line 6 (for element in item) crashes the program with a 'gives a IndentationError: expected an indented block' on reaching 3 in the list. The object of the program is catch items that cannot be iterated and print the rest. How do I get past this error? Thanks in advance.
0debug
void do_addmeo (void) { T1 = T0; T0 += xer_ca + (-1); if (likely(!((uint32_t)T1 & ((uint32_t)T1 ^ (uint32_t)T0) & (1UL << 31)))) { xer_ov = 0; } else { xer_ov = 1; xer_so = 1; } if (likely(T1 != 0)) xer_ca = 1; }
1threat
My program shows an error, It says that a semicolon missing : <pre><code>import java.util.*; public class Fact </code></pre> <blockquote> <p>program to find factorial numbers</p> </blockquote> <pre><code>{ Scanner sc=new Scanner(System.in); int n; Fact() </code></pre> <blockquote> <p>an empty constructor</p> </blockquote> <pre><code> { } void accept() { System.out.println("Enter the number"); n=sc.nextInt(); System.out.println(pact(n)); } **int pact(int n)** </code></pre> <blockquote> <p>here is where my program says that it is missing a semicolon</p> </blockquote> <pre><code> ( if(n==1) return 1; else return n*fact(n-1); } public static void main() { Fact obj=new Fact(); obj.accept(); } } </code></pre>
0debug
Why does runif() have less unique values than rnorm()? : <p>If you run code like: </p> <pre><code>length(unique(runif(10000000))) length(unique(rnorm(10000000))) </code></pre> <p>you'll see that only about 99.8% of runif values are unique, but 100% of rnorm values are. I thought this might be because of the constrained range, but upping the range to (0, 100000) for runif doesn't change the result. Continuous distributions should have probability of repeats =0, and I know in floating-point precision that's not the case, but I'm curious why we don't see fairly close to the same number of repeats between the two.</p>
0debug
Xcode : Compare buttons : I am new to iOS development and I was trying to make a basic tic tac toe app. I am not able to find a way to compare the value of three buttons(the one's in a row or column etc). I managed to create 9 buttons and I am replacing the image of each button on user click(Either X or O based on turn.) Also i am using tag id from 1-9 on buttons. Here the code I am facing an error in. func check(){ let b1 = self.view.viewWithTag(1) as? UIButton let b2 = self.view.viewWithTag(1) as? UIButton let b3 = self.view.viewWithTag(1) as? UIButton let b4 = self.view.viewWithTag(1) as? UIButton let b5 = self.view.viewWithTag(1) as? UIButton let b6 = self.view.viewWithTag(1) as? UIButton let b7 = self.view.viewWithTag(1) as? UIButton let b8 = self.view.viewWithTag(1) as? UIButton let b9 = self.view.viewWithTag(1) as? UIButton if(b1.currentImage.isEqual(UIImage(named: "x")) && b2.currentImage.isEqual(UIImage(named: "x")) && b3.currentImage.isEqual(UIImage(named: "x"))) { print("X wins") } } I am getting an Error on if statement saying, > Value of optional type 'UIButton?' not unwrapped; did you mean to use > '!' or '?'? Now the problem is the inbuilt help is not fixing the error. Also I do not understand why am I getting this error. Can someone help me explain why I am facing this error? Also how to fix it?
0debug
I need a keyboard button presser thing please : hi i am trying to make a clicker for a game i play, and it requires the pushing of a button, and about 10 seconds later i need to hold down a different button if someone can link me, or somehow make a keyboard presser thing that can press q over and over for ten seconds, and then hold c for 10 seconds, endlessly repeating this process, I've looked all over google, no keyboard clickers can do more than one key at a time, and it's really frustrating thanks
0debug
While Statement help bash scripting : <p>Need help understanding this script I cannot figure out what the <code>-z</code> condition means for first line then the <code>-z</code> with the <code>"$1"</code> in the if statement Here is the script:</p> <pre><code>while [ -z "$USERNAME" ] do if [ -z "$1" ] then unset ans unset USER echo "What is the username you would like to add?" read USER echo "Is" $USER " the correct username? [y/n]" read ans case "$ans" in y|Y|yes|Yes|YES) USERNAME=$USER </code></pre> <p>;;</p>
0debug
from collections import Counter def count_common(words): word_counts = Counter(words) top_four = word_counts.most_common(4) return (top_four)
0debug
How to reverse a long sum without loosing the first digit after the sum reverse? : I've completed a program where it reverse long sum's, but for some reason when I try to reverse the sum of two long values it drops the first number. The first number I use is 1234567890000000000 and the second 1234567890. When I do the calculations the total adds to 1234567891234567890 and suppose to reverse to 0987654321987654321. Instead my program drops the zero and return a result of 987654321987654321. Is my while loop math off? When you try smaller integers like 567 and 456 = 1023 reversed 3201. I think when a zero is at the end of any value it reverse incorrectly. import java.math.*; import java.util.Scanner; import java.lang.*; public class Exercise3 { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Enter first number: "); long n1 = sc.nextLong(); System.out.println("Enter second number: "); long n2 = sc.nextLong(); long sum = n1+n2; long reverseSum = 0; long rem; while(sum != 0) { rem = sum % 10; reverseSum = reverseSum * 10 + rem; sum = sum / 10; } System.out.println("The reversed sum is " + reverseSum); } }
0debug
difference between "->" and "." operator in C language (struct) : <p>I' just got started in learning struct in c language. i Thought "->" and "." were equivalent but i get the following error when using "->" instead of ".": <em>invalid type argument of '->' (have 'struct item')</em></p>
0debug
static int decode_frame_byterun1(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { IffContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; unsigned buf_size = avpkt->size; const uint8_t *buf_end = buf+buf_size; unsigned y, plane, x; if (avctx->reget_buffer(avctx, &s->frame) < 0){ av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } for(y = 0; y < avctx->height ; y++ ) { uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; if (avctx->codec_tag == MKTAG('I','L','B','M')) { memset(row, 0, avctx->pix_fmt == PIX_FMT_PAL8 ? avctx->width : (avctx->width * 4)); for (plane = 0; plane < avctx->bits_per_coded_sample; plane++) { for(x = 0; x < s->planesize && buf < buf_end; ) { int8_t value = *buf++; unsigned length; if (value >= 0) { length = value + 1; memcpy(s->planebuf + x, buf, FFMIN3(length, s->planesize - x, buf_end - buf)); buf += length; } else if (value > -128) { length = -value + 1; memset(s->planebuf + x, *buf++, FFMIN(length, s->planesize - x)); } else { continue; } x += length; } if (avctx->pix_fmt == PIX_FMT_PAL8) { decodeplane8(row, s->planebuf, s->planesize, avctx->bits_per_coded_sample, plane); } else { decodeplane32((uint32_t *) row, s->planebuf, s->planesize, avctx->bits_per_coded_sample, plane); } } } else { for(x = 0; x < avctx->width && buf < buf_end; ) { int8_t value = *buf++; unsigned length; if (value >= 0) { length = value + 1; memcpy(row + x, buf, FFMIN3(length, buf_end - buf, avctx->width - x)); buf += length; } else if (value > -128) { length = -value + 1; memset(row + x, *buf++, FFMIN(length, avctx->width - x)); } else { continue; } x += length; } } } *data_size = sizeof(AVFrame); *(AVFrame*)data = s->frame; return buf_size; }
1threat
How to import Room Persistence Library to an Android project : <p>I recently saw the new feature announced on Google I/O Room Persistence Library to work with Sqlite databases on Android. I have been looking to the <a href="https://developer.android.com/topic/libraries/architecture/room.html" rel="noreferrer">official documentation</a> and I don't find which dependencies I should import to my gradle file on my Android project. Someone can give me a hand?</p>
0debug
static int init_directories(BDRVVVFATState* s, const char* dirname) { bootsector_t* bootsector; mapping_t* mapping; unsigned int i; unsigned int cluster; memset(&(s->first_sectors[0]),0,0x40*0x200); s->cluster_size=s->sectors_per_cluster*0x200; s->cluster_buffer=qemu_malloc(s->cluster_size); i = 1+s->sectors_per_cluster*0x200*8/s->fat_type; s->sectors_per_fat=(s->sector_count+i)/i; array_init(&(s->mapping),sizeof(mapping_t)); array_init(&(s->directory),sizeof(direntry_t)); { direntry_t* entry=array_get_next(&(s->directory)); entry->attributes=0x28; snprintf((char*)entry->name,11,"QEMU VVFAT"); } init_fat(s); s->faked_sectors=s->first_sectors_number+s->sectors_per_fat*2; s->cluster_count=sector2cluster(s, s->sector_count); mapping = array_get_next(&(s->mapping)); mapping->begin = 0; mapping->dir_index = 0; mapping->info.dir.parent_mapping_index = -1; mapping->first_mapping_index = -1; mapping->path = strdup(dirname); i = strlen(mapping->path); if (i > 0 && mapping->path[i - 1] == '/') mapping->path[i - 1] = '\0'; mapping->mode = MODE_DIRECTORY; mapping->read_only = 0; s->path = mapping->path; for (i = 0, cluster = 0; i < s->mapping.next; i++) { int fix_fat = (i != 0); mapping = array_get(&(s->mapping), i); if (mapping->mode & MODE_DIRECTORY) { mapping->begin = cluster; if(read_directory(s, i)) { fprintf(stderr, "Could not read directory %s\n", mapping->path); return -1; } mapping = array_get(&(s->mapping), i); } else { assert(mapping->mode == MODE_UNDEFINED); mapping->mode=MODE_NORMAL; mapping->begin = cluster; if (mapping->end > 0) { direntry_t* direntry = array_get(&(s->directory), mapping->dir_index); mapping->end = cluster + 1 + (mapping->end-1)/s->cluster_size; set_begin_of_direntry(direntry, mapping->begin); } else { mapping->end = cluster + 1; fix_fat = 0; } } assert(mapping->begin < mapping->end); cluster = mapping->end; if(cluster > s->cluster_count) { fprintf(stderr,"Directory does not fit in FAT%d (capacity %s)\n", s->fat_type, s->fat_type == 12 ? s->sector_count == 2880 ? "1.44 MB" : "2.88 MB" : "504MB"); return -EINVAL; } if (fix_fat) { int j; for(j = mapping->begin; j < mapping->end - 1; j++) fat_set(s, j, j+1); fat_set(s, mapping->end - 1, s->max_fat_value); } } mapping = array_get(&(s->mapping), 0); s->sectors_of_root_directory = mapping->end * s->sectors_per_cluster; s->last_cluster_of_root_directory = mapping->end; fat_set(s,0,s->max_fat_value); fat_set(s,1,s->max_fat_value); s->current_mapping = NULL; bootsector=(bootsector_t*)(s->first_sectors+(s->first_sectors_number-1)*0x200); bootsector->jump[0]=0xeb; bootsector->jump[1]=0x3e; bootsector->jump[2]=0x90; memcpy(bootsector->name,"QEMU ",8); bootsector->sector_size=cpu_to_le16(0x200); bootsector->sectors_per_cluster=s->sectors_per_cluster; bootsector->reserved_sectors=cpu_to_le16(1); bootsector->number_of_fats=0x2; bootsector->root_entries=cpu_to_le16(s->sectors_of_root_directory*0x10); bootsector->total_sectors16=s->sector_count>0xffff?0:cpu_to_le16(s->sector_count); bootsector->media_type=(s->fat_type!=12?0xf8:s->sector_count==5760?0xf9:0xf8); s->fat.pointer[0] = bootsector->media_type; bootsector->sectors_per_fat=cpu_to_le16(s->sectors_per_fat); bootsector->sectors_per_track=cpu_to_le16(s->bs->secs); bootsector->number_of_heads=cpu_to_le16(s->bs->heads); bootsector->hidden_sectors=cpu_to_le32(s->first_sectors_number==1?0:0x3f); bootsector->total_sectors=cpu_to_le32(s->sector_count>0xffff?s->sector_count:0); bootsector->u.fat16.drive_number=s->fat_type==12?0:0x80; bootsector->u.fat16.current_head=0; bootsector->u.fat16.signature=0x29; bootsector->u.fat16.id=cpu_to_le32(0xfabe1afd); memcpy(bootsector->u.fat16.volume_label,"QEMU VVFAT ",11); memcpy(bootsector->fat_type,(s->fat_type==12?"FAT12 ":s->fat_type==16?"FAT16 ":"FAT32 "),8); bootsector->magic[0]=0x55; bootsector->magic[1]=0xaa; return 0; }
1threat
Headless Chrome and Selenium on Windows? : <p>I've seen that headless Chrome came out in some form last month and I've seen that it can be interacted with via Selenium but the articles I've seen mostly mention Linux and MacOS. Is this available for windows (7 and /or 10) yet?</p>
0debug
Java String class replaceAll method missing : <p>I'm having a very weird issue right now, the <code>replaceAll</code> method is missing from the <code>String</code> object.</p> <p>JDK version: 1.8.0<br> Android Studio version: 3.1.3<br> Kotlin version: 1.2</p> <p><a href="https://i.stack.imgur.com/mHDZ0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mHDZ0.png" alt="enter image description here"></a></p> <p><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#replaceAll-java.lang.String-java.lang.String-" rel="noreferrer">It hasn't been removed</a>, so whats going on here??</p>
0debug