problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
{
AvsFormat *avs = s->priv_data;
int sub_type = 0, size = 0;
AvsBlockType type = AVS_NONE;
int palette_size = 0;
uint8_t palette[4 + 3 * 256];
int ret;
if (avs->remaining_audio_size > 0)
if (avs_read_audio_pac... | 1threat |
This is a question about reversing a string : <p>Write a function that reverses a string. The input string is given as an array of characters char[].</p>
<p>Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.</p>
<p>You may assume all the chara... | 0debug |
crashing the program on a specific date C# : i use this code to get date
String.Format("{0:yyyy/MM/dd}", Convert.ToDateTime(calender.Text))
it work correct .
but cant get 3 Special data so my program crashing.
in the day "31" and Month "2" , "4" , "6" for example `"1397/06/31"`or `"1397/04/31"`
how to f... | 0debug |
int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)
{
CPUS390XState *env = &cpu->env;
S390PCIBusDevice *pbdev;
uint64_t offset;
uint64_t data;
uint8_t len;
uint32_t fh;
uint8_t pcias;
cpu_synchronize_state(CPU(cpu));
if (env->psw.mask & PSW_MASK_PSTATE) {
... | 1threat |
Can I move a DOM element to an arbitrary position without mutating the DOM? : Is it possible to move an element to a position in a variable without changing a value in the DOM? | 0debug |
static inline void RENAME(planar2x)(const uint8_t *src, uint8_t *dst, int srcWidth, int srcHeight, int srcStride, int dstStride)
{
int x,y;
dst[0]= src[0];
for(x=0; x<srcWidth-1; x++){
dst[2*x+1]= (3*src[x] + src[x+1])>>2;
dst[2*x+2]= ( src[x] + 3*src[x+1])>>2;
}
dst[2*srcWidth-1]= s... | 1threat |
C# .net code error message in calculator code :
**I am coding for calculator in c#.net. I am having an error message on txtDisplay in txtDisplay.Text. the error says "The name 'txtDisplay' does not exists in the current context".My code so far is:**
using System.Drawing;
using System.Linq;
using System.Te... | 0debug |
static int build_huff(const uint8_t *src, VLC *vlc, int *fsym)
{
int i;
HuffEntry he[256];
int last;
uint32_t codes[256];
uint8_t bits[256];
uint8_t syms[256];
uint32_t code;
*fsym = -1;
for (i = 0; i < 256; i++) {
he[i].sym = i;
he[i].len = *src++;
... | 1threat |
static void bastardized_rice_decompress(ALACContext *alac,
int32_t *output_buffer,
int output_size,
int readsamplesize,
int rice_initialhistory,
int... | 1threat |
spring-jdbc vs spring-data-jdbc and what are they supporting : <p>I'm curious what is the difference between the spring-jdbc (what I missing in the newest spring release) and spring-data-jdbc.<br>
Is there a difference or just a renaming (in the repositories I don't see this)? </p>
<p>And is there somewhere described... | 0debug |
Why is JavaScript bind() necessary? : <p>The problem in example 1 is 'this' referring to the global name instead of the myName object.</p>
<p>I understand the use of bind() in setting the value of this to a specific object, so it solves the problem in example 1, but why does this problem occur in the first place? Is i... | 0debug |
void av_parser_close(AVCodecParserContext *s)
{
if(s){
if (s->parser->parser_close) {
ff_lock_avcodec(NULL);
s->parser->parser_close(s);
ff_unlock_avcodec();
}
av_free(s->priv_data);
av_free(s);
}
}
| 1threat |
How do I convert a Firestore date/Timestamp to a JS Date()? : <p>I am trying to convert the below date to a javascript Date() object. When I get it back from the server, it is a Timestamp object, </p>
<p><strong>Screenshot from Firebase Firestore console:</strong></p>
<p><a href="https://i.stack.imgur.com/Dz7gE.png" ... | 0debug |
regex in javascript to check value in range : <p>What should be the regex for checking a value is in range of (1000 to 20000)</p>
| 0debug |
Show Tutorial View on first time only : <p>I'm trying to create an tutorial screen that displays only during the first opening of an app. i know i should use user defaults but how and where ? in method viewDidLoad or on app delegate class ? </p>
| 0debug |
static void n8x0_init(QEMUMachineInitArgs *args,
struct arm_boot_info *binfo, int model)
{
MemoryRegion *sysmem = get_system_memory();
struct n800_s *s = (struct n800_s *) g_malloc0(sizeof(*s));
int sdram_size = binfo->ram_size;
s->mpu = omap2420_mpu_init(sysmem, sdram_size... | 1threat |
static target_ulong helper_udiv_common(CPUSPARCState *env, target_ulong a,
target_ulong b, int cc)
{
SPARCCPU *cpu = sparc_env_get_cpu(env);
int overflow = 0;
uint64_t x0;
uint32_t x1;
x0 = (a & 0xffffffff) | ((int64_t) (env->y) << 32);
x1 = (b & ... | 1threat |
static void disas_ldst_pair(DisasContext *s, uint32_t insn)
{
int rt = extract32(insn, 0, 5);
int rn = extract32(insn, 5, 5);
int rt2 = extract32(insn, 10, 5);
int64_t offset = sextract32(insn, 15, 7);
int index = extract32(insn, 23, 2);
bool is_vector = extract32(insn, 26, 1);
bool ... | 1threat |
req.handle.writev is not a function : <p>I'm using React, React-Redux with Webpack for my project in a Docker container and keep running into this error</p>
<blockquote>
<p>internal/stream_base_commons.js:59 var err = req.handle.writev(req,
chunks, allBuffers);
^</p>
<p>TypeError: r... | 0debug |
Cannot use 'dotnet ef...' - The specified framework version '2.0' could not be parsed : <p>My project builds without any issues and can run without issues, but I cannot use <code>dotnet ef migrations</code> because of this strange error:</p>
<pre><code>The specified framework version '2.0' could not be parsed
The spec... | 0debug |
Uncaught Invariant Violation: Rendered more hooks than during the previous render : <p>I have a component that looks like this (very simplified version):</p>
<pre><code>const component = (props: PropTypes) => {
const [allResultsVisible, setAllResultsVisible] = useState(false);
const renderResults = () =&g... | 0debug |
Separating multiple if conditions with commas in Swift : <p>We already know <a href="https://stackoverflow.com/questions/35434939/swift-if-statement-multiple-conditions-separated-by-commas">multiple optional bindings can be used in a single if/guard statement by separating them with commas</a>, but not with <code>&... | 0debug |
How can I stop EF Core from creating a filtered index on a nullable column : <p>I have this model:</p>
<pre><code>public class Subject
{
public int Id { get; set; }
[Required]
[StringLength(50)]
public string Name { get; set; }
public int LevelId { get; set; }
[ForeignKey("LevelId")]
pub... | 0debug |
void s390_sclp_extint(uint32_t parm)
{
if (kvm_enabled()) {
kvm_s390_service_interrupt(parm);
} else {
S390CPU *dummy_cpu = s390_cpu_addr2state(0);
cpu_inject_ext(dummy_cpu, EXT_SERVICE, parm, 0);
}
}
| 1threat |
Mapped Types: removing optional modifier : <p>Given this code:</p>
<pre><code>interface Foo{
one?: string;
two?: string;
}
type Foo2 = {
[P in keyof Foo]: number;
}
</code></pre>
<p>I would expect the type of <code>Foo2</code> to be <code>{ one: number; two: number; }</code> However, instead it seems to keep ... | 0debug |
static void test_tco_second_timeout_none(void)
{
TestData td;
const uint16_t ticks = TCO_SECS_TO_TICKS(256);
QDict *ad;
td.args = "-watchdog-action none";
td.noreboot = false;
test_init(&td);
stop_tco(&td);
clear_tco_status(&td);
reset_on_second_timeout(true);
set_... | 1threat |
Continuous WebJob with timer trigger : <p>I have written following functions in continuous web job :</p>
<pre><code>public static void fun1([TimerTrigger("24:00:00", RunOnStartup = true, UseMonitor = true)] TimerInfo timerInfo, TextWriter log)
{//Code}
public static void fun2([TimerTrigger("00:01:00", RunOnStartup = ... | 0debug |
create an array from elements in a string, elemets start with certain key/sign : <p>I want to abstract an array with text strings that reside in a text, each text element starts with a certain sign or key e.g. $ or &. how can I achieve this?</p>
<p>so "$Huey, $Dewey, and $Louie all live in Duckcity. $Goofy and $Mi... | 0debug |
how to identify if checkbox is checked ajax? : <p>When I'm getting E-mail message I can not identify which checkbox is checked.</p>
<p>My JS code looks like this: </p>
<pre><code>$(document).ready(function(){
$('#submit').click(function(){
$.post("submit.php",
{service1: $('#service1').val(),
... | 0debug |
static void gen_tlbld_74xx(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
gen_helper_74xx_tlbd(cpu_env, cpu_gpr[rB(ctx->opcode)]);
#end... | 1threat |
how to change the (image color) of buttons? : <p>I have 4 bottons and I set a image as a background on each button.
What I want to do is that the button should turn into gray when not selected
and turn into its original image color when selected.
how can I do this??</p>
<pre><code> <Button
android... | 0debug |
Hello, i have coded this simple application, what i want now is for my app when reopened to display the last image i had clicked last : <blockquote>
<p>This is the MainActivity code</p>
</blockquote>
<pre><code>public class MainActivity extends AppCompatActivity {
ImageView imageView;
private static final i... | 0debug |
static target_long monitor_get_pc (const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
if (!env)
return 0;
return env->eip + env->segs[R_CS].base;
}
| 1threat |
static void spr_write_ibatl_h (void *opaque, int sprn)
{
DisasContext *ctx = opaque;
gen_op_store_ibatl((sprn - SPR_IBAT4L) / 2);
RET_STOP(ctx);
}
| 1threat |
static int dxv_decompress_raw(AVCodecContext *avctx)
{
DXVContext *ctx = avctx->priv_data;
GetByteContext *gbc = &ctx->gbc;
bytestream2_get_buffer(gbc, ctx->tex_data, ctx->tex_size);
return 0;
} | 1threat |
MS SQL query if table exist : Hey all I have the following query:
SELECT
COUNT(*) over () as countNum
,[F1] AS STANDARDandOBJ
,[F2] AS CLUSTER
,[F3] AS OBJECTIVE
,[F4] AS EXTRA0
IF COL_LENGTH([tmpExcelDB].[dbo].['Blahsing$'], [F5]) IS NOT NULL
... | 0debug |
What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element : <p>When I used inspect elements in Google Chrome there is always <code>== $0</code> at the end of the selected element. This is something new and I hadn't see it in the older versions of the Google Chrome:</p>
<p>... | 0debug |
static void vga_update_display(void *opaque)
{
VGACommonState *s = opaque;
int full_update, graphic_mode;
qemu_flush_coalesced_mmio_buffer();
if (ds_get_bits_per_pixel(s->ds) == 0) {
} else {
full_update = 0;
if (!(s->ar_index & 0x20) &&
... | 1threat |
desktop application on Chrome : <p>I have a basic knowledge of html, css and javascript, enough to build some simple web sites. </p>
<p>What I need now is to create a simple desktop application (bookmarks manager), running on Chrome, win7 64bit. </p>
<p>Is it possible without learning a new language and please for ... | 0debug |
static void raw_close_fd_pool(BDRVRawState *s)
{
int i;
for (i = 0; i < RAW_FD_POOL_SIZE; i++) {
if (s->fd_pool[i] != -1) {
close(s->fd_pool[i]);
s->fd_pool[i] = -1;
}
}
}
| 1threat |
org.json.JSONException: No value for answers : https://a.top4top.net/p_480p8eho1.png
in this image my json from webservice
when reguest this webservice all of things done but in answers array give me this exception org.json.JSONException: No value for answers
StringRequest req = new StringRequest(Request.Me... | 0debug |
formControlName in a children component : <p>I would like to create a custom input component and reuse it in my forms, but I am hitting an issue with formGroup and formControlName.</p>
<pre><code>// Form
<form [formGroup]='loginForm'>
<custom-input [myFormControlName]='email'></custom-input>
</f... | 0debug |
how to adjust table to view content left and right : So i have this code :
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://ww... | 0debug |
If a user inputs a 4 digit int, how do I use an array to extract each digit? : <p>I'm creating a very basic encryption program, and I'm stuck. Essentially the user inputs a 4 digit int using a scanner and my goal is to, encrypt each digit, using a set formula. But i can't figure out how to, extract each digit and inser... | 0debug |
availability set azure fault domain & update domain : Q.I have 2 servers.so i ll have 2 FD(FD0, FD1) & 2 UD(UD0, UD1). what if UD0 is down & at the same time the FD1 goes down due some reason. so what will happen ? | 0debug |
Call from TableView Swift2 : I have anything like that
http://i.imgur.com/Hmjidup.png
I want when I push on the right number call. I try with **tel//:** but don't work. Is possible?
Thanks! | 0debug |
c# Linq List<T>.Where().ToList() create new instances of <T> : <p>I have a class, Solution.
I use this class as a List which I don't want to grow unnecessarily.</p>
<p>I search the list to get a preexisting entry and return that -or- create a new entry if need be:</p>
<pre><code>var s0 = _solutions.Where(x => x.st... | 0debug |
Displaying iReport from jFrame by jButton click event : I am using NetBeans 8.0.2. I have already created iReport using iReport5.6.0. After designing I moved it into my existing Java Application project in NetBeans into new folder called **reports**. My jFrame file **reportform.java** is in same project under **appfold... | 0debug |
Is CppCoreGuidelines C.21 correct? : <p>While reading the Bjarne Stroustrup's CoreCppGuidelines, I have found a guideline which contradicts my experience.</p>
<p>The <a href="https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rc-five">C.21</a> requires the following:</p>
<blockquote>
<p>If... | 0debug |
static void add_pc_test_case(const char *mname)
{
char *path;
PlugTestData *data;
if (!g_str_has_prefix(mname, "pc-")) {
return;
}
data = g_new(PlugTestData, 1);
data->machine = g_strdup(mname);
data->cpu_model = "Haswell";
data->sockets = 1;
data->cores = 3;
... | 1threat |
How to generate two colors randomly in JS with slight difference : How to generate two colors with rgb format in js which are similar but slight difference in shade. See the image for clearance. Ignore the rest coding just provide the random JS functions to show these.
[enter image description here][1]
[1]: htt... | 0debug |
How does JavaScript deals with value which is unknown? : <p>I am new to JavaScript and reading a <a href="http://eloquentjavascript.net/03_functions.html" rel="nofollow noreferrer">book</a> and in recursive chapter, there is an example as follow</p>
<pre><code>function findSolution(target) {
function find(current, h... | 0debug |
URL Blocked: This redirect failed because the redirect URI is not whitelisted....(Localhost web application) : <p>URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redi... | 0debug |
int qcow2_refcount_init(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
unsigned int refcount_table_size2, i;
int ret;
assert(s->refcount_table_size <= INT_MAX / sizeof(uint64_t));
refcount_table_size2 = s->refcount_table_size * sizeof(uint64_t);
s->refcount_table = g_try_malloc(... | 1threat |
How to use Laravel Passport with Password Grant Tokens? : <p>I just read the <a href="https://laravel.com/docs/5.6/passport" rel="noreferrer">https://laravel.com/docs/5.6/passport</a> documentation and I have some doubts that hopefully someone could help me with:</p>
<p>First, some context, I want to use Passport as a... | 0debug |
int kvm_arch_init_vcpu(CPUState *env)
{
struct {
struct kvm_cpuid2 cpuid;
struct kvm_cpuid_entry2 entries[100];
} __attribute__((packed)) cpuid_data;
uint32_t limit, i, j, cpuid_i;
uint32_t eax, ebx, ecx, edx;
cpuid_i = 0;
cpu_x86_cpuid(env, 0, 0, &eax, &ebx, &ecx, &... | 1threat |
pandas.factorize on an entire data frame : <p><a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.factorize.html" rel="noreferrer"><code>pandas.factorize</code></a> encodes input values as an enumerated type or categorical variable. </p>
<p>But how can I easily and efficiently convert many columns of... | 0debug |
Is it possible to wget / curl protected files from GCS? : <p>Is it possible to wget / curl protected files from Google Cloud Storage without making them public? I don't mind a fixed predefined token. I just want to avoid the case where my public file gets leeched, costing me good dollars.</p>
| 0debug |
in C# i wanna compare two Lists : I have two lists
List1 < Labels > lbl and List2 < Strings > value
and I wanna compare both using `foreach` like
if (label1.text == value ) { // value is the 2nd list name
// do something here
}
| 0debug |
void cpu_dump_state (CPUState *env, FILE *f,
int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
int flags)
{
#define RGPL 4
#define RFPL 4
int i;
cpu_fprintf(f, "NIP " ADDRX " LR " ADDRX " CTR " ADDRX " XER %08x\n",
env->nip, env->lr, env... | 1threat |
int rom_load_all(void)
{
target_phys_addr_t addr = 0;
MemoryRegionSection section;
Rom *rom;
QTAILQ_FOREACH(rom, &roms, next) {
if (rom->fw_file) {
continue;
}
if (addr > rom->addr) {
fprintf(stderr, "rom: requested regions overlap "
... | 1threat |
TopShelf: how to integrate topshelf to an existing windows service project? : Bare with me, I am new to TopShelf and Windows Service programming in general.
A lot of the [examples][1] and [documentation][2] out there refer to creating a Windows Console project in Visual Studio **first**, and **then** adding TopShelf... | 0debug |
Spring Security blocks POST requests despite SecurityConfig : <p>I'm developing a REST API based on Spring Boot (<code>spring-boot-starter-web</code>) where I use Spring Security (<code>spring-security-core</code> e <code>spring-security-config</code>) to protect the different endpoints.</p>
<p>The authentication is d... | 0debug |
static ssize_t qsb_get_iovec(const QEMUSizedBuffer *qsb,
off_t pos, off_t *d_off)
{
ssize_t i;
off_t curr = 0;
if (pos > qsb->used) {
return -1;
}
for (i = 0; i < qsb->n_iov; i++) {
if (curr + qsb->iov[i].iov_len > pos) {
*d_off ... | 1threat |
Any good tutorial on Bot Framework? : I have started developing project in Bot Framework C#, however, I am just a beginner (like creating hello world, dialog exchange with simple if else condition ). I have some basic knowledge on FormFlow and Dialog. But I am unable to go beyond this. I have gone through several tutor... | 0debug |
How to Build lora network : <p>I want to make Lora network in india that helps to receive node(sensor) data within 2km to 3km range in urban area.</p>
<p>I had read some tutorial but I have some doubts...</p>
<p>1)can we use single channel gateway without license? (because in india 868mhz is not free)</p>
<p>2)is it... | 0debug |
Rolify Table Error (user.add_role :admin Unknown Key Error) : <p>I'm attempting to setup the rolify gem and I'm running into an issue assigning a role to a user in the console.</p>
<p>Here's my error: </p>
<pre><code>2.2.1 :007 > user.add_role :admin
ArgumentError: Unknown key: :optional.
</code></pre>
<p>I'm run... | 0debug |
Find case insensitive word or sentence in a body of text - PHP : <p>I am a complete newbie in PHP and programming generally. I am looking for an example or function of searching a sentence or a word in a body of text.</p>
<p>Thanks,</p>
<p>Matt</p>
| 0debug |
static void scsi_command_complete(SCSIDiskReq *r, int status, int sense)
{
DPRINTF("Command complete tag=0x%x status=%d sense=%d\n",
r->req.tag, status, sense);
scsi_req_set_status(r, status, sense);
scsi_req_complete(&r->req);
scsi_remove_request(r);
}
| 1threat |
What does "^=" in c++ mean? : <p>I read mutation of genetic algorithm in this post:
<a href="https://stackoverflow.com/questions/4725515/c-genetic-algorithm-mutation-error">c++ Genetic Algorithm Mutation error</a></p>
<p>What does <code>^=</code> mean in <code>Child1.binary_code[z] ^= 1</code>?
Thank you in advance.</... | 0debug |
Array of json into json object : <p>I am trying to convert array of json into json object is this the correct syntax in java script file</p>
<pre><code>var request = {"data":[{
"contractorName": param.contractorName,
"hoursWorked": param.hoursWorked,
"hourlyRate": param.hourlyRate,
"pay... | 0debug |
What is the fastest way to empty s3 bucket using boto3? : <p>I was thinking about deleting and then re-creating bucket (bad option which I realised later).</p>
<p>Then how can delete all objects from the bucket?</p>
<p>I tried this : <a href="http://boto3.readthedocs.io/en/latest/reference/services/s3.html#S3.Bucket.... | 0debug |
Do all UWP apps leak memory when navigating pages? : <p>So I've been getting my teeth into UWP and developing a simple app in C# using VS2017 v15.6.4, on the latest release of Windows 10.</p>
<p>When running the app I notice its memory usage continues to increase over time.</p>
<p>After a lot of pairing back of the c... | 0debug |
Rust - need vector slices to live longer : 13 fn populate_chain(file_path: &str) -> HashMap<String, HashSet<& String>>{
14 println!("loading...");
15 let time = util::StopWatch::new();
16 let mut words = HashMap::new();
17 {
18 let f = |mut x:Vec<String>|{
... | 0debug |
static int decode_cabac_mb_cbp_chroma( H264Context *h) {
int ctx;
int cbp_a, cbp_b;
cbp_a = (h->left_cbp>>4)&0x03;
cbp_b = (h-> top_cbp>>4)&0x03;
ctx = 0;
if( cbp_a > 0 ) ctx++;
if( cbp_b > 0 ) ctx += 2;
if( get_cabac( &h->cabac, &h->cabac_state[77 + ctx] ) == 0 )
re... | 1threat |
Creating Hyper-V Administrators group in Windows 10 : <p>I am receiving the error "Unable to add user to the Hyper-V Administrators group. Exit code 2220" while attempting to deploy to an MS Android emulator. I am able to deploy windows mobile emulators as well as Linux VMs in Hyper-V.</p>
<ul>
<li>Windows 10 Pro</li>... | 0debug |
void helper_memalign(uint32_t addr, uint32_t dr, uint32_t wr, uint32_t size)
{
uint32_t mask;
switch (size) {
case 4: mask = 3; break;
case 2: mask = 1; break;
default:
case 1: mask = 0; break;
}
if (addr & mask) {
qemu_log("unaligned access addr... | 1threat |
Nesting MYSQLi commands code : This question refers to nesting mysqli commands, i'm not sure the term "nesting" is the correct one here so i'll explain.
Look at this code for example:
$query = 'SELECT id FROM users WHERE id="' . $_POST['uid'] . '"';
$result = $mysqli->query($query);
$user_id = mysql... | 0debug |
PhP/MySQL - how to add parameters like ?q=blabla to url : <p>I know this question must be very, very basic since even beginners are asking more advanced questions, but I can't find the answer.. I have searched for hours on this, so please condone my ignorance.</p>
<p><strong>What I have</strong>: localhost:8888/site/d... | 0debug |
IllegalStateException: reasonPhrase can't be empty with Android WebView : <p>I've recently been noticing that a number of users are receiving this <code>IllegalStateException</code>, which causes a crash of the app. It happens when a <code>WebView</code> is shown to the user:</p>
<pre><code>Fatal Exception: java.lang.... | 0debug |
static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
uint32_t type;
uint32_t av_unused ctype;
int64_t title_size;
char *title_str;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
avio_r8(pb);
... | 1threat |
Install packages in Alpine docker : <p>How do I write Dockerfile commands to install the following in alpine docker image:</p>
<ol>
<li>software-properties-common</li>
<li>openjdk-8-jdk</li>
<li>python3</li>
<li>nltk </li>
<li>Flask</li>
</ol>
| 0debug |
alert('Hello ' + user_input); | 1threat |
Contentful Javascript API - looking up an entry by slug : <p>I see how to query an Entry by the ID.</p>
<p>Is there a way to lookup by slug? That is what I really want to do.</p>
<p>Thanks!</p>
| 0debug |
How to change to a stringbuilder in java : I am trying to change the following code to stringbuilder so i can format the output of an arraylist how can i do this.
private static String createFormattedList(List<List<String>> failureList) {
String lineBreak = "</br>";
String result = "";
... | 0debug |
can't set a value in another class : <p>This is a method from a class, courses is an array from another class, I set the value of cn in main, but it skips all the codes after it. Why is that?</p>
<pre><code>public class GradeBook {
Scanner r=new Scanner(System.in);
private int cn;
private Course courses[]=... | 0debug |
static void test_bmdma_short_prdt(void)
{
QPCIDevice *dev;
QPCIBar bmdma_bar, ide_bar;
uint8_t status;
PrdtEntry prdt[] = {
{
.addr = 0,
.size = cpu_to_le32(0x10 | PRDT_EOT),
},
};
dev = get_pci_device(&bmdma_bar, &ide_bar);
sta... | 1threat |
React and Redux: redirect after action : <p>I develop a website with React/Redux and I use a thunk middleware to call my API. My problem concerns redirections after actions.</p>
<p>I really do not know how and where I can do the redirection: in my action, in the reducer, in my component, … ?</p>
<p>My action looks li... | 0debug |
load multiple models in Tensorflow : <p>I have written the following convolutional neural network (CNN) class in Tensorflow [<em>I have tried to omit some lines of code for clarity.</em>]</p>
<pre><code>class CNN:
def __init__(self,
num_filters=16, # initial number of convolution filters
... | 0debug |
static int qxl_post_load(void *opaque, int version)
{
PCIQXLDevice* d = opaque;
uint8_t *ram_start = d->vga.vram_ptr;
QXLCommandExt *cmds;
int in, out, newmode;
assert(d->last_release_offset < d->vga.vram_size);
if (d->last_release_offset == 0) {
d->last_release = NULL;
} ... | 1threat |
static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,
int num_ports, int devfn,
qemu_irq irq, enum ohci_type type,
const char *name, uint32_t localmem_base)
{
int i;
if (usb_frame_time == 0) {
#ifdef OHCI_TIME_WARP
... | 1threat |
Python assert(False) vs assert(false) : A recent coding error of mine has made me think...
I have been using `assert(false)` instead of `assert(False)` in one of my functions.
This function is invoked only inside `try/except` clauses.
So I never noticed this "compilation error", until I actually printed the de... | 0debug |
int ff_h264_set_parameter_from_sps(H264Context *h)
{
if (h->flags & CODEC_FLAG_LOW_DELAY ||
(h->sps.bitstream_restriction_flag &&
!h->sps.num_reorder_frames)) {
if (h->avctx->has_b_frames > 1 || h->delayed_pic[0])
av_log(h->avctx, AV_LOG_WARNING, "Delayed frames seen. "
... | 1threat |
Attribute Value Read? : <p>Currently im trying to read a XML attribute with no sucess, so far what i got is :</p>
<pre><code> XmlDocument _doc = new XmlDocument();
_doc.LoadXml(@"<DATA jsonclass=""array"">
<ROW id=""1"">
<D n=""697""/>
<D n=""2601"">10... | 0debug |
Randomly select multiple items from an array : <p>I want to have an array with different words and phrases and randomly generate around five of these on page refresh. How would I go about doing this in javascript?</p>
| 0debug |
connect_to_qemu(
const char *host,
const char *port
) {
struct addrinfo hints;
struct addrinfo *server;
int ret, sock;
sock = qemu_socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0) {
fprintf(stderr, "Error opening socket!\n");
return -1;
}
memse... | 1threat |
In Spark, is it possible to share data between two executors? : <p>I have a really big read only data that I want all the executors on the same node to use. Is that possible in Spark. I know, you can broadcast variables, but can you broadcast really big arrays. Does, under the hood, it shares data between executors on ... | 0debug |
How to understand following single and double quotes terminology in C/C++? : Help me understand the following:
cout<<'a' prints a and it's okay but
cout<<'ab' prints 24930 but I was expecting an error due to term 'ab' having two character in single quote
cout<<'a'+1 prints 98
cout<<"ab" prints ab... | 0debug |
Angular2: How to find out what was previous page url when using angular2 routing : <p>I am developing an angular2 app and I use router.
I am in a page /myapp/signup. after signup I navigate the use to /myapp/login. /myapp/login can also be navigated from my home page which is /myapp. So now, when the user users /myapp/... | 0debug |
Is it good practice to return available Options for the entity : <p>I'm working on a new api and i'm trying to decide if it would be a good practice to include the list of available options as well as the selected option when returning an entity back from the database. </p>
<p>Take for example </p>
<pre><code>class c... | 0debug |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.