problem
stringlengths
26
131k
labels
class label
2 classes
static int bt_hid_out(struct bt_hid_device_s *s) { USBPacket p; if (s->data_type == BT_DATA_OUTPUT) { p.pid = USB_TOKEN_OUT; p.devep = 1; p.data = s->dataout.buffer; p.len = s->dataout.len; s->dataout.len = s->usbdev->info->handle_data(s->usbdev, &p); ...
1threat
Conditional operators precedence in C : Do conditional operators have precedence in C (like && being executed after || or vice-versa) or do they execute from left to right? I usually use parentheses to make sure they execute correctly, but someone asked me about this and I was not sure. For example is $a || b && c ...
0debug
How do I open developer tools on IOS simulator : <p>I am wanting to open <strong>developer tools</strong> on an IOS simulator</p> <p>I have taken the following steps, on a 2016 Macbook running <strong>macOS Sierra 10.12.1</strong> and don't know how to get any further:</p> <ul> <li>I have XCode installed</li> <li>I c...
0debug
c++ loop its not end the program wont end : can u tell whats the mistake t runs ok but program wont end i a m new to programming please i need help i have posted the code any one v=can check and help me please and am using dev c++ for this and i dont know why its doing like this uuuuurgghhhhhh #include <iostream...
0debug
Javascipt: How can I change the class of a div by clicking another div? : I want to make a div appear when clicking on another div. I was thinking of doing this by using JavaScript to change the class of a div when another div is clicked on. This is the HTML of the div I want to appear: <div id ="menutext...
0debug
static int64_t load_kernel(void) { int64_t entry, kernel_high; long kernel_size, initrd_size, params_size; ram_addr_t initrd_offset; uint32_t *params_buf; int big_endian; #ifdef TARGET_WORDS_BIGENDIAN big_endian = 1; #else big_endian = 0; #endif kernel_size = load_elf(loade...
1threat
what i am further to do..I got a Prime Numbers to be print ,non prime numbers are am not able to print. : Input:20 Output:0 is not a Prime 1 is not a prime 2 is a prime 3 is a prime 4 is not a prime 5 is a prime 20 is not a prime(upto n...
0debug
Can someone please help me with this program? : Write a program that reads four integers and prints "two pairs" if the input consists of two matching pairs (in some order) and "not two pairs" So far I have written: public static void main(String[] args){ Scanner in = new Scanner(System.in); int n; i...
0debug
qsort not working c program : <p>I am trying to sort an array of names via qsort.</p> <p>This is my code</p> <pre><code>#include&lt;stdio.h&gt; #include&lt;string.h&gt; #include&lt;stdlib.h&gt; int myCompare (const void * a, const void * b ) { return *(char*)a - *(char*)b; } int main(void) { int i; char fileArr[...
0debug
how to arrange values according to alphabets in php : hi m working on jobportal project, and wants to arrange values alphabatically according to their starting aplhabet section, according to image. <span>a</span> <?php $sql = "select * from companies"; $result = mysqli_query...
0debug
bool virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req) { VirtIOSCSICommon *vs = &s->parent_obj; SCSIDevice *d; int rc; rc = virtio_scsi_parse_req(req, sizeof(VirtIOSCSICmdReq) + vs->cdb_size, sizeof(VirtIOSCSICmdResp) + vs->sense_size); if ...
1threat
Unable to resolve module `./../../react-transform-hmr/lib/index.js` : <p>error: bundling failed: Error: Unable to resolve module <code>./../../react-transform-hmr/lib/index.js</code> from <code>/ReactNative/UsermanagementNav/src/App.js</code>: The module <code>./../../react-transform-hmr/lib/index.js</code> could not b...
0debug
static void v9fs_wstat_post_rename(V9fsState *s, V9fsWstatState *vs, int err) { if (err < 0) { goto out; } if (vs->v9stat.name.size != 0) { v9fs_string_free(&vs->nname); } if (vs->v9stat.length != -1) { if (v9fs_do_truncate(s, &vs->fidp->path, vs->v9stat.length) ...
1threat
When not to use mobile-web-app-capable : <p>I've <a href="http://www.html5rocks.com/en/mobile/fullscreen/#toc-launch" rel="noreferrer">read</a> on how adding</p> <pre class="lang-html prettyprint-override"><code>&lt;meta name="apple-mobile-web-app-capable" content="yes"&gt; &lt;meta name="mobile-web-app-capable" conte...
0debug
How to change the line color in seaborn lmplot : <p>We can get a plot as bellow</p> <pre><code>import numpy as np, pandas as pd; np.random.seed(0) import seaborn as sns; sns.set(style="white", color_codes=True) tips = sns.load_dataset("tips") g = sns.lmplot(x="total_bill", y="tip", data=tips) sns.plt.show() </code></p...
0debug
Logging array indices, not values (JavaScript) - why? : <p>Here's my script:</p> <pre><code>var alphabet = ["A", "B", "C", "D", "3", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; var str = []; for (i=0; i&lt;alphabet.length; i++) { str.push(i); conso...
0debug
Error while Installing restart patches when launching android app with Android Studio 2.0 : <p>Currently I'm using Android Studio 2.0 and installing my APK into my Samsung device (S6). However, when rebuilding my code and running it again I receive the following error:</p> <pre><code>Error installing cold swap patches...
0debug
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { PicContext *s = avctx->priv_data; AVFrame *frame = data; uint32_t *palette; int bits_per_plane, bpp, etype, esize, npal, pos_after_pal; int i, x, y, p...
1threat
Convert Matrix to upper triangular without using numpy : My code had conveted the matrix to Upper Triangular Matrix but I need to eliminate the space after the last element in a row. My code is n= int(input()) matrix=[] for i in range(n): matrix.append(list(map(int,input().rstrip().split(...
0debug
static void exponents_from_scale_factors(MPADecodeContext *s, GranuleDef *g, int16_t *exponents) { const uint8_t *bstab, *pretab; int len, i, j, k, l, v0, shift, gain, gains[3]; int16_t *exp_ptr; exp_ptr = exponen...
1threat
how to develop a wordpress plugin to fetch the posts from the parameters given at home page and parse it as json, like JSON API Plugin : I am trying to develop a small wordpress plugin to fetch the posts, pages from the website and parse it as json to further use in mobile apps. Right now i am achiving the goal via t...
0debug
How to add a URL to download a file in java : <p>I want to add a URL into my java program: <a href="http://www.markit.com/news/InterestRates_JPY_20160426.zip" rel="nofollow">http://www.markit.com/news/InterestRates_JPY_20160426.zip</a>; so basically when you open this link a zip file is downloaded. How do I do that?</p...
0debug
Invalid name when running stata do file : I am getting "Invalid name" when running the following code foreach i in 2008 2009 2010 2011{ disp `"Working in Year `i'"' tostring `i', local(yearStr) disp `"yearStr"' graph bar E if Year=="'i'", c(1) name ('i',replace) histogram E if Year=="`i'...
0debug
Stream Video using Twilio from IP Camera RTSP : <p>All of Twilio's examples for their Programmable Video service that I've been able to find either demonstrate screen sharing or webcam media streams. Can someone point me to an example that streams video from an RTSP stream provided by an IP Camera?</p> <p>I've been a...
0debug
Is C# a regular language? : <p>I'm writing some static analysis tools and have been trying to avoid doing full-on compilation style string parsing, and that brought me to this question.</p> <p>Is C# a regular language?</p> <p>Why or why not?</p>
0debug
static void pit_reset(void *opaque) { PITState *pit = opaque; PITChannelState *s; int i; for(i = 0;i < 3; i++) { s = &pit->channels[i]; s->mode = 3; s->gate = (i != 2); pit_load_count(s, 0); } }
1threat
%matplotlib notebook showing a blank histogram : <p>In my Jupyter notebook I am now using <code>%matplotlib notebook</code> instead of <code>%matplotlib inline</code>, it's awesome that I can now interact with my plots on Jupyter. However, when I try to make an histogram I get a blank plot:</p> <p><a href="https://i.s...
0debug
static av_cold int prores_encode_close(AVCodecContext *avctx) { ProresContext* ctx = avctx->priv_data; av_freep(&avctx->coded_frame); av_free(ctx->fill_y); av_free(ctx->fill_u); av_free(ctx->fill_v); return 0; }
1threat
CVS how to split and find number of 0's in column : I have 14 columns (A-N) in a CVS file I am looking to to find how many patients(303 in total) have 0 signs for heart disease this would be in column 14(N) anything above 0 would be counted as ill patients and those with 0 are healthy. From what I have in my code so...
0debug
static void validate_bootdevices(char *devices) { const char *p; int bitmap = 0; for (p = devices; *p != '\0'; p++) { if (*p < 'a' || *p > 'p') { fprintf(stderr, "Invalid boot device '%c'\n", *p); exit(1); } if (bitma...
1threat
ComboBox Items via Scene Builder? : <pre><code> &lt;ComboBox fx:id="schaltung" layoutX="347.0" layoutY="50.0" prefHeight="63.0" prefWidth="213.0"&gt; &lt;items&gt; &lt;FXCollections fx:factory="observableArrayList"&gt; &lt;String fx:id="reihe" fx:value="Reihenschaltung" /&g...
0debug
Convert Rdd to Data Frame - i am getting output in the data frame table with " " like "2012-10-10" but i should get output without " " in the table : My input file contains below input "date","time","size","r_version","r_arch","r_os" "2012-10-01","00:30:13",35165,"2.15.1","i686","linux-gnu" "2012-10-01","00:30...
0debug
found syntax error near ')' SQL server : when I run this query don't know why this show error "Incorrect syntax near ')'." Thank you for help select Sum(DateDiff(s,Toc1.OutTime, (Select Top 1 Intime From tblTokenLogs Where TokenId = Toc1.TokenId And LogId != Toc1.LogId And LogId > Toc1.LogId))) ...
0debug
Cross platform iOS, Android, Linux C++ test framework : <p>In 2017, what options for cross platform C++ unit testing do I have? Testing for both iOS and Android has been totally cumbersome and required lots of custom work in the past.</p> <p>Google recently improved C++ support for Android and Google's GTest looked pr...
0debug
static int bdrv_qed_do_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVQEDState *s = bs->opaque; QEDHeader le_header; int64_t file_size; int ret; s->bs = bs; qemu_co_queue_init(&s->allocating_write_reqs); ret = bdrv_pread(bs-...
1threat
static void pci_dev_get_w64(PCIBus *b, PCIDevice *dev, void *opaque) { Range *range = opaque; PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev); uint16_t cmd = pci_get_word(dev->config + PCI_COMMAND); int i; if (!(cmd & PCI_COMMAND_MEMORY)) { return; } if (pc->is_bridge) { ...
1threat
What CIDR address do not overlaps with 10.0.0.0/16? : <p>I ahve created aws VPC and try to create additional CIDR. I have always got overlaps error whever values I tried <code>/8</code>, <code>/0</code>, <code>/16</code>, <code>/32</code>:</p> <p><a href="https://i.stack.imgur.com/UU9aV.png" rel="nofollow noreferrer">...
0debug
Error in windows forms : <p>First of all, sorry for my bad english,</p> <p>My teacher gave me some homeworks to do, he told me to make a program with 'windows forms' to order fruits from home, but i have these two errors in the code. These two errors are coming from the rows with three slashes. I hope somebody can hel...
0debug
static void build_guest_fsinfo_for_virtual_device(char const *syspath, GuestFilesystemInfo *fs, Error **errp) { DIR *dir; char *dirpath; struct dirent entry, *result; dirpath = g_strdup_printf("%...
1threat
Pictures and images for using in app designing : <p>anyone knows a good website for getting pictures, images, characters,etc for an app I'm developing? I have tried looking for websites but couldnt find anything. maybe there isnt. but im pretty much a begginer and would love to know if there is one. </p>
0debug
When using create-react-app why does the development server keep disconnecting? : <p>It happens arbritarily, like once every 3 or 4 refreshes, the server just disocnnects with this message in the console:</p> <pre><code>The development server has disconnected. Refresh the page if necessary. </code></pre> <p>I looked ...
0debug
how to fill a full line in vertical layout android app programming : this is my first app so sorry i know its not that good. My english neither. I got a Problem with my xml design: I want 2 Buttons and 2 TextViews in one line and to fill the whole line. At the moment it looks like that: [enter image description her...
0debug
background-image not displaying on body : my css is not working i need it to be fixed does not display and don't know why it has done this i'm new so coding html and css and want the image to go full screen. I have tried everything and still not working. body { background-image: "/folder/photo.gif";...
0debug
Convert code from C++ to C : Does anyone know how to convert this line from C++ to C programming language? i wrote this code in C++ and i want to convert it in C. bool compare(string a, string b) { return a+b > b+a; }
0debug
static int balloon_parse(const char *arg) { QemuOpts *opts; if (strcmp(arg, "none") == 0) { return 0; } if (!strncmp(arg, "virtio", 6)) { if (arg[6] == ',') { opts = qemu_opts_parse(qemu_find_opts("device"), arg+7, 0); if (!opts) ...
1threat
static int coroutine_fn backup_run_incremental(BackupBlockJob *job) { bool error_is_read; int ret = 0; int clusters_per_iter; uint32_t granularity; int64_t sector; int64_t cluster; int64_t end; int64_t last_cluster = -1; int64_t sectors_per_cluster = cluster_size_sectors(jo...
1threat
why my code giving error in in jupyter notebook where as it is running correct on online ide ? : # Program for Armstrong Number<br> import math<br> print("this program is for armstrong number\n")<br /> m=0<br> p=0<br> n=int(input("Enter any number: \n"))<br> y=n<br> while y!=0:<br> y=y/10<br> p+=1<br> ...
0debug
How to disable gathering facts for subplays not included within given tag : <p>Several of my playbooks have sub-plays structure like this:</p> <pre><code>- hosts: sites user: root tags: - configuration tasks: (...) - hosts: sites user: root tags: - db tasks: (...) - hosts: sites user: "{{ s...
0debug
Why I am getting the below error? I interchanged the class names and there was no error. : [enter image description here][1] [1]: http://i.stack.imgur.com/IbCWi.png I am executing this in java 8. I tried interchanging the class name. While i did that, I also shuffled the main method. I was getting no errors. ...
0debug
EF query to Oracle throwing "ORA-12704: character set mismatch" : <p>I'm trying to combine a few columns in EF from Oracle then do a <code>.Contains()</code> over the columns like this:</p> <pre><code>public IEnumerable&lt;User&gt; SearchUsers(string search) { search = search.ToLower(); return _securityUow.Us...
0debug
How to create a dataframe from a built in vector in Rstudio : I tried to create a dataframe from the built in data (its a vector) called percip. Here is the code below: data("precip") > str(precip) Named num [1:70] 67 54.7 7 48.5 14 17.2 20.7 13 43.4 40.2 ... - attr(*, "names")= chr [1:70] "Mobile" "Juneau" "Phoe...
0debug
How to print ASCII art in python 3? : I want to print some ASCII art using python 3 on my terminal. I've tried triple quotes but got all sorts of Syntax Errors. Found something like [this][1] that looks fine, but i don't know python 2 and translating it was non-trivial. How do I do this? Thanks a lot. [1]: http:...
0debug
Cookie is not set on localhost in chrome or firefox : <p>I am working with a Jersey server which returns a cookie in the following way:</p> <pre><code>return Response.ok() .cookie( new NewCookie( "userAccessToken", userTokenDTO.getToken(), "/", "", "what is this", 3600, false ...
0debug
Need to change program filtering of files getting from FTP : <p>I've a C# program that received FTP records. The files we receive are all .csv so I check for that below:</p> <pre><code>private static bool IsAllowedExtension(string fileExtension) { return fileExtension.ToLower() == ".csv"; ...
0debug
Get current OS language - Python : <p>I want to take the current OS language in Python. For example if english are chosen, I want to get a code (or something like that) and when I change with shift+alt to other language, I want to take the newly changed language code.</p> <p>Is this possible?</p>
0debug
Why does this bool expression with 'or' return True? : <p>I am still working with bool logic.</p> <p>I have this snippet and I don't understand why the result comes out True.</p> <pre><code>flag = False print(flag) flag = flag or True print(flag) </code></pre> <p>you get:</p> <pre><code>&gt;&gt;False &gt;&gt;True <...
0debug
What does (1UL << 22) mean in MySQL Source Code Documentation : <p>I am updating an existing library in Java I have to connect to MySQL 8 but the source code documentation has a #DEFINE I don't understand. I'm looking specifically at the client capability flags at <a href="https://dev.mysql.com/doc/dev/mysql-server/lat...
0debug
Disable AccountChooser for Firebase Auth : <p>I'm trying the new FirebaseUI for Web (<a href="https://github.com/firebase/FirebaseUI-Web" rel="noreferrer">https://github.com/firebase/FirebaseUI-Web</a>). But when I tried to login with Email, it redirects me to an AccountChooser website.</p> <p>Is there anyway that I c...
0debug
MongoDB: Bulk insert (Bulk.insert) vs insert multiple (insert([...])) : <p>Is there any difference between a <a href="https://docs.mongodb.org/manual/core/bulk-write-operations/" rel="noreferrer">bulk insert</a> vs <a href="https://docs.mongodb.org/manual/reference/method/db.collection.insert/" rel="noreferrer">inserti...
0debug
Java - How to determine if there's a run of characters in an array? : Say we have an array: array = [1, 0, 0, 0, 1, 0, 1, 1, 1]; And we want to find a "run" of duplicate numbers where there are at least three in a row. In this case, it would be the set of 0, 0, 0, and 1, 1, 1. How can I determine which indic...
0debug
static void test_hmac_speed(const void *opaque) { size_t chunk_size = (size_t)opaque; QCryptoHmac *hmac = NULL; uint8_t *in = NULL, *out = NULL; size_t out_len = 0; double total = 0.0; struct iovec iov; Error *err = NULL; int ret; if (!qcrypto_hmac_supports(QCRYPTO_HASH_A...
1threat
Get first and last elements in array, ES6 way : <p><code>let array = [1,2,3,4,5,6,7,8,9,0]</code></p> <p>Documentation is something like this</p> <p><code>[first, ...rest] = array</code> will output 1 and the rest of array</p> <p>Now is there a way to take only the first and the last element <code>1 &amp; 0</code> w...
0debug
XCode 10 does not show file in Navigation Pane : When I click on a folder in the Navigation pane, and open it in Finder, the file is there, but it's not shown in Xcode and build fails complaining the file doesn't exist.
0debug
MYSQL Tables Conflict Need Help Joining tables : MYSQL PROBLEM! HELP PLEASE.. <h3>I HAVE TWO TABLES CALLED kingdom & player</h3> <pre> kingdom table: +---------------------------------------- | ID | kingdom | timestamp | +---------------------------------------- | 1 | Kingdom 47 | time ...
0debug
Delphi: Very simple random : I have this code ... letsdoit(something,'abcd'); letsdoit(something,'asdfasdf'); letsdoit(something,'gagaga'); ... I want it to be, if possible, just one simple line with the logic like: > Question 1: (letsdoit(something,'abcd'))OR(letsdo...
0debug
check_host_key_hash(BDRVSSHState *s, const char *hash, int hash_type, size_t fingerprint_len) { const char *fingerprint; fingerprint = libssh2_hostkey_hash(s->session, hash_type); if (!fingerprint) { session_error_report(s, "failed to read remote host key"); retu...
1threat
How to sort certain range of elements only of a String array in java? : <p>For example I have an array of 5 elements and i want to sort only elements 1-3??</p> <p>array={"abc","rst","pqr","qwerty","lmn"}</p> <p>my array should be array={"abc","pqr","qwerty","rst","lmn"} How do i proceed?</p>
0debug
static int tcp_read(URLContext *h, uint8_t *buf, int size) { TCPContext *s = h->priv_data; int size1, len, fd_max; fd_set rfds; struct timeval tv; size1 = size; while (size > 0) { if (url_interrupt_cb()) return -EINTR; fd_max = s->fd; FD_ZERO(&rfd...
1threat
Comparing Two Hashmaps in Java : <p>What's the recommended approach for comparing hashmaps in Java for equality so that I can determine if they have identical keys and values?</p> <pre><code>Map&lt;String,List&lt;String&gt;&gt; data1 = new HashMap&lt;&gt;(); data1.put("file1", Arrays.asList("one","two","three")); Map...
0debug
Using classes in static main method : <p>So I'm writing a mini-board game program in Java.</p> <p>The program is going to read in standard input and construct a game as directed in the input.</p> <p>To help stay organized and progress my oo java skills, I am using a Cell class to act as a cell in a nxn game.</p> <p>...
0debug
copy web page content in a file via linux terminal : I want to copy some texts from a web page to a file in Linux. I know "wget" can be used to download files but my favourite data is not stored in files and when I want to have them, I have to use copy and paste manually which is very difficult for thousands of web pa...
0debug
static int vp8_lossless_decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, uint8_t *data_start, unsigned int data_size, int is_alpha_chunk) { WebPContext *s = avctx->priv_data; int w, h, ret, i; if (!is_alpha_chun...
1threat
static inline void cow_set_bits(uint8_t *bitmap, int start, int64_t nb_sectors) { int64_t bitnum = start, last = start + nb_sectors; while (bitnum < last) { if ((bitnum & 7) == 0 && bitnum + 8 <= last) { bitmap[bitnum / 8] = 0xFF; bitnum += 8; continue; ...
1threat
static void i6300esb_restart_timer(I6300State *d, int stage) { int64_t timeout; if (!d->enabled) return; d->stage = stage; if (d->stage <= 1) timeout = d->timer1_preload; else timeout = d->timer2_preload; if (d->clock_scale == CLOCK_SCALE_1KHZ) ...
1threat
What is the exact difference between abstraction and encapsulation in C++ : <p>C++: Difference between abstraction and encapsulation in c++</p> <p>I have seen some answers on this topic but I want to know the difference by an example which relates to the theoretical concept of these topics. </p>
0debug
FIND 3RD HISGHEST COST FROM : [This is catalog table [] [1]: https://i.stack.imgur.com/F4AML.png**so i have to find 3rd highest cost from this table .** i wrote this SELECT TOP 1 COST FROM CATALOG WHERE COST IN (SELECT DISTINCT TOP 3 COST FROM CATALOG ORDER BY COST DESC) ORDER BY COST ASC; ...
0debug
How do i Maintain Session in C# MVC Partial Views which will access in different Controllers : <p>I am Trying to Design a web App using MVC .. i am trying to access user Login information throughout the application until the user Logout from the application. </p> <p>please anyone help me... it's most helpful for me if...
0debug
Pulling double inverted commas from the database : <p>I need some assistance. I have a table and I am loading info to it from the database, everything loads how it is in the database but as soon as I want to edit a row with a value that has a double inverted comma in it for eg: 40" Samsung. What it will do when I want ...
0debug
How NAT traversal works in case of peer to peer protocols like bittorrent. : <p>I know about NAT traversal and about STUN, TURN and ICE and its use. I want to know whether these are implemented in peer to peer file sharing application like bittorrent. Whether trackers facilitate peers behind NATs to communicate with ea...
0debug
void kvm_cpu_synchronize_state(CPUState *env) { if (!env->kvm_vcpu_dirty) run_on_cpu(env, do_kvm_cpu_synchronize_state, env); }
1threat
void spapr_tce_free(sPAPRTCETable *tcet) { QLIST_REMOVE(tcet, list); if (!kvm_enabled() || (kvmppc_remove_spapr_tce(tcet->table, tcet->fd, tcet->window_size) != 0)) { g_free(tcet->table); } g_free(tcet); }
1threat
static coroutine_fn int qcow2_co_flush_to_os(BlockDriverState *bs) { BDRVQcow2State *s = bs->opaque; int ret; qemu_co_mutex_lock(&s->lock); ret = qcow2_cache_flush(bs, s->l2_table_cache); if (ret < 0) { qemu_co_mutex_unlock(&s->lock); return ret; } if (qcow2_nee...
1threat
How to pass a string value from a class to another on the same viewcontroller (Swift) : I have created a viewcontroller which consists of two classes. These are displayed below: import UIKit class ViewController: UIViewController { var colour:String? override func viewDidLoad() { su...
0debug
static uint16_t md_common_read(PCMCIACardState *card, uint32_t at) { MicroDriveState *s = MICRODRIVE(card); IDEState *ifs; uint16_t ret; at -= s->io_base; switch (s->opt & OPT_MODE) { case OPT_MODE_MMAP: if ((at & ~0x3ff) == 0x400) { at = 0; } bre...
1threat
Javascript shorthand which calls functions : <p>I want a shorthand that runs a function if true and runs a separate function if false. Something like:</p> <pre><code>(condition)? function1:function2; </code></pre>
0debug
static void alpha_cpu_realizefn(DeviceState *dev, Error **errp) { AlphaCPUClass *acc = ALPHA_CPU_GET_CLASS(dev); acc->parent_realize(dev, errp); }
1threat
Text selection is not giving the exact position : I have a text which is like -> **Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type...
0debug
What does =+ mean in c++ : <p>I've been studying operator overloading and i cant understand this, whenever i use <code>s1=+s2</code> answer is <code>s1=1 s2=1</code> and when i use <code>s2=+s1</code> i get <code>s1=2 s2=2</code> please explain</p> <pre><code>#include&lt;iostream&gt; using namespace std; class score {...
0debug
Generic programming via effects : <p>In the Idris <a href="https://github.com/idris-lang/Idris-dev/blob/master/libs/effects/Effects.idr" rel="noreferrer">Effects</a> library effects are represented as</p> <pre><code>||| This type is parameterised by: ||| + The return type of the computation. ||| + The input resource. ...
0debug
static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { BlockDriver *drv = bs->drv; int64_t sector_num = offset >> BDRV_SECTOR_BITS; unsigned...
1threat
What kind of information is stored in a .cpp file extension? : <p>I researched this question on Google and Stak Overflow but couldn't find an answer to it. </p> <p>I am trying to find out what all information is stored in a .cpp file extension. Meaning, is it just code that has been compiled (meaning compiled code)? D...
0debug
Wordpress functions.php has a parse error : <p>Hi I ran into a prob while setting up the functions.php file for Wordpress. My localhost server is showing this error: Parse error: syntax error, unexpected 'if' (T_IF) in /Applications/MAMP/htdocs/wdnomads-wp/wp-content/themes/womendigitalnomads/functions.php on line 3</p...
0debug
How to get an image of each letter from image with text : <p>F.E. we have a scanned text document. For now, I have wrote a program which can get an image of a letter and recognize it. The thing which I don't understand now is how can I get from the whole scanned document the image representation of each text symbol? Is...
0debug
How i can create generator string with ONLY ONE special character? : <p>i want to create generator string with one special character. Just only one. Can u help me ?.</p> <p>I tried searched the generator on the internet but i saw only generatorspecial characters with a lot of special characters i need "ONLY ONE SPECIA...
0debug
static uint16_t nvme_del_cq(NvmeCtrl *n, NvmeCmd *cmd) { NvmeDeleteQ *c = (NvmeDeleteQ *)cmd; NvmeCQueue *cq; uint16_t qid = le16_to_cpu(c->qid); if (!qid || nvme_check_cqid(n, qid)) { return NVME_INVALID_CQID | NVME_DNR; } cq = n->cq[qid]; if (!QTAILQ_EMPTY(&cq->sq_list...
1threat
Is Visual Studio 2017 new .csproj relevant to non .net core projects : <p>I'm a bit confused. I have the new version of Visual Studio 2017. And have converted my class projects (.net full 4.5) to the new .csproj project format. Then I tried to run live tests on those projects, but VS now informs me that live testing is...
0debug
static coroutine_fn int qcow2_co_write_zeroes(BlockDriverState *bs, int64_t sector_num, int nb_sectors, BdrvRequestFlags flags) { int ret; BDRVQcow2State *s = bs->opaque; int head = sector_num % s->cluster_sectors; int tail = (sector_num + nb_sectors) % s->cluster_sectors; trace_qcow2...
1threat
iterating through multiple equations : <p>I have a problem simplified into the following:</p> <p>Xn+1 = Xn + Yn</p> <p>Yn+1= Yn + Zn</p> <p>Zn+1= Zn+ Xn</p> <p>I know the values of X0,Y0,Z0 to be equal to 1. I want to tell python to find the values of X1,Y1,Z1 and then X2,Y2,Z2,...etc. Can anyone help me with that?...
0debug
Wrong answer although the whole program logic seems to be working : <p>This is my solution to the problem <a href="http://codeforces.com/contest/129/problem/A" rel="nofollow noreferrer">Codeforces-D2A-129 Cookies</a>. The program outputs a wrong answer at testcase 11, which is: </p> <p>82 </p> <p>43 44 96 33 23 42 33...
0debug
static MemTxResult nvic_sysreg_read(void *opaque, hwaddr addr, uint64_t *data, unsigned size, MemTxAttrs attrs) { NVICState *s = (NVICState *)opaque; uint32_t offset = addr; unsigned i, startvec, end; uint32_t val; if ...
1threat