problem
stringlengths
26
131k
labels
class label
2 classes
TypeError: get_weather() takes no arguments (1 given) : <p>I'm taking an online course with StackSkills for Python and have copied the code exactly as given in the lecture - we're making a weather app using Flask. I keep getting this message: TypeError: get_weather() takes no arguments (1 given)</p> <p>The Python Page...
0debug
int av_reallocp_array(void *ptr, size_t nmemb, size_t size) { void **ptrptr = ptr; *ptrptr = av_realloc_f(*ptrptr, nmemb, size); if (!*ptrptr && !(nmemb && size)) return AVERROR(ENOMEM); return 0; }
1threat
How to pass text from textarea to reflect or show in another page, without losing the formatting? : <p>I am making an application using javascript (no JQuery) and php. I have a textarea form -which applies - space formatting. But when I send the values from this textarea to another page using PHP post command ..the sp...
0debug
How can I re-sort records for my text file? : <p>Morning guys,</p> <p>I have a text file like this (original.txt):</p> <pre><code>AAAA BBBB CCCC DDDD EEEE FFFF </code></pre> <p>I need a file like this (result.txt):</p> <pre><code>AAAA BBBB CCCC DDDD EEEE FFFF </code></pre> <p>Could you please help me with that by ...
0debug
static unsigned int dec_subs_r(DisasContext *dc) { TCGv t0; int size = memsize_z(dc); DIS(fprintf (logfile, "subs.%c $r%u, $r%u\n", memsize_char(size), dc->op1, dc->op2)); cris_cc_mask(dc, CC_MASK_NZVC); t0 = tcg_temp_new(TCG_TYPE_TL); t_gen_sext(t0, cpu_R[dc->op1], size); cris_alu(dc,...
1threat
static int blk_connect(struct XenDevice *xendev) { struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev); int pers, index, qflags; bool readonly = true; if (blkdev->directiosafe) { qflags = BDRV_O_NOCACHE | BDRV_O_NATIVE_AIO; } else { qflags = BDRV...
1threat
static void mcf_fec_cleanup(NetClientState *nc) { mcf_fec_state *s = qemu_get_nic_opaque(nc); g_free(s); }
1threat
Searching and sorting java : So i am trying to solve this following question in java for practice as I am a beginneer and trying to strengthen my java skills. Here is the question... __________________________________________________ According to our suggested 16 week course schedule, this programming project shou...
0debug
static int init_tile(Jpeg2000DecoderContext *s, int tileno) { int compno; int tilex = tileno % s->numXtiles; int tiley = tileno / s->numXtiles; Jpeg2000Tile *tile = s->tile + tileno; if (!tile->comp) return AVERROR(ENOMEM); tile->coord[0][0] = av_clip(tilex * s->tile_wi...
1threat
How to use down symbol to display list of users : How to design and code this in swift(IOS) AND xcode.If we tap on down button it should display items and vicecersa[enter image description here][1] [1]: https://i.stack.imgur.com/WGfwR.png
0debug
static void disas_xtensa_insn(DisasContext *dc) { #define HAS_OPTION(opt) do { \ if (!option_enabled(dc, opt)) { \ qemu_log("Option %d is not enabled %s:%d\n", \ (opt), __FILE__, __LINE__); \ goto invalid_opcode; \ } \ } while (0) #ifdef TARGET_...
1threat
Trying to write Python code to count the number of different vowels in a string? : <p>I've literally just started learning to code so very inexperienced, and I probably haven't done this the best way - I'm trying to write code in Python that will count the number of DIFFERENT vowels in a string (i.e. if the input was '...
0debug
static int flush_packet(AVFormatContext *ctx, int stream_index, int64_t pts, int64_t dts, int64_t scr, int trailer_size) { MpegMuxContext *s = ctx->priv_data; StreamInfo *stream = ctx->streams[stream_index]->priv_data; uint8_t *buf_ptr; int size, payload_size, startcode, i...
1threat
Type or namespace definition, or end-of-file expected: : <pre><code>using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Trade_Entry_Application { ...
0debug
int bdrv_snapshot_delete(BlockDriverState *bs, const char *snapshot_id) { BlockDriver *drv = bs->drv; if (!drv) return -ENOMEDIUM; if (drv->bdrv_snapshot_delete) return drv->bdrv_snapshot_delete(bs, snapshot_id); if (bs->file) return bdrv_snapshot_delete(bs->file, snapsho...
1threat
void ide_drive_get(DriveInfo **hd, int max_bus) { int i; if (drive_get_max_bus(IF_IDE) >= max_bus) { fprintf(stderr, "qemu: too many IDE bus: %d\n", max_bus); exit(1); } for(i = 0; i < max_bus * MAX_IDE_DEVS; i++) { hd[i] = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_...
1threat
static av_cold int dirac_decode_init(AVCodecContext *avctx) { DiracContext *s = avctx->priv_data; int i; s->avctx = avctx; s->frame_number = -1; if (avctx->flags&CODEC_FLAG_EMU_EDGE) { av_log(avctx, AV_LOG_ERROR, "Edge emulation not supported!\n"); return AVERROR_PATCHWEL...
1threat
static int http_prepare_data(HTTPContext *c, long cur_time) { int i; switch(c->state) { case HTTPSTATE_SEND_DATA_HEADER: memset(&c->fmt_ctx, 0, sizeof(c->fmt_ctx)); pstrcpy(c->fmt_ctx.author, sizeof(c->fmt_ctx.author), c->stream->author); pstrcpy(c->fmt_ctx.comment, sizeof(c...
1threat
static int64_t ffm_seek1(AVFormatContext *s, int64_t pos1) { FFMContext *ffm = s->priv_data; AVIOContext *pb = s->pb; int64_t pos; pos = FFMIN(pos1, ffm->file_size - FFM_PACKET_SIZE); pos = FFMAX(pos, FFM_PACKET_SIZE); av_dlog(s, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos); retu...
1threat
Why in principle an in-place-modifying method should return None : <p>A language design question.</p> <p>Taking Python as example.</p> <p>Quoting a <a href="https://stackoverflow.com/questions/22442378/what-is-the-difference-between-sortedlist-vs-list-sort#comment81703173_22442440">comment</a> in an answer to a quest...
0debug
target_ulong helper_dmt(target_ulong arg1) { arg1 = 0; return arg1; }
1threat
Axios: chaining multiple API requests : <p>I need to chain a few API requests from the Google Maps API, and I'm trying to do it with Axios.</p> <p>Here is the first request, which is in componentWillMount()</p> <pre><code>axios.get('https://maps.googleapis.com/maps/api/geocode/json?&amp;address=' + this.props.p1) ....
0debug
Angular 6 Auth0 - global not defined : <p>Ive upgraded my app from angular 5 to angular 6. i get the following error now.</p> <pre><code>Uncaught ReferenceError: global is not defined at Object../node_modules/auth0-lock/lib/utils/cdn_utils.js (cdn_utils.js:13) </code></pre> <blockquote> <p>"angular2-jwt": "^0.2.3",...
0debug
What are the best option for a pager when building on Rails? : <p>I am building an education app and I want a pager that uses the buttons "previous" and "next" to go back and forth on the lessons I created.</p> <p>Many Google results show me to use the kaminari gem but kaminiari seems to be more on the pagination(like...
0debug
how to validate a url in inside paragraph using Regex : i am using the following regex to validate the url: /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\...
0debug
Why aren't my onclick events working? : <p>Here is a snippet of my code on <a href="https://jsfiddle.net/dreami/jy69s6r3/2/" rel="nofollow">jsfiddle</a>.</p> <p>I want the "+ Create Forum" button to show the form, "Cancel" button to reset the form and hide it, and if you want to see the form, delete "style="display: n...
0debug
static void crs_replace_with_free_ranges(GPtrArray *ranges, uint64_t start, uint64_t end) { GPtrArray *free_ranges = g_ptr_array_new_with_free_func(crs_range_free); uint64_t free_base = start; int i; g_ptr_array_sort(ranges, crs_range_compare); for (...
1threat
uint32_t gic_acknowledge_irq(GICState *s, int cpu) { int ret, irq, src; int cm = 1 << cpu; irq = s->current_pending[cpu]; if (irq == 1023 || GIC_GET_PRIORITY(irq, cpu) >= s->running_priority[cpu]) { DPRINTF("ACK no pending IRQ\n"); return 1023; } s->last_act...
1threat
My C Compiler blew up , when i tried changing some address values , please tell me why? : Have a look at my code : #include <stdio.h> #include <limits.h> int main (int argc, const char *argv[]) { typedef unsigned char byte; byte *pointer; byte b1=1; byte b2=2; int ...
0debug
static void filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) { MpegEncContext * const s = &h->s; int mb_y_firstrow = s->picture_structure == PICT_BOTTOM_FIELD; int mb_xy, mb_type; int qp, qp0, qp1, q...
1threat
Inheritance vs. Delegation : <p>The code below shows how method m() can be reused by inheritance. How works for delegation? Thanks!</p> <pre><code> class A{ int m(); } class B extends A{} B b =new B() b.m(); </code></pre>
0debug
void object_property_set_link(Object *obj, Object *value, const char *name, Error **errp) { object_property_set_str(obj, object_get_canonical_path(value), name, errp); }
1threat
Difference between NULL, 0 ,False and ''? : <p>What is the exact difference between <code>null</code>, <code>0</code>, <code>false</code>, and an empty string in PHP? Is <code>null</code> similar to <code>None</code> in python?</p>
0debug
How to calculate exact average using arrays in Java : <p>Regardless of what I try, the program outputs the average as the integer "4" when the average should be "4.78". I have tried changing the integers to doubles, but to no avail. </p> <p>The rest of the program works as intended, though. It is supposed to print how...
0debug
Cannot avoid the error marks on md elements of Angualar material in visual studio 2013 : [Project Image][1][enter image description here][2] Cannot avoid the error marks on md elements of Angualr material in visual studio 2013 [1]: https://i.stack.imgur.com/eNaH9.jpg [2]: https://i.stack.imgur.com/XXWTv....
0debug
Typeclasses and overloading, what is the connection? : <p>I am currently trying to wrap my head around typeclasses and instances and I don't quite understand the point of them yet. I have two questions on the matter so far:</p> <p>1) Why is it necessary to have a type class in a function signature when the function us...
0debug
static int metasound_read_bitstream(AVCodecContext *avctx, TwinVQContext *tctx, const uint8_t *buf, int buf_size) { TwinVQFrameData *bits = &tctx->bits; const TwinVQModeTab *mtab = tctx->mtab; int channels = tctx->avctx->channels; int sub; ...
1threat
def all_Bits_Set_In_The_Given_Range(n,l,r): num = (((1 << r) - 1) ^ ((1 << (l - 1)) - 1)) new_num = n & num if (new_num == 0): return True return False
0debug
event_thread(void *arg) { unsigned char atr[MAX_ATR_LEN]; int atr_len = MAX_ATR_LEN; VEvent *event = NULL; unsigned int reader_id; while (1) { const char *reader_name; event = vevent_wait_next_vevent(); if (event == NULL) { break; } ...
1threat
code to find the largest number in the array but it only showing the first number as the largest. someone please let me know why : <pre><code> #include &lt;iostream&gt; using namespace std; int findLargest() { int arg[25],largest,size,i,j; cout&lt;&lt;"enter the size of array"&lt;&lt;endl; cin&gt;&gt;s...
0debug
Android studio layout design issue : I have a problem in the layout design in android studio, in android studio I set 720x1280 in the design preview option. Its the first image. But when i build the apk and install it in the device, the same activity looks like the second image. Its like it's cut. I need that in th...
0debug
Error defining a function : <p>My task is to make o a function named count_nucleotides which takes to string, one word and a letter and counts the appearance number of the letter. For example:</p> <p>count_nucleotides('ATCGGC', 'G') and gives 2</p> <p>count_nucleotides('ATCTA', 'G') and gives 0</p> <p>My code until ...
0debug
static int milkymist_minimac2_init(SysBusDevice *sbd) { DeviceState *dev = DEVICE(sbd); MilkymistMinimac2State *s = MILKYMIST_MINIMAC2(dev); size_t buffers_size = TARGET_PAGE_ALIGN(3 * MINIMAC2_BUFFER_SIZE); sysbus_init_irq(sbd, &s->rx_irq); sysbus_init_irq(sbd, &s->tx_irq); memory_re...
1threat
void op_flush_icache_all(void) { CALL_FROM_TB1(tb_flush, env); RETURN(); }
1threat
I have built a regex but there is an issue : <p>I have this regex as follows </p> <pre><code>/^\S(?=.*[a-z])(?=.*[A-Z])(?=.{8,})(?=.*[0-9])\S </code></pre> <p>it does most of what's its suppose to do such as must be eight characters long have at least one uppercase character one lowercase and one number however the ...
0debug
static unsigned hpte_page_shift(const struct ppc_one_seg_page_size *sps, uint64_t pte0, uint64_t pte1) { int i; if (!(pte0 & HPTE64_V_LARGE)) { if (sps->page_shift != 12) { return 0; } return 12; } for (i = 0; i < PPC_PAGE_SIZ...
1threat
void fw_cfg_add_bytes(FWCfgState *s, uint16_t key, uint8_t *data, uint32_t len) { int arch = !!(key & FW_CFG_ARCH_LOCAL); key &= FW_CFG_ENTRY_MASK; assert(key < FW_CFG_MAX_ENTRY); s->entries[arch][key].data = data; s->entries[arch][key].len = len; }
1threat
File Saveas xls to xlsx : I have an excel file in the **C** disk named **C:\Book1.xls** How can I saveas **C:\Book1.xls** to **C:\Book2.xlsx** ? Is it possible to use **System.IO.File.SaveAs** class?
0debug
how to extract number sets in parentheses from google sheet : How to extract and split this set of numbers (314.81+10.00)+0.00 to each column expected result: [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/QHkjZ.png
0debug
I want to filter rows by the content of their cells, with multiple words : <p>I have a table with this look <a href="https://i.stack.imgur.com/fAaYS.png" rel="nofollow noreferrer">enter image description here</a></p> <p>I want to filter all the rows that in the column Cellular have the word membrane. But when I do th...
0debug
Converting Java string to Date : <p>I need to convert a java string in a date format to a new date format to send it to my sql-server. Currently, my Java date is <code>Jul 17 2018 14:22:58</code>, and I need it to look like <code>2018-07-17 14:22:58</code>. So I created this:</p> <pre><code>String oldTime = "Jul 17 ...
0debug
R: return first value that exceeds 0.8 within groups : data<-data.frame(c(A,A,A,A,B,B,B,C,C,C),c(0.2,0.78,0.82,0,1,0.1,0.81,1,0.8,0.92,1)) Hello! I would like to choose only first 80% within each group (A,B). Means I cannot use ordinary <. Any ideas?
0debug
given a role ARN, you want to find out which stack and region created the role? : Can anyone please provide cli command to get stack name and region of a role created through it
0debug
The application bundle does not contain a valid identifier : <p>I try to run my project but i get the following error "The application bundle does not contain a valid identifier."</p> <p>here my info.plist</p> <p><a href="https://i.stack.imgur.com/p1jC9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/p1jC9....
0debug
Python: how to merge two dataframes with different size? : <p>I have two dataframes, <code>df</code> and <code>df1</code>. The first one contains all the information about all the possible combination of a dataset while the second one is just a subset without the information.</p> <pre><code>df x y distance 0 ...
0debug
"import torch" giving error "from torch._C import *, DLL load failed: The specified module could not be found" : <p>I am currently using Python 3.5.5 on Anaconda and I am unable to import torch. It is giving me the following error in Spyder: </p> <pre><code>Python 3.5.5 |Anaconda, Inc.| (default, Mar 12 2018, 17:44:09...
0debug
How do I flatten a tensor in pytorch? : <p>Given a tensor of multiple dimensions, how do I flatten it so that it has a single dimension?</p> <p>Eg:</p> <pre><code>&gt;&gt;&gt; t = torch.rand([2, 3, 5]) &gt;&gt;&gt; t.shape torch.Size([2, 3, 5]) </code></pre> <p>How do I flatten it to have shape:</p> <pre><code>torc...
0debug
void OPPROTO op_store_msr (void) { do_store_msr(env, T0); RETURN(); }
1threat
static void coroutine_fn v9fs_flush(void *opaque) { ssize_t err; int16_t tag; size_t offset = 7; V9fsPDU *cancel_pdu; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; err = pdu_unmarshal(pdu, offset, "w", &tag); if (err < 0) { pdu_complete(pdu, err); return; ...
1threat
static void imdct36(int *out, int *buf, int *in, int *win) { int i, j, t0, t1, t2, t3, s0, s1, s2, s3; int tmp[18], *tmp1, *in1; for(i=17;i>=1;i--) in[i] += in[i-1]; for(i=17;i>=3;i-=2) in[i] += in[i-2]; for(j=0;j<2;j++) { tmp1 = tmp + j; in1 = in + j; ...
1threat
document.write('<script src="evil.js"></script>');
1threat
How can read from some files and write content of them with different form into files with same names : <p>I have some files with names f_1to2.txt, f_1to3.txt, f_2to1.txt, f_2to3.txt, ..., f_99to100.txt. I want to do something with the contents of these files and then write these changed files with the same names into ...
0debug
How To Run Exported Jar Without Having Assets Next To It : <p>I created a game using LibGDX and I'm trying to figure out how to run a jar without having the images and such within the same folder as it. How do I make it so the jar itself is self sufficient and has the assets contained within it?</p>
0debug
static void omap_pwt_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { struct omap_pwt_s *s = (struct omap_pwt_s *) opaque; int offset = addr & OMAP_MPUI_REG_MASK; if (size != 1) { omap_badwidth_write8(opaque, addr, value); return; } ...
1threat
static void event_test_emit(test_QAPIEvent event, QDict *d, Error **errp) { QObject *obj; QDict *t; int64_t s, ms; obj = qdict_get(d, "timestamp"); g_assert(obj); t = qobject_to_qdict(obj); g_assert(t); obj = qdict_get(t, "seconds"); g_assert(obj && qobject_type(obj...
1threat
'choco' command not recognized when run as administrator on Windows : <p>I installed Chocolatey as per the instructions on the website (<a href="https://chocolatey.org/install" rel="noreferrer">https://chocolatey.org/install</a>).</p> <p>The 'choco' command works fine when I run it normally on cmd but returns the foll...
0debug
static always_inline void gen_op_neg (DisasContext *ctx, TCGv ret, TCGv arg1, int ov_check) { int l1, l2; l1 = gen_new_label(); l2 = gen_new_label(); #if defined(TARGET_PPC64) if (ctx->sf_mode) { tcg_gen_brcondi_tl(TCG_COND_EQ, arg1, INT64_MIN, l1); } else { TCGv t0 = tcg_...
1threat
docker service replicas remain 0/1 : <p>I am trying out docker swarm with 1.12 on my Mac. I started 3 VirtualBox VMs, created a swarm cluster of 3 all fine.</p> <pre><code>docker@redis1:~$ docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS 2h1m8equ5w5beetbq3go56ebl redis3 Ready Active 8xubu8g7pzjvo34q...
0debug
What do the function arguments in STATIC_ROOT = os.path.join(BASE_DIR, 'static') mean? : Django newbie here. I'm on Django 2.1 and was taking tutorials when I saw this line in the settings.py file. What exactly does this line mean? What does os.path.join do?
0debug
Java android: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $ : I'm trying to parse a JSON file that looks like this: [ {"character": "㐭", "definition": "blabla", "pinyin": ["lin"]}, // some more {"character": "㐱", "definition": "blabla", "pinyin": ["zhen"]} ] Whi...
0debug
Docker Bridge Conflicts with Host Network : <p>Docker seems to be creating a bridge after a container starts running that then conflicts with my host network. This is not the default bridge docker0, but rather another bridge that is created after a container has started. I am able to configure the default bridge accor...
0debug
static int tak_read_header(AVFormatContext *s) { TAKDemuxContext *tc = s->priv_data; AVIOContext *pb = s->pb; GetBitContext gb; AVStream *st; uint8_t *buffer = NULL; int ret; st = avformat_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); st->codec->codec_...
1threat
CSS Center curved figure : <p>Is there a way to draw the following figure just with pure CSS? <a href="https://i.stack.imgur.com/UDjI7.jpg" rel="nofollow noreferrer">figure</a></p>
0debug
static int url_connect(struct playlist *pls, AVDictionary *opts, AVDictionary *opts2) { AVDictionary *tmp = NULL; int ret; av_dict_copy(&tmp, opts, 0); av_dict_copy(&tmp, opts2, 0); av_opt_set_dict(pls->input, &tmp); if ((ret = ffurl_connect(pls->input, NULL)) < 0) { ffurl_...
1threat
how to use Sql IN Statement with list of Items selected from treeviewlist? : how to join string values from "For Next Loop" into one single string Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim accid As String Dim iLast As Integer iLast = trv...
0debug
I have a table like below i want the latest entry to be displayed.Please let me know i you need any other details : [The Query which iam using now is below ][1] [The raw output s as this image shows][2] The data is what i get now but i want the latest entry for uid 3,15,33 The reason why i have done the ...
0debug
char *av_base64_encode(uint8_t * src, int len) { static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; char *ret, *dst; unsigned i_bits = 0; int i_shift = 0; int bytes_remaining = len; if (len < UINT_MAX / 4) { ret = dst = av_mal...
1threat
Given a list of positive and negative numbers. What is an elegant solution to tell which is closest to zero? : <p>Say you have a list of numbers:</p> <pre><code>var list = [4, -12, 18, 1, -3]; </code></pre> <p>What is a more elegant solution to finding the value closest to zero without nesting a whole lot of if/else ...
0debug
PHP: How do I limit the amount of results in an array : <p>I am pulling trends out of the Twitter API. I end up with an array with 42 items. I can print the elements I want just fine, however I would like to limit the amount of elements to just 5 instead of 42.</p> <p>Here's a screenshot of the data returned:</p> <p>...
0debug
def remove_Occ(s,ch): for i in range(len(s)): if (s[i] == ch): s = s[0 : i] + s[i + 1:] break for i in range(len(s) - 1,-1,-1): if (s[i] == ch): s = s[0 : i] + s[i + 1:] break return s
0debug
I am creating unity game in C#. i am struggling a liitle bit to add a script that moves the object of the game from side to side : i am struggling a little bit to add a script that moves the object of the game from side to side I want to create a function to move the object of the game from left to right and to avoi...
0debug
static void integratorcm_init(int memsz, uint32_t flash_offset) { int iomemtype; integratorcm_state *s; s = (integratorcm_state *)qemu_mallocz(sizeof(integratorcm_state)); s->cm_osc = 0x01000048; s->cm_auxosc = 0x0007feff; s->cm_sdram = 0x00011122; if (memsz >= 256) { ...
1threat
Downloading a file from google cloud storage inside a folder : <p>I've got a python script that gets a list of files that have been uploaded to a google cloud storage bucket, and attempts to retrieve the data as a string.</p> <p>The code is simply: </p> <pre><code>file = open(base_dir + "/" + path, 'wb') data = Blob...
0debug
Way to break out of an inner For loop in Swift : <p>Is there a simple way to break out of an inner For loop, i.e. a Fro loop within another For loop? Without having to set additional flags for example</p>
0debug
Year Field in Django : <p>I want my users to enter their birth year. I don't want them to type the same in the form rather select the year from available options. I known that I can do something like this in my model if I needed to date instead of year:</p> <pre><code>class MyModel(models.Model): birthday = model...
0debug
static void xen_domain_watcher(void) { int qemu_running = 1; int fd[2], i, n, rc; char byte; pipe(fd); if (fork() != 0) return; n = getdtablesize(); for (i = 3; i < n; i++) { if (i == fd[0]) continue; if (i == xen_xc) ...
1threat
static uint32_t bitband_readw(void *opaque, target_phys_addr_t offset) { uint32_t addr; uint16_t mask; uint16_t v; addr = bitband_addr(opaque, offset) & ~1; mask = (1 << ((offset >> 2) & 15)); mask = tswap16(mask); cpu_physical_memory_read(addr, (uint8_t *)&v, 2); return (v & ma...
1threat
android studio admob banner doesn't work : <p>I am working on simple android app that contain Admob banner, but when I run the app I get this message:</p> <pre><code>unfortunately the app has stopped </code></pre> <p>here is my code:</p> <p>xml layout: </p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &...
0debug
Is this a violation of strict aliasing rules? : <p>According to the standard — <em>an aggregate or union type that includes one of the aforementioned types among its elements or nonstatic data members (including, recursively, an element or non-static data member of a subaggregate or contained union)</em>, this is allow...
0debug
static void coroutine_fn bdrv_get_block_status_above_co_entry(void *opaque) { BdrvCoGetBlockStatusData *data = opaque; data->ret = bdrv_co_get_block_status_above(data->bs, data->base, data->sector_num, data->nb_...
1threat
int avpriv_vsnprintf(char *restrict s, size_t n, const char *restrict fmt, va_list ap) { int ret; if (n == 0) return 0; else if (n > INT_MAX) return AVERROR(EINVAL); memset(s, 0, n); ret = vsnprintf(s, n - 1, fmt, ap); if (ret ==...
1threat
How to grep all the njmbers in a file : Cat test 1 0 2 Operator 3 Cat test ¦ grep [0-9] >> 1 The test file contains the baove values. When i grep the test file using grep [0-9] it gives only 1 as output.. How to grep all the numbers in the test file
0debug
BottomSheetDialog remains hidden after dismiss by dragging down : <p>I am pretty curious about the behavior of the <code>BottomSheetDialog</code> when it is dismissed : when the user draggs it down to hide it, it will remain hidden, even if <code>bottomSheetDialog#show()</code> is called after. This only happens when ...
0debug
comment in bash script processed by slurm : <p>I am using <code>slurm</code> on a cluster to run jobs and submit a script that looks like below with <code>sbatch</code>:</p> <pre><code>#!/usr/bin/env bash #SBATCH -o slurm.sh.out #SBATCH -p defq #SBATCH --mail-type=ALL #SBATCH --mail-user=my.email@something.com echo ...
0debug
static sPAPREventLogEntry *rtas_event_log_dequeue(uint32_t event_mask, bool exception) { sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine()); sPAPREventLogEntry *entry = NULL; if ((event_mask & EVENT_MASK_EPOW) == 0) { return N...
1threat
void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec, int unused, int size) { if (is_exec) helper_raise_exception(EXCP_IBE); else helper_raise_exception(EXCP_DBE); }
1threat
How do I call git diff on the same file between 2 different local branches? : <p>Is there a way to check the difference between the working directory in my current branch against the working directory of another branch in a specific file? For example, if I'm working in branch A on file 1, I want to compare the differen...
0debug
operations in methods dont get saved to my variable : This is my first time using stackoverflow. IDK if i am doing it right. So anyways, i am trying to make calculator on Java. I am not sure how to explain my problem. operations in methods dont get saved. when i try to add number, it doesnt apply to last state of it. i...
0debug
Optional property class in typescript : <p>I'm new in typescript and I want to know what is the utility of optional property class in typescript? And what is the difference between:</p> <pre><code>a?: number; a: number | undefined; </code></pre>
0debug
int pci_piix3_xen_ide_unplug(DeviceState *dev) { PCIIDEState *pci_ide; DriveInfo *di; int i; IDEDevice *idedev; pci_ide = PCI_IDE(dev); for (i = 0; i < 4; i++) { di = drive_get_by_index(IF_IDE, i); if (di != NULL && !di->media_cd) { BlockBackend *blk = b...
1threat