problem
stringlengths
26
131k
labels
class label
2 classes
static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st) { AVIOContext *pb = s->pb; int ret; *st = av_new_stream(s, 0); if (!*st) return AVERROR(ENOMEM); ff_get_wav_header(pb, (*st)->codec, size); if (ret < 0) return ret; (*st)->need_parsing = AVSTREAM_PARSE_FULL; av_set_pts_info(*st, 64, 1, (*st)->codec->sample_rate); return 0; }
1threat
how to access key values in a json files dictionaries with python : i have a script that pulls json data from an api, and i want it to then after pulling said data, decode and pick which tags to store into a db. right now i just need to get the script to return specific called upon values. this is what the script looks like, before me trying to decode it. import requests def call(): payload = {'apikey':'945e8e8499474b7e8d2bc17d87191bce', 'zip' : '47120'} bas_url = 'http://congress.api.sunlightfoundation.com/legislators/locate' r = requests.get(bas_url, params = payload) grab = r.json() return grab 'results': [{'twitter_id': 'RepToddYoung', 'ocd_id': 'ocd-division/country:us/state:in/cd:9', 'oc_email': 'Rep.Toddyoung@opencongress.org', 'middle_name': 'C.', 'votesmart_id': 120345, 'first_name': 'Todd', 'youtube_id': 'RepToddYoung', 'last_name': 'Young', 'bioguide_id': 'Y000064', 'district': 9, 'nickname': None, 'office': '1007 Longworth House Office Building', 'term_start': '2015-01-06', 'thomas_id': '02019', 'party': 'R', 'in_office': True, 'title': 'Rep', 'govtrack_id': '412428', 'crp_id': 'N00030670', 'term_end': '2017-01-03', 'chamber': 'house', 'state_name': 'Indiana', 'fax': '202-226-6866', 'phone': '202-225-5315', 'gender': 'M', 'fec_ids': ['H0IN09070'], 'state': 'IN', 'website': 'http://toddyoung.house.gov', 'name_suffix': None, 'icpsr_id': 21133, 'facebook_id': '186203844738421', 'contact_form': 'https://toddyoungforms.house.gov/give-me-your-opinion', 'birthday': '1972-08-24'}, {'twitter_id': 'SenDonnelly', 'ocd_id': 'ocd-division/country:us/state:in', 'oc_email': 'Sen.Donnelly@opencongress.org', 'middle_name': None, 'lis_id': 'S356', 'first_name': 'Joe', 'youtube_id': 'sendonnelly', 'last_name': 'Donnelly', 'bioguide_id': 'D000607', 'district': None, 'nickname': None, 'office': '720 Hart Senate Office Building', 'state_rank': 'junior', 'thomas_id': '01850', 'term_start': '2013-01-03', 'party': 'D', 'in_office': True, 'title': 'Sen', 'govtrack_id': '412205', 'crp_id': 'N00026586', 'term_end': '2019-01-03', 'chamber': 'senate', 'state_name': 'Indiana', 'fax': '202-225-6798', 'phone': '202-224-4814', 'gender': 'M', 'senate_class': 1, 'fec_ids': ['H4IN02101', 'S2IN00091'], 'state': 'IN', 'votesmart_id': 34212, 'website': 'http://www.donnelly.senate.gov', 'name_suffix': None, 'icpsr_id': 20717, 'facebook_id': '168059529893610', 'contact_form': 'http://www.donnelly.senate.gov/contact/email-joe', 'birthday': '1955-09-28'}, {'twitter_id': 'SenDanCoats', 'ocd_id': 'ocd-division/country:us/state:in', 'oc_email': 'Sen.Coats@opencongress.org', 'middle_name': 'Ray', 'lis_id': 'S212', 'first_name': 'Daniel', 'youtube_id': 'SenatorCoats', 'last_name': 'Coats', 'bioguide_id': 'C000542', 'district': None, 'nickname': None, 'office': '493 Russell Senate Office Building', 'state_rank': 'senior', 'thomas_id': '00209', 'term_start': '2011-01-05', 'party': 'R', 'in_office': True, 'title': 'Sen', 'govtrack_id': '402675', 'crp_id': 'N00003845', 'term_end': '2017-01-03', 'chamber': 'senate', 'state_name': 'Indiana', 'fax': '202-228-1820', 'phone': '202-224-5623', 'gender': 'M', 'senate_class': 3, 'fec_ids': ['S0IN00053'], 'state': 'IN', 'votesmart_id': 53291, 'website': 'http://www.coats.senate.gov', 'name_suffix': None, 'icpsr_id': 14806, 'facebook_id': '180671148633644', 'contact_form': 'http://www.coats.senate.gov/contact/', 'birthday': '1943-05-16'}]} thats the json data returned, i want to specifically call upon IE {'twitter_id': 'RepToddYoung', or 'first_name': 'Todd' instead of my script returning the entire json file that it retrieves
0debug
static Suite *qint_suite(void) { Suite *s; TCase *qint_public_tcase; s = suite_create("QInt test-suite"); qint_public_tcase = tcase_create("Public Interface"); suite_add_tcase(s, qint_public_tcase); tcase_add_test(qint_public_tcase, qint_from_int_test); tcase_add_test(qint_public_tcase, qint_destroy_test); tcase_add_test(qint_public_tcase, qint_from_int64_test); tcase_add_test(qint_public_tcase, qint_get_int_test); tcase_add_test(qint_public_tcase, qobject_to_qint_test); return s; }
1threat
static void ioreq_release(struct ioreq *ioreq, bool finish) { struct XenBlkDev *blkdev = ioreq->blkdev; QLIST_REMOVE(ioreq, list); memset(ioreq, 0, sizeof(*ioreq)); ioreq->blkdev = blkdev; QLIST_INSERT_HEAD(&blkdev->freelist, ioreq, list); if (finish) { blkdev->requests_finished--; } else { blkdev->requests_inflight--; } }
1threat
jquery datepicker default value in html input filed : Jqeury datepicker default (today) in input field [enter image description here][1] [1]: http://i.stack.imgur.com/3hGnE.png
0debug
static av_cold int qdm2_decode_init(AVCodecContext *avctx) { QDM2Context *s = avctx->priv_data; uint8_t *extradata; int extradata_size; int tmp_val, tmp, size; if (!avctx->extradata || (avctx->extradata_size < 48)) { av_log(avctx, AV_LOG_ERROR, "extradata missing or truncated\n"); return -1; } extradata = avctx->extradata; extradata_size = avctx->extradata_size; while (extradata_size > 7) { if (!memcmp(extradata, "frmaQDM", 7)) break; extradata++; extradata_size--; } if (extradata_size < 12) { av_log(avctx, AV_LOG_ERROR, "not enough extradata (%i)\n", extradata_size); return -1; } if (memcmp(extradata, "frmaQDM", 7)) { av_log(avctx, AV_LOG_ERROR, "invalid headers, QDM? not found\n"); return -1; } if (extradata[7] == 'C') { av_log(avctx, AV_LOG_ERROR, "stream is QDMC version 1, which is not supported\n"); return -1; } extradata += 8; extradata_size -= 8; size = AV_RB32(extradata); if(size > extradata_size){ av_log(avctx, AV_LOG_ERROR, "extradata size too small, %i < %i\n", extradata_size, size); return -1; } extradata += 4; av_log(avctx, AV_LOG_DEBUG, "size: %d\n", size); if (AV_RB32(extradata) != MKBETAG('Q','D','C','A')) { av_log(avctx, AV_LOG_ERROR, "invalid extradata, expecting QDCA\n"); return -1; } extradata += 8; avctx->channels = s->nb_channels = s->channels = AV_RB32(extradata); extradata += 4; if (s->channels > MPA_MAX_CHANNELS) avctx->sample_rate = AV_RB32(extradata); extradata += 4; avctx->bit_rate = AV_RB32(extradata); extradata += 4; s->group_size = AV_RB32(extradata); extradata += 4; s->fft_size = AV_RB32(extradata); extradata += 4; s->checksum_size = AV_RB32(extradata); s->fft_order = av_log2(s->fft_size) + 1; s->fft_frame_size = 2 * s->fft_size; s->group_order = av_log2(s->group_size) + 1; s->frame_size = s->group_size / 16; s->sub_sampling = s->fft_order - 7; s->frequency_range = 255 / (1 << (2 - s->sub_sampling)); switch ((s->sub_sampling * 2 + s->channels - 1)) { case 0: tmp = 40; break; case 1: tmp = 48; break; case 2: tmp = 56; break; case 3: tmp = 72; break; case 4: tmp = 80; break; case 5: tmp = 100;break; default: tmp=s->sub_sampling; break; } tmp_val = 0; if ((tmp * 1000) < avctx->bit_rate) tmp_val = 1; if ((tmp * 1440) < avctx->bit_rate) tmp_val = 2; if ((tmp * 1760) < avctx->bit_rate) tmp_val = 3; if ((tmp * 2240) < avctx->bit_rate) tmp_val = 4; s->cm_table_select = tmp_val; if (s->sub_sampling == 0) tmp = 7999; else tmp = ((-(s->sub_sampling -1)) & 8000) + 20000; if (tmp < 8000) s->coeff_per_sb_select = 0; else if (tmp <= 16000) s->coeff_per_sb_select = 1; else s->coeff_per_sb_select = 2; if ((s->fft_order < 7) || (s->fft_order > 9)) { av_log(avctx, AV_LOG_ERROR, "Unknown FFT order (%d), contact the developers!\n", s->fft_order); return -1; } ff_rdft_init(&s->rdft_ctx, s->fft_order, IDFT_C2R); ff_mpadsp_init(&s->mpadsp); qdm2_init(s); avctx->sample_fmt = AV_SAMPLE_FMT_S16; return 0; }
1threat
static uint64_t musicpal_lcd_read(void *opaque, target_phys_addr_t offset, unsigned size) { musicpal_lcd_state *s = opaque; switch (offset) { case MP_LCD_IRQCTRL: return s->irqctrl; default: return 0; } }
1threat
Why won't this JAVA code work as expected? : <p>So, this seems fairly simple bit of code.But when I run this, it gives me strange output. First, I store the number of elements of <code>queries[] Array</code> in <code>NumQ</code> variable.Then, I store the values of elements by looping from 0 to numQ-1.It works in any other case.</p> <pre><code>int numQ=sc.nextInt(); String queries[]=new String[numQ]; for(int i=0;i&lt;numQ;i++){ queries[i]=sc.nextLine(); } System.out.println(queries[0]); System.out.println(queries[1]); System.out.println(queries[2]); </code></pre> <p>In my case, inputs are-(note that it even doesn't ask for the value at index 2.numQ is 3)</p> <p><a href="https://i.stack.imgur.com/fTWX6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fTWX6.png" alt="enter image description here"></a></p> <p>And here is the output.</p> <p><a href="https://i.stack.imgur.com/tRyIl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tRyIl.png" alt="Output of the code"></a></p> <p>See, at <code>queries[0]</code>, it stores blank value(blue selection is blank).At <code>queries[ 1 ]</code>, it stores the first input(which was to be stored at index 0.And it stores the index 1 value at index 2 and so on.)</p> <p>So what's the problem with my code. Thanks in advance:-)</p>
0debug
static void test_acpi_piix4_tcg_memhp(void) { test_data data; memset(&data, 0, sizeof(data)); data.machine = MACHINE_PC; data.variant = ".memhp"; test_acpi_one(" -m 128,slots=3,maxmem=1G -numa node", &data); free_test_data(&data); }
1threat
reactnative : can't get ellipsizeMode to work : <p>I am trying to truncate a text in my reactnative app. I've decided to use the "ellipsizeMode" attribute, but I can't get it to work.</p> <p>I wrote a demo of the problem :</p> <pre><code>'use strict'; import React, { Component } from 'react'; import { StyleSheet, Text, View, } from 'react-native'; export class EllipsizeModeTest extends Component { render() { return ( &lt;View style={styles.container}&gt; &lt;Text style={styles.text}&gt;{'first part | '}&lt;/Text&gt; &lt;Text style={styles.text} numberOfLines={1} ellipsizeMode={'tail'}&gt; {'a text too long to be displayed on the screen'} &lt;/Text&gt; &lt;/View&gt; ); } } const styles = StyleSheet.create({ container: { flexDirection: 'row', }, text: { fontSize: 20, } }); </code></pre> <p>Now the text does not get truncated, any idea why ?</p>
0debug
Before Android 4.1, method android.graphics.PorterDuffColorFilter --- would have incorrectly overridden the package : <p>I am using navigation <code>drawer activity android studio</code> and <code>Firebase Authentication</code>. When i going to run this app than i get this error.</p> <pre><code> W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable </code></pre> <p>I am also using least version SDK and build tool...</p> <pre><code>android { compileSdkVersion 25 buildToolsVersion "25.0.2" } </code></pre>
0debug
what help can i get to understand this sql error message : I have been trying for a while to create a table but keep getting these errors. my table is: create table loginform values('users','pin''8909') 5 errors were found during analysis. 1.An opening bracket was expected. (near "VALUES" at position 24) 2.At least one column definition was expected. (near " " at position 22) 3.Unexpected beginning of statement. (near "'users'" at position 31) 4.Unexpected beginning of statement. (near "'pin'" at position 40) 5.Unexpected beginning of statement. (near "'8909'" at position 47) SQL query: CREATE TABLE loginform VALUES('users', 'pin', '8909') MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES('users', 'pin', '8909')' at line 2 any help would be much appreciated.
0debug
Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper> supportLib=28 : <p>This weird logcat messages started when I switched to supportLibrary 28, not happens on 27.1.1. I tried with an empty default project and the result exactly the same.</p> <p>The problem is easily reproducible,</p> <p>Create a new project with an empty activity and run on an emulator except API28 emulator. It'll give that error on my API21 emulator:</p> <pre><code>Rejecting re-init on previously-failed class java.lang.Class&lt;android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper&gt; </code></pre> <p>My API24 device shows more detailed log:</p> <pre><code>2018-11-15 22:00:55.563 9948-9948/? I/art: Rejecting re-init on previously-failed class java.lang.Class&lt;android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper&gt;: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener; 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.support.v4.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2341) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.support.v7.widget.ActionBarContainer.&lt;init&gt;(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:62) 2018-11-15 22:00:55.563 9948-9948/? I/art: at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2) 2018-11-15 22:00:55.563 9948-9948/? I/art: at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:645) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:787) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:727) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:858) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:821) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:518) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:426) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:377) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:607) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void com.example.myapplication.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:11) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6666) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1118) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2732) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2844) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1572) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:110) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.os.Looper.loop() (Looper.java:203) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6364) 2018-11-15 22:00:55.563 9948-9948/? I/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1063) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:924) 2018-11-15 22:00:55.563 9948-9948/? I/art: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.example.myapplication-2/base.apk", zip file "/data/app/com.example.myapplication-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.myapplication-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.myapplication-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.myapplication-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.myapplication-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.myapplication-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.myapplication-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.myapplication-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.myapplication-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.myapplication-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.myapplication-2/split_lib_slice_9_ 2018-11-15 22:00:55.563 9948-9948/? I/art: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56) 2018-11-15 22:00:55.563 9948-9948/? I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380) 2018-11-15 22:00:55.563 9948-9948/? I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.support.v4.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2341) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.support.v7.widget.ActionBarContainer.&lt;init&gt;(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:62) 2018-11-15 22:00:55.563 9948-9948/? I/art: at java.lang.Object java.lang.reflect.Constructor.newInstance0!(java.lang.Object[]) (Constructor.java:-2) 2018-11-15 22:00:55.563 9948-9948/? I/art: at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:430) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:645) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:787) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:727) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:858) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:821) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:518) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:426) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:377) 2018-11-15 22:00:55.563 9948-9948/? I/art: at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:607) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518) 2018-11-15 22:00:55.563 9948-9948/? I/art: at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void com.example.myapplication.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:11) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:6666) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1118) 2018-11-15 22:00:55.564 9948-9948/? I/art: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2732) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2844) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void android.app.ActivityThread.-wrap12(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1572) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:110) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void android.os.Looper.loop() (Looper.java:203) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6364) 2018-11-15 22:00:55.564 9948-9948/? I/art: at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1063) 2018-11-15 22:00:55.564 9948-9948/? I/art: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:924) </code></pre> <p>I tried API21 emulator, API24 hardware device and API 28 emulator. Only API28 emulator didn't produce that error.</p> <p>I googled, searched SO and also reported to <a href="https://issuetracker.google.com/issues/117685087" rel="noreferrer">android issue tracker</a> I can't find any solution and android team says that is an intended behavior. So I don't know what to do. Should I ignore an error message? Is there anybody have this issue? </p> <p>build.gradle:</p> <pre><code>apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.example.myapplication" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' } </code></pre> <p>MainActivity.java:</p> <pre><code>package com.example.myapplication; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } } </code></pre> <p>activity_main.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"&gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /&gt; &lt;/android.support.constraint.ConstraintLayout&gt; </code></pre>
0debug
StdOut not recognized in Java : <p>I'm new to Java and am trying to implement some example code from a book on algorithms:</p> <pre><code>public class ThreeSum { public static int count(int[] a) { int N = a.length; int cnt = 0; for (int i = 0; i &lt; N; i++) for (int j = i+1; j &lt; N; j++) for (int k = j+1; k &lt; N; k++) if (a[i] + a[j] + a[k] == 0) cnt++; return cnt; } public static void main(String[] args) { int[] a = In.readInts(args[0]); StdOut.println(count(a)); } } </code></pre> <p>In Netbeans 7.2, I entered this code in a New File in a New Project. However, I notice that the lines in the client program with <code>In</code> and <code>StdOut</code> are underlined with red squiggly lines and have warnings leading to suggestions to create the class (see below).</p> <p><a href="https://i.stack.imgur.com/26WAT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/26WAT.png" alt="enter image description here"></a></p> <p>How could I get rid of these warnings? Do I have to import any libraries? Also, how could I run the main program with some example input in the Netbeans environment?</p>
0debug
How to increase the version number from 2.1.0 to 2.1.1 in vb.net : recently I'm working on my work, which is a maintenance system for various application, and I'm stuck at the arithmetic problem. For the application version which is 2.1.0 now, and i want to update the application version to 2.1.1, the datatype of the version is stored as string, How does the algorithm for this change?
0debug
Converting rows from one format to another format using linux tools : <p>let's consider following format of raws: </p> <p><code>| Node[42]{id:42} | Node[208813]{id:208813} | Node[292823]{id:292823} |</code></p> <p>Is is possible to use Linux tools to map it into:<br> <code>42,208813,292823</code> </p> <p>Where, these numbers are numbers gathered from <code>[]</code>.<br> Please note that I search for universal method for more columns, for example:<br> <code>| Node[42]{id:42} | Node[208813]{id:208813} | Node[292823]{id:292823} | Node[1]|</code> into </p> <p><code>42,208813,292823,1</code>.<br> Please note also that <code>{id:292823}</code> is optional (it is not mandatory). </p> <p>Can anyone help?</p>
0debug
my thread doesn't get notified : **the following code does not get notify the thread reader it execute the writer and then terminates.why is it like that? The notifyall should awake all the thread which are at the wait state.** public class Testing { public static void main(String[] args) { Testing testing=new Testing(); testing.reader.start(); testing.writer.start(); } Thread reader = new Thread("reader") { public void run() { System.out.println("reader started"); synchronized (this) { try { wait(); } catch (InterruptedException ex) { ex.printStackTrace(); } } for (int i = 0; i < 10; i++) { System.out.println("reader " + i); } } }; Thread writer = new Thread("reader") { public void run() { System.out.println("writer started"); for (int i = 0; i < 10; i++) { System.out.println("writer " + i); } synchronized (Thread.currentThread()) { notifyAll(); } } }; }
0debug
If abstract base class contains parameterised constructor (and derived does not) why can't it be used? : <p>I have a DDD type solution with "domain model" classes which are constructed using a "DTO" class (i.e. raw data from DB). </p> <p>The domain model classes all inherit from an abstract base class, which is intended to provide generic injecting/retrieving of the DTO data. Here is a sample:</p> <pre><code>public abstract class DomainModelBase&lt;T&gt; where T : IDto, new() { protected T _data; protected DomainModelBase() { _data = new T(); } protected DomainModelBase(T data) { _data = data; } protected void SetData(T data) { _data = data; } public T GetData() { return _data; } } public class AttributeOption : DomainModelBase&lt;AttributeOptionData&gt; { //public AttributeOption(AttributeOptionData data) //{ // SetData(data); //} } </code></pre> <p>I thought (because DomainModelBase contains a parameterised constructor) I would be able to do this:</p> <pre><code> var data = new AttributeOptionData(); var model = new AttributeOption(data); </code></pre> <p>However, the compiler says "Constructor 'AttributeOption' has zero parameters, but is invoked with one argument". The only way to make it work seems to be to create a parameterised constructor in the derived class (like the commented out one above).</p> <p>Is there a way to make this work by modifying the base class, i.e. without the work of setting up parameterised constructors in every derived class?</p>
0debug
Extract number between 2nd space and "," in R : <p>I have a r data frame. One of its column "A" has string. I would like to extract the number between <strong>second</strong> space in string and <strong>","</strong>. </p> <p>The data frame looks like</p> <pre><code> A XY Z 123, 30009 Addr AB CBA 12, 900000 Addr FC AX 1234, 977777 Addr . . </code></pre> <p>And the resultant df should look like </p> <pre><code> A 123 12 1234 . . </code></pre> <p>The numbers that need to be extracted are not fixed in length.</p>
0debug
For loop JS for a calculator : <p>I'm trying to create a calculator which goes through 18 units. I wanted to make my code shorter by using a for loop. I thought something like this would work:</p> <pre><code>var i=0; for (i=0;i&lt;=18;i++) { if (Unit[i] = "P" or Unit[i] == "p") { UnitTotal[i] = 70; SetCookie('UnitAns'[i],UnitAns[i]); } } </code></pre> <p>This doesn't work what am I doing wrong or what do I need to do differently?</p>
0debug
def multiply_num(numbers): total = 1 for x in numbers: total *= x return total/len(numbers)
0debug
Docker-compose volume mount before run : <p>I have a Dockerfile I'm pointing at from a docker-compose.yml.</p> <p>I'd like the volume mount in the docker-compose.yml to happen before the <code>RUN</code> in the Dockerfile. </p> <p>Dockerfile:</p> <pre><code>FROM node WORKDIR /usr/src/app RUN npm install --global gulp-cli \ &amp;&amp; npm install ENTRYPOINT gulp watch </code></pre> <p>docker-compose.yml</p> <pre><code>version: '2' services: build_tools: build: docker/gulp volumes_from: - build_data:rw build_data: image: debian:jessie volumes: - .:/usr/src/app </code></pre> <p>It makes complete sense for it to do the Dockerfile first, then mount from docker-compose, however is there a way to get around it.</p> <p>I want to keep the Dockerfile generic, while passing more specific bits in from compose. Perhaps that's not the best practice?</p>
0debug
how do i turn this into a list conversion? : I am trying to figure out how to convert this into list conversion --- temp = [] for data in current_set.data_set: if(data[0] == day and data[1] == time): #print(str(data[0]) + " , " + str(data[1]) + " , " + str(data[3])) temp.append(data[3])
0debug
JPG to PNG converter code not working. Please help me with my code : I have used the below code to [![enter image description here][1]][1]convert JPG into PNG file: But when i am running this code from the command line terminal using: python a.py "C:\Users\nishant.gupta2\PycharmProjects\jpgtopngconverter\photo" new The system is giving me the error: PermissionError: [Errno 13] Permission denied: 'C:\\Users\\nishant.gupta2\\PycharmProjects\\jpgtopngconverter\\photo' please help My code is below: import sys import os from PIL import Image image_folder=sys.argv[1] output_folder=sys.argv[2] if not os.path.exists(output_folder): os.mkdir(output_folder) for items in os.listdir(image_folder): im= Image.open(f'{image_folder}') im.save(f'{output_folder}.png','png') [1]: https://i.stack.imgur.com/CFpUL.png
0debug
uintptr_t is too small to store addresses : <p>In C, when I cast a pointer to type uintptr_t, it truncates part of the address. Is there anyway to store the entire address as an integer or some other data type that is no larger than 8 bytes?</p>
0debug
how to store the indices into one variable : sub = ['great to have','good to have'] my_string =''' *** Strong skills in these can make up for lack of experience in one or two critical areas Great To Have: - DevExpress Experience (in Angular 2+ or AngularJS) - Strong DBD understanding and experience (set-based artifact design, performance tuning, modeling) ''' s ="" for i in sub: ii = my_string.lower().find(i) my_string[ii:] how to store the indexes into s variable
0debug
static int decode_frame_adu(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MPADecodeContext *s = avctx->priv_data; uint32_t header; int len, ret; len = buf_size; if (buf_size < HEADER_SIZE) { av_log(avctx, AV_LOG_ERROR, "Packet is too small\n"); return AVERROR_INVALIDDATA; } if (len > MPA_MAX_CODED_FRAME_SIZE) len = MPA_MAX_CODED_FRAME_SIZE; header = AV_RB32(buf) | 0xffe00000; if (ff_mpa_check_header(header) < 0) { av_log(avctx, AV_LOG_ERROR, "Invalid frame header\n"); return AVERROR_INVALIDDATA; } avpriv_mpegaudio_decode_header((MPADecodeHeader *)s, header); avctx->sample_rate = s->sample_rate; avctx->channels = s->nb_channels; avctx->channel_layout = s->nb_channels == 1 ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO; if (!avctx->bit_rate) avctx->bit_rate = s->bit_rate; s->frame_size = len; s->frame = data; ret = mp_decode_frame(s, NULL, buf, buf_size); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error while decoding MPEG audio frame.\n"); return ret; } *got_frame_ptr = 1; return buf_size; }
1threat
How to remove part of a string using jquery? : <p>I need to remove part of a string using <strong>jQuery</strong> in this way:</p> <p>I have this string:</p> <pre><code>url(http://example.com/wp-content/uploads/2017/01/11_CAT_CONILLS_-w900-h600-150x150.jpg) </code></pre> <p>Remove all before the last "/" which is (this part can take other value): </p> <pre><code>url(http://example.com/wp-content/uploads/2017/01/ </code></pre> <p>Remove:</p> <pre><code>) </code></pre> <p>To just leave:</p> <pre><code>11_CAT_CONILLS_-w900-h600-150x150.jpg </code></pre>
0debug
Linux configuration -- ssmtp: Cannot open smtp.gmail.com:587 : <p>Hi I have RHEL5 with ssmtp installed on it ssmtp-2.61-22.el5.i386.rpm</p> <p>my /etc/ssmtp/ssmtp.conf updated as below :-</p> <pre><code>AuthUser=mymail@gmail.com AuthPass=mypassword FromLineOverride=YES mailhub=smtp.gmail.com:587 UseSTARTTLS=YES UseTLS=Yes RewriteDomain=gmail.com </code></pre> <p>also revaliases updated as below :</p> <pre><code>root:mymail@gmail.com:smtp.gmail.com:587 </code></pre> <p>i have shutdown sendmail service </p> <p>when i try to send email with ssmtp i get below error </p> <pre><code>[root@ctmtest ssmtp]# echo "test" | ssmtp -vvv mymail@gmail.com [&lt;-] 220 smtp.gmail.com ESMTP v26sm42795996pfi.56 - gsmtp [-&gt;] EHLO ctmtest [&lt;-] 250 SMTPUTF8 [-&gt;] STARTTLS [&lt;-] 220 2.0.0 Ready to start TLS ssmtp: Cannot open smtp.gmail.com:587 </code></pre> <p>i searched lots of tag with this error , but unable to fix this </p> <p>my system is able to connect smtp.gmail.com on port 587</p> <pre><code>[root@ctmtest ssmtp]# telnet smtp.gmail.com 587 Trying 74.125.200.108... Connected to smtp.gmail.com (74.125.200.108). Escape character is '^]'. 220 smtp.gmail.com ESMTP o90sm11695907pfi.17 - gsmtp </code></pre> <p>is there anyone who have fixed this ? please suggest </p>
0debug
static void s390_init(QEMUMachineInitArgs *args) { ram_addr_t my_ram_size = args->ram_size; const char *cpu_model = args->cpu_model; const char *kernel_filename = args->kernel_filename; const char *kernel_cmdline = args->kernel_cmdline; const char *initrd_filename = args->initrd_filename; CPUS390XState *env = NULL; MemoryRegion *sysmem = get_system_memory(); MemoryRegion *ram = g_new(MemoryRegion, 1); ram_addr_t kernel_size = 0; ram_addr_t initrd_offset; ram_addr_t initrd_size = 0; int shift = 0; uint8_t *storage_keys; void *virtio_region; hwaddr virtio_region_len; hwaddr virtio_region_start; int i; while ((my_ram_size >> (20 + shift)) > 65535) { shift++; } my_ram_size = my_ram_size >> (20 + shift) << (20 + shift); ram_size = my_ram_size; s390_bus = s390_virtio_bus_init(&my_ram_size); s390_sclp_init(); memory_region_init_ram(ram, "s390.ram", my_ram_size); vmstate_register_ram_global(ram); memory_region_add_subregion(sysmem, 0, ram); virtio_region_len = my_ram_size - ram_size; virtio_region_start = ram_size; virtio_region = cpu_physical_memory_map(virtio_region_start, &virtio_region_len, true); memset(virtio_region, 0, virtio_region_len); cpu_physical_memory_unmap(virtio_region, virtio_region_len, 1, virtio_region_len); storage_keys = g_malloc0(my_ram_size / TARGET_PAGE_SIZE); if (cpu_model == NULL) { cpu_model = "host"; } ipi_states = g_malloc(sizeof(S390CPU *) * smp_cpus); for (i = 0; i < smp_cpus; i++) { S390CPU *cpu; CPUS390XState *tmp_env; cpu = cpu_s390x_init(cpu_model); tmp_env = &cpu->env; if (!env) { env = tmp_env; } ipi_states[i] = cpu; tmp_env->halted = 1; tmp_env->exception_index = EXCP_HLT; tmp_env->storage_keys = storage_keys; } s390_add_running_cpu(env); if (kernel_filename) { kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, NULL, NULL, 1, ELF_MACHINE, 0); if (kernel_size == -1UL) { kernel_size = load_image_targphys(kernel_filename, 0, ram_size); } if (kernel_size == -1UL) { fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename); exit(1); } env->psw.addr = KERN_IMAGE_START; env->psw.mask = 0x0000000180000000ULL; } else { ram_addr_t bios_size = 0; char *bios_filename; if (bios_name == NULL) { bios_name = ZIPL_FILENAME; } bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); bios_size = load_image_targphys(bios_filename, ZIPL_LOAD_ADDR, 4096); g_free(bios_filename); if ((long)bios_size < 0) { hw_error("could not load bootloader '%s'\n", bios_name); } if (bios_size > 4096) { hw_error("stage1 bootloader is > 4k\n"); } env->psw.addr = ZIPL_START; env->psw.mask = 0x0000000180000000ULL; } if (initrd_filename) { initrd_offset = INITRD_START; while (kernel_size + 0x100000 > initrd_offset) { initrd_offset += 0x100000; } initrd_size = load_image_targphys(initrd_filename, initrd_offset, ram_size - initrd_offset); if (initrd_size == -1UL) { fprintf(stderr, "qemu: could not load initrd '%s'\n", initrd_filename); exit(1); } stq_p(rom_ptr(INITRD_PARM_START), initrd_offset); stq_p(rom_ptr(INITRD_PARM_SIZE), initrd_size); } if (rom_ptr(KERN_PARM_AREA)) { memcpy(rom_ptr(KERN_PARM_AREA), kernel_cmdline, strlen(kernel_cmdline) + 1); } for(i = 0; i < nb_nics; i++) { NICInfo *nd = &nd_table[i]; DeviceState *dev; if (!nd->model) { nd->model = g_strdup("virtio"); } if (strcmp(nd->model, "virtio")) { fprintf(stderr, "S390 only supports VirtIO nics\n"); exit(1); } dev = qdev_create((BusState *)s390_bus, "virtio-net-s390"); qdev_set_nic_properties(dev, nd); qdev_init_nofail(dev); } for(i = 0; i < MAX_BLK_DEVS; i++) { DriveInfo *dinfo; DeviceState *dev; dinfo = drive_get(IF_IDE, 0, i); if (!dinfo) { continue; } dev = qdev_create((BusState *)s390_bus, "virtio-blk-s390"); qdev_prop_set_drive_nofail(dev, "drive", dinfo->bdrv); qdev_init_nofail(dev); } }
1threat
Using one app function attribute into another app function : <p>I need help</p> <p>For example , i have two app in my project ,Blog and Post . </p> <p>In Blog app i have a function with name Promo as </p> <pre><code>def Promo(): global x x= 10 y= 20 c= x + y return c </code></pre> <p>In second app Post , i have Code function and i want use <strong>x</strong> in this function</p> <pre><code>def Code(): d = x + 10 return d </code></pre> <p>But error occurred something like that : <strong>global name 'x' is not defined</strong></p> <p>How can i use x value into Code function that located in Post app in same project ? </p>
0debug
Is it safe to combine 'with' and 'yield' in python? : <p>It's a common idiom in python to use context manager to automatically close files:</p> <pre><code>with open('filename') as my_file: # do something with my_file # my_file gets automatically closed after exiting 'with' block </code></pre> <p>Now I want to read contents of several files. Consumer of the data does not know or care if data comes from files or not-files. It does not want to check if the objects it received can be open or not. It just wants to get something to read lines from. So I create an iterator like this:</p> <pre><code>def select_files(): """Yields carefully selected and ready-to-read-from files""" file_names = [.......] for fname in file_names: with open(fname) as my_open_file: yield my_open_file </code></pre> <p>This iterator may be used like this:</p> <pre><code>for file_obj in select_files(): for line in file_obj: # do something useful </code></pre> <p>(Note, that the same code could be used to consume not the open files, but lists of strings - that's cool!)</p> <p><strong>The question is: is it safe to yield open files?</strong></p> <p>Looks like "why not?". Consumer calls iterator, iterator opens file, yields it to consumer. Consumer processes the file and comes back to iterator for next one. Iterator code resumes, we exit 'with' block, the <code>my_open_file</code> object gets closed, go to next file, etc.</p> <p>But what if consumer never comes back to iterator for the next file? F.e. an exception occurred inside the consumer. Or consumer found something very exciting in one of the files and happily returned the results to whoever called it?</p> <p>Iterator code would never resume in this case, we would never come to the end of 'with' block, and the <code>my_open_file</code> object would never get closed!</p> <p>Or would it?</p>
0debug
What is wrong with my Merge sort code? I am getting wrong output : I am implementing merge sort algorithm. I have debugged the code properly. but not able to identify what is the problem with my code. Here is my code : #include<iostream> using namespace std; void merge(int* l,int nL,int* r,int nR,int * a){ //merging the arrays int i=0,j=0,k=0; while(i<nL && j<nR){ if(l[i]<=r[j]){ i++; a[k]=l[i]; } else{ j++; a[k]=r[j]; } k++; } //now elements that are left out while(i<nL){ a[k]=l[i]; k++; i++; } while(j<nR){ a[k]=r[j]; j++; k++; } } This is my **mergeSort** function to implement the merge sort algorithm. void mergeSort(int* a,int n){ //base case if(n<2) return; //rec case int mid=n/2; //take 2 arrays of size mid & (n-mid) int nL=mid; int nR=n-mid; int l[nL]; int r[nR]; //fill the arrays for(int i=0;i<mid;i++){ l[i]=a[i]; } for(int i=mid;i<n;i++){ r[i-mid]=a[i]; } //call merge sort recursively mergeSort(l,nL); mergeSort(r,nR); merge(l,nL,r,nR,a); } Here is the main function where I am taking an array as input and passing to the function **mergeSort** int main(){ int a[100]; cout<<"Enter no of elements"<<endl; int n; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } mergeSort(a,n); cout<<"After sorting with merge sort"<<endl; for(int i=0;i<n;i++){ cout<<a[i]<<" "; } return 0; } Function **merge()** is merging two arrays and **mergeSort** is the function to divide the array and implement the merge sort. I am giving this as input : 8 2 4 1 6 8 5 3 7 Output : 6 1006565088 2096014825 6 2098806136 2096014825 93 8
0debug
RegEX help (working but need an exclusion) : I am need of some regex help. I have a list like so: /hours_3203 /hours_3204 /hours_3205 /hours_3206 /hours_3207 /hours_3208 /hours_3309 /hours_3310 /hours_3211 I am using this regex to find all entries that start with 32 or 33 /hours_3[23]/ and this is working... however I was thrown a curve ball when I was told.. I need to EXCLUDE 'hours_3211' from matching in this list.. How can I adjust my regex to match on all 'hours_3[23]' but NOT match on /hours_3211? Alternately.... when I have a list like this: /hours_3412 /hours_3413 /hours_3414 /hours_3415 /hours_3516 /hours_3517 /hours_3518 /hours_3519 I have been using a regex of: /hours_3[45]/ to find all 'hours_34x & /hours_35x how I can adjust this: /hours_3[45]/ to find the above but ALSO find/match on /hours_3211?? thanks!
0debug
How can I get all keys from a JSON column in Postgres? : <p>If I have a table with a column named <code>json_stuff</code>, and I have two rows with</p> <p><code>{ "things": "stuff" }</code> and <code>{ "more_things": "more_stuff" }</code></p> <p>in their <code>json_stuff</code> column, what query can I make across the table to receive <code>[ things, more_things ]</code> as a result?</p>
0debug
In Julia, how to merge a dictionary? : <p>What is the best way to merge a dictionary in Julia?</p> <pre><code>&gt; dict1 = Dict("a" =&gt; 1, "b" =&gt; 2, "c" =&gt; 3) &gt; dict2 = Dict("d" =&gt; 4, "e" =&gt; 5, "f" =&gt; 6) # merge both dicts &gt; dict3 = dict1 with dict2 &gt; dict3 Dict{ASCIIString,Int64} with 6 entries: "f" =&gt; 6 "c" =&gt; 3 "e" =&gt; 5 "b" =&gt; 2 "a" =&gt; 1 "d" =&gt; 4 </code></pre>
0debug
Printing out all the numbers in a list if the sum of those numbers exceed 100. : <p>List of numbers nums and prints all the numbers from nums in order until the sum of the numbers printed exceeds 100. I need to rewrite the function using a while loop and <strong>I cannot use for, break or return.</strong><br> if the sum of the numbers is less than or equal to 100 then all numbers in the list are printed. Below includes my attempt of the question (which is wrong...), and the outputs I would like to achieve. I would like to know your ideas on how you would try to solve the problem or your advice on the logic of my code. Many thanks in advance :D </p> <pre><code>def print_hundred(nums): """ Hundy club """ total = 0 index = 0 while index &lt; nums[len(nums)]: print(nums) total += nums[index] else: if total &gt; 100: print(total) print_hundred([1, 2, 3]) print_hundred([100, -3, 4, 7]) print_hundred([101, -3, 4, 7]) test1 (Because the sum of those numbers are still less than 100) 1 2 3 test2 (100 - 3 + 4 = 101, so the printing stops when it exceeds 100) 100 -3 4 test3 (Already exceeds 100) 101 </code></pre>
0debug
static void qxl_destroy_primary(PCIQXLDevice *d) { if (d->mode == QXL_MODE_UNDEFINED) { return; } dprint(d, 1, "%s\n", __FUNCTION__); d->mode = QXL_MODE_UNDEFINED; d->ssd.worker->destroy_primary_surface(d->ssd.worker, 0); }
1threat
Is there a way to query for a certain amount of documents from a database with graphql? : <p>Essentially what I want to do is to be able to query, lets say, fruits(0:30). This would give me the 29 documents in the collection regarding fruits. I understand how to query documents and such in graphql, but I do not understand how I would resolve this issue. I see many examples using TypeScript or the files are .graphql and I have no idea what is going on. Is there any possible solution in only node/javascript?</p>
0debug
Android How to get values from deep link in android using java? : <p>Android How to get values from deep link in android using java? I am implementing deep link in my android app and now i want to get all parameter like after slash both. my url = <strong>www.exmple.com/poduct-name/prodcut_id</strong></p> <p><strong>www.exmple.com/iphone/147895</strong></p> <p>so i want to get id-147895 from above url?</p>
0debug
Starting an nREPL with Clojure CLI Tools : <p>How do I start an nREPL from the <code>clj</code> command?</p> <p>I can't run my project using Lein or Boot because I have an unbalanced paren somewhere, and the reader complains `java.lang.RuntimeException: read-cond starting on line 13 requires an even number of forms.</p>
0debug
static int event_thread(void *arg) { AVFormatContext *s = arg; SDLContext *sdl = s->priv_data; int flags = SDL_BASE_FLAGS | (sdl->window_fullscreen ? SDL_FULLSCREEN : 0); AVStream *st = s->streams[0]; AVCodecContext *encctx = st->codec; if (SDL_Init(SDL_INIT_VIDEO) != 0) { av_log(s, AV_LOG_ERROR, "Unable to initialize SDL: %s\n", SDL_GetError()); sdl->init_ret = AVERROR(EINVAL); goto init_end; } SDL_WM_SetCaption(sdl->window_title, sdl->icon_title); sdl->surface = SDL_SetVideoMode(sdl->window_width, sdl->window_height, 24, flags); if (!sdl->surface) { av_log(sdl, AV_LOG_ERROR, "Unable to set video mode: %s\n", SDL_GetError()); sdl->init_ret = AVERROR(EINVAL); goto init_end; } sdl->overlay = SDL_CreateYUVOverlay(encctx->width, encctx->height, sdl->overlay_fmt, sdl->surface); if (!sdl->overlay || sdl->overlay->pitches[0] < encctx->width) { av_log(s, AV_LOG_ERROR, "SDL does not support an overlay with size of %dx%d pixels\n", encctx->width, encctx->height); sdl->init_ret = AVERROR(EINVAL); goto init_end; } sdl->init_ret = 0; av_log(s, AV_LOG_VERBOSE, "w:%d h:%d fmt:%s -> w:%d h:%d\n", encctx->width, encctx->height, av_get_pix_fmt_name(encctx->pix_fmt), sdl->overlay_rect.w, sdl->overlay_rect.h); init_end: SDL_LockMutex(sdl->mutex); sdl->inited = 1; SDL_UnlockMutex(sdl->mutex); SDL_CondSignal(sdl->init_cond); if (sdl->init_ret < 0) return sdl->init_ret; while (!sdl->quit) { int ret; SDL_Event event; SDL_PumpEvents(); ret = SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_ALLEVENTS); if (ret < 0) av_log(s, AV_LOG_ERROR, "Error when getting SDL event: %s\n", SDL_GetError()); if (ret <= 0) continue; switch (event.type) { case SDL_KEYDOWN: switch (event.key.keysym.sym) { case SDLK_ESCAPE: case SDLK_q: sdl->quit = 1; break; } break; case SDL_QUIT: sdl->quit = 1; break; case SDL_VIDEORESIZE: sdl->window_width = event.resize.w; sdl->window_height = event.resize.h; SDL_LockMutex(sdl->mutex); sdl->surface = SDL_SetVideoMode(sdl->window_width, sdl->window_height, 24, SDL_BASE_FLAGS); if (!sdl->surface) { av_log(s, AV_LOG_ERROR, "Failed to set SDL video mode: %s\n", SDL_GetError()); sdl->quit = 1; } else { compute_overlay_rect(s); } SDL_UnlockMutex(sdl->mutex); break; default: break; } } return 0; }
1threat
App on Google Play always shows "Update" instead of open : <p>I have an app on Google Play that, after an update, always shows the update button. Even if it's already updated and the latest version is shown in app settings, Google Play keeps asking me to update it. What can the problem be? This only happens with this single application. I tried to delete all caches and data (both for play store and the app), but with no results.</p>
0debug
removing a directory before cordova build : in my hybrid project i have a node modules directory which does not need to participate in the apk construction. by reading the [cordova documentation about hooks][1] i ended up with the following script: #!/usr/bin/env node // before_build_android.js console.log("*** running before build ***"); const spawn = require('child_process').execSync; console.log(spawn("pwd").toString("utf-8")); console.log(spawn("rm -rf ./platforms/android/assets/www/node_modules").toString("utf-8")); console.log("*** done ***"); and in my config.xml i have it referenced: <!-- ... --> <platform name="android"> <hook type="before_build" src="hooks/before_build_android.js"/> <allow-intent href="market:*" /> </platform> <!-- ... --> however it does not work. any guidance about how to remove this in order to avoid it to be added to the .apk file? node_modules is too big and all i need is the build.js generated by browserify. [1]: http://cordova.apache.org/docs/en/dev/guide/appdev/hooks/index.html#Hooks%20Guide
0debug
static int wav_read_header(AVFormatContext *s, AVFormatParameters *ap) { int64_t size, av_uninit(data_size); int64_t sample_count=0; int rf64; unsigned int tag; AVIOContext *pb = s->pb; AVStream *st; WAVContext *wav = s->priv_data; int ret, got_fmt = 0; int64_t next_tag_ofs, data_ofs = -1; tag = avio_rl32(pb); rf64 = tag == MKTAG('R', 'F', '6', '4'); if (!rf64 && tag != MKTAG('R', 'I', 'F', 'F')) return -1; avio_rl32(pb); tag = avio_rl32(pb); if (tag != MKTAG('W', 'A', 'V', 'E')) return -1; if (rf64) { if (avio_rl32(pb) != MKTAG('d', 's', '6', '4')) return -1; size = avio_rl32(pb); if (size < 16) return -1; avio_rl64(pb); data_size = avio_rl64(pb); sample_count = avio_rl64(pb); if (data_size < 0 || sample_count < 0) { av_log(s, AV_LOG_ERROR, "negative data_size and/or sample_count in " "ds64: data_size = %"PRId64", sample_count = %"PRId64"\n", data_size, sample_count); return AVERROR_INVALIDDATA; } avio_skip(pb, size - 24); } for (;;) { size = next_tag(pb, &tag); next_tag_ofs = avio_tell(pb) + size; if (url_feof(pb)) break; switch (tag) { case MKTAG('f', 'm', 't', ' '): if (!got_fmt && (ret = wav_parse_fmt_tag(s, size, &st) < 0)) { return ret; } else if (got_fmt) av_log(s, AV_LOG_WARNING, "found more than one 'fmt ' tag\n"); got_fmt = 1; break; case MKTAG('d', 'a', 't', 'a'): if (!got_fmt) { av_log(s, AV_LOG_ERROR, "found no 'fmt ' tag before the 'data' tag\n"); return AVERROR_INVALIDDATA; } if (rf64) { next_tag_ofs = wav->data_end = avio_tell(pb) + data_size; } else { data_size = size; next_tag_ofs = wav->data_end = size ? next_tag_ofs : INT64_MAX; } data_ofs = avio_tell(pb); if (!pb->seekable || (!rf64 && !size)) goto break_loop; break; case MKTAG('f','a','c','t'): if(!sample_count) sample_count = avio_rl32(pb); break; case MKTAG('b','e','x','t'): if ((ret = wav_parse_bext_tag(s, size)) < 0) return ret; break; } if ((avio_size(pb) > 0 && next_tag_ofs >= avio_size(pb)) || avio_seek(pb, next_tag_ofs, SEEK_SET) < 0) { break; } } break_loop: if (data_ofs < 0) { av_log(s, AV_LOG_ERROR, "no 'data' tag found\n"); return AVERROR_INVALIDDATA; } avio_seek(pb, data_ofs, SEEK_SET); if (!sample_count && st->codec->channels && av_get_bits_per_sample(st->codec->codec_id)) sample_count = (data_size<<3) / (st->codec->channels * (uint64_t)av_get_bits_per_sample(st->codec->codec_id)); if (sample_count) st->duration = sample_count; ff_metadata_conv_ctx(s, NULL, wav_metadata_conv); return 0; }
1threat
Custom init for UIViewController in Swift with interface setup in storyboard : <p>I'm having issue for writing custom init for subclass of UIViewController, basically I want to pass the dependency through the init method for viewController rather than setting property directly like <code>viewControllerB.property = value</code></p> <p>So I made a custom init for my viewController and call super designated init</p> <pre><code>init(meme: Meme?) { self.meme = meme super.init(nibName: nil, bundle: nil) } </code></pre> <p>The view controller interface resides in storyboard, I've also make the interface for custom class to be my view controller. And Swift requires to call this init method even if you are not doing anything within this method. Otherwise the compiler will complain...</p> <pre><code>required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } </code></pre> <p>The problem is when I try to call my custom init with <code>MyViewController(meme: meme)</code> it doesn't init properties in my viewController at all...</p> <p>I was trying to debug, I found in my viewController, <code>init(coder aDecoder: NSCoder)</code> get called first, then my custom init get called later. However these two init method return different <code>self</code> memory addresses.</p> <p>I'm suspecting something wrong with the init for my viewController, and it will always return <code>self</code> with the <code>init?(coder aDecoder: NSCoder)</code>, which, has no implementation.</p> <p>Does anyone know how to make custom init for your viewController correctly ? Note: my viewController's interface is set up in storyboard</p> <p>here is my viewController code:</p> <pre><code>class MemeDetailVC : UIViewController { var meme : Meme! @IBOutlet weak var editedImage: UIImageView! // TODO: incorrect init init(meme: Meme?) { self.meme = meme super.init(nibName: nil, bundle: nil) } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } override func viewDidLoad() { /// setup nav title title = "Detail Meme" super.viewDidLoad() } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) editedImage = UIImageView(image: meme.editedImage) } } </code></pre>
0debug
Check if you can make word2 out of the letters of word1 (Beginner) : The task is to input two words that are made up of uppercase latin letters that are >1 and <250 characters and have the program output whether the second word can be made out of the 1st word's letters. I've been tackling this exercise all day and when I send it in, I only pass 11/12 tests. After asking 3 people for help and using their codes, I started getting 4/12... that's why I'm here. My code: #include <iostream> using namespace std; int main() { string word1, word2; // inputted words cin >> word1 >> word2; if (word2.size() > word1.size()) { return 0; } for (int i = 0; i < word1.size(); i++) // safe proofing { if(islower(word1[i]) || islower(word2[i]) || word1.size() < 1 || word1.size() > 250 || word2.size() < 1 || word2.size() > 250) { return 0; } } int sk1 = 0, sk2 = 0; // times a letter appears in the respective words int a = 0; // variable outside of for loop for the end if statement to work for(a; a < word2.size(); a++) //checks how many times each letter of the 2nd word appears in both words { for(int i = 0; i < word1.size(); i++) //checks how many times the letter appears in the 1st word { if (word2[a] == word1[i]) { sk1++; // counts the times it appears } } for(int i = 0; i < word2.size(); i++)//checks how many times the letter appears in the 2nd word { if (word2[a] == word2[i]) { sk2++; // counts the times it appears } } if(sk1 < sk2) // if the 1st word has less of the letter than needed, it outputs that you can't make the 2nd word { cout << "NO"; break; } sk1=0; sk2=0; } if (a == word2.size()) //if it goes through all the letters and there are enough of them to make the 2nd word, it says that it can be made. { cout << "YES"; } }
0debug
Where would I put the .title function in order for the final output to have the words beginning with a capital letter? : <p>I know this is probably a simple problem but as a beginner I thought I would ask. I have created a simple Python script to run through terminal where, after being asked three questions, the user will be given an output with it all in. I would like to add to this by capitalising all words answered and I know I could use the .title function but im not sure where to put it. any help would be much appreciated.</p> <pre><code>#ask user for age name = input('What is your name?: ') print(name) #ask user age age = input('How old are you?: ') print(age) #ask user for city city = input('What city were you born in?: ') print(city) #ask user what they enjoy hobby = input('What do you enjoy doing in your spare time?: ') print(hobby) #create output text string = 'Your name is {} and you are {} years old. you were born in {} and you enjoy {}' output = string.format(name, age, city, hobby) #print output to screen print(output) </code></pre>
0debug
static void process_incoming_migration_bh(void *opaque) { Error *local_err = NULL; MigrationIncomingState *mis = opaque; bdrv_invalidate_cache_all(&local_err); migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_FAILED); error_report_err(local_err); migrate_decompress_threads_join(); exit(EXIT_FAILURE); qemu_announce_self(); if (!global_state_received() || global_state_get_runstate() == RUN_STATE_RUNNING) { if (autostart) { vm_start(); } else { runstate_set(RUN_STATE_PAUSED); } else { runstate_set(global_state_get_runstate()); migrate_decompress_threads_join(); migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_COMPLETED); qemu_bh_delete(mis->bh); migration_incoming_state_destroy();
1threat
WebPack 2: Migrate preLoaders and postLoaders : <p>I've installed <code>webpack@2.1.0-beta.27</code>. Before, I was using <code>webpack@2.1.0-beta.22</code>. On my configuration file I was using <code>preLoaders</code> and <code>postLoaders</code>:</p> <pre><code>preLoaders: [ { test: /\.ts$/, loader: 'string-replace-loader', query: { search: '(System|SystemJS)(.*[\\n\\r]\\s*\\.|\\.)import\\((.+)\\)', replace: '$1.import($3).then(mod =&gt; (mod.__esModule &amp;&amp; mod.default) ? mod.default : mod)', flags: 'g' }, include: [helpers.root('src')] }, ], loaders: [...], postLoaders: [ { test: /\.js$/, loader: 'string-replace-loader', query: { search: 'var sourceMappingUrl = extractSourceMappingUrl\\(cssText\\);', replace: 'var sourceMappingUrl = "";', flags: 'g' } } ] </code></pre> <p>I'm not able to figure out once I've took a look on internet how to migrate this <code>preLoaders</code> and <code>postLoaders</code>.</p> <p>Should I put them inside <code>loaders</code>? Only that?</p>
0debug
Xcode if statement within if statement not working : I need to have an if statement inside an if statement and cant quite get it to work - keep getting an error - expected expression. The below code is what i've tried: ``` if weightLabel.text == "Weight (lbs)" { if pickerView == heightPicker { let titleRow = height[row] return titleRow } else if pickerView == weightPicker { let titleRow = weight[row] return titleRow } return "" else if weightLabel.text == "Weight (kgs)" { if pickerView == heightPicker { let titleRow = heightCM[row] return titleRow } else if pickerView == weightPicker { let titleRow = weightKG[row] return titleRow } return "" } } ``` Can someone take a look at my current code and help?
0debug
how do i create a make file in windows operating system and run it using cmd : i am new to makefile concept so to try out if i am able to run and compile c files using word "make"in command prompt i made main.c (which contains main function) ,ttt.c (which contain a function void ttt(int)) , mandar.h (headerfile to include void ttt(int) function in main.c) when i run this program in cmd using "gcc main.c ttt.c -o main && main",program gets compiled and run properly(so there shouldn't be any error in code) now in the same directory i made a file Makefile.txt as follow [image of makefile][1] now when i type "make "in cmd following message is shown [image of cmd message][2] i typed everything exactly the same way as in "head first c " book did i miss something this is my first time to ask a question so suggestion regarding improvement of questions are also welcomed [1]: http://i.stack.imgur.com/ymHPw.png [2]: http://i.stack.imgur.com/rVwLt.png
0debug
int ff_rtp_send_rtcp_feedback(RTPDemuxContext *s, URLContext *fd, AVIOContext *avio) { int len, need_keyframe, missing_packets; AVIOContext *pb; uint8_t *buf; int64_t now; uint16_t first_missing, missing_mask; if (!fd && !avio) return -1; need_keyframe = s->handler && s->handler->need_keyframe && s->handler->need_keyframe(s->dynamic_protocol_context); missing_packets = find_missing_packets(s, &first_missing, &missing_mask); if (!need_keyframe && !missing_packets) return 0; now = av_gettime(); if (s->last_feedback_time && (now - s->last_feedback_time) < MIN_FEEDBACK_INTERVAL) return 0; s->last_feedback_time = now; if (!fd) pb = avio; else if (avio_open_dyn_buf(&pb) < 0) return -1; if (need_keyframe) { avio_w8(pb, (RTP_VERSION << 6) | 1); avio_w8(pb, RTCP_PSFB); avio_wb16(pb, 2); avio_wb32(pb, s->ssrc + 1); avio_wb32(pb, s->ssrc); } if (missing_packets) { avio_w8(pb, (RTP_VERSION << 6) | 1); avio_w8(pb, RTCP_RTPFB); avio_wb16(pb, 3); avio_wb32(pb, s->ssrc + 1); avio_wb32(pb, s->ssrc); avio_wb16(pb, first_missing); avio_wb16(pb, missing_mask); } avio_flush(pb); if (!fd) return 0; len = avio_close_dyn_buf(pb, &buf); if (len > 0 && buf) { ffurl_write(fd, buf, len); av_free(buf); } return 0; }
1threat
When i tried to add the library it gives an error of versions .. help me to solve it please : <p><a href="https://i.stack.imgur.com/YM3sF.png" rel="nofollow noreferrer">When i execute the library it gives an error of versions .. help me to solve it please!</a></p>
0debug
UICollectionView with self sizing cells uses estimatedItemSize for delete animation : <p>I'm using <code>UICollectionView</code> with self sizing cells and have set the <code>estimatedItemSize</code> property for this to work.</p> <p>When performing a delete animation however, the cells animate to their position if they were sized with the <code>estimatedItemSize</code> property, rather than their auto layout (actual) size.</p> <p>What's worse is that our cells are variable sizes and there doesn't seem to be a method like <code>UITableView</code> where we can pass an estimated size per index path.</p> <p>I attempted to subclass the collection view flow layout and override the <code>initialLayoutAttributesForAppearingItemAtIndexPath(_:)</code> and <code>finalLayoutAttributesForDisappearingItemAtIndexPath(_:)</code>, but on inspection the superclass's return values for these methods are correct.</p> <p>Does anyone know of a solution to this seemingly basic bug?</p>
0debug
How to get the average of several chrono::time_points : <p>The formula for getting the average of several numbers is of course well known:</p> <p><img src="https://latex.codecogs.com/gif.latex?avg%20%3D%20%5Cfrac%7B%5Csum_%7Bi%3D1%7D%5EN%20x_i%7D%7BN%7D" alt=""></p> <p>And this formula can easily be used to get the average of <code>chrono::duration</code>s:</p> <pre><code>template &lt;class Rep0, class Period0&gt; auto sum(const std::chrono::duration&lt;Rep0, Period0&gt;&amp; d0) { return d0; } template &lt;class Rep0, class Period0, class ...Rep, class ...Period&gt; auto sum(const std::chrono::duration&lt;Rep0, Period0&gt;&amp; d0, const std::chrono::duration&lt;Rep, Period&gt;&amp; ...d) { return d0 + sum(d...); } template &lt;class ...Rep, class ...Period&gt; auto avg(const std::chrono::duration&lt;Rep, Period&gt;&amp; ...d) { return sum(d...) / sizeof...(d); } </code></pre> <p>But <code>chrono::time_point</code>s can't be added to one another. How can I average <code>time_point</code>s?</p>
0debug
sql join expression ambiguous : my ddl script is as follow: CREATE TABLE CPR_ENTITIES ( ENTITY_ID NUMBER(20) NOT NULL, SYSTEM_ID NUMBER(4), ENTITY_TYPE_ID NUMBER(8), GLOBAL_UID VARCHAR2(1000), SYS_OBJ_UID VARCHAR2(1000), ENTITY_NAME VARCHAR2(1000), CAGE_CODE VARCHAR2(2000), REVISION VARCHAR2(2000), ENTITY_CREATION_DATE NUMBER(20), ENTITY_MODIFICATION_DATE NUMBER(20), RELEASE_DATE NUMBER(20), ......................., ........................ CONSTRAINT "CPR_ENTITIES_PK" PRIMARY KEY ("ENTITY_ID"), CONSTRAINT "CPR_ENTITIES_FK1" FOREIGN KEY ("SYSTEM_ID") REFERENCES CPR_SOURCE_SYSTEM_METADATA("SYSTEM_ID"), CONSTRAINT "CPR_ENTITIES_FK2" FOREIGN KEY ("ENTITY_TYPE_ID") REFERENCES CPR_ENTITY_METADATA("ENTITY_TYPE_ID")); CREATE TABLE CPR_ENTITY_ATTRIBUTE ( VAL_ID NUMBER(20) NOT NULL, ENTITY_ID NUMBER(20), ATT_ID NUMBER(10), STRING_VALUE VARCHAR2(4000), NUM_VALUE NUMBER(10,2), TIMESTAMP_VALUE TIMESTAMP, CREATED_BY VARCHAR2(200), MODIFIED_BY VARCHAR2(200), CREATED_ON NUMBER(20), MODIFIED_ON NUMBER(20), IS_DELETED VARCHAR2(1), CONSTRAINT "CPR_ENTITY_ATTRIBUTE_PK" PRIMARY KEY ("VAL_ID"), CONSTRAINT "CPR_ENTITY_ATTRIBUTE_FK1" FOREIGN KEY ("ENTITY_ID") REFERENCES CPR_ENTITIES("ENTITY_ID"), CONSTRAINT "CPR_ENTITY_ATTRIBUTE_FK2" FOREIGN KEY ("ATT_ID") REFERENCES CPR_ENTITY_ATTRIBUTE_METADATA("ATT_ID") ); JOIN Expression: SELECT CPR_ENTITIES.ENTITY_ID,CPR_ENTITY_ATTRIBUTE.STRING_VALUE FROM CPR_ENTITIES LEFT JOIN CPR_ENTITIES ON CPR_ENTITIES.ENTITY_ID=CPR_ENTITY_ATTRIBUTE.ENTITY_ID; Error given: ERROR at line 1: ORA-00904: "CPR_ENTITY_ATTRIBUTE"."ENTITY_ID": invalid identifier
0debug
Simple jquery image editor with text function : <p>I'm looking for an image editor in js/jquery with possibility for user to add text other the image, move it, choose color. Crop and rotate function for image.</p> <p>Is there something like that? I found only one in codecanyon.</p>
0debug
Last 5 minutes on Runtime Datatable : <p>I have runtime Datatable. U update the datatable every seconds. </p> <p>I want to keep just last 5 minutes on Datatable. Is there any way to do it ?</p>
0debug
static int flush_packet(AVFormatContext *ctx, int stream_index, int64_t pts, int64_t dts, int64_t scr, int trailer_size) { MpegMuxContext *s = ctx->priv_data; StreamInfo *stream = ctx->streams[stream_index]->priv_data; uint8_t *buf_ptr; int size, payload_size, startcode, id, stuffing_size, i, header_len; int packet_size; uint8_t buffer[128]; int zero_trail_bytes = 0; int pad_packet_bytes = 0; int pes_flags; int general_pack = 0; int nb_frames; id = stream->id; #if 0 printf("packet ID=%2x PTS=%0.3f\n", id, pts / 90000.0); #endif buf_ptr = buffer; if ((s->packet_number % s->pack_header_freq) == 0 || s->last_scr != scr) { size = put_pack_header(ctx, buf_ptr, scr); buf_ptr += size; s->last_scr= scr; if (s->is_vcd) { if (stream->packet_number==0) { size = put_system_header(ctx, buf_ptr, id); buf_ptr += size; } } else if (s->is_dvd) { if (stream->align_iframe || s->packet_number == 0){ int PES_bytes_to_fill = s->packet_size - size - 10; if (pts != AV_NOPTS_VALUE) { if (dts != pts) PES_bytes_to_fill -= 5 + 5; else PES_bytes_to_fill -= 5; } if (stream->bytes_to_iframe == 0 || s->packet_number == 0) { size = put_system_header(ctx, buf_ptr, 0); buf_ptr += size; size = buf_ptr - buffer; put_buffer(ctx->pb, buffer, size); put_be32(ctx->pb, PRIVATE_STREAM_2); put_be16(ctx->pb, 0x03d4); put_byte(ctx->pb, 0x00); for (i = 0; i < 979; i++) put_byte(ctx->pb, 0x00); put_be32(ctx->pb, PRIVATE_STREAM_2); put_be16(ctx->pb, 0x03fa); put_byte(ctx->pb, 0x01); for (i = 0; i < 1017; i++) put_byte(ctx->pb, 0x00); memset(buffer, 0, 128); buf_ptr = buffer; s->packet_number++; stream->align_iframe = 0; scr += s->packet_size*90000LL / (s->mux_rate*50LL); size = put_pack_header(ctx, buf_ptr, scr); s->last_scr= scr; buf_ptr += size; } else if (stream->bytes_to_iframe < PES_bytes_to_fill) { pad_packet_bytes = PES_bytes_to_fill - stream->bytes_to_iframe; } } } else { if ((s->packet_number % s->system_header_freq) == 0) { size = put_system_header(ctx, buf_ptr, 0); buf_ptr += size; } } } size = buf_ptr - buffer; put_buffer(ctx->pb, buffer, size); packet_size = s->packet_size - size; if (s->is_vcd && id == AUDIO_ID) zero_trail_bytes += 20; if ((s->is_vcd && stream->packet_number==0) || (s->is_svcd && s->packet_number==0)) { if (s->is_svcd) general_pack = 1; pad_packet_bytes = packet_size - zero_trail_bytes; } packet_size -= pad_packet_bytes + zero_trail_bytes; if (packet_size > 0) { packet_size -= 6; if (s->is_mpeg2) { header_len = 3; if (stream->packet_number==0) header_len += 3; header_len += 1; } else { header_len = 0; } if (pts != AV_NOPTS_VALUE) { if (dts != pts) header_len += 5 + 5; else header_len += 5; } else { if (!s->is_mpeg2) header_len++; } payload_size = packet_size - header_len; if (id < 0xc0) { startcode = PRIVATE_STREAM_1; payload_size -= 1; if (id >= 0x40) { payload_size -= 3; if (id >= 0xa0) payload_size -= 3; } } else { startcode = 0x100 + id; } stuffing_size = payload_size - av_fifo_size(stream->fifo); if(payload_size <= trailer_size && pts != AV_NOPTS_VALUE){ int timestamp_len=0; if(dts != pts) timestamp_len += 5; if(pts != AV_NOPTS_VALUE) timestamp_len += s->is_mpeg2 ? 5 : 4; pts=dts= AV_NOPTS_VALUE; header_len -= timestamp_len; if (s->is_dvd && stream->align_iframe) { pad_packet_bytes += timestamp_len; packet_size -= timestamp_len; } else { payload_size += timestamp_len; } stuffing_size += timestamp_len; if(payload_size > trailer_size) stuffing_size += payload_size - trailer_size; } if (pad_packet_bytes > 0 && pad_packet_bytes <= 7) { packet_size += pad_packet_bytes; payload_size += pad_packet_bytes; if (stuffing_size < 0) { stuffing_size = pad_packet_bytes; } else { stuffing_size += pad_packet_bytes; } pad_packet_bytes = 0; } if (stuffing_size < 0) stuffing_size = 0; if (stuffing_size > 16) { pad_packet_bytes += stuffing_size; packet_size -= stuffing_size; payload_size -= stuffing_size; stuffing_size = 0; } nb_frames= get_nb_frames(ctx, stream, payload_size - stuffing_size); put_be32(ctx->pb, startcode); put_be16(ctx->pb, packet_size); if (!s->is_mpeg2) for(i=0;i<stuffing_size;i++) put_byte(ctx->pb, 0xff); if (s->is_mpeg2) { put_byte(ctx->pb, 0x80); pes_flags=0; if (pts != AV_NOPTS_VALUE) { pes_flags |= 0x80; if (dts != pts) pes_flags |= 0x40; } if (stream->packet_number == 0) pes_flags |= 0x01; put_byte(ctx->pb, pes_flags); put_byte(ctx->pb, header_len - 3 + stuffing_size); if (pes_flags & 0x80) put_timestamp(ctx->pb, (pes_flags & 0x40) ? 0x03 : 0x02, pts); if (pes_flags & 0x40) put_timestamp(ctx->pb, 0x01, dts); if (pes_flags & 0x01) { put_byte(ctx->pb, 0x10); if (id == AUDIO_ID) put_be16(ctx->pb, 0x4000 | stream->max_buffer_size/ 128); else put_be16(ctx->pb, 0x6000 | stream->max_buffer_size/1024); } } else { if (pts != AV_NOPTS_VALUE) { if (dts != pts) { put_timestamp(ctx->pb, 0x03, pts); put_timestamp(ctx->pb, 0x01, dts); } else { put_timestamp(ctx->pb, 0x02, pts); } } else { put_byte(ctx->pb, 0x0f); } } if (s->is_mpeg2) { put_byte(ctx->pb, 0xff); for(i=0;i<stuffing_size;i++) put_byte(ctx->pb, 0xff); } if (startcode == PRIVATE_STREAM_1) { put_byte(ctx->pb, id); if (id >= 0xa0) { put_byte(ctx->pb, 7); put_be16(ctx->pb, 4); put_byte(ctx->pb, stream->lpcm_header[0]); put_byte(ctx->pb, stream->lpcm_header[1]); put_byte(ctx->pb, stream->lpcm_header[2]); } else if (id >= 0x40) { put_byte(ctx->pb, nb_frames); put_be16(ctx->pb, trailer_size+1); } } assert(payload_size - stuffing_size <= av_fifo_size(stream->fifo)); av_fifo_generic_read(stream->fifo, ctx->pb, payload_size - stuffing_size, &put_buffer); stream->bytes_to_iframe -= payload_size - stuffing_size; }else{ payload_size= stuffing_size= 0; } if (pad_packet_bytes > 0) put_padding_packet(ctx,ctx->pb, pad_packet_bytes); for(i=0;i<zero_trail_bytes;i++) put_byte(ctx->pb, 0x00); put_flush_packet(ctx->pb); s->packet_number++; if (!general_pack) stream->packet_number++; return payload_size - stuffing_size; }
1threat
Is there any way to make non-html5 supporting browsers to support html5, not just the html5 markup, html5 api's as well? : <p>Specifically i want to make the non-html5 browser to support html5 geolocation api atleast.</p>
0debug
Android Studio ImageButton onclick : [when i click restart button it creates blue thing how to set that blue thing to transparent please? help me (sorry for my bed english :D)][1] [1]: https://i.stack.imgur.com/QgWwW.png
0debug
static void *do_data_compress(void *opaque) { CompressParam *param = opaque; while (!quit_comp_thread) { qemu_mutex_lock(&param->mutex); while (!param->start && !quit_comp_thread) { qemu_cond_wait(&param->cond, &param->mutex); } if (!quit_comp_thread) { do_compress_ram_page(param); } param->start = false; qemu_mutex_unlock(&param->mutex); qemu_mutex_lock(comp_done_lock); param->done = true; qemu_cond_signal(comp_done_cond); qemu_mutex_unlock(comp_done_lock); } return NULL; }
1threat
jump to line X in nano editor : <p>Does the Nano minimal text editor have a keyboard shortcut feature to jump to a specified line?</p> <p>Vim provides several <a href="http://vim.wikia.com/wiki/Go_to_line" rel="noreferrer">analogs</a>.</p>
0debug
void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, int mb_y) { const int bs = ctx->block_width_l2; const int bw = 1 << bs; int dct_y_offset = ctx->dct_y_offset; int dct_uv_offset = ctx->dct_uv_offset; int linesize = ctx->m.linesize; int uvlinesize = ctx->m.uvlinesize; const uint8_t *ptr_y = ctx->thread[0]->src[0] + ((mb_y << 4) * ctx->m.linesize) + (mb_x << bs + 1); const uint8_t *ptr_u = ctx->thread[0]->src[1] + ((mb_y << 4) * ctx->m.uvlinesize) + (mb_x << bs + ctx->is_444); const uint8_t *ptr_v = ctx->thread[0]->src[2] + ((mb_y << 4) * ctx->m.uvlinesize) + (mb_x << bs + ctx->is_444); PixblockDSPContext *pdsp = &ctx->m.pdsp; VideoDSPContext *vdsp = &ctx->m.vdsp; if (ctx->bit_depth != 10 && vdsp->emulated_edge_mc && ((mb_x << 4) + 16 > ctx->m.avctx->width || (mb_y << 4) + 16 > ctx->m.avctx->height)) { int y_w = ctx->m.avctx->width - (mb_x << 4); int y_h = ctx->m.avctx->height - (mb_y << 4); int uv_w = (y_w + 1) / 2; int uv_h = y_h; linesize = 16; uvlinesize = 8; vdsp->emulated_edge_mc(&ctx->edge_buf_y[0], ptr_y, linesize, ctx->m.linesize, linesize, 16, 0, 0, y_w, y_h); vdsp->emulated_edge_mc(&ctx->edge_buf_uv[0][0], ptr_u, uvlinesize, ctx->m.uvlinesize, uvlinesize, 16, 0, 0, uv_w, uv_h); vdsp->emulated_edge_mc(&ctx->edge_buf_uv[1][0], ptr_v, uvlinesize, ctx->m.uvlinesize, uvlinesize, 16, 0, 0, uv_w, uv_h); dct_y_offset = bw * linesize; dct_uv_offset = bw * uvlinesize; ptr_y = &ctx->edge_buf_y[0]; ptr_u = &ctx->edge_buf_uv[0][0]; ptr_v = &ctx->edge_buf_uv[1][0]; } else if (ctx->bit_depth == 10 && vdsp->emulated_edge_mc && ((mb_x << 3) + 8 > ctx->m.avctx->width || (mb_y << 3) + 8 > ctx->m.avctx->height)) { int y_w = ctx->m.avctx->width - (mb_x << 3); int y_h = ctx->m.avctx->height - (mb_y << 3); int uv_w = ctx->is_444 ? y_w : (y_w + 1) / 2; int uv_h = y_h; linesize = 16; uvlinesize = 8 + 8 * ctx->is_444; vdsp->emulated_edge_mc(&ctx->edge_buf_y[0], ptr_y, linesize, ctx->m.linesize, linesize / 2, 16, 0, 0, y_w, y_h); vdsp->emulated_edge_mc(&ctx->edge_buf_uv[0][0], ptr_u, uvlinesize, ctx->m.uvlinesize, uvlinesize / 2, 16, 0, 0, uv_w, uv_h); vdsp->emulated_edge_mc(&ctx->edge_buf_uv[1][0], ptr_v, uvlinesize, ctx->m.uvlinesize, uvlinesize / 2, 16, 0, 0, uv_w, uv_h); dct_y_offset = bw * linesize; dct_uv_offset = bw * uvlinesize; ptr_y = &ctx->edge_buf_y[0]; ptr_u = &ctx->edge_buf_uv[0][0]; ptr_v = &ctx->edge_buf_uv[1][0]; } if (!ctx->is_444) { pdsp->get_pixels(ctx->blocks[0], ptr_y, linesize); pdsp->get_pixels(ctx->blocks[1], ptr_y + bw, linesize); pdsp->get_pixels(ctx->blocks[2], ptr_u, uvlinesize); pdsp->get_pixels(ctx->blocks[3], ptr_v, uvlinesize); if (mb_y + 1 == ctx->m.mb_height && ctx->m.avctx->height == 1080) { if (ctx->interlaced) { ctx->get_pixels_8x4_sym(ctx->blocks[4], ptr_y + dct_y_offset, linesize); ctx->get_pixels_8x4_sym(ctx->blocks[5], ptr_y + dct_y_offset + bw, linesize); ctx->get_pixels_8x4_sym(ctx->blocks[6], ptr_u + dct_uv_offset, uvlinesize); ctx->get_pixels_8x4_sym(ctx->blocks[7], ptr_v + dct_uv_offset, uvlinesize); } else { ctx->bdsp.clear_block(ctx->blocks[4]); ctx->bdsp.clear_block(ctx->blocks[5]); ctx->bdsp.clear_block(ctx->blocks[6]); ctx->bdsp.clear_block(ctx->blocks[7]); } } else { pdsp->get_pixels(ctx->blocks[4], ptr_y + dct_y_offset, linesize); pdsp->get_pixels(ctx->blocks[5], ptr_y + dct_y_offset + bw, linesize); pdsp->get_pixels(ctx->blocks[6], ptr_u + dct_uv_offset, uvlinesize); pdsp->get_pixels(ctx->blocks[7], ptr_v + dct_uv_offset, uvlinesize); } } else { pdsp->get_pixels(ctx->blocks[0], ptr_y, linesize); pdsp->get_pixels(ctx->blocks[1], ptr_y + bw, linesize); pdsp->get_pixels(ctx->blocks[6], ptr_y + dct_y_offset, linesize); pdsp->get_pixels(ctx->blocks[7], ptr_y + dct_y_offset + bw, linesize); pdsp->get_pixels(ctx->blocks[2], ptr_u, uvlinesize); pdsp->get_pixels(ctx->blocks[3], ptr_u + bw, uvlinesize); pdsp->get_pixels(ctx->blocks[8], ptr_u + dct_uv_offset, uvlinesize); pdsp->get_pixels(ctx->blocks[9], ptr_u + dct_uv_offset + bw, uvlinesize); pdsp->get_pixels(ctx->blocks[4], ptr_v, uvlinesize); pdsp->get_pixels(ctx->blocks[5], ptr_v + bw, uvlinesize); pdsp->get_pixels(ctx->blocks[10], ptr_v + dct_uv_offset, uvlinesize); pdsp->get_pixels(ctx->blocks[11], ptr_v + dct_uv_offset + bw, uvlinesize); } }
1threat
Upgrading Spring Boot from 1.3.7 to 1.4.0 causing NullPointerException in AuthenticatorBase.getJaspicProvider : <p>This is somewhat caused by the tomcat-embed-core version 8.5.4 that comes with the spring-boot-starter-jersey. It generates an error shown below on all integration tests. It will only work if I override the pom to use tomcat-embed-core version 8.0.36. What's weird is, that's the only error message I get.</p> <pre><code>java.lang.NullPointerException: null at org.apache.catalina.authenticator.AuthenticatorBase.getJaspicProvider(AuthenticatorBase.java:1140) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:431) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) </code></pre> <p>Here's my dependecy tree:</p> <pre><code>[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ sample-services --- [INFO] com.sample:sample-services:jar:1.0.0-SNAPSHOT [INFO] +- com.sample:sample-customer:jar:1.0.0-SNAPSHOT:compile [INFO] | +- com.sample:sample-core:jar:1.0.0-SNAPSHOT:compile [INFO] | | +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.4.0.RELEASE:compile [INFO] | | | +- org.springframework.boot:spring-boot-starter-aop:jar:1.4.0.RELEASE:compile [INFO] | | | | \- org.aspectj:aspectjweaver:jar:1.8.9:compile [INFO] | | | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.4.0.RELEASE:compile [INFO] | | | | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.4:compile [INFO] | | | | | \- org.apache.tomcat:tomcat-juli:jar:8.5.4:compile [INFO] | | | | \- org.springframework:spring-jdbc:jar:4.3.2.RELEASE:compile [INFO] | | | +- org.hibernate:hibernate-core:jar:5.0.9.Final:compile [INFO] | | | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile [INFO] | | | | +- antlr:antlr:jar:2.7.7:compile [INFO] | | | | +- org.jboss:jandex:jar:2.0.0.Final:compile [INFO] | | | | +- dom4j:dom4j:jar:1.6.1:compile [INFO] | | | | | \- xml-apis:xml-apis:jar:1.4.01:compile [INFO] | | | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile [INFO] | | | +- org.hibernate:hibernate-entitymanager:jar:5.0.9.Final:compile [INFO] | | | +- javax.transaction:javax.transaction-api:jar:1.2:compile [INFO] | | | +- org.springframework.data:spring-data-jpa:jar:1.10.2.RELEASE:compile [INFO] | | | | \- org.springframework:spring-orm:jar:4.3.2.RELEASE:compile [INFO] | | | \- org.springframework:spring-aspects:jar:4.3.2.RELEASE:compile [INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.0.RELEASE:compile [INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.7:compile [INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.7:compile [INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile [INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile [INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile [INFO] | | +- commons-collections:commons-collections:jar:3.2.2:compile [INFO] | | +- com.h2database:h2:jar:1.4.192:compile [INFO] | | +- org.postgresql:postgresql:jar:9.4.1209.jre7:compile [INFO] | | +- javax:javaee-api:jar:7.0:compile [INFO] | | | \- com.sun.mail:javax.mail:jar:1.5.5:compile [INFO] | | | \- javax.activation:activation:jar:1.1:compile [INFO] | | +- org.apache.commons:commons-lang3:jar:3.4:compile [INFO] | | +- commons-codec:commons-codec:jar:1.10:compile [INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.5:compile [INFO] | | +- org.joda:joda-money:jar:0.10.0:compile [INFO] | | \- com.sun.jna:jna:jar:3.0.9:compile [INFO] | +- org.springframework.boot:spring-boot-starter-data-elasticsearch:jar:1.4.0.RELEASE:compile [INFO] | | \- org.springframework.data:spring-data-elasticsearch:jar:2.0.2.RELEASE:compile [INFO] | | +- org.springframework:spring-tx:jar:4.3.2.RELEASE:compile [INFO] | | +- org.springframework.data:spring-data-commons:jar:1.12.2.RELEASE:compile [INFO] | | +- commons-lang:commons-lang:jar:2.6:compile [INFO] | | \- org.elasticsearch:elasticsearch:jar:2.3.4:compile [INFO] | | +- org.apache.lucene:lucene-core:jar:5.5.0:compile [INFO] | | +- org.apache.lucene:lucene-backward-codecs:jar:5.5.0:compile [INFO] | | +- org.apache.lucene:lucene-analyzers-common:jar:5.5.0:compile [INFO] | | +- org.apache.lucene:lucene-queries:jar:5.5.0:compile [INFO] | | +- org.apache.lucene:lucene-memory:jar:5.5.0:compile [INFO] | | +- org.apache.lucene:lucene-highlighter:jar:5.5.0:compile [INFO] | | +- org.apache.lucene:lucene-queryparser:jar:5.5.0:compile [INFO] | | | \- org.apache.lucene:lucene-sandbox:jar:5.5.0:compile [INFO] | | +- org.apache.lucene:lucene-suggest:jar:5.5.0:compile [INFO] | | | \- org.apache.lucene:lucene-misc:jar:5.5.0:compile [INFO] | | +- org.apache.lucene:lucene-join:jar:5.5.0:compile [INFO] | | | \- org.apache.lucene:lucene-grouping:jar:5.5.0:compile [INFO] | | +- org.apache.lucene:lucene-spatial:jar:5.5.0:compile [INFO] | | | +- org.apache.lucene:lucene-spatial3d:jar:5.5.0:compile [INFO] | | | \- com.spatial4j:spatial4j:jar:0.5:compile [INFO] | | +- org.elasticsearch:securesm:jar:1.0:compile [INFO] | | +- com.carrotsearch:hppc:jar:0.7.1:compile [INFO] | | +- org.joda:joda-convert:jar:1.2:compile [INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.8.1:compile [INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.8.1:compile [INFO] | | +- io.netty:netty:jar:3.10.5.Final:compile [INFO] | | +- com.ning:compress-lzf:jar:1.0.2:compile [INFO] | | +- com.tdunning:t-digest:jar:3.0:compile [INFO] | | +- org.hdrhistogram:HdrHistogram:jar:2.1.6:compile [INFO] | | +- commons-cli:commons-cli:jar:1.3.1:compile [INFO] | | \- com.twitter:jsr166e:jar:1.1.0:compile [INFO] | +- com.google.guava:guava:jar:19.0:compile [INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile [INFO] | +- commons-httpclient:commons-httpclient:jar:3.1:compile [INFO] | +- commons-io:commons-io:jar:2.5:compile [INFO] | +- net.sf.uadetector:uadetector-core:jar:0.9.22:compile [INFO] | | +- net.sf.qualitycheck:quality-check:jar:1.3:compile [INFO] | | +- com.google.code.findbugs:jsr305:jar:2.0.3:compile [INFO] | | \- javax.annotation:jsr250-api:jar:1.0:compile [INFO] | +- net.sf.uadetector:uadetector-resources:jar:2014.10:compile [INFO] | \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.8.1:compile [INFO] +- com.sample:sample-messaging:jar:1.0.0-SNAPSHOT:compile [INFO] | +- com.amazonaws:aws-java-sdk-sns:jar:1.11.24:compile [INFO] | \- com.amazonaws:aws-java-sdk-sqs:jar:1.11.24:compile [INFO] +- org.springframework.boot:spring-boot-starter-jersey:jar:1.4.0.RELEASE:compile [INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.4.0.RELEASE:compile [INFO] | | \- org.yaml:snakeyaml:jar:1.17:compile [INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.0.RELEASE:compile [INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.4:compile [INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.4:compile [INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.4:compile [INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:1.4.0.RELEASE:compile [INFO] | +- org.springframework:spring-web:jar:4.3.2.RELEASE:compile [INFO] | | +- org.springframework:spring-aop:jar:4.3.2.RELEASE:compile [INFO] | | +- org.springframework:spring-beans:jar:4.3.2.RELEASE:compile [INFO] | | \- org.springframework:spring-context:jar:4.3.2.RELEASE:compile [INFO] | +- org.glassfish.jersey.core:jersey-server:jar:2.23.1:compile [INFO] | | +- org.glassfish.jersey.core:jersey-client:jar:2.23.1:compile [INFO] | | +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.23.1:compile [INFO] | | +- javax.annotation:javax.annotation-api:jar:1.2:compile [INFO] | | +- org.glassfish.hk2:hk2-api:jar:2.4.0-b34:compile [INFO] | | | +- org.glassfish.hk2:hk2-utils:jar:2.4.0-b34:compile [INFO] | | | \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b34:compile [INFO] | | \- org.glassfish.hk2:hk2-locator:jar:2.4.0-b34:compile [INFO] | | \- org.javassist:javassist:jar:3.20.0-GA:compile [INFO] | +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.23.1:compile [INFO] | +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.23.1:compile [INFO] | +- org.glassfish.jersey.ext:jersey-spring3:jar:2.23.1:compile [INFO] | | +- org.glassfish.hk2:hk2:jar:2.4.0-b34:compile [INFO] | | | +- org.glassfish.hk2:config-types:jar:2.4.0-b34:compile [INFO] | | | +- org.glassfish.hk2:hk2-core:jar:2.4.0-b34:compile [INFO] | | | +- org.glassfish.hk2:hk2-config:jar:2.4.0-b34:compile [INFO] | | | +- org.glassfish.hk2:hk2-runlevel:jar:2.4.0-b34:compile [INFO] | | | \- org.glassfish.hk2:class-model:jar:2.4.0-b34:compile [INFO] | | | \- org.glassfish.hk2.external:asm-all-repackaged:jar:2.4.0-b34:compile [INFO] | | \- org.glassfish.hk2:spring-bridge:jar:2.4.0-b34:compile [INFO] | \- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.23.1:compile [INFO] | +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.23.1:compile [INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.8.1:compile [INFO] | \- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.8.1:compile [INFO] | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.8.1:compile [INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.1:compile [INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.1:compile [INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.1:compile [INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.4.0.RELEASE:compile [INFO] | +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile [INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile [INFO] | | \- com.fasterxml:classmate:jar:1.3.1:compile [INFO] | \- org.springframework:spring-webmvc:jar:4.3.2.RELEASE:compile [INFO] | \- org.springframework:spring-expression:jar:4.3.2.RELEASE:compile [INFO] +- com.amazonaws:aws-java-sdk-s3:jar:1.11.24:compile [INFO] | +- com.amazonaws:aws-java-sdk-kms:jar:1.11.24:compile [INFO] | \- com.amazonaws:aws-java-sdk-core:jar:1.11.24:compile [INFO] | +- commons-logging:commons-logging:jar:1.1.3:compile [INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.8.1:compile [INFO] | \- joda-time:joda-time:jar:2.9.4:compile [INFO] +- com.wordnik:swagger-jersey2-jaxrs_2.10:jar:1.3.13:compile [INFO] | +- com.wordnik:swagger-jaxrs_2.10:jar:1.3.13:compile [INFO] | | +- com.wordnik:swagger-core_2.10:jar:1.3.13:compile [INFO] | | | +- com.fasterxml.jackson.module:jackson-module-scala_2.10:jar:2.4.1:compile [INFO] | | | | \- com.thoughtworks.paranamer:paranamer:jar:2.6:compile [INFO] | | | +- com.fasterxml.jackson.module:jackson-module-jsonSchema:jar:2.4.1:compile [INFO] | | | +- com.wordnik:swagger-annotations:jar:1.3.13:compile [INFO] | | | +- org.json4s:json4s-ext_2.10:jar:3.2.11:compile [INFO] | | | +- org.json4s:json4s-native_2.10:jar:3.2.11:compile [INFO] | | | | \- org.json4s:json4s-core_2.10:jar:3.2.11:compile [INFO] | | | | +- org.json4s:json4s-ast_2.10:jar:3.2.11:compile [INFO] | | | | \- org.scala-lang:scalap:jar:2.10.0:compile [INFO] | | | | \- org.scala-lang:scala-compiler:jar:2.10.0:compile [INFO] | | | \- org.json4s:json4s-jackson_2.10:jar:3.2.11:compile [INFO] | | \- org.reflections:reflections:jar:0.9.9:compile [INFO] | | \- com.google.code.findbugs:annotations:jar:2.0.1:compile [INFO] | \- org.glassfish.jersey.media:jersey-media-multipart:jar:2.1:compile [INFO] | \- org.jvnet.mimepull:mimepull:jar:1.8:compile [INFO] +- org.glassfish.jersey.ext:jersey-bean-validation:jar:2.23.1:compile [INFO] | +- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b34:compile [INFO] | +- org.glassfish.jersey.core:jersey-common:jar:2.23.1:compile [INFO] | | +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.23.1:compile [INFO] | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile [INFO] | +- javax.validation:validation-api:jar:1.1.0.Final:compile [INFO] | +- javax.el:javax.el-api:jar:2.2.4:compile [INFO] | +- org.glassfish.web:javax.el:jar:2.2.4:compile [INFO] | \- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile [INFO] +- com.jayway.restassured:rest-assured:jar:2.9.0:test [INFO] | +- org.codehaus.groovy:groovy:jar:2.4.7:test [INFO] | +- org.codehaus.groovy:groovy-xml:jar:2.4.7:test [INFO] | +- org.apache.httpcomponents:httpmime:jar:4.5.2:test [INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test [INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test [INFO] | +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:test [INFO] | +- com.jayway.restassured:json-path:jar:2.9.0:test [INFO] | | +- org.codehaus.groovy:groovy-json:jar:2.4.7:test [INFO] | | \- com.jayway.restassured:rest-assured-common:jar:2.9.0:test [INFO] | \- com.jayway.restassured:xml-path:jar:2.9.0:test [INFO] +- com.jayway.jsonpath:json-path:jar:2.2.0:compile [INFO] | +- net.minidev:json-smart:jar:2.2.1:compile [INFO] | | \- net.minidev:accessors-smart:jar:1.1:compile [INFO] | | \- org.ow2.asm:asm:jar:5.0.3:compile [INFO] | \- org.slf4j:slf4j-api:jar:1.7.21:compile [INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.4.0.RELEASE:test [INFO] | +- org.springframework.boot:spring-boot-test:jar:1.4.0.RELEASE:test [INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:1.4.0.RELEASE:test [INFO] | +- junit:junit:jar:4.12:test [INFO] | +- org.mockito:mockito-core:jar:1.10.19:test [INFO] | | \- org.objenesis:objenesis:jar:2.1:test [INFO] | +- org.skyscreamer:jsonassert:jar:1.3.0:test [INFO] | +- org.springframework:spring-core:jar:4.3.2.RELEASE:compile [INFO] | \- org.springframework:spring-test:jar:4.3.2.RELEASE:test [INFO] +- org.assertj:assertj-core:jar:3.2.0:compile [INFO] +- org.springframework.boot:spring-boot-configuration-processor:jar:1.4.0.RELEASE:compile [INFO] | \- org.json:json:jar:20140107:compile [INFO] +- org.neo4j:neo4j-cypher-compiler-2.2:jar:2.2.5:compile [INFO] | +- org.scala-lang:scala-library:jar:2.10.5:compile [INFO] | +- org.scala-lang:scala-reflect:jar:2.10.5:compile [INFO] | +- org.parboiled:parboiled-scala_2.10:jar:1.1.7:compile [INFO] | | \- org.parboiled:parboiled-core:jar:1.1.7:compile [INFO] | \- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.4:compile [INFO] \- org.springframework.boot:spring-boot-devtools:jar:1.4.0.RELEASE:compile [INFO] +- org.springframework.boot:spring-boot:jar:1.4.0.RELEASE:compile [INFO] \- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.0.RELEASE:compile </code></pre> <p>And here's my Application class:</p> <pre><code>@EntityScan(basePackageClasses = { Application.class, Jsr310JpaConverters.class }) @EnableScheduling @EnableAsync @SpringBootApplication(scanBasePackages = "com.sample") public class Application extends Loggable implements AsyncConfigurer { /** * This forces the SNS topics to be created and/or linked. */ @Autowired @SuppressWarnings("all") private TopicFactory topicFactory; /** * It all begins here. */ public static void main(String[] args) throws Exception { SpringApplication application = new SpringApplication(Application.class); application.setBanner(new SampleBanner()); application.run(args); } /** * Returns the @Async executor. */ @Override public Executor getAsyncExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(4); executor.setMaxPoolSize(4); executor.setQueueCapacity(0); executor.setThreadNamePrefix("Async-"); executor.initialize(); return executor; } /** * Returns the uncaught exception handler for @Async operations. */ @Override public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() { return (e, method, params) -&gt; log.error("Uncaught async error", e); } } </code></pre> <p>If someone could point me out where to start or what's causing it to fail, it would be of great help.</p>
0debug
static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd){ const int b_stride= s->b_width << s->block_max_depth; BlockNode *block= &s->block[mb_x + mb_y * b_stride]; BlockNode backup[4]= {block[0], block[1], block[b_stride], block[b_stride+1]}; int rd, index, value; assert(mb_x>=0 && mb_y>=0); assert(mb_x<b_stride); assert(((mb_x|mb_y)&1) == 0); index= (p0 + 31*p1) & (ME_CACHE_SIZE-1); value= s->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12); if(s->me_cache[index] == value) return 0; s->me_cache[index]= value; block->mx= p0; block->my= p1; block->ref= ref; block->type &= ~BLOCK_INTRA; block[1]= block[b_stride]= block[b_stride+1]= *block; rd= get_4block_rd(s, mb_x, mb_y, 0); if(rd < *best_rd){ *best_rd= rd; return 1; }else{ block[0]= backup[0]; block[1]= backup[1]; block[b_stride]= backup[2]; block[b_stride+1]= backup[3]; return 0; } }
1threat
any pointer in this querying will be helpful looks complicated to me : a table has users from different states who used different methods to approach the application the table has userids (1,2,3,4,5,6..14000) approaches(a,b,c,d,e,f) states (wa,vic..) now i need to formulate a table which would have columns with coulmn 1 approaches and remaining column names with states names westernaustralia, victoria, SA,queensland etc. the approach row would have total no of people who used this approach in different states victoria 5 wa 0.. in the same way other 5 approaches would have number of people used the approach in different states(in columns). Hope I made it clear..
0debug
static void vnc_tls_handshake_done(QIOTask *task, gpointer user_data) { VncState *vs = user_data; Error *err = NULL; if (qio_task_propagate_error(task, &err)) { VNC_DEBUG("Handshake failed %s\n", error_get_pretty(err)); vnc_client_error(vs); error_free(err); } else { vs->ioc_tag = qio_channel_add_watch( vs->ioc, G_IO_IN | G_IO_OUT, vnc_client_io, vs, NULL); start_auth_vencrypt_subauth(vs); } }
1threat
int css_do_ssch(SubchDev *sch, ORB *orb) { SCSW *s = &sch->curr_status.scsw; PMCW *p = &sch->curr_status.pmcw; int ret; if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) { ret = -ENODEV; goto out; } if (s->ctrl & SCSW_STCTL_STATUS_PEND) { ret = -EINPROGRESS; goto out; } if (s->ctrl & (SCSW_FCTL_START_FUNC | SCSW_FCTL_HALT_FUNC | SCSW_FCTL_CLEAR_FUNC)) { ret = -EBUSY; goto out; } if (channel_subsys.chnmon_active) { css_update_chnmon(sch); } sch->orb = *orb; sch->channel_prog = orb->cpa; s->ctrl |= (SCSW_FCTL_START_FUNC | SCSW_ACTL_START_PEND); s->flags &= ~SCSW_FLAGS_MASK_PNO; ret = do_subchannel_work(sch); out: return ret; }
1threat
C++ - No instance of constructor matches the argument list : I have a class called Person. class Person { private: char* name; int age; public: Person(); Person(char* pName, int pAge); ~Person(); void Display(); }; Person.cpp #include<iostream> #include "Person.h" Person::Person() : name(nullptr), age(0) {} Person::Person(char* pName, int pAge) : name(pName), age(pAge) {} Person::~Person() {} void Person::Display() { std::cout << "Name is " << name << " and age is " << age << std::endl; } Main.cpp #include "Person.h" int main() { Person* pt = new Person("Scott, 25"); pt->Display(); delete pt; return 0; } I got the following errors when I build the program using Visual Studio 2017. E0289 no instance of constructor "Person::Person" matches the argument list C2664 'Person::Person(const Person &)': cannot convert argument 1 from 'const char [6]' to 'char *' What did I do wrong in this code? Can you please help me to correct it? I tried using string but got the same error. Thank you.
0debug
How to extract lower and upper bound in numeric format from a confidence interval string? : <p>Suppose a vector including some confidence intervals as below</p> <pre><code>confint &lt;- c("[0.741 ; 2.233]", "[263.917 ; 402.154]", "[12.788 ; 17.975]", "[0.680 ; 2.450]", "[0.650 ; 1.827]", "[0.719 ; 2.190]") </code></pre> <p>I want to have two new vectors one including the lower Limits in numeric format as </p> <pre><code>lower &lt;- c(0.741, 263.917, 12.788, 0.680, 0.650 , 0.719) </code></pre> <p>and othe including the upper Limits in numeric format like</p> <pre><code>upper &lt;- c(2.233, 402.154, 17.975, 2.450, 1.827, 2.190) </code></pre>
0debug
static void vnc_init_basic_info_from_server_addr(QIOChannelSocket *ioc, VncBasicInfo *info, Error **errp) { SocketAddress *addr = NULL; if (!ioc) { error_setg(errp, "No listener socket available"); return; } addr = qio_channel_socket_get_local_address(ioc, errp); if (!addr) { return; } vnc_init_basic_info(addr, info, errp); qapi_free_SocketAddress(addr); }
1threat
static int video_read_header(AVFormatContext *s, AVFormatParameters *ap) { AVStream *st; st = av_new_stream(s, 0); if (!st) return AVERROR_NOMEM; st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_id = s->iformat->value; st->need_parsing = 1; if (ap && ap->time_base.num) { av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den); } else if ( st->codec->codec_id == CODEC_ID_MJPEG || st->codec->codec_id == CODEC_ID_MPEG4 || st->codec->codec_id == CODEC_ID_H264) { av_set_pts_info(st, 64, 1, 25); } return 0; }
1threat
Disable button when input is empty in Angular 2 : <p>I want to check whether the input is empty.</p> <ul> <li>If not empty, enable the submit button.</li> <li>If empty, disable the submit button.</li> </ul> <p>I tried <code>(oninput)</code> and <code>(onchange)</code>, but they do not run.</p> <pre><code>&lt;input type="password" [(ngModel)]="myPassword" (oninput)="checkPasswordEmpty()"/&gt; checkPasswordEmpty() { console.log("checkPasswordEmpty runs"); if (this.myPassword) { // enable the button } } </code></pre>
0debug
dynamically submit form and show the value of the input without reloading : i want to create chat UI a fully dynamic for my website now it reloads the whole page but i want a fully dynamic like if a person submits the button this will directly show the div `<div class="messeging" id="msg"><?php print $message->getName() ." : " . $chat->message . ""; ?> </div>` without reload msgs are save in some xml file path like example `(../user/xml)` i dont know javascript/ajax well how to solve this html <form action="action.php" method="post"> <input type="text" id="input" value="php echo"><input type="submit" value="send" onclick="showDiv()"> </form> <div class="messeging" id="msg"><?php print $message->getName() ." : " . $chat->message . ""; ?> </div>
0debug
Best practice for storing auth tokens in VueJS? : <p>My backend is a REST API served up by Django-Rest-Framework. I am using VueJS for the front end and trying to figure out what is the best practice for doing authentication/login. This is probably terrible code, but it works (in a component called <code>Login.vue</code>):</p> <pre><code> methods: { login () { axios.post('/api-token-auth/login/', { username: this.username, password: this.pwd1 }).then(response =&gt; { localStorage.setItem('token', response.data.token) }).catch(error =&gt; { console.log("Error login") console.log(error) }) this.dialog = false } } </code></pre> <p>Does it make sense to use <code>localStorage</code> this way? Also, I'm wondering when the user wants to sign out, and I call <code>/api-token-auth/logout</code>, do I still need to remove the token from <code>localStorage</code>? It's not actually clear to me what goes on with the tokens either on Django's end or the browser/Vue.</p>
0debug
static void ivshmem_realize(PCIDevice *dev, Error **errp) { IVShmemState *s = IVSHMEM_COMMON(dev); if (!qtest_enabled()) { error_report("ivshmem is deprecated, please use ivshmem-plain" " or ivshmem-doorbell instead"); } if (!!qemu_chr_fe_get_driver(&s->server_chr) + !!s->shmobj != 1) { error_setg(errp, "You must specify either 'shm' or 'chardev'"); return; } if (s->sizearg == NULL) { s->legacy_size = 4 << 20; } else { int64_t size = qemu_strtosz_MiB(s->sizearg, NULL); if (size < 0 || (size_t)size != size || !is_power_of_2(size)) { error_setg(errp, "Invalid size %s", s->sizearg); return; } s->legacy_size = size; } if (s->role) { if (strncmp(s->role, "peer", 5) == 0) { s->master = ON_OFF_AUTO_OFF; } else if (strncmp(s->role, "master", 7) == 0) { s->master = ON_OFF_AUTO_ON; } else { error_setg(errp, "'role' must be 'peer' or 'master'"); return; } } else { s->master = ON_OFF_AUTO_AUTO; } if (s->shmobj) { desugar_shm(s); } pci_config_set_interrupt_pin(dev->config, 1); ivshmem_common_realize(dev, errp); }
1threat
Visual studio code interactive python console : <p>I'm using visual studio code with DonJayamanne python extension. It's working fine but I want to have an interactive session just like the one in Matlab, where after code execution every definition and computational result remains and accessible in the console. </p> <p>For example after running this code: </p> <pre><code>a = 1 </code></pre> <p>the python session is terminated and I cannot type in the console something like:</p> <pre><code>b = a + 1 print(b) </code></pre> <p>I'm aware that the python session can stay alive with a "-i" flag. But this simply doesn't work. </p> <p>Also every time I run a code file, a new python process is spawned. Is there a way to run consecutive runs in just one console? Again like Matlab?</p> <p>This sounds really essential and trivial to me. Am I missing something big here that I can't find a solution for this?</p>
0debug
Unable to parse json data from url : I am working on json data for my project. Json data is to be fetched from url. For http://example.com/q=x json data is {"X":{"USD":158.47}} http://example.com/q=y json data is {"Y":{"USD":145}} I have javascript file where I need to store the value (158.47 and 145)vto a variable to output it. I tried: 1) $.getJSON(url, function(json) { const prices=json.$x."USD"; $(`#${symbol}-price`).text(prices.toLocaleString()) }) 2) SONObject obj = new JSONObject(IOUtils.toString(new URL(url), Charset.forName("UTF-8"))); JSONObject prices = obj.getJSONObject(x); But none of them are working. Pls help.
0debug
VS 2017 RC generating an 0x8000ffff error when trying to debug xUnit tests : <p>I'm trying to debug my .NET Core xUnit tests in VS 2017 RC. I run my tests via the Test Explorer window. While right-clicking a test and selecting <strong>Run Selected Tests</strong> works fine, selecting <strong>Debug Selected Tests</strong> does not:</p> <p><a href="https://i.stack.imgur.com/EkGg1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EkGg1.png" alt=""></a></p> <p>I'm at a loss at how to get past this. I have tried restarting VS, doing a clean build, removing the <code>.vs/</code> folder, and even updating to a newer build of VS 2017. However, nothing so far has worked. Does anyone have suggestions for how I can work around this? Thanks!</p> <p><strong>edit:</strong> My project has a Git repo <a href="https://github.com/jamesqo/BasicCompiler/tree/44e148000c21174f0872a7a423f997955268d045" rel="noreferrer">here</a>, so if you want to you're free to clone it and see if you can repro for yourself. The test assembly is in <code>src/BasicCompiler.Tests/</code>.</p>
0debug
static void update_max_chunk_size(BDRVDMGState *s, uint32_t chunk, uint32_t *max_compressed_size, uint32_t *max_sectors_per_chunk) { uint32_t compressed_size = 0; uint32_t uncompressed_sectors = 0; switch (s->types[chunk]) { case 0x80000005: case 0x80000006: compressed_size = s->lengths[chunk]; uncompressed_sectors = s->sectorcounts[chunk]; break; case 1: uncompressed_sectors = (s->lengths[chunk] + 511) / 512; break; case 2: uncompressed_sectors = s->sectorcounts[chunk]; break; } if (compressed_size > *max_compressed_size) { *max_compressed_size = compressed_size; } if (uncompressed_sectors > *max_sectors_per_chunk) { *max_sectors_per_chunk = uncompressed_sectors; } }
1threat
Ruby Conditionals Issue? : I have a beginner Ruby programmer question. Why will the strings not print out when I type in "Y" or "N"? def name_of_client puts "Hello sir/madam; please enter your name: " name = gets.chomp.upcase puts "Welcome to the Great Bank, #{name}. Would you like to enter your seriously insecure account? (Y/N)" end def get_response answer = gets if answer == "Y" || answer == "y" puts 'Sure thing... ' elsif answer == "N" || answer== "n" puts "Logging you out now. " end end name_of_client get_response
0debug
when I am moving jck 1.5 code to jdk 1.7 platorm that time I am getting ClassCastException : when I am moving jdk 1.5 code to jdk 1.7 platform that time I am getting ClassCastException here in serializerFactory code ,can anyone plese suggest the solution . synchronized (key) { if (this.firstCall()) { [enter image description here][1] _call.setEncodingStyle(null); int i = 0; while (i < this.cachedSerFactories.size()) { Class df; Class sf; Class cls = (Class)this.cachedSerClasses.get(i); QName qName = (QName)this.cachedSerQNames.get(i); Object x = this.cachedSerFactories.get(i); if (x instanceof Class) { sf = (Class) this.cachedSerFactories.get(i); df = (Class)this.cachedDeserFactories.get(i); _call.registerTypeMapping(cls, qName, sf, df, false); } else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) { sf = (SerializerFactory)this.cachedSerFactories.get(i); df = (DeserializerFactory)this.cachedDeserFactories.get(i); _call.registerTypeMapping(cls, qName, (SerializerFactory)sf,(DeserializerFactory)df, false); } ++i; } } } [1]: https://i.stack.imgur.com/o0hoI.jpg
0debug
window.location.href = 'http://attack.com?user=' + user_input;
1threat
static const char *scsi_command_name(uint8_t cmd) { static const char *names[] = { [ TEST_UNIT_READY ] = "TEST_UNIT_READY", [ REQUEST_SENSE ] = "REQUEST_SENSE", [ FORMAT_UNIT ] = "FORMAT_UNIT", [ READ_BLOCK_LIMITS ] = "READ_BLOCK_LIMITS", [ REASSIGN_BLOCKS ] = "REASSIGN_BLOCKS", [ READ_6 ] = "READ_6", [ WRITE_6 ] = "WRITE_6", [ SEEK_6 ] = "SEEK_6", [ READ_REVERSE ] = "READ_REVERSE", [ WRITE_FILEMARKS ] = "WRITE_FILEMARKS", [ SPACE ] = "SPACE", [ INQUIRY ] = "INQUIRY", [ RECOVER_BUFFERED_DATA ] = "RECOVER_BUFFERED_DATA", [ MAINTENANCE_IN ] = "MAINTENANCE_IN", [ MAINTENANCE_OUT ] = "MAINTENANCE_OUT", [ MODE_SELECT ] = "MODE_SELECT", [ RESERVE ] = "RESERVE", [ RELEASE ] = "RELEASE", [ COPY ] = "COPY", [ ERASE ] = "ERASE", [ MODE_SENSE ] = "MODE_SENSE", [ START_STOP ] = "START_STOP", [ RECEIVE_DIAGNOSTIC ] = "RECEIVE_DIAGNOSTIC", [ SEND_DIAGNOSTIC ] = "SEND_DIAGNOSTIC", [ ALLOW_MEDIUM_REMOVAL ] = "ALLOW_MEDIUM_REMOVAL", [ READ_CAPACITY ] = "READ_CAPACITY", [ READ_10 ] = "READ_10", [ WRITE_10 ] = "WRITE_10", [ SEEK_10 ] = "SEEK_10", [ WRITE_VERIFY ] = "WRITE_VERIFY", [ VERIFY ] = "VERIFY", [ SEARCH_HIGH ] = "SEARCH_HIGH", [ SEARCH_EQUAL ] = "SEARCH_EQUAL", [ SEARCH_LOW ] = "SEARCH_LOW", [ SET_LIMITS ] = "SET_LIMITS", [ PRE_FETCH ] = "PRE_FETCH", [ SYNCHRONIZE_CACHE ] = "SYNCHRONIZE_CACHE", [ LOCK_UNLOCK_CACHE ] = "LOCK_UNLOCK_CACHE", [ READ_DEFECT_DATA ] = "READ_DEFECT_DATA", [ MEDIUM_SCAN ] = "MEDIUM_SCAN", [ COMPARE ] = "COMPARE", [ COPY_VERIFY ] = "COPY_VERIFY", [ WRITE_BUFFER ] = "WRITE_BUFFER", [ READ_BUFFER ] = "READ_BUFFER", [ UPDATE_BLOCK ] = "UPDATE_BLOCK", [ READ_LONG ] = "READ_LONG", [ WRITE_LONG ] = "WRITE_LONG", [ CHANGE_DEFINITION ] = "CHANGE_DEFINITION", [ WRITE_SAME ] = "WRITE_SAME", [ READ_TOC ] = "READ_TOC", [ LOG_SELECT ] = "LOG_SELECT", [ LOG_SENSE ] = "LOG_SENSE", [ MODE_SELECT_10 ] = "MODE_SELECT_10", [ RESERVE_10 ] = "RESERVE_10", [ RELEASE_10 ] = "RELEASE_10", [ MODE_SENSE_10 ] = "MODE_SENSE_10", [ PERSISTENT_RESERVE_IN ] = "PERSISTENT_RESERVE_IN", [ PERSISTENT_RESERVE_OUT ] = "PERSISTENT_RESERVE_OUT", [ MOVE_MEDIUM ] = "MOVE_MEDIUM", [ READ_12 ] = "READ_12", [ WRITE_12 ] = "WRITE_12", [ WRITE_VERIFY_12 ] = "WRITE_VERIFY_12", [ SEARCH_HIGH_12 ] = "SEARCH_HIGH_12", [ SEARCH_EQUAL_12 ] = "SEARCH_EQUAL_12", [ SEARCH_LOW_12 ] = "SEARCH_LOW_12", [ READ_ELEMENT_STATUS ] = "READ_ELEMENT_STATUS", [ SEND_VOLUME_TAG ] = "SEND_VOLUME_TAG", [ WRITE_LONG_2 ] = "WRITE_LONG_2", [ REPORT_DENSITY_SUPPORT ] = "REPORT_DENSITY_SUPPORT", [ GET_CONFIGURATION ] = "GET_CONFIGURATION", [ READ_16 ] = "READ_16", [ WRITE_16 ] = "WRITE_16", [ WRITE_VERIFY_16 ] = "WRITE_VERIFY_16", [ SERVICE_ACTION_IN ] = "SERVICE_ACTION_IN", [ REPORT_LUNS ] = "REPORT_LUNS", [ LOAD_UNLOAD ] = "LOAD_UNLOAD", [ SET_CD_SPEED ] = "SET_CD_SPEED", [ BLANK ] = "BLANK", }; if (cmd >= ARRAY_SIZE(names) || names[cmd] == NULL) return "*UNKNOWN*"; return names[cmd]; }
1threat
How can I run commands in a running container in AWS ECS using Fargate : <p>If I am running container in AWS ECS using EC2, then I can access running container and execute any command.</p> <p>ie. <code>docker exec -it &lt;containerid&gt; &lt;command&gt;</code></p> <p>How can I run commands in the running container or access container in AWS ECS using Fargate?</p>
0debug
Amount should be 2 decimal places only, no commas or dollar sign in JS : <p>I need help with this, I have been trying I cannot make it work :</p> <p>Numeric - Decimal Places. Amount should be 2 decimal places only, no commas or dollar sign. So a check totaling $450,000.00 should appear as 450000.00</p>
0debug
Getting Android RecyclerView to update view inside React Native component : <p>I am making a mobile application using React Native and included list components didn't have high enough performance for it so I started using Android's RecyclerView as the list component. There is a problem though with it. The RecyclerView doesn't update its contents views until I scroll or change RecyclerView's size. What could cause this problem and how I can fix it? I have tried notifyDatasetChanged, notifyItemChanged, forceLayout, invalidate, postInvalidate and many different variations with each.</p>
0debug
static void pause_all_vcpus(void) { CPUState *penv = first_cpu; while (penv) { penv->stop = 1; qemu_thread_signal(penv->thread, SIGUSR1); qemu_cpu_kick(penv); penv = (CPUState *)penv->next_cpu; } while (!all_vcpus_paused()) { qemu_cond_timedwait(&qemu_pause_cond, &qemu_global_mutex, 100); penv = first_cpu; while (penv) { qemu_thread_signal(penv->thread, SIGUSR1); penv = (CPUState *)penv->next_cpu; } } }
1threat
why JS for loop doesn't work if i put return keyword? : <p>when i put the <strong>return</strong> keyword like this example:</p> <pre><code>for (let z = 0; z &lt; 5; z++) { return console.log('one'); } //the result is : 'one' </code></pre> <p>but when i remove the <strong>return</strong> keyword like this example:</p> <pre><code>for (let z = 0; z &lt; 5; z++) { console.log('one'); } //the result is : 'one', 'one', 'one', 'one', 'one' </code></pre> <p>the loop works and return <strong><em>five 'one'</em></strong> what's the reason for that ?</p>
0debug
static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt) { MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; AVStream *st = s->streams[pkt->stream_index]; MXFStreamContext *sc = st->priv_data; MXFIndexEntry ie = {0}; int err; if (!mxf->edit_unit_byte_count && !(mxf->edit_units_count % EDIT_UNITS_PER_BODY)) { if ((err = av_reallocp_array(&mxf->index_entries, mxf->edit_units_count + EDIT_UNITS_PER_BODY, sizeof(*mxf->index_entries))) < 0) { mxf->edit_units_count = 0; av_log(s, AV_LOG_ERROR, "could not allocate index entries\n"); return err; if (st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO) { if (!mxf_parse_mpeg2_frame(s, st, pkt, &ie)) { av_log(s, AV_LOG_ERROR, "could not get mpeg2 profile and level\n"); return -1; } else if (st->codec->codec_id == AV_CODEC_ID_DNXHD) { if (!mxf_parse_dnxhd_frame(s, st, pkt)) { av_log(s, AV_LOG_ERROR, "could not get dnxhd profile\n"); return -1; } else if (st->codec->codec_id == AV_CODEC_ID_DVVIDEO) { if (!mxf_parse_dv_frame(s, st, pkt)) { av_log(s, AV_LOG_ERROR, "could not get dv profile\n"); return -1; } else if (st->codec->codec_id == AV_CODEC_ID_H264) { if (!mxf_parse_h264_frame(s, st, pkt, &ie)) { av_log(s, AV_LOG_ERROR, "could not get h264 profile\n"); return -1; if (s->oformat == &ff_mxf_opatom_muxer) return mxf_write_opatom_packet(s, pkt, &ie); if (!mxf->header_written) { if (mxf->edit_unit_byte_count) { if ((err = mxf_write_partition(s, 1, 2, header_open_partition_key, 1)) < 0) return err; mxf_write_klv_fill(s); mxf_write_index_table_segment(s); } else { if ((err = mxf_write_partition(s, 0, 0, header_open_partition_key, 1)) < 0) return err; mxf->header_written = 1; if (st->index == 0) { if (!mxf->edit_unit_byte_count && (!mxf->edit_units_count || mxf->edit_units_count > EDIT_UNITS_PER_BODY) && !(ie.flags & 0x33)) { mxf_write_klv_fill(s); if ((err = mxf_write_partition(s, 1, 2, body_partition_key, 0)) < 0) return err; mxf_write_klv_fill(s); mxf_write_index_table_segment(s); mxf_write_klv_fill(s); mxf_write_system_item(s); if (!mxf->edit_unit_byte_count) { mxf->index_entries[mxf->edit_units_count].offset = mxf->body_offset; mxf->index_entries[mxf->edit_units_count].flags = ie.flags; mxf->index_entries[mxf->edit_units_count].temporal_ref = ie.temporal_ref; mxf->body_offset += KAG_SIZE; mxf->edit_units_count++; } else if (!mxf->edit_unit_byte_count && st->index == 1) { mxf->index_entries[mxf->edit_units_count-1].slice_offset = mxf->body_offset - mxf->index_entries[mxf->edit_units_count-1].offset; mxf_write_klv_fill(s); avio_write(pb, sc->track_essence_element_key, 16); if (s->oformat == &ff_mxf_d10_muxer) { if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) mxf_write_d10_video_packet(s, st, pkt); else mxf_write_d10_audio_packet(s, st, pkt); } else { klv_encode_ber4_length(pb, pkt->size); avio_write(pb, pkt->data, pkt->size); mxf->body_offset += 16+4+pkt->size + klv_fill_size(16+4+pkt->size); avio_flush(pb); return 0;
1threat
What is Getter and Setter in Android : <h1>What is getter and setter in android development.</h1> <p>And what is the use of <strong>@Expose</strong> in GSON.</p> <pre><code>@SerializedName("url") @Expose private String url; </code></pre>
0debug
static int qcow2_check(BlockDriverState *bs, BdrvCheckResult *result) { return qcow2_check_refcounts(bs, result); }
1threat
Disable all breakpoints without current breakpoint in Intellij IDEA : <p>I used Intellij IDEA CE version 2016.3.4 and I have simple question about breakpoints.</p> <p>Is it possible to disable all breakpoints except one (current one) and without editing all other? Maybe there is any "one click" option ?</p> <p>Example:</p> <pre><code>+ means Enabled breakpoint - means Disabled breakpoint (Before) [+] Breakpoint1 [+] Breakpoint2 - current [+] Breakpoint3 [+] Breakpoint4 (After mute/disable all without current) [-] Breakpoint1 [+] Breakpoint2 - current [-] Breakpoint3 [-] Breakpoint4 </code></pre>
0debug
running node.js proccess step by step : i was developer php, i try write code on node.js for pratice some program. i am confuse about node.js when i execute my program, line of code jumpt to next line this is my part code //article.js var article_model = require('../models/article_model'); var comment_model = require('../models/comment_model'); var list_article,list_comment; app.set('views','./views/article/'); app.set('view engine','ejs'); app.get('/list_article',csrfProtection,function(req,res){ master_model.get_article(req,xparams,function(status,result,total_data){ list_article = result.data; }); console.log(list_article); master_model.get_comment(req,xparams,function(status,result,total_data){ list_comment = result.data; }); console.log(list_comment); var params = { title : "Article List", data_article : list_article, }; res.render('content.ejs',params); }); and then //master_model.js exports.get_article = function (req,hash, fn) { var auths = { user : api_server["auth_username"], pass : api_server["auth_password"], } request.get({url:"http://myapi.com/article/latest", auth:auths } , function(err,httpResponse,body) { if (!err && httpResponse.statusCode == 200) { var temp = JSON.parse(body); if (temp.status == 1){ result_data = {status:1, message : temp.message ,data : temp.data}; return fn(true,result_data,1); }else if(temp.status == 0){ result_data ={ status:0, message : temp.message}; return fn(false,result_data,0); } }else{ result_data ={ status:0, message : "error, please try again"}; return fn(false,result_data,0); //something problem to API } }) }; exports.get_comment = function (req,hash, fn) { var auths = { user : api_server["auth_username"], pass : api_server["auth_password"], } request.get({url:"http://myapi.com/comment/latest", auth:auths } , function(err,httpResponse,body) { if (!err && httpResponse.statusCode == 200) { var temp = JSON.parse(body); if (temp.status == 1){ result_data = {status:1, message : temp.message ,data : temp.data}; return fn(true,result_data,1); }else if(temp.status == 0){ result_data ={ status:0, message : temp.message}; return fn(false,result_data,0); } }else{ result_data ={ status:0, message : "error, please try again"}; return fn(false,result_data,0); //something problem to API } }) }; when i run my code, and open browser, output data is blank, when i refresh again my browser show ouput my data (artcile list, and commment list) and i look my console if first run output : { id : 1 title : title 1.. ... .. } undefined if i refresh again my browser, all output complete to show (not show undefined) my question how to my code run process step by step until process end and deliver to views ? any problem with my code? thanks
0debug
php sort array of version strings : <p>I would like to sort an array of version strings in php.</p> <p>Input would be something like this:</p> <pre><code>["2019.1.1.0", "2019.2.3.0", "2019.2.11.0", "2020.1.0.0", "2019.1.3.0", "2019.3.0.0"] </code></pre> <p>What is the easiest way to sort this? Sorting the strings as is does not work, because that would put the "2019.2.11.0" before "2019.2.3.0" and that is of course not what I want.</p> <p>Result should be</p> <pre><code>["2019.1.1.0", "2019.1.3.0", "2019.2.3.0", "2019.2.11.0", "2019.3.0.0", "2020.1.0.0"] </code></pre>
0debug
Python - Adding characters to string : <p>I am trying to make a password generator. I've tried using a for loop to generate each digit. I then appended each digit to a list. However, I want the output to be something along the lines of: </p> <pre><code>54324 </code></pre> <p>rather than:</p> <pre><code>[5, 4, 3, 2, 4] </code></pre> <p>The following is my code:</p> <pre><code> code = '' chars = 5 for i in range(chars): digit = str(randint(0,9)) digit += code </code></pre> <p>What happens in this scenario is that my output is just blank. I am somewhat new to python, so I may be missing something obvious, but I would appreciate if you could explain what I've done wrong and how to fix it.</p>
0debug
How do I break up my vuex file? : <p>I have a vuex file with a growing mass of mutators, but I'm not sure of the correct way of splitting it out into different files.</p> <p>Because I have:</p> <p><code>const store = new Vuex.Store({ vuex stuff })</code> and then below that my main Vue app declaration: <code>const app = new Vue({ stuff })</code></p> <p>I'm happy working with Vue components and have lots of those already, but this is stuff at the top level of the app and I'm not sure how to break it apart. Any advice appreciated.</p>
0debug
NSDictionary EXC_BAD_ACCESS : I have the following code: NSString * client_type = @"client_credentials"; @implementation OauthObject - (NSDictionary*) getParamsCredintion{ return [[NSDictionary alloc] initWithObjectsAndKeys:client_id, @"client_id", client_secret, @"client_secret", client_type, "@client_credentials", nil]; } When i try to init NSDictionary with `client_type` key I get error: `NSDictionary EXC_BAD_ACCESS`
0debug