problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
static void setup_sigframe_v2(struct target_ucontext_v2 *uc,
target_sigset_t *set, CPUState *env)
{
struct target_sigaltstack stack;
int i;
memset(uc, 0, offsetof(struct target_ucontext_v2, tuc_mcontext));
memset(&stack, 0, sizeof(stack));
__put_user(ta... | 1threat |
The c ++ stl library containers have dynamic memory allocations? : <p>I would like to know for example if to allocate memory dynamically I use new [] or malloc in std :: vector, or do not need, if I do not need, where should I use new [], malloc and smartpointers?</p>
| 0debug |
Convert whole dataframe from lower case to upper case with Pandas : <p>I have a dataframe like the one displayed below: </p>
<pre><code># Create an example dataframe about a fictional army
raw_data = {'regiment': ['Nighthawks', 'Nighthawks', 'Nighthawks', 'Nighthawks'],
'company': ['1st', '1st', '2nd', '2n... | 0debug |
What's difference between tf.sub and just minus operation in tensorflow? : <p>I am trying to use Tensorflow. Here is an very simple code.</p>
<pre><code>train = tf.placeholder(tf.float32, [1], name="train")
W1 = tf.Variable(tf.truncated_normal([1], stddev=0.1), name="W1")
loss = tf.pow(tf.sub(train, W1), 2)
step = tf.... | 0debug |
How does the Shouldly assertion library know the expression the assertion was applied to? : <p>The <a href="http://shouldly.readthedocs.io/en/latest/">Shouldly assertion library for .NET</a> somehow knows what expression the assertion method was called on so it is able to display it into the message. I tried to find ou... | 0debug |
bash [[ [a] == [a] ]] not true? square bracket affect compare result : <p>Anyone know why this happens? Is this a bug of bash?</p>
<pre><code>x='mnt:[4026532411]'
[[ $x == $x ]] && echo OK
</code></pre>
<p>I am expecting result <code>OK</code>, but it did not.</p>
<p>Of course, this works</p>
<pre><code>[[... | 0debug |
How to print the contents of enzyme's shallow wrapper : <p>I have the following :</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>import {shallow} from "enzyme"
const w... | 0debug |
undefined reference to `startswith' : I am writing some C in which the program is going to convert the first command line argument into a int and check to see if it is an int. If it isnt a integer value it will then attempt to check to see whether the string begins with a '.' character or not. For some reason I am gett... | 0debug |
Slicing HTML based on delimiter : <p>I am converting Word docs on the fly to HTML and needing to parse said HTML based on a delimiter. For example:</p>
<pre><code><div id="div1">
<p>
<font>
<b>[[delimiter]]Start of content section 1.</b>
</font>
&... | 0debug |
static void omap_lpg_tick(void *opaque)
{
struct omap_lpg_s *s = opaque;
if (s->cycle)
timer_mod(s->tm, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + s->period - s->on);
else
timer_mod(s->tm, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + s->on);
s->cycle = !s->cycle;
printf("%s: LED ... | 1threat |
static void ehci_frame_timer(void *opaque)
{
EHCIState *ehci = opaque;
int need_timer = 0;
int64_t expire_time, t_now;
uint64_t ns_elapsed;
uint64_t uframes, skipped_uframes;
int i;
t_now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
ns_elapsed = t_now - ehci->last_run_ns;
ufr... | 1threat |
sql make time in datetime 12 pm : I have datetime field as
<pre>
03/04/2016 08:00:00 AM
03/15/2016 04:00:00 AM
</pre>
I want to keep it as date time but make all the time to 12 am.So the result should be
<pre>
03/04/2016 12:00:00 AM
03/15/2016 12:00:00 AM
</pre>
No t-sql or declaring variables. Please advic... | 0debug |
Retrieve next Id from table using specific id from same table : <p>I am working on Blog, If user chooses to read Full Post from home page, it redirects to Details page where only one post gets displayed with all details, where all data being displayed from database table.</p>
<p>What I want to implement is, user can r... | 0debug |
Android app licensing - any current tutorials on this? : I am hoping somebody can point me in the right direction on this one. I have been reading for a few days now on the developer site, various posts on stackoverflow, etc., and am really struggling to piece all of this together. The Google documentation seems to h... | 0debug |
Prevent Foreach Array Give Same Value : <p>I have this array code</p>
<pre><code>$data = array();
foreach($getAllUserTicketHistoryJson as $value){
$data[$value['user_id']] = number_format((float)($value['total_ticket'] / $getAllTicketRound * 100), 2, '.', '');
}
$array=$data;
</code></pre>
<p>which will give outp... | 0debug |
JavaScript in Echo php : <p>hey guys can anyone help me to make this javascript code work in echo php area :/ .. please help cuz i really need this :) </p>
<pre><code><script type="text/javascript">
function countDown(secs,elem){
var element = document.getElementById(elem);
element.innerHTML = "Please wa... | 0debug |
static void finish_read_pci_config(sPAPREnvironment *spapr, uint64_t buid,
uint32_t addr, uint32_t size,
target_ulong rets)
{
PCIDevice *pci_dev;
uint32_t val;
if ((size != 1) && (size != 2) && (size != 4)) {
rt... | 1threat |
Batch file, how to remove the first world in a text file and only in the first line? : I have a .txt file that may contain various words on various lines and I just want to remove the first word in the first line. (ex: I have 2 lines in my text file containing 2 words each (abc, bcd on the first line and cde, def on th... | 0debug |
should be really straight forward but my background for website wont show : [My Code]<https://codepen.io/Crudge/pen/MWgBwZW>
body {background: url('images\Copy_of_mona-eendra-208388-unsplash.jpg') width 100% height 100% margin:0;}
I've got a pen with the whole code on. i'm using ATOM so i've just pulling the ... | 0debug |
Python equivalent of golang's defer statement : <p>How would one implement something that works like the <code>defer</code> statement from go in python? </p>
<p>Defer pushes a function call to a stack. When the function containing the defer statement returns, the defered function calls are popped and executed one by o... | 0debug |
static void avc_luma_hv_qrt_8w_msa(const uint8_t *src_x, const uint8_t *src_y,
int32_t src_stride, uint8_t *dst,
int32_t dst_stride, int32_t height)
{
uint32_t loop_cnt;
v16i8 src_hz0, src_hz1, src_hz2, src_hz3;
v16i8 src_vt0, src_v... | 1threat |
void virtio_reset(void *opaque)
{
VirtIODevice *vdev = opaque;
VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
int i;
virtio_set_status(vdev, 0);
if (current_cpu) {
vdev->device_endian = virtio_current_cpu_endian();
} else {
vdev->device_endia... | 1threat |
static void fill_block(uint16_t *pdest, uint16_t color, int block_size, int pitch)
{
int x, y;
pitch -= block_size;
for (y = 0; y != block_size; y++, pdest += pitch)
for (x = 0; x != block_size; x++)
*pdest++ = color;
}
| 1threat |
static void ipvideo_decode_format_10_opcodes(IpvideoContext *s, AVFrame *frame)
{
int pass, x, y, changed_block;
int16_t opcode, skip;
GetByteContext decoding_map_ptr;
GetByteContext skip_map_ptr;
bytestream2_skip(&s->stream_ptr, 14);
memcpy(frame->data[1], s->pal, AVPALETTE_SI... | 1threat |
Android Country codes : <p>How i use Country codes String in my android code using edittext startswith number
here my code m using.</p>
<p>String</p>
<pre><code>private static final String[] mCodes = {
"+93", "+355", "+213", "+376", "+244", "+672", "+54", "+374",
"+297", "+61", "+43", "+994", "+973",... | 0debug |
Difference between Firefox and Firefox developer nowdays - 2017 : <p>When Firefox developer edition introduced, I was so happy, that I can use WebIde, responsive design tool, eyedroper, etc... Today I had enough.</p>
<p>There are a lot of bugs in it, I wont start to enumarate how many bugs sended and approved by me an... | 0debug |
static void compute_stereo(MPADecodeContext *s, GranuleDef *g0, GranuleDef *g1)
{
int i, j, k, l;
int sf_max, sf, len, non_zero_found;
INTFLOAT (*is_tab)[16], *tab0, *tab1, tmp0, tmp1, v1, v2;
int non_zero_found_short[3];
if (s->mode_ext & MODE_EXT_I_STEREO) {
if (!s->lsf) {
... | 1threat |
Why does std::find_if(first, last, p) not take predicate by reference? : <p>I was looking at the various signatures for <a href="http://en.cppreference.com/w/cpp/algorithm/find" rel="noreferrer"><code>std::find_if</code> on cppreference.com,</a> and I noticed that the flavors that take a predicate function appear to ac... | 0debug |
Is it possible to set custom CPU throttling in Chrome DevTools? : <p>I am using Google Chrome 63.</p>
<p>In DevTools in <strong>Performance</strong> tab there are three CPU throttling settings: "No throttling", "4x slowdown" and "6x slowdown".</p>
<p>Is it possible to set custom throttling, for example "20x slowdown"... | 0debug |
How do I make make/ninja limit parallelism based on memory pressure? : <p>If I use <code>make -j2</code>, it builds fine, but under-utilizes CPU:</p>
<p><a href="https://i.stack.imgur.com/gYhxt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gYhxt.png" alt="j2"></a></p>
<p>If I use <code>make -j4</code>, it... | 0debug |
Passing props as parameter to the onClick event : I am working on a React project. I am having a div in my component. I give a key to this div using uuid.v4() function (generates random number). Now when I click this div, I want to send this key as a parameter to click event. I am not able to solve how to sent the key ... | 0debug |
void axisdev88_init (ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
{
CPUState *env;
DeviceState *dev;
SysBusDevice *s;
qemu_... | 1threat |
static void sd_reset(SDState *sd)
{
uint64_t size;
uint64_t sect;
if (sd->blk) {
blk_get_geometry(sd->blk, §);
} else {
sect = 0;
}
size = sect << 9;
sect = sd_addr_to_wpnum(size) + 1;
sd->state = sd_idle_state;
sd->rca = 0x0000;
sd_set_ocr(... | 1threat |
Animation Proble m CSS : Hover doesnt work. https://jsfiddle.net/j52qz6v4/ .When mouse hover the div , animation must stop and never start again.I dont want to use jquery
.box:hover { -webkit-animation-play-state: paused;}
| 0debug |
bool st_set_trace_file(const char *file)
{
st_set_trace_file_enabled(false);
free(trace_file_name);
if (!file) {
if (asprintf(&trace_file_name, CONFIG_TRACE_FILE, getpid()) < 0) {
trace_file_name = NULL;
return false;
}
} else {
if (asprintf(... | 1threat |
How to get text between data and comma in a string? Python 3 : I am parsing text from a website, where I got string: "Some Event 21.08.2019—31.08.2019 Standart (1+1) , Some text" or something same. I need to get text beetween last data and comma, here is "Standart (1+1)" slice. How to do that? I use Python 3
... | 0debug |
static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
AVStream *st = c->fc->streams[c->fc->nb_streams-1];
MOVStreamContext *sc = st->priv_data;
unsigned int i, entries;
int64_t duration=0;
int64_t total_sample_count=0;
get_byte(pb);
get_be24(pb);
entries... | 1threat |
Spring boot - number of backup log files restricted to 7 : <p>In our <strong>spring-boot</strong> project we are using <strong>slf4j</strong> for logging purpose. Below are configuration which we have added in <strong>application.properties</strong> file</p>
<pre><code>logging.file=/opt/logs/my_log.log
logging.level.o... | 0debug |
connection.query('SELECT * FROM users WHERE username = ' + input_string) | 1threat |
Batch - How to create a command with set/p and if : <p>i need help for extracting variable from set/p
i explain : </p>
<pre><code>set/p command=
:: THE %COMMAND% IS : setname mirtex
if "%command%"=="setname %name%" goto test
:test
echo your name is %name%
</code></pre>
<p>so i would like to extract my name "mirtex" l... | 0debug |
is there any way to run this applet code and why is my code wrong please help me guys :
import java.applet.*;
import java.awt.Graphics;
public class App extends Applet
{
public void paint (Graphics g)
{
g.drawString ("Hello World", 20, 20);
}
}
| 0debug |
basic SQL: selecting AVG() values depending two columns : I want to get AVG values depending two columns value.
Here is my table example [example][1];
And this is what i need to [get][2];
I'm using that code to get required data but it gives me average for issue not isssue and owner
and here is my code;
... | 0debug |
object twitterBootstrap is not a member of package views.html.helper : <p>Read from stdout: D:\PROJECTS\test\SimpleRequest5\app\views\products\editProduct.scala.html:11: object twitterBootstrap is not a member of package views.html.helper
D:\PROJECTS\test\SimpleRequest5\app\views\products\editProduct.scala.html:11: obj... | 0debug |
C++: Binary Heap : <p>I'm working on a C++ implementation of a Binary Heap, but I'm having some issues getting started. Here's a snippet of my code:</p>
<pre><code>class binaryHeap {
public:
// Constructor
binaryHeap(int _capacity)
{
// initializes the binary heap with a capacity, size, and space... | 0debug |
Why I cannot receive the content of arraylist : <p>I am currently struggling to fix the outcome of my code.</p>
<p>I am supposed to add a list from menu and then display the list. However, I cannot retrieve its content, rather I receive its memory value (I guess?).</p>
<p>Studentclass </p>
<pre><code> private i... | 0debug |
What if I use 1 million IPv6 addresses per second then how long would it take to exhaust all the addresses? : <p>if I use 1 million IPv6 addresses per second then how long would it take to exhaust all the addresses. Explain </p>
| 0debug |
Encrypt / Decrypt in C# using Certificate : <p>I'm having trouble finding a good example in encrypting / decrypting strings in C# <em>using a certificate</em>. I was able to find and implement an example of <strong>signing</strong> and validating a signature, as shown below. Could someone point me to an easy, similar e... | 0debug |
calculating occurances of values in an input stream : I am a college student who is currently learning programming. one of the problem statements given to us was:
user inputs an integer n followed by n different integers. Without using arrays or strings, find the number which occurs the most number of times in the inp... | 0debug |
Hey everyone, how do i sum up all the fractions in a loop in python : Id like to calculate the sum of the following numbers using a loop
1/3 + 3/5 + 5/7 + . . . + 95/97 + 97/99
Print the sum
So far this is what I wrote but I could only get it to print the fractions
s = ''
for j in range(30, 0, -1):... | 0debug |
Javascript ES6 - Enums inside classes used outside like a static enum : <p>I'd like to ask if it's possible to add an enum similar to:</p>
<pre><code>STATES = {
WIP: "Work in progress",
ONLINE: "Online",
ONLINE_MODIFIED: "Online, modified",
HIDDEN: "Hidden"
}
</code></pre>
<p>inside a Class, and be ab... | 0debug |
how to delete file you don't know it's location with batch file : how to delete a file with batch/command line you don't know it's location "text.txt" for example | 0debug |
static int mpegts_resync(ByteIOContext *pb)
{
int c, i;
for(i = 0;i < MAX_RESYNC_SIZE; i++) {
c = url_fgetc(pb);
if (c < 0)
return -1;
if (c == 0x47) {
url_fseek(pb, -1, SEEK_CUR);
return 0;
}
}
return -1;
}
| 1threat |
leaflet multi geojson nested overlays control : i have 3 separated geojson files ,each one contains a featurecollection of polygons
first one for regions the second for provinces and last for communes.
so the scenario is
for each region on click or zoom
show provinces in the clicked region then same thing wit... | 0debug |
Ubuntu 18.04 add gpg key failed with gpg-agent not found error : <p>trying to migrate our base image to the stable Ubuntu 18.04, when we try to add our gpg key, getting this error:</p>
<pre><code>root@77ff14f29cab:/# apt-key add apt-key.gpg
gpg: failed to start agent '/usr/bin/gpg-agent': No such file or directory
gp... | 0debug |
How to calculate how many time passed from the date with timezone? : I get from the server date with this format:
2016-05-27 17:33:43+0400
Now, I want to detect, how many time passed since that date? For example `1 day 5 hours 10 minutes 20 seconds`.
How can I do it? I know how to calculate this from the t... | 0debug |
static ssize_t nbd_co_send_reply(NBDRequest *req, struct nbd_reply *reply,
int len)
{
NBDClient *client = req->client;
int csock = client->sock;
ssize_t rc, ret;
qemu_co_mutex_lock(&client->send_lock);
qemu_set_fd_handler2(csock, nbd_can_read, nbd_read,
... | 1threat |
How to convert numbers written in words to digits in Java? : <p>Does anyone know how to convert something like <code>quatre-vingt mille quatre cent quatre-vingt-dix-sept</code> to <code>80497</code> in Java?</p>
| 0debug |
static void monitor_start_input(void)
{
readline_start("(qemu) ", 0, monitor_handle_command1, NULL);
}
| 1threat |
How can i sort it : <pre><code>[{TIME21=0, TIME22=2, TIME23=0, TIME12=0, TIME13=1, LOAN_AMT=500, TIME10=0, TIME20=0, TIME11=1, TIME17=0, TIME9=2, TIME16=0, TIME15=0, TIME14=1, TIME5=0, REG_DT=20170517, TIME6=0, TIME19=0, TIME7=0, TIME18=1, TIME8=4, TIME1=0, TIME2=0, TIME3=0, TIME4=0, TIME0=0}, {TIME21=3, TIME22=2, TIME... | 0debug |
static void store_slice16_c(uint16_t *dst, const uint16_t *src,
int dst_linesize, int src_linesize,
int width, int height, int log2_scale,
const uint8_t dither[8][8])
{
int y, x;
#define STORE16(pos) do { ... | 1threat |
C# How to send currect date format from dateTimePicker to MySQL : This is the format used in my MySql database: 2018-04-22.
In my C# form, I pick the value form dataTimePicker:
String data1 = dataTimePicker1.Text;
Then send it with parameter:
cmd.Parameters.Add("@data1", MySqlDbType.Date).Value = da... | 0debug |
R Data-Frame: Get Maximum of Variable B condititional on Variable A : <p>I am searching for an efficient and fast way to do the following:
I have a data frame with, say, 2 variables, A and B, where the values for A can occur several times:</p>
<pre><code>mat<-data.frame('VarA'=rep(seq(1,10),2),'VarB'=rnorm(20))
V... | 0debug |
Convert int to BigDecimal with decimal - Java : <p>I'm having a hard time figuring out how to convert this. Here is what I want:</p>
<pre><code>int i = 5900;
BigDecimal bD = new BigDecimal(i);
</code></pre>
<p>I need bD to be 59.00 but I can't figure out how to get this result. All I've been able to get is 5900 as t... | 0debug |
Xcode 8 return height= 1000 and Width =1000 for UIview (actual size is (328,40)) : <p>Since i installed Xcode 8, i am in trouble.
I didnt get the correct value for each or any UIView.</p>
<p>I also got the constraint alert for UIView. So i update it.
But view returns 1000 as width or height.
I tried or search a lot. B... | 0debug |
static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value,
unsigned size)
{
IMXEPITState *s = IMX_EPIT(opaque);
uint32_t reg = offset >> 2;
uint64_t oldcr;
DPRINTF("(%s, value = 0x%08x)\n", imx_epit_reg_name(reg), (uint32_t)value);
switch (reg) {
... | 1threat |
Set password on Zip file using DotNetZip : <p>I'm using <a href="https://www.nuget.org/packages/DotNetZip/" rel="noreferrer">DotNetZip</a> to zip my files, but I need to set a password in zip.</p>
<p>I tryed:</p>
<pre><code>public void Zip(string path, string outputPath)
{
using (ZipFile zip = new ZipFile... | 0debug |
BlockAIOCB *ide_issue_trim(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockCompletionFunc *cb, void *opaque)
{
TrimAIOCB *iocb;
iocb = qemu_aio_get(&trim_aiocb_info, bs, cb, opaque);
iocb->bh = qemu_bh_new(ide_trim_bh_cb, iocb);
iocb->ret = 0;
... | 1threat |
Call java method from other class (servlet) : I want to call a method from my Servlet but I think I messed something up with the declaration.
It says
> " The method println(boolean) in the type Printwriter is not
> applicable for the arguments (void)"
.
Here is a part of my servlet
protected void ... | 0debug |
Putting a new value into a Map if not present, or adding it if it is : <p>I have a <code>java.util.Map<Foo, Double></code> for a key-type class <code>Foo</code>. Let's call the instance of the map <code>map</code>.</p>
<p>I want to add {<code>foo</code>, <code>f</code>} (<code>foo</code> is an instance of <code>... | 0debug |
Programmatically Call on a mobile number without user interaction and without user confirmation prompt in Swift / Objective C : How to call on a mobile number without user interaction and without user confirmation prompt in Swift / Objective C. | 0debug |
Is there a proper way of resetting a component's initial data in vuejs? : <p>I have a component with a specific set of starting data:</p>
<pre><code>data: function (){
return {
modalBodyDisplay: 'getUserInput', // possible values: 'getUserInput', 'confirmGeocodedValue'
submitButtonText: 'Lookup', /... | 0debug |
simple poker program (Draw same cards) : First, i must say you sorry for my english.
I'm learning Java for my own and i have this problem:
I created a poker program, and always AI and me draws Ace of Spades (5 each) all the rounds. I let you the code and thanks so much!
import java.io.IOException;
impor... | 0debug |
static int get_uint32_equal(QEMUFile *f, void *pv, size_t size,
VMStateField *field)
{
uint32_t *v = pv;
uint32_t v2;
qemu_get_be32s(f, &v2);
if (*v == v2) {
return 0;
error_report("%" PRIx32 " != %" PRIx32, *v, v2);
return -EINVAL;
| 1threat |
How to import moment.js in ES6 using npm? : <p>I am using angular js and nodejs along with ES6. I want to import the moment.js in the angular js code. I did <code>'npm install moment --save'</code></p>
<p>Now I am able to see moment.js file in moment folder which is inside node modules. </p>
<p>and in my app.js file ... | 0debug |
Sorting through list and storing different variables : So I'm using pandas to read from a row of data that looks like this:
0 overcast
1 overcast
2 overcast
3 overcast
4 rainy
5 rainy
6 rainy
7 rainy
8 rainy
9 sunny
... | 0debug |
RxJS5 finalize operator not called : <p>I'm trying to trigger a callback when all my observables are executed. In my other, older project i used <code>finally</code> like so and that worked like a charm: </p>
<pre><code>this.myService.callDummy()
.finally(() => console.log('Works!'))
.subscribe(result => ...... | 0debug |
START_TEST(unterminated_sq_string)
{
QObject *obj = qobject_from_json("'abc");
fail_unless(obj == NULL);
}
| 1threat |
Wait for state to update when using hooks : <p>How do I wait for state to update using Hooks. When I submit my form I need to check if <code>termsValidation</code> is false before running some additional code. If the state has just changed it doesn't pick up on this. </p>
<pre><code>import React, { useState } from 're... | 0debug |
Ruby implementation array#flatten : I need to implement ruby Array#Flatten. This implementation remove all the nested arrays
a = [ 1, 2, [3, [4, 5] ] ]
def my_flatten(arr)
arr.reduce([]) do |result, item|
item.is_a?(Array) ? result + my_flatten(item) : result << item
end
... | 0debug |
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1 error on my calendar program : My program compiles correctly but I get the same message when I try and run it.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | ... | 0debug |
Issue with comma in jquery : I've this Function that retrive a xml for a listview content :
function xmlParser(data) {
xml = data;
$('#load').fadeOut();
$(xml).find("item").each(function () {
var title = $(this).find("t... | 0debug |
int ff_init_me(MpegEncContext *s){
MotionEstContext * const c= &s->me;
int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT);
int dia_size= FFMAX(FFABS(s->avctx->dia_size)&255, FFABS(s->avctx->pre_dia_size)&255);
if(FFMIN(s->avctx->dia_size, s->avctx->pre_dia_size) < -ME_MAP_SIZE){
... | 1threat |
static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
{
MP3Context *mp3 = s->priv_data;
if (pkt->stream_index == mp3->audio_stream_idx) {
if (mp3->pics_to_write) {
AVPacketList *pktl = av_mallocz(sizeof(*pktl));
if (!pktl)
return AV... | 1threat |
How can i get the male count and female count seperately : here is my code `public function getmaletofemaleCountById()
{
$select=$this->select();
$select->from($this->_name, array('count(*) AS candidateSum','count(candidate_gender='.MALE.') AS male','count(candidate_gender='.FEMALE.') AS female'));... | 0debug |
import heapq
def k_smallest_pairs(nums1, nums2, k):
queue = []
def push(i, j):
if i < len(nums1) and j < len(nums2):
heapq.heappush(queue, [nums1[i] + nums2[j], i, j])
push(0, 0)
pairs = []
while queue and len(pairs) < k:
_, i, j = heapq.heappop(queue)
pairs.appe... | 0debug |
Square button with rounded shape on hover : <p>I designed a call to action box. The idea is to add on hover a rounded shape. This shape need to slide in smoothly. Does anyone an idea or an example how to program this?</p>
<p><a href="https://i.stack.imgur.com/hp4Gi.png" rel="nofollow noreferrer">Normal state on the le... | 0debug |
static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
LibSpeexContext *s = avctx->priv_data;
int16_t *output;
int ret, consumed = 0;
s->fr... | 1threat |
No debuggable processes in android studio when connected with phone which runs android 6.0 : <p>everyone!</p>
<p>I got so confused by android studio.
when I plug in my phone to debug apps,logcat can detect my phone,but i can not choose process. It said "no debuggable processes",not common "no debuggable applications".... | 0debug |
import math
def surfacearea_cone(r,h):
l = math.sqrt(r * r + h * h)
SA = math.pi * r * (r + l)
return SA | 0debug |
void qemu_aio_set_fd_handler(int fd,
IOHandler *io_read,
IOHandler *io_write,
AioFlushHandler *io_flush,
void *opaque)
{
aio_set_fd_handler(qemu_aio_context, fd, io_read, io_write, io_flush,
... | 1threat |
static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
SVQ1EncContext *const s = avctx->priv_data;
AVFrame *const p = avctx->coded_frame;
int i, ret;
if (!pkt->data &&
(ret = av_new_packet(pkt, s->y_... | 1threat |
void av_opt_set_defaults2(void *s, int mask, int flags)
{
#endif
const AVOption *opt = NULL;
while ((opt = av_opt_next(s, opt)) != NULL) {
#if FF_API_OLD_AVOPTIONS
if ((opt->flags & mask) != flags)
continue;
#endif
switch (opt->type) {
case AV_OPT_TYPE_CONST:
... | 1threat |
static int iscsi_truncate(BlockDriverState *bs, int64_t offset)
{
IscsiLun *iscsilun = bs->opaque;
Error *local_err = NULL;
if (iscsilun->type != TYPE_DISK) {
return -ENOTSUP;
}
iscsi_readcapacity_sync(iscsilun, &local_err);
if (local_err != NULL) {
error_free(local_... | 1threat |
static SocketAddressLegacy *unix_build_address(const char *path)
{
SocketAddressLegacy *saddr;
saddr = g_new0(SocketAddressLegacy, 1);
saddr->type = SOCKET_ADDRESS_LEGACY_KIND_UNIX;
saddr->u.q_unix.data = g_new0(UnixSocketAddress, 1);
saddr->u.q_unix.data->path = g_strdup(path);
retur... | 1threat |
Can i do network connections in doInBackground of AsyncTask : <p>Can i do network connections in doInBackground of AsyncTask. If not what to use for this.</p>
<p>As per i know i can use intentService for long running operation but this will lead some complexity in code.</p>
<p>Please suggest for the same.</p>
| 0debug |
Finding latest record from duplicates : I have a customers table with ID's and some date/time columns. But those ID's have duplicates and i just want to Analyse distinct values.
I tried using groupby but this makes the process very slow.
Due to data sensitivity can't share it.
Any suggestions would be helpful. | 0debug |
From where will hibenate fetch values : Can someone clarify my doubt.
public class MyClass{
private String name;
public void setName(String name) {
this.name = name;
}
public String getName() {
return name + " Hello";
}
public static void main() {
... | 0debug |
static int config_out_props(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
AVFilterLink *inlink = outlink->src->inputs[0];
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format);
TInterlaceContext *tinterlace = ctx->priv;
int i;
tinterlace->vsub = desc->log... | 1threat |
static void coroutine_fn stream_run(void *opaque)
{
StreamBlockJob *s = opaque;
StreamCompleteData *data;
BlockBackend *blk = s->common.blk;
BlockDriverState *bs = blk_bs(blk);
BlockDriverState *base = s->base;
int64_t sector_num = 0;
int64_t end = -1;
uint64_t delay_ns = 0;
... | 1threat |
static void sub2video_update(InputStream *ist, AVSubtitle *sub)
{
int w = ist->sub2video.w, h = ist->sub2video.h;
AVFrame *frame = ist->sub2video.frame;
int8_t *dst;
int dst_linesize;
int num_rects, i;
int64_t pts, end_pts;
if (!frame)
return;
if (sub) {
... | 1threat |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.