problem
stringlengths
26
131k
labels
class label
2 classes
document.write('<script src="evil.js"></script>');
1threat
Java project with Gradle and building jar file in Intellij IDEA - how to? : <p>Is there anywhere a tutorial on how to create Java project with Gradle and then build the jar file?</p> <p>I'm running into various problems with that. When I create Java project and then add Gradle with File -> New -> Module -> Gradle -> ....
0debug
Need generic xpath/css_selectro for following html code : <p>Following is the html code for which I need generic xpath pr css_selector</p> <pre><code>&lt;fieldset&gt; &lt;legend&gt;Forged Email:&lt;/legend&gt; &lt;p class="custom-err-pos-handle"&gt; &lt;input id="domainforging" class="required custom-err-pos valid" n...
0debug
Interest rate program : <p>I am just beginning to learn C. So for practice I decided to write a interest rate calculator but for some reason my calculation always comes out as 0 and I can't figure it out. If you can please take a look.</p> <pre><code>#include &lt;stdio.h&gt; main() { int time; float principle, rat...
0debug
library not found for -lDoubleConversion : <p>I tried to build on XCode but <code>ld: library not found for -lDoubleConversion</code> error occurs. I could build <code>react-native run-ios</code>. That would work, but XCode could not build...</p> <blockquote> <p>ld: warning: directory not found for option '-L/Users/...
0debug
void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict) { QObject *data; int devfn; if (do_pcie_aer_inject_error(mon, qdict, &data) < 0) { return; } assert(qobject_type(data) == QTYPE_QDICT); qdict = qobject_to_qdict(data); devfn = (int)qdict_get_int(qdict, "d...
1threat
import heapq as hq def heap_replace(heap,a): hq.heapify(heap) hq.heapreplace(heap, a) return heap
0debug
ogm_header(AVFormatContext *s, int idx) { struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; AVStream *st = s->streams[idx]; const uint8_t *p = os->buf + os->pstart; uint64_t time_unit; uint64_t spu; uint32_t size; if(!(*p & 1)) return 0; ...
1threat
Why the loop to search for a string that is present in a file returns True for first iteration and False for the rest? : <p>I have a file named text.txt which contains the following data:</p> <pre><code>My Name Is Lorem Ipsum </code></pre> <p>My python code:</p> <pre><code>with open("text.txt") as f: for i in xr...
0debug
static struct omap_tipb_bridge_s *omap_tipb_bridge_init( MemoryRegion *memory, hwaddr base, qemu_irq abort_irq, omap_clk clk) { struct omap_tipb_bridge_s *s = (struct omap_tipb_bridge_s *) g_malloc0(sizeof(struct omap_tipb_bridge_s)); s->abort = abort_irq; omap_tipb_bridge_reset...
1threat
when i write a Macro which C++,it precessing error with "the declaration has no storage type" : when i write a Macro which C++,it precessing error with "the declaration has no storage type", and this is my code,what's wrong with is?If i impletment with function,it works well.It doubts me. #define FLAG_CLEAR_MUL_...
0debug
static int sp5x_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AVPacket avpkt_recoded; const int qscale = 5; const uint8_t *buf_ptr; ...
1threat
Shortcut for joining two lines : <p>What's the keyboard shortcut for joining two lines in VS Code?</p> <p>If the cursor is anywhere in the first line of</p> <pre><code> f(foo, bar) </code></pre> <p>then when I hit the shortcut, I want to get</p> <pre><code> f(foo, bar) </code></pre>
0debug
Cannot call void user defined function inside main function in C programming : <p>When I try to run the below program</p> <pre><code>#include&lt;stdio.h&gt; /* demo.c: My first C program on a Linux */ void main() { getString(); } void getString() { printf("Hello World"); } </code></pre> <p>I get the below e...
0debug
void ff_put_h264_qpel16_mc22_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_mid_16w_msa(src - (2 * stride) - 2, stride, dst, stride, 16); }
1threat
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. (django 2.0.1)(Python 3.6) : <p>It's my first time trying to deploy a Django app(django 2.0.1)(Python 3.6) to pythonanywhere, it is a simple portfolio app with no models, no bootstrap. Just Django, HTML, CSS &amp; Javascript.</p> <p>After pulling it f...
0debug
I keep getting an error that my app needs to be verified when either I or another user try to authorize with OAuth2. What does that mean? : <p>I received this error when trying to authorize my app with my own account:</p> <pre><code>Your project is trying to access scopes that need to go through the verification proce...
0debug
How to make a basic GGPLOT2 time series graph : I need to graph sat -0.038685744 sun -0.004397419 mon -0.072163337 tue 0.123328564 wed 0.021875962 thu 0.005030862 fri 0.002869955 but the steps on r-graph-gallery are confusing, so can someone help me out with a simple graph that shows day...
0debug
static int xan_unpack(uint8_t *dest, const int dest_len, const uint8_t *src, const int src_len) { uint8_t opcode; int size; uint8_t *orig_dest = dest; const uint8_t *src_end = src + src_len; const uint8_t *dest_end = dest + dest_len; while (dest < dest_end) { ...
1threat
Regular expression : I want to pull out the string after src like for the following two samples as: 1. Images/17/0000894189/0000894189-17-005831/image00003.jpg 2. Images/17/0000894189/0000894189-17-005831/image0.jpg `<div style="TEXT-ALIGN: center"><img src="Images/17/0000894189/0000894189-17-005831/image00003...
0debug
C# find changes between two generic lists : <p>I had a problem with comparing two generic lists to find the set of changes because the effect of change propagates to multiple destinations:</p> <p><strong>The Problems was:</strong></p> <ul> <li>They are not simple types (I have to use comparer</li> <li>I need to know ...
0debug
static void vector_fmul_reverse_vfp(float *dst, const float *src0, const float *src1, int len) { src1 += len; asm volatile( "fldmdbs %[src1]!, {s0-s3}\n\t" "fldmias %[src0]!, {s8-s11}\n\t" "fldmdbs %[src1]!, {s4-s7}\n\t" "fldmias %[src0]!, {s12-s15}\n\t"...
1threat
Swift Trimming String : <p>I am trying to trim a string so that i am left with everything on the right side of a colon in Swift.</p> <p>For example</p> <blockquote> <p>"Sally: Hello My Name is Sally"</p> </blockquote> <p>Becomes</p> <blockquote> <p>"Hello My Name is Sally"</p> </blockquote> <p>What would the t...
0debug
static void gen_neon_dup_high16(TCGv var) { TCGv tmp = new_tmp(); tcg_gen_andi_i32(var, var, 0xffff0000); tcg_gen_shri_i32(tmp, var, 16); tcg_gen_or_i32(var, var, tmp); dead_tmp(tmp); }
1threat
How to convert String array to Int array in Kotlin? : <p>Kotlin has many shorthands and interesting features. So, I wonder if there is some fast and short way of converting array of string to array of integers. Similar to this code in Python:</p> <pre><code>results = [int(i) for i in results] </code></pre>
0debug
void vnc_display_open(DisplayState *ds, const char *display, Error **errp) { VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display; const char *options; int password = 0; int reverse = 0; #ifdef CONFIG_VNC_TLS int tls = 0, x509 = 0; #endif #ifdef CONFIG_VNC_SASL int sasl = 0; ...
1threat
static void test_cipher_speed(const void *opaque) { QCryptoCipher *cipher; Error *err = NULL; double total = 0.0; size_t chunk_size = (size_t)opaque; uint8_t *key = NULL, *iv = NULL; uint8_t *plaintext = NULL, *ciphertext = NULL; size_t nkey = qcrypto_cipher_get_key_len(QCRYPTO_CIPHE...
1threat
NULL help please : I am currently using SQL Server 2008R2. I am using this script: SELECT a.productname, a.orderdate, a.workarea FROM database1table1 AS a WHERE a.orderdate >='2016/08/01' Which gives the output: PRODUCT NAME ORDER DATE WORKAREA x ...
0debug
static void qmp_input_type_bool(Visitor *v, bool *obj, const char *name, Error **errp) { QmpInputVisitor *qiv = to_qiv(v); QObject *qobj = qmp_input_get_object(qiv, name, true); if (!qobj || qobject_type(qobj) != QTYPE_QBOOL) { error_setg(errp, QERR_INVALID_PA...
1threat
grlib_irqmp_writel(void *opaque, target_phys_addr_t addr, uint32_t value) { IRQMP *irqmp = opaque; IRQMPState *state; assert(irqmp != NULL); state = irqmp->state; assert(state != NULL); addr &= 0xff; switch (addr) { case LEVEL_OFFSET: value &= 0xFFFF <<...
1threat
how can i take the textview text from custom listview contains 3 textviews and an imageview? : public void onItemClick(AdapterView<?> parent, View view, int position, long id) { TextView textView = (TextView) listView.findViewById(R.id.namee); String title = textView.getText().toString(); T...
0debug
import re def text_match_three(text): patterns = 'ab{3}?' if re.search(patterns, text): return 'Found a match!' else: return('Not matched!')
0debug
A beginner-made python number guessing game. Please help optimize and resolve issues : <p>I have just started to learn coding. This is a simple number guessing game that I created with Python. It works fine but I feel like the code can be simplified/optimized so it looks more neat. Another thing is that every time I tr...
0debug
Weird output for echo and print_r : <p>I haver discovered some weird behavior and cannot explain what is going on:</p> <pre><code>$e = 3; echo "with array " . print_r($e); </code></pre> <p>gives:</p> <pre><code>3with array 1 </code></pre> <p>why?</p>
0debug
static uint32_t nabm_readw (void *opaque, uint32_t addr) { PCIAC97LinkState *d = opaque; AC97LinkState *s = &d->ac97; AC97BusMasterRegs *r = NULL; uint32_t index = addr - s->base[1]; uint32_t val = ~0U; switch (index) { case PI_SR: case PO_SR: case MC_SR: r = &s-...
1threat
AVFilterBufferRef *avfilter_null_get_audio_buffer(AVFilterLink *link, int perms, enum AVSampleFormat sample_fmt, int size, int64_t channel_layout, int packed) { return avfilter_get_audio_buffer(link->dst->outputs...
1threat
How can I refresh a page when a database is updated(Laravel)? : <p>How can I refresh a page when a database is updated in Laravel?</p>
0debug
Neural network weird prediction : <p>I try to implement a neural network. I'm using backpropagation to compute the gradients. After obtaining the gradients, I multiply them by the learning rate and subtract them from the corresponding weights. (basically trying to apply gradient descent, please tell me if this is wrong...
0debug
static void chr_read(void *opaque, const uint8_t *buf, int size) { TestServer *s = opaque; CharDriverState *chr = s->chr; VhostUserMsg msg; uint8_t *p = (uint8_t *) &msg; int fd; if (size != VHOST_USER_HDR_SIZE) { g_test_message("Wrong message size received %d\n", size); return; ...
1threat
How to repeatedly add the same element to an array : <p>How to repeatedly add the same element to an array, I am new beginner in Java, could anyone help me solve this problem</p> <p>For example, </p> <pre><code>When N = 1 int[] a1 = {1,2,3} When N = 2 the result is a1 = {1,2,3,1,2,3} </code></pre> <p>what's about ...
0debug
how to Finding Differences in two Images with PHP : How to find difference between two image? [![Image][1]][1] [1]: https://i.stack.imgur.com/KdbxZ.png Please check above image i hopw you can clear. both image are same but one image have also text so how to different this things? thank you so much in adv...
0debug
JS: getElementById not working? : I have a function like this function f(el){ var a = el.getElementsByName("name"); } I know that I can use `arguments` for this but what if I want to do it like the method above? Thanks! Also no jQuery please
0debug
How do I Programmatically create a button and assign a macro to it upon opening spreadsheet? : What I need to do upon opening a spreadsheet is to execute some VBA to produce a button for me and automatically assign a macro I have created previously to it, let's call this macro "edit_colour" (which has been pre-recorded...
0debug
static int bethsoftvid_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { BethsoftvidContext * vid = avctx->priv_data; char block_type; uint8_t * dst; uint8_t * frame_end; int remaining = avctx->width...
1threat
Trying to write a function that will print all numbers from 1 to 1000 that the sum of their figures is divisible by 8 : So just like the topic says, I'm trying to write an efficient function that will print all numbers from 1 to 1000 that the sum of their figures is divisible by 10. I'm using this 'for': `for (var i =...
0debug
Tuples from postgresql not getting extracted onto the webpage using rails : stack overflow! I'm a newbie to using ROR. I'm trying to develop a simple blog app using rails 5.0.1 and psql. The problem is that,although 3 tuples are stored in the db(I checked it),when I extract it using "@posts=Post.all "command, only 3 ...
0debug
static void virtio_blk_handle_read(VirtIOBlockReq *req) { BlockDriverAIOCB *acb; uint64_t sector; sector = ldq_p(&req->out->sector); if (sector & req->dev->sector_mask) { acb = bdrv_aio_readv(req->dev->bs, sector, &req->qiov, req->qiov.size / BDRV_SECTOR_...
1threat
static uint64_t mv88w8618_eth_read(void *opaque, hwaddr offset, unsigned size) { mv88w8618_eth_state *s = opaque; switch (offset) { case MP_ETH_SMIR: if (s->smir & MP_ETH_SMIR_OPCODE) { switch (s->smir & MP_ETH_SMIR_ADDR) { case MP...
1threat
Need specified regexp : https://regex101.com/r/YWgrlO/1 I have test data on the link "summer camp", "summer", "camp", me need to make a regular expression so that "summer camp" becomes the first match
0debug
How do you sync Postman with a git repository : <p>I'm wondering how you can sync your Postman config with a git repository.</p> <p>I know you can export and import from Postman to a folder - which is OK - but I wondered if there was something more effortless.</p>
0debug
static int64_t seek_to_sector(BlockDriverState *bs, int64_t sector_num) { BDRVBochsState *s = bs->opaque; int64_t offset = sector_num * 512; int64_t extent_index, extent_offset, bitmap_offset; char bitmap_entry; extent_index = offset / s->extent_size; extent_offset = (offset % s->...
1threat
void visit_get_next_type(Visitor *v, int *obj, const int *qtypes, const char *name, Error **errp) { if (v->get_next_type) { v->get_next_type(v, obj, qtypes, name, errp); } }
1threat
static int vmdk_parse_extents(const char *desc, BlockDriverState *bs, const char *desc_file_path) { int ret; char access[11]; char type[11]; char fname[512]; const char *p = desc; int64_t sectors = 0; int64_t flat_offset; char extent_path[PATH_MAX]; BlockDriverStat...
1threat
Stop objects from colliding using SpriteKit : <p>I am testing out the features of SpriteKit and I ran into a problem. I was reading into bit masks, colliding, category, and contact. I get what they are, mostly at least, I don't get the point of category bitmasks, but I get colliding bitmasks which are the ones I need t...
0debug
How do i enable javascript autoload function : is there a way i can enhance my script to autoload instad of using button. Also is there a way i can include fade-in style sort of in this script. <script> var content = [ "Headline", "Headline 1", "Headline 2", "Headline 3", ];...
0debug
static int decode_frame(AVCodecContext * avctx, void *data, int *got_frame, AVPacket *avpkt) { KmvcContext *const ctx = avctx->priv_data; AVFrame *frame = data; uint8_t *out, *src; int i, ret; int header; int blocksize; const uint8_t *pal = av_packet_get_side...
1threat
Can any body help me to create this image in android by using shape : <p><a href="https://i.stack.imgur.com/BWBz8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BWBz8.png" alt="enter image description here"></a></p> <p>Please suggest me which is the best way to create this image by just create png ...
0debug
static void m68060_cpu_initfn(Object *obj) { M68kCPU *cpu = M68K_CPU(obj); CPUM68KState *env = &cpu->env; m68k_set_feature(env, M68K_FEATURE_M68000); m68k_set_feature(env, M68K_FEATURE_USP); m68k_set_feature(env, M68K_FEATURE_WORD_INDEX); m68k_set_feature(env, M68K_FEATURE_BRAL); m...
1threat
static void blur(CoverContext *cover, AVFrame *in, int offx, int offy) { int x, y, p; for (p=0; p<3; p++) { int ox = offx>>!!p; int oy = offy>>!!p; int stride = in->linesize[p]; uint8_t *data = in->data[p] + ox + oy * stride; int w = FF_CEIL_RSHIFT(cover->width ...
1threat
Creating mutiline text area in javascript : <!DOCTYPE html> <html> <body> <p>Click the button to create a File Upload Button.</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var x = document.createElement("INPUT"); ...
0debug
sql retrieve the name of every customer and how many pizzas they have ordered (NULL if no pizzas ordered) : I have to answer a question that has to be answered int a certain format. SELECT blank 1 FROM blank 2( SELECT blank 3 AS quantity FROM ORDERS NATURAL JOIN ORDERCONTENTS GROUP BY blank 4) as quant...
0debug
static void slavio_timer_init_all(target_phys_addr_t addr, qemu_irq master_irq, qemu_irq *cpu_irqs, unsigned int num_cpus) { DeviceState *dev; SysBusDevice *s; unsigned int i; dev = qdev_create(NULL, "slavio_timer"); qdev_prop_set_uint32(dev, "num_cpus", nu...
1threat
When use String.Insert(int index, string text) insert at the end of the new string: "00000" [C#] : I need to insert in a specific position of "string line", another string, so I compute the specific position for start to insert: string info1 = "info1"; string info2 = "info2"; string info3 = "info3...
0debug
Desktop application through java netbeans : I want to design a desktop software in java through Netbeans. So when creating a 'New Project' in Netbeans, what i would have to select - whether 'Java Application' under "java" or 'JavaFX Application under "JavaFX" ?
0debug
What is the optimal way to return a private value from inside a class? : <p>I'm attempting to optimize my code for maximum readability and for that I need my code to be in-line through and through. I will present two snippets of code as an example. In my eyes the below one is more easier for the eyes. These snippets (o...
0debug
Error:error: '' is incompatible with attribute android:background (attr) reference|color : <p>I can't run my app and some of the attributes are unrecognized, resources aren't supported as the app build results suggest.How do i fix all of the resource values? Can it be a problem from the dependencies? can the android st...
0debug
void dpy_gl_scanout(QemuConsole *con, uint32_t backing_id, bool backing_y_0_top, uint32_t x, uint32_t y, uint32_t width, uint32_t height) { assert(con->gl); con->gl->ops->dpy_gl_scanout(con->gl, backing_id, backing_y_0_top, ...
1threat
coudn't get value from text box : i have a text box called txtUprice.. which gets the value from a data grid view **but when i tried get value of txtUprice text box in a message box.. (with or without changing the text box value) im getting an error "Input string was not in a correct format"** i have tried changi...
0debug
static int recover(WtvContext *wtv, uint64_t broken_pos) { AVIOContext *pb = wtv->pb; int i; for (i = 0; i < wtv->nb_index_entries; i++) { if (wtv->index_entries[i].pos > broken_pos) { int ret = avio_seek(pb, wtv->index_entries[i].pos, SEEK_SET); if (ret < 0) ...
1threat
How to cast activity to fragment by converting activity to fragment? : As a beginner, I am struggling here to solve one issue in my programming code. I have Navigation drawer -> If I click item from the Navigation drawer, it opens the separate Fragment which has two tabs named as "Lists" and "Photos". My aim is ...
0debug
Open native iOS map application with specific lat and lng : <p>How to open native ios map application by adding pin at specific lat and lng from Objective C.</p>
0debug
static void spapr_cpu_core_register(const SPAPRCoreInfo *info) { TypeInfo type_info = { .parent = TYPE_SPAPR_CPU_CORE, .instance_size = sizeof(sPAPRCPUCore), .instance_init = info->initfn, }; type_info.name = g_strdup_printf("%s-" TYPE_SPAPR_CPU_CORE, info->name); type_...
1threat
[C++]Calling multiple functions with multiple params from a function pointer? : im trying to define a function pointer for calling multiple functions with different parameters but now im stuck with my idea does anyone have a idea or can see what i do wrong because i can't :smile: It will be very helpfull if you can hel...
0debug
What is the Python operater ilshift (<<=)? : What is or what makes the Python operator ilshift (<<=) and where can I find infos about this? Thanks https://docs.python.org/2/library/operator.html#operator.ilshift http://www.pythonlake.com/python/operators/operatorilshift
0debug
VBScript - Read CSV file and output result depending on date : I have a csv file with 2 columns 02/07/2018,Week A 09/07/2018,Week B 16/07/2018,Week A 23/07/2018,Week B 30/07/2018,Summer Break How do I read this in to a VBScript and then find the current week and then display a message to display the text from...
0debug
Airflow "This DAG isnt available in the webserver DagBag object " : <p>when I put a new DAG python script in the dags folder, I can view a new entry of DAG in the DAG UI but it was not enabled automatically. On top of that, it seems does not loaded properly as well. I can only click on the Refresh button few times on t...
0debug
Reorder a list of string randomly but constant in a period of time : <p>I need to reorder a list in a random way but I want to have the same result on a short period of time ... So I have:</p> <pre><code>var list = new String[] { "Angie", "David", "Emily", "James" } var shuffled = list.OrderBy(v =&gt; "4a78926c"))....
0debug
send command from node red to arduino : <p>Good morning everyone,</p> <p>I want to send command to my Arduino board by clicking on a button on node red dashboard</p> <p>my Arduino sketch send sensor data to be visualised in the dashboard of the node red (using serial), the data is sent every 2 seconds automatically (...
0debug
static void qobject_input_type_str(Visitor *v, const char *name, char **obj, Error **errp) { QObjectInputVisitor *qiv = to_qiv(v); QObject *qobj = qobject_input_get_object(qiv, name, true, errp); QString *qstr; *obj = NULL; if (!qobj) { return; ...
1threat
void error_setg(Error **errp, const char *fmt, ...) { va_list ap; va_start(ap, fmt); error_setv(errp, ERROR_CLASS_GENERIC_ERROR, fmt, ap); va_end(ap); }
1threat
Setting selected option of select control in an Angular 2 model-driven form : <p>I have researched many similar existing answers on SO and elsewhere, but just can't find the solution to this.</p> <p>I'm using the model-driven approach in Angular 2 to build my form, which is both an add and edit form. When in edit mode...
0debug
Check if username (Hashed) or email(Hashed) alredy exist with pdo : i am trying to verify if username or email are alredy taken in a registration form, but i can't understand how to do it, since both are hashed in my database with password_hash(), how can i compare, users input with the database in pdo?Please explain m...
0debug
static void pred_temp_direct_motion(H264Context * const h, int *mb_type){ MpegEncContext * const s = &h->s; int b8_stride = 2; int b4_stride = h->b_stride; int mb_xy = h->mb_xy, mb_y = s->mb_y; int mb_type_col[2]; const int16_t (*l1mv0)[2], (*l1mv1)[2]; const int8_t *l1ref0, *l1ref1; ...
1threat
How to specify the path of `package.json` to npm? : <p>I use <code>npm</code> scripts to build my project. I'd like to be able to run the scripts from a different directory. That is, instead of doing the following:</p> <pre><code>cd project; npm run build; cd .. </code></pre> <p>...I'd like to simply do something l...
0debug
static void build_pci_bus_state_cleanup(AcpiBuildPciBusHotplugState *state) { build_free_array(state->device_table); build_free_array(state->notify_table); }
1threat
regex match pattern in a string multiple times : <p>I have the following string "*&amp;abc=123&amp;**&amp;defg=hh&amp;*" and so on the pattern start and end is <em>&amp;&amp;</em> and I would like to have the following when I do regex.matches or regex.split</p> <p>first match = <em>&amp;abc=123&amp;</em> 2 match = <e...
0debug
how to sort value based on index in javascript? : I have a data which resembles just the below format in javascript. i would like to sort descending order with the index 3 or the column 4. any help would be really helpfull. sort desc on fourth column
0debug
selecting information from table : Hello i am new to sql server and used to work on normal sql , I have an issue In table i have for example 591|15-MA TEST i want to retrieve 15-MA TEST i tried to mix substring , charindex , left with no use , Can any one help me
0debug
static int make_cdt16_entry(int p1, int p2, int16_t *cdt) { int r, b, lo; b = cdt[p2]; r = cdt[p1] << 11; lo = b + r; return (lo + (lo << 16)) << 1; }
1threat
Swift 4 : 'init(_offset:)' is unavailable : > Swift 4 : 'init(_offset:)' is unavailable Iam trying to expand variable names (enclosed by curly braces). let message = "Hello {what}".expand(["what" : "world"]) print(message) // Hello World I used this for dynamic url construction. Upt...
0debug
Fused Location Provider: Is there a way to check if a location update failed? : <p><strong>Introduction</strong></p> <p>In my app I want to get a one-off accurate location of where the user currently is. When I used <code>FusedLocationProviderApi.getLastLocation</code> sometimes this would be null or out of date locat...
0debug
Regex for validating path : <p>How do I write a regex that passes for below conditions in C#</p> <p>\segment\segment\ </p> <p>a) each segment starts and ends with a backslash</p> <p>b) segment can be alpha-numeric with dashes, underscore and period allowed (e.g. \some-name\some.other_name\ )</p> <p>c) the sequenc...
0debug
QObject *json_parser_parse_err(QList *tokens, va_list *ap, Error **errp) { JSONParserContext ctxt = {}; QList *working; QObject *result; if (!tokens) { return NULL; } working = qlist_copy(tokens); result = parse_value(&ctxt, &working, ap); QDECREF(working); e...
1threat
how to access elements from array using index : I am at the byebug and `object` has the following array [{"a"=>nil, "b"=>79, "c"=>"mg/dL", "d"=>"high", "e"=>false}, {"a"=>80, "b"=>139, "c"=>"mg/dL", "d"=>"low", "e"=>true}, {"a"=>140, "b"=>199, "c"=>"mg/dL", "d"=>"moderate", "e"=>false}, {"a"=>200, "b"=>nil, "c"=...
0debug
Can you use python to solve a quadratic without teaching it the quadratic formula? : <pre><code>def f(x): f(x) = x^2 + 2*x + 1 for x in range(-100, 100): if f(x) == 0: print(x) </code></pre> <p>Something like this? I get the error "cannot assign to function call" though</p>
0debug
Bash fail if any single command fails but still run all commands : <p>Probably a simple question but an elegant solution is not coming to mind. I would like to run a series of commands (each one is a test) and return 1 if any of them returned non-zero. Typically I would do something like:</p> <pre><code>thingA &amp;...
0debug
What algorithm used to in Set to avoid duplicates? : May I know What algorithm used to in Set to avoid duplicates ? I want to know just What is the name of the algorithm used to avoid the duplicates and If possible the same algorithm implementation as well.
0debug
static void init_excp_970 (CPUPPCState *env) { #if !defined(CONFIG_USER_ONLY) env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; env->excp_vectors[POWERPC_EXCP_DSEG] = 0x00000380; ...
1threat
Can i use the following powershell command to theck the port availability "netstat -ano | findstr 161 " : I am trying to check the availability on UDP port 389,161 on a remote server The windows server version is 2012R2 netstat -ano | findstr 161 I expect the output such as "Port 161 listening"
0debug
static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst, int pitch, const uint8_t *table) { int i; int j; int out = 0; if (width & 1) return AVERROR_INVALIDDATA; while (out < width) { int c = ir2_get_code(&ctx->g...
1threat