problem
stringlengths
26
131k
labels
class label
2 classes
Puppeteer wait for all images to load then take screenshot : <p>I am using <a href="https://github.com/GoogleChrome/puppeteer" rel="noreferrer">Puppeteer</a> to try to take a screenshot of a website after all images have loaded but can't get it to work.</p> <p>Here is the code I've got so far, I am using <a href="https://www.digg.com" rel="noreferrer">https://www.digg.com</a> as the example website:</p> <pre><code>const puppeteer = require('puppeteer'); (async () =&gt; { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://www.digg.com/'); await page.setViewport({width: 1640, height: 800}); await page.evaluate(() =&gt; { return Promise.resolve(window.scrollTo(0,document.body.scrollHeight)); }); await page.waitFor(1000); await page.evaluate(() =&gt; { var images = document.querySelectorAll('img'); function preLoad() { var promises = []; function loadImage(img) { return new Promise(function(resolve,reject) { if (img.complete) { resolve(img) } img.onload = function() { resolve(img); }; img.onerror = function(e) { resolve(img); }; }) } for (var i = 0; i &lt; images.length; i++) { promises.push(loadImage(images[i])); } return Promise.all(promises); } return preLoad(); }); await page.screenshot({path: 'digg.png', fullPage: true}); browser.close(); })(); </code></pre>
0debug
How to convert .img to docker image : I am novice at docker. By this [post][1] I made a .img file for docker, but how import it as docker image I don't know... Thanks for your help. [1]: https://forum.volumio.org/volumio2-docker-rpi3-t5849.html
0debug
Use HttpClientFactory from .NET 4.6.2 : <p>I have a .NET 4.6.2 console application (using Simple Injector). I need to make calls to an HTTP service. Having run into issues using HttpClient directly, I'm trying to use HttpClientFactory ( <a href="https://github.com/aspnet/HttpClientFactory" rel="noreferrer">https://github.com/aspnet/HttpClientFactory</a> ) instead.</p> <p>The project/library is .NET Standard 2.0 so it should?? work in .NET 4.6.2, but it uses stuff like IServiceCollection, which is in Core only.</p> <p>So my question is can I use HttpClientFactory in a non-Core application.</p>
0debug
static void test_to_from_buf_1(void) { unsigned niov; struct iovec *iov; size_t sz; unsigned char *ibuf, *obuf; unsigned i, j, n; iov_random(&iov, &niov); sz = iov_size(iov, niov); ibuf = g_malloc(sz + 8) + 4; memcpy(ibuf-4, "aaaa", 4); memcpy(ibuf + sz, "bbbb", 4); obuf = g_malloc(sz + 8) + 4; memcpy(obuf-4, "xxxx", 4); memcpy(obuf + sz, "yyyy", 4); for (i = 0; i < sz; ++i) { ibuf[i] = i & 255; } for (i = 0; i <= sz; ++i) { n = iov_memset(iov, niov, 0, 0xff, -1); g_assert(n == sz); n = iov_from_buf(iov, niov, i, ibuf + i, -1); g_assert(n == sz - i); memset(obuf + i, 0, sz - i); n = iov_to_buf(iov, niov, i, obuf + i, -1); g_assert(n == sz - i); g_assert(memcmp(ibuf, obuf, sz) == 0); n = iov_to_buf(iov, niov, i, obuf + i, 1); g_assert(n == (i < sz)); if (n) { g_assert(obuf[i] == (i & 255)); } for (j = i; j <= sz; ++j) { n = iov_memset(iov, niov, 0, 0xff, -1); g_assert(n == sz); n = iov_from_buf(iov, niov, i, ibuf + i, j - i); g_assert(n == j - i); memset(obuf + i, 0, j - i); n = iov_to_buf(iov, niov, i, obuf + i, j - i); g_assert(n == j - i); g_assert(memcmp(ibuf, obuf, sz) == 0); test_iov_bytes(iov, niov, i, j - i); } } g_assert(!memcmp(ibuf-4, "aaaa", 4) && !memcmp(ibuf+sz, "bbbb", 4)); g_free(ibuf-4); g_assert(!memcmp(obuf-4, "xxxx", 4) && !memcmp(obuf+sz, "yyyy", 4)); g_free(obuf-4); iov_free(iov, niov); }
1threat
How do I validate the DI container in ASP.NET Core? : <p>In my <code>Startup</code> class I use the <code>ConfigureServices(IServiceCollection services)</code> method to set up my service container, using the built-in DI container from <code>Microsoft.Extensions.DependencyInjection</code>.</p> <p>I want to validate the dependency graph in an unit test to check that all of the services can be constructed, so that I can fix any services missing during unit testing instead of having the app crash at runtime. In previous projects I've used Simple Injector, which has a <code>.Verify()</code> method for the container. But I haven't been able to find anything similar for ASP.NET Core.</p> <p><strong>Is there any built-in (or at least recommended) way of verifying that the entire dependency graph can be constructed?</strong></p> <p>(The dumbest way I can think of is something like this, but it will still fail because of the open generics that are injected by the framework itself):</p> <pre><code>startup.ConfigureServices(serviceCollection); var provider = serviceCollection.BuildServiceProvider(); foreach (var serviceDescriptor in serviceCollection) { provider.GetService(serviceDescriptor.ServiceType); } </code></pre>
0debug
App Crashes when button is clicked to load webview : I am very new to android programming and i am trying to develop a small app that basically has four buttons. One of the buttons is suppose to take the user to a login page on a website**(in the android app)** when clicked. I dont know what i am doing wrong but when ever the button (login) is clicked, the app crashes. Below are my codes MAIN ACTIVITY XML <?xml version="1.0" encoding="utf-8"?> <LinearLayout 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" android:background="@drawable/back" android:orientation="vertical" tools:context=".MainActivity"> <Button android:id="@+id/login" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="start" android:layout_margin="0dp" android:alpha="0.6" android:background="@drawable/my_button_bg" android:drawableLeft="@drawable/ic_lock_open_black_24dp" android:drawablePadding="5dp" android:onClick="login" android:padding="15dp" android:paddingLeft="50dp" android:paddingRight="20dp" android:text="@string/text_login" android:textAlignment="textStart" android:textAllCaps="false" android:textColor="@color/colorOrange" android:textSize="20sp" android:textStyle="bold" /> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="0dp" android:layout_gravity="start" android:textStyle="bold" android:textAllCaps="false" android:padding="15dp" android:textSize="20sp" android:textAlignment="textStart" android:text="@string/text_howto" android:id="@+id/howto" android:alpha="0.6" android:drawablePadding="5dp" android:paddingLeft="50dp" android:paddingRight="20dp" android:background="@drawable/my_button_bg" android:textColor="@color/colorOrange" android:drawableLeft="@drawable/ic_live_help_black_24dp" /> </LinearLayout> MAIN ACTIVITY JAVA package com.example.hp.fruitprint; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; public class MainActivity extends AppCompatActivity { private WebView webView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void login(View v) { webView = (WebView)findViewById(R.id.home); WebSettings webSettings = webView.getSettings(); webSettings.setJavaScriptEnabled(true); webView.loadUrl("https://mysitename.com/login"); webView.setWebViewClient(new WebViewClient()); } } APP (ACTIVITY) XML <?xml version="1.0" encoding="utf-8"?> <LinearLayout 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" android:orientation="vertical" tools:context=".MainActivity"> <WebView android:id="@+id/home" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp"/> </LinearLayout> MANIFEST XML <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.hp.fruitprint"> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> I know i am not doing something right but like i said earlier i am very very new to android programming (started three days ago) so any help will be really appreciated. God bless us all. (please also if you find anything at all i am not doing proper in the codes, kindly point it out, thanks)
0debug
void HELPER(set_cp15)(CPUState *env, uint32_t insn, uint32_t val) { int op1; int op2; int crm; op1 = (insn >> 21) & 7; op2 = (insn >> 5) & 7; crm = insn & 0xf; switch ((insn >> 16) & 0xf) { case 0: if (arm_feature(env, ARM_FEATURE_XSCALE)) break; if (arm_feature(env, ARM_FEATURE_OMAPCP)) break; if (arm_feature(env, ARM_FEATURE_V7) && op1 == 2 && crm == 0 && op2 == 0) { env->cp15.c0_cssel = val & 0xf; break; } goto bad_reg; case 1: if (arm_feature(env, ARM_FEATURE_OMAPCP)) op2 = 0; switch (op2) { case 0: if (!arm_feature(env, ARM_FEATURE_XSCALE) || crm == 0) env->cp15.c1_sys = val; tlb_flush(env, 1); break; case 1: if (arm_feature(env, ARM_FEATURE_XSCALE)) { env->cp15.c1_xscaleauxcr = val; break; } break; case 2: if (arm_feature(env, ARM_FEATURE_XSCALE)) goto bad_reg; if (env->cp15.c1_coproc != val) { env->cp15.c1_coproc = val; tb_flush(env); } break; default: goto bad_reg; } break; case 2: if (arm_feature(env, ARM_FEATURE_MPU)) { switch (op2) { case 0: env->cp15.c2_data = val; break; case 1: env->cp15.c2_insn = val; break; default: goto bad_reg; } } else { switch (op2) { case 0: env->cp15.c2_base0 = val; break; case 1: env->cp15.c2_base1 = val; break; case 2: val &= 7; env->cp15.c2_control = val; env->cp15.c2_mask = ~(((uint32_t)0xffffffffu) >> val); env->cp15.c2_base_mask = ~((uint32_t)0x3fffu >> val); break; default: goto bad_reg; } } break; case 3: env->cp15.c3 = val; tlb_flush(env, 1); break; case 4: goto bad_reg; case 5: if (arm_feature(env, ARM_FEATURE_OMAPCP)) op2 = 0; switch (op2) { case 0: if (arm_feature(env, ARM_FEATURE_MPU)) val = extended_mpu_ap_bits(val); env->cp15.c5_data = val; break; case 1: if (arm_feature(env, ARM_FEATURE_MPU)) val = extended_mpu_ap_bits(val); env->cp15.c5_insn = val; break; case 2: if (!arm_feature(env, ARM_FEATURE_MPU)) goto bad_reg; env->cp15.c5_data = val; break; case 3: if (!arm_feature(env, ARM_FEATURE_MPU)) goto bad_reg; env->cp15.c5_insn = val; break; default: goto bad_reg; } break; case 6: if (arm_feature(env, ARM_FEATURE_MPU)) { if (crm >= 8) goto bad_reg; env->cp15.c6_region[crm] = val; } else { if (arm_feature(env, ARM_FEATURE_OMAPCP)) op2 = 0; switch (op2) { case 0: env->cp15.c6_data = val; break; case 1: case 2: env->cp15.c6_insn = val; break; default: goto bad_reg; } } break; case 7: env->cp15.c15_i_max = 0x000; env->cp15.c15_i_min = 0xff0; break; case 8: switch (op2) { case 0: tlb_flush(env, 0); break; case 1: #if 0 val &= 0xfffff000; tlb_flush_page(env, val); tlb_flush_page(env, val + 0x400); tlb_flush_page(env, val + 0x800); tlb_flush_page(env, val + 0xc00); #else tlb_flush(env, 1); #endif break; case 2: tlb_flush(env, val == 0); break; case 3: tlb_flush(env, 1); break; default: goto bad_reg; } break; case 9: if (arm_feature(env, ARM_FEATURE_OMAPCP)) break; switch (crm) { case 0: switch (op1) { case 0: switch (op2) { case 0: env->cp15.c9_data = val; break; case 1: env->cp15.c9_insn = val; break; default: goto bad_reg; } break; case 1: break; default: goto bad_reg; } break; case 1: goto bad_reg; default: goto bad_reg; } break; case 10: break; case 12: goto bad_reg; case 13: switch (op2) { case 0: if (env->cp15.c13_fcse != val) tlb_flush(env, 1); env->cp15.c13_fcse = val; break; case 1: if (env->cp15.c13_context != val && !arm_feature(env, ARM_FEATURE_MPU)) tlb_flush(env, 0); env->cp15.c13_context = val; break; case 2: env->cp15.c13_tls1 = val; break; case 3: env->cp15.c13_tls2 = val; break; case 4: env->cp15.c13_tls3 = val; break; default: goto bad_reg; } break; case 14: goto bad_reg; case 15: if (arm_feature(env, ARM_FEATURE_XSCALE)) { if (op2 == 0 && crm == 1) { if (env->cp15.c15_cpar != (val & 0x3fff)) { tb_flush(env); env->cp15.c15_cpar = val & 0x3fff; } break; } goto bad_reg; } if (arm_feature(env, ARM_FEATURE_OMAPCP)) { switch (crm) { case 0: break; case 1: env->cp15.c15_ticonfig = val & 0xe7; env->cp15.c0_cpuid = (val & (1 << 5)) ? ARM_CPUID_TI915T : ARM_CPUID_TI925T; break; case 2: env->cp15.c15_i_max = val; break; case 3: env->cp15.c15_i_min = val; break; case 4: env->cp15.c15_threadid = val & 0xffff; break; case 8: cpu_interrupt(env, CPU_INTERRUPT_HALT); break; default: goto bad_reg; } } break; } return; bad_reg: cpu_abort(env, "Unimplemented cp15 register write (c%d, c%d, {%d, %d})\n", (insn >> 16) & 0xf, crm, op1, op2); }
1threat
String de Conexao salva em txt : Bom dia, Como faço para o vb.net ler que a string que estou passando esta dentro do arquivo txt? Public Const strConexao As String = "C:\Users\TestFile.txt" Dentro do arquivo txt está a string de conexao com o banco de dados: Data Source=Teste\SQLEXPRESS;Initial Catalog=BDTeste;Integrated Security=True Eu sou novato nisso e não estou conseguindo fazer isso rodar, sei que é duvida de principiante.
0debug
static void host_x86_cpu_initfn(Object *obj) { X86CPU *cpu = X86_CPU(obj); CPUX86State *env = &cpu->env; KVMState *s = kvm_state; cpu->host_features = true; if (kvm_enabled()) { env->cpuid_level = kvm_arch_get_supported_cpuid(s, 0x0, 0, R_EAX); env->cpuid_xlevel = kvm_arch_get_supported_cpuid(s, 0x80000000, 0, R_EAX); env->cpuid_xlevel2 = kvm_arch_get_supported_cpuid(s, 0xC0000000, 0, R_EAX); } object_property_set_bool(OBJECT(cpu), true, "pmu", &error_abort); }
1threat
static void mp_decode_frame_helper(MotionPixelsContext *mp, GetBitContext *gb) { YuvPixel p; int y, y0; for (y = 0; y < mp->avctx->height; ++y) { if (mp->changes_map[y * mp->avctx->width] != 0) { memset(mp->gradient_scale, 1, sizeof(mp->gradient_scale)); p = mp_get_yuv_from_rgb(mp, 0, y); } else { p.y += mp_gradient(mp, 0, mp_get_vlc(mp, gb)); p.y = av_clip(p.y, 0, 31); if ((y & 3) == 0) { p.v += mp_gradient(mp, 1, mp_get_vlc(mp, gb)); p.v = av_clip(p.v, -32, 31); p.u += mp_gradient(mp, 2, mp_get_vlc(mp, gb)); p.u = av_clip(p.u, -32, 31); } mp->vpt[y] = p; mp_set_rgb_from_yuv(mp, 0, y, &p); } } for (y0 = 0; y0 < 2; ++y0) for (y = y0; y < mp->avctx->height; y += 2) mp_decode_line(mp, gb, y); }
1threat
How to write text file in a specific path in android device : I am using visual studio to crate cordova mobile application (Cordova-plugin-file). How to write text file in a specific path in android device, to be able get it from a fixed location.
0debug
Building Python 3.7.1 - SSL module failed : <p>Building Python 3.7 from source runs into following error:</p> <pre><code>Failed to build these modules: _hashlib _ssl Could not build the ssl module! Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host(). LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381 </code></pre> <p>I tried so many workarounds from other stackoverflow-questions, but it doesnt work. I build newest OpenSSL and LibreSSL from source. OpenSSL path is: "/usr/local/ssl" with version OpenSSL 1.0.2p.</p> <pre><code>./configure --with-openssl=/usr/local/ssl/ (./configure CPPFLAGS="-I/usr/local/ssl/include" LDFLAGS="-L/usr/local/ssl/lib") make make altinstall </code></pre> <p>My system: Ubuntu 12.04.5 LTS</p> <p>Any ideas?</p>
0debug
static uint16_t handle_write_event_buf(SCLPEventFacility *ef, EventBufferHeader *event_buf, SCCB *sccb) { uint16_t rc; BusChild *kid; SCLPEvent *event; SCLPEventClass *ec; QTAILQ_FOREACH(kid, &ef->sbus.qbus.children, sibling) { DeviceState *qdev = kid->child; event = (SCLPEvent *) qdev; ec = SCLP_EVENT_GET_CLASS(event); rc = SCLP_RC_INVALID_FUNCTION; if (ec->write_event_data && ec->event_type() == event_buf->type) { rc = ec->write_event_data(event, event_buf); break; } } return rc; }
1threat
static uint64_t mv88w8618_flashcfg_read(void *opaque, target_phys_addr_t offset, unsigned size) { mv88w8618_flashcfg_state *s = opaque; switch (offset) { case MP_FLASHCFG_CFGR0: return s->cfgr0; default: return 0; } }
1threat
How to terminate another appliation using c++/c#/vc++ gracefully? : I have an application running an infinite loop and performing some important functions in that loop. I need to provide the user with another application which would terminate the application with infinite loop. The problem is what if the user terminates the application when it is inside loop performing some operation. It would lead to inconsistent state. I tried kill() and TerminateProcess but they didn't help. Is there any way i could signal the application with infinite loop that complete your iteration and exit? I am open to solutuons in c#,cpp and vc++.
0debug
Please help me with this program : protected void Page_Load(object sender, EventArgs e) { if (DateTime.Now.Hour < 12) { lblGreeting.Text = "Good Morning"; } else if (DateTime.Now.Hour < 17) { lblGreeting.Text = "Good Afternoon"; } else { lblGreeting.Text = "Good Evening"; } } protected void Button1_Click(object sender, EventArgs e) { if (DateTime.Now.Date = TextBox2.Text) { Label2.Text = "Happy Birthday"; } else { Label2.Text = "Have a nice day"; } } It gives me error at the last if condition under button 1 click event shows error that cannot implicitly convert type string to system date and time what changes should be done?
0debug
What database to choose from? : <p>Realm Database or MySQL or MongoDB or the standard Firebase. </p> <p>I am curious why would anyone choose one over another. I am in a group project and one of the members in the group suggested that we should use Realm Database over Firebase. He tried to explain to me the reason but I was not able to comprehend. </p> <p>What has your experience been like? Is one database more user-friendly over another? Firebase seems to have very nice documentation. </p> <p>Which one would you guys suggest?</p>
0debug
Asynchronous classes and its features : <p>Newbie in programming, I am trying to understand <strong>Asynchronous</strong> classes and the benefits. What features can be included in a class that supports such operations? With example too</p>
0debug
static void spapr_memory_unplug_request(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { sPAPRMachineState *spapr = SPAPR_MACHINE(hotplug_dev); Error *local_err = NULL; PCDIMMDevice *dimm = PC_DIMM(dev); PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm); MemoryRegion *mr = ddc->get_memory_region(dimm); uint64_t size = memory_region_size(mr); uint32_t nr_lmbs = size / SPAPR_MEMORY_BLOCK_SIZE; uint64_t addr_start, addr; int i; sPAPRDRConnector *drc; sPAPRDRConnectorClass *drck; sPAPRDIMMState *ds; addr_start = object_property_get_int(OBJECT(dimm), PC_DIMM_ADDR_PROP, &local_err); if (local_err) { goto out; } ds = g_malloc0(sizeof(sPAPRDIMMState)); ds->nr_lmbs = nr_lmbs; ds->dimm = dimm; spapr_pending_dimm_unplugs_add(spapr, ds); addr = addr_start; for (i = 0; i < nr_lmbs; i++) { drc = spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_LMB, addr / SPAPR_MEMORY_BLOCK_SIZE); g_assert(drc); drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); drck->detach(drc, dev, spapr_lmb_release, NULL, errp); addr += SPAPR_MEMORY_BLOCK_SIZE; } drc = spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_LMB, addr_start / SPAPR_MEMORY_BLOCK_SIZE); drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); spapr_hotplug_req_remove_by_count_indexed(SPAPR_DR_CONNECTOR_TYPE_LMB, nr_lmbs, drck->get_index(drc)); out: error_propagate(errp, local_err); }
1threat
Why is this JS synthax error given? : <p>I have this code:</p> <pre><code>var message = "Geachte " + $("#person_name").val() + ",&lt;br/&gt;&lt;br/&gt; U heeft aangegeven diensten van OZMO cloud communications op te willen zeggen. Graag willen wij u verzoeken een “reply” op deze mail te sturen met daarin aangegeven dat u akkoord gaat met deze opzegging en eventuele kosten.&lt;br/&gt;&lt;br/&gt;De opdrachtgever is &lt;?= $row['company_name'] ?&gt; gevestigd aan de &lt;?= $row['company_address'] ?&gt; te &lt;?= $row['company_city'] ?&gt;. Namens de opdrachtgever treedt "+ $("#person_name").val() +" op als bevoegd vertegenwoordiger.&lt;br/&gt;&lt;br/&gt;Te beeindigen OZMO cloud communication BV diensten:&lt;br/&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;Type dienst&lt;/td&gt;&lt;td&gt;Datum beëindiging&lt;/td&gt;&lt;td&gt;Kosten beëindiging&lt;/td&gt;&lt;/tr&gt;"; </code></pre> <p>Now I get this error:</p> <blockquote> <p>Uncaught SyntaxError: Invalid or unexpected token</p> </blockquote> <p>This is the error in my console: <a href="https://i.stack.imgur.com/VVDw3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VVDw3.png" alt="enter image description here"></a></p> <p>What I'm doing wrong?<br/> I always used it this way and worked.</p>
0debug
How to deal with values between methods and constructors : <p>Its rough right now, but I'm stuck because I can't find a way to access either digits (an array of integers (it has to be a private array, per the assignment rules)) or size. Is there a way to access constructor variables in methods within the same class?</p> <p>I'm not sure what to try, as I'm still in the very basic stages (only a lesson or two in Java) and I don't know how to continue.</p> <pre><code>public class Zillion { private int[] digits; String strdigits; public Zillion(int size) { int[] digits = new int[size]; } public String toString() { for(int x=0; x&lt;digits.length; x++) { strdigits += digits[x]; System.out.println(strdigits); } return(strdigits); } public static void main(String[] args) { Zillion z = new Zillion(2); System.out.println(z); // 00 2 points } </code></pre> <p>}</p> <p>Below are my errors; System.out.println(z) is supposed to output 00, but it seems the code gets trapped by a NullPointerException when I try to access digits.length in line 10.</p> <pre><code>Exception in thread "main" java.lang.NullPointerException at lab4_carl6188.Zillion.toString(Zillion.java:10) at java.base/java.lang.String.valueOf(String.java:3042) at java.base/java.io.PrintStream.println(PrintStream.java:897) at lab4_carl6188.Zillion.main(Zillion.java:19) </code></pre>
0debug
VSCode showing only one file in the tab bar (can't open multiple files) : <p>I hit some shortcut and I can't find the setting the turn it off. But opening multiple files doesn't show different tabs.</p> <p>Here's what I'm seeing</p> <p><a href="https://i.stack.imgur.com/7aLOc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7aLOc.png" alt="enter image description here"></a></p> <p>But this is what I'm expecting when I open a new tab</p> <p><a href="https://i.stack.imgur.com/1Y15p.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1Y15p.png" alt="enter image description here"></a></p>
0debug
query = 'SELECT * FROM customers WHERE email = ' + email_input
1threat
Run Angular2 as static app in browser without a server : <p>As I understand the Angular2 concept - it is transpiling TypeScript files to .js files. In principle, it should be possible to compile, package, and then run that Angular2 application as a static application from AWS S3 bucket, GitHub or whatever static source.</p> <p>If I run Angular2 application on node server (with angular-cli "ng serve" command), it takes 500 MB of RAM on server - it's "Heey, common!" - is it really supposed to be that way! What's the benefit of this framework then against React, for example, which needs only a browser.</p> <p>I can't seem to find anything useful on serving Angular2 application as a static compiled HTML+JS.</p> <p>Maybe you can help me understand this, and solve?</p> <p>Thanks a lot!</p> <p>Maris</p>
0debug
assign a unique color to a array number in java : <p>hi guys im new to programming this is my code </p> <pre><code>for (int i = 0; i &lt; V; i++) System.out.print(value[i] +" "); System.out.println(); </code></pre> <p>value of "i" are numbers , instead of printing value of "i" I want to print a unique color for each value for example if this is the value: "1 2 1 1 3" i want to print: "red blue red red green" how can i do this?</p>
0debug
static int check_pkt(AVFormatContext *s, AVPacket *pkt) { MOVMuxContext *mov = s->priv_data; MOVTrack *trk = &mov->tracks[pkt->stream_index]; int64_t ref; uint64_t duration; if (trk->entry) { ref = trk->cluster[trk->entry - 1].dts; } else if ( trk->start_dts != AV_NOPTS_VALUE && !trk->frag_discont) { ref = trk->start_dts + trk->track_duration; } else ref = pkt->dts; duration = pkt->dts - ref; if (pkt->dts < ref || duration >= INT_MAX) { av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" / timestamp: %"PRId64" is out of range for mov/mp4 format\n", duration, pkt->dts ); pkt->dts = ref + 1; pkt->pts = AV_NOPTS_VALUE; if (pkt->duration < 0 || pkt->duration > INT_MAX) { av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is invalid\n", pkt->duration); return AVERROR(EINVAL); return 0;
1threat
static int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out) { char *pix_fmts; AVCodecContext *codec = ofilter->ost->st->codec; AVFilterContext *last_filter = out->filter_ctx; int pad_idx = out->pad_idx; int ret; AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc(); #if FF_API_OLD_VSINK_API ret = avfilter_graph_create_filter(&ofilter->filter, avfilter_get_by_name("buffersink"), "out", NULL, NULL, fg->graph); #else ret = avfilter_graph_create_filter(&ofilter->filter, avfilter_get_by_name("buffersink"), "out", NULL, buffersink_params, fg->graph); #endif av_freep(&buffersink_params); if (ret < 0) return ret; if (codec->width || codec->height) { char args[255]; AVFilterContext *filter; snprintf(args, sizeof(args), "%d:%d:flags=0x%X", codec->width, codec->height, (unsigned)ofilter->ost->sws_flags); if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"), NULL, args, NULL, fg->graph)) < 0) return ret; if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0) return ret; last_filter = filter; pad_idx = 0; } if ((pix_fmts = choose_pixel_fmts(ofilter->ost))) { AVFilterContext *filter; if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("format"), "format", pix_fmts, NULL, fg->graph)) < 0) return ret; if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0) return ret; last_filter = filter; pad_idx = 0; av_freep(&pix_fmts); } if ((ret = avfilter_link(last_filter, pad_idx, ofilter->filter, 0)) < 0) return ret; return 0; }
1threat
PHP How To Create new Url for New Post : <p>I would like to know how to create a new url for each file upload. When people upload videos on the site, I would like the video to have its own url like this: "localhost/example.com/string". For example, Youtube has a new url for each upload like this "<a href="https://www.youtube.com/watch?v=209fsloiwifo" rel="nofollow noreferrer">https://www.youtube.com/watch?v=209fsloiwifo</a>" Is there a way for me to create a new url for each new post in php?</p>
0debug
Need Python Help.. I am very new to python : ******* <br> PYTHON guruz Please Help! I am writing a program to get an output for a user input .. User inputs IP address.. I need to display a specific part of the above line. <br> <br> THANKS IN ADVANCE <br><br> ********/ Got this file /******** <br> mot physical /ABC-RD0.CLD/CPQSCWSSF001f1-V.80 { <br> poolcoin /ABC-RD0.CLD/123.45.67.890:88 <br> ip-protocol tcp <br> mask 255.255.255.255 <br> /Common/source_addr { <br> default yes <br> mot physical /ABC-RD0.CLD/CPQSCWSSF001f1-V.80 { <br> profiles { <br> /Common/http { } <br> /Common/webserver-tcp-lan-optimized { <br> context serverside <br> } <br> mot physical /ABC-RD0.CLD/BBQSCPQZ001f1-V.80 { <br> poolcoin /ABC-RD0.CLD/123.45.67.890:88 <br> ip-protocol tcp <br> mask 255.255.255.255 <br> ********/ Want the below output for user input /******** <br> User inputs the IP and output should be: <br> <br> user input: 123.45.67.890<br> output: CPQSCWSSF001f1 <---------------------------- <br><br> user input: 123.45.67.890 <br> output: BBQSCPQZ001f1 <---------------------------- <br> <br> ********/ This is what i have tried /******** <br> #!/usr/bin/env python <br> <br> import re <br> <br ip = raw_input("Please enter your IP: ") <br> with open("test.txt") as open file: <br> for line in open file: <br> for part in line.split(): <br> if ip in part: <br> print part -1 <br>
0debug
av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx) { const int high_bit_depth = avctx->bits_per_raw_sample > 8; if (avctx->bits_per_raw_sample <= 8 && (avctx->idct_algo == FF_IDCT_AUTO || avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) { c->idct_put = ff_simple_idct_put_armv6; c->idct_add = ff_simple_idct_add_armv6; c->idct = ff_simple_idct_armv6; c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM; } if (!high_bit_depth) { c->put_pixels_tab[0][0] = ff_put_pixels16_armv6; c->put_pixels_tab[0][1] = ff_put_pixels16_x2_armv6; c->put_pixels_tab[0][2] = ff_put_pixels16_y2_armv6; c->put_pixels_tab[1][0] = ff_put_pixels8_armv6; c->put_pixels_tab[1][1] = ff_put_pixels8_x2_armv6; c->put_pixels_tab[1][2] = ff_put_pixels8_y2_armv6; c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_armv6; c->put_no_rnd_pixels_tab[0][1] = ff_put_pixels16_x2_no_rnd_armv6; c->put_no_rnd_pixels_tab[0][2] = ff_put_pixels16_y2_no_rnd_armv6; c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_armv6; c->put_no_rnd_pixels_tab[1][1] = ff_put_pixels8_x2_no_rnd_armv6; c->put_no_rnd_pixels_tab[1][2] = ff_put_pixels8_y2_no_rnd_armv6; c->avg_pixels_tab[0][0] = ff_avg_pixels16_armv6; c->avg_pixels_tab[1][0] = ff_avg_pixels8_armv6; } if (!high_bit_depth) c->get_pixels = ff_get_pixels_armv6; c->add_pixels_clamped = ff_add_pixels_clamped_armv6; c->diff_pixels = ff_diff_pixels_armv6; c->pix_abs[0][0] = ff_pix_abs16_armv6; c->pix_abs[0][1] = ff_pix_abs16_x2_armv6; c->pix_abs[0][2] = ff_pix_abs16_y2_armv6; c->pix_abs[1][0] = ff_pix_abs8_armv6; c->sad[0] = ff_pix_abs16_armv6; c->sad[1] = ff_pix_abs8_armv6; c->sse[0] = ff_sse16_armv6; c->pix_norm1 = ff_pix_norm1_armv6; c->pix_sum = ff_pix_sum_armv6; }
1threat
static void calc_sums(int pmin, int pmax, uint32_t *data, int n, int pred_order, uint32_t sums[][MAX_PARTITIONS]) { int i, j; int parts; uint32_t *res, *res_end; parts = (1 << pmax); res = &data[pred_order]; res_end = &data[n >> pmax]; for (i = 0; i < parts; i++) { uint32_t sum = 0; while (res < res_end) sum += *(res++); sums[pmax][i] = sum; res_end += n >> pmax; } for (i = pmax - 1; i >= pmin; i--) { parts = (1 << i); for (j = 0; j < parts; j++) sums[i][j] = sums[i+1][2*j] + sums[i+1][2*j+1]; } }
1threat
IOS11 UIContextualAction Place the image color text : <p>To prevent the picture How to restore the real color I now place the image are white</p> <pre><code>- (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath API_AVAILABLE(ios(11.0)) { UIContextualAction *deleteRowAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleNormal title:nil handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) { NSLog(@"------------------&gt;%@",sourceView); completionHandler (YES); }]; deleteRowAction.image = [UIImage imageNamed:@"heart"]; UISwipeActionsConfiguration *config = [UISwipeActionsConfiguration configurationWithActions:@[deleteRowAction]]; return config; return nil; } </code></pre>
0debug
static void gen_cp0 (CPUMIPSState *env, DisasContext *ctx, uint32_t opc, int rt, int rd) { const char *opn = "ldst"; switch (opc) { case OPC_MFC0: if (rt == 0) { return; } gen_mfc0(env, ctx, cpu_gpr[rt], rd, ctx->opcode & 0x7); opn = "mfc0"; break; case OPC_MTC0: { TCGv t0 = tcg_temp_new(); gen_load_gpr(t0, rt); gen_mtc0(env, ctx, t0, rd, ctx->opcode & 0x7); tcg_temp_free(t0); } opn = "mtc0"; break; #if defined(TARGET_MIPS64) case OPC_DMFC0: check_insn(env, ctx, ISA_MIPS3); if (rt == 0) { return; } gen_dmfc0(env, ctx, cpu_gpr[rt], rd, ctx->opcode & 0x7); opn = "dmfc0"; break; case OPC_DMTC0: check_insn(env, ctx, ISA_MIPS3); { TCGv t0 = tcg_temp_new(); gen_load_gpr(t0, rt); gen_dmtc0(env, ctx, t0, rd, ctx->opcode & 0x7); tcg_temp_free(t0); } opn = "dmtc0"; break; #endif case OPC_MFTR: check_insn(env, ctx, ASE_MT); if (rd == 0) { return; } gen_mftr(env, ctx, rt, rd, (ctx->opcode >> 5) & 1, ctx->opcode & 0x7, (ctx->opcode >> 4) & 1); opn = "mftr"; break; case OPC_MTTR: check_insn(env, ctx, ASE_MT); gen_mttr(env, ctx, rd, rt, (ctx->opcode >> 5) & 1, ctx->opcode & 0x7, (ctx->opcode >> 4) & 1); opn = "mttr"; break; case OPC_TLBWI: opn = "tlbwi"; if (!env->tlb->helper_tlbwi) goto die; gen_helper_tlbwi(); break; case OPC_TLBWR: opn = "tlbwr"; if (!env->tlb->helper_tlbwr) goto die; gen_helper_tlbwr(); break; case OPC_TLBP: opn = "tlbp"; if (!env->tlb->helper_tlbp) goto die; gen_helper_tlbp(); break; case OPC_TLBR: opn = "tlbr"; if (!env->tlb->helper_tlbr) goto die; gen_helper_tlbr(); break; case OPC_ERET: opn = "eret"; check_insn(env, ctx, ISA_MIPS2); gen_helper_eret(); ctx->bstate = BS_EXCP; break; case OPC_DERET: opn = "deret"; check_insn(env, ctx, ISA_MIPS32); if (!(ctx->hflags & MIPS_HFLAG_DM)) { MIPS_INVAL(opn); generate_exception(ctx, EXCP_RI); } else { gen_helper_deret(); ctx->bstate = BS_EXCP; } break; case OPC_WAIT: opn = "wait"; check_insn(env, ctx, ISA_MIPS3 | ISA_MIPS32); ctx->pc += 4; save_cpu_state(ctx, 1); ctx->pc -= 4; gen_helper_wait(); ctx->bstate = BS_EXCP; break; default: die: MIPS_INVAL(opn); generate_exception(ctx, EXCP_RI); return; } (void)opn; MIPS_DEBUG("%s %s %d", opn, regnames[rt], rd); }
1threat
void virtio_submit_multiwrite(BlockDriverState *bs, MultiReqBuffer *mrb) { int i, ret; if (!mrb->num_writes) { return; } ret = bdrv_aio_multiwrite(bs, mrb->blkreq, mrb->num_writes); if (ret != 0) { for (i = 0; i < mrb->num_writes; i++) { if (mrb->blkreq[i].error) { virtio_blk_rw_complete(mrb->blkreq[i].opaque, -EIO); } } } mrb->num_writes = 0; }
1threat
How to remove <p> </p> tag from Starting string : I have a string as follows <p>Message Pilcrow</p><p>Testing....</p><br/><p>testing in progress...</p>" i need below string as result Message Pilcrow<p>Testing....</p><br/><p>testing in progress...</p>
0debug
I want create this Sliding UIVies in xocde using swift, what sholud i used ? an collecntionView or TableView ? how to use it? : i want to create an exact screen in my ios application im not able to create it , what shall i used? an collectionView? or ScroolView? import UIKit class ViewController: UIViewController,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout{ @IBOutlet weak var newCollectionView: UICollectionView! override func viewDidLoad() { super.viewDidLoad() newCollectionView.delegate = self newCollectionView.dataSource = self // Do any additional setup after loading the view, typically from a nib. } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return 4 } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) return cell } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { return CGSize(width: view.frame.width, height: view.frame.height) } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { return 0 } }[enter image description here][1] [1]: https://i.stack.imgur.com/mHhxv.gif
0debug
C++ Avoid passing variable to std::cout if variable is zero : Suppose I have a variable, `double x`, as a result of some calculations, which can have any value, including zero, and I need it passed to `std::cout`. How can I avoid printing `x` if its value is zero? As an example, this will print `1+<value_of_x>` if `x`, else just `1`: `std::cout << (x ? "1+" : "1") << x << '\n';` Is there a way to make the same but for `x`? Something like the following nonsense: `std::cout << (x ? ("1+" << x) : "1") << '\n';` I should probably add that I am not advanced in C++.
0debug
static int vp3_decode_end(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; int i; av_free(s->superblock_coding); av_free(s->all_fragments); av_free(s->coeffs); av_free(s->coded_fragment_list); av_free(s->superblock_fragments); av_free(s->superblock_macroblocks); av_free(s->macroblock_fragments); av_free(s->macroblock_coding); if (s->golden_frame.data[0] && s->golden_frame.data[0] != s->last_frame.data[0]) avctx->release_buffer(avctx, &s->golden_frame); if (s->last_frame.data[0]) avctx->release_buffer(avctx, &s->last_frame); return 0;
1threat
static int stdio_fclose(void *opaque) { QEMUFileStdio *s = opaque; int ret = 0; if (s->file->ops->put_buffer || s->file->ops->writev_buffer) { int fd = fileno(s->stdio_file); struct stat st; ret = fstat(fd, &st); if (ret == 0 && S_ISREG(st.st_mode)) { ret = fsync(fd); if (ret != 0) { ret = -errno; return ret; } } } if (fclose(s->stdio_file) == EOF) { ret = -errno; } g_free(s); return ret; }
1threat
Why can't I add a new bank account for my App Store Connect? : <p>I'm trying to replace the bank account info for my App Store Connect. However when I go to the <strong>Agreements, Tax and Banking section</strong>, I can only view and do some minor changes to my existing bank account info but there's no way to add a new bank account. I can confirm my Apple ID is an agent with Admin and Legal roles. </p> <p><a href="https://i.stack.imgur.com/X6bqf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/X6bqf.png" alt="Agreement, Tax and Banking page"></a></p> <p>May I know where do I actually add a new bank account?</p>
0debug
i need help to download image to tableview from firebase with my database : class ArtistModel { var id: String? var name: String? var genre: String? var img: String? init(id: String?, name: String?, genre: String?, img: String?){ self.id = id self.name = name self.genre = genre self.img = img } } and this my tableviewCell class addArtistTableViewCell: UITableViewCell { @IBOutlet weak var lblName: UILabel! @IBOutlet weak var lblGenre: UILabel! @IBOutlet weak var img: UIImageView! and this my viewController import UIKit import Firebase import FirebaseDatabase class addArtistViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { var refArtists: FIRDatabaseReference! @IBOutlet weak var textFieldName: UITextField! @IBOutlet weak var textFieldGenre: UITextField! @IBOutlet weak var img: UIImageView! @IBOutlet weak var labelMessage: UILabel! @IBOutlet weak var tableViewArtists: UITableView! //list to store all the artist var artistList = [ArtistModel]() func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { //getting the selected artist let artist = artistList[indexPath.row] //building an alert let alertController = UIAlertController(title: artist.name, message: "Give new values to update ", preferredStyle: .alert) //the confirm action taking the inputs let confirmAction = UIAlertAction(title: "Enter", style: .default) { (_) in //getting artist id let id = artist.id //getting new values let name = alertController.textFields?[0].text let genre = alertController.textFields?[1].text //calling the update method to update artist self.updateArtist(id: id!, name: name!, genre: genre!) } //the cancel action doing nothing let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (_) in } //adding two textfields to alert alertController.addTextField { (textField) in textField.text = artist.name } alertController.addTextField { (textField) in textField.text = artist.genre } //adding action alertController.addAction(confirmAction) alertController.addAction(cancelAction) //presenting dialog present(alertController, animated: true, completion: nil) } public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int{ return artistList.count } public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{ //creating a cell using the custom class let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! addArtistTableViewCell //the artist object let artist: ArtistModel //getting the artist of selected position artist = artistList[indexPath.row] //adding values to labels cell.lblName.text = artist.name cell.lblGenre.text = artist.genre //returning cell return cell } @IBAction func buttonAddArtist(_ sender: UIButton) { addArtist() } override func viewDidLoad() { super.viewDidLoad() //getting a reference to the node artists refArtists = FIRDatabase.database().reference().child("artists") //observing the data changes refArtists.observe(FIRDataEventType.value, with: { (snapshot) in //if the reference have some values if snapshot.childrenCount > 0 { //clearing the list self.artistList.removeAll() //iterating through all the values for artists in snapshot.children.allObjects as! [FIRDataSnapshot] { //getting values let artistObject = artists.value as? [String: AnyObject] let artistName = artistObject?["artistName"] let artistId = artistObject?["id"] let artistGenre = artistObject?["artistGenre"] let artistImg = artistObject?["artistImg"] //creating artist object with model and fetched values let artist = ArtistModel(id: artistId as! String?, name: artistName as! String?, genre: artistGenre as! String?, img: artistImg as! String?) //appending it to list self.artistList.append(artist) } //reloading the tableview self.tableViewArtists.reloadData() } }) } func addArtist(){ //generating a new key inside artists node //and also getting the generated key let key = refArtists.childByAutoId().key //creating artist with the given values let artist = ["id":key, "artistName": textFieldName.text! as String, "artistGenre": textFieldGenre.text! as String, ] //as [String : Any] //adding the artist inside the generated unique key refArtists.child(key).setValue(artist) //displaying message labelMessage.text = "Artist Added" } func updateArtist(id:String, name:String, genre:String){ //creating artist with the new given values let artist = ["id":id, "artistName": name, "artistGenre": genre ] //updating the artist using the key of the artist refArtists.child(id).setValue(artist) //displaying message labelMessage.text = "Artist Updated" }
0debug
How can I diff two branches in GitHub? : <p>I am just wondering if there is a way to simply diff two branches in GitHub? I know GitHub has capacity to do it because when we do code-reviews it does list out all the diffs nicely. I was just wondering if there is a way to do it without any code review to compare say Branch to Branch or Commit to Commit? So that when I push something to my remote branch and I want to see how my diffs are going to look like BEFORE it create a PR then it can be very helpful.</p> <p>I can always be in console and do git diff but that is really not as nice and visually clear as how it shows up in web UI of GitHub. Any ideas?</p>
0debug
static void qdev_print(Monitor *mon, DeviceState *dev, int indent) { BusState *child; qdev_printf("dev: %s, id \"%s\"\n", dev->info->name, dev->id ? dev->id : ""); indent += 2; if (dev->num_gpio_in) { qdev_printf("gpio-in %d\n", dev->num_gpio_in); } if (dev->num_gpio_out) { qdev_printf("gpio-out %d\n", dev->num_gpio_out); } qdev_print_props(mon, dev, dev->info->props, "dev", indent); qdev_print_props(mon, dev, dev->parent_bus->info->props, "bus", indent); if (dev->parent_bus->info->print_dev) dev->parent_bus->info->print_dev(mon, dev, indent); LIST_FOREACH(child, &dev->child_bus, sibling) { qbus_print(mon, child, indent); } }
1threat
static void spr_write_403_pbr (void *opaque, int sprn) { DisasContext *ctx = opaque; gen_op_store_403_pb(sprn - SPR_403_PBL1); RET_STOP(ctx); }
1threat
email and mobilenumber validation same textbox html5 with button : i want to validate both email,mobile number using single textbox. i tried in many ways but not working. i want to validate either it is javascript,html5,jquery,angularjs is not a problem. please help me to solve this problem. thanks in advancehttp://jsfiddle.net/ANxmv/3582/ Link: http://jsfiddle.net/ANxmv/3582/
0debug
Is there a way to export a BigQuery table's schema as JSON? : <p>A BigQuery <a href="https://cloud.google.com/bigquery/docs/tables" rel="noreferrer">table</a> has schema which can be viewed in the web UI, <a href="https://cloud.google.com/bigquery/docs/tables#updateschema" rel="noreferrer">updated</a>, or used to <a href="https://cloud.google.com/bigquery/loading-data" rel="noreferrer">load data</a> with the <code>bq</code> tool as a JSON file. However, I can't find a way to dump this schema from an existing table to a JSON file (preferably from the command-line). Is that possible?</p>
0debug
check alpha numeric password in php using js : I am using to js to check if the password is alphanumeric, below is the code, not sure why but it is not throwing the alert when password is not alphanumeric.Please note I am using php version 5. if (!input_string.match(/^[0-9a-z]+$/)) { alert("please enter alpha numeric password") }
0debug
Mailgun Domain not found: abc.com : <p>I am trying to setup emails with my own website. Let's say the domain name is <code>abc.com</code>.</p> <p>The nameserver in use is digital ocean and I also have a gmail account linked to the same (say using <code>contact@abc.com</code>).</p> <p>While setting up things with mailgun, I used <code>mg.abc.com</code> (as they said it would also let me email using the root domain). The verification step is done and I can send email using <code>contact@mg.abc.com</code>.</p> <p>However, trying to use the root domain (<code>contact@abc.com</code>) gives the following error:</p> <pre><code>AnymailRequestsAPIError: Sending a message to me@gmail.com from contact@abc.com ESP API response 404: { "message": "Domain not found: abc.com" } </code></pre> <p>How do I resolve this issue?</p>
0debug
Creating a application in a website : <p>If I wanted to create a small program, perhaps a calculator or something, what language would I use, and how would I implement it?</p> <p>Very new to coding, especially with websites so sorry if it's a dumb question. </p>
0debug
Can not run service on Windows - Visual Studio 2015 : When I start "F5" in a project in Visual Studio 2015, the program show me the message: "Can not you start the service from the command line or in the debugger. The windows service must be installed 's First (using installutil.exe ) and then started with ServerExplorer , the administrative tool for Windows Services or the NET START command" How can I resolve these?
0debug
C++ : "undefined reference to" probably beacause of CMake files : I would like to test my Socket class with gtest but I get this error: "undefined reference to` Server :: Socket :: Socket (int, int, int) " and:" (.text $ _ZN11SocketTestsC2Ev [_ZN11SocketTestsC2Ev] + 0x49) : relocation truncated to fit: R_X86_64_PC32 against undefined symbol `Server :: Socket :: Socket (int, int, int) 'I can not fix. I think the problem has to come from one of my CMake files. Here is the architecture of the project: +-- CMakeLists.txt +-- Serveur | +-- CMakeLists.txt | +-- Serveur.cpp | +-- Serveur.h | +-- Socket.cpp | +-- Socket.h | +-- Tests | +-- CMakeLists.txt | +-- main.cpp | +-- lib | +-- ServeurTests | +-- SocketTests.cpp The different files : ./ CMakeLists.txt : cmake_minimum_required(VERSION 3.10) project(ServeurCheckIn) set(CMAKE_CXX_STANDARD 14) add_subdirectory(Serveur) add_subdirectory(Tests) Serveur/CMakeLists.txt: cmake_minimum_required(VERSION 3.10) project(ServeurCheckIn) set(CMAKE_CXX_STANDARD 14) add_library(ServeurCheckIn SHARED Serveur.cpp Serveur.h Socket.cpp Socket.h) Serveur/Socket.h : #include <sys/socket.h> #include <netinet/in.h> namespace Serveur { class Socket { public: Socket(int domaine, int type, int protocole); int Domaine(); int Type(); int Protocole(); private: int _domaine; int _type; int _protocole; }; } Serveur/Socket.cpp: #include "Socket.h" using namespace Serveur; Socket::Socket(int domaine, int type, int protocole) : _domaine(domaine), _type(type), _protocole(protocole) { } int Socket::Domaine() { return _domaine; } int Socket::Type() { return _type; } int Socket::Protocole() { return _protocole; } Tests/CMakeLists.txt: cmake_minimum_required(VERSION 3.10) project(Tests) set(CMAKE_CXX_STANDARD 14) add_subdirectory(lib/googletest-master) include_directories(lib/googletest-master/googletest/include) include_directories(lib/googletest-master/googlemock/include) add_executable(Tests main.cpp ServeurTests/SocketTests.cpp ) target_link_libraries(Tests gtest gtest_main) enable_testing() Tests/SocketTests.cpp: #include <gtest/gtest.h> #include "../../Serveur/Serveur.h" using namespace Serveur; class SocketTests : public testing::Test { public: SocketTests() : _socket(AF_INET, SOCK_RAW, IPPROTO_IP) { } protected: Socket _socket; }; TEST_F(SocketTests, CreateSocket_SocketIsCreated) { ASSERT_EQ(1, 1); } I thank you in advance for your answers :)
0debug
TEXT AREA EDITOR WITHOUT PLUGINS : I CREATED A TEXTAREA EDITOR WITHOUT USING ANY PLUGINS . WITH A ONLY FIELDS OF FONT-FAMILY,fONT-SIZE AND fONT-COLOR IT WORKING FINE BUT THE THING IS WHAT ARE ALL THE EFFECTS I CHANGE IF IF CLICK SUBMIT IT SHOULD SHAVE IN DATABASE LIKE <p style="text-align: center;"><strong>Chethan K</strong></p> LIKE THIS BUT THIS IS NOT HAPPENING PLEASE HELP ME OUT
0debug
How do I add both a variable and a string into the same print statement? : <p>I'm trying to write a basic Python RPG for my friend, and I'm trying to make a stat generator. From what I learned in classes, I'm supposed to <code>print('Your ability score in this is ' + var1 + '.')</code></p> <p>Here's the entire code block where I'm getting the error.</p> <pre><code>Your elemental attack is '''+ elematk + '''.''') </code></pre> <p>And the error I'm getting is</p> <pre><code> File "/Users/data censored/Desktop/Basic RPG.py", line 24, in &lt;module&gt; Your elemental attack is '''+ elematk + '''.''') TypeError: can only concatenate str (not "int") to str </code></pre> <p>Maybe I'm just bad at this. I looked at another answer saying that commas separate a string and a var, but that didn't work either.</p>
0debug
Different behavior between String.value0f and Character.toString in Java : <p>In the following example, this program snippet does not compile, but if we replace the method <code>Character.toString(char)</code> by <code>String.valueOf(char)</code>, everything is fine. What is the issue why Character.toString here ? In the documentation, these methods seem to have the same behavior. Thanks for explanation.</p> <pre><code> public static void main (String args[]) { String source = "19/03/2016 16:34"; String result = Character.toString(source.substring(1,3)); System.out.print(result); } </code></pre>
0debug
static int vhost_virtqueue_start(struct vhost_dev *dev, struct VirtIODevice *vdev, struct vhost_virtqueue *vq, unsigned idx) { hwaddr s, l, a; int r; int vhost_vq_index = idx - dev->vq_index; struct vhost_vring_file file = { .index = vhost_vq_index }; struct vhost_vring_state state = { .index = vhost_vq_index }; struct VirtQueue *vvq = virtio_get_queue(vdev, idx); assert(idx >= dev->vq_index && idx < dev->vq_index + dev->nvqs); vq->num = state.num = virtio_queue_get_num(vdev, idx); r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_NUM, &state); if (r) { return -errno; } state.num = virtio_queue_get_last_avail_idx(vdev, idx); r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_BASE, &state); if (r) { return -errno; } if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1) && virtio_legacy_is_cross_endian(vdev)) { r = vhost_virtqueue_set_vring_endian_legacy(dev, virtio_is_big_endian(vdev), vhost_vq_index); if (r) { return -errno; } } s = l = virtio_queue_get_desc_size(vdev, idx); a = virtio_queue_get_desc_addr(vdev, idx); vq->desc = cpu_physical_memory_map(a, &l, 0); if (!vq->desc || l != s) { r = -ENOMEM; goto fail_alloc_desc; } s = l = virtio_queue_get_avail_size(vdev, idx); a = virtio_queue_get_avail_addr(vdev, idx); vq->avail = cpu_physical_memory_map(a, &l, 0); if (!vq->avail || l != s) { r = -ENOMEM; goto fail_alloc_avail; } vq->used_size = s = l = virtio_queue_get_used_size(vdev, idx); vq->used_phys = a = virtio_queue_get_used_addr(vdev, idx); vq->used = cpu_physical_memory_map(a, &l, 1); if (!vq->used || l != s) { r = -ENOMEM; goto fail_alloc_used; } vq->ring_size = s = l = virtio_queue_get_ring_size(vdev, idx); vq->ring_phys = a = virtio_queue_get_ring_addr(vdev, idx); vq->ring = cpu_physical_memory_map(a, &l, 1); if (!vq->ring || l != s) { r = -ENOMEM; goto fail_alloc_ring; } r = vhost_virtqueue_set_addr(dev, vq, vhost_vq_index, dev->log_enabled); if (r < 0) { r = -errno; goto fail_alloc; } file.fd = event_notifier_get_fd(virtio_queue_get_host_notifier(vvq)); r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_KICK, &file); if (r) { r = -errno; goto fail_kick; } event_notifier_test_and_clear(&vq->masked_notifier); return 0; fail_kick: fail_alloc: cpu_physical_memory_unmap(vq->ring, virtio_queue_get_ring_size(vdev, idx), 0, 0); fail_alloc_ring: cpu_physical_memory_unmap(vq->used, virtio_queue_get_used_size(vdev, idx), 0, 0); fail_alloc_used: cpu_physical_memory_unmap(vq->avail, virtio_queue_get_avail_size(vdev, idx), 0, 0); fail_alloc_avail: cpu_physical_memory_unmap(vq->desc, virtio_queue_get_desc_size(vdev, idx), 0, 0); fail_alloc_desc: return r; }
1threat
Active Directory concurrent password policies : <p>I have an interesting problem for you.</p> <p>Do you know of any method to set 2 concurrent password policies in AD ?</p> <p>Here is the idea :</p> <ul> <li>Policy 1 : if password length between 8 and 14 char --> impose complexity rule</li> <li>Policy 2 : if password length greater than 14 char --> no complexity rule</li> </ul> <p>As far as I know, by default, Windows will execute the policies sequentially. Meaning, by default, Windows will override the first policy with the second, which is not what I'm looking for.</p> <p>Thanks in advance for your comments.</p>
0debug
this line is not working update quer is not workind : $q = mysql_query("UPDATE `payment_details` SET `txnid`='{$txnid}',`amount`='{$amount}', `email`='{$email}',`firstname`='{$firstname}',`phone`='{$phone}',`productinfo`='{$productinfo}' WHERE `id`='{$id}' ") OR die(mysql_error());
0debug
Display Who Follows You on Instagram : <p>I am trying to create a simple script that displays who a user follows and if that person follows them back or not. Is there a way to fetch this information with Instagram API?</p>
0debug
Calling default method in interface when having conflict with private method : <p>Consider below class hierarchy.</p> <pre><code>class ClassA { private void hello() { System.out.println("Hello from A"); } } interface Myinterface { default void hello() { System.out.println("Hello from Interface"); } } class ClassB extends ClassA implements Myinterface { } public class Test { public static void main(String[] args) { ClassB b = new ClassB(); b.hello(); } } </code></pre> <p>Running the program will give following error :</p> <pre><code>Exception in thread "main" java.lang.IllegalAccessError: tried to access method com.testing.ClassA.hello()V from class com.testing.Test at com.testing.Test.main(Test.java:23) </code></pre> <ol> <li>This is all because I marked ClassA.hello as private.</li> <li>If I mark ClassA.hello as protected or remove the visibility modifier(i.e. making it default scope), then it shows a compiler error as : <code>The inherited method ClassA.hello() cannot hide the public abstract method in Myinterface</code></li> </ol> <p>However, as per exception stacktrace above, <strong>I get a runtime IllegalAccessError.</strong></p> <p>I couldn't get why this is not detected at compile time. Any clues ?</p>
0debug
Backgroundimage in css : how to put **backgound image** with help of **css**. When image file is stored locally on desktop and css file and image are in same folder. \Desktop\New folder\image :- image destination \Desktop\New folder\css :- css file destination
0debug
How to put "" inside a string in JavaScript? : <p>I need to put the following line <code>count_scalar(container_memory_usage_bytes{image!=""} &gt; 0)</code> inside a string so I did <code>"count_scalar(container_memory_usage_bytes{image!=""} &gt; 0)"</code> but it seems not work because there are <code>""</code> inside <code>"..."</code></p> <p>So how can I correct this line ?</p>
0debug
static void xhci_xfer_report(XHCITransfer *xfer) { uint32_t edtla = 0; unsigned int left; bool reported = 0; bool shortpkt = 0; XHCIEvent event = {ER_TRANSFER, CC_SUCCESS}; XHCIState *xhci = xfer->xhci; int i; left = xfer->packet.actual_length; for (i = 0; i < xfer->trb_count; i++) { XHCITRB *trb = &xfer->trbs[i]; unsigned int chunk = 0; switch (TRB_TYPE(*trb)) { case TR_DATA: case TR_NORMAL: case TR_ISOCH: chunk = trb->status & 0x1ffff; if (chunk > left) { chunk = left; if (xfer->status == CC_SUCCESS) { shortpkt = 1; } } left -= chunk; edtla += chunk; break; case TR_STATUS: reported = 0; shortpkt = 0; break; } if (!reported && ((trb->control & TRB_TR_IOC) || (shortpkt && (trb->control & TRB_TR_ISP)) || (xfer->status != CC_SUCCESS && left == 0))) { event.slotid = xfer->slotid; event.epid = xfer->epid; event.length = (trb->status & 0x1ffff) - chunk; event.flags = 0; event.ptr = trb->addr; if (xfer->status == CC_SUCCESS) { event.ccode = shortpkt ? CC_SHORT_PACKET : CC_SUCCESS; } else { event.ccode = xfer->status; } if (TRB_TYPE(*trb) == TR_EVDATA) { event.ptr = trb->parameter; event.flags |= TRB_EV_ED; event.length = edtla & 0xffffff; DPRINTF("xhci_xfer_data: EDTLA=%d\n", event.length); edtla = 0; } xhci_event(xhci, &event, TRB_INTR(*trb)); reported = 1; if (xfer->status != CC_SUCCESS) { return; } } } }
1threat
please help me anyone to create gmail account. i am facing trouble with month and country drop downs : I want to select gmail month and country drop downs using select class but it is showing the error like Element should have been "select" but was "div" i handled with actions class but not with select class. i tried with x path, id and class but i didn't get. i am new to selenium. i am frustrated with this error.. so please help me out. here is my code. d.get("https://accounts.google.com/SignUp?continue=https%3A%2F%2Faccounts.google.com%2FManageAccount"); d.manage().window().maximize(); Select s=new Select(d.findElement(By.id("BirthMonth"))); s.selectByIndex(5); System.out.println("may slected...");
0debug
Logic of arithmatic operators? : As far as I understand of arithmetic operators, the below code should output 15 yet it outputs 11 and not sure why. Any help would be greatly appreciated echo $total = 3 - 1 * 2 + 10; //outputs: 11
0debug
Java: How to convert a list to HashMap (key being the list) in one line : <p>I have an arraylist of Strings:</p> <pre><code>ArrayList&lt;String&gt; list = Arrays.asList("A", "B", "C", "D"); </code></pre> <p>I would like to initialize a map <code>HashMap&lt;String, List&lt;Integer&gt;&gt;</code> with the element of my list being the key and an empty list of integers being the value.</p> <p>Of course there is a way to do it using a loop, but I wonder whether there is a way to do it in one line. After seeing the questions and answers in <a href="https://stackoverflow.com/questions/8261075/adding-multiple-entries-to-a-hashmap-at-once-in-one-statement">a similar question</a>, I am aware that it is doable by:</p> <pre><code>HashMap&lt;String, List&lt;Integer&gt;&gt; bigMap = ImmutableMap.&lt;String, List&lt;Integer&gt;&gt;builder() .put("A", new ArrayList&lt;Integer&gt;) .put("B", new ArrayList&lt;Integer&gt;) .put("C", new ArrayList&lt;Integer&gt;) .put("D", new ArrayList&lt;Integer&gt;) .build(); </code></pre> <p>But that only applies to the scenario that the size of the list is small. How can I do it using stream, like the way mentioned in <a href="https://stackoverflow.com/questions/4138364/java-how-to-convert-list-to-map">another question</a>?</p>
0debug
What's the best way to store text data? : <p>I am kinda new to Android development, but I coded a lot of C#(WinF,WPF). I created an quiz app (German words) for app and I'm not quite sure how to store and load dictionaries (a file, where lines contain 2 words). What is the best way to store these dictionaries? I googled a bit, but didn't find exact answers. At the moment I generate the words directly in the code. Thanks!</p>
0debug
SQL: Check if entry exists and return if it DOESN'T : I want to check if an entry exists in one table based on a value from a 2nd table, but if it DOESN'T exist then select the value from the 2nd table. To explain, I have a table called `devices` and a table called `tests`. Each device in `devices` has a unique identifier (an integer). Each test in `tests` references the a device that the test was run on. Therefore, every `test` is associated with a `device`. However, not every `device` has been tested. Moreover, multiple tests could have been run on a single device. So what I want to `SELECT` is all entries in `devices` that are NOT referenced by at least one entry in `tests`.
0debug
Implementing an update to android app outside play store : <p>i am developing an android app outside play store or any of the app stores. is there any code i can implements so users can update the app when there is a new version?</p> <p>I know when its on play store it can be easily updated.</p>
0debug
Export UIDocument with custom file package UTI : <p>I'm trying to export my <code>UIDocument</code> subclass with a <code>UIDocumentPickerViewController</code>. The subclass writes data to a <code>FileWrapper</code> and its UTI conforms to <code>com.apple.package</code>.</p> <p>But the presented document picker shows <em>"Documents in iCloud Drive are not available because the iCloud Drive setting is disabled."</em></p> <p><img src="https://i.stack.imgur.com/Rcne1.png" width="250"></p> <p>The document is successfully written to the cache, as I can see from the exported container package.</p> <p><a href="https://i.stack.imgur.com/85fMN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/85fMN.png" alt="Cache directory"></a></p> <p>When I change the document subclass and custom UTI to conform to a single file (e.g. <code>public.plain-text</code>), the document picker works fine and I can export the file. So the problem seems to be with the Document Type or Exported UTI.</p> <p>Am I doing something wrong or is this a bug?</p> <hr> <p><em>Info.plist</em></p> <p><a href="https://i.stack.imgur.com/nknxg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nknxg.png" alt="Document Type and Exported UTI"></a></p> <pre class="lang-xml prettyprint-override"><code>&lt;key&gt;CFBundleDocumentTypes&lt;/key&gt; &lt;array&gt; &lt;dict&gt; &lt;key&gt;CFBundleTypeIconFiles&lt;/key&gt; &lt;array/&gt; &lt;key&gt;CFBundleTypeName&lt;/key&gt; &lt;string&gt;Custom Doc&lt;/string&gt; &lt;key&gt;LSHandlerRank&lt;/key&gt; &lt;string&gt;Owner&lt;/string&gt; &lt;key&gt;LSItemContentTypes&lt;/key&gt; &lt;array&gt; &lt;string&gt;com.zxzxlch.documentsandbox.customdoc&lt;/string&gt; &lt;/array&gt; &lt;key&gt;LSTypeIsPackage&lt;/key&gt; &lt;true/&gt; &lt;/dict&gt; &lt;/array&gt; ... &lt;key&gt;UTExportedTypeDeclarations&lt;/key&gt; &lt;array&gt; &lt;dict&gt; &lt;key&gt;UTTypeConformsTo&lt;/key&gt; &lt;array&gt; &lt;string&gt;com.apple.package&lt;/string&gt; &lt;/array&gt; &lt;key&gt;UTTypeDescription&lt;/key&gt; &lt;string&gt;Custom Doc File&lt;/string&gt; &lt;key&gt;UTTypeIdentifier&lt;/key&gt; &lt;string&gt;com.zxzxlch.documentsandbox.customdoc&lt;/string&gt; &lt;key&gt;UTTypeTagSpecification&lt;/key&gt; &lt;dict&gt; &lt;key&gt;public.filename-extension&lt;/key&gt; &lt;array&gt; &lt;string&gt;zzz&lt;/string&gt; &lt;/array&gt; &lt;/dict&gt; &lt;/dict&gt; &lt;/array&gt; </code></pre> <p><em>CustomDocument.swift</em></p> <pre><code>private let textFilename = "contents.txt" class CustomDocument: UIDocument { var content = "Test" override func load(fromContents contents: Any, ofType typeName: String?) throws { guard let topFileWrapper = contents as? FileWrapper, let textData = topFileWrapper.fileWrappers?[textFilename]?.regularFileContents else { return } content = String(data: textData, encoding: .utf8)! } override func contents(forType typeName: String) throws -&gt; Any { let textFileWrapper = FileWrapper(regularFileWithContents: content.data(using: .utf8)!) textFileWrapper.preferredFilename = textFilename return FileWrapper(directoryWithFileWrappers: [textFilename: textFileWrapper]) } } </code></pre> <p><em>ViewController.swift</em></p> <pre><code>func exportDocument() { // Write to cache let cachesDir = FileManager.default.urls(for: FileManager.SearchPathDirectory.cachesDirectory, in: .allDomainsMask).first! let dataDir = cachesDir.appendingPathComponent("export", isDirectory: true) try! FileManager.default.createDirectory(at: dataDir, withIntermediateDirectories: true, attributes: nil) let fileURL = dataDir.appendingPathComponent("cookie").appendingPathExtension("zzz") let archive = CustomDocument(fileURL: fileURL) archive.content = "Cookie cat" archive.save(to: archive.fileURL, for: .forCreating) { success in guard success else { let alertController = UIAlertController.notice(title: "Cannot export data", message: nil) self.present(alertController, animated: true, completion: nil) return } let documentPicker = UIDocumentPickerViewController(url: archive.fileURL, in: .exportToService) documentPicker.delegate = self self.present(documentPicker, animated: true, completion: nil) } } </code></pre>
0debug
Difference between In-Memory cache and In-Memory Database : <p>I was wondering if I could get an explanation between the differences between In-Memory cache(redis, memcached), In-Memory data grids (gemfire) and In-Memory database (VoltDB). I'm having a hard time distinguishing the key characteristics between the 3. </p>
0debug
cursor.execute('SELECT * FROM users WHERE username = ' + user_input)
1threat
String, substring, Range, NSRange in Swift 4 : <p>I am using the following code to get a <code>String</code> substring from an <code>NSRange</code>:</p> <pre><code>func substring(with nsrange: NSRange) -&gt; String? { guard let range = Range.init(nsrange) else { return nil } let start = UTF16Index(range.lowerBound) let end = UTF16Index(range.upperBound) return String(utf16[start..&lt;end]) } </code></pre> <p>(via: <a href="https://mjtsai.com/blog/2016/12/19/nsregularexpression-and-swift/" rel="noreferrer">https://mjtsai.com/blog/2016/12/19/nsregularexpression-and-swift/</a>)</p> <p>When I compile with Swift 4 (Xcode 9b4), I get the following errors for the two lines that declare <code>start</code> and <code>end</code>:</p> <pre><code>'init' is unavailable 'init' was obsoleted in Swift 4.0 </code></pre> <p>I am confused, since I am not using an init.</p> <p>How can I fix this?</p>
0debug
def volume_cylinder(r,h): volume=3.1415*r*r*h return volume
0debug
void smc91c111_init(NICInfo *nd, uint32_t base, void *pic, int irq) { smc91c111_state *s; int iomemtype; s = (smc91c111_state *)qemu_mallocz(sizeof(smc91c111_state)); iomemtype = cpu_register_io_memory(0, smc91c111_readfn, smc91c111_writefn, s); cpu_register_physical_memory(base, 16, iomemtype); s->base = base; s->pic = pic; s->irq = irq; memcpy(s->macaddr, nd->macaddr, 6); smc91c111_reset(s); s->vc = qemu_new_vlan_client(nd->vlan, smc91c111_receive, s); }
1threat
java.lang.ArrayIndexOutOfBoundsException when adding new elements to an array? : <p>I have the following <code>Java</code> class that adds a Person object to an existing Person <code>Array</code>:</p> <pre><code> public class PersonService{ protected int lastItemInPersonArray = 0; private Person[] persons = new Person[100]; public void addPersonToPersonArray(Person personToAdd){ persons[lastItemInPersonArray++] = personToAdd; } } </code></pre> <p>I can add 1 object correctly here but when I try to 2 I get the following error:</p> <pre><code>java.lang.ArrayIndexOutOfBoundsException: 1 </code></pre> <p>What is incorrect with my logic that is causing this?</p>
0debug
static void sha256_transform(uint32_t *state, const uint8_t buffer[64]) { unsigned int i, a, b, c, d, e, f, g, h; uint32_t block[64]; uint32_t T1; a = state[0]; b = state[1]; c = state[2]; d = state[3]; e = state[4]; f = state[5]; g = state[6]; h = state[7]; #if CONFIG_SMALL for (i = 0; i < 64; i++) { uint32_t T2; if (i < 16) T1 = blk0(i); else T1 = blk(i); T1 += h + Sigma1_256(e) + Ch(e, f, g) + K256[i]; T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; } #else for (i = 0; i < 16;) { ROUND256_0_TO_15(a, b, c, d, e, f, g, h); ROUND256_0_TO_15(h, a, b, c, d, e, f, g); ROUND256_0_TO_15(g, h, a, b, c, d, e, f); ROUND256_0_TO_15(f, g, h, a, b, c, d, e); ROUND256_0_TO_15(e, f, g, h, a, b, c, d); ROUND256_0_TO_15(d, e, f, g, h, a, b, c); ROUND256_0_TO_15(c, d, e, f, g, h, a, b); ROUND256_0_TO_15(b, c, d, e, f, g, h, a); } for (; i < 64;) { ROUND256_16_TO_63(a, b, c, d, e, f, g, h); ROUND256_16_TO_63(h, a, b, c, d, e, f, g); ROUND256_16_TO_63(g, h, a, b, c, d, e, f); ROUND256_16_TO_63(f, g, h, a, b, c, d, e); ROUND256_16_TO_63(e, f, g, h, a, b, c, d); ROUND256_16_TO_63(d, e, f, g, h, a, b, c); ROUND256_16_TO_63(c, d, e, f, g, h, a, b); ROUND256_16_TO_63(b, c, d, e, f, g, h, a); } #endif state[0] += a; state[1] += b; state[2] += c; state[3] += d; state[4] += e; state[5] += f; state[6] += g; state[7] += h; }
1threat
Add module from RPM as a requirement : <p>So I have this project with many dependencies that are being installed from pip and are documented in requirements.txt I need to add another dependency now that doesn't exist on pip and I have it as an RPM in some address. What is the most Pythonic way to install it as a requirement? Thanks! The code will run on RHEL and Fedora</p>
0debug
Where did i go wrong in my code for word count C++ : Hey guys I'm having trouble my code wont count characters if I go to a new line, and for some reason will pick up chars in addition to spaces, where did I go wrong?? (I cant use strings only char and arrays) void wordCount(ifstream& in_stream, ofstream& out_stream) { int counter = 0,i; char next,last[5]; in_stream.get(next); while (!in_stream.eof()) { if (next == ' ') (next >> last[5]); for(i = 0; last[i] != '\0'; ++i) { if (last[i] == ' ') counter++; } in_stream.get(next); }
0debug
Android Navigation Architecture Component - Get current visible fragment : <p>Before trying the Navigation component I used to manually do fragment transactions and used the fragment tag in order to fetch the current fragment.</p> <p><code>val fragment:MyFragment = supportFragmentManager.findFragmentByTag(tag):MyFragment</code></p> <p>Now in my main activity layout I have something like:</p> <pre><code>&lt;fragment android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/nav_host" app:navGraph= "@navigation/nav_item" android:name="androidx.navigation.fragment.NavHostFragment" app:defaultNavHost= "true" /&gt; </code></pre> <p>How can I retrieve the current displayed fragment by the Navigation component? Doing </p> <p><code>supportFragmentManager.findFragmentById(R.id.nav_host)</code></p> <p>returns a <code>NavHostFragment</code> and I want to retrieve my shown 'MyFragment`.</p> <p>Thank you.</p>
0debug
Is it possible to easily copy applications settings from one web app to another on azure : <p>I was wondering if there is an easy way to completely copy all the key values from one web app's application settings to another, as seen in the below picture I have a lot of these key values and having to do this manually every time is very cumbersome.</p> <p><a href="https://i.stack.imgur.com/4vfJm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4vfJm.png" alt="enter image description here"></a></p>
0debug
static int draw_text(AVFilterContext *ctx, AVFrame *frame, int width, int height) { DrawTextContext *s = ctx->priv; AVFilterLink *inlink = ctx->inputs[0]; uint32_t code = 0, prev_code = 0; int x = 0, y = 0, i = 0, ret; int max_text_line_w = 0, len; int box_w, box_h; char *text; uint8_t *p; int y_min = 32000, y_max = -32000; int x_min = 32000, x_max = -32000; FT_Vector delta; Glyph *glyph = NULL, *prev_glyph = NULL; Glyph dummy = { 0 }; time_t now = time(0); struct tm ltime; AVBPrint *bp = &s->expanded_text; FFDrawColor fontcolor; FFDrawColor shadowcolor; FFDrawColor bordercolor; FFDrawColor boxcolor; av_bprint_clear(bp); if(s->basetime != AV_NOPTS_VALUE) now= frame->pts*av_q2d(ctx->inputs[0]->time_base) + s->basetime/1000000; switch (s->exp_mode) { case EXP_NONE: av_bprintf(bp, "%s", s->text); break; case EXP_NORMAL: if ((ret = expand_text(ctx, s->text, &s->expanded_text)) < 0) return ret; break; case EXP_STRFTIME: localtime_r(&now, &ltime); av_bprint_strftime(bp, s->text, &ltime); break; } if (s->tc_opt_string) { char tcbuf[AV_TIMECODE_STR_SIZE]; av_timecode_make_string(&s->tc, tcbuf, inlink->frame_count); av_bprint_clear(bp); av_bprintf(bp, "%s%s", s->text, tcbuf); } if (!av_bprint_is_complete(bp)) return AVERROR(ENOMEM); text = s->expanded_text.str; if ((len = s->expanded_text.len) > s->nb_positions) { if (!(s->positions = av_realloc(s->positions, len*sizeof(*s->positions)))) return AVERROR(ENOMEM); s->nb_positions = len; } if (s->fontcolor_expr[0]) { av_bprint_clear(&s->expanded_fontcolor); if ((ret = expand_text(ctx, s->fontcolor_expr, &s->expanded_fontcolor)) < 0) return ret; if (!av_bprint_is_complete(&s->expanded_fontcolor)) return AVERROR(ENOMEM); av_log(s, AV_LOG_DEBUG, "Evaluated fontcolor is '%s'\n", s->expanded_fontcolor.str); ret = av_parse_color(s->fontcolor.rgba, s->expanded_fontcolor.str, -1, s); if (ret) return ret; ff_draw_color(&s->dc, &s->fontcolor, s->fontcolor.rgba); } x = 0; y = 0; for (i = 0, p = text; *p; i++) { GET_UTF8(code, *p++, continue;); dummy.code = code; glyph = av_tree_find(s->glyphs, &dummy, glyph_cmp, NULL); if (!glyph) { load_glyph(ctx, &glyph, code); } y_min = FFMIN(glyph->bbox.yMin, y_min); y_max = FFMAX(glyph->bbox.yMax, y_max); x_min = FFMIN(glyph->bbox.xMin, x_min); x_max = FFMAX(glyph->bbox.xMax, x_max); } s->max_glyph_h = y_max - y_min; s->max_glyph_w = x_max - x_min; glyph = NULL; for (i = 0, p = text; *p; i++) { GET_UTF8(code, *p++, continue;); if (prev_code == '\r' && code == '\n') continue; prev_code = code; if (is_newline(code)) { max_text_line_w = FFMAX(max_text_line_w, x); y += s->max_glyph_h; x = 0; continue; } prev_glyph = glyph; dummy.code = code; glyph = av_tree_find(s->glyphs, &dummy, glyph_cmp, NULL); if (s->use_kerning && prev_glyph && glyph->code) { FT_Get_Kerning(s->face, prev_glyph->code, glyph->code, ft_kerning_default, &delta); x += delta.x >> 6; } s->positions[i].x = x + glyph->bitmap_left; s->positions[i].y = y - glyph->bitmap_top + y_max; if (code == '\t') x = (x / s->tabsize + 1)*s->tabsize; else x += glyph->advance; } max_text_line_w = FFMAX(x, max_text_line_w); s->var_values[VAR_TW] = s->var_values[VAR_TEXT_W] = max_text_line_w; s->var_values[VAR_TH] = s->var_values[VAR_TEXT_H] = y + s->max_glyph_h; s->var_values[VAR_MAX_GLYPH_W] = s->max_glyph_w; s->var_values[VAR_MAX_GLYPH_H] = s->max_glyph_h; s->var_values[VAR_MAX_GLYPH_A] = s->var_values[VAR_ASCENT ] = y_max; s->var_values[VAR_MAX_GLYPH_D] = s->var_values[VAR_DESCENT] = y_min; s->var_values[VAR_LINE_H] = s->var_values[VAR_LH] = s->max_glyph_h; s->x = s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, &s->prng); s->y = s->var_values[VAR_Y] = av_expr_eval(s->y_pexpr, s->var_values, &s->prng); s->x = s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, &s->prng); update_alpha(s); update_color_with_alpha(s, &fontcolor , s->fontcolor ); update_color_with_alpha(s, &shadowcolor, s->shadowcolor); update_color_with_alpha(s, &bordercolor, s->bordercolor); update_color_with_alpha(s, &boxcolor , s->boxcolor ); box_w = FFMIN(width - 1 , max_text_line_w); box_h = FFMIN(height - 1, y + s->max_glyph_h); if (s->draw_box) ff_blend_rectangle(&s->dc, &boxcolor, frame->data, frame->linesize, width, height, s->x - s->boxborderw, s->y - s->boxborderw, box_w + s->boxborderw * 2, box_h + s->boxborderw * 2); if (s->shadowx || s->shadowy) { if ((ret = draw_glyphs(s, frame, width, height, &shadowcolor, s->shadowx, s->shadowy, 0)) < 0) return ret; } if (s->borderw) { if ((ret = draw_glyphs(s, frame, width, height, &bordercolor, 0, 0, s->borderw)) < 0) return ret; } if ((ret = draw_glyphs(s, frame, width, height, &fontcolor, 0, 0, 0)) < 0) return ret; return 0; }
1threat
How can ignoring of return value be marked in Java code? : <p>There is C convention to mark that function is called for side effects only and in this particular invocation we are not interested in returning value:</p> <pre><code>(void) getSomethingAndDoAction(...); </code></pre> <p>Are there any equivalent in Java?</p>
0debug
void helper_mtc0_wired(CPUMIPSState *env, target_ulong arg1) { env->CP0_Wired = arg1 % env->tlb->nb_tlb; }
1threat
Capture File and Folder Opening events in C# : I have a friend who live in HOSTEL, his roommates aren’t very trustworthy people, he said to me, to make something for him, so that He could know which files and folders were opened in his absence by his roommates? _(They have a mutual agreement of not opening someone personal folders)_ _(He is supposed to share PC and can’t hide or encrypt his personal folders)_ So I decided to go with C# because my friend is using Windows OS. So The task is to make a Windows Form Application that will logs name and location of every file and folder opened by user _(in file or DB doesn’t matter)_ during the application running time. I know there is a class of `FileSystemWatcher` but it only has four events of Changed, Created, Deleted & Renamed which I don’t need at all, It doesn’t matter if your is changing or deleting or creating or renaming something, all it does matter is which files & folders are opened by user ...? If it could be done in Java I am also ready to give it a shot, just point me in the right direction !!
0debug
Error regarding variable in Selenium Junit test : I'm trying to run below code from IntelliJ but in turns an error (below). I just want to click a button on the website using a Xpath locator and adding an assertion to validate my test. What is the best approach to build such a simple test? ```package selenium; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.testng.annotations.Test; import java.util.List; public class ButtonTest extends CommonScenario { private static WebDriver driver; @Test() public void button_test() { button b = driver.findElements(By.xpath("//button[text()='Teleworking")); } ``` Error: ``` Error:(16, 5) java: cannot find symbol symbol: class button location: class selenium.ButtonTest
0debug
static int print_uint32(DeviceState *dev, Property *prop, char *dest, size_t len) { uint32_t *ptr = qdev_get_prop_ptr(dev, prop); return snprintf(dest, len, "%" PRIu32, *ptr); }
1threat
Number Guessing Game : I'm trying to make a game where the user has 3 chances to guess a random number that the program generates. I have this code so far, but I don't know how to get the program to stop after the user inputs 3 out of 3 guesses. If the user is not able to correctly guess in 3 tries, I want the program to say "You loose. The number was ..." import java.util.Random; import java.util.Scanner; class GuessNumber { public static void main(String args[]) { Random random = new Random(); Scanner input = new Scanner(System.in); int MIN = 1; int MAX = 10; int comp = random.nextInt(MAX - MIN + 1) + MIN; int user; do { System.out.print("Guess a number between 1 and 10: "); user = input.nextInt(); if (user > comp) System.out.println("My number is less than " + user + "."); else if (user < comp) System.out.println("My number is greater than " + user + "."); else System.out.println("Correct! " + comp + " was my number! " ); } while (user != comp); } }
0debug
c# - saveFileDialog with Custom Extensions : <p>How would I read/save/open custom file extensions designed for my program? My program reads text from a richTextBox then saves it vice versa.</p>
0debug
How can I save an email attachment to SharePoint using MS Flow : I need to save the email attachment (excel) to SharePoint list or library when I receive new email
0debug
Where does go get install packages? : <p>I've been given instructions to run <code>go get &lt;some-remote-git-repo&gt;</code> which seems to succeed, but it's not clear to me where the package was installed to so I can run an executable from it.</p> <p>Per <a href="https://golang.org/doc/code.html#remote" rel="noreferrer">https://golang.org/doc/code.html#remote</a> it seems it will be installed in <code>$GOPATH/bin</code> but <code>$GOPATH</code> isn't defined in my shell (though the <code>go get</code> command seems to work fine). Go is installed via Homebrew.</p>
0debug
TypeScript within .cshtml Razor Files : <p>I am starting a new project using ASP.NET-MVC framework. I'd like to use TypeScript in this project in place of JavaScript. TypeScript is easily supported by Visual Studio but doesn't seem to be (fully) compatible with the .cshtml razor files. I'm able to create my classes within the .ts file and call those classes within my .cshtml file, the issue is when I pass in parameters to the object in the .cshtml file TypeSafety is ignored and the function is run as if a type were never defined.</p> <p><strong>.ts file</strong></p> <pre><code> export class SomeClass { name: number; constructor(public tName: number) { this.name = tName; } public sayName() { alert(this.name); } } </code></pre> <p><strong>.cshtml file</strong></p> <pre><code>var instance = new SomeClass("Timmy"); instance.sayName(); </code></pre> <p>As you can see, I am passing a string to the constructor even though I clearly defined the parameter to only accept numbers, but the TypeSafely is ignored and the TypeScript/JavaScript executes as if there is no issue.</p> <p>Both file types were invented by Microsoft so I'm slightly surprised they aren't a little more friendly with each other. This isn't the end of the world, at least I am still able to use Object Oriented Programming, I'm just curious if anyone else has experienced this and can maybe give me a brief explanation. </p>
0debug
CSS elements covering on hover : <p><a href="https://i.stack.imgur.com/LjiSz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LjiSz.png" alt="enter image description here"></a></p> <p>I have some problems with CSS, I want this image cover item below on hover. How can I make this? </p>
0debug
static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq, VirtIODevice *vdev) { VirtIOSerialPortClass *vsc; assert(port); assert(virtio_queue_ready(vq)); vsc = VIRTIO_SERIAL_PORT_GET_CLASS(port); while (!port->throttled) { unsigned int i; if (!port->elem.out_num) { if (!virtqueue_pop(vq, &port->elem)) { break; } port->iov_idx = 0; port->iov_offset = 0; } for (i = port->iov_idx; i < port->elem.out_num; i++) { size_t buf_size; ssize_t ret; buf_size = port->elem.out_sg[i].iov_len - port->iov_offset; ret = vsc->have_data(port, port->elem.out_sg[i].iov_base + port->iov_offset, buf_size); if (port->throttled) { port->iov_idx = i; if (ret > 0) { port->iov_offset += ret; } break; } port->iov_offset = 0; } if (port->throttled) { break; } virtqueue_push(vq, &port->elem, 0); port->elem.out_num = 0; } virtio_notify(vdev, vq); }
1threat
static int parse_dsd_diin(AVFormatContext *s, AVStream *st, uint64_t eof) { AVIOContext *pb = s->pb; while (avio_tell(pb) + 12 <= eof) { uint32_t tag = avio_rl32(pb); uint64_t size = avio_rb64(pb); uint64_t orig_pos = avio_tell(pb); const char * metadata_tag = NULL; switch(tag) { case MKTAG('D','I','A','R'): metadata_tag = "artist"; break; case MKTAG('D','I','T','I'): metadata_tag = "title"; break; } if (metadata_tag && size > 4) { unsigned int tag_size = avio_rb32(pb); int ret = get_metadata(s, metadata_tag, FFMIN(tag_size, size - 4)); if (ret < 0) { av_log(s, AV_LOG_ERROR, "cannot allocate metadata tag %s!\n", metadata_tag); return ret; } } avio_skip(pb, size - (avio_tell(pb) - orig_pos) + (size & 1)); } return 0; }
1threat
static int local_post_create_passthrough(FsContext *fs_ctx, const char *path, FsCred *credp) { char buffer[PATH_MAX]; if (chmod(rpath(fs_ctx, path, buffer), credp->fc_mode & 07777) < 0) { return -1; } if (lchown(rpath(fs_ctx, path, buffer), credp->fc_uid, credp->fc_gid) < 0) { if ((fs_ctx->export_flags & V9FS_SEC_MASK) != V9FS_SM_NONE) { return -1; } } return 0; }
1threat
S390PCIBusDevice *s390_pci_find_dev_by_fh(uint32_t fh) { S390PCIBusDevice *pbdev; int i; S390pciState *s = S390_PCI_HOST_BRIDGE( object_resolve_path(TYPE_S390_PCI_HOST_BRIDGE, NULL)); if (!s || !fh) { return NULL; } for (i = 0; i < PCI_SLOT_MAX; i++) { pbdev = &s->pbdev[i]; if (pbdev->fh == fh) { return pbdev; } } return NULL; }
1threat
static int h263_decode_block(MpegEncContext * s, int16_t * block, int n, int coded) { int level, i, j, run; RLTable *rl = &ff_h263_rl_inter; const uint8_t *scan_table; GetBitContext gb= s->gb; scan_table = s->intra_scantable.permutated; if (s->h263_aic && s->mb_intra) { rl = &ff_rl_intra_aic; i = 0; if (s->ac_pred) { if (s->h263_aic_dir) scan_table = s->intra_v_scantable.permutated; else scan_table = s->intra_h_scantable.permutated; } } else if (s->mb_intra) { if (CONFIG_RV10_DECODER && s->codec_id == AV_CODEC_ID_RV10) { if (s->rv10_version == 3 && s->pict_type == AV_PICTURE_TYPE_I) { int component, diff; component = (n <= 3 ? 0 : n - 4 + 1); level = s->last_dc[component]; if (s->rv10_first_dc_coded[component]) { diff = ff_rv_decode_dc(s, n); if (diff == 0xffff) return -1; level += diff; level = level & 0xff; s->last_dc[component] = level; } else { s->rv10_first_dc_coded[component] = 1; } } else { level = get_bits(&s->gb, 8); if (level == 255) level = 128; } }else{ level = get_bits(&s->gb, 8); if((level&0x7F) == 0){ av_log(s->avctx, AV_LOG_ERROR, "illegal dc %d at %d %d\n", level, s->mb_x, s->mb_y); if (s->avctx->err_recognition & (AV_EF_BITSTREAM|AV_EF_COMPLIANT)) return -1; } if (level == 255) level = 128; } block[0] = level; i = 1; } else { i = 0; } if (!coded) { if (s->mb_intra && s->h263_aic) goto not_coded; s->block_last_index[n] = i - 1; return 0; } retry: { OPEN_READER(re, &s->gb); i--; for(;;) { UPDATE_CACHE(re, &s->gb); GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0); if (run == 66) { if (level){ CLOSE_READER(re, &s->gb); av_log(s->avctx, AV_LOG_ERROR, "illegal ac vlc code at %dx%d\n", s->mb_x, s->mb_y); return -1; } if (CONFIG_FLV_DECODER && s->h263_flv > 1) { int is11 = SHOW_UBITS(re, &s->gb, 1); SKIP_CACHE(re, &s->gb, 1); run = SHOW_UBITS(re, &s->gb, 7) + 1; if (is11) { SKIP_COUNTER(re, &s->gb, 1 + 7); UPDATE_CACHE(re, &s->gb); level = SHOW_SBITS(re, &s->gb, 11); SKIP_COUNTER(re, &s->gb, 11); } else { SKIP_CACHE(re, &s->gb, 7); level = SHOW_SBITS(re, &s->gb, 7); SKIP_COUNTER(re, &s->gb, 1 + 7 + 7); } } else { run = SHOW_UBITS(re, &s->gb, 7) + 1; SKIP_CACHE(re, &s->gb, 7); level = (int8_t)SHOW_UBITS(re, &s->gb, 8); SKIP_COUNTER(re, &s->gb, 7 + 8); if(level == -128){ UPDATE_CACHE(re, &s->gb); if (s->codec_id == AV_CODEC_ID_RV10) { level = SHOW_SBITS(re, &s->gb, 12); SKIP_COUNTER(re, &s->gb, 12); }else{ level = SHOW_UBITS(re, &s->gb, 5); SKIP_CACHE(re, &s->gb, 5); level |= SHOW_SBITS(re, &s->gb, 6)<<5; SKIP_COUNTER(re, &s->gb, 5 + 6); } } } } else { if (SHOW_UBITS(re, &s->gb, 1)) level = -level; SKIP_COUNTER(re, &s->gb, 1); } i += run; if (i >= 64){ CLOSE_READER(re, &s->gb); i = i - run + ((run-1)&63) + 1; if (i < 64) { block[scan_table[i]] = level; break; } if(s->alt_inter_vlc && rl == &ff_h263_rl_inter && !s->mb_intra){ rl = &ff_rl_intra_aic; i = 0; s->gb= gb; s->bdsp.clear_block(block); goto retry; } av_log(s->avctx, AV_LOG_ERROR, "run overflow at %dx%d i:%d\n", s->mb_x, s->mb_y, s->mb_intra); return -1; } j = scan_table[i]; block[j] = level; } } not_coded: if (s->mb_intra && s->h263_aic) { ff_h263_pred_acdc(s, block, n); i = 63; } s->block_last_index[n] = i; return 0; }
1threat
9 buttons are calling one function. I want to change value of button which called/invoked the function : There are 9 buttons in my page calling the same js function, I want to change the value of button which called the function to "abc". How to do it pls help.. I know I can use 9 different functions individually for 9 buttons, but that would be too lengthy.
0debug
static const AVClass *urlcontext_child_class_next(const AVClass *prev) { URLProtocol *p = NULL; while (prev && (p = ffurl_protocol_next(p))) if (p->priv_data_class == prev) break; while (p = ffurl_protocol_next(p)) if (p->priv_data_class) return p->priv_data_class; return NULL; }
1threat
Can't create Docker network : <p>I've been able to start my Docker application without a problem but suddenly I get this error:</p> <blockquote> <p>failed to parse pool request for address space "LocalDefault" pool "" subpool "": could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network</p> </blockquote> <p>I'm running Docker 1.12.6.</p> <p>How do I fix this?</p>
0debug