problem
stringlengths
26
131k
labels
class label
2 classes
static bool net_tx_pkt_rebuild_payload(struct NetTxPkt *pkt) { size_t payload_len = iov_size(pkt->raw, pkt->raw_frags) - pkt->hdr_len; pkt->payload_frags = iov_copy(&pkt->vec[NET_TX_PKT_PL_START_FRAG], pkt->max_payload_frags, pkt->raw, pkt->...
1threat
linux unix regex : Trying to extract the digit bewtween the parenthesis (AA) and modify (expl: times 300 ) and update the old value (AA) using the new value which is (AA*300) in the whole text. Exmp text: RRRR TTTTYYY (22); UUUUUUU IIIIII4 (55);
0debug
R: readr: is it possible to read HTML tables using this package : <p>I want to know if we can reach html tables using readr package with the url of the page where html table is published. For example, I want to import table on the <a href="http://sports.yahoo.com/nfl/stats/byteam?group=Offense&amp;cat=Total&amp;confer...
0debug
Javascript. Need error box if no question mark is input : I'm new to javascript. I need some help with the following project. I'm doing a magic 8 ball and need to display the following: If the same question is asked twice in a row, or if the question doesn’t end with a “?”, give appropriate error messages using the ...
0debug
static int scsi_disk_emulate_start_stop(SCSIDiskReq *r) { SCSIRequest *req = &r->req; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev); bool start = req->cmd.buf[4] & 1; bool loej = req->cmd.buf[4] & 2; if (s->qdev.type == TYPE_ROM && loej) { if (!start && !s->tray_open ...
1threat
static void guess_mv(MpegEncContext *s) { uint8_t *fixed = av_malloc(s->mb_stride * s->mb_height); #define MV_FROZEN 3 #define MV_CHANGED 2 #define MV_UNCHANGED 1 const int mb_stride = s->mb_stride; const int mb_width = s->mb_width; const int mb_height = s->mb_height; int i, depth, nu...
1threat
static abi_long do_accept(int fd, abi_ulong target_addr, abi_ulong target_addrlen_addr) { socklen_t addrlen; void *addr; abi_long ret; if (get_user_u32(addrlen, target_addrlen_addr)) return -TARGET_EFAULT; if (addrlen < 0) return -TARGET_EINVAL;...
1threat
Where to find some real programming assignments for a beginner webdev? : <p><strong>Hello, folks!</strong></p> <p>So here I am - a total beginner in webdev without any profound education on the topic, but still aiming to get a real webdev job sometime soon. </p> <p>And while the assignments in the courses I've taken ...
0debug
How to disable IntelliSense in VS Code for Markdown? : <p>I don't want word completion for Markdown files in Visual Studio Code, how do I disable it? Ideally, for Markdown only but in the worst case, even a global switch would be good.</p>
0debug
static void gd_update_caption(GtkDisplayState *s) { const char *status = ""; gchar *title; if (!runstate_is_running()) { status = " [Stopped]"; } if (qemu_name) { title = g_strdup_printf("QEMU (%s)%s", qemu_name, status); } else { title = g_strdup_printf("QE...
1threat
Google Maps in React-Native (iOS) : <p>My goal is to display a Google Map in React Native. I have seen examples that use the Google Maps SDK with an UIMapView or a MapBox map, but that is not what I am looking for.</p> <p>I currently have no errors. Here is my code:</p> <p>index.ios.js</p> <pre><code>'use strict'; i...
0debug
Error in an array, java.lang.NullPointerException : <p>So, i'm using an array in my program, and it gives me this error:</p> <p><code>Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException</code></p> <p>The error is in fourth line of this code: </p> <pre><code>int n = numbers.length, numBigger10 = 0; ...
0debug
static Suite *qfloat_suite(void) { Suite *s; TCase *qfloat_public_tcase; s = suite_create("QFloat test-suite"); qfloat_public_tcase = tcase_create("Public Interface"); suite_add_tcase(s, qfloat_public_tcase); tcase_add_test(qfloat_public_tcase, qfloat_from_double_test); tcase_add...
1threat
static int cook_decode_close(AVCodecContext *avctx) { int i; COOKContext *q = avctx->priv_data; av_log(NULL,AV_LOG_DEBUG, "Deallocating memory.\n"); av_free(q->mlt_window); av_free(q->mlt_precos); av_free(q->mlt_presin); av_free(q->mlt_postcos); av_free(q->frame_reorder_...
1threat
Algorithm to find ideal starting spot in a circle : <p>So the problem I have been debating is as such:</p> <p>Your are given an array of integers representing a circle. Then, you have to pick spot in the circle to start. From the place you start, you compare the value at the array to number of steps you took to get th...
0debug
static void scsi_write_complete_noio(SCSIDiskReq *r, int ret) { uint32_t n; assert (r->req.aiocb == NULL); if (r->req.io_canceled) { scsi_req_cancel_complete(&r->req); goto done; } if (ret < 0) { if (scsi_handle_rw_error(r, -ret, false)) { goto don...
1threat
Can you use a service worker with a self-signed certificate? : <p>I have developer server that are used for testing. They have SSL self-signed certificates, which allow us to test the web application over HTTPS, but with prominent warnings that the certificates are not verifiable.</p> <p>That's fine, but I have a Serv...
0debug
display input text error message as when using the required attribute : <p>I would like to know if you can create a javascript function that allows you to activate and then display an error message around the input text as when you do submit leaving the input blank and you have the required attribute.</p> <p>a message...
0debug
static void qemu_rdma_dump_gid(const char *who, struct rdma_cm_id *id) { char sgid[33]; char dgid[33]; inet_ntop(AF_INET6, &id->route.addr.addr.ibaddr.sgid, sgid, sizeof sgid); inet_ntop(AF_INET6, &id->route.addr.addr.ibaddr.dgid, dgid, sizeof dgid); DPRINTF("%s Source GID: %s, Dest GID: %s\n"...
1threat
Search form slow show [html] : <p>Anyone can help me create search form like this:</p> <pre><code>http://gledanjefilmova.net/ </code></pre> <p>I know there is some elements in css but I forgot which was...</p>
0debug
Reload current page in Aurelia : <p>I have an <a href="http://www.aurelia.io">Aurelia</a> application where the user can select the company they're currently "working on". Every page in the app is dependent on the currently selected company, and the user can select a new company from a drop-down menu. The drop-down is ...
0debug
How to remove lines from File A that are in File B using Windows powershell : <p><a href="https://stackoverflow.com/questions/19816914/how-to-join-two-text-files-removing-duplicates-in-windows">This other question</a> is excellent for joining two files. I need to do sort of the opposite. I need to remove lines from F...
0debug
static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { LibvorbisContext *s = avctx->priv_data; ogg_packet op; int ret, duration; if (frame) { const int samples = frame->nb_samples; ...
1threat
Python Programming Help- Strings/Parameter : I am very new to python, and I am trying to create a simple function that allows me to return a string reversed. However, when I called the function, the error TypeError: reverseString() takes 1 positional argument but 2 were given comes up. Im more familiar with java, and ...
0debug
static void i386_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *dc = container_of(dcbase, DisasContext, base); target_ulong pc_next = disas_insn(dc, cpu); if (dc->tf || (dc->base.tb->flags & HF_INHIBIT_IRQ_MASK)) { dc->base.is_jmp = DISAS_...
1threat
How to parse a String like "14px" to get Int value 14 in Swift : <p>I receive from a server API a String like "14px". How to transform this String to Int with value 14 ignoring substring "px"?</p>
0debug
Update TSLint Errors : Could not find implementations for the following rules specified in the configuration : <p>I upgraded my tslint to 4.0.2 and now I get a lot of errors like the following</p> <pre><code>Could not find implementations for the following rules specified in the configuration: directive-selector-n...
0debug
how to do a smoth scoll down a page with javascript : so im trying to make the for loop increase the height by 1 each loop which will make the screen drop by the height of one. Using a time interval for a very short amount of time I would believe this would make a smooth scroll down the page.
0debug
int qemu_signalfd(const sigset_t *mask) { #if defined(CONFIG_signalfd) int ret; ret = syscall(SYS_signalfd, -1, mask, _NSIG / 8); if (ret != -1) return ret; #endif return qemu_signalfd_compat(mask); }
1threat
How to convert alphabets to numerical values with spaces and retain it back to alphabets using Matlab? : Want to convert the alphabet to numerical values and transform it back to alphabets using some mathematical techniques like fast fourier transform in matlab
0debug
Calling Firebase Analytic's getInstance() every time vs. storing instance as a static variable in Application class : <p>I'm trying decide which of the following is the proper way to do this:</p> <ol> <li>Calling <code>FirebaseAnalytics.getInstance(Context)</code> from every activity, fragment, and service that I'm lo...
0debug
JavaNullPointer Exception on ArrayList Add Function : <p>Hope you are doing well</p> <p>i am facing issue while adding object to ArrayList i need your kind assistance in solving this problem each time when i am going to add something to selectedContacts ArrayList i got nullPointerException</p> <pre><code>ArrayList&lt...
0debug
Find time duration between tow times with am pm selecton : I have three dropdown lists for selecting start time and another three for selecting end time .I want asp.net program which will give duration between two time and after i entered start time then end time should be greater than start time .first dropdown list c...
0debug
Do I need to create a new SQLite database every time an application is updated? : <p>I have a Xamarin Forms application I would like to develop. It will have a SQLite database and I wish to make this available on iOS and Android. The database will be populated with data from a SQL Server database on the cloud with ini...
0debug
react-native ios Podfile issue with "use_native_modules!" : <p>In my react-native project (react-native@0.60) in the ios/ dir I run <code>pod install</code> and get this error:</p> <pre><code>[!] Invalid `Podfile` file: no implicit conversion of nil into String. # from /Users/coryrobinson/projects/hhs2/ios/Podfile:...
0debug
React Router VS Conditional Rendering : <p>I am confused about the core difference (especially regarding performance) between using React Router and regular conditional rendering approach. What I mean "regular conditional rendering approach" is, for example:</p> <p>we can set a state in parent component, and pass it a...
0debug
static uint16_t phys_section_add(MemoryRegionSection *section) { if (phys_sections_nb == phys_sections_nb_alloc) { phys_sections_nb_alloc = MAX(phys_sections_nb_alloc * 2, 16); phys_sections = g_renew(MemoryRegionSection, phys_sections, phys_sections_nb_alloc); } ...
1threat
static double get_volume(CompandContext *s, double in_lin) { CompandSegment *cs; double in_log, out_log; int i; if (in_lin < s->in_min_lin) return s->out_min_lin; in_log = log(in_lin); for (i = 1;; i++) if (in_log <= s->segments[i + 1].x) break; ...
1threat
Printing a character multiple times in a for loop : <p>I want to use printf and for loop to print a character multiple times per line depending on the input; i.e. if the input is 3 i want to print:</p> <pre><code>a aa aaa </code></pre> <p>this is the loop, which doesn't work at all.</p> <pre><code>for (int i = 0; i ...
0debug
db.execute('SELECT * FROM employees WHERE id = ' + user_input)
1threat
How to pass a class as an argument to another classes constructor? : <p>The problem i get is inside Person.cpp , in the constructor.When i do this ,everything works ok </p> <pre><code>Person::Person(string n,Birthday b) : name(n) , birthday(b) {} </code></pre> <p>when i do this , i get errors...</p> <pre><cod...
0debug
static void rv40_v_loop_filter(uint8_t *src, int stride, int dmode, int lim_q1, int lim_p1, int alpha, int beta, int beta2, int chroma, int edge){ rv40_adaptive_loop_filter(src, 1, stride, dmode, lim_q1, lim_p1, alpha, b...
1threat
Listeners in php : <p>Is there anyway to make a listener for any update happens in database (mysql) using php? for example. if you make any update in database (change an entry or element) it will notify you or make a specific function.</p>
0debug
Move change each element in a string and a coditional if arr[i-1]=='n'.... do : problem take a string move every character in the alphabet 13 times forward for example hello would be **uryyb**, but the trick here is that if there is a vowel in the element before then its 14 spaces so it would be **urzyb**, I got the 14...
0debug
Error in is.data.frame(x) : object file name' not found : pls, i dont know why always fail when i save my work #menentukan tempat penyimpanan setwd("C:/Users/Child-PC/Documents/Doc/Kerja/Jakarta Smart City/Data/CRM/CRM (Files) Mei 2019/R Function") #menyimpan data ke csv write.csv(nilai_data, file="nilai_data.c...
0debug
static gboolean io_watch_poll_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) { return g_io_watch_funcs.dispatch(source, callback, user_data); }
1threat
Connection closed by EC2 IP - port 22 : <p>Below is the security group(first one) applied to EC2 instance.</p> <h2><a href="https://i.stack.imgur.com/XCthf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XCthf.png" alt="enter image description here"></a></h2> <p>Rules for this security group is:</p...
0debug
int ff_h2645_extract_rbsp(const uint8_t *src, int length, H2645NAL *nal) { int i, si, di; uint8_t *dst; nal->skipped_bytes = 0; #define STARTCODE_TEST \ if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { ...
1threat
static av_always_inline int setup_classifs(vorbis_context *vc, vorbis_residue *vr, uint8_t *do_not_decode, unsigned ch_used, int partition_count...
1threat
status bar disappeared after full screen video in WKWebView only in iOS 12 : <p>As you can see this only happened in iOS 12.</p> <p>iOS 12 &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; &emsp;&emsp;iOS 11 </p> <p><a href="https://i.stack.imgur.com/XLq2T.gif" rel="noreferrer"><img src="https://i.stac...
0debug
Why this R ggplot subscript is not working? : <p>Code where trying to apply <code>g + labs(y=expression(N_{s}))</code> with the following error which does not make sense</p> <pre><code>g &lt;- ggplot(datm, aes(variable, value, fill=gender)) + geom_bar(stat="identity", position = position_dodge()) + facet_grid(male.Nij...
0debug
int opt_default(void *optctx, const char *opt, const char *arg) { const AVOption *o; int consumed = 0; char opt_stripped[128]; const char *p; const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class(); const av_unused AVClass *rc_class; const AVClass *sc, *swr_class; ...
1threat
SQL Sever: max of date : Table 1 -------- RefId ----- 1 2 Table 2 -------- RefId Date ----- ----- 1 29/03/2018 07:15 1 29/03/2018 07:30 2 29/03/2018 07:35 2 29/03/2018 07:40 i would like the result to be as follows...
0debug
How to disable auto-quotes and auto-brackets in Jupyter 5.0 : <p>I upgraded Jupyter to the latest vesion, 5.0, and it looks like my front-end configuration stopped working.</p> <p>I don't understand why Jupyter comes with auto closing quotes and brackets by default, which I find pretty annoying. So, at each version I ...
0debug
static void flush_encoders(void) { int i, ret; for (i = 0; i < nb_output_streams; i++) { OutputStream *ost = output_streams[i]; AVCodecContext *enc = ost->enc_ctx; OutputFile *of = output_files[ost->file_index]; if (!ost->encoding_needed) continue; ...
1threat
Use module as text in Python : I have a dictionary that contains modules, now I would like to use the string value of the module (see example). Is this possible or am I better of just creating a second dictionary? ```python import module1 import module2 import module3 module_dict = { 'module1' = module1 ...
0debug
static void type_initialize(TypeImpl *ti) { TypeImpl *parent; if (ti->class) { return; } ti->class_size = type_class_get_size(ti); ti->instance_size = type_object_get_size(ti); ti->class = g_malloc0(ti->class_size); parent = type_get_parent(ti); if (parent) { ...
1threat
Gitlab integration with SonarQube : <p>I am pretty new to Development community and specifically to DevOps practices , as a part of project we are trying to integrate SonarQube with Gitlab , did some R&amp; D on SonarQube and Git CI ( Continuous Integration ) and look like plugin is released for Github and SonarQube wh...
0debug
DeviceState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id) { DeviceState *dev; if (nand_flash_ids[chip_id].size == 0) { hw_error("%s: Unsupported NAND chip ID.\n", __FUNCTION__); } dev = DEVICE(object_new(TYPE_NAND)); qdev_prop_set_uint8(dev, "manufacturer_id", manf_id...
1threat
How to group by a single item without including it in the GROUP BY clause? : <p>My desire is to have a sales report grouped by product description that shows the quantity of each item and the price. The problem I am running into is that I only want to group by the product description and not other fields that I have t...
0debug
int index_from_key(const char *key) { int i; for (i = 0; QKeyCode_lookup[i] != NULL; i++) { if (!strcmp(key, QKeyCode_lookup[i])) { break; } } return i; }
1threat
Windows & Android: react native server crashes very often : <pre><code> ERROR EPERM: operation not permitted, lstat '...\.idea\workspace.xml___jb_old___' {"errno":-4048,"code":"EPERM","syscall":"lstat","path":"...\.idea\\workspace.xml___jb_old___"} Error: EPERM: operation not permitted, lstat 'app\.idea\workspace.xml_...
0debug
VBA to export rows in source doc to an existing document and save as new file : 'I am trying to make a vba code to open an existing spreadsheet and populate the first row of that existing spreadsheet with the row of the information from the source spreadsheet then auto save it as the project name listed in a specific c...
0debug
Navigation Architecture Component - Splash screen : <p>I would like to know how to implement splash screen using Navigation Architecture Component.</p> <p>Till now I have something like this</p> <p><a href="https://i.stack.imgur.com/BovRm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/BovRm.png" alt="enter...
0debug
static struct omap_lpg_s *omap_lpg_init(MemoryRegion *system_memory, target_phys_addr_t base, omap_clk clk) { struct omap_lpg_s *s = (struct omap_lpg_s *) g_malloc0(sizeof(struct omap_lpg_s)); s->tm = qemu_new_timer_ms(vm_clock, omap_lpg_tick, s); ...
1threat
How to get the checkbutton to respond to command? : <p>I have a button which adds a movable yellow circle and an off switch when pressed. I want the user to turn off and on the yellow circle, when the checkbutton is checked it will turn the circle to white and when the button is checked it will turn the circle yellow.<...
0debug
Serialization of an object in Java : <p>we have an object as following,</p> <p>[user_id,name,email,password]</p> <p>1- How can we serialize this object?<br> 2- How can we serialize user_id,name,email part only?<br> That means I dnt want serialize password field.</p>
0debug
Is it considered grey/black hat SEO if I modify the sizing of the headings? : <p>The situation is the following:</p> <p>The page's title is H3, the article's title is H2 and some keyword/important sentence is H1 in the article. They have custom css classes on them, so the H3 looks like a H1, and the H1 looks like norm...
0debug
apt-get installing oracle java 7 stopped working : <p>Recently <code>apt-get install -y oracle-java7-installer</code> stopped working.</p> <p>I know in their roadmap, I think the public version is no longer supported, but it's been working all the way until recently. <a href="http://www.oracle.com/technetwork/java/jav...
0debug
Protobuf3: How to describe map of repeated string? : <p>The <a href="https://developers.google.com/protocol-buffers/docs/proto3#maps" rel="noreferrer" title="Official documentation about map type">Official documentation about map type</a> says:</p> <blockquote> <p><code>map&lt;key_type, value_type&gt; map_field = N;...
0debug
static void v9fs_readdir(void *opaque) { int32_t fid; V9fsFidState *fidp; ssize_t retval = 0; size_t offset = 7; int64_t initial_offset; int32_t count, max_count; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; pdu_unmarshal(pdu, offset, "dqd", &fid, &initial_offset, &max_c...
1threat
Fetching records from database in chunks : <p>My java web application is retrieving a large dataset from the DB (DB2) and displaying the records on a webpage. Since the number of records is very large , the page takes a little time to load (about 15 secs) To improve this , I want to implement pagination on the server ...
0debug
Can't center jdialog in jframe [Java] : I can't center my jdialog in my jframe. I've tried to do this but it doesn't work: public Window(String title) { panel = new JPanel(); this.setLocationRelativeTo(Main.instance.frame); this.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);...
0debug
void console_select(unsigned int index) { TextConsole *s; if (index >= MAX_CONSOLES) return; if (active_console) { active_console->g_width = ds_get_width(active_console->ds); active_console->g_height = ds_get_height(active_console->ds); } s = consoles[index]; ...
1threat
What is Renderer2 in angular4? why it is preferred over jquery? : <p>I want to understand what is and why Renderer2 is used in angular for DOM manipulation. Can we use the rich and famous library jQuery in place fo Renderer2 or native javascript? What is advantage of using Renederer2 over jQuery</p>
0debug
def remove_even(l): for i in l: if i % 2 == 0: l.remove(i) return l
0debug
static void versatile_init(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model, int board_id) { CPUState *env; ram_addr...
1threat
How to use an object outside a method in java? : <pre><code>public class Utilty { public DesiredCapabilities nologs() { DesiredCapabilities dcap= new DesiredCapabilities(); return dcap; } private static WebDriver driver = new FirefoxDriver(dcap) } } </code></pre> <p>i want to use dcap object outside the method nologs ...
0debug
static void pflash_update(pflash_t *pfl, int offset, int size) { int offset_end; if (pfl->bs) { offset_end = offset + size; offset = offset >> 9; offset_end = (offset_end + 511) >> 9; bdrv_write(pfl->bs, offset, pfl->storage + (offset <...
1threat
void usb_ep_combine_input_packets(USBEndpoint *ep) { USBPacket *p, *u, *next, *prev = NULL, *first = NULL; USBPort *port = ep->dev->port; int ret; assert(ep->pipeline); assert(ep->pid == USB_TOKEN_IN); QTAILQ_FOREACH_SAFE(p, &ep->queue, queue, next) { if (ep->halted...
1threat
How does the linker handle identical template instantiations across translation units? : <p>Suppose I have two translation-units: </p> <p>foo.cpp</p> <pre><code>void foo() { auto v = std::vector&lt;int&gt;(); } </code></pre> <p>bar.cpp</p> <pre><code>void bar() { auto v = std::vector&lt;int&gt;(); } </code></pr...
0debug
static int device_open(AVFormatContext *ctx, uint32_t *capabilities) { struct v4l2_capability cap; int fd; int res, err; int flags = O_RDWR; if (ctx->flags & AVFMT_FLAG_NONBLOCK) { flags |= O_NONBLOCK; } fd = open(ctx->filename, flags, 0); if (fd < 0) { av_...
1threat
/dev/kvm permission denied android emulator : <p>hi i install android stdio on Ubuntu 18.0 then i try to start android emulator i got error </p> <blockquote> <p>/dev/kvm permission denied</p> </blockquote> <p>i try some stackoverflow question but its not solve my problem those question links are </p> <p>1.<a href=...
0debug
How to reload a page in angular2 : <p>How to reload a page in angular2.<br> While searching through net, i got a code <code>"this._router.renavigate()"</code> to reload the page but looks like its not working with latest release of angular2.<br> Another way is <code>'window.location.reload()'</code> but this is not the...
0debug
Change the mat-autocomplete width? : <p>It seems like the <code>&lt;mat-autocomplete&gt;</code> width is always the width of the input we're typing in. Is there no way to make it larger? I have a very small input and can't read the dropdown items. I'm also limited in form space so can't make the input larger.</p> <pre...
0debug
how to use an array as Global and access it from all other files in PHP : <p>I have a file called users.php where I am adding usernames in array as below</p> <pre><code>&lt;?php $users = array("alexritz","katrob","diaman","janber","denivar","hamrop","calvik"); ?&gt; </code></pre> <p>everytime I need this array in ...
0debug
static int vmdk_write(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors) { BDRVVmdkState *s = bs->opaque; int index_in_cluster, n; uint64_t cluster_offset; static int cid_update = 0; while (nb_sectors > 0) { index_in_cluster = sector...
1threat
int qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, uint64_t offset) { int ret; qed_unref_l2_cache_entry(request->l2_table); request->l2_table = qed_find_l2_cache_entry(&s->l2_cache, offset); if (request->l2_table) { return 0; } request->l2_table = qed_alloc_l...
1threat
sql qurey for duplicate customers : I want number of customers (count) and duplicate phone_no from a table. I have to remove dashes in phone number and then check the length is equal to 10. Please can any one help in sql query. My query is like below, select COUNT(Cust_ID) cnt,Phone_no from tbl_Customers where Cu...
0debug
Renaming RStudio project under version control : <p>What's the right way to rename an RStudio project (esp., when that project is under version control)?</p> <p>E.g., I created an RStudio project with version control in "~/myproject". Then I decided I wanted to rename the project to "myproject1". So I </p> <ol> <li>r...
0debug
c# creating a dynamically anonymous types (var) : <p>I need to create a anonymous type (HAS to be a var). Like this:</p> <pre><code>var sizes = new { size = new { Medium = "1", Large = "-3", XL = "10%" } }; </code></pre> <p>It has to be dynamically so the next time this could also happen:</p> <pre><code>var si...
0debug
Determine if user clicked outside shadow dom : <p>I'm trying to implement a dropdown which you can click outside to close. The dropdown is part of a custom date input and is encapsulated inside the input's shadow DOM.</p> <p>I want to write something like:</p> <pre><code>window.addEventListener('mousedown', function ...
0debug
int qemu_strtoi64(const char *nptr, const char **endptr, int base, int64_t *result) { char *ep; int err = 0; if (!nptr) { if (endptr) { *endptr = nptr; } err = -EINVAL; } else { errno = 0; *result = strtoll(nptr, ...
1threat
Scala - How to avoid a var here : <p>I wonder if anybody knows how to avoid the var in the following pseudocode:</p> <pre><code>var cnt = theConstant val theSequence = theMap.flapMap{case (theSet, theList) =&gt; if (theSet.isEmpty) { // do something here with theList and return a sequence } else { cnt += 1...
0debug
static int http_proxy_open(URLContext *h, const char *uri, int flags) { HTTPContext *s = h->priv_data; char hostname[1024], hoststr[1024]; char auth[1024], pathbuf[1024], *path; char lower_url[100]; int port, ret = 0, attempts = 0; HTTPAuthType cur_auth_type; char *authstr; int ...
1threat
RequiresApi vs TargetApi android annotations : <p>Whats the difference between <code>RequiresApi</code> and <code>TargetApi</code>?</p> <p>Sample in kotlin:</p> <pre><code>@RequiresApi(api = Build.VERSION_CODES.M) @TargetApi(Build.VERSION_CODES.M) class FingerprintHandlerM() : FingerprintManager.AuthenticationCallbac...
0debug
static int coroutine_fn bdrv_co_do_write_zeroes(BlockDriverState *bs, int64_t sector_num, int nb_sectors, BdrvRequestFlags flags) { BlockDriver *drv = bs->drv; QEMUIOVector qiov; struct iovec iov = {0}; int ret = 0; int max_write_zeroes = bs->bl.max_write_zeroes ? ...
1threat
static sPAPRDIMMState *spapr_recover_pending_dimm_state(sPAPRMachineState *ms, PCDIMMDevice *dimm) { sPAPRDRConnector *drc; PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm); MemoryRegion *mr = ddc->get_memory_region(dimm); uint64_t size = mem...
1threat
What is the reason I can't execute the code below? : <pre><code>&lt;?php $greeting = 'hi'; echo 'hi' $greeting; ?&gt; </code></pre> <p>I know that the above works when string interpolation is used such as <code>echo "hi $greeting";</code> but if the code works individually as in <code>echo 'hi'</code> and <code>echo...
0debug
int bdrv_create(BlockDriver *drv, const char* filename, QemuOpts *opts, Error **errp) { int ret; Coroutine *co; CreateCo cco = { .drv = drv, .filename = g_strdup(filename), .opts = opts, .ret = NOT_DONE, .err = NULL, }; if (!drv...
1threat