problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
SyntaxError: multiple statements found while compiling a single statement [Real Python Rookie] : <pre><code>i=9
while i>0:
for j in range(1,i+1):
print(str(i)+"*"+str(j)+"="+str(i*j),end=" ")
print("\n")
i--
</code></pre>
<p>SyntaxError: multiple statements found while compiling a single stateme... | 0debug |
What are access modifiers : <p>Is their a difference between modifiers and specifiers. I want to clarify and make sure their is no difference between the 3. I have looked for answers everywhere but haven't had any luck with finding the answer. </p>
| 0debug |
WebView loading blank screen in devices but working fine in emulator : <p>Enabled these two options for mywebview,</p>
<pre><code>webV.getSettings().setJavaScriptEnabled(true);
webV.getSettings().setDomStorageEnabled(true);
</code></pre>
| 0debug |
Jest transformIgnorePatterns not working : <p>I have spent a long time looking at other questions about this and looking at other projects on Github but none of the answers seem to work for me.</p>
<p>I am loading a third party library in my project, and when running Jest tests I get the error</p>
<pre><code>export d... | 0debug |
static void qpci_pc_config_writeb(QPCIBus *bus, int devfn, uint8_t offset, uint8_t value)
{
outl(0xcf8, (1 << 31) | (devfn << 8) | offset);
outb(0xcfc, value);
}
| 1threat |
troubles with arrays, index out of bounds exception : <p>So i've been at this problem for awhile, It's a piece of code that is suppose to display the data that has already been collected and sorted from the user. First ill post the code than ill post the error.</p>
<pre><code>import java.util.Scanner;
import java.util... | 0debug |
def bitwise_xor(test_tup1, test_tup2):
res = tuple(ele1 ^ ele2 for ele1, ele2 in zip(test_tup1, test_tup2))
return (res) | 0debug |
Remove specific element from array of specifc object : <p>I need to modify a nested array. In this example I would like to remove <code>content 2</code> from the target array of the object with the id <code>ZFrNsQKSY6ywSzYps</code></p>
<pre><code>var array = [
{ _id: "QKSY6ywSzYpsZFrNs", target: ["content 1"]}
{ _... | 0debug |
def word_len(s):
s = s.split(' ')
for word in s:
if len(word)%2!=0:
return True
else:
return False | 0debug |
int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
{
char buf1[32], tuple_type[32];
int h, w, depth, maxval;
pnm_get(s, buf1, sizeof(buf1));
s->type= buf1[1]-'0';
if(buf1[0] != 'P')
return -1;
if (s->type==1 || s->type==4) {
avctx->pix_fmt = PIX_FM... | 1threat |
Increment double pointer by 1 : I'm learning c pointers. There i have incremented double pointer by 1. then i could get as follows
current ptr_double =0x0128
then i incremented it by 1
so ptr_double plus 8 bytes , That is 0x0128+8 which gives `0x0130` , But i'm unable to understand how `0x0130` comes. Pleas... | 0debug |
how to add extensions to vendor manually in yii2 : <p>i want to add <a href="https://github.com/postaddictme/instagram-php-scraper" rel="nofollow noreferrer">https://github.com/postaddictme/instagram-php-scraper</a> in yii2 .</p>
<p>i copyed vendor from instagram-php-scraper project to yii2's vendor</p>
<p>this is ... | 0debug |
Angular 2 Focus on first invalid input after Click/Event : <p>I have an odd requirement and was hoping for some help.</p>
<p>I need to focus on the first found invalid input of a form after clicking a button (not submit). The form is rather large, and so the screen needs to scroll to the first invalid input.</p>
<p>T... | 0debug |
Error in Swift code : first time playing about with Xcode.
I get an error when trying to run my project, the error is as follows.
Type CGFLoat has no member "random"
var randomPosition = CGFloat.random (min: -200, max: 200)
wallPair.position.y = wallPair.position.y + randomPosition
wall... | 0debug |
Javascript: Sort Object by value : <p>I have the following object: </p>
<pre><code>{1234: "3.05", 1235: "2.03", 1236: "3.05"}
</code></pre>
<p>I would like to sort them by <strong>value</strong> to get something like this:</p>
<pre><code>{1235: "2.03", 1234: "3.05", 1236: "3.05"}
</code></pre>
<p>I tried:</p>
<pre... | 0debug |
How to reset the use/password of jenkins on windows? : <p>Maybe a fool question, I installed jenkins on windows by default, have set no user/password, it worked at first, no need to login. But when launch the 8080 webpage now, it hangs the login page, I've tried some normal user/password combinations, none could pass. ... | 0debug |
How can I receive an uploaded file using a Golang net/http server? : <p>I'm playing around with <a href="https://github.com/gorilla/mux" rel="noreferrer">Mux</a> and <code>net/http</code>. Lately, I'm trying to get a simple server with one endpoint to accept a file upload.</p>
<p>Here's the code I've got so far:</p>
... | 0debug |
Configure Apache with multiple ProxyPass : <p>i am trying to configure my apache server as proxy to serve two internal services , one listening on 8080 and should receive traffic on specific URL and the other listening on 8077 and should receive all other http traffic</p>
<p>I deployed and configured apache on the sam... | 0debug |
C program to convert decimal to binary using AND bitwise operator : <p>I have seen this code to convert decimal to binary using AND bitwise operator,and put the resulting binary number in an array to iterate over it later .since I'm new to C , I couldn't visualize the code </p>
<p>For example if we have number (13) in... | 0debug |
static void read_sbr_single_channel_element(AACContext *ac,
SpectralBandReplication *sbr,
GetBitContext *gb)
{
if (get_bits1(gb))
skip_bits(gb, 4);
read_sbr_grid(ac, sbr, gb, &sbr->data[0]);
read_sbr_d... | 1threat |
Make SLE 5542 Smart Cards Read Only After Binary Write Using APDU : <p>Excited to ask my first question over here... so here goes.. </p>
<p>I am Currently working with the Composite Smart Cards (one with both the NFC MIFARE 1k And Chip Encode ) SLE 5542,</p>
<p>So far i have managed to perform the following task wit... | 0debug |
Logical help to get arranged data from python lists? : <p>I have an problem to solve but i am getting confused on how to resolve it
I have two list with some data corresponding to each other.</p>
<pre><code>For ex:
A a1
A a2
A a3
B b1
B b2
B a1
A c1
A c2
C c1
C c2
C c3
C c4
D b1
</code></pre>
<p>I want to solve above... | 0debug |
Get from string with regular expression : <p>I need to extract from string </p>
<blockquote>
<p><code>userAllowedCrud['create']</code>
the part that is inside <code>[]</code>.</p>
</blockquote>
<p>i think using regular expression is the better way to do it. Am i wrong?</p>
| 0debug |
open Source REST API monitoring tool for Web Services : <p>I am looking for an Open Source API monitoring tool for RESTful Web service.
Like whether the API is live, down, the performance of the API, Alert by email or phone call when a REST API is down.</p>
<p>I have seen many licensed API monitoring tools. But I am l... | 0debug |
void qemu_co_rwlock_rdlock(CoRwlock *lock)
{
while (lock->writer) {
qemu_co_queue_wait(&lock->queue);
}
lock->reader++;
} | 1threat |
static coroutine_fn int hdev_co_write_zeroes(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, BdrvRequestFlags flags)
{
BDRVRawState *s = bs->opaque;
int rc;
rc = fd_open(bs);
if (rc < 0) {
return rc;
}
if (!(flags & BDRV_REQ_MAY_UNMAP)) {
return -ENOTSUP... | 1threat |
Angular 2: No provider for (injected) service : <p>I have two services in my app - MainService and RightClickService. Only MainService is accessible globally in the application, and RightClickService is injected to MainService. Therefore, I defined the following files as: </p>
<p><strong>app.module.ts</strong></p>
<p... | 0debug |
tensorflow: Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob` : <p>I get this warning most of the time when i define a model using Keras. It seems to somehow come from tensorflow though:</p>
<pre><code>WARNING:tensorflow:From C:\Users\lenik\AppData\Local\Programs\Python\Python37\li... | 0debug |
VirtIODevice *virtio_net_init(DeviceState *dev)
{
VirtIONet *n;
static int virtio_net_id;
n = (VirtIONet *)virtio_common_init("virtio-net", VIRTIO_ID_NET,
sizeof(struct virtio_net_config),
sizeof(VirtIONet));
n->v... | 1threat |
How does `git checkout .` work : <p>I've used <code>git checkout .</code> to delete local changes from my working index. </p>
<p>Does anyone know what <code>git</code> is doing under the hood™?</p>
| 0debug |
query = 'SELECT * FROM customers WHERE email = ' + email_input | 1threat |
static void xilinx_axidma_init(Object *obj)
{
XilinxAXIDMA *s = XILINX_AXI_DMA(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
Error *errp = NULL;
object_property_add_link(obj, "axistream-connected", TYPE_STREAM_SLAVE,
(Object **) &s->tx_dev, NULL);
object_init... | 1threat |
void helper_sysexit(CPUX86State *env, int dflag)
{
int cpl;
cpl = env->hflags & HF_CPL_MASK;
if (env->sysenter_cs == 0 || cpl != 0) {
raise_exception_err(env, EXCP0D_GPF, 0);
}
cpu_x86_set_cpl(env, 3);
#ifdef TARGET_X86_64
if (dflag == 2) {
cpu_x86_load_seg_cache(env,... | 1threat |
How to reproduce this shape android studio? : I'm working on a recyclerview and i want to add a half line + picture +half line before it, but i have no idea of how to reproduce it. Can you please help me to get a similar shape ?[half line + pictogram + half line][1]
[1]: https://i.stack.imgur.com/jaBCr.png | 0debug |
In echarts3, how to force axis labels to display : <p>Echarts seems to have a nice feature that automatically chooses which labels to display depending on the space provided. However, this algorithm seems to be bit too aggressive at times and does not take into account text rotate. I've gone through the chart options a... | 0debug |
npm install - javascript heap out of memory : <p>When running <code>npm install -g ionic</code> I get the following error:</p>
<blockquote>
<p>FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory</p>
</blockquote>
<p>Is there a way to globally increase the node.js memory limit?</p>
| 0debug |
FAB Button using on ActionBar : <p>I have a problem. I'm working an android project and I want to using FAB button in ActionBar. Just like ActionBar item. Is it possible or impossible? I'm looking for a lot tutorial but I've never seen just like I want.. Thanks a lot.</p>
| 0debug |
static int nbd_co_send_request(BlockDriverState *bs,
NBDRequest *request,
QEMUIOVector *qiov)
{
NBDClientSession *s = nbd_get_client_session(bs);
int rc, ret, i;
qemu_co_mutex_lock(&s->send_mutex);
while (s->in_flight == MAX_NBD_REQU... | 1threat |
static void choose_sample_fmt(AVStream *st, AVCodec *codec)
{
if (codec && codec->sample_fmts) {
const enum AVSampleFormat *p = codec->sample_fmts;
for (; *p != -1; p++) {
if (*p == st->codec->sample_fmt)
break;
}
if (*p == -1) {
av_lo... | 1threat |
static int hdcd_integrate(HDCDContext *ctx, hdcd_state_t *state, int *flag, const int32_t *samples, int count, int stride)
{
uint32_t bits = 0;
int result = FFMIN(state->readahead, count);
int i;
*flag = 0;
for (i = result - 1; i >= 0; i--) {
bits |= (*samples & 1) << i;
s... | 1threat |
static void do_ext_interrupt(CPUS390XState *env)
{
S390CPU *cpu = s390_env_get_cpu(env);
uint64_t mask, addr;
LowCore *lowcore;
ExtQueue *q;
if (!(env->psw.mask & PSW_MASK_EXT)) {
cpu_abort(CPU(cpu), "Ext int w/o ext mask\n");
}
if (env->ext_index < 0 || env->ext_index >... | 1threat |
query = 'SELECT * FROM customers WHERE email = ' + email_input | 1threat |
Replace with .lengthCompare warning : <p>IntelliJ keep suggesting to replace <code>.length == X</code> with <code>.lengthCompare(X) == 0</code>. Why is that better? Don't quite get it, since the suggested changes are more verbose. </p>
<p><a href="https://i.stack.imgur.com/I6h7N.png" rel="noreferrer"><img src="https:/... | 0debug |
the redirection page doesnt work proper ?in php with phpmyadmin : i have written my code in php as well as in html for my final project which is the the course registration system for the collage my problem is if i need to redirect the page for one user it works but later when i used the switch statement for redirect a... | 0debug |
How do we overcome the compile time and runtime gap when programming in a Dependently Typed Language? : <p>I'm told that in dependent type system, "types" and "values" is mixed, and we can treat both of them as "terms" instead.</p>
<p>But there is something I can't understand: in a strongly typed programming language ... | 0debug |
Python 2: Get network share path from drive letter : <p>If I use the following to get the list of all connected drives:</p>
<pre><code>available_drives = ['%s:' % d for d in string.ascii_uppercase if os.path.exists('%s:' % d)]
</code></pre>
<p>How do I get the UNC path of the connected drives?</p>
<p><code>os.path</... | 0debug |
android billing how to enable enablePendingPurchases() : <p>I've moved from an old gradle of billing api, to the most recent to date, and now I've tried adding </p>
<pre><code> BillingClient.Builder enablePendingPurchases = BillingClient.newBuilder(this).setListener(this);
</code></pre>
<p>but I can not get it to wo... | 0debug |
Using a GPU both as video card and GPGPU : <p>Where I work, we do a lot of numerical computations and we are considering buying workstations with NVIDIA video cards because of CUDA (to work with TensorFlow and Theano).</p>
<p>My question is: should these computers come with another video card to handle the display and... | 0debug |
static uint64_t get_cluster_offset(BlockDriverState *bs,
uint64_t offset, int allocate)
{
BDRVVmdkState *s = bs->opaque;
unsigned int l1_index, l2_offset, l2_index;
int min_index, i, j;
uint32_t min_count, *l2_table, tmp;
uint64_t cluster_offset;
... | 1threat |
Remove navigation bar on Xamarin Forms app with Caliburn.Micro : <p>When using the <code>FormsApplication</code> base class with a brand new Xamarin.Forms app using Caliburn.Micro, I end up with an empty navigation bar at the top of my screen. I assume it's being created by Caliburn.Micro somehow, because an out-of-the... | 0debug |
how to Handle diveded by zer error in sql : cast(CAST(countAta AS float) / CAST(DATEDIFF(day,@searchDate,@EndDate)AS float) as decimal(16,2)) | 0debug |
Nodemon - "clean exit - waiting for changes before restart" during setup : <p>I am trying to set up a RESTful API with Node and Postgres. I have run into a problem where whenever I attempt to run the server (using npm start) to test it locally, I get the following output:</p>
<blockquote>
<p>[nodemon] 1.14.10 [nodem... | 0debug |
static int svq1_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
{
MpegEncContext *s=avctx->priv_data;
uint8_t *current, *previous;
int result, i, x, y, width, height;
AVFrame *pict = data;
... | 1threat |
Gettting error for invalid identifier : SELECT emp. email_01 as online_id,
emp. email_02 as primary_id,
dept. email_03 as secondary_id
from
(select distinct
emp. email_01 as online_id,
emp. email_02 as primary_id,
dept. email_03 as secondary_id
fro... | 0debug |
static void pci_device_class_init(ObjectClass *klass, void *data)
{
DeviceClass *k = DEVICE_CLASS(klass);
k->init = pci_qdev_init;
k->exit = pci_unregister_device;
k->bus_type = TYPE_PCI_BUS;
k->props = pci_props;
}
| 1threat |
I have Haslell Directions and how to make it Ints? : <p>I have Directions and I step 1 like that</p>
<p>THis is the directions:</p>
<pre><code> North (x,y) = (x,y+1)
East (x,y) = (x+1,y)
South (x,y) = (x, y-1)
West (x,y) = (x-1, y)
</code></pre>
<p>How to implement like that?</p>
<pre><code> f13 :: [Dir] -> ... | 0debug |
Angular 2 event when any [routerLink] is clicked : <p>I have a simple Loader Service that hides and shows certain loaders. I'm working on something that will be used a lot with slow connections and I need to show/hide a loader between route changes. </p>
<p>I can hide the loader when the new route is loaded with the f... | 0debug |
QEMUFile *qemu_fopen_socket(int fd, const char *mode)
{
QEMUFileSocket *s;
if (qemu_file_mode_is_not_valid(mode)) {
return NULL;
}
s = g_malloc0(sizeof(QEMUFileSocket));
s->fd = fd;
if (mode[0] == 'w') {
qemu_set_block(s->fd);
s->file = qemu_fopen_ops(s, &so... | 1threat |
Angular2: How do you mark FormGroup control dirty via `patchValue()` : <p>I am updating a Reactive <code>FormGroup</code> control value from my component via <a href="https://angular.io/docs/ts/latest/api/forms/index/FormGroup-class.html#!#patchValue" rel="noreferrer">patchValue</a>.</p>
<p>Ex:</p>
<pre><code>this.my... | 0debug |
static void adx_decode(ADXContext *c, int16_t *out, const uint8_t *in, int ch)
{
ADXChannelState *prev = &c->prev[ch];
GetBitContext gb;
int scale = AV_RB16(in);
int i;
int s0, s1, s2, d;
init_get_bits(&gb, in + 2, (18 - 2) * 8);
s1 = prev->s1;
s2 = prev->s2;
for (i = 0; ... | 1threat |
qcrypto_tls_session_new(QCryptoTLSCreds *creds,
const char *hostname,
const char *aclname,
QCryptoTLSCredsEndpoint endpoint,
Error **errp)
{
QCryptoTLSSession *session;
int ret;
session = g_new0(QCrypto... | 1threat |
static void mpeg4_encode_gop_header(MpegEncContext *s)
{
int hours, minutes, seconds;
int64_t time;
put_bits(&s->pb, 16, 0);
put_bits(&s->pb, 16, GOP_STARTCODE);
time = s->current_picture_ptr->f.pts;
if (s->reordered_input_picture[1])
time = FFMIN(time, s->reordered_input_pic... | 1threat |
void s390_program_interrupt(CPUS390XState *env, uint32_t code, int ilen,
uintptr_t ra)
{
#ifdef CONFIG_TCG
S390CPU *cpu = s390_env_get_cpu(env);
if (tcg_enabled()) {
cpu_restore_state(CPU(cpu), ra);
}
#endif
program_interrupt(env, code, ilen);
}
| 1threat |
How to mock a function, that is imported within an imported method from different module : <p>I got the following function to test:</p>
<p><strong>my_package.db_engine.db_functions.py:</strong> </p>
<pre><code>from ..utils import execute_cmd
from my_package.db_engine.db_functions import dbinfo
def dbinfo(db_name... | 0debug |
How to debug electron production binaries : <p>I can't open devtools in the built version of my electron app. Therefore i want to find another solution to log any errors that only occur in the production version.</p>
<p>Is there any good way to get some console.logs from an electron application if its already built?
O... | 0debug |
m48t59_t *m48t59_init_isa(uint32_t io_base, uint16_t size, int type)
{
M48t59ISAState *d;
ISADevice *dev;
m48t59_t *s;
dev = isa_create("m48t59_isa");
qdev_prop_set_uint32(&dev->qdev, "type", type);
qdev_prop_set_uint32(&dev->qdev, "size", size);
qdev_prop_set_uint32(&dev->qdev, "i... | 1threat |
java.lang.IllegalArgumentException: Rect should intersect with child's bounds : <p>In Android Studio after starting a new project, and selecting a Tabbed Activity, after the project is build, I get this error in the Android Monitor:</p>
<pre><code>E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.app, PID:... | 0debug |
Devise Add Admin Role : <p>I wish to know how to create an admin role in devise gem and how to make pages that just if you are logged as admin you could access, otherwise you get a 404 page.</p>
| 0debug |
static uint64_t m5208_timer_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
m5208_timer_state *s = (m5208_timer_state *)opaque;
switch (addr) {
case 0:
return s->pcsr;
case 2:
return s->pmr;
case 4:
return ptimer_get_cou... | 1threat |
int kvm_log_stop(target_phys_addr_t phys_addr, ram_addr_t size)
{
return kvm_dirty_pages_log_change(phys_addr, size,
0,
KVM_MEM_LOG_DIRTY_PAGES);
}
| 1threat |
void armv7m_nvic_set_pending(void *opaque, int irq)
{
NVICState *s = (NVICState *)opaque;
VecInfo *vec;
assert(irq > ARMV7M_EXCP_RESET && irq < s->num_irq);
vec = &s->vectors[irq];
trace_nvic_set_pending(irq, vec->enabled, vec->prio);
if (irq >= ARMV7M_EXCP_HARD && irq < ARMV7M_EX... | 1threat |
runtime of a recursive function : Hi can anyone help me to find the time complexity of the following recursive function? I wrote T(n^(1/2)) and T(n^(1/4)) but what is the general way to get to the run time of any recursion?
T(n) = n^(1/2) (T(n^(1/2)) + n | 0debug |
Parsing a string into multiple separate strings : <p>Hey guys I have a quick question. I am trying to parse a single string into multiple strings using a keyword. I can currently find a set of code that allows me to parse the single string but I need to store each of the new strings as a new variable/item.</p>
<pre><c... | 0debug |
char () and int () are functions in c++? : <p>after 30 min of googling I decided to ask here my doubt
It maybe invalid question if I am not understanding below line of code correctly </p>
<p><code>result += char(int(text[i]+s-65)%26 +65);</code></p>
<p>In above code char() is a function ? If yes so I am unable to fi... | 0debug |
How to collect heap dump : $java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap6460sr16fp26-20160508_01(SR16 FP26))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460sr16fp25-20160413_299433 (JIT enabled, AOT enabled)
J9VM - 20160413_299433
JIT - r9_20160328_114196
GC -... | 0debug |
C# Cannot delete folder contains PDF or DOC files : <p>I have an issue that has just happened yesterday. Before, I use <code>Directory.Delete(path, true)</code> to delete all files and subfolders and it worked correctly.</p>
<p>But now, when I run my program run to this method, if the folder contains PDF or DOC files,... | 0debug |
simple python regular ex not working : <p>Try to regex phone numbers, can't get it to work and don't see what's wrong with my regular expression.
here is the code i'm running:</p>
<pre><code>import re
text = 'random text 058-6959503 -'
cellular = re.findall(r'/^05\d([-]{0,1})\d{7}$/',text )
print(cellular)
</c... | 0debug |
Convert string array into integer python : <p>I need to convert following string array into integers. How to do it in python.
Those string are hex values.</p>
<pre><code>['02', '01', '03', '01', '04', '01', '05', '01', '06', '01', '07', '01', '08', '01', '09', '01', '0a', '01', '0b', '01', '0c', '01', '0d', '01', '0e'... | 0debug |
How can i get var output data when my Return type Is IEnumarable : Here i need data from `var result = new` not from `IEnumarable` please Help me if is their any latranate solution is their please Help me
public IEnumerable<Employee_Join> GetEmployees(int paginate)
{
int Filte... | 0debug |
build.gradle: compile group vs compile, buildscript, classpath : <p>What is the difference between "compile group" and "compile"? Just another way to define a dependency?</p>
<p>Ex:</p>
<pre><code>compile group: 'org.slf4j', name: 'slf4j-jcl', version: '1.7.21'
</code></pre>
<p>And i think this also will work:</p>
... | 0debug |
static void bdrv_do_release_matching_dirty_bitmap(BlockDriverState *bs,
BdrvDirtyBitmap *bitmap,
bool only_named)
{
BdrvDirtyBitmap *bm, *next;
QLIST_FOREACH_SAFE(bm, &bs->dirty_bitmaps, list, next) {
... | 1threat |
react Material-ui, How do I know I can use onClick for button? : <p>The list of properties on the doc doesn't include <code>onClick</code>
(<a href="http://www.material-ui.com/#/components/icon-button" rel="noreferrer">http://www.material-ui.com/#/components/icon-button</a>)</p>
<p>How do I know I need to use onClick... | 0debug |
int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name)
{
switch(nb_channels) {
case 1: return AV_CH_LAYOUT_MONO;
case 2: return AV_CH_LAYOUT_STEREO;
case 3: return AV_CH_LAYOUT_SURROUND;
case 4: return AV_CH_LAYOUT_QUAD;
case 5: return AV_CH_LAY... | 1threat |
ERROR_INVALID_PARAMETER in VC++ code : I have written a routine that uses the native C++ "HTTPDECLAREPUSH" method to utilize server push. I am passing the parameters as below, still getting error # 87 (ERROR_INVALID_PARAMETER) at `HttpDeclarePush(p_req_queue_handle, request_id, verb, http_path, query, headers);`
... | 0debug |
Best practices for storing a Token in iOS app : <p>I'm creating an iOS that interacts with an API using Alamofire, and requires a Token for most requests. I've built the app using the MVC pattern, and it works great, but I've encountered a problem as I've tried to integrate the API. How should I share/store the token s... | 0debug |
static int remove_mapping(BDRVVVFATState* s, int mapping_index)
{
mapping_t* mapping = array_get(&(s->mapping), mapping_index);
mapping_t* first_mapping = array_get(&(s->mapping), 0);
if (mapping->first_mapping_index < 0)
free(mapping->path);
array_remove(&(s->mapping), mapping_in... | 1threat |
Why java packages do not work as a hierarchy? : <p>why java does not allow access to package restricted types that are in parents package?</p>
<p>With something like :</p>
<pre><code>Package a
|--Class A
|--Package b
|--Class B
</code></pre>
<p>It is not possible to access class <code>A</code> from class <code>B<... | 0debug |
static int read_packet(AVFormatContext *s,
AVPacket *pkt)
{
FilmstripDemuxContext *film = s->priv_data;
AVStream *st = s->streams[0];
if (s->pb->eof_reached)
return AVERROR(EIO);
pkt->dts = avio_tell(s->pb) / (st->codec->width * (st->codec->height + film->leading)... | 1threat |
Send data to the backend API Angular 6 : <p>i'm trying to send few form details to the backend API using angular6, but it doesn't work as i expected, and how do i add Observable to this, im expecting to use observable instead of promises.</p>
<p><strong>login.component.html</strong></p>
<pre><code>loginUser(e){
... | 0debug |
Find dead code in Golang monorepo : <p>My team has all our Golang code in a monorepo.</p>
<ul>
<li>Various package subdirectories with library code.</li>
<li>Binaries/services/tools under <code>cmd</code></li>
</ul>
<p>We've had it for a while and are doing some cleanup. Are there any tools or techniques that can fin... | 0debug |
Getting Error I cannot ger it : 04-20 00:40:11.688: E/AndroidRuntime(1623): FATAL EXCEPTION: AsyncTask #1
04-20 00:40:11.688: E/AndroidRuntime(1623): Process: com.clip.android, PID: 1623
04-20 00:40:11.688: E/AndroidRuntime(1623): java.lang.RuntimeException: An error occured while executing doInBackground()
04-20 00... | 0debug |
VB Code to Drag Formula to Visible Rows Only : I've tried searching for this but have only ended up with a non-functioning Frankenstein sub routine. I need to:
-Filter Column B to Grey Cells.
-In column AB on all visible rows, set formula equal to the values in Column B.
If a row is filtered out, I need it ... | 0debug |
GetObject(, "Word.Application") Office 265 : After installing Office 365 my application code
in vba is not working anymore
Set wrd = GetObject(, "Word.Application")
wrd.Visible = True wrd.Documents.Open "C:\My Documents\Temp.doc"
Set wrd = Nothing
Does someone has any ideas
| 0debug |
Getting total number of registered users : <p>In my app I have login/registration system and need to count the total number of registered users. For example I have 2 registered users.</p>
<pre><code>----------------------------------------------------
|id| email |use_name|user_pass|confirm_pass|
--------------... | 0debug |
JSF 2.2 - @Inject @ThirteenNumber throw NullPointException : I try to work with `@Injection`, so start with a simple example here :
**Interface**
public interface NumberGenerator {
String generateNumber();
}
**BookService**
public class BookServices {
@Inject
@... | 0debug |
Javascript: Expected Identifier : <p>I am creating an HTML document and using javascript to create an image element.
Here is my code (create is already defined):</p>
<pre><code>create=document.createElement("img");
create.src = 'data/1.png';
create.alt = 'image1';
create.style.magin = '1px';
eval("create.id = 'image" ... | 0debug |
address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *xlat,
hwaddr *plen, bool resolve_subpage)
{
MemoryRegionSection *section;
Int128 diff, diff_page;
section = address_space_lookup_region(d, addr, resolve_subpage);
addr -= section... | 1threat |
static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc, const int16_t *chrSrc, const int16_t *alpSrc,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, int dstW, int chrDstW)
{
int i;
#if COMPILE_TEMPLATE_MMX
if(!(c->flags & SWS_BITEXACT)) ... | 1threat |
How to add custom font sizes to QuillJS editor : <p>How do you add custom font sizes to the toolbar with QuillJS? I've tried two approaches:</p>
<pre><code>// Initiate the editor
let toolbarOptions = [
['bold', 'italic', 'underline', 'strike'],
[{ 'align': [] }],
[{ 'size': ... | 0debug |
What is a block means in Python 3? : guys.
I am a newbie in programming and trying to learn Python from automatetheboringstuff.com.
At the end of Chapter 2, the question below shows up.
And even after I have go through the official answer, I still am clueless.
Please help!
https://pastebin.com/Hhvwm5Qb (answer... | 0debug |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.