problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
static int vfio_add_capabilities(VFIOPCIDevice *vdev)
{
PCIDevice *pdev = &vdev->pdev;
int ret;
if (!(pdev->config[PCI_STATUS] & PCI_STATUS_CAP_LIST) ||
!pdev->config[PCI_CAPABILITY_LIST]) {
return 0;
}
ret = vfio_add_std_cap(vdev, pdev->config[PCI_CAPABILITY_LIST]);
... | 1threat |
How to represent Guid in typescript? : <p>let's say I have this C# class</p>
<pre><code>public class Product
{
public Guid Id { get; set; }
public string ProductName { get; set; }
public Decimal Price { get; set; }
public int Level { get; set; }
}
</code></pre>
<p>The equivalent typescript would be someth... | 0debug |
how to split number and simbols JAVA : I need help with the java. As I have such a character in a line 1.11 € 1.10 € 1.02 € 0.66 € 0.50 and I need to add these characters to separate variables like double i = 1.11 double a = 1.10 and so on. | 0debug |
static void arm_gic_realize(DeviceState *dev, Error **errp)
{
GICv3State *s = ARM_GICV3(dev);
ARMGICv3Class *agc = ARM_GICV3_GET_CLASS(s);
Error *local_err = NULL;
agc->parent_realize(dev, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
}
... | 1threat |
Calculate total number of levels of nesting paranthesis for each letter in input string :
I have input string
```
`(a ( b c ) ( d ( e ) ) )`
```
I want to calculate total number of nested paranthesis for each
character
```
for example output should be for a -> 1
b and c and d -> 2
and ... | 0debug |
from collections import defaultdict
def count_Substrings(s,n):
count,sum = 0,0
mp = defaultdict(lambda : 0)
mp[0] += 1
for i in range(n):
sum += ord(s[i]) - ord('0')
count += mp[sum - (i + 1)]
mp[sum - (i + 1)] += 1
return count | 0debug |
c# I can not Parse JSON to string : I have problem with my code. I don't know how to fix. I just want to get all title from json.
It showed error at: var obj = JObject.Parse(jsons);
"Unexpected character encountered while parsing value: . Path '', line 0, position 0."
public void getTitle()
{
... | 0debug |
static int xiph_handle_packet(AVFormatContext *ctx, PayloadContext *data,
AVStream *st, AVPacket *pkt, uint32_t *timestamp,
const uint8_t *buf, int len, uint16_t seq,
int flags)
{
int ident, fragmented, tdt, num_pkts, p... | 1threat |
int kvm_arch_put_registers(CPUState *cpu, int level)
{
X86CPU *x86_cpu = X86_CPU(cpu);
int ret;
assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu));
if (level >= KVM_PUT_RESET_STATE) {
ret = kvm_put_msr_feature_control(x86_cpu);
if (ret < 0) {
return ret;
... | 1threat |
static int local_mknod(FsContext *fs_ctx, V9fsPath *dir_path,
const char *name, FsCred *credp)
{
char *path;
int err = -1;
int serrno = 0;
V9fsString fullname;
char *buffer;
v9fs_string_init(&fullname);
v9fs_string_sprintf(&fullname, "%s/%s", dir_path->data,... | 1threat |
CSS selector for all elements starting with a prefix : <p>I have several polymer elements.</p>
<pre><code><ps-el-one/>
<ps-el-two/>
<ps-el-three/>
<ps-el-four/>
</code></pre>
<p>I want to be able to query all of the elements which begin with "ps-" with either a CSS selector or javaScript.</p>... | 0debug |
Jquery ajax not loading in same page : I'm trying to load my stripe payment success message when the form is submitted but for some reason the page always refreshes and then I get the display message. I don't want the page refresh though.
This is a javascript I'm working with (a mix of jquery and vanilla js)
... | 0debug |
Calculate time difference in word VBA : I would like to calculate the time difference between 2 cells and the result showing in the 3rd cell.
For instance, cell D2 showing 2pm and D1 showing 1pm and the difference in cell B2
Sub DetermineDuration()
Dim doc As Document
Dim rng As Range
Dim dtDur... | 0debug |
Immutability and collections : <p>Hello I've got a questation, is this bad approach to immutability? And if it is, why? I mean for me if you adding or removing items to or from collection, you are not changing the state of the object, it still has one and the same collection. It doesn't really matter how many and if co... | 0debug |
Why is it saying that the = in bold is an invalid syntax? : <pre><code>print('Select operation')
print('Choose from:')
print('+')
print('-')
print('*')
print('/')
choice=input('Enter choice (+,-,*,/):')
num1=int(input('Enter first number:'))
num2=int(input('Enter second number:'))
if choice== '+':
print(num1,'+',num... | 0debug |
static void block_job_ref(BlockJob *job)
{
++job->refcnt;
}
| 1threat |
static int mp_user_removexattr(FsContext *ctx,
const char *path, const char *name)
{
char buffer[PATH_MAX];
if (strncmp(name, "user.virtfs.", 12) == 0) {
errno = EACCES;
return -1;
}
return lremovexattr(rpath(ctx, path, buffer), name... | 1threat |
Fetching the server IP from URL : <p>Suppose I go on to some website from my chrome browser. Is it possible in any programing language like PHP, js to fetch the server IP of a webpage from its URL.
(for eg: like we do using NSlookup).
Is it possible to write a script to get the server IP of a webpage using its URL.</p... | 0debug |
qio_channel_command_new_spawn(const char *const argv[],
int flags,
Error **errp)
{
pid_t pid = -1;
int stdinfd[2] = { -1, -1 };
int stdoutfd[2] = { -1, -1 };
int devnull = -1;
bool stdinnull = false, stdoutnull = false;
QIOChan... | 1threat |
How to put script in a separate file? : <p>I have this code:</p>
<pre><code><!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
var txt = '{"name":"John", "city":"New York"}'
var obj = JSON.parse(txt);
document.getElementById("demo").innerHTML = obj.name;
</script>
<... | 0debug |
where did NUnit Gui Runner go? version 3.0.1 : <p>I just upgraded to version 3.0.1 from nunit 2.6.4. It used to have a NUnit Gui Runner, located here:</p>
<p><a href="https://i.stack.imgur.com/PNHqE.png"><img src="https://i.stack.imgur.com/PNHqE.png" alt="enter image description here"></a></p>
<p>After installing 3.0... | 0debug |
What's the right way to clear a bytes.Buffer in golang? : <p>I'm trying to clear a <code>bytes.Buffer</code>, but there's no such function in the document</p>
<p>Maybe I should just renew the buffer? What's the right way to do it?</p>
<pre><code>buffer = bytes.NewBufferString("")
buffer.Grow (30000)
</code></pre>
| 0debug |
Variance Inflation Factor in Python : <p>I'm trying to calculate the variance inflation factor (VIF) for each column in a simple dataset in python: </p>
<pre><code>a b c d
1 2 4 4
1 2 6 3
2 3 7 4
3 2 8 5
4 1 9 4
</code></pre>
<p>I have already done this in R using the vif function from the <a href="https://cran.r-pro... | 0debug |
how to create string and sum from A,B,C in javascript : how to make output from A,B,C and calculate all result, where AAAA = 1
AAAA AAAB AAAC AABA etc | 0debug |
static int ide_write_dma_cb(IDEState *s,
target_phys_addr_t phys_addr,
int transfer_size1)
{
int len, transfer_size, n;
int64_t sector_num;
transfer_size = transfer_size1;
for(;;) {
len = s->io_buffer_size - s->io_buffer_index;
... | 1threat |
sPAPRTCETable *spapr_tce_find_by_liobn(uint32_t liobn)
{
sPAPRTCETable *tcet;
if (liobn & 0xFFFFFFFF00000000ULL) {
hcall_dprintf("Request for out-of-bounds LIOBN 0x" TARGET_FMT_lx "\n",
liobn);
return NULL;
}
QLIST_FOREACH(tcet, &spapr_tce_tables, list) ... | 1threat |
How to convert node.js code to regular browser javascript? : <p>I don't know how to get a javascript file to work for web-browser functionalit, when it's coded as node.js.</p>
<p>The code in question is from a github <a href="https://github.com/svk31/graphenejs-lib" rel="noreferrer">graphenejs-lib</a>. I want to conve... | 0debug |
void visit_type_int16(Visitor *v, int16_t *obj, const char *name, Error **errp)
{
int64_t value;
if (!error_is_set(errp)) {
if (v->type_int16) {
v->type_int16(v, obj, name, errp);
} else {
value = *obj;
v->type_int(v, &value, name, errp);
... | 1threat |
change the background color of a given field only in a form : <p>Is it possible to target a particular text field in a form and change it's background & foreground color. Likewise different colors for different fields too.</p>
<p>It needs to use css and not js and also there is to be no inline html/code present.<... | 0debug |
Recycleview not scroll in nested scroolview android : I have using recycle view inside nested Scroll view but Recycle view not scroll down in nested scroll view.recycle view scroll down when keyboard open and new item add in recycle view | 0debug |
addStyleClass("sapUiSizeCompact"); after clicking a button in UI5 : I want to change the compact density with a button.
onInit: function () {
this.getView().addStyleClass("sapUiSizeCompact");
},
works well. If I will change it in a button, it does not work.
onOpenDialog: f... | 0debug |
Convert drawings in instructions for Java Swing paintComponent : <p>Would you know a software able to convert simple drawings (done with simple instructions that can be found in paintComponent like fillRectangle, drawLine... etc) into Java instructions?</p>
<p>I ask this question because I'm programming a Pacman game,... | 0debug |
cannot resolve symbol 'R' in android studio 3.3.1 : I am using android 3.3.1. I am currently taking an android development bootcamp online course on udemy. After I cloned the project from github to android studio (bitcoin-ticker), after the graddle files synchronize and project is loaded, when I open the MainActivity i... | 0debug |
static void drive_backup_prepare(BlkActionState *common, Error **errp)
{
DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common);
BlockBackend *blk;
DriveBackup *backup;
Error *local_err = NULL;
assert(common->action->type == TRANSACTION_ACTION_KIND_DRIVE_BACKUP);
backup =... | 1threat |
Can i reboot phone without root access on b4a? : How to reboot phone without root access on b4a?
Only need root access with ML library?
Pls help me, i m start learning in b4a.
Code:
Sub Globals
Dim M as MLfiles
End Sub
Sub Activity_Create(FirstTime As Boolean)
M.GetRoot
M.RootCmd("... | 0debug |
Is there a way to share a configMap in kubernetes between namespaces? : <p>We are using one namespace for the develop environment and one for the staging environment. Inside each one of this namespaces we have several configMaps and secrets but there are a lot of share variables between the two environments so we will ... | 0debug |
static int kvm_physical_sync_dirty_bitmap(MemoryRegionSection *section)
{
KVMState *s = kvm_state;
unsigned long size, allocated_size = 0;
KVMDirtyLog d;
KVMSlot *mem;
int ret = 0;
hwaddr start_addr = section->offset_within_address_space;
hwaddr end_addr = start_addr + int128_get64(s... | 1threat |
static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
{
InputStream *ist = NULL;
enum AVMediaType type = avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx);
int i;
if (type != AVMEDIA_TYPE_VIDEO && type != AVMEDIA_TYPE_AUDIO) {
av_log(NULL, AV_LOG_FATAL, "On... | 1threat |
void ff_vp3_h_loop_filter_c(uint8_t *first_pixel, int stride, int *bounding_values)
{
unsigned char *end;
int filter_value;
for (end= first_pixel + 8*stride; first_pixel != end; first_pixel += stride) {
filter_value =
(first_pixel[-2] - first_pixel[ 1])
+3*(first_pixel[... | 1threat |
Xamarin.Android Architecture Components: Not getting callbacks for lifecycle events : <p>I'm trying to use the architecture components package for detecting when the application enters background or foreground state. The problem is that the callbacks are not being invoked. In the sample code below, the methods <code>on... | 0debug |
static uint32_t isa_mmio_readl(void *opaque, target_phys_addr_t addr)
{
return cpu_inl(addr & IOPORTS_MASK);
}
| 1threat |
This code should reverse the string but i am not getting why is it not reversing the string? : class Solution:
def reverseString(self, s: List[str]) -> None:
if(len(s)<=1):
return
s[0],s[-1] = s[-1],s[0]
self.reverseString(s[1:-1])
this was a quest... | 0debug |
How can I define macros for the C++ intellisense engine? : <p>When using the <code>"Default"</code> intellisense engine, some of the symbols in my C++ project cannot be resolved. It turns out that it's because they are in headers where they are guarded by an <code>#ifdef</code> that depends on a macro passed to gcc wit... | 0debug |
[C++][SDL2]Segmentation fault before function entry, no apparent cause, can not find answer elsewhere : So, first I'll note that I am unable of finding a cause for this after an hour of debugging and googling. I have a function, that is supposed to load a few test assets and blit them onto screen using SDL2. This funct... | 0debug |
How to make angular div using html & css : I am using html, css, and bootstrap.
I have 2 horizontal divs:
<div class="container-fluid">
...div content...
</div>
<div class="container-fluid">
...div content...
</div>
They each have a background image, and I would like them to ... | 0debug |
I wnat when I open the slide menu hamburger icon disappears : I have this html code :
~
<div id="side-menu" class="side-nav" >
<a href="#" onclick="openSlideMenu()" >
<div id="open-slide">
<svg width="30" height="30" style="margin-left:-10px;">
<path d="M0 ,5 30 ,5" stroke="#003145... | 0debug |
Styled-component vs jss vs emotion for React : <p>I'm trying to understand the best choice (as a CTO) between</p>
<ul>
<li>jss</li>
<li>emotion</li>
<li>styled-component.</li>
</ul>
<p>I will try not to make the question "too wide" or "off-topic", because it's a very subjective topic. I'll try to answer (here) the qu... | 0debug |
dynamic semantic errors checking : <p>I read that dynamic semantic errors cannot be detected by the C compiler as semantic analysis phase catches only static semantic errors.</p>
<p>Then which component of C compiler does the checking of dynamic semantic errors?</p>
| 0debug |
static void gen_ld (CPUMIPSState *env, DisasContext *ctx, uint32_t opc,
int rt, int base, int16_t offset)
{
const char *opn = "ld";
TCGv t0, t1;
if (rt == 0 && env->insn_flags & (INSN_LOONGSON2E | INSN_LOONGSON2F)) {
MIPS_DEBUG("NOP");
return;
... | 1threat |
static void register_multipage(AddressSpaceDispatch *d, MemoryRegionSection *section)
{
target_phys_addr_t start_addr = section->offset_within_address_space;
ram_addr_t size = section->size;
target_phys_addr_t addr;
uint16_t section_index = phys_section_add(section);
assert(size);
add... | 1threat |
double parse_number_or_die(const char *context, const char *numstr, int type, double min, double max)
{
char *tail;
const char *error;
double d = av_strtod(numstr, &tail);
if (*tail)
error= "Expected number for %s but found: %s\n";
else if (d < min || d > max)
error= "The val... | 1threat |
How to print the following with php[preferred] or javaScript? : <p>So i was asked the following question in an interview. I was able to print the whole xxx thing. but it was not diagonal like the below one. I think it meant to have spaces prints through a loop. Can Someone please help me with this.</p>
<p>How to print... | 0debug |
static void vma_delete(struct mm_struct *mm)
{
struct vm_area_struct *vma;
while ((vma = vma_first(mm)) != NULL) {
TAILQ_REMOVE(&mm->mm_mmap, vma, vma_link);
qemu_free(vma);
}
qemu_free(mm);
}
| 1threat |
Gradle: No tests found : <p>When I am trying to run Android tests by executing:</p>
<pre><code>./gradlew connectedDebugAndroidTest
</code></pre>
<p>The following error occurs:</p>
<pre><code>com.android.builder.testing.ConnectedDevice > No tests found.[devicename] FAILED
No tests found. This usually means that yo... | 0debug |
How to join a table by a column with tilde separated values in sql server : I'm trying to match the codes/descriptions from table_2 to each company in table_1. The company_type_string column contains multiple codes separated by '~' that are supposed to match with the codes in table_2.
Table 1:
company company_type_... | 0debug |
How to obtain a position of last non-zero element : <p>I've got a binary variable representing if event happened or not:</p>
<pre><code>event <- c(0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0)
</code></pre>
<p>I need to obtain a variable that would indicate the time when the last event happened. The expected out... | 0debug |
How to Swap Two numbers using java script function with one parameter : My Requirement is
I want to display this output when I gave a(0) the output should come 5 and when I gave a(5) the output should come 0.
a(0) = 5
a(5) = 0
like this
Hint:
Using this function
function A(num){} like this
Please Help me h... | 0debug |
Generating and accessing stored procedures using Entity framework core : <p>I am implementing Asp.Net core Web API , entity framework core, database first approach using Visual Studio 2017. I have managed to generate the context and class files based on an existing database. I need to access stored procedures using my ... | 0debug |
cursor.execute('SELECT * FROM users WHERE username = ' + user_input) | 1threat |
PYTHON TKINTER entry float 8,2 : I have the need with tkinter python, to define an entry field that only accepts a float field with 8 integers and 2 decimals, perhaps with an error message if it does not respect the format 8.2. You can help me define a format for this field.
Thanks in advance . Greetings . Paul | 0debug |
What is `export type` in Typescript? : <p>I notice the following syntax in Typescript.</p>
<pre><code>export type feline = typeof cat;
</code></pre>
<p>As far as I know, <code>type</code> is not a <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" rel="noreferrer">built-in basic type</a>, nor it ... | 0debug |
void ff_put_h264_qpel4_mc20_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_hz_4w_msa(src - 2, stride, dst, stride, 4);
}
| 1threat |
Best resources for learning Machine Learning for beginners : <p>I am keen in learning machining learning. I know programming, just want to know some useful sites which will help in understanding the concepts of machine learning with simple examples.</p>
| 0debug |
void event_loop(void)
{
SDL_Event event;
double incr, pos, frac;
for(;;) {
SDL_WaitEvent(&event);
switch(event.type) {
case SDL_KEYDOWN:
switch(event.key.keysym.sym) {
case SDLK_ESCAPE:
case SDLK_q:
do_exit();
... | 1threat |
Suspend function 'callGetApi' should be called only from a coroutine or another suspend function : <p>I am calling suspended function from onCreate(...)</p>
<pre><code>override fun onCreate(savedInstanceState: Bundle?) {
...
...
callGetApi()
}
</code></pre>
<p>and the suspended function is:-</p>
<pre><co... | 0debug |
static inline void assert_fp_access_checked(DisasContext *s)
{
#ifdef CONFIG_DEBUG_TCG
if (unlikely(!s->fp_access_checked || !s->cpacr_fpen)) {
fprintf(stderr, "target-arm: FP access check missing for "
"instruction 0x%08x\n", s->insn);
abort();
}
#endif
}
| 1threat |
static void fill_float_array(AVLFG *lfg, float *a, int len)
{
int i;
double bmg[2], stddev = 10.0, mean = 0.0;
for (i = 0; i < len; i += 2) {
av_bmg_get(lfg, bmg);
a[i] = bmg[0] * stddev + mean;
a[i + 1] = bmg[1] * stddev + mean;
}
}
| 1threat |
When I put 'wet' into the code it can't find the notepad document. The notepad document is called notepad : The code is not finding the notepad document, please help
SEND_REPORT_TUPLE = ('wet', 'water', 'liquid')
#make a list from the input
input_list = answer.split(" ")
#And then the use any ... | 0debug |
can i use span tag for making html email templates? : This is html email templates. I don't know gmail,yahoo,hotmail,outlook is span tag and br-line-break is supported or not? Please give your valuable answare. thanks
[enter image description here][1]
[1]: https://i.stack.imgur.com/IR4Ls.png | 0debug |
static void iohandler_init(void)
{
if (!iohandler_ctx) {
iohandler_ctx = aio_context_new(&error_abort);
}
}
| 1threat |
MATLAB - Working with multiple multiple elements : 'Simple' question.
Say I had y=sin(x) where **x is made up of multiple elements** say x=(1:1:5). Now my question: how do I **solve for all elements** in a variable z where all I know is z=cos(y)?
Using just MATLAB code, please no algebraic manipulation.
Than... | 0debug |
How to overwrite angular 2 material styles? : <p>I have this select in angular material:</p>
<p><a href="https://i.stack.imgur.com/cAOsA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cAOsA.png" alt="enter image description here"></a></p>
<p>Its code :</p>
<pre><code><md-select placeholder="Descuentos ... | 0debug |
Edit text should allow text if a. alphabet +number b. alphabet +special charterer c. alphabet only in Android : I am trying to generate a regular expression in Android which can satisfy following conditions:
Edit text can accept:
1. Alphabet only
2. Combination of Alphabet and number
3. Combination of Alphabet ... | 0debug |
Base R horizontal legend - with multiple rows : <p>I wish to create a horizontal legend with multiple rows using base R (not ggplot).
There is an option for multiple columns but not multiple rows in legend(). Is there a way to do this? Example to play with below where the horizontal legend it too wide for the plot.</p>... | 0debug |
Kotlin Map with non null values : <p>Let say that I have a Map for translating a letter of a playing card to an integer </p>
<pre><code> val rank = mapOf("J" to 11, "Q" to 12, "K" to 13, "A" to 14)
</code></pre>
<p>When working with the map it seems that I always have to make a null safety check even though the Map a... | 0debug |
What exactly is the timeout value in React CSS Transition Group doing? : <p>I've been reading the official docs for <a href="https://facebook.github.io/react/docs/animation.html" rel="noreferrer">React Animations (React CSS Transition Group)</a>, but I'm a little unclear as to what the timeout values are used for - esp... | 0debug |
how to present a frequency table from Rstudio in MS Word nicely : So, I copied this frequency table from R in MS Word:
I A I B II A II B III A III A III B IV
128 73 61 59 1 166 86 463
How can I make it look nicer in a MS Word document?
No Latex please... | 0debug |
static void kvm_supported_msrs(CPUState *env)
{
static int kvm_supported_msrs;
int ret;
if (kvm_supported_msrs == 0) {
struct kvm_msr_list msr_list, *kvm_msr_list;
kvm_supported_msrs = -1;
msr_list.nmsrs = 0;
ret = kvm_ioctl(env->kvm_state, KVM... | 1threat |
What should I do in order to retain the text view values in Android? : I have two text views on my home page of the app.And I have two buttons which launches new activities. And I am taking the values of text view from the two respective activities and then using intent passing the data back to the main activity .But w... | 0debug |
Python - Breaking a Word into a given list of "syllables" : I'm trying to write a function in Python that will return True or False based on string matching to see if a given list of "syllables" mixed and matched can form a word.
The two inputs would be the word and the list of syllables.
Some examples:
... | 0debug |
void hmp_info_memdev(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
MemdevList *memdev_list = qmp_query_memdev(&err);
MemdevList *m = memdev_list;
StringOutputVisitor *ov;
char *str;
int i = 0;
while (m) {
ov = string_output_visitor_new(false);
visit_typ... | 1threat |
C# Use textbox value in another cs file : I'd like to add a WinForm into my Console App:
namespace ExchangeNativeDemo.Window
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object... | 0debug |
static inline int is_sector_in_chunk(BDRVDMGState* s,
uint32_t chunk_num,int sector_num)
{
if(chunk_num>=s->n_chunks || s->sectors[chunk_num]>sector_num ||
s->sectors[chunk_num]+s->sectorcounts[chunk_num]<=sector_num)
return 0;
else
return -1;
}
| 1threat |
static int vc1_init_common(VC1Context *v)
{
static int done = 0;
int i = 0;
static VLC_TYPE vlc_table[32372][2];
v->hrd_rate = v->hrd_buffer = NULL;
if (!done) {
INIT_VLC_STATIC(&ff_vc1_bfraction_vlc, VC1_BFRACTION_VLC_BITS, 23,
ff_vc1_bfraction_bits... | 1threat |
static uint8_t usb_linux_get_alt_setting(USBHostDevice *s,
uint8_t configuration, uint8_t interface)
{
char device_name[64], line[1024];
int alt_setting;
sprintf(device_name, "%d-%s:%d.%d", s->bus_num, s->port,
(int)configuration, (int)interface);
if (!usb_host_read_file(line,... | 1threat |
.sqlite file no more available in documents folder - Swift 5 : <p>The sqlite file related to coredata is no more available in the documents directory.</p>
<p>Found it is present inside <code>/Library/Application Support</code></p>
<p>How to search for that url in proper way?</p>
| 0debug |
C# Win Forms game. Ground Collision : I have tried searching for an answer but i have not found anything. I'm making this 2d game in c# where i want the player to be pulled down by the force which increases by gravity each time the function in called (inside a while loop). For some reason the code will not stop when th... | 0debug |
int ff_h263_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
UINT8 *buf, int buf_size)
{
MpegEncContext *s = avctx->priv_data;
int ret,i;
AVFrame *pict = data;
float new_aspect;
#ifdef PRINT_FRAME_TIME
uint64_t tim... | 1threat |
PHP loop trough JSON repsonce and insert into MYSQL : for a school project i want to loop trough a json responce and insert the data into a mysql database.
The json responce looks like this:
ID 123456
data
0
updated_at 1234567890123
total
last
avg_daily_volume
... | 0debug |
How 2 fragments communicate each other inside an activity : <p>Consider an activity we can call as a base activity. Two fragments are added to this base activity , call as fragmentOne and fragentTwo.How can fragmentOne can communicate with fragentTwo and vice versa .</p>
| 0debug |
static void apply_mdct(AC3EncodeContext *s)
{
int blk, ch;
for (ch = 0; ch < s->channels; ch++) {
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
AC3Block *block = &s->blocks[blk];
const SampleType *input_samples = &s->planar_samples[ch][blk * AC3_BLOCK_SIZE];
... | 1threat |
static void outport_write(KBDState *s, uint32_t val)
{
DPRINTF("kbd: write outport=0x%02x\n", val);
s->outport = val;
if (s->a20_out) {
qemu_set_irq(*s->a20_out, (val >> 1) & 1);
}
if (!(val & 1)) {
qemu_system_reset_request();
}
}
| 1threat |
void qmp_guest_file_close(int64_t handle, Error **err)
{
GuestFileHandle *gfh = guest_file_handle_find(handle, err);
int ret;
slog("guest-file-close called, handle: %ld", handle);
if (!gfh) {
return;
}
ret = fclose(gfh->fh);
if (ret == -1) {
error_set(err, QERR_... | 1threat |
static uint64_t kvm_apic_mem_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
return ~(uint64_t)0;
}
| 1threat |
void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,
AcpiCpuHotplug *gpe_cpu, uint16_t base)
{
CPUState *cpu;
CPU_FOREACH(cpu) {
acpi_set_cpu_present_bit(gpe_cpu, cpu, &error_abort);
}
memory_region_init_io(&gpe_cpu->io, owner, &AcpiCp... | 1threat |
specify sysctl values using docker-compose : <p>I am trying to set a few sysctl values.<br>
Basically the following </p>
<pre><code>sysctl -w \
net.ipv4.tcp_keepalive_time=300 \
net.ipv4.tcp_keepalive_intvl=60 \
net.ipv4.tcp_keepalive_probes=9
</code></pre>
<p>in a docker container.<br>
When log into to the ... | 0debug |
static void nvme_rw_cb(void *opaque, int ret)
{
NvmeRequest *req = opaque;
NvmeSQueue *sq = req->sq;
NvmeCtrl *n = sq->ctrl;
NvmeCQueue *cq = n->cq[sq->cqid];
block_acct_done(blk_get_stats(n->conf.blk), &req->acct);
if (!ret) {
req->status = NVME_SUCCESS;
} else {
... | 1threat |
bool trace_init_backends(void)
{
#ifdef CONFIG_TRACE_SIMPLE
if (!st_init()) {
fprintf(stderr, "failed to initialize simple tracing backend.\n");
return false;
}
#ifdef CONFIG_TRACE_FTRACE
if (!ftrace_init()) {
fprintf(stderr, "failed to initialize ftrace backend.\n");
return ... | 1threat |
static const char *io_port_to_string(uint32_t io_port)
{
if (io_port >= QXL_IO_RANGE_SIZE) {
return "out of range";
}
static const char *io_port_to_string[QXL_IO_RANGE_SIZE + 1] = {
[QXL_IO_NOTIFY_CMD] = "QXL_IO_NOTIFY_CMD",
[QXL_IO_NOTIFY_CURSOR] = "QXL_I... | 1threat |
PHP + MySQL/MariaDB + avoid race condition : <p>I've developed a web application using Apache, MySQL and PHP.</p>
<p>This web app allows multiple users' to login to the application.
Then, through the application, they have access to the Database.</p>
<p>Since race conditions may apply when two or more users try to SE... | 0debug |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.