problem
stringlengths
26
131k
labels
class label
2 classes
static int sysctl_oldcvt(void *holdp, size_t holdlen, uint32_t kind) { switch (kind & CTLTYPE) { case CTLTYPE_INT: case CTLTYPE_UINT: *(uint32_t *)holdp = tswap32(*(uint32_t *)holdp); break; #ifdef TARGET_ABI32 case CTLTYPE_LONG: case CTLTYPE_ULONG: *(uint32_t *)hol...
1threat
def check_Odd_Parity(x): parity = 0 while (x != 0): x = x & (x - 1) parity += 1 if (parity % 2 == 1): return True else: return False
0debug
How create app to app communication in c#? : <p>I have problem, because I can send data from program for example program1 to program2. I see that can use events, observer but the problem is how. </p> <p>Sorry but I not have any code.</p> <p>Can anybody take here example or link for help to understand events and obse...
0debug
What is format of object JS? : <p>There is an array:</p> <pre><code>var data = data.addRows([ ['Nitrogen', 0.78], ['Oxygen', 0.21], ['Other', 0.01] ]); </code></pre> <p>What does it mean? Arrays in array? What is it <code>['Nitrogen', 0.78]</code> ? Why <code>[]</code> brackets?</p> <p>...
0debug
how to pass varibale from HTML page to nodejs : I have a requirement where i want to pass variable from HTML to nodejs.Requirement is as below: 1) I have different hyperlink of different areas like Newcastle, Dudley, Belfast. 2) for now i'm calling my nodejs code by passing /Newcastle or /Dudley or /Belfast 3) Now ...
0debug
const char *get_feature_xml(CPUState *env, const char *p, const char **newp) { extern const char *const xml_builtin[][2]; size_t len; int i; const char *name; static char target_xml[1024]; len = 0; while (p[len] && p[len] != ':') len++; *newp = p + len; name = ...
1threat
How to reference Boolean java class from kotlin? : <p>As far as I understand <code>Boolean::class.java</code> gives me <code>Boolean.TYPE</code>, but not <code>Boolean.class</code></p>
0debug
returning a value from a column if row number equals to a given value : <p>I have a dataframe with two columns, let's call them "value" and "diff". The column diff contains random row numbers. I would like to create a vector by selecting values from the column "value" satisfying one condition, namely finding the value ...
0debug
Why does -u mean remember for git push [-u] : In the manual it states that `-u` will tell git to remember where to push to. However, I think this is a strange abbreviation. `-r` would make more sense. It works fine I'm just wondering where these abbreviations come from. Any one?
0debug
void ppc40x_chip_reset (CPUState *env) { target_ulong dbsr; printf("Reset PowerPC chip\n"); cpu_ppc_reset(env); dbsr = env->spr[SPR_40x_DBSR]; dbsr &= ~0x00000300; dbsr |= 0x00000200; env->spr[SPR_40x_DBSR] = dbsr; cpu_loop_exit(); }
1threat
How to use the Jenkins MSBuild plug-in in a Jenkinsfile? : <p>I have Jenkins v2.60.3 with the <a href="http://wiki.jenkins-ci.org/display/JENKINS/MSBuild+Plugin" rel="noreferrer">MSBuild Plugin</a> v1.27 installed on Windows.</p> <p>I have configured the path to my <code>msbuild.exe</code> in Jenkins' Global Tool Conf...
0debug
void do_tlbwi (void) { mips_tlb_flush_extra (env, MIPS_TLB_NB); invalidate_tlb(env->CP0_index & (MIPS_TLB_NB - 1), 0); fill_tlb(env->CP0_index & (MIPS_TLB_NB - 1)); }
1threat
can this have a better solution than the naive O(n*log(n)) approach. if yes can you please suggest an approach : you are given a string consisting of only 1's. eg: "11111111" you have an iterator that changes direction when it hits the extremes of the string. starting in the direction left to right. the iterator repl...
0debug
numpy array printing in desired manner : <p>I am using numpy array to fetch values from file and do calculations. The final output is like this <br> <code>('I', 10031, 'GASAS.SW', 2024, 23067, -501, -6760.1, 1, 125 )</code> <br> But i need it to be printed like this <br> <code>I 10031 GASAS.SW 2024 23067 -501 -6760.1 1...
0debug
static void vnc_dpy_copy(DisplayChangeListener *dcl, DisplayState *ds, int src_x, int src_y, int dst_x, int dst_y, int w, int h) { VncDisplay *vd = ds->opaque; VncState *vs, *vn; uint8_t *src_row; uint8_t *dst_row; i...
1threat
Pylint badge in gitlab : <p>Gitlab has functionality to generade badges about build status and coverage percentage.<br> Is it possible to create custom badge to display Pylint results? Or just display this results in README.md?<br> I already have CI job for Pylint</p>
0debug
Spring Data Redis Expire Key : <p>I have a One Spring Hibernate Application. In my application, Recently i am implemented Spring data Redis.</p> <pre><code>spring-servlet.xml &lt;!-- redis connection factory --&gt; &lt;bean id="jedisConnFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFac...
0debug
static int output_frame(H264Context *h, AVFrame *dst, Picture *srcp) { AVFrame *src = &srcp->f; int i; int ret = av_frame_ref(dst, src); if (ret < 0) return ret; av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0); if (!srcp->crop) return 0; ...
1threat
Singleton component cannot depend on scoped components : <p>While working on android application using dagger2 for dependency injects while defining dagger component I'm getting this error </p> <pre><code>Error:(13, 1) error: This @Singleton component cannot depend on scoped components: @Singleton com.eaxample.app.Dag...
0debug
Can i store words in file using python like this? : import random, sys from urllib import urlopen word_url = "http://scrapmaker.com/data/wordlists/dictionaries/rockyou.txt" words = [] for word in urlopen(word_url).readlines(): print "Doing it now..." wordlist = open('wordlist.txt', 'w') wordlist.wr...
0debug
tkinter interface need helf : i'm developing a graphical interface with tkinter , when i open file and send it , i want to see the scrolling instructions in label (Commande) To be more precise i do not know how to link this instruction (print ('Sending: ' + l)) with this instruction ( Label(Frame1, text="Commande...
0debug
static void eepro100_cu_command(EEPRO100State * s, uint8_t val) { eepro100_tx_t tx; uint32_t cb_address; switch (val) { case CU_NOP: break; case CU_START: if (get_cu_state(s) != cu_idle) { logout("CU state is %u, should be %u\n", get_c...
1threat
Python requests and BeautifulSoup4 .get('href') returning absoulte address : I'm trying to scrape the contents of `<a>` tags from a web page. My code is: from bs4 import BeautifulSoup import requests import sys reload(sys) sys.setdefaultencoding('utf-8') url = 'https://www.sa...
0debug
static void coroutine_fn stream_run(void *opaque) { StreamBlockJob *s = opaque; BlockDriverState *bs = s->common.bs; BlockDriverState *base = s->base; int64_t sector_num, end; int error = 0; int ret = 0; int n = 0; void *buf; s->common.len = bdrv_getlength(bs); if (s...
1threat
Cannot load a reference assembly for execution from a Web-Site project : <p>Using .NET 4.6.2 and an older Web-Site (not Web-Application) project. If I clear the BIN directory and then build and run it works, but sometimes after multiple builds and runs, it fails with this error.</p> <pre><code>Server Error in '/' Appl...
0debug
eclipse error cannot make a static reference to a non-static field : <p>import java.util.Scanner;</p> <p>public class Account { int number1,number2,sum;</p> <pre><code>public static void main(String[] args) { Scanner input = new Scanner (System.in); System.out.println("Enter your first number"); number...
0debug
static void init_mbr(BDRVVVFATState* s) { mbr_t* real_mbr=(mbr_t*)s->first_sectors; partition_t* partition = &(real_mbr->partition[0]); int lba; memset(s->first_sectors,0,512); real_mbr->nt_id= cpu_to_le32(0xbe1afdfa); partition->attributes=0x80; lba = sect...
1threat
Plugin with id 'androidx.navigation.safeargs' not found : <p>When I try to add Safe Args (Android Navigation) to my app's as following</p> <p>( using this guide : <a href="https://developer.android.com/topic/libraries/architecture/navigation/navigation-pass-data" rel="noreferrer">https://developer.android.com/topic/li...
0debug
static bool gen_check_loop_end(DisasContext *dc, int slot) { if (option_enabled(dc, XTENSA_OPTION_LOOP) && !(dc->tb->flags & XTENSA_TBFLAG_EXCM) && dc->next_pc == dc->lend) { int label = gen_new_label(); gen_advance_ccount(dc); tcg_gen_brcondi_i32(TCG_COND_EQ...
1threat
Testing EditText errors with Espresso on Android : <p>I want to test if an EditText field has an error (set with editText.setError("Cannot be blank!")).</p> <p><a href="https://i.stack.imgur.com/fipqA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fipqA.png" alt="EditText field with error"></a></p> <p>I've...
0debug
can't get a:hover function in css/php to work : for some reason my browser with xampp (PHP) isn't giving a response to the hover command in this piece of code. how can i solve this to get my font to get a little color while hovering over with my mouse? .headermenu a{ font-size: 18px; color: #...
0debug
static void qemu_remap_bucket(MapCacheEntry *entry, target_phys_addr_t size, target_phys_addr_t address_index) { uint8_t *vaddr_base; xen_pfn_t *pfns; int *err; unsigned int i, j; target_phys_addr_t nb_pfn = size >> XC_PAGE_SHIFT; ...
1threat
Minimize function with parameters : <p>Currently I have the following code that defines the function <code>f</code>.</p> <pre><code>a = #something b = #something c = #something def f(x): """Evaluates some function that depends on parameters a, b, and c""" someNumber = #some calculation return someNumber </...
0debug
static int RENAME(epzs_motion_search2)(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int pred_x, int pred_y, uint8_t *src_data[3], uint8_t *ref_data[3], int stride, int uvstride, int16_...
1threat
Get current date and time from google in android : I have some experience in Android App development.Now we developed an Android Application where we need date and time from google or internet means exact time. Already I test some code from stack overflow and from some other sites but not work correctly. The App is cra...
0debug
void msix_load(PCIDevice *dev, QEMUFile *f) { unsigned n = dev->msix_entries_nr; unsigned int vector; if (!(dev->cap_present & QEMU_PCI_CAP_MSIX)) { return; } msix_free_irq_entries(dev); qemu_get_buffer(f, dev->msix_table_page, n * PCI_MSIX_ENTRY_SIZE); qemu_get_buffer(f...
1threat
'await Unexpected identifier' on Node.js 7.5 : <p>I am experimenting with the <code>await</code> keyword in Node.js. I have this test script:</p> <pre><code>"use strict"; function x() { return new Promise(function(resolve, reject) { setTimeout(function() { resolve({a:42}); },100); }); } await x(); </...
0debug
Access Form checkbox updates date in another table : I'm trying to make a form checkbox update a the date in another table. Private Sub Delivered_AfterUpdate() If Delivered = -1 Then [tool implentation].[date] = Now() End Sub This is code I have but it does not work. Does anyone have a suggestion...
0debug
How to create a table corresponding to enum in EF Core Code First? : <p>How would one turn the enums used in an EF Core database context into lookup tables and add the relevant foreign keys?</p> <hr> <ul> <li>Same as <a href="https://stackoverflow.com/q/11167665/10245">EF5 Code First Enums and Lookup Tables</a> but f...
0debug
Making an element in reverse side using css : <p>I want to make an element inside html to be displayed in reverse side or direction including images and text. See the image <img src="https://i.ibb.co/VCZTb4j/Screen-Shot-2019-03-25-at-11-22-37-AM.png" alt="normal"></p> <p>I expect to have as an example: <img src="https...
0debug
How to split string and map each character into dictionary : <p>Suppose i have a string like <code>'value=sahi'</code> and i want it like <code>{1:s,2:a,3:h,4:i}</code> is there any function to do like this.</p>
0debug
How can i make a carousel like this? : How can i make a carousel like this with UICollection view? [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/CY1qZ.png
0debug
int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix) { QEDCheck check = { .s = s, .result = result, .nclusters = qed_bytes_to_clusters(s, s->file_size), .request = { .l2_table = NULL }, .fix = fix, }; int ret; check.used_clusters = g_try_m...
1threat
Why is it reading from the file randomly? ( this is in C ) : #include <stdio.h> void readMatrices(FILE*numbers, int array[4][4], int array2[4][4]) /*this puts the numbers fomr the file into two matrices*/ { int i,j,num; for(i=0;i<4;i++) { for(j=0;j<4;j++) { fscanf(num...
0debug
the display function in linked list is not working properly : When i call the display function, the first element of linked list is printed twice. I do not know what is wrong with the code. Please help me to figure it out. The code is as follows: #include <iostream> using namespace std; class node{ ...
0debug
static void arm_cpu_do_interrupt_aarch32(CPUState *cs) { ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; uint32_t addr; uint32_t mask; int new_mode; uint32_t offset; uint32_t moe; switch (env->exception.syndrome >> ARM_EL_EC_SHIFT) { case EC_BREAKPOINT: ...
1threat
how to login to instagram on dev computer : <p>I am trying to create a wordpress plugin that will display images from my company's instagram account. My dev computer is on my desktop computer behind the company's firewall. My understanding (which could be wrong) is that the page will have to go to the instagram site to...
0debug
Why an application starts with FPU Control Word different than Default8087CW? : <p>Could you please help me to understand what is going on with FPU Control Word in my Delphi application, on Win32 platform.</p> <p>When we create a new VCL application, the control word is set up to 1372h. This is the first thing I don't...
0debug
Javascript/java is changing my leading spaces to questiom marks : I am using this inside of a minecraft mod to read and write file and all the leading space are being converted to ? in the file. **file input sample:** {    "ReturnToStart": "1b", **file out put sample:** { ???"ReturnToStart": "1b", <!-- begin s...
0debug
static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) { int i, j, k, cbp, val, mb_type, motion_type; const int mb_block_count = 4 + (1 << s->chroma_format); int ret; ff_tlog(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y); av_assert2(s->mb_skipped == 0); if (s->m...
1threat
static void send_qmp_error_event(BlockDriverState *bs, BlockErrorAction action, bool is_read, int error) { IoOperationType optype; optype = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE; qapi_event_send_block_io_error(bdr...
1threat
I am not able to click on filter on grid in selenium : I am giving the code below where i need to click on the filter icon. please help me out <thead class="k-grid-header" role="rowgroup"> <tr role="row"> <th class="k-header k-filterable k-with-icon" scope="col" data-title="User Name" data-index="0" dat...
0debug
static void virtio_serial_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->init = virtio_serial_init_pci; k->exit = virtio_serial_exit_pci; k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; k->device_id = PCI...
1threat
int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, int ts_start, int duration, int raw) { AVBPrint buf; int ret, dlen; AVSubtitleRect **rects; av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); if ((ret = ff_ass_bprint_dialog(&buf, dialog, ts_start, duration, raw))...
1threat
Is i=++i; undefined behavior? : <p>This is undefined behavior, right? Double assignment in the same sequence point?</p> <pre><code>int i = 0; i = ++i; </code></pre>
0debug
static int get_codec_data(AVIOContext *pb, AVStream *vst, AVStream *ast, int myth) { nuv_frametype frametype; if (!vst && !myth) return 1; while (!avio_feof(pb)) { int size, subtype; frametype = avio_r8(pb); switch (frametype) { ...
1threat
How to send push notifications to google firebase web application : Can anybody provide information on how to setup push notifications for a chrome web application? How to setup topics, create new topics, delete topics and what the syntax would be. I searched the internet using what tools we have and come up with...
0debug
void bdrv_io_unplugged_begin(BlockDriverState *bs) { BdrvChild *child; if (bs->io_plug_disabled++ == 0 && bs->io_plugged > 0) { BlockDriver *drv = bs->drv; if (drv && drv->bdrv_io_unplug) { drv->bdrv_io_unplug(bs); } } QLIST_FOREACH(child, &bs->children, ...
1threat
How to replace volumes_from in docker-composer v3 : <p>I want to know the equivalent of the configuration below to suit version 3 of docker-composer.yml! volumes_from is no longer valid so am I supposed to skip the data volume and replace it with top level volumes ?</p> <pre><code>version: '2' services: php: bu...
0debug
static void iscsi_close(BlockDriverState *bs) { IscsiLun *iscsilun = bs->opaque; struct iscsi_context *iscsi = iscsilun->iscsi; iscsi_detach_aio_context(bs); if (iscsi_is_logged_in(iscsi)) { iscsi_logout_sync(iscsi); } iscsi_destroy_context(iscsi); g_free(iscsilun->zeroblo...
1threat
static int vnc_update_client(VncState *vs, int has_dirty) { if (vs->need_update && vs->csock != -1) { VncDisplay *vd = vs->vd; int y; int n_rectangles; int saved_offset; int n; if (vs->output.offset && !vs->audio_cap && !vs->force_update) ...
1threat
void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top) { assert(!bdrv_requests_pending(bs_top)); assert(!bdrv_requests_pending(bs_new)); bdrv_ref(bs_top); change_parent_backing_link(bs_top, bs_new); bdrv_set_backing_hd(bs_new, bs_top); bdrv_unref(bs_top); ...
1threat
static int ogg_read_packet(AVFormatContext *s, AVPacket *pkt) { struct ogg *ogg; struct ogg_stream *os; int idx, ret; int pstart, psize; int64_t fpos, pts, dts; if (s->io_repositioned) { ogg_reset(s); s->io_repositioned = 0; retry: do { ret = og...
1threat
React Props is Not Defined : <p>I'm having trouble understanding why my props.updateBuilding is not working. </p> <p>The following works when the prop is within the render method </p> <pre><code>class Buildings extends Component { constructor(props) { super(props); } componentWillMount() { this.props...
0debug
html select option display value with empty color div and display value : i need the html select option dispaly value with empty color div and display value. how do we do that with html,js or jquery? i attached png value i need like that. Thanks.[this is what i need] [1]: https://i.stack.imgur.com/OysaJ...
0debug
Xpath: select div with grandchildren containing text : <p>How do you write the xpath to select the div with class tableRow that contains a nested div with the title <code>apple</code> as well as a nested span with the text <code>3.14</code>?</p> <pre><code>&lt;div class='tableRow'&gt; &lt;div class='tableCell'&gt; ...
0debug
Failure [INSTALL_CANCELED_BY_USER] on Xiaomi device : <p>I bought a Xiaomi Redmi 4x yesterday and I can't debug my apps in this device.</p> <p>I already enabled the Developer Options in the device, switch on to USB Debugging, install the USB Drivers and accepted the RSA debugging fingerprint pop that appears when I pl...
0debug
static int mace3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) { int16_t *samples = data; MACEContext *ctx = avctx->priv_data; int i, j, k; for(i = 0; i < avctx->channels; i++) { ...
1threat
static QOSState *pci_test_start(int socket) { const char *cmd = "-netdev socket,fd=%d,id=hs0 -device " "virtio-net-pci,netdev=hs0"; return qtest_pc_boot(cmd, socket); }
1threat
static void gen_check_sr(DisasContext *dc, uint32_t sr) { if (!xtensa_option_bits_enabled(dc->config, sregnames[sr].opt_bits)) { if (sregnames[sr].name) { qemu_log("SR %s is not configured\n", sregnames[sr].name); } else { qemu_log("SR %d is not implemented\n", sr); ...
1threat
Click the button and it sends that info into another box on the page : <p>I want to be able to click on a button then that puts that information into another part on the page (in a box). However, I want the ability to remove this from that box too. </p> <p>What is the best way to do this using html and javascript?</p>...
0debug
SQL Server where clause with two date : I use this query in my app **"SELECT * FROM Vi_WebReport WHERE Legajo=? AND ent>=? AND ent>=?"** So, legajo its a number thats identify one person. And ent its a date. The query works ok, but when i want to select only one day like: **SELECT * FROM Vi_WebReport WHERE Leg...
0debug
Appium IOS Get All Device ID that connrct to MAC : need help How do i call in my framework (In java) to “instruments -s devices” to Get all Device UDID that connect to the MAC and parse the result (UDID) to Array list ? Thanks !
0debug
For create this kind of product image functionality what i should use please : Here is aliexpress single product page. I want this kind of product page. actually the question is how i can create this kind of image fature. Like : When i hover a small image it load big image in same div. It only load when i hover or ...
0debug
Extract string values from mixed data types in list : I have a list of mixed data types and from that I want to access string into one single value. For instance, ['000000001', 'Aaron', 'Appindangoye', '26', '183', '84.8'] from here I want to get Aaron Appindangoye together. Need a help. Thank you in advance.
0debug
Is there an R functon for easily display text as in Question function : I need to present the user with some text as in the help function. The help function display the text in a convenient way (for example, in emacs it uses a new buffer, in terminal opens vim, etc). So, is there a function that receives the string and...
0debug
Do I really need to learn xml for android development? : <p>I am a Python programmer and I want to learn android app development. My million dollar question is, <strong>do I really need to learn xml?</strong> Can't I just use the design tab in android studio and drag n drop elements to make the design?</p>
0debug
static int64_t mkv_write_seekhead(AVIOContext *pb, MatroskaMuxContext *mkv) { AVIOContext *dyn_cp; mkv_seekhead *seekhead = mkv->main_seekhead; ebml_master metaseek, seekentry; int64_t currentpos; int i; currentpos = avio_tell(pb); if (seekhead->reserved_size > 0) { if (...
1threat
bool cpu_physical_memory_is_io(hwaddr phys_addr) { MemoryRegionSection *section; section = phys_page_find(address_space_memory.dispatch, phys_addr >> TARGET_PAGE_BITS); return !(memory_region_is_ram(section->mr) || memory_region_is_romd(section->mr)); }
1threat
clicking on buttom using httprequest in vbs : I WANT TO SIMULATE 'ie.document.getElementbyId("buttom_id").(0).click' IN XMLHTTPREQUEST, PLEASE HELP :( THEREFORE IN CLICKING THE BUTTOM : 1) RIGHT CLICK ON THE WEBPAGE AND SELECT 'INSPECT' 2) SELECT NETWORK TAB 3) COPY ALL AS HAR THIS INTERACT IS IN below: [HAR ...
0debug
Clears all the fields in Android Studio : I have 4 fields and 2 buttons, one of the buttons is reset, I want that when I click on the button it clears all the fields
0debug
void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip) { const ARMCPRegInfo *ri = rip; switch (ri->accessfn(env, ri)) { case CP_ACCESS_OK: return; case CP_ACCESS_TRAP: case CP_ACCESS_TRAP_UNCATEGORIZED: break; default: g_assert_not_reached()...
1threat
static av_cold int iv_alloc_frames(Indeo3DecodeContext *s) { int luma_width = (s->width + 3) & ~3, luma_height = (s->height + 3) & ~3, chroma_width = ((luma_width >> 2) + 3) & ~3, chroma_height = ((luma_height >> 2) + 3) & ~3, luma_pixels = luma_widt...
1threat
ask sql for multiplication two coloms and then division with sum of some rows : i have tables **scores** id name score item_id 1 rikad 90 1 2 rikad 80 2 3 rikad 70 3 4 reza 80 1 5 reza 80 2 6 reza 100 3 ---------- **items** id weight 1 0.5 2 0.2 3 0.3 --...
0debug
JaveScript: how to put things in the end of the call stack? : I am working in angular(2) and more and more I get into situation where I need to wait for angular to do its magic and then execute my code. all its actually means is just to put the action in the end of the call stack(which I achieve right now by setting ...
0debug
yuv2rgb48_2_c_template(SwsContext *c, const int32_t *buf[2], const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf[2], uint16_t *dest, int dstW, int yalpha, int uvalpha, int y, enum PixelFormat target) { ...
1threat
php how to get a random value between 2 users : i have selected two users with their id. eg: $user_one = 1034; $user_two = 1098; $new_id = ""; Now i want to select one user between these two users **Randomly**. Can someone please help me how to select random ids from given ids. eg: $new_id ...
0debug
static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt) { MP3Context *mp3 = s->priv_data; if (pkt->data && pkt->size >= 4) { MPADecodeHeader c; int av_unused base; avpriv_mpegaudio_decode_header(&c, AV_RB32(pkt->data)); if (!mp3->initial_bitrate) ...
1threat
How to update object in React state : <p>I have an indexed list of <code>users</code> in the JS object (not array). It's part of the React state.</p> <pre><code>{ 1: { id: 1, name: "John" } 2: { id: 2, name: "Jim" } 3: { id: 3, name: "James" } } </code></pre> <p>What's the best practice to:</p> <ol> <li>...
0debug
static void spapr_add_lmbs(DeviceState *dev, uint64_t addr_start, uint64_t size, uint32_t node, bool dedicated_hp_event_source, Error **errp) { sPAPRDRConnector *drc; sPAPRDRConnectorClass *drck; uint32_t nr_lmbs = size/SPAPR_MEMORY_BLOCK_SIZE; ...
1threat
Unable to find current origin/master revision in submodule path : <p>In my project (which uses <code>git</code>), I need to use <a href="https://github.com/mb21/JSONedit" rel="noreferrer">a library</a>, which is still in progress. I decided to create a submodule for that library, because I want to update from time to t...
0debug
Member function invocation through object : <p>I just to understand the logic behind this code. When member function is not part of the object then how does the compiler invokes the function. Somehow the compiler needs to know the address of the function to invoke. Where it gets the address of the right function.I know...
0debug
Automatically check bounds in std::vector : <p>During active development of a class that uses <code>std::vector</code>, it often happens that an index is out of bounds. (See <a href="https://codereview.stackexchange.com/questions/183930">this code review question</a> for a practical example.) When using <code>operator[...
0debug
how to delete an element from a struct? : I Would like you to help me in a homework we got from our teacher. My question is the following: Can you help me in correcting my ddelete method (function)? Oh and please don't mark it as a duplicate, because don't think that there's a solution out there to my problem. (I'm s...
0debug
Confused about Directory.GetFiles : <p>I've read the docs about the <code>Directory.GetPath</code> search pattern and how it is used, because I noticed that <code>*.dll</code> finds both <code>test.dll</code> and <code>test.dll_20170206</code>. That behavior is documented</p> <p>Now, I have a program that lists files ...
0debug
My sql query is giving me a error can any one help me? : $query = " SELECT * FROM comments WHERE comment_post_id = {$The_post_id} AND comment_status= 'approved' "; error is errorYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '...
0debug
static void do_fp_st(DisasContext *s, int srcidx, TCGv_i64 tcg_addr, int size) { TCGv_i64 tmp = tcg_temp_new_i64(); tcg_gen_ld_i64(tmp, cpu_env, fp_reg_offset(srcidx, MO_64)); if (size < 4) { tcg_gen_qemu_st_i64(tmp, tcg_addr, get_mem_index(s), MO_TE + size); } else { TCGv_i...
1threat
static int rdma_delete_block(RDMAContext *rdma, RDMALocalBlock *block) { RDMALocalBlocks *local = &rdma->local_ram_blocks; RDMALocalBlock *old = local->block; int x; if (rdma->blockmap) { g_hash_table_remove(rdma->blockmap, (void *)(uintptr_t)block->offset); } if (block->pmr) {...
1threat
Why does NumberFormatter's string(from:) return an optional? : <p><a href="https://developer.apple.com/documentation/foundation/numberformatter/1418046-string" rel="noreferrer">Documentation link</a></p> <p>Why does the <code>NumberFormatter</code> function <code>func string(from number: NSNumber) -&gt; String?</code>...
0debug
Cut line shortcut in Visual Studio Code (Ctrl+L in VS) (not delete line!) : <p>Visual Studio has by default the shortcut Ctrl+l (cut line). It copies the line where the cursor is to the clipboard and deletes it.</p> <p>I cannot find it in Visual Studio Code. Is there a way to add it as end user?</p> <p>(I know there ...
0debug