problem
stringlengths
26
131k
labels
class label
2 classes
static void nfs_client_close(NFSClient *client) { if (client->context) { if (client->fh) { nfs_close(client->context, client->fh); } aio_set_fd_handler(client->aio_context, nfs_get_fd(client->context), false, NULL, NULL, NULL, NULL); nfs...
1threat
How to implement the ftruncate function : Hi I just have a simple question; I am trying to use the function "ftruncate" to truncate a file, so my question is how do you inplement this function? Thanks
0debug
Angular2 HTTP - How to understand that the backend server is down : <p>I am developing a front end which consumes JSON services provided by a server. </p> <p>I happily use HTTP of Angular2 and I can catch errors via <code>.catch()</code> operator.</p> <p>If I find a problem related to a specific service (e.g. the ser...
0debug
static void *data_plane_thread(void *opaque) { VirtIOBlockDataPlane *s = opaque; do { aio_poll(s->ctx, true); } while (!s->stopping || s->num_reqs > 0); return NULL; }
1threat
C# - Running code asynchronously in parallel : <p>I have a C# console app that I'm using for experimentation. I have some blocks of code that I know that I want to run 1) Asynchronously 2) in Parallel and 3) Run some shared cleanup code when each block finishes. </p> <p>I need to run the blocks asynchronously because ...
0debug
static int16_t square_root(int val) { return (ff_sqrt(val << 1) >> 1) & (~1); }
1threat
static uint32_t drc_unisolate_physical(sPAPRDRConnector *drc) { if (!drc->dev) { return RTAS_OUT_NO_SUCH_INDICATOR; } drc->isolation_state = SPAPR_DR_ISOLATION_STATE_UNISOLATED; return RTAS_OUT_SUCCESS; }
1threat
RxJS: Observable.create() vs. Observable.from() : <p>What's the difference between these two?</p> <pre><code>return Observable.create(function(observer) { if (array) observer.next([]); else observer.next(null); observer.complete(); }); </code></pre> <p>and </p> <pre><code>return Observabl...
0debug
Andoid database SQLite Datatype mismatch : This is not a duplicate question. I understand that there are a lot of questions about this but none of them solved the problem for me. Why is the datatype mismatched and why is the insertion of the row happening as (name,_id) and not (_id,name) when I call the createRecords ...
0debug
enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, const char *filename, const char *mime_type, enum AVMediaType type) { if (av_match_name("segment", fmt->name) || av_match_name("ssegment", fmt->name)) { fmt = av_guess_...
1threat
uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, uint32_t index, int reg) { struct kvm_cpuid2 *cpuid; int i, max; uint32_t ret = 0; uint32_t cpuid_1_edx; int has_kvm_features = 0; max = 1; while ((cpuid = try_get_cpuid(e...
1threat
how can I make a table field predefined in mysql? : I've not worked on such case before so asking you . like I'll create a table where inside the table fields field3=field1+field2 by default. mean i don't need to make it on frontend. check the imaga- [enter image description here][1] please give a suggestion. T...
0debug
Android create backup database inside app : I have an app similar to contacts app and uses the sqlite to store data. I want that whenever the database version is changed,a backup of current database is taken inside the app and the customer has option to fall back to previous version. In onUpgrade() method,if i crea...
0debug
RecyclerView skips the first few views i dont know why : For some reason,Recyclerview skips views and when it first loads up it makes all views of the same object in the array and still comes up empty till i scroll down and up then they start to appear. I dont seem to see the problem because it does work, it just does ...
0debug
How can I group by name in R and apply sum to the other 2 columns? : <p>I am trying to summarize this dataset by grouping by name (Almeria, Ath Bilbao,...) and have the sum of its corresponding values in column 2 (HalfTimeResult) and 3 (FullTimeResult). I tried with the <strong>aggregate</strong> and <strong>group_by</...
0debug
static target_ulong h_protect(PowerPCCPU *cpu, sPAPRMachineState *spapr, target_ulong opcode, target_ulong *args) { CPUPPCState *env = &cpu->env; target_ulong flags = args[0]; target_ulong pte_index = args[1]; target_ulong avpn = args[2]; uint64_t token; tar...
1threat
Init an object conforming to Codable with a dictionary/array : <p>Primarily my use case is to create an object using a dictionary: e.g. </p> <pre><code>struct Person: Codable { let name: String } let dictionary = ["name": "Bob"] let person = Person(from: dictionary) </code></pre> <p>I would like to avoid writ...
0debug
Cannot read property 'push' of undefined(…) in angular2 : <p>this is the error saying <strong><em>" cannot read property 'push' of undefined "</em></strong> when using the code below</p> <pre><code> let deal = new Deal( 5, 'afaf', 'dafa',5,23 ) this.publicDeals.push( deal ) // gives a error saying Cannot read p...
0debug
static void decode_src_opc(CPUTriCoreState *env, DisasContext *ctx, int op1) { int r1; int32_t const4; TCGv temp, temp2; r1 = MASK_OP_SRC_S1D(ctx->opcode); const4 = MASK_OP_SRC_CONST4_SEXT(ctx->opcode); switch (op1) { case OPC1_16_SRC_ADD: gen_addi_d(cpu_gpr_d[r1], cpu_g...
1threat
Index and length must refer to a location within the string when I try to add an extra digit? : <p>Hello so I have a program that generates a Key when you fill in some info in some text boxes. When ever I generate a key that adds an extra 1 or 0 it tells me Index and length must refer to a location within the string, t...
0debug
PHP only returns the the first value : This has 3 rows and 3 buttons each rows. So, when I input a value at the first row and click it's button, it inserts the data. And then when I input at the second row and click its button, it inserts the value at the first row. And there's also something wrong with the button. I t...
0debug
Header with lines on either side : <p>I<code>m writing a website, i</code>m newbie. Needs help with header, i don`t know how to create line on either side of header. Here is image [1]: <a href="https://imgur.com/a/slm22Pg" rel="nofollow noreferrer">https://imgur.com/a/slm22Pg</a> with that's what I mean.</p>
0debug
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) { target_long *stack = (void *)infop->start_stack; memset(regs, 0, sizeof(*regs)); regs->ARM_cpsr = 0x10; regs->ARM_pc = infop->entry; regs->ARM_sp = infop->start_stack; regs->ARM_r2 = tswapl(stack[2]); ...
1threat
static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *dc = container_of(dcbase, DisasContext, base); CPUARMState *env = cpu->env_ptr; uint32_t insn; bool is_16bit; if (arm_pre_translate_insn(dc)) { return; } insn = arm_lduw_code(env...
1threat
python: How can I split and merge the dataframe? : Q1. I want to split the dataframe (from df1 to df2) Q2. and also How I can i turn merge the dataframe (from df1 to df2)? Dataframe df1 c1 c2 0 0 [{'a':1 ,'b':2},{'a':3 ,'b':4}] 1 1 [{'a':5 ,'b':6},{'a':7 ,'b':8...
0debug
How to use HTML5 color picker in Django admin : <p>I'm trying to implement the HTML5 colorpicker in Django's admin page.</p> <p>Here is my model:</p> <pre><code>#model.py ... class Category(models.Model): ... color = models.CharField(max_length=7) </code></pre> <p>Here is the form:</p> <pre><code>#form.py ...
0debug
Front Degradation Issue : I'm beginning to learn the basics of HTML and CSS and am currently working through the FreeCodeCamp program. Currently, I cannot create an account to access the forums there so I'm going to attempt to solve it here. Within the problem, it's asking the user to add a second font and comment out ...
0debug
static int copy_parameter_set(void **to, void **from, int count, int size) { int i; for (i = 0; i < count; i++) { if (to[i] && !from[i]) { av_freep(&to[i]); } else if (from[i] && !to[i]) { to[i] = av_malloc(size); if (!to[i]) return ...
1threat
Absolute and Relative links : <p>I have a question about absolute and relatives links as I am working on an assignment and seem to be a bit confused... what are the different situations that each type of link would be used in? </p> <p>Thank you! </p>
0debug
Adding images in OpenCV : <p>You can add two images by OpenCV function, <code>cv2.add()</code> or simply by numpy operation, <code>res = img1 + img2</code>. Both images should be of same depth and type, or second image can just be a scalar value. What should i use to compare their depth and type of images.i have studie...
0debug
static int inet_listen_saddr(InetSocketAddress *saddr, int port_offset, bool update_addr, Error **errp) { struct addrinfo ai,*res,*e; char port[33]; char uaddr[INET6_ADDRSTRLEN+1]; char uport[33]; int rc,...
1threat
Why this is not giving compilation error : <pre><code>#include&lt;stdio.h&gt; #define A -B #define B -C #define C 5 int main() { printf("The value of A is %d\n", A); return 0; } </code></pre> <p>In this, Macros as just get replaced -B becomes --C and finally --5.But This should give compilation error as 5 is a ...
0debug
static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp, int flags, int send) { abi_long ret, len; struct msghdr msg; int count; struct iovec *vec; abi_ulong target_vec; if (msgp->msg_name) { msg.msg_namelen = tswap32(msgp...
1threat
Wy viewWithTag is returning nil : activite1Label as the tag 1 class StatsViewController: UIViewController { @IBOutlet weak var activite1Label: UILabel! @IBOutlet weak var activite2Label: UILabel! @IBOutlet weak var activite3Label: UILabel! override func viewDidLoad() { super....
0debug
how to show selected item in another activityin android : <p>I am new in android. My app is basically is shoppping cart.Now I want help. when user select items from custom listview.Those items display with image ,name and quantity to next activity such as view cart.I have been searching tutorial but cannot find a compl...
0debug
static enum AVPixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt) { int num_formats = sizeof(schro_pixel_format_map) / sizeof(schro_pixel_format_map[0]); int idx; for (idx = 0; idx < num_formats; ++idx) if (schro_pixel_format_map[idx].schro_pix_fmt == schro_p...
1threat
ES6 - is there an elegant way to import all named exports but not the default export? : <p>I am looking for an elegant way to import all named exports without having to import the default as well.</p> <p>In one file I am exporting many named constants plus a default:</p> <pre><code>// myModule.js const myDefault = 'm...
0debug
static int vorbis_packet(AVFormatContext *s, int idx) { struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; struct oggvorbis_private *priv = os->private; int duration; if (!os->lastpts) { int seg; uint8_t *last_pkt = os->buf + os->pstart;...
1threat
How can I change the control sourse in TFS2018 : Could you please tell me how I can change the control source in one project with TFS on Git. Thanks.
0debug
Glob Sync Pattern on multiple directories : <p>I am trying to achieve a <code>glob</code> sync pattern that allows me to meet the following criteria, but unfortunately, im having a hard time working out why the pattern isn't working.</p> <p><strong>Glob Pattern</strong></p> <p><code>glob.sync("./src/handlebar/{a, b, ...
0debug
Will I be able to test this PHP? : <p>So I have 2 websites. One is currently hosted on a domain and one is just local on my computer (viewing it using brackets live preview).</p> <p>I used the hosted website (#1) to create a mysql database. </p> <p>Then for my local website (#2) I created a login page and created a i...
0debug
static int decode_header(MPADecodeContext *s, uint32_t header) { int sample_rate, frame_size, mpeg25, padding; int sample_rate_index, bitrate_index; if (header & (1<<20)) { s->lsf = (header & (1<<19)) ? 0 : 1; mpeg25 = 0; } else { s->lsf = 1; mpeg25 = 1; } ...
1threat
static ram_addr_t kqemu_ram_alloc(ram_addr_t size) { ram_addr_t addr; if ((last_ram_offset + size) > kqemu_phys_ram_size) { fprintf(stderr, "Not enough memory (requested_size = %" PRIu64 ", max memory = %" PRIu64 ")\n", (uint64_t)size, (uint64_t)kqemu_phys_ram_size); abort(...
1threat
Is it possible to start a stopped container from another container : <p>There are two containers A and B. Once container A starts, one process will be executed, then the container will stop. Container B is just an web application (say expressjs). Is it possible to kickstart A from container B ?</p>
0debug
static int w64_read_header(AVFormatContext *s) { int64_t size, data_ofs = 0; AVIOContext *pb = s->pb; WAVDemuxContext *wav = s->priv_data; AVStream *st; uint8_t guid[16]; int ret; avio_read(pb, guid, 16); if (memcmp(guid, ff_w64_guid_riff, 16)) if (avio_rl64...
1threat
Regular expression to get a string between two strings in Javascript. The 2 strings are bookended by quotes : I have the below string that I need help pulling an ID from in Presto. Presto uses the javascript regex. I need to pull the GA Client ID which looks like this: ```75714ae471df63202106404675dasd800097erer18...
0debug
static uint32_t pmac_ide_readl (void *opaque,target_phys_addr_t addr) { uint32_t retval; MACIOIDEState *d = opaque; addr = (addr & 0xFFF) >> 4; if (addr == 0) { retval = ide_data_readl(&d->bus, 0); } else { retval = 0xFFFFFFFF; } retval = bswap32(retval); ret...
1threat
How can I create JavaScript sliders that emulate the ones on the New York Times "Rent or Buy" web site? : <p>I love the way the sliders on this web site work. How in the world can I make ones that look and act like them? In particular, I love that everything they are connected to update on the fly. I love that they ar...
0debug
Jupyter Notebook: interactive plot with widgets : <p>I am trying to generate an interactive plot that depends on widgets. The problem I have is that when I change parameters using the slider, a new plot is done after the previous one, instead I would expect only one plot changing according to the parameters.</p> <p><s...
0debug
Type 'string' is not assignable to type '"inherit" | "initial" | "unset" | "fixed" | "absolute" | "static" | "relative" | "sticky"' : <p>I get the following error in my application (npm 5.4.2, react 15.4, typescript 2.5.3, webpack 2.2.1, webpack-dev-server 2.4.1).</p> <p>This will work:</p> <pre><code>&lt;div style={...
0debug
How do I serialize an object for the query in a GET request? : <p>I'm trying to serialize an object in JavaScript so that I can query it in a GET request.</p>
0debug
sorry if this question is so simple. how to produce output string and numbering from the same statement in python?eg. "output_CH = 0.7 and CH_healthy" : if input_CH in range (185, 211): if input_CH >= 185 and input_CH < 190: output_CH = (1/5 * input_CH) - 37 elif input_CH >=...
0debug
What are best practises with Django to handle big dropdown list? : Problem is simple, for fields based on foreign key dropdowns generated some dropdowns, eventually those can become very big and it is difficult to select needed value for end user.(currently we use crispy forms for auto formating.) I subdivided the...
0debug
static IOMMUTLBEntry spapr_tce_translate_iommu(MemoryRegion *iommu, hwaddr addr, bool is_write) { sPAPRTCETable *tcet = container_of(iommu, sPAPRTCETable, iommu); uint64_t tce; IOMMUTLBEntry ret = { .target_as = &address_space_memory, .io...
1threat
static void v9fs_rename(void *opaque) { int32_t fid; ssize_t err = 0; size_t offset = 7; V9fsString name; int32_t newdirfid; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; v9fs_string_init(&name); err = pdu_unmarshal(pdu, offset, "dds", &fid, &newdirfid, &name)...
1threat
How do I add 1 element to array with loops? : <p>I'm trying to loop through array and if element is null I will add a string inputted by the user. When I run it, it spits out the loop however big my array is. I want just to add 1 string and go back to a switch. How do i go about this?</p> <pre><code>public void insert...
0debug
static int xan_huffman_decode(unsigned char *dest, int dest_len, const unsigned char *src, int src_len) { unsigned char byte = *src++; unsigned char ival = byte + 0x16; const unsigned char * ptr = src + byte*2; int ptr_len = src_len - 1 - byte*2; unsigned char va...
1threat
syntax error: `(' unexpected in shell script : <p>I have a shell script which contains some functions in it. One of those functions has to be executed through perl. The perl functions checks whether port is opened on a remote server or not.</p> <pre><code>#!/usr/bin/ksh function1 function2 telnet_check() { #!/usr/bi...
0debug
int ff_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret, i, err; AVStream *st; for (;;) { AVPacketList *pktl = s->internal->raw_packet_buffer; if (pktl) { *pkt = pktl->pkt; st = s->streams[pkt->stream_index]; if (s->internal->raw_packet_buffer_re...
1threat
Git, error: remote unpack failed: unable to create temporary object directory - By creating new Branch : <p>Good Day.</p> <p>I Try to create a new Branch in my Repo.</p> <p>I made this:</p> <blockquote> <p>Git branch events</p> <p>Git Checkout events</p> </blockquote> <p>That worked. So I changed some files ...
0debug
Angular/RxJS 6: How to prevent duplicate HTTP requests? : <p>Currently have a scenario where a method within a shared service is used by multiple components. This method makes an HTTP call to an endpoint that will always have the same response and returns an Observable. Is it possible to share the first response with a...
0debug
How to bind default value in mat-radio-group angular reactive forms : <p>In my case it needs to active option 01 as default selection. It is working with checked=true property, but value is not binding with the formControlName="options", it is binding when user select any option. if no any user selection options value ...
0debug
static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) { int log2_min_cb_size = sps->log2_min_cb_size; int width = sps->width; int height = sps->height; int pic_size_in_ctb = ((width >> log2_min_cb_size) + 1) * ((height >> log2_min_cb_size)...
1threat
Is it suitable to use 200 http code for forbidden web page : what is the difference when we use 200 response code for a forbidden page with an error message saying 'access denied' instead of using 403 response code? are there any security implications of this
0debug
static inline void gen_op_eval_ble(TCGv dst, TCGv_i32 src) { gen_mov_reg_N(cpu_tmp0, src); gen_mov_reg_V(dst, src); tcg_gen_xor_tl(dst, dst, cpu_tmp0); gen_mov_reg_Z(cpu_tmp0, src); tcg_gen_or_tl(dst, dst, cpu_tmp0); }
1threat
Change color of react-big-calendar events : <p>I need to make a calendar with events and I decided to use <a href="http://intljusticemission.github.io/react-big-calendar/examples/index.html" rel="noreferrer">react-big-calendar</a>. But I need to make events of different colors. So each event will have some category and...
0debug
i am new to angular js trying to addclass but getting error addclass not a function : i am new to angular js trying to addclass but getting error addclass not a function plz help $scope.viewReport = function(ev,element) { window.location="#tab7"; $scope.tabact = document.getElementById...
0debug
difference between np.inf and float('Inf') : <p>Is there some difference between NumPy <code>np.inf</code> and <code>float('Inf')</code>? <code>float('Inf') == np.inf</code> returns <code>True</code>, so it seems they are interchangeable, thus I was wondering why NumPy has defined its own "inf" constant, and when shoul...
0debug
static int config_input_overlay(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; OverlayContext *over = inlink->dst->priv; char *expr; double var_values[VAR_VARS_NB], res; int ret; const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(inlink->format); av_image_fill_...
1threat
void replay_account_executed_instructions(void) { if (replay_mode == REPLAY_MODE_PLAY) { replay_mutex_lock(); if (replay_state.instructions_count > 0) { int count = (int)(replay_get_current_step() - replay_state.current_step); replay_state.instru...
1threat
Find the approximate value in the vector : <p>I have a number of the vector with the numbers.</p> <pre><code>test &lt;- 0.495 vector &lt;- c(0.5715122, 2.2860487, 5.1436096, 9.1441949) </code></pre> <p>This vector is the need to take an approximate number to the number 0.495. Help me. </p>
0debug
Are you writing opencv programs in ubuntu? : I need your help! I have been troubled by the problem these days. I want to write opencv-3.0.0 programs with c language in the terminal of my ubuntu 14.04 in the VM. Could you please give me an example of yours?
0debug
Url-loader vs File-loader Webpack : <p>I'm trying to figure out the difference between url-loader vs file-loader. What does <code>DataURl</code> mean?</p> <blockquote> <p>The url-loader works like the file-loader, but can return a DataURL if the file is smaller than a byte limit.</p> </blockquote>
0debug
Convert LINQ nested Any's to take N parameters : Requirement: check if a list of successive words exists in a dataset. If it does, return a boolean to show the success. Here is my code so far with unit tests: [Test] public void PhraseSearch() { var DataSet = new List<Word> ...
0debug
static int loadvm_postcopy_handle_advise(MigrationIncomingState *mis) { PostcopyState ps = postcopy_state_set(POSTCOPY_INCOMING_ADVISE); uint64_t remote_hps, remote_tps; trace_loadvm_postcopy_handle_advise(); if (ps != POSTCOPY_INCOMING_NONE) { error_report("CMD_POSTCOPY_ADVISE in wrong ...
1threat
create dict from lists using key list again : <p>I have two list</p> <pre><code>listA = (1,2,3,4) listB = (A,B,C,D,A,B,C,D,A,B,C,D,A,B,C,D,A,B,C,D) </code></pre> <p>I want to build a dictionary reusing <code>listA</code> as the key to all values in <code>listB</code></p> <pre><code>dict = {1:A,2:B,3:C,4:D,1:A,2:B,3:...
0debug
SwiftUI and MVVM - Communication between model and view model : <p>I've been experimenting with the MVVM model that's used in <code>SwiftUI</code> and there are some things I don't quite get yet.</p> <p><code>SwiftUI</code> uses <code>@ObservableObject</code>/<code>@ObservedObject</code> to detect changes in a view mo...
0debug
char *desc_get_buf(DescInfo *info, bool read_only) { PCIDevice *dev = PCI_DEVICE(info->ring->r); size_t size = read_only ? le16_to_cpu(info->desc.tlv_size) : le16_to_cpu(info->desc.buf_size); if (size > info->buf_size) { info->buf = g_realloc(info->buf, size); ...
1threat
why is macro acting different while not using namespace std and while using namespace std? : <p>in this below code <b><i>macro 1</i></b> is always fine</p> <p>but, <b><i>macro 2 </i></b>is not working if statement 1 is not written..why is this happening?</p> <pre><code>#include&lt;iostream&gt; #include&lt;conio.h&gt;...
0debug
Changing the value of a copy also changes the value of the original : <p>Changing the value of a variable b, which is a copy of a, also changes the value of a.</p> <pre><code>a = [[0]] b = a.copy() print("a before", a) b[0][0] = 1 print("a after ", a) </code></pre> <p>prints:</p> <pre><code>a before [[0]] a after...
0debug
static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty, Jpeg2000ResLevel *rlevel, int precno, int layno, uint8_t *expn, int numgbits) { int bandno, cblkno, ret, nb_code_blocks...
1threat
static int virtio_9p_init_pci(PCIDevice *pci_dev) { VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); VirtIODevice *vdev; vdev = virtio_9p_init(&pci_dev->qdev, &proxy->fsconf); vdev->nvectors = proxy->nvectors; virtio_init_pci(proxy, vdev, PCI_VENDOR_I...
1threat
Error when defining variables within a defined function (Python) : <p>Consider the following code (I received a name error when running this)</p> <pre><code>item = input("What food???") def itemcheck(): if item == "chex": cereal = "Yummy" else: cereal = "Yuck!" itemcheck() print(cereal) </code...
0debug
What is SYCL 1.2? : <p>I am trying to install tensorflow</p> <pre><code>Please specify the location where ComputeCpp for SYCL 1.2 is installed. [Default is /usr/local/computecpp]: Invalid SYCL 1.2 library path. /usr/local/computecpp/lib/libComputeCpp.so cannot be found </code></pre> <p>What should I do?What is SYCL ...
0debug
What is the simplest way to create a form in java swing? : <p>I need advise about layout manager in swing for such form:</p> <pre><code> Label1 TextField1 Label1 TextField1 ButtonWideAsForm </code></pre> <p>Can you tell me what layout to use ?</p>
0debug
Finding the mean of all of the integers in an ArrayList : I am currently making a simulator for fake basketball players but am currently stuck on finding the mean of all of the numbers in the arraylist. I know how to add all of them up but when ever I try to make a counter variable to divide the list or list.getSize()...
0debug
Propertly would not be serialize into a Parcel in Kotlin : <p>I wish to have my variables <strong>that are not</strong> from my constructor, part of my Parcelable. However, I face this warning "Propertly would not be serialize into a Parcel", that inform me I can't do that currently.</p> <p>I am using Kotlin in <em>ex...
0debug
ping: http://google.com: Name or service not known : <p>I'm using centos7 in virtualbox on windows. And vagrant made it, got ping error with http or https. also curl. someone can help me how to fix it and let it work.</p> <pre><code>[root@localhost ~]# ping google.com PING google.com (61.91.161.217) 56(84) bytes of da...
0debug
Error calling RCTDeviceEventEmitter.emit in ReactNative : <p>I am begginer in ReactNative ... After install the first project in my Device This error was displayed:</p> <blockquote> <p>Error calling RCTDeviceEventEmitter.emit</p> </blockquote> <p>What is the problem ? <a href="https://i.stack.imgur.com/clgDX.jpg" r...
0debug
Using `std::min` as an algorithm parameter : <p>So I ran into this problem: I need to replace every element of the <code>std::vector&lt;int&gt;</code> with the minimum of whatever came before it (inclusive). </p> <p>Naturally <code>std::partial_sum</code> comes to mind - if I could pass <code>std::min</code> as the <...
0debug
uint64_t HELPER(neon_abdl_u32)(uint32_t a, uint32_t b) { uint64_t tmp; uint64_t result; DO_ABD(result, a, b, uint16_t); DO_ABD(tmp, a >> 16, b >> 16, uint16_t); return result | (tmp << 32); }
1threat
static bool migrate_params_check(MigrationParameters *params, Error **errp) { if (params->has_compress_level && (params->compress_level < 0 || params->compress_level > 9)) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level", "is invalid, it should be in the rang...
1threat
The output is number that signifies the smallest number of hops/jumps : <p>Create an app that receives input from the terminal console/UI and gives the output on the console/UI. </p> <p>1st input - A list of 3 letter words. 2nd input - One word from the above list. 3rd input - Another word from the list. </p> <p>Th...
0debug
def move_first(test_list): test_list = test_list[-1:] + test_list[:-1] return test_list
0debug
void *qemu_vmalloc(size_t size) { if (!size) { abort(); } return oom_check(VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE)); }
1threat
C2106: '=' : left operand must be l-value : <p>So, I'm learning C as my first language and as doing some coding for practise I got the error above. I done everything as the book says (Stephen G. Kochan: Programming in C, Third Edition). What am I doing wrong? I'm using Microsoft Visual Studio 2015.</p> <p>Thanks for y...
0debug
static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2, gpointer data) { GtkDisplayState *s = data; VirtualConsole *vc; gboolean on_vga; if (!gtk_widget_get_realized(s->notebook)) { return; } vc = gd_vc_find_by_page(s, arg2); if...
1threat
window.location.href = 'http://attack.com?user=' + user_input;
1threat
qcrypto_block_luks_open(QCryptoBlock *block, QCryptoBlockOpenOptions *options, const char *optprefix, QCryptoBlockReadFunc readfunc, void *opaque, unsigned int flags, Err...
1threat
Why duplicate code is needed with const reference arguments? : <p>In this <a href="http://www.stlport.org/resources/StepanovUSA.html">interview</a> Stepanov shows how to implement generic <code>max</code> function in C++. </p> <blockquote> <p>Try to implement a simple thing in the object oriented way, say, max. I ...
0debug