problem stringlengths 26 131k | labels class label 2 classes |
|---|---|
static av_cold int hevc_decode_free(AVCodecContext *avctx)
{
HEVCContext *s = avctx->priv_data;
HEVCLocalContext *lc = s->HEVClc;
int i;
pic_arrays_free(s);
av_freep(&s->md5_ctx);
for(i=0; i < s->nals_allocated; i++) {
av_freep(&s->skipped_bytes_pos_nal[i]);
}
av_freep(&s->skipped_bytes_pos_size_nal);
av_freep(&s->skipped_bytes_nal);
av_freep(&s->skipped_bytes_pos_nal);
av_freep(&s->cabac_state);
av_frame_free(&s->tmp_frame);
av_frame_free(&s->output_frame);
for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
ff_hevc_unref_frame(s, &s->DPB[i], ~0);
av_frame_free(&s->DPB[i].frame);
}
for (i = 0; i < FF_ARRAY_ELEMS(s->vps_list); i++)
av_buffer_unref(&s->vps_list[i]);
for (i = 0; i < FF_ARRAY_ELEMS(s->sps_list); i++)
av_buffer_unref(&s->sps_list[i]);
for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++)
av_buffer_unref(&s->pps_list[i]);
s->sps = NULL;
s->pps = NULL;
s->vps = NULL;
av_buffer_unref(&s->current_sps);
av_freep(&s->sh.entry_point_offset);
av_freep(&s->sh.offset);
av_freep(&s->sh.size);
for (i = 1; i < s->threads_number; i++) {
lc = s->HEVClcList[i];
if (lc) {
av_freep(&s->HEVClcList[i]);
av_freep(&s->sList[i]);
}
}
if (s->HEVClc == s->HEVClcList[0])
s->HEVClc = NULL;
av_freep(&s->HEVClcList[0]);
for (i = 0; i < s->nals_allocated; i++)
av_freep(&s->nals[i].rbsp_buffer);
av_freep(&s->nals);
s->nals_allocated = 0;
return 0;
}
| 1threat |
Locate text which loads dynamcally python selenium webdriver : My problem is that i am trying to get text of element, which fills up with html content dynamically. Here is html source code. The last div
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<div data-bind="with: dataForRatingPopup"></div>
<!-- end snippet -->
Fills with html code when mouse enter first div.
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
<div class="star-rating-wrap" data-bind="event: { mouseenter: mouseEnter, mouseleave: mouseLeave, click: click }, css: { 'has-supplier': emex.context.userIsInOptovikInterface }">
<div class="star-rating rating-6" data-bind="css: css"></div>
<div data-bind="with: dataForRatingPopup"></div>
</div>
<!-- end snippet -->
How can i get text of this element using selenium webdriver?
| 0debug |
store multiple items in a single table column in sql database : currently i have
public void bindgrid()
{
SqlConnection conn = new SqlConnection("Data Source = 'PAULO'; Initial Catalog=ShoppingCartDB;Integrated Security =True");
SqlCommand cmd = new SqlCommand("select p.[name], cd.CustomerName, cd.CustomerEmailID,cd.CustomerPhoneNo,cd.CustomerAddress,cd.TotalPrice,cd.OrderDateTime, cd.PaymentMethod FROM CustomerDetails cd Inner Join CustomerProducts cp ON cp.CustomerID = cd.Id Inner Join Products p ON cp.ProductID = p.ProductID", conn);
SqlDataAdapter da = new SqlDataAdapter("", conn);
da.SelectCommand = new SqlCommand("select p.[name], cd.CustomerName, cd.CustomerEmailID,cd.CustomerPhoneNo,cd.CustomerAddress,cd.TotalPrice,cd.OrderDateTime, cd.PaymentMethod FROM CustomerDetails cd Inner Join CustomerProducts cp ON cp.CustomerID = cd.Id Inner Join Products p ON cp.ProductID = p.ProductID", conn);
DataSet ds = new DataSet();
da.Fill(ds, "data");
GridView1.DataSource = ds.Tables[0].DefaultView;
GridView1.DataBind();
}
and the [result][1]
what i want to happen is that since it is in the same ID (10), would it be possible if i can have multiple values inside my Name column? like lpg,oxygen,etc?
[1]: http://i.stack.imgur.com/2czOx.jpg | 0debug |
Convert Date string to format yyyy-MM-dd : Hello I was wondering is it possible to transform this Date string:
`Sat Aug 12 2000 00:00:00 GMT+0200 (Midden-Europese zomertijd)`
to the format of:
2000-12-08
I tried the following things:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
var DateInput = "Sat Aug 12 2000 00:00:00 GMT+0200 (Midden-Europese zomertijd)";
var test = new Date(DateInput);
console.log(test);
var convert_date = test.toString().split('-');
console.log(convert_date);
<!-- end snippet -->
But this does not work. Can anyone explain why and help me guiding to the right direction? | 0debug |
static void wmv2_idct_row(short * b)
{
int s1, s2;
int a0, a1, a2, a3, a4, a5, a6, a7;
a1 = W1 * b[1] + W7 * b[7];
a7 = W7 * b[1] - W1 * b[7];
a5 = W5 * b[5] + W3 * b[3];
a3 = W3 * b[5] - W5 * b[3];
a2 = W2 * b[2] + W6 * b[6];
a6 = W6 * b[2] - W2 * b[6];
a0 = W0 * b[0] + W0 * b[4];
a4 = W0 * b[0] - W0 * b[4];
s1 = (181 * (a1 - a5 + a7 - a3) + 128) >> 8;
s2 = (181 * (a1 - a5 - a7 + a3) + 128) >> 8;
b[0] = (a0 + a2 + a1 + a5 + (1 << 7)) >> 8;
b[1] = (a4 + a6 + s1 + (1 << 7)) >> 8;
b[2] = (a4 - a6 + s2 + (1 << 7)) >> 8;
b[3] = (a0 - a2 + a7 + a3 + (1 << 7)) >> 8;
b[4] = (a0 - a2 - a7 - a3 + (1 << 7)) >> 8;
b[5] = (a4 - a6 - s2 + (1 << 7)) >> 8;
b[6] = (a4 + a6 - s1 + (1 << 7)) >> 8;
b[7] = (a0 + a2 - a1 - a5 + (1 << 7)) >> 8;
}
| 1threat |
Why does it display the error: "Resource leak: 'keyboard' is never closed"? : <p>I recently installed Eclipse on a new computer and when I tried to write this code it gave me this error. I swear that I've written this type of </p>
<pre><code>Scanner keyboard = new Scanner(System.in)
</code></pre>
<p>many of times in my old computer and have never gotten this error until now.</p>
<pre><code>import java.util.Scanner;
public class W1M1 {
public static void main(String[] args) {
System.out.println("Hellow World");
Scanner keyboard = new Scanner(System.in); //'keyboard' word shows this error
System.out.println("Please enter your name: ");
String userInput = keyboard.nextLine();
System.out.println("Hello there, " + userInput + ".");
}
}
</code></pre>
| 0debug |
How can I pass a structure pointer to a function properly? : c++ beginner here. So I have several functions in which I am trying to pass an element of array of pointers (which contains structures (records)). I'm having trouble doing this and I'm pretty stuck and frustrated. I'm very new to pointers and memory so go easy on me. I keep getting errors when I try to pass the specific structure element into the function. (BTW: The functions are declared in a header file)
What can I do to fix/change this and make it work? Thank you for the help, it is very much appreciated.
The error I get:
'changeAssignmentGradeForStudent' was not declared in this scope
**Code:**
Structure student:
typedef struct {
char firstName[50];
char lastName[50];
char studentNumber[10];
char NSID[10];
float assignments[10];
float midterm;
float final;
}Student;
void useFunctions(int recordNum) {
// array of 10 student references
Student* students[recordNum];
// values received from the user
for (int i = 0; i < recordNum; i++) {
cout << "Student " << i+1 << ": " << endl;
students[i] = readStudentRecordFromConsole();
}
cout << "Would you like to make any changes to any student records? (N or Y)" << endl;
cin >> answer;
if (answer == 'N') {
return;
} else {
cout << "Which student?" << endl;
cin >> student;
students[student-1] = gradeChanges(*students[student-1], recordNum, student);
}
Student * gradeChanges(Student* s, int recordNum, int student) {
Student *changedStudent = s;
int gradeChange, aNum;
cout << "assignment number to change?" << endl;
cin >> aNum;
cout << "assignment to change?" << endl;
cin >> gradeChange;
changeAssignmentGradeForStudent(changedStudent, aNum, gradeChange); // where the errors are
return changedStudent;
}
void changeAssignmentGradeForStudent(Student* s, int a, int g) {
if (s != NULL) {
s->assignments[a] += g;
}
}
PS: Sorry if my code is not formatted correctly. If it isn't, please edit it for me, thank you. | 0debug |
How do I return multiple strings from a method in C# : <p>If I have something like:</p>
<pre><code> static string characterName()
{
Console.Write("Name your character: ");
string name = Console.ReadLine();
Console.Write("Is this correct? (Y/N): ");
string nameConfirm = Console.ReadLine();
return nameConfirm;
}
</code></pre>
<p>How can I change this so it outputs both nameConfirm and name.
The nameConfirm goes into:</p>
<pre><code> static string stageOne(string nameConfirm)
{
while (nameConfirm != "Y")
nameConfirm = Program.characterName();
if (nameConfirm == "Y")
{
Console.WriteLine("Alright, lets continue.");
nameConfirm = Console.ReadLine();
}
return nameConfirm;
</code></pre>
<p>That works fine but I want to be able to call upon the name later if its needed.</p>
| 0debug |
JavaScript - Cannot Update Array Object Properties Inside Nested For Loops : <p>I have the following nested loops:</p>
<pre><code>for(var i = 0; i < availabilities.length; i++){
if(availabilities[i].round === 1){
// Return the indices of all objects which share the same event_team_user_id property
var indices = helperService.findArrayIndices(availabilities, 'event_team_user_id', availabilities[i].event_team_user_id);
for(var x = 1; x < indices.length; x++){
availabilities[x].status = availabilities[i].status;
console.log(availabilities[x]);
}
}
}
console.log(availabiities);
</code></pre>
<p>The above should find all array objects associated with a particular round (in this case round 1) and then update all other array objects' status property to match the first round's status if those array objects have the same <em>event_team_user_id</em> property. </p>
<p><code>console.log(availabilities[x]);</code> nested within the two loops correctly outputs the array object, but <code>console.log(availabiities);</code> returns an array object where the changes made in the for loops to the <em>status</em> property aren't reflected.</p>
<p>Why are the updated properties in the array objects not being saved?</p>
| 0debug |
void ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src)
{
MpegEncContext bak;
int i;
backup_duplicate_context(&bak, dst);
memcpy(dst, src, sizeof(MpegEncContext));
backup_duplicate_context(dst, &bak);
for (i = 0; i < 12; i++) {
dst->pblocks[i] = &dst->block[i];
}
}
| 1threat |
How to add text to OS written in Assembly : So i started learning assembly and am writing a simple OS with FASM i have a blue screen with a gray top bar and a curser but cant get text to appear on a line. on the top line i want it to say FILE SYSTEM and then on other lines i want stuff. Ill put the code here:
mov ax, 9ch
mov ss, ax
mov sp, 4096d
mov ax, 7c0h
mov ds, ax
;----------------
;this sets blue to background
mov ah, 09h
mov cx, 1000h
mov al, 20h
mov bl, 17h
int 10h
;end of blue
;start of gray top
mov ah, 09h
mov cx, 80d
mov al, 20h
mov bl, 87h
int 10h
;end of gray
;top bar
;end of top bar
;define mouse
mov ah, 01h
mov cx, 07h
int 10h
mov bl, 5h
mov cl, 5h
_mouser:
mov ah, 02h
mov dl, bl
mov dh, cl
int 10h
mov ah, 00h
int 16h
cmp al, 77h
je _up
cmp al, 73h
je _down
cmp al, 61h
je _left
cmp al, 64h
je _right
cmp al, 20h
je _click
jmp _mouser
_click:
mov ah, 0eh
mov al, 0b2h
int 10h
jmp _mouser
_up:
cmp cl, 0h
je _mouser
sub cl, 1h
jmp _mouser
_down:
cmp cl, 24d
je _mouser
add cl, 1h
jmp _mouser
_left:
cmp bl, 0h
je _mouser
sub bl, 1h
jmp _mouser
_right:
cmp bl, 79d
je _mouser
add bl, 1h
jmp _mouser
;----------------
times 510-($-$$) db 0
dw 0xAA55
i have tried
mov ah, eof
mov al, 'F'
int 10h
problem is i cant make a string and i know you cant do it with MOV AH, EOH
| 0debug |
UNIQUE constraint failed: code(1555) : E/SQLiteDatabase: Error inserting Email_ID=1234567 USER_ID=abcd13 Password=a@g.com Mobile=1234567890 Name=asdf
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: User.USER_ID (code 1555)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:780)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1471)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1341)
at edmt.dev.androidgridlayout.DatabaseHelper.saveUserData(DatabaseHelper.java:555)
at edmt.dev.androidgridlayout.Register$1.onClick(Register.java:80)
at android.view.View.performClick(View.java:5207)
at android.view.View$PerformClick.run(View.java:21168)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Application terminated.
| 0debug |
static DeviceClass *qdev_get_device_class(const char **driver, Error **errp)
{
ObjectClass *oc;
DeviceClass *dc;
oc = object_class_by_name(*driver);
if (!oc) {
const char *typename = find_typename_by_alias(*driver);
if (typename) {
*driver = typename;
oc = object_class_by_name(*driver);
}
}
if (!object_class_dynamic_cast(oc, TYPE_DEVICE)) {
error_setg(errp, "'%s' is not a valid device model name", *driver);
return NULL;
}
if (object_class_is_abstract(oc)) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver",
"non-abstract device type");
return NULL;
}
dc = DEVICE_CLASS(oc);
if (dc->cannot_instantiate_with_device_add_yet ||
(qdev_hotplug && !dc->hotpluggable)) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver",
"pluggable device type");
return NULL;
}
return dc;
}
| 1threat |
Why printf() prints such a thing? : <p>I found a problem at internet such that there is a <strong>C</strong> program which like- <br></p>
<pre><code>int main(){
int a = 123;
printf("%d", printf("%d",a));
return 0;
}
</code></pre>
<p>I run this program at <strong>Codeblocks</strong> and find result <strong>1233</strong>.<br>
My question is that why printf() acts like this?</p>
| 0debug |
Database connection not working with mysql_connect : <p>I am managing a website which is built a year or two back. The whole project is based on PHP and <code>mysql</code> is used to connect to the databases. It was performing fine until recently it stopped working. I did some tweaking and found that there is some problem with the database connect file. I replaced the <code>mysql_connect</code> with <code>mysqli_connect</code> and some part of the website started working. Ofcourse, everything will not work since it is built on mysql syntax. Now, it is impossible for me to replace all the codes with mysqli syntax.</p>
<p>So is there a way to get the website working, keeping the mysql_connect in the database connect file. And what might be the reason of this issue?</p>
<p>Any help is appreciated Thanks.</p>
| 0debug |
void helper_sysenter(CPUX86State *env)
{
if (env->sysenter_cs == 0) {
raise_exception_err(env, EXCP0D_GPF, 0);
}
env->eflags &= ~(VM_MASK | IF_MASK | RF_MASK);
cpu_x86_set_cpl(env, 0);
#ifdef TARGET_X86_64
if (env->hflags & HF_LMA_MASK) {
cpu_x86_load_seg_cache(env, R_CS, env->sysenter_cs & 0xfffc,
0, 0xffffffff,
DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
DESC_S_MASK |
DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK |
DESC_L_MASK);
} else
#endif
{
cpu_x86_load_seg_cache(env, R_CS, env->sysenter_cs & 0xfffc,
0, 0xffffffff,
DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
DESC_S_MASK |
DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK);
}
cpu_x86_load_seg_cache(env, R_SS, (env->sysenter_cs + 8) & 0xfffc,
0, 0xffffffff,
DESC_G_MASK | DESC_B_MASK | DESC_P_MASK |
DESC_S_MASK |
DESC_W_MASK | DESC_A_MASK);
env->regs[R_ESP] = env->sysenter_esp;
env->eip = env->sysenter_eip;
}
| 1threat |
How to uninstall bluej? Is netbeans better? : <p>Can i have intalled on my computer both bluej and netbeans? I have bluej now, if i uninstall it , everything related with it will be unistalled to (every libraries). And generally is netbeans better option?</p>
| 0debug |
Add Github remote to GitKraken : <p>I'm using GitKraken (v. 1.4.1) as my Git managing tool. And now I want to use Github as a remote to back up my repos. But when I click on add remote and try to add a Github repo, it just says 'no match'</p>
<p><a href="https://i.stack.imgur.com/rlt7G.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rlt7G.png" alt="Gitkraken w/o Github"></a></p>
<p>Does anybody know why this happens? (BTW: I'm using Windows 10, just in case that's relevant)</p>
| 0debug |
def set_to_tuple(s):
t = tuple(sorted(s))
return (t) | 0debug |
Calling functions using a switch statement isnt working : <p>I am new to writing in c and I am attempting to use switch statement to call function according to an input. Not sure as to why this isn't working. Sorry if this is posted in the wrong place or has already been answered but I couldn't find anything.</p>
<pre><code> int choice;
printf("---Menu---\n");
printf("1 Add Two Vectors\n");
printf("2 Subtract Two Vectors\n");
printf("3 Calculate Euclian Distance\n");
printf("4 Exit The Program\n");
printf(" Please select an option (1, 2, 3, or 4): ");
scanf("&d", &choice);
switch (choice){
case 1:
addVectors();
break;
case 2:
subVectors();
break;
case 3:
euclianDistance();
break;
</code></pre>
<p>/*this is the function being called */</p>
<pre><code>printf("Please input Vector 1 X and Y coordinate separated by a space: ");
scanf("&d", "&d", &coordinateX1, &coordinateY1);
printf("Please input Vector 2 X and Y coordinate separated by a space: ");
scanf("&d", "&d", &coordinateX2, &coordinateY2);
vectorSumX = coordinateX1 + coordinateX2;
vectorSumY = coordinateY1 + coordinateY2;
printf("Sum of vectors is: (", &vectorSumX), printf(",", &vectorSumY), printf(")");
return 0;
</code></pre>
<p>Thank you!</p>
| 0debug |
uint32_t HELPER(mvcp)(CPUS390XState *env, uint64_t l, uint64_t a1, uint64_t a2)
{
HELPER_LOG("%s: %16" PRIx64 " %16" PRIx64 " %16" PRIx64 "\n",
__func__, l, a1, a2);
return mvc_asc(env, l, a1, PSW_ASC_PRIMARY, a2, PSW_ASC_SECONDARY);
}
| 1threat |
static int mmu_translate_region(CPUS390XState *env, target_ulong vaddr,
uint64_t asc, uint64_t entry, int level,
target_ulong *raddr, int *flags, int rw)
{
CPUState *cs = CPU(s390_env_get_cpu(env));
uint64_t origin, offs, new_entry;
const int pchks[4] = {
PGM_SEGMENT_TRANS, PGM_REG_THIRD_TRANS,
PGM_REG_SEC_TRANS, PGM_REG_FIRST_TRANS
};
PTE_DPRINTF("%s: 0x%" PRIx64 "\n", __func__, entry);
origin = entry & _REGION_ENTRY_ORIGIN;
offs = (vaddr >> (17 + 11 * level / 4)) & 0x3ff8;
new_entry = ldq_phys(cs->as, origin + offs);
PTE_DPRINTF("%s: 0x%" PRIx64 " + 0x%" PRIx64 " => 0x%016" PRIx64 "\n",
__func__, origin, offs, new_entry);
if ((new_entry & _REGION_ENTRY_INV) != 0) {
DPRINTF("%s: invalid region\n", __func__);
trigger_page_fault(env, vaddr, PGM_SEGMENT_TRANS, asc, rw);
return -1;
}
if ((new_entry & _REGION_ENTRY_TYPE_MASK) != level) {
trigger_page_fault(env, vaddr, PGM_TRANS_SPEC, asc, rw);
return -1;
}
if (level == _ASCE_TYPE_SEGMENT) {
return mmu_translate_segment(env, vaddr, asc, new_entry, raddr, flags,
rw);
}
offs = (vaddr >> (28 + 11 * (level - 4) / 4)) & 3;
if (offs < ((new_entry & _REGION_ENTRY_TF) >> 6)
|| offs > (new_entry & _REGION_ENTRY_LENGTH)) {
DPRINTF("%s: invalid offset or len (%lx)\n", __func__, new_entry);
trigger_page_fault(env, vaddr, pchks[level / 4 - 1], asc, rw);
return -1;
}
return mmu_translate_region(env, vaddr, asc, new_entry, level - 4,
raddr, flags, rw);
}
| 1threat |
vreader_get_reader_by_id(vreader_id_t id)
{
VReader *reader = NULL;
VReaderListEntry *current_entry = NULL;
if (id == (vreader_id_t) -1) {
return NULL;
}
vreader_list_lock();
for (current_entry = vreader_list_get_first(vreader_list); current_entry;
current_entry = vreader_list_get_next(current_entry)) {
VReader *creader = vreader_list_get_reader(current_entry);
if (creader->id == id) {
reader = creader;
break;
}
vreader_free(creader);
}
vreader_list_unlock();
return reader;
}
| 1threat |
static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
{
AVCodecContext *avctx = s->avctx;
Mpeg1Context *s1 = (Mpeg1Context *) s;
if (s->first_field || s->picture_structure == PICT_FRAME) {
AVFrameSideData *pan_scan;
if (ff_MPV_frame_start(s, avctx) < 0)
return -1;
ff_mpeg_er_frame_start(s);
s->current_picture_ptr->f.repeat_pict = 0;
if (s->repeat_first_field) {
if (s->progressive_sequence) {
if (s->top_field_first)
s->current_picture_ptr->f.repeat_pict = 4;
else
s->current_picture_ptr->f.repeat_pict = 2;
} else if (s->progressive_frame) {
s->current_picture_ptr->f.repeat_pict = 1;
}
}
pan_scan = av_frame_new_side_data(&s->current_picture_ptr->f,
AV_FRAME_DATA_PANSCAN,
sizeof(s1->pan_scan));
if (!pan_scan)
return AVERROR(ENOMEM);
memcpy(pan_scan->data, &s1->pan_scan, sizeof(s1->pan_scan));
if (s1->a53_caption) {
AVFrameSideData *sd = av_frame_new_side_data(
&s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC,
s1->a53_caption_size);
if (sd)
memcpy(sd->data, s1->a53_caption, s1->a53_caption_size);
av_freep(&s1->a53_caption);
}
if (s1->has_stereo3d) {
AVStereo3D *stereo = av_stereo3d_create_side_data(&s->current_picture_ptr->f);
if (!stereo)
return AVERROR(ENOMEM);
*stereo = s1->stereo3d;
s1->has_stereo3d = 0;
}
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME))
ff_thread_finish_setup(avctx);
} else {
int i;
if (!s->current_picture_ptr) {
av_log(s->avctx, AV_LOG_ERROR, "first field missing\n");
return -1;
}
if (s->avctx->hwaccel &&
(s->avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) {
if (s->avctx->hwaccel->end_frame(s->avctx) < 0)
av_log(avctx, AV_LOG_ERROR,
"hardware accelerator failed to decode first field\n");
}
for (i = 0; i < 4; i++) {
s->current_picture.f.data[i] = s->current_picture_ptr->f.data[i];
if (s->picture_structure == PICT_BOTTOM_FIELD)
s->current_picture.f.data[i] +=
s->current_picture_ptr->f.linesize[i];
}
}
if (avctx->hwaccel) {
if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
return -1;
}
#if FF_API_XVMC
FF_DISABLE_DEPRECATION_WARNINGS
if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
if (ff_xvmc_field_start(s, avctx) < 0)
return -1;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
return 0;
}
| 1threat |
pass an array twig to javascript : I have a packages array in my twig file. I want to send this array to javascript but have this error (Array to String Conversion).
This is my code
//packages array from model
{{packages}}
//javascript
const myArray = '{{ packages[0] }}';
console.log(myArray);
| 0debug |
static member inheritance and access through child member in JAVA : i have following case here:
Room{ price;}
|
-----------
/ \
standard suite
now, i want to set price of standard room in such a way that it remains static in all objects of standard and must not affect suite's price and vice versa. i have tried keeping `price` in `Room` class `static` and accessing it via `getter` and `setter` in child classes but it doesn't work. I also am reluctant to make `price` members in each child class because I don't like that solution. Maybe there's another beautiful OOP solution to it.
| 0debug |
In java, is there a way to generate a valid dictionary word of certain length randomly? : <p>I need to generate a valid dictionary word of certain length but in a random fashion. Is there an api or code snippet that does this? I tried googling it but couldn't find anything for this.</p>
<p>Thanks</p>
| 0debug |
SecurityException: Failed to find provider null for user 0; on ActiveAndroid on Android 8.0 : <p>I have an app that is using ActiveAndroid and it's been working fine. However; now when I try to save a model to the database I'm getting a SecurityException. </p>
<p>The stack is:</p>
<pre><code>Error saving model java.lang.SecurityException: Failed to find provider null for user 0; expected to find a valid ContentProvider for this authority
at android.os.Parcel.readException(Parcel.java:1942)
at android.os.Parcel.readException(Parcel.java:1888)
at android.content.IContentService$Stub$Proxy.notifyChange(IContentService.java:801)
at android.content.ContentResolver.notifyChange(ContentResolver.java:2046)
at android.content.ContentResolver.notifyChange(ContentResolver.java:1997)
at android.content.ContentResolver.notifyChange(ContentResolver.java:1967)
at com.activeandroid.Model.save(Model.java:162)
[.... local stack removed]
</code></pre>
<p>Has anyone else experienced this? Do we need to specify the <em>Content Provider</em> in the <em>AndroidManifest.xml</em>? </p>
<p>Sorry but I do not have an isolated example of this yet. I will work to put something together.</p>
<p>Thanks in advance</p>
| 0debug |
How to decide if a template specialization exist : <p>I would like to check if a certain template specialization exist or not, where the general case is not defined.</p>
<p>Given:</p>
<pre><code>template <typename T> struct A; // general definition not defined
template <> struct A<int> {}; // specialization defined for int
</code></pre>
<p>I would like to define a struct like this:</p>
<pre><code>template <typename T>
struct IsDefined
{
static const bool value = ???; // true if A<T> exist, false if it does not
};
</code></pre>
<p>Is there a way to do that (ideally without C++11)?</p>
<p>Thanks</p>
| 0debug |
static int vmdk_add_extent(BlockDriverState *bs,
BlockDriverState *file, bool flat, int64_t sectors,
int64_t l1_offset, int64_t l1_backup_offset,
uint32_t l1_size,
int l2_size, uint64_t cluster_sectors,
VmdkExtent **new_extent,
Error **errp)
{
VmdkExtent *extent;
BDRVVmdkState *s = bs->opaque;
if (cluster_sectors > 0x200000) {
error_setg(errp, "Invalid granularity, image may be corrupt");
return -EFBIG;
}
if (l1_size > 512 * 1024 * 1024) {
error_setg(errp, "L1 size too big");
return -EFBIG;
}
s->extents = g_realloc(s->extents,
(s->num_extents + 1) * sizeof(VmdkExtent));
extent = &s->extents[s->num_extents];
s->num_extents++;
memset(extent, 0, sizeof(VmdkExtent));
extent->file = file;
extent->flat = flat;
extent->sectors = sectors;
extent->l1_table_offset = l1_offset;
extent->l1_backup_table_offset = l1_backup_offset;
extent->l1_size = l1_size;
extent->l1_entry_sectors = l2_size * cluster_sectors;
extent->l2_size = l2_size;
extent->cluster_sectors = flat ? sectors : cluster_sectors;
if (!flat) {
bs->bl.write_zeroes_alignment =
MAX(bs->bl.write_zeroes_alignment, cluster_sectors);
}
if (s->num_extents > 1) {
extent->end_sector = (*(extent - 1)).end_sector + extent->sectors;
} else {
extent->end_sector = extent->sectors;
}
bs->total_sectors = extent->end_sector;
if (new_extent) {
*new_extent = extent;
}
return 0;
}
| 1threat |
How to access non-modified variable : I have a variable that is in a package, where I can neither modify the package or that class and I need to access it is there any way I can do this. I can not modify com.archi.hello or the contents of it
For Example:
com.archi.hello:
class obj:
int j = 123;
com.archi.newpackage:
int jo;
I need to set jo to j without modifying com.archi.hello in any way, and yes i have tried extending the obj. Is there anyway to do this? | 0debug |
Modular Exponentiation (Power in Modular Arithmetic) : <blockquote>
<p>Hello!
<br> I am getting stuck in understanding the concept of modular Exponentiation. When i need this and how this works.
<br> Suppose i am calling the power function as : <strong>power(2,n-1)</strong>.
<br>How the loops will be executed for say <strong>n=10</strong></p>
</blockquote>
<pre><code>#define m 1000000007
unsigned long long int power(unsigned long long int x, unsigned long long int n){
unsigned long long int res = 1;
while(n > 0){
if(n & 1){
res = res * x;
res = res % m;
}
x = x * x;
x= x % m;
n >>= 1;
}
return res;
}
</code></pre>
| 0debug |
How do you update a django template context variable after an AJAX call? : <p>I have a table Product that shows information of a group of products.</p>
<pre><code> <table id="item_table" class="table table-sm table-hover table-bordered">
<thead class="thead-inverse">
<tr>
<th colspan="2">Date</th>
<th colspan="6">Product name</th>
<th colspan="2">Category</th>
<th colspan="2">Amount</th>
</tr>
</thead>
<tbody>
{% for item in product_list %}
<tr>
<td colspan="2">{{ item.date }}</td>
<td id="item_name_format" colspan="6">{{ item.name }}</td>
{% if item.category_id %}
<td id="item_name_format" colspan="2">{{ item.category_id.level1_desc }}</td>
{% endif %}
<td id="item_amt_format" colspan="2">${{ item.amount|intcomma }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</code></pre>
<p>I am using the below Ajax call you update the table.</p>
<pre><code>$(document).ready(function(){
// Submit post on submit
$('.item_num').on('click', function(event){
event.preventDefault();
var item_num = $(this).attr('id');
update_item(item_num);
});
function update_item(item_num) {
console.log(item_num) // sanity check
$.ajax({
type: 'GET',
url:'update_items',
data: { 'item_num': item_num },
success: function(result){
console.log(result);
???$('item_table').product_list = result;???
},
... more code
</code></pre>
<p>How do I update the variable product_list with 'result' from my Ajax call?</p>
<p>This should update the table right?</p>
<p>Thanks</p>
| 0debug |
static uint64_t vtd_get_iotlb_key(uint64_t gfn, uint8_t source_id,
uint32_t level)
{
return gfn | ((uint64_t)(source_id) << VTD_IOTLB_SID_SHIFT) |
((uint64_t)(level) << VTD_IOTLB_LVL_SHIFT);
}
| 1threat |
Format a date in java : <p>I have a date in String format: 2017-05-10.
I need to transform this string in this 10/05/2017. How i can do?
Which library i can use?
I have tried this but not works</p>
<pre><code>DateFormat df = new SimpleDateFormat("dd-MM-yyyy",Locale.ITALIAN);
Calendar cal = Calendar.getInstance();
cal.setTime(df.parse(data));
</code></pre>
| 0debug |
def last(n):
return n[-1]
def sort_list_last(tuples):
return sorted(tuples, key=last) | 0debug |
void memory_region_notify_iommu(MemoryRegion *mr,
IOMMUTLBEntry entry)
{
IOMMUNotifier *iommu_notifier;
IOMMUNotifierFlag request_flags;
assert(memory_region_is_iommu(mr));
if (entry.perm & IOMMU_RW) {
request_flags = IOMMU_NOTIFIER_MAP;
} else {
request_flags = IOMMU_NOTIFIER_UNMAP;
}
IOMMU_NOTIFIER_FOREACH(iommu_notifier, mr) {
if (iommu_notifier->start > entry.iova + entry.addr_mask + 1 ||
iommu_notifier->end < entry.iova) {
continue;
}
if (iommu_notifier->notifier_flags & request_flags) {
iommu_notifier->notify(iommu_notifier, &entry);
}
}
}
| 1threat |
static void set_tco_timeout(const TestData *d, uint16_t ticks)
{
qpci_io_writew(d->dev, d->tco_io_base + TCO_TMR, ticks);
}
| 1threat |
Batch Script: Why Is the first line failing? : I am trying to understand why the first line is failing from a batch script.
if exist reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion" goto OptionOne
exit
:OptionOne
some code
goto:eof
It never goes to OptionOne and just exits. I do have a solution to this problem written differently (so don't provide examples to make it work) but I want to understand why this one liner fails. Improper syntax? But google says its correct. Poorly designed code? I know the regkey exists so thats not it. Is it something with the return value and its correct syntax but needs to be further written out on the else statements? | 0debug |
how to convert ra-dec coordinates to galactic coordinates in python : i was converting a pixel coordinate fits file to world coordinates in python.the header shows that this fits file is in Ra-Dec coordinate system .I want to convert this to galactic coordinates.i tried
from astropy import coordinates as coord
from astropy import units as u
c=coord.icrscoord(ra=wx,dec=wy,unit=(u.degree,u.degree))
c.galactic
AttributeError: 'module' object has no attribute 'icrscoord'
>>>
what shall I do? | 0debug |
Change sheet on multiple Excel documents from "Visible" to "Very Hidden" : <p>I need help modifying one sheet from multiple documents, the sheets the same name in between all the documents, from visible to becoming "Very Hidden". I know how to do this in VBA only for one document at a time but I do not know how to do it to many. </p>
<p>I need to do this over 100 times so it would be great if anyone knew how to code this either using VBa or Python (maybe using "openpyxl" in Python 2?)</p>
<p>Thank you</p>
| 0debug |
static int kvm_get_sregs(CPUState *env)
{
struct kvm_sregs sregs;
uint32_t hflags;
int bit, i, ret;
ret = kvm_vcpu_ioctl(env, KVM_GET_SREGS, &sregs);
if (ret < 0)
return ret;
env->interrupt_injected = -1;
for (i = 0; i < ARRAY_SIZE(sregs.interrupt_bitmap); i++) {
if (sregs.interrupt_bitmap[i]) {
bit = ctz64(sregs.interrupt_bitmap[i]);
env->interrupt_injected = i * 64 + bit;
break;
}
}
get_seg(&env->segs[R_CS], &sregs.cs);
get_seg(&env->segs[R_DS], &sregs.ds);
get_seg(&env->segs[R_ES], &sregs.es);
get_seg(&env->segs[R_FS], &sregs.fs);
get_seg(&env->segs[R_GS], &sregs.gs);
get_seg(&env->segs[R_SS], &sregs.ss);
get_seg(&env->tr, &sregs.tr);
get_seg(&env->ldt, &sregs.ldt);
env->idt.limit = sregs.idt.limit;
env->idt.base = sregs.idt.base;
env->gdt.limit = sregs.gdt.limit;
env->gdt.base = sregs.gdt.base;
env->cr[0] = sregs.cr0;
env->cr[2] = sregs.cr2;
env->cr[3] = sregs.cr3;
env->cr[4] = sregs.cr4;
cpu_set_apic_base(env->apic_state, sregs.apic_base);
env->efer = sregs.efer;
#define HFLAG_COPY_MASK ~( \
HF_CPL_MASK | HF_PE_MASK | HF_MP_MASK | HF_EM_MASK | \
HF_TS_MASK | HF_TF_MASK | HF_VM_MASK | HF_IOPL_MASK | \
HF_OSFXSR_MASK | HF_LMA_MASK | HF_CS32_MASK | \
HF_SS32_MASK | HF_CS64_MASK | HF_ADDSEG_MASK)
hflags = (env->segs[R_CS].flags >> DESC_DPL_SHIFT) & HF_CPL_MASK;
hflags |= (env->cr[0] & CR0_PE_MASK) << (HF_PE_SHIFT - CR0_PE_SHIFT);
hflags |= (env->cr[0] << (HF_MP_SHIFT - CR0_MP_SHIFT)) &
(HF_MP_MASK | HF_EM_MASK | HF_TS_MASK);
hflags |= (env->eflags & (HF_TF_MASK | HF_VM_MASK | HF_IOPL_MASK));
hflags |= (env->cr[4] & CR4_OSFXSR_MASK) <<
(HF_OSFXSR_SHIFT - CR4_OSFXSR_SHIFT);
if (env->efer & MSR_EFER_LMA) {
hflags |= HF_LMA_MASK;
}
if ((hflags & HF_LMA_MASK) && (env->segs[R_CS].flags & DESC_L_MASK)) {
hflags |= HF_CS32_MASK | HF_SS32_MASK | HF_CS64_MASK;
} else {
hflags |= (env->segs[R_CS].flags & DESC_B_MASK) >>
(DESC_B_SHIFT - HF_CS32_SHIFT);
hflags |= (env->segs[R_SS].flags & DESC_B_MASK) >>
(DESC_B_SHIFT - HF_SS32_SHIFT);
if (!(env->cr[0] & CR0_PE_MASK) ||
(env->eflags & VM_MASK) ||
!(hflags & HF_CS32_MASK)) {
hflags |= HF_ADDSEG_MASK;
} else {
hflags |= ((env->segs[R_DS].base |
env->segs[R_ES].base |
env->segs[R_SS].base) != 0) <<
HF_ADDSEG_SHIFT;
}
}
env->hflags = (env->hflags & HFLAG_COPY_MASK) | hflags;
return 0;
}
| 1threat |
Ionic 2 responsive grid : <p>How can I make a responsive grid in Ionic 2? Ionic 1 supported reserved classes like <code>responsive-md</code> or <code>responsive-sm</code> that made grids responsive, but they don't seem to work in Ionic 2.</p>
<p>In my case I have an <code><ion-row></code> with three <code><ion-col></code>. I would like the columns to drop below each other when the display width drops below a threshold. Is it possible to do this with Ionic 2? </p>
| 0debug |
static void s390_init(ram_addr_t my_ram_size,
const char *boot_device,
const char *kernel_filename,
const char *kernel_cmdline,
const char *initrd_filename,
const char *cpu_model)
{
CPUState *env = NULL;
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
ram_addr_t kernel_size = 0;
ram_addr_t initrd_offset;
ram_addr_t initrd_size = 0;
int shift = 0;
uint8_t *storage_keys;
void *virtio_region;
target_phys_addr_t virtio_region_len;
target_phys_addr_t virtio_region_start;
int i;
while ((my_ram_size >> (20 + shift)) > 65535) {
shift++;
}
my_ram_size = my_ram_size >> (20 + shift) << (20 + shift);
ram_size = my_ram_size;
s390_bus = s390_virtio_bus_init(&my_ram_size);
memory_region_init_ram(ram, "s390.ram", my_ram_size);
vmstate_register_ram_global(ram);
memory_region_add_subregion(sysmem, 0, ram);
virtio_region_len = my_ram_size - ram_size;
virtio_region_start = ram_size;
virtio_region = cpu_physical_memory_map(virtio_region_start,
&virtio_region_len, true);
memset(virtio_region, 0, virtio_region_len);
cpu_physical_memory_unmap(virtio_region, virtio_region_len, 1,
virtio_region_len);
storage_keys = g_malloc0(my_ram_size / TARGET_PAGE_SIZE);
if (cpu_model == NULL) {
cpu_model = "host";
}
ipi_states = g_malloc(sizeof(CPUState *) * smp_cpus);
for (i = 0; i < smp_cpus; i++) {
CPUState *tmp_env;
tmp_env = cpu_init(cpu_model);
if (!env) {
env = tmp_env;
}
ipi_states[i] = tmp_env;
tmp_env->halted = 1;
tmp_env->exception_index = EXCP_HLT;
tmp_env->storage_keys = storage_keys;
}
s390_add_running_cpu(env);
if (kernel_filename) {
kernel_size = load_image(kernel_filename, qemu_get_ram_ptr(0));
if (lduw_be_phys(KERN_IMAGE_START) != 0x0dd0) {
fprintf(stderr, "Specified image is not an s390 boot image\n");
exit(1);
}
env->psw.addr = KERN_IMAGE_START;
env->psw.mask = 0x0000000180000000ULL;
} else {
ram_addr_t bios_size = 0;
char *bios_filename;
if (bios_name == NULL) {
bios_name = ZIPL_FILENAME;
}
bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
bios_size = load_image(bios_filename, qemu_get_ram_ptr(ZIPL_LOAD_ADDR));
g_free(bios_filename);
if ((long)bios_size < 0) {
hw_error("could not load bootloader '%s'\n", bios_name);
}
if (bios_size > 4096) {
hw_error("stage1 bootloader is > 4k\n");
}
env->psw.addr = ZIPL_START;
env->psw.mask = 0x0000000180000000ULL;
}
if (initrd_filename) {
initrd_offset = INITRD_START;
while (kernel_size + 0x100000 > initrd_offset) {
initrd_offset += 0x100000;
}
initrd_size = load_image(initrd_filename, qemu_get_ram_ptr(initrd_offset));
stq_be_phys(INITRD_PARM_START, initrd_offset);
stq_be_phys(INITRD_PARM_SIZE, initrd_size);
}
if (kernel_cmdline) {
cpu_physical_memory_write(KERN_PARM_AREA, kernel_cmdline,
strlen(kernel_cmdline) + 1);
}
for(i = 0; i < nb_nics; i++) {
NICInfo *nd = &nd_table[i];
DeviceState *dev;
if (!nd->model) {
nd->model = g_strdup("virtio");
}
if (strcmp(nd->model, "virtio")) {
fprintf(stderr, "S390 only supports VirtIO nics\n");
exit(1);
}
dev = qdev_create((BusState *)s390_bus, "virtio-net-s390");
qdev_set_nic_properties(dev, nd);
qdev_init_nofail(dev);
}
for(i = 0; i < MAX_BLK_DEVS; i++) {
DriveInfo *dinfo;
DeviceState *dev;
dinfo = drive_get(IF_IDE, 0, i);
if (!dinfo) {
continue;
}
dev = qdev_create((BusState *)s390_bus, "virtio-blk-s390");
qdev_prop_set_drive_nofail(dev, "drive", dinfo->bdrv);
qdev_init_nofail(dev);
}
}
| 1threat |
static void vfio_listener_region_del(MemoryListener *listener,
MemoryRegionSection *section)
{
VFIOContainer *container = container_of(listener, VFIOContainer,
iommu_data.listener);
hwaddr iova, end;
int ret;
if (vfio_listener_skipped_section(section)) {
DPRINTF("SKIPPING region_del %"HWADDR_PRIx" - %"PRIx64"\n",
section->offset_within_address_space,
section->offset_within_address_space + section->size - 1);
return;
}
if (unlikely((section->offset_within_address_space & ~TARGET_PAGE_MASK) !=
(section->offset_within_region & ~TARGET_PAGE_MASK))) {
error_report("%s received unaligned region", __func__);
return;
}
iova = TARGET_PAGE_ALIGN(section->offset_within_address_space);
end = (section->offset_within_address_space + int128_get64(section->size)) &
TARGET_PAGE_MASK;
if (iova >= end) {
return;
}
DPRINTF("region_del %"HWADDR_PRIx" - %"HWADDR_PRIx"\n",
iova, end - 1);
ret = vfio_dma_unmap(container, iova, end - iova);
memory_region_unref(section->mr);
if (ret) {
error_report("vfio_dma_unmap(%p, 0x%"HWADDR_PRIx", "
"0x%"HWADDR_PRIx") = %d (%m)",
container, iova, end - iova, ret);
}
}
| 1threat |
iOS app rejected due to copyright issues : <p>an app I have been working on got rejected by Apple,
here is the message I got from Apple when it got rejected:</p>
<p>From Apple
22.2 - Apps that contain false, fraudulent or misleading representations or use names or icons similar to other Apps will be rejected </p>
<p>22.2 Details
Your app or its metadata contains misleading content.</p>
<p>Specifically, the app screenshots and splash screen are from a well known TV show belonging to Keshet without the rights to use it.</p>
<p>We’ve attached screenshot for your reference.</p>
<p>Next Steps</p>
<p>Please remove or revise any misleading content in your app and its metadata.</p>
<p>Since your iTunes Connect Application State is Rejected, a new binary will be required. Make the desired metadata changes when you upload the new binary.</p>
<p>NOTE: Please be sure to make any metadata changes to all App Localizations by selecting each specific localization and making appropriate changes.*</p>
<p>some background,
I did develop this app for Keshet with permission, but I did not include any kind of permission from Keshet when submitting.
Yes, my bad, I just didn't know it was required.</p>
<p>Anyway, my question is,
would replying to Apple through the resolution center and including a document from Keshet's legel dept. be enough to resolve this issue?
or do I need to go through the whole process again, submitting a new binary etc.?
or perhaps something else?</p>
<p>Also, does this kind of rejection means that every other aspect of the game I submitted is okay?
because they only reacted to the rights to use Keshet's properties.</p>
| 0debug |
Error deploying with firebase on npm --prefix $RESOURCE_DIR run lint : <p>I have a fresh install of firebase tools (following this <a href="https://firebase.google.com/docs/functions/get-started" rel="noreferrer">tutorial</a>) and I'm trying to upload my first firebase function. I get this issue with the hello-world example that they initialise when you run firebase init (The only set up the functions CLI feature during the init)</p>
<p>If I replace <code>$RESOURCE_DIR</code> in <code>firebase.json</code> with my functions folder it works, but of course that Is bad practice and I'd like to find a proper <code>$RESOURCE_DIR</code> replacement that works.</p>
<pre><code>PS D:\workspace\firebase-functions> firebase deploy
=== Deploying to 'newagent-5221d'...
i deploying functions
Running command: npm --prefix $RESOURCE_DIR run lint
npm ERR! path D:\workspace\firebase-functions\$RESOURCE_DIR\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'D:\workspace\firebase-functions\$RESOURCE_DIR\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dtlut\AppData\Roaming\npm-cache\_logs\2018-01-19T15_57_22_990Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code4294963238
</code></pre>
| 0debug |
void arm_gen_test_cc(int cc, int label)
{
TCGv_i32 tmp;
int inv;
switch (cc) {
case 0:
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_ZF, 0, label);
break;
case 1:
tcg_gen_brcondi_i32(TCG_COND_NE, cpu_ZF, 0, label);
break;
case 2:
tcg_gen_brcondi_i32(TCG_COND_NE, cpu_CF, 0, label);
break;
case 3:
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_CF, 0, label);
break;
case 4:
tcg_gen_brcondi_i32(TCG_COND_LT, cpu_NF, 0, label);
break;
case 5:
tcg_gen_brcondi_i32(TCG_COND_GE, cpu_NF, 0, label);
break;
case 6:
tcg_gen_brcondi_i32(TCG_COND_LT, cpu_VF, 0, label);
break;
case 7:
tcg_gen_brcondi_i32(TCG_COND_GE, cpu_VF, 0, label);
break;
case 8:
inv = gen_new_label();
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_CF, 0, inv);
tcg_gen_brcondi_i32(TCG_COND_NE, cpu_ZF, 0, label);
gen_set_label(inv);
break;
case 9:
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_CF, 0, label);
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_ZF, 0, label);
break;
case 10:
tmp = tcg_temp_new_i32();
tcg_gen_xor_i32(tmp, cpu_VF, cpu_NF);
tcg_gen_brcondi_i32(TCG_COND_GE, tmp, 0, label);
tcg_temp_free_i32(tmp);
break;
case 11:
tmp = tcg_temp_new_i32();
tcg_gen_xor_i32(tmp, cpu_VF, cpu_NF);
tcg_gen_brcondi_i32(TCG_COND_LT, tmp, 0, label);
tcg_temp_free_i32(tmp);
break;
case 12:
inv = gen_new_label();
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_ZF, 0, inv);
tmp = tcg_temp_new_i32();
tcg_gen_xor_i32(tmp, cpu_VF, cpu_NF);
tcg_gen_brcondi_i32(TCG_COND_GE, tmp, 0, label);
tcg_temp_free_i32(tmp);
gen_set_label(inv);
break;
case 13:
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_ZF, 0, label);
tmp = tcg_temp_new_i32();
tcg_gen_xor_i32(tmp, cpu_VF, cpu_NF);
tcg_gen_brcondi_i32(TCG_COND_LT, tmp, 0, label);
tcg_temp_free_i32(tmp);
break;
default:
fprintf(stderr, "Bad condition code 0x%x\n", cc);
abort();
}
}
| 1threat |
QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fail_if_exists)
{
QemuOpts *opts = NULL;
if (id) {
opts = qemu_opts_find(list, id);
if (opts != NULL) {
if (fail_if_exists) {
fprintf(stderr, "tried to create id \"%s\" twice for \"%s\"\n",
id, list->name);
return NULL;
} else {
return opts;
}
}
}
opts = qemu_mallocz(sizeof(*opts));
if (id) {
opts->id = qemu_strdup(id);
}
opts->list = list;
TAILQ_INIT(&opts->head);
TAILQ_INSERT_TAIL(&list->head, opts, next);
return opts;
}
| 1threat |
Replicating messages from one Kafka topic to another kafka topic : <p>I want to make a flow from a Kafka cluster/topic in thr prod cluster into another Kafka cluster in the dev environment for scalability and regrrssion testing. </p>
<p>For the duck-tape solution, I cascade a Kafka consumer and producer, but my instinct tells me that there should be a better way. But, I couldn't find any good solution yet. Can anyone help me?</p>
| 0debug |
can anybody tell what wrong with mysqli_num_rows function in this code please?? : i think the error is with sql query or just the numrows funtion????
few more things might be wrong because i've made alot of changes and m totally confused now...
can anybody tell what wrong with mysqli_num_rows in this code please?? thanq in advance
<?php
$i=0;
$key=$_GET['abc'];
$ex=explode(" ", $key);
$query="SELECT * FROM search";
/*foreach ($ex as $val)
{
$i++;
if($i == 1)
$query .="keywords like '%$val%' ";
else
$query .="or keywords like '%$val%' ";
}*/
$con=mysqli_connect("localhost","xxxxxxx","xxxxxxx","search");
if (!$con)
die("Connection failed: " . mysqli_connect_error());
else
echo "Connected successfully";
mysqli_select_db($con,"search");
$queryy=mysqli_real_query($con,$query);
$nr =@mysqli_query($con, $queryy);
$row=mysqli_num_rows($nr);
if($row>0)
{
while($r=mysqli_fetch_assoc($queryy))
{
$id=$r['id'];
$title=$r['title'];
$description=$r['description'];
$keywords=$r['keywords'];
$link=$r['link'];
echo "<h2> <a href='$link'>$title</a></h2> $description <br /><br />";
}
}
else
echo "no results found for \"<b>$key</b>\" ";
?> | 0debug |
Windows Ethernet showing "Network cable unplugged" when connected to Linux machine : <p>I currently have a Windows 10 machine connected to a Red Hat Enterprise Linux Workstation 6.10 machine by Cat 5 Ethernet cable. </p>
<p>I plug an Ethernet cable from <code>eth2</code> port on the Linux machine to <code>Ethernet</code> on Windows machine.</p>
<p>I run <code>ifconfig eth2 down</code> on the Linux machine to take down the network connection. The Network Connections window on the Windows Machine show that <code>Ethernet</code> is connected to an Unidentified network. I cannot ping the static ip address for <code>eth2</code> however. </p>
<p>If I run <code>ifconfig eth2 up</code> on the Linux machine to bring up the network connection Windows shows <code>Ethernet</code> as "Network cable unplugged'. When running <code>ifconfig</code> on the Linux machine the following shows:</p>
<pre><code>eth2 Link encap:Ethernet HWaddr __:__:__:__:__:__
inet addr: 192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 frame:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:17
</code></pre>
<p>If I ping <code>192.168.1.11</code> on the Windows machine I get the message <code>Destination Host Unreachable</code>. </p>
<p>What might be causing this?</p>
| 0debug |
Functions in Haskell (specifically swap function) : <p>Alright I know that this question has been asked before, but no answers have compiled. I've researched Haskell function tutorials to no avail. Basically I just want to know how to declare a function in Haskell and how to call it. Most of the tutorials I've found are answering how to do this with ghci, which I understand should be basically the same thing, but I need to write this in a .hs file and compile with ghc for a school assignment. Basically I'd like something like this:</p>
<pre><code>main = do
let list = [1,2,3,4]
-- declare swap
swap (list !! 0) (list !!2)
-- Or
swap 1 2 list
</code></pre>
<p>I'm using ghc version 7.4.1 which I understand isn't the latest version, but it's not a terribly old version either, so it shouldn't make a difference here, should it? Any and all help would be greatly appreciated. Thank you.</p>
| 0debug |
javascript json getting data out, always say: "undefined" : <p>Hey guys I have a javascript file like this:</p>
<pre><code> // An object that holds all images and words.
var items = {
"images": [
{
"imageLink": "elephant.png",
"imageText": "Elephant"
},
{
"imageLink": "rabbit.jpeg",
"imageText": "Rabbit"
},
{
"imageLink": "tiger.jpg",
"imageText": "Tiger"
},
{
"imageLink": "turtle.png",
"imageText": "Turtle"
}
]
};
// Hide the buttons from the screen
var hidebuttons = function() {
document.getElementById("buttonWrapper").classList.add("hide");
};
var replaceTitle = function(title) {
document.getElementById("header").firstElementChild.innerHTML = title;
}
var rotateImage = function() {
console.log(items.images.length);
for (i = 0; i < items.images.length; i++) {
setInterval(function() {
// document.getElementById("imageToRotate").src= "img/" + items.images[i].imageLink;
console.log(items.images);
if (i === items.images.length -1) {
i = 0;
}
}, 1000);
}
}
</code></pre>
<p>and when I I use items.images it returns the follwoing in the console: </p>
<pre><code>Array[4]
0: Object
1: Object
imageLink: "rabbit.jpeg"
imageText: "Rabbit"
__proto__: Object
</code></pre>
<p>but whenerver I use </p>
<pre><code>items.images[i]
items.images.i
</code></pre>
<p>It always returns "undefined". Does anyone have an idea what I'm doing wrong? thanks for the help. Cheers!</p>
| 0debug |
static double compute_target_delay(double delay, VideoState *is)
{
double sync_threshold, diff;
if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) {
diff = get_video_clock(is) - get_master_clock(is);
sync_threshold = FFMAX(AV_SYNC_THRESHOLD, delay);
if (fabs(diff) < AV_NOSYNC_THRESHOLD) {
if (diff <= -sync_threshold)
delay = 0;
else if (diff >= sync_threshold)
delay = 2 * delay;
}
}
av_dlog(NULL, "video: delay=%0.3f A-V=%f\n",
delay, -diff);
return delay;
}
| 1threat |
Error in printing the elements of vector : in the following code, I have a 2D vector,in each index of vector each pair contains int and string. I am trying to access the each element after taking the values in the vector. Suggestions will be very much appreciated.
#include <bits/stdc++.h>
using namespace std;
vector<pair<int,string>> aye[100001];
int main()
{
cin >> n >> m;
for (int i = 1; i <= n; ++i)
{
cin >> x;
cin >> a >> b;
aye[a].push_back(make_pair(-b,x));
cout<<aye[a].first<<aye[a].second;//this is not working
cout<<aye[a][0]<<aye[a][1]<<endl;//this is not working
}
} | 0debug |
Error [ERR_REQUIRE_ESM]: How to use es6 modules in node 12? : <p>From <a href="https://2ality.com/2019/04/nodejs-esm-impl.html" rel="noreferrer">https://2ality.com/2019/04/nodejs-esm-impl.html</a> Node 12 should support es6 modules; however, I just keep getting the error:</p>
<p>Question: How do I make a MVP of using es6 modules in node 12?</p>
<p><strong>package.json</strong></p>
<pre><code>{
"name": "dynamic-es6-mod",
"version": "1.0.0",
"description": "",
"main": "src/index.mjs",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node src/index.mjs"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"globby": "^10.0.1"
}
}
</code></pre>
<pre><code>$ node -v
$ 12.6.0
$ npm run start
internal/modules/cjs/loader.js:821
throw new ERR_REQUIRE_ESM(filename);
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/dev/dynamic-es6-mod/src/index.mjs
at Object.Module._extensions..mjs (internal/modules/cjs/loader.js:821:9)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
at internal/main/run_main_module.js:17:11
</code></pre>
| 0debug |
Chrome: CPU profile parser is fixing n missing samples : <p>I'm using Chrome's performance tab to study the performance of a page, and I occasionally get a warning like:</p>
<blockquote>
<p>DevTools: CPU profile parser is fixing 4 missing samples.</p>
</blockquote>
<p>Does anyone know what this means? Googling for this warning has returned no results so far...</p>
| 0debug |
How to select in css 1st 4th 5th or 2nd 3rd 6th element : <p>How to use css nth child selector properly?</p>
<p>I have 6 divs and i need to select 1st 4th and 5th element, I can get 1st and 4th but cannot get the 5th element.</p>
<p>That's what i tried at the moment:</p>
<pre><code> .partners-logo:nth-child(3n+1) {
background-color: #f7f7f7;
}
</code></pre>
| 0debug |
highchart is posible in android?if yes,can you give me sample like? : highchart is posible in android?if yes,can you give me sample link? | 0debug |
Android App is not Compatible with any of the android supported : I have published an android application made in Android Studio but at the Play Store it is showing that the is incompatible with my device and i have tried it on many different android smartphones with different android versions but it is showing the same message.
but I have declared the minimum SDk 15 and targeted SDK 23 but it is showing the same message even on the targeted SDK.
the link is [The App Link on Play Store][1]
and screenshots are [First Screenshot][2] and [Second Screenshot][3]
and in the Play Store it tells
Supported devices:
817
Unsupported devices:
15314
I have add this code in the manifest
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="false"
android:xlargeScreens="true"
/>
<compatible-screens>
<screen
android:screenDensity="ldpi"
android:screenSize="small" />
<screen
android:screenDensity="mdpi"
android:screenSize="normal" />
<screen
android:screenDensity="xhdpi"
android:screenSize="large" />
<screen
android:screenDensity="xhdpi"
android:screenSize="xlarge" />
</compatible-screens>
[1]: https://play.google.com/store/apps/details?id=com.hackermate.GlobFlexTv.LiveStream
[2]: https://i.stack.imgur.com/Qo5k6.png
[3]: https://i.stack.imgur.com/XNrE4.png | 0debug |
Bind Monit to use Port 443 : <p>I'm using Monit with this config:</p>
<pre><code>set httpd port 2812
allow 0.0.0.0/0.0.0.0
allow md5 /etc/apache2/.htpasswd USERX
ssl enable
pemfile /etc/monit/pemfile-DOMAIN.pem
</code></pre>
<p>I can't change to port to 443 nor 80 but <strong>I just want to use https on 443.</strong>
I'm getting this error if I try: </p>
<pre><code>[CEST Apr 26 23:08:33] error : Cannot listen -- Address already in use
[CEST Apr 26 23:08:33] error : HTTP server: not available -- could not create a server socket at port 443 -- Address already in use
</code></pre>
| 0debug |
Don't get my ToSting to work. name with right score : I dont get way my ToString dosent work? I want it to get the right name white right score.
namespace _501
{
class Program
{
static void Main(string[] args)
{
Console.Title = "###### Nicklas Dart Räknare ######";
Game game = new Game();
game.PlayGame();
}
}
//***************************************************************************
class Game
{
private List<Player> player = new List<Player>();
public void AddPlayer(string name)
{
Player person = new Player(name);
player.Add(person);
}
public void PlayGame()
{
int totalaSumma = 0;
Console.Write("Hur många spelare? ");
int antalSpelare = Convert.ToInt32(Console.ReadLine());
for (int i = 0; i < antalSpelare; i++)
{
Console.Write("Skriv in spelarens namn: ");
string spelaresNamn = Console.ReadLine();
AddPlayer(spelaresNamn);
}
do
{
foreach (Player name in player)
{
int summa = 0;
if (totalaSumma > 500)
{
Endgame();
break;
}
Console.WriteLine(name + " tur att kasta");
Console.WriteLine("Först poängen");
int score1 = Int32.Parse(Console.ReadLine());
totalaSumma = totalaSumma + score1;
if (totalaSumma > 500)
{
Endgame();
break;
}
Console.WriteLine("Andra poängen");
int score2 = Int32.Parse(Console.ReadLine());
totalaSumma = totalaSumma + score2;
if (totalaSumma > 500)
{
Endgame();
break;
}
Console.WriteLine("Tredje poängen");
int score3 = Int32.Parse(Console.ReadLine());
summa = score1 + score2 + score3;
totalaSumma = score3 + totalaSumma;
Console.WriteLine("totala summan av all tre kast blev: " + summa);
Console.WriteLine(name + " totala summan är: " + totalaSumma);
}
} while (totalaSumma < 501);
}
public void Endgame()
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Grattis " + player.ToString() + " Du vann");
for (int i = 0; i < 10; i++)
{
int sec= 300;
Console.BackgroundColor = ConsoleColor.Red;
System.Threading.Thread.Sleep(sec);
Console.BackgroundColor = ConsoleColor.Yellow;
System.Threading.Thread.Sleep(sec);
Console.BackgroundColor = ConsoleColor.Green;
System.Threading.Thread.Sleep(sec);
Console.BackgroundColor = ConsoleColor.White;
System.Threading.Thread.Sleep(sec);
}
System.Threading.Thread.Sleep(300);
}
}
//***************************************************************************
class Player
{
public string Name { get; set; }
public List<Arrows> trow = new List<Arrows>();
public Player(string name = "")
{
Name = name;
}
public override string ToString()
{
return Name;
}
}
//***************************************************************************
class Arrows:Player
{
private int arrowOne;
private int arrowTwo;
private int arrowThree;
public Arrows(int arrowOne = 0, int arrowTwo = 0, int arrowThree = 0)
{
this.arrowOne = arrowOne;
this.arrowTwo = arrowTwo;
this.arrowThree = arrowThree;
}
public int GetScore()
{
return arrowOne + arrowTwo + arrowThree;
}
public override string ToString()
{
return string.Format("Din totala summa är {0}{1}", Name );
}
}
}
/*public int SlumpDator(string ord)
{
Random random = new Random();
int slumptal = random.Next(0 - 60);
System.Threading.Thread.Sleep(100);
}*/
/* if (name == "Dator")
{
Random random = new Random();
int slumptal = random.Next(0 - 60);
System.Threading.Thread.Sleep(100);
}*/ | 0debug |
Best way to transmit data between two applications : <p>What is the best way to transmit data between two (Java) applications running on the same machine? One obvious idea would be to use standard Sockets but this doesn't feel right. </p>
<p>I've heard that most operating systems have a built-in system specifically for this task. How is it called and how does it work? </p>
<p>And is there any other good method to do something like that?</p>
| 0debug |
How to require custom JS files in Rails 6 : <p>I'm currently trying Rails 6.0.0.rc1 which seems to have moved the default <code>javascript</code> folder from <code>app/assets/javascript</code> to <code>app/javascript</code>. The <code>application.js</code> file is now located in <code>app/javascript/packs</code>. Now, I want to add a couple of js files, but for some reason they don't get imported and I can't find any documentation on how this can be done in Rails 6. I tried a couple of things:</p>
<ol>
<li><p>Create a new folder <code>custom_js</code> under <code>app/javascript/packs</code>, putting all my js files there and then add a <code>require "custom_js"</code> to <code>application.js</code>.</p></li>
<li><p>Copy all my js files under <code>app/javascript/channels</code> (which should be included by default, since <code>application.js</code> has <code>require("channels")</code>).</p></li>
<li><p>Adding <code>require_tree .</code> to <code>application.js</code>, which was the previous approach.</p></li>
</ol>
<p>How can I load my own js files inside a Rails 6 application?</p>
| 0debug |
Access of static variables from one class to another in Android : I'm having a hard time trying to understand static variables. Can anybody explain why when I call the variable 'startingDate' in FragmentJoy, it doesn't return the correct value? Assume all the rest of the code is working perfectly, not NULL values and databaseCategories is working fine. How can I save a value inside 'onDataChange()' method and use it in FragmentJoy?
I CANNOT remove:
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {)
This is dashboard activity
public class Dashboard extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
static String startingDate;
DatabaseReference databaseCategories;
ArrayList<Category> currentJoyCategories;
User currentUser; //holds the information of the current user
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dashboard);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
. . . . . .
databaseCategories = FirebaseDatabase.getInstance().getReference("Categories");
currentJoyCategories = new ArrayList<>();
databaseCategories.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
//want to do
startingDate = "some string";
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
} //end of Dashboard class
In Another class I want to do:
public class FragmentJoy extends Fragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_joy,container,false);
//not storing the string "some string"
System.out.println("testing " + Dashboard.startingDate);
} //end of onCreateView method
} //end of class
| 0debug |
What is hamburger menu ? and what is it used for ? : What is `3 line Menu` or `hamburgerMenu`? What is use of it ? Which Purpose we can add it in our application or website ? | 0debug |
Why doesn't std::vector::push_front() exist? : <p>Since <code>std::vector::push_back()</code> exists, why doesn't <code>std::vector::push_front()</code> exist too? </p>
<p>I know there are others storage objects that work pretty much the same way and have an implementation of both <code>push_back()</code> and <code>push_front()</code> functions, but I was curious about the reason why <code>std::vector</code> doesn't.</p>
| 0debug |
NSNotificationCenter Swift 3.0 on keyboard show and hide : <p>I am trying to run a function when the keyboard shows and disappears and have the following code:</p>
<pre><code>let notificationCenter = NotificationCenter.default
notificationCenter.addObserver(self, selector: #selector(ViewController.keyBoardUp(Notification :)), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
</code></pre>
<p>And the function <code>keyBoardUp</code> below:</p>
<pre><code>func keyBoardUp( Notification: NSNotification){
print("HELLO")
}
</code></pre>
<p>However the function doesn't print to the console when the keyboard shows. Help would be greatly appreciated</p>
| 0debug |
how to take hreaf into a variable nd give it to href="$vrable so" : <?php if (!empty($this->highlitsrightside)) { foreach ($this->highlitsrightside as $rightsidehlights){ if (!empty($rightsidehlights['highimage1']) || !empty($rightsidehlights['highimage2']) || !empty($rightsidehlights['highimage3']) || !empty($rightsidehlights['highimage4']) || !empty($rightsidehlights['highimage5'])) { ?>
<?php $hrf1 = "www.google.com"; ?>
<?php } else { $hrf1 = '#';} ?>
<?php if (!empty($rightsidehlights['icontext'])) {?>
<a class="off_clr_text link_chn_lo" href="$hrf1" data-options="" tabindex="0"><i class="<?php echo $rightsidehlights['icontext']; ?>" ></i> <?php echo $rightsidehlights['highlightname']; ?></a>
<?php } else {?>
<a class="off_clr_text link_chn_lo" href="$hrf1" data-options="" tabindex="0"> <img style=" display: inline-block;" src="<?php echo UPLOADS . 'images/highlights_icon/' . $rightsidehlights['highlighticon'] ?>"width="30" height="16" ></span></i> <?php echo $rightsidehlights['highlightname']; ?></a>
<?php } }?>
| 0debug |
Returning a '/n' character in c++ : <p>I am doing a homework assignment for my c++ class, and I can't seem to figure out what I am doing wrong.</p>
<p>Here are the directions:</p>
<p>Exercise: read02</p>
<p>Description</p>
<p>In this exercise, you will create a function to fetch a character from a string, but only if the specified index is in range. If it is out of range, return the newline character.</p>
<p>Function Name</p>
<p>read02</p>
<p>Parameters</p>
<pre><code>str: a std::string
index: a size_t
</code></pre>
<p>Return Value</p>
<p>The char stored at index in str, unless index is out of range, then \n.</p>
<p>Examples</p>
<pre><code>std::string data = "hello";
size_t i = 3;
char x = read02(data, i);
</code></pre>
<p>Hints</p>
<p>String Documentation
Remember to include the header file.
size_t requires the cstdlib header file.
size_t is unsigned (only includes values that are >= 0).
'\n' is the character constant for the newline character.</p>
<p>Here is what I have:</p>
<pre><code>#include <string>
#include <cstdlib>
char read02(std::string str, size_t index){
size_t i;
for( i = 0; i < str.size(); i++){
if(index > 0 && index < str.size()){
return str[index];
}
else{
return '/n';
}
}
return 0;
}
</code></pre>
<p>And here is the error I am getting:</p>
<pre><code>error: multi-character character constant [-Werror=multichar]
return '/n';
</code></pre>
<p>Any explanation as to why I'm getting this error and how to fix it would be greatly appreciated.</p>
<p>Thanks!</p>
| 0debug |
c# only return some fileds in json : I have an API that returns some data of a class in json, Is there any way to return only some specific fields of a c# class in json?
For example:
```
class Person {
public int Id{ get; set; }
public string Name { get; set; }
public string Family { get; set; }
public string Gender { get; set; }
}
Person myPerson = new Person();
var Json = (new
{
Person = myPerson
});
return Request.CreateResponse(HttpStatusCode.OK, Json);
```
It returns ID, Name, Family, Gender. I need to return only Name and Family. I thought may I can create an object and add my specific fields in the class in that object and return object?!
| 0debug |
Is there an iPhone SE simulator for Xcode 11, iOS 13? : <p>I'm running Xcode 11.0 on macOS Mojave (10.14.6) and though the iPhone SE is <a href="https://support.apple.com/en-us/HT210327" rel="noreferrer">officially supported on iOS 13</a>, it doesn't appear in the list of simulators. </p>
<p><a href="https://i.stack.imgur.com/rtlgE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rtlgE.png" alt="enter image description here"></a></p>
<p>It can't be added nor downloaded, as far as I can see. Any ideas? </p>
| 0debug |
searching example for data loss by multiple access via threads (in C) : <p>I am searching an example for data loss by a concurrent access from two or more threads. Have anyone an idea, how I could do that? (in C)</p>
<p>In the second step I want to fix the problem with mutex or smth like that.</p>
<p>But it would help just to have an idea how to do the data loss!</p>
<p>greetings</p>
| 0debug |
def multiply_list(items):
tot = 1
for x in items:
tot *= x
return tot | 0debug |
int av_strerror(int errnum, char *errbuf, size_t errbuf_size)
{
int ret = 0, i;
struct error_entry *entry = NULL;
for (i = 0; i < FF_ARRAY_ELEMS(error_entries); i++) {
if (errnum == error_entries[i].num) {
entry = &error_entries[i];
break;
}
}
if (entry) {
av_strlcpy(errbuf, entry->str, errbuf_size);
} else {
#if HAVE_STRERROR_R
ret = strerror_r(AVUNERROR(errnum), errbuf, errbuf_size);
#else
ret = -1;
#endif
if (ret < 0)
snprintf(errbuf, errbuf_size, "Error number %d occurred", errnum);
}
return ret;
}
| 1threat |
Validations for Textfields in swift with numbers , alphabets , phone number, email : How to validate Textfields with greater than 0 value. i tried all suggestions of stack overflow i failed to validate it. and how to check value of textfield less than or equal to my label value. | 0debug |
Google Play status "Pending publication" for already more than 20 hours? How long does it take in 2019? : <p>I am experiencing some issue with "Pending publication" status for my Android application in Google Play Developer Console.</p>
<p>Currently it is 20 hours and nothing happens.</p>
<p>How long does it really take to publish? (I am from Croatia if that is a case)</p>
<p>1st version enrolled for publish on May, 5th at 18:58 (GMT/UTC+2).
Last version (3rd) enrolled today, May 6th at 03:10 (GMT/UTC+2).</p>
<ul>
<li>AndroidX implemented</li>
<li>Firebase connected</li>
<li>No errors</li>
<li>Graphics added</li>
<li>Content rating added</li>
<li>Price added</li>
</ul>
<p>Everything is setup correctly.</p>
<p>This status "pending" is already for a 19 hours and I have to have it running tomorrow for my presentation.</p>
<p>Why does this application take so long to publihs, while others were published within 3 hours?</p>
<p>Thank you.</p>
| 0debug |
static void lsi_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
k->init = lsi_scsi_init;
k->exit = lsi_scsi_uninit;
k->vendor_id = PCI_VENDOR_ID_LSI_LOGIC;
k->device_id = PCI_DEVICE_ID_LSI_53C895A;
k->class_id = PCI_CLASS_STORAGE_SCSI;
k->subsystem_id = 0x1000;
dc->alias = "lsi";
dc->reset = lsi_scsi_reset;
dc->vmsd = &vmstate_lsi_scsi;
}
| 1threat |
Is it safe to use the "realloc" after the "new" operator in C++? : <p>As far as I know, there is no exact alternative for the <code>realloc</code> of <code>C</code> in <code>C++</code> like the <code>new</code> for <code>malloc</code>. However, when I use the <code>realloc</code> in <code>C++</code> to alter the memory allocated by the <code>new</code> operator, it works fine. </p>
<p>Is it safe to use those two (<code>new</code> and <code>realloc</code>) like I do in the codes below or it can lead to some problems?</p>
<pre><code>#include <iostream>
#include <cstdlib>
int main()
{
int size = 5;
int * arr = new int[size]{ 1,3,5,7,9 };
for (int i = 0; i < size; i++)
std::cout << *(arr + i) << (i < size - 1 ? ' ' : '\n');
size++;
arr = (int*)realloc(arr, size * sizeof(int));
*(arr + size - 1) = 11;
for (int i = 0; i < size; i++)
std::cout << *(arr + i) << (i < size - 1 ? ' ' : '\n');
delete[] arr;
//free(arr);
std::cin.get();
return 0;
}
</code></pre>
<p>Also, which operator should I use in such a case to free the memory: <code>delete[]</code> of <code>free()</code>?</p>
| 0debug |
Searching data from table view issue in swift : I have a search bar above my table view. The data in table view is coming from my service. I'm trying to apply search filter on the table view data. I have tried some code but it isn't working. My code for searchbar is this,
var filteredData = [String]()
var isSearching = false
var dishNameArray = [String]()
searchBar.delegate = self
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == menuTableView{
if isSearching{
return filteredData.count
}
return ResMenuService.instance.categoryModelInstance.count
}
else{
return AllReviewsService.instance.allReviewsModel.count
}
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView == menuTableView{
let cell = menuTableView.dequeueReusableCell(withIdentifier: "menuCell", for: indexPath) as! RestaurantMenuTableViewCell
if isSearching{
cell.dishTitleLbl.text = filteredData[indexPath.row]
dishNameArray.append(cell.dishTitleLbl.text!)
}
// let cell = menuTableView.dequeueReusableCell(withIdentifier: "menuCell", for: indexPath) as! RestaurantMenuTableViewCell
cell.dishTitleLbl.text = ResMenuService.instance.categoryModelInstance[indexPath.row].categoryName
cell.cardView.layer.cornerRadius = 5
cell.selectionStyle = .none
return cell
}
else
{
let cell = reviewTableView.dequeueReusableCell(withIdentifier: "reviewCell", for: indexPath) as! AllReviewsTableViewCell
cell.nameLbl.text = AllReviewsService.instance.allReviewsModel[indexPath.row].name
cell.descriptionLbl.text = AllReviewsService.instance.allReviewsModel[indexPath.row].description
cell.timeLbl.text = AllReviewsService.instance.allReviewsModel[indexPath.row].time
cell.ratingView.rating = Double(AllReviewsService.instance.allReviewsModel[indexPath.row].rating)
cell.backgroundColor = UIColor.clear
cell.selectionStyle = .none
return cell
}
}
This is search bar delegate method.
func updateSearchResults(for searchController: UISearchController) {
filteredData.removeAll(keepingCapacity: false)
let searchPredicate = NSPredicate(format: "SELF CONTAINS[c] %@", searchController.searchBar.text!)
let array = (dishNameArray as NSArray).filtered(using: searchPredicate)
filteredData = array as! [String]
self.menuTableView.reloadData()
}
But when i type something it does not filter the data. | 0debug |
Prevent dismissal of BottomSheetDialogFragment on touch outside : <p>I have implemented a BottomSheet Dialog and I want to prevent the bottomsheet from dismissing when the user touches outside of the bottomsheet when it's peeking (Not fully expanded state).</p>
<p>I have set <code>dialog.setCanceledOnTouchOutside(false);</code> in the code but it doesn't seem to take any affect.</p>
<p>Here's my BottomSheetDialogFragment class:</p>
<pre><code>public class ShoppingCartBottomSheetFragment extends BottomSheetDialogFragment {
private BottomSheetBehavior.BottomSheetCallback mBottomSheetBehaviorCallback = new BottomSheetBehavior.BottomSheetCallback() {
@Override
public void onStateChanged(@NonNull View bottomSheet, int newState) {
if (newState == BottomSheetBehavior.STATE_HIDDEN) {
dismiss();
}
}
@Override
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
}
};
@Override
public void setupDialog(Dialog dialog, int style) {
super.setupDialog(dialog, style);
View contentView = View.inflate(getContext(), R.layout.fragment_shopping_cart_bottom_sheet, null);
dialog.setCanceledOnTouchOutside(false);
dialog.setContentView(contentView);
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
CoordinatorLayout.Behavior behavior = params.getBehavior();
if( behavior != null && behavior instanceof BottomSheetBehavior ) {
((BottomSheetBehavior) behavior).setBottomSheetCallback(mBottomSheetBehaviorCallback);
((BottomSheetBehavior) behavior).setPeekHeight(97);
((BottomSheetBehavior) behavior).setHideable(false);
}
}
@Override
public void onStart() {
super.onStart();
Window window = getDialog().getWindow();
WindowManager.LayoutParams windowParams = window.getAttributes();
windowParams.dimAmount = 0;
windowParams.flags |= WindowManager.LayoutParams.FLAG_DIM_BEHIND;
window.setAttributes(windowParams);
}
}
</code></pre>
<p>According to the BottomSheet <a href="https://material.io/guidelines/components/bottom-sheets.html#bottom-sheets-behavior" rel="noreferrer">specification</a> bottom sheets can be dismissed by touching outside of the bottom sheet, therefore what are my options to override this behavior and prevent it being dismissed?</p>
| 0debug |
uploading an image into a database php : Am trying to insert a data into a database.This is the code that am using. It inserts all the data except the image(Pic) any help?
public function insert($hey){
try {
$hey = $this->db->query("INSERT INTO addmember(Pic,Firstname,Lastname,Age,Gender,Phonenumber,Location,Member,Department) VALUES('".$hey['pic']."','".$hey['fname']."','".$hey['lname']."','".$hey['age']."','".$hey['gender']."','".$hey['phone']."','".$hey['loc']."','".$hey['group']."','".$hey['department']."')");
} catch (PDOException $e) {
echo $e->getMessage();
}
}
| 0debug |
Get the argument names of an R function : <p>For an arbitrary function </p>
<pre><code>f <- function(x, y = 3){
z <- x + y
z^2
}
</code></pre>
<p>I want to be able take the argument names of <code>f</code></p>
<pre><code>> argument_names(f)
[1] "x" "y"
</code></pre>
<p>Is this possible?</p>
| 0debug |
Conda and Visual Studio Code debugging : <p>The goal is to be able to use my environment setup from Conda/Anaconda within the visual studio code debugger. The default pythonpath configuration does not produce this effect - rather it goes to the system default python path (what you get when you type 'python' in a fresh shell).</p>
<p><a href="https://i.stack.imgur.com/GbByq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GbByq.png" alt="enter image description here"></a></p>
<p><strong>How do I configure VS Code to use my Conda environment?</strong></p>
| 0debug |
What does java equals() return : <p>I have this code:</p>
<pre><code>if(!((s.substring(s.length() - 1)).equals(";"))){
s = s + ";";
}
</code></pre>
<p>This code should be checking if the last character of a string is ";" and should add a semicolon to it if it is not the case, only it's doing the exact opposite, it adds a semicolon if the string already ends with one. My code works if I take out the exclamation mark. How is that possible, I read the documentation and .equals() should return true if the two expressions are equal. Am I missing something? Thanks</p>
| 0debug |
codeigniter Data Not inserting : my Controller
<?php
/**
*
*/
class Product extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->helper('url');
$this->load->helper('form');
$this->load->library('form_validation');
//$this->load->library('session');
$config['upload_path'] = './upload/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$this->load->library('upload',$config);
$this->load->model('Pro_model');
}
public function NewProduct(){
$data['categories'] = $this->Pro_model->fetchCat();
$data['upload_error'] = $this->upload->display_errors();
//var_dump($cat_res); exit;
$this->load->view('common/header');
$this->load->view('common/sidebar');
$this->load->view('addnewpro',$data);
$this->load->view('common/footer');
}
public function Pro_insert(){
$this->form_validation->set_rules('proname','Product Name','required');
$this->form_validation->set_rules('prodesc','Product Description','required');
$this->form_validation->set_rules('proprice','Product Price','required');
$this->form_validation->set_rules('procat','Product Category','required');
if ($this->form_validation->run() && $this->upload->do_upload('proimg')) {
$post = $this->input->post();
unset($post['submit']);
//var_dump($post); exit;
$data = $this->upload->data();
$img_path = base_url("upload/".$data['raw_name'].$data['file_ext']);
//var_dump($img_path); exit;
$post['img_path'] = $img_path;
$post_data = $this->Pro_model->insert_product($post);
// var_dump($pro_data); exit;
if ($post_data) {
$this->session->set_flashdata('prosuccess','Product Insert Success');
//redirect('Product/Pro_insert');
$this->NewProduct();
}
else{
$this->NewProduct();
}
}
else{
$this->NewProduct();
}
}
}
my model
<?php
/**
*
*/
class Pro_model extends CI_Model
{
public function insert_product($post){
return $this->db->insert('product',$post);
//echo $this->db->last_query(); exit;
}
public function fetchCat()
{
$res = $this->db->get('category');
//echo $this->db->last_query(); exit;
return $res->result();
}
}
my view
<!-- MAIN CONTENT-->
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<?php
if ($this->session->flashdata('prosuccess')) { ?>
<div class="alert alert-success">
<?php echo $this->session->flashdata('prosuccess'); } ?></div>
<div class="row">
<div class="col-lg-6">
<form action="<?php echo base_url('product/Pro_insert'); ?>" method="post" enctype="multipart/form-data">
<div class="card">
<div class="card-header">
<strong>Add New</strong> Product
</div>
<div class="card-body card-block">
<div class="has-success form-group">
<label for="inputIsValid" class=" form-control-label">Product Name</label>
<input type="text" name="proname" class="is-valid form-control-success form-control">
<div style="color: red"><?php echo form_error('proname'); ?></div>
</div>
<div class="has-warning form-group">
<label for="inputIsInvalid" class=" form-control-label">Product Description</label>
<input type="text" name="prodesc" class="is-invalid form-control">
<div style="color: red"> <?php echo form_error('prodesc'); ?></div>
</div>
<div class="has-warning form-group">
<label for="inputIsInvalid" class=" form-control-label">Product Price</label>
<input type="text" name="proprice" class="is-invalid form-control">
<div style="color: red"> <?php echo form_error('proprice'); ?></div>
</div>
<div class="has-warning form-group">
<label for="inputIsInvalid" class=" form-control-label">Product Category</label>
<select name="procat" class="is-invalid form-control">
<?php
foreach ($categories as $cat) { ?>
<option value="<?php echo $cat->cat_id; ?>"><?php echo $cat->cat_name; ?></option>
<?php } ?>
<div style="color: red"> <?php echo form_error('procat'); ?></div>
</select>
</div>
<div class="has-warning form-group">
<label for="inputIsInvalid" class=" form-control-label">Product Image</label>
<input type="file" name="proimg" class="is-invalid">
<?php if ($upload_error) {
echo $upload_error;
} ?>
</div>
</div>
<div class="card-footer">
<input type="submit" name="submit" class="btn btn-primary btn-sm">
</div>
</div>
</form>
</div>
</div>
my Error is
A Database Error Occurred
Error Number: 1054
Unknown column 'proname' in 'field list'
INSERT INTO `product` (`proname`, `prodesc`, `proprice`, `procat`, `img_path`) VALUES ('sultan', 'ali', '2323', '11', 'http://localhost/shop/Admin/upload/Penguins7.jpg')
Filename: G:/xampp/htdocs/shop/Admin/system/database/DB_driver.php
Line Number: 691
| 0debug |
int hw_device_init_from_string(const char *arg, HWDevice **dev_out)
{
AVDictionary *options = NULL;
char *type_name = NULL, *name = NULL, *device = NULL;
enum AVHWDeviceType type;
HWDevice *dev, *src;
AVBufferRef *device_ref = NULL;
int err;
const char *errmsg, *p, *q;
size_t k;
k = strcspn(arg, ":=@");
p = arg + k;
type_name = av_strndup(arg, k);
if (!type_name) {
err = AVERROR(ENOMEM);
goto fail;
}
type = av_hwdevice_find_type_by_name(type_name);
if (type == AV_HWDEVICE_TYPE_NONE) {
errmsg = "unknown device type";
goto invalid;
}
if (*p == '=') {
k = strcspn(p + 1, ":@");
name = av_strndup(p + 1, k);
if (!name) {
err = AVERROR(ENOMEM);
goto fail;
}
if (hw_device_get_by_name(name)) {
errmsg = "named device already exists";
goto invalid;
}
p += 1 + k;
} else {
size_t index_pos;
int index, index_limit = 1000;
index_pos = strlen(type_name);
name = av_malloc(index_pos + 4);
if (!name) {
err = AVERROR(ENOMEM);
goto fail;
}
for (index = 0; index < index_limit; index++) {
snprintf(name, index_pos + 4, "%s%d", type_name, index);
if (!hw_device_get_by_name(name))
break;
}
if (index >= index_limit) {
errmsg = "too many devices";
goto invalid;
}
}
if (!*p) {
err = av_hwdevice_ctx_create(&device_ref, type,
NULL, NULL, 0);
if (err < 0)
goto fail;
} else if (*p == ':') {
++p;
q = strchr(p, ',');
if (q) {
device = av_strndup(p, q - p);
if (!device) {
err = AVERROR(ENOMEM);
goto fail;
}
err = av_dict_parse_string(&options, q + 1, "=", ",", 0);
if (err < 0) {
errmsg = "failed to parse options";
goto invalid;
}
}
err = av_hwdevice_ctx_create(&device_ref, type,
device ? device : p, options, 0);
if (err < 0)
goto fail;
} else if (*p == '@') {
src = hw_device_get_by_name(p + 1);
if (!src) {
errmsg = "invalid source device name";
goto invalid;
}
err = av_hwdevice_ctx_create_derived(&device_ref, type,
src->device_ref, 0);
if (err < 0)
goto fail;
} else {
errmsg = "parse error";
goto invalid;
}
dev = hw_device_add();
if (!dev) {
err = AVERROR(ENOMEM);
goto fail;
}
dev->name = name;
dev->type = type;
dev->device_ref = device_ref;
if (dev_out)
*dev_out = dev;
name = NULL;
err = 0;
done:
av_freep(&type_name);
av_freep(&name);
av_freep(&device);
av_dict_free(&options);
return err;
invalid:
av_log(NULL, AV_LOG_ERROR,
"Invalid device specification \"%s\": %s\n", arg, errmsg);
err = AVERROR(EINVAL);
goto done;
fail:
av_log(NULL, AV_LOG_ERROR,
"Device creation failed: %d.\n", err);
av_buffer_unref(&device_ref);
goto done;
}
| 1threat |
Angular 5: clicked button that triggers a dialog becomes highlighted after the dialog is closed : <p>I noticed that button gets classes cdk-focused and cdk-program-focused added <em>after</em> the dialog it triggered is closed. If I click anywhere effect disappears.</p>
<p><strong>app.component.html</strong> [fragment]</p>
<pre><code><mat-cell *matCellDef="let element">
<span matTooltip="Delete" matTooltipPosition="right">
<button mat-icon-button color="warn" (click)="openDeleteAssociationDialog()">
<mat-icon>delete</mat-icon>
</button>
</span>
</mat-cell>
</code></pre>
<p><a href="https://i.stack.imgur.com/FA3Fa.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/FA3Fa.gif" alt="Illustration"></a></p>
| 0debug |
static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s)
{
signed char x, y;
CHECK_STREAM_PTR(2);
x = *s->stream_ptr++;
y = *s->stream_ptr++;
debug_interplay (" motion bytes = %d, %d\n", x, y);
return copy_from(s, &s->last_frame, x, y);
}
| 1threat |
PHP: Deleting the "body" of the file even there's a similar file name : <p>I am creating a PHP Program where it will delete the file inside a folder and i am using unlink() but after reading about unlink() it seems like it will not delete the "body" of the file if there is a file with a similar name even it is on a different directory. I need to totally delete the file even if there's a file with a similar name, any suggestions or additional actions i should've done?.</p>
<p>Thank you in advance.</p>
| 0debug |
[HTML][CSS] Images are spilling out of table : I'm having trouble with a homework...I am quite new to HTML/CSS and I can't find a fix to my images spilling out of my table...no matter the sizes of my pictures , they still won't fit in the table cells...
[Table images][1]
[1]: https://i.stack.imgur.com/nDIXT.jpg
| 0debug |
How to delete part of string indicated after a character? : <p>This is what I need.</p>
<p>var str = "This is an |#|example text!"</p>
<p>After deleting:</p>
<p>str = "This is an "</p>
| 0debug |
static int lrc_read_header(AVFormatContext *s)
{
LRCContext *lrc = s->priv_data;
AVBPrint line;
AVStream *st;
st = avformat_new_stream(s, NULL);
if(!st) {
return AVERROR(ENOMEM);
}
avpriv_set_pts_info(st, 64, 1, 1000);
lrc->ts_offset = 0;
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
st->codecpar->codec_id = AV_CODEC_ID_TEXT;
av_bprint_init(&line, 0, AV_BPRINT_SIZE_UNLIMITED);
while(!avio_feof(s->pb)) {
int64_t pos = read_line(&line, s->pb);
int64_t header_offset = find_header(line.str);
if(header_offset >= 0) {
char *comma_offset = strchr(line.str, ':');
if(comma_offset) {
char *right_bracket_offset = strchr(line.str, ']');
if(!right_bracket_offset) {
continue;
}
*right_bracket_offset = *comma_offset = '\0';
if(strcmp(line.str + 1, "offset") ||
sscanf(comma_offset + 1, "%"SCNd64, &lrc->ts_offset) != 1) {
av_dict_set(&s->metadata, line.str + 1, comma_offset + 1, 0);
}
*comma_offset = ':';
*right_bracket_offset = ']';
}
} else {
AVPacket *sub;
int64_t ts_start = AV_NOPTS_VALUE;
int64_t ts_stroffset = 0;
int64_t ts_stroffset_incr = 0;
int64_t ts_strlength = count_ts(line.str);
while((ts_stroffset_incr = read_ts(line.str + ts_stroffset,
&ts_start)) != 0) {
ts_stroffset += ts_stroffset_incr;
sub = ff_subtitles_queue_insert(&lrc->q, line.str + ts_strlength,
line.len - ts_strlength, 0);
if(!sub) {
return AVERROR(ENOMEM);
}
sub->pos = pos;
sub->pts = ts_start - lrc->ts_offset;
sub->duration = -1;
}
}
}
ff_subtitles_queue_finalize(s, &lrc->q);
ff_metadata_conv_ctx(s, NULL, ff_lrc_metadata_conv);
return 0;
} | 1threat |
Using flask inside class : <p>I have application with many threads. One of them is flask, which is used to implement (axillary) API. It used with low load and never exposed to the Internet, so build-in flask web server is perfectly fine.</p>
<p>My current code looks like this:</p>
<pre><code>class API:
# ... all other stuff here, skipped
def run():
app = flask.Flask('API')
@app.route('/cmd1')
def cmd1():
self.cmd1()
@app.route('/cmd2')
def cmd2()
self.cmd2()
app.run()
</code></pre>
<p>I feel I done it wrong, because all docs says 'create flask app at module level'. But I don't want to do this - it mess up with my tests, and API is small part of the larger application, which has own structure and agreements (each 'application' is separate class running in one or more threads).</p>
<p>How can I use Flask inside class?</p>
| 0debug |
Are there any other way to do this? : <p>I have this form where employees can send feedbacks.</p>
<p><a href="https://i.stack.imgur.com/TUe3O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TUe3O.png" alt="enter image description here"></a></p>
<p>I have two tables, employee and tbl_feedback.</p>
<p>The <code>employee_id</code> in my tbl_feedback references <code>id</code> in my employee table.</p>
<p>Now my question is, are there any other way to make it work <strong>without putting Employee ID</strong> on my form?</p>
| 0debug |
static void test_visitor_out_native_list_bool(TestOutputVisitorData *data,
const void *unused)
{
test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_BOOLEAN);
}
| 1threat |
void vm_start(void)
{
if (!vm_running) {
cpu_enable_ticks();
vm_running = 1;
vm_state_notify(1, 0);
qemu_rearm_alarm_timer(alarm_timer);
resume_all_vcpus();
}
}
| 1threat |
Multiple triggers for an Azure Function : <p>We have an Azure Function that has an event hub trigger. Is it possible to have a trigger on more than one event hub for the same Azure Function?</p>
| 0debug |
static int pci_read_devaddr(Monitor *mon, const char *addr,
int *busp, unsigned *slotp)
{
int dom;
if (!strncmp(addr, "pci_addr=", 9)) {
addr += 9;
}
if (pci_parse_devaddr(addr, &dom, busp, slotp, NULL)) {
monitor_printf(mon, "Invalid pci address\n");
return -1;
}
if (dom != 0) {
monitor_printf(mon, "Multiple PCI domains not supported, use device_add\n");
return -1;
}
return 0;
}
| 1threat |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.