problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size)
{
VP56RangeCoder *c = &s->c;
int rows, cols;
ff_vp56_init_range_decoder(&s->c, buf, buf_size);
s->frames[VP56_FRAME_CURRENT]->key_frame = !vp56_rac_get(c);
vp56_rac_get(c);
ff_vp56_init_dequant(s, vp56_rac_get... | 1threat |
Randomize Function to create a length range in Delphi : <p>I was wondering how I would create a randomized string that has a set length range, that range being 8 to 24 characters, instead of it it being a fixed length such as 10. </p>
| 0debug |
is it posible to use back button item and left bar button items at same time in swift 3 : I want use back button item to go the stack back and a left bar button to call also the slide menu. for this a use a navigation bar , is this possible and how?
[menu button][1]
[back item][2]
[1]: https://i.stack.imgu... | 0debug |
def even_Power_Sum(n):
sum = 0;
for i in range(1,n+1):
j = 2*i;
sum = sum + (j*j*j*j*j);
return sum; | 0debug |
NullPointerException error Array : <p>Trying to create a basic program, in which an object Swimmer and its data are created and stored to a file (simple database for swimmers). However, I am experiencing numerous run time errors, many of which are classified as NullPointerExceptions. I have a Swimmer class w/o a Constr... | 0debug |
pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian)
{
if (native_endian) {
switch (bpp) {
case 15:
return PIXMAN_x1r5g5b5;
case 16:
return PIXMAN_r5g6b5;
case 24:
return PIXMAN_r8g8b8;
case 32:
... | 1threat |
Software to block internet for applications : <p>I am using mobile internet on my desktop computer. All the sudden I have found out there was like one giga mb lost for nothing and I assume it must be because of some other background applications. Is there any software where I could limit internet only for specific appl... | 0debug |
What does the 24 mean in 192.168.1.0/24 in route table? : <p>What does the 24 mean in 192.168.1.0/24 in route table?
Sorry for my noob question ;(</p>
| 0debug |
static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_time, int flags)
{
MOVContext* mov = (MOVContext *) s->priv_data;
MOVStreamContext* sc;
int32_t i, a, b, m;
int64_t start_time;
int32_t seek_sample, sample;
int32_t duration;
int32_t count;
int32_t chu... | 1threat |
Cannot read property 'setState' of undefined (with fetch api) : <p>When I'm trying to set my "users" state's variable, I've got the following message : <br/><em>Cannot read property 'setState' of undefined</em>
<br/> It's on the following code line :<br/><br/>
<code>this.setState({users: data.users});</code></p>
<p>He... | 0debug |
Java exit while loop from called method : <p>How do I make this code exit after the s variable updates to 0? As of now, its executing the whole block outputting the last print statement before stopping. Is this the normal behaviour of while loop?</p>
<pre><code>public class test {
private static int i = 0;
pr... | 0debug |
Membership site with PHP and MySQL : <p>I have a html site, and I have a page that acts as a bio for users (which I currently have to update by hand with html).</p>
<p>I want to create a membership login page, and I want users to be able to input their own data, that in turn updates their bio page automatically. With ... | 0debug |
how to use colored google maps in website without any JavaScript? :
can we use google maps in webpage or website without any javascript?
just using HTML and CSS.
previously I used google map with `<iframe>` tag
`<iframe id="map-canvas" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3784.7722058335007... | 0debug |
format a string like a date : <p>I'm receiving a "<em>date</em>" represented by a string in the form <strong>yyyymmdd</strong> from a database table over which I have no control. (I cannot modify the type/format of the date field)</p>
<p>I would like to insert the character '<strong>/</strong>' at the right place. (<e... | 0debug |
Git rebase and push instead of pull : <p>Alternative for
1. git pull origin master
2. git add -a
3. git commit -m 'message'
4. git push</p>
<p>How can I do the above without using a pull and using a rebase
1. git rebase master
2. git add -a
3. git commit -m 'message'
4. git push</p>
<p>Is that all I need to ... | 0debug |
Reasons to use generic array over array of Object : I know two reason to use generic array over array of objects.
1. To restrict what type of objects can be inserted into the array
List<Object> stringObjects = Arrays.asList("a",new Integer(5));
List<String> genericStrings = Arrays.asList("a",new Integer(... | 0debug |
Difference between Number and Integer in SQL Datatypes? : <p>i want to know the basic difference between sql datatype Number and Integer. </p>
| 0debug |
ESLint's "no-undef" rule is calling my use of Underscore an undefined variable : <p>I am using Grunt as my Build Tool and ESLint as my linting tool for an app I am working on. I am also using the Underscore Node package, and have made use of it in my app. Unfortunately, when I run ESLint on my code, it thinks that _ is... | 0debug |
How to Resize Center and Crop an image with ImageSharp : <p>I need to convert some System.Drawing based code to use this .NET Core compatible library:</p>
<p><a href="https://github.com/SixLabors/ImageSharp" rel="noreferrer">https://github.com/SixLabors/ImageSharp</a></p>
<p>The System.Drawing based code below resize... | 0debug |
is this a correct way to analyze a graph ? : Hi guys I need help with analyzing a graph , I have implemented Dijkstra algorithm but i'm not sure about my analysis.
is this a correct way to analyze a graph ?
my analysis are in the comments.
public class Dijkstra {
for (int i = 0; ... | 0debug |
static abi_long do_socketcall(int num, abi_ulong vptr)
{
abi_long ret;
const int n = sizeof(abi_ulong);
switch(num) {
case SOCKOP_socket:
{
abi_ulong domain, type, protocol;
if (get_user_ual(domain, vptr)
|| get_user_ual(type, vptr + n)
... | 1threat |
How to set the path of the folder to be created in uwp in C# : <p>For example: C:\Users\gabriel\Desktop\</p>
<p>There it creates the folder on the desktop</p>
<p>I do not have code, and I have no idea how to do it. And I do not want to use FolderPicker, I want to define in the folder path code</p>
| 0debug |
User control with if/else statment? : So.. I want to include an ascx file with navigator bar. There are two versions, one shows up when user is not logged in and one is for logged user.
<div class="navigator">
<uc1:nav runat="server" ID="nav" />
</div>
... | 0debug |
static int integrate(hdcd_state_t *state, int *flag, const int32_t *samples, int count, int stride)
{
uint32_t bits = 0;
int result = FFMIN(state->readahead, count);
int i;
*flag = 0;
for (i = result - 1; i >= 0; i--) {
bits |= (*samples & 1) << i;
samples += stride;
... | 1threat |
Git revert just some files in commit : <p>I have few commits on github that I want to change. So in my previous commit I've changed some file/folders and I need to revert changes only for some of them. What is the best solution to make it.</p>
| 0debug |
Use AngularJS directive in Angular Component : <p>I'm trying to upgrade an angularjs directive to use it my angular component. I've gotten the hybrid (ng1 + ng2) environment to work. I can also inject angularjs services in angular and use them in angular components (I actually got this working even with angularjs 1.4... | 0debug |
Some example of Junit of Rest Api : I wanna to try some example of junit with rest api, i m a beginner of j unit and i don t know how to start
nothing to test
My Repository:
@Repository
public interface ClienteRepository extends JpaRepository<ClienteEntity, Integer>{
ClienteEntity findByEmail(@P... | 0debug |
How do I add an intermediate SSL certificate to Kubernetes ingress TLS configuration? : <p>The documentation does not specify how to add an intermediate SSL certificate: <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#tls" rel="noreferrer">https://kubernetes.io/docs/concepts/services-networkin... | 0debug |
A Python implementation of GitHub flavored markdown : <p>I've been searching for a while now but still can't find anything. I basically need a Python converter for Github flavored markdown, that supports syntax highlighting. I currently use <a href="https://github.com/stewart/gfm" rel="nofollow">gfm</a>, however, that ... | 0debug |
Algorithm to remove and shift elements in an array : <p>I am struggling to come up with a technique to achieve following:</p>
<p>Example:
Input:</p>
<pre><code>a[] = [0 1 0 1 0 1 1 0]
Array a has 8 entries. Each entry will have either 0 or 1.
</code></pre>
<p>Output:</p>
<pre><code>output = [1 3 5 6 0 2 4 7]
Outp... | 0debug |
How to get Database Messages while executing any query from JAVA : Is it possible to get Database console messages using JDBC after a query is being executed?
select * from staff
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/pw5hy.png | 0debug |
Can't create project on Netbeans 8.2 : <p>I have windows 10 OS, I just downloaded JDK 9, and Netbeans 8.2 version with All features. When I want to create (Java) project, it just can't do it. Doesn't give me an error or something, just this blank screen.</p>
<p><a href="https://i.stack.imgur.com/FokIp.png" rel="norefe... | 0debug |
Iframe not loading in IE after installing update KB3154070 : <p>We have an application that mostly deals with iframes (loads the different pages within the application on demand)</p>
<p>Recently, the IE browser got updated with <a href="https://support.microsoft.com/en-gb/kb/3154070">KB3154070</a>(Current IE Version: ... | 0debug |
void tcg_dump_ops(TCGContext *s)
{
char buf[128];
TCGOp *op;
int oi;
for (oi = s->gen_first_op_idx; oi >= 0; oi = op->next) {
int i, k, nb_oargs, nb_iargs, nb_cargs;
const TCGOpDef *def;
const TCGArg *args;
TCGOpcode c;
op = &s->gen_op_buf[oi];
... | 1threat |
Extending Angular 4 universal renderer : <p>I hope someone can help with the logic on this one.
I would like to modify the way angular universal injects the style for each component.
Does anyone know how to extend the renderer an get the stylesheet from other place by doing an api request. I would just need an example... | 0debug |
Android Developer Console - wrong fingerprint after release build with Android Studio : <p>I started building an Android app with Adobe Air so I needed a .p12 key for building the release version .apk
Next I ported the app to Unity3d so I converted the .p12 to .keystore. Up to this point there was no problem uploading... | 0debug |
How to capitalized only first letter of sentence in input fields with javascript? : <p>I want to have only first letter of the sentence to be capitalized in input fields with javascript when i type something. </p>
<p>This is my website <a href="http://web.quick-truck.com/signup" rel="nofollow">link</a> where i want to... | 0debug |
PPC_OP(setcrfbit)
{
T1 = (T1 & PARAM(1)) | (T0 << PARAM(2));
RETURN();
}
| 1threat |
How to return the last element in a byte array of integers in golang : In Golang, I want to find the last element in an array of integers.
But it seems like this needs to be done manually or in such a complex way.
So if I have a list of 0.0.1, 0.0.2, 0.0.3 I just want 0.0.3 to be returned.
Every time I try ... | 0debug |
XCode, Swift, Adapt to all devices : I am a newbie in Swift world. I am trying to design a screen like below. I can do this design for several devices for example IPhone 5 and 5S. This means that my application runs properly on IPhone 5 and 5S. But when I try to run it on IPhone 6 or 6S, my design is broken and disrupt... | 0debug |
Can someone explain to me how this if else loop works? : studying some linked lists and not sure how this loop works with the assignment.
The question where the code is from is to find the intersection of two linked lists.
`ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
ListNode *cur1 ... | 0debug |
WPF Window Closing does not work after Cancel : <p>I have an issue that I can't seem to resolve via Google (likely because I'm not searching the right criteria). I have a Closing Event that checks if a button is enabled and pops a messagebox with a result (Yes/No). If the user says NO, I get the desired results in the... | 0debug |
How do I set array to a new array? : I need to a implement a function that modifies array. New array maybe different size. `cout` prints 1. I understand what's wrong with this code but I just cannot figure out what the syntax is.
//tried this..
int reduce(int *array[])
{
*array = ... | 0debug |
Avoiding Android navigation IllegalArgumentException in NavController : <p>I recently switched over to Android Navigation, but have encountered a fair amount of situations (in different parts of the code), where I get:</p>
<pre><code>Fatal Exception: java.lang.IllegalArgumentException
navigation destination com.xxx.yy... | 0debug |
Are there any alternatives to T4 templates and EnvDTE for cross platform asp.net 5 development? : <p>We currently use T4 templates to generate C# code files based on C# Code (Entity POCO's) and the EDMX (in older applications) </p>
<p>Moving to ASP.NET 5 with a view to support cross platform development, are there any... | 0debug |
static int img_bench(int argc, char **argv)
{
int c, ret = 0;
const char *fmt = NULL, *filename;
bool quiet = false;
bool image_opts = false;
bool is_write = false;
int count = 75000;
int depth = 64;
int64_t offset = 0;
size_t bufsize = 4096;
int pattern = 0;
size... | 1threat |
Android WebView err_unknown_url_scheme : <p>With the simple below code I can get my url loaded correctly, but, I get "ERR_UNKNOWN_URL_SCHEME" when trying to tap on html links that starts with <em>mailto:</em> <em>whatsapp:</em> and <em>tg:</em> (Telegram).</p>
<p>Anyone can help me to fix this please? Unfortunately I ... | 0debug |
Javascript Copy To Clipboard on safari? : <p>It may be duplicate question but i didnt find the solution for this.</p>
<p>I am trying to copy text on button click. Its working on chrome, mozilla(working on on windows and mac but not on linux). And its not working on safari.</p>
<p>I am using <code>document.execCommand... | 0debug |
Declare a C++ function that has C calling convention but internal linkage : <p>I'm trying to interface with a C library, which expects me to provide a pointer to a callback function.</p>
<p>As I understand it, according to the standard the callback must have C <em>language linkage</em>, due to possibly different calli... | 0debug |
static int vc9_decode_init(AVCodecContext *avctx)
{
VC9Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
GetBitContext gb;
if (!avctx->extradata_size || !avctx->extradata) return -1;
avctx->pix_fmt = PIX_FMT_YUV420P;
v->s.avctx = avctx;
if(ff_h263_decode_init(avctx) < 0)
... | 1threat |
static int get_uint16_equal(QEMUFile *f, void *pv, size_t size,
VMStateField *field)
{
uint16_t *v = pv;
uint16_t v2;
qemu_get_be16s(f, &v2);
if (*v == v2) {
return 0;
error_report("%x != %x", *v, v2);
return -EINVAL;
| 1threat |
C# - A* algorithm gives wrong results : <p>I am trying to make 4-directional A-star pathfinding algorithm in C# but can't make it work properly. In Main method i have a example 5x5 <em>int</em> array map to set which fields can be accessed and which not (0 - clear field, 1 - obstacle). As example i set <em>START</em> p... | 0debug |
static bool lowprot_enabled(const CPUS390XState *env)
{
if (!(env->cregs[0] & CR0_LOWPROT)) {
return false;
}
if (!(env->psw.mask & PSW_MASK_DAT)) {
return true;
}
switch (env->psw.mask & PSW_MASK_ASC) {
case PSW_ASC_PRIMARY:
return !(env->cregs[1] & _AS... | 1threat |
Limites de uso gratuito no Azure : Olá, me inscrevi agora no teste gratuito do Azure não sei como funciona. Gostaria de saber quais os limites de uso terei depois que o plano gratuito acabar. Eu tenho um site com 400mb e 10mb de banco de dados MySQL, posso hospedar de forma gratuita sem exceder os limites de uso do pla... | 0debug |
VB.Net MS ACCESS .Object Reference Not Set to an instanceof an object : 'Sql = "Select ItemName,Count(itemID) from tblItem where Item ='" & "A" & "' AND ExpireDate < '" & Now().Date() & "' Group By ItemName"
Im FACING Datatype miss match in this querry in DATE Field....
how could i make this ?
DB-MS ACCESS | 0debug |
static int adx_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf0, int buf_size)
{
ADXContext *c = avctx->priv_data;
short *samples = data;
const uint8_t *buf = buf0;
int rest = buf_size;
if (!c->header_parsed) {
int hdrsize = adx_decode_header(avctx,buf,... | 1threat |
Python: Extracting every nth m items from a list : Champs,
What's the most efficient way of extracting every nth m items from a list. So if I have:
[1,2,3,4,5,6,7,8,9,10,...]
I would like every 3rd 2 items, starting from the first index:
[1,2,7,8,13,14,...]
Thanks
Kam | 0debug |
Run some php Code with SAPUI5 on HANA Cloud Platform : I try to write some data with php in an .txt file. Therefore I create in my SAPUI5 App the file "writeData.php" with this content:
<?php
$inhalt = "123456789";
$handle = fopen ("testWrite.txt", w);
fwrite ($handle, $inhalt);
fclo... | 0debug |
void *pci_assign_dev_load_option_rom(PCIDevice *dev, struct Object *owner,
int *size, unsigned int domain,
unsigned int bus, unsigned int slot,
unsigned int function)
{
char name[32], rom_file[64];
... | 1threat |
How do i select rows based on specific condition in R :
I am trying to select specific rows based on specific condition. Like to get values all below z with respect to 1st column and exclude the ones on top. I tried using filter and group by but it is not working:(
https://i.stack.imgur.com/Xfa6j.png
| 0debug |
Is there a wildcard character in Express.js routing? : <p>I want to create a web application structure like the following:</p>
<pre><code>rootUrl/shopRecords/shop1
rootUrl/shopRecords/shop2
rootUrl/shopRecords/shop3...
</code></pre>
<p>where there can be any limit of shops, but all of the shop pages will have the sam... | 0debug |
void apic_enable_vapic(DeviceState *d, target_phys_addr_t paddr)
{
APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d);
APICCommonClass *info = APIC_COMMON_GET_CLASS(s);
s->vapic_paddr = paddr;
info->vapic_base_update(s);
}
| 1threat |
How to interact with Java Scanner Class (Atom editor) : I am super newb with Java and I am trying simple codes with Atom editor (osx).
Please, someone can help me to understand how can I interact with code with Atom?
I use Script package (Atom) to run the code (cmd+i).
For example if I use the Scanner class:
... | 0debug |
int qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset,
int nb_clusters)
{
BDRVQcowState *s = bs->opaque;
uint64_t cluster_index;
uint64_t old_free_cluster_index;
int i, refcount, ret;
cluster_index = offset >> s->cluster_bits;
for(i = 0; i < nb_clusters; i++) {
refco... | 1threat |
Regarding Contacts Framework in Swift : Having no experience in coding and having an app idea 6 months ago,I am watching swift programmatically rather than using the storyboard. So I have a question hoping some folks here can answer, and based on my limited search ability on what key words to use. I haven't been able ... | 0debug |
Is DatabaseCleaner still necessary with Rails system specs? : <p>From all that I've read about Rails 5.1 new system specs my understanding was that Rails now handles database transactions internally. </p>
<p>From <a href="http://rspec.info/blog/2017/10/rspec-3-7-has-been-released/" rel="noreferrer">Rspec's blog</a>: "... | 0debug |
static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s)
{
int x, y;
unsigned char B, BL, BH;
CHECK_STREAM_PTR(1);
B = *s->stream_ptr++;
BL = B & 0x0F;
BH = (B >> 4) & 0x0F;
x = -8 + BL;
y = -8 + BH;
debug_interplay (" motion byte = %d, (x, y) = (%d, %d)... | 1threat |
static int close_f(int argc, char **argv)
{
bdrv_close(bs);
bs = NULL;
return 0;
}
| 1threat |
avoid to show anything except English keyboard with javascript : how can do in javascript , when user typewrite anything except numbers , don't show anything in input field type text ,for some reason i can't change input type to number ?
and in other input type text when user typewrite any things except English ke... | 0debug |
Is this R bug real? : <p>I am quite confused... and thinking is this bug real? How can it be?
I just want to make a vector of 0's and 1's.</p>
<p>Here's the source and the outcome</p>
<pre><code>n.subj=1000
prop.aber = 0.9
n.measure = 3
n.subj.norm = n.subj*(1-prop.aber)
n.subj.aber = n.subj*prop.aber
labE <- rnor... | 0debug |
static void dp8393x_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
set_bit(DEVICE_CATEGORY_NETWORK, dc->categories);
dc->realize = dp8393x_realize;
dc->reset = dp8393x_reset;
dc->vmsd = &vmstate_dp8393x;
dc->props = dp8393x_properties;
} | 1threat |
Force browser user to maximize window and set 100% zoom : I know it sound weird but there really is a reason and it is in the users' best intereset. I know that having the browser automatically maximize and set 100% might be problematic but how about making so that if the window is not maximize and the zoom is not 100%... | 0debug |
static int mpeg4_unpack_bframes_filter(AVBSFContext *ctx, AVPacket *out)
{
UnpackBFramesBSFContext *s = ctx->priv_data;
int pos_p = -1, nb_vop = 0, pos_vop2 = -1, ret = 0;
AVPacket *in;
ret = ff_bsf_get_packet(ctx, &in);
if (ret < 0)
return ret;
scan_buffer(in->data, in->size... | 1threat |
int ff_hevc_cu_qp_delta_abs(HEVCContext *s)
{
int prefix_val = 0;
int suffix_val = 0;
int inc = 0;
while (prefix_val < 5 && GET_CABAC(elem_offset[CU_QP_DELTA] + inc)) {
prefix_val++;
inc = 1;
}
if (prefix_val >= 5) {
int k = 0;
while (k < CABAC_MAX_BI... | 1threat |
Can you create objects with length 0 in R? : <p>Is it possible to create objects in R with length 0?</p>
| 0debug |
Unable to trace the error for a function any help as in where i have gone wrong? : I am having trouble in debugging the error in this code, and not understanding where exactly i am going wrong? Can you please help?
#include <iostream>
using namespace std;
class man
{
int age;
int hei... | 0debug |
How to extract words from the string in python? : <p>I have strings of the form </p>
<pre><code> sent="Software Development = 1831".
</code></pre>
<p>I want to extract only words from the string i.e. "Software Development". How I can extract this in Python. </p>
| 0debug |
def median_trapezium(base1,base2,height):
median = 0.5 * (base1+ base2)
return median | 0debug |
PHP print JSON specific value : <p>In my code I want to print a specific value i.e. <code>ticket</code> from JSON data but when I do it I got <code>Notice: Trying to get property of non-object</code> error every time I don't know what I am doing wrong in it</p>
<p>Here is my JSON array dump</p>
<pre><code>array(3) {
... | 0debug |
How to create array from string in javascript : <p>I have a string like below</p>
<pre><code> Ontario;Northwest Territories;Nunavut;Prince Edward Island
</code></pre>
<p>from this string I need to create an array of string like</p>
<pre><code> territoty:Array<string> = [Ontario,Northwest Territories,Nunavut,P... | 0debug |
What are the industry standard breakpoints in Responsive Design based on the most popular devices TODAY 2016? : <p>What are the most popular breakpoints used in responsive design today? My interest is mainly mobile > tablet > desktop.</p>
<p>No opinions solicited, just hoping for concrete answers</p>
| 0debug |
Visual studio/GIT : No tracked remote branch : <p>I just configured Visual Studio 2015 with a connection to GitHub. Unfortunately, it doesn't work to track the remote branch.
I have 2 projects in the same solution, each has its own repository.
For each of them,
- I only have one branch (Master)
- I checked that the re... | 0debug |
convert how to Convert textbox to integer c# : <p>I'v problem
how to Convert textbox to float c#</p>
<p>I have in my textbox.text
example</p>
<p>8.1.1</p>
<p>I did this cod but error</p>
<p>//</p>
<pre><code> int a ;
a = val (model.Text);
//
if (a >= 6)
{
}
<... | 0debug |
how to get the largest sum of indexes in array that have a negative numbers in java : <p>hy , i'm a beginner java student and we were asked to take the sequence of indexes with the largest sum , the array have negative and positive numbers and may contain 0
our job is to get the largest sum of indexes that are in a ro... | 0debug |
SQLite provider in VS2017 : <p>I want to connect sqlite using EF6 in VS2017.
I installed "System.Data.SQLite" nuget package.
I also installed "sqlite-netFx46-setup-bundle-x86-2015-1.0.104.0.exe" from <a href="http://system.data.sqlite.org" rel="noreferrer">http://system.data.sqlite.org</a>, but I cannot see the sqlite ... | 0debug |
def find_substring(str1, sub_str):
if any(sub_str in s for s in str1):
return True
return False | 0debug |
I can't ever get Regex Right : <p>I have a query string I'm trying to remove a query string parameter. What I currently have is</p>
<p><code>date=(.*)&</code></p>
<p>But this will remove anything to the last &. I only want to remove to the first occurance of the &.</p>
<p>So this is how it should work:</... | 0debug |
static void exynos4210_gic_init(Object *obj)
{
DeviceState *dev = DEVICE(obj);
Exynos4210GicState *s = EXYNOS4210_GIC(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
uint32_t i;
const char cpu_prefix[] = "exynos4210-gic-alias_cpu";
const char dist_prefix[] = "exynos4210-gic-alias_dist";
... | 1threat |
static void channel_weighting(float *su1, float *su2, int *p3)
{
int band, nsample;
float w[2][2];
if (p3[1] != 7 || p3[3] != 7) {
get_channel_weights(p3[1], p3[0], w[0]);
get_channel_weights(p3[3], p3[2], w[1]);
for (band = 1; band < 4; band++) {
for (n... | 1threat |
Group by and find top n value_counts pandas : <p>I have a dataframe of taxi data with two columns that looks like this:</p>
<pre><code>Neighborhood Borough Time
Midtown Manhattan X
Melrose Bronx Y
Grant City Staten Island Z
Midtown Manhattan A
Lincoln Square ... | 0debug |
int float64_le( float64 a, float64 b STATUS_PARAM )
{
flag aSign, bSign;
if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) )
|| ( ( extractFloat64Exp( b ) == 0x7FF ) && extractFloat64Frac( b ) )
) {
float_raise( float_flag_invalid STATUS_VAR);
retu... | 1threat |
void *checkasm_check_func(void *func, const char *name, ...)
{
char name_buf[256];
void *ref = func;
CheckasmFuncVersion *v;
int name_length;
va_list arg;
va_start(arg, name);
name_length = vsnprintf(name_buf, sizeof(name_buf), name, arg);
va_end(arg);
if (!func || name... | 1threat |
Java homework- what's wrong with my code? : Here's the question:
A string contains several X's followed by several O's. Devise a divide-and-conquer algorithm that finds the number of X's in the string in log2n steps, where n is the length of the string.
And here's my code:
public static int count(String... | 0debug |
document.getElementById('input').innerHTML = user_input; | 1threat |
how can i fetch json array from php code and display it in textview? using webclient : i am using xamarin.android at visual studio 2015 with c# language also i am using Mysql as a server and used `webclient` for connecting xamarin.android to Mysql
this is my php code :
` $sql = "SELECT * FROM DoctorMaster WHERE Doc... | 0debug |
Identify first n characters of regex pattern : I'm trying to mask all the occurences of **AccountNumber** in my XML response code. The AccountNumber has 16 digits and I want to mask first 12 digits and retain last four.
XML response:
<ns2:PaymentMethod>
<CCInfo xmlns="">
<AccountType>sd... | 0debug |
Aligning title, subtitle and caption for horizontal ggplot barchart : <p>I would like to left align the <code>plot.title</code>, <code>plot.subtitle</code> and <code>plot.caption</code> in a horizontal ggplot2 barchart.</p>
<p><em>Example:</em></p>
<pre><code>library("ggplot2") # ggplot2 2.2
df <- data.frame(type=... | 0debug |
static int aac_encode_frame(AVCodecContext *avctx,
uint8_t *frame, int buf_size, void *data)
{
AACEncContext *s = avctx->priv_data;
int16_t *samples = s->samples, *samples2, *la;
ChannelElement *cpe;
int i, j, chans, tag, start_ch;
const uint8_t *chan_map = aac_cha... | 1threat |
How to use RETURNING for query.update() with sqlalchemy : <p>I want to specify the return values for a specific update in sqlalchemy.</p>
<p>The documentation of the underlying <a href="http://docs.sqlalchemy.org/en/latest/core/dml.html#sqlalchemy.sql.expression.update" rel="noreferrer">update statement</a> (sqlalchem... | 0debug |
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
{
PerThreadContext *p = avctx->internal->thread_ctx;
int err;
f->owner = avctx;
if (!(avctx->active_thread_type & FF_THREAD_FRAME))
return ff_get_buffer(avctx, f->f, flags);
if (atomic_load(&p->state) != ... | 1threat |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.