problem
stringlengths
26
131k
labels
class label
2 classes
update nested dictionary from another nested dictionary based on mapping provided in dictionary : I need to write down a method to transform existing nested dictionary values from another nested dictionary , and mapping in between these two dictionary is in another third dictionary. source = { "s0" : ...
0debug
static int tight_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) { int max_rows; if (vs->clientds.pf.bytes_per_pixel == 4 && vs->clientds.pf.rmax == 0xFF && vs->clientds.pf.bmax == 0xFF && vs->clientds.pf.gmax == 0xFF) { vs->tigh...
1threat
static void readline_printf_func(void *opaque, const char *fmt, ...) { va_list ap; va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); }
1threat
static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn, void *src) { int result = 0; if (secn > 0) { const uint8_t *sp = (const uint8_t *)src; uint8_t *dp = 0, *dpp = 0; if (s->bdrv_cur) { dp = g_malloc(512); if (!dp || bd...
1threat
Beginner - Not getting output in my textbook : I'm a student and have a question. I'm not getting the correct output in our textbook. first = 'I' second = 'love' third = 'Python' sentence = first + '' + second + '' + third + '.' Output: I love Python. When I run it, nothing happens. ...
0debug
hide/show fab with scale animation : <p>I'm using custom floatingactionmenu. I need to implement scale animation on show/hide menu button like here <a href="https://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0B6Okdz75tqQsZU1kZWhRYWZpUDg/components-buttons-fab-behavior_01_xhdpi_012....
0debug
void *qemu_blockalign(BlockDriverState *bs, size_t size) { return qemu_memalign((bs && bs->buffer_alignment) ? bs->buffer_alignment : 512, size); }
1threat
void do_info_usernet(Monitor *mon) { SlirpState *s; TAILQ_FOREACH(s, &slirp_stacks, entry) { monitor_printf(mon, "VLAN %d (%s):\n", s->vc->vlan->id, s->vc->name); slirp_connection_info(s->slirp, mon); } }
1threat
PHP - simple array to multiple array : I have an array with contry list like this $array = array('country1' => CountryOne, 'country2' => Country Two); How i can transform this array in a multiple array like: array(2) { [0] => array(2) { ["code"] => "country1",["name"] => "CountryOne"} ...
0debug
Is there third party package repository for Swift? : <p>I came from web development/design (still are) and I started to learn Swift 5 for iOS app development. In web development, there's a lot of sites or repo where I can download pre-written codes for the web like packagist.org. My question is, is there a similar site...
0debug
How can i change this code for multiplication? : i have this code and i am using for addition of inputs. How can i change this code for multiplication? function sumIt() { var total = 0, val; $('.inst_amount').each(function() { val = $(this).val(); val = isNaN(val) || $.trim(val) === "" ? 0 : ...
0debug
void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number) { mpeg1_encode_sequence_header(s); put_header(s, PICTURE_START_CODE); put_bits(&s->pb, 10, (s->picture_number - s->gop_picture_number) & 0x3ff); s->fake_picture_number++; ...
1threat
static int wma_decode_init(AVCodecContext * avctx) { WMADecodeContext *s = avctx->priv_data; int i, flags1, flags2; float *window; uint8_t *extradata; float bps1, high_freq; volatile float bps; int sample_rate1; int coef_vlc_table; s->sample_rate = avctx->sample_rate;...
1threat
Why there is no floating point type smaller in byte-size than 'float' in C# : <p>Hopefully it is the 1st question of its type on SO. C# has 4 integral types:</p> <p><code>byte</code>: 1 byte</p> <p><code>short</code>: 2 bytes</p> <p><code>int</code>: 4 bytes</p> <p><code>long</code>: 8 bytes</p> <p>But just two fl...
0debug
int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr, int is_write, int is_user, int is_softmmu) { uint8_t *pde_ptr, *pte_ptr; uint32_t pde, pte, virt_addr, ptep; int error_code, is_dirty, prot, page_size, ret; unsigned long paddr, vaddr, page_offset; #...
1threat
Reading Sequences in Python : I'm new to python and I'm trying to help out a friend with her code. The code receives input from a user until the input is 0, using a while loop. I'm not used to the python syntax, so I'm a little confused as to how to receive user input. I don't know what I'm doing wrong. Here's my code:...
0debug
ruby check if a jpeg is readable : Ruby newby here<br /> I am downloading pictures with open-Uri and sometimes, the downloaded picture is corrupted and cannot be opened with a picture viewer (or another program capable of displaying pictures)<br /> Is there a simple method to determine if the downloaded picture is co...
0debug
How to Zip Two Lists, of Which One Only Has One Element or More (Combine Elements One by One From Two List) : <p>Here is an example of two lists:</p> <pre><code>scala&gt; val hosts = List("host1", "host2") hosts: List[String] = List(host1, host2) scala&gt; val ports = List("port1") ports: List[String] = List(port1) <...
0debug
when i am clicking on the upload button in document web part, then inside that section master page is showing(which should not show) : continued..... Kindly let me know how to remove that either in SharePoint designer or SharePoint 2013 itself. Also site settings is showing up in home page(but it should show in seper...
0debug
how to compare two strings in IF condition (if the words are similar from each strings) inside for loop in python? : I want to compare two strings after changed from list. if the word from d1 is similar with d2, then it returns the similar words. here's my codes : d1 = [['learn'],['car']] d2 = [['learn'...
0debug
int ff_get_cpu_flags_x86(void) { int rval = 0; int eax, ebx, ecx, edx; int max_std_level, max_ext_level, std_caps=0, ext_caps=0; int family=0, model=0; union { int i[3]; char c[12]; } vendor; #if ARCH_X86_32 x86_reg a, c; __asm__ volatile ( "pushfl\n\t...
1threat
static Coroutine *coroutine_new(void) { const size_t stack_size = 1 << 20; CoroutineUContext *co; CoroutineThreadState *coTS; struct sigaction sa; struct sigaction osa; struct sigaltstack ss; struct sigaltstack oss; sigset_t sigs; sigset_t osigs; jmp_buf old_env; ...
1threat
Why I get wrong result with std::pow and std::fmod? : <p>The following lines of code end up returning a wrong result after a calculation, could this be caused by the approximation of the "double" type?</p> <pre><code> int base = 20, exp = 27, mod = 123; std::fmod(std::pow(base, exp), mod) </code></pre> <p>Is t...
0debug
static int coroutine_fn nfs_co_flush(BlockDriverState *bs) { NFSClient *client = bs->opaque; NFSRPC task; nfs_co_init_task(client, &task); if (nfs_fsync_async(client->context, client->fh, nfs_co_generic_cb, &task) != 0) { return -ENOMEM; } while (!t...
1threat
Google permission restriction for SMS and CALL_LOG : <p>My app during testing has RECEIVE_SMS permission. A month ago I receive warning from Google for restrictions about receiving SMS since 9 January 2019. After warning I removed this permission from manifest, but warning is still displayed. Now my manifest permissio...
0debug
Identify Return Key action in React Native : <p>I have a <code>TextInput</code> which I have enabled <code>multiline</code> as true. Thing is the Keyboard won't hide after Return is pressed. It goes to a new line. So I was hoping to use <a href="https://www.npmjs.com/package/react-native-dismiss-keyboard" rel="noreferr...
0debug
void gen_intermediate_code_internal(LM32CPU *cpu, TranslationBlock *tb, bool search_pc) { CPUState *cs = CPU(cpu); CPULM32State *env = &cpu->env; struct DisasContext ctx, *dc = &ctx; uint16_t *gen_opc_end; uint32_t pc_start; int j, lj; uint32_t ne...
1threat
Why JVM doesn't throw any compile time error for not initializing local variable if a local variable is declared like this int a=10,b=3,m;? : I am trying to execute the below code: public class HelloWorld{ public static void main(String []args){ int a=10,b=3,m; System.out.println("Hello Wo...
0debug
What does this means, why is the (int) in the sentence? : I don't know why is the "int" in parenthesis next to the *Predicator typedef bool (*Predicate)(int);
0debug
static void fft(AC3MDCTContext *mdct, IComplex *z, int ln) { int j, l, np, np2; int nblocks, nloops; register IComplex *p,*q; int tmp_re, tmp_im; np = 1 << ln; for (j = 0; j < np; j++) { int k = av_reverse[j] >> (8 - ln); if (k < j) FFSWAP(IComplex...
1threat
void omap_badwidth_write8(void *opaque, target_phys_addr_t addr, uint32_t value) { uint8_t val8 = value; OMAP_8B_REG(addr); cpu_physical_memory_write(addr, (void *) &val8, 1); }
1threat
Length of each string in a NumPy array : <p>Is there any builtin operation in NumPy that returns the length of each string in an array?</p> <p>I don't think any of the <a href="https://docs.scipy.org/doc/numpy-1.12.0/reference/routines.char.html" rel="noreferrer">NumPy string operations</a> does that, is this correct?...
0debug
How to insert/update information in SqlServer using C# : Hello I am trying to insert new information into my already created table where id = 2019; I get the error incorrect syntax near WHERE private void button6_Click(object sender, EventArgs e) { xcon.Open(); SqlDataAdapter xadapter =...
0debug
Kestrel with IIS - libuv.dll missing on run : <p>We're setting up an existing Web API server to serve site(s) alongside an existing API. I have been loosely following <a href="http://miniml.ist/dotnet/how-to-serve-a-static-site-plus-a-web-api-in-aspnetcore/" rel="noreferrer">this article</a>.</p> <p>Here's what my Glo...
0debug
static void uhci_fill_queue(UHCIState *s, UHCI_TD *td) { uint32_t int_mask = 0; uint32_t plink = td->link; uint32_t token = uhci_queue_token(td); UHCI_TD ptd; int ret; while (is_valid(plink)) { pci_dma_read(&s->dev, plink & ~0xf, &ptd, sizeof(ptd)); le32_to_cpus(&ptd.l...
1threat
Websocket : javascript as client and python as server, and web host on Linux : I need to build the website and use the javascript as client language to communicate with python server. BTW, the webpage need to be host on Linux. and for now, I just only use the command "python -m SimpleHTTPServer" to build a simple serve...
0debug
Can I inspect a sqlalchemy query object to find the already joined tables? : <p>I'm trying to programmatically build a search query, and to do so, I'm joining a table.</p> <pre><code>class User(db.Model): id = db.Column(db.Integer(), primary_key=True) class Tag(db.Model): id = db.Column(db.Integer(), primary_...
0debug
Kotlin reflect proguard SmallSortedMap : <pre><code>Warning: kotlin.reflect.jvm.internal.KClassImpl: can't find referenced class kotlin.reflect.jvm.internal.KClassImpl$kotlin.reflect.jvm.internal.KClassImpl$Data Warning: kotlin.reflect.jvm.internal.KClassImpl: can't find referenced class kotlin.reflect.jvm.internal.KCl...
0debug
Web Scrapping code review : from bs4 import BeautifulSoup import requests import pandas as pd records=[] keep_looking = True url = 'https://www.tapology.com/fightcenter' while keep_looking: re = requests.get(url) soup = BeautifulSoup(re.text,'html.parser') ...
0debug
Why do we have to forcefully use the bootstrap navbar? : <p>I believe that this component is very problematic, it has many classes, and it is easily disbanded. Would not it be much easier to use div with col and rows to control it in a simpler way?</p> <p>Of course we could use some indispensable classes like fixed, b...
0debug
java.util.ConcurrentModificationException in fragment : <p>I am developing android app I have implemented searchview but when I start to search news in search bar </p> <pre><code>I am getting following exception </code></pre> <blockquote> <p>Process: edgar.yodgorbek.sportnews, PID: 5146 java.util.Concurr...
0debug
void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset) { c->frames= frame_offset; if (c->ach) c->abytes= av_rescale_q(c->frames, c->sys->time_base, (AVRational){8, c->ast[0]->codec->bit_rate}); c->audio_pkt[0].size = c->audio_pkt[1].size = 0; c->a...
1threat
Merge DataFrames with Matching Values From Two Different Columns - Pandas : <p>I have two different DataFrames that I want to merge with <code>date</code> and <code>hours</code> columns. I saw some <a href="https://stackoverflow.com/questions/28097222/pandas-merge-two-dataframes-with-different-columns">threads</a> that...
0debug
static void avc_luma_midv_qrt_16w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height, uint8_t vert_offset) { uint32_t multiple8_cnt; for (multiple8_cnt = 2; multiple8_cnt--;) { a...
1threat
why is golang http server failing with "broken pipe" when response exceeds 8kb? : <p>I have a example web server below where if you call <code>curl localhost:3000 -v</code> then <code>^C</code> (cancel) it immediately (before 1 second), it will report <code>write tcp 127.0.0.1:3000-&gt;127.0.0.1:XXXXX: write: broken pi...
0debug
exercise in python 3 with wrapper : I have issue with following exercise:https://pythonprogramming.net/decorators-intermediate-python-tutorial/ Here is code I wanted to write: def add_wrapping(item): def wrapped_item(): return 'a wrapped up box of {}'.format(str(item())) retur...
0debug
static void migration_state_notifier(Notifier *notifier, void *data) { MigrationState *s = data; if (migration_is_active(s)) { #ifdef SPICE_INTERFACE_MIGRATION spice_server_migrate_start(spice_server); #endif } else if (migration_has_finished(s)) { #if SPICE_SERVER_VERSION >= 0x000701 #i...
1threat
static void ff_h264_idct_add8_sse2(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){ int i; for(i=16; i<16+8; i+=2){ if(nnzc[ scan8[i+0] ]|nnzc[ scan8[i+1] ]) ff_x264_add8x4_idct_sse2 (dest[(i&4)>>2] + block_offset[i], block + i*16, stride); ...
1threat
static void omap_eac_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { struct omap_eac_s *s = (struct omap_eac_s *) opaque; if (size != 2) { return omap_badwidth_write16(opaque, addr, value); } switch (addr) { case 0x098: ...
1threat
static void test_wait_event_notifier_noflush(void) { EventNotifierTestData data = { .n = 0 }; EventNotifierTestData dummy = { .n = 0, .active = 1 }; event_notifier_init(&data.e, false); aio_set_event_notifier(ctx, &data.e, event_ready_cb, NULL); g_assert(!aio_poll(ctx, false)); g_asse...
1threat
static void backward_filter(RA288Context *ractx) { float temp1[37]; float temp2[11]; do_hybrid_window(36, 40, 35, ractx->sp_block, temp1, ractx->sp_hist, ractx->sp_rec, syn_window); if (!eval_lpc_coeffs(temp1, ractx->sp_lpc, 36)) colmult(ractx->sp_lpc, ractx->sp...
1threat
javascript sum with parseFloat giving wronge value : <pre><code>function myFunction() { var c = parseFloat("10.81") +parseFloat("10.00"); alert(c); } </code></pre> <p>//output is 20.810000000000002 why?</p>
0debug
Even the file system is full, Then to linux system will work fine. How it is happening? : <p>Even the file system is full, Then to linux system will work fine. How it is happening ?</p>
0debug
Jenkinsfile get current tag : <p>Is there a way to get the current tag ( or null if there is none ) for a job in a Jenkinsfile? The background is that I only want to build some artifacts ( android APKs ) when this commit has a tag. I tried:</p> <pre><code>env.TAG_NAME </code></pre> <p>and</p> <pre><code>binding.var...
0debug
Urgent Help: Recycle View : I have used combination of recycle view E,g When we open Google play store we can scroll them horizontally and vertically to find an application, My problem: When i click on parent view it gives me the position of parent however when i click on child view,i get child position (Note: when ...
0debug
A weird error occurring when trying to implement useEffect : <p>I am trying to use useEffect inside of my cockpit function that returns a couple of elements, but I get this weird error saying that "Line 6: React Hook "useEffect" is called in function "cockpit" which is neither a React function component or a custom R...
0debug
moment().add() only works with literal values : <p>I'm using Moment.js in TypeScript (under Angular 2 if that matters). When I use the add() method with literal values as arguments, it works fine:</p> <pre><code>moment().add(1, 'month'); </code></pre> <p>However, if I try to replace the units with a string, it fails...
0debug
Shell Script to find string of file A in File B and print Yes or No in front of particular string : <p>I have two file A &amp; B. File A contains some strings. I wanted to find strings in file B &amp; if a string is there in file B. Print Yes in front of string in file A otherwise print NO.</p> <p>Propose any solution...
0debug
InputEvent *qemu_input_event_new_btn(InputButton btn, bool down) { InputEvent *evt = g_new0(InputEvent, 1); evt->btn = g_new0(InputBtnEvent, 1); evt->kind = INPUT_EVENT_KIND_BTN; evt->btn->button = btn; evt->btn->down = down; return evt; }
1threat
Vba code to auto serial number in column A after my userform entered data in column B : I have a userform which user can insert data and data will insert in column B to M. I need a code,either in worksheet or in userform to auto fill serial number starting with "RD 00001" which will fill in column A everytime data has ...
0debug
db.execute('SELECT * FROM employees WHERE id = ' + user_input)
1threat
ASAuthorizationAppleIDButton not responding to touchUpInside events : <p>I've experienced strange bug in Latest Xcode 11.0 My code:</p> <pre><code>let button = ASAuthorizationAppleIDButton(type: .default, style: .black) button.translatesAutoresizingMaskIntoConstraints = false button.cornerRadius = 10 button.addTarget(...
0debug
How to include XML documentation file in NuGet package built from a project file? : <p>I consider it generally good practice to include the XML documentation file generated by the C# build in NuGet packages alongside the DLLs to provide intellisense documentation for consumers.</p> <p>However, it's not clear to me how...
0debug
void qmp_cont(Error **errp) { Error *local_err = NULL; BlockBackend *blk; BlockDriverState *bs; BdrvNextIterator it; if (dump_in_progress()) { error_setg(errp, "There is a dump in process, please wait."); return; } if (runstate_needs_reset()) { ...
1threat
String.Replace() will not change the source string of the variable : <p>I have the following code inside my c# application:-</p> <pre><code> string[] excludechar = { "|", "\\", "\"", "'", "/", "[", " ]", ":", "&lt;", " &gt;", "+", "=", ",", ";", "?", "*", " @" }; var currentgroupname = curItemSiteName; for (int i = ...
0debug
How to turn off interval loop : <p>How would I stop this loop? The loop is necessary, I'm just not sure how I stop it when I need to. </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-overri...
0debug
C programming book code : So I am reading the "C programming book" and I understand how this program functions, but, I don't understand one thing. I don't understand how fahr is functioning as a variable. does fahr have two values or one? Cause I thought once you write a value for a variable you can't change it unl...
0debug
static void omap_mcbsp_writeh(void *opaque, hwaddr addr, uint32_t value) { struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; int offset = addr & OMAP_MPUI_REG_MASK; switch (offset) { case 0x00: case 0x02: OMAP_RO_REG(addr); return; case 0x04...
1threat
int qemu_timer_expired(QEMUTimer *timer_head, int64_t current_time) { if (!timer_head) return 0; return (timer_head->expire_time <= current_time); }
1threat
Why isn't my String being detected in my Set? : I am having a very specific problem I am currently trying to find a string in a set. But for some reason it can't be found and its not triggering the code properly. while program_running: load_reddit() if not image_found: for images in hot_imag...
0debug
sharing a single service across multiple angular 5 applications : <p>I'm running multiple small angular 5 applications as widgets inside my backbase application. Now I'm trying to write a global service, which is at window level, and share across all applications.</p> <p>Currently, I'm making the service static and us...
0debug
how to increment a const without calling/creating a listerner function : In javascript we have addEventlister, this listens to an even and calls a function called a listener function. Is an alternate approach possible where we increment the value of a const without using a function to do this in case of event being tri...
0debug
How to prevent class instantiation with dependency injection? : <p>I had an interview question that asked roughly the following: with dependency injection, how do you prevent all of the classes from being instantiated? What if you only want a few, but not all? There are good reasons, they said, for example to avoid the...
0debug
Using static variables and methods vs. non-static : <p>I am developing an ASP/c# webform where I am using JQuery as well. I came into a scenario where I need to call. C# function from JQuery. In order to that, I found that function in c# has to be a static method (web method). </p> <p>The problem is that I need to acc...
0debug
Bash script to return correct value on Updates statement : <p>I've written a small script to check for Updates. I'm looking for it to output 1 of 3 answers:</p> <ol> <li>If there are no updates, return "Your system is up to date"</li> <li>If there is only one update avaiable, return "There is 1 Update available"</li> ...
0debug
Datasets not joining : <p>I'm having trouble joining FBI crime data with school districts. </p> <p>There are some cities/towns that have the same name in the same state, so county is given as a way to separate these values. For the years 2003-2017 there are roughly 1700 values that also have counties. However, when I ...
0debug
remove plus symbol from email regex php : <p>I want to remove + symbol from email please help me to write a regex that doesn't accept + symbol in email.</p> <pre><code>abc@xyz.com - valid email abc123@xyz.com - valid email abc.def@xyz.com - valid email abc+123@xyz.com - Invalid email </code></pre>
0debug
JS lodash [1, 2] => {1: 'test', 2: 'test'} : <p>There is an array:</p> <pre><code>var array = [{test: 1}, {test: 2}, {test: 3}] </code></pre> <p>I need to get:</p> <pre><code>{1: 'random_value', 2: 'random_value', 3: 'random_value'} </code></pre> <p>I'm doing:</p> <pre><code>var values_test = _.map(array, 'test');...
0debug
PHP -- Unsyntax error, unexpected 'echo' (T_ECHO) on line 58 : <pre><code> else if (isset($id) &amp;&amp; isset($street_address) &amp;&amp; isset($price) ){ echo '&lt;p&gt;Are you sure you want to delete the following product?&lt;/p&gt;'; echo '&lt;p&gt;&lt;strong&gt;Street Address: &lt;/strong&gt;' . $street_add...
0debug
void copy_picture_field(TInterlaceContext *tinterlace, uint8_t *dst[4], int dst_linesize[4], const uint8_t *src[4], int src_linesize[4], enum AVPixelFormat format, int w, int src_h, int src_field, int interleave, int dst...
1threat
Position:absolute, position:relative doesnt work : I want announce on the top and header in the bottom but this is the output in every browser what am i doing wrong here [enter image description here][1] [1]: https://i.stack.imgur.com/ZsoSf.png this is my html code: https://hastebin.com/bocacehoka.js this i...
0debug
Scrabble Description Assume that you are trying to complete a crossword puzzle : In a crossword puzzle, some letters are given and you have to figure out which complete word can you make out of it. For example, given letters "cwd"in the same order, you can make the word "crossword" or "cr I have written a code : x...
0debug
Add two JSON s in Javascript : I have two JSON s, I want to add two JSON s in Javascript, JSON A :- { "data": [{ "id": 1, "subgroup": "1", "power": "2", "grp": "1" }, { "id": 1, "subgroup": "1", "power": "1", "grp": "1" }, { ...
0debug
Randomly generating obstacles in Unity : <p>Currently I'm creating game in which whole level is generated when player moves. I have working script for that, but now I want to generate obstacles in front of the player. My idea is to add empty object to my terrain segment(these are dynamically generated) and then instant...
0debug
How to convert number to scientific notation in Codeigniter? : I am working on web-based application build with Codeigniter. My question is how to convert number to scientific notation? For some reason, I need to display number from user input from **250** to **2.5 x 10<sup>2</sup>** and **25** to **2.5 x 10<sup>1<...
0debug
Lazarus. I get FileSize error : I get error: unit1.pas(91,31) Error: Incompatible type for arg no. 1: Got "File Of Byte", expected "AnsiString" var f : file of byte; ... AssignFile(f, FileName); Reset(f); try TotalBytes := FileSize(f); // line 93 finally ...
0debug
Hubot/CoffeeScript combine spawned process outputs : While the following code works great to call a python script and get the output: s = spawn 'python', ['-u', 'foo.py'] s.stdout.on 'data', (data) -> msg.send data.toString() s.stderr.on 'data', (data) -> msg.send data.toString() foo.py returns many...
0debug
Understanding MetaData() from SQLAlchemy in Python : <p>I am trying to understand what the MetaData() created object is in essence. It is used when reflecting and creating databases in Python (using SQLAlchemy package). </p> <p>Consider the following working code:</p> <p>/ with preloaded Engine(sqlite:///chapter5.sql...
0debug
BlockReopenQueue *bdrv_reopen_queue(BlockReopenQueue *bs_queue, BlockDriverState *bs, QDict *options, int flags) { assert(bs != NULL); BlockReopenQueueEntry *bs_entry; BdrvChild *child; QDict *old_options; if (bs_que...
1threat
how to overwrite two dataframe in get the result like below : i have two dataframes DF1 and DF2 through pyspark, i want output like below. DF1 Id|field_A|field_B|field_C|field_D 1 |cat |12 |black |1 2 |dog |128 |white |2 DF2 Id|field_A|field_B|field_C 1 |cat |13 |blue OutPut ...
0debug
copy array of pointers and print the copy : <p>I'm trying to copy a pointers of arrays and print the values from the copied array, but I got a Segmentation fault.</p> <pre><code>void kosomo(char * test[10]) { int j=0; char * test2[10]; while (test[j] != NULL) { test2[j]=&amp;tes...
0debug
--recurse ERROR: Insufficient Permission: Request had insufficient authentication scopes : <p>I'm trying to copy a directory from my vm to my local machine's Desktop with the following command:</p> <pre><code>gcloud compute scp --recurse instance-1:~/directory ~/Desktop/ </code></pre> <p>I tried reauthenticating with...
0debug
static void test_machine(const void *data) { const testdef_t *test = data; char tmpname[] = "/tmp/qtest-boot-serial-XXXXXX"; int fd; fd = mkstemp(tmpname); g_assert(fd != -1); global_qtest = qtest_startf("-M %s,accel=tcg:kvm " "-chardev fil...
1threat
Python set __contains__ is not finding objects contained in the set : <p>(python 3.7.1 on linux)</p> <p>I am observing some strange behavior storing user-defined objects in a set. The objects are highly complex so a minimal example is not in the cards-- but I am hoping the observed behavior will elicit an explanation...
0debug
Why doesn't For loop iterate without compound assignment operators : Sorry for noob question, I am trying to replace every character of source string with "🥃". If I remove += from my code For loop iterates only once, can't seem to follow logic behind this? However, if I use '+=' For loop iterates. Shouldn't iterati...
0debug
Could not find any available provisioning profiles for iOS : <p>We are developing a iOS shopping cart application in c# and visual studio 2017 for xamarin. I have an iPad Air iOS 10.3, when I try to publish to real device, I am getting the following error message: "Could not find any available provisioning profiles for...
0debug
static int pcm_encode_frame(AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data) { int n, sample_size, v; const short *samples; unsigned char *dst; const uint8_t *srcu8; const int16_t *samples_int16_t; const int32_t *samples_int32_t; con...
1threat
php, create 1 array from another 2 : <p>I have two arrays like this:</p> <pre><code>$a1 = ['A','B']; $a2 = ['1','2']; </code></pre> <p>I need to have this new one (with the _ between the values):</p> <pre><code>$a3 = ['A_1','B_2']; </code></pre> <p>I know isn't difficult, but I'm pretty stucked, using <code>array_c...
0debug
Get array of string literal type values : <p>I need to get a full list of all possible values for a string literal.</p> <pre><code>type YesNo = "Yes" | "No"; let arrayOfYesNo : Array&lt;string&gt; = someMagicFunction(YesNo); //["Yes", "No"] </code></pre> <p>Is there any way of achiving this?</p>
0debug
static bool intel_hda_xfer(HDACodecDevice *dev, uint32_t stnr, bool output, uint8_t *buf, uint32_t len) { HDACodecBus *bus = DO_UPCAST(HDACodecBus, qbus, dev->qdev.parent_bus); IntelHDAState *d = container_of(bus, IntelHDAState, codecs); target_phys_addr_t addr; uint32_t...
1threat