problem
stringlengths
26
131k
labels
class label
2 classes
Adding Parameter to Angular router.navigate : <p>First of all, I am not sure if this is the right way, to achieve what I want.. I am trying to add an export binding like the following to a router.navigate()-method:</p> <pre><code>&lt;call [caller]="caller"&gt;&lt;/call&gt; </code></pre> <p>The problem is that I never...
0debug
Playframework: Use Scalatags instead of Twirl : <p>I'd prefer to use the former over the latter, but am not sure how to incorporate Scalatags into the playframework.</p> <p>This is my simple layout:</p> <pre><code>object Test { import scalatags.Text.all._ def build = { html( head( title := "T...
0debug
How to create shortcode in wordpress? : <p>When I run the following i get:</p> <blockquote> <p>Parse error: syntax error, unexpected 'if' (T_IF) in /home3/</p> </blockquote> <pre><code>function list_pages_function( $atts, $content ) { return if(ICL_LANGUAGE_CODE=='en'){ echo "Define topic and titl...
0debug
About ListBox limit item : <p><strong><em>Hello everyone,I am new here, can I ask a question:</em></strong></p> <ul> <li><p>Let's say I have a ListBox (with more than 5k items of all English words ). and a richTextBox.</p></li> <li><p>And a ListBox usually load every items, right? How can I change my ListBox to just l...
0debug
dotnet aspnetcore docker build fails with a 145 error code : <p>I've used <a href="https://stormpath.com/blog/tutorial-deploy-asp-net-core-on-linux-with-docker" rel="noreferrer">this tutorial</a> to create my first docker webapi project.</p> <p>I'm using windows 7 (docker toolbox).</p> <p>This what I've ran:</p> <pr...
0debug
Need help fixing "property value expected" in CSS (Beginner/amateur) : <p>So I'm trying to set up some animated text in my project, but I keep getting an error in vscode saying "property value expected css(css-propertyvalueexpected) [59, 1]" in ".main-title" which I think is leading the code not to work cause it's not ...
0debug
static void sysbus_fdc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->props = sysbus_fdc_properties; set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); }
1threat
No instance of function template "std::fpclassify" matches the argument list : I have some project with code using both Boost and CUDA. I haven't built it in a while (a couple of months), and now - without any changes to the code, but with a change of Boost version to 1.67.0 - I get the following errors: /path/t...
0debug
How to sort array in javascript or typescript by a key but if key is same sort in alphabetical order? : <p>I have this array </p> <pre><code>[ { "Books": [], "_id": "5dea9a11a8e1bf301c462ce4", "FileName": "AAAAA", "Order": 99999 }, { "_id": "5dea9864a8e1bf301c462cdb", "Books": [], ...
0debug
Iteration in Python [Please help] : Why would the code below produce an output of 5? And what does it mean for the condition while n? Shouldn't it produce an infinite loop since n will always be true? n = 10000 count = 0 while n: count = count + 1 n = n / 10 n = int(n) ...
0debug
How to save and restore terminal sessions for a specific IntelliJ project? : <p>Is there a way in IntelliJ IDEA (either built-in on via a plugin) to store the open <strong>terminal sessions</strong> (their <em>name</em>, their <em>current folder</em>, ideally also the <em>history</em> of the commands and the <em>output...
0debug
Getting this error **System.NullReferenceException: 'Object reference not set to an instance of an object.'** : <p>I have a page which updates the details of lender in the database but when I click the update button it is throwing this error.</p> <p>I have put the breakpoints and inspected the code it shows the values...
0debug
with excel showing producs when insterting measurments with multiple results : Hello i'm having problems with getting this to work. What i'm trying to do is when you insert a set of measurements i want excel to show the ( In this case products) which are closest to those measurements. Ill insert a picture of the ex...
0debug
CORS error :Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response : <p>I am trying to send the request from one localhost port to the another. I am using <strong>angularjs on the frontend and node on the backend</strong>.</p> <p>Since it is <strong>CORS</strong> reques...
0debug
int ff_h263_decode_picture_header(MpegEncContext *s) { int format, width, height, i; uint32_t startcode; align_get_bits(&s->gb); if (show_bits(&s->gb, 2) == 2 && s->avctx->frame_number == 0) { av_log(s->avctx, AV_LOG_WARNING, "Header looks like RTP instead of H.263\n"); } ...
1threat
static float ssim_end4(int sum0[5][4], int sum1[5][4], int width) { float ssim = 0.0; int i; for (i = 0; i < width; i++) ssim += ssim_end1(sum0[i][0] + sum0[i + 1][0] + sum1[i][0] + sum1[i + 1][0], sum0[i][1] + sum0[i + 1][1] + sum1[i][1] + sum1[i + 1][1], ...
1threat
static void ahci_port_write(AHCIState *s, int port, int offset, uint32_t val) { AHCIPortRegs *pr = &s->dev[port].port_regs; DPRINTF(port, "offset: 0x%x val: 0x%x\n", offset, val); switch (offset) { case PORT_LST_ADDR: pr->lst_addr = val; map_page(s->as, &s->dev[port...
1threat
Building a row from a dict in pySpark : <p>I'm trying to dynamically build a row in pySpark 1.6.1, then build it into a dataframe. The general idea is to extend the results of <code>describe</code> to include, for example, skew and kurtosis. Here's what I thought should work:</p> <pre><code>from pyspark.sql import R...
0debug
vuejs v-for add bootstrap row every 5 items : <p>I have an array of items like 'Item 1', 'Item 2' up to 'Item 25'. I want the HTML after rendering look like this:</p> <pre><code>&lt;div class="row"&gt; &lt;div&gt;Item 1&lt;/div&gt; &lt;div&gt;Item 2&lt;/div&gt; &lt;div&gt;Item 3&lt;/div&gt; &lt;div&gt;Item...
0debug
static void flash_sync_page(Flash *s, int page) { int bdrv_sector, nb_sectors; QEMUIOVector iov; if (!s->bdrv || bdrv_is_read_only(s->bdrv)) { return; } bdrv_sector = (page * s->pi->page_size) / BDRV_SECTOR_SIZE; nb_sectors = DIV_ROUND_UP(s->pi->page_size, BDRV_SECTOR_SIZE); ...
1threat
when i type localhost/phpmyadmin in browser instead of login page the page opens with the following errors. Why is this happening? : #1045 - Access denied for user 'root'@'localhost' (using password: NO) mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) Connecti...
0debug
How to handle alert having javascript embedded into a button? : <p>I am automating a sharepoint website using webdriver and java, which contains javascript embedded into the button code. </p> <p>Please find the HTML snippet of the same :</p> <pre><code>&lt;input id="ctl00_ContentPlaceHolder1_btnDelete" class="btn" ty...
0debug
static void core_commit(MemoryListener *listener) { PhysPageMap info = cur_map; cur_map = next_map; phys_sections_clear(&info); }
1threat
Difference in the end of lifetime rules? : <p><a href="https://en.cppreference.com/w/cpp/language/lifetime" rel="noreferrer">https://en.cppreference.com/w/cpp/language/lifetime</a> in <strong>Notes</strong> section has this code, reproduced here:</p> <pre><code>struct A { int* p; ~A() { std::cout &lt;&lt; *p; } //...
0debug
static void RENAME(chrRangeFromJpeg)(int16_t *dst, int width) { int i; for (i = 0; i < width; i++) { dst[i ] = (dst[i ]*1799 + 4081085)>>11; dst[i+VOFW] = (dst[i+VOFW]*1799 + 4081085)>>11; } }
1threat
Go test string contains substring : <p>How do I check if a string is a substring of another string in Go? For example, I want to check <code>someString.contains("something")</code>.</p>
0debug
static int coroutine_fn bdrv_co_do_writev(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov) { BlockDriver *drv = bs->drv; BdrvTrackedRequest req; int ret; if (!bs->drv) { return -ENOMEDIUM; if (bs->read_only) { return -EACCES; if (bdrv_check_reques...
1threat
static av_cold int pcx_init(AVCodecContext *avctx) { PCXContext *s = avctx->priv_data; avcodec_get_frame_defaults(&s->picture); avctx->coded_frame= &s->picture; return 0; }
1threat
How do you connect to Google Cloud Postgresql via Django framework? : <p>This is the default configuration one would have for a local postgresql connection using Django framework in setting.py file:</p> <pre><code>DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME'...
0debug
GuestFileWrite *qmp_guest_file_write(int64_t handle, const char *buf_b64, bool has_count, int64_t count, Error **errp) { GuestFileWrite *write_data = NULL; guchar *buf; gsize buf_len; bool is_ok; DWORD write_count; ...
1threat
static int kvm_get_msrs(CPUState *env) { struct { struct kvm_msrs info; struct kvm_msr_entry entries[100]; } msr_data; struct kvm_msr_entry *msrs = msr_data.entries; int ret, i, n; n = 0; msrs[n++].index = MSR_IA32_SYSENTER_CS; msrs[n++].index = MSR_IA32_SYSENTER_...
1threat
Why immutable state with redux : <p>I'm learning redux and am struggling to understand why state has to be immutable. Could you provide me with an example, in code preferably, where breaking the immutable contract results in an not so obvious side effect.</p>
0debug
static int get_phys_addr_v5(CPUARMState *env, uint32_t address, int access_type, ARMMMUIdx mmu_idx, hwaddr *phys_ptr, int *prot, target_ulong *page_size) { CPUState *cs = CPU(arm_env_get_cpu(env)); int code; uint32_t table; uint32_t desc; ...
1threat
static void realtime_init(void) { if (enable_mlock) { if (os_mlock() < 0) { fprintf(stderr, "qemu: locking memory failed\n"); exit(1); } } }
1threat
How can I shorten a test for a list being null or having no elements? : <p>I have this code:</p> <pre><code>if (App.selectedPhrases == null || App.selectedPhrases.Count == 0) </code></pre> <p>I know that I can use App.selectedPhrases?.Count to return null if needed but how how can I shorten this test? I can't see a w...
0debug
bool gs_allowed(void) { if (kvm_enabled()) { MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); if (object_class_dynamic_cast(OBJECT_CLASS(mc), TYPE_S390_CCW_MACHINE)) { S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc); ...
1threat
Android Alarm notification on particular date and time and app should be active : <p>I need to know step by step process to do notification</p> <p>requirement: user will register for an event and then they will notification before one day at 9 am and before half an hour.</p> <ul> <li>even if app is not active they sh...
0debug
Why Locale.current.regionCode is nil? : <p>I am trying to get user's region code in swift 3 by using:</p> <pre><code>Locale.current.regionCode </code></pre> <p>Unfortunately regionCode is nil, do you have an idea why? And what should I do to obtain it?</p> <p>Thanks a lot.</p>
0debug
What are ES6 arrow functions, how do they work? : <p>I am curious about ES6 arrow functions (fat arrow functions). Are they simply syntactic sugar derived from CoffeeScript, or is there more to them than meets the eye?</p>
0debug
UITextChecker with Swift 3 : <p>I'm trying to make use of Apple's UITextChecker in Xcode 8 to automatically search for spelling errors in a string of words and give suggestions as to replacements. I'm relatively new to referencing Apple API's so any help would be appreciated.</p> <p>Thanks!</p>
0debug
How can I write javascript on Katalon tool? : Sometimes, I've met the element which is unable to click with the normal script by selenium so I have to use javascript to execute my script.
0debug
static int tpm_passthrough_unix_transfer(TPMPassthruState *tpm_pt, const TPMLocality *locty_data) { return tpm_passthrough_unix_tx_bufs(tpm_pt, locty_data->w_buffer.buffer, locty_data->w_off...
1threat
static void test_visitor_out_list_qapi_free(TestOutputVisitorData *data, const void *unused) { UserDefTwoList *p, *head = NULL; const char string[] = "foo bar"; int i, max_count = 1024; for (i = 0; i < max_count; i++) { p = g_malloc0(sizeof(*p...
1threat
Order 'Contain' Model in CakePHP 3.x : <p>I have multiple <code>Things</code> in <code>AnotherThing</code> now I am trying to order them in my edit action in my <code>AnotherThing Controller</code> - I can access the <code>Things</code> just fine in my edit, but I want to sort them differently (not over their ID), for ...
0debug
libsystem_symptoms.dylib missing in Xcode 8 : <p>I just updated to Xcode 8, and I can no longer build xml2-based applications. If I build a simple file and try to build it as follows:</p> <pre><code>c++ myapp.cc `xml2-config --cflags` `xml2-config --libs` </code></pre> <p>...I get the following error message:</p> <...
0debug
static void blk_disconnect(struct XenDevice *xendev) { struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev); if (blkdev->bs) { bdrv_detach_dev(blkdev->bs, blkdev); if (!blkdev->dinfo) { blk_unref(blk_by_name(blkdev->dev)); } blkdev->bs =...
1threat
C++ error: no match for 'operator>>' : <p>I'm somewhat new to C++ and I was trying to write a code to make a basic c++ calculator, but when I try to build it the following error pops up:</p> <p>"error: no match for 'operator>>' (operand types are 'std::basic_ostream::__ostream_type {aka std::basic_ostream}' and 'char'...
0debug
question on Linked List implementation concept and how it is traverse from node to node : I just started to learn the concept of Linked List recently, and having some problem on how is the else statement work in the below code? How it is traverse to next node until it found a null value in Node.next? please see the cod...
0debug
static int http_read_stream(URLContext *h, uint8_t *buf, int size) { HTTPContext *s = h->priv_data; int err, new_location, read_ret; int64_t seek_ret; int reconnect_delay = 0; if (!s->hd) return AVERROR_EOF; if (s->end_chunked_post && !s->end_header) { err = http_rea...
1threat
void HELPER(ucf64_cmps)(float32 a, float32 b, uint32_t c, CPUUniCore32State *env) { int flag; flag = float32_compare_quiet(a, b, &env->ucf64.fp_status); env->CF = 0; switch (c & 0x7) { case 0: break; case 1: if (flag == 2) { env->CF = 1; } ...
1threat
What is a flag in python while loops? : <p><strong><em>I am new to python and I came across this terminology-> flag in python while loops so can anyone explain what that is?</em></strong></p>
0debug
PHPStorm - Huge use of CPU usage : What is up with PHPStorm? Are they quietly BitCoin mining in the background or something along those lines... My CPU usage can range anything between 150% and 500%... and if I am using a laptop, it gets really warm and toasts my nads... which is unpleasant and they need constant re...
0debug
static void filter(SPPContext *p, uint8_t *dst, uint8_t *src, int dst_linesize, int src_linesize, int width, int height, const uint8_t *qp_table, int qp_stride, int is_luma, int sample_bytes) { int x, y, i; const int count = 1 << p->log2_count; const int linesize ...
1threat
No php_mongodb.dll file in this archive? : <p>As it's written on this website: <code>http://www.hongkiat.com/blog/webdev-with-mongodb-part3/</code>, i need to unzip mongo-php-driver archive to get php_mongo.dll, but i can't find it...</p> <p>Any help ?</p> <p>Cheers</p>
0debug
Show all warnings and errors in visual studio code : <p>I'am using Visual Studio Code Version 1.6.0. Is there any possibility to show errors and warnings of all files in the current root folder?</p> <p>At the moment it shows only errors and warnings for open files. </p>
0debug
PHP regexp how to get value from parentheses? : <p>Input:</p> <blockquote> <p>Gujarat (24)</p> </blockquote> <p>Expected Output:</p> <blockquote> <p>24</p> </blockquote> <p>How can I get value from parentheses?</p>
0debug
What's alternative to 'AppBarLayout$ScrollingViewBehavior' in AndroidX? : <p>I've recently migrated my project to AndroidX. Now when I open specific page of the app that has code below, the app Crashes</p> <pre><code>&lt;androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" andr...
0debug
Invoke pytest from python for current module only : <p>I know that py.test can test a single module if I do:</p> <pre><code>py.test mod1.py </code></pre> <p>Or, I can invoke pytest inside python:</p> <pre><code>import pytest pytest.run(['mod1.py']) </code></pre> <p>Can I do it inside python, and let it to run the c...
0debug
static int image_probe(AVProbeData *p) { if (av_str2id(img_tags, p->filename)) { if (av_filename_number_test(p->filename)) return AVPROBE_SCORE_MAX; else return AVPROBE_SCORE_MAX/2; } return 0; }
1threat
Yoga error building React Native from source : <p>I'm trying to build React Native from source to use some changes I made to its Camera Roll functions. I've followed the guide for how to do that, but I'm running into some downright arcane errors when trying to compile the whole thing.</p> <p>Here's the whole pile:</p>...
0debug
START_TEST(qstring_get_str_test) { QString *qstring; const char *ret_str; const char *str = "QEMU/KVM"; qstring = qstring_from_str(str); ret_str = qstring_get_str(qstring); fail_unless(strcmp(ret_str, str) == 0); QDECREF(qstring); }
1threat
How to access string in another class in Java - GUI : Another question for Java... I know it's basic, but I am not pro. So I have Main.java public class Main { public static void main(String[] args) { System.setProperty("webdriver.gecko.driver", "C:/geckodriver.exe"); WebDriver driver =...
0debug
Changing link to pop up link : <p>Hello trying change this link ;</p> <pre><code> &lt;a href="@String.Format("http://www.koltukcubey.com/chat/index.php?project={0}&amp;member={1}", item.Id, item.Member)" class="theme-btn btn-style-one hvr-bounce-to-right"&gt;&lt;span style="float:right;min-width:210px;"&gt;&lt;/span&g...
0debug
static void musicpal_init(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { CPUState *env; qemu_irq *cpu_pic; qemu_irq pic[32]; DeviceState *dev...
1threat
Explanation for issues of type "ResourceCycle": when generate signed Apk : <p>I am getting error after update to appcompat-v7:24.0.0-alpha1 on generating the signed apk.</p> <pre><code>Error:Error: Style Resource definition cycle: TextAppearance.AppCompat.Light.SearchResult.Title =&gt; TextAppearance.AppCompat.Search...
0debug
Which Class should inherit a QMainWindow? : <p>I am new to Qt and this is probably a very stupid question. I am working on a Project with several sub-projects in Visual Studio (C++). The whole project has a single User-interface (UI), and for that, the Qt is used. </p> <p>Among all the sub-projects, only 2 classes are...
0debug
PS MarkSweep is which garbage collector : <p>My jdk version is :</p> <pre><code>java version "1.8.0_102" Java(TM) SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode) </code></pre> <p>this is my test code :</p> <pre><code>List&lt;GarbageCollectorMXBean&gt; b...
0debug
Dart: create a list from 0 to N : <p>How can I create easily a range of consecutive integers in dart? For example:</p> <pre><code>// throws a syntax error :) var list = [1..10]; </code></pre>
0debug
static inline abi_long target_to_host_sockaddr(int fd, struct sockaddr *addr, abi_ulong target_addr, socklen_t len) { const socklen_t unix_maxlen = sizeof (struct sockaddr_un); sa_family_t sa_family; struct t...
1threat
static void openpic_irq_raise(OpenPICState *opp, int n_CPU, IRQ_src_t *src) { int n_ci = IDR_CI0_SHIFT - n_CPU; if ((opp->flags & OPENPIC_FLAG_IDE_CRIT) && (src->ide & (1 << n_ci))) { qemu_irq_raise(opp->dst[n_CPU].irqs[OPENPIC_OUTPUT_CINT]); } else { qemu_irq_raise(opp->dst[n_CPU].i...
1threat
static int mb_var_thread(AVCodecContext *c, void *arg){ MpegEncContext *s= *(void**)arg; int mb_x, mb_y; for(mb_y=s->start_mb_y; mb_y < s->end_mb_y; mb_y++) { for(mb_x=0; mb_x < s->mb_width; mb_x++) { int xx = mb_x * 16; int yy = mb_y * 16; uint8_t *pix =...
1threat
static char *SocketAddress_to_str(const char *prefix, SocketAddressLegacy *addr, bool is_listen, bool is_telnet) { switch (addr->type) { case SOCKET_ADDRESS_LEGACY_KIND_INET: return g_strdup_printf("%s%s:%s:%s%s", prefix, is_telnet ?...
1threat
Why doesn't the read function work in sha1 c++ implementation? : <p>I found this c++ implementation of SHA1 on this page <a href="http://www.zedwood.com/article/cpp-sha1-function" rel="nofollow noreferrer">zedwood.com</a>. Why doesn't the this function work. It says that max has to be a constant. How to get around this...
0debug
static int matroska_ebmlnum_uint(MatroskaDemuxContext *matroska, uint8_t *data, uint32_t size, uint64_t *num) { ByteIOContext pb; init_put_byte(&pb, data, size, 0, NULL, NULL, NULL, NULL); return ebml_read_num(matroska, &pb, 8, num); }
1threat
PHP split string : <p>Hey how can I split string into 2 string, exemple:</p> <pre><code>$ipadd = "192.168.1.60"; </code></pre> <p>From here I want to print 2 result, one is: 192.168.1 secend is:60</p> <p>Always split by the last point and print 2 string.</p>
0debug
int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) { int pqindex, lowquant; int status; int mbmodetab, imvtab, icbptab, twomvbptab, fourmvbptab; int scale, shift, i; v->numref=0; v->p_frame_skipped = 0; if (v->second_field) { if(v->fcm!=2 || v->field_mod...
1threat
Join two tables and update based upon equal and like condition : There are two tables. **table 1** A B C ================= 1 AAA AA;BB 2 BBB CC;DD 3 CCC FF;G 4 DDD E **table 2** (this table is expanded based upon columns C in above table which has ";" seperate...
0debug
Sequelize - case-insensitive like : <p>How can I achieve this in Sequelize?</p> <pre><code>SELECT * FROM table where lower(column) LIKE ('abcd%'); </code></pre> <p>I can't find a way to mix <em>lower</em> function with <em>$like</em></p>
0debug
BlockDriverState *bdrv_find_node(const char *node_name) { BlockDriverState *bs; assert(node_name); QTAILQ_FOREACH(bs, &graph_bdrv_states, node_list) { if (!strcmp(node_name, bs->node_name)) { return bs; } } return NULL; }
1threat
Why am i getting this error in c: lab_6.c:(.text+0x53): undefined reference to `polyndrom' , `uppercase' and `lowercase' : include stdio.h include stdlib.h include string.h int polyndrom(char str[]); int uppercase(char ch); int lowercase(char ch); int isNumber(char str[]); int isReal(char str[]); ...
0debug
How to make a bottom slide in Canvas showing content with CSS, jquery and Javascript? : <p>i have this idea, having something like a slide in menu or html or even a canvas where the user can see a dynamic filled data table.</p> <p>The target is to get the "site" (<strong>bottom sheet</strong>) slide in from the bottom...
0debug
static int get_last_needed_nal(H264Context *h) { int nals_needed = 0; int i; for (i = 0; i < h->pkt.nb_nals; i++) { H2645NAL *nal = &h->pkt.nals[i]; GetBitContext gb; switch (nal->type) { case H264_NAL_SPS: case H264_NAL_PPS: ...
1threat
static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index) { AVPacket out_pkt = { 0 }, flush_pkt = { 0 }; AVStream *st = s->streams[stream_index]; uint8_t *data = pkt ? pkt->data : NULL; int size = pkt ? pkt->size : 0; int ret = 0, got_output = 0; if (!pkt) { ...
1threat
How do I sort this list in Python 3? : <p>I'm in the middle of making a leaderboard, currently I am taking data from a txt file and dumping it into a list.</p> <p>The list's format looks something like this:</p> <p><code>[['56', 'UsernameA'], ['73', 'UsernameB'], ['52', 'UsernameC'], ['10', 'UsernameD']]</code></p> ...
0debug
two tiny python questions : <pre><code>fn = raw_input("Enter file to open: ") fileObject = open(fn,'r+') dictionary = {} for line in fileObject: x = line.split(":") a = x[0] b = x[1] c = len(b)-1 b = b[0:c] dictionary[a] = b print dictionary </code></pre> <p>After I tested my program, I found out e...
0debug
Regex remove all text to the left of certain last character : Im trying to remove all the text which falls before the last character in a regex pattern. Example: ``` rom.com/run/login.php ``` Becomes: ``` login.php ``` How would I go about doing this in javascript? I'm new to regular expressions.
0debug
Get value of parent object base on value from another object : <p>From a json, Can I get the value base on a value of key from another object? How will I do that? using array filter or for loop?</p> <p>I have tried using array filter but it only returns the whole json object</p> <p>Here is my sample JSON:</p> <pre><...
0debug
How does Python determine if two strings are identical : <p>I've tried to understand when Python strings are identical (aka sharing the same memory location). However during my tests, there seems to be no obvious explanation when two string variables that are equal share the same memory:</p> <pre><code>import sys prin...
0debug
int net_init_bridge(const NetClientOptions *opts, const char *name, NetClientState *peer, Error **errp) { const NetdevBridgeOptions *bridge; const char *helper, *br; TAPState *s; int fd, vnet_hdr; assert(opts->kind == NET_CLIENT_OPTIONS_KIND_BRIDGE); bridge = ...
1threat
no experience, learning on my own : I have three worksheets in excel which I am using. First page is where I put all the data so it can populate in sheet 2 and sheet 3. Sheet 2 and 3 is what I am going to save as pdf. My question, is there a vba code that will name sheet 2 with the value in cell A1 with the letter "F" ...
0debug
static av_cold int fieldmatch_init(AVFilterContext *ctx) { const FieldMatchContext *fm = ctx->priv; AVFilterPad pad = { .name = av_strdup("main"), .type = AVMEDIA_TYPE_VIDEO, .filter_frame = filter_frame, .config_props = config_input, }; if (!pa...
1threat
SQL Server - Select : <p>Please, how do I SELECT, to get the result column?</p> <p><a href="https://i.stack.imgur.com/N3wCZ.jpg" rel="nofollow noreferrer">columns</a></p>
0debug
static int http_parse_request(HTTPContext *c) { char *p; int post; char cmd[32]; char info[1024], *filename; char url[1024], *q; char protocol[32]; char msg[1024]; const char *mime_type; FFStream *stream; p = c->buffer; q = cmd; while (!isspace(*p) && *p !=...
1threat
Reading CSV file and splitting it in an array(Java-IntelliJ) : https://hastebin.com/etumuyiduf.java I'm trying to split the excel file(the URL) to a 3 element array and then find the names written in public class CSV to print they corresponding phone numbers of those names. Don't know exactly how to do that. Any...
0debug
String objects and storage : <p>How many objects will be created in the following code and where they will be stored?</p> <pre><code>String s = "abc"; // line 1 String s1 = new String("abc"); // line 2 String str1 = new String("efg"); //line 3 </code></pre>
0debug
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags) { AVDictionary *m = *pm; AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags); char *oldval = NULL, *copy_key = NULL, *copy_value = NULL; if (flags & AV_DICT_DONT_STRDUP_KEY) copy_key ...
1threat
Derby built in functions : <p>How do I calculate equivalent POWER(base, exponent) function in Apache Derby using SELECT statement? </p>
0debug
I have an ArrayIndexOutOfBoundsExeption error can someone help me fix it please : <p>This error keeps occurring Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 131071</p> <p>I'm trying to create an array of 131071 integers with no duplicates.</p> <pre><code>public class array { public static ...
0debug
Error obtaining UI hierarchy Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist : <p>I am testing my app with adb, but i get this error when i execute "dump view hierarchy for uiautomator":</p> <blockquote> <p>Error obtaining UI hierarchy Error while obtaining ...
0debug
int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, void *log_ctx) { char *tail, color_string2[128]; const ColorEntry *entry; int len, hex_offset = 0; if (color_string[0] == '#') { hex_offset = 1; } else if (!strncmp(color_string, "0x", 2)...
1threat