problem
stringlengths
26
131k
labels
class label
2 classes
void ahci_command_wait(AHCIQState *ahci, AHCICommand *cmd) { while (BITSET(ahci_px_rreg(ahci, cmd->port, AHCI_PX_TFD), AHCI_PX_TFD_STS_BSY) || BITSET(ahci_px_rreg(ahci, cmd->port, AHCI_PX_CI), (1 << cmd->slot))) { usleep(50); } }
1threat
C++ abstract class inheritance : <p>Suppose that I have this piece of code:</p> <pre><code>class Vehicle { virtual const char* media() const = 0; virtual unsigned speed() const = 0; } V, *PV; class LandVehicle : public Vehicle { const char* media() const override{ return "Land";} } L, *PL; class Train : publ...
0debug
Python 3: Print in a while LOOP : I can get the print statements to display to terminal if I enter a number that is not equivalent to 15. I want to display a message when the input is not 15, but it won't. Only when I enter 15, I get only "Right Guess" Thanks x=15 y=10 while x != y: ...
0debug
How to convert cURL to postman? : <p>Postman has built-in function to convert postman to cURL code, but if I want to convert cURL code to postman, How can I do this efficiently? For example, cURL code as following;</p> <p>curl -v -X POST "<a href="https://speech.platform.bing.com/recognize?scenarios=smd&amp;appid=D4D5...
0debug
Javascript issue "Unexpected token :" : > Error Like the title says, I have an error of javascript with `Uncaught SyntaxError: Unexpected token :` The result of this error is this: ``` {"id":19728251846714,"properties":null,"quantity":1,"variant_id":19728251846714,"key":"19728251846714:f1a55a69aed71e7c10ca...
0debug
int kvm_arch_put_registers(CPUState *cs, int level) { struct kvm_one_reg reg; uint32_t fpr; uint64_t val; int i; int ret; ARMCPU *cpu = ARM_CPU(cs); CPUARMState *env = &cpu->env; if (!is_a64(env)) { aarch64_sync_32_to_64(env); } for (i = 0; i <...
1threat
- Use the `$(inherited)` flag, or - Remove the build settings from the target. CocoaPod Swift3 pod update error : <p>I've been running into a couple of strange errors in terminal when updating cocoapods after updating a Switf2 project to Swift3. Here are the errors:</p> <pre><code>[!] The `MyShowGuide [Debug]` target ...
0debug
static av_cold int imc_decode_init(AVCodecContext * avctx) { int i, j; IMCContext *q = avctx->priv_data; double r1, r2; q->decoder_reset = 1; for(i = 0; i < BANDS; i++) q->old_floor[i] = 1.0; ff_sine_window_init(q->mdct_sine_window, COEFFS); for(i = 0; i < COEFFS...
1threat
what is the mistake i made this program it will through runtime error? : <p><a href="https://i.stack.imgur.com/qmtxx.png" rel="nofollow noreferrer">Insert the element in last using single link list . please suggest what is the mistake i made . i shows run time error </a></p>
0debug
static void test_native_list_integer_helper(TestInputVisitorData *data, const void *unused, UserDefNativeListUnionKind kind) { UserDefNativeListUnion *cvalue = NULL; Visitor *v; GString *gstr_list = g_string_new(""...
1threat
static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) { int b, prefixes, aflag, dflag; int shift, ot; int modrm, reg, rm, mod, reg_addr, op, opreg, offset_addr, val; target_ulong next_eip, tval; int rex_w, rex_r; if (unlikely(loglevel & CPU_LOG_TB_OP)) tcg_gen_...
1threat
How to get specific date in php : <p>I want to get UTC time as in below format.</p> <blockquote> <p>2017-09-12T10:14:00.000Z</p> </blockquote> <p>Thanks in advance</p>
0debug
Swift4 Error on High Sierra, can't resolve symbol : <p>I've got this prefpane made in Swift and Cocoa... Yesterday I migrated it to Swift 4 as-per-the-migration guide and after some initial pains everything appeared to be working perfectly.</p> <p>I did this on Sierra, running Xcode 9.0 with the latest SDK.</p> <p>Pr...
0debug
To fetch distinct record in a table using sql : [enter image description here][1]i have redundancy data in the table where i have to fetch only distinct records in my table . here my table data sample here only unique records should be displayed which means 4th and last record in the table.. please suggest on t...
0debug
static void test_identify(void) { uint8_t data; uint16_t buf[256]; int i; int ret; ide_test_start( "-vnc none " "-drive file=%s,if=ide,serial=%s,cache=writeback " "-global ide-hd.ver=%s", tmp_path, "testdisk", "version"); outb(IDE_BASE + reg_d...
1threat
static void print_report(int is_last_report, int64_t timer_start) { char buf[1024]; OutputStream *ost; AVFormatContext *oc; int64_t total_size; AVCodecContext *enc; int frame_number, vid, i; double bitrate, ti1, pts; static int64_t last_time = -1; static int qp_histogram[52...
1threat
Mean as a window-function in dplyr : <p>I want to calculate group means but save them as a vector next to the raw data. Is there an efficient way to do this in <code>dplyr</code>?</p> <p>Original <code>data.frame</code>: </p> <pre><code>dat &lt;- data.frame( group = c("A","A","A","B","B","B"), value = c(4, 5, 6, ...
0debug
Get the height of SafeAreaView from within BottomTabBar : <p>I am attempting to use <a href="https://github.com/Andr3wHur5t/react-native-keyboard-spacer" rel="noreferrer"><code>react-native-keyboard-spacer</code></a> in conjunction with <a href="https://github.com/react-navigation/react-navigation" rel="noreferrer"><co...
0debug
Firebase and google play on different accounts : <p>I want to integrate a Google Play Account to Firebase. In our company only my boss has owner priviledge for the google play account. The account used for firebase and other tools like adsense has administrator priviledges.</p> <p>Is it possible to integrate the googl...
0debug
I can't find the problm area in the following code (finding power of a number using user defined functions). : [code along with the outputstrong text][1] The following code is not working. It has no errors, am doing some mistake in the logic i think. I am a newbie in programming and following is a very basic code, I...
0debug
altivec_yuv2packedX (SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, int dstW, int dstY) { int i,j; short tmp __attribute__((aligned (16))); int16_t *p; short *f; vector signed s...
1threat
static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; const uint8_t *buf_end; uint8_t segment_type; int segment_length; int i, ret; av_dlog(avc...
1threat
void qemu_del_nic(NICState *nic) { int i, queues = nic->conf->queues; if (nic->peer_deleted) { for (i = 0; i < queues; i++) { qemu_free_net_client(qemu_get_subqueue(nic, i)->peer); } } for (i = queues - 1; i >= 0; i--) { NetClientState *nc = qemu_ge...
1threat
How to add other themes for Jekyll Now? : <p>I am using Jekyll Now on GitHub Pages.</p> <p><code>Version 1.2.0</code></p> <p>My question is how do I add other themes that are compatible with <code>Jekyll Now</code>?</p> <p>Is it simply a case of adding the <code>theme: &lt;themename&gt;</code> into the <code>_config...
0debug
static void omap_rtc_alarm_update(struct omap_rtc_s *s) { s->alarm_ti = mktimegm(&s->alarm_tm); if (s->alarm_ti == -1) printf("%s: conversion failed\n", __FUNCTION__); }
1threat
envlist_setenv(envlist_t *envlist, const char *env) { struct envlist_entry *entry = NULL; const char *eq_sign; size_t envname_len; if ((envlist == NULL) || (env == NULL)) return (EINVAL); if ((eq_sign = strchr(env, '=')) == NULL) return (EINVAL); envname_len = eq_sign - env + 1; ...
1threat
Create a nested json object from another nested json object : As the question states, I want to create a new object from a current json object. My current json object: <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> { "name": "Parent", "childr...
0debug
How to write the below result in a file in python/How to store the results : Have made a python GUI and now I want to store the variable say Reference and Total cost in a file how can I achieve that?[enter image description here][1] Have tried writing a file like : def writetofile(): import os outputnam...
0debug
SourceTree - how to checkout to remote repo branch : <p>I create a new branch in remote GIT repository. Repository stored on BitBucket.</p> <p>In my my local repository I can see this new branch with SourceTree. It appears in commits list, on same commit I create branch from. But I cannot see this new branch under bra...
0debug
How to use Python's RotatingFileHandler : <p>I'm trying to do a test run of the <code>logging</code> module's <code>RotatingFileHandler</code> as follows:</p> <pre><code>import logging from logging.handlers import RotatingFileHandler # logging.basicConfig(filename="example.log", level=logging.DEBUG) logger = logging...
0debug
static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor, int point_transform){ int i, mb_x, mb_y; uint16_t buffer[2048][4]; int left[3], top[3], topleft[3]; const int linesize= s->linesize[0]; const int mask= (1<<s->bits)-1; for(i=0; i<3; i++){ buffer[0][i]= 1 ...
1threat
static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, const uint8_t *src, int srcW, int xInc, const int16_t *hLumFilter, const int16_t *hLumFilterPos, int hLumFilterSize, uint8_t *format...
1threat
static void version(void) { printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); }
1threat
How to get request's URI from WebRequest in Spring? : <p>I am handling REST exceptions using <code>@ControllerAdvice</code> and <code>ResponseEntityExceptionHandler</code> in a spring Rest webservice. So far everything was working fine until I decided to add the <code>URI</code> path(for which exception has occurred) i...
0debug
mips_mipssim_init (ram_addr_t ram_size, int vga_ram_size, const char *boot_device, DisplayState *ds, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { char buf[1024]; unsigned long bios_of...
1threat
Associativity of fold-expressions : <p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4191.html" rel="noreferrer"><strong>N4191</strong></a> proposed fold-expressions to C++. The definition there was that</p> <pre><code>(args + ...) </code></pre> <p>is a left-fold (i.e. <code>(((a0 + a1) + a2) + .....
0debug
solisten(port, laddr, lport, flags) u_int port; u_int32_t laddr; u_int lport; int flags; { struct sockaddr_in addr; struct socket *so; int s, addrlen = sizeof(addr), opt = 1; DEBUG_CALL("solisten"); DEBUG_ARG("port = %d", port); DEBUG_ARG("laddr = %x", laddr); DEBUG_ARG("lport = %d", lport); ...
1threat
void cpu_dump_state(CPUState *env, FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...), int flags) { int i, x; cpu_fprintf(f, "pc: " TARGET_FMT_lx " npc: " TARGET_FMT_lx "\n", env->pc, env->npc); cpu_fprintf(f, "General Registers:\n");...
1threat
Java Cannot intialize ArrayList variables in constructor : I have several different types of ArrayLists. Each stores split data from a .csv file. //NOTE: this is for understanding, syntax may not be correct. ArrayList<String> name = {item1, item2, item3, item4}; ArrayList<String> type = {type1, type2,...
0debug
Please help me to SUM SQL tables : Please help me to get a expected output. I have 2 tables table 1 [CODE] Project_Name Start Date P-2018-001 2018/06/20 P-2018-002 2018/06/21 P-2018-003 2018/06/22 [/CODE] table 2 [CODE] Date Project_Name Staff Working_Time 2018/06/20 P-2018-001 Staff01 8 2018/06/20...
0debug
find name and add sentence in C# (windows form) : I have a name List (name.txt) and want if find "David" name , A line before add "find my name" For example: Name.txt: <br> Jacob <br> William <br> Ethan <br> James <br> **David** -------------- i want = <br> Jacob <br> William <br> Ethan <br> ...
0debug
Updating column datatype in mongodb : <p>I am trying to update datatype of a column in mongodb dataset, but even after successful run of command expected changes are not reflecting in compass.</p> <p>query:</p> <pre><code>db.EquityPrice.find().forEach(function(data) { db.EquityPrice.update({_id : doc._id}, {$set ...
0debug
can we modify private variables in child class : <blockquote> <p>can we <em>modify</em> a private variable through <strong>child class</strong>. <br/>We can use it by set and get methods but how can we modify them in child class. </p> </blockquote>
0debug
Python 'map' function inserting NaN, possible to return original values instead? : <p>I am passing a dictionary to the <code>map</code> function to recode values in the column of a Pandas dataframe. However, I noticed that if there is a value in the original series that is not explicitly in the dictionary, it gets reco...
0debug
NestedScrollView could not scroll with match_parent height child : <p>I implement NonSwipeableViewPager with a fragment has NestedScrollView like this, what I expect is that the scrollview can scroll up and show 2 textviews:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;android.support.v4.widget.Nest...
0debug
enum AVPixelFormat avpriv_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id) { int i; for (i = 0; avpriv_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) { if (avpriv_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt && avpriv_fmt_conversion_table[i].codec_id == codec_id) { ...
1threat
static int dirac_decode_picture_header(DiracContext *s) { unsigned retire, picnum; int i, j, ret; int64_t refdist, refnum; GetBitContext *gb = &s->gb; picnum = s->current_picture->avframe->display_picture_number = get_bits_long(gb, 32); av_log(s->avctx,AV_LOG_DEBUG,"PICTURE_NU...
1threat
static int hds_flush(AVFormatContext *s, OutputStream *os, int final, int64_t end_ts) { HDSContext *c = s->priv_data; int i, ret = 0; char target_filename[1024]; int index = s->streams[os->first_stream]->id; if (!os->packets_written) return 0; avio_flush...
1threat
Java Regular Expression to mask sensitive data in access log : "PUT /v1/users/me/change_password.json?api_key=pDY0VK7YFv9btw6pasXZ&current_password=Qwerty123&password=Qwerty1234&password_confirmation=Qwerty1234 HTTP/1.1" 200 - I need regular expression which replace password ,current_password and password_confirmati...
0debug
temp += {expression}; vs temp = {expression}; sum += temp; : I just finished spending ~4hours debugging an issue I had with a larger program, and even after fixing it, I still can't figure out why it was causing an issue. Here's the mini version of the code: #include <cstdlib> #include<iostream> ...
0debug
static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, unsigned src_size) { const uint8_t *s = src; const uint8_t *end; #ifdef HAVE_MMX const uint8_t *mm_end; #endif uint16_t *d = (uint16_t *)dst; end = s + src_size; #ifdef HAVE_MMX __asm __volatile(PREFETCH" %0"::"m"(*src):"memory");...
1threat
query = 'SELECT * FROM customers WHERE email = ' + email_input
1threat
(Excel VBA) - Copy webpage content to a string : I need to access webpages and copy their content (everything) into a string which I will then extract some figures from. The webpage address changes each time, as I am basically accessing an online simulation tool and I have to specify the sim parameters each time. An...
0debug
static int vda_h264_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { VDAContext *vda = avctx->internal->hwaccel_priv_data; struct vda_context *vda_ctx = avctx->hwaccel_context; void...
1threat
static void patch_pci_windows(PcPciInfo *pci, uint8_t *start, unsigned size) { *ACPI_BUILD_PTR(start, size, acpi_pci32_start[0], uint32_t) = cpu_to_le32(pci->w32.begin); *ACPI_BUILD_PTR(start, size, acpi_pci32_end[0], uint32_t) = cpu_to_le32(pci->w32.end - 1); if (pci->w64.end || p...
1threat
Equivalent urllib.parse.quote() in python 2.7 : <p>What is the equivalent of <code>urllib.parse.quote</code></p> <p>It's <code>urllib.urlencode()</code>?</p> <p>Thanks</p>
0debug
Msg 512, Level 16, State 1, Line 19 Subquery returned more than 1 value. : update ActiveParty set rmname = (select CONCAT(rmname,rmadr1) from ActiveParty where RMADR1 like ('%C/O%') or RMADR1 like ('%Attention%') or RMADR1 LIKE '%!%%' escape '!') where RMADR1 in (select RMADR1 from ActivePar...
0debug
Something Wrong with QuickSort algorithm : <p>Quick Sort Java Implementation- I have made a program to implement QuickSort algorithm, but it is not showing the sorted sequence properly, It is also showing array out of bound Index exception. can someone tell what is wrong with code or logic?</p> <pre><code>import java....
0debug
static void show_format(WriterContext *w, AVFormatContext *fmt_ctx) { char val_str[128]; int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1; writer_print_section_header(w, SECTION_ID_FORMAT); print_str("filename", fmt_ctx->filename); print_int("nb_streams", fmt_ctx->nb_st...
1threat
static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) { AVFilterContext *ctx = link->dst; CropContext *crop = ctx->priv; AVFilterBufferRef *ref2; int i; picref->video->w = crop->w; picref->video->h = crop->h; ref2 = avfilter_ref_buffer(picref, ~0); crop->v...
1threat
Creating cell same like fb and gmail login page : I want to create automated cells in excel which will show the type of data to be entered in that cells. I want to create cells which will show "Enter Username here", " Enter DOB here" same as that which shows in fb and gmail login page. I don't want to save any credenti...
0debug
void unix_start_incoming_migration(const char *path, Error **errp) { SocketAddressLegacy *saddr = unix_build_address(path); socket_start_incoming_migration(saddr, errp); }
1threat
void ff_mqc_init_contexts(MqcState *mqc) { int i; memset(mqc->cx_states, 0, sizeof(mqc->cx_states)); mqc->cx_states[MQC_CX_UNI] = 2 * 46; mqc->cx_states[MQC_CX_RL] = 2 * 3; mqc->cx_states[0] = 2 * 4; for (i = 0; i < 47; i++) { ff_mqc_qe[2 * i] = ff_mqc_qe...
1threat
void RENAME(ff_init_mpadsp_tabs)(void) { int i, j; for (i = 0; i < 36; i++) { for (j = 0; j < 4; j++) { double d; if (j == 2 && i % 3 != 1) continue; d = sin(M_PI * (i + 0.5) / 36.0); if (j == 1) { if ...
1threat
Checking if a type is a map : <p>I sometimes find the need to write general routines that can be applied to a container of objects, or a map of such containers (i.e. process each container in the map). One approach is to write separate routines for map types, but I think it can be more natural and less verbose to have...
0debug
static int raw_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVRawState *s = bs->opaque; int access_flags; DWORD overlapped; QemuOpts *opts; Error *local_err = NULL; const char *filename; int ret; s->type = FTYPE_FILE; opts...
1threat
Splitting the values of an array based on a property and then form a new array of objects : <p>I have an objects that contains arrays with following structure:</p> <pre><code>var obj = { "feature1" : ["val1","val2"], "feature2" : ["val3"] } </code></pre> <p>Now I want to split the values that are present inside...
0debug
linq count (list of datastructures, compared to an array value) : related to a [question I asked previously][1] (and got a great answer for) i have a list<data_struct> roi and an array[][]avg. the list contains an index (of course), each index contains X,Y,Z values in a data structure i've gotten some averages a...
0debug
Kotlin: How to check if enum contains a given String without messing with Exceptions? : <p>Why there is no <code>contains</code> method in enum classes (as well as in Java)? And how to implement it elegantly? Now I'm using this ugly approach:</p> <pre><code>val contains: Boolean = try { MyEnum.valueOf("so...
0debug
com.android.ddmlib.AdbCommandRejectedException: device offline (Even when device is connected) : <p>After update of Android Studio to 2.1.2 I've been getting the following error too many times when i make a change.</p> <blockquote> <p>com.android.ddmlib.AdbCommandRejectedException: device offline</p> <p>Error w...
0debug
static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb, AVStream *st, int read_all) { RMDemuxContext *rm = s->priv_data; char buf[256]; uint32_t version; int i; version = get_be32(pb); if (((version >> 16) & 0xff) == 3) { ...
1threat
import re def snake_to_camel(word): return ''.join(x.capitalize() or '_' for x in word.split('_'))
0debug
static int rv20_decode_picture_header(RVDecContext *rv) { MpegEncContext *s = &rv->m; int seq, mb_pos, i; int rpr_bits; #if 0 GetBitContext gb= s->gb; for(i=0; i<64; i++){ av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&gb)); if(i%4==3) av_log(s->avctx, AV_LOG_DEBUG, " ");...
1threat
Click event not working on the append item : <p>I am not being able to call the click function on the appended data. I have a html structure like below and items are added after slider move. After the items are added, I need to get the click event but at the moment its not working.</p> <h2>HTML</h2> <pre><code> &l...
0debug
how to call method with array input : int n; //this is a method for get and set value of array public static int[] avali(int n) { System.out.println("insert number"); Scanner num = new Scanner(System.in); int a1[] = new int[n]; for (int i = 0; i < n; i++) { ...
0debug
Unexpected value 'DecoratorFactory' imported by the module 'TempModule' : <p>In my sample application I have written a feature module "TempModule" and below is the code.</p> <pre><code>import { NgModule } from '@angular/core'; import { CommonModule} from '@angular/common'; import { TempOneComponent } from './temp.one...
0debug
Passing a variable through href - is it a good approach? : <p>I'm currently working on my school project and I started wondering if it's a good approach to pass some variable through href so it can been seen in the URL. Is it good or a bad way and why? </p> <p>Or are there any better ways? </p>
0debug
javscript regexp get no quotes params : eg: var str = '2+3+name+"obj.name name"+"g233"'; how can i get the name params from the str with out "obj.name name" and "g233" string if it can use regexp to realize it; the fitst name is what i want to replace, not want the name in quotes!
0debug
How to split a string in java by a non printable ascii character (Example - Record Seperator) : <p>In C# this would work - <code>String[] elements = sample.Split((char)30);</code></p> <p>What is the java equivalent?</p>
0debug
What does that $$ mean? : Firstly, I am beginner in Perl. I would like to know what does this code mean. sub function { my $var1 = shift; my $var2 = shift; if ($$var1) { #code } else { #code } } I know that it is a function, and var...
0debug
Is there any way to analyze a truncated Java Heap Dump (hprof file)? : <p>In my work, we are running into a difficult to reproduce OOM issue. Or, more accurately, it is very easy to reproduce on one system, making that system unusable, but difficult to reproduce anywhere else, given the same inputs.</p> <p>The applica...
0debug
static void lz_unpack(unsigned char *src, unsigned char *dest) { unsigned char *s; unsigned char *d; unsigned char queue[QUEUE_SIZE]; unsigned int qpos; unsigned int dataleft; unsigned int chainofs; unsigned int chainlen; unsigned int speclen; unsigned char tag; unsign...
1threat
static inline void direct_ref_list_init(H264Context * const h){ MpegEncContext * const s = &h->s; Picture * const ref1 = &h->ref_list[1][0]; Picture * const cur = s->current_picture_ptr; int list, i, j; int sidx= s->picture_structure&1; int ref1sidx= ref1->reference&1; for(list=0; lis...
1threat
Error while finding the outliers in R for diamonds dataset : for the below code, i am getting an error of diamonds[which(diamonds$carat,diamonds$depth,diamonds$table,diamonds$x,diamonds$y,diamonds$z%in% outliers),] error is Error in which(diamonds$carat, diamonds$depth, diamonds$table, diamonds$x, : unused ...
0debug
Authorization method for REST API utilising Active Directory : <p>What is the best method of securing a REST Web API with the following requirements. The system has an Angular JS frontend with the REST APIs implemented in ASP.net.</p> <ul> <li>There are two "roles" in the system, users will have one of the roles. On...
0debug
Simulate history.go(-1) with Javascript/JQuery : <p>I have three different html files (<strong>page1.html</strong>, <strong>page2.html</strong>, <strong>page3.html</strong>) that each contain a link to the same target in a fourth html file (<strong>glossary.html</strong>).</p> <p>For technical reasons, I can't use <st...
0debug
spring JNDI logging before logback is initialized : <p>I've got a spring boot app that is outputing around 1500 lines of JNDI debug logging to stdout at startup before logback is initialized. Does anyone know what's causing this and if there is a way to get logback initialized before this? I've got -Dlogback.debug=true...
0debug
import datetime def check_date(m, d, y): try: m, d, y = map(int, (m, d, y)) datetime.date(y, m, d) return True except ValueError: return False
0debug
SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d, uint32_t tag, uint32_t lun, void *hba_private) { SCSIRequest *req; SCSIBus *bus = scsi_bus_from_device(d); BusState *qbus = BUS(bus); req = g_malloc0(reqops->size); req->refcount = 1; req->...
1threat
Retrofit v2 Does Call.cancel() remove Callback? : <p>I've read in the <a href="https://github.com/square/retrofit/issues/297" rel="noreferrer">Retrofit v2 API Spec</a> that calling the cancel() method on the Call class returned from your custom retrofit interface should set the Callback passed in to null.</p> <blockqu...
0debug
static void dma_bdrv_unmap(DMAAIOCB *dbs) { int i; for (i = 0; i < dbs->iov.niov; ++i) { dma_memory_unmap(dbs->sg->as, dbs->iov.iov[i].iov_base, dbs->iov.iov[i].iov_len, dbs->dir, dbs->iov.iov[i].iov_len); } qemu_iovec_reset(&dbs->iov);...
1threat
static int megasas_dcmd_cfg_read(MegasasState *s, MegasasCmd *cmd) { uint8_t data[4096]; struct mfi_config_data *info; int num_pd_disks = 0, array_offset, ld_offset; BusChild *kid; if (cmd->iov_size > 4096) { return MFI_STAT_INVALID_PARAMETER; } QTAILQ_FOREACH(kid, &s->b...
1threat
Python - remainder operator : <p>Although I know there is a built in <code>str()</code> <code>function</code> in <code>python</code>, I'm trying to understand its logic.</p> <pre><code>def intToStr(i): digits = '0123456789' if i == 0: return '0' result = '' while i &gt; 0: result = digi...
0debug
static int RENAME(dct_quantize)(MpegEncContext *s, DCTELEM *block, int n, int qscale) { int i, level, last_non_zero_p1, q; const UINT16 *qmat; static __align8 INT16 temp_block[64]; int minLevel, maxLevel; if(s->avctx!=NULL && s->a...
1threat
How to delete all columns in DataFrame except certain ones? : <p>Let's say I have a DataFrame that looks like this:</p> <pre><code>a b c d e f g 1 2 3 4 5 6 7 4 3 7 1 6 9 4 8 9 0 2 4 2 1 </code></pre> <p>How would I go about deleting every column besides <code>a</code> and <code>b</code>?</p...
0debug
Regular Expression email address Python : <p>I want to extract top level domains from email addresses with Python. I want to use a regular expression to get everything after the FIRST dot after the @ symbol</p> <p>E.g.</p> <pre><code>tony.manero@testing.com ted.br@top.domain.us </code></pre> <p>Expected result</p> ...
0debug
android set margin programmatically : <p>after i press a button, i would like to move a textfield programmatically from the actual position + 20 margin left.</p> <p>this is my xml file:</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.and...
0debug
static void spice_update_buttons(QemuSpicePointer *pointer, int wheel, uint32_t button_mask) { static uint32_t bmap[INPUT_BUTTON__MAX] = { [INPUT_BUTTON_LEFT] = 0x01, [INPUT_BUTTON_MIDDLE] = 0x04, [INPUT_BUTTON_RIGHT] = 0x02, ...
1threat
How to sort ArrayList<String> in Java in decreasing order? : <p>I am new in java i am trying to sort a list of install app in device according to their data use. i want like highest at the top.i use code to find install package are:</p> <pre><code> List&lt;ApplicationItem&gt; mApplicationItemList = new ArrayList&lt;Ap...
0debug
Please help me to write this procedure to get auto-increment alphanumeric id in ms sql server : CREATE PROC Usp_GetNewInquiryId AS BEGIN IF NOT EXISTS(SELECT InquiryId FROM JobPortal.dbo.tblContact) DECLARE @PrefixValue VARCHAR(10)='INQ' DECLARE @InitialValue DECIMAL(10)=1001 SELECT InquiryId = @PrefixVal...
0debug