problem
stringlengths
26
131k
labels
class label
2 classes
Amazon s3 static web hosting caching : <p>I'm using Amazon S3 webhosting for my static html,js,css (etc..) files. After replacing my index.html file, I still get the old version when consuming via the browser. I would like to set a default ttl <strong>to the bucket</strong> (and not to specific objects in it). I found...
0debug
Getting Dynamic Constants in laravel : I am having one table named as <b>Settings</b> and fields are <b>id</b>,<b>constant_name</b>,<b>constant_value</b>,<b>Timestampsfield</b> and values are<br> constant_name &nbsp; constant_value<br> <b>sitename</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...
0debug
How to customize default auth login form in Django? : <p>How do you customize the default login form in Django?</p> <pre><code># demo_project/urls.py from django.contrib import admin from django.urls import include, path urlpatterns = [ path('', include('pages.urls')), path('users/', include('users.urls')), #...
0debug
Laravel unit tests - changing a config value depending on test method : <p>I have an application with a system to verify accounts (register -> get email with link to activate -> account verified). That verification flow is optional and can be switched off with a configuration value:</p> <pre><code>// config/auth.php r...
0debug
void OPPROTO op_addco (void) { do_addco(); RETURN(); }
1threat
How to find consecutive letters in a string in Python 3? : guys. I want to count the number of consecutive letters that arrive in a string. For example, my string input is EOOOEOEE I would only like to find the number of consecutive O's in the string. The Output should be: 1 Since, there is only one ...
0debug
static void s390_cpu_full_reset(CPUState *s) { S390CPU *cpu = S390_CPU(s); S390CPUClass *scc = S390_CPU_GET_CLASS(cpu); CPUS390XState *env = &cpu->env; int i; scc->parent_reset(s); cpu->env.sigp_order = 0; s390_cpu_set_state(CPU_STATE_STOPPED, cpu); memset(env, 0, offsetof(C...
1threat
How can I use java Integer.Intparse()? : I was trying to change like String A00001 to int 1 in this code.but Eclipse told me that --- Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "00001 " at java.lang.NumberFormatException.forInputString(Unknown So...
0debug
How to convert string to mm/dd/yyyy format in vb.net : How do i change string like "15:33:56 Thursday 17th, November 2016" to mm/dd/yyyy date format vb.net. Have already tried to use the inbuilt vb.net date function cdate
0debug
How to call Destructor : <p>I know destructor are called by Garbage Collector when object is no longer used. But I want to know </p> <blockquote> <p>How to call destructor through c# code?</p> </blockquote> <p><strong>If possible please give some basic example for understanding.</strong></p>
0debug
Why can't i just define a non-const gloabal variable in header? and if i use namespaces why do i have to declare it 'extern'? : 1) I know a non-const variable is external linkage by default (it's like it's been declared as external more or less) but i dont understand why cant i define a global variable such as `int glb...
0debug
if..else..if..else code not working properly(coding in C) : <p>I have a question.I think I may have a mistake in my code because my code program(Dev C++) seems not to recognize the "else if" statement.</p> <p>Here is the code:</p> <pre><code>#include &lt;stdio.h&gt; int main() { int a = 80; if(a == 10); printf("value...
0debug
How to insert data from other tables when the destination table has primary keys : I need help creating a table the can track a 2% yearly price increase over the years 2010-2016.[My create statement is as follows][1] [1]: http://i.stack.imgur.com/M5hCu.png I have 24 products and the starting price in my Product...
0debug
static int nprobe(AVFormatContext *s, uint8_t *enc_header, const uint8_t *n_val) { OMAContext *oc = s->priv_data; uint32_t pos, taglen, datalen; struct AVDES av_des; if (!enc_header || !n_val) return -1; pos = OMA_ENC_HEADER_SIZE + oc->k_size; if (!memcmp(&enc_header[pos], "E...
1threat
What is the difference between using a class and not using a class in Python : <p>So I'm working on a personal Python project as of right now and I would research a certain question I had. However, lots of the code samples looked like this:</p> <pre><code>x = 0 class foo(object): def bar(self): global x ...
0debug
Extend slice length on the left : <p>I just started going through gotour, and encountered a question regarding slice defaults chapter.</p> <pre><code>package main import "fmt" func main() { s := []int{2, 3, 5, 7, 11, 13} s = s[1:4] fmt.Println(s) // [3 5 7] fmt.Println(len(s)) // 3 s = s[:4] ...
0debug
Multiple data-toggle not working correctly : I have the following page: http://mindspyder.com/newline/my-account.html And the following code on that page: <!-- begin snippet: js hide: false --> <!-- language: lang-html --> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li clas...
0debug
How to divide many columns? : <p>I have a data frame that look like </p> <pre><code>V1 V2 V3 V4 V5 V6 V7 V8 0 Tri1 D D D D D D D D D D D D 0 Tri2 D D D D D D D D D D D D 0 Tri3 D D D D D D D D D D D D 0 Tri4 D D D D D D D D D D D D 0 Tri5 D D D...
0debug
bool migration_is_blocked(Error **errp) { if (qemu_savevm_state_blocked(errp)) { return true; } if (migration_blockers) { *errp = error_copy(migration_blockers->data); return true; } return false; }
1threat
static void vnc_listen_read(void *opaque, bool websocket) { VncDisplay *vs = opaque; struct sockaddr_in addr; socklen_t addrlen = sizeof(addr); int csock; graphic_hw_update(vs->dcl.con); #ifdef CONFIG_VNC_WS if (websocket) { csock = qemu_accept(vs->lwebsock, (struct sock...
1threat
Not sure how to flip these lines to form a diamond in python 3 : The idea of this code is to enter a height and form a diamond with asterisks(stars). eg. If the input for the height was 6, I'd want the code to produce: ************ ***** ***** **** **** *** *** ** ** *...
0debug
static void gen_dmtc0 (DisasContext *ctx, int reg, int sel) { const char *rn = "invalid"; switch (reg) { case 0: switch (sel) { case 0: gen_op_mtc0_index(); rn = "Index"; break; case 1: rn = "MVPControl"; case ...
1threat
static av_cold int pam_encode_init(AVCodecContext *avctx) { avctx->coded_frame = av_frame_alloc(); if (!avctx->coded_frame) return AVERROR(ENOMEM); avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; avctx->coded_frame->key_frame = 1; return 0; }
1threat
Eclipse jre 1.5 > 1.8 : <p>Can anybody convert these lines from jre 1.5 to 1.8?</p> <p>Even tho if i put my eclipse project version to 1.5 my jar breaks.</p> <pre><code> Map&lt;String, byte[]&gt; resources = new HashMap&lt;&gt;(); Enumeration&lt;JarEntry&gt; enumeration = jar.entries(); Class&lt;?&gt;...
0debug
I'm android Problems to convert a full name of a android.widget.EditText@410e5a58 edittextview : <p>I'm android Problems to convert a full name of a android.widget.EditText@410e5a58 edittextview is the string representation of your EditText object (ie , calling the toString your EditText object will return this string)...
0debug
static int film_read_packet(AVFormatContext *s, AVPacket *pkt) { FilmDemuxContext *film = s->priv_data; AVIOContext *pb = s->pb; film_sample *sample; int ret = 0; int i; int left, right; if (film->current_sample >= film->sample_count) return AV...
1threat
Where do I find the source for the "script" command in linux : <p>Where do I find the source for the "script" command. I would like to change it from relative time between lines to relative time from start of script?</p> <p>ie, man script SCRIPT(1) BSD General Commands Manual SCRIPT(1) N...
0debug
Vue combine event handlers : <p>I have the following Vue event handlers with contenteditable:</p> <pre><code>&lt;div contentEditable="true" v-on:keyup="changed($event, current, 0)" v-on:paste="changed($event, current, 0)" v-on:blur="changed($event, current, 0)" v-on:delete="changed($event, current, 0)" v-on:focused="c...
0debug
R: Remove a row from all data.frames in global environment : <p>I have over 200 data.frames in my global environment. I would like to remove the first row from each data.frame, but I am not sure how. </p> <p>Any help will be appreciated please let me know if further information is needed.</p>
0debug
connection.query('SELECT * FROM users WHERE username = ' + input_string)
1threat
I need help in ggplot. : > smokeyes_male LungCap.cc. Age..years. Height.inches. Smoke Gender Caesarean 211 6.575 10 63.2 yes male yes 220 7.000 10 62.8 yes male yes 252 9.350 11 71.2 yes male no 258 ...
0debug
How can I read a webpage in R and made a data table out of it : <p>Here is the website and there are 5 properties </p> <p><a href="http://cpdocket.cp.cuyahogacounty.us/SheriffSearch/results.aspx?q=searchType%3dZipCode%26searchString%3d44106%26foreclosureType%3d%26dateFrom%3d10%2f6%2f2016+12%3a00%3a00+AM%26dateTo%3d4%2...
0debug
static int sls_flag_use_localtime_filename(AVFormatContext *oc, HLSContext *c, VariantStream *vs) { if (c->flags & HLS_SECOND_LEVEL_SEGMENT_INDEX) { char * filename = av_strdup(oc->filename); if (!filename) return AVERROR(ENOMEM); if (replace_int_data_in_filename(oc->file...
1threat
How can I "wrap" or break this line of Code? : I know people have probably asked this a thousand times before, but every time I try Netbeans tells me I am wrong. So can you guys help please? This is Java btw.` highestPoint = (initialVelocity * math.sin(launchAngle) * t - 1/2g math.sqrt(t)); ` I want t...
0debug
static void free_test_data(test_data *data) { AcpiSdtTable *temp; int i; g_free(data->rsdt_tables_addr); for (i = 0; i < data->tables->len; ++i) { temp = &g_array_index(data->tables, AcpiSdtTable, i); g_free(temp->aml); if (temp->aml_file && !temp->tmp_fi...
1threat
static void scsi_do_read(SCSIDiskReq *r, int ret) { SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s)); assert (r->req.aiocb == NULL); if (r->req.io_canceled) { scsi_req_cancel_complete(&r->req); go...
1threat
php merge Boolean variable : I have some Boolean variables and I want merge those (Calculation) I used `implode()` but always return true! <?php $myarray = array(true,false,false,true,false); implode(''&&'', $myarray); ?> How to do it !
0debug
static av_cold int sunrast_encode_init(AVCodecContext *avctx) { SUNRASTContext *s = avctx->priv_data; switch (avctx->coder_type) { case FF_CODER_TYPE_RLE: s->type = RT_BYTE_ENCODED; break; case FF_CODER_TYPE_RAW: s->type = RT_STANDARD; break; default: ...
1threat
Where do I start with first c# project using amazon and netflix? : <p>I need to learn c# for work and I thought the best way for me to get started would be with a passion project. </p> <p>I love movies and tv and was thinking about creating a c# database app that would take data from my netflix and amazon accounts and...
0debug
Golang : Could not understang how below code is executing : Below is the code i have a query upon: I have a single dimentional array a I could not understand when i printing a[0][0] then why it is returning ascii value of the character a package main import ( "fmt" ) ...
0debug
React router redirect after action redux : <p>I'm using react-redux and standard react-routing. I need redirect after definite action.</p> <p>For example: I have registration a few steps. And after action:</p> <pre><code>function registerStep1Success(object) { return { type: REGISTER_STEP1_SUCCESS, ...
0debug
static inline uint16_t mipsdsp_lshift16(uint16_t a, uint8_t s, CPUMIPSState *env) { uint8_t sign; uint16_t discard; if (s == 0) { return a; } else { sign = (a >> 15) & 0x01; if (sign != 0) { discard = (((0x01 << (16...
1threat
Hello i cannot make update on PHP (Mysqli) : php but it is not correct and what can i do? insert is working. Everything is working but not update. I dont know why, i think i had made everything correct. if you can help me it would be great. Thank you! i cannot make update on PHP (Mysqli) <?php include("...
0debug
PHP : preg_replace_callback() not working if occurrence starts with a number : I'm using **preg_replace_callback()** with a regex to pick up some heading content and create an ID based on the content but it seems that it's not working if the occurrence begins with a number and I don't understand where I'm wrong. Here i...
0debug
int kvmppc_put_books_sregs(PowerPCCPU *cpu) { CPUPPCState *env = &cpu->env; struct kvm_sregs sregs; int i; sregs.pvr = env->spr[SPR_PVR]; sregs.u.s.sdr1 = env->spr[SPR_SDR1]; #ifdef TARGET_PPC64 for (i = 0; i < ARRAY_SIZE(env->slb); i++) { sregs.u.s.ppc64.slb[i].slbe...
1threat
alert('Hello ' + user_input);
1threat
static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t response) { HDACodecBus *bus = HDA_BUS(dev->qdev.parent_bus); IntelHDAState *d = container_of(bus, IntelHDAState, codecs); hwaddr addr; uint32_t wp, ex; if (d->ics & ICH6_IRS_BUSY) { dprint(d, 2, "%s: [irr]...
1threat
How do I find out and change the value of <input type = "text"> in asp.net? : <p>I want to find the value of and want to mask the first 4th of the text field to another character when the length of the text field is 4 or greater. </p> <p>but I don't know well asp.net skill. help me plz.</p> <p>here is some html in b...
0debug
Ajax.load wont work when pressing a button : <p>I am trying to run ajax.load method when pressing a button. The idea is very simple: change the body of a to something else, by using the ajax.load method. However, i havent been succesful yet, and after researching for a couple of hours, i still havent found the solutio...
0debug
How to run Tensorboard from python scipt in virtualenv? : <p>Tensorboard should be started from commnad line like that:</p> <pre><code>tensorboard --logdir=path </code></pre> <p>I need to run it from code. Until now I use this:</p> <pre><code>import os os.system('tensorboard --logdir=' + path) </code></pre> <p>Howe...
0debug
Yarn warning on docker build : <p>Upon running <code>yarn install</code> inside my docker container it gives a warning about being without connection. <a href="https://hub.docker.com/r/tavern/rpg-web/~/dockerfile/" rel="noreferrer">https://hub.docker.com/r/tavern/rpg-web/~/dockerfile/</a></p> <p><code> warning You don...
0debug
Android: ANR Input dispatching timed out : <p>I am getting following error logs on some phone which as follow:</p> <p>Reason: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue le...
0debug
static void curl_setup_preadv(BlockDriverState *bs, CURLAIOCB *acb) { CURLState *state; int running; BDRVCURLState *s = bs->opaque; uint64_t start = acb->offset; uint64_t end; qemu_mutex_lock(&s->mutex); if (curl_find_buf(s, start, acb->bytes, acb)) { got...
1threat
Function to count small letters and Capital in a string , spaces? : I created a function that you type a string and it will bring back the amount of small letters and the amount of capital letters in that string the program works for 1 word but as soon I add two letters the 'space' between two words messes things up. s...
0debug
Java , binary search in file : I want to write a program that makes binary search in a file. I have a treeset adt that has strings int and i want to make research in file for each string this way : First i want to read the middle page of the file and do research in it . if the string is found then the position of the s...
0debug
Disable Active Storage in Rails 5.2 : <p>Upgrading Rails to 5.2, and I found out that I must commit the storage.yml into version control. I don't plan to use ActiveStorage. Is there a way to disable it?</p>
0debug
how to pass suspend function as parameter to another function? Kotlin Coroutines : <p>I want to send suspending function as a parameter, but it shows " Modifier 'suspend' is not applicable to 'value parameter" . how to do it?</p> <pre><code>fun MyModel.onBG(suspend bar: () -&gt; Unit) { launch { withContext(Disp...
0debug
Python "triplet" dictionary? : <p>If we have <code>(a1, b1)</code> and <code>(a2, b2)</code> it's easy to use a dictionary to store the correspondences:</p> <pre><code>dict[a1] = b1 dict[a2] = b2 </code></pre> <p>And we can get <code>(a1, b1)</code> and <code>(a2, b2)</code> back no problem.</p> <p>But, if we have <...
0debug
how to pass php value to script variable : i have a php variable value and we have to pass it to a script variable automatically on a button click ---------- <button><? echo $part1;?></button><? }?><br> <video style="border:1px solid" id="myVideo" width="320" height="176" controls> ...
0debug
VSCode Implement Method Shortcut : <p>I'm using VSCode, Exist, a way to implement the methods that are within an interface in typescript using some shortcut keys or set for it.</p> <p>I searched on the website of Microsoft, and the web, but I have not found anything.</p>
0debug
static uint64_t cirrus_linear_read(void *opaque, target_phys_addr_t addr, unsigned size) { CirrusVGAState *s = opaque; uint32_t ret; addr &= s->cirrus_addr_mask; if (((s->vga.sr[0x17] & 0x44) == 0x44) && ((addr & s->linear_mmio_mask) == s->linear_mmi...
1threat
Type 'void' is not assignable to type '((event: MouseEvent<HTMLInputElement>) => void) | undefined' : <pre><code> import * as React from "react"; import "./App.css"; import PageTwo from "./components/PageTwo"; export interface IPropsk { data?: Array&lt;Items&gt;; fetchData?(value: string): ...
0debug
C# .NET MVC 5 Advanced ajaxform with 2 models : I'm looking for any ideas/ tutorials or maybe the name of that metod. I'd like to create something like this on the photo. **Let's me explain:** Technology: - C# .Net MVC5 We have 2 tables. - Order (Order_Id, OrderName), - Item (Item_Id, ItemName),...
0debug
When trying to print UINT_MAX I get -1 : <p>When trying to print 'UINT_MAX' all I get it -1, why is this? It's the only thing I have in my 'main()', a printf statement that prints 'UINT_MAX'</p>
0debug
int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad) { AVFilterLink **newlinks; AVFilterPad *newpads; unsigned i; idx = FFMIN(idx, *count); newpads = av_realloc_array(*pa...
1threat
How to retry Ansible task that may fail? : <p>In my Ansible play I am restarting database then trying to do some operations on it. Restart command returns as soon as restart is started, not when db is up. Next command tries to connect to the database. That command my fail when db is not up.</p> <p>I want to retry my s...
0debug
Module using another function of the same module : <p>I have something like this:</p> <ul> <li>MyModule <ul> <li><code>index.js</code></li> <li><code>myFunction1.js</code></li> <li><code>myFunction2.js</code></li> </ul></li> </ul> <p>In <code>index.js</code> file i'm exporting all modules function (<code>myFunction1...
0debug
static int lag_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; unsigned int buf_size = avpkt->size; LagarithContext *l = avctx->priv_data; ThreadFrame frame = { .f = data }; AVFrame *const p = da...
1threat
Anaconda3 - AttributeError: 'dict' object has no attribute 'rsplit' : <p>I am running Anaconda3 locally via web browser. Everytime I go to the "Conda" section to see the packages that are installed (at <a href="http://localhost:8888/tree#conda" rel="noreferrer">http://localhost:8888/tree#conda</a>) I get <code>An error...
0debug
How to convert Decimal() to a number in Python? : <p>I have a JSON output that is <code>Decimal('142.68500203')</code>.</p> <p>I can use str() to get a string which is <code>"142.68500203"</code>. But I want to get a number output which is <code>142.68500203</code>.</p> <p>How to make the conversion in Python?</p>
0debug
print everything in div tag selenium python3 : Hello I am newbie at learning selenium. I am trying to scrape a website which has some info under its div tag like this ``` <div> id="searchResults" class="multiple-view-elements" <span>name</name> <span>info</name> <span>info</name> ---- <span>name</name> ...... ...
0debug
How to get variable's value outside promise? : <p>I'm trying to set a value to a variable outside a promise. But when I check the value it prints <code>undefined</code>, I defined the variable outside the promise so I don't understand why its <code>undefined</code></p> <p>Here is my code, hope you can help me with tha...
0debug
Bigrams as map keys in C++ : <p>Alright, so I'm wondering how I would go about creating a map key from a two word string (a bigram). For example, the line "This is only a test." would contain the bigrams "this is", "is only", "only a", and "a test."</p> <p>I'm thinking of using make_pair, but something tells me this c...
0debug
Nmap scan to get 2 random addresses with open port 80 in a prefix : How can I use nmap to get 2 random addresses with open port 80 in a prefix. Nmap takes time for port scanning, Is there way to speed up the scanning?
0debug
static void init_vlcs(ASV1Context *a){ static int done = 0; if (!done) { done = 1; init_vlc(&ccp_vlc, VLC_BITS, 17, &ccp_tab[0][1], 2, 1, &ccp_tab[0][0], 2, 1); init_vlc(&dc_ccp_vlc, VLC_BITS, 8, &dc_ccp_tab[0][1], 2, 1, ...
1threat
static void test_visitor_out_native_list_str(TestOutputVisitorData *data, const void *unused) { test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_STRING); }
1threat
I am writing a Movie Session Program. : I get the error: "Bad Operand Types for Binary Operator ">" first type: Time second type: Time" This is the method where it gives me the error: @Override public int compareTo(MovieSession currentMovieSession) { if (this.sessionTime < currentMovieSession.sess...
0debug
int main_loop(void) { #ifndef _WIN32 struct pollfd ufds[MAX_IO_HANDLERS + 1], *pf; IOHandlerRecord *ioh, *ioh_next; uint8_t buf[4096]; int n, max_size; #endif int ret, timeout; CPUState *env = global_env; for(;;) { if (vm_running) { ret = cpu_exec(env); ...
1threat
c++ dynamic array of pointers : <p>I'm trying to understand how to create a dynamic array of pointers in C++. I understand that <code>new</code> returns a pointer to the allocated block of memory and <code>int*[10]</code> is an array of pointers to <code>int</code>. But why to you assign it to a <code>int**</code>? I'...
0debug
Which code is better to find the first recurring alphabet in a string? : <p>The first code is:</p> <pre><code> string = "DBCABA" #computing the first recurring alphabet def compute_reccuring(): for a in string: var = string.count(a) if var &gt; 1: final = str(a) print(str(...
0debug
static int start_frame_overlay(AVFilterLink *inlink, AVFilterBufferRef *inpicref) { AVFilterContext *ctx = inlink->dst; OverlayContext *over = ctx->priv; inlink->cur_buf = NULL; over->overpicref = inpicref; over->overpicref->pts = av_rescale_q(inpicref->pts, ctx->inputs[OVERLAY]->time_base...
1threat
What does declare in `export declare type Xyz` mean vs `export type Xyz` : <p>In a definition file it is valid to write both:</p> <pre><code>export declare type Abc = string; export type Bcd = string; </code></pre> <p>The <code>declare</code> keyword here serves no purpose, correct?</p>
0debug
Lazarus - No Form Window, Dialogue Grey'd Out : <p>I've got a wee bit of experience with Pascal, as I've used it to create mods via TES5Edit for Skyrim, and I've hit a wee snag with modding Dark Souls, and I figured flexin' me Pascalerrific muscles would be a good exercise.</p> <p>But, uh, it's all buggered right from...
0debug
static int do_virtio_net_can_receive(VirtIONet *n, int bufsize) { if (!virtio_queue_ready(n->rx_vq) || !(n->vdev.status & VIRTIO_CONFIG_S_DRIVER_OK)) return 0; if (virtio_queue_empty(n->rx_vq) || (n->mergeable_rx_bufs && !virtqueue_avail_bytes(n->rx_vq, bufsize, 0))) { ...
1threat
How to get data of an specefic row or column in sql : <p>Example</p> <pre><code>id name surname 0 Alex A 1 Mark B 2 Bill C </code></pre> <p>Let's suppose that I want to get the name and surname where id equals 1 in Java, how can I get the values of each column</p>
0debug
void address_space_init(AddressSpace *as, MemoryRegion *root) { memory_region_transaction_begin(); as->root = root; as->current_map = g_new(FlatView, 1); flatview_init(as->current_map); QTAILQ_INSERT_TAIL(&address_spaces, as, address_spaces_link); as->name = NULL; memory_region_tra...
1threat
Create Shapes on a website given an input in Javascript : <p>Suppose I have an array in Javascript with integer values: <code>[10, 20, 30, 40, 50]</code>. My goal is to have rectangles side by side that have a width of 10 pixels and a height of the pixels specified in the array. In this case, I would have a rectangle 1...
0debug
Are C++17 Parallel Algorithms implemented already? : <p>I was trying to play around with the new parallel library features proposed in the C++17 standard, but I couldn't get it to work. I tried compiling with the up-to-date versions of <code>g++ 8.1.1</code> and <code>clang++-6.0</code> and <code>-std=c++17</code>, but...
0debug
Search into database based on user input : <p>I am a newbie in PHP. I am working on searching function, but it does not work well and I could not find why. The problem is; the <strong>$query has been sent and accepted well</strong> however it <strong>could not find the $query in the database</strong> even though the <s...
0debug
How to find last git commit before a merge : <p>After I have done a merge to my master branch from a working branch with git, I sometimes want to find to find the last commit on master before the merge happened. How do I do this?</p>
0debug
How does append() work in this code snippet? Confused with a particular variable : <p>Can someone explain this code to me? More specifically, the part about lead.append([sum1 - sum2 , 1]) and print(ans[1],ans[0]). </p> <p>I do not understand the "1" in "lead.append([sum1 - sum2 , 1])"</p> <p>I, also, do not understa...
0debug
Go:get fragment values in url : sample code <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> func main() { fmt.Print("starting box web server...") http.HandleFunc("/", landing) http.HandleFunc("/handle", handler) http.ListenAndServe(con...
0debug
Do function parameters take up local memory space? : <p>In the following example, am I taking up any local memory space in the function "add"? And if not, where are the parameter variables stored in memory?</p> <pre><code>void add(int *a, int *b, int *result){ *result = *a + *b; } int main(){ int a = 1, b = 2...
0debug
jQuery click() - not working more than once : Beginner stuff :) I want to add auto-scrolling to header images here: https://listify-demos.astoundify.com/classic/listing/the-drake-hotel/ So `document.querySelector('.slick-next').click();` can do the click and I'm trying to get it working in a loop. Running the ...
0debug
void ff_cavs_init_top_lines(AVSContext *h) { h->top_qp = av_malloc( h->mb_width); h->top_mv[0] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector)); h->top_mv[1] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector)); h->top_pred_Y = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y)); ...
1threat
int bdrv_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) { BlockDriver *drv = bs->drv; if (!drv) return -ENOMEDIUM; if (drv->bdrv_snapshot_create) return drv->bdrv_snapshot_create(bs, sn_info); if (bs->file) return bdrv_snapshot_...
1threat
the result of my code is 0 and i don't know why, can someone help me? : Can somebody help me please. The question is to print out the smallest prime number but bigger than other not prime number. after hours of work, my code print out 0 no matter what i type in, can anyone tell me where i go wrong? sorry for bad englis...
0debug
Geometric Distribution - Expected number of rolls of a die before a value occurs : <p>Say I want to calculate the expected number of rolls of a die before a particular value is rolled, let's say a 5. I know this involves geometric distribution. Is there an R function that can calculate this?</p>
0debug
Sql Server conditional within a condition : I want to say 'Where the first 2 letters are not 10 and for those that do start with 10 only exclude the ones from 2018 onward' where (left(c.DealCode, 2) <> '10' and estyear > 2018) Does not work.. What am I missing ?
0debug
ivshmem_client_parse_args(IvshmemClientArgs *args, int argc, char *argv[]) { int c; while ((c = getopt(argc, argv, "h" "v" "S:" )) != -1) { switch (c) { case 'h': ivshmem_cl...
1threat