problem stringlengths 26 131k | labels class label 2
classes |
|---|---|
VB.NET help slicing a substring : Trying to slice a sub-string out of a string and though I have searched the site, I have found methods of both searching for a sub-string, and slicing a string but only for the first instance of the slice bound. Bellow is what I am trying to do:
string = "abcdabcdabcdabcd"
I want t... | 0debug |
Reread a response body from JavaScript's fetch : <p><code>fetch()</code> returns promise which (if successful) resolves to a <a href="https://developer.mozilla.org/en-US/docs/Web/API/Response" rel="noreferrer"><code>Response</code></a> object. A very common thing to do is immediately call <a href="https://developer.moz... | 0debug |
static void virtio_vmstate_change(void *opaque, int running, RunState state)
{
VirtIODevice *vdev = opaque;
BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK);
if (runnin... | 1threat |
uint32_t HELPER(get_cp15)(CPUState *env, uint32_t insn)
{
cpu_abort(env, "cp15 insn %08x\n", insn);
return 0;
}
| 1threat |
Position Fixed not working when CSS Filters applied on same element in Microsoft Edge : <p>I am testing this on Edge 20.10240.16384.0 </p>
<p>I have an element whose position is fixed and has CSS Filters applied to it. This works great in all browsers except Microsoft Edge, where the position of the element doesn't re... | 0debug |
static int nuv_probe(AVProbeData *p) {
if (p->buf_size < 12)
return 0;
if (!memcmp(p->buf, "NuppelVideo", 12))
return AVPROBE_SCORE_MAX;
if (!memcmp(p->buf, "MythTVVideo", 12))
return AVPROBE_SCORE_MAX;
return 0;
}
| 1threat |
static int proxy_renameat(FsContext *ctx, V9fsPath *olddir,
const char *old_name, V9fsPath *newdir,
const char *new_name)
{
int ret;
V9fsString old_full_name, new_full_name;
v9fs_string_init(&old_full_name);
v9fs_string_init(&new_full_name);
... | 1threat |
vcard_free(VCard *vcard)
{
VCardApplet *current_applet = NULL;
VCardApplet *next_applet = NULL;
if (vcard == NULL) {
return;
}
vcard->reference_count--;
if (vcard->reference_count != 0) {
return;
}
if (vcard->vcard_private_free) {
(*vcard->vcard_priv... | 1threat |
void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
ISADevice **rtc_state,
bool create_fdctrl,
bool no_vmport,
uint32_t hpet_irqs)
{
int i;
DriveInfo *fd[MAX_FD];
DeviceState *hpet = NULL;
... | 1threat |
Generate inside module folder : <p>I'm working with an Angular 2 application based on Angular-CLI skeleton, I had the habit of structuring my src folder with one directory by module, and each component related to this module in the same folder.</p>
<pre><code>src
app
documents
document-list.com... | 0debug |
TortoiseSVN Why does "Add" exist when you can commit unversioned? : I can't seem to get a clear answer as to why this is useful.
**[Official Description][1]**
> Add files, directories, or symbolic links to your working copy and schedule them for addition to the repository. They will be uploaded and added to the r... | 0debug |
int av_cold ff_mlp_init_crc2D(AVCodecParserContext *s)
{
if (!crc_init_2D) {
av_crc_init(crc_2D, 0, 16, 0x002D, sizeof(crc_2D));
crc_init_2D = 1;
}
return 0;
}
| 1threat |
void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
{
ff_j_rev_dct(block);
ff_put_pixels_clamped(block, dest, line_size);
}
| 1threat |
Please help me to fix a problem in android studio build (Update firbase) : im new here i hope u do good
my problem is about firebase versions when i add the last line "implementation 'com.google.firebase:firebase-core:16.0.1' " i get this problem
this is my code :
dependencies {
implementation file... | 0debug |
Ms-dos to extract string : I have a string "[0.020s][info][class,load] opened: C:\Program Files\Java\jdk-9.0.1\lib\modules".
I'd like to extract only the “C:\Program Files\Java\jdk-9.0.1” part of the string by using MS-DOS.
How can I write the code? Using position is not the choice. Thanks | 0debug |
How To Refresh A Grid From Another Form In c# Window Form Application : <p>I Have A MDI Form As DashBoard There Is 1 DataGrid Control And 1 Submit Button After Submit Button Form 2 Is Open I Have To Write A Code On Form 2 And Refresh a Dashboards Grid </p>
| 0debug |
Server-side warning: Aggregation query used without partition key : <p>While using the C/C++ driver of Cassandra, I at times see these kind of messages popping up in my console:</p>
<pre><code>1460937092.140 [WARN] (src/response.cpp:51:char*
cass::Response::decode_warnings(char*, size_t)):
Server-side warn... | 0debug |
void memory_region_init_ram(MemoryRegion *mr,
const char *name,
uint64_t size)
{
memory_region_init(mr, name, size);
mr->ram = true;
mr->terminates = true;
mr->destructor = memory_region_destructor_ram;
mr->ram_addr = qemu_ram_alloc(siz... | 1threat |
handling null and string.empty using ?? operator in C# : <p>I want to handle "" and null while assigning value to the property of the class. </p>
<p>So how can i handle the same. Below is my example which works for null. But also want to handle empty string</p>
<pre><code> Id = characater.Id ?? System.Guid.NewGuid().... | 0debug |
[Vue warn]: Cannot find element: #app : <p>I have a fresh installed laravel project with all the components updated.</p>
<p>All I did is tried to add <code>app.js</code> in my welcome.blade.php file, after adding the following I get this error</p>
<blockquote>
<p>[Vue warn]: Cannot find element: #app </p>
</blockqu... | 0debug |
how to return an array in a c++ function : int main()
{
std::string my_string= "16657";
std::map<std::string, std::array<std::string, 2>> m_msg_int;
std::array<std::string, 2> arrId;
arrId[0] = "ABC";
arrId[1] = "XYZ/CDE";
m_msg_int[my_string] = arrId;
get_msg_type(cons... | 0debug |
sql- query update in c# : My database, Student, has 4 columns which are ID, Name, FamilyName and Age.
I ask user to give specific ID and then one of the columns to update with query.
my update query CommandText is as follow:
public void Update (OleDbConnection connection, string Name, int ID)
{
... | 0debug |
static ssize_t imx_enet_receive(NetClientState *nc, const uint8_t *buf,
size_t len)
{
IMXFECState *s = IMX_FEC(qemu_get_nic_opaque(nc));
IMXENETBufDesc bd;
uint32_t flags = 0;
uint32_t addr;
uint32_t crc;
uint32_t buf_addr;
uint8_t *crc_ptr;
unsi... | 1threat |
int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
uint8_t **output, int out_plane_size,
int out_samples, uint8_t **input,
int in_plane_size, int in_samples)
{
A... | 1threat |
Value of optional type must be unwrapped to a value of type : <p>I'm trying to have a sceneView load a scene but I get the error <em>Value of optional type 'SCNScene?' must be unwrapped to a value of type 'SCNScene'</em> With options of <em>Coalesce using '??' to provide a default when the optional value contains 'nil'... | 0debug |
How to compare datetime.now with a certain date? : <p>Let's say i have a variable of datetime type; varA = '2016-06-10 12:28:36.697'. What is the best way and how i can compare it with <code>datetime.now</code> to make sure the date is the same regardless of the year?</p>
| 0debug |
Git does not ask me for gpg passphrase and fails my commit : <p>When I do <code>git commit -a -S -m "Commit Message"</code>, I get this error:</p>
<pre><code>You need a passphrase to unlock the secret key for
user: "Username (Gpg Key) <email-id>"
2048-bit RSA key, ID 2487BE7C, created 2016-10-03
error: gpg fail... | 0debug |
Convert Object List Into Map : <p>I have list of objects which have two properties {alpha,beta} as below :</p>
<pre><code>obj1 = {alpha1,beta1}
obj2 = {alpha2,beta2}
obj3 = {alpha3,beta3}
obj3 = {alpha1,beta2}
obj5 = {alpha3,beta1}
</code></pre>
<p>I want to create a map such as <code>Map<alphaKey,List<beta>... | 0debug |
how to pass values with php from function into an array : I've read the Q&A regarding this topic, but it unfortunatlly doesn't answer my question, because I'm a Beginner in PHP.
I use a function to display a polygon on my google Map. That works all fine. The coords are stored in the following variable:
$poly... | 0debug |
static void checkpoint(void) {
assert(((mapping_t*)array_get(&(vvv->mapping), 0))->end == 2);
check1(vvv);
check2(vvv);
assert(!vvv->current_mapping || vvv->current_fd || (vvv->current_mapping->mode & MODE_DIRECTORY));
#if 0
if (((direntry_t*)vvv->directory.pointer)[1].attributes != 0xf)
... | 1threat |
cursor.execute('SELECT * FROM users WHERE username = ' + user_input) | 1threat |
int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes,
Node *nodes, huff_cmp_t cmp, int hnode_first)
{
int i, j;
int cur_node;
int64_t sum = 0;
for(i = 0; i < nb_codes; i++){
nodes[i].sym = i;
nodes[i].n0 = -2;
sum += nodes[i].coun... | 1threat |
How to install Raspbian to SD card on Mac : <p>How can i install Raspbian OS to my SD card without installing any additional software or application on my Mac. Most of tutorials found on google will require to install SD Formatter or didn't provide detail steps.</p>
| 0debug |
write a regex to extract dates in different ways python regex : i would like to extract the date of birth from these text. there are four conditions:
keywords to match
Date of Birth
date of birth:
D.O.B:
DOB:
The strings like that:
text = "my name is adam m... | 0debug |
Passing PowerShell $_ to DOS : Is there to feed from PowerShell to DOS through a pipeline? For example can I do something like get-admember abc123 | net user /domain $_.samaccountname (I know there are other ways to get it to work, I just want to focus on the communication between PowerShell and DOS)?
Regards,
Geor... | 0debug |
How to override twitter bootstrap styles in angular2 with ng2-bootstrap : <p>I am using ng2-bootstrap from valor-software. When I start the website using ng serve, the page that is served up has the following style tags in the header:</p>
<pre><code><style type="text/css">/* You can add global styles to this fi... | 0debug |
How to convert from UTC time to local time zone of the browser : I got this time zone from backend code
2018-05-28T00:00:00Z
How to convert this to local time zone.
Thanks
| 0debug |
Check if WorkManager is scheduled already : <p><strong>How can I check if <code>WorkManager</code> is scheduled already.</strong></p>
<p>Here is my code that schedule <code>WorkManager</code>.</p>
<pre><code>public static void scheduleWork() {
PeriodicWorkRequest.Builder photoCheckBuilder =
new Period... | 0debug |
Add Class and Remove Class Specific div Area : I found this code on the web, it adds a div when I hover over it.
But how do I do that when the mouse exits the divi the "blue" div is removed?
http://jsfiddle.net/5d922roc
<div id="div1" class="div">
Div 1
</div>
<div id="div2" class="div">... | 0debug |
static int chr_can_read(void *opaque)
{
SCLPConsole *scon = opaque;
return SIZE_BUFFER_VT220 - scon->iov_data_len;
}
| 1threat |
Object.assign vs $.extend : <p>Given that I am using an immutable object, I want to <strong>clone</strong> or <strong>copy</strong> an object in order to make changes.</p>
<p>Now I have always been using javascript's native <code>Object.assign</code> but stumbled upon the JQuery <code>$.extend</code>.</p>
<p>I was wo... | 0debug |
static TileExcp gen_rr_opcode(DisasContext *dc, unsigned opext,
unsigned dest, unsigned srca)
{
TCGv tdest, tsrca;
const char *mnemonic;
TCGMemOp memop;
TileExcp ret = TILEGX_EXCP_NONE;
switch (opext) {
case OE_RR_Y0(NOP):
case OE_RR_Y1(NOP):
... | 1threat |
How do i connect second database if my first database connection faild using eval in perl : <p>I want connect to database using perl but if my database connection is faild then i want connect to my second database using eval function. </p>
| 0debug |
Difference between setTranslationX/Y and offsetLeftAndRight/offsetTopAndBottom? : <p>I'm working with a <code>CoordinatorLayout</code> in which child views positions are being animated with the <code>ViewCompat.offsetLeftAndRight</code> and <code>ViewCompact.offsetTopAndBottom</code> APIs.</p>
<p>When a child view is ... | 0debug |
Aml *aml_shiftleft(Aml *arg1, Aml *count)
{
Aml *var = aml_opcode(0x79 );
aml_append(var, arg1);
aml_append(var, count);
build_append_byte(var->buf, 0x00);
return var;
}
| 1threat |
int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
int64_t d;
FdMigrationState *s;
d = qdict_get_int(qdict, "value");
d = MAX(0, MIN(UINT32_MAX, d));
max_throttle = d;
s = migrate_to_fms(current_migration);
if (s && s->file) {
qemu_file_set_... | 1threat |
Kotlin checked exceptions alternative : <p>Since Kotlin doesn't support checked exceptions then how to make a programmer aware that a method may throw exception</p>
<p>Simple example:</p>
<pre><code>class Calculator (value: Int = 0) {
fun divide (dividend: BigDecimal, divider: BigDecimal) : BigDecimal {
... | 0debug |
Unexpected token '(' : <p>I am trying to make a shortcut to fire alerts in my admin system, but I am getting a weird "Unexpected token" error I can't understand.</p>
<p><strong>My code</strong></p>
<pre><code>$( document ).ready(function(
/**
* POST.JS
*
* Usage success:
*
* jso... | 0debug |
MSSQL Query optimize : I have a query with very poor performance.
In the production base there are tens of millions rows of data.
SELECT (SELECT MIN(CASE WHEN tab1.col1 = 0 THEN 0 ELSE 1 END)
FROM tab1
WHERE tab1.col2 = tab2.col2
AND (tab2.col1 <> 1 OR (SELECT COUNT(*) FROM tab1 A... | 0debug |
Jenkins in Docker container (run docker pipeline) : <p>I want to run Jenkins in Docker container. Everything is OK. I can run it like this: <code>docker run -d --name jenkins -t -i -p 49001:8080 jenkins</code> I can also add persistent storage. The problem came when I created a pipeline can has to execute <code>docker<... | 0debug |
Content type 'multipart/form-data;boundary=----...;charset=UTF-8' not supported : <p>I want to send an object to the controller that has several lists with files and several fields with plain text.</p>
<pre><code>public class ContributionNew<T extends MovieInfoDTO> {
private List<T> elementsToAdd;
... | 0debug |
static void ppc_cpu_do_nmi_on_cpu(CPUState *cs, run_on_cpu_data arg)
{
cpu_synchronize_state(cs);
ppc_cpu_do_system_reset(cs);
}
| 1threat |
Bootstrap overrides my custom CSS : Out of nowhere Bootstrap suddenly started overriding my custom CSS. The site has worked perfectly in about 1 month, then I updated the favicons, and everything started messing up.
Trying to solve the problem with updating to the newest Boostrap (version 4), and included everything... | 0debug |
delphi how to send text from indy TCPServer to client : i need a simple Fix in my chat app Made with **TCPServer** and **TCPClient** please with no additional code, just send and receive text
procedure TServerApp1.Button1Click(Sender: TObject);
var AContext : TIdContext;
begin
AContext.Connec... | 0debug |
void *s1d13745_init(qemu_irq gpio_int)
{
BlizzardState *s = (BlizzardState *) g_malloc0(sizeof(*s));
DisplaySurface *surface;
s->fb = g_malloc(0x180000);
s->con = graphic_console_init(blizzard_update_display,
blizzard_invalidate_display,
... | 1threat |
int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors)
{
Coroutine *co;
DiscardCo rwco = {
.bs = bs,
.sector_num = sector_num,
.nb_sectors = nb_sectors,
.ret = NOT_DONE,
};
if (qemu_in_coroutine()) {
bdrv_discard_co_entry(... | 1threat |
static int cpu_has_work(CPUState *env)
{
if (env->stop)
return 1;
if (env->stopped)
return 0;
if (!env->halted)
return 1;
if (qemu_cpu_has_work(env))
return 1;
return 0;
}
| 1threat |
I want to change price tier from basic to standard in Azure : I want to change price tier from basic to standard in Azure and app having in two different location | 0debug |
How to get last installed/updated Jenkins plugins? : <p>My Jenkins instance interface broken. I suspect recent plugin update as the cause. However I cannot remember which plugins get updated recently. I need to know so I can rollback plugin version to the previous one.</p>
<p>How to find this information?</p>
<p>Some... | 0debug |
static int ffm_read_data(AVFormatContext *s,
uint8_t *buf, int size, int first)
{
FFMContext *ffm = s->priv_data;
ByteIOContext *pb = s->pb;
int len, fill_size, size1, frame_offset;
size1 = size;
while (size > 0) {
redo:
len = ffm->packet_end - ffm->pa... | 1threat |
Why base class and dervied class constructor is getting called when creating object of child class : Code :
class A
{
public A()
{
}
}
class B : A
{
public B()
{
... | 0debug |
How to use React Router on top of Rails router (not using react-rails gem)? : <p>Now i am making React app on top off Ruby on Rails app (with out react-rails gem) by using <a href="https://github.com/browserify-rails/browserify-rails" rel="noreferrer">browserify-rails</a> to compile js files.</p>
<p>So i tried to us <... | 0debug |
Can anyone direct me to examples of Netlogo code for generating neutral landscape models? : <p>Can anyone also point me to netlogo simulation models that interface with GIS layers and/or automated in R?</p>
| 0debug |
document.getElementById('input').innerHTML = user_input; | 1threat |
How to include Roboto font in webpack build for Material UI? : <p>For a <em>progressive</em> web app based on <a href="http://www.material-ui.com/" rel="noreferrer">Material UI</a> (React) and built with <strong>Webpack</strong>, how do I properly include Roboto font(s) so that the app does not depend on Google servers... | 0debug |
QemuOpts *vnc_parse_func(const char *str)
{
QemuOptsList *olist = qemu_find_opts("vnc");
QemuOpts *opts = qemu_opts_parse(olist, str, 1);
const char *id = qemu_opts_id(opts);
if (!id) {
vnc_auto_assign_id(olist, opts);
}
return opts;
}
| 1threat |
static void sdhci_initfn(Object *obj)
{
SDHCIState *s = SDHCI(obj);
DriveInfo *di;
di = drive_get_next(IF_SD);
s->card = sd_init(di ? blk_bs(blk_by_legacy_dinfo(di)) : NULL, false);
if (s->card == NULL) {
exit(1);
}
s->eject_cb = qemu_allocate_irq(sdhci_insert_eject_cb, s,... | 1threat |
Python 3.4 shows print being invalid syntax : <pre><code>import string
from random import *
characters = string.ascii_letters+strings.punctuation+string.digits
password = "".join(choice(characters) for x in range(randint(8,16))
print(password)
</code></pre>
<p>print shows up as invalid syntax. I am trying to make a r... | 0debug |
Append "%.2X" data in char array or string in C (preferably) or C++ : I have been trying to fix it for last 3 days, and tried many options, but didn't get to work.
I have the following code in C++.
#include <winsock2.h>
#include <iphlpapi.h>
#include<stdio.h>
#include <stdlib.h>... | 0debug |
static void adb_mouse_event(void *opaque,
int dx1, int dy1, int dz1, int buttons_state)
{
MouseState *s = opaque;
s->dx += dx1;
s->dy += dy1;
s->dz += dz1;
s->buttons_state = buttons_state;
}
| 1threat |
2. Computer A executes the MIPS ISA and has a 2.5Ghz clock frequency. : 2. Computer A executes the MIPS ISA and has a 2.5Ghz clock frequency. Computer B executes the x86 and has a 3GHz clock frequency. On average, programs execute 1.5 times as many MIPS instructions than x86 instructions.
a) For Program P1, Computer... | 0debug |
Unable to get the desired output : I am unable to add two 2D array in c++
what could be the issue ? I am trying to add two multi-dimensional array from user input but the output is not right.
Below is my code
#include<stdio.h>
#include<conio.h>
void main()
{
int m,n,p,q,c,d,k;
int f... | 0debug |
Java - Android Studio '..' has private access in : I have a problem with my code. I can't resolve a problem with this :( I send screen[![enter image description here][1]][1]:
[1]: https://i.stack.imgur.com/QZVXx.png | 0debug |
static int qio_channel_socket_dgram_worker(QIOTask *task,
Error **errp,
gpointer opaque)
{
QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task));
struct QIOChannelSocketDGramWorkerData *data = opaque;
... | 1threat |
How to check if two vectors are equal? : <p>From <a href="https://octave.org/doc/v4.2.2/Comparison-Ops.html" rel="nofollow noreferrer">documentation</a>:</p>
<blockquote>
<p>All of Octave’s comparison operators return a value of 1 if the
comparison is true, or 0 if it is false. For matrix values, they all
work o... | 0debug |
static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int job, int self_id)
{
HEVCContext *s1 = avctxt->priv_data, *s;
HEVCLocalContext *lc;
int ctb_size = 1<< s1->ps.sps->log2_ctb_size;
int more_data = 1;
int *ctb_row_p = input_ctb_row;
int ctb_row = ctb_r... | 1threat |
Azure Pipeline Publish: task DotNetCoreCLI with specific folder or project : <p>I'm having a problem (unwanted behavior) when running an Azure Build Pipeline with the following project/folder structure.</p>
<p>My repository's root folder has two main folders: </p>
<ul>
<li>frontend (ASP.Net Core 2.x & Angular 7 p... | 0debug |
Warning message when leaving your website to another : <p>How do you set up a warning message for any external links letting the user know that they are leaving your site and going to another?</p>
<pre><code><div class="row">
<div class="col-lg-12">
<div class="form-group">
*For a list of... | 0debug |
static void dec_sru(DisasContext *dc)
{
if (dc->format == OP_FMT_RI) {
LOG_DIS("srui r%d, r%d, %d\n", dc->r1, dc->r0, dc->imm5);
} else {
LOG_DIS("sru r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1);
}
if (dc->format == OP_FMT_RI) {
if (!(dc->features & LM32_FEATURE_SHIFT) &&... | 1threat |
static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
{
const ASSSection *section = &ass_sections[ctx->current_section];
int *number = &ctx->field_number[ctx->current_section];
int *order = ctx->field_order[ctx->current_section];
int *tmp, i, len;
while (buf && *buf) {
... | 1threat |
static void dec_float(DisasContext *dc, uint32_t insn)
{
uint32_t op0;
uint32_t ra, rb, rd;
op0 = extract32(insn, 0, 8);
ra = extract32(insn, 16, 5);
rb = extract32(insn, 11, 5);
rd = extract32(insn, 21, 5);
switch (op0) {
case 0x00:
LOG_DIS("lf.add.s r%d, r%d, r%... | 1threat |
Why is the scope of object created using new limited? : <p>Object made using <code>new</code> operator does not seem to be available outside the scope! Isn't that the whole point of the <code>new</code> operator?</p>
<p><a href="https://ideone.com/DDvo9y" rel="nofollow noreferrer">https://ideone.com/DDvo9y</a> - Pleas... | 0debug |
Our Exercise code is outputting an unexpected -1 and we dont know why : So we are working on an exercise for Uni and we cant figure out why this code outputs the second value as -1
We believe that it is due to the 16-bit limit but don't understand exactly why and can't find any sources on this issue since we dont know... | 0debug |
Build Release Proguard failed task : I try generate signed APK but not work......................................................................................................................
My proguard-rules.pro
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
... | 0debug |
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
AVFilterContext *ctx = inlink->dst;
APadContext *apad = ctx->priv;
if (apad->whole_len)
apad->whole_len -= frame->nb_samples;
apad->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rat... | 1threat |
MATLAB programming to detect data is Bimodal or Trimodal distribution : <p>I have a time series data having values randomly between 0 & 1. I want to detect the automatically through MATLAB programming whether the distribution of data is Bimodal or Trimodal distribution.</p>
| 0debug |
Proper usage of Apache HttpClient and when to close it. : <p>I am using HttpClient within a servlet to make calls to a resource which I return as the servlets response after some manipulation. </p>
<p>My HttpClient uses PoolingHttpClientConnectionManager. </p>
<p>I create the client like so:</p>
<pre><code>private C... | 0debug |
What is the value assigned to num in the statement: double num = 5/2;? : What is the value assigned to num in the statement: double num = 5/2;?
Some websites say 2 some say 2.5. Help please. | 0debug |
What's the meaning of pool_connections in requests.adapters.HTTPAdapter? : <p>When initializing a requests' <code>Session</code>, two <a href="http://docs.python-requests.org/en/latest/api/#requests.adapters.HTTPAdapter" rel="noreferrer"><code>HTTPAdapter</code></a> will be created and <a href="https://github.com/kenne... | 0debug |
yuv2plane1_16_c_template(const int32_t *src, uint16_t *dest, int dstW,
int big_endian, int output_bits)
{
int i;
int shift = 19 - output_bits;
for (i = 0; i < dstW; i++) {
int val = src[i] + (1 << (shift - 1));
output_pixel(&dest[i], val, 0, uint);
}
}... | 1threat |
static uint64_t bmdma_read(void *opaque, target_phys_addr_t addr, unsigned size)
{
BMDMAState *bm = opaque;
uint32_t val;
if (size != 1) {
return ((uint64_t)1 << (size * 8)) - 1;
}
switch(addr & 3) {
case 0:
val = bm->cmd;
break;
case 2:
val = ... | 1threat |
Pseudocode: How to decode a PNG file from bits and bytes? : <p>I've been trying to figure this out by reverse engineering a .png file I created in GIMP. It's 4x4 pixels. My goal is to decode the raw pixels out of the file with the intent of reversing this to encode. </p>
<p>Here is a full hex dump of the file: </p>
... | 0debug |
Access index property of JSON in javascript using a variable : The api that i am messing with has a limit of 100 items per request. So I am trying to find out the length variable (which works) but why cant i use that variable to get the index. like below.
const ttl = results.data.length;
ttl = parseInt(l... | 0debug |
static int count_contiguous_clusters(uint64_t nb_clusters, int cluster_size,
uint64_t *l2_table, uint64_t start, uint64_t mask)
{
int i;
uint64_t offset = be64_to_cpu(l2_table[0]) & ~mask;
if (!offset)
return 0;
for (i = start; i < start + nb_clusters; i++)
if (offset... | 1threat |
static int bochs_read(BlockDriverState *bs, int64_t sector_num,
uint8_t *buf, int nb_sectors)
{
int ret;
while (nb_sectors > 0) {
int64_t block_offset = seek_to_sector(bs, sector_num);
if (block_offset >= 0) {
ret = bdrv_pread(bs->file, block_offset, buf,... | 1threat |
static int send_jpeg_rect(VncState *vs, int x, int y, int w, int h, int quality)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
struct jpeg_destination_mgr manager;
JSAMPROW row[1];
uint8_t *buf;
int dy;
if (ds_get_bytes_per_pixel(vs->ds) == 1)
return sen... | 1threat |
yuv2rgba64_full_2_c_template(SwsContext *c, const int32_t *buf[2],
const int32_t *ubuf[2], const int32_t *vbuf[2],
const int32_t *abuf[2], uint16_t *dest, int dstW,
int yalpha, int uvalpha, int y,
enum AVPixelFormat target, ... | 1threat |
static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
AVStream *st = c->fc->streams[c->fc->nb_streams-1];
MOVStreamContext *sc = (MOVStreamContext *)st->priv_data;
int entries, frames_per_sample;
uint32_t format;
print_atom("stsd", atom);
get_byte(pb);
ge... | 1threat |
Gulp error: gulp.hasTask is not a function : <p>I'm getting the following when I run "gulp". Looks like I have a mixed of CLI and Local version, not really sure how to solve this problem. </p>
<pre><code>cabox@box-codeanywhere:~/workspace/apps/web-ui$ gulp -v
[22:44:23] CLI version 2.0.1
[22:44:23] Local version 4.0.0... | 0debug |
pandas distinction between str and object types : <p>Numpy seems to make a distinction between <code>str</code> and <code>object</code> types. For instance I can do ::</p>
<pre><code>>>> import pandas as pd
>>> import numpy as np
>>> np.dtype(str)
dtype('S')
>>> np.dtype(object)
dt... | 0debug |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.