problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
Add another user for remote access Windows 10 : <p>So, I created remote access from my lap top to server(Windows 10). Now, how can I add more users, so they can log in from their lap tops with their microsoft accounts or whatever accounts they have?</p>
| 0debug |
C# Not responding : I would just like to say that this is my first windows form application so bare with me :)
**What the application should do**
This application should take the input of time (seconds, minutes and hours) and shutdown the computer after that time. It should also update the text box with how long ... | 0debug |
@CreationTimestamp and @UpdateTimestamp : <p>This is my blog class </p>
<pre><code>@Entity
@Component
@Table
public class Blog implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
private String id;
private String name;
private String Description;
@CreationTimestamp
private Dat... | 0debug |
Swift 5: 'substring(to:)' is deprecated : <p>I`m newbie in Swift and I have simple code, that cut string from the end to special characters "$2F" and returned cutted off string:</p>
<pre><code> let index2 = favUrlString.range(of: "%2F", options: .backwards)?.lowerBound
favUrlString = index2.map(favUrlString.su... | 0debug |
calculate time diffrence in pl/sql with shifts : i have two table
the first table contains the record of a ticket with start date and end date.
start_date | End_Date
21-02-2017 07:52:32 | 22-02-2017 09:56:32
21-02-2017 09:52:32 | 23-02-2017 17:52:32
the second table contains the details of the we... | 0debug |
void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, int sx, int sy, int b_w, int b_h, BlockNode *block, int plane_index, int w, int h){
if(block->type & BLOCK_INTRA){
int x, y;
const unsigned color = block->color[plane_index];
const unsigned color4 = color*0x... | 1threat |
How can I add Offline google maps on website that I am creating : <p>I am building a website which will be used in sea with no internet access and I need to show google maps and draw a path on it.</p>
<p>Can you tell me how can I implement the offline google maps on the website?</p>
<p>Thanks in advance!
Cheers</p>
| 0debug |
Taking input of a graph from text file in java till the end of file : <p>I have an input file which contains a weighted graph.</p>
<pre><code>a b 2
a c 8
a d 14
b f 19
b d 25
c d 21
d g 13
d f 17
e f 9
e g 1
f g 5
</code></pre>
<p>In each line first two inputs define nodes and third input defines the weight of edge b... | 0debug |
void hmp_pci_add(Monitor *mon, const QDict *qdict)
{
PCIDevice *dev = NULL;
const char *pci_addr = qdict_get_str(qdict, "pci_addr");
const char *type = qdict_get_str(qdict, "type");
const char *opts = qdict_get_try_str(qdict, "opts");
if (!strncmp(pci_addr, "pci_addr=", 9)) {
... | 1threat |
ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host,
MemoryRegion *mr, Error **errp)
{
RAMBlock *new_block;
ram_addr_t addr;
Error *local_err = NULL;
size = TARGET_PAGE_ALIGN(size);
new_block = g_malloc0(sizeof(*new_block));
new_block->mr =... | 1threat |
Invalid syntax error in an `if` statement which I am unable to understand? : <p>I went line by line and came up to this error.</p>
<blockquote>
<p>SyntaxError: invalid syntax</p>
</blockquote>
<p>In, the <code>emailRegex</code> gets highlighted</p>
<p><code>if cell.value and isinstance(cell.value, str) emailRegex.... | 0debug |
How to fetch a query to get the following data? : <p>List the names and designation of those employees whose salary is greater than 2000 and address is US.</p>
| 0debug |
def check_monthnumber(monthname3):
if monthname3 =="April" or monthname3== "June" or monthname3== "September" or monthname3== "November":
return True
else:
return False | 0debug |
JavaScript functions fire in codepen but not JSFiddle. Why? : <p>I'm trying to run a basic JavaScript function from an external file but I'm getting inconsistent results. Basically, I can't get a button's "onclick" event to fire when I put the script in an external JS page. I can get it work in CodePen:</p>
<p><a href... | 0debug |
static void bmdma_map(PCIDevice *pci_dev, int region_num,
pcibus_t addr, pcibus_t size, int type)
{
PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, pci_dev);
int i;
for(i = 0;i < 2; i++) {
BMDMAState *bm = &d->bmdma[i];
d->bus[i].bmdma = bm;
bm->bus = d->bu... | 1threat |
static int encode_packet(Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, int precno,
uint8_t *expn, int numgbits)
{
int bandno, empty = 1;
*s->buf = 0;
s->bit_index = 0;
for (bandno = 0; bandno < rlevel->nbands; bandno++){
if (rlevel-... | 1threat |
Python: Multiple packages in one repository or one package per repository? : <p>I have a big Python 3.7+ project and I am currently in the process of splitting it into multiple packages that can be installed separately. My initial thought was to have a single Git repository with multiple packages, each with its own set... | 0debug |
ssize_t vnc_client_read_buf(VncState *vs, uint8_t *data, size_t datalen)
{
ssize_t ret;
#ifdef CONFIG_VNC_TLS
if (vs->tls.session) {
ret = vnc_client_read_tls(&vs->tls.session, data, datalen);
} else {
#endif
ret = qemu_recv(vs->csock, data, datalen, 0);
#ifdef CONFIG_VNC_TLS
... | 1threat |
static void boston_mach_init(MachineState *machine)
{
DeviceState *dev;
BostonState *s;
Error *err = NULL;
const char *cpu_model;
MemoryRegion *flash, *ddr, *ddr_low_alias, *lcd, *platreg;
MemoryRegion *sys_mem = get_system_memory();
XilinxPCIEHost *pcie2;
PCIDevice *ahci;
... | 1threat |
How to dynamic custom menu "Home icon button on blogspot : Boss,
I need help about Blogspot. I have created a custom menu for my client. I added home icon on home tab.
But, now problem is, when i click on home icon, it not going to main page exp:"mysite.blogspot.com". It showing me others link like this--> exp: ... | 0debug |
C pointer arithmetic confusion : <p>I have to answer if the following code compiles and which are the results:</p>
<pre><code>char *s1 = "A String";
char *s2 = "Other String";
*s1 = *s2;
</code></pre>
<p>I didnt really find what happens in the background when you do declarations like that. Is s1 pointing to memory lo... | 0debug |
Printf with unfixed length : <p>I need to </p>
<blockquote>
<p>printf(%?d)</p>
</blockquote>
<p>Where '?' is some int. How can I do it?
I'm using pure c.
I've tried to work with const char* array. But there was no result.</p>
| 0debug |
Adding item in RecyclerView Fragment : <p>Apologies first of all because it is going to be a long question.</p>
<p>I am creating a to do list using 2 RecyclerViews in 2 fragments following is the code.</p>
<p>MainActivity.java</p>
<pre><code>public class MainActivity extends AppCompatActivity {
/**
* The {@link an... | 0debug |
assign variable only if it is null : <p>on Ruby one have something like this:</p>
<pre><code>@var ||= 'value'
</code></pre>
<p>basically, it means that <code>@var</code> will be assigned <code>'value'</code> only if <code>@var</code> is not assigned yet (e.g. if <code>@var</code> is <code>nil</code>)</p>
<p>I'm loo... | 0debug |
How to trim unwanted fields in a JavaScript object? : For example, I have
const eva = {name: "Eva", age: 3, hobby: "dance", state: "NY"};
const ann = {name: "Ann", age: 9, hobby: "read", state: "WA", schoolyear: 3};
I want to have a trim function, which only keeps the fields I want.
cosnt fields =... | 0debug |
How can i clear the quantity and price field when i select no product in the drop down? : When i select product from the drop down price and quantity came out from the database and when i Select the option **SELECT MOTHERBOARD** that have no value so that quantity and price field should be empty but the quantity field ... | 0debug |
Apache Commons IO - Encrypt download from Website : <p>With Apache Commons Io you can download Files from the Internet (<code>FileUtils.copyURLToFile(URL, File)</code>). But is this download encrypted? If no how can I encrypt a download from the Internet? </p>
<p>PS: I want to download from a Website/Filehost like Med... | 0debug |
roc_auc_score - Only one class present in y_true : <p>I am doing a k-fold XV on an existing dataframe, and I need to get the AUC score.
The problem is - sometimes the test data only contains 0s, and not 1s!</p>
<p>I tried using <a href="http://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_auc_score.htm... | 0debug |
Solving Http Status 500 Servlet Exeution threw an exeption for Simple Login Servlet : /* hi here is the code for simple login servlet in eclips which checks username and password from the existing table of database and take it to home page if exists or send to login page. When I run it on server and put information i... | 0debug |
BlockDriverState *bdrv_next_node(BlockDriverState *bs)
{
if (!bs) {
return QTAILQ_FIRST(&graph_bdrv_states);
}
return QTAILQ_NEXT(bs, node_list);
}
| 1threat |
static void vgafb_update_display(void *opaque)
{
MilkymistVgafbState *s = opaque;
SysBusDevice *sbd;
DisplaySurface *surface = qemu_console_surface(s->con);
int first = 0;
int last = 0;
drawfn fn;
if (!vgafb_enabled(s)) {
return;
}
sbd = SYS_BUS_DEVICE(s);
... | 1threat |
static inline void t_gen_subx_carry(DisasContext *dc, TCGv d)
{
if (dc->flagx_known) {
if (dc->flags_x) {
TCGv c;
c = tcg_temp_new(TCG_TYPE_TL);
t_gen_mov_TN_preg(c, PR_CCS);
tcg_gen_andi_tl(c, c, C_FLAG);
tcg_gen_sub_tl(d, d, c);
tcg_temp_free(c);
}
} else {
TCG... | 1threat |
Ionic - ion-item text is not vertically centered when ion-icon is bigger : <p>I have a list of ion-items with an icon followed by text. When the icon size is smaller as seen on the image below, the text seems to vertically align itself to the center of the ion-item. But when the icon is bigger, the alignment is a bit o... | 0debug |
Login with Facebook sdk not getting email on swift 4 : When login with Facebook sdk email not getting, only getting name and picture. | 0debug |
CoreData ManagedObjectContext Recursive Save Error : <p>Some users of mine are encountering a CoreData error when performing a save. I haven't been able to find any information online about this error or how to symbolicate the stack trace.</p>
<p>The error message is <code>attempt to recursively call -save: on the con... | 0debug |
it is possible to find data accoding to date in spring : I'm trying to find data according to date throw the exception **java.lang.IllegalArgumentException: null**
@SuppressWarnings("deprecation")
@GetMapping("/product-DateList/{pathDate}")
public ModelAndView getFindByDateOfPurchase(@PathVariable("p... | 0debug |
My Date Formatter Isn't Showing Correct Day : I am trying to show today's date as March 26 but it is showing as "March 85" when I use this code. I am not sure why.
let formatter = DateFormatter()
formatter.dateFormat = "MMMM DD"
let defaultTimeZoneStr = formatter.string(from: NSDate() as Da... | 0debug |
static void bt_dummy_lmp_disconnect_master(struct bt_link_s *link)
{
fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __func__);
exit(-1);
}
| 1threat |
static uint32_t hpet_ram_readw(void *opaque, target_phys_addr_t addr)
{
printf("qemu: hpet_read w at %" PRIx64 "\n", addr);
return 0;
}
| 1threat |
What is the use of autoscroll to source and and autoscroll from source features in Intellij IDEs? : <p>I was looking for how to show the open files in project view and found theses two features, I want to know what does the above mentioned features do?</p>
| 0debug |
C# WebClient NTLM authentication starting for each request : <p>Consider a simple C# NET Framework 4.0 application, that:</p>
<ul>
<li>uses WebClient</li>
<li>authenticates using NTLM (tested on IIS 6.0 and IIS 7.5 server)</li>
<li>retrieves a string from an URL multiple times using DownloadString()</li>
</ul>
<p>Her... | 0debug |
void do_migrate_set_speed(Monitor *mon, const QDict *qdict)
{
double d;
char *ptr;
FdMigrationState *s;
const char *value = qdict_get_str(qdict, "value");
d = strtod(value, &ptr);
switch (*ptr) {
case 'G': case 'g':
d *= 1024;
case 'M': case 'm':
d *= 1024;
... | 1threat |
static void dequantization_int_97(int x, int y, Jpeg2000Cblk *cblk,
Jpeg2000Component *comp,
Jpeg2000T1Context *t1, Jpeg2000Band *band)
{
int i, j;
int w = cblk->coord[0][1] - cblk->coord[0][0];
for (j = 0; j < (cblk->coord[1][1] - cblk->co... | 1threat |
Where to put images in a react-native project? : <p>I am working on a react-native project and we are putting images currently in <code>/images/</code> folder. Is it a good path for them ? Is there any best practice? </p>
<p><a href="https://i.stack.imgur.com/Spym8.png" rel="noreferrer"><img src="https://i.stack.imgur... | 0debug |
WARNING: API 'variant.getMappingFile()' is obsolete and has been replaced with 'variant.getMappingFileProvider()' : <p>I just updated Android Studio 3.5 to Android Studio 3.6 and replaced previous Gradle plugin with Gradle plugin 3.6.0 when syncing Gradle:</p>
<blockquote>
<p>build.gradle: API 'variant.getMappingFil... | 0debug |
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
{
BC_STATUS ret;
BC_DTS_STATUS decoder_status = { 0, };
CopyRet rec_ret;
CHDContext *priv = avctx->priv_data;
HANDLE dev = priv->dev;
uint8_t *in_data = avpkt->data;
int len =... | 1threat |
Inline variable declaration doesn't compile when using '== false' instead of negation operator : <p>Consider the following snippets:</p>
<pre><code>void Foo(object sender, EventArgs e)
{
if (!(sender is ComboBox comboBox)) return;
comboBox.DropDownWidth = 100;
}
</code></pre>
<p>compared to</p>
<pre><code>vo... | 0debug |
uint32_t vfio_pci_read_config(PCIDevice *pdev, uint32_t addr, int len)
{
VFIOPCIDevice *vdev = DO_UPCAST(VFIOPCIDevice, pdev, pdev);
uint32_t emu_bits = 0, emu_val = 0, phys_val = 0, val;
memcpy(&emu_bits, vdev->emulated_config_bits + addr, len);
emu_bits = le32_to_cpu(emu_bits);
if (emu_b... | 1threat |
int ff_vaapi_commit_slices(FFVAContext *vactx)
{
VABufferID *slice_buf_ids;
VABufferID slice_param_buf_id, slice_data_buf_id;
if (vactx->slice_count == 0)
return 0;
slice_buf_ids =
av_fast_realloc(vactx->slice_buf_ids,
&vactx->slice_buf_ids_alloc,
... | 1threat |
can't edit .bashrc while it is already present in the directory : <p>I'm setting up zsh in my Windows subsystem for Linux in my windows 10 machine by following some tutorial which instructs on opening my bash profile by the following command </p>
<pre><code>vim~/.bashrc
</code></pre>
<p>but it says</p>
<pre><code>ba... | 0debug |
How run the "OSM Map Tile Packager"? : I cloned this [repository](https://github.com/osmdroid/osmdroid).
I need run this project "OSM Map Tile Packager". I don't understand how to do that.
How run the "OSM Map Tile Packager"?
I use IDE Android Studio.
That I to do? | 0debug |
VSTS 2015 Current user-issues in using features of VSTS 2015 : Issues using features of VSTS 2015 where if two users are connected to same VM(work station) concurrently and trying to access Visual studio 2015 (work station Name : DevBOX).
could you please explain that if 2 users are accessing same VM concurrently an... | 0debug |
How to wait Func<T>().invoike in C# : I have a method to show loading form with parameter Func<T> and in that method I use func.Invoke(); this.Close();
but in this cast this.Close(); not waiting for func.Invoke to finish.
Help me please. :)
private void ShowLoading<T>(Func<T> func)
{
fu... | 0debug |
Why can my ```first_pay``` not be defined? My ```second_pay``` works fine : The goal here is to calculate a salesperson's total pay for selling two vehicles, each one of any type. When they sell a new vehicle, they make $1,500. When they sell a used vehicle, they make a commission of 5% of the vehicle price. I have to ... | 0debug |
Downgrade kubectl version to match minikube k8s version : <p>I started minikube with k8s version 1.5.2 and I would like to downgrade my kubectl so that it is also 1.5.2. Currently when I run <code>kubectl version</code> I get:</p>
<pre><code>Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitC... | 0debug |
static bool acpi_has_nvdimm(void)
{
PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
return pcms->nvdimm;
}
| 1threat |
Keyof nested child objects : <p>I have a recursively typed object that I want to get the keys of and any child keys of a certain type.</p>
<p>For instance. Below I want to get a union type of:</p>
<pre><code>'/another' | '/parent' | '/child'
</code></pre>
<p>Example: </p>
<pre><code>export interface RouteEntry {
... | 0debug |
How to change directory and run command on that directory? : <p>Example: I want to change directory to : C:/temp/hacking/passsword
and execute a command like that : java Helloworld arg1 arg2
How can I do this with java?</p>
| 0debug |
Can lazy-loaded modules share the same instance of a service provided by their parent? : <p>I've just run into a problem with a lazy-loaded module where parent and child module both require the same service but create an instance each. The declaration is identical for both, that is</p>
<pre><code>import { MyService } ... | 0debug |
Sorting JS Array : I have the following Js array:
myArr = [[["One"],["First","Fourth","Third"]],
[["Two"],["First","Second","Third"]],
[["Three"],["First","Third"]],
[["One two"],["Fourth","Second","Third"]],
[["One three"],["Fourth","Third"]],
... | 0debug |
Debounce function implemented with promises : <p>I'm trying to implement a debounce function that works with a promise in javascript. That way, each caller can consume the result of the "debounced" function using a Promise. Here is the best I have been able to come up with so far:</p>
<pre><code>function debounce(inne... | 0debug |
static av_cold int flac_encode_init(AVCodecContext *avctx)
{
int freq = avctx->sample_rate;
int channels = avctx->channels;
FlacEncodeContext *s = avctx->priv_data;
int i, level;
uint8_t *streaminfo;
s->avctx = avctx;
dsputil_init(&s->dsp, avctx);
if (avctx->sample_fmt != ... | 1threat |
vreader_get_reader_by_name(const char *name)
{
VReader *reader = NULL;
VReaderListEntry *current_entry = NULL;
vreader_list_lock();
for (current_entry = vreader_list_get_first(vreader_list); current_entry;
current_entry = vreader_list_get_next(current_entry)) {
VReader *crea... | 1threat |
Change a field in a Django REST Framework ModelSerializer based on the request type? : <p>Consider this case where I have a <code>Book</code> and <code>Author</code> model. </p>
<p>serializers.py</p>
<pre><code>class AuthorSerializer(serializers.ModelSerializer):
class Meta:
model = models.Author
... | 0debug |
static void IMLT(float *pInput, float *pOutput, int odd_band)
{
int i;
if (odd_band) {
for (i=0; i<128; i++)
FFSWAP(float, pInput[i], pInput[255-i]);
}
ff_imdct_calc(&mdct_ctx,pOutput,pInput);
dsp.vector_fmul(pOutput,mdct_window,5... | 1threat |
Conversion into proper date format : I've a system generated date and time format. It looks something like this, "2017-04-12-02.29.25.000000" . I want to convert this format into a standard one so that my system can read this and later on I can convert it into minutes. Someone please help to provide a code in R. | 0debug |
Three.js how add cicle in center of scene : i work with sphere img and use for it Threejs and i need add some small obj like aim in center of sphere, and when i will move scene this obj should be always in center of scene. | 0debug |
Invalid arguments ' in c++ : when i try to use get functions that I built i get that error .
here is an example from my code :
class Apartment{
public :
class ApartmentException : public std::exception {};
class IllegalArgException : public ApartmentException {};
class OutOfApartmentB... | 0debug |
static void dvbsub_parse_object_segment(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
DVBSubContext *ctx = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
const uint8_t *block;
int object_id;
DVBSubObject *object;
DVBSubOb... | 1threat |
static void blend_image_rgb_pm(AVFilterContext *ctx, AVFrame *dst, const AVFrame *src, int x, int y)
{
blend_image_packed_rgb(ctx, dst, src, 0, x, y, 1);
}
| 1threat |
when i scroll down it always load more the same data? : Can anyone help me? i want to load more data when scroll up and down by using Asyntask.i try to use this code but it load only more 10 data when i scroll down besides that, it displays the same data. it doesn't load new data.
here my code:
<pre>
@Nulla... | 0debug |
Can anyone speed up this code : This code 8 cells from a data entry form and copies those cells to the next empty row on another worksheet that is used as a database. It works perfectly except that it takes 15 seconds to run. I know that I can speed up the code if it didn't copy to another sheet. It that scenario it... | 0debug |
static int xhci_ep_nuke_one_xfer(XHCITransfer *t, TRBCCode report)
{
int killed = 0;
if (report && (t->running_async || t->running_retry)) {
t->status = report;
xhci_xfer_report(t);
}
if (t->running_async) {
usb_cancel_packet(&t->packet);
t->running_async = 0... | 1threat |
static void sch_handle_start_func_virtual(SubchDev *sch)
{
PMCW *p = &sch->curr_status.pmcw;
SCSW *s = &sch->curr_status.scsw;
int path;
int ret;
bool suspend_allowed;
path = 0x80;
if (!(s->ctrl & SCSW_ACTL_SUSP)) {
ORB *orb = &sch->orb;
s->cst... | 1threat |
In Mongo what is the difference between $near and $nearSphere? : <p>I read the docs and its not very clear what the difference is between the two.</p>
<p>The only difference I found is that in nearSphere it explicitly says that Mongo calculates distances for $nearSphere using spherical geometry. But this is achievable... | 0debug |
int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
{
int i, oi, oi_next, num_insns;
#ifdef CONFIG_PROFILER
{
int n;
n = s->gen_last_op_idx + 1;
s->op_count += n;
if (n > s->op_count_max) {
s->op_count_max = n;
}
n = s->nb_temps;
... | 1threat |
How do I the site logo depending on the URL the request was made from? : <p>I created a product registration page using ASP.Net MVC. I need to implement the same product registration page for subsidiaries (maybe 3 or 4) with a few minor changes to the way the site looks. For example, the logo will be different and some... | 0debug |
What is a purpose of Zap Functor and zap function in Haskell? : <p>I came across <a href="https://hackage.haskell.org/package/category-extras-0.53.5/docs/Control-Functor-Zap.html">this construction</a> in Haskell. I couldn't find any examples or explanations of how can I use <code>zap</code>/<code>zapWith</code> and <c... | 0debug |
I want to calculate the average of the last 6 months in MySQL : [calculate the average of the last 6 months in MySQL.][1]
[1]: https://i.hizliresim.com/z0ZOq9.png
sample code : `select avg(dt.number_of_employees) from (select number_of_employees from my_table order by date desc limit 1,6) dt;`
but did not ... | 0debug |
Configure ngrok's CORS headers : <p>I am running a local webserver, which runs an XHR request to an ngrok server, also run from my PC. </p>
<p>I'm getting <code>XMLHttpRequest cannot load http://foo.ngrok.io/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000'... | 0debug |
How to set checked item in checkedlistbox with string seprated comma - c# : I have problem to select item from string separated comma and check item in checkedlistbox
**How can I select item from string separated comma and then check in checkedlistbox?**
[preview my program][1]
**download My project from this ... | 0debug |
Why would I choose a Windows Service over a Web API service? : <p>For me, Windows Services are inconvenient and cumbersome enough to question their validity in all apps that aren't "Watch this folder for a change, react to this change."</p>
<p>I understand that this oversimplification is ignorant, why would one choose... | 0debug |
How to avoid NRE when reading the tag of a button C# : <p>(Sobbing out of frustration)</p>
<p>How do you avoid annoying NRE in this case? The output of the code is correct, but I wish to get rid of the NRE.</p>
<p>Background:</p>
<p>There are some buttons on a form, some of which represent seats of a classroom. The ... | 0debug |
import math
def volume_sphere(r):
volume=(4/3)*math.pi*r*r*r
return volume | 0debug |
static void event_loop(VideoState *cur_stream)
{
SDL_Event event;
double incr, pos, frac;
for (;;) {
double x;
refresh_loop_wait_event(cur_stream, &event);
switch (event.type) {
case SDL_KEYDOWN:
if (exit_on_keydown) {
do_exit(cur_strea... | 1threat |
static int packed_vscale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
{
VScalerContext *inst = desc->instance;
int dstW = desc->dst->width;
int chrSliceY = sliceY >> desc->dst->v_chr_sub_sample;
int lum_fsize = inst[0].filter_size;
int chr_fsize = inst[1].filter_size;
... | 1threat |
Arrow function confusion : <p>I was doing a question on codesignal and when I couldn't get the answer myself for all tests, revealed the answers and saw this one; while I understand what it's trying to do (make sure positions are not divisible by n, and if it is increment n by one) I'm having trouble understanding the ... | 0debug |
Tax calculation using javascript : <p>I develop E-commerce app.</p>
<p>I display the List of product using this array.</p>
<p>Here is my cartProduct array.</p>
<pre><code> Cartproduct=[
{
"P_ID": 1,
"P_TITLE": "Martina",
"PRICE_REGULAR": 194,
"PRICE_SALE": 161,
"P_TAX": [
{
"... | 0debug |
static void i440fx_pcihost_get_pci_hole_end(Object *obj, Visitor *v,
const char *name, void *opaque,
Error **errp)
{
I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj);
uint32_t value = s->pci_hole.end;
visit_type_uint... | 1threat |
Chart.js Show labels on Pie chart : <p>I recently updated my charts.js library to the most updated version (2.5.0).
This version doesn't show the labels on the chart.</p>
<p>I have an example of working one on fiddler: <a href="http://jsfiddle.net/g6fajwg8" rel="noreferrer">http://jsfiddle.net/g6fajwg8</a> .</p>
<p>H... | 0debug |
static int mpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
Mpeg1Context *s = avctx->priv_data;
AVFrame *picture = data;
MpegEncContext *s2 = &s->mpeg_enc_ctx;
dprintf(avctx, "fill_bu... | 1threat |
Unity C#: Help editing script to use Right Mouse Button instead of OnMouseDrag : I am having trouble figuring out how to adjust this script to use the Middle Mouse Button instead of Left. The script currently uses OnMouseDown, OnMouseUp, and OnMouseDrag. I need those to be middle mouse instead. (mouse button 3)
I... | 0debug |
static void acquire_privilege(const char *name, Error **errp)
{
HANDLE token = NULL;
TOKEN_PRIVILEGES priv;
Error *local_err = NULL;
if (OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &token))
{
if (!LookupPrivilegeValue(NULL, name, &priv.Privile... | 1threat |
Why does (2/3) evaluate to 0 in rails? : <p>I'm building a sort of number balancer, but I am running into a problem where even in my console (2/3) evaluates to 0... which makes no sense. I'm fairly sure I'm working with floats, or integers, but why would it fail in the console? Anyways, any help is appreciated, I'm jus... | 0debug |
REGEX - How can I return text between two strings : <p>Link <a href="https://regex101.com/r/7j7eWy/1" rel="nofollow noreferrer">Regex101</a>
I am using (FD.*?)FD however I am missing every second expression - see regex. Any ideas?</p>
| 0debug |
static void start_output(DBDMA_channel *ch, int key, uint32_t addr,
uint16_t req_count, int is_last)
{
DBDMA_DPRINTF("start_output\n");
DBDMA_DPRINTF("addr 0x%x key 0x%x\n", addr, key);
if (!addr || key > KEY_STREAM3) {
kill_channel(ch);
return;
... | 1threat |
Hi everyone,i'm tryng to retreive the serial number of a hard drive or a battery tag : h[here is what i get when i compile it ][1]
`#include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <string.h> #include <process.h> #include <WinIoCtl.h> #i... | 0debug |
@SpringBootTest vs @ContextConfiguration vs @Import in Spring Boot Unit Test : <p>I'm working on a Spring Boot project.
I'm writing a "Unit Test" code based on "TDD," which is a little bit difficult. </p>
<p>@SpringBootTest loaded all BEANs, which led to longer test times. </p>
<p>So I used the @SpringBootTest's cla... | 0debug |
Laravel 5 Migration change length of existed column : <p>It not work, I search so many ways, How can I change length of value in laravel 5</p>
<pre><code>public function up()
{
Schema::table('articles', function (Blueprint $table) {
$table->string('name',50)->change();
});
}
</code></pre>
<p>Tha... | 0debug |
What is the method ".getChildren()" used for in Java? : <p>For example if I were to add a line of code such as-</p>
<pre><code>hbox.getChildren().add(calculateButton);
</code></pre>
<p>what significance does .getChildren hold and what happens if it not used in a program?</p>
| 0debug |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.