problem
stringlengths
26
131k
labels
class label
2 classes
Sample code to connect to MS Access(accdb) database : Can anyone provide a sample code to connect to an MS Access database (.accdb file) from a C# application. Details are given below: I need to connect using the OdbcConnection class I am using Access 2007
0debug
static bool bdrv_start_throttled_reqs(BlockDriverState *bs) { bool drained = false; bool enabled = bs->io_limits_enabled; int i; bs->io_limits_enabled = false; for (i = 0; i < 2; i++) { while (qemu_co_enter_next(&bs->throttled_reqs[i])) { drained = true; } ...
1threat
static void *qpa_thread_in (void *arg) { PAVoiceIn *pa = arg; HWVoiceIn *hw = &pa->hw; if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { return NULL; } for (;;) { int incr, to_grab, wpos; for (;;) { if (pa->done) { goto exit; ...
1threat
static PCIReqIDCache pci_req_id_cache_get(PCIDevice *dev) { PCIDevice *parent; PCIReqIDCache cache = { .dev = dev, .type = PCI_REQ_ID_BDF, }; while (!pci_bus_is_root(dev->bus)) { parent = dev->bus->parent_dev; if (pci_is_express(parent)) { ...
1threat
int ff_listen_connect(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout, URLContext *h) { struct pollfd p = {fd, POLLOUT, 0}; int ret; socklen_t optlen; ff_socket_nonblock(fd, 1); while ((ret = connect(fd, addr, addrlen))) { ret = ff_neterr...
1threat
What is modifier for the variables inside the public static void main(String args[]) method : I have read at many places that static method can access static variables only but when I write code, I am mentioning my variables as static and my code still works. Is anyone out there to help me understand this concept cl...
0debug
CharDriverState *uart_hci_init(qemu_irq wakeup) { struct csrhci_s *s = (struct csrhci_s *) g_malloc0(sizeof(struct csrhci_s)); s->chr.opaque = s; s->chr.chr_write = csrhci_write; s->chr.chr_ioctl = csrhci_ioctl; s->hci = qemu_next_hci(); s->hci->opaque = s; s->hci->...
1threat
static int coroutine_fn bdrv_aligned_pwritev(BlockDriverState *bs, BdrvTrackedRequest *req, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, int flags) { BlockDriver *drv = bs->drv; int ret; int64_t sector_num = offset >> BDRV_SECTOR_BITS; unsigned int nb_sectors = bytes >> BDRV_...
1threat
Transfer files from dropbox/drive to Google cloud storage : <p>We are planning to implement a feature to let customers browse their images in their own google drive or dropbox accounts (within our app), and select ones they wanna use in our app. Then, we will save these images into our Google cloud storage (GCS) place....
0debug
static void serial_ioport_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { SerialState *s = opaque; addr &= 7; DPRINTF("write addr=0x%" HWADDR_PRIx " val=0x%" PRIx64 "\n", addr, val); switch(addr) { default: case 0: if (s->lcr & U...
1threat
static target_ulong h_put_tce_indirect(PowerPCCPU *cpu, sPAPRMachineState *spapr, target_ulong opcode, target_ulong *args) { int i; target_ulong liobn = args[0]; target_ulong ioba = args[1]; target_ulong ioba1 = ioba; ...
1threat
static int zipl_load_segment(struct component_entry *entry) { const int max_entries = (SECTOR_SIZE / sizeof(struct scsi_blockptr)); struct scsi_blockptr *bprs = (void*)sec; const int bprs_size = sizeof(sec); uint64_t blockno; long address; int i; blockno = entry->data.blockno; ...
1threat
void do_info_vnc(Monitor *mon, QObject **ret_data) { if (vnc_display == NULL || vnc_display->display == NULL) { *ret_data = qobject_from_jsonf("{ 'enabled': false }"); } else { QDict *qdict; QList *clist; clist = qlist_new(); if (vnc_display->clients) { ...
1threat
how to transpose every multiple rows that start with a specific string into columns using python? : i would like to ask how to transpose every multiple rows into columns and save into text file using python? I have attached input and expected output at the following part. According to the input, i would like to select ...
0debug
long vnc_client_read_ws(VncState *vs) { int ret, err; uint8_t *payload; size_t payload_size, frame_size; VNC_DEBUG("Read websocket %p size %zd offset %zd\n", vs->ws_input.buffer, vs->ws_input.capacity, vs->ws_input.offset); buffer_reserve(&vs->ws_input, 4096); ret = vnc_clien...
1threat
How to display Math equations in React Native View : <p>How to render Math equations in React Native Views? For web applications, we can use LaTex or MathJax solutions. But React Native renders native components. Using WebView will be bad as MathJax loading will take time for each WebView component. How do we render Ma...
0debug
Why does my code not return the requested number but always the requested number -1? : The Task is to create a Function. The function takes two arguments: current father's age (years) current age of his son (years) Сalculate how many years ago the father was twice as old as his son (or in how many years he wi...
0debug
Unrecognized Selector swift : <p>I've perused the previous posts on SO regarding this topic and I've ensured my code doesn't contain the same bugs, but I keep getting the error "Unrecognized selector sent to instance" when I try tap my UIButton. Can anyone figure out what the issue is? I've made sure that both my actio...
0debug
import math def calculate_polygons(startx, starty, endx, endy, radius): sl = (2 * radius) * math.tan(math.pi / 6) p = sl * 0.5 b = sl * math.cos(math.radians(30)) w = b * 2 h = 2 * sl startx = startx - w starty = starty - h endx = endx + w endy = endy + h origx = st...
0debug
Where has gone getItem() method? : <p>Making <code>RecyclerView</code> <code>Adapter class</code> and dont know why <code>getItem()</code> method is missing.</p> <p>My adapter class:</p> <pre><code>package com.example.pc.example; import android.content.Context; import android.database.Cursor; import android.support....
0debug
Extract Last Name only from Lastname,Firstname : <p>I just started working with Oracle recently so please bear with me.</p> <p>I have a column of names as LASTNAME,FIRSTNAME and I need to extract JUST the last name. I know how to do this in excel, where I want to so search for the "," find the length of characters bef...
0debug
Remove rows from listview as well as from my hostinger server database using remove button which is set by Adapter : i want to remove a particular row from database as well as from list view when i click the remove button,i tried but i am not getting the error > UserAdapter cannot be cast to android.content.Context...
0debug
React prevent event bubbling in nested components on click : <p>Here's a basic component. Both the <code>&lt;ul&gt;</code> and <code>&lt;li&gt;</code> have onClick functions. I want only the onClick on the <code>&lt;li&gt;</code> to fire, not the <code>&lt;ul&gt;</code>. How can I achieve this?</p> <p>I've played arou...
0debug
How to select the first <li> in an unordered list? : <p>I,m a beginner in programming. I'm trying to build a portfolio from scratch. In my navbar I want to select the first link to color it differently. Can anyone tell me the best possible way to select the first link from the unordered list?</p> <pre><code>&lt;ul id=...
0debug
static void spapr_dt_ov5_platform_support(void *fdt, int chosen) { PowerPCCPU *first_ppc_cpu = POWERPC_CPU(first_cpu); char val[2 * 4] = { 23, 0x00, 24, 0x00, 25, 0x00, 26, 0x40, }; if (kvm_enabled()) { if (kvmppc_has_cap_mmu_radix() && kvmppc_ha...
1threat
In App Purchase with fingerprint or Face ID in Objective c : I have an Objective C Project which i am working using Xcode 11 and i am trying to implement In App Purchase. I used some tutorials and implemented successfully but i am not able to use Fingerprint or Face ID. Please find the Image Url below in which it s...
0debug
static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { int i, k, channel; DCAContext *c = avctx->priv_data; const int16_t *samples; int ret, real_channel = 0; if ((ret = ff_alloc_packet2(avctx, avpkt, DCA_MAX_FRAM...
1threat
How to sort variables in my particular case : I would like to sort "years" in var yearObject so the menu starts with 2016 instead of 2013. Please help. [Example](http:jsfiddle.net/bond1126/r1nvsta9/)
0debug
How to create a simple Binding for previews : <p>With the new <code>@Binding</code> delegate and previews, I find it kinda awkward to always have to create a <code>@State static var</code> to create the neccesarry binding:</p> <pre class="lang-swift prettyprint-override"><code>struct TestView: View { @Binding var ...
0debug
Angular 4 renderer2 setStyle not working : <p>in a component, im attempting to target a dom node and change it's style but this does not work, can anyone tell me what i am doing wrong here?</p> <pre><code>@Input() progress:number = 0; ... ngOnChanges() { this.progressInnerEl = this.elRef.nativeElement.querySelec...
0debug
Why can't I edit the style property with javascript? : So, I was just trying to make a <div> appear on an onkeyup event with javascript and for some reason, it didn't let me do it and I got the error: **Uncaught TypeError: Cannot read property 'style' of null** This is my code: HTML: ``` <div class="content"...
0debug
static int qio_channel_command_close(QIOChannel *ioc, Error **errp) { QIOChannelCommand *cioc = QIO_CHANNEL_COMMAND(ioc); int rv = 0; if (close(cioc->writefd) < 0) { rv = -1; } if (close(cioc->readfd) < 0) { rv = -1; } #...
1threat
How to create method to count occurrences of type char within an array and return int of occurrences : I need to create a method that searches a String array whether a char exists in the array and returns an integer of the number of occurrences, I have looked on other posts to try and work it out myself but they are al...
0debug
void *grow_array(void *array, int elem_size, int *size, int new_size) { if (new_size >= INT_MAX / elem_size) { av_log(NULL, AV_LOG_ERROR, "Array too big.\n"); exit(1); } if (*size < new_size) { uint8_t *tmp = av_realloc(array, new_size*elem_size); if (!tmp) { ...
1threat
static void decode_hrd(HEVCContext *s, int common_inf_present, int max_sublayers) { GetBitContext *gb = &s->HEVClc->gb; int nal_params_present = 0, vcl_params_present = 0; int subpic_params_present = 0; int i; if (common_inf_present) { nal_params_present = ge...
1threat
Why is IEnumerable(of T) not accepted as extension method receiver : <p>Complete <strong>question</strong> before code:</p> <p>Why is <code>IEnumerable&lt;T&gt;</code> <code>where T : ITest</code> not accepted as receiver of an extension method that expects <code>this IEnumerable&lt;ITest&gt;</code>?</p> <p>And now t...
0debug
Q: How do I delete a specific nickname and password in a text file in python? : I have difficulties on **deleting an account** in a **text file**, although it is a school work. Here is my code (long and complicated): create = "" import time import sys while True: print("Type create...
0debug
static av_noinline void emulated_edge_mc_sse(uint8_t * buf,const uint8_t *src, ptrdiff_t buf_stride, ptrdiff_t src_stride, int block_w, int block_h, ...
1threat
React - TypeError: Cannot read property 'props' of undefined : <p>I'm trying to create a click event be able to delete an item on my list, but when I click it I get "TypeError: Cannot read property 'props' of undefined".</p> <p>I'm trying to stick to ES6 as much as possible, and I'm pretty sure its something to do bin...
0debug
How can i create object from a file in c++? : Im learning c++. I have my class complex: #include "Complejo.h" #include <sstream> Complejo::Complejo() { // TODO Auto-generated constructor stub real = 0; imaginary = 0; } Complejo::Complejo(int a, int b){ real = a...
0debug
accessing name of an index in a list : <p>With a list like below</p> <pre><code>mapping &lt;- c( "All A"= list(c('a1', 'a2')), "All B" = list(c('b1', 'b2'))) </code></pre> <p>I can access the vector in index 1 as below</p> <pre><code>&gt; mapping[[1]] [1] "a1" "a2" </code></pre> <p>How do I get the name of list at ...
0debug
Split String into smaller words by length variable in c# : <p>Hi I have a string paragraph containing 25 words and 300 characters, I want to set it in set of labels which can be contain 40 characters. I am trying it as below code with character lengths.</p> <pre><code>public static List&lt;string&gt; _mSplitByLength(t...
0debug
What is the best The IMDB REST API? Wher e can I get it from? : <p>I want access to IMDB REST API. How can I get it?</p>
0debug
void helper_rsm(CPUX86State *env) { X86CPU *cpu = x86_env_get_cpu(env); CPUState *cs = CPU(cpu); target_ulong sm_state; int i, offset; uint32_t val; sm_state = env->smbase + 0x8000; #ifdef TARGET_X86_64 cpu_load_efer(env, x86_ldq_phys(cs, sm_state + 0x7ed0)); env->gdt.base = x86_ldq_phys...
1threat
static void nbd_request_put(NBDRequest *req) { NBDClient *client = req->client; if (req->data) { qemu_vfree(req->data); } g_slice_free(NBDRequest, req); if (client->nb_requests-- == MAX_NBD_REQUESTS) { qemu_notify_event(); } nbd_client_put(client); }
1threat
go over all multiples of 3 between 0 and 100 (inclusive), and print the ones that are divisible by 2 : what I have so far... >num = range(0,101,3) >list = [] >if num % 3 == 0: >>>list.append >print(list)
0debug
static int seq_fill_buffer(SeqDemuxContext *seq, ByteIOContext *pb, int buffer_num, unsigned int data_offs, int data_size) { TiertexSeqFrameBuffer *seq_buffer; if (buffer_num >= SEQ_NUM_FRAME_BUFFERS) return AVERROR_INVALIDDATA; seq_buffer = &seq->frame_buffers[buffer_num]; if (seq_buf...
1threat
Remove jquery from JavaScript : I am new in the field of development, I develop an API with angularjs 2 using the janus media server, I have a problem with the start button, once I run my janus it starts the button automatically not manually , This is the function I used: // Use a button to start the demo ...
0debug
static int old_codec37(SANMVideoContext *ctx, int top, int left, int width, int height) { int stride = ctx->pitch; int i, j, k, t; int skip_run = 0; int compr, mvoff, seq, flags; uint32_t decoded_size; uint8_t *dst, *prev; compr = bytestream2_get_byte...
1threat
Angular 2: how to create radio buttons from enum and add two-way binding? : <p>I'm trying to use Angular2 syntax to create radio buttons from an enum definition, and bind the value to a property that has the type of that enum.</p> <p>My html contains:</p> <pre><code>&lt;div class="from_elem"&gt; &lt;label&gt;Moti...
0debug
@EnableResourceServer @EnableAuthorizationServer are deprecated? : <p>I am writing a simple application to test Oauth. But i see that both the annotations @EnableResourceServer @EnableAuthorizationServer were deprecated!</p> <p>I don't find an alternative way to deal with it and I don't find any info anywhere.</p> <p...
0debug
static void do_info(int argc, const char **argv) { term_cmd_t *cmd; const char *item; if (argc < 2) goto help; item = argv[1]; for(cmd = info_cmds; cmd->name != NULL; cmd++) { if (compare_cmd(argv[1], cmd->name)) goto found; } help: help_cmd(argv[0...
1threat
static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, const uint8_t **buf, int buf_size) { MpegEncContext *s = &s1->mpeg_enc_ctx; AVCodecContext *avctx= s->avctx; const int field_pic= s->picture_structure != PICT_FRAME; const int lowres= s->avctx->lowres; s->...
1threat
static void bufp_free(USBRedirDevice *dev, struct buf_packet *bufp, uint8_t ep) { QTAILQ_REMOVE(&dev->endpoint[EP2I(ep)].bufpq, bufp, next); dev->endpoint[EP2I(ep)].bufpq_size--; free(bufp->data); g_free(bufp); }
1threat
MemoryRegionSection *phys_page_find(AddressSpaceDispatch *d, hwaddr index) { PhysPageEntry lp = d->phys_map; PhysPageEntry *p; int i; for (i = P_L2_LEVELS - 1; i >= 0 && !lp.is_leaf; i--) { if (lp.ptr == PHYS_MAP_NODE_NIL) { return &phys_sections[phys_section_unassigned]; ...
1threat
Cordova / Ionic creates <allow-navigation> garbage in config.xml on each run : <p>When running an app with Ionic and live reload enabled it automatically adds a new <code>allow-navigation</code> entry to config.xml with my local IP address and port in there.</p> <p>After some time this results in a lot of garbage in c...
0debug
How to define a mathematical function in SymPy? : <p>I've been trying this now for hours. I think I don't understand a basic concept, that's why I couldn't answer this question to myself so far.</p> <p>What I'm trying is to implement a simple mathematical function, like this:</p> <pre><code>f(x) = x**2 + 1 </code></p...
0debug
complex JavaScript object : <p>I have 3 Javascript arrays:</p> <pre><code>array1 = ["data", "data1", "data2"] array2 = ["data", "data1", "data2"] array3 = ["data", "data1", "data2"] </code></pre> <p>How can I combine them all, so that I can simply run a single loop and retrieve values from them.</p> <pre><code>for (...
0debug
How to implement map instead of for loop in javascript : > I have two json arrays(req[],res[]) which need to be compared and the differences should display in log,for this I am using for loop,But i want to use map for solving this problem. Note: Need to sort both the arrays first for(var i=0...
0debug
static void decode_v1_vector(CinepakEncContext *s, AVPicture *sub_pict, mb_info *mb, strip_info *info) { int entry_size = s->pix_fmt == AV_PIX_FMT_YUV420P ? 6 : 4; sub_pict->data[0][0] = sub_pict->data[0][1] = sub_pict->data[0][ sub_pict->linesize[0]] = sub_pict->d...
1threat
static int libgsm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { int ret; gsm_signal *samples = (gsm_signal *)frame->data[0]; struct gsm_state *state = avctx->priv_data; if ((ret = ff_alloc_packet2(avctx, avpkt, av...
1threat
static int nbd_negotiate_options(NBDClient *client, uint16_t myflags, Error **errp) { uint32_t flags; bool fixedNewstyle = false; bool no_zeroes = false; if (nbd_read(client->ioc, &flags, sizeof(flags), errp) < 0) { erro...
1threat
static int mp_decode_frame(MPADecodeContext *s, short *samples) { int i, nb_frames, ch; short *samples_ptr; init_get_bits(&s->gb, s->inbuf + HEADER_SIZE, s->inbuf_ptr - s->inbuf - HEADER_SIZE); if (s->error_protection) get_bits...
1threat
C: non-NULL terminated unsigned char * : I saw [here][1] that it isn't possible to find out an unsigned char * length using strlen if it isn't NULL terminated, since the strlen function will go over the string but won't find any '\0', hence a run-time error. I figure that it is exactly the same for signed char *. I ...
0debug
static int usb_host_update_interfaces(USBHostDevice *dev, int configuration) { int dev_descr_len, config_descr_len; int interface, nb_interfaces, nb_configurations; int ret, i; if (configuration == 0) return 1; i = 0; dev_descr_len = dev->descr[0]; if (dev_descr_len > d...
1threat
static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt) { MOVMuxContext *mov = s->priv_data; MOVTrack *trk = &mov->tracks[pkt->stream_index]; AVCodecParameters *par = trk->par; int64_t frag_duration = 0; int size = pkt->size; if (mov->flags & FF_MOV_FLAG_FRA...
1threat
RegExp to search words starts with numbers and special characters only using C# : <p>I want to perform a search to C# list object to find all products starts with any number or special characters only. I am looking for a Regular expressions for this scenario.</p> <p>Please help </p>
0debug
What are docValues in Solr? When should I use them? : <p>So, I have read multiple sources that try to explain what 'docValues' are in Solr, but I don't seem to understand when I should use them, especially in relation to indexed vs stored fields. Can anyone please throw some light on it?</p>
0debug
Androis studio not openning in my laptop : [after installed i open that android studio but it is not opening. Please provide some help.thank you][1] [1]: https://i.stack.imgur.com/SwlvD.jpg
0debug
static int bdrv_check_request(BlockDriverState *bs, int64_t sector_num, int nb_sectors) { if (nb_sectors < 0 || nb_sectors > BDRV_REQUEST_MAX_SECTORS) { return -EIO; } return bdrv_check_byte_request(bs, sector_num * BDRV_SECTOR_SIZE, ...
1threat
static QObject *parse_value(JSONParserContext *ctxt, va_list *ap) { QObject *token; token = parser_context_peek_token(ctxt); if (token == NULL) { parse_error(ctxt, NULL, "premature EOI"); return NULL; } switch (token_get_type(token)) { case JSON_LCURLY: retu...
1threat
Helper function to return size of a custom object in java : <p>This is an interview question: There is a custom PERSON object which have some properties like name, age, gender, etc. Write a generic function which can return the size of this object. It should not use any direct API of Java to get the size of Object. Thi...
0debug
How to tell if a "ZipArchiveEntry" is directory? : <p>I am handling some 3rd party ZIP files with .Net 4.5.2 System.IO.Compression.ZipArchive class and all works nicely.<br> However, I need to tell apart <strong>file entries</strong> from <strong>directory entries</strong>, preferably without extracting them first.</p>...
0debug
static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct, float *out, float X[2][38][64], float mdct_buf[2][64], float *v0, int *v_off, const unsigned int div) { int i, n; const float *sbr_qmf_window = div ? s...
1threat
Error handling when calling .bat within .bat : I am trying call a .bat file from within a .bat file. This is how the call is invoked : call %FWK_DIR%\run_sqlldr_process.bat !ldr!.ctl !log!.log !bad!.bad !data!.dat %BATCHUSER% %BATCHPWD% %ORACLE_SID% echo %ERRORLEVEL% echo %RC% There is a failure inside run_s...
0debug
static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; int64_t ret; uint8_t uuid[16]; static const uint8_t uuid_isml_manifest[] = { 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd, 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, ...
1threat
Why using the symbol "$" in Angular : <p><a href="https://i.stack.imgur.com/p7705.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p7705.png" alt="enter image description here"></a></p> <p>Based on the picture with the white selection.</p> <p>I don't understand why you need to use the symbol "$". (<...
0debug
Image processing using matlab : I have a question for you I have 10 gray images and I would like for each image the mean gray value and standard deviation but not for the whole picture ... but for each pixel in the image the mean gray value and the standard deviation thank you in advance
0debug
int event_notifier_get_fd(EventNotifier *e) { return e->fd; }
1threat
static int rscc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { RsccContext *ctx = avctx->priv_data; GetByteContext *gbc = &ctx->gbc; GetByteContext tiles_gbc; AVFrame *frame = data; const uint8_t *pixels, *raw; uint...
1threat
How to delete 1 random row at a time in Oracle database : I am working on a project where I need to delete a random row in Oracle database,which query should be fired for that.?
0debug
Create Integer List of Lists in C : <p>I would like to create an integer list in C containing integer arrays of variable size. The length of the main list will not need to change.</p> <p>How would I declare it - my implementation - particularly my access is not working:</p> <pre><code>int dataArray[length]; int dataA...
0debug
Splitting datime in PHP : I am doing project to school and need something like this in PHP. I have 2 datetime value: $begin = new DateTime( "2015-07-03 12:00:00" ); $end = new DateTime( "2015-07-04 14:00:00" ); and I need to split it to this result: val11 = 2015-07-03 12:00:00; val12 = 2...
0debug
static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req) { uint32_t dw10 = le32_to_cpu(cmd->cdw10); uint32_t result; switch (dw10) { case NVME_VOLATILE_WRITE_CACHE: result = blk_enable_write_cache(n->conf.blk); break; case NVME_NUMBER_OF_QUEUES: ...
1threat
saparate object to array of object : <p>i dont know how to make for loop to create new array of object with javascript coding</p> <p>here i have some object like this</p> <pre><code>item :[ { res_name: 'a', id: 1, name: name1 }, { res_name: 'b', id: 2, name: name2 }, { res_name: 'b', id: 3, name: name3 } ] <...
0debug
static void disable_device(PIIX4PMState *s, int slot) { s->ar.gpe.sts[0] |= PIIX4_PCI_HOTPLUG_STATUS; s->pci0_status.down |= (1 << slot); }
1threat
void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_t *segment, uint8_t *ref, int layout, int is_vp7) { VP56RangeCoder *c = &s->c; static const char *vp7_feature_name[] = { "q-index", "lf-delta", ...
1threat
Method that returns Task<string> : <p>I need a method that returns a <code>Task&lt;string&gt;</code> with empty string like</p> <pre><code>public static Task&lt;string&gt; AsyncTest() { return new Task&lt;string&gt;(() =&gt; string.Empty); //problem here // this method would work: // return new Web...
0debug
void scsi_req_unref(SCSIRequest *req) { assert(req->refcount > 0); if (--req->refcount == 0) { BusState *qbus = req->dev->qdev.parent_bus; SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qbus); if (bus->info->free_request && req->hba_private) { bus->info->free_request(bus, r...
1threat
Primitive Data Types - BYTE in Java : <p>Can you help me explain more detail about this sentence:</p> <p>"BYTE: They can also be used in place of int where their limits help to clarify your code; the fact that a variable's range is limited can serve as a form of documentation." Source:<a href="https://docs.oracle.com/...
0debug
static int crc_write_packet(struct AVFormatContext *s, int stream_index, const uint8_t *buf, int size, int64_t pts) { CRCState *crc = s->priv_data; crc->crcval = adler32(crc->crcval, buf, size); return 0; }
1threat
static int hdcd_scan(HDCDContext *ctx, hdcd_state_t *state, const int32_t *samples, int max, int stride) { int cdt_active = 0; int result; if (state->sustain > 0) { cdt_active = 1; if (state->sustain <= max) { state->control = 0; max = state->sustain; ...
1threat
SWIFT BEGINNER: How to assign values to deck of cards images and then compare them : How can I assign values to a deck of cards? Like A is high and 2 is low with images named c-2 to c-53? This is my code so far, so I need to assign values to the numbers and also colours of the specific cards images(4 colours), and t...
0debug
How does Python assign variables simultaneously? : There I was, all this time, under the impression that `a, b, c = c, a, b` is the same as `a, c, b = c, b, a`... I thought this was a way to assign variables at the same time so you don't have to create a bunch of temp vars. But apparently they're different because one ...
0debug
static void slirp_receive(void *opaque, const uint8_t *buf, size_t size) { #ifdef DEBUG_SLIRP printf("slirp input:\n"); hex_dump(stdout, buf, size); #endif slirp_input(buf, size); }
1threat
DIsplaying a php variable inside js : I must start by saying I'm a complete js noob but I've spent a big portion of today solving this with all the answers I found here + google, couldn't get it done, so I decided to ask for a direct help. Basically, I want to embed an Youtube video in a php page. The videoid variab...
0debug
Is there a way to generate an empty Html node in Elm-Html? : <p>I'm writing a function that displays error messages, so in my view, I have something like </p> <pre><code>div [] [ displayErrors model ] </code></pre> <p>in the event that there are no errors, how can I make displayErrors return something that is interpr...
0debug
QBool *qobject_to_qbool(const QObject *obj) { if (qobject_type(obj) != QTYPE_QBOOL) return NULL; return container_of(obj, QBool, base); }
1threat
void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *info) { host_to_target_siginfo_noswap(tinfo, info); tswap_siginfo(tinfo, tinfo); }
1threat
static void close_connection(HTTPContext *c) { HTTPContext **cp, *c1; int i, nb_streams; AVFormatContext *ctx; URLContext *h; AVStream *st; cp = &first_http_ctx; while ((*cp) != NULL) { c1 = *cp; if (c1 == c) { *cp = c->next; } else { ...
1threat