problem
stringlengths
26
131k
labels
class label
2 classes
VSCode: Open file from file explorer with Enter key on Mac OSX : <p>When using VSCode on Windows, I can navigate the file explorer and hit <kbd>Enter</kbd> on the focused file and the file will open in the editor. On my Mac, however, when I do this, VSCode will open the rename input as follows:</p> <p><a href="https:/...
0debug
static void compute_pkt_fields(AVFormatContext *s, AVStream *st, AVCodecParserContext *pc, AVPacket *pkt) { int num, den, presentation_delayed; if(st->cur_dts != AV_NOPTS_VALUE){ if(pkt->pts != AV_NOPTS_VALUE) pkt->pts= lsb2full(pkt->pts, st->cur...
1threat
How to trigger expensive build steps only when required? : <p>I have a TeamCity project with the following build configurations:</p> <ol> <li>Gather dependencies (expensive)</li> <li>Build</li> <li>Test</li> <li>Deploy</li> </ol> <p>Say I know whether I need to do it by changes to some file <code>deps.txt</code>.</p>...
0debug
Devices with Android + MIUI and setCustomSelectionActionModeCallback : <p>I'm trying to create custom selection menu but it does not work on a device with rom MIUI and Android 6. The result is common menu with "copy" and "select all" items. On other devices and simulators under clean Android it works just fine. The cod...
0debug
Android getIntent() returns current activity : <p>I have a question about getIntent(); Somebody makes activity(Activity A) to call my Activity(Activity B). So it's different package name. The problem is that when I use getIntent(), the return of getIntent is Activity B. so intent.getExtras() is null. What is problem? ...
0debug
static void qerror_set_data(QError *qerr, const char *fmt, va_list *va) { QObject *obj; obj = qobject_from_jsonv(fmt, va); if (!obj) { qerror_abort(qerr, "invalid format '%s'", fmt); } if (qobject_type(obj) != QTYPE_QDICT) { qerror_abort(qerr, "error format is not a QDict '...
1threat
Why is the first element in python's sys.path an empty string? : <p>I noticed, when I launch <code>python</code> REPL and do:</p> <pre><code>import sys print(sys.path) </code></pre> <p>The first element of the list is an empty string. This only happens in the REPL. </p>
0debug
not able to insert empty integer value in microsoft sql server : INSERT INTO emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES(7369,'SMITH','CLERK',7902,17-Dec-80,800,'',20) when i run the sql command select * from emp The COMM colums is 0 and not empty. i want the column(COMM...
0debug
How to round 0.40 to 1 using c# : How to round decimal **0.40** value to **1**, using c# math.round function? math.round(0.40) gives 0 as answer but what i want is 1. how can i git this? thanks in advance
0debug
Getting an error in a program to encrypt text using Caesar Cipher (Python) : Caesar Cipher is a simple way of encryption that shifts a character a number of places in front of it. For example, ABC with a Rotation of 1 would be BCD. In this program, however, the list of all characters include special characters in a ran...
0debug
static void v7m_push_stack(ARMCPU *cpu) { CPUARMState *env = &cpu->env; uint32_t xpsr = xpsr_read(env); if ((env->regs[13] & 4) && (env->v7m.ccr & R_V7M_CCR_STKALIGN_MASK)) { env->regs[13] -= 4; xpsr |= XPSR_SPREALIGN; } v7m_push(env, xpsr); v7m_p...
1threat
Why does this code produce a syntax error? : <p>I am having problems with this if statement</p> <pre><code>while True: try: continue_shopping=int(input("press 0 to stop shopping and print your reciept or press 1 to continue shopping")) if continue_shopping !=0 and continue_shopping !=1: print("...
0debug
What does "tr[class^="row"]" mean in Javascript : <p>What does this <code>^</code> mean in the following code line: </p> <pre><code>tr[class^="row"] </code></pre> <p>In the HTML how does it looks like? if used:</p> <pre><code>var rows = document.querySelectorAll('tr[class^="row"]'); </code></pre>
0debug
static uint32_t slow_bar_readb(void *opaque, target_phys_addr_t addr) { AssignedDevRegion *d = opaque; uint8_t *in = d->u.r_virtbase + addr; uint32_t r; r = *in; DEBUG("slow_bar_readl addr=0x" TARGET_FMT_plx " val=0x%08x\n", addr, r); return r; }
1threat
static void vnc_init_basic_info_from_server_addr(QIOChannelSocket *ioc, VncBasicInfo *info, Error **errp) { SocketAddress *addr = NULL; addr = qio_channel_socket_get_local_address(ioc, errp); if (!addr) { v...
1threat
print_insn_sparc (bfd_vma memaddr, disassemble_info *info) { FILE *stream = info->stream; bfd_byte buffer[4]; unsigned long insn; sparc_opcode_hash *op; static int opcodes_initialized = 0; static unsigned long current_mach = 0; bfd_vma (*getword) (const unsigned char *); if (!opcodes_...
1threat
what is the role of bins to plot an histogram? : I want to an histogram. When I plot it with `bins=80` or `auto`. My code works correctly. But when I try to plot it with `bins=100`. It does not work with giving me this error: "{!r} is not a valid estimator for `bins`".format(bin_name)) ValueError: '100'...
0debug
How can I solve this error to call data frame in R? : <p>So when I run R and try to read a file, it gives me an error like this <a href="https://i.stack.imgur.com/fmESI.jpg" rel="nofollow noreferrer">Error message</a></p> <p>But I definitely have my file in my directory. As I can tell below photo.</p> <p><a href="htt...
0debug
static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int predictor, int point_transform) { int i, mb_x, mb_y; uint16_t (*buffer)[4]; int left[4], top[4], topleft[4]; const int linesize = s->linesize[0]; const int mask = (1 << s->bits) - 1; int resync_mb_y = 0; int r...
1threat
requestAnimationFrame is being called only once : <p>I'm trying to achieve a pretty basic animation using ThreeJS in my Ionic 2 application. Basically trying to rotate a cube. But the cube isn't rotating because requestAnimationFrame is being executed only once inside the render loop.</p> <p>I'm able to see only this....
0debug
hi please help me. Not an allowed type in Turbo C++ : So I'm trying to make a grading system. I've already made a program that does it but I just recently found at that we need to use procedures and functions, this is what I've done so far.So what i want to do is take 1/3 of the value of outputgrade and add it with 2/3...
0debug
Pyspark dataframe operator "IS NOT IN" : <p>I would like to rewrite this from R to Pyspark, any nice looking suggestions?</p> <pre><code>array &lt;- c(1,2,3) dataset &lt;- filter(!(column %in% array)) </code></pre>
0debug
How to manage installation from Unknown Sources in Android Oreo? : <p>In Android Oreo (8.0), several changes where made on how to allow the installation of apps from Unknown Sources (from the user's point of view) and to the process of getting permission to install them (from the developer's point of view).</p> <p>Si...
0debug
Should `const` and `constexpr` variables in headers be `inline` to prevent ODR violations? : <p>Consider the following header and assume it is used in several TUs:</p> <pre><code>static int x = 0; struct A { A() { ++x; printf("%d\n", x); } }; </code></pre> <p>As <a href="https://stackoverflow...
0debug
static void process_tns_coeffs(TemporalNoiseShaping *tns, double *coef_raw, int *order_p, int w, int filt) { int i, j, order = *order_p; int *idx = tns->coef_idx[w][filt]; float *lpc = tns->coef[w][filt]; float temp[TNS_MAX_ORDER] = {0.0f}, out[TNS_MAX_ORDER] = {0.0f...
1threat
Xamarin SQLite "This is the 'bait'" : <p>I follow <a href="https://developer.xamarin.com/guides/android/application_fundamentals/data/part_3_using_sqlite_orm/" rel="noreferrer">this</a> guide trying to create a SQLite database to my proyect. But always got same error, doing the exactly steps of the article.</p> <pre><...
0debug
What regex pattern can I use to match this string? : <p>What regex pattern can I use to match the following:</p> <p>Dxx-xxxx/xxx</p> <p>So: - Any string that starts with character 'D' - Has any number of any character between the 'D' and the '-' - Has any number of any character between the '-' and the '/' - Has ...
0debug
Is it possible to copy website? I need to take design from my friend's website but we want to try this way. Is it possible? : <p>I want to copy my friend's website but change language and some details. We are working on wordpress. Is it possible?</p>
0debug
Does retrieving a parcelable object through bundle always create new copy? : <p>I'm passing a parcelable object to a fragment by adding into a bundle while creating the fragment. In onc instance modification to this parcelled object reflects modification in original object and in another case it is not. I'm a little ba...
0debug
void v9fs_device_unrealize_common(V9fsState *s, Error **errp) { g_free(s->tag); g_free(s->ctx.fs_root);
1threat
static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr) { VFIOQuirk *quirk; VFIOrtl8168Quirk *rtl; if (!vfio_pci_is(vdev, PCI_VENDOR_ID_REALTEK, 0x8168) || nr != 2) { return; } quirk = g_malloc0(sizeof(*quirk)); quirk->mem = g_malloc0(sizeof(MemoryRegion) * 2);...
1threat
Create an application that loads a website? : <p>I have an existing MVC web application and I want to create a native application for Android, IOS, and PC that, when launched, navigates to a website but does not show typical browser features such as the URL bar, navigation buttons, bookmarks, etc.</p> <p>Are there any...
0debug
Remove specific variable from list R : <p>I want to remove a pre-defined variable from a list in R, for example: </p> <pre><code>vertex &lt;- c("A","B","C","D") list_safe&lt;-vertex z&lt;-sample(list_safe,1) list_infected[z] &lt;- z list_safe_new&lt;-list_safe[list_safe =! "z"] </code></pre> <p>Somehow, it doe...
0debug
How to detect AVPlayer actually started to play in swift : <p>Hello I have set my <code>UISlider</code>minimum value to 0.00. Then I set it's max value in this way.</p> <pre><code>self.viewPlayer.layer.addSublayer(playerLayer) let duration : CMTime = avPlayer.avPlayer.currentItem!.asset.duration let seconds : ...
0debug
i am using Swift-SRWebClient to upload multiple images in single post but i am not able to do so with swift 2.2? using REST API : SRWebClient.POST("http://www.tiikoni.com/tis/upload/upload.php").data(messageData, fieldName:"photo", data: ["CreatedBy":"4","Name": "Test", "Description" :"Test","CategoryId": "0", "Send...
0debug
static uint64_t arm_thistimer_read(void *opaque, target_phys_addr_t addr, unsigned size) { arm_mptimer_state *s = (arm_mptimer_state *)opaque; int id = get_current_cpu(s); return timerblock_read(&s->timerblock[id * 2], addr, size); }
1threat
Extract substring from the first letter : <p>I need to extract substring from string but starting with the first letter</p> <p><strong>example</strong> : </p> <pre><code>string s1 = "12 x 13 ABC 12@ 15.8" substring = ABC 12@ 15.8 string s2 = "25 x 32 FER @23.8" substring = FER @23.8 </code></pre> <p>I tried the in...
0debug
static void acpi_pcihp_update_hotplug_bus(AcpiPciHpState *s, int bsel) { BusChild *kid, *next; PCIBus *bus = acpi_pcihp_find_hotplug_bus(s, bsel); while (s->acpi_pcihp_pci_status[bsel].down) { acpi_pcihp_eject_slot(s, bsel, s->acpi_pcihp_pci_status[bsel].down); } s->acpi_pci...
1threat
void ff_snow_vertical_compose97i_sse2(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width){ long i = width; while(i & 0xF) { i--; b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS; b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS; b2[i] += (W_B...
1threat
What causes this Android APK Upload error: "Non-upgradable APK" : <p>I have an Android APK in the Google Play store with an Target SDK of 23.</p> <p>I have released a new version (same target SDK) and Google shows me this error:</p> <p>If I proceed (I learnt the hard way) then none of the current users can upgrade to...
0debug
NumberFormatException and how do i fix it? : When I enter jTextField2 before I enter jTextField1 I get the error stacktrace: Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: "Enter" at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043) at sun.mis...
0debug
Query returns no results in xQuery : I tried to query an XML file with xQuery in BaseX. Unfortunately the query returns no results. I think this is caused by incorrect declarations of the namespaces in xQuery's prolog. Please see the code below for the namespaces used in the original XML. Can somebody please tell me...
0debug
static void pci_bridge_region_del(PCIBridge *br, PCIBridgeWindows *w) { PCIDevice *pd = PCI_DEVICE(br); PCIBus *parent = pd->bus; memory_region_del_subregion(parent->address_space_io, &w->alias_io); memory_region_del_subregion(parent->address_space_mem, &w->alias_mem); memory_region_del_subr...
1threat
static void pxa2xx_gpio_set(void *opaque, int line, int level) { PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *) opaque; CPUState *cpu = CPU(s->cpu); int bank; uint32_t mask; if (line >= s->lines) { printf("%s: No GPIO pin %i\n", __FUNCTION__, line); return; } bank = lin...
1threat
static void virtio_queue_host_notifier_read(EventNotifier *n) { VirtQueue *vq = container_of(n, VirtQueue, host_notifier); if (event_notifier_test_and_clear(n)) { virtio_queue_notify_vq(vq); } }
1threat
Passing an event object to enzyme .simulate : <p>I am using Jest and Enzyme to test a React checkbox component.</p> <p>This is my test:</p> <pre><code>it('triggers checkbox onChange event', () =&gt; { const configs = { default: true, label: 'My Label', element: 'myElement', } const checkbox = shallo...
0debug
static int dvbsub_parse_clut_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { DVBSubContext *ctx = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; int i, clut_id; int version; DVBSubCLUT *clut; int entry_id, depth , f...
1threat
static void virtio_blk_save_device(VirtIODevice *vdev, QEMUFile *f) { VirtIOBlock *s = VIRTIO_BLK(vdev); VirtIOBlockReq *req = s->rq; while (req) { qemu_put_sbyte(f, 1); qemu_put_buffer(f, (unsigned char *)req->elem, sizeof(VirtQueueElement)); req = ...
1threat
Java Scanner utility wont allow user to re-enter input in a loop : <p>just trying to wrap my head around Java coding with a few practice programs and am experimenting with loops and the scanner utility and just ran into a problem when trying to use the scanner to check if the right input was entered and getting the pro...
0debug
Multiple databases in docker and docker-compose : <p>I have a project consisting of two main java apps that use eight postgres databases, so is there a way in docker-compose to build eight different databases so that each one has a different owner and password? Can I even do that in docker-compose?</p> <p><strong>exam...
0debug
static void monitor_call_handler(Monitor *mon, const mon_cmd_t *cmd, const QDict *params) { QObject *data = NULL; cmd->mhandler.cmd_new(mon, params, &data); if (data) cmd->user_print(mon, data); qobject_decref(data); }
1threat
Does somebody know what's $#? : I have to change a bash script into a powershell script, but I dont really get the condition in the if-statement. if [ $# -eq 0 ] then name='plmapp-all' else name="$1" Does somebody know whats $# and how this statement would look like in po...
0debug
Pythonic way for calculating length of lists in pandas dataframe column : <p>I have a dataframe like this:</p> <pre><code> CreationDate 2013-12-22 15:25:02 [ubuntu, mac-osx, syslinux] 2009-12-14 14:29:32 [ubuntu, mod-rewrite, laconica, apache-2.2] 20...
0debug
void hmp_delvm(Monitor *mon, const QDict *qdict) { BlockDriverState *bs; Error *err; const char *name = qdict_get_str(qdict, "name"); if (!find_vmstate_bs()) { monitor_printf(mon, "No block device supports snapshots\n"); return; } if (bdrv_all_delete_snapshot(name, &...
1threat
static int onenand_initfn(SysBusDevice *sbd) { DeviceState *dev = DEVICE(sbd); OneNANDState *s = ONE_NAND(dev); uint32_t size = 1 << (24 + ((s->id.dev >> 4) & 7)); void *ram; s->base = (hwaddr)-1; s->rdy = NULL; s->blocks = size >> BLOCK_SHIFT; s->secs = size >> 9; s->blo...
1threat
.prob() does not change the checkbox status from inside each() loop : I'm working on a project where I want to check checkboxes based on matching a regEx Pattern. [MY_JSFIDDLE][1] I come across a very strange behavior: function checkRegEx() { $.each(myjson, function (i, v) { var feedname = this.n...
0debug
static void pc_init1(QEMUMachineInitArgs *args, int pci_enabled, int kvmclock_enabled) { MemoryRegion *system_memory = get_system_memory(); MemoryRegion *system_io = get_system_io(); int i; ram_addr_t below_4g_mem_size, above_4g_mem_size; PCIBus *pci...
1threat
Search box label should change by drop down list : I am trying to do change search box label as per drop down list. like ... [![ ][1]][1] [1]: http://i.stack.imgur.com/7yeGK.png then the search box should be like Search Company Admin when is elect company admin tag.
0debug
Javascript variables and parameters : <p>I have a question as to why this is not working. Noob question, probably.</p> <pre><code>var itemCheck = { darkBerries: 0 } var id = darkBerries; itemcheck . id ++; </code></pre> <p>Thank you.</p>
0debug
cryptodev_builtin_get_aes_algo(uint32_t key_len, Error **errp) { int algo; if (key_len == 128 / 8) { algo = QCRYPTO_CIPHER_ALG_AES_128; } else if (key_len == 192 / 8) { algo = QCRYPTO_CIPHER_ALG_AES_192; } else if (key_len == 256 / 8) { algo = QCRYPTO_CIPHER_ALG_AES_256...
1threat
how to use Socks4/5 Proxy Handlers in Netty Client (4.1) : <p>I need to configure socks proxy in Netty client (to request different sites via socks4 or 5 proxies). Tried a lot of proxies from free socks lists (like www.socks-proxy.net, <a href="http://sockslist.net/" rel="noreferrer">http://sockslist.net/</a> etc) but ...
0debug
int mpeg4_decode_video_packet_header(MpegEncContext *s) { int mb_num_bits= av_log2(s->mb_num - 1) + 1; int header_extension=0, mb_num, len; if( get_bits_count(&s->gb) > s->gb.size_in_bits-20) return -1; for(len=0; len<32; len++){ if(get_bits1(&s->gb)) break; } if(len!...
1threat
Can an algorithm for this be done in one line? : <p>I have 3 variables: <code>total</code>, <code>paid</code>, and <code>payment</code></p> <p>Lets give an example to simplify the problem:</p> <blockquote> <pre><code>total = 100 paid = 10 </code></pre> <p>If a new <code>payment</code> comes in which value is <co...
0debug
static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block) { int i; register int t1,t2,t3,t4; DCTELEM *src, *dst; const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; src = block; dst = block; for(i = 0; i < 4; i++){ t1 = 17 * (src[0] + src[2]) + 4; t2...
1threat
static int dca_decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int i; int16_t *samples = data; DCAContext *s = avctx->priv_data; int channels;...
1threat
`docker-credential-gcloud` not in system PATH : <p>After the latest updates to gcloud and docker I'm unable to access images on my google container repository. Locally when I run: <code>gcloud auth configure-docker</code> as per the instructions after updating gcloud, I get the following message:</p> <pre><code>WARNI...
0debug
Can switch statements in c# only take integer values? : <p>So, I am a beginner programmer in C#. I was trying to learn to use switch statements in C#. Having coming from python, I had no idea what they were. Anyway, my problem is that when I try to use a switch statement, they say that they cannot convert the string to...
0debug
I have two tables i wanto retrive the different results from same column in SQL : I have listed the actual table.from that i want the result as expected one.[enter image description here][1] [1]: https://i.stack.imgur.com/p53W1.jpg
0debug
void pc_guest_info_init(PCMachineState *pcms) { int i, j; pcms->apic_xrupt_override = kvm_allows_irq0_override(); pcms->numa_nodes = nb_numa_nodes; pcms->node_mem = g_malloc0(pcms->numa_nodes * sizeof *pcms->node_mem); for (i = 0; i < nb_numa_nodes; i++) ...
1threat
static void dump_json_image_info(ImageInfo *info) { QString *str; QObject *obj; Visitor *v = qmp_output_visitor_new(&obj); visit_type_ImageInfo(v, NULL, &info, &error_abort); visit_complete(v, &obj); str = qobject_to_json_pretty(obj); assert(str != NULL); printf("%s\n", qstrin...
1threat
static void tci_out_label(TCGContext *s, TCGLabel *label) { if (label->has_value) { tcg_out_i(s, label->u.value); assert(label->u.value); } else { tcg_out_reloc(s, s->code_ptr, sizeof(tcg_target_ulong), label, 0); s->code_ptr += sizeof(tcg_target_ulong); } }
1threat
qcow_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov) { BDRVQcowState *s = bs->opaque; QEMUIOVector hd_qiov; struct iovec iov; z_stream strm; int ret, out_len; uint8_t *buf, *out_buf; uint64_t cluster_offset;...
1threat
Sending and Receiving Emoticons in Smack : How can I send and receive emoticons over android application using `smack` library and `OpenFire` sever in Chat Application ?
0debug
Running JavaFX application with JDK 11+ : <p>If I understand Oracle's announcments JavaFX won't be included to the JDK beginning with JDK 11 and will be only available as OpenJFX.</p> <p>What steps do I have to make as an software developer to allow my JavaFX application to be run with JDK 11+? Is there any good adivc...
0debug
Save as UTF 8 IN My eclipse Screen Other Wise The Programe is Not Run Whay This is happened : Sometime i will See a Pop Appear in Eclipse and not run my code . i wanted to know i fixed this error.[how i get rid of this error ][1] [1]: https://i.stack.imgur.com/JWetZ.png
0debug
static int read_bfraction(VC1Context *v, GetBitContext* gb) { v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1); v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index]; return 0; }
1threat
def max_subarray_product(arr): n = len(arr) max_ending_here = 1 min_ending_here = 1 max_so_far = 0 flag = 0 for i in range(0, n): if arr[i] > 0: max_ending_here = max_ending_here * arr[i] min_ending_here = min (min_ending_here * arr[i], 1) flag = 1 elif arr[i] == 0: max_ending_here = 1...
0debug
No executables found matching command 'dotnet-aspnet-codegenerator'" : <p>When trying to add a Controller in an ASP.NET Core project using Visual Studio 15 Enterprise with Update 3, I get the error below: </p> <p><code>"The was an error running the selected code generator: No executables found matching command 'dotnet...
0debug
Listview duplicate action in android : I have list. a row is content image and text and icon, The icon use to make the row is important. when i click on icon the color of icon is change. All is work probably but when i click on one icon more than one of icon is affect. I see more post here put not fix the problem, I...
0debug
java main method wont compile because it cannot find a symbol to create an object : <p>im relatively new to java since im attending my first year at university. currently we are doing OOP in class and i have the following problem:</p> <p>i am creating a "Train", but when i try to compile it , it gives the following er...
0debug
I want to store an array of objects : I want to store an array of objects items=[ {"122":{ name:"abc", "price":"12" }, {"1225656":{ name:"bc", "price":"35" } } ]
0debug
Remove Webpack bootstrap from output file : <p>Well, I know Webpack allow us to import packages with <code>require</code> and that's the infrastructure from Webpack. </p> <p>But, isn't it useless when you don't use <code>require</code> in the entry file?</p> <p>I have this <code>test.js</code> entry:</p> <pre><code...
0debug
static bool check_irqchip_in_kernel(void) { if (kvm_irqchip_in_kernel()) { return true; } error_report("pci-assign: error: requires KVM with in-kernel irqchip " "enabled"); return false; }
1threat
Using visitor pattern instead of casting : <p>I make regular use of the visitor pattern in my code. When a class hierarchy has a visitor implemented, I use it as an alternative to <code>instanceof</code> and casting. However it leads to some pretty awkward code which I'd like to improve.</p> <p>Consider the contrived ...
0debug
How to display date in Month and year format in R : I have a date variable which has date in "Fri Nov 27 20:17:01 IST 2015" format. I need to display it as NOv 2015. How can i do that in R? Please help
0debug
Kotlin complier error: expecting member declaration : I'm new to android studio and java. Trying to write a log in, can someone help me understand what's going on with the code? Thank you very much [enter image description here][1] [enter image description here][2] [1]: https://i.stack.imgur.com/ZP9Lm...
0debug
int ff_h264_build_ref_list(H264Context *h, H264SliceContext *sl) { int list, index, pic_structure; print_short_term(h); print_long_term(h); h264_initialise_ref_list(h, sl); for (list = 0; list < sl->list_count; list++) { int pred = sl->curr_pic_num; for (index = 0; in...
1threat
Why does `std::make_shared` perform two separate allocations with `-fno-rtti`? : <pre><code>#include &lt;memory&gt; struct foo { }; int main() { std::make_shared&lt;foo&gt;(); } </code></pre> <p>The asssembly generated by both <code>g++7</code> and <code>clang++5</code> with <code>-fno-exceptions -Ofast</code> for the...
0debug
vue.js, simple v-for / v-bind to add index to class name : <p>I can't seem to find the syntax to loop through my items and give each 'li' a class corresponding to the index. How is this done? </p> <pre><code>&lt;li v-for="(item, idx) in items class="idx""&gt; &lt;/li&gt; </code></pre>
0debug
Python code that search for text and copy it to the next line : <p>I python code to read lines in a text file and to copy text between specific characters. For example, text between _ _.</p> <pre><code>Input ./2425/1/115_Lube_45484.jpg 45484 ./2425/1/114_Spencerian_73323.jpg 73323 Output ./2425/1/115_Lube_45484.jpg 4...
0debug
Spurious requests, certificate auditors? : <p>In the last few days I've seen lots of POST requests to many of the domains I own hitting the following paths:</p> <pre><code>/ct/v1/sct-gossip /ct/v1/sct-feedback /.well-known/ct/v1/sct-feedback /.well-known/ct/v1/sth-pollination /.well-known/ct/v1/collected-sct-feedback ...
0debug
Install latest nodejs version in ubuntu 14.04 : <p>This is the way I installed <a href="https://nodejs.org/en/">nodejs</a> in ubuntu 14.04 LTS:</p> <pre><code>sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get install nodejs </code></pre> <p>When I checked the node version with this:</p> <pre><code>node -v ...
0debug
Where is the mistake in this code? : <p>I'm a noobie in php, so I got this code from my teacher and I can't get the answer. Can somebody explain me where is the mistake is this code?</p> <pre><code>&lt;?php function XXX($array, $val) { foreach ($array as $key =&gt; $value) { if ($value == $val) { unset($value); re...
0debug
VB.Net Selenium Implicit Wait Timeout not working : Was trying to block execution for 10 seconds properly with VB.Net Selenium, so found out about Implicit Wait on SO, and found this example. driver.Manage.Timeouts.ImplicitWait = TimeSpan.FromSeconds(10) Debug.WriteLine(driver.PageSource) T...
0debug
C# - DrawBorder - Bottom and Right side not visible : <p>I want to add a different bordercolor for every side of the element, yet it's working pretty okay, the only problem I got is that my right side and bottom side of the border isn't visible.</p> <pre><code> public static void DrawBorder ( Graphi...
0debug
I cannot get the sum to calculate. I'm not even sure my logic is correct. : I believe I may need to use for instead of while, I am unsure on how fix this. When I try to research this all I can find is in relation to "sum of arrays" My sum keeps coming out to equal 10 although I have declared the values. Can someone hel...
0debug
static void init_uni_ac_vlc(RLTable *rl, uint8_t *uni_ac_vlc_len){ int i; for(i=0; i<128; i++){ int level= i-64; int run; for(run=0; run<64; run++){ int len, bits, code; int alevel= FFABS(level); int sign= (level>>31)&1; if...
1threat
How do you declare a object that can be accessed through multiple header files? : <p>I'm working on a project and I am cleaning my code and Re-doing the code so it's more readable and easy to tweak. I'm having one issue though when I create an object in a header file the complier throws me an error saying its already d...
0debug
I want to incude a certain div from another url into my site : i have this <div> <object type="text/html" data="https://www.urlIWantTheDivFrom.com" width="800px" height="600px" > </object> </div> However this gives me the whole webpage. I want to copy a certain div. I ...
0debug
Docker: Using --password via the CLI is insecure. Use --password-stdin : <p>I have this error when I login during a CI process: </p> <pre><code>WARNING! Using --password via the CLI is insecure. Use --password-stdin. </code></pre> <p>Should I just replace "--password" with "--password-stdin'?</p>
0debug