problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
static void numa_node_parse(NumaNodeOptions *node, QemuOpts *opts, Error **errp)
{
uint16_t nodenr;
uint16List *cpus = NULL;
if (node->has_nodeid) {
nodenr = node->nodeid;
} else {
nodenr = nb_numa_nodes;
}
if (nodenr >= MAX_NODES) {
error_setg(errp, "Max nu... | 1threat |
Tidy evaluation programming with dplyr::case_when : <p>I try to write a simple function wrapping around the dplyr::case_when() function. I read the <em>programming with dplyr</em> documentation on <a href="https://cran.r-project.org/web/packages/dplyr/vignettes/programming.html" rel="noreferrer">https://cran.r-project.... | 0debug |
How do i find empty cells or cells with   in td in table and make it editable using js and jquery : I am working with huge table like i have 5000 tds and i want make all the empty cells or cells with only   editable using js and jquery | 0debug |
Why do I have to set the dataSource and delegate to self? : <p>I'm learning swift, and the course I'm following teaches tableViews. It I have to set the <code>TableViewController</code> t include <code>UITableViewDataSource</code> and <code>UITableViewDelegate</code>. Then, in <code>viewDidLoad</code>, I have to set </... | 0debug |
how to updaload image twice with diffrent sizes : <p>hello i have project i work on , it have some issues ,</p>
<p>the problem here i need to get file twice once to move it and one with resizing </p>
<p>this is my code , what should i do here</p>
<pre><code> public function update_image(Request $request)
{
$ad =... | 0debug |
how to pass parameter to where clause dyanamically in store procedure :
ALTER PROCEDURE [dbo].[GetCustomers_PagerSelected]
@PageIndex INT
,@PageSize INT = 10
,@SubCondition nvarchar(max)
,@RecordCount INT OUTPUT
AS
BEGIN
SET NOCOUNT ON;
SELECT ROW_NUMBER() OVER
... | 0debug |
static int nbd_opt_go(QIOChannel *ioc, const char *wantname,
NBDExportInfo *info, Error **errp)
{
nbd_opt_reply reply;
uint32_t len = strlen(wantname);
uint16_t type;
int error;
char *buf;
info->flags = 0;
trace_nbd_opt_go_start(wantname);
bu... | 1threat |
Xcode build error - Multiple commands produce .o, Target 'ProjectCoreData' has compile command for Swift source files listed twice : <p>I am running xCode Version 10.1 (10B61), Mojave 10.14 (18A391)</p>
<p>Searching shows similar issue in Xcode 10 greater than a year ago, but no issues since then. The solution from la... | 0debug |
Why is my program is outputting '0' when run, even though it is not supposed too? : <p>I am quite new to c++, and was just playing around with if statements, so I made this program:</p>
<pre><code>#include <iostream>
using namespace std;
int getMax(int num1, int num2){
if (num1>num2)
{
cout &... | 0debug |
Gradle does not find my tests with Kotlin and JUnit 5 : <p>I have written some basic unit tests with Kotlin and Junit 5. Unfortunately, when I run them from Intellij IDEA, the tests are not found by Gradle.
I am getting the message "No tests found for given includes: [de.mhaug.phd.btcwallet.BasicTests]" from Gradle and... | 0debug |
How to change data in notepad using python : <p>Ok so I want to make a simple game where it's essential for the game to save. I wish to store all the data in notepad. However how do I pull notepad into python. I have tried saving notepad into the same folder where my .py file is. Then in the program im not sure what to... | 0debug |
Put SVG images next to each other : HTML
<div class="button">
<a href="#">
<img id="img1" src="icons/onas1.svg" alt="O nas[enter image description here][1]">
</>
<a href="#">
<img id="img2" src="icons/kontakt1.svg" alt="kontak... | 0debug |
Add a resizing layer to a keras sequential model : <p>How can I add a resizing layer to </p>
<pre><code>model = Sequential()
</code></pre>
<p>using </p>
<pre><code>model.add(...)
</code></pre>
<p>To resize an image from shape (160, 320, 3) to (224,224,3) ?</p>
| 0debug |
static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch,
Error **errp)
{
PCIQXLDevice *qxl = opaque;
VGACommonState *vga = &qxl->vga;
switch (qxl->mode) {
case QXL_MODE_COMPAT:
case QXL_MODE_NATIVE:
qxl_render_update(qxl);
... | 1threat |
QapiDeallocVisitor *qapi_dealloc_visitor_new(void)
{
QapiDeallocVisitor *v;
v = g_malloc0(sizeof(*v));
v->visitor.start_struct = qapi_dealloc_start_struct;
v->visitor.end_struct = qapi_dealloc_end_struct;
v->visitor.start_implicit_struct = qapi_dealloc_start_implicit_struct;
v->visito... | 1threat |
static void nand_command(NANDFlashState *s)
{
unsigned int offset;
switch (s->cmd) {
case NAND_CMD_READ0:
s->iolen = 0;
break;
case NAND_CMD_READID:
s->ioaddr = s->io;
s->iolen = 0;
nand_pushio_byte(s, s->manf_id);
nand_pushio_byte(s, s->chip_... | 1threat |
static void vnc_dpy_setdata(DisplayChangeListener *dcl,
DisplayState *ds)
{
VncDisplay *vd = ds->opaque;
qemu_pixman_image_unref(vd->guest.fb);
vd->guest.fb = pixman_image_ref(ds->surface->image);
vd->guest.format = ds->surface->format;
vnc_dpy_update(dcl, ds, 0,... | 1threat |
static int mpeg1_find_frame_end(MpegEncContext *s, uint8_t *buf, int buf_size){
ParseContext *pc= &s->parse_context;
int i;
uint32_t state;
state= pc->state;
i=0;
if(!pc->frame_start_found){
for(i=0; i<buf_size; i++){
state= (state<<8) | buf[i];
... | 1threat |
int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
{
BlockDriver *drv = bs->drv;
if (drv && drv->bdrv_ioctl)
return drv->bdrv_ioctl(bs, req, buf);
return -ENOTSUP;
}
| 1threat |
calculate the difference between two time durations php : <p>I Have two-time durations</p>
<ol>
<li>5 hours and 55 minutes. </li>
<li>6 hours.</li>
</ol>
<p>expecting the answer +5.00 or -5.00 for the difference between. </p>
<p>what are the best options to resolve the matter? </p>
| 0debug |
Google Map JavaScript API from server page : I hava a problem about Google Map JavaScript API access.
I can access Google Maps API with Javascript class, google.maps.DirectionsService and google.maps.Geocoder, from my local html file (C:\path\to\google.html).
script tag is:
<script async defer type="text/j... | 0debug |
Swift Detect Every Time Device Orientation Changes : <p>I'm creating an iPhone game in Xcode with the latest version of Swift. Why I'm asking this question is when the user flips the phone and changes the orientation, is there any way I can detect that, so I can change the placing, size, etc. of things?</p>
| 0debug |
How can this small C program work? Variables are equal to zero but enters loop anyway : Im experimenting on a very low level with some C coding. This is not an actual problem because the program works as i wish, but could someone explain to me how the following conditions in the while-loop are evaluated?
I read that... | 0debug |
static int mpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
Mpeg1Context *s = avctx->priv_data;
AVFrame *picture = data;
MpegEncConte... | 1threat |
How to include untyped node modules with Typescript 1.8? : <blockquote>
<p>Typescript 1.8 now supports untyped JS files. To enable this feature,
just add the compiler flag --allowJs or add "allowJs": true to
compilerOptions in tsconfig.json</p>
</blockquote>
<p>via <a href="https://blogs.msdn.microsoft.com/types... | 0debug |
static inline int vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
int a_avail, int c_avail,
int16_t **dc_val_ptr, int *dir_ptr)
{
int a, b, c, wrap, pred;
int16_t *dc_val;
int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
int q1,... | 1threat |
explaining constuctor and coppy costructor example : i have this code and i can understand what happening with the contractor of class Fat.
#include <iostream>
using namespace std;
class Block{ int data;
public:
Block(int i = 10) : data(i)
{ cout << "I just created a Block " << endl... | 0debug |
Is it possible to dump the AST while building an Xcode project? : <p>I've been doing some work on analyzing Swift projects using their ASTs, and I would like to know if it is possible to generate it somehow when building a Swift project with Xcode.</p>
<p>Right now, I am able to print the AST on the terminal when runn... | 0debug |
static int slirp_smb(SlirpState* s, const char *exported_dir,
struct in_addr vserver_addr)
{
static int instance;
char smb_conf[128];
char smb_cmdline[128];
FILE *f;
snprintf(s->smb_dir, sizeof(s->smb_dir), "/tmp/qemu-smb.%ld-%d",
(long)getpid(), instance+... | 1threat |
Convert string text into an array : <p>I have string in DB that looks like this</p>
<pre><code>1233,3332,2333,2333
</code></pre>
<p>How can I convert it so it becomes like this:</p>
<pre><code>'1233','3332','2333','2333'
</code></pre>
<p>with php. Thanks in advance</p>
| 0debug |
static uint32_t qpci_spapr_io_readl(QPCIBus *bus, void *addr)
{
QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus);
uint64_t port = (uintptr_t)addr;
uint32_t v;
if (port < s->pio.size) {
v = readl(s->pio_cpu_base + port);
} else {
v = readl(s->mmio_cpu_base + port);
... | 1threat |
Format on python string gives error : <p>In python, I'm trying to create a string by format()</p>
<pre><code>json_data_resp = '{"error":false,"code":"{0}","mac":"{1}","message":"Device configured successfully"}'.format(activation_code, macaddress)
</code></pre>
<p>When I execute this code, it gives me an error like s... | 0debug |
User Control Won't Return Value : I am writing a user control. I want it to return a customer number when the user double clicks on the customer. I can't seem to get it to work. The user control is displayed and, on the double click, the data shows in the messagebox but I can't seem to get it to update the value on ... | 0debug |
How can I change a .NET standard library to a .NET framework library? : <p>I'm writing a class library for a simple parser in C#. When I first created it, I used .NET standard 2.0, but now I need to migrate it to .NET 4.6 both to conform to the other projects in my solution and in order to use NUnit.</p>
<p>I tried to... | 0debug |
Python: set varaibles in array : <p>Is it possible to set piece array as [x , y] variable. For example, piece [ [x1,y1],[x2,y2],....] </p>
<p>Below is my code:</p>
<pre><code>piece = [[387,500] , [247,499] , [120,496] , [533,488] , [191,432] , [464,432],[328,426] , [50,426]]
if (292<x<350) and (390<y<450... | 0debug |
static inline void gen_op_eval_bg(TCGv dst, TCGv_i32 src)
{
gen_mov_reg_N(cpu_tmp0, src);
gen_mov_reg_V(dst, src);
tcg_gen_xor_tl(dst, dst, cpu_tmp0);
gen_mov_reg_Z(cpu_tmp0, src);
tcg_gen_or_tl(dst, dst, cpu_tmp0);
tcg_gen_xori_tl(dst, dst, 0x1);
}
| 1threat |
void ioinst_handle_rsch(S390CPU *cpu, uint64_t reg1)
{
int cssid, ssid, schid, m;
SubchDev *sch;
int ret = -ENODEV;
int cc;
if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) {
program_interrupt(&cpu->env, PGM_OPERAND, 4);
return;
}
trace_ioinst_sc... | 1threat |
Is there a way to disable SSL/TLS for GitHub Pages? : <p>I have been looking for a place to store some of my XML schemas publicly without actually having to host them. I decided <a href="https://pages.github.com/" rel="noreferrer">GitHub Pages</a> would be the ideal platform. I was correct except that I cannot figure o... | 0debug |
sPAPRDRConnector *spapr_dr_connector_new(Object *owner, const char *type,
uint32_t id)
{
sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(object_new(type));
char *prop_name;
drc->id = id;
drc->owner = owner;
prop_name = g_strdup_printf("dr-connector[%"PRIu... | 1threat |
static void pit_common_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = pit_common_realize;
dc->vmsd = &vmstate_pit_common;
dc->no_user = 1;
}
| 1threat |
Serialize in JSON a base64 encoded data : <p>I'm writing a script to automate data generation for a demo and I need to serialize in a JSON some data. Part of this data is an image, so I encoded it in base64, but when I try to run my script I get:</p>
<pre><code>Traceback (most recent call last):
File "lazyAutomation... | 0debug |
How do display different runs in TensorBoard? : <p>TensorBoard seems to have a feature to display multiple different runs and toggle them. </p>
<p><a href="https://i.stack.imgur.com/5E3eQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5E3eQ.png" alt="enter image description here"></a></p>
<p>How can I make... | 0debug |
Log event datetime with.Net Core Console logger : <p>I'm using logging to Console output, that built-in to .Net Core framework.
Here initialization of the logger:</p>
<pre><code>var serviceCollection = new ServiceCollection();
serviceCollection.AddSingleton(new LoggerFactory()
.AddConsole());
</cod... | 0debug |
Android studio Listview in Fragment : I want to create a ListView in Fragment but something goes wrong.
In layout listmygroups.xml are three TextViews (trainermygroupslistwhen, trainermygroupslistwhere, trainermygroupslistname).
I try to open fragment with listview(TrainerMyGroups) from another fragment by:
... | 0debug |
regex for specific username format : There's a ton of these things here and I really suck with regex/ it's been way too long since I've used it so a little bit of guidance here would be amazing.
My username criterion is simple: <br>
- Must contain 1 or more letters, anywhere <br>
- May contain any amount of numb... | 0debug |
Converting a Regex from JS flavor to Golang flavor? : <p>I am trying to convert a certain regex from ECMAScript flavor to Golang flavor, here it is : </p>
<pre><code>((r|🇷)+)(( |\n)*)((🇪|e)+)(( |\n)*)((p|🇵)+)(( |\n)*)((🇴|o)+)(( |\n)*)((🇸|s)+)(( |\n)*)((t|🇹)+)
</code></pre>
<p>Basically the point is to match mes... | 0debug |
Angular 8 and Observable that waits for another observable : <p>I need the data of observable1, but I need it only when observable2 is set to <code>true</code>. It is set to <code>true</code> AFTER the data of observable1 changes. How can I chain the two observables so that I will get the data of observable1 every time... | 0debug |
How to configure setCustomValidity for selectize in onchange event? : How to configure setCustomValidity for selectize in onchange event?
every think is ok, but setCustomValidity does not work.
var countyPhoneCodeId = '#county_phone_code';
$(countyPhoneCodeId).selectize({
maxItems: 1,
la... | 0debug |
is the latest mongodb 4.2 just released is a stable new version? : <p>i found on <a href="https://github.com/mongodb/mongo/tree/r4.2.0" rel="nofollow noreferrer">https://github.com/mongodb/mongo/tree/r4.2.0</a>, it is released. </p>
<p>i know, that even versions are the stable versions, so, should i start using it? </... | 0debug |
'setConfigSettings(FirebaseRemoteConfigSettings!): Unit' is deprecated : <p>After upgrading Firebase libraries to </p>
<pre><code>implementation "com.google.firebase:firebase-messaging:18.0.0"
implementation 'com.google.firebase:firebase-config:17.0.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
</code><... | 0debug |
Disable Firebase in development mode in Android : <p>I am using Firebase in my android project. Wanted to know how to disable it in development mode. All crashes and usage/events are being logged and messing up with actual analytics.</p>
<p>Any better way to disable this in development mode?</p>
| 0debug |
connection.query('SELECT * FROM users WHERE username = ' + input_string) | 1threat |
static int do_alloc_cluster_offset(BlockDriverState *bs, uint64_t guest_offset,
uint64_t *host_offset, unsigned int *nb_clusters)
{
BDRVQcowState *s = bs->opaque;
int ret;
trace_qcow2_do_alloc_clusters_offset(qemu_coroutine_self(), guest_offset,
*host_off... | 1threat |
Pass a dynamically allocated multidimensional array to a function : <pre><code>#include<iostream>
using namespace std;
void seed(int* matrixAddr, int n, int m);
void main()
{
int n, m;
cin >> n >> m;
int matrix[n][m]; // DevC++ does not throw an error here, where VS does instead
seed(mat... | 0debug |
How can i duplicate an HashMAP with duplicate values : so i need to create new hashmaps that contain only the duplicate values of my first hashmap
Original map: {Player1=Hello, Player2=Hi, Player3=Hi, Player4=Hello, Player5=Hello}
Hello map: {Player1=Hello,Player4=Hello, Player5=Hello}
Hi map: {Player2... | 0debug |
Excel VBA Sheet EnableCalculation Working Intermitently : I am working on a spreadsheet for my company and I am having trouble with the EnableCalculation function. We copy large chunks of data and paste them into a workbook. To expedite this process, I 'freeze' sheets by turning the EnableCalculation to False as shown ... | 0debug |
Write a function unction that takes as input ݊n and returns the matrix C, Cij= 0 if i/j<2 , Cij =ij^2 otherwise in MATLAB : Consider the ݊nxn matrix C with elements
Cij= 0 if i/j<2 ,
Cij =ij^2 otherwise
while 1=<i,y=<n
Write a Matlab function matSetup that takes as input ݊n and returns the matrix ... | 0debug |
static void check_lowpass_line(int depth){
LOCAL_ALIGNED_32(uint8_t, src, [SRC_SIZE]);
LOCAL_ALIGNED_32(uint8_t, dst_ref, [WIDTH_PADDED]);
LOCAL_ALIGNED_32(uint8_t, dst_new, [WIDTH_PADDED]);
int w = WIDTH;
int mref = WIDTH_PADDED * -1;
int pref = WIDTH_PADDED;
int i, depth_byte;
... | 1threat |
how to develop a basic online ordering app? : need a small clarity regarding developing an android app..basically the idea is to build an app where the user can select the items(eg.books),after selecting he will be taken to next activity where he can choose the number of items(say 2)...after selecting he will be taken ... | 0debug |
RuntimeError: There is no current event loop in thread in async + apscheduler : <p>I have a async function and need to run in with apscheduller every N minutes.
There is a python code below</p>
<pre><code>URL_LIST = ['<url1>',
'<url2>',
'<url2>',
]
def demo_async(... | 0debug |
How to start mongo v4.2.0 : <p>I have successfully installed Mongo v4.2.0.</p>
<pre><code>mongo --version
MongoDB shell version v4.2.0
git version: a4b751dcf51dd249c5865812b390cfd1c0129c30
OpenSSL version: OpenSSL 1.1.1c 28 May 2019
allocator: tcmalloc
modules: none
build environment:
distmod: ubuntu1804
dist... | 0debug |
static int decode_init(AVCodecContext *avctx)
{
HYuvContext *s = avctx->priv_data;
int width, height;
s->avctx= avctx;
s->flags= avctx->flags;
dsputil_init(&s->dsp, avctx);
memset(s->vlc, 0, 3*sizeof(VLC));
width= s->width= avctx->width;
height= s->height= avct... | 1threat |
Check whether the file is password protected or not in C# : <p>I Have a path, which contains different kind of files(like .sdf,.sdb). I need to find out how many files are password protected. I searched but i found the result only for doc,xls kind of files. I need generic result. Can any one suggest me.</p>
| 0debug |
Remove � charcter from the text : I am trying to remove � symbol from text, but my method is not working .
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/6dSHZ.jpg
This my code to remove the symbol.
public static function cleanText($text)
{
// St... | 0debug |
void qmp_drive_backup(DriveBackup *arg, Error **errp)
{
return do_drive_backup(arg, NULL, errp);
}
| 1threat |
static void avc_luma_vt_and_aver_dst_4x4_msa(const uint8_t *src,
int32_t src_stride,
uint8_t *dst, int32_t dst_stride)
{
int16_t filt_const0 = 0xfb01;
int16_t filt_const1 = 0x1414;
int16_t filt_const2 = 0x1fb;
... | 1threat |
AKS. Can't pull image from an acr : <p>I try to pull image from an ACR using a secret and I can't do it.</p>
<p>I created resources using azure cli commands:</p>
<pre><code>az login
az provider register -n Microsoft.Network
az provider register -n Microsoft.Storage
az provider register -n Microsoft.Compute
az provide... | 0debug |
What is the meaning of start a goroutine which is also a goroutine : https://github.com/fhmq/hmq/blob/master/pool/fixpool.go . here are the codes, I do not understand why the function startWorker is written like the following.
```go
func startWorker(taskChan chan func()) {
go func() {
var task func()
var ok b... | 0debug |
Not ignoring 0 on Java : <p>I need help, I have an <code>int num = 0000;</code> but on <code>System.out.print(num);</code> it only shows like this: <code>0</code>.
I would like to know what can I do if I have <code>num = 0111;</code> or <code>num = 0011;</code> or <code>num = 0001</code> and I want to show the 0 before... | 0debug |
How to use CryptoJS with Angular 4 : <p>When I was not using Angular 4, I would just put the <code>script</code> tags for the library. Even when I put the <code>script</code> tags in the <code>index.html</code> file it is not recognizing <code>CryptoJS</code>. Is there a way to use the library or a Angular equivalent? ... | 0debug |
HTML - Allow only pattern with numbers and dots for input type text : <p>I need to have a text input that accepts only numbers and the dot sign for float numbers.</p>
<p>I don't want a number type input.</p>
| 0debug |
Is it possible to, with a C# program, get a list of PDF readers installed on a given PC? : <p>I need to list all the PDF readers available in a given PC.
I've found many ways to get the default one, or to get just the adobe acrobat, but I need to be able to list them all like:
Adobe Acrobat
Foxit
...</p>
| 0debug |
using enzyme.mount().setProps with a react-redux Provider : <p>I have a test which is setting props, to observe some changes in the component. The only complication is that I'm wrapping the rendered element in a <code><Provider></code> because there are some connected components further down the tree.</p>
<p>I'm... | 0debug |
How to code a countdown timer always countdown to tomorrow? : I would like to have a countdown timer always show a countdown until tomorrow to a new client id. Thinking of using the js variable code functions to define new client's timezone together with if statement comment. and make it a repeat loop ?
Anyone have do... | 0debug |
Why does this very simple C# method produce such illogical CIL code? : <p>I've been digging into IL recently, and I noticed some odd behavior of the C# compiler. The following method is a very simple and verifiable application, it will immediately exit with exit code 1:</p>
<pre><code>static int Main(string[] args)
{
... | 0debug |
Java: Difference between Class.function() and Object.function() : <p>In cases where it does not seem to matter, i.e. the value is a parameter and the function is not operating directly on the calling object instance, what are the "under the hood" differences between calling a Class.function() and Object.function()?</p>... | 0debug |
How can i redirect a webpage to another webpage permanently through cpanel : How can redirect a webpage to another webpage permanently using cpanel
Ex:
www.abc/contactUs.php
redirect to
www.abc/contactus.php
Your quick response appreciated. | 0debug |
How to find and replace with regex in excel : <p>I have an excel file with 1 column and multiple rows.</p>
<p>The rows contain various text, here's an example:</p>
<pre><code>texts are home
texts are whatever
dafds
dgretwer
werweerqwr
texts are 21412
texts are 346345
texts are rwefdg
terfesfasd
rwerw
</code></pre>
<... | 0debug |
int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src)
{
int ret, i;
av_assert0(!dst->f->buf[0]);
av_assert0(src->f->buf[0]);
av_assert0(src->tf.f == src->f);
dst->tf.f = dst->f;
ret = ff_thread_ref_frame(&dst->tf, &src->tf);
if (ret < 0)
goto fail;
... | 1threat |
static inline void silk_stabilize_lsf(int16_t nlsf[16], int order, const uint16_t min_delta[17])
{
int pass, i;
for (pass = 0; pass < 20; pass++) {
int k, min_diff = 0;
for (i = 0; i < order+1; i++) {
int low = i != 0 ? nlsf[i-1] : 0;
int high = i != order ? n... | 1threat |
function that returns number of vowels in a string : <pre><code>if(string[i] === "a" || string[i] === "e" || string[i] === "i" || string[i] === "o" || string[i] ==="u"){}
</code></pre>
<p>I'm writing a function that takes a string and returns the number of vowels in that string. </p>
<p>The code above is what I used ... | 0debug |
How can i echo the last record php mysql : <p>For a project a need the echo the last 4 database records. I have a script that show all the records but I need only the last 4. Can someone help me?</p>
<pre><code><?php
$con = mysql_connect("localhost","test","test");
if (!$con)
{
die('Could not connect: ' . mysql... | 0debug |
How can I run functions within a Vue data object? : <p>So I am trying to use the following component within Vue JS:</p>
<pre><code>Vue.component('careers', {
template: '<div>A custom component!</div>',
data: function() {
var careerData = [];
client.getEntries()
.then(function (entries) {... | 0debug |
Codeigniter Controller return to previous page : <p>I'd like to ask you how can I instead of $this->load->view('some_view.php') at the end of controller code, return user to page from where he invoked controller method? Simple return statement is not working. </p>
<p>ie.</p>
<pre><code>public function someMethod($IDC... | 0debug |
OSX dev_appserver.py file not accessible: '/System/Library/CoreServices/SystemVersion.plist' : <p>I did a <code>gcloud components update</code> 2 days ago and started getting this error when i run <code>dev_appserver.py</code></p>
<pre><code>(venv) myusername@mymachine:~/projects/myproject$ dev_appserver.py ./ --host ... | 0debug |
static int raw_fd_pool_get(BDRVRawState *s)
{
int i;
for (i = 0; i < RAW_FD_POOL_SIZE; i++) {
if (s->fd_pool[i] != -1)
continue;
s->fd_pool[i] = dup(s->fd);
if (s->fd_pool[i] != -1)
return s->fd_pool[i];
}
return s... | 1threat |
Why my if elif logic in Python is not working.. Please explain : Dataframe(test1):
cons_flag
Mas
Mas
Wood
Wood
Wood
Mas
Conc
Wood
OUTPUT:
cons_flag new_var
Mas MASOM
Mas MASOM
Wood MASOM
Wood MASOM
Wood MASOM
Mas MASOM
Conc MASOM
Wood MASOM
CODE USED:
... | 0debug |
Given a matrix, how do I determine whether the entries of the matrix are Independent and Identically Distributed (IID)? : <p>The matrix was not generated with a <code>rand</code> function; rather, it was obtained by collecting data from a server. I want to know if there is a method to check if any given matrix, A, has ... | 0debug |
TortoiseSVN error The XML response contains invalid XML and Malformed XML: no element found : <p>My TortoiseSVN Checkout and Update error </p>
<p><strong>The XML response contains invalid XML
Malformed XML: no element found</strong></p>
<p>What do you do
Please help me.</p>
| 0debug |
static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags)
{
BDRVRBDState *s = bs->opaque;
char pool[RBD_MAX_POOL_NAME_SIZE];
char snap_buf[RBD_MAX_SNAP_NAME_SIZE];
char conf[RBD_MAX_CONF_SIZE];
char clientname_buf[RBD_MAX_CONF_SIZE];
char *clientname;
QemuOpts *opts;
... | 1threat |
Get the values of a Observable<any> into an array in typescript : <p>I'm trying to get the values from a post in typescript, I'm getting a Observable type variable from the post operation but I don't know how can I get the values within. Is there a way to do this?</p>
<p>Here is the code I have until now</p>
<pre><co... | 0debug |
How do I replace cells with formulas with its calculated value automatically? : I am making a payroll program in Excel and one of my concerns is that the salaries of the employees are searched using the INDEX and MATCH or VLOOKUP function. The problem is if the salaries get updated in the future (e.g. a raise or change... | 0debug |
sum of values for multiple rows with same name in r : <p>how to perform a sum of values for multiple rows with the same name in r and render a chart in plotly.i have tried a couple of methods like aggregate and tapply, none of them seems to be working for me, could anyone tell me where I am going wrong. </p>
<pre><cod... | 0debug |
Can AWS CodePipeline track multiple feature branches and run tests on each? : <p>With Bitbucket and Bamboo, I was able to have Bamboo track every feature branch and run tests on each so that, at the pull request time, I was able to see if the branch passed its unit tests.</p>
<p>With <a href="http://docs.aws.amazon.co... | 0debug |
static void nbd_teardown_connection(NbdClientSession *client)
{
struct nbd_request request = {
.type = NBD_CMD_DISC,
.from = 0,
.len = 0
};
nbd_send_request(client->sock, &request);
shutdown(client->sock, 2);
nbd_recv_coroutines_enter_all(client);
qe... | 1threat |
static int apng_read_header(AVFormatContext *s)
{
APNGDemuxContext *ctx = s->priv_data;
AVIOContext *pb = s->pb;
uint32_t len, tag;
AVStream *st;
int acTL_found = 0;
int64_t ret = AVERROR_INVALIDDATA;
if (avio_rb64(pb) != PNGSIG)
return ret;
len = avio_r... | 1threat |
static void fdt_add_psci_node(const VirtBoardInfo *vbi)
{
void *fdt = vbi->fdt;
ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(0));
if (kvm_enabled()) {
qemu_fdt_add_subnode(fdt, "/psci");
if (armcpu->psci_version == 2) {
const char comp[] = "arm,psci-0.2\0arm,psci";
... | 1threat |
First program with Rails framework : I try to exec a first ruby on rails project.
I have done this few commands but no html page I see on localhost:3000 after rails server.
The comands that I wrote, are:
rails new first_proj;
cd first_proj
rails generate scaffold project name:string cost:decimal;
... | 0debug |
static void test_visitor_out_enum(TestOutputVisitorData *data,
const void *unused)
{
QObject *obj;
EnumOne i;
for (i = 0; i < ENUM_ONE__MAX; i++) {
visit_type_EnumOne(data->ov, "unused", &i, &error_abort);
obj = visitor_get(data);
g_asser... | 1threat |
PHP Warning: get_included_files() expects exactly 0 parameters, 1 given in : <p>I'm trying to uploade and use an old script i made way back, but it gives me an error:</p>
<p>PHP Warning: get_included_files() expects exactly 0 parameters, 1 given in</p>
<pre><code>session_start();
ob_start();
get_required_files('co... | 0debug |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.