problem
stringlengths
26
131k
labels
class label
2 classes
static void disas_cond_b_imm(DisasContext *s, uint32_t insn) { unsigned int cond; uint64_t addr; if ((insn & (1 << 4)) || (insn & (1 << 24))) { unallocated_encoding(s); return; } addr = s->pc + sextract32(insn, 5, 19) * 4 - 4; cond = extract32(insn, 0, 4); if (c...
1threat
Using a random string generator in c++ constructor : <p>When attempting to randomly generate a string for a name attribute in a class, the output seems to print the same string for each object.</p> <p>When I run this in the debugger, a unique name identifier IS generated for each Array object, however, when compiling ...
0debug
jQuery sum input values of each divs? : <p>I'm looking for a way to create a sum of inputs within an element. </p> <p>I'm running into this problem that whenever I'm using each, the function itself sums all values and not just those within the div. </p> <p>Working with this isn't working as hoped:</p> <pre><code>$('...
0debug
how can i get Price for Size 0.75 , Color = K and Clarity = IF? : Shape Purity Color From Size To Size Price ---------- BR IF D 0.5 0.69 8600 BR VVS1 D 0.5 0.69 6600 BR VVS2 D 0.5 0.69 5800 BR VS1 D 0.5 0.69 4700 BR VS2 D 0.5 0.69 4300 BR SI1 D 0.5 0.69 3600 BR SI2 D 0.5 0.69 2900 BR SI3 D 0.5 0.69 2600 ...
0debug
Facebook Access Token always null : <p>I have some code in my main Activity which calls My facebook Login activity class if AccessToken.getCurrentAccessToken() is null:</p> <pre><code>import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; impo...
0debug
static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix, const int *block_offset, const int16_t *block, ptrdiff_t stride) { int i; for(i=0; i<4; i++) FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i...
1threat
Can ML Kit for Firebase be used for handwritten text? : <p>Concerning the new ML Kit for Firebase, all the examples I have seen from Google is recognizing "machine" text, but I was wondering if it is possible to use the new ML Kit for Firebase to extract handwritten characters as well?</p> <p>I think not, but I cannot...
0debug
how to parse crul to json? : i am new in using curl, and i don t know how to parse this link to json curl --get --include 'https://doodle-manga- scraper.p.mashape.com/mangafox.me/manga/naruto/1' \ -H 'X-Mashape-Key: LhdkCyyF6Tmsh3BXTnN79quTbg08p1j2B20jsn89wOXridOzNe' \ -H 'Accept:...
0debug
static int opt_input_ts_scale(const char *opt, const char *arg) { unsigned int stream; double scale; char *p; stream = strtol(arg, &p, 0); if (*p) p++; scale= strtod(p, &p); if(stream >= MAX_STREAMS) ffmpeg_exit(1); ts_scale = grow_array(ts_scale, sizeof(...
1threat
How to use migration programmatically in EntityFramework Codefirst? : <p>I'm working in a project that uses EF Code First. I'm trying to use migration features. I don't want to use Package Console Manager. How can I execute the "Add-Migration" and "Update-Database" programmatically? </p> <pre><code>add-migration TestM...
0debug
How to combine a .map() with a promise? : <p>I have an array and I need, for each element of this array, to <code>fetch</code> some data (dependent on the element) and add this data to the element in the array.</p> <p>To set an example, I will simulate the <code>fetch</code> with a Promise (in real life, this will be ...
0debug
void avfilter_uninit(void) { memset(registered_avfilters, 0, sizeof(registered_avfilters)); next_registered_avfilter_idx = 0; }
1threat
integer function with no return value : <p>I'm trying to execute the below code, since the function has no return value but it was defined with integer return type. how it was running without any error.</p> <pre><code>#include &lt;stdio.h&gt; int fn(int a, int b){ int temp = b; a = 2*temp; b = a; } int main() { ...
0debug
How can I display opening (bottom aligned) quotation marks in Java? (Android Studio) : is it possible to display in a TextView a bottom aligned quotation mark [like this][1] in Android Studio(3.5.3) with java? [1]: https://i.stack.imgur.com/9qSFM.jpg
0debug
static void set_bmc_global_enables(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, uint8_t *rsp, unsigned int *rsp_len, unsigned int max_rsp_len) { IPMI_CHECK_CMD_LEN(3); set_global_enables(ibs, c...
1threat
void qemu_bh_schedule(QEMUBH *bh) { AioContext *ctx; if (bh->scheduled) return; ctx = bh->ctx; bh->idle = 0; smp_mb(); bh->scheduled = 1; aio_notify(ctx); }
1threat
db.execute('SELECT * FROM employees WHERE id = ' + user_input)
1threat
static void ffm_seek1(AVFormatContext *s, int64_t pos1) { FFMContext *ffm = s->priv_data; ByteIOContext *pb = s->pb; int64_t pos; pos = pos1 + ffm->write_index; if (pos >= ffm->file_size) pos -= (ffm->file_size - FFM_PACKET_SIZE); #ifdef DEBUG_SEEK av_log(s, AV_LOG_DEBUG, "see...
1threat
Error:(5,19) java: package org.mockito does not exist : <p>I wanted to learn a bit about Mockito, but when I run my test class I get the following errors, even though I import the package:</p> <p><a href="https://i.stack.imgur.com/eGEO2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eGEO2.png" alt=...
0debug
static void rtas_ibm_query_interrupt_source_number(sPAPREnvironment *spapr, uint32_t token, uint32_t nargs, target_ulong args, ...
1threat
static void destroy_buffers(VADisplay display, VABufferID *buffers, unsigned int n_buffers) { unsigned int i; for (i = 0; i < n_buffers; i++) { if (buffers[i]) { vaDestroyBuffer(display, buffers[i]); buffers[i] = 0; } } }
1threat
static av_cold int ljpeg_encode_close(AVCodecContext *avctx) { LJpegEncContext *s = avctx->priv_data; av_frame_free(&avctx->coded_frame); av_freep(&s->scratch); return 0; }
1threat
Take Text from an EntryBox and then write it to a txt file : <p>All, I have attempted this a few different ways and am still struggling here. </p> <p>I want to have someone write in this Entry Box and then once submit is hit, it should write the text to the .txt file. I'm obviously not very good. </p> <pre><code>impo...
0debug
I have a error on my sql kindly help me : UPDATE CaTbItemRequest SET vcReqStatus='complete' , vcItemCode='781015020002' WHERE inItemRequestNo=2000003 and vcDelFlag='false' and vcItemNatureType='Services' (Note vcItemCode -varchar(50)) The error MSG is Msg 248, Level 16, State 1, Procedure ExtendCode, Lin...
0debug
Disable the "a" attribute underline? : <p>I was wondering how you would disable to underline on the "a" attribute, for href's. I find it annoying, and I was wondering if there was a bit of code I could add to my .css to change it. Thank you.</p>
0debug
static void tcg_opt_gen_mov(TCGArg *gen_args, TCGArg dst, TCGArg src, int nb_temps, int nb_globals) { reset_temp(dst, nb_temps, nb_globals); assert(temps[src].state != TCG_TEMP_COPY); if (src >= nb_globals) { assert(temps[src].state != TCG_TEMP_CONST...
1threat
static void tpm_passthrough_cancel_cmd(TPMBackend *tb) { TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb); int n; if (tpm_pt->tpm_executing) { if (tpm_pt->cancel_fd >= 0) { n = write(tpm_pt->cancel_fd, "-", 1); if (n != 1) { error_repor...
1threat
static int rm_assemble_video_frame(AVFormatContext *s, ByteIOContext *pb, RMDemuxContext *rm, RMStream *vst, AVPacket *pkt, int len, int *pseq) { int hdr, seq, pic_num, len2, pos; int type; hdr = get_byte(pb); len--; type = h...
1threat
Promise error The message port closed before a reponse was received : <p>I've just started to get this error:</p> <p><code>Uncaught (in promise) Objectmessage: "The message port closed before a reponse was received."</code></p> <p>at chrome-extension://gppongmhjkpfnbhagpmjfkannfbllamg/js/browser-polyfill.js at this l...
0debug
What is the '1995-12-17T03:24:00' for of a datetime called? : <p>I'm trying to to create a method that returns a random date in that format in the from today to a year ago. So right now I have</p> <pre><code>var curDate = new Date(), oneYearAgo = curDate-365*24*60*60*1000, randDate = new Date(Math.random() * ...
0debug
Call mysql Database remotely from another network in golang : I am new to MYSQL database and i m using go lang for my application. I have tried remote database calling with in the network.It is working but i would like to know can we do this if the remote call is from different network (i.e: for example database host ...
0debug
Opening new window in php with echo with predetermined size and width : So I have something that looks like this and I am trying to open a new link with predetermined size/with PHP echo. Here is what I have, echo '<a href=“noticeboard.php?charid=' .$row_char['noticeID'].'"STYLE="text-decoration: none" target="_b...
0debug
How does one initialize a variable with tf.get_variable and a numpy value in TensorFlow? : <p>I wanted to initialize some of the variable on my network with numpy values. For the sake of the example consider:</p> <pre><code>init=np.random.rand(1,2) tf.get_variable('var_name',initializer=init) </code></pre> <p>when I ...
0debug
void eth_get_protocols(const uint8_t *headers, uint32_t hdr_length, bool *isip4, bool *isip6, bool *isudp, bool *istcp) { int proto; size_t l2hdr_len = eth_get_l2_hdr_length(headers); assert(hdr_length >= eth_get_l2_hdr_length(heade...
1threat
void slirp_init(int restricted, const char *special_ip) { #ifdef _WIN32 { WSADATA Data; WSAStartup(MAKEWORD(2,0), &Data); atexit(slirp_cleanup); } #endif link_up = 1; slirp_restrict = restricted; if_init(); ip_init(); m_init(); i...
1threat
How to detect when a React Native app is opened? : <p>My React Native app wants to synchronize its local data with an API when the user opens the app. This should happen whenever the user returns to the app, not just when it first starts. Essentially, what I would like is the equivalent of AppDelegate's <code>applicati...
0debug
static void rtas_ibm_write_pci_config(sPAPREnvironment *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets) { uint32_t val, size, addr; uint64_t buid = ...
1threat
node 0.12.x const in strict mode issue : <p>I'm running node v0.12.7, and installed protractor through npm. Now I'm trying to run the conf.js using this <a href="https://angular.github.io/protractor/#/tutorial">simple tutorial</a>, and I get the following error when executing the command <code>protractor conf.js</code>...
0debug
struct pxa2xx_i2c_s *pxa2xx_i2c_init(target_phys_addr_t base, qemu_irq irq, int ioregister) { int iomemtype; struct pxa2xx_i2c_s *s = (struct pxa2xx_i2c_s *) i2c_slave_init(i2c_init_bus(), 0, sizeof(struct pxa2xx_i2c_s)); s->base = base; s->irq = irq; s->slave.e...
1threat
static int stdio_get_fd(void *opaque) { QEMUFileStdio *s = opaque; return fileno(s->stdio_file); }
1threat
static int hls_window(AVFormatContext *s, int last) { HLSContext *hls = s->priv_data; ListEntry *en; int64_t target_duration = 0; int ret = 0; AVIOContext *out = NULL; char temp_filename[1024]; int64_t sequence = FFMAX(hls->start_sequence, hls->sequence - hls->size); snprintf(...
1threat
Most recent created subdirectory in directory (PHP) : <p>For example - I have some subdirectory like this in ftp:</p> <pre><code>public_html/raports/pdf/ </code></pre> <p>And in 'pdf' folder there are automatically created folders by month and year like: 07.2017, 08.2017, 09.2017 ... etc. </p> <p>I would like to cre...
0debug
static void spr_write_40x_dbcr0 (void *opaque, int sprn) { DisasContext *ctx = opaque; gen_op_store_40x_dbcr0(); RET_STOP(ctx); }
1threat
static av_cold int psy_3gpp_init(FFPsyContext *ctx) { AacPsyContext *pctx; float bark; int i, j, g, start; float prev, minscale, minath; ctx->model_priv_data = av_mallocz(sizeof(AacPsyContext)); pctx = (AacPsyContext*) ctx->model_priv_data; minath = ath(3410, ATH_ADD); for (j...
1threat
How to update the Redux store after Apollo GraphQL query returns : <p>I'm fetching a list of data with the <code>graphql</code> HOC provided by react apollo. E.g.:</p> <pre><code>const fetchList = graphql( dataListQuery, { options: ({ listId }) =&gt; ({ variables: { listId, }, }), pro...
0debug
Github user email is null, despite user:email scope : <p>I am following <a href="https://developer.github.com/v3/oauth/" rel="noreferrer">Github’s OAuth flow</a>, and obtaining an access token that gives me access to the user’s email scope. When I exchange a code for an access token, using the <a href="https://github....
0debug
when am trying to validate the jsp form on keypress event , it shows alert box first before entering any data onto input field? : <html> <head> <script text/javascript> var inputs = document.getElementsByTagName("input"); function checkTabPress(e) { for(var i=0;i<inputs.lengt...
0debug
static void set_int16(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; int16_t *ptr = qdev_get_prop_ptr(dev, prop); Error *local_err = NULL; int64_t value; if (dev->state != DEV_STATE...
1threat
static uint64_t ecc_diag_mem_read(void *opaque, target_phys_addr_t addr, unsigned size) { ECCState *s = opaque; uint32_t ret = s->diag[(int)addr]; trace_ecc_diag_mem_readb(addr, ret); return ret; }
1threat
static inline uint8_t fat_chksum(const direntry_t* entry) { uint8_t chksum=0; int i; for(i=0;i<11;i++) { unsigned char c; c = (i < 8) ? entry->name[i] : entry->extension[i-8]; chksum=(((chksum&0xfe)>>1)|((chksum&0x01)?0x80:0)) + c; } return chksum; }
1threat
static void raw_fd_pool_put(RawAIOCB *acb) { BDRVRawState *s = acb->common.bs->opaque; int i; for (i = 0; i < RAW_FD_POOL_SIZE; i++) { if (s->fd_pool[i] == acb->fd) { close(s->fd_pool[i]); s->fd_pool[i] = -1; } } }
1threat
static uint64_t vfio_rtl8168_window_quirk_read(void *opaque, hwaddr addr, unsigned size) { VFIOQuirk *quirk = opaque; VFIOPCIDevice *vdev = quirk->vdev; switch (addr) { case 4: if (quirk->data.flags) { trace_vfio_rtl8168_windo...
1threat
static uint64_t sdhci_read(void *opaque, hwaddr offset, unsigned size) { SDHCIState *s = (SDHCIState *)opaque; uint32_t ret = 0; switch (offset & ~0x3) { case SDHC_SYSAD: ret = s->sdmasysad; break; case SDHC_BLKSIZE: ret = s->blksize | (s->blkcnt << 16); b...
1threat
static ssize_t block_crypto_read_func(QCryptoBlock *block, void *opaque, size_t offset, uint8_t *buf, size_t buflen, Error **...
1threat
static void uhci_async_cancel_device(UHCIState *s, USBDevice *dev) { UHCIAsync *curr, *n; QTAILQ_FOREACH_SAFE(curr, &s->async_pending, next, n) { if (curr->packet.owner == NULL || curr->packet.owner->dev != dev) { continue; } uhci_async_unlink(s, curr); ...
1threat
Regex to find sequence of words that can repeat : <p>I would like to identify the following pattern on a string (all words are separated by comma)<br> 1. The string starts with RO,TA,PR<br> 2. The string ends with TA,TO<br> 3. After RO,TA,PR it can have multiples TA,PR<br></p> <p>Example of valid patterns:<br> - RO,T...
0debug
static void s390_virtio_rng_instance_init(Object *obj) { VirtIORNGS390 *dev = VIRTIO_RNG_S390(obj); object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_RNG); object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL); object_property_add_link(obj, "rng", TYPE_RNG_BACKEND, ...
1threat
static void term_handle_command(const char *cmdline) { const char *p, *pstart, *typestr; char *q; int c, nb_args, len, i, has_arg; term_cmd_t *cmd; char cmdname[256]; char buf[1024]; void *str_allocated[MAX_ARGS]; void *args[MAX_ARGS]; #ifdef DEBUG term_printf("command='...
1threat
while opening "https://www.flipkart.com/" a window opens for login. How to handle this window in selenium? : System.setProperty("webdriver.gecko.driver", "F:\\Software_Sel\\GekoDriver\\geckodriver-v0.16.1-win64\\geckodriver.exe"); WebDriver wd = new FirefoxDriver(); wd.get("https://www.flipkart.com/") ...
0debug
Where may I find an IQueryable implementation of Contains for T-SQL? : <p>Everytime I do a:</p> <pre><code>journals = _context.Journals .Where(j =&gt; j.Name.Contains("foo")); </code></pre> <p>I feel the need to stop and write an extension on <code>IQueryable</code> that will make the <code>Contains</code...
0debug
How do i assign foreign key value to my post : # This my part of CreateView def post(self, request, *args, **kwargs): form = BussinessDetailForm(request.POST,request.FILES or None) form2 = MultipleImageForm(request.POST or None, request.FILES or None) files = request.FILES.getlist(...
0debug
Maximum absolute difference in an array : <p>I came across this algorithm question. I was able to implement a O(n^2) solution. Is there a better way of doing this in O(n) time? </p> <p><strong>Question:</strong></p> <p>You are given an array of N integers, <code>A1, A2 ,…, AN</code>. Return maximum value of <code>f(i...
0debug
python String out of index : def cleanupstring (S): newstring = ["", 0] j = 1 for i in range(len(S)): if S[i] != " " and S[i+1] != " ": newstring[0] = newstring[0] + S[i] else: newstring[1] = newstring [1] + 1 return newstring # main pro...
0debug
why lazy loaded module has to import commonModule? Angular 2 : <p>When we import <strong>BrowserModule</strong> in root module of application ,we can use NgIf and NgFor( in eagerly loaded component). But for lazy loaded modules I have to import CommonModule which has been exported by BrowserModule of root. SO why do we...
0debug
Using mongoose promises with async/await : <p>I'm trying to get the hang of using Mongoose promises with the async/await functionality of Node.js. When my function <code>printEmployees</code> is called I want to save the list of employees which are queried by the <code>orderEmployees</code> function. While, the <code>c...
0debug
c++ array of type class : <p>I have just started learning c++. I have a question in an assignment that reads: Consider the following class declaration with a main() function. There are two errors in the main() function. Name them and explain how to fix them.</p> <pre><code>//Question Three Start #include &lt;iostream&...
0debug
Add an element on the last Jekyll loop of posts : <p>I'm sure this is simple but cant find the answer.</p> <p>There is a standard Jekyll/Liquid post iterator. How do i use the <code>{% if %}</code> statement below to put the <code>&lt;hr&gt;</code> element for each post <strong>except</strong> the last?</p> <pre><cod...
0debug
def count_Char(str,x): count = 0 for i in range(len(str)): if (str[i] == x) : count += 1 n = 10 repititions = n // len(str) count = count * repititions l = n % len(str) for i in range(l): if (str[i] == x): count += 1 return...
0debug
Discord.js: "if (message.channel.name === '')" not working : <p>I'm trying to make a bot not respond if the message isn't in a channel, for some reason using </p> <pre class="lang-js prettyprint-override"><code>if (message.channel.name === '') </code></pre> <p>doesn't work. I can see the channel name by using if I c...
0debug
Unable to insert a row into my Bug_Project table : <p>I am writing a database in oracle and am i little stuck with the following error code:</p> <pre><code>Error starting at line : 95 in command - INSERT INTO Bug_Project(Bug_ID, Project_ID) VALUES (00, 00) Error at Command Line : 95 Column : 33 Error report - SQL Erro...
0debug
Why is my pogram crashing when I try to initialize my pointer? : So my program runs the numElements method but than crashes, am I declaring my variables wrong or is my pointer variable wrong? Header.h typedef struct Node { int number; struct Node *pNext; }Node; Other.h int i,j,...
0debug
How To Convert URL to Image in android. Here showing URL's in GridView by using arrayList and ArrayAdapter : > i am using GridView and fetching all urls with data from server in android now i want to convert these url's in to images.
0debug
How can i calculate the cost of the Loan with the Capital and interest rate? Vba : I´m doing a Intership as a Developer an got a tough exercise. I´ve got a Loan Text and there are 3 Fields blank, the Loan, the Capital and the interest rate. I´ve created already the and it look like this: Private Sub l_jahre_...
0debug
VueJS - Unit testing with vue-test-utils gives error - TypeError: _vm.$t is not a function : <p>Relatively new to Vuejs and testing its components. Using vue-test-utils and jest for testing. Getting following error <a href="https://i.stack.imgur.com/rQejp.jpg" rel="noreferrer">test log</a></p> <p>The .vue file consis...
0debug
Javascript - Make specific text a link : <p>I'm looking at a 'to do' list application that uses JavaScript. One of the functions converts text in to a hyperlink when https, https or ftp is present.</p> <p>I'd like to expand this so if my text contains # followed by any 5 digit number, that becomes a link as well. The ...
0debug
static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) { AVStream *st = c->fc->streams[c->fc->nb_streams-1]; MOVStreamContext *sc = st->priv_data; int entries, i, j; get_be32(pb); entries = get_be32(pb); if (entries >= UINT_MAX / sizeof(*sc->drefs)) return...
1threat
Which operation is more expensive?Order by or group by? : <p>Which operation is more expensive?Order by or group by?</p>
0debug
static inline void vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, int mvn, int r_x, int r_y, uint8_t* is_intra, int dir) { MpegEncContext *s = &v->s; int xy, wrap, off = 0; int A[2], B[2], C[2]; int px, py; int a_valid = 0, b_valid = 0, c_va...
1threat
void bdrv_release_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap) { BdrvDirtyBitmap *bm, *next; QLIST_FOREACH_SAFE(bm, &bs->dirty_bitmaps, list, next) { if (bm == bitmap) { assert(!bdrv_dirty_bitmap_frozen(bm)); QLIST_REMOVE(bitmap, list); hbitmap_f...
1threat
how to fix my for code in java, not working : <p>Program that accepts integers and stores them in an array, and outputs the largest number of them. but following code is not working</p> <p>import java.util.Scanner;</p> <p>public class Test2 {</p> <pre><code>public static void main(String[] args){ System.out.prin...
0debug
Owl Carousel 2 Nav on Sides : <p>Hi I'm using Owl Carousel version 2 and can't find an example to put the navigation on the sides of the carousel like right and left chevrons or arrows. How do you do it?</p>
0debug
static int get_phys_addr_v5(CPUARMState *env, uint32_t address, int access_type, int is_user, hwaddr *phys_ptr, int *prot, target_ulong *page_size) { CPUState *cs = CPU(arm_env_get_cpu(env)); int code; uint32_t table; uint32_t desc; int...
1threat
uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar, int64_t overflow_time) { int64_t d = acpi_pm_tmr_get_clock(); if (d >= overflow_time) { ar->pm1.evt.sts |= ACPI_BITMASK_TIMER_STATUS; } return ar->pm1.evt.sts; }
1threat
Best software to view OLAP Cube : <p>I connected to an analysis server using (32-bit) Ms Excel, but it crashed since the amount of data was big. Then I used SQL Server Management Studio, even that did not worked for me since it seems like SSMS is an administrator tool and you need to have administrator rights for the D...
0debug
Use ViewChild for dynamic elements - Angular 2 & ionic 2 : <p>I want use multiple <a href="https://ionicframework.com/docs/api/components/slides/Slides/" rel="noreferrer">IonicSlides</a> that I added thease dynamically, So I can't use viewChild . please suggest a way for this problem. </p> <p><strong>Template.html :</...
0debug
How to mock generators with mock.patch : <p>I have gone through the page <a href="https://docs.python.org/3/library/unittest.mock-examples.html" rel="noreferrer">https://docs.python.org/3/library/unittest.mock-examples.html</a> and i see that they have listed an example on how to mock generators</p> <p>I have a code w...
0debug
display hidden form when specific number of integers/characters are entered into a text field : <p>I am trying to create a function where when a specific number of integers (eg. a phone number) are entered into a text field, a hidden form is displayed and both initial text field and form re-positioned. </p> <p>Any exa...
0debug
In JavaScript, is constructor mandatory in a class? : <p>I am reading about JavaScript class from the <a href="https://developer.mozilla.org/my/docs/Web/JavaScript/Reference/Classes#Class_body_and_method_definitions" rel="noreferrer">Mozilla documentation section of 'Class body and method definitions'</a>. Under the Co...
0debug
static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr, SBRData *ch_data, const int e_a[2]) { int e, k, m; static const SoftFloat limgain[4] = { { 760155524, 0 }, { 0x20000000, 1 }, { 758351638, 1 }, { 625000000,...
1threat
How to document attributes in Kotlin data class? : <p>Where shall I put Javadoc for attributes in Kotlin data class?</p> <p>In other words, how to write in Kotlin the following Java code:</p> <pre class="lang-java prettyprint-override"><code>/** * Represents a person. */ public class Person { /** * First n...
0debug
Get user input from command prompt in Java? : <p>I am fairly new to programming and I am stuck with a problem.</p> <p>I want to write a small calculator program that does nothing more than reading to numbers from the command prompt and adds them together.</p> <p>My problem now is, how do I get the numbers typed by th...
0debug
Two same strings aren't equal : <p>I have 2 equal strings, and when I'm doing a console.log() to know if they are equal, I do this:</p> <pre><code>console.log("message = " + document.getElementsByClassName("hud-chat-message")[i].childNodes[0].innerHTML + " type = " + typeof document.getElementsByClassName("hud-chat-me...
0debug
static av_cold int dilate_init(AVFilterContext *ctx, const char *args) { OCVContext *ocv = ctx->priv; DilateContext *dilate = ocv->priv; char default_kernel_str[] = "3x3+0x0/rect"; char *kernel_str; const char *buf = args; int ret; dilate->nb_iterations = 1; if (args) ...
1threat
Facebook Objective C to Swift 4 : <p>I am trying to implement facebook login using Swift 4</p> <p>Facebook docs covers how to implement the facebook login button for the view controller but it does not cover how to set up the Appdelegate using swift </p> <p>Can someone please convert this Objective C code to Swift </...
0debug
Can someone explain why a value gets incremented when "++" is used for comparison? : <p>This may already be a question out there, but with the lack of specific key terms, it's a bit hard to search for. Just looking for more insight on this topic.</p> <p>Right now, I'm working in C++ and wondering why my value is repla...
0debug
Steps to get hosted reatjs website? : I'm creating a reactjs web application project with create-react-app. Now it's all most ready. I did little research about how to get hostname and all. I found that https://www.netlify.com/ from this website I can able to host my website. Can anyone suggest which file I required to...
0debug
JavaScript split string with .match(regex) : <p>From the Mozilla Developer Network for function <code>split()</code>:</p> <blockquote> <p>The split() method returns the new array.</p> <p>When found, separator is removed from the string and the substrings are returned in an array. If separator is not found or ...
0debug
void bdrv_info(void) { BlockDriverState *bs; for (bs = bdrv_first; bs != NULL; bs = bs->next) { term_printf("%s:", bs->device_name); term_printf(" type="); switch(bs->type) { case BDRV_TYPE_HD: term_printf("hd"); break; case BDRV_TYPE_C...
1threat
static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double duration, int64_t pos, int64_t size) { HLSSegment *en = av_malloc(sizeof(*en)); const char *filename; int ret; if (!en) return AVERROR(ENOMEM); if ((hls->flags & (HLS_S...
1threat
Parsing a line from file : <p>I have a file with the following line:</p> <pre><code> numOfItems = 100 </code></pre> <p>I want to read the line from file and initialize the attribute "numOfItems" to 100. How could I do it, i.e, deleting the unnecessary spaces and read only the values I need?</p> <p...
0debug