problem
stringlengths
26
131k
labels
class label
2 classes
Visual studio code color picker : <p>I love visual studio code but there's one thing that is missing in my opinion.<br /> A color picker. <br /> Does anyone know if there's a color picker for visual studio code just like in visual studio?</p>
0debug
C++ Division Error? : <p>Hi so whenever I try to do division such as <strong>double x = 3 * (5/10);</strong> it will make x = 0 for some reason. Is there a reason this happens in c++ I'm learning and have no clue why this happens. </p>
0debug
def even_bit_toggle_number(n) : res = 0; count = 0; temp = n while(temp > 0 ) : if (count % 2 == 0) : res = res | (1 << count) count = count + 1 temp >>= 1 return n ^ res
0debug
How to write "@" in android emulator ? : <p>I have a MAC and with OPT-ò (italian keyboard layout) I can write "@" in ALL application but not in "Android emulator". I don't want to press "char per char" via virtual keyboard in my app. Is it possibile (and how) write "@" without virtual keyboard? </p>
0debug
Deleting subfolder and files in window through cmd and timestamp backup : <p>I want to delete files and folders from a folder by using cmd in windows.How can i do?</p> <p>And i need to copy a file and paste appending timestamp by time.</p> <p>Help will be appreciated</p> <p>Thanks!</p>
0debug
PHP Wamp server : <p>Hey I have a database that contains information about different countries. I also have a html page where you can submit information about countries. Can someone help me to write a code that says that the information has been stored in the database instead of it just redirecting to a blank page?</p>...
0debug
How to set a program that count similar items in a string? : <p>I have this list</p> <pre><code>dragonLoot = ['gold coin', 'dagger', 'gold coin', 'gold coin', 'ruby'] </code></pre> <p>I need a function that would tell me that there is 3 gold coin, 1 dagger and 1 ruby in the dragon loot.</p>
0debug
What are primitive, internal, builtin, and special functions? : <p>I have seen that some functions that call C-code are described as <code>primitive</code>, <code>internal</code>, <code>builtin</code>, or <code>special</code>. What are these functions?</p>
0debug
Vue. How to get a value of a "key" attribute in created element : <p>I try to create a components and get its key for using in axios. Elements created, but I can't get a key. It's undefined</p> <pre><code>&lt;div class="container" id="root"&gt; &lt;paddock is="paddock-item" v-for="paddock in paddocks" :key="paddoc...
0debug
Currency based on Http request getlocale throwing illegalargumentException : I am trying to get currency symbols based on locale, currency code in a servlet. I tried to do Currency getInstance(request.getlocale()) and it is throwing IllegalArgumentException. Locale has language as "en" but country value empty. ...
0debug
what could be the regular expression for the text "192.168.71.1 GET HTTP/1.0 /test/abc"? : what could be the relevant regular expression for the text "192.168.71.1 GET HTTP/1.0 /test/abc" i have tried for regular expressions separately but could not combine all these with a space in betweeen
0debug
How to write a block of text(multiple lines text) to a file in windows via batch file without using multiple echo call? : I have been trying to write multiple lines of text to a text file in windows but don't know how to do this. Also, search on the internet a lot about this but all solutions use echo command multiple ...
0debug
void aio_set_fd_handler(AioContext *ctx, int fd, bool is_external, IOHandler *io_read, IOHandler *io_write, void *opaque) { AioHandler *node; bool is_new = false; node = find_ai...
1threat
static inline int mov_get_stsc_samples(MOVStreamContext *sc, int index) { int chunk_count; if (mov_stsc_index_valid(index, sc->stsc_count)) chunk_count = sc->stsc_data[index + 1].first - sc->stsc_data[index].first; else chunk_count = sc->chunk_count - (sc->stsc_data[index].first - 1)...
1threat
Angular4: Http -> HttpClient - requestOptions : <p>So, I am trying to migrate from 'old' http to the new httpClient</p> <p>with the http client I am using this format in my service:</p> <pre><code>return this.http.get(environment.api+ '.feed.json', requestOptions) </code></pre> <p>how do I use this in httpClient?</p...
0debug
IEnumerable<T> Queue.Count is not returning an integer : <p>I am attempting to define a queue named movingAverages with a size of queue.Count - period. I am getting an error "int IEnumerable.Count() ... - cannot be applied to method and int.... </p> <pre><code>private static IEnumerable&lt;DateClose&gt; Moving...
0debug
static void pci_config(void) { QVirtioPCIDevice *dev; QOSState *qs; int n_size = TEST_IMAGE_SIZE / 2; uint64_t capacity; qs = pci_test_start(); dev = virtio_blk_pci_init(qs->pcibus, PCI_SLOT); capacity = qvirtio_config_readq(&dev->vdev, 0); g_assert_cmpint(capacity, ==, TE...
1threat
Monitor bluetooth peripheral state changes even when the app is killed : <p>At the moment I am using <code>CBCentralManager</code>'s constructor that accepts its delegate and other params. From that point on if the app is in foreground or background state the delegate method is called as expected as soon as the bluetoo...
0debug
How to download any files from server in android studio kotlin : <p>I am fairly new to Kotlin so I will like to try to create app that let users download files eg videos and save them into internal storage. Please help me out. Thanks in advance 🙏🏾 </p>
0debug
static void gen_dccci(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); #else if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); return; } #endif }
1threat
void vnc_tight_clear(VncState *vs) { int i; for (i=0; i<ARRAY_SIZE(vs->tight_stream); i++) { if (vs->tight_stream[i].opaque) { deflateEnd(&vs->tight_stream[i]); } } buffer_free(&vs->tight); buffer_free(&vs->tight_zlib); buffer_free(&vs->tight_gradient); #...
1threat
static int xen_pt_register_regions(XenPCIPassthroughState *s) { int i = 0; XenHostPCIDevice *d = &s->real_device; for (i = 0; i < PCI_ROM_SLOT; i++) { XenHostPCIIORegion *r = &d->io_regions[i]; uint8_t type; if (r->base_addr == 0 || r->size == 0) { conti...
1threat
static void dv_decode_ac(DVVideoDecodeContext *s, BlockInfo *mb, DCTELEM *block, int last_index) { int last_re_index; int shift_offset = mb->shift_offset; const UINT8 *scan_table = mb->scan_table; const UINT8 *shift_table = mb->shift_table; int pos = mb->pos; in...
1threat
Laravel - Send Notifications via Job class - Enqueueing Notifications to redis queue without sending them twice : <p>I want to enqueue notifications to redis queue via a job class. I ask myself what is the best practice to send notifications via a job and not sending them multiple times. My job is triggered by an artis...
0debug
static av_cold int g726_init(AVCodecContext * avctx) { G726Context* c = avctx->priv_data; unsigned int index= (avctx->bit_rate + avctx->sample_rate/2) / avctx->sample_rate - 2; if (avctx->bit_rate % avctx->sample_rate && avctx->codec->encode) { av_log(avctx, AV_LOG_ERROR, "Bitrate - Samplerat...
1threat
static void pack_yuv(TiffEncoderContext * s, uint8_t * dst, int lnum) { AVFrame *p = &s->picture; int i, j, k; int w = (s->width - 1) / s->subsampling[0] + 1; uint8_t *pu = &p->data[1][lnum / s->subsampling[1] * p->linesize[1]]; uint8_t *pv = &p->data[2][lnum / s->subsampling[1] * p->linesize[...
1threat
int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) { int pqindex, lowquant; int status; int mbmodetab, imvtab, icbptab, twomvbptab, fourmvbptab; int field_mode, fcm; v->numref = 0; v->p_frame_skipped = 0; if (v->second_field) { v->s.pict_type = (...
1threat
ngClass compare number with array of numbers dynamically - Angular : <p>I have something like this:</p> <pre><code>[ngClass]="{className: singleNumber == arrayOfNumbers} </code></pre> <p>How do I compare <code>1 === [1,2,3,4]</code> ? it works if I do this: arrayOfNumbers[0]</p>
0debug
How to recursively get the number of elements until reached all sqaures in 5 x 5 grid in scala : So I have a grid 5 x 5 grid. And my initial position is at (0,0) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 # 0 0 0 0 I have a method that finds all possible position in 'L' shape from that position...
0debug
what are mapping functions in c++? : <p>I have searched about mapping functions in n dimensional array but didn't find particular answer. I want to know that how multidimensional arrays works i c++? what is general formula for finding element at particular index in n dimensional array.?</p>
0debug
AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b) { AVFilterFormats *ret; unsigned i, j, k = 0; ret = av_mallocz(sizeof(AVFilterFormats)); ret->formats = av_malloc(sizeof(*ret->formats) * FFMIN(a->format_count, ...
1threat
When would you not drop a table before creating it? : <p>I don't understand why you wouldn't ever not drop a table before creating it. Do you want to do this when you want to restart a table from scratch and delete everything? I mean, you can't create the same table without dropping it first right? So wouldn't you alwa...
0debug
What is the difference between fields and properties in Julia? : <p>Julia has the setter functions <code>setproperty!</code> and <code>setfield!</code> and the getter functions <code>getproperty</code> and <code>getfield</code> that operate on structs. What is the difference between properties and fields in Julia?</p> ...
0debug
Change service config parameters at runtime : <p>I'm using mailgun to send mails thought Laravel 5.2. It configured on config/services.php like that:</p> <pre><code> 'mailgun' =&gt; [ 'domain' =&gt; env('mailgun_domain','mydomain.com'), 'secret' =&gt; env('mailgin_secret','my-secret-key-132152345423...
0debug
Is kubectl port-forward encrypted? : <p>I couldn't find any information on wherever a connection creation between cluster's pod and locahost is encrypted when running "kubectl port-forward" command.</p> <p>It seems like it uses "<a href="https://linux.die.net/man/1/socat" rel="noreferrer">socat</a>" library which supp...
0debug
virtio_crypto_check_cryptodev_is_used(const Object *obj, const char *name, Object *val, Error **errp) { if (cryptodev_backend_is_used(CRYPTODEV_BACKEND(val))) { char *path = object_get_canonical_path_component(val); error_setg(errp, "can't use ...
1threat
Why does increase() return a value of 1.33 in prometheus? : <p>We graph a timeseries with <code>sum(increase(foo_requests_total[1m]))</code> to show the number of foo requests per minute. Requests come in quite sporadically - just a couple of requests per day. The value that is shown in the graph is always 1.3333. Why ...
0debug
alert('Hello ' + user_input);
1threat
static av_cold int cook_decode_init(AVCodecContext *avctx) { COOKContext *q = avctx->priv_data; const uint8_t *edata_ptr = avctx->extradata; const uint8_t *edata_ptr_end = edata_ptr + avctx->extradata_size; int extradata_size = avctx->extradata_size; int s = 0; unsigned int channel_mask =...
1threat
static void bdrv_sync_complete(void *opaque, int ret) { }
1threat
Python (Turtle) drawing help Please : So my problem is that my height of the tower variable is not printing at all, and I feel if it did it would not work, I cannot understand why this isn't working please help. My Code: import turtle bob = turtle.Turtle() turtle.setup(width = 400, height = 300) ...
0debug
mode of a duplicate classifier is worth it? : hello i have a question about a classifier concept. case 1 if i have a classifier and the performance of that classifier up to 90%. and i create n another classifier with the same algorithm and same dataset and get performance 90% too. case2 same like case 1 but ev...
0debug
Install tensorflow on Ubuntu 14.04 : <p>I'm trying to follow <a href="https://www.tensorflow.org/get_started/os_setup#pip_installation" rel="noreferrer">these instructions</a> </p> <p><code>sudo apt-get install python-pip python-dev</code></p> <p><code>sudo pip install tensorflow</code></p> <pre><code>user@user-Virt...
0debug
How to get a text from SearchView? : <p>I need to get a text from SearchView and compare it to strings in my activity's ListView and show a Toast if the word in a SearchView is in my ListView. How do I do that? Here's my working code for the SearchView:</p> <pre><code>MenuItem ourSearchItem = menu.findItem(R.id.menu_i...
0debug
how to get value of cell in table and display it in textbox : <p>I have a table like this:</p> <pre><code>&lt;table id="mytable"&gt; &lt;tr&gt; &lt;th&gt;Customer Id&lt;/th&gt; &lt;th&gt;Name&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;123&lt;/td&gt; &lt;td&gt;A&lt;/td&gt; &lt;/tr&gt; &lt;tr&...
0debug
static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) { VAAPIEncodeContext *ctx = avctx->priv_data; VAEncSequenceParameterBufferH264 *vseq = ctx->codec_sequence_params; VAEncPictureParameterBufferH264 *vpic = ctx->codec_picture_params; VAAPIEncodeH264Context ...
1threat
Why my heroku node.js app is giving at=error code=H10 desc="App crashed" method=GET path="/"? : <p>I am trying to run my simple node app on Heroku. </p> <p>Here is the directory structure</p> <pre><code>├── app.js ├── assets ├── blog.html ├── index.html ├── node_modules └── package.json </code></pre> <p>Here is my a...
0debug
resize program works for some and not others : > so the problem, is suppose to take 3 arguments (factor, infile and outfile) the factor is a positive integer from 1 - 100. the program then is suppose to resize the infile image depending on the factor, 1 produce the same image and 2 twice as big and so on to the outfile...
0debug
Select only the most recent line of a table based on a field : <p>Given the following table:</p> <pre><code>Column1 Column2 Column3 Name1 "2016-05-11" Value1 Name2 "2016-05-11" Value2 Name2 "2015-05-17" Value3 Name3 "2014-07-31" Value4 Name4 "2011-07-31" Value5 Name4 "2013-07...
0debug
How we can sort numbers lexicographically without converting them to strings in C language? : <p>I have tried to sort the numbers using dictionary sort with converting them to strings.But I don't know how to sort numbers using dictionary sort without converting them to strings</p>
0debug
static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; VmdAudioContext *s = avctx->priv_data; int block_type; unsign...
1threat
static void qpeg_decode_inter(QpegContext *qctx, uint8_t *dst, int stride, int width, int height, int delta, const uint8_t *ctable, uint8_t *refdata) { int i, j; int code; int filled = 0; int orig_height; ...
1threat
Stop people getting my ip from my domain name.? : <p>1st of all YES my domain name is pointed at my ip no hate. The reason that is because i have a minecraft server + teamspeak server + Webserver.</p> <p>NOW, i released a minecraft server 2 days ago, on the 1st day i got taken down from DDOS Attacks, Due to people pul...
0debug
int qemu_devtree_nop_node(void *fdt, const char *node_path) { int offset; offset = fdt_path_offset(fdt, node_path); if (offset < 0) return offset; return fdt_nop_node(fdt, offset); }
1threat
Build project with Microsoft.Build API : <p>I'm trying to build a project using the classes in Microsoft.Build.</p> <p>The code is:</p> <pre><code>var project = new ProjectInstance(CS_PROJ_FILE); project.Build(); </code></pre> <p>However it's throwing the following exception:</p> <pre class="lang-none prettyprint-o...
0debug
static int decode_block_refinement(MJpegDecodeContext *s, DCTELEM *block, uint8_t *last_nnz, int ac_index, int16_t *quant_matrix, int ss, int se, int Al, int *EOBRUN) { int code, i=ss, j, sign, val, run; int last = FFMIN(se, *last_nnz); OPEN_READER(re,...
1threat
static void jump_to_IPL_code(uint64_t address) { write_subsystem_identification(); ResetInfo *current = 0; save = *current; current->ipl_addr = (uint32_t) (uint64_t) &jump_to_IPL_2; current->ipl_continue = address & 0x7fffffff; debug_print_int("set IPL addr to", cu...
1threat
how to use and what is the use lambda expression in java8? : can anyone tell the use of lambda expression in java8?.. I have tried this below program and could not get the meaning of the program.. public static void main(String[] args) { state s=new state(); MathOperation addition=( a, b) -> a+b; ...
0debug
Dev c++ code not compiling in viusual c++(codeblocks vs Visual Studio)(Begineer) : For some odd reason file declaration works diferently in Visual Studio the it does in code blocks. The following code runs perfectly fine in code:blocks but won't compile in Visual,and i don't have a clue why so.Couldn't figure out ...
0debug
Cross-Origin Request Blocked when loading local file : <p>I am currently developing a website and have trouble showing my font-icons in firefox. every browser except for firefox can load and show my font-icons, but on firefox I get the following error:</p> <p><code>Cross-Origin Request Blocked: The Same Origin Policy ...
0debug
C# Count Threading Not Working : <p>Good afternoon everybody. I am new to Parallel.ForEach and even newer to threading and I wanted to ask your opinion on what is wrong with this code.</p> <pre><code> using System; using System.Collections.Generic; using System.Linq; using System.Text; using System...
0debug
React Native and WMS : <p>I am developing a mobile application in React Native requiring the use of Web Map Services. I have not found any library or framework that allows use WMS and react native at same time. In React (Web) I found <a href="https://github.com/PaulLeCam/react-leaflet" rel="noreferrer">one</a>. My que...
0debug
static uint64_t g364fb_ctrl_read(void *opaque, target_phys_addr_t addr, unsigned int size) { G364State *s = opaque; uint32_t val; if (addr >= REG_CURS_PAT && addr < REG_CURS_PAT + 0x1000) { int idx = (addr - REG_CUR...
1threat
int v9fs_co_symlink(V9fsState *s, V9fsFidState *fidp, const char *oldpath, const char *newpath, gid_t gid) { int err; FsCred cred; cred_init(&cred); cred.fc_uid = fidp->uid; cred.fc_gid = gid; cred.fc_mode = 0777; v9fs_co_run_in_worker( { ...
1threat
Implement different concretions to an abstract class that implements a generic service : <p>I have a generic interface and one generic class with generic methods to query the database.</p> <pre><code> public interface IRepositoryBase&lt;Entity&gt; { IEnumerable&lt;TEntity&gt; GetAll(Func&lt;IQueryable&lt;TE...
0debug
static int coreaudio_init_out (HWVoiceOut *hw, struct audsettings *as) { OSStatus status; coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw; UInt32 propertySize; int err; const char *typ = "playback"; AudioValueRange frameRange; err = pthread_mutex_init(&core->mutex, NULL); ...
1threat
static coroutine_fn int qcow2_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int count, BdrvRequestFlags flags) { int ret; BDRVQcow2State *s = bs->opaque; uint32_t head = offset % s->cluster_size; uint32_t tail = (offset + count) % s->cluster_size; trace_qcow2_pwrite_zeroes_st...
1threat
static int parse_drive(DeviceState *dev, Property *prop, const char *str) { DriveInfo **ptr = qdev_get_prop_ptr(dev, prop); *ptr = drive_get_by_id(str); if (*ptr == NULL) return -ENOENT; return 0; }
1threat
Why not send data with AJAX-script? : Tell me please, there is a form for sending data to the database. Without a script it works fine, but nothing happens with the script. In the console — Form Data has all the data, and the 200th code arrives, but is not added to the database. PHP: <?php $data = $_POST...
0debug
div.my-class vs. .my-class any benefits? : <p>If I am to only use this class on a div. Is there any benefit to using the first over the second?</p> <pre><code>div.my-class .my-class </code></pre>
0debug
PHP: Transforming Array Orientation : In PHP - Any Help for me in transforming array it's actually a query result from mysql DB > **Existing:** > ( > [ITEM] => Array > ( > [0] => PRODUCT A > [1] => PRODUCT B > [2] => PRODUCT C > ...
0debug
def long_words(n, str): word_len = [] txt = str.split(" ") for x in txt: if len(x) > n: word_len.append(x) return word_len
0debug
Class template argument deduction and default template parameters : <p>The following stripped down code doesn't work with the latest clang++5 but is accepted by g++7:</p> <pre><code>template&lt;typename Wrapped, typename U&gt; struct wrapper; template&lt;typename Wrapped, typename U=int&gt; struct wrapper { wrapp...
0debug
splitting a full url into parts : <p>I'm trying to split a url into parts so that I can work with these separately. </p> <p>For e.g. the url:</p> <p><code>'https://api.somedomain.co.uk/api/addresses?postcode=XXSDF&amp;houseNo=34'</code></p> <p>How can I split this into: 1) the source/origin (i.e. protocol + subdomai...
0debug
int ff_mjpeg_decode_sos(MJpegDecodeContext *s) { int len, nb_components, i, h, v, predictor, point_transform; int index, id; const int block_size= s->lossless ? 1 : 8; int ilv, prev_shift; len = get_bits(&s->gb, 16); nb_components = get_bits(&s->gb, 8); if (len != 6+2*nb_...
1threat
static int nfs_file_create(const char *url, QemuOpts *opts, Error **errp) { int ret = 0; int64_t total_size = 0; NFSClient *client = g_new0(NFSClient, 1); QDict *options = NULL; client->aio_context = qemu_get_aio_context(); total_size = ROUND_UP(qemu_opt_get_size_del(opts, BLOCK...
1threat
static void omap_screen_dump(void *opaque, const char *filename, bool cswitch, Error **errp) { struct omap_lcd_panel_s *omap_lcd = opaque; DisplaySurface *surface = qemu_console_surface(omap_lcd->con); omap_update_display(opaque); if (omap_lcd && surface_data(surface...
1threat
Solving linter error no-undef for document : <p>I am using <code>airbnb</code> extension for linting my React Project. Now, in my <code>index.js</code> I have:</p> <pre><code>import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; ReactDOM.render( &lt;App /&gt;, document.getElementBy...
0debug
static gboolean tcp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque) { CharDriverState *chr = opaque; TCPCharDriver *s = chr->opaque; uint8_t buf[READ_BUF_LEN]; int len, size; if (!s->connected || s->max_size <= 0) { return TRUE; } len = sizeof(buf); if (le...
1threat
SSRS Lookup Based on Multiple Conditions : <p>I have a dataset (Volume) looks like this:</p> <p><a href="https://i.stack.imgur.com/HhzIc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HhzIc.png" alt="enter image description here"></a></p> <p>In my report, what I want to get is this: </p> <p><a href="https...
0debug
uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2) { int r = sclp_service_call(env, r1, r2); if (r < 0) { program_interrupt(env, -r, 4); return 0; } return r; }
1threat
php move_uploaded_files and copy not working : both the functions work for file whose size is less than 10MB. It does not copy when the file size is more than 10MB. php.ini files have following post_max_size = 300M upload_max_filesize = 300M memory_limit = 128M Destination directory has required ...
0debug
static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh, struct msghdr *msgh) { struct cmsghdr *cmsg = CMSG_FIRSTHDR(msgh); abi_long msg_controllen; abi_ulong target_cmsg_addr; struct target_cmsghdr *target_cmsg, *target_cmsg_start; ...
1threat
static void hpet_timer(void *opaque) { HPETTimer *t = (HPETTimer*)opaque; uint64_t diff; uint64_t period = t->period; uint64_t cur_tick = hpet_get_ticks(); if (timer_is_periodic(t) && period != 0) { if (t->config & HPET_TN_32BIT) { while (hpet_time_after(cur_tick, t->...
1threat
Having trouble looping through an array in c++ : <p>I seem to be looping through my array wrong, I've got it set up to prompt the user for a list of numbers and I am supposed to be comparing it to another number that the user sets. </p> <pre><code>#include &lt;iostream&gt; using namespace std; bool chk = true; int mai...
0debug
static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, int line_size) { int i; vector unsigned char perm = vec_lvsl(0, pixels); vector unsigned char bytes; const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0); vector signed short shorts; ...
1threat
How to pass each id from JSP to javascript? : In our JSP application, we are creating a html buttons in for loop. Say, for example, <%for(int i=0;i<5;i++){%> <input type="button" class="btn-success btn-rounded" id ="?????" value="abcd" onclick="changeButton()"> Now i want pass each button's id to javascript met...
0debug
Java - Calling the constructor of a superclass fails : <p>Here is a basic class I have set up to calculate earnings with stocks. Focus on the "Stock" constructor here: </p> <pre><code>public class Stock{ private String symbol; private int totalShares; private double totalCost; public void Stock(String...
0debug
void unregister_savevm(const char *idstr, void *opaque) { SaveStateEntry *se, *new_se; TAILQ_FOREACH_SAFE(se, &savevm_handlers, entry, new_se) { if (strcmp(se->idstr, idstr) == 0 && se->opaque == opaque) { TAILQ_REMOVE(&savevm_handlers, se, entry); qemu_free(se); ...
1threat
Javascrip onclick pick random html element and style it : Hello I am need some help with javascript I am newbie self-taught How can i code - I have a table and 2 buttons, when i press button I want to pick random table data (from 1 to 9) and change it background color and when i press second button - change tabl...
0debug
How to change display name of an app in react-native : <p>Apple have <a href="https://developer.apple.com/library/prerelease/content/qa/qa1823/_index.html" rel="noreferrer">clear instructions</a> on how to change the display name of an IOS app, but they are not useful for a react-native app because the folder structure...
0debug
static uint32_t apic_mem_readw(void *opaque, target_phys_addr_t addr) { return 0; }
1threat
How can it search inside the directory, if the directory is empty? : I just started learning python and found this snippet. It's supposed to count how many times a word appears. I guess, for all of you this will seem very logical, but unfortunately for me, it doesn't make any sense. str = "house is where you live, ...
0debug
static inline void tlb_update_dirty(CPUTLBEntry *tlb_entry) { ram_addr_t ram_addr; void *p; if ((tlb_entry->addr_write & ~TARGET_PAGE_MASK) == io_mem_ram.ram_addr) { p = (void *)(unsigned long)((tlb_entry->addr_write & TARGET_PAGE_MASK) + tlb_entry->addend); ram_addr = q...
1threat
What's the purpose of this lambda? : <p>I see the following lambda in C++ code. What's the purpose of it?</p> <pre class="lang-cpp prettyprint-override"><code>static const auto faster = [](){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); return nullptr; }(); </code></pre>
0debug
pvscsi_update_irq_status(PVSCSIState *s) { PCIDevice *d = PCI_DEVICE(s); bool should_raise = s->reg_interrupt_enabled & s->reg_interrupt_status; trace_pvscsi_update_irq_level(should_raise, s->reg_interrupt_enabled, s->reg_interrupt_status); if (s->msi_used && ...
1threat
static void virtio_scsi_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) { VirtIOSCSI *s = (VirtIOSCSI *)vdev; VirtIOSCSIReq *req; while ((req = virtio_scsi_pop_req(s, vq))) { int type; if (iov_to_buf(req->elem.out_sg, req->elem.out_num, 0, &type, sizeof(type)...
1threat
Are neural networks capable of estimating human facial attractiveness in 2018? : <p>I'm trying to understand if the project I'm thinking about is feasible or not using Neural Networks. I'm aware of apps like MakeApp and FakeApp which use neural networks to manipulate human faces. </p> <p>My question is - <strong>Can m...
0debug
I need to read user input (numberdecimal) and convert that input to double format. My app keep crashing. I am trying to display user input in textView : <p>Trying to read input and then display it in textview and utilize that user input. I am not sure how to read user input and use that input it could be string or numb...
0debug
Custom list implementation iterator can't access last element (c++) : <p>I'm implementing a custom list for a personal project &amp; I can't seem to access the last element with an iterator.</p> <p>It's basically a flat doubly linked list (with next &amp; previous node pointers). </p> <p><strong>expression.hpp</stron...
0debug