问:
Bootstrap submit button cannot post data in my phpmyadmin database and the textbox is messed up
Boostrap submit form button would not connect onto my phpmyadmin database table. What am I missing here? Do I have the wrong pathway? Is my submit button modal incorrect? Please help.

custom.js

kindly check if there are any errors in this part

```<code>// household show table
var table = $('.household-table').DataTable({
processing: true,
dom: 'lrtip',
serverSide: true,
ajax: config.routes.household,
columns: \[{
data: 'checkbox',
name: 'checkbox',
orderable: false,
searchable: false
},{
data: 'action',
name: 'action',
orderable: false,
searchable: false

},{data: 'household_id',name: 'household_id', "visible": false,
},{data: 'household_no',name: 'household_no'
},{data: 'familyhead',name: 'familyhead'
},{data: 'familymember',name: 'familymember'
},{data: 'familyincome',name: 'familyincome'
},{data: 'householdtype',name: 'householdtype'

},
]

});

//Household module CreateHousehold POPUP
$('#createhousehold').click(function() {
$('#submit').val("create-household");

$('#householdform').trigger("reset");
$('#modelHeading').html("Create Household Data");
$('#householdmodal').modal('show');
$('#household_no_err').html("");
$('#familyhead_err').html("");
$('#familymember_err').html("");
$('#familyincome_err').html("");
$('#householdtype').html("");

});

//Household module HouseholdEdit
$('body').on('click', '.editHousehold', function() {

var household_id = $(this).data('id');

$.get(config.routes.household + '/' + household_id + '/edit', function(data) {
    $('#modelHeading').html("Modify Household Data");
    $('#submit').val("Edit Household");
    $('#householdmodal').modal('show');
    $('#household_id').val(data.household_id);
    $('#household_no').val(data.household_no);
    $('#familyhead').val(data.familyhead);
    $('#familymember').val(data.familymember);
    $('#familyincome').val(data.familyincome);
    $('#householdtype').val(data.householdtype);

  //  $('#author').val(data.author);
});

});
//Household module viewmodal
$('body').on('click', '.viewhousehold', function() {
var household_id = $(this).data('id');

$.get(config.routes.household + '/' + household_id + '/edit', function(data) {

    $('#modelHeading').html("View Household Data");
    $('#submit').val("Edit Household");
    $('#householdviewmodal').modal('show');
    $('#household_idv').val(data.household_id);

    $('#household_no').val(data.household_no);
    $('#familyhead').val(data.familyhead);
    $('#familymember').val(data.familymember);
    $('#familyincome').val(data.familyincome);
    $('#householdtype').val(data.householdtype);

});

});

//BUTTOM SUBMIT MODAL
$('#submit').click(function(e) {

e.preventDefault();
$(this).html('Save');
$(this).html('Submit');

$.ajax({
    data: $('#householdform').serialize(),
    url: config.routes.household_store,
    type: "POST",
    dataType: 'json',
    success: function(data) {
        if(data.status == 1){
            $('#householdmodal').modal('hide');
            $('#householdform').trigger("reset");

            table.draw();
            }else{
                printErrorMsg(data.error);

            }
    }/*,
    error: function(data) {
        console.log('Error:', data);

        $('#submit').html('Save Changes');
    }
    */
});

});

//delete table
$('body').on('click', '.deletehousehold', function () {

var household_id = $(this).data("id");

if (confirm("Are You sure want to delete !")) {
    $.ajax({
        type: "DELETE",
        url: config.routes.household_store +'/'+household_id,
        success: function (data) {
            table.draw();
        },
        error: function (data) {
            console.log('Error:', data);
        }
    });
}

});

//Bulk Delete check all
$('#check-all').click(function(){
$('.checkBoxClass').prop('checked', $(this).prop('checked'));
});

// Bulk Delete Current Select
$('#bulkdelete').click(function(e){
e.preventDefault();

var total=0;
$("input:checkbox[name=ids]:checked").each(function(){
    total += 1;
});

if (confirm("Number of Data to Delete: " + total)) {
$("input:checkbox[name=ids]:checked").each(function(){
    var household_id = $(this).data("id");

   $.ajax({
    type: "DELETE",
    url: config.routes.household_store +'/'+household_id,
    success: function (data) {
        table.draw();
    },
    error: function (data) {
        console.log('Error:', data);
    }
});

});

}

});
</code>```

web.php

and this as well since I am not really familiar with the routes of this.

```<code>//Household Module
use App\Http\Controllers\AdminPanel\HouseholdsInfoController;

//Household Module
Route::get('/household', [HouseholdsInfoController::class, 'show']);
Route::resource('household', HouseholdsInfoController::class);
</code>```

HouseholdsInfoController.php

What else am I missing in this part and how will I be able to show the CRUD method?

```<code><?php

namespace App\Http\Controllers\AdminPanel;

use App\Http\Controllers\Controller;
//Models
use App\Models\households_info;
use Illuminate\Http\Request;

//Plugins
use Yajra\DataTables\DataTables;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;

use Carbon\Carbon;
use PDF;
class HouseholdsInfoController extends Controller
{

public function index(Request $request)
{
    if (!session()->has("user")) {
        return redirect("login");
    }

    $household = households_info::latest()->get();
    if ($request->ajax()) {
        $data = households_info::latest()->get();
        return Datatables::of($data)
                ->addIndexColumn()
                ->addColumn('checkbox', function($row){
                    $chk = '
                         <input type="checkbox" class="flat icheckbox_flat-green text-center checkBoxClass" id="checked"  name="ids" data-id="'.$row->household_id.'" name="table_records">';
                    return $chk;
                })
                ->addColumn('action', function($row){
                    $btn = '<a href="javascript:void(0)" data-toggle="tooltip"  data-id="'.$row->household_id.'" data-original-title="Edit" class="edit btn btn-info  btn-xs pr-4 pl-4 editHousehold"><i class="fa fa-pencil fa-lg"></i> </a>';
                    $btn = $btn.' <a href="javascript:void(0)" data-toggle="tooltip"   data-id="'.$row->household_id.'" data-original-title="Delete" class="btn btn-danger btn-xs pr-4 pl-4 deletehousehold"><i class="fa fa-trash fa-lg"></i> </a>';
                    $btn = $btn.' <a href="javascript:void(0)" data-toggle="tooltip"  data-id="'.$row->household_id.'" data-original-title="View" class="btn btn-primary btn-xs pr-4 pl-4 viewhousehold"><i class="fa fa-folder fa-lg"></i> </a>';
                     return $btn;
             })
               ->rawColumns(['checkbox','action'])
                ->make(true);

    }

    return view('pages.AdminPanel.households',[compact('household')]);
}
public function store(Request $request)
{

    $validator = Validator::make($request->all(), [
        'household_no' => 'required',
        'familyhead' => 'required',
        'familymember' => 'required',
        'familyincome'  => 'required',
        'householdtype'  => 'required',

    ]);

    if ($validator->fails()) {
        return response()->json(['status'=>0,'error'=>$validator->errors()]);
    }else{

    households_info::updateOrCreate(['household_id' => $request->household_id],
    ['household_no' => $request->household_no,
    'familyhead' => $request->familyhead,
    'familymember'=> $request->familymember,
    'familyincome'=>$request->familyincome,
    'householdtype'=>$request->householdtype]);

    return response()->json(['status'=>1,'success'=>'Household saved successfully.']);

    }
}
}
</code>```

households.blade.php

And what about this one? The submit button form modal cannot enter into my phpmyadmin database. What is the solution for this?

```<code>@extends('layouts.apps')
@section('content')
<div class="col-sm-12 text-left ">
<h1 class="border-bottom border-bot pt-3">Households Information</h1>
</div>
<div class="Household-Content main-wrapper col-sm-12 text-left h-100  pr-0 pl-0 " >
<div class="col-sm-12 pl-0 pr-0 search-bars" >
  <div class="topnav navbar navbar">
      <div>
     <button id="createhousehold" class="btn btn-success text-white " data-toggle="modal" data-target="#householdmodal">New Household <i class="fa fa-plus"></i></button>
     <button id="bulkdelete" class="btn btn-danger text-white " style="margin-left:2px;" > <i class="fa fa-trash"></i></button>
      </div>

      <div class="modal fade" id="householdmodal" name="householdmodal" tabindex="-1" role="dialog" aria-labelledby="household-modal" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-xl" role="document">
           <div class="modal-content">
              <div class="modal-header">
                 <h5 class="modal-title" id="modelHeading"></h5>
                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 <span aria-hidden="true">×</span>
                 </button>
              </div>

              <div class="modal-body">
                 <form id="householdform"  class="modal-input">
                    {{ csrf_field() }}
                    <input type="hidden" name="household_id" id="household_id">
                    <div class="row">
                        <div class="col-sm-6">

                        <div class="row" style="margin-left: 0px;margin-right: 0px;">
                        <div class="col-sm-6" >
                          <label >Household No.</label>
                          <input type="text" class="form-control" name="household_no" id="household_no" placeholder="Ex: 5" value="" required="">
                          <span id="household_no_err" class="text-danger error-text household_no_err"></span>
                        </div>
                        <div class="col-sm-6 ">
                          <label >Family Head</label>
                          <input type="text" class="form-control" name="familyhead" id="familyhead" placeholder="Ex: John Mark" value="" required="">
                          <span id="familyhead_err" class="text-danger error-text familyhead_err"></span>
                        </div>
                      </div>

                      <div class="row" style="margin-left: 0px;margin-right: 0px;">
                        <div class="col-sm-6" >
                          <label >Family Member</label>
                          <input type="text" class="form-control" name="familymember" id="familymember" placeholder="Ex: Panlilio" value="" required="">
                          <span id="familymember_err" class="text-danger error-text familymember_err"></span>
                        </div>

                    <div class="row" style="margin-left: 0px;margin-right: 0px;">
                       <div class="col-sm-6" >
                         <label >Family Income</label>
                         <input type="text" class="form-control"   name="familyincome" id="familyincome" placeholder="Ex: 123-45-678"  value="" required="">
                         <span id="familyincome_err" class="text-danger error-text familyincome_err"></span>
                       </div>
                       <div class="col-sm-6 ">
                         <label >Household Type</label>
                         <input type="text" class="form-control" name="householdtype" id="householdtype"  placeholder="Ex: 09166041823" value="" required="">
                         <span id="householdtype_err" class="text-danger error-text householdtype_err"></span>
                       </div>
                     </div>
                </div>

            <!----------------
            -->
                </div>
                    <div class="ln_solid"></div>
                    <div class="item form-group">
                       <div class="col-md-12 col-sm-12 offset-md-4">
                          <button type="submit" id="submit" class="btn btn-success household-button">Submit</button>
                          <a class="btn btn-primary" type="button" data-dismiss="modal" style="margin-left: 4px;" >Cancel</a>
                          <input class="btn btn-primary" type="reset" value="Reset">
                       </div>
                    </div>
                 </form>
              </div>
              <div class="modal-footer text-white">
              </div>
           </div>
        </div>
     </div>
     <div class="search-container">
        <input class="global_filter" type="text" id="global_filter" placeholder="Search..." name="search">
        <button type="submit"><i class="fa fa-search"></i></button>
        </form>
     </div>
  </div>
  <div class=" col-sm-12 text-left h-100  pr-0 pl-0 pt-2 pb-2 text-white" >
     <div class="row pl-4 pr-4   ">
        <div class="col-sm-12 border border-bot ">
        </div>
     </div>
     <div class="row pt-4 pl-4 pr-4">
        <div  class=" col-sm-12 overflow-auto display-nones ">
           <table   class=" bulk_action dataTables_info table household-table datatable-element household table-striped jambo_table bulk_action text-center border dataTable no-footer">
              <thead>
                 <tr class="headings">
                    <th >
                        <input class="icheckbox_flat-green" type="checkbox"   id="check-all" >

                      </th>
                    <th class="column-title">Action</th>
                    <th class="column-title">Household_ID</th>
                    <th class="column-title">Household No.</th>
                    <th class="column-title">Family Head </th>

                    <th class="column-title">Family Income</th>

                    <th class="column-title">Household Type</th>

                    </th>
                 </tr>
              </thead>
              </tbody>
           </table>

        </div>
     </div>
  </div>
</div>
</div>

<div class="modal fade" id="householdviewmodal" name="householdviewmodal" tabindex="-1" role="dialog" aria-labelledby="household-modal" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
   <div class="modal-content">
      <div class="modal-header">
         <h5 class="modal-title" id="modelHeading">View Household Data</h5>

         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
         <span aria-hidden="true">×</span>
         </button>
      </div>

      <div class="modal-body">
         <form id="householdviewform"  class="modal-input">
            {{ csrf_field() }}
            <input type="hidden" name="household_idv" id="household_idv">

            <div class="row">
                <div class="col-sm-6">

            <div class="row" style="margin-left: 0px;margin-right: 0px;">
                <div class="col-sm-6" >
                  <label >Household No.</label>
                  <input type="text" class="form-control" readonly id="household_nov" name="household_nov"   readonly>

                </div>
                <div class="col-sm-6 ">
                  <label >Family Head</label>
                  <input  type="text" class="form-control" id="familyheadv" name="familyheadv"  readonly >

                </div>

              </div>

              <div class="row" style="margin-left: 0px;margin-right: 0px;">
                <div class="col-sm-6" >
                  <label >Family Member</label>
                  <input type="text"  readonly class="form-control" name="familymemberv" id="familymemberv" >

                </div>
              </div>

            <div class="row" style="margin-left: 0px;margin-right: 0px;">
               <div class="col-sm-6" >
                 <label >Family Income</label>
                 <input type="text" class="form-control"  readonly name="familyincomev" id="familyincomev" >

               </div>
              </div>

        </div>

             <div class="item form-group">
                <label class="col-form-label col-md-3 col-sm-3 label-align" for="first-name">Household Type
                </label>
                <div class="col-md-12 col-sm-12 ">
                   <input type="text" id="householdtypev" readonly  name="householdtypev" class="form-control ">
                </div>
             </div>

        </div>

@endsection
</code>```

Body:
Boostrap submit form button would not connect onto my phpmyadmin database table. What am I missing here? Do I have the wrong pathway? Is my submit button modal incorrect? Please help.

custom.js

kindly check if there are any errors in this part

// household show table
var table = $('.household-table').DataTable({
processing: true,
dom: 'lrtip',
serverSide: true,
ajax: config.routes.household,
columns: \[{
data: 'checkbox',
name: 'checkbox',
orderable: false,
searchable: false
},{
data: 'action',
name: 'action',
orderable: false,
searchable: false

},{data: 'household_id',name: 'household_id', "visible": false,
},{data: 'household_no',name: 'household_no'
},{data: 'familyhead',name: 'familyhead'
},{data: 'familymember',name: 'familymember'
},{data: 'familyincome',name: 'familyincome'
},{data: 'householdtype',name: 'householdtype'

},
]

});

//Household module CreateHousehold POPUP
$('#createhousehold').click(function() {
$('#submit').val("create-household");

$('#householdform').trigger("reset");
$('#modelHeading').html("Create Household Data");
$('#householdmodal').modal('show');
$('#household_no_err').html("");
$('#familyhead_err').html("");
$('#familymember_err').html("");
$('#familyincome_err').html("");
$('#householdtype').html("");

});

//Household module HouseholdEdit
$('body').on('click', '.editHousehold', function() {

var household_id = $(this).data('id');

$.get(config.routes.household + '/' + household_id + '/edit', function(data) {
    $('#modelHeading').html("Modify Household Data");
    $('#submit').val("Edit Household");
    $('#householdmodal').modal('show');
    $('#household_id').val(data.household_id);
    $('#household_no').val(data.household_no);
    $('#familyhead').val(data.familyhead);
    $('#familymember').val(data.familymember);
    $('#familyincome').val(data.familyincome);
    $('#householdtype').val(data.householdtype);

  //  $('#author').val(data.author);
});

});
//Household module viewmodal
$('body').on('click', '.viewhousehold', function() {
var household_id = $(this).data('id');

$.get(config.routes.household + '/' + household_id + '/edit', function(data) {

    $('#modelHeading').html("View Household Data");
    $('#submit').val("Edit Household");
    $('#householdviewmodal').modal('show');
    $('#household_idv').val(data.household_id);

    $('#household_no').val(data.household_no);
    $('#familyhead').val(data.familyhead);
    $('#familymember').val(data.familymember);
    $('#familyincome').val(data.familyincome);
    $('#householdtype').val(data.householdtype);

});

});

//BUTTOM SUBMIT MODAL
$('#submit').click(function(e) {

e.preventDefault();
$(this).html('Save');
$(this).html('Submit');

$.ajax({
    data: $('#householdform').serialize(),
    url: config.routes.household_store,
    type: "POST",
    dataType: 'json',
    success: function(data) {
        if(data.status == 1){
            $('#householdmodal').modal('hide');
            $('#householdform').trigger("reset");

            table.draw();
            }else{
                printErrorMsg(data.error);

            }
    }/*,
    error: function(data) {
        console.log('Error:', data);

        $('#submit').html('Save Changes');
    }
    */
});

});

//delete table
$('body').on('click', '.deletehousehold', function () {

var household_id = $(this).data("id");

if (confirm("Are You sure want to delete !")) {
    $.ajax({
        type: "DELETE",
        url: config.routes.household_store +'/'+household_id,
        success: function (data) {
            table.draw();
        },
        error: function (data) {
            console.log('Error:', data);
        }
    });
}

});

//Bulk Delete check all
$('#check-all').click(function(){
$('.checkBoxClass').prop('checked', $(this).prop('checked'));
});

// Bulk Delete Current Select
$('#bulkdelete').click(function(e){
e.preventDefault();

var total=0;
$("input:checkbox[name=ids]:checked").each(function(){
    total += 1;
});

if (confirm("Number of Data to Delete: " + total)) {
$("input:checkbox[name=ids]:checked").each(function(){
    var household_id = $(this).data("id");

   $.ajax({
    type: "DELETE",
    url: config.routes.household_store +'/'+household_id,
    success: function (data) {
        table.draw();
    },
    error: function (data) {
        console.log('Error:', data);
    }
});

});

}

});

web.php

and this as well since I am not really familiar with the routes of this.

//Household Module
use App\Http\Controllers\AdminPanel\HouseholdsInfoController;

//Household Module
Route::get('/household', [HouseholdsInfoController::class, 'show']);
Route::resource('household', HouseholdsInfoController::class);

HouseholdsInfoController.php

What else am I missing in this part and how will I be able to show the CRUD method?

<?php

namespace App\Http\Controllers\AdminPanel;

use App\Http\Controllers\Controller;
//Models
use App\Models\households_info;
use Illuminate\Http\Request;

//Plugins
use Yajra\DataTables\DataTables;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;

use Carbon\Carbon;
use PDF;
class HouseholdsInfoController extends Controller
{

public function index(Request $request)
{
    if (!session()->has("user")) {
        return redirect("login");
    }

    $household = households_info::latest()->get();
    if ($request->ajax()) {
        $data = households_info::latest()->get();
        return Datatables::of($data)
                ->addIndexColumn()
                ->addColumn('checkbox', function($row){
                    $chk = '
                         <input type="checkbox" class="flat icheckbox_flat-green text-center checkBoxClass" id="checked"  name="ids" data-id="'.$row->household_id.'" name="table_records">';
                    return $chk;
                })
                ->addColumn('action', function($row){
                    $btn = 'household_id.'" data-original-title="Edit" class="edit btn btn-info  btn-xs pr-4 pl-4 editHousehold"> ';
                    $btn = $btn.' household_id.'" data-original-title="Delete" class="btn btn-danger btn-xs pr-4 pl-4 deletehousehold"> ';
                    $btn = $btn.' household_id.'" data-original-title="View" class="btn btn-primary btn-xs pr-4 pl-4 viewhousehold"> ';
                     return $btn;
             })
               ->rawColumns(['checkbox','action'])
                ->make(true);

    }

    return view('pages.AdminPanel.households',[compact('household')]);
}
public function store(Request $request)
{

    $validator = Validator::make($request->all(), [
        'household_no' => 'required',
        'familyhead' => 'required',
        'familymember' => 'required',
        'familyincome'  => 'required',
        'householdtype'  => 'required',

    ]);

    if ($validator->fails()) {
        return response()->json(['status'=>0,'error'=>$validator->errors()]);
    }else{

    households_info::updateOrCreate(['household_id' => $request->household_id],
    ['household_no' => $request->household_no,
    'familyhead' => $request->familyhead,
    'familymember'=> $request->familymember,
    'familyincome'=>$request->familyincome,
    'householdtype'=>$request->householdtype]);

    return response()->json(['status'=>1,'success'=>'Household saved successfully.']);

    }
}
}

households.blade.php

And what about this one? The submit button form modal cannot enter into my phpmyadmin database. What is the solution for this?

@extends('layouts.apps')
@section('content')

Households Information

     <button id="createhousehold" class="btn btn-success text-white " data-toggle="modal" data-target="#householdmodal">New Household </button>
     <button id="bulkdelete" class="btn btn-danger text-white " style="margin-left:2px;" > </button>

                 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                 ×
                 </button>

                 <form id="householdform"  class="modal-input">
                    {{ csrf_field() }}
                    <input type="hidden" name="household_id" id="household_id">

                          Household No.
                          <input type="text" class="form-control" name="household_no" id="household_no" placeholder="Ex: 5" value="" required="">

                          Family Head
                          <input type="text" class="form-control" name="familyhead" id="familyhead" placeholder="Ex: John Mark" value="" required="">

                          Family Member
                          <input type="text" class="form-control" name="familymember" id="familymember" placeholder="Ex: Panlilio" value="" required="">

                         Family Income
                         <input type="text" class="form-control"   name="familyincome" id="familyincome" placeholder="Ex: 123-45-678"  value="" required="">

                         Household Type
                         <input type="text" class="form-control" name="householdtype" id="householdtype"  placeholder="Ex: 09166041823" value="" required="">

                          <button type="submit" id="submit" class="btn btn-success household-button">Submit</button>
                          Cancel
                          <input class="btn btn-primary" type="reset" value="Reset">

                 </form>

        <input class="global_filter" type="text" id="global_filter" placeholder="Search..." name="search">
        <button type="submit"></button>
        </form>

                        <input class="icheckbox_flat-green" type="checkbox"   id="check-all" >

                    Action
                    Household_ID
                    Household No.
                    Family Head

                    Family Income

                    Household Type

View Household Data

         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
         ×
         </button>

         <form id="householdviewform"  class="modal-input">
            {{ csrf_field() }}
            <input type="hidden" name="household_idv" id="household_idv">

                  Household No.
                  <input type="text" class="form-control" readonly id="household_nov" name="household_nov"   readonly>

                  Family Head
                  <input  type="text" class="form-control" id="familyheadv" name="familyheadv"  readonly >

                  Family Member
                  <input type="text"  readonly class="form-control" name="familymemberv" id="familymemberv" >

                 Family Income
                 <input type="text" class="form-control"  readonly name="familyincomev" id="familyincomev" >

                Household Type

                   <input type="text" id="householdtypev" readonly  name="householdtypev" class="form-control ">

@endsection


来源: stackexchange

问:
unable to show a camera icon on center of the Image when hover using material ui and react
I want to to show a camera icon on center of the Image when hover like below pic,

My output is,

my code is,

```<code>    import Avatar from '@mui/material/Avatar';
    import CameraAltIcon from '@mui/icons-material/CameraAlt';

<Avatar
 className='editProfile'
  alt="Remy Sharp"
   src="/assets/images/avatars/avatar_default.jpg"
   sx={{
   mx: 'auto',
     width: 150,
      height: 150,
       border: '5px solid #f1f1f1',
      boxShadow: '0px 0px 5px -2px',
      alignItems: 'center',
      '&:hover': {
        filter: 'brightness(50%)',
          '& $icon': {
             display: 'block',
             },

              },
             }}
           />
     <CameraAltIcon  className='icon'/>
</code>```

Thanks in advance...

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla auctor, nisi a tristique vestibulum, nisl justo luctus quam, nec scelerisque est nunc ac dui. Cras sed dui ac enim elementum feugiat. Aliquam erat volutpat. Maecenas tempus, ipsum at ullamcorper efficitur, est lacus aliquet massa, non faucibus lacus lectus a est. Proin consequat, orci vel auctor interdum, libero libero ornare libero, a tempus felis diam ac ligula. Aliquam nec tempus nibh. Fusce vehicula est et leo consequat, at elementum lacus suscipit. In hac habitasse platea dictumst. Proin elementum libero auctor, scelerisque lacus non, facilisis eros. Ut vestibulum nibh sit amet lacus rutrum, sit amet euismod massa eleifend. Donec at efficitur metus. Suspendisse ultricies dolor vel lectus cursus, in cursus quam mollis.

ContentLicense: CC BY-SA 4.0

Body:
I want to to show a camera icon on center of the Image when hover like below pic,

My output is,

my code is,

    import Avatar from '@mui/material/Avatar';
    import CameraAltIcon from '@mui/icons-material/CameraAlt';

<Avatar
 className='editProfile'
  alt="Remy Sharp"
   src="/assets/images/avatars/avatar_default.jpg"
   sx={{
   mx: 'auto',
     width: 150,
      height: 150,
       border: '5px solid #f1f1f1',
      boxShadow: '0px 0px 5px -2px',
      alignItems: 'center',
      '&:hover': {
        filter: 'brightness(50%)',
          '& $icon': {
             display: 'block',
             },

              },
             }}
           />
     <CameraAltIcon  className='icon'/>

Thanks in advance...

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla auctor, nisi a tristique vestibulum, nisl justo luctus quam, nec scelerisque est nunc ac dui. Cras sed dui ac enim elementum feugiat. Aliquam erat volutpat. Maecenas tempus, ipsum at ullamcorper efficitur, est lacus aliquet massa, non faucibus lacus lectus a est. Proin consequat, orci vel auctor interdum, libero libero ornare libero, a tempus felis diam ac ligula. Aliquam nec tempus nibh. Fusce vehicula est et leo consequat, at elementum lacus suscipit. In hac habitasse platea dictumst. Proin elementum libero auctor, scelerisque lacus non, facilisis eros. Ut vestibulum nibh sit amet lacus rutrum, sit amet euismod massa eleifend. Donec at efficitur metus. Suspendisse ultricies dolor vel lectus cursus, in cursus quam mollis.


问:
generated Word document by phpdocx library is not compatible with the Google Docs
I am using the phpdocx library to generate word docx from html. when i copy content from generated word document and paste in google docs then i am facing formating issues like heading h1,h2 ect. not working in google docs. heading display like normal text. any one can hep me to solve this?</p>
```<code>$docx = new CreateDocx();
$docx->setDefaultFont('Arial');
$wordStyles = array(
 '<h1>' => 'Heading1PHPDOCX',
 '<h2>' => 'Heading2PHPDOCX',
 '<h3>' => 'Heading3PHPDOCX',
 '<h4>' => 'Heading4PHPDOCX',
 '<h5>' => 'Heading5PHPDOCX',
 '<h6>' => 'Heading6PHPDOCX');
$docx->embedHTML($htmlContent, array('wordStyles' => $wordStyles));
$docx->createDocxAndDownload('/tmp/'.$filename);
</code>```

Body:
I am using the phpdocx library to generate word docx from html. when i copy content from generated word document and paste in google docs then i am facing formating issues like heading h1,h2 ect. not working in google docs. heading display like normal text. any one can hep me to solve this?

$docx = new CreateDocx();
$docx->setDefaultFont('Arial');
$wordStyles = array(
 '
' => 'Heading1PHPDOCX',
 '
' => 'Heading2PHPDOCX',
 '
' => 'Heading3PHPDOCX',
 '
' => 'Heading4PHPDOCX',
 '
' => 'Heading5PHPDOCX',
 '
' => 'Heading6PHPDOCX');
$docx->embedHTML($htmlContent, array('wordStyles' => $wordStyles));
$docx->createDocxAndDownload('/tmp/'.$filename);


问:
If the image F is convoluted with the filter M what is the value of the shaded pixel?
If the image F is convoluted with  the filter M what is the value of the shaded pixel? can someone teach me how to calculate this please. with the steps


问:
Power App Daily Operation - slow performance using power automate
As we read a lot of different types of licenses couldn't understand actual daily limit of license that my company have and do it have difference if of number of daily operation based on license type?

This is license that currently have - can we agree that daily operation is same docs here

It's related in my case especially for Power Automate - because when the system reach daily limit automatically scale to very slow close to zero execution.


问:
Vite and SvelteKit - Using multiple entry html files
I am just starting to get into SvelteKit and have a question regarding development and builds.

I am using the static adapter and I would like to have two entry points for my SvelteKit app.

One being the default index.html (src/app.html) and the other being other.html (other/app.html).

eg.

```<code>build
    ...
    index.html
    other.html
src
    ...
    app.html
other
    ...
    app.html
</code>```

Is there a way using Vite or SvelteKit to have these two separate entries in the one build configuration?

Body:
I am just starting to get into SvelteKit and have a question regarding development and builds.

I am using the static adapter and I would like to have two entry points for my SvelteKit app.

One being the default index.html (src/app.html) and the other being other.html (other/app.html).

eg.

build
    ...
    index.html
    other.html
src
    ...
    app.html
other
    ...
    app.html

Is there a way using Vite or SvelteKit to have these two separate entries in the one build configuration?


问:
SixLabors Image Sharp How to Write text to Image c#
I have searched for a long time. I know it is part of the extended package, but I cannot seem to find any examples. Even a hello world example on how to write text to an Image Sharp image. Thanks for any help.</p>
```<code>  public Image DragImage {
            get{

               SixLabors.ImageSharp.Image<Rgba32> ri = new((int)rect.Width,(int)rect.Height);
                //FieldName on the ri Image just created

                return ri;

            } }
</code>```

Body:
I have searched for a long time. I know it is part of the extended package, but I cannot seem to find any examples. Even a hello world example on how to write text to an Image Sharp image. Thanks for any help.

  public Image DragImage {
            get{

               SixLabors.ImageSharp.Image<Rgba32> ri = new((int)rect.Width,(int)rect.Height);
                //FieldName on the ri Image just created

                return ri;

            } }


问:
Universal Links works don't work correctly on some devices
We have an app where we use Universal Links to fetch a callback from a website that is opened in a SFSafariViewController from out app.
Everything is set up for Universal Links, like the AASA file on the domain, the associated domain in the entitlements, and the UL method in out app delegate.

```<code>application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool
</code>```

The universal links work fine in the simulator. They also work on my own iPhone, both when I run directly from Xcode and when I install from TestFlight. However, it doesn't fork for the other testers on their devices. The SFSafariViewController is redirected to the URL that is supposed to be opened in the app and just shows a blank page. If they open the url in Safari it shows the "Open in 'our app'" button that does work. Also, if they copy the URL to, say, Notes and long press, they also get the "Open in 'our app'" option that works.

Any ideas as to why it doesn't work automatically on their devices (but works on mine)? We are all running iOS 16. I have checked and I don't think I have anything special enabled on my device (like for instance "Associated Domains Development" under Settings).

PS: Universal Links work for the testers in our test environment that uses a different domain and where the app is distributed via App Center. So we can get their devices to open the url automatically, just not in production for some reason.

Body:
We have an app where we use Universal Links to fetch a callback from a website that is opened in a SFSafariViewController from out app.
Everything is set up for Universal Links, like the AASA file on the domain, the associated domain in the entitlements, and the UL method in out app delegate.

application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool

The universal links work fine in the simulator. They also work on my own iPhone, both when I run directly from Xcode and when I install from TestFlight. However, it doesn't fork for the other testers on their devices. The SFSafariViewController is redirected to the URL that is supposed to be opened in the app and just shows a blank page. If they open the url in Safari it shows the "Open in 'our app'" button that does work. Also, if they copy the URL to, say, Notes and long press, they also get the "Open in 'our app'" option that works.

Any ideas as to why it doesn't work automatically on their devices (but works on mine)? We are all running iOS 16. I have checked and I don't think I have anything special enabled on my device (like for instance "Associated Domains Development" under Settings).

PS: Universal Links work for the testers in our test environment that uses a different domain and where the app is distributed via App Center. So we can get their devices to open the url automatically, just not in production for some reason.


问:
Looking for a way to detect database changes using Django Channels
I am looking for a way to detect if there is data insertion happened in my database, i will use this to create a notification badge in real time so that the user wont need to refresh the page to see if there is new notifications. I am planning to use django channels but i cannot see any tutorials that will fit my need.

I've tried to use timer but i don't think it is the best practice for this.


问:
Xcode does not support previews in a macOS Widget extension
Sorry to bother, but I guess there might be something wrong. I added a Widget Extension in Xcode 14.2 to my macOS applicaiton the way the official document told me to. However, I found it in surprise that the function of previews is not supported? Quite confusing. Is there something wrong with this implementation?

Diagnotics:

```<code>UnsupportedMacAppExtensionTypeError: Widget extensions are not supported

Xcode does not support previews in a macOS Widget extension

extension: AppExtension(bundleIdentifier: "com.louisstudio.WidgetHub.ProjectWidget", displayName: "ProjectWidgetExtension", kind: PreviewsPlatforms.AppExtension.Kind.homeScreen, signingInformation: Optional(Code Signing {
  identifier: com.louisstudio.WidgetHub.ProjectWidget
  identity: 04FFDADBA91F279D4A0CC823B283DC1115BF09DB
  hasGetTaskAllow: false
  isSandboxed: true
}))
</code>```

I haven't modified anything yet. Everything is exactly what the template of a Widget Extension is like.

```<code>macOS Version: 12.6.2 (21G320)
Xcode Version: 14.2
</code>```

Hoping to get help. Thanks.

Body:
Sorry to bother, but I guess there might be something wrong. I added a Widget Extension in Xcode 14.2 to my macOS applicaiton the way the official document told me to. However, I found it in surprise that the function of previews is not supported? Quite confusing. Is there something wrong with this implementation?

Diagnotics:

UnsupportedMacAppExtensionTypeError: Widget extensions are not supported

Xcode does not support previews in a macOS Widget extension

extension: AppExtension(bundleIdentifier: "com.louisstudio.WidgetHub.ProjectWidget", displayName: "ProjectWidgetExtension", kind: PreviewsPlatforms.AppExtension.Kind.homeScreen, signingInformation: Optional(Code Signing {
  identifier: com.louisstudio.WidgetHub.ProjectWidget
  identity: 04FFDADBA91F279D4A0CC823B283DC1115BF09DB
  hasGetTaskAllow: false
  isSandboxed: true
}))

I haven't modified anything yet. Everything is exactly what the template of a Widget Extension is like.

macOS Version: 12.6.2 (21G320)
Xcode Version: 14.2

Hoping to get help. Thanks.


问:
The cause of the syntax error di=("First": 3, "Second": 2.1, "Apple": "Orange") ^ SyntaxError: invalid syntax
What is  wrong with the code below

```<code>import pandas as pd
di=("First": 3, "Second": 2.1, "Apple": "Orange")
series_dict=pd.Series(di)
print(series_dict)
print(series_dict['First'])
</code>```

Trying to create series from dictionary,
i'm still learning

Body:
What is  wrong with the code below

import pandas as pd
di=("First": 3, "Second": 2.1, "Apple": "Orange")
series_dict=pd.Series(di)
print(series_dict)
print(series_dict['First'])

Trying to create series from dictionary,
i'm still learning


问:
Question about the child element margin when I assigned a flexbox
It hasn't been long since I started learning this.
Please understand even if the English translation is not smooth.

When I studied 'margin: auto' before, I was curious about the content of 'horizontal alignment is possible, but why not vertical alignment.
I found out that the reason was that when I set the specification, I set it as 'the most basic format to be placed in the middle of the street without the top and bottom margins'.

When I gave 'display: flex' to the parent element and 'margin: auto' to the child element, I saw that it became horizontal and vertical center alignment, not horizontal center alignment as before.

If the parent element is 'display: flex' and the child element is 'margin: auto', does it take precedence to be aligned up, down, left, and right to the parent element, rather than to the existing specification?
I wonder if this is the characteristic of the flexbox.

Thank you.

```<code>    <style>
        .wrap{
            background-color: tan;
            height: 500px;
            display: flex;
        }
        .testArea{
            background-color: seashell;
            width: 300px;
            height: 300px;
            margin: auto;
        }
    </style>
<body>
    <div class="wrap">
        <div class="testArea">
            'margin: auto' test
        </div>
    </div>
</body>
</code>```

Body:
It hasn't been long since I started learning this.
Please understand even if the English translation is not smooth.

When I studied 'margin: auto' before, I was curious about the content of 'horizontal alignment is possible, but why not vertical alignment.
I found out that the reason was that when I set the specification, I set it as 'the most basic format to be placed in the middle of the street without the top and bottom margins'.

When I gave 'display: flex' to the parent element and 'margin: auto' to the child element, I saw that it became horizontal and vertical center alignment, not horizontal center alignment as before.

If the parent element is 'display: flex' and the child element is 'margin: auto', does it take precedence to be aligned up, down, left, and right to the parent element, rather than to the existing specification?
I wonder if this is the characteristic of the flexbox.

Thank you.

            'margin: auto' test


问:
Unity, Facebook SDK, in Android build the app crashes
I am integrating Unity Facebook SDK to a project, right now I am making a log-in system. I have written a script, attached it to an object on a scene, created a button, added the FbLogin method as a listener of OnClick UnityEvent of my button and built an app for Android. Also I have pasted all the needed keys and tokens.

```<code>using System.Collections.Generic;
using UnityEngine;
using Facebook.Unity;

class FacebookLoginSystem
{
    private void Awake()
    {
        FB.Init(SetInit, OnHideUnity);
    }
    void SetInit()
    {
        if (FB.IsLoggedIn)
        {
            Debug.Log("Logged in Successfuly!");
        }
        else
        {
            Debug.Log("FB is not loggid in");
        }
    }
    void OnHideUnity(bool isGameShown)
    {
        if (isGameShown)
        {
            Time.timeScale = 1;
        }
        else
        {
            Time.timeScale = 0;
        }
    }

    public void FbLogin()
    {
        List<string> permessions = new List<string>();
        permessions.Add("public_profile");
        FB.LogInWithReadPermissions(permessions, AuthCallResult);
    }

    private void AuthCallResult(ILoginResult result)
    {
        if (result.Error != null)
        {
            Debug.Log(result.Error);
        }
        else
        {
            if (FB.IsLoggedIn)
            {
                Debug.Log("FB logged in");
                Debug.Log(result.RawResult);
                FB.API("/me?fields=first_name", HttpMethod.GET, callbackData);
            }
            else
            {
                Debug.Log("Login Failed!");
            }
        }
    }
}
</code>```

But when I press the button in my build, I get this. ("Something went wrong, we are working on it...")
Tell me, please, why does it happen?
This happens when I press the button

UPD:
I have replaced the methods FbLogin and AuthCallback with these versions. Also I added a serialized field TextForLogging to see my logs in Build, and it tells me that "User cancelled login".

```<code>    public void FbLogin()
    {
        var perms = new List<string>() { "public_profile", "email" };
        FB.LogInWithReadPermissions(perms, AuthCallback);
    }

    private void AuthCallback(ILoginResult result)
    {
        if (FB.IsLoggedIn)
        {
            // AccessToken class will have session details
            var aToken = Facebook.Unity.AccessToken.CurrentAccessToken;
            // Print current access token's User ID
            Debug.Log(aToken.UserId);
            TextForLogging.text += $"\n{aToken.UserId}";
            // Print current access token's granted permissions
            foreach (string perm in aToken.Permissions)
            {
                Debug.Log(perm);
                TextForLogging.text += $"\n{perm}";
            }
            FB.API("/me?fields=first_name", HttpMethod.GET, callbackData);
        }
        else
        {
            Debug.Log("User cancelled login");
            TextForLogging.text += "\nUser cancelled login";
        }
    }
</code>```

Body:
I am integrating Unity Facebook SDK to a project, right now I am making a log-in system. I have written a script, attached it to an object on a scene, created a button, added the FbLogin method as a listener of OnClick UnityEvent of my button and built an app for Android. Also I have pasted all the needed keys and tokens.

using System.Collections.Generic;
using UnityEngine;
using Facebook.Unity;

class FacebookLoginSystem
{
    private void Awake()
    {
        FB.Init(SetInit, OnHideUnity);
    }
    void SetInit()
    {
        if (FB.IsLoggedIn)
        {
            Debug.Log("Logged in Successfuly!");
        }
        else
        {
            Debug.Log("FB is not loggid in");
        }
    }
    void OnHideUnity(bool isGameShown)
    {
        if (isGameShown)
        {
            Time.timeScale = 1;
        }
        else
        {
            Time.timeScale = 0;
        }
    }

    public void FbLogin()
    {
        List<string> permessions = new List<string>();
        permessions.Add("public_profile");
        FB.LogInWithReadPermissions(permessions, AuthCallResult);
    }

    private void AuthCallResult(ILoginResult result)
    {
        if (result.Error != null)
        {
            Debug.Log(result.Error);
        }
        else
        {
            if (FB.IsLoggedIn)
            {
                Debug.Log("FB logged in");
                Debug.Log(result.RawResult);
                FB.API("/me?fields=first_name", HttpMethod.GET, callbackData);
            }
            else
            {
                Debug.Log("Login Failed!");
            }
        }
    }
}

But when I press the button in my build, I get this. ("Something went wrong, we are working on it...")
Tell me, please, why does it happen?
This happens when I press the button

UPD:
I have replaced the methods FbLogin and AuthCallback with these versions. Also I added a serialized field TextForLogging to see my logs in Build, and it tells me that "User cancelled login".

    public void FbLogin()
    {
        var perms = new List<string>() { "public_profile", "email" };
        FB.LogInWithReadPermissions(perms, AuthCallback);
    }

    private void AuthCallback(ILoginResult result)
    {
        if (FB.IsLoggedIn)
        {
            // AccessToken class will have session details
            var aToken = Facebook.Unity.AccessToken.CurrentAccessToken;
            // Print current access token's User ID
            Debug.Log(aToken.UserId);
            TextForLogging.text += $"\n{aToken.UserId}";
            // Print current access token's granted permissions
            foreach (string perm in aToken.Permissions)
            {
                Debug.Log(perm);
                TextForLogging.text += $"\n{perm}";
            }
            FB.API("/me?fields=first_name", HttpMethod.GET, callbackData);
        }
        else
        {
            Debug.Log("User cancelled login");
            TextForLogging.text += "\nUser cancelled login";
        }
    }


问:
How do I open up multple pdf files in Android app
In my app I plan to have a at least 40 different pdf files that come out to about 4gb obviously that's way to much to jave inside an app with out a live data storage so my question is. Is it possible to have the files apart of the app and when the users download the app it goes in there phones or devices internal storage for location to where in side the app the people will click a button and it can open up the pdf file inside the app without it being slow or needed a data connection. Also I'm building this in android studio using kotlin.</p>


问:
Use PHP to send a post request with image to flask, print request.files get ImmutableMultiDict([])
I try to use PHP to send an image to flask, and process it.
The docker is tiangolo/uwsgi-nginx-flask
the PHP code is below

```<code>$image = curl_file_create('16662723435304.jpg');
$data = array('image' => $image,'token' =>'12345');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://45.**.**0.194:56730/api/image");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
$output = curl_exec($ch);
curl_close($ch);
</code>```

python code

```<code>from flask import Flask, request
@app.route('/api/image', methods=['POST'])
def image():
    print(request.data)
    print(request.form)
    print(request.files)
</code>```

when the image sends to the cloud server, it prints:

b''

ImmutableMultiDict([])

ImmutableMultiDict([])

But when I try it in localhost, the result is:

b''

ImmutableMultiDict([('token', '12345')])

ImmutableMultiDict([('image', <FileStorage: '16662723435304.jpg' ('application/octet-stream')>)])

If I change
$data = array('image' => $image,'token' =>'12345');
to
$data = array('image' => 'image_string','token' =>'12345');
then the cloud can return correctly.

b''
ImmutableMultiDict

([('image', 'image_string'), ('token', '12345')])
ImmutableMultiDict([])

I have try to edit nginx.conf user to root, and also add

client_body_buffer_size 10M;
client_max_body_size 10M;

What I can do to make flask can receive the image file in cloud.

Body:
I try to use PHP to send an image to flask, and process it.
The docker is tiangolo/uwsgi-nginx-flask
the PHP code is below

$image = curl_file_create('16662723435304.jpg');
$data = array('image' => $image,'token' =>'12345');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://45.**.**0.194:56730/api/image");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
$output = curl_exec($ch);
curl_close($ch);

python code

from flask import Flask, request
@app.route('/api/image', methods=['POST'])
def image():
    print(request.data)
    print(request.form)
    print(request.files)

when the image sends to the cloud server, it prints:

b''

ImmutableMultiDict([])

ImmutableMultiDict([])

But when I try it in localhost, the result is:

b''

ImmutableMultiDict([('token', '12345')])

ImmutableMultiDict([('image', <FileStorage: '16662723435304.jpg' ('application/octet-stream')>)])

If I change
$data = array('image' => $image,'token' =>'12345');
to
$data = array('image' => 'image_string','token' =>'12345');
then the cloud can return correctly.

b''
ImmutableMultiDict

([('image', 'image_string'), ('token', '12345')])
ImmutableMultiDict([])

I have try to edit nginx.conf user to root, and also add

client_body_buffer_size 10M;
client_max_body_size 10M;

What I can do to make flask can receive the image file in cloud.


问:
How to upload file from Laravel Public directory to google drive in
When I upload it in HTML form it works fine. but when I want to upload files from the Laravel public directory it's not working.
My code in Controller:</p>
```<code>function createFile($file, $parent_id = null)
    {

        $file = FileStorage::find($file)->first()->UniqueFileName;
        $name = gettype($file) === 'object' ? $file->getClientOriginalName() : $file;
        $fileMetadata = new \Google_Service_Drive_DriveFile([
            'name' => $name,
            'parent' => $parent_id ? $parent_id : 'root'
        ]);
        $content = gettype($file) === 'object' ?  File::get($file) : Storage::get($file);
        $mimeType = gettype($file) === 'object' ? File::mimeType($file) : Storage::mimeType($file);
        $file = $this->drive->files->create($fileMetadata, [
            'data' => $content,
            'mimeType' => $mimeType,
            'uploadType' => 'multipart',
            'fields' => 'id'
        ]);
        dd($file->id);
    }
</code>```

Body:
When I upload it in HTML form it works fine. but when I want to upload files from the Laravel public directory it's not working.
My code in Controller:

function createFile($file, $parent_id = null)
    {

        $file = FileStorage::find($file)->first()->UniqueFileName;
        $name = gettype($file) === 'object' ? $file->getClientOriginalName() : $file;
        $fileMetadata = new \Google_Service_Drive_DriveFile([
            'name' => $name,
            'parent' => $parent_id ? $parent_id : 'root'
        ]);
        $content = gettype($file) === 'object' ?  File::get($file) : Storage::get($file);
        $mimeType = gettype($file) === 'object' ? File::mimeType($file) : Storage::mimeType($file);
        $file = $this->drive->files->create($fileMetadata, [
            'data' => $content,
            'mimeType' => $mimeType,
            'uploadType' => 'multipart',
            'fields' => 'id'
        ]);
        dd($file->id);
    }


问:
Cross Browser Cookie Expiration Inconsistencies
I'm looking for a way to set cookies with a short duration against all browsers. Apparently each browser handles the PHP setcookie method differently. Below are my results.

The PHP code:

```<code>setcookie("TestCookie", $value, time()+7200, "/", ".domain.com", 1, true);
</code>```

The Results:

OPERA 11.10

```<code>Local time of test: 1316621628
PHP Server Time: Wed Sep 21 07:58:35 PDT 2011
Cookie Expiration Time: 2011-09-21 - 20:58:35
</code>```

Chrome 6.0.472.63

```<code>Local time of test - 1316621761
PHP Server Time - Wed Sep 21 08:01:21 PDT 2011
Cookie Expiration Time - Wednesday, September 21, 2011 9:01:21 PM
</code>```

Firefox 4

```<code>Local time of test: 1316622064
PHP Server Time: Wed Sep 21 08:07:38 PDT 2011
CookieExpiration Time: Wednesday, September 21, 2011 10:22:50 PM
</code>```

Safari 3.2.3

```<code>Local time of test: 1316622359
PHP Server Time: Wed Sep 21 08:10:48 PDT 2011
CookieExpiration Time: 9/21/11 5:10 PM
</code>```

Internet Explorer 8

```<code>Local time of test: 1316623009
PHP Server Time: Wed Sep 21 08:21:37 PDT 2011

Cookie Data:
TestCookie
x
domain.com/
9728
3932016640
30177410
2837190416
30177404
</code>```

As you can see, the expiration date/time for the cookies varies widely from working as intended to being several hours in the past to only being 1 hour! Very frustrating.

In addition to trying the above method, I've also tried setting the exact expiration date/time via unixtime... I've done this with both time() at the PHP level, or utilizing the browser's unixtime retrieved through JavaScript.

```<code>setcookie("TestCookie", $value, 1316621928, "/", ".domain.com", 1, true);
</code>```

Each browser handles this differently as well. I can't seem to find one method that works the same for all browsers. Is anyone aware of a method that accomplishes this?

Thank you.

ContentLicense: CC BY-SA 3.0

Body:
I'm looking for a way to set cookies with a short duration against all browsers. Apparently each browser handles the PHP setcookie method differently. Below are my results.

The PHP code:

setcookie("TestCookie", $value, time()+7200, "/", ".domain.com", 1, true);

The Results:

OPERA 11.10

Local time of test: 1316621628
PHP Server Time: Wed Sep 21 07:58:35 PDT 2011
Cookie Expiration Time: 2011-09-21 - 20:58:35

Chrome 6.0.472.63

Local time of test - 1316621761
PHP Server Time - Wed Sep 21 08:01:21 PDT 2011
Cookie Expiration Time - Wednesday, September 21, 2011 9:01:21 PM

Firefox 4

Local time of test: 1316622064
PHP Server Time: Wed Sep 21 08:07:38 PDT 2011
CookieExpiration Time: Wednesday, September 21, 2011 10:22:50 PM

Safari 3.2.3

Local time of test: 1316622359
PHP Server Time: Wed Sep 21 08:10:48 PDT 2011
CookieExpiration Time: 9/21/11 5:10 PM

Internet Explorer 8

Local time of test: 1316623009
PHP Server Time: Wed Sep 21 08:21:37 PDT 2011

Cookie Data:
TestCookie
x
domain.com/
9728
3932016640
30177410
2837190416
30177404

As you can see, the expiration date/time for the cookies varies widely from working as intended to being several hours in the past to only being 1 hour! Very frustrating.

In addition to trying the above method, I've also tried setting the exact expiration date/time via unixtime... I've done this with both time() at the PHP level, or utilizing the browser's unixtime retrieved through JavaScript.

setcookie("TestCookie", $value, 1316621928, "/", ".domain.com", 1, true);

Each browser handles this differently as well. I can't seem to find one method that works the same for all browsers. Is anyone aware of a method that accomplishes this?

Thank you.


问:
NodeJS Server Adress 80 already in use ERROR --> Running on debian 10 cloud server with apache2
I have an issue I can't resolve for a while now. If anyone has a clue, or could help me via TeamViewer, i'll pay reward of 100$. I need this working Monday.

So. I have a webserver set up on 46.231.206.172
There I initially installed an apache2 webserver to host my website under the domain magnolian.ch

Then I switched to a nodejs server though. So I uninstalled apache2 and instead, install a service for the nodejs server.js file.

This worked great on Port 80.

But now all of a sudden (Dont know why, even back 2 weeks of backups still error...).

When I try to load the site, it times out.
When I manually want to start the server via the command "node server.js" it gives the error:

Adress already in use on port 80.

So i have no clue what I need to do here. I cant find any process with Port 80.

lsof -i :80 returns nothing....

Theres no service running that I can seem to find out...

Any ideas?

Much love
Roger, let me know!

Discord for support: Hunter S. Thompson#0275

Code:

Server.js

```<code>const http = require('http');
const app = require('./app');
const server = http.createServer(app);
server.listen(80);
</code>```

App.js

```<code>const express = require('express');
const bodyparser = require('body-parser');

const offerRoutes = require('./api/routes/offer');
const contactRoutes = require('./api/routes/contacts');
const userRoutes = require('./api/routes/users');
const aboutRoutes = require('./api/routes/abouts');
const servicesRoutes = require('./api/routes/services');
const newsRoutes = require('./api/routes/news');
const homeRoutes = require('./api/routes/home');
const technoRoutes = require('./api/routes/techno');
const errorRoutes = require('./api/routes/error');

const app = express();

app.use(bodyparser.urlencoded({extended: false}));
app.use(bodyparser.json());

app.set('view engine', 'ejs');
app.set('views', './api/views');
app.use(express.static(__dirname + '/public'));

app.use('/offer', offerRoutes);
app.use('/about', aboutRoutes);
app.use('/services', servicesRoutes);
app.use('/news', newsRoutes);
app.use('/techno', technoRoutes);
app.use('/contact', contactRoutes);
app.use('/user', userRoutes);
app.use('/', homeRoutes);
app.use('/*', errorRoutes);

app.listen(80, '127.0.0.1');

module.exports = app;
</code>```

Body:
I have an issue I can't resolve for a while now. If anyone has a clue, or could help me via TeamViewer, i'll pay reward of 100$. I need this working Monday.

So. I have a webserver set up on 46.231.206.172
There I initially installed an apache2 webserver to host my website under the domain magnolian.ch

Then I switched to a nodejs server though. So I uninstalled apache2 and instead, install a service for the nodejs server.js file.

This worked great on Port 80.

But now all of a sudden (Dont know why, even back 2 weeks of backups still error...).

When I try to load the site, it times out.
When I manually want to start the server via the command "node server.js" it gives the error:

Adress already in use on port 80.

So i have no clue what I need to do here. I cant find any process with Port 80.

lsof -i :80 returns nothing....

Theres no service running that I can seem to find out...

Any ideas?

Much love
Roger, let me know!

Discord for support: Hunter S. Thompson#0275

Code:

Server.js

const http = require('http');
const app = require('./app');
const server = http.createServer(app);
server.listen(80);

App.js

const express = require('express');
const bodyparser = require('body-parser');

const offerRoutes = require('./api/routes/offer');
const contactRoutes = require('./api/routes/contacts');
const userRoutes = require('./api/routes/users');
const aboutRoutes = require('./api/routes/abouts');
const servicesRoutes = require('./api/routes/services');
const newsRoutes = require('./api/routes/news');
const homeRoutes = require('./api/routes/home');
const technoRoutes = require('./api/routes/techno');
const errorRoutes = require('./api/routes/error');

const app = express();

app.use(bodyparser.urlencoded({extended: false}));
app.use(bodyparser.json());

app.set('view engine', 'ejs');
app.set('views', './api/views');
app.use(express.static(__dirname + '/public'));

app.use('/offer', offerRoutes);
app.use('/about', aboutRoutes);
app.use('/services', servicesRoutes);
app.use('/news', newsRoutes);
app.use('/techno', technoRoutes);
app.use('/contact', contactRoutes);
app.use('/user', userRoutes);
app.use('/', homeRoutes);
app.use('/*', errorRoutes);

app.listen(80, '127.0.0.1');

module.exports = app;


问:
any possible python version to install pybluez on windows , need to advertisement from laptop
any possible python version to install pybluez on windows , need to  advertisement from laptop

I install pybluez for the purpose of communication with bluetooth but i have this error Module not found error came while install pybluez , im trying 3.7, 3,3,2.7,3.8 python version


问:
Appropriate data structure for a long string made of key - value pairs
I have a requirement to send a message to another system.
The message is in the form of a string made of multiple key-value pairs. It's what's called a fixed message.They key is predefined int and the value a string,int,float etc

Eq:

```<code>   beginKey=XA#|key1=value1|key2=value2 ...
</code>```

Some of these fields have default, some are static, some get modified or computed when the object is build.

I thought of using a simple pojo with each field being a Pair<Integer,String> trying to have in this way all the information : the key, value and the name of the field.
I also thought providing a builder that can set some defaults as well.

How would you model an object to keep this data and interact with it in a clean way.

Any idea to make this better is appreciated ?
Thanks

```<code>@Builder
public class Message {

@Builder.Default
private Pair<Integer, String> beginKey = Pair.of(123,"XA#");
private Pair<Integer, String> key1;
private Pair<Integer, String> key2;
...

public String toString() {

  StringJoiner formattedString = new StringJoiner("|");
  formattedString.add(beginKey);
  formattedString.add(key1);
  formattedString.add(key2);

  return formattedString.toString();
}
</code>```

Body:
I have a requirement to send a message to another system.
The message is in the form of a string made of multiple key-value pairs. It's what's called a fixed message.They key is predefined int and the value a string,int,float etc

Eq:

   beginKey=XA#|key1=value1|key2=value2 ...

Some of these fields have default, some are static, some get modified or computed when the object is build.

I thought of using a simple pojo with each field being a Pair<Integer,String> trying to have in this way all the information : the key, value and the name of the field.
I also thought providing a builder that can set some defaults as well.

How would you model an object to keep this data and interact with it in a clean way.

Any idea to make this better is appreciated ?
Thanks

@Builder
public class Message {

@Builder.Default
private Pair<Integer, String> beginKey = Pair.of(123,"XA#");
private Pair<Integer, String> key1;
private Pair<Integer, String> key2;
...

public String toString() {

  StringJoiner formattedString = new StringJoiner("|");
  formattedString.add(beginKey);
  formattedString.add(key1);
  formattedString.add(key2);

  return formattedString.toString();
}


问:
React Query useQuery not returning async API calls NextJS
I am trying to return an array of data that returns the firebase data that I fetched and the API call to return data. I already have two useQuery hooks and the one that only returns the firebase documents works fine. On my second useQuery hook, it doesn't return the price when I render the data, but the function is being called and it console.logs all the correct prices. I tried a similar version transferring the code to onSettled, but that returns a similar issue. I created two versions of the second useQuery hook, one with Promise.all, and another without promises completely. They both return nothing.

No Promise

```<code>  const fetchListDocs = async () => {
    try {
      const queryCollection = query(collection(db, loc));
      const snapshot = await getDocs(queryCollection);
    //   let arr = [];
      let retArr = []
      let newRetMap = new Map();
      snapshot.forEach(async (doc) => {
        const docTicker = doc.data().stockTicker
        // console.log(doc.data())
        // arr.push(doc.data());
        if (newRetMap.has(docTicker)) {
            //averaging price code here
        } else {
            const newPrice = await getStockPrice(docTicker).then((result) => result);
            const currentPrice = parseFloat(newPrice.toFixed(2));
            newRetMap.set(docTicker, currentPrice)
            retArr.push(currentPrice)
        }
      });
      console.log(retArr)
    //   newRetMap.entries((value) => {
    //     retArr.push(value)
    //   })

      return retArr;
    } catch (error) {
      console.log(error);
    }
  };

  const { data: listDocs, status } = useQuery({
    queryKey: ["firestoreListDocuments", db],
    queryFn: () => fetchListDocs(),
    onSettled: (dataCollection) => {

        return dataCollection

    }
  });
</code>```

With Promise

```<code>const fetchListDocs = async () => {
    try {
      const queryCollection = query(collection(db, loc));
      const snapshot = await getDocs(queryCollection);
    //   let arr = [];
      let retArr = []
      let newRetMap = new Map();
      snapshot.forEach(async (doc) => {
        const docTicker = doc.data().stockTicker
        // console.log(doc.data())
        // arr.push(doc.data());
        if (newRetMap.has(docTicker)) {
            //averaging price code here
        } else {
            let newPrice = await getStockPrice(docTicker).then((result) => result);
            newPrice = Promise.resolve(newPrice)
            console.log(newPrice)
            const currentPrice = parseFloat(newPrice);

            newRetMap.set(docTicker, currentPrice)
            retArr.push(currentPrice)
        }
      });
      console.log(retArr)
    //   newRetMap.entries((value) => {
    //     retArr.push(value)
    //   })

      return Promise.all(retArr);
    } catch (error) {
      console.log(error);
    }
  };
</code>```

I would appreciate any and all help. Please let me know if there are any questions.

Body:
I am trying to return an array of data that returns the firebase data that I fetched and the API call to return data. I already have two useQuery hooks and the one that only returns the firebase documents works fine. On my second useQuery hook, it doesn't return the price when I render the data, but the function is being called and it console.logs all the correct prices. I tried a similar version transferring the code to onSettled, but that returns a similar issue. I created two versions of the second useQuery hook, one with Promise.all, and another without promises completely. They both return nothing.

No Promise

  const fetchListDocs = async () => {
    try {
      const queryCollection = query(collection(db, loc));
      const snapshot = await getDocs(queryCollection);
    //   let arr = [];
      let retArr = []
      let newRetMap = new Map();
      snapshot.forEach(async (doc) => {
        const docTicker = doc.data().stockTicker
        // console.log(doc.data())
        // arr.push(doc.data());
        if (newRetMap.has(docTicker)) {
            //averaging price code here
        } else {
            const newPrice = await getStockPrice(docTicker).then((result) => result);
            const currentPrice = parseFloat(newPrice.toFixed(2));
            newRetMap.set(docTicker, currentPrice)
            retArr.push(currentPrice)
        }
      });
      console.log(retArr)
    //   newRetMap.entries((value) => {
    //     retArr.push(value)
    //   })

      return retArr;
    } catch (error) {
      console.log(error);
    }
  };

  const { data: listDocs, status } = useQuery({
    queryKey: ["firestoreListDocuments", db],
    queryFn: () => fetchListDocs(),
    onSettled: (dataCollection) => {

        return dataCollection

    }
  });

With Promise

const fetchListDocs = async () => {
    try {
      const queryCollection = query(collection(db, loc));
      const snapshot = await getDocs(queryCollection);
    //   let arr = [];
      let retArr = []
      let newRetMap = new Map();
      snapshot.forEach(async (doc) => {
        const docTicker = doc.data().stockTicker
        // console.log(doc.data())
        // arr.push(doc.data());
        if (newRetMap.has(docTicker)) {
            //averaging price code here
        } else {
            let newPrice = await getStockPrice(docTicker).then((result) => result);
            newPrice = Promise.resolve(newPrice)
            console.log(newPrice)
            const currentPrice = parseFloat(newPrice);

            newRetMap.set(docTicker, currentPrice)
            retArr.push(currentPrice)
        }
      });
      console.log(retArr)
    //   newRetMap.entries((value) => {
    //     retArr.push(value)
    //   })

      return Promise.all(retArr);
    } catch (error) {
      console.log(error);
    }
  };

I would appreciate any and all help. Please let me know if there are any questions.


问:
How can I detect if IPTC and GPS metadata is present in an image file in c#?
How can I programmatically detect if IPTC and GPS metadata is present in an image file in c#?

Using bitmapMetadat.GetQuery(/app13/irb/8bimiptc/iptc/)  to detect results in a crash but has to be applied for each field. I'm looking for a way to detect of any IPTC or GPS fields are present


问:
AWS ECS FARGATE between RDS TimeOut
We set up servers on 2 different platforms, Aws ECS and Digitalocens.
When we do our mobile application tests, there is no problem with api requests made with the digitaloceans platform.

However, we are having problems with the api communication with the environment established on the Aws ecs platform.

Summary of the Problem: Containers in Aws Ecs work for a while, then timeout after a few minutes after connection with RDS database. During this time, AWS ECS Service is at RUNNING. Service Crash not happening

Title: AWS ECS FARGATE between RDS TimeOut


问:
Save generated image to ImageField model Django

Detected path traversal attempt in '/home/mrlonely/Desktop/lumen/lumen/media/thumbnail/6.jpeg'

When i run this in the views.py:

```<code>def generate_thumbnail(instance):
   post = Post.objects.get(pk=instance.pk)
   output = 'media/thumbnail/' + post.title + '.jpeg'
   filename_thumbnail = Path.joinpath(filename, output)
   try:
      (
            ffmpeg
            .input(str(filename)+post.video.url, ss='00:00:20')
            .output(output, vframes=1)
            .overwrite_output()
            .run(capture_stdout=True, capture_stderr=True)
        )
      with open(filename_thumbnail, 'rb') as file_handler:
         django_file = File(file_handler)
         post.thumbnail.save(filename_thumbnail, 'thumbnail/')
   except ffmpeg.Error as e:
        print(e.stderr.decode(), file=sys.stderr)
        sys.exit(1)
</code>```

I am trying to connect the ffmpeg generated thumbnail to the model ImageField on the Post model (instance is post)

Body:
Detected path traversal attempt in '/home/mrlonely/Desktop/lumen/lumen/media/thumbnail/6.jpeg'

When i run this in the views.py:

def generate_thumbnail(instance):
   post = Post.objects.get(pk=instance.pk)
   output = 'media/thumbnail/' + post.title + '.jpeg'
   filename_thumbnail = Path.joinpath(filename, output)
   try:
      (
            ffmpeg
            .input(str(filename)+post.video.url, ss='00:00:20')
            .output(output, vframes=1)
            .overwrite_output()
            .run(capture_stdout=True, capture_stderr=True)
        )
      with open(filename_thumbnail, 'rb') as file_handler:
         django_file = File(file_handler)
         post.thumbnail.save(filename_thumbnail, 'thumbnail/')
   except ffmpeg.Error as e:
        print(e.stderr.decode(), file=sys.stderr)
        sys.exit(1)

I am trying to connect the ffmpeg generated thumbnail to the model ImageField on the Post model (instance is post)


问:
How to add multiple elements in correct order to NumPy array based on conditions
Is there a straightforward solution to create an array with multiple elements per condition or set of conditions using np.select? In other words, how do I have certain choices generate multiple elements in the array?

I only know how to add one single element per condition or multiple conditions as follows:

```<code>conditions = [
(Shapes['Color'] == 'Blue'),
(Shapes['Color'] == 'Red'),
(Shapes['Color'] == 'Green'),
(Shapes['Color'] == 'Purple'),
(Shapes['Color'] == 'Yellow')
]

choices = [
'The ' + Shapes['Type'] + ' is color blue.',
'The ' + Shapes['Type'] + ' is color red.',
'The ' + Shapes['Type'] + ' is color green.',
'The ' + Shapes['Type'] + ' is color purple.',
'The ' + Shapes['Type'] + ' is color yellow.'
]

ShapeDescriptions = np.select(conditions, choices, default='NA')
</code>```

I'd like to be able to generate for certain conditions multiple sentences of text with each sentence representing separate elements in the array. The order of the elements is important. So if I want 3 sentences for blue, but 1 sentence for red, and 2 for green, how would I do that?

Alternatively, if that can't be done, then after the above array is generated, how do I add additional elements only after certain elements in the array?

Numpy.append only adds elements to the end of the array and Numpy.insert seems to add only one element. Can multiple elements be inserted by Numpy.insert?

Thank you

Body:
Is there a straightforward solution to create an array with multiple elements per condition or set of conditions using np.select? In other words, how do I have certain choices generate multiple elements in the array?

I only know how to add one single element per condition or multiple conditions as follows:

conditions = [
(Shapes['Color'] == 'Blue'),
(Shapes['Color'] == 'Red'),
(Shapes['Color'] == 'Green'),
(Shapes['Color'] == 'Purple'),
(Shapes['Color'] == 'Yellow')
]

choices = [
'The ' + Shapes['Type'] + ' is color blue.',
'The ' + Shapes['Type'] + ' is color red.',
'The ' + Shapes['Type'] + ' is color green.',
'The ' + Shapes['Type'] + ' is color purple.',
'The ' + Shapes['Type'] + ' is color yellow.'
]

ShapeDescriptions = np.select(conditions, choices, default='NA')

I'd like to be able to generate for certain conditions multiple sentences of text with each sentence representing separate elements in the array. The order of the elements is important. So if I want 3 sentences for blue, but 1 sentence for red, and 2 for green, how would I do that?

Alternatively, if that can't be done, then after the above array is generated, how do I add additional elements only after certain elements in the array?

Numpy.append only adds elements to the end of the array and Numpy.insert seems to add only one element. Can multiple elements be inserted by Numpy.insert?

Thank you


问:
How to know the context in thread in whatsapp or telegram chatbot
I'm training to create a WhatsApp chatbot and I have a major difficulty: how to know the context in the thread. For example in a previous message, I sent a list of options (A. My account, B. Other option, etc) and the user will choose an option, since I have a single webhook for all messages , how do I find myself in this context?</p>


问:
File handling: reading integers and strings line by line in C++
What I want to do is read lines from a text file that contain two integers and remaining are strings on each line. For example, it may look something like this:

```<code>1 2 abc def pq
1 3 abc def
10 12 abc pq rt
</code>```

I have till now found out how to read 2 integers and 1 string on each line but I'm really having trouble reading the whole input file as given above. Following is the code that I have tried:

```<code>#include <iostream>
#include<string>
#include<fstream>
using namespace std;

int main() {

    ifstream file( "Foodtest.txt", ios::in );
    string part1;
    int num1, num2;

    if( !file )
        cerr << "Cant open " << endl;

    while( file >> num1 >> num2 >> part1 )
    {
        cout << num1 << " " <<  num2
             << " " << part1 << endl;
    }

    file.close();
    return 0;
}
</code>```

Body:
What I want to do is read lines from a text file that contain two integers and remaining are strings on each line. For example, it may look something like this:

1 2 abc def pq
1 3 abc def
10 12 abc pq rt

I have till now found out how to read 2 integers and 1 string on each line but I'm really having trouble reading the whole input file as given above. Following is the code that I have tried:

#include <iostream>
#include<string>
#include<fstream>
using namespace std;

int main() {

    ifstream file( "Foodtest.txt", ios::in );
    string part1;
    int num1, num2;

    if( !file )
        cerr << "Cant open " << endl;

    while( file >> num1 >> num2 >> part1 )
    {
        cout << num1 << " " <<  num2
             << " " << part1 << endl;
    }

    file.close();
    return 0;
}


问:
Pyhton Data Handling
`

```<code># Sorting out the data
for id, name in data:
    is_organization = False
    for pattern in organization_patterns:
        if pattern in name:
            is_organization = True
            break
        if  is_organization:
          organization_names.append((id,name))

    else:
        is_junk = False
        for keyword in junk_keywords:
            if keyword in name:
                is_junk = True
                break
        if is_junk:
            junk_data.append((id, name))

    if not is_organization and not is_junk:
        indian_names.append((id, name))

#output workbook
output_wb = Workbook()

# Indian names
indian_names_sheet = output_wb.create_sheet('Indian Names')

#Indian Names
indian_names_sheet.cell(row=1, column=1).value = 'ID'
indian_names_sheet.cell(row=1, column=2).value = 'Name'
for i, (id, name) in enumerate(indian_names):
    indian_names_sheet.cell(row=i+2, column=1).value = id
    indian_names_sheet.cell(row=i+2, column=2).value = name

# Organization Names
organization_names_sheet = output_wb.create_sheet('Organization Names')

#Organization
organization_names_sheet.cell(row=1, column=1).value = 'ID'
organization_names_sheet.cell(row=1, column=2).value = 'Name'
for i, (id, name) in enumerate(organization_names):
    organization_names_sheet.cell(row=i+2, column=1).value = id
    organization_names_sheet.cell(row=i+2, column=2).value = name

</code>```

The above code should write data in organization names , indian names and junk data , the junk data and indian names is writing fine but its blank in organization names

It is not writing anything in organization names dont know why..

Title: Pyhton Data Handling

Body:
`

# Sorting out the data
for id, name in data:
    is_organization = False
    for pattern in organization_patterns:
        if pattern in name:
            is_organization = True
            break
        if  is_organization:
          organization_names.append((id,name))

    else:
        is_junk = False
        for keyword in junk_keywords:
            if keyword in name:
                is_junk = True
                break
        if is_junk:
            junk_data.append((id, name))

    if not is_organization and not is_junk:
        indian_names.append((id, name))

#output workbook
output_wb = Workbook()

# Indian names
indian_names_sheet = output_wb.create_sheet('Indian Names')

#Indian Names
indian_names_sheet.cell(row=1, column=1).value = 'ID'
indian_names_sheet.cell(row=1, column=2).value = 'Name'
for i, (id, name) in enumerate(indian_names):
    indian_names_sheet.cell(row=i+2, column=1).value = id
    indian_names_sheet.cell(row=i+2, column=2).value = name

# Organization Names
organization_names_sheet = output_wb.create_sheet('Organization Names')

#Organization
organization_names_sheet.cell(row=1, column=1).value = 'ID'
organization_names_sheet.cell(row=1, column=2).value = 'Name'
for i, (id, name) in enumerate(organization_names):
    organization_names_sheet.cell(row=i+2, column=1).value = id
    organization_names_sheet.cell(row=i+2, column=2).value = name

The above code should write data in organization names , indian names and junk data , the junk data and indian names is writing fine but its blank in organization names

It is not writing anything in organization names dont know why..


问:
I m geting an error like this "Expected a value of type 'List<Dynamic>',but got one of type 'Null' " in brower.I want to get a json file readed
```<code> Widget build(BuildContext context) {
    // this function is called before the build so that
    // the string assettoload is avialable to the DefaultAssetBuilder
    setasset();
    // and now we return the FutureBuilder to load and decode JSON
    return FutureBuilder(
      future:
          DefaultAssetBundle.of(context).loadString(assettoload, cache: false),
      builder: (context, snapshot) {
        List mydata = jsonDecode(snapshot.data.toString());
        if (mydata == null) {
          return Scaffold(
            body: Center(
              child: Text(
                "Loading",
              ),
            ),
          );
        } else {
          return quizpage(mydata: mydata);
        }
      },
    );
  }
}
</code>```

I was expecting to get output in the browser which i passed in json format but it returned error

Body:
 Widget build(BuildContext context) {
    // this function is called before the build so that
    // the string assettoload is avialable to the DefaultAssetBuilder
    setasset();
    // and now we return the FutureBuilder to load and decode JSON
    return FutureBuilder(
      future:
          DefaultAssetBundle.of(context).loadString(assettoload, cache: false),
      builder: (context, snapshot) {
        List mydata = jsonDecode(snapshot.data.toString());
        if (mydata == null) {
          return Scaffold(
            body: Center(
              child: Text(
                "Loading",
              ),
            ),
          );
        } else {
          return quizpage(mydata: mydata);
        }
      },
    );
  }
}

I was expecting to get output in the browser which i passed in json format but it returned error


问:
file.delete() Always returns false in Android java(Android 11+ deives)?
I'm trying to delete a file in android storage. But the file is not getting deleted.
I trapped on this issue almost 3 days. I tired all the solution as of my knowledge, but nothing hellps. Your help will be highly useful to me thanks in advance.

I used the below code to delete

```<code> String path = "/storage/emulated/0/Recordings/Call/Two.mp3";
        File fdelete = new File(path);
        if (fdelete.exists()) {
          boolean  b = fdelete.delete();
          if (b) {
             System.out.println("file Deleted :" + path);
          } else {
             System.out.println("file not Deleted :" + path);
     }
}
</code>```

And the permission I used in manifest are

```<code>    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.STORAGE" />
    <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
</code>```

Body:
I'm trying to delete a file in android storage. But the file is not getting deleted.
I trapped on this issue almost 3 days. I tired all the solution as of my knowledge, but nothing hellps. Your help will be highly useful to me thanks in advance.

I used the below code to delete

 String path = "/storage/emulated/0/Recordings/Call/Two.mp3";
        File fdelete = new File(path);
        if (fdelete.exists()) {
          boolean  b = fdelete.delete();
          if (b) {
             System.out.println("file Deleted :" + path);
          } else {
             System.out.println("file not Deleted :" + path);
     }
}

And the permission I used in manifest are

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.STORAGE" />
    <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />


问:
C++ in vscode: Launch: program does not exist (the error suddenly showed up while previous programs with the same setupworks)
I've been writing c++ in vscode for two months now, and everything was working fine. Until last week this error showed up. (update: it showed up twice now)
sometimes it's this error
or a different error
the program is the same as the one above^^ I was just trying to run the same program in a different file, and then a different error shows

```<code>{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
    {
        "name": "(gdb) Launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}\\${fileBasenameNoExtension}.exe",
        "args": [],
        "stopAtEntry": false,
        "cwd": "C:\\msys64\\mingw64\\bin",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            },
            {
                "description":  "Set Disassembly Flavor to Intel",
                "text": "-gdb-set disassembly-flavor intel",
                "ignoreFailures": true
            }
        ]
    }
]
</code>```

}

launch.json

This program is for usaco bronze contest, and the same file runs find when I put it into the online grader. The whole situation is frustrating and I'm worried that the same error will show up again during future contests :(

Please help, any suggestions are appreciated. Thanks!

A few things I've tried:

rename the file -> doesn't run

copying the same program to a different file -> doesn't run

using the same file but with a simple hello world -> runs

writing a different code with the same function -> doesn't run??

Attempted to uninstall vscode, but somehow I cannot uninstall it

editing launch.json according to multiple solutions online, none of them worked

Today the same error happened to a different program, and I couldn't find any similarities between the two.

And all the other programs I wrote before & after this error showed up all work. It seemed like it is very specific to these problem I'm trying to solve.

Body:
I've been writing c++ in vscode for two months now, and everything was working fine. Until last week this error showed up. (update: it showed up twice now)
sometimes it's this error
or a different error
the program is the same as the one above^^ I was just trying to run the same program in a different file, and then a different error shows

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
    {
        "name": "(gdb) Launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}\\${fileBasenameNoExtension}.exe",
        "args": [],
        "stopAtEntry": false,
        "cwd": "C:\\msys64\\mingw64\\bin",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            },
            {
                "description":  "Set Disassembly Flavor to Intel",
                "text": "-gdb-set disassembly-flavor intel",
                "ignoreFailures": true
            }
        ]
    }
]

}

launch.json

This program is for usaco bronze contest, and the same file runs find when I put it into the online grader. The whole situation is frustrating and I'm worried that the same error will show up again during future contests :(

Please help, any suggestions are appreciated. Thanks!

A few things I've tried:

rename the file -> doesn't run

copying the same program to a different file -> doesn't run

using the same file but with a simple hello world -> runs

writing a different code with the same function -> doesn't run??

Attempted to uninstall vscode, but somehow I cannot uninstall it

editing launch.json according to multiple solutions online, none of them worked

Today the same error happened to a different program, and I couldn't find any similarities between the two.

And all the other programs I wrote before & after this error showed up all work. It seemed like it is very specific to these problem I'm trying to solve.


问:
How to fix an error displayed while modelfitting in Rstudio?
Want to study the regime switching of a time series using MSGARCH package in Rstudio. After specifying the model, tried to fit the model using data of series using FitML function.I have used the following code to fit data.

```<code>msgarch_fit=FitML(msgarch_spec,data="log_ret") ## I have found the log return of the series and saved it in the vector named "log_ret".
</code>```

But the following error is displayed.

```<code>"Error in f_check_y(data) : y must be numeric"
</code>```

Being a beginner I can't understand the meaning of it. It would be of great help if someone can explain.

I tried to execute the code but error was displayed.

I was expecting to get the summary output.

Thank you

Body:
Want to study the regime switching of a time series using MSGARCH package in Rstudio. After specifying the model, tried to fit the model using data of series using FitML function.I have used the following code to fit data.

msgarch_fit=FitML(msgarch_spec,data="log_ret") ## I have found the log return of the series and saved it in the vector named "log_ret".

But the following error is displayed.

"Error in f_check_y(data) : y must be numeric"

Being a beginner I can't understand the meaning of it. It would be of great help if someone can explain.

I tried to execute the code but error was displayed.

I was expecting to get the summary output.

Thank you


问:
I want write codes for counting numbers app. My app can count the numbers of pages. I want to add button for cleaning screen

from kivy.app import App

from kivy.uix.screenmanager import ScreenManager, Screen

from kivy.uix.boxlayout import BoxLayout

from kivy.uix.label import Label

from kivy.uix.button import Button

class TestScreen(Screen):

    def __init__(self, **kwargs):

        Screen.__init__(self, **kwargs)

        layout = BoxLayout(orientation="vertical")

        self.add_widget(layout)

        layout.add_widget(Label(text=self.name, font_size="150sp"))

        button = Button(text="Count",font_size='30sp')

        layout.add_widget(button)

        button.bind(on_press=self.add_screen)

    def add_screen(self, *args):

        n = len(self.manager.screen_names)

        screen = TestScreen(name="{}".format(n))

        self.manager.add_widget(screen)

        self.manager.current = screen.name

# Create the screen manager

sm = ScreenManager()

sm.add_widget(TestScreen(name=''))

class TestApp(App):

    def build(self):

        return sm

if __name__ == '__main__':

    TestApp().run()
```

I can't add button with a view to cleaning screen. I know this app not for counting. But i only need add button for cleaning numbers.

Body:
from kivy.app import App

from kivy.uix.screenmanager import ScreenManager, Screen

from kivy.uix.boxlayout import BoxLayout

from kivy.uix.label import Label

from kivy.uix.button import Button

class TestScreen(Screen):

    def __init__(self, **kwargs):

        Screen.__init__(self, **kwargs)

        layout = BoxLayout(orientation="vertical")

        self.add_widget(layout)

        layout.add_widget(Label(text=self.name, font_size="150sp"))

        button = Button(text="Count",font_size='30sp')

        layout.add_widget(button)

        button.bind(on_press=self.add_screen)

    def add_screen(self, *args):

        n = len(self.manager.screen_names)

        screen = TestScreen(name="{}".format(n))

        self.manager.add_widget(screen)

        self.manager.current = screen.name

# Create the screen manager

sm = ScreenManager()

sm.add_widget(TestScreen(name=''))

class TestApp(App):

    def build(self):

        return sm

if __name__ == '__main__':

    TestApp().run()

I can't add button with a view to cleaning screen. I know this app not for counting. But i only need add button for cleaning numbers.