问:
Statement timeout error in postgreSQL for large data
We have recently migrated to PostgreSQL 15 from Oracle.
My table structure is as in image below. Only indices are primary keys.

We have this program for finding duplicate( for an entity if any staging record exists in main, then mark as duplicate in staging detail)
Main table has approx. 500 million of data. The below query works when staging table has approx. 1 million records (1 million ~ 500 million comparison), but gives statement timeout error for more than 1 million records. No new index was created in PostgreSQL. Do we have option to increase memory or timeout time in Postgres or any new index can be created to run this query for large data?

Edit : edited query with unique_id >= 15684 condition

```<code>    SELECT FD.file_id, FD.LINE_NO
from staging_header FH
left join staging_detail FD on FH.file_id = FD.file_id
left join(main_header H left join main_detail D
on H.unique_id = D.unique_id)
ON (FD.TXN_DATE = D.transaction_date and FD.MID = D.merchant_id and FD.TID = D.terminal_id and FD.TXN_REF_NO = D.tx_ref_no
where FH.entity_id = 'XXXX' and FH.entity_id = H.entity_id and unique_id >= 15684
and FH.PROCESS_FLAG = 'N' and FH.PROCESS_STATUS = '00'
and FD.PROCESS_FLAG = 'N' and FD.PROCESS_STATUS = '00'
</code>```

We have approx. 76 month wise partitions for main_detail table on transaction_date column.

Output of EXPLAIN ANALYSE:

```<code>Gather  (cost=686297.66..56604907.59 rows=1 width=16) (actual time=391652.590..397957.305 rows=0 loops=1)
   Workers Planned: 2
   Workers Launched: 2
   ->  Parallel Hash Join  (cost=685297.66..56603907.49 rows=1 width=16) (actual time=391629.181..391630.151 rows=0
loops=3)
         Hash Cond: ((d.transaction_date = fd.txn_date) AND ((d.merchant_id)::text = (fd.mid)::text) AND ((d.termina
l_id)::text = (fd.tid)::text) AND ((d.tx_ref_no)::text = (fd.txn_ref_no)::text) AND ((d.auth_code)::text = (fd.auth_
code)::text))
         ->  Hash Join  (cost=748.33..53211966.04 rows=61120806 width=74) (actual time=48280.346..300238.985 rows=14
2758659 loops=3)
               Hash Cond: (d.unique_id = h.unique_id)
               ->  Parallel Append  (cost=0.00..51719090.37 rows=568323296 width=77) (actual time=0.242..248105.291
rows=454658663 loops=3)
                     ->  Parallel Seq Scan on main_detail_202204 d_68  (cost=0.00..2765248.17 rows=31161217
width=79) (actual time=0.131..36385.007 rows=74786917 loops=1)
                    ->  Parallel Seq Scan on main_detail_202205 d_69  (cost=0.00..2570672.60 rows=28713160
width=83) (actual time=0.139..34076.709 rows=68911584 loops=1)
                     ->  Parallel Seq Scan on main_detail_202210 d_74  (cost=0.00..2525110.23 rows=27849423
width=88) (actual time=0.066..34458.420 rows=66838615 loops=1)
                     ->  Parallel Seq Scan on main_detail_202208 d_72  (cost=0.00..2437750.12 rows=27017712
width=85) (actual time=1.309..31526.598 rows=64842508 loops=1)
                     ->  Parallel Seq Scan on main_detail_202209 d_73  (cost=0.00..2417680.45 rows=26714745
width=88) (actual time=0.389..30640.660 rows=64115389 loops=1)
                     ->  Parallel Seq Scan on main_detail_202207 d_71  (cost=0.00..2380965.98 rows=26395098
width=85) (actual time=1.878..30367.172 rows=63348237 loops=1)
                     ->  Parallel Seq Scan on main_detail_202206 d_70  (cost=0.00..2288957.10 rows=25457710
width=84) (actual time=1.225..30613.453 rows=61098506 loops=1)
                     ->  Parallel Seq Scan on main_detail_202203 d_67  (cost=0.00..2228805.72 rows=27047072
width=79) (actual time=1.204..30554.095 rows=64912973 loops=1)
                     ->  Parallel Seq Scan on main_detail_202211 d_75  (cost=0.00..2114584.45 rows=23342545
width=89) (actual time=2.361..28424.133 rows=56022109 loops=1)
                     ->  Parallel Seq Scan on main_detail_202110 d_62  (cost=0.00..1929836.90 rows=23170790
width=79) (actual time=1.908..24234.816 rows=55609894 loops=1)
                     ->  Parallel Seq Scan on main_detail_202112 d_64  (cost=0.00..1916823.43 rows=23095743
width=80) (actual time=0.309..24250.450 rows=55429782 loops=1)
                     ->  Parallel Seq Scan on main_detail_202202 d_66  (cost=0.00..1841871.05 rows=22302905
width=81) (actual time=0.920..23430.150 rows=53526972 loops=1)
                     ->  Parallel Seq Scan on main_detail_202111 d_63  (cost=0.00..1811233.87 rows=21760687
width=80) (actual time=1.175..10110.061 rows=17408550 loops=3)
                     ->  Parallel Seq Scan on main_detail_202201 d_65  (cost=0.00..1781216.65 rows=21494365
width=81) (actual time=1.924..14664.887 rows=25793238 loops=2)
                     ->  Parallel Seq Scan on main_detail_202108 d_60  (cost=0.00..1672640.07 rows=19995007
width=78) (actual time=1.034..21265.332 rows=47988018 loops=1)
                     ->  Parallel Seq Scan on main_detail_202109 d_61  (cost=0.00..1642747.75 rows=19685775
width=78) (actual time=0.495..20735.015 rows=47245860 loops=1)
                     ->  Parallel Seq Scan on main_detail_202107 d_59  (cost=0.00..1582179.23 rows=18876623
width=75) (actual time=1.217..24656.746 rows=45303895 loops=1)
                     ->  Parallel Seq Scan on main_detail_202106 d_58  (cost=0.00..1416963.00 rows=16879900
width=75) (actual time=0.461..18096.119 rows=40511759 loops=1)
                     ->  Parallel Seq Scan on main_detail_202104 d_56  (cost=0.00..1247189.85 rows=14815785
width=73) (actual time=1.271..16250.747 rows=35557883 loops=1)
                     ->  Parallel Seq Scan on main_detail_202105 d_57  (cost=0.00..1034296.03 rows=12273802
width=75) (actual time=0.279..12897.524 rows=29457126 loops=1)
                     ->  Parallel Seq Scan on main_detail_202001 d_41  (cost=0.00..660224.22 rows=7901322 wi
dth=62) (actual time=0.851..8385.719 rows=18963171 loops=1)
                     ->  Parallel Seq Scan on main_detail_202103 d_55  (cost=0.00..636403.65 rows=7600365 wi
dth=59) (actual time=0.636..7917.474 rows=18240877 loops=1)
                     ->  Parallel Seq Scan on main_detail_201912 d_40  (cost=0.00..634131.68 rows=7575968 wi
dth=62) (actual time=0.981..7876.041 rows=18182322 loops=1)
                     ->  Parallel Seq Scan on main_detail_202002 d_42  (cost=0.00..618985.88 rows=7403088 wi
dth=61) (actual time=0.443..7823.615 rows=17767413 loops=1)
                     ->  Parallel Seq Scan on main_detail_202101 d_53  (cost=0.00..594448.23 rows=7099623 wi
dth=60) (actual time=0.579..7617.154 rows=17039096 loops=1)
                     ->  Parallel Seq Scan on main_detail_202012 d_52  (cost=0.00..592949.22 rows=7075422 wi
dth=60) (actual time=0.289..7599.207 rows=16981011 loops=1)
                     ->  Parallel Seq Scan on main_detail_202102 d_54  (cost=0.00..557941.45 rows=6666945 wi
dth=59) (actual time=1.097..8469.829 rows=16000668 loops=1)
                     ->  Parallel Seq Scan on main_detail_202011 d_51  (cost=0.00..551561.22 rows=6580722 wi
dth=60) (actual time=2.323..7845.248 rows=15793732 loops=1)
                     ->  Parallel Seq Scan on main_detail_202010 d_50  (cost=0.00..541516.32 rows=6465732 wi
dth=60) (actual time=3.071..7509.806 rows=15517757 loops=1)
                     ->  Parallel Seq Scan on main_detail_202003 d_43  (cost=0.00..500525.41 rows=5982441 wi
dth=61) (actual time=0.505..6566.428 rows=14357859 loops=1)
                     ->  Parallel Seq Scan on main_detail_202009 d_49  (cost=0.00..498229.27 rows=5952427 wi
dth=60) (actual time=1.340..6354.120 rows=14285824 loops=1)
                     ->  Parallel Seq Scan on main_detail_202008 d_48  (cost=0.00..473451.19 rows=5649219 wi
dth=60) (actual time=1.899..6152.809 rows=13558126 loops=1)
                     ->  Parallel Seq Scan on main_detail_202007 d_47  (cost=0.00..442856.52 rows=5280052 wi
dth=60) (actual time=0.688..5718.016 rows=12672124 loops=1)
                     ->  Parallel Seq Scan on main_detail_202006 d_46  (cost=0.00..431238.51 rows=5139651 wi
dth=60) (actual time=1.022..5570.241 rows=12335163 loops=1)
                     ->  Parallel Seq Scan on main_detail_202005 d_45  (cost=0.00..322049.82 rows=3843882 wi
dth=59) (actual time=0.514..4179.456 rows=9225317 loops=1)
                     ->  Parallel Seq Scan on main_detail_202004 d_44  (cost=0.00..170375.59 rows=2033059 wi
dth=59) (actual time=1.270..2200.745 rows=4879342 loops=1)
                     ->  Parallel Seq Scan on main_detail_201911 d_39  (cost=0.00..99748.34 rows=1126534 wid
th=60) (actual time=0.442..1238.540 rows=2703682 loops=1)
                     ->  Parallel Seq Scan on main_detail_201904 d_32  (cost=0.00..77520.76 rows=877776 widt
h=60) (actual time=1.233..1038.713 rows=2106663 loops=1)
                     ->  Parallel Seq Scan on main_detail_201905 d_33  (cost=0.00..75244.24 rows=852324 widt
h=60) (actual time=0.033..1018.941 rows=2045578 loops=1)
                     ->  Parallel Seq Scan on main_detail_201908 d_36  (cost=0.00..71581.46 rows=807346 widt
h=60) (actual time=0.034..756.542 rows=1937631 loops=1)
                     ->  Parallel Seq Scan on main_detail_201907 d_35  (cost=0.00..70736.10 rows=798410 widt
h=60) (actual time=0.031..815.549 rows=1916185 loops=1)
                     ->  Parallel Seq Scan on main_detail_201906 d_34  (cost=0.00..70287.73 rows=795673 widt
h=60) (actual time=4.525..1071.337 rows=1909616 loops=1)
                     ->  Parallel Seq Scan on main_detail_201910 d_38  (cost=0.00..64894.83 rows=731183 widt
h=60) (actual time=4.229..1106.733 rows=1754839 loops=1)
                     ->  Parallel Seq Scan on main_detail_201909 d_37  (cost=0.00..64030.31 rows=722131 widt
h=60) (actual time=0.036..1115.049 rows=1733114 loops=1)
                     ->  Parallel Seq Scan on main_detail_202212 d_76  (cost=0.00..62668.10 rows=734710 widt
h=70) (actual time=0.502..941.721 rows=1763305 loops=1)
                     ->  Parallel Seq Scan on main_detail_201704 d_8  (cost=0.00..20424.27 rows=244827 width
=59) (actual time=0.023..253.853 rows=587584 loops=1)
                     ->  Parallel Seq Scan on main_detail_201805 d_21  (cost=0.00..18971.21 rows=222421 widt
h=60) (actual time=0.365..255.920 rows=534441 loops=1)
                     ->  Parallel Seq Scan on main_detail_201806 d_22  (cost=0.00..17918.28 rows=211428 widt
h=60) (actual time=0.022..244.113 rows=507427 loops=1)
                     ->  Parallel Seq Scan on main_detail_201804 d_20  (cost=0.00..17845.21 rows=210521 widt
h=60) (actual time=0.033..227.176 rows=505301 loops=1)
                     ->  Parallel Seq Scan on main_detail_201803 d_19  (cost=0.00..17609.88 rows=208088 widt
h=60) (actual time=0.018..201.712 rows=499411 loops=1)
                     ->  Parallel Seq Scan on main_detail_201810 d_26  (cost=0.00..17272.90 rows=203890 widt
h=60) (actual time=3.561..241.027 rows=489337 loops=1)
                     ->  Parallel Seq Scan on main_detail_201811 d_27  (cost=0.00..16898.90 rows=199690 widt
h=60) (actual time=0.016..226.327 rows=479255 loops=1)
                     ->  Parallel Seq Scan on main_detail_201801 d_17  (cost=0.00..16872.47 rows=199347 widt
h=60) (actual time=0.011..228.096 rows=478432 loops=1)
                     ->  Parallel Seq Scan on main_detail_201809 d_25  (cost=0.00..16693.76 rows=197076 widt
h=60) (actual time=0.011..232.691 rows=472983 loops=1)
                     ->  Parallel Seq Scan on main_detail_201808 d_24  (cost=0.00..16615.35 rows=196135 widt
h=60) (actual time=0.527..256.811 rows=470725 loops=1)
                     ->  Parallel Seq Scan on main_detail_201705 d_9  (cost=0.00..16518.85 rows=196985 width
=60) (actual time=0.633..247.533 rows=472764 loops=1)
                     ->  Parallel Seq Scan on main_detail_201710 d_14  (cost=0.00..16385.53 rows=192653 widt
h=61) (actual time=0.011..242.029 rows=462368 loops=1)
                     ->  Parallel Seq Scan on main_detail_201807 d_23  (cost=0.00..16300.88 rows=192788 widt
h=60) (actual time=0.011..212.557 rows=462691 loops=1)
                     ->  Parallel Seq Scan on main_detail_201712 d_16  (cost=0.00..15956.17 rows=189018 widt
h=60) (actual time=0.377..233.791 rows=453642 loops=1)
                     ->  Parallel Seq Scan on main_detail_201903 d_31  (cost=0.00..15630.37 rows=184637 widt
h=60) (actual time=2.076..195.545 rows=443129 loops=1)
                     ->  Parallel Seq Scan on main_detail_201802 d_18  (cost=0.00..15556.97 rows=183697 widt
h=60) (actual time=0.019..200.397 rows=440872 loops=1)
                     ->  Parallel Seq Scan on main_detail_201812 d_28  (cost=0.00..15281.62 rows=180662 widt
h=60) (actual time=2.067..209.129 rows=433590 loops=1)
                     ->  Parallel Seq Scan on main_detail_201709 d_13  (cost=0.00..14963.41 rows=177641 widt
h=60) (actual time=0.011..207.096 rows=426339 loops=1)
                     ->  Parallel Seq Scan on main_detail_201901 d_29  (cost=0.00..14355.48 rows=169448 widt
h=60) (actual time=0.453..200.458 rows=406674 loops=1)
                     ->  Parallel Seq Scan on main_detail_201708 d_12  (cost=0.00..14190.58 rows=168458 widt
h=60) (actual time=0.676..187.462 rows=404299 loops=1)
                     ->  Parallel Seq Scan on main_detail_201711 d_15  (cost=0.00..13645.50 rows=161350 widt
h=60) (actual time=0.487..190.109 rows=387239 loops=1)
                     ->  Parallel Seq Scan on main_detail_201902 d_30  (cost=0.00..13521.67 rows=159367 widt
h=60) (actual time=0.643..183.340 rows=382480 loops=1)
                     ->  Parallel Seq Scan on main_detail_201706 d_10  (cost=0.00..13430.53 rows=159553 widt
h=60) (actual time=0.981..186.323 rows=382928 loops=1)
                     ->  Parallel Seq Scan on main_detail_201707 d_11  (cost=0.00..13163.89 rows=156389 widt
h=60) (actual time=2.020..183.935 rows=375334 loops=1)
                     ->  Parallel Seq Scan on main_detail_201703 d_7  (cost=0.00..926.89 rows=14989 width=60
) (actual time=0.009..10.364 rows=25481 loops=1)
                     ->  Parallel Seq Scan on main_detail_201612 d_4  (cost=0.00..14.23 rows=223 width=61) (
actual time=0.009..0.556 rows=379 loops=1)
                     ->  Parallel Seq Scan on main_detail_201610 d_2  (cost=0.00..10.29 rows=29 width=408) (
actual time=0.000..0.003 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202301 d_77  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.001 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202302 d_78  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.001..0.001 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202303 d_79  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.001 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202304 d_80  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.003 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202305 d_81  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.000 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202306 d_82  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.000 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202307 d_83  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.000 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202308 d_84  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.000 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202309 d_85  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.002 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202310 d_86  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.000 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202312 d_87  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.001 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_201702 d_6  (cost=0.00..7.06 rows=106 width=61) (a
ctual time=0.009..0.457 rows=180 loops=1)
                     ->  Parallel Seq Scan on main_detail_before_2016 d_1  (cost=0.00..2.43 rows=43 width=21
6) (actual time=0.010..0.027 rows=73 loops=1)
                     ->  Parallel Seq Scan on main_detail_201701 d_5  (cost=0.00..2.35 rows=35 width=60) (ac
tual time=0.318..0.336 rows=59 loops=1)
                     ->  Parallel Seq Scan on main_detail_201611 d_3  (cost=0.00..1.02 rows=2 width=408) (ac
tual time=0.453..0.458 rows=4 loops=1)
               ->  Hash  (cost=717.83..717.83 rows=2440 width=13) (actual time=100.803..100.806 rows=4086 loops=3)
                     Buckets: 4096  Batches: 1  Memory Usage: 212kB
                     ->  Bitmap Heap Scan on main_header h  (cost=47.54..717.83 rows=2440 width=13) (actual
time=1.429..99.670 rows=4086 loops=3)
                           Recheck Cond: ((entity_id)::text = 'W002'::text)
                           Filter: (unique_id >= 15684)
                           Heap Blocks: exact=421
                           ->  Bitmap Index Scan on idx_pos_cb_hdr_t99  (cost=0.00..46.93 rows=4086 width=0) (actual
time=1.002..1.002 rows=4086 loops=3)
                                 Index Cond: ((entity_id)::text = 'W002'::text)
         ->  Parallel Hash  (cost=661416.16..661416.16 rows=606763 width=101) (actual time=7268.024..7268.037 rows=1
894307 loops=3)
               Buckets: 65536 (originally 65536)  Batches: 128 (originally 32)  Memory Usage: 7136kB
               ->  Hash Join  (cost=7.85..661416.16 rows=606763 width=101) (actual time=3559.203..5547.343 rows=1894
307 loops=3)
                     Hash Cond: (fd.file_id = fh.file_id)
                     ->  Parallel Seq Scan on staging_detail fd  (cost=0.00..642716.64 rows=6977776
width=96) (actual time=1.887..4871.854 rows=5580857 loops=3)
                           Filter: (((process_flag)::text = 'N'::text) AND ((process_status)::text = '00'::text))
                           Rows Removed by Filter: 162
                     ->  Hash  (cost=7.62..7.62 rows=18 width=13) (actual time=0.154..0.157 rows=46 loops=3)
                           Buckets: 1024  Batches: 1  Memory Usage: 11kB
                           ->  Seq Scan on staging_header fh  (cost=0.00..7.62 rows=18 width=13) (ac
tual time=0.082..0.126 rows=46 loops=3)
                                 Filter: (((entity_id)::text = 'W002'::text) AND ((process_flag)::text = 'N'::text)
AND ((process_status)::text = '00'::text))
                                 Rows Removed by Filter: 121
Planning Time: 65.403 ms
Execution Time: 397960.649 ms
(117 rows)
</code>```

Body:
We have recently migrated to PostgreSQL 15 from Oracle.
My table structure is as in image below. Only indices are primary keys.

We have this program for finding duplicate( for an entity if any staging record exists in main, then mark as duplicate in staging detail)
Main table has approx. 500 million of data. The below query works when staging table has approx. 1 million records (1 million ~ 500 million comparison), but gives statement timeout error for more than 1 million records. No new index was created in PostgreSQL. Do we have option to increase memory or timeout time in Postgres or any new index can be created to run this query for large data?

Edit : edited query with unique_id >= 15684 condition

    SELECT FD.file_id, FD.LINE_NO
from staging_header FH
left join staging_detail FD on FH.file_id = FD.file_id
left join(main_header H left join main_detail D
on H.unique_id = D.unique_id)
ON (FD.TXN_DATE = D.transaction_date and FD.MID = D.merchant_id and FD.TID = D.terminal_id and FD.TXN_REF_NO = D.tx_ref_no
where FH.entity_id = 'XXXX' and FH.entity_id = H.entity_id and unique_id >= 15684
and FH.PROCESS_FLAG = 'N' and FH.PROCESS_STATUS = '00'
and FD.PROCESS_FLAG = 'N' and FD.PROCESS_STATUS = '00'

We have approx. 76 month wise partitions for main_detail table on transaction_date column.

Output of EXPLAIN ANALYSE:

Gather  (cost=686297.66..56604907.59 rows=1 width=16) (actual time=391652.590..397957.305 rows=0 loops=1)
   Workers Planned: 2
   Workers Launched: 2
   ->  Parallel Hash Join  (cost=685297.66..56603907.49 rows=1 width=16) (actual time=391629.181..391630.151 rows=0
loops=3)
         Hash Cond: ((d.transaction_date = fd.txn_date) AND ((d.merchant_id)::text = (fd.mid)::text) AND ((d.termina
l_id)::text = (fd.tid)::text) AND ((d.tx_ref_no)::text = (fd.txn_ref_no)::text) AND ((d.auth_code)::text = (fd.auth_
code)::text))
         ->  Hash Join  (cost=748.33..53211966.04 rows=61120806 width=74) (actual time=48280.346..300238.985 rows=14
2758659 loops=3)
               Hash Cond: (d.unique_id = h.unique_id)
               ->  Parallel Append  (cost=0.00..51719090.37 rows=568323296 width=77) (actual time=0.242..248105.291
rows=454658663 loops=3)
                     ->  Parallel Seq Scan on main_detail_202204 d_68  (cost=0.00..2765248.17 rows=31161217
width=79) (actual time=0.131..36385.007 rows=74786917 loops=1)
                    ->  Parallel Seq Scan on main_detail_202205 d_69  (cost=0.00..2570672.60 rows=28713160
width=83) (actual time=0.139..34076.709 rows=68911584 loops=1)
                     ->  Parallel Seq Scan on main_detail_202210 d_74  (cost=0.00..2525110.23 rows=27849423
width=88) (actual time=0.066..34458.420 rows=66838615 loops=1)
                     ->  Parallel Seq Scan on main_detail_202208 d_72  (cost=0.00..2437750.12 rows=27017712
width=85) (actual time=1.309..31526.598 rows=64842508 loops=1)
                     ->  Parallel Seq Scan on main_detail_202209 d_73  (cost=0.00..2417680.45 rows=26714745
width=88) (actual time=0.389..30640.660 rows=64115389 loops=1)
                     ->  Parallel Seq Scan on main_detail_202207 d_71  (cost=0.00..2380965.98 rows=26395098
width=85) (actual time=1.878..30367.172 rows=63348237 loops=1)
                     ->  Parallel Seq Scan on main_detail_202206 d_70  (cost=0.00..2288957.10 rows=25457710
width=84) (actual time=1.225..30613.453 rows=61098506 loops=1)
                     ->  Parallel Seq Scan on main_detail_202203 d_67  (cost=0.00..2228805.72 rows=27047072
width=79) (actual time=1.204..30554.095 rows=64912973 loops=1)
                     ->  Parallel Seq Scan on main_detail_202211 d_75  (cost=0.00..2114584.45 rows=23342545
width=89) (actual time=2.361..28424.133 rows=56022109 loops=1)
                     ->  Parallel Seq Scan on main_detail_202110 d_62  (cost=0.00..1929836.90 rows=23170790
width=79) (actual time=1.908..24234.816 rows=55609894 loops=1)
                     ->  Parallel Seq Scan on main_detail_202112 d_64  (cost=0.00..1916823.43 rows=23095743
width=80) (actual time=0.309..24250.450 rows=55429782 loops=1)
                     ->  Parallel Seq Scan on main_detail_202202 d_66  (cost=0.00..1841871.05 rows=22302905
width=81) (actual time=0.920..23430.150 rows=53526972 loops=1)
                     ->  Parallel Seq Scan on main_detail_202111 d_63  (cost=0.00..1811233.87 rows=21760687
width=80) (actual time=1.175..10110.061 rows=17408550 loops=3)
                     ->  Parallel Seq Scan on main_detail_202201 d_65  (cost=0.00..1781216.65 rows=21494365
width=81) (actual time=1.924..14664.887 rows=25793238 loops=2)
                     ->  Parallel Seq Scan on main_detail_202108 d_60  (cost=0.00..1672640.07 rows=19995007
width=78) (actual time=1.034..21265.332 rows=47988018 loops=1)
                     ->  Parallel Seq Scan on main_detail_202109 d_61  (cost=0.00..1642747.75 rows=19685775
width=78) (actual time=0.495..20735.015 rows=47245860 loops=1)
                     ->  Parallel Seq Scan on main_detail_202107 d_59  (cost=0.00..1582179.23 rows=18876623
width=75) (actual time=1.217..24656.746 rows=45303895 loops=1)
                     ->  Parallel Seq Scan on main_detail_202106 d_58  (cost=0.00..1416963.00 rows=16879900
width=75) (actual time=0.461..18096.119 rows=40511759 loops=1)
                     ->  Parallel Seq Scan on main_detail_202104 d_56  (cost=0.00..1247189.85 rows=14815785
width=73) (actual time=1.271..16250.747 rows=35557883 loops=1)
                     ->  Parallel Seq Scan on main_detail_202105 d_57  (cost=0.00..1034296.03 rows=12273802
width=75) (actual time=0.279..12897.524 rows=29457126 loops=1)
                     ->  Parallel Seq Scan on main_detail_202001 d_41  (cost=0.00..660224.22 rows=7901322 wi
dth=62) (actual time=0.851..8385.719 rows=18963171 loops=1)
                     ->  Parallel Seq Scan on main_detail_202103 d_55  (cost=0.00..636403.65 rows=7600365 wi
dth=59) (actual time=0.636..7917.474 rows=18240877 loops=1)
                     ->  Parallel Seq Scan on main_detail_201912 d_40  (cost=0.00..634131.68 rows=7575968 wi
dth=62) (actual time=0.981..7876.041 rows=18182322 loops=1)
                     ->  Parallel Seq Scan on main_detail_202002 d_42  (cost=0.00..618985.88 rows=7403088 wi
dth=61) (actual time=0.443..7823.615 rows=17767413 loops=1)
                     ->  Parallel Seq Scan on main_detail_202101 d_53  (cost=0.00..594448.23 rows=7099623 wi
dth=60) (actual time=0.579..7617.154 rows=17039096 loops=1)
                     ->  Parallel Seq Scan on main_detail_202012 d_52  (cost=0.00..592949.22 rows=7075422 wi
dth=60) (actual time=0.289..7599.207 rows=16981011 loops=1)
                     ->  Parallel Seq Scan on main_detail_202102 d_54  (cost=0.00..557941.45 rows=6666945 wi
dth=59) (actual time=1.097..8469.829 rows=16000668 loops=1)
                     ->  Parallel Seq Scan on main_detail_202011 d_51  (cost=0.00..551561.22 rows=6580722 wi
dth=60) (actual time=2.323..7845.248 rows=15793732 loops=1)
                     ->  Parallel Seq Scan on main_detail_202010 d_50  (cost=0.00..541516.32 rows=6465732 wi
dth=60) (actual time=3.071..7509.806 rows=15517757 loops=1)
                     ->  Parallel Seq Scan on main_detail_202003 d_43  (cost=0.00..500525.41 rows=5982441 wi
dth=61) (actual time=0.505..6566.428 rows=14357859 loops=1)
                     ->  Parallel Seq Scan on main_detail_202009 d_49  (cost=0.00..498229.27 rows=5952427 wi
dth=60) (actual time=1.340..6354.120 rows=14285824 loops=1)
                     ->  Parallel Seq Scan on main_detail_202008 d_48  (cost=0.00..473451.19 rows=5649219 wi
dth=60) (actual time=1.899..6152.809 rows=13558126 loops=1)
                     ->  Parallel Seq Scan on main_detail_202007 d_47  (cost=0.00..442856.52 rows=5280052 wi
dth=60) (actual time=0.688..5718.016 rows=12672124 loops=1)
                     ->  Parallel Seq Scan on main_detail_202006 d_46  (cost=0.00..431238.51 rows=5139651 wi
dth=60) (actual time=1.022..5570.241 rows=12335163 loops=1)
                     ->  Parallel Seq Scan on main_detail_202005 d_45  (cost=0.00..322049.82 rows=3843882 wi
dth=59) (actual time=0.514..4179.456 rows=9225317 loops=1)
                     ->  Parallel Seq Scan on main_detail_202004 d_44  (cost=0.00..170375.59 rows=2033059 wi
dth=59) (actual time=1.270..2200.745 rows=4879342 loops=1)
                     ->  Parallel Seq Scan on main_detail_201911 d_39  (cost=0.00..99748.34 rows=1126534 wid
th=60) (actual time=0.442..1238.540 rows=2703682 loops=1)
                     ->  Parallel Seq Scan on main_detail_201904 d_32  (cost=0.00..77520.76 rows=877776 widt
h=60) (actual time=1.233..1038.713 rows=2106663 loops=1)
                     ->  Parallel Seq Scan on main_detail_201905 d_33  (cost=0.00..75244.24 rows=852324 widt
h=60) (actual time=0.033..1018.941 rows=2045578 loops=1)
                     ->  Parallel Seq Scan on main_detail_201908 d_36  (cost=0.00..71581.46 rows=807346 widt
h=60) (actual time=0.034..756.542 rows=1937631 loops=1)
                     ->  Parallel Seq Scan on main_detail_201907 d_35  (cost=0.00..70736.10 rows=798410 widt
h=60) (actual time=0.031..815.549 rows=1916185 loops=1)
                     ->  Parallel Seq Scan on main_detail_201906 d_34  (cost=0.00..70287.73 rows=795673 widt
h=60) (actual time=4.525..1071.337 rows=1909616 loops=1)
                     ->  Parallel Seq Scan on main_detail_201910 d_38  (cost=0.00..64894.83 rows=731183 widt
h=60) (actual time=4.229..1106.733 rows=1754839 loops=1)
                     ->  Parallel Seq Scan on main_detail_201909 d_37  (cost=0.00..64030.31 rows=722131 widt
h=60) (actual time=0.036..1115.049 rows=1733114 loops=1)
                     ->  Parallel Seq Scan on main_detail_202212 d_76  (cost=0.00..62668.10 rows=734710 widt
h=70) (actual time=0.502..941.721 rows=1763305 loops=1)
                     ->  Parallel Seq Scan on main_detail_201704 d_8  (cost=0.00..20424.27 rows=244827 width
=59) (actual time=0.023..253.853 rows=587584 loops=1)
                     ->  Parallel Seq Scan on main_detail_201805 d_21  (cost=0.00..18971.21 rows=222421 widt
h=60) (actual time=0.365..255.920 rows=534441 loops=1)
                     ->  Parallel Seq Scan on main_detail_201806 d_22  (cost=0.00..17918.28 rows=211428 widt
h=60) (actual time=0.022..244.113 rows=507427 loops=1)
                     ->  Parallel Seq Scan on main_detail_201804 d_20  (cost=0.00..17845.21 rows=210521 widt
h=60) (actual time=0.033..227.176 rows=505301 loops=1)
                     ->  Parallel Seq Scan on main_detail_201803 d_19  (cost=0.00..17609.88 rows=208088 widt
h=60) (actual time=0.018..201.712 rows=499411 loops=1)
                     ->  Parallel Seq Scan on main_detail_201810 d_26  (cost=0.00..17272.90 rows=203890 widt
h=60) (actual time=3.561..241.027 rows=489337 loops=1)
                     ->  Parallel Seq Scan on main_detail_201811 d_27  (cost=0.00..16898.90 rows=199690 widt
h=60) (actual time=0.016..226.327 rows=479255 loops=1)
                     ->  Parallel Seq Scan on main_detail_201801 d_17  (cost=0.00..16872.47 rows=199347 widt
h=60) (actual time=0.011..228.096 rows=478432 loops=1)
                     ->  Parallel Seq Scan on main_detail_201809 d_25  (cost=0.00..16693.76 rows=197076 widt
h=60) (actual time=0.011..232.691 rows=472983 loops=1)
                     ->  Parallel Seq Scan on main_detail_201808 d_24  (cost=0.00..16615.35 rows=196135 widt
h=60) (actual time=0.527..256.811 rows=470725 loops=1)
                     ->  Parallel Seq Scan on main_detail_201705 d_9  (cost=0.00..16518.85 rows=196985 width
=60) (actual time=0.633..247.533 rows=472764 loops=1)
                     ->  Parallel Seq Scan on main_detail_201710 d_14  (cost=0.00..16385.53 rows=192653 widt
h=61) (actual time=0.011..242.029 rows=462368 loops=1)
                     ->  Parallel Seq Scan on main_detail_201807 d_23  (cost=0.00..16300.88 rows=192788 widt
h=60) (actual time=0.011..212.557 rows=462691 loops=1)
                     ->  Parallel Seq Scan on main_detail_201712 d_16  (cost=0.00..15956.17 rows=189018 widt
h=60) (actual time=0.377..233.791 rows=453642 loops=1)
                     ->  Parallel Seq Scan on main_detail_201903 d_31  (cost=0.00..15630.37 rows=184637 widt
h=60) (actual time=2.076..195.545 rows=443129 loops=1)
                     ->  Parallel Seq Scan on main_detail_201802 d_18  (cost=0.00..15556.97 rows=183697 widt
h=60) (actual time=0.019..200.397 rows=440872 loops=1)
                     ->  Parallel Seq Scan on main_detail_201812 d_28  (cost=0.00..15281.62 rows=180662 widt
h=60) (actual time=2.067..209.129 rows=433590 loops=1)
                     ->  Parallel Seq Scan on main_detail_201709 d_13  (cost=0.00..14963.41 rows=177641 widt
h=60) (actual time=0.011..207.096 rows=426339 loops=1)
                     ->  Parallel Seq Scan on main_detail_201901 d_29  (cost=0.00..14355.48 rows=169448 widt
h=60) (actual time=0.453..200.458 rows=406674 loops=1)
                     ->  Parallel Seq Scan on main_detail_201708 d_12  (cost=0.00..14190.58 rows=168458 widt
h=60) (actual time=0.676..187.462 rows=404299 loops=1)
                     ->  Parallel Seq Scan on main_detail_201711 d_15  (cost=0.00..13645.50 rows=161350 widt
h=60) (actual time=0.487..190.109 rows=387239 loops=1)
                     ->  Parallel Seq Scan on main_detail_201902 d_30  (cost=0.00..13521.67 rows=159367 widt
h=60) (actual time=0.643..183.340 rows=382480 loops=1)
                     ->  Parallel Seq Scan on main_detail_201706 d_10  (cost=0.00..13430.53 rows=159553 widt
h=60) (actual time=0.981..186.323 rows=382928 loops=1)
                     ->  Parallel Seq Scan on main_detail_201707 d_11  (cost=0.00..13163.89 rows=156389 widt
h=60) (actual time=2.020..183.935 rows=375334 loops=1)
                     ->  Parallel Seq Scan on main_detail_201703 d_7  (cost=0.00..926.89 rows=14989 width=60
) (actual time=0.009..10.364 rows=25481 loops=1)
                     ->  Parallel Seq Scan on main_detail_201612 d_4  (cost=0.00..14.23 rows=223 width=61) (
actual time=0.009..0.556 rows=379 loops=1)
                     ->  Parallel Seq Scan on main_detail_201610 d_2  (cost=0.00..10.29 rows=29 width=408) (
actual time=0.000..0.003 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202301 d_77  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.001 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202302 d_78  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.001..0.001 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202303 d_79  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.001 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202304 d_80  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.003 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202305 d_81  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.000 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202306 d_82  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.000 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202307 d_83  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.000 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202308 d_84  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.000 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202309 d_85  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.002 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202310 d_86  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.000 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_202312 d_87  (cost=0.00..10.29 rows=29 width=408)
(actual time=0.000..0.001 rows=0 loops=1)
                     ->  Parallel Seq Scan on main_detail_201702 d_6  (cost=0.00..7.06 rows=106 width=61) (a
ctual time=0.009..0.457 rows=180 loops=1)
                     ->  Parallel Seq Scan on main_detail_before_2016 d_1  (cost=0.00..2.43 rows=43 width=21
6) (actual time=0.010..0.027 rows=73 loops=1)
                     ->  Parallel Seq Scan on main_detail_201701 d_5  (cost=0.00..2.35 rows=35 width=60) (ac
tual time=0.318..0.336 rows=59 loops=1)
                     ->  Parallel Seq Scan on main_detail_201611 d_3  (cost=0.00..1.02 rows=2 width=408) (ac
tual time=0.453..0.458 rows=4 loops=1)
               ->  Hash  (cost=717.83..717.83 rows=2440 width=13) (actual time=100.803..100.806 rows=4086 loops=3)
                     Buckets: 4096  Batches: 1  Memory Usage: 212kB
                     ->  Bitmap Heap Scan on main_header h  (cost=47.54..717.83 rows=2440 width=13) (actual
time=1.429..99.670 rows=4086 loops=3)
                           Recheck Cond: ((entity_id)::text = 'W002'::text)
                           Filter: (unique_id >= 15684)
                           Heap Blocks: exact=421
                           ->  Bitmap Index Scan on idx_pos_cb_hdr_t99  (cost=0.00..46.93 rows=4086 width=0) (actual
time=1.002..1.002 rows=4086 loops=3)
                                 Index Cond: ((entity_id)::text = 'W002'::text)
         ->  Parallel Hash  (cost=661416.16..661416.16 rows=606763 width=101) (actual time=7268.024..7268.037 rows=1
894307 loops=3)
               Buckets: 65536 (originally 65536)  Batches: 128 (originally 32)  Memory Usage: 7136kB
               ->  Hash Join  (cost=7.85..661416.16 rows=606763 width=101) (actual time=3559.203..5547.343 rows=1894
307 loops=3)
                     Hash Cond: (fd.file_id = fh.file_id)
                     ->  Parallel Seq Scan on staging_detail fd  (cost=0.00..642716.64 rows=6977776
width=96) (actual time=1.887..4871.854 rows=5580857 loops=3)
                           Filter: (((process_flag)::text = 'N'::text) AND ((process_status)::text = '00'::text))
                           Rows Removed by Filter: 162
                     ->  Hash  (cost=7.62..7.62 rows=18 width=13) (actual time=0.154..0.157 rows=46 loops=3)
                           Buckets: 1024  Batches: 1  Memory Usage: 11kB
                           ->  Seq Scan on staging_header fh  (cost=0.00..7.62 rows=18 width=13) (ac
tual time=0.082..0.126 rows=46 loops=3)
                                 Filter: (((entity_id)::text = 'W002'::text) AND ((process_flag)::text = 'N'::text)
AND ((process_status)::text = '00'::text))
                                 Rows Removed by Filter: 121
Planning Time: 65.403 ms
Execution Time: 397960.649 ms
(117 rows)


来源: stackexchange

问:
Specified Cast Is Not Valid (Asp.net MVC)
specified cast is not valid while i am trying to bind dropdownlist value to db
**I want to Take the value from dropdown from model and when i click on create it should insert into db table instead of inserting  deptartment names interger values are assigning to the column
Pls help me
**
My
Model

```<code> public Departments DeptNames { get; set; }
        public enum Departments
        {
            ECE=1,
            CSE=2,
            MECH=3,
            CIVIL=4
        }
</code>```

MY Repository

```<code>  public List<ModelClass> ShowListOfUserDetails()
        {
                List<ModelClass> models = new List<ModelClass>();
                SqlCommand cmd = new SqlCommand("sp_ShowUserDetails", con);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataTable dt = new DataTable();
                con.Open();
                da.Fill(dt);
                con.Close();
                foreach (DataRow dr in dt.Rows)
                {
                    models.Add(new ModelClass
                    {
                        Id = Convert.ToInt32(dr["pid"]),
                        Name = Convert.ToString(dr["namee"]),
                        City = Convert.ToString(dr["city"]),
                        Address = Convert.ToString(dr["addresss"]),
                        Gender = Convert.ToString(dr["gender"]),
                        DeptNames = (ModelClass.Departments)dr["department"]
                    });
                }
            return models;
        }
</code>```

MY View

```<code>@foreach (var item in Model) {
<tr>
    <td>
        @Html.DisplayFor(modelItem =>item.Id)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.Name)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.City)
    </td>
    <td>
        @Html.DisplayFor(modelItem => item.Address)
    </td>
    <td>
        @Html.DisplayFor(modelItem=>item.Gender)
    </td>
    <td>
        @Html.DisplayFor(modelItem=>item.DeptNames)
    </td>
    <td>
</tr>
</code>```

ContentLicense: CC BY-SA 4.0

Body:
specified cast is not valid while i am trying to bind dropdownlist value to db
**I want to Take the value from dropdown from model and when i click on create it should insert into db table instead of inserting  deptartment names interger values are assigning to the column
Pls help me
**
My
Model

 public Departments DeptNames { get; set; }
        public enum Departments
        {
            ECE=1,
            CSE=2,
            MECH=3,
            CIVIL=4
        }

MY Repository

  public List<ModelClass> ShowListOfUserDetails()
        {
                List<ModelClass> models = new List<ModelClass>();
                SqlCommand cmd = new SqlCommand("sp_ShowUserDetails", con);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                DataTable dt = new DataTable();
                con.Open();
                da.Fill(dt);
                con.Close();
                foreach (DataRow dr in dt.Rows)
                {
                    models.Add(new ModelClass
                    {
                        Id = Convert.ToInt32(dr["pid"]),
                        Name = Convert.ToString(dr["namee"]),
                        City = Convert.ToString(dr["city"]),
                        Address = Convert.ToString(dr["addresss"]),
                        Gender = Convert.ToString(dr["gender"]),
                        DeptNames = (ModelClass.Departments)dr["department"]
                    });
                }
            return models;
        }

MY View

@foreach (var item in Model) {

        @Html.DisplayFor(modelItem =>item.Id)

        @Html.DisplayFor(modelItem => item.Name)

        @Html.DisplayFor(modelItem => item.City)

        @Html.DisplayFor(modelItem => item.Address)

        @Html.DisplayFor(modelItem=>item.Gender)

        @Html.DisplayFor(modelItem=>item.DeptNames)


问:
ExpressJs - NODEMAILER not sending email on production mode using vercel
im really stuck here. i already try a couple hours to solve this. on development, nodemailer works for sending email, like verification or reset password. but when i deploy or on production mode using vercel, nodemailer not work. can somebody help me? please? i really stuck here. thank you. here's the code</p>
```<code>const nodemailer = require("nodemailer");
const fs = require("fs");
const mustache = require("mustache");
const path = require("path");
const gmail = require("../config/gmail");

module.exports = {
  sendMail: (data) => {
    // eslint-disable-next-line no-new
    new Promise((resolve, reject) => {
      const transporter = nodemailer.createTransport({
        service: "gmail",
        host: "smtp.gmail.com",
        port: 465,
        auth: {
          type: "OAuth2",
          user: process.env.MAIL_USERNAME,
          pass: process.env.APP_PASSWORD,
          clientId: gmail.clientId,
          clientSecret: gmail.clientSecret,
          refreshToken: gmail.refreshToken,
          accessToken: gmail.accessToken,
        },
        secure: "true",
      });

      const filePath = path.join(
        __dirname,
        `../../src/templates/email/${data.template}`
      );

      const fileTemplate = fs.readFileSync(filePath, "utf8");
      const mailOptions = {
        from: '"Event Organizing" <arkawebdev1@gmail.com>',
        to: data.to,
        subject: data.subject,
        html: mustache.render(fileTemplate, { ...data }),
      };

      transporter.sendMail(mailOptions, (error, result) => {
        if (error) {
          reject(error);
        } else {
          resolve(result);
        }
      });
    });
  },
};
</code>```

Body:
im really stuck here. i already try a couple hours to solve this. on development, nodemailer works for sending email, like verification or reset password. but when i deploy or on production mode using vercel, nodemailer not work. can somebody help me? please? i really stuck here. thank you. here's the code

const nodemailer = require("nodemailer");
const fs = require("fs");
const mustache = require("mustache");
const path = require("path");
const gmail = require("../config/gmail");

module.exports = {
  sendMail: (data) => {
    // eslint-disable-next-line no-new
    new Promise((resolve, reject) => {
      const transporter = nodemailer.createTransport({
        service: "gmail",
        host: "smtp.gmail.com",
        port: 465,
        auth: {
          type: "OAuth2",
          user: process.env.MAIL_USERNAME,
          pass: process.env.APP_PASSWORD,
          clientId: gmail.clientId,
          clientSecret: gmail.clientSecret,
          refreshToken: gmail.refreshToken,
          accessToken: gmail.accessToken,
        },
        secure: "true",
      });

      const filePath = path.join(
        __dirname,
        `../../src/templates/email/${data.template}`
      );

      const fileTemplate = fs.readFileSync(filePath, "utf8");
      const mailOptions = {
        from: '"Event Organizing" <arkawebdev1@gmail.com>',
        to: data.to,
        subject: data.subject,
        html: mustache.render(fileTemplate, { ...data }),
      };

      transporter.sendMail(mailOptions, (error, result) => {
        if (error) {
          reject(error);
        } else {
          resolve(result);
        }
      });
    });
  },
};


问:
Problem trying to set int variable outside a while loop from inside a while loop
I am having an issue where I want to run a while loop that will find all the angle brackets an a given line of text but for some reason, the while loop will loop infinitely and the conditions to break it will never be met. The reason for this is because in my code I have an int variable called "leftAngleIndex" which is initially set to 0 I also have another variable called "rightAngleIndex" which is also initially set to 0. After these two variables I have two more variables called "leftAngleBracketLocation" and "rightAngleBracketLocation" these variables both find a "<" or a ">" starting at the index of "leftAngleIndex" or "rightAngleIndex" so 0 in this case.

Now the issue is when we get to the end of the while loop I want to set values of "leftAngleIndex" equal to "leftAngleBracketLocation" and the same thing for "rightAngleIndex". By doing this we will be able to find all of the "<" and ">" in our line of text. And once there is no more "<" or ">" then are loop should break because the value of "leftAngleBracketLocation" will be set to -1.

This is not the case however and for some reason I can not set "rightAngleIndex" equal to rightAngleBracketLocation and the same thing for "leftAngleIndex" I can not set it equal to "leftAngleBracketLocation". And that is why I am here I am not sure why I am not able to set these values.

```<code>/**
 *
 * This method takes in our final phrase and replaces Non-Terminals until all the Non-Terminals have been replaced
 *
 * @param phrase
 * @return final phrase
 */
private static String buildPhrase(String phrase) {
    // Create a string builder for the final phrase and for any Non-Terminals we find.
    StringBuilder finalPhrase = new StringBuilder();
    StringBuilder NonTerminal = new StringBuilder();

    int start = 0;
    int leftAngleIndex = 0;
    int rightAngleIndex = 0;
    int end = phrase.length();

    // Will find index of the current "<" bracket.
    int leftAngleBracketLocation = phrase.indexOf("<", leftAngleIndex);

    // Will find the index of the current ">" bracket.
    int rightAngleBracketLocation = phrase.indexOf(">", rightAngleIndex);

    // Will find all of the Non-Terminal values in our phrase and then replace them with terminal values.
    while (leftAngleBracketLocation != -1) {
        // This will append everything up to the first Non-Terminal.
        finalPhrase.append(phrase, start, leftAngleBracketLocation);

        // This will append the non-terminal and tell us what non-terminal we have so we can find the coresponding terminal value for it.
        NonTerminal.append(phrase, leftAngleBracketLocation, rightAngleBracketLocation);

        // This will allow us to keep finding non-terminals unitl there is no more non-terminals.
        leftAngleIndex = leftAngleBracketLocation;
        rightAngleIndex = rightAngleBracketLocation;
    }

    // This will append the rest of our phrase.
    finalPhrase.append(phrase, rightAngleBracketLocation, end);

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

Body:
I am having an issue where I want to run a while loop that will find all the angle brackets an a given line of text but for some reason, the while loop will loop infinitely and the conditions to break it will never be met. The reason for this is because in my code I have an int variable called "leftAngleIndex" which is initially set to 0 I also have another variable called "rightAngleIndex" which is also initially set to 0. After these two variables I have two more variables called "leftAngleBracketLocation" and "rightAngleBracketLocation" these variables both find a "<" or a ">" starting at the index of "leftAngleIndex" or "rightAngleIndex" so 0 in this case.

Now the issue is when we get to the end of the while loop I want to set values of "leftAngleIndex" equal to "leftAngleBracketLocation" and the same thing for "rightAngleIndex". By doing this we will be able to find all of the "<" and ">" in our line of text. And once there is no more "<" or ">" then are loop should break because the value of "leftAngleBracketLocation" will be set to -1.

This is not the case however and for some reason I can not set "rightAngleIndex" equal to rightAngleBracketLocation and the same thing for "leftAngleIndex" I can not set it equal to "leftAngleBracketLocation". And that is why I am here I am not sure why I am not able to set these values.

/**
 *
 * This method takes in our final phrase and replaces Non-Terminals until all the Non-Terminals have been replaced
 *
 * @param phrase
 * @return final phrase
 */
private static String buildPhrase(String phrase) {
    // Create a string builder for the final phrase and for any Non-Terminals we find.
    StringBuilder finalPhrase = new StringBuilder();
    StringBuilder NonTerminal = new StringBuilder();

    int start = 0;
    int leftAngleIndex = 0;
    int rightAngleIndex = 0;
    int end = phrase.length();

    // Will find index of the current "<" bracket.
    int leftAngleBracketLocation = phrase.indexOf("<", leftAngleIndex);

    // Will find the index of the current ">" bracket.
    int rightAngleBracketLocation = phrase.indexOf(">", rightAngleIndex);

    // Will find all of the Non-Terminal values in our phrase and then replace them with terminal values.
    while (leftAngleBracketLocation != -1) {
        // This will append everything up to the first Non-Terminal.
        finalPhrase.append(phrase, start, leftAngleBracketLocation);

        // This will append the non-terminal and tell us what non-terminal we have so we can find the coresponding terminal value for it.
        NonTerminal.append(phrase, leftAngleBracketLocation, rightAngleBracketLocation);

        // This will allow us to keep finding non-terminals unitl there is no more non-terminals.
        leftAngleIndex = leftAngleBracketLocation;
        rightAngleIndex = rightAngleBracketLocation;
    }

    // This will append the rest of our phrase.
    finalPhrase.append(phrase, rightAngleBracketLocation, end);

    return finalPhrase.toString();
}


问:
javascript date difference showing wrong in ios
I'm trying to add a timer using the function, but it's working fine in windows, but showing the wrong timer in IOS.

```<code>enddate = "2023-04-25 00:00:00";

getEventTimer() {
    setInterval(() => {
      if(this._diff > 0) {
        this._days = this.getDays(this._diff);
        this._hours = this.getHours(this._diff);
        this._minutes = this.getMinutes(this._diff);
        this._seconds = this.getSeconds(this._diff);
      } else {
        this._days = 0;
        this._hours = 0;
        this._minutes = 0;
        this._seconds = 0;
      }

      const s:any = new Date(this.enddate.toLocaleString().replace(/-/g, "/"));
      const t:any = new Date(new Date().toLocaleString().replace(/-/g, "/"));
      this._diff = s - t;
    }, 1000);

  }

 getDays(t) {
    return Math.floor(t / (1000 * 60 * 60 * 24));
  }

  getHours(t) {
    return Math.floor((t / (1000 * 60 * 60)) % 24);
  }

  getMinutes(t) {
    return Math.floor((t / 1000 / 60) % 60);
  }

  getSeconds(t) {
    return Math.floor((t / 1000) % 60);
  }
</code>```

..................................................................................................................................

expecting the correct timer.

Body:
I'm trying to add a timer using the function, but it's working fine in windows, but showing the wrong timer in IOS.

enddate = "2023-04-25 00:00:00";

getEventTimer() {
    setInterval(() => {
      if(this._diff > 0) {
        this._days = this.getDays(this._diff);
        this._hours = this.getHours(this._diff);
        this._minutes = this.getMinutes(this._diff);
        this._seconds = this.getSeconds(this._diff);
      } else {
        this._days = 0;
        this._hours = 0;
        this._minutes = 0;
        this._seconds = 0;
      }

      const s:any = new Date(this.enddate.toLocaleString().replace(/-/g, "/"));
      const t:any = new Date(new Date().toLocaleString().replace(/-/g, "/"));
      this._diff = s - t;
    }, 1000);

  }

 getDays(t) {
    return Math.floor(t / (1000 * 60 * 60 * 24));
  }

  getHours(t) {
    return Math.floor((t / (1000 * 60 * 60)) % 24);
  }

  getMinutes(t) {
    return Math.floor((t / 1000 / 60) % 60);
  }

  getSeconds(t) {
    return Math.floor((t / 1000) % 60);
  }

..................................................................................................................................

expecting the correct timer.


问:
Pytorch: save tensor into transparent image
I would like to save the tensor image as a transparent image because I want to merge two images. I have tried different solutions but always there are tensor reshape problems. I am unable to do so. The shape of the tensor is torch.Size([1, 1, 256, 256])

```<code>from torchvision.utils import save_image

image = net_G(input_image)
        # transform = T.ToPILImage()
        # image = torch.squeeze(image, 0).shape
        # img = transform(image)

save_image(img, full_output_dir+'/%s.jpg' % name, transparency=255)
</code>```

Body:
I would like to save the tensor image as a transparent image because I want to merge two images. I have tried different solutions but always there are tensor reshape problems. I am unable to do so. The shape of the tensor is torch.Size([1, 1, 256, 256])

from torchvision.utils import save_image

image = net_G(input_image)
        # transform = T.ToPILImage()
        # image = torch.squeeze(image, 0).shape
        # img = transform(image)

save_image(img, full_output_dir+'/%s.jpg' % name, transparency=255)


问:
How to load datapoints from 4 array in CanvasJS to create a chart
I want to use chart canvasjs to display 4 different data.
My data is for the balances of 4 different accounts in the last 10 days and I want the x-axis of the days and the y-axis of the balance amounts.

my code :

const ColorBac = ["rgba(255, 0, 50, 0.2)", "rgba(27, 68, 128, 0.2)", "rgba(246, 162, 30, 0.2)", "rgba(23, 135, 95, 0.2)"];
const Colorborder = ["rgba(255, 0, 50, 0.6)", "rgba(27, 68, 128, 0.6)", "rgba(246, 162, 30, 0.6)", "rgba(23, 135, 95, 0.6)"];

Api = api('Chart');
console.log("load Api Array");
console.log(Api.ExData);

function setColor(chart) {
  for (var i = 0; i < chart.options.data.length; i++) {
    dataSeries = chart.options.data[i];

    for (var j = 0; j < dataSeries.dataPoints.length; j++) {
      if (dataSeries.dataPoints[j].y <= 0)
        dataSeries.dataPoints[j].color = ColorBac[j];
    }
  }
}

function ShowChart() {
  var dataPoints = [];
  //GetData();
  $.each(Api.ExData, function(index, Info) {
    dataPoints.push({
      x: parseInt(Info.fldHesabID),
      y: parseInt(Info.fldMojoodi),
      label: Info.fldDate,
      mouseover: onMouseover,
    });
  });
  console.log('load dataPoints');
  console.log(dataPoints);
  ///////
  var chart = new CanvasJS.Chart("chartContainer", {
    animationEnabled: true,
    theme: "light2", // "light1", "light2", "dark1", "dark2"

    axisY: {
      //title: "Reserves(MMbbl)"
      //labelAngle: 30
    },
    axisX: {
      interval: 1,
      //minimum: 0,
      //  maximum: 20,
      labelAngle: 30
    },
    data: [{
      type: "line",
      toolTipContent: "{label}: {y} ",
      dataPoints: dataPoints,
    }]
  });

  console.log('load Chart');
  setColor(chart);
  chart.render();

  function onMouseover(e) {
    createGauge(e.dataPoint.progressVal);
  }
}
ShowChart();
console.log('end Chart');```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div id="chartContainer" style="height: 370px; width: 100%;border: 1px solid green;"></div>
<br>

<script type="text/javascript" src="https://canvasjs.com/assets/script/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="https://canvasjs.com/assets/script/canvasjs.min.js"></script></code>```

My data output is in the form of a photo.

Please help me to display this chart

Body:
I want to use chart canvasjs to display 4 different data.
My data is for the balances of 4 different accounts in the last 10 days and I want the x-axis of the days and the y-axis of the balance amounts.

my code :

const ColorBac = ["rgba(255, 0, 50, 0.2)", "rgba(27, 68, 128, 0.2)", "rgba(246, 162, 30, 0.2)", "rgba(23, 135, 95, 0.2)"];
const Colorborder = ["rgba(255, 0, 50, 0.6)", "rgba(27, 68, 128, 0.6)", "rgba(246, 162, 30, 0.6)", "rgba(23, 135, 95, 0.6)"];

Api = api('Chart');
console.log("load Api Array");
console.log(Api.ExData);

function setColor(chart) {
  for (var i = 0; i < chart.options.data.length; i++) {
    dataSeries = chart.options.data[i];

    for (var j = 0; j < dataSeries.dataPoints.length; j++) {
      if (dataSeries.dataPoints[j].y <= 0)
        dataSeries.dataPoints[j].color = ColorBac[j];
    }
  }
}

function ShowChart() {
  var dataPoints = [];
  //GetData();
  $.each(Api.ExData, function(index, Info) {
    dataPoints.push({
      x: parseInt(Info.fldHesabID),
      y: parseInt(Info.fldMojoodi),
      label: Info.fldDate,
      mouseover: onMouseover,
    });
  });
  console.log('load dataPoints');
  console.log(dataPoints);
  ///////
  var chart = new CanvasJS.Chart("chartContainer", {
    animationEnabled: true,
    theme: "light2", // "light1", "light2", "dark1", "dark2"

    axisY: {
      //title: "Reserves(MMbbl)"
      //labelAngle: 30
    },
    axisX: {
      interval: 1,
      //minimum: 0,
      //  maximum: 20,
      labelAngle: 30
    },
    data: [{
      type: "line",
      toolTipContent: "{label}: {y} ",
      dataPoints: dataPoints,
    }]
  });

  console.log('load Chart');
  setColor(chart);
  chart.render();

  function onMouseover(e) {
    createGauge(e.dataPoint.progressVal);
  }
}
ShowChart();
console.log('end Chart');

My data output is in the form of a photo.

Please help me to display this chart


问:
Flutter RepeatInterval local notification
anybody knows how to make the periodicaly show in flutter to show different notification and not the same over and over again?
Here is my code:

```<code>Future<void> showNotification(int id, String title, String body) async {
    await flutterLocalNotificationsPlugin.periodicallyShow(
      id,
      title,
      body,
      RepeatInterval.everyMinute,
      const NotificationDetails(
        // Android details
        android: AndroidNotificationDetails('main_channel', 'Main Channel',
            channelDescription: "ashwin",
            importance: Importance.max,
            priority: Priority.max),
        // iOS details
        iOS: DarwinNotificationDetails(
          sound: 'default.wav',
          presentAlert: true,
          presentBadge: true,
          presentSound: true,
        ),
      ),
      androidAllowWhileIdle:
          true, // To show notification even when the app is closed
    );
  }
</code>```

It works fine but it show me the same notification over and over again, I call this function in another class and in the body I have a randomName variable from a list, the problem it s not updating at every notification as i want and it display one random String again at every interval of time. I want to be updated every time the user get a notification.

```<code>String? randomName;
    final random = new Random();
    randomName = names[random.nextInt(names.length)];
</code>```
```<code>onPressed: () {
                      setState(() {
                        showToast();
                        NotificationService().showNotification(
                          1,
                          'sada',
                          randomName!,
                        );
                      });
                    },
</code>```

This 2 codes are from another class

Body:
anybody knows how to make the periodicaly show in flutter to show different notification and not the same over and over again?
Here is my code:

Future<void> showNotification(int id, String title, String body) async {
    await flutterLocalNotificationsPlugin.periodicallyShow(
      id,
      title,
      body,
      RepeatInterval.everyMinute,
      const NotificationDetails(
        // Android details
        android: AndroidNotificationDetails('main_channel', 'Main Channel',
            channelDescription: "ashwin",
            importance: Importance.max,
            priority: Priority.max),
        // iOS details
        iOS: DarwinNotificationDetails(
          sound: 'default.wav',
          presentAlert: true,
          presentBadge: true,
          presentSound: true,
        ),
      ),
      androidAllowWhileIdle:
          true, // To show notification even when the app is closed
    );
  }

It works fine but it show me the same notification over and over again, I call this function in another class and in the body I have a randomName variable from a list, the problem it s not updating at every notification as i want and it display one random String again at every interval of time. I want to be updated every time the user get a notification.

String? randomName;
    final random = new Random();
    randomName = names[random.nextInt(names.length)];

onPressed: () {
                      setState(() {
                        showToast();
                        NotificationService().showNotification(
                          1,
                          'sada',
                          randomName!,
                        );
                      });
                    },

This 2 codes are from another class


问:
How to fetch all stale branches on a GitHub repo?
I know there's a GET /repos/{owner}/{repo}/branches API for listing branches.
Is there one for stale branches? Or is it possible to select the stale branches from those returned by the list branches API?


问:
Developer console shows rating but not on market
My console says I have (2) ratings (but no comments) on one of my apps but when I look on the market there are no ratings (or comments).
Has anyone had this confusing report before?</p>

ContentLicense: CC BY-SA 3.0


问:
Compiler for dart
Is there any editor for dart.
I was trying to run my dart program at vscode it runs but did not print anything.
I was trying to take input from user and add it into a list of numbers and then show the list on console.
It takes the input but did not shown any list.</p>
```<code>// Importing dart:io file
import 'dart:io';

void main() {
  List<int> list = [5];

  // Scanning number
  for (var i = 0; i < list.length; i++) {
    int? n = int.parse(stdin.readLineSync()!);
    list.add(n);
  }
  // Here ? and ! are for null safety

  // Printing that number
  print("Your list $list");
}

</code>```

Title: Compiler for dart

Body:
Is there any editor for dart.
I was trying to run my dart program at vscode it runs but did not print anything.
I was trying to take input from user and add it into a list of numbers and then show the list on console.
It takes the input but did not shown any list.

// Importing dart:io file
import 'dart:io';

void main() {
  List<int> list = [5];

  // Scanning number
  for (var i = 0; i < list.length; i++) {
    int? n = int.parse(stdin.readLineSync()!);
    list.add(n);
  }
  // Here ? and ! are for null safety

  // Printing that number
  print("Your list $list");
}


问:
Exception handling in SSIS Task for Hive Commands to run on Linux server from SSIS Package
I'm executing SSIS Task, Task is about running the file(which contains hive commands) on a Linux server from the SSIS package using SSH Connection manager by copying files to Linux server and passing a command from SSIS Task to execute the file.

Some of the commands are successfully executed, and some got failed. But the SSIS Task shows it as successfully completed the test execution.

So, How to fail the SSIS task whenever the hive command failed on the Linux server?


问:
invalid request when signing in using AppAuth in Android and not getting Access Token
I have integrated login using appAuth, I am able to redirect to my IDP page using redirect URI as soon as I click on sign-in button from my idp I see an invalid request and an Authorization exception null with an Authorization response.

I tried the demo of appAuth open id Android library github and in that too I can see the same issue. I want a solution for signing in successfully and getting an Access token from appAuth.


问:
android.inputmethodservice.KeyboardView.showKey(KeyboardView.java:925) CharSequence.length() on a null object reference at
``Hi developers I am working on a keyboard app. I'm facing an exception that I can't detect because it's on the keyboard end. If anyone knows about this exception please help.</p>
```<code>Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
       at android.inputmethodservice.KeyboardView.showKey(KeyboardView.java:936)
       at android.inputmethodservice.KeyboardView.access$100(KeyboardView.java:75)
       at android.inputmethodservice.KeyboardView$1.handleMessage(KeyboardView.java:382)
</code>```

Body:
``Hi developers I am working on a keyboard app. I'm facing an exception that I can't detect because it's on the keyboard end. If anyone knows about this exception please help.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
       at android.inputmethodservice.KeyboardView.showKey(KeyboardView.java:936)
       at android.inputmethodservice.KeyboardView.access$100(KeyboardView.java:75)
       at android.inputmethodservice.KeyboardView$1.handleMessage(KeyboardView.java:382)


问:
How to remove/delete a button if a condition is met in WinUI 3?
I'm working on a WinUI 3 application and I have a table with data. On the last column I have a button that says "Update". However I want to remove this button if a condition is met. Right now my button is created on first initialization and then after this condition is checked, it will either stay or be deleted. How can I achieve this behaviour in WinUI 3 application?</p>


问:
I am doing file input/output, and I am attempting to locate a string of characters within a json file and replace them with another string
I am currently writing a program that automates a game I play. I am doing this as a side project and I am currently stuck on a file input/output issue. All the text information stored inside the json file gets fully deleted once I finish running the program. I am trying to find certain phrase in a json file and then replace it with a different one. I made multiple functions to help assist me in doing this. I am utilizing one function to find the line specified within the file, and then another line to replace the string I located with a string I made, based on splicing using a mixture of hard-coded text and a user inputted string. I am aware that I am using cin >> rather than getline and using strings in c++ but I promise you that is not the issue at hand here. The problem is that my entire file's content is being deleted and I am not quite sure why. I will link my code below with a picture of the output and hopefully someone can help me out here because I am genuinely confused, especially since this seems like such a rudimentary task. I took out segments of the code because the entire project is pretty extensive, if there is anything missing down below or anything is unclear please let me know in the comments.

```<code>string FindFullLine(std::ifstream& file, unsigned int num){
    std::string s;
    for (int i = 1; i <= num; i++)
        std::getline(file, s);
    return s;

}
bool replace(std::string& str, const std::string& from, const std::string& to) {
    size_t start_pos = str.find(from);
    if(start_pos == std::string::npos)
        return false;
    str.replace(start_pos, from.length(), to);
    return true;
}
</code>```

^^ separate functions that are being used in this small piece of code below

```<code>        string champo = " \"mainChamp\": ";
        string apo = "\",";
        string champ, ban, gamemode, newchamp;
        cout << "What champion would you like to pick? " << endl;
        cin >> champ;                   //getline doesnt work; cin is not causing the issue
        cout << "\nWhat champion would you like to ban? " << endl;
        cin >> ban;
        cout << "\nWhat gamemode would you like to pick? " << endl;
        cin >> gamemode;
        newchamp = "    \"mainChamp\": \"";
        newchamp += champ;
        newchamp.append(apo);
        ifstream yuumi ("C:\\forfuncoding\\bot\\Yuumi Bot Extension Fix\\bot\\config.json");        //opening file stream for input
        ofstream yuumi1 ("C:\\forfuncoding\\bot\\Yuumi Bot Extension Fix\\bot\\config.json");       //opening file stream for output
        if(!yuumi || !yuumi1){
            cout << "Error opening up files! " << endl;
            exit(0);
        }
        string s = FindFullLine(yuumi, 2);
        string temps;
        string strTemp;
        temps = s;                  //temporary val to store s
        cout << s;
        replace(s, s , newchamp);   //first parameter is where new string is stored, second param is             the old string and third param is what old string is being replaced by new string
        cout << s;
        while(yuumi >> strTemp)
        {
            if(strTemp == temps){
                cout << s;
                strTemp = s;
            }
            yuumi1 << strTemp;
        }
        yuumi.close();             //closes file for output

        yuumi1.close();              //closes file for input
        exit(0);        //just for testing purposes
</code>```

I have tried changing many values by passing them by reference/not by reference, I have tried using fstream with ios::out and ios::in, I have tried using getline, I have tried moving the logic around; making sure all the variables are scoped correctly. At first glance I thought the issue was in the replace function since it returns a bool but after further inspection it also works as is. Originally, the FindFullLine function was made for fstream, but I changed it to ifstream in the parameters, I don't believe that would change much however. I also tried getting rid of the ifstream and ofstream.close(); functions. I have tried practically everything I can think of.Down below is a screenshot of the format I was attempting to copy.

format of text in json file i was copying

I believe I formatted everything correctly in my code in order to match exactly what is happening in the text file. But when I run the code, everything disappears and the text file is blank. Linked down below is the output that I get, there is a cout << statement after the replace function is ran to ensure that everything is working as intended, and from the output's point of view, everything is working correctly.
output from console

Body:
I am currently writing a program that automates a game I play. I am doing this as a side project and I am currently stuck on a file input/output issue. All the text information stored inside the json file gets fully deleted once I finish running the program. I am trying to find certain phrase in a json file and then replace it with a different one. I made multiple functions to help assist me in doing this. I am utilizing one function to find the line specified within the file, and then another line to replace the string I located with a string I made, based on splicing using a mixture of hard-coded text and a user inputted string. I am aware that I am using cin >> rather than getline and using strings in c++ but I promise you that is not the issue at hand here. The problem is that my entire file's content is being deleted and I am not quite sure why. I will link my code below with a picture of the output and hopefully someone can help me out here because I am genuinely confused, especially since this seems like such a rudimentary task. I took out segments of the code because the entire project is pretty extensive, if there is anything missing down below or anything is unclear please let me know in the comments.

string FindFullLine(std::ifstream& file, unsigned int num){
    std::string s;
    for (int i = 1; i <= num; i++)
        std::getline(file, s);
    return s;

}
bool replace(std::string& str, const std::string& from, const std::string& to) {
    size_t start_pos = str.find(from);
    if(start_pos == std::string::npos)
        return false;
    str.replace(start_pos, from.length(), to);
    return true;
}

^^ separate functions that are being used in this small piece of code below

        string champo = " \"mainChamp\": ";
        string apo = "\",";
        string champ, ban, gamemode, newchamp;
        cout << "What champion would you like to pick? " << endl;
        cin >> champ;                   //getline doesnt work; cin is not causing the issue
        cout << "\nWhat champion would you like to ban? " << endl;
        cin >> ban;
        cout << "\nWhat gamemode would you like to pick? " << endl;
        cin >> gamemode;
        newchamp = "    \"mainChamp\": \"";
        newchamp += champ;
        newchamp.append(apo);
        ifstream yuumi ("C:\\forfuncoding\\bot\\Yuumi Bot Extension Fix\\bot\\config.json");        //opening file stream for input
        ofstream yuumi1 ("C:\\forfuncoding\\bot\\Yuumi Bot Extension Fix\\bot\\config.json");       //opening file stream for output
        if(!yuumi || !yuumi1){
            cout << "Error opening up files! " << endl;
            exit(0);
        }
        string s = FindFullLine(yuumi, 2);
        string temps;
        string strTemp;
        temps = s;                  //temporary val to store s
        cout << s;
        replace(s, s , newchamp);   //first parameter is where new string is stored, second param is             the old string and third param is what old string is being replaced by new string
        cout << s;
        while(yuumi >> strTemp)
        {
            if(strTemp == temps){
                cout << s;
                strTemp = s;
            }
            yuumi1 << strTemp;
        }
        yuumi.close();             //closes file for output

        yuumi1.close();              //closes file for input
        exit(0);        //just for testing purposes

I have tried changing many values by passing them by reference/not by reference, I have tried using fstream with ios::out and ios::in, I have tried using getline, I have tried moving the logic around; making sure all the variables are scoped correctly. At first glance I thought the issue was in the replace function since it returns a bool but after further inspection it also works as is. Originally, the FindFullLine function was made for fstream, but I changed it to ifstream in the parameters, I don't believe that would change much however. I also tried getting rid of the ifstream and ofstream.close(); functions. I have tried practically everything I can think of.Down below is a screenshot of the format I was attempting to copy.

format of text in json file i was copying

I believe I formatted everything correctly in my code in order to match exactly what is happening in the text file. But when I run the code, everything disappears and the text file is blank. Linked down below is the output that I get, there is a cout << statement after the replace function is ran to ensure that everything is working as intended, and from the output's point of view, everything is working correctly.
output from console


问:
Template instantiation for type string, but operator overload method gives an error no operator "[]" matches these operands Templates
```<code>
    template <typename T, size_t SIZE>
    struct Array
    {
        const T* data() const
        {
            return std::addressof(m_data[0]);
        }

        constexpr size_t size() const
        {
            return SIZE;
        }

        T* begin() { return data(); }
        T* end() { return data() + size(); }
        T& operator[] (size_t id) { return m_data[id]; }

        T m_data[SIZE];
    }

int main()
{
    Array<int, 3> intArray{ 2, 4, 5 };
    Array<double, 2> doArray{ 3.0, 4 };
    int value = intArray[0];

    const Array<std::string, 2> strArray {"S", "R"};
    const auto strData = strArray.data();
    std::cout << *strData;

    //auto secondStr = strArray[0];
    /* for(const auto& x: strArray)
    {
        std::cout << x;
    }*/

}
</code>```

I am learning templates, not sure why I am getting an error while trying to strArray[0]  "no operator "[]" matches these operands" for strings whereas it works fine for both int and double types above.

Tried with int and double that worked but not sure why it doesnt work with strings

Body:
    template <typename T, size_t SIZE>
    struct Array
    {
        const T* data() const
        {
            return std::addressof(m_data[0]);
        }

        constexpr size_t size() const
        {
            return SIZE;
        }

        T* begin() { return data(); }
        T* end() { return data() + size(); }
        T& operator[] (size_t id) { return m_data[id]; }

        T m_data[SIZE];
    }

int main()
{
    Array<int, 3> intArray{ 2, 4, 5 };
    Array<double, 2> doArray{ 3.0, 4 };
    int value = intArray[0];

    const Array<std::string, 2> strArray {"S", "R"};
    const auto strData = strArray.data();
    std::cout << *strData;

    //auto secondStr = strArray[0];
    /* for(const auto& x: strArray)
    {
        std::cout << x;
    }*/

}

I am learning templates, not sure why I am getting an error while trying to strArray[0]  "no operator "[]" matches these operands" for strings whereas it works fine for both int and double types above.

Tried with int and double that worked but not sure why it doesnt work with strings


问:
How to escape whitespaces with regex search in golang service using mongodb?
I am using mgo driver.
"/^\s+text\s+$/i" this is the regex pattern I want to search in the mongo db.

I tried with MustCompile and Options:"i". But it's not working, there is no data coming.

Code for reference.code

Any string with any number of leading or trailing spaces should come in the result. Example "    text  " should come in the result.

I tried MustCompile, QuoteMeta.


问:
How to select 3 rows above and 3 rows below from selected row
Here is the example script I am working on. After selecting df.loc[df['Name'] == 'Chris'] I am trying to capture 3 rows above and 3 rows below from the selected row. I think I would have to use the df.loc[df['Name'] == 'Chris'] combined with iloc but not sure what would be the best way to achieve this. Any help would be greatly appreciated.

```<code>import pandas as pd

data={'Name':['Karan','Rohit','Sahil','Aryan','Chris','Rodger','Tommy','Sean','Ryan'],'Age':[23,22,21,24,30,33,21,34,55]}
df=pd.DataFrame(data,index=['No.1','No.2','No.3','No.4','No.5','No.6','No.7','No.8','No.9'])
</code>```

Body:
Here is the example script I am working on. After selecting df.loc[df['Name'] == 'Chris'] I am trying to capture 3 rows above and 3 rows below from the selected row. I think I would have to use the df.loc[df['Name'] == 'Chris'] combined with iloc but not sure what would be the best way to achieve this. Any help would be greatly appreciated.

import pandas as pd

data={'Name':['Karan','Rohit','Sahil','Aryan','Chris','Rodger','Tommy','Sean','Ryan'],'Age':[23,22,21,24,30,33,21,34,55]}
df=pd.DataFrame(data,index=['No.1','No.2','No.3','No.4','No.5','No.6','No.7','No.8','No.9'])


问:
php in IIS - header is not correct
I'm testing with my webhook on PHP, run on IIS (windows).
I don't know why i GET with header 'X-ZEvent-Signature', but when receipt is 'X-Zevent-Signature'. In PHP, it is different.
First

Second

I don't know how to solve this problem.

Title: php in IIS - header is not correct


问:
Amplify S3 Documentation "Using Amazon S3" - How to update Auth_Role policies?
I'm trying to understand the AWS Amplify documentation section "Using Amazon S3". It says:

If you set up your Cognito resources manually, the roles will need to be given permission to access the S3 bucket.

There are two roles created by Cognito: an Auth_Role that grants signed-in-user-level bucket access and an Unauth_Role that allows unauthenticated access to resources. Attach the corresponding policies to each role for proper S3 access. Replace {enter bucket name} with the correct S3 bucket.

And then the docs provide JSON examples of Policies for Auth_Role and Unauth_Role. What's confusing me is that when I go into my Roles in my IAM console, I have the following:

amplify--dev-153155-authRole (contains AppSync resources)

amplify--dev-153155-authRole-idp (log group resources)

amplify--dev-153155-unauthRole (empty)

Neither of which contain anything like the JSON examples. The "...authRole" Policy contains actions/resources concerning AppSync, but nothing to do with S3. Likewise for the other two. I expected to find permissions to allow my Amplify app to get/store S3 items, otherwise how is it able to currently do it?

So my questions are:

How do I create and attach the policies provided in the above documentation? Do I simply paste the JSON into new policies in my IAM console, and attach them to the Auth_Role?

Where are the default permissions stored? I have set up an amplify app and added S3 with amplify add storage. I can connect to the S3 bucket to add and retrieve files - so presumably there must be existing Polices. But my Auth_Role contains no Policies that reference S3?


问:
Google map users live camera position?
I have users current coordinates and google map camera position should be users current location the coordinates i got from users i am unable to passs in latlang

```<code> Future<void> Locationservice() async {
    bool _serviceEnabled;
    LocationData locationData;
    Location location = Location();
    PermissionStatus _permissionGranted;

_serviceEnabled = await location.serviceEnabled();
if (!_serviceEnabled) {
  _serviceEnabled = await location.requestService();
}

_permissionGranted = await location.hasPermission();
if (_permissionGranted == PermissionStatus.denied) {
  _permissionGranted = await location.requestPermission();
  if (_permissionGranted != PermissionStatus.granted) {}
}

locationData = await location.getLocation();

}

  @override
  void initState() {
    Locationservice();
    super.initState();
 }
</code>```

i am unable to pass coordinated dynamically

```<code> body: Stack(children: [
    GoogleMap(
      mapType: MapType.hybrid,
      initialCameraPosition: const CameraPosition(
        target: LatLng( (user lat) , (user lang) ),
        zoom: 14.4746,
      ),
      onMapCreated: (GoogleMapController controller) {
        _controller.complete(controller);
      },
    ),
</code>```

Title: Google map users live camera position?

Body:
I have users current coordinates and google map camera position should be users current location the coordinates i got from users i am unable to passs in latlang

 Future<void> Locationservice() async {
    bool _serviceEnabled;
    LocationData locationData;
    Location location = Location();
    PermissionStatus _permissionGranted;

_serviceEnabled = await location.serviceEnabled();
if (!_serviceEnabled) {
  _serviceEnabled = await location.requestService();
}

_permissionGranted = await location.hasPermission();
if (_permissionGranted == PermissionStatus.denied) {
  _permissionGranted = await location.requestPermission();
  if (_permissionGranted != PermissionStatus.granted) {}
}

locationData = await location.getLocation();

}

  @override
  void initState() {
    Locationservice();
    super.initState();
 }

i am unable to pass coordinated dynamically

 body: Stack(children: [
    GoogleMap(
      mapType: MapType.hybrid,
      initialCameraPosition: const CameraPosition(
        target: LatLng( (user lat) , (user lang) ),
        zoom: 14.4746,
      ),
      onMapCreated: (GoogleMapController controller) {
        _controller.complete(controller);
      },
    ),


问:
Get bin size values in seaborn charts logscale
I made a chart with seaborn and I would like to retrieve the bin size values.
As my bins are constant in a logarithmic scale, their size are different.  Any ideas ?

Code used : sns.displot(productDF, x="Area", hue="Slice",hue_order=sliceList, bins = 50, log_scale=True, col="Slice", col_wrap = 2, col_order=sliceList)

Here after an example of my chart:

I checked the doc but seaborn doesn't seem to return any info.


问:
find string in json file using regular expression
I have such a code in json file and need to find password from special array using regular expression. For example, i want to find the password from sftpConfig not pbx

```<code>"pbx": {
    "dbConfig": {
        "username": "postgres",
        "password": "postgres",
        "database": "autocaller",
        "host": "postgres",
        "dialect": "postgres",
        "operatorsAliases": false,
        "dialectOptions": {
    "connectTimeout": 60000,
            "options": {
                "requestTimeout": 3000
            }
        },
        "pool": {
            "max": 10,
            "min": 0,
            "idle": 10000
        }
    }
},
"strapi": {
    "credentials": {
        "identifier": "admin",
        "password": "admin"
    }
},
</code>```

"sftpConfig":{
"host": "1.1.1.1",
"port": "22",
"username": "admin",
"password": "admin1"
}

Body:
I have such a code in json file and need to find password from special array using regular expression. For example, i want to find the password from sftpConfig not pbx

"pbx": {
    "dbConfig": {
        "username": "postgres",
        "password": "postgres",
        "database": "autocaller",
        "host": "postgres",
        "dialect": "postgres",
        "operatorsAliases": false,
        "dialectOptions": {
    "connectTimeout": 60000,
            "options": {
                "requestTimeout": 3000
            }
        },
        "pool": {
            "max": 10,
            "min": 0,
            "idle": 10000
        }
    }
},
"strapi": {
    "credentials": {
        "identifier": "admin",
        "password": "admin"
    }
},

"sftpConfig":{
"host": "1.1.1.1",
"port": "22",
"username": "admin",
"password": "admin1"
}


问:
how to use @Retryable along with the Pessimistic lock
i am new in hibernate and concurrency.
I have tried to use a pessimistic lock in a transaction.
how can i make wait the concurrent request to have access after the lock from one request is released. is Using @Retryable annotation helps here.
I am using postgresql as my database.</p>
```<code>@Transactional
    @Lock(LockModeType.PESSIMISTIC_WRITE)
    public Long getSequenceNumber(long hospitalId, long subcenterId, String financialYear) {
        BillNumberSequence billnumberSequence = billNumberSequenceDao.getCurrentNumber(hospitalId, subcenterId,
                financialYear);
        Long lastCount = billnumberSequence.getCurrentNumber();
        billnumberSequence.setCurrentNumber(lastCount + 1);
        billNumberSequenceDao.save(billnumberSequence);
        return lastCount;
    }
</code>```

Body:
i am new in hibernate and concurrency.
I have tried to use a pessimistic lock in a transaction.
how can i make wait the concurrent request to have access after the lock from one request is released. is Using @Retryable annotation helps here.
I am using postgresql as my database.

@Transactional
    @Lock(LockModeType.PESSIMISTIC_WRITE)
    public Long getSequenceNumber(long hospitalId, long subcenterId, String financialYear) {
        BillNumberSequence billnumberSequence = billNumberSequenceDao.getCurrentNumber(hospitalId, subcenterId,
                financialYear);
        Long lastCount = billnumberSequence.getCurrentNumber();
        billnumberSequence.setCurrentNumber(lastCount + 1);
        billNumberSequenceDao.save(billnumberSequence);
        return lastCount;
    }


问:
UIScrollView with paging enabled: strange behavior when swiping left or right
I have a UIScrollView and it has paging enabled (vertically).
Swiping up or down scrols to the previous or next page as expected.
However when swiping left or right, the previous or next page is shown without any animation.
I cannot find a setting to disable this! The view is exactly as wide as the surrounding view. It only scrolls vertically.
What's the best approach?


问:
Tensorflow's quantization for RNN and LSTM
In the guide for Quantization Aware Training, I noticed that RNN and LSTM were listed in the roadmap for "future support". Does anyone know if it is supported now?

Is using Post-Training Quantization also possible for quantizing RNN and LSTM? I don't see much information or discussion about it so I wonder if it is possible now or if it is still in development.

Thank you.

I am currently trying to implement a speech enhancement model in 8-bit integer based on DTLN (https://github.com/breizhn/DTLN). However, when I tried to infer the quantized model without any audio/ empty array, it adds a weird waveform on top of the result: A constant signal every 125 Hz. I have checked other places in the code and there is no problem, just boils down to the quantization process with RNN/LSTM.


问:
getStaticProps not showing data from API
I have 2 questions.

How can I use getStaticProps to create dynamic routes for multiple or all the data from an endpoint?

http://localhost:3000/api/information/genders

```<code>[
    {
        "_id": "639188f080440c60a50fec8c",
        "id": "1",
        "name": "Female",
        "person": "Amy"
    },
    {
        "_id": "639188f080440c60a50fec8d",
        "id": "2",
        "name": "Male",
        "person": "Jack"
    }
]
</code>```

At the moment, I am able to create dynamic routes for one data i.e. name. However, I'm unable to render i.e. This is Male on /male because it's showing me i.e. This is Female on the /male route. Now, my question is ... How can I render unique data on each dynamic route?

this is the code
this is the endpoint
this route is not rendering the matched data
this route is not rendering the 'person' url

I was able to create dynamic routes for i.e. /male and /female at a time & /amy and /jack at a time. However, I want to be able to create dynamic routes for /male, /female, /amy, and /jack at a time. Further, I want to be able to render unique data on each dynamic route. For example, show i.e. This is Male on /male, This is Female on /female, This is Amy on /amy, and This is Jack on /jack at a time.

Y'all help will be highly appreciated.

Body:
I have 2 questions.

How can I use getStaticProps to create dynamic routes for multiple or all the data from an endpoint?

http://localhost:3000/api/information/genders

[
    {
        "_id": "639188f080440c60a50fec8c",
        "id": "1",
        "name": "Female",
        "person": "Amy"
    },
    {
        "_id": "639188f080440c60a50fec8d",
        "id": "2",
        "name": "Male",
        "person": "Jack"
    }
]

At the moment, I am able to create dynamic routes for one data i.e. name. However, I'm unable to render i.e. This is Male on /male because it's showing me i.e. This is Female on the /male route. Now, my question is ... How can I render unique data on each dynamic route?

this is the code
this is the endpoint
this route is not rendering the matched data
this route is not rendering the 'person' url

I was able to create dynamic routes for i.e. /male and /female at a time & /amy and /jack at a time. However, I want to be able to create dynamic routes for /male, /female, /amy, and /jack at a time. Further, I want to be able to render unique data on each dynamic route. For example, show i.e. This is Male on /male, This is Female on /female, This is Amy on /amy, and This is Jack on /jack at a time.

Y'all help will be highly appreciated.


问:
Unable to change Windows Azure Pipeline Agent proxy password
I have had to configure an Azure Pipelines Agent using the --proxyurl, --proxyusername and --proxypassword parameters during agent configuration (as per https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/proxy?view=azure-devops&tabs=windows), on a computer within my customers' network. This agent has been working perfectly for several releases.

I recently had to change the password for my customer account which is used by the Azure Pipelines Agent for proxy access. The agent now informs me the network proxy requires authentication when I run run.cmd. If I run config remove, I get the same message.

I have tried setting the environment variables VSTS_HTTP_PROXY_USERNAME and VSTS_HTTP_PROXY_PASSWORD but the same message is shown.

How do I update the password, which would seem to be a simple thing to do, and surely thought of in the design of these agents!

If there is no simple way, how do I force delete the agent? Delete it in Azure, delete c:\agent, and ?

TIA

Jon

Ps. I have posted this question in https://learn.microsoft.com/en-us/answers/questions/1121174/unable-to-change-windows-azure-pipeline-agent-prox.html, but this seems a way more appropriate forum!


问:
The procedure named apex_admin could not be accessed
Database : 12.2

apex : 22.2

ords : 22.3

after installation execute

http://localhost:8080/ords/apex_admin

appear a page :
Error 404 Not Found
The procedure named apex_admin could not be accessed, it may not be declared, or the user executing this request may not have been granted execute privilege on the procedure, or a function specified by security.requestValidationFunction configuration property has prevented access. Check the spelling of the procedure, check that the execute privilege has been granted to the caller and check the configured security.requestValidationFunction function. If using the PL/SQL Gateway Procedure Allow List, check that the procedure has been allowed via ords_admin.add_plsql_gateway_procedure.

error

I reinstalled the apex and ords also but got the same issue again. I can provide anydesk