problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
static int omap_validate_tipb_mpui_addr(struct omap_mpu_state_s *s,
target_phys_addr_t addr)
{
return range_covers_byte(0xe1010000, 0xe1020004 - 0xe1010000, addr);
}
| 1threat |
static int dump_cleanup(DumpState *s)
{
int ret = 0;
guest_phys_blocks_free(&s->guest_phys_blocks);
memory_mapping_list_free(&s->list);
if (s->fd != -1) {
close(s->fd);
}
if (s->resume) {
vm_start();
}
return ret;
}
| 1threat |
static inline void range_dec_normalize(APEContext * ctx)
{
while (ctx->rc.range <= BOTTOM_VALUE) {
ctx->rc.buffer = (ctx->rc.buffer << 8) | bytestream_get_byte(&ctx->ptr);
ctx->rc.low = (ctx->rc.low << 8) | ((ctx->rc.buffer >> 1) & 0xFF);
ctx->rc.range <<= 8;
}
}
| 1threat |
What does this line means in JAVA : if (number < 0) number = (number* -1);
What does this line means, especially " number* ", I've never seen before statement like this in java, I'm new. | 0debug |
static void close_unused_images(BlockDriverState *top, BlockDriverState *base,
const char *base_id)
{
BlockDriverState *intermediate;
intermediate = top->backing_hd;
while (intermediate) {
BlockDriverState *unused;
if (intermediate == base... | 1threat |
static int opt_debug(void *optctx, const char *opt, const char *arg)
{
av_log_set_level(99);
debug = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
return 0;
}
| 1threat |
Display viewmodal data from controler t view in asp.net core : Salam to All.
i want to Display query result to Razor View.
i got desired output by controller but need help to show on view.
Class **Fuel**
public class Fuel
{
public int FuelId { get; set; }
... | 0debug |
static int rtp_write(URLContext *h, const uint8_t *buf, int size)
{
RTPContext *s = h->priv_data;
int ret;
URLContext *hd;
if (RTP_PT_IS_RTCP(buf[1])) {
hd = s->rtcp_hd;
} else {
hd = s->rtp_hd;
}
ret = ffurl_write(hd, buf, size);
return ret;
} | 1threat |
NEED: An intersect for 2 Arraylists : I've got 2 arraylists and i want to find common elements from those 2.
Example:
Arraylist 1 contains: "Cat", "Dog", "Phone", "Watch", "Monkey".
Arraylist 2 contains: "Dog", "Phone", "Chair".
As a result i want to have a method which returns : "Dog" and "Phone".
I've ... | 0debug |
void do_srad (void)
{
int64_t ret;
if (likely(!(T1 & 0x40UL))) {
if (likely((uint64_t)T1 != 0)) {
ret = (int64_t)T0 >> (T1 & 0x3FUL);
if (likely(ret >= 0 || ((int64_t)T0 & ((1 << T1) - 1)) == 0)) {
xer_ca = 0;
} else {
xer_ca... | 1threat |
How to rename a rails 5 application? : <p>Is the <code>rename</code> gem the best way to rename my rails 5 app?</p>
<p>Also, is there any notes I have to keep in mind when renaming my app?</p>
| 0debug |
can anyone solve it for me : <hr>
<p>IndexError Traceback (most recent call last)
in
----> 1 print('the {2} {1} {3}'.format('brown', 'fat', 'fox',))</p>
<p>IndexError: tuple index out of range<strong>strong text</strong></p>
| 0debug |
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
{
AVFrame *src = srcp->f;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(src->format);
int i;
int ret = av_frame_ref(dst, src);
if (ret < 0)
return ret;
av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_s... | 1threat |
maven-site plugins 3.3 java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent : <p>Since this night, maven site 3.3 plugins stop to work.</p>
<p>Try to delete local repository, but no change.
Maven 3.3.9
java 1.8</p>
<p>No config or dependencies defined in pom for site plugins</p>
<pre... | 0debug |
static int scsi_handle_rw_error(SCSIDiskReq *r, int error)
{
bool is_read = (r->req.cmd.xfer == SCSI_XFER_FROM_DEV);
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
BlockErrorAction action = bdrv_get_error_action(s->qdev.conf.bs, is_read, error);
if (action == BLOCK_ERROR_ACTION_RE... | 1threat |
Codename one - lib install in NetBeans : <p>I have downloaded the library for including Toasts in CN1, but I am not sure how to install/add it to NetBeans.</p>
<p>Could you guide me?</p>
| 0debug |
Angular scope doesn't update even with apply() : <p>I have a problem with Angular's scope:</p>
<p>Init Angular:</p>
<pre><code><html lang="en" ng-app="ant101App" ng-controller="regFormController as reg">
</code></pre>
<p>Script:</p>
<pre><code>script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/... | 0debug |
static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
{
int x = 0, y = 0;
while (bytestream2_get_bytes_left(&s->gb) > 0) {
int run_length, color;
if (y >= s->avctx->height)
return 0;
color = bytestream2_get_byte(&s->gb);
if (color & 0x... | 1threat |
static int dv_extract_audio(uint8_t *frame, uint8_t *ppcm[4],
const DVprofile *sys)
{
int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
uint16_t lc, rc;
const uint8_t *as_pack;
uint8_t *pcm, ipcm;
as_pack = dv_extract_pack(frame, dv_audio_source);
if... | 1threat |
How to get local time from web server? : I set up an ajax server with this settings
```
let express = require('express');
let server = express();
server.use('/MyWebApp', express.static(__dirname + '/public'));
server.get('/MyWebApp/dateService', function(request, response){
... | 0debug |
static int ra144_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const AVFrame *frame, int *got_packet_ptr)
{
static const uint8_t sizes[LPC_ORDER] = {64, 32, 32, 16, 16, 8, 8, 8, 8, 4};
static const uint8_t bit_sizes[LPC_ORDER] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2};
RA144... | 1threat |
IndexOutOffRangeException Was Unhandled warning : i have implemented some codes in order to make changes to my csv file. however every time i was the program i the the "IndexOutOfRangeException error.
Any Help would be appreciated as i do not know the solution to this
class Program
{
static v... | 0debug |
static bool is_zero_cluster_top_locked(BlockDriverState *bs, int64_t start)
{
BDRVQcow2State *s = bs->opaque;
int nr = s->cluster_sectors;
uint64_t off;
int ret;
ret = qcow2_get_cluster_offset(bs, start << BDRV_SECTOR_BITS, &nr, &off);
assert(nr == s->cluster_sectors);
return ret =... | 1threat |
int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info)
{
CPUState *cpu = ENV_GET_CPU(env);
TaskState *ts = cpu->opaque;
struct emulated_sigtable *k;
struct sigqueue *q, **pq;
abi_ulong handler;
int queue;
trace_user_queue_signal(env, sig);
k = &ts->sigtab[sig - 1... | 1threat |
static void vhdx_parse_header(BlockDriverState *bs, BDRVVHDXState *s,
Error **errp)
{
int ret;
VHDXHeader *header1;
VHDXHeader *header2;
bool h1_valid = false;
bool h2_valid = false;
uint64_t h1_seq = 0;
uint64_t h2_seq = 0;
uint8_t *buffer;
... | 1threat |
cursor.execute('SELECT * FROM users WHERE username = ' + user_input) | 1threat |
ram_addr_t migration_bitmap_find_dirty(RAMState *rs, RAMBlock *rb,
ram_addr_t start,
ram_addr_t *ram_addr_abs)
{
unsigned long base = rb->offset >> TARGET_PAGE_BITS;
unsigned long nr = base + (start >> TARGET_PAGE_BITS);
uin... | 1threat |
int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
int mmu_idx, int is_softmmu)
{
#if !defined(CONFIG_USER_ONLY)
target_phys_addr_t physical;
int prot;
#endif
int access_type;
int ret = 0;
#if 0
log_cpu_state(env, 0);
#endif
q... | 1threat |
how to insert into table asp.net c# : I am trygin to insert values from registration page into a table login_tbl
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString);
conn.Open();
string insertQ = "INSERT INTO login_tbl (empid,first_... | 0debug |
static int arm_gic_init(SysBusDevice *dev)
{
int i;
GICState *s = FROM_SYSBUS(GICState, dev);
ARMGICClass *agc = ARM_GIC_GET_CLASS(s);
agc->parent_init(dev);
gic_init_irqs_and_distributor(s, s->num_irq);
memory_region_init_io(&s->cpuiomem[0], &gic_thiscpu_o... | 1threat |
Spring MVC (async) vs Spring WebFlux : <p>I'm trying to understand Spring WebFlux. The things I've found so far are reactive at the core, no Servlet API, no thread per request, HTTP 2, server pushes, application/stream+json. </p>
<p>But what is the difference between asynchronous calls in Spring MVC? I mean in Spring ... | 0debug |
Java android parse response from server to object or get a Value : <p>Parse response from server to Object, I post to server a JSON and this is a answer :</p>
<pre><code> <?xml version="1.0" encoding="UTF-8" standalone="yes"?><login_result><sctoken>a1fc912a-5c7a352b-8edf-4a54-a396-c6c5aea58c8b</sc... | 0debug |
static av_cold void dump_enc_cfg(AVCodecContext *avctx,
const struct vpx_codec_enc_cfg *cfg)
{
int width = -30;
int level = AV_LOG_DEBUG;
av_log(avctx, level, "vpx_codec_enc_cfg\n");
av_log(avctx, level, "generic settings\n"
" %*s%u\n %*s%u\n %*s%u... | 1threat |
Checkbox inside Custom ListVIew is not workinf : When i use textview instead of checkbox, it works perfectly. But with checkbox it doesnt work. What is wrong here?
I want to update Menuitem with every checkboxevent.
So how can i make this working?
This is custom made listview, so i dont have listview in my xml f... | 0debug |
What is AST in graphql? : <p>What is AST in graphql ? I am using graphql-js. How does it help with anything?</p>
<p>Nothing in any documentation seems to explain what AST is</p>
| 0debug |
int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
{
int ret;
AVStream *st;
ff_read_frame_flush(s);
if(flags & AVSEEK_FLAG_BYTE)
return seek_frame_byte(s, stream_index, timestamp, flags);
if(stream_index < 0){
stream_index= av_find_def... | 1threat |
Loop back to program after an execution is thrown : public void runMenu() {
int x = 1;
Scanner Option = new Scanner (System.in);
int Choice = 0;
do{
try{
System.out.println("Choose Option");
System.o... | 0debug |
Why am I getting undefined error? : <p>the syntax seems to be correct, I dont get it, here is
error: app.js:73 Uncaught ReferenceError: getBirthyear is not defined
Code: </p>
<pre><code>const person = {
name: 'Tommy',
age: 32,
location: {
state: 'Missouri',
city: 'louisisana',
street: '1 marcia dri... | 0debug |
void helper_lswx(CPUPPCState *env, target_ulong addr, uint32_t reg,
uint32_t ra, uint32_t rb)
{
if (likely(xer_bc != 0)) {
if (unlikely((ra != 0 && reg < ra && (reg + xer_bc) > ra) ||
(reg < rb && (reg + xer_bc) > rb))) {
helper_raise_exception_err(env... | 1threat |
static int decode_residual_block(AVSContext *h, GetBitContext *gb,
const struct dec_2dvlc *r, int esc_golomb_order,
int qp, uint8_t *dst, int stride) {
int i, level_code, esc_code, level, run, mask;
DCTELEM level_buf[65];
uint8_t run_buf... | 1threat |
static uint64_t timer_read(void *opaque, target_phys_addr_t addr, unsigned size)
{
LM32TimerState *s = opaque;
uint32_t r = 0;
addr >>= 2;
switch (addr) {
case R_SR:
case R_CR:
case R_PERIOD:
r = s->regs[addr];
break;
case R_SNAPSHOT:
r = (uint32_t)p... | 1threat |
Android Studio 2.2 : I keep seeing "GPU tools not installed, install now" : <p>I've just downloaded the latest Android Studio 2.2 and I'm trying to use the GPU profiling tools. On my LG G4 phone I've enabled up USB debugging & Profile GPU rendering (In adb shell dumpsys gfxinfo).</p>
<p>When using the Android Mon... | 0debug |
How do I retrieve the public IP for a fargate task using the CLI? : <p>I have a cluster running with services and am also able to launch fargate tasks from the command line. I can get the taskArn as a response to launching the task and I can wait for the task to be in the running state by using "aws ecs wait". I'm stuc... | 0debug |
How to create numpy array with every alternative number starting from 5 to 55 : <p><strong>please help</strong>
*I've just started python and I'm lost here *
*kindly just tell me the way I'll do it *</p>
| 0debug |
How to parse JSON to MySql : I have a JSON string from a http request I need to store in a MySql table, columns and rows
I need to do it in Node.js. It's not a problem to get the JSON string via the http request. http://lonobox.com/api/index.php?id=100004854
The problem is to convert it to columns and rows and st... | 0debug |
Cannot concatenate 'str' and 'list' objects (Basic list indexing Python 2) : I have a program that asks for the user how many names they have and then prints them depending on the category the fall in (first, middle, and last).
names = int(input("Number of names: "))
name_list = []
for i in range(nam... | 0debug |
How to convert any type into String in Julia : <p>Using Julia, I'd like to reliably convert any type into type <code>String</code>. There seems to be two ways to do the conversion in v0.5, either the <code>string</code> function or <code>String</code> constructor. The problem is that you need to choose the right one de... | 0debug |
UIImageView getting attached to _UIBarBackground : <p>Following is the screenshot of the issue:-</p>
<p>Not sure why is uiimageview getting added , and what is <code>_UIBarBackGround</code> ?
<a href="https://i.stack.imgur.com/qlFhq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qlFhq.png" alt="enter image... | 0debug |
static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
{
RMDemuxContext *rm = s->priv_data;
AVStream *st;
int i, len, res, seq = 1;
int64_t timestamp, pos;
int flags;
for (;;) {
if (rm->audio_pkt_cnt) {
st = s->streams[rm->audio_stream_num];
... | 1threat |
static void ppc_cpu_unrealizefn(DeviceState *dev, Error **errp)
{
PowerPCCPU *cpu = POWERPC_CPU(dev);
CPUPPCState *env = &cpu->env;
opc_handler_t **table;
int i, j;
cpu_exec_exit(CPU(dev));
for (i = 0; i < PPC_CPU_OPCODES_LEN; i++) {
if (env->opcodes[i] == &invalid_handler) {... | 1threat |
static size_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries)
{
assert(entries < (UINT64_C(1) << (64 - 9)));
return DIV_ROUND_UP(entries << s->refcount_order, 8);
}
| 1threat |
static inline void RENAME(yuv2nv12X)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat)
{
yuv2nv12XinC(lumFilter, lumSrc, lumFilterSize,
chrFilt... | 1threat |
cannot create aws lamda function due to some cryptic error message : <p>I am trying to create an aws lambda function but when I click deploy I get this error message:</p>
<blockquote>
<p>Correct the errors below and try again.
Your function's execution role must be assumable by the edgelambda.amazonaws.com service... | 0debug |
Swashbuckle Swagger - How to annotate content types? : <p>How do I annotate my ASP.NET WebAPI actions so that the swagger metadata includes the content-types that my resources support?</p>
<p>Specifically, I want the documentation to show that one of my resources can return the 'original' <code>application/json</code>... | 0debug |
static gboolean pty_chr_timer(gpointer opaque)
{
struct CharDriverState *chr = opaque;
PtyCharDriver *s = chr->opaque;
if (s->connected) {
goto out;
}
if (s->polling) {
pty_chr_state(chr, 1);
goto out;
}
pty_chr_update_read_handler(chr... | 1threat |
sql query to dulicate each row 12 times : I have a table which has columns site,year and sales . this table is unique on site+year eg <br/>
site year sales
a 2012 50
b 2013 100
a 2006 35
Now what i wanted to do is make this table unique on site+year+month. thus each row g... | 0debug |
static int config_input_ref(AVFilterLink *inlink)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
AVFilterContext *ctx = inlink->dst;
PSNRContext *s = ctx->priv;
unsigned sum;
int j;
s->nb_components = desc->nb_components;
if (ctx->inputs[0]->w != ctx->inpu... | 1threat |
static int usb_host_auto_scan(void *opaque, int bus_num, int addr,
int class_id, int vendor_id, int product_id,
const char *product_name, int speed)
{
struct USBAutoFilter *f;
struct USBDevice *dev;
if (class_id == 9)
return 0;
for (f =... | 1threat |
Why would I ever use unowned self? : <p>The following pattern happens a lot in iOS apps: </p>
<pre><code>class MyViewController: UIViewController {
let myModel = MyModel()
override func viewDidLoad() {
super.viewDidLoad()
myModel.foo() { [***] in
// use self here
}
}
}... | 0debug |
Exclude elements of Array based on index (Julia) : <p>What is the most natural way to filter an array by index in Julia? The simplest example would be to leave off the kth element:</p>
<pre><code>A = [1,2,3,4,5,6,7,8]
k = 4
[getindex(A, i) for i = 1:8 if i != k]
</code></pre>
<p>The above works but seems verbose com... | 0debug |
Date field in where clause - if date in feild is >= 67 : I am trying to pull up records based on a DATETIME field. In the where clause I want the query to look at the date in the DATETIME field and if its greater than or equal to 67 days, I want the records to show up. How do I do this?
I have used the sysdate in t... | 0debug |
Says hashed password is incorrect but they are the same : <p>Trying to learn a secure login so i was looking up tutorials. I found <a href="https://www.tutorialrepublic.com/php-tutorial/php-mysql-login-system.php" rel="nofollow noreferrer">this</a> tutorial useful and got a registration page working perfectly but the l... | 0debug |
cannot resolve constructor 'class_name(java.lang.String)' : <p>I'm trying to store data in database when clicking add button but an error appears when I created an object in MainActivity.java class with database class as shown <a href="http://i.stack.imgur.com/FTJt0.jpg" rel="nofollow">enter image description here</a> ... | 0debug |
Import a specific worksheet from a single excel (CSV) file : <p>I am currently using lumenworks to import data stored within an excel file to my program. It only grabs the information from the first worksheet in the excel document. Would I be able to modify this code in order to import data from a second worksheet, or ... | 0debug |
Apple.com Hero/Front Page Banner Area CSS : <p>I am building a home page that has similar to the apple.com home page, </p>
<p>A hero banner with 4 promos at the bottom and when you scale the promos are set to the bottom and the hero banner seems like it has a max height.</p>
<p>I have tried to copy the code and mimic... | 0debug |
Javascript to jquery convertion : So I'm trying to convert this javascript DOM into jquery, and my code isn't running for some reason. This is the DOM I am using.
document.getElementById("forma").onsubmit = function () {
var ime = document.getElementById("ime").value;
var priimek = document... | 0debug |
python incorrectly calculates number : <p>So, this was in my exam paper and I was really confused</p>
<pre><code>def num_input():
num1 = input("num1: ")
num2 = input("num2: ")
num1 = int(num2)*2.5
num2 = int(num1)*1.5
print("num1:", num1, "num2:", num2)
num_input()
</code></pre>
<p>say that num1 ... | 0debug |
static void test_visitor_in_enum(TestInputVisitorData *data,
const void *unused)
{
Error *err = NULL;
Visitor *v;
EnumOne i;
for (i = 0; EnumOne_lookup[i]; i++) {
EnumOne res = -1;
v = visitor_input_test_init(data, "%s", EnumOne_lookup[i]);
... | 1threat |
How to ssh into the services create using docker-compose : <p>This is my docker compose file</p>
<pre><code>version: '2'
# based off compose-sample-2, only we build nginx.conf into image
# uses sample site from https://startbootstrap.com/template-overviews/agency/
services:
proxy:
build:
context: .
... | 0debug |
Handling Enter Key in Vue.js : <p>I'm learning Vue.js. In my Vue, I have a text field and a button. By default, this button submits a form when someone presses the Enter key on their keyboard. When someone is typing in the text field, I want to capture each key pressed. If the key is an '@' symbol, I want to do somethi... | 0debug |
def find_Max_Len_Even(str):
n = len(str)
i = 0
currlen = 0
maxlen = 0
st = -1
while (i < n):
if (str[i] == ' '):
if (currlen % 2 == 0):
if (maxlen < currlen):
maxlen = currlen
st = i - currlen
... | 0debug |
static void mips_cpu_class_init(ObjectClass *c, void *data)
{
MIPSCPUClass *mcc = MIPS_CPU_CLASS(c);
CPUClass *cc = CPU_CLASS(c);
DeviceClass *dc = DEVICE_CLASS(c);
mcc->parent_realize = dc->realize;
dc->realize = mips_cpu_realizefn;
mcc->parent_reset = cc->reset;
cc->reset = mip... | 1threat |
What is the little white gap for my css? : <!-- begin snippet: js hide: false -->
<!-- language: lang-css -->
body{
margin:0px;
padding:0px;}
div{
border:1px solid black;
box-sizing:border-box;
font-size:30px;}
#wrapper{
width:900px;
... | 0debug |
How to use map from purrr with dplyr::mutate to create multiple new columns based on column pairs : <p>I have to following issue using R. In short I want to create multiple new columns in a data frame based on calculations of different column pairs in the data frame.</p>
<p>The data looks as follows:</p>
<pre><code>d... | 0debug |
static void vfio_bar_quirk_teardown(VFIODevice *vdev, int nr)
{
VFIOBAR *bar = &vdev->bars[nr];
while (!QLIST_EMPTY(&bar->quirks)) {
VFIOQuirk *quirk = QLIST_FIRST(&bar->quirks);
memory_region_del_subregion(&bar->mem, &quirk->mem);
QLIST_REMOVE(quirk, next);
g_free(quir... | 1threat |
av_cold int ff_nvenc_encode_close(AVCodecContext *avctx)
{
NVENCContext *ctx = avctx->priv_data;
NV_ENCODE_API_FUNCTION_LIST *nv = &ctx->nvel.nvenc_funcs;
int i;
av_frame_free(&avctx->coded_frame);
if (ctx->in) {
for (i = 0; i < ctx->nb_surfaces; ++i) {
... | 1threat |
I keep getting cannot read property error. : I am trying to do a bubblesort. I am using this algorithm to sort a 2d array and I keep getting an error. Here is the function:
var array = [["Rober Hill", 123.54],
["Chrsitopher Reddkin", 54.67],
["Maggie Woods", 1000.87],
["Jennifer Jones", 3.34],
["Marc... | 0debug |
rotate animation in jquery or css : <p>I want to create a rotating wheel luck game. I know that jquery has some features like fadein, fadeout etc. I was just wondering if there is also a rotating effect in jquery? if not then how can i do this effect?
thanks</p>
| 0debug |
Pytorch: Can't call numpy() on Variable that requires grad. Use var.detach().numpy() instead : <p>I have an error in my code which is not getting fixed any which way I try.</p>
<p>The Error is simple, I return a value:</p>
<pre><code>torch.exp(-LL_total/T_total)
</code></pre>
<p>and get the error later in the pipeli... | 0debug |
static av_cold int vc1_decode_init(AVCodecContext *avctx)
{
VC1Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
GetBitContext gb;
v->output_width = avctx->width;
v->output_height = avctx->height;
if (!avctx->extradata_size || !avctx->extradata)
return -1;
... | 1threat |
Attempting Python list comprehension with two variable of different ranges : <p>I'm trying to generate a list quickly with content from two different arrays of size n and n/2. As an example:</p>
<pre><code>A = [70, 60, 50, 40, 30, 20, 10, 0]
B = [1, 2, 3, 4]
</code></pre>
<p>I wish to generate something like</p>
<pr... | 0debug |
How to get last item from array of object? : <p>I have JSON object from server and requirement is to always display last item from the array <code>items</code>. how can i achieve that task using AngularJs or native JavaScript ?</p>
<p>Below case i have to display text <code>Chief Administrative Officer</code>.</p>
<p... | 0debug |
How do I Add Value as Source Code in Php Variable : <p>My source code here</p>
<pre><code><?php
$a = "$b = dfsdf ";
echo $a;
?>
</code></pre>
<p>I want to get out put result as below</p>
<pre><code>$b = dfsdf
</code></pre>
| 0debug |
static av_cold int a64multi_encode_init(AVCodecContext *avctx)
{
A64Context *c = avctx->priv_data;
int a;
av_lfg_init(&c->randctx, 1);
if (avctx->global_quality < 1) {
c->mc_lifetime = 4;
} else {
c->mc_lifetime = avctx->global_quality /= FF_QP2LAMBDA;
}
av_log(... | 1threat |
static uint64_t pfpu_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
MilkymistPFPUState *s = opaque;
uint32_t r = 0;
addr >>= 2;
switch (addr) {
case R_CTL:
case R_MESHBASE:
case R_HMESHLAST:
case R_VMESHLAST:
case R_CODEPAGE:
... | 1threat |
Why doesn't my arrow function return a value? : <p>I have an arrow function that looks like this (simplified):</p>
<pre><code>const f = arg => { arg.toUpperCase(); };
</code></pre>
<p>But when I call it, I get <code>undefined</code>:</p>
<pre><code>console.log(f("testing")); // undefined
</code></pre>
<p>Why?</p... | 0debug |
CREATING VIEW WITH SELECT QUERY HAVING SUB QUERIES : CREATE OR REPLACE VIEW SAMPLE_VIEW(MISSION_ID,"ESMP TRACK NO","RFPS TRACK NO","RADAR ID")
AS
SELECT ESMP.MISSION_ID,ESMP.TRACK_NO,RFPS.RFPS_TRK_NO,(SELECT RADAR_ID FROM MATCHED_TT_DETAILS TT1 WHERE TT1.MISSION_ID = ESMP.MISSION_ID AND TT1.TRACK_NO = ESMP.TRACK_NO)
... | 0debug |
cursor.execute('SELECT * FROM users WHERE username = ' + user_input) | 1threat |
11.1*9 = 99.89999999999999 : <p>I am using javascript to calculate a basket total for a simple html5 application. But javascript giving me wrong result in mobile and pc side. </p>
<p>Tested in Safari and Chrome in Mac and Chrome in Android. </p>
<p>For example:
9.1*9= 81.89999999999999
11.1*9= 99.89999999999999</p>
... | 0debug |
static int encode_init(AVCodecContext *avctx)
{
HYuvContext *s = avctx->priv_data;
int i, j, width, height;
s->avctx= avctx;
s->flags= avctx->flags;
dsputil_init(&s->dsp, avctx);
width= s->width= avctx->width;
height= s->height= avctx->height;
assert(widt... | 1threat |
How to use logic operators in jinja template on salt-stack (AND, OR) : <p>I am using a jinja template to generate a state file for salt. I added some conditionals and would like to express:
<code>if A or B</code>. However, it seems I cannot get any logical operator working.</p>
<p>It doesn't like <code>||, |, &&am... | 0debug |
Infinite loop in C, codeblock : <p>Here is my code. </p>
<pre><code>#include<stdio.h>
main()
{
float H,U,D,F;
int x=0,i=0;
scanf("%f %f %f %f",&H,&U,&D,&F);
while(H>x){
x=x+U-D;
U=U-(F/100*U);
i++;
printf("%d\t%d\t%2lf\t%2lf\t%2lf\n",i,x,U,D,F);
... | 0debug |
vpn server and client (possibly) on the same machine : what i'm trying to achieve is:
- connect to a vpn as client and route all my internal network's traffic over the vpn
- run a vpn server, so that people from outside can connect to my internal network and get routed over the a.m. vpn client
i'm trying to achieve ... | 0debug |
CSS hide scroll bar, but have element scrollable : <p>I have this element called items and the content inside the element is longer than the element height, I want to make it scrollable but hide the scroll bar, how would I do that?</p>
<pre><code><div class="left-side">
<div class="items" style="display:b... | 0debug |
Can't update or install package: An item with the same key has already been added : <h3>Problem</h3>
<p>In a particular project, I can't update or install any NuGet packages. When I try to do so using the NuGet GUI, it does some work and then stops without saying anything. When I try to do so using the package manager... | 0debug |
How to put the name of the file in advance when uploading? : I want to save the uploaded file with "1.jpg" name. If it already exists in the "upload" folder, save with "2.jpg", and if file "2.jpg" already exists in the "upload" folder, Wait until the another script clears one of them. If, after some time (about 120 sec... | 0debug |
Update multiple rows in sql server 9.0.5000 : I'mk currently creating a script automatically with a program that copies files from one place to another, and I used to do the following:
UPDATE d
SET Path= t.Path
FROM dbo.tableOperation d
JOIN (
VALUES
(1,'Path 1'),
... | 0debug |
void HELPER(ove)(CPUOpenRISCState *env, target_ulong test)
{
if (unlikely(test)) {
OpenRISCCPU *cpu = openrisc_env_get_cpu(env);
CPUState *cs = CPU(cpu);
cs->exception_index = EXCP_RANGE;
cpu_loop_exit_restore(cs, GETPC());
}
}
| 1threat |
Showing Legend on the side of graph : <p>I plotted a graph and the legend is showing right on top of the graph there by hiding the graph. </p>
<p>How can I show it on the side. </p>
<p>Here is the code I wrote</p>
<pre><code>##############################################################################
# Plot ROC cu... | 0debug |
pandas series,isnull() is not working inside list comprehension : <p>for the following simple code:</p>
<pre><code>drop_cols = [col for col in train.columns if col[0] == 'V' and train[col].isnulll().sum()/len(train) > 0.76]
drop_cols
</code></pre>
<p>I get this error:</p>
<blockquote>
<p>AttributeError ... | 0debug |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.