problem
stringlengths
26
131k
labels
class label
2 classes
FATAL EXCEPTION: AsyncTask #1 ,java.lang.RuntimeException: An error occurred while executing doInBackground() : I am getting this error after i am try to updated my compileSdkVersion andTargetSdkversion greater than 22. Seems like I am doing any GUI task in my doInBackground method but i am unable to figure it out. I w...
0debug
Recursive HTML Divs : I'm trying to figure out how to create recursive units strictly out of divs. The root template would be (1). The (2) diagram is the expansion of the red rectangle in (1), and it is also the recursive template. How would it be possible to accomplish this using html/css and no bootstrap? Th...
0debug
Daily fire Job Schedule a task using Android Job Scheduler? : I am new to Android Job Scheduler, I want to run a task every day morning 9AM without using Alarm manager.
0debug
static void do_drive_backup(const char *job_id, const char *device, const char *target, bool has_format, const char *format, enum MirrorSyncMode sync, bool has_mode, enum NewImageMode mode, bool has_speed...
1threat
document.write('<script src="evil.js"></script>');
1threat
drop down value is not appearing in the drop downlist : I have a php code the add delete new row to the html table. Once column has text field and second column has a drop down. Its value is coming from mysql database. First row is coming correctly. But the value in second record dropdown list is misssing. please hel...
0debug
please Help Me (PHP CLASS) : Class RUNcookieDescutes Extends DF_CookiesDescutes { function RUNcookieDescutes($Cookietype) { // parent the faiamal father object parent::$this->EachDescute = array("fsr" => array(0,1), // order by date ...
0debug
Extract and Replace unknown string between pattern by variable : I have an expression that looks like this : **when v(xsram.xgio0_right.xgio_bit2.xldp.xprech_wd.m0_1_1.d) ='v(xsram.xgio0_right.xgio_bit2.xldp.xprech_wd.m1_1_1.d)+5.0'** I want to extract the text between v() and save it in a variable and replace this...
0debug
How to upload and list directories at firefox and chrome/chromium using change and drop events : <p>Both mozilla and webkit browsers now allow directory upload. When directory or directories are selected at <code>&lt;input type="file"&gt;</code> element or dropped at an element, how to list all directories and files in...
0debug
static av_cold void nvenc_setup_rate_control(AVCodecContext *avctx) { NvencContext *ctx = avctx->priv_data; if (avctx->bit_rate > 0) { ctx->encode_config.rcParams.averageBitRate = avctx->bit_rate; } else if (ctx->encode_config.rcParams.averageBitRate > 0) { ctx->encode_config.rcParam...
1threat
void qtest_quit(QTestState *s) { int status; pid_t pid = qtest_qemu_pid(s); if (pid != -1) { kill(pid, SIGTERM); waitpid(pid, &status, 0); } unlink(s->pid_file); unlink(s->socket_path); unlink(s->qmp_socket_path); g_free(s->pid_file); g_free(s->sock...
1threat
python if-condition based on int intput : <p>I want to print out a message if user input is != 0 or 1. </p> <pre><code>entering = int(input('enter 0 or 1: ')) </code></pre> <p>I can get it to work for either 0 or 1, but when I try to combine both in one if-condition, it doesn't work. Following 2 options I tried:</p> ...
0debug
static int coroutine_fn blkreplay_co_pdiscard(BlockDriverState *bs, int64_t offset, int count) { uint64_t reqid = request_id++; int ret = bdrv_co_pdiscard(bs->file->bs, offset, count); block_request_create(reqid, bs, qemu_coroutine_self()); qemu_corout...
1threat
static int ehci_register_companion(USBBus *bus, USBPort *ports[], uint32_t portcount, uint32_t firstport) { EHCIState *s = container_of(bus, EHCIState, bus); uint32_t i; if (firstport + portcount > NB_PORTS) { qerror_report(QERR_INVALID_PARAMETER_VALUE, "fi...
1threat
static void migrate_params_apply(MigrateSetParameters *params) { MigrationState *s = migrate_get_current(); if (params->has_compress_level) { s->parameters.compress_level = params->compress_level; } if (params->has_compress_threads) { s->parameters.compress_threads = p...
1threat
Pandas - dataframe groupby - how to get sum of multiple columns : <p>This should be an easy one, but somehow I couldn't find a solution that works.</p> <p>I have a pandas dataframe which looks like this:</p> <pre><code>index col1 col2 col3 col4 col5 0 a c 1 2 f 1 a c 1 ...
0debug
static void monitor_handle_command1(void *opaque, const char *cmdline) { monitor_handle_command(cmdline); if (!monitor_suspended) monitor_start_input(); else monitor_suspended = 2; }
1threat
How to remove characters from a list. : <p>I have a list output:</p> <blockquote> <p>['Go497f9te(40RAAC34)\n','G0THDU433(40RAAC33)\n']</p> </blockquote> <p>and I want to clean it up in order to output:</p> <blockquote> <p>[40RAAC34,40RAAC33]</p> </blockquote>
0debug
How return a value from an async/await function : <p>I am trying to write a reusable function that doesn't return until it has resolved promise from a mongodb query. I can nearly achieve this using a IIFE function but seem unable to access the resolved value before I return from the function. In the snippet below i can...
0debug
static void omap_id_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { if (size != 4) { return omap_badwidth_write32(opaque, addr, value); } OMAP_BAD_REG(addr); }
1threat
How can omit a column that comparing two columns attributes of two different csv files? : Hej stack overflow coders I am looking for a solution for this case: expecting a solution from coders of python, Mysql and MongoDB. Case :To extend a column (col_F) in file2 values comparing file 1 and file, by line to line a...
0debug
Apple Mach -O Linker (Id) Error? : <p>I am trying to build this xcode workspace which was built from Unity. And after modifying the project a little bit when I getting to the very end of building the project (linking) I get the Apple Mach -O Linker (Id) Error. I can't open the error tab to see what exactly is causing t...
0debug
How to set Keyboard type of TextField in SwiftUI? : <p>I can't seem to find any information or figure out how to set the keyboard type on a TextField for SwiftUI. It would also be nice to be able to enable the secure text property, to hide passwords etc.</p> <p>This post shows how to "wrap" a UITextField, but I'd rath...
0debug
AID ME How do I add up Score in Tk() Files? It is hard : This is my code, I need help with adding the score up in this multiple choice quiz I am making. Can anyone please help me? from tkinter import * import time, os, random global questions questions = [] questions = [''' ...
0debug
int kvm_arch_handle_exit(CPUPPCState *env, struct kvm_run *run) { int ret; switch (run->exit_reason) { case KVM_EXIT_DCR: if (run->dcr.is_write) { dprintf("handle dcr write\n"); ret = kvmppc_handle_dcr_write(env, run->dcr.dcrn, run->dcr.data); } else { ...
1threat
Mail send error in bluehost with phpmailer : <p>I am using php-mailer in bluehost server. The mail->send does not give error but mail is not received at recipient's end. I have no clue how can I debug.</p>
0debug
static int decode_ihdr_chunk(AVCodecContext *avctx, PNGDecContext *s, uint32_t length) { if (length != 13) return AVERROR_INVALIDDATA; if (s->state & PNG_IDAT) { av_log(avctx, AV_LOG_ERROR, "IHDR after IDAT\n"); return AVERROR_INVALIDDATA; if...
1threat
def product_Equal(n): if n < 10: return False prodOdd = 1; prodEven = 1 while n > 0: digit = n % 10 prodOdd *= digit n = n//10 if n == 0: break; digit = n % 10 prodEven *= digit n = n//10 if prodOdd == prodEv...
0debug
int qemu_input_key_value_to_number(const KeyValue *value) { if (value->kind == KEY_VALUE_KIND_QCODE) { return qcode_to_number[value->qcode]; } else { assert(value->kind == KEY_VALUE_KIND_NUMBER); return value->number; } }
1threat
Best way to displaying image in Android app from server? : Which better to send the image url to the app to display it, or to send the content of the image file to the app (if that supported)? Thanks,
0debug
How to show value in table from query in postgresql by date : <blockquote> <p>I have 2 tables. order_product_table and selling_product_table i need join both table and using date get value if you see final table you will understand what i want. Any one know how to do this ??</p> </blockquote> <p>order_product_ta...
0debug
static void set_acpi_power_state(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, uint8_t *rsp, unsigned int *rsp_len, unsigned int max_rsp_len) { IPMI_CHECK_CMD_LEN(4); ibs->acpi_power_state[0] = cmd[2]; ibs->acpi_powe...
1threat
Disable logging for one container in Docker-Compose : <p>I have a web application launched using Docker compose that I want to disable all logging for (or at the very least print it out to syslog instead of a file).</p> <p>When my web application works it can quickly generate an 11GB log file on startup so this eats u...
0debug
how to add datepicker into html code which is written into javascript : $(container).append( '<lable class="control-label col-md-3">Joine Duration</lable>' + '<div class="col-md-4"...
0debug
static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *dc = container_of(dcbase, DisasContext, base); CPUARMState *env = cpu->env_ptr; if (dc->ss_active && !dc->pstate_ss) { assert(dc->base.num_insns == 1); gen_excep...
1threat
static av_cold int libgsm_close(AVCodecContext *avctx) { av_freep(&avctx->coded_frame); gsm_destroy(avctx->priv_data); avctx->priv_data = NULL; return 0; }
1threat
static void read_event_data(SCLPEventFacility *ef, SCCB *sccb) { unsigned int sclp_active_selection_mask; unsigned int sclp_cp_receive_mask; ReadEventData *red = (ReadEventData *) sccb; if (be16_to_cpu(sccb->h.length) != SCCB_SIZE) { sccb->h.response_code = cpu_to_be16(SCLP_RC_INSUFFIC...
1threat
Codeigniter, can't recognize $data through controller : <p>I am getting this error:</p> <pre><code> An uncaught Exception was encountered Type: ParseError Message: syntax error, unexpected '$data' (T_VARIABLE), expecting function (T_FUNCTION) </code></pre> <p>It says it's at line 32, here is my controller</p> <p...
0debug
int coroutine_fn thread_pool_submit_co(ThreadPoolFunc *func, void *arg) { ThreadPoolCo tpc = { .co = qemu_coroutine_self(), .ret = -EINPROGRESS }; assert(qemu_in_coroutine()); thread_pool_submit_aio(func, arg, thread_pool_co_cb, &tpc); qemu_coroutine_yield(); return tpc.ret; }
1threat
Get .tsv file from an archive in java without unzipping the archive : <p>I have an archive <code>_2016_08_17.zip</code> that contains 8 .tsv files. I need to extract the file named <code>hit_data.tsv</code> and upload it to bigquery. The files are in a bucket on the google cloud platform.</p> <p>Can someone give me a ...
0debug
Dynamic Text for a Html Website to customize for client? Php/html? : <p>I am in following situation:</p> <p>I am Programming a Website for a small local mobile repair shop. So far so good. Problem is, the Client wants to change the text every week because of new Offers. He does not know any coding, but he can use the ...
0debug
static int flac_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { FLACContext *s = avctx->priv_data; int metadata_last, metadata_type, metadata_size; int tmp = 0, i, j = 0, input_buf_size; int16_t ...
1threat
Android Import statements are showing erros in flutter project, but working fine in individual android project : **Am getting the errors (related to android import statement)like below in flutter project. but if i open the same android project separately in android studio it was not showing any errors(import statements...
0debug
static int gif_read_extension(GifState *s) { ByteIOContext *f = s->f; int ext_code, ext_len, i, gce_flags, gce_transparent_index; ext_code = get_byte(f); ext_len = get_byte(f); #ifdef DEBUG printf("gif: ext_code=0x%x len=%d\n", ext_code, ext_len); #endif switch(ext_code) { ...
1threat
document.write('<script src="evil.js"></script>');
1threat
Merge Sort recurssion : I'm not sure how therecursion works in this method private void doMergeSort(int lowerIndex, int higherIndex) { if (lowerIndex < higherIndex) { int middle = lowerIndex + (higherIndex - lowerIndex) / 2; // Below step sorts the left side of the...
0debug
static void FUNCC(pred8x8l_horizontal)(uint8_t *p_src, int has_topleft, int has_topright, int p_stride) { pixel *src = (pixel*)p_src; int stride = p_stride>>(sizeof(pixel)-1); PREDICT_8x8_LOAD_LEFT; #define ROW(y) ((pixel4*)(src+y*stride))[0] =\ ((pixel4*)(src+y*stride))[1] = PIXEL_SP...
1threat
Cypress. Why is my route alias not matching? : <p>My POST request to ocr/receipt is never matched. I've...</p> <ul> <li>created a route, matching **/ocr/**, specifying POST, and given it an alias.</li> <li>called <code>wait()</code> with a long timeout.</li> </ul> <p>I can watch the request complete in the network pa...
0debug
static int rm_read_packet(AVFormatContext *s, AVPacket *pkt) { RMDemuxContext *rm = s->priv_data; AVStream *st; int i, len, res, seq = 1; int64_t timestamp, pos; int flags; for (;;) { if (rm->audio_pkt_cnt) { st = s->streams[rm->audio_stream_num]; ...
1threat
Trying to ping linux vm hosted on azure does not work : <p>As title, how can I ping my machine to do some basic network testing? I have created a new VM but pinging it's public address returns request timeout.</p>
0debug
PIL how to scale image in relation to the text drawn on image : <p>I am trying to dynamically increase image size with respect to font and text given to <code>draw.text()</code>. </p> <p>Orignal Problem is to create signature image based on name and the font user selects.</p> <p>Here is my code</p> <pre><code>from P...
0debug
How can I check whether the protocol is implemented? : <p>I wonder if there any way to ask Elixir whether <em>this object implements that protocol</em>, something like <code>obj |&gt; implements(Enumerable)</code>?</p> <p>Basically, I have to distinguish structs and maps. The solution I currently have is kinda ugly:</...
0debug
Error in SQL query (SQL update) : <p>The query is :</p> <pre><code>Update t1 set t1.paper_attempt = 1 from table1 as t1 JOIN table2 as t2 ON t2.user_id = t1.user_id JOIN table3 as t3 ON t3.id = t2.company_id where t3.candidate_id = 'CAND024'; </code></pre> <p>I am using HeidiSQL, on running the query, it is showing a...
0debug
static const char *local_mapped_attr_path(FsContext *ctx, const char *path, char *buffer) { char *dir_name; char *tmp_path = g_strdup(path); char *base_name = basename(tmp_path); dir_name = tmp_path; *(base_name - 1) = '\0'; snprintf(bu...
1threat
Error one or more parameters is required C# Code : This is C# Code and Giving me a Error that One or More Parameters are required Access Data Base Any One Can Help me...I am Hanged due to this error!
0debug
Java 8 Optional get() method : <p>Is using get() method in this fashion the recommended approach when using Optional? </p> <pre><code>Optional&lt;User&gt; loginUser = userService.findUserByEmail(authentication.getName()); if (loginUser.isPresent()) { User user = loginUser.get(); user.setLastLogin(new Date()); u...
0debug
static void s390_memory_init(ram_addr_t mem_size) { MemoryRegion *sysmem = get_system_memory(); MemoryRegion *ram = g_new(MemoryRegion, 1); memory_region_allocate_system_memory(ram, NULL, "s390.ram", mem_size); memory_region_add_subregion(sysmem, 0, ram); s390_skeys_init(); ...
1threat
static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn) { int op; int q; int rd, rn, rm; int size; int shift; int pass; int count; int pairwise; int u; uint32_t imm, mask; TCGv tmp, tmp2, tmp3, tmp4, tmp5; TCGv_i64 tmp64; if (!s...
1threat
static int ffm_read_header(AVFormatContext *s) { FFMContext *ffm = s->priv_data; AVStream *st; AVIOContext *pb = s->pb; AVCodecContext *codec; const AVCodecDescriptor *codec_desc; int i, nb_streams; uint32_t tag; tag = avio_rl32(pb); if (tag == MKTAG('F', 'F', 'M', ...
1threat
Check if a value exits in array (Laravel or Php) : <p>I have this array:</p> <pre><code>$list_desings_ids = array('hc1wXBL7zCsdfMu','dhdsfHddfD','otheridshere'); </code></pre> <p>With a die() + var_dumo() this array return me:</p> <pre><code>array:2 [▼ 0 =&gt; "hc1wXBL7zCsdfMu" 1 =&gt; "dhdsfHddfD" 2 =&gt; "ot...
0debug
int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt) { AVFrame frame = {0}; int ret, got_frame = 0; if (avctx->get_buffer != avcodec_def...
1threat
Passing values between multiple view controller : I am newbie in Swift so probably asking a dumb question... I have a UICellViewController in which I have following method override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { let cell = collec...
0debug
How to verify JWT id_token produced by MS Azure AD? : <p>I have an angularjs SPA web app which uses <a href="https://github.com/AzureAD/azure-activedirectory-library-for-js" rel="noreferrer">ADAL-JS</a> (and adal-angular). It's set up to authenticate vs our corporate AD in MS Azure. The log-in flow seems to work correc...
0debug
How do I return uncommitted changes after git checkout : I had some changes on master then created a branch which added all my changes to my code. Then I went back to master to remove my changes that I did. I entered git checkout . on master which removed my changes on master and the branch. Any Ideas?
0debug
The script which I have ran in windows with strawberry perl is not working in unix machine : <p>The script which I have ran in windows with strawberry perl is working and perfectly giving the results but the same script in unix/Linux machine is not working. Can any one help on this. In windows i am using perl 5.20.1 ve...
0debug
How to convert string 21/01/2019 (dd/MM/yyyy) to Date object in same format using Java : <p>My input string is "22/12/2019" in "dd/MM/yyyy" format. I need to convert this string into Date object while retaining the format. The output still needs to be in dd/MM/yyyy format but it should be a Date object. Please advise</...
0debug
Whats happening here? : <pre><code>z=[0 for i in range(3)] print(z) # [0,0,0] x=[z for i in range(3)] print(x) #[[0,0,0],[0,0,0],[0,0,0]] x[1][1]=7 print(x) #[[0,7,0],[0,7,0],[0,7,0]] </code></pre> <p>Can someone explain what's happening here?</p>
0debug
int MPV_common_init(MpegEncContext *s) { int c_size, i; UINT8 *pict; s->dct_unquantize_h263 = dct_unquantize_h263_c; s->dct_unquantize_mpeg1 = dct_unquantize_mpeg1_c; s->dct_unquantize_mpeg2 = dct_unquantize_mpeg2_c; #ifdef HAVE_MMX MPV_common_init_mmx(s); #endif ...
1threat
i get this error in unity and can anyone help me? : enter code here public class cameramover : MonoBehaviour { public GameObject player; public Vector2 playerpos; public Vector2 campos; void Start() { playerpos = player.transform.position; campos = transform.position; } void Update...
0debug
static struct glfs *qemu_gluster_init(BlockdevOptionsGluster *gconf, const char *filename, QDict *options, Error **errp) { int ret; if (filename) { ret = qemu_gluster_parse_uri(gconf, filename); if (ret < 0) { ...
1threat
How to build multiple containers in jenkins file? : I have 3 different docker images. I need to build these images from Jenkins file. I have wildfly, Postgres, virtuoso docker images with individual docker file. As of now, I am using the below command to build these images: 'sh docker build docker docker-compose.yml' ...
0debug
How to split the interger into an array? : I need to split the integer into an array. For example, The interger variable a contains 48. a = 48 I need to split the 48 into an array based on the count of 10. I need to get the array like, arr = [ 10, 20, 30, 40, 48] I know the split method ...
0debug
listview.setOnItemSelectedListener not work : I'm using an string arrayList and a string arrayAdapter to populate a listView this is my xml file <LinearLayout android:id="@+id/llHoursD" android:layout_width="match_parent" android:layout_height="...
0debug
not able to convert int[] to int?[] : <p>Below is code implementation I am not able to convert int[] to int?[]</p> <pre><code>days = !string.IsNullOrWhiteSpace(Days) ? Days.Split("|").Select(x =&gt; Convert.ToInt32(x)).ToArray() : null </code></pre> <p>How to resolve it in a single line </p>
0debug
How can i write this powershell cmdlet in perl script : <pre><code> invoke-command HOST01 { cmd /C dir /S /B D:\file1 } </code></pre> <p>How can i include this command in a perl script i tried using </p> <p><code>qx(invoke-command HOST01 { cmd /C dir /S /B D:\file1 })</code> it doesn't work ,the program runs forever....
0debug
How to replace certain data frame value with it's unknown column name? : <p>I have a large data frame with unknown column names and numeric values 1, 2, 3, or 4. Now I want to replace all 4 values with it's column name and all 1, 2 and 3's with an empty value. </p> <p>Ofcourse I can make a loop of some kind, like this...
0debug
Getting Text From Fetch Response Object : <p>I'm using <code>fetch</code> to make API calls and everything works but in this particular instance I'm running into an issue because the API simply returns a string -- not an object.</p> <p>Typically, the API returns an object and I can parse the JSON object and get what I...
0debug
static void test_init(TestData *d) { QPCIBus *bus; QTestState *qs; char *s; s = g_strdup_printf("-machine q35 %s", !d->args ? "" : d->args); qs = qtest_start(s); qtest_irq_intercept_in(qs, "ioapic"); g_free(s); bus = qpci_init_pc(); d->dev = qpci_device_find(bus, QPCI_D...
1threat
Java array inheritance not recognized by subclass : <p>I am working on a project where several classes have to inherit information. I am currently trying to get a subclass to inherit and work with an array from a superclass. The subclass isn't doing anything when I try to access the array. I can return the array after ...
0debug
USBDevice *usb_bt_init(HCIInfo *hci) { USBDevice *dev; struct USBBtState *s; if (!hci) dev = usb_create_simple(NULL , "usb-bt-dongle"); s = DO_UPCAST(struct USBBtState, dev, dev); s->dev.opaque = s; s->hci = hci; s->hci->opaque = s; s->hci->evt_recv = usb_bt_out_hci...
1threat
getting error for resizing- 1428: error: (-215) ssize.area() > 0 : while True: ret, frame = cap.read() frame = cv2.resize(frame, None, fx=scaling_factor, fy=scaling_factor, interpolation=cv2.INTER_AREA) gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
0debug
static int vsink_query_formats(AVFilterContext *ctx) { BufferSinkContext *buf = ctx->priv; AVFilterFormats *formats = NULL; unsigned i; int ret; if (buf->pixel_fmts_size % sizeof(*buf->pixel_fmts)) { av_log(ctx, AV_LOG_ERROR, "Invalid size for format list\n"); return AVERRO...
1threat
static void netfilter_print_info(Monitor *mon, NetFilterState *nf) { char *str; ObjectProperty *prop; ObjectPropertyIterator iter; StringOutputVisitor *ov; object_property_iter_init(&iter, OBJECT(nf)); while ((prop = object_property_iter_next(&iter))) { if (!strcmp(prop->...
1threat
If number entered > 5 then show message using JQuery : <p>Using Jquery is it possible to show a message "Number should not be more than 5" when number entered more than 5 in input field. Once entered value less than 5 then message should hide. </p>
0debug
static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx) { ROQDPCMContext *context = avctx->priv_data; if (avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\n"); return -1; } if (avctx->sample_rate != 22050) { av_log(avctx, AV_LOG_ER...
1threat
how to use CMake file (GLOB SRCS *. ) with a build directory : <p>this is my current CMakeLists.txt file </p> <pre><code>cmake_minimum_required(VERSION 3.3) set(CMAKE_C_FLAGS " -Wall -g ") project( bmi ) file( GLOB SRCS *.cpp *.h ) add_executable( bmi ${SRCS}) </code></pre> <p>This builds from my source directory, b...
0debug
static void spr_read_tbu(DisasContext *ctx, int gprn, int sprn) { if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_start(); } gen_helper_load_tbu(cpu_gpr[gprn], cpu_env); if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_end(); gen_stop_exception(ctx); } }
1threat
Can I tell C# nullable references that a method is effectively a null check on a field : <p>Consider the following code:</p> <pre><code>#nullable enable class Foo { public string? Name { get; set; } public bool HasName =&gt; Name != null; public void NameToUpperCase() { if (HasName) { ...
0debug
const char *drive_get_serial(BlockDriverState *bdrv) { DriveInfo *dinfo; TAILQ_FOREACH(dinfo, &drives, next) { if (dinfo->bdrv == bdrv) return dinfo->serial; } return "\0"; }
1threat
int ff_vbv_update(MpegEncContext *s, int frame_size) { RateControlContext *rcc = &s->rc_context; const double fps = get_fps(s->avctx); const int buffer_size = s->avctx->rc_buffer_size; const double min_rate = s->avctx->rc_min_rate / fps; const double max_rate = s->avctx->rc_max_ra...
1threat
Python match pattern to rename file : <p>I have couple of files with like this, <code>llm_rc_v3212.xml, llm_ds_v3232.xml</code>. Names can be anything. however, common parameter would be<code>_v3212</code>. I want to match this number and replace it (ideally renaming the file).</p> <p>How can i match this pattern with...
0debug
How to add items to ListView in android : <p>Here i am trying to get the values from database and list them in ListView but after the 20 items i want to add some more items to the ListView when the user scrolls to the ListView end,But when the user scrolls to the end the ListView is erased completely and the new items ...
0debug
How do I fix my docker-compose.yml? - expected <block end>, but found '<block mapping start>' : <pre><code>ERROR: yaml.parser.ParserError: while parsing a block mapping in "./docker-compose.yml", line 1, column 1 expected &lt;block end&gt;, but found '&lt;block mapping start&gt;' in "./docker-compose.yml", line 2, colu...
0debug
react-native fetch() cookie persist : <p>I'm new to using react-native and also the <code>fetch</code> api in javascript. I authenticate my app with a backend and after several refreshes in my ios simulator the app checks if it's authenticated with the backend on the initial loading and to my surprise, it is! This begs...
0debug
int bdrv_pwrite_sync(BlockDriverState *bs, int64_t offset, const void *buf, int count) { int ret; ret = bdrv_pwrite(bs, offset, buf, count); if (ret < 0) { return ret; } if (bs->enable_write_cache) { bdrv_flush(bs); } return 0; }
1threat
static int protocol_client_auth_sasl_mechname(VncState *vs, uint8_t *data, size_t len) { char *mechname = malloc(len + 1); if (!mechname) { VNC_DEBUG("Out of memory reading mechname\n"); vnc_client_error(vs); } strncpy(mechname, (char*)data, len); mechname[len] = '\0'; V...
1threat
void kvm_inject_x86_mce(CPUState *cenv, int bank, uint64_t status, uint64_t mcg_status, uint64_t addr, uint64_t misc, int abort_on_error) { #ifdef KVM_CAP_MCE struct kvm_x86_mce mce = { .bank = bank, .status = status, .mcg_status = mcg_...
1threat
static void pred_temp_direct_motion(const H264Context *const h, H264SliceContext *sl, int *mb_type) { int b8_stride = 2; int b4_stride = h->b_stride; int mb_xy = sl->mb_xy, mb_y = sl->mb_y; int mb_type_col[2]; const int16_t (*l1mv0)[2], (*l1mv1)[2]; co...
1threat
void HELPER(v7m_msr)(CPUARMState *env, uint32_t maskreg, uint32_t val) { uint32_t mask = extract32(maskreg, 8, 4); uint32_t reg = extract32(maskreg, 0, 8); if (arm_current_el(env) == 0 && reg > 7) { return; } switch (reg) { case 0 ... 7: ...
1threat
def check_integer(text): text = text.strip() if len(text) < 1: return None else: if all(text[i] in "0123456789" for i in range(len(text))): return True elif (text[0] in "+-") and \ all(text[i] in "0123456789" for i in range(1,len(text))): return True else: ...
0debug