problem
stringlengths 26
131k
| labels
class label 2
classes |
|---|---|
Way map tracker for MapKit or Google Maps : <p>Somebody have experience with tracking way what i go with CoreLocation. Like this: </p>
<p><a href="https://i.stack.imgur.com/DSXUw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DSXUw.png" alt="enter image description here"></a></p>
<p>If somebody have sample please send me link. Thanks </p>
| 0debug
|
ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply)
{
uint8_t buf[NBD_REPLY_SIZE];
uint32_t magic;
ssize_t ret;
ret = read_sync(ioc, buf, sizeof(buf));
if (ret <= 0) {
return ret;
}
if (ret != sizeof(buf)) {
LOG("read failed");
return -EINVAL;
}
magic = ldl_be_p(buf);
reply->error = ldl_be_p(buf + 4);
reply->handle = ldq_be_p(buf + 8);
reply->error = nbd_errno_to_system_errno(reply->error);
if (reply->error == ESHUTDOWN) {
LOG("server shutting down");
return -EINVAL;
}
TRACE("Got reply: { magic = 0x%" PRIx32 ", .error = % " PRId32
", handle = %" PRIu64" }",
magic, reply->error, reply->handle);
if (magic != NBD_REPLY_MAGIC) {
LOG("invalid magic (got 0x%" PRIx32 ")", magic);
return -EINVAL;
}
return 0;
}
| 1threat
|
static void acpi_get_pm_info(AcpiPmInfo *pm)
{
Object *piix = piix4_pm_find();
Object *lpc = ich9_lpc_find();
Object *obj = NULL;
QObject *o;
pm->cpu_hp_io_base = 0;
pm->pcihp_io_base = 0;
pm->pcihp_io_len = 0;
if (piix) {
obj = piix;
pm->cpu_hp_io_base = PIIX4_CPU_HOTPLUG_IO_BASE;
pm->pcihp_io_base =
object_property_get_int(obj, ACPI_PCIHP_IO_BASE_PROP, NULL);
pm->pcihp_io_len =
object_property_get_int(obj, ACPI_PCIHP_IO_LEN_PROP, NULL);
}
if (lpc) {
obj = lpc;
pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE;
}
assert(obj);
pm->cpu_hp_io_len = ACPI_GPE_PROC_LEN;
pm->mem_hp_io_base = ACPI_MEMORY_HOTPLUG_BASE;
pm->mem_hp_io_len = ACPI_MEMORY_HOTPLUG_IO_LEN;
o = object_property_get_qobject(obj, ACPI_PM_PROP_S3_DISABLED, NULL);
if (o) {
pm->s3_disabled = qint_get_int(qobject_to_qint(o));
} else {
pm->s3_disabled = false;
}
qobject_decref(o);
o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_DISABLED, NULL);
if (o) {
pm->s4_disabled = qint_get_int(qobject_to_qint(o));
} else {
pm->s4_disabled = false;
}
qobject_decref(o);
o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_VAL, NULL);
if (o) {
pm->s4_val = qint_get_int(qobject_to_qint(o));
} else {
pm->s4_val = false;
}
qobject_decref(o);
pm->sci_int = object_property_get_int(obj, ACPI_PM_PROP_SCI_INT, NULL);
pm->acpi_enable_cmd = object_property_get_int(obj,
ACPI_PM_PROP_ACPI_ENABLE_CMD,
NULL);
pm->acpi_disable_cmd = object_property_get_int(obj,
ACPI_PM_PROP_ACPI_DISABLE_CMD,
NULL);
pm->io_base = object_property_get_int(obj, ACPI_PM_PROP_PM_IO_BASE,
NULL);
pm->gpe0_blk = object_property_get_int(obj, ACPI_PM_PROP_GPE0_BLK,
NULL);
pm->gpe0_blk_len = object_property_get_int(obj, ACPI_PM_PROP_GPE0_BLK_LEN,
NULL);
pm->pcihp_bridge_en =
object_property_get_bool(obj, "acpi-pci-hotplug-with-bridge-support",
NULL);
}
| 1threat
|
C sharp Namespace : I am pretty new to C# but I have worked a little bit for my classes. When I worked in C sharp for classes, our teacher used to tell us the namespaces that we needed for completing the assignment.
I wanted to know where do I find all the collection of the namespace for C sharp.
One of my friends directed me to this site
https://docs.microsoft.com/en-us/dotnet/api/index?view=netframework-4.0
but some of the namespaces did not work for example,
[enter image description here][1]
[1]: https://i.stack.imgur.com/RlmA5.jpg
I am working on a small project for ASP.Net MVC and wanted to try different namespaces
| 0debug
|
Java Regex for start with fixed digits 53 or 54 0r or 55 then number : I need regex to validate USA SIT id, so in US sit id start with 53 | 54|55 so, can i know the regex to evaluate code start with 53 | 54 | 55 followed by 7 digit number.
| 0debug
|
SwiftUI Repaint View Components on Device Rotation : <p>How to detect device rotation in SwiftUI and re-draw view components?</p>
<p>I have a @State variable initialized to the value of UIScreen.main.bounds.width when the first appears. But this value doesn't change when the device orientation changes. I need to redraw all components when the user changes the device orientation.</p>
| 0debug
|
Difference between container port,host port and service port in dcos json in portMappings : <p>I am confused with what all these port signify container port,host port and service port in portMappings, below is my json</p>
<pre><code>"portMappings": [
{
"containerPort": 9000,
"hostPort": 9000,
"labels": {
"VIP_0": "/app2n:9000"
},
"protocol": "tcp",
"servicePort": 10101
}
]
</code></pre>
| 0debug
|
static void readline_hist_add(ReadLineState *rs, const char *cmdline)
{
char *hist_entry, *new_entry;
int idx;
if (cmdline[0] == '\0')
return;
new_entry = NULL;
if (rs->hist_entry != -1) {
hist_entry = rs->history[rs->hist_entry];
idx = rs->hist_entry;
if (strcmp(hist_entry, cmdline) == 0) {
goto same_entry;
}
}
for (idx = 0; idx < READLINE_MAX_CMDS; idx++) {
hist_entry = rs->history[idx];
if (hist_entry == NULL)
break;
if (strcmp(hist_entry, cmdline) == 0) {
same_entry:
new_entry = hist_entry;
memmove(&rs->history[idx], &rs->history[idx + 1],
(READLINE_MAX_CMDS - idx + 1) * sizeof(char *));
rs->history[READLINE_MAX_CMDS - 1] = NULL;
for (; idx < READLINE_MAX_CMDS; idx++) {
if (rs->history[idx] == NULL)
break;
}
break;
}
}
if (idx == READLINE_MAX_CMDS) {
free(rs->history[0]);
memcpy(rs->history, &rs->history[1],
(READLINE_MAX_CMDS - 1) * sizeof(char *));
rs->history[READLINE_MAX_CMDS - 1] = NULL;
idx = READLINE_MAX_CMDS - 1;
}
if (new_entry == NULL)
new_entry = strdup(cmdline);
rs->history[idx] = new_entry;
rs->hist_entry = -1;
}
| 1threat
|
Retrieve data from mySQL table in a array : <p>I have a data table named <code>CallTriggers</code> with the attributs </p>
<pre><code>cloturer = 0 or 1
created_at
</code></pre>
<p>and I want to get all the data like this</p>
<pre><code>$array = [
['Month', 'Total Call', 'Close'],
['Jan', 57, 50],
['Feb', 67, 60],
['Mar', 40, 40],
['Apr', 33, 30],
['May', 70, 66]
];
</code></pre>
<p><code>Example:</code> ['Jan', 57, 50] here jan is the month, 57 is number of call in the month with value 1 and 50 is number of that the value is 0 in database.</p>
<p>How can I perform that kind of operation with <code>Laravel 5.6</code>? Thanks</p>
| 0debug
|
Concatenate same string x times : <p>There's a shortand way to concatenate a string x times instead of using something like this?</p>
<pre><code>z = 'val'
y = ''
for x in range(1,10):
y += z
</code></pre>
| 0debug
|
gdb doesn't work on macos High Sierra 10.13.3 : <p>I have installed gdb 8.1 with brew. </p>
<p>I have codesign gdb also and .gdbinit as below:</p>
<p><code>set startup-with-shell off</code>.</p>
<p>I have disabled SIP feature:</p>
<pre><code>$ csrutil status
System Integrity Protection status: disabled.
</code></pre>
<p>But gdb still doesn't work:</p>
<pre><code>#include <iostream>
using namespace std;
int main() {
cout << "hello world!" << endl;
return 0;
}
</code></pre>
<p>Compile command:</p>
<pre><code>g++ -g test.cpp
</code></pre>
<p>gdb output:</p>
<pre><code>GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin17.3.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...Reading symbols from /Users/mypc/Downloads/a.out.dSYM/Contents/Resources/DWARF/a.out...done.
done.
(gdb) run
Starting program: /Users/mypc/Downloads/a.out
[New Thread 0x2503 of process 802]
[New Thread 0x2303 of process 802]
During startup program terminated with signal ?, Unknown signal.
(gdb)
</code></pre>
<p>What correct steps to make gdb work on macos sierra?</p>
| 0debug
|
static void test_uuid_unparse_strdup(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(uuid_test_data); i++) {
char *out;
if (!uuid_test_data[i].check_unparse) {
continue;
}
out = qemu_uuid_unparse_strdup(&uuid_test_data[i].uuid);
g_assert_cmpstr(uuid_test_data[i].uuidstr, ==, out);
}
}
| 1threat
|
static void ehci_reset(void *opaque)
{
EHCIState *s = opaque;
int i;
USBDevice *devs[NB_PORTS];
trace_usb_ehci_reset();
for(i = 0; i < NB_PORTS; i++) {
devs[i] = s->ports[i].dev;
if (devs[i] && devs[i]->attached) {
usb_detach(&s->ports[i]);
}
}
memset(&s->mmio[OPREGBASE], 0x00, MMIO_SIZE - OPREGBASE);
s->usbcmd = NB_MAXINTRATE << USBCMD_ITC_SH;
s->usbsts = USBSTS_HALT;
s->usbsts_pending = 0;
s->usbsts_frindex = 0;
s->astate = EST_INACTIVE;
s->pstate = EST_INACTIVE;
for(i = 0; i < NB_PORTS; i++) {
if (s->companion_ports[i]) {
s->portsc[i] = PORTSC_POWNER | PORTSC_PPOWER;
} else {
s->portsc[i] = PORTSC_PPOWER;
}
if (devs[i] && devs[i]->attached) {
usb_attach(&s->ports[i]);
usb_device_reset(devs[i]);
}
}
ehci_queues_rip_all(s, 0);
ehci_queues_rip_all(s, 1);
qemu_del_timer(s->frame_timer);
qemu_bh_cancel(s->async_bh);
}
| 1threat
|
static int ssd0323_load(QEMUFile *f, void *opaque, int version_id)
{
SSISlave *ss = SSI_SLAVE(opaque);
ssd0323_state *s = (ssd0323_state *)opaque;
int i;
if (version_id != 1)
s->cmd_len = qemu_get_be32(f);
s->cmd = qemu_get_be32(f);
for (i = 0; i < 8; i++)
s->cmd_data[i] = qemu_get_be32(f);
s->row = qemu_get_be32(f);
s->row_start = qemu_get_be32(f);
s->row_end = qemu_get_be32(f);
s->col = qemu_get_be32(f);
s->col_start = qemu_get_be32(f);
s->col_end = qemu_get_be32(f);
s->redraw = qemu_get_be32(f);
s->remap = qemu_get_be32(f);
s->mode = qemu_get_be32(f);
qemu_get_buffer(f, s->framebuffer, sizeof(s->framebuffer));
ss->cs = qemu_get_be32(f);
return 0;
| 1threat
|
how does AngularJS display image? : n I'm using Http-server and AnglarJS. below is the folder structure.
[![enter image description here][1]][1]
[1]: http://i.stack.imgur.com/QtF4H.png
in <code>search.html</code> i want to display <code>abc.png</code>
I declared img tag and did what i usually do with HTML.
`<img src="../img/abc.png" >`
And I received an error <code>GET http://localhost:8000/img/abc.png 404 (Not Found) </code>
Then i declared img tag like this `<img src="/website/img/abc.png" />` And it work well. It surprised me.
So how does AngularJS display image?
| 0debug
|
Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause : <p>I am sure this used to work. </p>
<p><code>SELECT first_name, surname, id, time, MIN(timeinmilliseconds) FROM users WHERE team= '$key</code>'</p>
<p>I don't know where or why I would use a GroupBy Clause.</p>
| 0debug
|
How to grep a directory for a string, rewrite it to something else and save in bash? : <p>I have a bash script that does the following:</p>
<ul>
<li>Removes a CSS directory</li>
<li>Copies over new SASS from source</li>
<li>Runs gulp task to generate CSS again</li>
</ul>
<p>After I copy the SASS over, I would like to do the following before generating CSS again:</p>
<p>Find any occurrence of <code>('/assets</code> and change it to <code>('/themes/custom/mytheme/assets</code> in any of the files in the SASS directory.</p>
<p>How can I do that?</p>
| 0debug
|
Kotlin: How to insert a list of objects into Room? : <p>I am trying to define common <a href="https://en.wikipedia.org/wiki/Create,_read,_update_and_delete" rel="noreferrer">CRUD</a> methods in a base interface as shown here:</p>
<pre><code>interface BaseDao<in I> {
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun create(obj: I)
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun createAll(objects: List<I>)
@Delete
fun delete(obj: I)
}
</code></pre>
<p>The following <code>ProductDao</code> interface for <a href="https://developer.android.com/topic/libraries/architecture/room.html" rel="noreferrer">Room</a> inherits from the base interface:</p>
<pre><code>@Dao
interface ProductDao : BaseDao<Product> {
// Specific methods
}
</code></pre>
<p>When I compile the definition for <code>fun createAll(objects: List<I>)</code> produces the following error:</p>
<blockquote>
<p>Type of the parameter must be a class annotated with @Entity or a collection/array of it.</p>
</blockquote>
| 0debug
|
to get data from array in php : i have to echo the value from array . In an array we have two feilds . Need to fetch specific feilds.
My code is this
$fields = array(
'name' => $name,
'age' => $age,
);
Need to get the name only in result.I have done this . But showing Array.
foreach ($fields as $key => $value) {
echo $value;
}
| 0debug
|
How to remove first and last character of a string in C#? : <pre><code>String: "hello to the very tall person I am about to meet"
</code></pre>
<p>What I want it to become is this:</p>
<pre><code>String: hello to the very tall person I am about to meet
</code></pre>
<p>I can only find code to trim the start?</p>
| 0debug
|
static gboolean nbd_negotiate_continue(QIOChannel *ioc,
GIOCondition condition,
void *opaque)
{
qemu_coroutine_enter(opaque, NULL);
return TRUE;
}
| 1threat
|
def remove_list_range(list1, leftrange, rigthrange):
result = [i for i in list1 if (min(i)>=leftrange and max(i)<=rigthrange)]
return result
| 0debug
|
static void i8257_realize(DeviceState *dev, Error **errp)
{
ISADevice *isa = ISA_DEVICE(dev);
I8257State *d = I8257(dev);
int i;
memory_region_init_io(&d->channel_io, NULL, &channel_io_ops, d,
"dma-chan", 8 << d->dshift);
memory_region_add_subregion(isa_address_space_io(isa),
d->base, &d->channel_io);
isa_register_portio_list(isa, d->page_base, page_portio_list, d,
"dma-page");
if (d->pageh_base >= 0) {
isa_register_portio_list(isa, d->pageh_base, pageh_portio_list, d,
"dma-pageh");
}
memory_region_init_io(&d->cont_io, OBJECT(isa), &cont_io_ops, d,
"dma-cont", 8 << d->dshift);
memory_region_add_subregion(isa_address_space_io(isa),
d->base + (8 << d->dshift), &d->cont_io);
for (i = 0; i < ARRAY_SIZE(d->regs); ++i) {
d->regs[i].transfer_handler = i8257_phony_handler;
}
d->dma_bh = qemu_bh_new(i8257_dma_run, d);
}
| 1threat
|
How to get distinct rows in dataframe using pyspark? : <p>I understand this is just a very simple question and most likely have been answered somewhere, but as a beginner I still don't get it and am looking for your enlightenment, thank you in advance:</p>
<p>I have a interim dataframe:</p>
<pre><code>+----------------------------+---+
|host |day|
+----------------------------+---+
|in24.inetnebr.com |1 |
|uplherc.upl.com |1 |
|uplherc.upl.com |1 |
|uplherc.upl.com |1 |
|uplherc.upl.com |1 |
|ix-esc-ca2-07.ix.netcom.com |1 |
|uplherc.upl.com |1 |
</code></pre>
<p>What I need is to remove all the redundant items in host column, in another word, I need to get the final distinct result like:</p>
<pre><code>+----------------------------+---+
|host |day|
+----------------------------+---+
|in24.inetnebr.com |1 |
|uplherc.upl.com |1 |
|ix-esc-ca2-07.ix.netcom.com |1 |
|uplherc.upl.com |1 |
</code></pre>
| 0debug
|
void ff_vc1dsp_init_mmx(VC1DSPContext *dsp)
{
int mm_flags = av_get_cpu_flags();
#if HAVE_INLINE_ASM
if (mm_flags & AV_CPU_FLAG_MMX) {
dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_mmx;
dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_mmx;
dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_mmx;
dsp->put_vc1_mspel_pixels_tab[12] = put_vc1_mspel_mc03_mmx;
dsp->put_vc1_mspel_pixels_tab[ 1] = put_vc1_mspel_mc10_mmx;
dsp->put_vc1_mspel_pixels_tab[ 5] = put_vc1_mspel_mc11_mmx;
dsp->put_vc1_mspel_pixels_tab[ 9] = put_vc1_mspel_mc12_mmx;
dsp->put_vc1_mspel_pixels_tab[13] = put_vc1_mspel_mc13_mmx;
dsp->put_vc1_mspel_pixels_tab[ 2] = put_vc1_mspel_mc20_mmx;
dsp->put_vc1_mspel_pixels_tab[ 6] = put_vc1_mspel_mc21_mmx;
dsp->put_vc1_mspel_pixels_tab[10] = put_vc1_mspel_mc22_mmx;
dsp->put_vc1_mspel_pixels_tab[14] = put_vc1_mspel_mc23_mmx;
dsp->put_vc1_mspel_pixels_tab[ 3] = put_vc1_mspel_mc30_mmx;
dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_mmx;
dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_mmx;
dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_mmx;
}
if (mm_flags & AV_CPU_FLAG_MMX2){
dsp->avg_vc1_mspel_pixels_tab[ 0] = ff_avg_vc1_mspel_mc00_mmx2;
dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_mmx2;
dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_mmx2;
dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_mmx2;
dsp->avg_vc1_mspel_pixels_tab[ 1] = avg_vc1_mspel_mc10_mmx2;
dsp->avg_vc1_mspel_pixels_tab[ 5] = avg_vc1_mspel_mc11_mmx2;
dsp->avg_vc1_mspel_pixels_tab[ 9] = avg_vc1_mspel_mc12_mmx2;
dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_mmx2;
dsp->avg_vc1_mspel_pixels_tab[ 2] = avg_vc1_mspel_mc20_mmx2;
dsp->avg_vc1_mspel_pixels_tab[ 6] = avg_vc1_mspel_mc21_mmx2;
dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_mmx2;
dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_mmx2;
dsp->avg_vc1_mspel_pixels_tab[ 3] = avg_vc1_mspel_mc30_mmx2;
dsp->avg_vc1_mspel_pixels_tab[ 7] = avg_vc1_mspel_mc31_mmx2;
dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_mmx2;
dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_mmx2;
dsp->vc1_inv_trans_8x8_dc = vc1_inv_trans_8x8_dc_mmx2;
dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_mmx2;
dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_mmx2;
dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_mmx2;
}
#endif
#define ASSIGN_LF(EXT) \
dsp->vc1_v_loop_filter4 = ff_vc1_v_loop_filter4_ ## EXT; \
dsp->vc1_h_loop_filter4 = ff_vc1_h_loop_filter4_ ## EXT; \
dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_ ## EXT; \
dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_ ## EXT; \
dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_ ## EXT; \
dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_ ## EXT
#if HAVE_YASM
if (mm_flags & AV_CPU_FLAG_MMX) {
dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_mmx_nornd;
}
return;
if (mm_flags & AV_CPU_FLAG_MMX2) {
ASSIGN_LF(mmx2);
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_mmx2_nornd;
} else if (mm_flags & AV_CPU_FLAG_3DNOW) {
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_3dnow_nornd;
}
if (mm_flags & AV_CPU_FLAG_SSE2) {
dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_sse2;
dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse2;
dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_sse2;
dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse2;
}
if (mm_flags & AV_CPU_FLAG_SSSE3) {
ASSIGN_LF(ssse3);
dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_ssse3_nornd;
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_ssse3_nornd;
}
if (mm_flags & AV_CPU_FLAG_SSE4) {
dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse4;
dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse4;
}
#endif
}
| 1threat
|
Can't accept license agreement Android SDK Platform 24 : <p>I'm getting the following error when trying to install an android platform on a Cordova project. I've been following this guide: <a href="https://cordova.apache.org/docs/en/latest/guide/cli/">https://cordova.apache.org/docs/en/latest/guide/cli/</a></p>
<p>Error occurs when executing the following: $ cordova platform add android --save</p>
<blockquote>
<p>A problem occurred configuring root project 'android'.
You have not accepted the license agreements of the following SDK components: [Android SDK Platform 24].</p>
</blockquote>
<p>I've searched all over for ways to <strong>accept the license agreement of Android SDK Platform 24</strong>, but no real luck. </p>
<p>Thank you ahead of time.</p>
| 0debug
|
static struct scsi_task *iscsi_do_inquiry(struct iscsi_context *iscsi, int lun,
int evpd, int pc)
{
int full_size;
struct scsi_task *task = NULL;
task = iscsi_inquiry_sync(iscsi, lun, evpd, pc, 64);
if (task == NULL || task->status != SCSI_STATUS_GOOD) {
goto fail;
}
full_size = scsi_datain_getfullsize(task);
if (full_size > task->datain.size) {
scsi_free_scsi_task(task);
task = iscsi_inquiry_sync(iscsi, lun, evpd, pc, full_size);
if (task == NULL || task->status != SCSI_STATUS_GOOD) {
goto fail;
}
}
return task;
fail:
error_report("iSCSI: Inquiry command failed : %s",
iscsi_get_error(iscsi));
if (task) {
scsi_free_scsi_task(task);
return NULL;
}
return NULL;
}
| 1threat
|
Method Calls Not Working : <p>The method calls at the end of the main method are giving me an error saying "non-static method cannot be referenced from a static context" I'm not sure what I'm doing wrong in the method call. </p>
<pre><code> public static void main(String[] args)
{
ArrayList<Candidate> voteCount = new ArrayList<Candidate>();
//add objects to voteCount
printListResults(voteCount);
totalListVotes(voteCount);
printListTable(voteCount);
}
public void printListResults(ArrayList<Candidate> election)
{
//some code
}
public int totalListVotes(ArrayList<Candidate> election)
{
//some code
}
public void printListTable(ArrayList<Candidate> election)
{
//some code
}
</code></pre>
| 0debug
|
void av_noreturn exit_program(int ret)
{
int i, j;
for (i = 0; i < nb_filtergraphs; i++) {
avfilter_graph_free(&filtergraphs[i]->graph);
for (j = 0; j < filtergraphs[i]->nb_inputs; j++)
av_freep(&filtergraphs[i]->inputs[j]);
av_freep(&filtergraphs[i]->inputs);
for (j = 0; j < filtergraphs[i]->nb_outputs; j++)
av_freep(&filtergraphs[i]->outputs[j]);
av_freep(&filtergraphs[i]->outputs);
av_freep(&filtergraphs[i]);
}
av_freep(&filtergraphs);
for (i = 0; i < nb_output_files; i++) {
AVFormatContext *s = output_files[i]->ctx;
if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb)
avio_close(s->pb);
avformat_free_context(s);
av_dict_free(&output_files[i]->opts);
av_freep(&output_files[i]);
}
for (i = 0; i < nb_output_streams; i++) {
AVBitStreamFilterContext *bsfc = output_streams[i]->bitstream_filters;
while (bsfc) {
AVBitStreamFilterContext *next = bsfc->next;
av_bitstream_filter_close(bsfc);
bsfc = next;
}
output_streams[i]->bitstream_filters = NULL;
if (output_streams[i]->output_frame) {
AVFrame *frame = output_streams[i]->output_frame;
if (frame->extended_data != frame->data)
av_freep(&frame->extended_data);
av_freep(&frame);
}
av_freep(&output_streams[i]->filtered_frame);
av_freep(&output_streams[i]);
}
for (i = 0; i < nb_input_files; i++) {
avformat_close_input(&input_files[i]->ctx);
av_freep(&input_files[i]);
}
for (i = 0; i < nb_input_streams; i++) {
av_freep(&input_streams[i]->decoded_frame);
av_dict_free(&input_streams[i]->opts);
free_buffer_pool(input_streams[i]);
av_freep(&input_streams[i]->filters);
av_freep(&input_streams[i]);
}
if (vstats_file)
fclose(vstats_file);
av_free(vstats_filename);
av_freep(&input_streams);
av_freep(&input_files);
av_freep(&output_streams);
av_freep(&output_files);
uninit_opts();
av_freep(&audio_buf);
allocated_audio_buf_size = 0;
av_freep(&async_buf);
allocated_async_buf_size = 0;
avfilter_uninit();
avformat_network_deinit();
if (received_sigterm) {
av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
(int) received_sigterm);
exit (255);
}
exit(ret);
}
| 1threat
|
uint32_t kvmppc_get_dfp(void)
{
return kvmppc_read_int_cpu_dt("ibm,dfp");
}
| 1threat
|
ı wrote an c code about asal numbers but isn't working : printf("enter number:");
scanf("%d",&number);
for(i=2;i<sayi;i++){
if(sayi%i==0)
printf("your count isn't asal");
else
printf("your count is asal");
ı wrote this code.code run but if 10 entries are printing 10 times it isn t asal
| 0debug
|
static void RENAME(uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
int width, int height,
int lumStride, int chromStride, int srcStride)
{
int y;
const int chromWidth = FF_CEIL_RSHIFT(width, 1);
for (y=0; y<height; y++) {
RENAME(extract_even)(src+1, ydst, width);
if(y&1) {
RENAME(extract_even2avg)(src-srcStride, src, udst, vdst, chromWidth);
udst+= chromStride;
vdst+= chromStride;
}
src += srcStride;
ydst+= lumStride;
}
__asm__(
EMMS" \n\t"
SFENCE" \n\t"
::: "memory"
);
}
| 1threat
|
efficient merging on substrings (long lists of short terms) : I have a list of terms that need to be categorized according to a dictionary table. The term list and the dictionary are both hundreds of thousands of lines long.
The terms will typically not match a keyword in the dictionary exactly; the keywords will typically be a **substring** of the terms.
*I* ***could*** *loop through the dictionary keywords and then grep for the presence of the current keyword in all list terms.*
**What approaches would be more efficient than that? My preferred language is R, followed by Python.**
For the terms and dictionary below, I would want a result like this:
bean soup legume
cheese omelette dairy
cheese omelette eggs
turkey sandwich meat
turkey sandwich sandwich
Input terms:
bean soup
cheese omelette
turkey sandwich
Dictionary columns: keyword, category
bean legume
beef meat
carrot vegetable
cheese dairy
ice cream dairy
milk dairy
omelette eggs
sandwich bread
turkey meat
I have seen many good SO posts about effienct substring searching, but they seem more focused on searchign for short needles in long haystacks.
| 0debug
|
Regex to accept all type of files except one (NIFI) : <p>What will be the regular expression to accept all type of file formats except zip format?</p>
<pre><code>.*
</code></pre>
<p>accepts all types of files. But I don't want zip files. So what will be regex in this case?</p>
<p>Thanks.</p>
| 0debug
|
How is character encoding specified in a multipart/form-data HTTP POST request? : <p>The HTML 5 specification describes an <a href="http://www.w3.org/TR/2014/REC-html5-20141028/forms.html#multipart-form-data" rel="noreferrer">algorithm</a> for selecting the character encoding to be used in a multi-part form submission (e.g. UTF-8). However, it is not clear how the selected encoding should be relayed to the server so that the content can be properly decoded on the receiving end.</p>
<p>Often, character encodings are represented by appending a "charset" parameter to the value of the <code>Content-Type</code> request header. However, this parameter does not appear to be defined for the <code>multipart/form-data</code> MIME type:</p>
<p><a href="https://tools.ietf.org/html/rfc7578#section-8" rel="noreferrer">https://tools.ietf.org/html/rfc7578#section-8</a></p>
<p>Each part in a multipart form submission may provide its own <code>Content-Type</code> header; however, RFC 7578 notes that "in practice, many widely deployed implementations do not supply a charset parameter in each part, but rather, they rely on the notion of a 'default charset' for a multipart/form-data instance". </p>
<p>RFC 7578 goes on to suggest that a hidden "_charset_" form field can be used for this purpose. However, neither Safari (9.1) nor Chrome (51) appear to populate this field, nor do they provide any per-part encoding information.</p>
<p>I've looked at the request headers produced by both browsers and I don't see any obvious character encoding information. Does anyone know how the browsers are conveying this information to the server?</p>
| 0debug
|
Run Jenkins Pipeline with Code from Git : <p>I want to use following Pipeline script from git in jenkins</p>
<pre><code>#!groovy
pipeline {
agent any
stages {
stage('Build') {
steps {
echo 'Building..'
}
}
stage('Test') {
steps {
echo 'Testing..'
}
}
stage('Deploy') {
steps {
echo 'Deploying....'
}
}
}
}
</code></pre>
<p>I set the Repository URL right, under "Additional Behaviors" i added "Check out to a sub-directory" and wrote my sub directory there.</p>
<p>At "Script-Path" I wrote: mysubdirectory/Jenkinsfile</p>
<p>When I try to run it I get following ERROR:</p>
<pre><code>java.io.FileNotFoundException
at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:167)
at jenkins.plugins.git.GitSCMFile$3.invoke(GitSCMFile.java:159)
at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:162)
at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71)
at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:158)
at jenkins.plugins.git.GitSCMFile.content(GitSCMFile.java:159)
at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:101)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:59)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:262)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:415)
Finished: FAILURE
</code></pre>
<p>What am I doing wrong?</p>
<p>How can I run a Jenkins Script from git correctly?</p>
| 0debug
|
Xcode 9.4 : unexpected service error: The Xcode build system has crashed : <p>I’m getting strange error while building project in Xcode 9.4</p>
<pre><code>Build system information - unexpected service error: The Xcode build system has crashed. Please close and reopen your workspace.
</code></pre>
<p><a href="https://i.stack.imgur.com/DZibI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DZibI.png" alt="Screenshot attached"></a></p>
<p>I tried <em>Xcode quit and reopen but that didn’t worked.</em> Any solution?</p>
| 0debug
|
How to check the answer is correct or not? : I am creating an Online Examination System . I managed to show the questions and take the answer but i am having trouble to check the answer is correct or not. My approach is if the answer is correct then its add-mark by 1 and return the marks to the **result.jsp** page .I post the codes at below.
Please give me some solutions. Thank you..
**view.jsp ( In this page the answers are takes and passes the answer for Checking )**
<div class="col-sm-8" >
<form method="post" action="Resultprocess">
<% int i=1; %>
<c:forEach items="${examq}" var="examq" >
<label style="color:red">Q<c:out value="${examq.getQid()}"></c:out>:- <c:out value="${examq.getQuestion()}"></c:out></label><br>
<label style="color:white" >O1:<c:out value="${examq.getOption1()}"></c:out></label>
<input type="radio" name="option<%=i %>" value="<c:out value="${examq.getOption1()}"></c:out>" /><br>
<label style="color:white" >O2:<c:out value="${examq.getOption2()}"></c:out></label>
<input type="radio" name="option<%=i %>" value="<c:out value="${examq.getOption2()}"></c:out>"/><br>
<label style="color:white" >O3:<c:out value="${examq.getOption3()}"></c:out></label>
<input type="radio" name="option<%=i %>" value ="<c:out value ="${examq.getOption3()}"></c:out>"/><br>
<label style="color:white" >O4:<c:out value="${examq.getOption4() }"></c:out></label>
<input type="radio" name="option<%=i %>" value ="<c:out value="${examq.getOption4()}"></c:out>"/><br>
<hr>
<%i++; %>
</c:forEach>
<input type="submit" value="submit">
</form>
<a href="takeexam.jsp">GoBack</a>
</div>
**Resultprocess.java**
package exam.controller;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import exam.DAO.CTest;
import exam.DTO.ExamQ;
@WebServlet("/Resultprocess")
public class Resultprocess extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
for(int i=1;i<=6;i++) {
String ans =request.getParameter("option"+i);
HttpSession session = request.getSession();
session .setAttribute("answer", ans);
System.out.println(ans);
ExamQ answer1 = new ExamQ();
answer1.setAnswer(ans);
CTest cans =new CTest();
boolean ansercheck = cans.getans(answer1);
if(ansercheck == true) {
HttpSession session1 = request.getSession();
session1.setAttribute("answer1", answer1);
session1.setAttribute("answercheck",String.valueOf(ans));
RequestDispatcher rd =request.getRequestDispatcher("result.jsp");
rd.forward(request, response);
}
}
}
}
**CTest.java**
package exam.DAO;
import java.sql.*;
import java.util.ArrayList;
import exam.DTO.ExamQ;
import exam.utilities.ConnectionFac;
public class CTest {
Connection cn = null;
PreparedStatement ps = null;
Statement st = null;
ResultSet rs = null;
ConnectionFac con = new ConnectionFac();
String selectctest ="select * from ctest";
public ArrayList<ExamQ> getdata() {
ArrayList<ExamQ> arr =new ArrayList<ExamQ>();
try {
rs=con.getResultSet(selectctest);
while(rs.next()) {
ExamQ examques =new ExamQ();
examques.setQid(rs.getInt(1));
examques.setQuestion(rs.getString(2));
examques.setOption1(rs.getString(3));
examques.setOption2(rs.getString(4));
examques.setOption3(rs.getString(5));
examques.setOption4(rs.getString(6));
examques.setAnswer(rs.getString(7));
arr.add(examques);
}
} catch (SQLException e) {
e.printStackTrace();
}
return arr;
}
public boolean getans( ExamQ answer) {
try {
rs = con.getResultSet(selectctest);
while(rs.next()) {
String quesDB =rs.getString(2);
String answerDB = rs.getString(7);
ExamQ examdb = new ExamQ();
examdb.setQid(rs.getInt(1));
examdb.setQuestion(quesDB);
examdb.setAnswer(answerDB);
if(answer.equals(examdb)) {
return true;
}
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
}
**ExamQ.java**
package exam.DTO;
public class ExamQ {
int qid;
String question;
String option1;
String option2;
String option3;
String option4;
String answer;
public int getQid() {
return qid;
}
public void setQid(int qid) {
this.qid = qid;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public String getOption1() {
return option1;
}
public void setOption1(String option1) {
this.option1 = option1;
}
public String getOption2() {
return option2;
}
public void setOption2(String option2) {
this.option2 = option2;
}
public String getOption3() {
return option3;
}
public void setOption3(String option3) {
this.option3 = option3;
}
public String getOption4() {
return option4;
}
public void setOption4(String option4) {
this.option4 = option4;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof ExamQ))
return false;
ExamQ other = (ExamQ) obj;
if (answer == null) {
if (other.answer != null)
return false;
} else if (!answer.equals(other.answer))
return false;
if (option1 == null) {
if (other.option1 != null)
return false;
} else if (!option1.equals(other.option1))
return false;
if (option2 == null) {
if (other.option2 != null)
return false;
} else if (!option2.equals(other.option2))
return false;
if (option3 == null) {
if (other.option3 != null)
return false;
} else if (!option3.equals(other.option3))
return false;
if (option4 == null) {
if (other.option4 != null)
return false;
} else if (!option4.equals(other.option4))
return false;
if (qid != other.qid)
return false;
if (question == null) {
if (other.question != null)
return false;
} else if (!question.equals(other.question))
return false;
return true;
}
}
**ConnectionFac.java**
package exam.utilities;
import java.sql.*;
public class ConnectionFac {
Connection cn = null;
Statement st = null;
ResultSet rs = null;
public Connection getConn() {
try {
Class.forName("com.mysql.jdbc.Driver");// Register and load driver
cn = DriverManager.getConnection("jdbc:mysql://localhost:3306/exam", "root", "root");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException se) {
se.printStackTrace();
}
return cn;
}
public Statement getStatement() {
try {
cn = this.getConn();
st = cn.createStatement();
} catch (SQLException se) {
se.printStackTrace();
}
return st;
}
public ResultSet getResultSet(String sql) {
try {
st = this.getStatement();
rs = st.executeQuery(sql);
} catch (SQLException e) {
e.printStackTrace();
}
return rs;
}
}
| 0debug
|
Ruby: What is the fastest way to xor 2 integers in Ruby? : Given an array a of n elements, I should replace a[i] with a[i] XOR a[i+1] for m number of times. The value of m may reach up to 10^18. What is the fastest and best approach?
| 0debug
|
static USBDevice *usb_msd_init(const char *filename)
{
static int nr=0;
char id[8];
QemuOpts *opts;
DriveInfo *dinfo;
USBDevice *dev;
int fatal_error;
const char *p1;
char fmt[32];
snprintf(id, sizeof(id), "usb%d", nr++);
opts = qemu_opts_create(&qemu_drive_opts, id, 0);
p1 = strchr(filename, ':');
if (p1++) {
const char *p2;
if (strstart(filename, "format=", &p2)) {
int len = MIN(p1 - p2, sizeof(fmt));
pstrcpy(fmt, len, p2);
qemu_opt_set(opts, "format", fmt);
} else if (*filename != ':') {
printf("unrecognized USB mass-storage option %s\n", filename);
return NULL;
}
filename = p1;
}
if (!*filename) {
printf("block device specification needed\n");
return NULL;
}
qemu_opt_set(opts, "file", filename);
qemu_opt_set(opts, "if", "none");
dinfo = drive_init(opts, 0, &fatal_error);
if (!dinfo) {
qemu_opts_del(opts);
return NULL;
}
dev = usb_create(NULL , "usb-storage");
if (!dev) {
return NULL;
}
qdev_prop_set_drive(&dev->qdev, "drive", dinfo);
if (qdev_init(&dev->qdev) < 0)
return NULL;
return dev;
}
| 1threat
|
tslint Error - Shadowed name: 'err' : <p>tslint is currently throwing the following error</p>
<pre><code>Shadowed name: 'err'
</code></pre>
<p>Here is the code</p>
<pre><code>fs.readdir(fileUrl, (err, files) => {
fs.readFile(path.join(fileUrl, files[0]), function (err, data) {
if (!err) {
res.send(data);
}
});
});
</code></pre>
<p>Anybody have a clue on what the best way would be to solve this and what the error even means?</p>
| 0debug
|
static uint64_t omap_sti_fifo_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
OMAP_BAD_REG(addr);
return 0;
}
| 1threat
|
How to find just Current time and just day in mvc : <p>i want to find just time not date from my computer current time and
also find just "day" e.g., monday , tuesday etc from computer current day.
pls tell me as soon as possibe. </p>
| 0debug
|
find out missing month in the list of Dates arranged sequencially in SQL Server : I have a colomn of DateTime type containing a each months 1st date. I want to find out the months which are not in the colomn any suggestion..??
| 0debug
|
String builder underline text : <p>How can I underline text in a string builder ?</p>
<pre><code>strBody.Append("be a minimum of 8 characters")
</code></pre>
<p>I can't use HTML tags </p>
<pre><code>be a minimum of <u>8 characters</u>
</code></pre>
| 0debug
|
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
{
AVFilterContext *ctx = inlink->dst;
ASNSContext *asns = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
int ret;
int nb_samples = insamples->nb_samples;
if (av_audio_fifo_space(asns->fifo) < nb_samples) {
av_log(ctx, AV_LOG_DEBUG, "No space for %d samples, stretching audio fifo\n", nb_samples);
ret = av_audio_fifo_realloc(asns->fifo, av_audio_fifo_size(asns->fifo) + nb_samples);
if (ret < 0) {
av_log(ctx, AV_LOG_ERROR,
"Stretching audio fifo failed, discarded %d samples\n", nb_samples);
return -1;
}
}
av_audio_fifo_write(asns->fifo, (void **)insamples->extended_data, nb_samples);
if (asns->next_out_pts == AV_NOPTS_VALUE)
asns->next_out_pts = insamples->pts;
av_frame_free(&insamples);
while (av_audio_fifo_size(asns->fifo) >= asns->nb_out_samples)
push_samples(outlink);
return 0;
}
| 1threat
|
Change C# language version to 7.2 in vs-code on Linux : <p>I read that <code>.NET Core 2.0</code> SDK support <code>C# 7.2</code> by default but the features of <code>C# 7.1</code> and <code>7.2</code> are disabled and we have to enable them.
I install both SDK and C# extension for vs-code, but when I compile my code I got this error: </p>
<blockquote>
<p>Program.cs(118,2): error CS1513: } expected [/home/smn/Desktop/myTest.csproj]</p>
<p>The build failed. Please fix the build errors and run again. </p>
</blockquote>
<p>I also add these line to my <code>.csproj</code> file:</p>
<blockquote>
<p><code><PropertyGroup">
<LangVersion>7.2</LangVersion>
</PropertyGroup></code></p>
</blockquote>
<p>try this too:</p>
<pre><code>`<PropertyGroup">
<LangVersion>latest</LangVersion>
</PropertyGroup>`
</code></pre>
<p>and also try this too:</p>
<pre><code>`<PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup
Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<LangVersion>latest</LangVersion>
</PropertyGroup>`
</code></pre>
<p>What should I do?!</p>
| 0debug
|
How do i deploy with capastrano : When im trying to run bundle exec cap production deploy and loggin to my droplet, this error comes up. I folled this tutrorial: https://gorails.com/deploy/ubuntu/18.04 and have done everything in it, but it dosent work.
00:00 git:wrapper
01 mkdir -p /tmp
✔ 01 deploy@167.99.85.170 0.147s
Uploading /tmp/git-ssh-membercopy-production-root.sh 100.0%
02 chmod 700 /tmp/git-ssh-membercopy-production-root.sh
✔ 02 deploy@167.99.85.170 0.141s
00:00 git:check
01 git ls-remote git@github.com:Dekto/membercopy.git HEAD
01 git@github.com: Permission denied (publickey).
01 fatal: Could not read from remote repository.
01
01 Please make sure you have the correct access rights
01 and the repository exists.
#<Thread:0x00007fffedb4ef20@/root/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sshkit-1.18.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
1: from /root/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sshkit-1.18.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/root/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/sshkit-1.18.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as deploy@167.99.85.170: git exit status: 128 (SSHKit::Runner::ExecuteError)
git stdout: Nothing written
git stderr: git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@167.99.85.170: git exit status: 128
git stdout: Nothing written
git stderr: git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Caused by:
SSHKit::Command::Failed: git exit status: 128
git stdout: Nothing written
git stderr: git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Tasks: TOP => deploy:check => git:check
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deploy@167.99.85.170: git exit status: 128
git stdout: Nothing written
git stderr: git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
DEBUG [fb6c095d] Command: [ -d $HOME/.rbenv/versions/2.5.3 ]
DEBUG [d9437923] Finished in 12.154 seconds with exit status 0 (successful).
DEBUG [ee4139eb] Running /usr/bin/env which passenger as deploy@167.99.85.170
DEBUG [ee4139eb] Command: /usr/bin/env which passenger
DEBUG [eaba4dfc] Finished in 0.147 seconds with exit status 1 (failed).
INFO [9eeb8f8c] Running /usr/bin/env mkdir -p /tmp as deploy@167.99.85.170
DEBUG [9eeb8f8c] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.3" ; /usr/bin/env mkdir -p /tmp )
INFO [892841a3] Finished in 0.147 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/git-ssh-membercopy-production-root.sh 0.0%
INFO Uploading /tmp/git-ssh-membercopy-production-root.sh 100.0%
INFO [916f98f1] Running /usr/bin/env chmod 700 /tmp/git-ssh-membercopy-production-root.sh as deploy@167.99.85.170
DEBUG [916f98f1] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.3" ; /usr/bin/env chmod 700 /tmp/git-ssh-membercopy-production-root.sh )
INFO [fc59e4ba] Finished in 0.141 seconds with exit status 0 (successful).
INFO [6d70b2b1] Running /usr/bin/env git ls-remote git@github.com:Dekto/membercopy.git HEAD as deploy@167.99.85.170
DEBUG [6d70b2b1] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.3" GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-membercopy-production-root.sh" ; /usr/bin/env git ls-remote git@github.com:Dekto/membercopy.git HEAD )
DEBUG [a1aed7ca] git@github.com: Permission denied (publickey).
DEBUG [a1aed7ca] fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
| 0debug
|
Unattended install of krb5-user on Ubuntu 16.04 : <p>So, when running:</p>
<pre><code>sudo apt-get install krb5-user
</code></pre>
<p>You are asked to enter the AD/LDAP domain. The problem is that I want this to be able to be run as a startup script for my machines. Is there any way to either pass the domain in as a parameter or disable the interaction and set up krb5-user after?</p>
<p>Thanks</p>
| 0debug
|
static void id3v2_parse(AVIOContext *pb, AVDictionary **metadata,
AVFormatContext *s, int len, uint8_t version,
uint8_t flags, ID3v2ExtraMeta **extra_meta)
{
int isv34, unsync;
unsigned tlen;
char tag[5];
int64_t next, end = avio_tell(pb) + len;
int taghdrlen;
const char *reason = NULL;
AVIOContext pb_local;
AVIOContext *pbx;
unsigned char *buffer = NULL;
int buffer_size = 0;
const ID3v2EMFunc *extra_func = NULL;
unsigned char *uncompressed_buffer = NULL;
av_unused int uncompressed_buffer_size = 0;
av_log(s, AV_LOG_DEBUG, "id3v2 ver:%d flags:%02X len:%d\n", version, flags, len);
switch (version) {
case 2:
if (flags & 0x40) {
reason = "compression";
goto error;
}
isv34 = 0;
taghdrlen = 6;
break;
case 3:
case 4:
isv34 = 1;
taghdrlen = 10;
break;
default:
reason = "version";
goto error;
}
unsync = flags & 0x80;
if (isv34 && flags & 0x40) {
int extlen = get_size(pb, 4);
if (version == 4)
extlen -= 4;
if (extlen < 0) {
reason = "invalid extended header length";
goto error;
}
avio_skip(pb, extlen);
len -= extlen + 4;
if (len < 0) {
reason = "extended header too long.";
goto error;
}
}
while (len >= taghdrlen) {
unsigned int tflags = 0;
int tunsync = 0;
int tcomp = 0;
int tencr = 0;
unsigned long av_unused dlen;
if (isv34) {
if (avio_read(pb, tag, 4) < 4)
break;
tag[4] = 0;
if (version == 3) {
tlen = avio_rb32(pb);
} else
tlen = get_size(pb, 4);
tflags = avio_rb16(pb);
tunsync = tflags & ID3v2_FLAG_UNSYNCH;
} else {
if (avio_read(pb, tag, 3) < 3)
break;
tag[3] = 0;
tlen = avio_rb24(pb);
}
if (tlen > (1<<28))
break;
len -= taghdrlen + tlen;
if (len < 0)
break;
next = avio_tell(pb) + tlen;
if (!tlen) {
if (tag[0])
av_log(s, AV_LOG_DEBUG, "Invalid empty frame %s, skipping.\n",
tag);
continue;
}
if (tflags & ID3v2_FLAG_DATALEN) {
if (tlen < 4)
break;
dlen = avio_rb32(pb);
tlen -= 4;
} else
dlen = tlen;
tcomp = tflags & ID3v2_FLAG_COMPRESSION;
tencr = tflags & ID3v2_FLAG_ENCRYPTION;
if (tencr || (!CONFIG_ZLIB && tcomp)) {
const char *type;
if (!tcomp)
type = "encrypted";
else if (!tencr)
type = "compressed";
else
type = "encrypted and compressed";
av_log(s, AV_LOG_WARNING, "Skipping %s ID3v2 frame %s.\n", type, tag);
avio_skip(pb, tlen);
} else if (tag[0] == 'T' ||
(extra_meta &&
(extra_func = get_extra_meta_func(tag, isv34)))) {
pbx = pb;
if (unsync || tunsync || tcomp) {
av_fast_malloc(&buffer, &buffer_size, tlen);
if (!buffer) {
av_log(s, AV_LOG_ERROR, "Failed to alloc %d bytes\n", tlen);
goto seek;
}
}
if (unsync || tunsync) {
int64_t end = avio_tell(pb) + tlen;
uint8_t *b;
b = buffer;
while (avio_tell(pb) < end && b - buffer < tlen && !pb->eof_reached) {
*b++ = avio_r8(pb);
if (*(b - 1) == 0xff && avio_tell(pb) < end - 1 &&
b - buffer < tlen &&
!pb->eof_reached ) {
uint8_t val = avio_r8(pb);
*b++ = val ? val : avio_r8(pb);
}
}
ffio_init_context(&pb_local, buffer, b - buffer, 0, NULL, NULL, NULL,
NULL);
tlen = b - buffer;
pbx = &pb_local;
}
#if CONFIG_ZLIB
if (tcomp) {
int err;
av_log(s, AV_LOG_DEBUG, "Compresssed frame %s tlen=%d dlen=%ld\n", tag, tlen, dlen);
av_fast_malloc(&uncompressed_buffer, &uncompressed_buffer_size, dlen);
if (!uncompressed_buffer) {
av_log(s, AV_LOG_ERROR, "Failed to alloc %ld bytes\n", dlen);
goto seek;
}
if (!(unsync || tunsync)) {
err = avio_read(pb, buffer, tlen);
if (err < 0) {
av_log(s, AV_LOG_ERROR, "Failed to read compressed tag\n");
goto seek;
}
tlen = err;
}
err = uncompress(uncompressed_buffer, &dlen, buffer, tlen);
if (err != Z_OK) {
av_log(s, AV_LOG_ERROR, "Failed to uncompress tag: %d\n", err);
goto seek;
}
ffio_init_context(&pb_local, uncompressed_buffer, dlen, 0, NULL, NULL, NULL, NULL);
tlen = dlen;
pbx = &pb_local;
}
#endif
if (tag[0] == 'T')
read_ttag(s, pbx, tlen, metadata, tag);
else
extra_func->read(s, pbx, tlen, tag, extra_meta, isv34);
} else if (!tag[0]) {
if (tag[1])
av_log(s, AV_LOG_WARNING, "invalid frame id, assuming padding\n");
avio_skip(pb, tlen);
break;
}
seek:
avio_seek(pb, next, SEEK_SET);
}
if (version == 4 && flags & 0x10)
end += 10;
error:
if (reason)
av_log(s, AV_LOG_INFO, "ID3v2.%d tag skipped, cannot handle %s\n",
version, reason);
avio_seek(pb, end, SEEK_SET);
av_free(buffer);
av_free(uncompressed_buffer);
return;
}
| 1threat
|
When exactly is the operator keyword required in Kotlin? : <p>In the <a href="https://try.kotlinlang.org/#/Kotlin%20Koans/Conventions/Comparison/Task.kt" rel="noreferrer">14th Kotlin Koan</a> on operator overloading, I was suprised when after solving I viewed the answer and saw that the <code>operator</code> modifier was <strong>not</strong> required on the <code>compareTo</code> method:</p>
<pre><code>data class MyDate(val year: Int, val month: Int, val dayOfMonth: Int) : Comparable<MyDate> {
override fun compareTo(other: MyDate) = when {
year != other.year -> year - other.year
month != other.month -> month - other.month
else -> dayOfMonth - other.dayOfMonth
}
}
</code></pre>
<p>The <a href="http://kotlinlang.org/docs/reference/operator-overloading.html" rel="noreferrer">operator overloading docs</a> linked to from the exercise explicitly says: </p>
<blockquote>
<p>Functions that overload operators need to be marked with the operator
modifier.</p>
</blockquote>
<p>So what's going on here? Why does this code compile? When exactly is <code>operator</code> required?</p>
| 0debug
|
static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
GetBitContext *gb)
{
const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac;
const int aot = m4ac->object_type;
const int sampling_index = m4ac->sampling_index;
if (aot != AOT_ER_AAC_ELD) {
if (get_bits1(gb)) {
av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n");
return AVERROR_INVALIDDATA;
}
ics->window_sequence[1] = ics->window_sequence[0];
ics->window_sequence[0] = get_bits(gb, 2);
if (aot == AOT_ER_AAC_LD &&
ics->window_sequence[0] != ONLY_LONG_SEQUENCE) {
av_log(ac->avctx, AV_LOG_ERROR,
"AAC LD is only defined for ONLY_LONG_SEQUENCE but "
"window sequence %d found.\n", ics->window_sequence[0]);
ics->window_sequence[0] = ONLY_LONG_SEQUENCE;
return AVERROR_INVALIDDATA;
}
ics->use_kb_window[1] = ics->use_kb_window[0];
ics->use_kb_window[0] = get_bits1(gb);
}
ics->num_window_groups = 1;
ics->group_len[0] = 1;
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
int i;
ics->max_sfb = get_bits(gb, 4);
for (i = 0; i < 7; i++) {
if (get_bits1(gb)) {
ics->group_len[ics->num_window_groups - 1]++;
} else {
ics->num_window_groups++;
ics->group_len[ics->num_window_groups - 1] = 1;
}
}
ics->num_windows = 8;
ics->swb_offset = ff_swb_offset_128[sampling_index];
ics->num_swb = ff_aac_num_swb_128[sampling_index];
ics->tns_max_bands = ff_tns_max_bands_128[sampling_index];
ics->predictor_present = 0;
} else {
ics->max_sfb = get_bits(gb, 6);
ics->num_windows = 1;
if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD) {
if (m4ac->frame_length_short) {
ics->swb_offset = ff_swb_offset_480[sampling_index];
ics->num_swb = ff_aac_num_swb_480[sampling_index];
ics->tns_max_bands = ff_tns_max_bands_480[sampling_index];
} else {
ics->swb_offset = ff_swb_offset_512[sampling_index];
ics->num_swb = ff_aac_num_swb_512[sampling_index];
ics->tns_max_bands = ff_tns_max_bands_512[sampling_index];
}
if (!ics->num_swb || !ics->swb_offset)
return AVERROR_BUG;
} else {
ics->swb_offset = ff_swb_offset_1024[sampling_index];
ics->num_swb = ff_aac_num_swb_1024[sampling_index];
ics->tns_max_bands = ff_tns_max_bands_1024[sampling_index];
}
if (aot != AOT_ER_AAC_ELD) {
ics->predictor_present = get_bits1(gb);
ics->predictor_reset_group = 0;
}
if (ics->predictor_present) {
if (aot == AOT_AAC_MAIN) {
if (decode_prediction(ac, ics, gb)) {
return AVERROR_INVALIDDATA;
}
} else if (aot == AOT_AAC_LC ||
aot == AOT_ER_AAC_LC) {
av_log(ac->avctx, AV_LOG_ERROR,
"Prediction is not allowed in AAC-LC.\n");
return AVERROR_INVALIDDATA;
} else {
if (aot == AOT_ER_AAC_LD) {
av_log(ac->avctx, AV_LOG_ERROR,
"LTP in ER AAC LD not yet implemented.\n");
return AVERROR_PATCHWELCOME;
}
if ((ics->ltp.present = get_bits(gb, 1)))
decode_ltp(&ics->ltp, gb, ics->max_sfb);
}
}
}
if (ics->max_sfb > ics->num_swb) {
av_log(ac->avctx, AV_LOG_ERROR,
"Number of scalefactor bands in group (%d) "
"exceeds limit (%d).\n",
ics->max_sfb, ics->num_swb);
return AVERROR_INVALIDDATA;
}
return 0;
}
| 1threat
|
static int v9fs_synth_open2(FsContext *fs_ctx, V9fsPath *dir_path,
const char *name, int flags,
FsCred *credp, V9fsFidOpenState *fs)
{
errno = ENOSYS;
return -1;
}
| 1threat
|
static int coroutine_fn copy_sectors(BlockDriverState *bs,
uint64_t start_sect,
uint64_t cluster_offset,
int n_start, int n_end)
{
BDRVQcowState *s = bs->opaque;
QEMUIOVector qiov;
struct iovec iov;
int n, ret;
if (start_sect + n_end > bs->total_sectors) {
n_end = bs->total_sectors - start_sect;
}
n = n_end - n_start;
if (n <= 0) {
return 0;
}
iov.iov_len = n * BDRV_SECTOR_SIZE;
iov.iov_base = qemu_blockalign(bs, iov.iov_len);
qemu_iovec_init_external(&qiov, &iov, 1);
BLKDBG_EVENT(bs->file, BLKDBG_COW_READ);
if (!bs->drv) {
return -ENOMEDIUM;
}
ret = bs->drv->bdrv_co_readv(bs, start_sect + n_start, n, &qiov);
if (ret < 0) {
goto out;
}
if (s->crypt_method) {
qcow2_encrypt_sectors(s, start_sect + n_start,
iov.iov_base, iov.iov_base, n, 1,
&s->aes_encrypt_key);
}
ret = qcow2_pre_write_overlap_check(bs, 0,
cluster_offset + n_start * BDRV_SECTOR_SIZE, n * BDRV_SECTOR_SIZE);
if (ret < 0) {
goto out;
}
BLKDBG_EVENT(bs->file, BLKDBG_COW_WRITE);
ret = bdrv_co_writev(bs->file, (cluster_offset >> 9) + n_start, n, &qiov);
if (ret < 0) {
goto out;
}
ret = 0;
out:
qemu_vfree(iov.iov_base);
return ret;
}
| 1threat
|
logical operators in if statements c++ : <p>The current code at the bottom works but I can't combine the if statements without shifting the ascii values to a position that I don't want them to be. The encryption is supposed to be only alphabet values. Capital and lowercase z's are supposed to loop around to an A. I have a teacher but she doesn't know so I would be grateful for any help. Thanks <3</p>
<p>This doesn't work...</p>
<pre><code>if (sentence[i] == 'z' || 'Z')
{
sentence[i] = sentence[i] - 26;
}
</code></pre>
<p>And this doesn't work </p>
<pre><code>if (sentence[i] == 'z' || sentence[i] == 'Z')
{
sentence[i] = sentence[i] - 26;
}
</code></pre>
<p>This works.</p>
<pre><code>if (sentence[i] == 'z')
{
sentence[i] = sentence[i] - 26;
}
if (sentence[i] == 'Z')
{
sentence[i] = sentence[i] - 26;
}
</code></pre>
<p>Full code. </p>
<pre><code>#include <iostream>
#include <string>
using namespace std;
class EncryptionClass
{
string sentence;
public:
//constructors
EncryptionClass(string sentence)
{setString(sentence);}
EncryptionClass()
{sentence = "";}
//get and set
string getString()
{return sentence;}
void setString(string sentence)
{this-> sentence = sentence;}
//encrypt
void encryptString()
{
for(int i = 0; i < sentence.length(); i++)
{
if (isalpha(sentence[i]))
{
if (sentence[i] == 'z')
{
sentence[i] = sentence[i] - 26;
}
if (sentence[i] == 'Z')
{
sentence[i] = sentence[i] - 26;
}
sentence[i] = sentence[i] + 1;
}
}
}
};
int main()
{
string sentence;
cout << "Enter a sentence to be encrypted. ";
getline(cin, sentence);
cout << endl;
EncryptionClass sentence1(sentence);
cout << "Unencrypted sentence." << endl;
cout << sentence1.getString() << endl << endl;
sentence1.encryptString();
cout << "Encrypted sentence." << endl;
cout << sentence1.getString() << endl;
cin.get();
return 0;
}
</code></pre>
| 0debug
|
static void count_cpreg(gpointer key, gpointer opaque)
{
ARMCPU *cpu = opaque;
uint64_t regidx;
const ARMCPRegInfo *ri;
regidx = *(uint32_t *)key;
ri = get_arm_cp_reginfo(cpu->cp_regs, regidx);
if (!(ri->type & ARM_CP_NO_MIGRATE)) {
cpu->cpreg_array_len++;
}
}
| 1threat
|
What's the (base64Encoded:"aGVsbG8gd29ybGQ=") this String meaning? : let data = Data(base64Encoded:"aGVsbG8gd29ybGQ=" ,options:.ignoreUnknownCharacters)
what is the "aGVsbG8gd29ybGQ=" meaning???
----------
Language:swift 3
| 0debug
|
Symphony error don't know what it means : I am new to Symphony and i am getting this error and don't really know what it is.If anyone can help it would be greatly appreciated.
thx
[Screen shot of the error][1]
[1]: https://i.stack.imgur.com/37pkc.png
| 0debug
|
How to set the default namespace in projects using project.json (.xproj) : <p>In a standard <code>.csproj</code> you could go into properties and set the default namespace. How can this be achieved in a <code>.xproj</code> project using <code>project.json</code>?</p>
| 0debug
|
How to cycle through tasks and keep track of it in PHP : <p>I'm developing a web application in PHP in which a user can create tasks for other users to compete.</p>
<p>Those tasks are then stored in MySQL Database.</p>
<p>My question is, How can I cycle through those tasks from the database and present It to the users while keeping track of which tasks that user has completed to avoid presenting the same task to that user. All while also providing the user who created a task with number of users who have completed his/her task.</p>
<p>How can I accomplish this in PHP?</p>
| 0debug
|
static bool virtio_pci_modern_state_needed(void *opaque)
{
VirtIOPCIProxy *proxy = opaque;
return !(proxy->flags & VIRTIO_PCI_FLAG_DISABLE_MODERN);
}
| 1threat
|
Cannot change visual studio code settings : <p>I try to change visual studio code settings but I cannot edit anything. What should I do ? I want to set encoding to </p>
<pre><code>"files.encoding": "ISO 8859-1",
</code></pre>
| 0debug
|
Parse Server: hosting MongoDB on AWS vs hosting on MongoLab : <p>AWS published a <a href="http://mobile.awsblog.com/post/TxCD57GZLM2JR/How-to-set-up-Parse-Server-on-AWS-using-AWS-Elastic-Beanstalk" rel="nofollow" title="blog post">blog post</a> about migrating from Parse. I wonder why they suggest hosting MongoDB on MongoLab instead of hosting it directly on AWS?</p>
<p>What's the advantage of hosting MongoDB on MongoLab? </p>
| 0debug
|
static void isa_ne2000_set_bootindex(Object *obj, Visitor *v,
const char *name, void *opaque,
Error **errp)
{
ISANE2000State *isa = ISA_NE2000(obj);
NE2000State *s = &isa->ne2000;
int32_t boot_index;
Error *local_err = NULL;
visit_type_int32(v, name, &boot_index, &local_err);
if (local_err) {
goto out;
}
check_boot_index(boot_index, &local_err);
if (local_err) {
goto out;
}
s->c.bootindex = boot_index;
out:
if (local_err) {
error_propagate(errp, local_err);
}
}
| 1threat
|
static void nbd_co_receive_reply(NBDClientSession *s,
NBDRequest *request,
NBDReply *reply,
QEMUIOVector *qiov)
{
int ret;
qemu_coroutine_yield();
*reply = s->reply;
if (reply->handle != request->handle ||
!s->ioc) {
reply->error = EIO;
} else {
if (qiov && reply->error == 0) {
ret = nbd_rwv(s->ioc, qiov->iov, qiov->niov, request->len, true,
NULL);
if (ret != request->len) {
reply->error = EIO;
}
}
s->reply.handle = 0;
}
}
| 1threat
|
the onmouseover function don't work : I have this table:
<tr><td><DIV align='center' onmouseover='dettaglio(<?php echo $cdclie;?>)' onmouseout='chiudiDettaglio()'>0</DIV></td>
and I have the javascript:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
<script>
// codice per mostrare il dettaglio
function dettaglio()
{
tooltip = '<div class="tooltiptopicevent" style="width:auto;height:auto;background:#feb811;position:absolute;z-index:10001;padding:10px 10px 10px 10px ; line-height: 200%;">'
+ 'Client' + ' ' + 'First and last name' + '</div>';
$("body").append(tooltip);
$(this).mouseover(function (e)
{
$(this).css('z-index', 10000);
$('.tooltiptopicevent').fadeIn('500');
$('.tooltiptopicevent').fadeTo('10', 1.9);
}).mousemove(function (e)
{
$('.tooltiptopicevent').css('top', e.pageY + 10);
$('.tooltiptopicevent').css('left', e.pageX + 20);
});
}
//
function chiudiDettaglio()
{
$(this).css('z-index', 8);
$('.tooltiptopicevent').remove();
}
</script>
<!-- end snippet -->
In the java script I want to read the database and return the result with json_encode.
to clarify : in java script must be the call to the php that returns me an array to be displayed with the " onmouseover "
Help me, thanks
| 0debug
|
Analysis of hostile code. How to deal with packer and how to figure out the language it is written on? : <p>I received a tailored email with an infected attachment from a public email. I would like to more about the payload. What is the right way to study this? I would like to use a debugger. Easier, but riskier option is to run it on Windows guest/Linux host on a sacrificial box without wifi card and comparing disk images before and after infection.
If I go the debugger way, how should I unpack the code?<br>
How to tell in what language the malware was written?<br>
Can any code be debugged by changing defensive conditional jumps (like "if debugger present" jump, or there are other pitfalls?<br>
How likely is it for malware jailbreak vmware and infect Linux host? </p>
| 0debug
|
javascript nested object from array Unexpected token [ : <p>I do not understand why I get <code>Uncaught SyntaxError: Unexpected token [</code> when I do the following:</p>
<pre><code> var thisarray = ["one","two","three"]
var thisobj = {
thisarray[0] : {thisarray[1] : thisarray[2]}
}
</code></pre>
<p>There is a similar syntax error that I get from trying this:</p>
<pre><code>$scope.find_settings.find = {$scope.query_main_type:findarray}
</code></pre>
<p>here the unexpected token is <code>.</code>. Doesn't javascript resolve the expressions when creating objects or what is happening here?</p>
| 0debug
|
InvalidArgumentException: URI must be a string or UriInterface in Guzzle : <p>I get a guzzle error as above , when i am sending the following code from a drupal 8 site:</p>
<pre><code> $url="https://mywebsite.com/index.php";
$client = \Drupal::httpClient();
$client->setDefaultOption( array('verify' ,false));
$post_data = $form_state->cleanValues()->getValues();
$request = $client->post($url, $post_data);
</code></pre>
| 0debug
|
static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
int64_t offset,
int64_t length,
uint64_t addend,
bool decrease,
enum qcow2_discard_type type)
{
BDRVQcowState *s = bs->opaque;
int64_t start, last, cluster_offset;
void *refcount_block = NULL;
int64_t old_table_index = -1;
int ret;
#ifdef DEBUG_ALLOC2
fprintf(stderr, "update_refcount: offset=%" PRId64 " size=%" PRId64
" addend=%s%" PRIu64 "\n", offset, length, decrease ? "-" : "",
addend);
#endif
if (length < 0) {
return -EINVAL;
} else if (length == 0) {
return 0;
}
if (decrease) {
qcow2_cache_set_dependency(bs, s->refcount_block_cache,
s->l2_table_cache);
}
start = start_of_cluster(s, offset);
last = start_of_cluster(s, offset + length - 1);
for(cluster_offset = start; cluster_offset <= last;
cluster_offset += s->cluster_size)
{
int block_index;
uint64_t refcount;
int64_t cluster_index = cluster_offset >> s->cluster_bits;
int64_t table_index = cluster_index >> s->refcount_block_bits;
if (table_index != old_table_index) {
if (refcount_block) {
ret = qcow2_cache_put(bs, s->refcount_block_cache,
&refcount_block);
if (ret < 0) {
goto fail;
}
}
ret = alloc_refcount_block(bs, cluster_index, &refcount_block);
if (ret < 0) {
goto fail;
}
}
old_table_index = table_index;
qcow2_cache_entry_mark_dirty(bs, s->refcount_block_cache,
refcount_block);
block_index = cluster_index & (s->refcount_block_size - 1);
refcount = s->get_refcount(refcount_block, block_index);
if (decrease ? (refcount - addend > refcount)
: (refcount + addend < refcount ||
refcount + addend > s->refcount_max))
{
ret = -EINVAL;
goto fail;
}
if (decrease) {
refcount -= addend;
} else {
refcount += addend;
}
if (refcount == 0 && cluster_index < s->free_cluster_index) {
s->free_cluster_index = cluster_index;
}
s->set_refcount(refcount_block, block_index, refcount);
if (refcount == 0 && s->discard_passthrough[type]) {
update_refcount_discard(bs, cluster_offset, s->cluster_size);
}
}
ret = 0;
fail:
if (!s->cache_discards) {
qcow2_process_discards(bs, ret);
}
if (refcount_block) {
int wret;
wret = qcow2_cache_put(bs, s->refcount_block_cache, &refcount_block);
if (wret < 0) {
return ret < 0 ? ret : wret;
}
}
if (ret < 0) {
int dummy;
dummy = update_refcount(bs, offset, cluster_offset - offset, addend,
!decrease, QCOW2_DISCARD_NEVER);
(void)dummy;
}
return ret;
}
| 1threat
|
java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 when trying to read csv : <p>I have problem when trying to read the csv file, the error appears like this : <code>java.lang.ArrayIndexOutOfBoundsException: length=1; index=1</code> . I have tried searching in StackOverflow, the error appears same as above.</p>
<p>Code :</p>
<pre><code>private void readCSVFile(String csvNameFile) {
try {
File readFolderCSV = new File(Environment.getExternalStorageDirectory() + "/Download/" + csvNameFile);
CSVReader csvReader = new CSVReader(new FileReader(readFolderCSV.getAbsoluteFile()));
String[] nextLine;
while((nextLine = csvReader.readNext()) != null) {
Log.e("TAG", nextLine[0] + nextLine[1] + nextLine[2] + nextLine[3] + nextLine[4]);
}
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(MasterUoM.this, "The specified file was not found", Toast.LENGTH_SHORT).show();
}
}
</code></pre>
<p>MyCSVFile :</p>
<p><img src="https://i.stack.imgur.com/TRU71.png" alt="1"></p>
| 0debug
|
JavaScript : Converting "Mon March 28 2016 23:59:59 GMT -0600 (CENTRAL DAYLIGHT TIME)" TO "2016-03-28 23:59:59" (YYYY-MM-DD HH:MM:SS) : <p>How do i convert "Mon March 28 2016 23:59:59 GMT -0600 (CENTRAL DAYLIGHT TIME)" TO "2016-03-28 23:59:59" (YYYY-MM-DD HH:MM:SS) in javascript?</p>
| 0debug
|
static void v9fs_readlink(void *opaque)
{
V9fsPDU *pdu = opaque;
size_t offset = 7;
V9fsString target;
int32_t fid;
int err = 0;
V9fsFidState *fidp;
pdu_unmarshal(pdu, offset, "d", &fid);
fidp = get_fid(pdu, fid);
if (fidp == NULL) {
err = -ENOENT;
goto out_nofid;
}
v9fs_string_init(&target);
err = v9fs_co_readlink(pdu, &fidp->path, &target);
if (err < 0) {
goto out;
}
offset += pdu_marshal(pdu, offset, "s", &target);
err = offset;
v9fs_string_free(&target);
out:
put_fid(pdu, fidp);
out_nofid:
trace_v9fs_readlink_return(pdu->tag, pdu->id, target.data);
complete_pdu(pdu->s, pdu, err);
}
| 1threat
|
static void megasas_handle_frame(MegasasState *s, uint64_t frame_addr,
uint32_t frame_count)
{
uint8_t frame_status = MFI_STAT_INVALID_CMD;
uint64_t frame_context;
MegasasCmd *cmd;
frame_context = megasas_frame_get_context(s, frame_addr);
cmd = megasas_enqueue_frame(s, frame_addr, frame_context, frame_count);
if (!cmd) {
trace_megasas_frame_busy(frame_addr);
megasas_frame_set_scsi_status(s, frame_addr, BUSY);
megasas_frame_set_cmd_status(s, frame_addr, MFI_STAT_SCSI_DONE_WITH_ERROR);
megasas_complete_frame(s, frame_context);
s->event_count++;
return;
}
switch (cmd->frame->header.frame_cmd) {
case MFI_CMD_INIT:
frame_status = megasas_init_firmware(s, cmd);
break;
case MFI_CMD_DCMD:
frame_status = megasas_handle_dcmd(s, cmd);
break;
case MFI_CMD_ABORT:
frame_status = megasas_handle_abort(s, cmd);
break;
case MFI_CMD_PD_SCSI_IO:
frame_status = megasas_handle_scsi(s, cmd, 0);
break;
case MFI_CMD_LD_SCSI_IO:
frame_status = megasas_handle_scsi(s, cmd, 1);
break;
case MFI_CMD_LD_READ:
case MFI_CMD_LD_WRITE:
frame_status = megasas_handle_io(s, cmd);
break;
default:
trace_megasas_unhandled_frame_cmd(cmd->index,
cmd->frame->header.frame_cmd);
s->event_count++;
break;
}
if (frame_status != MFI_STAT_INVALID_STATUS) {
if (cmd->frame) {
cmd->frame->header.cmd_status = frame_status;
} else {
megasas_frame_set_cmd_status(s, frame_addr, frame_status);
}
megasas_unmap_frame(s, cmd);
megasas_complete_frame(s, cmd->context);
}
}
| 1threat
|
static int handle_alloc(BlockDriverState *bs, uint64_t guest_offset,
uint64_t *host_offset, uint64_t *bytes, QCowL2Meta **m)
{
BDRVQcowState *s = bs->opaque;
int l2_index;
uint64_t *l2_table;
uint64_t entry;
unsigned int nb_clusters;
int ret;
uint64_t alloc_cluster_offset;
trace_qcow2_handle_alloc(qemu_coroutine_self(), guest_offset, *host_offset,
*bytes);
assert(*bytes > 0);
nb_clusters =
size_to_clusters(s, offset_into_cluster(s, guest_offset) + *bytes);
l2_index = offset_to_l2_index(s, guest_offset);
nb_clusters = MIN(nb_clusters, s->l2_size - l2_index);
ret = get_cluster_table(bs, guest_offset, &l2_table, &l2_index);
if (ret < 0) {
return ret;
}
entry = be64_to_cpu(l2_table[l2_index]);
if (entry & QCOW_OFLAG_COMPRESSED) {
nb_clusters = 1;
} else {
nb_clusters = count_cow_clusters(s, nb_clusters, l2_table, l2_index);
}
ret = qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table);
if (ret < 0) {
return ret;
}
if (nb_clusters == 0) {
*bytes = 0;
return 0;
}
alloc_cluster_offset = start_of_cluster(s, *host_offset);
ret = do_alloc_cluster_offset(bs, guest_offset, &alloc_cluster_offset,
&nb_clusters);
if (ret < 0) {
goto fail;
}
if (nb_clusters == 0) {
*bytes = 0;
return 0;
}
int requested_sectors =
(*bytes + offset_into_cluster(s, guest_offset))
>> BDRV_SECTOR_BITS;
int avail_sectors = nb_clusters
<< (s->cluster_bits - BDRV_SECTOR_BITS);
int alloc_n_start = offset_into_cluster(s, guest_offset)
>> BDRV_SECTOR_BITS;
int nb_sectors = MIN(requested_sectors, avail_sectors);
QCowL2Meta *old_m = *m;
*m = g_malloc0(sizeof(**m));
**m = (QCowL2Meta) {
.next = old_m,
.alloc_offset = alloc_cluster_offset,
.offset = start_of_cluster(s, guest_offset),
.nb_clusters = nb_clusters,
.nb_available = nb_sectors,
.cow_start = {
.offset = 0,
.nb_sectors = alloc_n_start,
},
.cow_end = {
.offset = nb_sectors * BDRV_SECTOR_SIZE,
.nb_sectors = avail_sectors - nb_sectors,
},
};
qemu_co_queue_init(&(*m)->dependent_requests);
QLIST_INSERT_HEAD(&s->cluster_allocs, *m, next_in_flight);
*host_offset = alloc_cluster_offset + offset_into_cluster(s, guest_offset);
*bytes = MIN(*bytes, (nb_sectors * BDRV_SECTOR_SIZE)
- offset_into_cluster(s, guest_offset));
assert(*bytes != 0);
return 1;
fail:
if (*m && (*m)->nb_clusters > 0) {
QLIST_REMOVE(*m, next_in_flight);
}
return ret;
}
| 1threat
|
Why is this returning Garbage? : <p>I am making a calculator for a game.<br>
I usually first make sure the code is working in C++, and then convert it to the desired language. I had made this program. In this program, some of the times, optDura stores the correct value and other times, it stores garbage.
<br><br>
Here is the code :-</p>
<pre><code>#include <iostream>
using namespace std;
/*
cd - current Durability
se - smith efficiency in decimal
sc - smith charges in decimal
sE - smith efficiency in %
sC - smith charges in %
ic - initial cost
md - maximum durability
tmd - temporary maximum durability
tD - temporary durability
td - total durability
rc - repair cost
cpb - cost per battle
*/
int main(){
long int currDura, maxDura, tempMaxDura, tempDura, totDura, optDura;
double iniCost, repCost;
long int smithEffi, smithCharge;
double se, sc;
double totCostTillNow, costPerBattle = 0, minCPB;
int i;
long int repCount = 1;
iniCost = 25500;
currDura = 58;
maxDura = 59;
repCost = 27414;
se = 0.90;
sc = 0.85;
tempMaxDura = maxDura;
tempDura = currDura;
totDura = tempDura;
totCostTillNow = iniCost;
costPerBattle = totCostTillNow / totDura;
minCPB = costPerBattle;
cout<<"\n Cost without any repair = "<<costPerBattle;
for(i=1; i<=maxDura; i++)
{
totCostTillNow += (double) repCost * sc;
tempDura = tempMaxDura * se;
totDura += tempDura;
costPerBattle = (double) (totCostTillNow / totDura);
tempMaxDura -= 1;
if ( minCPB >= costPerBattle )
{
minCPB = costPerBattle;
optDura = tempMaxDura;
}
}
cout<<"\n Minimum cost per battle = "<<minCPB<<" & sell at 0/"<<optDura;
return 0;
}
</code></pre>
<p>The problem occurs when repCost is >= 27414. For values less than that, it gives the desired result. I am unable to figure out why this is happening.</p>
<p>Thanks a lot</p>
| 0debug
|
static inline void gen_stack_update(DisasContext *s, int addend)
{
#ifdef TARGET_X86_64
if (CODE64(s)) {
gen_op_addq_ESP_im(addend);
} else
#endif
if (s->ss32) {
gen_op_addl_ESP_im(addend);
} else {
gen_op_addw_ESP_im(addend);
}
}
| 1threat
|
static int kvm_mce_in_progress(CPUState *env)
{
struct kvm_msr_entry msr_mcg_status = {
.index = MSR_MCG_STATUS,
};
int r;
r = kvm_get_msr(env, &msr_mcg_status, 1);
if (r == -1 || r == 0) {
fprintf(stderr, "Failed to get MCE status\n");
return 0;
}
return !!(msr_mcg_status.data & MCG_STATUS_MCIP);
}
| 1threat
|
How to Edit and update an uploaded image in ASP.NET MVC : I want to edit my Uploaded Image in my **Edit.cshtml** page , but when I click my edit action there exist all data in my employee form but no image file and then I fail to change my image if necessary.
I use [MsSql Server][1] as database and there save only image name no path or image as I wish.
I take image as datatype `string` , not `byte[]`
My Code-
========
**Employee Model**
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Web;
namespace MVC_Login_Registration.Models
{
public class EmployeeInfo
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Key]
public int EmployeeID { get; set; }
[Required(ErrorMessage = "Employee Name is Required"), Display(Name = "Name")]
public string EmployeeName { get; set; }
[Required(ErrorMessage = "Employee Bangla Name is Required"), Display(Name = "Bangla Name")]
public string EmployeeBanglaName { get; set; }
//public int DepartmentID { get; set; }
////[ForeignKey("DepartmentID")]
//public virtual Department Department { get; set; }
//public int DesignationID { get; set; }
//public virtual Designation Designation { get; set; }
[Required(ErrorMessage = "Department Name is Required")]
public string Department { get; set; }
[Required(ErrorMessage = "Designation is Required")]
public string Designation { get; set; }
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
public DateTime JoiningDate{ get; set; }
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
public DateTime DateOfBirth { get; set; }
[Required(ErrorMessage = "BloodGroup is Required"), Display(Name = "Blood Group")]
public bloodGroup BloodGroup { get; set; }
[Required(ErrorMessage = "Gender is Required")]
public gender Gender { get; set; }
[Required(ErrorMessage = "Father Name is Required"), Display(Name = "Father Name")]
public string FatherName { get; set; }
[Required(ErrorMessage = "Mother Name is Required"), Display(Name = "Mother Name")]
public string MotherName { get; set; }
[Required(ErrorMessage = "Husband/Wife Name is Required"), Display(Name = "Spouse Name")]
public string SpouseName { get; set; }
public string ChildrenNumber { get; set; }
public string CardNumber { get; set; }
[Required(ErrorMessage = "Contact No is Required"), DataType(DataType.PhoneNumber)]
public string ContactNo { get; set; }
[Required(ErrorMessage = "Email is Required"), DataType(DataType.EmailAddress), StringLength(200)]
public string Email { get; set; }
[Required(ErrorMessage = "HomeContactNo is Required"),DataType(DataType.PhoneNumber)]
public string HomeContactNo { get; set; }
[Required(ErrorMessage = "District Name is Required")]
public string District { get; set; }
[Required(ErrorMessage = "Thana is Required")]
public string Thana { get; set; }
[Required(ErrorMessage = "Village Name is Required")]
public string Vill { get; set; }
[Required(ErrorMessage = "Post Code is Required")]
public string PostCode { get; set; }
public string Image { get; set; }
//public byte[] Image { get; set; }
public bool IsActive { get; set; }
public string AddedBy { get; set; }
public DateTime AddedDate { get; set; }
public string UpdateBy { get; set; }
public DateTime UpdateDate { get; set; }
}
public enum gender
{
Male,
Female,
Other
}
public enum bloodGroup
{
A_positive,
A_negative,
B_positive,
B_negative,
AB_positive,
AB_negative,
O_positive,
O_negative
}
}
**Employee Controller**
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MVC_Login_Registration.Models;
using System.Data.Entity;
using System.Net;
using System.Data.Entity.Infrastructure;
using System.IO;
using System.Threading.Tasks;
namespace MVC_Login_Registration.Controllers
{
public class EmployeeController : Controller
{
UserDbContext edb = new UserDbContext();
//
// GET: /Employee/
public ActionResult Index() => View(edb.employeeinfo.ToList());
public ActionResult Create() => View();
[HttpPost]
public ActionResult Create(EmployeeInfo empinfo, HttpPostedFileBase image)
{
empinfo.Image = System.IO.Path.GetFileName(image.FileName);
empinfo.AddedBy = "mahbub";
empinfo.AddedDate = DateTime.Now;
empinfo.UpdateBy = "mahbub";
empinfo.UpdateDate = DateTime.Now;
empinfo.IsActive = true;
if (ModelState.IsValid)
{
edb.employeeinfo.Add(empinfo);
edb.SaveChanges();
image.SaveAs("C:/EmployeeImage/" + empinfo.EmployeeID.ToString() + empinfo.Image);
image.SaveAs(Server.MapPath(Url.Content("~/EmployeeImage/" + empinfo.EmployeeID.ToString() + empinfo.Image)));
return RedirectToAction("Index");
//ModelState.Clear();
//ViewBag.Message = "Information Created Successfully...";
}
return View(empinfo);
}
public ActionResult Edit() => View(edb.employeeinfo.ToList());
[HttpGet]
public ActionResult Edit(int? id)
{
EmployeeInfo empinfo = edb.employeeinfo.Find(id);
return View(empinfo);
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Edit(EmployeeInfo empinfo, HttpPostedFileBase image)
{
if (ModelState.IsValid)
{
var model = edb.employeeinfo .Find(empinfo.EmployeeID );
string oldfilePath = model.Image ;
if (image != null && image .ContentLength > 0)
{
var fileName = Path.GetFileName(image .FileName);
string path = System.IO.Path.Combine(
Server.MapPath("~/EmployeeImage/"), fileName);
image.SaveAs(path);
model.Image = "/EmployeeImage/" + image .FileName;
string fullPath = Request.MapPath("~" + oldfilePath);
if (System.IO.File.Exists(fullPath))
{
System.IO.File.Delete(fullPath);
}
}
model.Image = empinfo .Image ;
edb.SaveChanges();
return RedirectToAction("Index");
}
return View(empinfo);
}
[HttpGet]
public ActionResult Delete(int id)
{
EmployeeInfo empinfo = edb.employeeinfo.Find(id);
return View(empinfo);
}
[HttpPost ActionName("Delete")]
public ActionResult DeleteConfirm(int id)
{
EmployeeInfo empinfoToDelete = edb.employeeinfo.Find(id);
edb.employeeinfo.Remove(empinfoToDelete);
edb.SaveChanges();
return RedirectToAction("Index");
}
// GET: Department/Details/5
public ActionResult Details(int id=0)
{
EmployeeInfo empinfo = edb.employeeinfo.Find(id);
return View(empinfo);
}
}
}
And **create.cshtml**
@model MVC_Login_Registration.Models.EmployeeInfo
@{
ViewBag.Title = "Create";
}
<div class="form-group">
<div class="col-lg-12 col-md-12 col-sm-12 col-sm-12">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<div class="col-lg-12 col-md-12 col-sm-12 col-sm-12">
@Html.LabelFor(model => model.EmployeeName)<br />
@*<input type="EmployeeName" class="form-control" id="EmployeeName" placeholder="Enter Your Name">*@
@Html.TextBox("EmployeeName", "", new { id = "EmployeeNameTextBox", @class = "form-control" })
@Html.ValidationMessageFor(model => model.EmployeeName)
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-sm-12">
<div class="col-lg-12 col-md-12 col-sm-12 col-sm-12">
@Html.LabelFor(model => model.Image, new { @class = "control-label col-md-2" })
<input type="file" name="image" onchange="previewFile()"><br>
<img src="" height="100" alt="Image preview...">
<script>
function previewFile() {
var preview = document.querySelector('img');
var file = document.querySelector('input[type=file]').files[0];
var reader = new FileReader();
reader.addEventListener("load", function () {
preview.src = reader.result;
}, false);
if (file) {
reader.readAsDataURL(file);
}
}
</script>
@Html.ValidationMessageFor(model => model.Image)
</div>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-sm-12">
<input type="submit" value="Create" class="btn btn-success" />
</div>
</form>
</div>
<div>
@Html.ActionLink("Back to List", "Index")
</div>
**Edit.cshtml**
<div class="col-lg-4 col-md-4 col-sm-4 col-sm-12">
<div class="col-lg-12 col-md-12 col-sm-12 col-sm-12">
@Html.LabelFor(model => model.Image, new { @class = "control-label col-md-2" })
<input type="file" name="image" onchange="previewFile()" onload="loadFile()"><br>
<img src="../EmployeeImage/(item.EmployeeID.ToString()+item.Image)" height="100">
<img src=model.Image height="100" alt="Image preview...">
<script>
function previewFile() {
var preview = document.querySelector('img');
var file = document.querySelector('input[type=file]').files[0];
var reader = new FileReader();
reader.addEventListener("load", function () {
preview.src = reader.result;
}, false);
if (file) {
reader.readAsDataURL(file);
}
}
</script>
@Html.ValidationMessageFor(model => model.Image)
@Html.HiddenFor(model => model.Image)
</div>
[1]: https://www.microsoft.com/en-us/sql-server/sql-server-2016
| 0debug
|
trying to fix my bug : <p>im making a slide text from right to left , but when goes on left side stop moving and start again ...i want it to never stop moving from right to left .. here is my code ..</p>
<pre><code>function change_left() {
$('#slide12').removeClass('slide-right').addClass('slide-left');
}
function change_right() {
$('#slide12').removeClass('slide-left').addClass('slide-right');
}
function to_left() {
setInterval(change_left, 5000);
};
function to_right() {
setInterval(change_right, 5000);
};
to_left();
to_right()
</code></pre>
| 0debug
|
How to split a string variable into n variables in R : <p>In R I need to split a string variable of a dataframe into n variables separated by "->" without knowing in advance the number of new variables to create</p>
| 0debug
|
static double eval_expr(Parser * p, AVEvalExpr * e) {
switch (e->type) {
case e_value: return e->value;
case e_const: return e->value * p->const_value[e->a.const_index];
case e_func0: return e->value * e->a.func0(eval_expr(p, e->param[0]));
case e_func1: return e->value * e->a.func1(p->opaque, eval_expr(p, e->param[0]));
case e_func2: return e->value * e->a.func2(p->opaque, eval_expr(p, e->param[0]), eval_expr(p, e->param[1]));
case e_squish: return 1/(1+exp(4*eval_expr(p, e->param[0])));
case e_gauss: { double d = eval_expr(p, e->param[0]); return exp(-d*d/2)/sqrt(2*M_PI); }
case e_ld: return e->value * p->var[clip(eval_expr(p, e->param[0]), 0, VARS-1)];
case e_while: {
double d;
while(eval_expr(p, e->param[0]))
d=eval_expr(p, e->param[1]);
return d;
}
default: {
double d = eval_expr(p, e->param[0]);
double d2 = eval_expr(p, e->param[1]);
switch (e->type) {
case e_mod: return e->value * (d - floor(d/d2)*d2);
case e_max: return e->value * (d > d2 ? d : d2);
case e_min: return e->value * (d < d2 ? d : d2);
case e_eq: return e->value * (d == d2 ? 1.0 : 0.0);
case e_gt: return e->value * (d > d2 ? 1.0 : 0.0);
case e_gte: return e->value * (d >= d2 ? 1.0 : 0.0);
case e_pow: return e->value * pow(d, d2);
case e_mul: return e->value * (d * d2);
case e_div: return e->value * (d / d2);
case e_add: return e->value * (d + d2);
case e_last:return d2;
case e_st : return e->value * (p->var[clip(d, 0, VARS-1)]= d2);
}
}
}
return NAN;
}
| 1threat
|
Why has the 'to lowercase' shortcut been removed from VS2015? : <p>In previous versions of Visual Studio, you could make all selected text lowercase with CTRL+U, and all uppercase using CTRL+SHIFT+U.</p>
<p>The uppercase shortcut remains in the 2015 version of VS, the lowercase shortcut, however, has been removed.</p>
<p>Does anybody have any info regarding this?</p>
<p>I thought it may have been because it conflicted with a shortcut for newly introduced functionality which had to take priority, but the only CTRL+U shortcut relies on a previous combination of keys too.</p>
| 0debug
|
void serial_exit_core(SerialState *s)
{
qemu_chr_fe_deinit(&s->chr);
qemu_unregister_reset(serial_reset, s);
}
| 1threat
|
void lm32_debug_excp_handler(CPUState *cs)
{
LM32CPU *cpu = LM32_CPU(cs);
CPULM32State *env = &cpu->env;
CPUBreakpoint *bp;
if (cs->watchpoint_hit) {
if (cs->watchpoint_hit->flags & BP_CPU) {
cs->watchpoint_hit = NULL;
if (check_watchpoints(env)) {
raise_exception(env, EXCP_WATCHPOINT);
} else {
cpu_resume_from_signal(cs, NULL);
}
}
} else {
QTAILQ_FOREACH(bp, &cs->breakpoints, entry) {
if (bp->pc == env->pc) {
if (bp->flags & BP_CPU) {
raise_exception(env, EXCP_BREAKPOINT);
}
break;
}
}
}
}
| 1threat
|
window.location.href = 'http://attack.com?user=' + user_input;
| 1threat
|
static int cdg_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
int ret;
uint8_t command, inst;
uint8_t cdg_data[CDG_DATA_SIZE];
AVFrame *frame = data;
CDGraphicsContext *cc = avctx->priv_data;
if (buf_size < CDG_MINIMUM_PKT_SIZE) {
av_log(avctx, AV_LOG_ERROR, "buffer too small for decoder\n");
return AVERROR(EINVAL);
}
if (buf_size > CDG_HEADER_SIZE + CDG_DATA_SIZE) {
av_log(avctx, AV_LOG_ERROR, "buffer too big for decoder\n");
return AVERROR(EINVAL);
}
if ((ret = ff_reget_buffer(avctx, cc->frame)) < 0)
return ret;
if (!avctx->frame_number) {
memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height);
memset(cc->frame->data[1], 0, AVPALETTE_SIZE);
}
command = bytestream_get_byte(&buf);
inst = bytestream_get_byte(&buf);
inst &= CDG_MASK;
buf += 2;
if (buf_size > CDG_HEADER_SIZE)
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
if ((command & CDG_MASK) == CDG_COMMAND) {
switch (inst) {
case CDG_INST_MEMORY_PRESET:
if (!(cdg_data[1] & 0x0F))
memset(cc->frame->data[0], cdg_data[0] & 0x0F,
cc->frame->linesize[0] * CDG_FULL_HEIGHT);
break;
case CDG_INST_LOAD_PAL_LO:
case CDG_INST_LOAD_PAL_HIGH:
if (buf_size - CDG_HEADER_SIZE < CDG_DATA_SIZE) {
av_log(avctx, AV_LOG_ERROR, "buffer too small for loading palette\n");
return AVERROR(EINVAL);
}
cdg_load_palette(cc, cdg_data, inst == CDG_INST_LOAD_PAL_LO);
break;
case CDG_INST_BORDER_PRESET:
cdg_border_preset(cc, cdg_data);
break;
case CDG_INST_TILE_BLOCK_XOR:
case CDG_INST_TILE_BLOCK:
if (buf_size - CDG_HEADER_SIZE < CDG_DATA_SIZE) {
av_log(avctx, AV_LOG_ERROR, "buffer too small for drawing tile\n");
return AVERROR(EINVAL);
}
ret = cdg_tile_block(cc, cdg_data, inst == CDG_INST_TILE_BLOCK_XOR);
if (ret) {
av_log(avctx, AV_LOG_ERROR, "tile is out of range\n");
return ret;
}
break;
case CDG_INST_SCROLL_PRESET:
case CDG_INST_SCROLL_COPY:
if (buf_size - CDG_HEADER_SIZE < CDG_MINIMUM_SCROLL_SIZE) {
av_log(avctx, AV_LOG_ERROR, "buffer too small for scrolling\n");
return AVERROR(EINVAL);
}
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
cdg_scroll(cc, cdg_data, frame, inst == CDG_INST_SCROLL_COPY);
av_frame_unref(cc->frame);
ret = av_frame_ref(cc->frame, frame);
if (ret < 0)
return ret;
break;
default:
break;
}
if (!frame->data[0]) {
ret = av_frame_ref(frame, cc->frame);
if (ret < 0)
return ret;
}
*got_frame = 1;
} else {
*got_frame = 0;
buf_size = 0;
}
return buf_size;
}
| 1threat
|
What would cause the code below to not run? : <script>
//<![CDATA[
var displayCurrentTime = new function() {
// Get values...
var sysHour = getHours(); // Get Hours
var curHour = 0; // Initialize current hour (12 hr format)
var morningEvening = "AM"; // Initialize AM/PM notation
if (sysHour < 13) { // If it's in the morning, set time as is.
curHour = sysHour;
morningEvening = "AM"
} else {
curHour = sysHour - 12; // If it's in the evening, subtract 12 from the value and use "PM"
morningEvening = "PM"
}
var curMins: getMinutes; // Get current minutes...
// Capture the ID of the notification bar div, and compose a string from the above values.
var notificationBar = document.getElementById("notificationBar");
var dateTimeString = curHour + ":" + curMins + " " + morningEvening;
// All that code above files into this fun stuff.
notificationBar.innerHTML = dateTimeString;
}
window.setInterval(function(){ displayCurrentTime(); }, 1000);
//]]>
</script>
I've been reading up some information and I wanted to create a simple script that grabs the hour and minute, does some calculations to determine if it's AM or PM, creates a string variable from those results, and then slips it inside of a specific DIV element. It does this every second.
Most of the code I've written seems to make sense based on what I've read. In the beginning I've tried using function displayCurrentTime() {} as well as what you see below (var displayCurrentTime = new function() {}) and neither seem to work. I cannot get my text to display in the page. Note: the ID of the div is notificationBar, just as it is here.
Is there anything in this code that makes no sense, or does this actually warrant posting the full HTML?
| 0debug
|
Sorting values off array in Java : <p>I am new to this site and new to java so pleas help me out. If i have array of positive and negative numbers all are int,
how to sort all the positive ones in a new array and all negative in a other new array.</p>
| 0debug
|
static inline void writer_print_rational(WriterContext *wctx,
const char *key, AVRational q, char sep)
{
AVBPrint buf;
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
av_bprintf(&buf, "%d%c%d", q.num, sep, q.den);
wctx->writer->print_string(wctx, key, buf.str);
wctx->nb_item++;
}
| 1threat
|
In Python 3.5, is the keyword "await" equivalent to "yield from"? : <p>In the document here: <a href="https://docs.python.org/3/library/asyncio-task.html" rel="noreferrer">https://docs.python.org/3/library/asyncio-task.html</a>, I found many <code>yield from</code> can be replaced by <code>await</code>.</p>
<p>I was wondering whether they are equivalent all the time in Python 3.5. Does anyone have ideas about this?</p>
| 0debug
|
Install from Github : <p>I am trying to download and install an app called "code printer" from Github but there seems to be no setup. I have installed the Git app on my Windows computer and it has been configured with my username and email ID. I have downloaded the files to my computer from the website. I am unsure about how to proceed. I am new to github and a step by step procedure would greatly help. Thank you.
This is the url where the app can be found : <a href="https://github.com/jaredpetersen/codeprinter" rel="nofollow noreferrer">https://github.com/jaredpetersen/codeprinter</a></p>
| 0debug
|
static int nbd_negotiate_options(NBDClient *client, uint16_t myflags,
Error **errp)
{
uint32_t flags;
bool fixedNewstyle = false;
bool no_zeroes = false;
if (nbd_read(client->ioc, &flags, sizeof(flags), errp) < 0) {
error_prepend(errp, "read failed: ");
return -EIO;
be32_to_cpus(&flags);
trace_nbd_negotiate_options_flags(flags);
if (flags & NBD_FLAG_C_FIXED_NEWSTYLE) {
fixedNewstyle = true;
flags &= ~NBD_FLAG_C_FIXED_NEWSTYLE;
if (flags & NBD_FLAG_C_NO_ZEROES) {
no_zeroes = true;
flags &= ~NBD_FLAG_C_NO_ZEROES;
if (flags != 0) {
error_setg(errp, "Unknown client flags 0x%" PRIx32 " received", flags);
while (1) {
int ret;
uint32_t option, length;
uint64_t magic;
if (nbd_read(client->ioc, &magic, sizeof(magic), errp) < 0) {
error_prepend(errp, "read failed: ");
magic = be64_to_cpu(magic);
trace_nbd_negotiate_options_check_magic(magic);
if (magic != NBD_OPTS_MAGIC) {
error_setg(errp, "Bad magic received");
if (nbd_read(client->ioc, &option,
sizeof(option), errp) < 0) {
error_prepend(errp, "read failed: ");
option = be32_to_cpu(option);
if (nbd_read(client->ioc, &length, sizeof(length), errp) < 0) {
error_prepend(errp, "read failed: ");
length = be32_to_cpu(length);
trace_nbd_negotiate_options_check_option(option,
nbd_opt_lookup(option));
if (client->tlscreds &&
client->ioc == (QIOChannel *)client->sioc) {
QIOChannel *tioc;
if (!fixedNewstyle) {
error_setg(errp, "Unsupported option 0x%" PRIx32, option);
switch (option) {
case NBD_OPT_STARTTLS:
if (length) {
return nbd_reject_length(client, length, option, true,
errp);
tioc = nbd_negotiate_handle_starttls(client, errp);
if (!tioc) {
return -EIO;
ret = 0;
object_unref(OBJECT(client->ioc));
client->ioc = QIO_CHANNEL(tioc);
break;
case NBD_OPT_EXPORT_NAME:
error_setg(errp, "Option 0x%x not permitted before TLS",
option);
default:
if (nbd_drop(client->ioc, length, errp) < 0) {
return -EIO;
ret = nbd_negotiate_send_rep_err(client->ioc,
NBD_REP_ERR_TLS_REQD,
option, errp,
"Option 0x%" PRIx32
"not permitted before TLS",
option);
if (option == NBD_OPT_ABORT) {
return 1;
break;
} else if (fixedNewstyle) {
switch (option) {
case NBD_OPT_LIST:
if (length) {
ret = nbd_reject_length(client, length, option, false,
errp);
} else {
ret = nbd_negotiate_handle_list(client, errp);
break;
case NBD_OPT_ABORT:
nbd_negotiate_send_rep(client->ioc, NBD_REP_ACK, option, NULL);
return 1;
case NBD_OPT_EXPORT_NAME:
return nbd_negotiate_handle_export_name(client, length,
myflags, no_zeroes,
errp);
case NBD_OPT_INFO:
case NBD_OPT_GO:
ret = nbd_negotiate_handle_info(client, length, option,
myflags, errp);
if (ret == 1) {
assert(option == NBD_OPT_GO);
return 0;
break;
case NBD_OPT_STARTTLS:
if (length) {
ret = nbd_reject_length(client, length, option, false,
errp);
} else if (client->tlscreds) {
ret = nbd_negotiate_send_rep_err(client->ioc,
NBD_REP_ERR_INVALID,
option, errp,
"TLS already enabled");
} else {
ret = nbd_negotiate_send_rep_err(client->ioc,
NBD_REP_ERR_POLICY,
option, errp,
"TLS not configured");
break;
case NBD_OPT_STRUCTURED_REPLY:
if (length) {
ret = nbd_reject_length(client, length, option, false,
errp);
} else if (client->structured_reply) {
ret = nbd_negotiate_send_rep_err(
client->ioc, NBD_REP_ERR_INVALID, option, errp,
"structured reply already negotiated");
} else {
ret = nbd_negotiate_send_rep(client->ioc, NBD_REP_ACK,
option, errp);
client->structured_reply = true;
myflags |= NBD_FLAG_SEND_DF;
break;
default:
if (nbd_drop(client->ioc, length, errp) < 0) {
return -EIO;
ret = nbd_negotiate_send_rep_err(client->ioc,
NBD_REP_ERR_UNSUP,
option, errp,
"Unsupported option 0x%"
PRIx32 " (%s)", option,
nbd_opt_lookup(option));
break;
} else {
switch (option) {
case NBD_OPT_EXPORT_NAME:
return nbd_negotiate_handle_export_name(client, length,
myflags, no_zeroes,
errp);
default:
error_setg(errp, "Unsupported option 0x%" PRIx32 " (%s)",
option, nbd_opt_lookup(option));
if (ret < 0) {
return ret;
| 1threat
|
static int parse_playlist(AppleHTTPContext *c, const char *url,
struct variant *var, AVIOContext *in)
{
int ret = 0, duration = 0, is_segment = 0, is_variant = 0, bandwidth = 0;
enum KeyType key_type = KEY_NONE;
uint8_t iv[16] = "";
int has_iv = 0;
char key[MAX_URL_SIZE];
char line[1024];
const char *ptr;
int close_in = 0;
if (!in) {
close_in = 1;
if ((ret = avio_open2(&in, url, AVIO_FLAG_READ,
c->interrupt_callback, NULL)) < 0)
return ret;
}
read_chomp_line(in, line, sizeof(line));
if (strcmp(line, "#EXTM3U")) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
if (var) {
free_segment_list(var);
var->finished = 0;
}
while (!in->eof_reached) {
read_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
struct variant_info info = {{0}};
is_variant = 1;
ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_variant_args,
&info);
bandwidth = atoi(info.bandwidth);
} else if (av_strstart(line, "#EXT-X-KEY:", &ptr)) {
struct key_info info = {{0}};
ff_parse_key_value(ptr, (ff_parse_key_val_cb) handle_key_args,
&info);
key_type = KEY_NONE;
has_iv = 0;
if (!strcmp(info.method, "AES-128"))
key_type = KEY_AES_128;
if (!strncmp(info.iv, "0x", 2) || !strncmp(info.iv, "0X", 2)) {
ff_hex_to_data(iv, info.iv + 2);
has_iv = 1;
}
av_strlcpy(key, info.uri, sizeof(key));
} else if (av_strstart(line, "#EXT-X-TARGETDURATION:", &ptr)) {
if (!var) {
var = new_variant(c, 0, url, NULL);
if (!var) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
var->target_duration = atoi(ptr);
} else if (av_strstart(line, "#EXT-X-MEDIA-SEQUENCE:", &ptr)) {
if (!var) {
var = new_variant(c, 0, url, NULL);
if (!var) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
var->start_seq_no = atoi(ptr);
} else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) {
if (var)
var->finished = 1;
} else if (av_strstart(line, "#EXTINF:", &ptr)) {
is_segment = 1;
duration = atoi(ptr);
} else if (av_strstart(line, "#", NULL)) {
continue;
} else if (line[0]) {
if (is_variant) {
if (!new_variant(c, bandwidth, line, url)) {
ret = AVERROR(ENOMEM);
goto fail;
}
is_variant = 0;
bandwidth = 0;
}
if (is_segment) {
struct segment *seg;
if (!var) {
var = new_variant(c, 0, url, NULL);
if (!var) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
seg = av_malloc(sizeof(struct segment));
if (!seg) {
ret = AVERROR(ENOMEM);
goto fail;
}
seg->duration = duration;
seg->key_type = key_type;
if (has_iv) {
memcpy(seg->iv, iv, sizeof(iv));
} else {
int seq = var->start_seq_no + var->n_segments;
memset(seg->iv, 0, sizeof(seg->iv));
AV_WB32(seg->iv + 12, seq);
}
ff_make_absolute_url(seg->key, sizeof(seg->key), url, key);
ff_make_absolute_url(seg->url, sizeof(seg->url), url, line);
dynarray_add(&var->segments, &var->n_segments, seg);
is_segment = 0;
}
}
}
if (var)
var->last_load_time = av_gettime();
fail:
if (close_in)
avio_close(in);
return ret;
}
| 1threat
|
From a Java based application perspective, what’s the purpose of oracle client installed on a server : <p>I am trying to understand the purpose of oracle client installed on a VM.</p>
<p>Can a Java application connect to the oracle client using jdbc?</p>
| 0debug
|
VSCODE: Is there a way to accept current change at once? : <p>I merged a file with one another, but there are bunch of HEADs with Accept Current Change | Accept Incoming Change | ...</p>
<p>Is there a way to accept current change at once?</p>
| 0debug
|
Your app has stopped - Android studio error : I have been developing a simple app in android studio, but my app keeps crashing when i attempt to run it. The stacktrace:
03-29 23:32:34.720 2130-2206/com.google.android.googlequicksearchbox:search
E/AudioRecord: Could not get audio input for session 4801, record source
1999, sample rate 16000, format 0x1, channel mask 0x10, flags 0
03-29 23:32:34.720 2130-2206/com.google.android.googlequicksearchbox:search
E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check
failed with status -22.
03-29 23:32:34.720 2130-2206/com.google.android.googlequicksearchbox:search
E/android.media.AudioRecord: Error code -20 when initializing native
AudioRecord object.
03-29 23:32:34.721 2130-2206/com.google.android.googlequicksearchbox:search
E/ActivityThread: Failed to find provider info for
com.google.android.apps.gsa.testing.ui.audio.recorded
I don't understand why this is happening, I never attempt to use a microphone or anything audio related in my app.
Here is my AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.nick.project2" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Thanks
| 0debug
|
static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, const HEVCContext *h,
DXVA_PicParams_HEVC *pp)
{
const HEVCFrame *current_picture = h->ref;
int i, j, k;
memset(pp, 0, sizeof(*pp));
pp->PicWidthInMinCbsY = h->sps->min_cb_width;
pp->PicHeightInMinCbsY = h->sps->min_cb_height;
pp->wFormatAndSequenceInfoFlags = (h->sps->chroma_format_idc << 0) |
(h->sps->separate_colour_plane_flag << 2) |
((h->sps->bit_depth - 8) << 3) |
((h->sps->bit_depth - 8) << 6) |
((h->sps->log2_max_poc_lsb - 4) << 9) |
(0 << 13) |
(0 << 14) |
(0 << 15);
fill_picture_entry(&pp->CurrPic, ff_dxva2_get_surface_index(avctx, ctx, current_picture->frame), 0);
pp->sps_max_dec_pic_buffering_minus1 = h->sps->temporal_layer[h->sps->max_sub_layers - 1].max_dec_pic_buffering - 1;
pp->log2_min_luma_coding_block_size_minus3 = h->sps->log2_min_cb_size - 3;
pp->log2_diff_max_min_luma_coding_block_size = h->sps->log2_diff_max_min_coding_block_size;
pp->log2_min_transform_block_size_minus2 = h->sps->log2_min_tb_size - 2;
pp->log2_diff_max_min_transform_block_size = h->sps->log2_max_trafo_size - h->sps->log2_min_tb_size;
pp->max_transform_hierarchy_depth_inter = h->sps->max_transform_hierarchy_depth_inter;
pp->max_transform_hierarchy_depth_intra = h->sps->max_transform_hierarchy_depth_intra;
pp->num_short_term_ref_pic_sets = h->sps->nb_st_rps;
pp->num_long_term_ref_pics_sps = h->sps->num_long_term_ref_pics_sps;
pp->num_ref_idx_l0_default_active_minus1 = h->pps->num_ref_idx_l0_default_active - 1;
pp->num_ref_idx_l1_default_active_minus1 = h->pps->num_ref_idx_l1_default_active - 1;
pp->init_qp_minus26 = h->pps->pic_init_qp_minus26;
if (h->sh.short_term_ref_pic_set_sps_flag == 0 && h->sh.short_term_rps) {
pp->ucNumDeltaPocsOfRefRpsIdx = h->sh.short_term_rps->num_delta_pocs;
pp->wNumBitsForShortTermRPSInSlice = h->sh.short_term_ref_pic_set_size;
}
pp->dwCodingParamToolFlags = (h->sps->scaling_list_enable_flag << 0) |
(h->sps->amp_enabled_flag << 1) |
(h->sps->sao_enabled << 2) |
(h->sps->pcm_enabled_flag << 3) |
((h->sps->pcm_enabled_flag ? (h->sps->pcm.bit_depth - 1) : 0) << 4) |
((h->sps->pcm_enabled_flag ? (h->sps->pcm.bit_depth_chroma - 1) : 0) << 8) |
((h->sps->pcm_enabled_flag ? (h->sps->pcm.log2_min_pcm_cb_size - 3) : 0) << 12) |
((h->sps->pcm_enabled_flag ? (h->sps->pcm.log2_max_pcm_cb_size - h->sps->pcm.log2_min_pcm_cb_size) : 0) << 14) |
(h->sps->pcm.loop_filter_disable_flag << 16) |
(h->sps->long_term_ref_pics_present_flag << 17) |
(h->sps->sps_temporal_mvp_enabled_flag << 18) |
(h->sps->sps_strong_intra_smoothing_enable_flag << 19) |
(h->pps->dependent_slice_segments_enabled_flag << 20) |
(h->pps->output_flag_present_flag << 21) |
(h->pps->num_extra_slice_header_bits << 22) |
(h->pps->sign_data_hiding_flag << 25) |
(h->pps->cabac_init_present_flag << 26) |
(0 << 27);
pp->dwCodingSettingPicturePropertyFlags = (h->pps->constrained_intra_pred_flag << 0) |
(h->pps->transform_skip_enabled_flag << 1) |
(h->pps->cu_qp_delta_enabled_flag << 2) |
(h->pps->pic_slice_level_chroma_qp_offsets_present_flag << 3) |
(h->pps->weighted_pred_flag << 4) |
(h->pps->weighted_bipred_flag << 5) |
(h->pps->transquant_bypass_enable_flag << 6) |
(h->pps->tiles_enabled_flag << 7) |
(h->pps->entropy_coding_sync_enabled_flag << 8) |
(h->pps->uniform_spacing_flag << 9) |
((h->pps->tiles_enabled_flag ? h->pps->loop_filter_across_tiles_enabled_flag : 0) << 10) |
(h->pps->seq_loop_filter_across_slices_enabled_flag << 11) |
(h->pps->deblocking_filter_override_enabled_flag << 12) |
(h->pps->disable_dbf << 13) |
(h->pps->lists_modification_present_flag << 14) |
(h->pps->slice_header_extension_present_flag << 15) |
(IS_IRAP(h) << 16) |
(IS_IDR(h) << 17) |
(IS_IRAP(h) << 18) |
(0 << 19);
pp->pps_cb_qp_offset = h->pps->cb_qp_offset;
pp->pps_cr_qp_offset = h->pps->cr_qp_offset;
if (h->pps->tiles_enabled_flag) {
pp->num_tile_columns_minus1 = h->pps->num_tile_columns - 1;
pp->num_tile_rows_minus1 = h->pps->num_tile_rows - 1;
if (!h->pps->uniform_spacing_flag) {
for (i = 0; i < h->pps->num_tile_columns; i++)
pp->column_width_minus1[i] = h->pps->column_width[i] - 1;
for (i = 0; i < h->pps->num_tile_rows; i++)
pp->row_height_minus1[i] = h->pps->row_height[i] - 1;
}
}
pp->diff_cu_qp_delta_depth = h->pps->diff_cu_qp_delta_depth;
pp->pps_beta_offset_div2 = h->pps->beta_offset / 2;
pp->pps_tc_offset_div2 = h->pps->tc_offset / 2;
pp->log2_parallel_merge_level_minus2 = h->pps->log2_parallel_merge_level - 2;
pp->CurrPicOrderCntVal = h->poc;
memset(&pp->RefPicList, 0xff, sizeof(pp->RefPicList));
memset(&pp->RefPicSetStCurrBefore, 0xff, sizeof(pp->RefPicSetStCurrBefore));
memset(&pp->RefPicSetStCurrAfter, 0xff, sizeof(pp->RefPicSetStCurrAfter));
memset(&pp->RefPicSetLtCurr, 0xff, sizeof(pp->RefPicSetLtCurr));
for (i = 0, j = 0; i < FF_ARRAY_ELEMS(h->DPB); i++) {
const HEVCFrame *frame = &h->DPB[i];
if (frame != current_picture && (frame->flags & (HEVC_FRAME_FLAG_LONG_REF | HEVC_FRAME_FLAG_SHORT_REF))) {
fill_picture_entry(&pp->RefPicList[j], ff_dxva2_get_surface_index(avctx, ctx, frame->frame), !!(frame->flags & HEVC_FRAME_FLAG_LONG_REF));
pp->PicOrderCntValList[j] = frame->poc;
j++;
}
}
#define DO_REF_LIST(ref_idx, ref_list) { \
const RefPicList *rpl = &h->rps[ref_idx]; \
av_assert0(rpl->nb_refs <= FF_ARRAY_ELEMS(pp->ref_list)); \
for (j = 0, k = 0; j < rpl->nb_refs; j++) { \
if (rpl->ref[j]) { \
pp->ref_list[k] = get_refpic_index(pp, ff_dxva2_get_surface_index(avctx, ctx, rpl->ref[j]->frame)); \
k++; \
} \
} \
}
DO_REF_LIST(ST_CURR_BEF, RefPicSetStCurrBefore);
DO_REF_LIST(ST_CURR_AFT, RefPicSetStCurrAfter);
DO_REF_LIST(LT_CURR, RefPicSetLtCurr);
pp->StatusReportFeedbackNumber = 1 + DXVA_CONTEXT_REPORT_ID(avctx, ctx)++;
}
| 1threat
|
Python: remove tuple from list similar to tuple in another list : i am new to python and to programming in general. I have a problem with removing tuples from a list that have similarity with tuples from another list.
List1=[(1,2,3,4,5),(1,3,6,7,8)]
`List2=[(1,2,3,7,9),(1,4,8,9,10),(1,3,8,9,10)]`
I want to remove tuples from List2 that have 3 similar element in tuples of List1.
Outputlist=[(1,4,8,9,10)]
What is the most efficient way to do it?
Thanks in advance.
| 0debug
|
How to set up URL of ASP.NET Core Web Application in Visual Studio 2015 : <p>I've create a ASP.NET Core Web Application in Visual Studio 2015 named "HelloASPNETCore", with the default template which has one controller "Home" and several actions "Index", "Contact".....etc; now I want to launch it on IIS Express with the root URL as</p>
<pre><code>http://localhost:29492/HelloASPNETCore
</code></pre>
<p>but the default URL that Visual Studio set up to me is</p>
<pre><code>http://localhost:29492
</code></pre>
<p>In the classic ASP.NET MVC Web Application Project I just specified the Project URL in the Project Properties and it works, but it's not work on the ASP.NET Core Web Application Project. I input the URL <a href="http://localhost:29492/Home/Index" rel="noreferrer">http://localhost:29492/Home/Index</a> on browser and got the correct content respond, but <a href="http://localhost:29492/HelloASPNETCore/Home/Index" rel="noreferrer">http://localhost:29492/HelloASPNETCore/Home/Index</a> gave me the empty content, without any error information.</p>
| 0debug
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.