problem
stringlengths
26
131k
labels
class label
2 classes
Angular 2 add multiple classes via [class.className] binding : <p>While adding a single class works great in this way - </p> <p><code>[class.loading-state]="loading"</code></p> <p>But how do I add multiple classes Ex if <code>loading</code> is <code>true</code> add class - <code>"loading-state" &amp; "my-class"</code...
0debug
Need to dynamically generate UITableView items from JSON. What is the best approach? : <p>Lets say I have an array of JSON objects like this:</p> <pre><code>{ "views": [ { "type": "UILabel", "data": "Here is a headline", "id": "label1" }, { "type": "UIImage", "data": "http://doge2048....
0debug
static int encode_mode(CinepakEncContext *s, int h, AVPicture *scratch_pict, AVPicture *last_pict, strip_info *info, unsigned char *buf) { int x, y, z, flags, bits, temp_size, header_ofs, ret = 0, mb_count = s->w * h / MB_AREA; int needs_extra_bit, should_write_temp; unsigned char temp[64]; mb_inf...
1threat
static void test_visitor_in_any(TestInputVisitorData *data, const void *unused) { QObject *res = NULL; Error *err = NULL; Visitor *v; QInt *qint; QBool *qbool; QString *qstring; QDict *qdict; QObject *qobj; v = visitor_input_test_init(data...
1threat
I'm having trouble shoveling all my objects into an array in ruby : so I'm working on my first scraping project in Ruby and I'm having some trouble placing my scraped data into the empty array I created. I'm not sure where my code is incorrect. So far it's only pushing one of the schools_1 etc. to the schools array. Do...
0debug
static void decode_mb(MpegEncContext *s, int ref) { s->dest[0] = s->current_picture.f.data[0] + (s->mb_y * 16 * s->linesize) + s->mb_x * 16; s->dest[1] = s->current_picture.f.data[1] + (s->mb_y * (16 >> s->chroma_y_shift) * s->uvlinesize) + s->mb_x * (16 >> s->chroma_x_shift); ...
1threat
Angular 6 - Keep scroll position when the route changes : <p><strong>Previous Behavior:</strong></p> <p>Changing the route or navigation path would not affect the scroll position when navigating to another route. I.e the contents can change without the scroll position changing.</p> <p><strong>Current Behavior:</stron...
0debug
Kafka optimal retention and deletion policy : <p>I am fairly new to kafka so forgive me if this question is trivial. I have a very simple setup for purposes of timing tests as follows:</p> <p>Machine A -> writes to topic 1 (Broker) -> Machine B reads from topic 1 Machine B -> writes message just read to topic 2 (Broke...
0debug
int64_t cpu_get_ticks(void) { if (use_icount) { return cpu_get_icount(); } if (!timers_state.cpu_ticks_enabled) { return timers_state.cpu_ticks_offset; } else { int64_t ticks; ticks = cpu_get_real_ticks(); if (timers_state.cpu_ticks_prev > ticks) { ...
1threat
static void av_noinline filter_mb_edgech( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) { const unsigned int index_a = 52 + qp + h->slice_alpha_c0_offset; const int alpha = alpha_table[index_a]; const int beta = (beta_table+52)[qp + h->slice_beta_offset]; if (alpha ==0 ...
1threat
'React' must be in scope when using JSX error in routes.js file : <p>ESlint is showing me the above-mentioned error when writing a <code>routes.js</code> file.</p> <pre><code>module.exports = { 'env': { 'browser': true, 'es6': true }, 'extends': ['plugin:react/recommended', 'standard'], 'globals': { ...
0debug
M = 100 def maxAverageOfPath(cost, N): dp = [[0 for i in range(N + 1)] for j in range(N + 1)] dp[0][0] = cost[0][0] for i in range(1, N): dp[i][0] = dp[i - 1][0] + cost[i][0] for j in range(1, N): dp[0][j] = dp[0][j - 1] + cost[0][j] for i in range(1, N): for j in range(1, N): dp[i][j] ...
0debug
static inline int coupling_strategy(AC3DecodeContext *s, int blk, uint8_t *bit_alloc_stages) { GetBitContext *bc = &s->gbc; int fbw_channels = s->fbw_channels; int channel_mode = s->channel_mode; int ch; memset(bit_alloc_stages, 3, AC3_MAX_CHANNELS); ...
1threat
def rectangle_perimeter(l,b): perimeter=2*(l+b) return perimeter
0debug
HTTP Google Sheets API v4 how to access without OAuth 2.0? : <p>my idea is to create a google sheet, make it public and then access it from my work computer linux/bash to read/write values on a daily basis. </p> <p>i have a public google doc sheet that anyone can find/edit. this is the sheet ID: <code>1F6jh6756xNDlDY...
0debug
Auto Versioning in Visual Studio 2017 (.NET Core) : <p>I have spent the better part of a few hours trying to find a way to auto-increment versions in a .NETCoreApp 1.1 (Visual Studio 2017).</p> <p>I know the the AssemblyInfo.cs is being created dynamically in the folder: <code>obj/Debug/netcoreapp1.1/</code></p> <p>I...
0debug
Dynamically generate html files to display image and video : <p>I am uploading some images and videos to upload folder and then I display those to my webpage using array. that takes extra load on browser. so I want when I upload any image/video to upload folder it should create dynamic html or php file to display for ...
0debug
Google Maps crashing on Android Pie : <p>I am testing Google Map on Google Pixel running the latest version of Android Pie. </p> <pre><code>Caused by java.lang.ClassNotFoundException Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m...
0debug
Error in my python cipher : <p>I'm using the code</p> <pre><code>a = 1 b = 2 c = 3 d = 4 e = 5 f = 6 g = 7 h = 8 i = 9 j = 10 k = 11 l = 12 m = 13 n = 14 o = 15 p = 16 q = 17 r = 18 s = 19 t = 20 u = 21 v = 22 w = 23 x = 24 y = 25 z = 26 fullstring = raw_input('Cipher-thing:') if fullstring.isalpha and len(fullstring)...
0debug
how can execute other contextmenu in console with javascripte or other js : **i want to change this top in console log with other menucontext other there i tried but no solution any one have a solution please** check this image please ! https://i.imgur.com/bienKZ0.png <article id="post-<?php the_ID...
0debug
av_cold int swr_init(struct SwrContext *s){ int ret; char l1[1024], l2[1024]; clear_context(s); if(s-> in_sample_fmt >= AV_SAMPLE_FMT_NB){ av_log(s, AV_LOG_ERROR, "Requested input sample format %d is invalid\n", s->in_sample_fmt); return AVERROR(EINVAL); } if(s->out_s...
1threat
C++ Random Number Generator With the Random Header : I have probably been through 20 different sites looking for a solution. I have been trying to make a random number generator (as the title says) but whenever I try something with an integer, it will return the same number. Here is some code that apparently works. (us...
0debug
Cannot resolve method findViewById for progress-bar : Cannot resolve method findViewById for progress-bar i want show a progress-bar for my webview, and it should stop once the loading is finished ,here is my code , but when i call progressbar it showing **Cannot resolve method findViewById** package com.fb...
0debug
static int64_t mmsh_read_seek(URLContext *h, int stream_index, int64_t timestamp, int flags) { MMSHContext *mmsh = h->priv_data; MMSContext *mms = &mmsh->mms; int ret; ret= mmsh_open_internal(h, mmsh->location, 0, timestamp, 0); if(ret>=0){ if (mms->mms_hd...
1threat
static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s, void *data, uint32_t length, uint64_t offset) { int ret = 0; void *buffer = NULL; void *merged_sector = NULL; void *data_tmp, *sector_write; unsigned int i; int sector_offset; uint32_t desc_s...
1threat
vim: difference between :n and :bn : <p>If I started vim with multiple files like so <code>vim *.java</code>, I can cycle through opened files using either <code>:n</code> or <code>:bn</code> (and other related commands). </p> <p>But if I start with only one file and load other files using <code>:split</code> (and lat...
0debug
void mpeg1_init_vlc(MpegEncContext *s) { static int done = 0; if (!done) { init_vlc(&dc_lum_vlc, 9, 12, vlc_dc_lum_bits, 1, 1, vlc_dc_lum_code, 2, 2); init_vlc(&dc_chroma_vlc, 9, 12, vlc_dc_chroma_bits, 1, 1, vlc...
1threat
static void qemu_net_queue_append_iov(NetQueue *queue, NetClientState *sender, unsigned flags, const struct iovec *iov, int iovcnt, ...
1threat
In computer vision, what does MVS do that SFM can't? : <p>I'm a dev with about a decade of enterprise software engineering under his belt, and my hobbyist interests have steered me into the vast and scary realm of computer vision (CV).</p> <p>One thing that is not immediately clear to me is the division of labor betwe...
0debug
static int udp_read(URLContext *h, uint8_t *buf, int size) { UDPContext *s = h->priv_data; int ret; int avail; #if HAVE_PTHREADS if (s->fifo) { pthread_mutex_lock(&s->mutex); do { avail = av_fifo_size(s->fifo); if (avail) { uint8_t tm...
1threat
How to adapt my data to a recycler view in kotlin : <p>I wrote a wrapper for a website that has a method get_page(pag: Int, cat: Int), and ot returns a list of maps and each map has keys like "name" "price" and "id". How do I adapt this data to a recycler view ?</p>
0debug
C# - Removing new lines in pipe-separated file : I have some files in CSV format, delimited with pipe. I need every row of the file to be in one single line, but I have some files like this: |0001|Some text|Some longer text that \n has new lines on it|1234 So, this means that the first row is now in two l...
0debug
static inline void downmix_2f_1r_to_dolby(float *samples) { int i; for (i = 0; i < 256; i++) { samples[i] -= samples[i + 512]; samples[i + 256] += samples[i + 512]; samples[i + 512] = 0; } }
1threat
elasticsearch data lost when running nodejs script : <p>i have an elasticsearch running on my localmachine (only there, no other shards/replicas), and it took me awhile but i got to a state where i had all my data (~9 million documents) on it. then, i wrote a small nodejs script that went throw all the documents in the...
0debug
LinkedIn in-app browser forcing video to fullscreen on iPhone : <p>We are using LinkedIn to share a link to an HTML5 interactive video. When the link is shared, by default it opens in LinkedIn's browser inside the app. The problem is that when the user starts playing the video, the browser automatically switches to ful...
0debug
static int ne2000_can_receive(void *opaque) { NE2000State *s = opaque; int avail, index, boundary; if (s->cmd & E8390_STOP) return 0; index = s->curpag << 8; boundary = s->boundary << 8; if (index < boundary) avail = boundary - index; else avail = (s-...
1threat
static int nbd_co_writev_1(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov, int offset) { BDRVNBDState *s = bs->opaque; struct nbd_request request; struct nbd_reply reply; request.type = NBD_CMD_WRITE; if (!...
1threat
How to convert class objects to named tuples? I am learning named tuples any one help me in this : I really want to use namedtuples instead of class objects class objects class ZoneFileObject(object): def __init__( self, descriptor='', name='', filehandle=...
0debug
What's wrong in my code? (Array and Scanner)(Java) : import java.util.*; public class RandomAddArray { public static void main (String[] args){ AddArray ad = new AddArray(); int [] Ar = new int [4]; ad.AddArray(Ar); } } class AddArray{ public void AddArray(int a[] ...
0debug
How are files stored in memory and how can i use that knowledge in C++? : <p>How are files stored in memory? I suppose that when i write in a text file something like Hello World, the file in memory looks like this: <code>01001000 01100101 01101100 01101100 01101111</code> 1 Byte 1 Char?</p> <p>Well... I'm 90% sure I'...
0debug
delete column of whole table. using mysql : <p>I am a newbie in php and just learning about it. in between this my sir give me one task to delete column of the table. how can we delete only one column of table. for example my table have 3 fields. ID,NAME,STATUS. it have 500 of data. and i just have to delete status fro...
0debug
Boostrap collapse not working : Attempting to use Boostrap collapse in a form and it is non-responsive. Copy & pasted directly from the Boostrap website but still does not work. Please help! <a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" data-target="firstname" aria-exp...
0debug
static void acpi_get_pm_info(AcpiPmInfo *pm) { Object *piix = piix4_pm_find(); Object *lpc = ich9_lpc_find(); Object *obj = NULL; QObject *o; pm->pcihp_io_base = 0; pm->pcihp_io_len = 0; if (piix) { obj = piix; pm->cpu_hp_io_base = PIIX4_CPU_HOTPLUG_IO_BASE; ...
1threat
how to get data from another web site : how to get an specific data from another web site, using curl with PHP. This is my code: $page = curl_init('http://lookup.cla.base8tech.com/'); $encoded =''; foreach($_GET as $name=>$value){ $encoded .= urlencode($name) .'=' .urlencode($val...
0debug
sort array of objects according to month name? : <p>I have a array of objects with months and i want to sort them in a specific order such as fiscal year format how do i do that?</p> <pre><code>(12) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] 0:{subscribedCustomers: 1, req_count: 1, revenue: 1532.82, ...
0debug
How does Pandas to_sql determine what dataframe column is placed into what database field? : <p>I'm currently using Pandas to_sql in order to place a large dataframe into an SQL database. I'm using sqlalchemy in order to connect with the database and part of that process is defining the columns of the database tables.<...
0debug
Remove the web apps using google apps script : Suppose i have list of web apps in Google admin console. I want to remove the webapps from the list.I know i can remove my webapp from admin console one by one. But i want to remove(or revoke) the web apps using google apps script. Can we do it? if yes,can you please pos...
0debug
int xen_be_init(void) { xenstore = xs_daemon_open(); if (!xenstore) { xen_be_printf(NULL, 0, "can't connect to xenstored\n"); return -1; } if (qemu_set_fd_handler(xs_fileno(xenstore), xenstore_update, NULL, NULL) < 0) { goto err; } xen_xc = xc_interface_open...
1threat
play video extention files on server : hey i would like for files with .3gp or mp4 to play in the browser when you type the url path insted of giving you the download option i want somthing like this http://www.html5videoplayer.net/videos/toystory.mp4 this is what i currently have http://www.reelychat.com/img/1/pro...
0debug
static bool elf_check_ehdr(struct elfhdr *ehdr) { return (elf_check_arch(ehdr->e_machine) && ehdr->e_ehsize == sizeof(struct elfhdr) && ehdr->e_phentsize == sizeof(struct elf_phdr) && ehdr->e_shentsize == sizeof(struct elf_shdr) && (ehdr->e_type == ET_EXEC || eh...
1threat
How to change the flex order when wrapping : <p>I would like to achieve something that renders like this depending on the screen size:</p> <pre><code>+---------------------------+ | A | B | C | +---------------------------+ +---------------+ | A | C | | B | +---------------+ </code...
0debug
Change default 'delimiters' in excel : <p>I am using Excel for Mac 2016 on macOS Sierra software. Although I have been successfully copying and pasting CSV files into excel for some time now, recently, they have begun to behave in an odd way. When I paste the data, the content of each row seems to split over many colum...
0debug
Python: How to append a file in python using inputs? : <p>I am fairly new to python, and have been trying to create a program where I create a file from user inputs. However, I cannot seem to get it to work, and keep getting the error:</p> <pre><code>Traceback (most recent call last): File "my_program.py", line 7,...
0debug
Is it possible for a hacker to find the value of a session variable on my server ? : <p>Is it possible for someone (hacker), to somehow get a hold of the value of a session variable that is active.</p>
0debug
static unsigned int dec_bound_m(DisasContext *dc) { TCGv l[2]; int memsize = memsize_zz(dc); int insn_len; DIS(fprintf (logfile, "bound.%d [$r%u%s, $r%u\n", memsize_char(memsize), dc->op1, dc->postinc ? "+]" : "]", dc->op2)); l[0] = tcg_temp_local_new(TCG_TYPE_TL); l[1] = tcg_temp_lo...
1threat
How do I grant Git 'ForcePush' permissions for pushing bfg-repo-cleaner results to VSTS? : <p>A person in my company who's an admin on the company's VSTS project created a repo for me, and granted me all permissions on the <code>master</code> branch.</p> <p>Now I need to run <a href="https://rtyley.github.io/bfg-repo-...
0debug
New to AWS S3, confusion on file storage : Lets say I want to make a server in Node.js that allows users to upload files and it stores them in AWS S3. I have something like this given by default: https://s3.amazonaws.com/aws-website-test-psjjm/about.html But this means anyone can view it and access it. ...
0debug
I HAVE CREATED A PL/SQL FUNCTION , WHEN I AM USING TEO CONDITION UNDER WHEN WITH AND , IT IS NOT GETTING COMPLIED : I HAVE CREATED A PL/SQL FUNCTION , HERE I AM USING CASE STATEMENT IN WHICH I AM USING A SQL QUERY AS AN EXPRESSION. THIS IS WORKING FINE BUT , WHEN I AM USING AND UNDER WHEN CONDITION IT IS NOT GETTING CO...
0debug
static float quantize_and_encode_band_cost(struct AACEncContext *s, PutBitContext *pb, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, ...
1threat
Create a list of dictionary under donditional : I got a json format data.I want to extract some useful data from it, so I need to use some loop to do it. here is my code: `data=json.loads(res.text)` `for item in data['leagues'][0]['events']:` `for xx in item['periods']:` `if 'moneyline' in xx.keys():` `...
0debug
All MySQL records from yesterday : <p>What is the most efficient way to get all records with a datetime field that falls somewhere between yesterday at <code>00:00:00</code> and yesterday at <code>23:59:59</code>?</p> <p>Table:</p> <pre><code>id created_at 1 2016-01-19 20:03:00 2 2016-01-19 11:12:05 3 ...
0debug
long do_sigreturn(CPUAlphaState *env) { struct target_sigcontext *sc; abi_ulong sc_addr = env->ir[IR_A0]; target_sigset_t target_set; sigset_t set; if (!lock_user_struct(VERIFY_READ, sc, sc_addr, 1)) { goto badframe; } target_sigemptyset(&target_set); __get_user(tar...
1threat
void rgb32tobgr24(const uint8_t *src, uint8_t *dst, long src_size) { long i; long num_pixels = src_size >> 2; for(i=0; i<num_pixels; i++) { #ifdef WORDS_BIGENDIAN dst[3*i + 0] = src[4*i + 1]; dst[3*i + 1] = src[4*i + 2]; dst[3*i + 2] = src[4*i + 3]; #else dst[3*i + 0] = src[4*i + 2];...
1threat
Add New Post potion wodpress did not work ad media : [enter image description here][1]i sent my screan short pleased help me [enter image description here][2] see my problem [1]: https://i.stack.imgur.com/MQYca.png [2]: https://i.stack.imgur.com/SF7rR.png
0debug
I have created two functions in php both the function returning an array I want to merge both the array and return a JSON : I have created two functions in PHP both the function returning an array I want to merge both the array and return a JSON. Thanks! Regards, Jitender
0debug
how to control NodeMCU without web but with GUI like Qt (through wifi) : I want to make a GUI which controls an LED over wifi (using Qt gui) the same way it is done using web servers but instead of a URL based controlling i want to control it using a Qt GUI. I have searched everywhere and could not find any answers, ho...
0debug
static void gen_sse(DisasContext *s, int b, target_ulong pc_start, int rex_r) { int b1, op1_offset, op2_offset, is_xmm, val, ot; int modrm, mod, rm, reg, reg_addr, offset_addr; GenOpFunc2 *sse_op2; GenOpFunc3 *sse_op3; b &= 0xff; if (s->prefix & PREFIX_DATA) b1 = 1; else i...
1threat
static void q35_host_get_pci_hole64_start(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { PCIHostState *h = PCI_HOST_BRIDGE(obj); Range w64; pci_bus_get_w64_range(h->bus, &w64); visit_...
1threat
PHP Updatable Variable : <p>I am working on a site that has a variable for the current year. This variable is used throughout the website. The variable needs to be manually updated every year in the middle of the summer. I want to allow the admin to update that variable but it seems wasteful to create an entire table f...
0debug
float32 HELPER(ucf64_si2sf)(float32 x, CPUUniCore32State *env) { return int32_to_float32(ucf64_stoi(x), &env->ucf64.fp_status); }
1threat
static void gen_window_check2(DisasContext *dc, unsigned r1, unsigned r2) { gen_window_check1(dc, r1 > r2 ? r1 : r2); }
1threat
void helper_discard_movcal_backup(CPUSH4State *env) { memory_content *current = env->movcal_backup; while(current) { memory_content *next = current->next; free (current); env->movcal_backup = current = next; if (current == NULL) env->movcal_backup_tail = &(env->movcal_backup); } }...
1threat
void bdrv_reset_dirty_bitmap(BdrvDirtyBitmap *bitmap, int64_t cur_sector, int64_t nr_sectors) { assert(bdrv_dirty_bitmap_enabled(bitmap)); hbitmap_reset(bitmap->bitmap, cur_sector, nr_sectors); }
1threat
How to set two adapters to one RecyclerView? : <p>I am developing an android app in which I'm storing two different types of information on 'FirebaseDatabase`.</p> <p>Then in the <code>MainActivity</code>, I'm retrieving them and showing to users in a <code>RecyclerView</code>. Both information are meant to be shown i...
0debug
Gradle error : Could not find com.android.tools.build:gradle:2.2.3 : <p>I'm trying to build my android project using gradle and circleCI, but I've got this error :</p> <pre><code>* What went wrong: A problem occurred configuring root project '&lt;myproject&gt;'. &gt; Could not resolve all dependencies for configur...
0debug
static int decode_init_mp3on4(AVCodecContext * avctx) { MP3On4DecodeContext *s = avctx->priv_data; MPEG4AudioConfig cfg; int i; if ((avctx->extradata_size < 2) || (avctx->extradata == NULL)) { av_log(avctx, AV_LOG_ERROR, "Codec extradata missing or too short.\n"); return -1; ...
1threat
Angular 2: check if shift key is down when an element is clicked : <p>In an Angular 2 app, i want the click event to trigger something different when <em>the shift key is being held down</em>. how to achieve this?</p> <p>html is below:</p> <pre><code>&lt;div class="item" *ngFor="#obj of available" (click)="toggleSele...
0debug
Import only type information from module : <p>Let's say I have two files, A.js and B.js. Both need references to each other like this.</p> <p><em>A.js</em></p> <pre><code>import { B } from "b" export class A { constructor(public name: string) {} } let b = new B(); b.print(new A("This is a random name")); </code><...
0debug
static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata) { AVFormatContext *is = ifile->ctx; AVFormatContext *os = ofile->ctx; AVChapter **tmp; int i; tmp = av_realloc(os->chapters, sizeof(*os->chapters) * (is->nb_chapters + os->nb_chapters)); if (!tmp) ...
1threat
Deleting from the start of a line to a colon regex(notepad++) : <p>I am trying to delete from the start of a line to the first colon. The dark gray area designates the area I am trying to get rid of. </p> <p><a href="https://i.stack.imgur.com/wkFDF.png" rel="nofollow noreferrer">.txt file list</a></p>
0debug
Codeigniter framework : stdClass Object ( [enq_id] => 10008 [enq_userid] => 3 [enq_catid] => 43 [enq_attachid] => 8 [enq_name] => werwer [enq_desc] => werwerwerewr [enq_end_date] => 22/08/2016 [enq_budget] => 1212 [enq_quantity] => 1212 [enq_city] => Alpy [enq_fee...
0debug
PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name) { PCIDevice *dev = pci_create(bus, devfn, name); qdev_init(&dev->qdev); return dev; }
1threat
How to persist a list of strings with Entity Framework Core? : <p>Let us suppose that we have one class which looks like the following:</p> <pre><code>public class Entity { public IList&lt;string&gt; SomeListOfValues { get; set; } // Other code } </code></pre> <p>Now, suppose we want to persist this using EF...
0debug
Find all possible increasing subsequences of a given length in scala : What is the efficient way to find all possible increasing subsequences of a given length in scala ? For eg: Suppose there is a sequence of numbers as follows: 7 6 9 11 16 10 12 The possible increasing subsequences of size 3 for the above sequ...
0debug
how to select element text with react+enzyme : <p>Just what it says. Some example code:</p> <pre><code>let wrapper = shallow(&lt;div&gt;&lt;button class='btn btn-primary'&gt;OK&lt;/button&gt;&lt;/div&gt;); const b = wrapper.find('.btn'); expect(b.text()).to.be.eql('OK'); // fails, </code></pre> <p>Also the <code>h...
0debug
How do I get past IndentationError with try and except in a for loop in Python? : given_items = ["one", "two", 3, 4, "five", ["six", "seven", "eight"]] for item in given_items: try: for element in item: except TypeError: pass else: print(element) prints: o n...
0debug
void do_addmeo (void) { T1 = T0; T0 += xer_ca + (-1); if (likely(!((uint32_t)T1 & ((uint32_t)T1 ^ (uint32_t)T0) & (1UL << 31)))) { xer_ov = 0; } else { xer_ov = 1; xer_so = 1; } if (likely(T1 != 0)) xer_ca = 1; }
1threat
My program shows an error, It says that a semicolon missing : <pre><code>import java.util.*; public class Fact </code></pre> <blockquote> <p>program to find factorial numbers</p> </blockquote> <pre><code>{ Scanner sc=new Scanner(System.in); int n; Fact() </code></pre> <blockquote> <p>an empty cons...
0debug
Why does runif() have less unique values than rnorm()? : <p>If you run code like: </p> <pre><code>length(unique(runif(10000000))) length(unique(rnorm(10000000))) </code></pre> <p>you'll see that only about 99.8% of runif values are unique, but 100% of rnorm values are. I thought this might be because of the constrain...
0debug
Xcode : Compare buttons : I am new to iOS development and I was trying to make a basic tic tac toe app. I am not able to find a way to compare the value of three buttons(the one's in a row or column etc). I managed to create 9 buttons and I am replacing the image of each button on user click(Either X or O based on tur...
0debug
I need a keyboard button presser thing please : hi i am trying to make a clicker for a game i play, and it requires the pushing of a button, and about 10 seconds later i need to hold down a different button if someone can link me, or somehow make a keyboard presser thing that can press q over and over for ten sec...
0debug
While Statement help bash scripting : <p>Need help understanding this script I cannot figure out what the <code>-z</code> condition means for first line then the <code>-z</code> with the <code>"$1"</code> in the if statement Here is the script:</p> <pre><code>while [ -z "$USERNAME" ] do if [ -z "$1" ] then ...
0debug
from collections import Counter def count_common(words): word_counts = Counter(words) top_four = word_counts.most_common(4) return (top_four)
0debug
How to reverse a long sum without loosing the first digit after the sum reverse? : I've completed a program where it reverse long sum's, but for some reason when I try to reverse the sum of two long values it drops the first number. The first number I use is 1234567890000000000 and the second 1234567890. When I do the ...
0debug
difference between "->" and "." operator in C language (struct) : <p>I' just got started in learning struct in c language. i Thought "->" and "." were equivalent but i get the following error when using "->" instead of ".": <em>invalid type argument of '->' (have 'struct item')</em></p>
0debug
static int decode_frame_byterun1(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { IffContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; unsigned buf_size = avpkt->size; const uint8_t *buf_end = buf+buf_size...
1threat
How to import Room Persistence Library to an Android project : <p>I recently saw the new feature announced on Google I/O Room Persistence Library to work with Sqlite databases on Android. I have been looking to the <a href="https://developer.android.com/topic/libraries/architecture/room.html" rel="noreferrer">official ...
0debug
static int init_directories(BDRVVVFATState* s, const char* dirname) { bootsector_t* bootsector; mapping_t* mapping; unsigned int i; unsigned int cluster; memset(&(s->first_sectors[0]),0,0x40*0x200); s->cluster_size=s->sectors_per_cluster*0x200; s->cluster_buffer=qemu_malloc(s->...
1threat
Headless Chrome and Selenium on Windows? : <p>I've seen that headless Chrome came out in some form last month and I've seen that it can be interacted with via Selenium but the articles I've seen mostly mention Linux and MacOS. Is this available for windows (7 and /or 10) yet?</p>
0debug
Java String class replaceAll method missing : <p>I'm having a very weird issue right now, the <code>replaceAll</code> method is missing from the <code>String</code> object.</p> <p>JDK version: 1.8.0<br> Android Studio version: 3.1.3<br> Kotlin version: 1.2</p> <p><a href="https://i.stack.imgur.com/mHDZ0.png" rel="nor...
0debug