Use asymmetric average when using Malitsky & Pock linesearch

Addresses a TODO in the Malitsky & Pock linesearch code.  The theory requires using an asymmetric average - including the primal starting point in the average (with a somewhat unusual weight), but not the dual starting point.  This changes the code to match the theory.
However, one caveat: on the one test instance I've run, academictimetablesmall with defaults except --method pdhg --step_size_policy=malitsky-pock, this change increases the number of iterations to solve from 1241 to 2041 (and kkt passes from 1.9e3 to 3.2e3).  I haven't run a larger benchmark.  I'm not sure this matters, but I found it interesting.
Note that supporting this required splitting the denominator in the average structure into primal and dual portions.  There were several places that tested whether the denominator was nonzero (before computing an average) - this changes them to require both denominators to be nonzero.  For the current code, this change is a no-op - they will be non-zero together, but it makes it clearer at the call site what's going on, rather than just testing one or the other.

Is it worth adding unit tests for SolutionWeightedAverage?

I recall implementing a solution with one single data structure, WeightedAverage, that we instantiated twice (for the primal and dual variables, respectively). Any reason why using a single data structure instead? I don't feel strongly about this; I am happy with the current structure.

I considered switching to separate primal/dual structures.  However, since all existing usage treated it as a single averaging object, leaving it that way and just changing the internals resulted in a smaller overall change, and I didn't feel strongly enough about having two simpler structures to make the larger change.


"Added new Component of Projects"

Solves the issue #71 .Please review and merge.

Nice Work @falgun143 🚀


Typo on Service 'Principles' instead of 'Principals'

Hi Team,
There is a typo on Service 'Principles' instead of 'Principals'.
https://learn.microsoft.com/en-us/powershell/azure/create-azure-service-principal-azureps?view=azps-9.2.0

https://learn.microsoft.com/en-us/security/benchmark/azure/baselines/data-factory-security-baseline

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: de7b73c0-d4e5-0c29-b480-a0cced2b4022
Version Independent ID: 264dcd28-da04-4231-90ab-8088b951a912
Content: Azure security baseline for Data Factory
Content Source: benchmark/azure/baselines/data-factory-security-baseline.md
Service: data-factory
GitHub Login: @msmbaldwin
Microsoft Alias: mbaldwin

Thanks for catching that @pr0b3r7!  I fixed it now and it is updated in the PR referenced above.
#please-close


Presolve breaks feasibility of complete hint

What version of OR-Tools and what language are you using?
Version: v9.10.4067
Language: Python
Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
CP-SAT
What operating system (Linux, Windows, ...) and version?
Fedora Linux 40 (Workstation Edition)
What did you do?
Steps to reproduce the behavior:

Run the following code with model.txt.

from ortools.sat.python.cp_model import CpModel, CpSolver
from google.protobuf import text_format

model = CpModel()

with open('model.txt', 'r') as file:
    text_format.Parse(file.read(), model.Proto())

solver = CpSolver()
solver.parameters.log_search_progress = True
# solver.parameters.cp_model_presolve = False
# solver.parameters.fix_variables_to_their_hinted_value = True
solver.solve(model)

Observe the feasibility of the complete hint when presolve starts (Starting presolve at...) and when preloading model (Preloading model.) in the CP-SAT log.

What did you expect to see
Complete hint should be feasible when presolve starts and when preloading model.
What did you see instead?
Complete hint is feasible when presolve starts (The solution hint is complete and is feasible.) but not when preloading model (The solution hint is complete, but it is infeasible! we will try to repair it.). Full CP-SAT solver log below. Either fixing the hint or turning off presolve (by uncommenting out either commented line) causes the solver to find the complete hinted solution immediately.

Starting CP-SAT solver v9.10.4067
Parameters: log_search_progress: true
Setting number of workers to 4

Initial satisfaction model 'PGTA model': (model_fingerprint: 0x3ecda0105b36e3c5)
#Variables: 30'795
  - 30'495 Booleans in [0,1]
  - 240 in [0,300]
  - 60 in [0,600]
#kAtMostOne: 4'500 (#literals: 5'893)
#kExactlyOne: 726 (#literals: 30'495)
#kLinMax: 180 (#expressions: 360)
#kLinear1: 240
#kLinear2: 3'775
#kLinear3: 169
#kLinearN: 2'651 (#terms: 112'657)

Starting presolve at 0.01s
The solution hint is complete and is feasible.
  1.47e-02s  0.00e+00d  [DetectDominanceRelations]
  1.64e-01s  0.00e+00d  [PresolveToFixPoint] #num_loops=2 #num_dual_strengthening=1
  1.89e-03s  0.00e+00d  [ExtractEncodingFromLinear] #potential_supersets=1'906 #potential_subsets=118
[Symmetry] Graph for symmetry has 103'124 nodes and 205'569 arcs.
[Symmetry] Symmetry computation done. time: 0.169736 dtime: 0.094568
[Symmetry] #generators: 492, average support size: 97.4065
[Symmetry] The model contains 365 duplicate constraints !
[Symmetry] 3782 orbits with sizes: 34,34,34,34,34,34,34,34,34,34,...
[Symmetry] Num fixable by intersecting at_most_one with orbits: 123 largest_orbit: 34
[Symmetry] Found orbitope of size 60 x 2
[SAT presolve] num removable Booleans: 0 / 27046
[SAT presolve] num trivial clauses: 0
[SAT presolve] [0s] clauses:252 literals:1048 vars:686 one_side_vars:623 simple_definition:63 singleton_clauses:0
[SAT presolve] [0.000189515s] clauses:209 literals:791 vars:686 one_side_vars:686 simple_definition:0 singleton_clauses:0
[SAT presolve] [0.000860566s] clauses:209 literals:791 vars:686 one_side_vars:686 simple_definition:0 singleton_clauses:0
  1.22e+00s  2.64e-01d  [Probe] #probed=60'686 #new_binary_clauses=2'270
  1.59e-02s  0.00e+00d  [MaxClique] Merged 1815(8536 literals) into 1089(5664 literals) at_most_ones.
  1.29e-02s  0.00e+00d  [DetectDominanceRelations]
  7.43e-02s  0.00e+00d  [PresolveToFixPoint] #num_loops=2 #num_dual_strengthening=1
  4.65e-02s  0.00e+00d  [ProcessAtMostOneAndLinear] #num_changes=18
  1.14e-02s  0.00e+00d  [DetectDuplicateConstraints] #duplicates=375
  1.86e-01s  1.52e-03d  [DetectDominatedLinearConstraints] #relevant_constraints=1'855 #num_inclusions=3'103
  7.17e-04s  0.00e+00d  [DetectDifferentVariables]
  8.53e-03s  1.19e-03d  [ProcessSetPPC] #relevant_constraints=3'671 #num_inclusions=3'628
  6.38e-04s  0.00e+00d  [FindAlmostIdenticalLinearConstraints]
  2.03e-01s  2.40e-01d  [FindBigAtMostOneAndLinearOverlap]
  1.86e-02s  1.04e-01d  [FindBigVerticalLinearOverlap]
  1.35e-01s  2.85e-01d  [FindBigHorizontalLinearOverlap] #blocks=44 #saved_nz=6'155 #linears=1'849
  1.28e-03s  8.70e-07d  [MergeClauses] #num_collisions=3 #num_merges=3 #num_saved_literals=6
  1.36e-02s  0.00e+00d  [DetectDominanceRelations]
  8.63e-02s  0.00e+00d  [PresolveToFixPoint] #num_loops=2 #num_dual_strengthening=1
  1.09e-02s  0.00e+00d  [DetectDominanceRelations]
  6.34e-02s  0.00e+00d  [PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
[Symmetry] Graph for symmetry has 101'755 nodes and 179'522 arcs.
[Symmetry] Symmetry computation done. time: 0.160018 dtime: 0.0849841
[Symmetry] #generators: 483, average support size: 96.9648
[Symmetry] 3778 orbits with sizes: 34,34,34,34,34,34,34,34,34,34,...
[Symmetry] Num fixable by intersecting at_most_one with orbits: 53 largest_orbit: 34
[Symmetry] Found orbitope of size 60 x 2
[SAT presolve] num removable Booleans: 0 / 26923
[SAT presolve] num trivial clauses: 0
[SAT presolve] [0s] clauses:297 literals:756 vars:568 one_side_vars:568 simple_definition:0 singleton_clauses:0
[SAT presolve] [0.000170759s] clauses:297 literals:756 vars:568 one_side_vars:568 simple_definition:0 singleton_clauses:0
[SAT presolve] [0.000835139s] clauses:297 literals:756 vars:568 one_side_vars:568 simple_definition:0 singleton_clauses:0
  1.23e+00s  2.68e-01d  [Probe] #probed=60'580 #new_bounds=1 #new_binary_clauses=1'491
  5.62e-03s  0.00e+00d  [MaxClique] Merged 1224(5809 literals) into 1088(5531 literals) at_most_ones.
  1.70e-02s  0.00e+00d  [DetectDominanceRelations]
  7.73e-02s  0.00e+00d  [PresolveToFixPoint] #num_loops=2 #num_dual_strengthening=1
  4.08e-02s  0.00e+00d  [ProcessAtMostOneAndLinear]
  4.26e-03s  0.00e+00d  [DetectDuplicateConstraints]
  1.44e-01s  1.26e-03d  [DetectDominatedLinearConstraints] #relevant_constraints=1'897 #num_inclusions=2'772
  6.48e-04s  0.00e+00d  [DetectDifferentVariables]
  7.99e-03s  1.01e-03d  [ProcessSetPPC] #relevant_constraints=3'738 #num_inclusions=3'445
  9.09e-04s  0.00e+00d  [FindAlmostIdenticalLinearConstraints]
  1.61e-01s  1.94e-01d  [FindBigAtMostOneAndLinearOverlap]
  1.48e-02s  8.16e-02d  [FindBigVerticalLinearOverlap]
  2.17e-01s  4.82e-01d  [FindBigHorizontalLinearOverlap] #linears=1'891
  1.22e-03s  1.65e-06d  [MergeClauses] #num_collisions=16 #num_merges=16 #num_saved_literals=71
  1.23e-02s  0.00e+00d  [DetectDominanceRelations]
  6.36e-02s  0.00e+00d  [PresolveToFixPoint] #num_loops=2 #num_dual_strengthening=1
  1.33e-02s  0.00e+00d  [DetectDominanceRelations]
  6.58e-02s  0.00e+00d  [PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
[Symmetry] Graph for symmetry has 101'097 nodes and 178'273 arcs.
[Symmetry] Symmetry computation done. time: 0.151737 dtime: 0.084584
[Symmetry] #generators: 479, average support size: 97.0063
[Symmetry] 3606 orbits with sizes: 34,34,34,34,34,34,34,34,34,34,...
[Symmetry] Num fixable by intersecting at_most_one with orbits: 19 largest_orbit: 34
[Symmetry] Found orbitope of size 60 x 2
[SAT presolve] num removable Booleans: 0 / 26870
[SAT presolve] num trivial clauses: 0
[SAT presolve] [0s] clauses:161 literals:480 vars:306 one_side_vars:306 simple_definition:0 singleton_clauses:0
[SAT presolve] [0.000116407s] clauses:161 literals:480 vars:306 one_side_vars:306 simple_definition:0 singleton_clauses:0
[SAT presolve] [0.000689051s] clauses:161 literals:480 vars:306 one_side_vars:306 simple_definition:0 singleton_clauses:0
  1.28e+00s  2.68e-01d  [Probe] #probed=60'542 #new_binary_clauses=1'491
  5.65e-03s  0.00e+00d  [MaxClique]
  1.18e-02s  0.00e+00d  [DetectDominanceRelations]
  7.47e-02s  0.00e+00d  [PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1
  4.14e-02s  0.00e+00d  [ProcessAtMostOneAndLinear]
  6.01e-03s  0.00e+00d  [DetectDuplicateConstraints]
  1.40e-01s  1.26e-03d  [DetectDominatedLinearConstraints] #relevant_constraints=1'897 #num_inclusions=2'772
  6.21e-04s  0.00e+00d  [DetectDifferentVariables]
  7.94e-03s  1.01e-03d  [ProcessSetPPC] #relevant_constraints=3'737 #num_inclusions=3'445
  5.93e-04s  0.00e+00d  [FindAlmostIdenticalLinearConstraints]
  1.58e-01s  1.94e-01d  [FindBigAtMostOneAndLinearOverlap]
  1.48e-02s  8.14e-02d  [FindBigVerticalLinearOverlap]
  2.03e-01s  4.81e-01d  [FindBigHorizontalLinearOverlap] #linears=1'891
  1.32e-03s  1.62e-06d  [MergeClauses] #num_collisions=15 #num_merges=15 #num_saved_literals=66
  1.07e-02s  0.00e+00d  [DetectDominanceRelations]
  6.73e-02s  0.00e+00d  [PresolveToFixPoint] #num_loops=1 #num_dual_strengthening=1

Presolve summary:
  - 3420 affine relations were detected.
  - rule 'TODO dual: only one blocking constraint?' was applied 1'097 times.
  - rule 'TODO linear inclusion: superset is equality' was applied 4'166 times.
  - rule 'affine: new relation' was applied 3'420 times.
  - rule 'at_most_one: removed literals' was applied 3 times.
  - rule 'at_most_one: transformed into max clique.' was applied 2 times.
  - rule 'bool_and: merged constraints with same enforcement' was applied 13 times.
  - rule 'bool_or: implications' was applied 151 times.
  - rule 'bool_or: removed enforcement literal' was applied 84 times.
  - rule 'duplicate: merged rhs of linear constraint' was applied 22 times.
  - rule 'duplicate: removed constraint' was applied 375 times.
  - rule 'exactly_one: removed literals' was applied 38 times.
  - rule 'lin_max: affine_max target domain reduced' was applied 120 times.
  - rule 'lin_max: converted to equality' was applied 1 time.
  - rule 'lin_max: removed exprs' was applied 1 time.
  - rule 'lin_max: target domain reduced' was applied 60 times.
  - rule 'lin_max: unused affine_max target' was applied 120 times.
  - rule 'linear + amo: detect hidden AMO' was applied 1 time.
  - rule 'linear + amo: extracted enforcement literal' was applied 220 times.
  - rule 'linear + amo: removed enforcement literal' was applied 90 times.
  - rule 'linear + amo: trivial linear constraint' was applied 76 times.
  - rule 'linear matrix: common horizontal rectangle' was applied 44 times.
  - rule 'linear1: always true' was applied 239 times.
  - rule 'linear2: Boolean with one feasible value.' was applied 26 times.
  - rule 'linear: advanced coefficient strenghtening.' was applied 57 times.
  - rule 'linear: always true' was applied 732 times.
  - rule 'linear: divide by GCD' was applied 2'186 times.
  - rule 'linear: extracted at most one (max).' was applied 635 times.
  - rule 'linear: extracted enforcement literal' was applied 71 times.
  - rule 'linear: fixed or dup variables' was applied 1'151 times.
  - rule 'linear: negative clause' was applied 168 times.
  - rule 'linear: positive at most one' was applied 8 times.
  - rule 'linear: reduced variable domains' was applied 294 times.
  - rule 'linear: reduced variable domains in derived constraint' was applied 1 time.
  - rule 'linear: remapped using affine relations' was applied 1'480 times.
  - rule 'linear: simplified rhs' was applied 2'620 times.
  - rule 'linear: simplify using approximate gcd' was applied 141 times.
  - rule 'linear: singleton column' was applied 2 times.
  - rule 'linear: small Boolean expression' was applied 21 times.
  - rule 'linear: variable substitution 0' was applied 1 time.
  - rule 'presolve: 224 unused variables removed.' was applied 1 time.
  - rule 'presolve: iteration' was applied 3 times.
  - rule 'probing: bool_or reduced to implication' was applied 151 times.
  - rule 'setppc: bool_or in at_most_one.' was applied 1 time.
  - rule 'symmetry: fixed to false in general orbit' was applied 195 times.

Presolved satisfaction model 'PGTA model': (model_fingerprint: 0x4ec277cd10e10ba0)
#Variables: 27'072
  - 26'851 Booleans in [0,1]
  - 1 in [0,28]
  - 4 in [0,38]
  - 2 in [0,43]
  - 2 in [0,47]
  - 5 in [0,48]
  - 3 in [0,52]
  - 17 in [0,56]
  - 2 in [0,57]
  - 2 in [0,61]
  - 1 in [0,62]
  - 7 in [0,66]
  - 2 in [0,71]
  - 1 in [0,74]
  - 10 in [0,76]
  - 5 in [0,99]
  - 1 in [0,114]
  - 5 in [0,124]
  - 12 in [0,148]
  - 1 in [0,163]
  - 7 in [0,173]
  - 1 in [0,184]
  - 7 in [0,198]
  - 1 in [0,214]
  - 1 in [0,297]
  - 1 in [0,325]
  - 1 in [0,342]
  - 2 in [50,74]
  - 13 in [67,99]
  - 17 in [83,124]
  - 41 in [100,148]
  - 19 in [116,173]
  - 24 in [133,198]
  - 2 in [199,297]
  - 1 in [315,358]
#kAtMostOne: 1'010 (#literals: 5'303)
#kBoolAnd: 93 (#enforced: 93 #multi: 15) (#literals: 252)
#kBoolOr: 53 (#literals: 162)
#kExactlyOne: 669 (#literals: 26'851)
#kLinMax: 59 (#expressions: 118)
#kLinearN: 1'897 (#enforced: 2 #multi: 2) (#terms: 78'708)

Preloading model.
The solution hint is complete, but it is infeasible! we will try to repair it.
[Symmetry] Graph for symmetry has 97'300 nodes and 178'142 arcs.
[Symmetry] Symmetry computation done. time: 0.156002 dtime: 0.0841308
[Symmetry] #generators: 474, average support size: 97.6835
[Symmetry] Found orbitope of size 60 x 2
#Model   7.49s var:27072/27072 constraints:3781/3781

Starting search at 7.49s with 4 workers.
4 full problem subsolvers: [default_lp, max_lp, no_lp, quick_restart]
2 incomplete subsolvers: [feasibility_pump, rins/rens]
2 helper subsolvers: [neighborhood_helper, synchronization_agent]
^C
Task timing                   n [     min,      max]      avg      dev     time         n [     min,      max]      avg      dev    dtime
        'default_lp':         1 [   2.87s,    2.87s]    2.87s   0.00ns    2.87s         1 [  3.68ms,   3.68ms]   3.68ms   0.00ns   3.68ms
  'feasibility_pump':         0 [  0.00ns,   0.00ns]   0.00ns   0.00ns   0.00ns         0 [  0.00ns,   0.00ns]   0.00ns   0.00ns   0.00ns
            'max_lp':         1 [   2.91s,    2.91s]    2.91s   0.00ns    2.91s         1 [  3.68ms,   3.68ms]   3.68ms   0.00ns   3.68ms
             'no_lp':         1 [   2.85s,    2.85s]    2.85s   0.00ns    2.85s         1 [  3.68ms,   3.68ms]   3.68ms   0.00ns   3.68ms
     'quick_restart':         1 [   2.88s,    2.88s]    2.88s   0.00ns    2.88s         1 [  3.68ms,   3.68ms]   3.68ms   0.00ns   3.68ms
         'rins/rens':         0 [  0.00ns,   0.00ns]   0.00ns   0.00ns   0.00ns         0 [  0.00ns,   0.00ns]   0.00ns   0.00ns   0.00ns

Search stats         Bools  Conflicts  Branches  Restarts  BoolPropag  IntegerPropag
     'default_lp':  26'851          0    52'684    52'684   1'356'299      2'131'756
         'max_lp':  26'910          0    48'460    48'460   1'252'517      1'965'226
          'no_lp':  26'851          0    41'578    41'578   1'073'116      1'687'823
  'quick_restart':  26'851          0    43'732    43'732   1'126'795      1'769'622

SAT stats           ClassicMinim  LitRemoved  LitLearned  LitForgotten  Subsumed  MClauses  MDecisions  MLitTrue  MSubsumed  MLitRemoved  MReused
     'default_lp':             0           0           0             0         0         0           0         0          0            0        0
         'max_lp':             0           0           0             0         0         0           0         0          0            0        0
          'no_lp':             0           0           0             0         0         0           0         0          0            0        0
  'quick_restart':             0           0           0             0         0         0           0         0          0            0        0

Lp stats            Component  Iterations  AddedCuts  OPTIMAL  DUAL_F.  DUAL_U.
     'default_lp':          1           0          0        0        0        0
         'max_lp':          1           0          0        0        0        0
  'quick_restart':          1           0          0        0        0        0

Lp dimension                                                             Final dimension of first component
     'default_lp':          0 rows, 27072 columns, 0 entries with magnitude in [0.000000e+00, 0.000000e+00]
         'max_lp':  3961 rows, 27190 columns, 112154 entries with magnitude in [7.088836e-02, 1.000000e+00]
  'quick_restart':          0 rows, 27072 columns, 0 entries with magnitude in [0.000000e+00, 0.000000e+00]

Lp debug            CutPropag  CutEqPropag  Adjust  Overflow  Bad  BadScaling
     'default_lp':          0            0       0         0    0           0
         'max_lp':          0            0       0         0    0           0
  'quick_restart':          0            0       0         0    0           0

Lp pool             Constraints  Updates  Simplif  Merged  Shortened  Split  Strenghtened  Cuts/Call
     'default_lp':        3'692        0        0       0          0      0             0        0/0
         'max_lp':        3'961        0        0       0          0      0             0        0/0
  'quick_restart':        3'692        0        0       0          0      0             0        0/0

LNS stats       Improv/Calls  Closed  Difficulty  TimeLimit
  'rins/rens':           0/0      0%        0.50       0.10

Solution repositories    Added  Queried  Ignored  Synchro
  'feasible solutions':      0        0        0        0
        'lp solutions':      0        0        0        0
                'pump':      0        0

CpSolverResponse summary:
status: UNKNOWN
objective: NA
best_bound: NA
integers: 29279
booleans: 26851
conflicts: 0
branches: 52684
propagations: 1356299
integer_propagations: 2131756
restarts: 52684
lp_iterations: 0
walltime: 10.4476
usertime: 10.4476
deterministic_time: 2.9651
gap_integral: 0

Anything else we should know about your project / environment
Apologies for the large model, I won't have time currently to find a simpler example.

it is a known bug, and it is very hard to solve.
You can add the parameters keep_all_feasible_solutions_in_presolve:true. It should fix it.
Note that this can degrade performance.

fixed on main. Not an short one :-)


Add basic Android SystemFonts impl.

I've moved my work over here from my fount repo. I have the fallback stuck to sans-serif for everything for the moment, I need to work out proper fallback and there are a few more things that are unclear regarding what parts of fonts.xml to interpret and which parts to ignore.

This stub implementation makes it possible to build and run Xilem, and will be improved afterward, with improvements including:

Language and script fallback matching, with reasonable behavior for Android expectations.
Family definitions related back by postScriptName and file name when necessary (the latter may involve adding an index or feature to scan to do properly.
Family-specific fallback with fallbackFor, particularly for generic families, e.g. serif mapping to Noto Serif CJK (明體) instead of Noto Sans CJK (黑體), or conceivably mapping cursive to a 楷書 font if that is called for in the configs.


Album art missing

As of the latest Spotify update, the album art is no longer loading properly.

Same issue. I've been working on a fix for the past hour.
The problem is that GetAlbumArtUrl always returns an empty string because the response from Spotify does not contain the expected meta tag, the one with "property="og:image"".

Even if I add a User-Agent to the header of the request, the response still does not contain the meta tag, but the album art url is both in the head and in the body of the page.

Fixed by #156 , gonna be released tomorrow afternoon

2.14.2 is released. Although nuget needs some time to index it I guess..


Release of findFirst

Hi,
I just noticed find starts from the currently selected value and was about to PR some updated docs but then saw there's already an implementation for starting a find from the first Zipper item. Is there a reason it's not been released yet?
Thanks

That has been an oversight! Will release a new version this week!

Ok great!


Test Parallelization Speed

Answer this question:  On an 8 core machine, is it faster to parallelize 2 tasks by assigning them 4 cores each or is the same as if they were each assigned 8?

I'm also testing which commands benefit from parallelism despite the fact that the programs are multithreaded and (generally) saturate all of the cores they are working on.

John Vivian<EMAIL_ADDRESS>writes:

Answer this question: On an 8 core machine, is it faster to parallelize 2 tasks
by assigning them 4 cores each or is the same as if they were each assigned 8?

In general, it hugely depends on the behavior of the tasks.
For bioinformatics applications, we just tend to not worry about
it.  Often file I/O is the killer anyway, so optimizing CPU
isn't as important.  Spending tons of time trying to get a 5%
optimization isn't worth the effort.  Just buy/rent another computer.

Test complete -- no real difference.


cmd/compile/internal/ssa: optimize ARM SSA rules with indexed MOVB/MOVH

There are indexed MOVW used  for ARM.
{name: "MOVWloadidx", argLength: 3, reg: gp2load, asm: "MOVW"},                   // load from arg0 + arg1. arg2=mem
{name: "MOVWloadshiftLL", argLength: 3, reg: gp2load, asm: "MOVW", aux: "Int32"}, // load from arg0 + arg1<<auxInt. arg2=mem
{name: "MOVWloadshiftRL", argLength: 3, reg: gp2load, asm: "MOVW", aux: "Int32"}, // load from arg0 + arg1>>auxInt, unsigned shift. arg2=mem
{name: "MOVWloadshiftRA", argLength: 3, reg: gp2load, asm: "MOVW", aux: "Int32"}, // load from arg0 + arg1>>auxInt, signed shift. arg2=mem
{name: "MOVWstoreidx", argLength: 4, reg: gp2store, asm: "MOVW"},                   // store arg2 to arg0 + arg1. arg3=mem
{name: "MOVWstoreshiftLL", argLength: 4, reg: gp2store, asm: "MOVW", aux: "Int32"}, // store arg2 to arg0 + arg1<<auxInt. arg3=mem
{name: "MOVWstoreshiftRL", argLength: 4, reg: gp2store, asm: "MOVW", aux: "Int32"}, // store arg2 to arg0 + arg1>>auxInt, unsigned shift. arg3=mem
{name: "MOVWstoreshiftRA", argLength: 4, reg: gp2store, asm: "MOVW", aux: "Int32"}, // store arg2 to arg0 + arg1>>auxInt, signed shift. arg3=mem

But corresponding ones for MOVB/MOVH are absent. Adding and using them can save bytes.

别他妈的发了傻逼
发自网易邮箱大师
On 08/28/2017 11:42, GopherBot wrote:
Change https://golang.org/cl/58450 mentions this issue: cmd/compile: optimize ARM with more efficient MOVB/MOVBU/MOVH/MOVHU
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.


[HOTFIX] Remove unnecessary table status read

Remove 1 extra table status read in query flow

[ ] Any interfaces changed?

[ ] Any backward compatibility impacted?

[ ] Document update required?

[ ] Testing done
Please provide details on
- Whether new unit test cases have been added or why no new tests are required?
- How it is tested? Please attach test report.
- Is it a performance related change? Please attach the performance test report.
- Any additional information to help reviewers in testing this change.

[ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

Build Success with Spark 2.1.0, Please check CI http://<IP_ADDRESS>:12545/job/ApacheCarbonPRBuilder2.1/862/

Build Success with Spark 2.2.1, Please check CI http://<IP_ADDRESS>:12545/job/ApacheCarbonPRBuilder2.2/867/

Build Success with Spark 2.3.2, Please check CI http://<IP_ADDRESS>:12545/job/ApacheCarbonPRBuilder2.3/867/

LGTM


Increment version for eventhub releases

Increment version for eventhub releases

Can one of the admins verify this patch?


Update mega-drive-genesis.md

Found a few minor things that could be fixed in this file while translating so far. Haven't finished looking through the entire file while translating yet so I might have some more minor fixes to make. This is just what I've found so far.

Sorry the commit history is a mess, it's been a while since I had a copy of a repo I was then also contributing to so I'm probably not doing it the cleanest way, haha.

That should be everything I noticed.

 Please see the new pull request.


chore(): forbidden identifiers check for relative scope imports.

Checks the added imports for any relative scope imports and automatically suggests the correct Scope Import statement.

Once a forbidden import will be found, we will output a super helpful error message (including suggestion / correction)

cc. @jelbourn

@hansl can you review this one?

LGTM with this note. Please fix and I'll merge. Cheers!

LGTM!  Let's wait for the tests to pass and I'll merge. Thanks a lot!


Please, we need updates

Please, update browser, your project really good)

Please add russian language

add dark theme browser and more actions with tabs, make it more convenient

Thanks for your feedback, your additions will be considered. 😸


Solved issue #26, Added Footer to the website

Hello @VanshKing30 ,
Solved #26 by using Tailwind CSS
I've made some enhancements to the project by adding a footer to the website. I believe this will improve user experience by providing important information and navigation links at the bottom of each page.
I've tested the changes locally and everything seems to be working smoothly. Could you please review my pull request and provide any feedback or suggestions for improvement?
Thank you for maintaining this project and considering my contribution.
Best regards,
Mutcherla Rahul Kumar

Can you please make a slight change , remove
[Premium]
[Campaigns]
[Blog]
FAQ's
Contact

Ok Sure !
Do u want me to add anything extra in that?
or any improvements?
On Thu, 16 May 2024 at 16:29, Vansh Waldeo @.***> wrote:

Can you please make a slight change , remove
[Premium]
[Campaigns]
[Blog]
FAQ's
Contact
—
Reply to this email directly, view it on GitHub
https://github.com/VanshKing30/FoodiesWeb/pull/146#issuecomment-2114907728,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A4V63T4YLPAILNPBNXJGRGTZCSGSXAVCNFSM6AAAAABHZG2RISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJUHEYDONZSHA
.
You are receiving this because you were assigned.Message ID:
@.***>

please check i have sent an pr using another repository
due to some tecnical issues i created and solved the above addressed issues


cannot findtune: empty boxes

I'm trying to finetune the model with my own data from the provided pretrained model checkpoint model.ckpt-73018,
but getting this weird issue: First (until about 500 steps) the model seems to find only windows, doors etc. large shapes (occasional large text boxes too) and also keeps predicting the whole image as a box. After that, it stops giving me any predictions (trying with lower pixel confidence thresholds 0.6 reveals the same kind of predictions but with lower confidences). My data has image size 600x600. I also tried with icdar2015 data, converted with the icdar2015_to_tfrecords.py, and got similar issues. I have tried with learning rate 1e-4 as well as the recommended 1e-2. When I check the traininng images in tensorboard, they are ok and the bounding boxes are drawn correctly. Also, the loss curve looks more or less possible, it decreases until that 500 steps (down to about 1.4) and then settles.
I'm training with batch size: 8, one gpu. I'm running the code on python 3.5 so i had to make some changes for that. I'm getting the predictions with test_pixel_link.py, and it gets good predictions with the provided pretrained model (both for my own data and for the icdar2015 data).
Any ideas what might be going on?

+1


Support Rc in html! attributes

Yew 0.17.4 silently cloned Strings passed in e.g. html!{<p foo=&self.a_String}. String::clone copies the contents of the string, which is wasteful.
v0.18.0 removes the silent clone, and while the easy fix would be to just move the clone up the stack to my Component::view, copying string contents on every view seems wasteful. That was the motivation for the change in the first place!
At first, it seems using Cow would help, but after some discussion I believe the current use of Cow<'static, str> still causes String content copies when the string has a lifetime less than 'static, e.g. strings originating from messages to Component::update.
It seems using Rc<str> or such would lead to string content copying happening only in Component::update (and typically, only for one variant of the Component::Message enum), so that would be a nice improvement.
It would be great if yew's vdom understood Rc<str> (and perhaps Arc also) and allowed using reference counts to enable cheap clones, instead of expensive string content copies.
Concretely:
struct Model {
    foo: Rc<str>
}
...
enum Msg {
    UpdateFoo { s: String },
...
    fn update(&mut self, msg: Self::Message) -> ShouldRender {
        match msg {
            Msg::UpdateFoo { s } => {
                // make String into a str, but then pass a reference to Rc::from
                self.foo = Rc::from(&*s);
            }
...
    fn view(&self) -> Html {
        html! {

It should also be possible to push the Rc (or just str) up front all the way to the message source, to avoid even the copy in `Component::update``, but that shouldn't require anything from yew.

A good solution would be have a custom type for this:
enum AttrValue {
    Borrowed(&'static str),
    Owned(String),
    ReferenceCounted(Rc<str>),
}

The VDom can then use this value.


Update changelog for 0.5.0 release

Updates the changelog for the recent commits to branch-0.5.

build

Let me know if we can close this in favor of #2326


Add feature gate scaffold

Doesn't introduce any features, but it's available when we need them. Should be used like: https://github.com/kubernetes/kubernetes/blob/master/pkg/features/kube_features.go to add features.

holding until we land the dep changes

I had this working at 1.14 deps but then I updated them to 1.16 and it won't build atm. :) Actually, I can probably back out and push these back down to 1.14, so nm.

@gerred  what's the status of this PR?   need any help here?


KAFKA-9557: correct thread process-rate sensor to measure throughput

The current definition of the thread-level process-rate/total metric seems not correct by any reasonable standard.
It claims to measure the number/rate of "calls to process", but doesn't define what a "call to process" is.
I think a reasonable definition would be a "call to process a record", which in Streams is equal to a call to task.process(). This is exactly what the task-level process-rate/total metric does.
However, the thread-level metric measures the number/rate of calls to taskManager.process(), in which the method processes at least one record. This doesn't seem like a useful quantity for operators to measure, and it certainly doesn't seem to honor the spirit of the metric.
Committer Checklist (excluded from commit message)

[ ] Verify design and implementation
[ ] Verify test coverage and CI build status
[ ] Verify documentation (including upgrade notes)

Java 8 tests unrelated:

kafka.admin.DescribeConsumerGroupTest.testDescribeGroupMembersWithShortInitializationTimeout * org.apache.kafka.streams.integration.RegexSourceIntegrationTest.testRegexMatchesTopicsAWhenDeleted

The build passed for me locally, so I'm going ahead with a merge.


Jest Builder is not passing the flags to Jest

Describe the bug
The builder doesn't pass the provided flags to Jest. As per the documentation:

These options can also be provided directly to ng test command. For example, to run a single test from this suite:
[...]
Use the following command: ng test --testNamePattern="My cool suite Should do one thing"

Running this command returns an error:
$ ng test --testNamePattern="something"
Unknown option: '--testNamePattern'

This is blocking me from using the Jest VScode extension.
To Reproduce
Steps to reproduce the behavior:

Run ng test with any jest config options. (ex. ng test --testNamePattern="something")

Expected behavior
ng test to pass the --testNamePattern flags to jest
Builder:

The name of the builder: jest
The version of the builder: ^1.2.5

Libraries

angular-devkit/build-angular: ~0.10.2
angular-devkit/core: ^7.0.2
jest: ^23.6.0

Duplicate of #113 because of a Github data issue.


400 Client Error: Bad Request for url: http://x.x.x.x:8080/api/v1/tasks/3928/annotations?format=CVAT for video 1.1

My actions before raising this issue
I tried to upload data (mp4) with annotations (CVAT for video 1.1) zipped with XML, using CLI. I prepare data and annotations to upload, like this one from dumped XML from a task from the same project.

Expected Behaviour
Correct creation of task with annotations
Current Behaviour
The task is created but there are no boxes from annots file.
I only see info in the terminal:
Created task ID: 3926 NAME: foo
Awaiting data compression before uploading annotations...
Awaiting compression for task 3926.
                            Status=Finished, Message=
400 Client Error: Bad Request for url: http://boo:8080/api/v1/tasks/3926/annotations?format=CVAT%20for%20video%201.1

Steps to Reproduce (for bugs)

example of XML:
<?xml version="1.0" encoding="utf-8"?>
<annotations><version>1.1</version><meta><task><id></id><name></name><size></size><mode>interpolation</mode><overlap>5</overlap><bugtracker></bugtracker><created></created><updated></updated><subset>default</subset><start_frame></start_frame><stop_frame></stop_frame><frame_filter></frame_filter><segments><segment><id></id><start></start><stop></stop><url></url></segment></segments><owner><username>admin</username><email></email></owner><assignee></assignee><labels><name>doors</name><color>#ffcc33</color><attributes></attributes><name>head</name><color>#24b353</color><attributes><attribute><name>location</name><mutable>True</mutable><input_type>select</input_type><default_value>in</default_value><values>in
out</values></attribute></attributes></labels><original_size><width>700</width><height>1000</height></original_size></task><dumped></dumped><source>left_top1.mp4</source></meta><track id="1" label="head" source="manual"><box frame="1" outside="0" occluded="0" keyframe="1" xtl="360" ytl="910" xbr="455" ybr="810" z_order="0"><attribute name="location">in</attribute></box><box frame="2" outside="0" occluded="0" keyframe="1" xtl="362" ytl="909" xbr="455" ybr="811" z_order="0"><attribute name="location">in</attribute></box>
...

Sorry for lack of proper indentation, but I used xmltodict lib to overwrite the values and I get it back in this form.

Operating System and version (e.g. Linux, Windows, MacOS): Linux ubuntu 18.04
Code example or link to GitHub repo or gist to reproduce problem:
Other diagnostic information / logs:
Logs from `cvat` container

Please provide logs from cvat container: docker logs cvat > cvat_log.txt

I upload only last ~30min-1h range, due to the logs are pretty large and I have an error when trying to dump them.
cvat_log.txt

When I upload the same vid to ui and then upload annotations by hand(on UI), the annotations are uploaded properly.

I figured out, that I badly specified the format. To upload annots you cannot use "CVAT for video 1.1" or "images 1.1", you have to describe the format as "CVAT 1.1"

Thanks for the investigation, so I suppose the issue can be closed.


Fixes #505 Adds TileView (previously SplitContainer)

Fixes #505 - Adds new View TileView
TileView can have any number of Tiles.  Each tile is seperated with a line which can be moved.  Tiles can be added and removed adhoc (see InsertTile, RemoveTile).
All Tiles must follow the same Orientation.  You can achieve grids/ T shapes etc of tiles through nesting.  To make this easier you can use the method bool TrySplitTile(int idx, int panels, out TileView result).
This PR contains the following sub PR which could be merged seperately

#2299
#2281

Noteworthy changes

Makes ViewToScreen public.  This is to position ContextMenu when right clicking TabView headers correctly.  I have used this method via reflection in TerminalGuiDesigner and don't really see why ScreenToView is public but ViewToScreen is private.
Fix bug in TabView where the 'damage region' property of bounds passed to Redraw is used for drawing border instead of Bounds which is always correct.  This manifested as a missing border when moving splitter lines (which reapeared after moving cursor or clicking... most strange).

ToDos

[x] Titles with the new Tile system
[x] Verify min tile sizes with 3+ tiles
[x] Respect Visible property to hide tiles

[x] Test all combinations for 3x2 tile configuration with border
[x] Test all combinations for 3x2 tile configuration without border

[x] Needs Tests
[x] Needs More Tests
[x] When switching from horizontal to vertical the SplitterDistance is usually way off (see in video) because consoles are far wider than they are tall.
[x] Actually respect the Min Panel Size properties
[x] Max/Min panel sizes should preserve Percent/Absolute state of SplitterDistance (currently resizing below the min results in a change to absolute splitter positioning
[x] Refactor UICatalogApp to use this as part of the PR

Modeled after the WinForms / Windows SplitContainer I've used the same name and public property names (Panel1, Panel2, SplitterDistance etc).
Draft for now as there's a few kinks to work out.  Theres a bit of a challenge in supporting both Percent and Absolute splitter distances.  Its mostly working for both but needs some thourough testing and to consider the other Pos types users could assign to SplitterDistance.
Out of Scope

[x] SplitterDistance should handle Percent and Absolute but not other types of Pos.  Letting user resize with keyboard/mouse means preserving the PosType is difficult.  Its most feasible if we restrict to Percent and Absolute.  So we should throw ArgumentException if user sets SplitterDistance to non percent/absolute (at least for time being).

Pull Request checklist:

[x] I've named my PR in the form of "Fixes #issue. Terse description."
[x] My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
[x] My code follows the Terminal.Gui library design guidelines
[x] I ran dotnet test before commit
[x] I have made corresponding changes to the API documentation (using /// style comments)
[x] My changes generate no new warnings
[x] I have checked my code and corrected any poor grammar or misspellings
[x] I conducted basic QA to assure all features are working

Awesome.
Can you refactor UICatalogApp to use this as part of the PR? That would add another use/test case.

@tig I took a look at changing UICatalog to use a split container.  The simplest solution would be just to put the 2 FrameView into either side of the parent SplitContainer but this would leave 3 separating lines down the middle (1 for each FrameView and 1 for the SplitterLine.
I looked into how to do it with just 1 line down the middle and have made some progress.
The biggest issue with this approach is that the 'Scenarios' caption has to go somewhere.  It also ideally has to move with the Splitter when dragged (see video).
I have a quite hacky solution using a Label floating over the Title but its pretty janky (see code below).  The Label also vanishes periodically so need to come up with something better.  Might be possible to just change the Title on the FrameView to have both strings (Categories and Scenarios) seperated by HLine.
But I thought I'd show the route I am going down before I put too much work into changing UICatalog.cs .  Was this what you were thinking of?
I've not committed the change but put the patch diff below so you can give me some feedback on whether you think this is an improvement?

--- a/UICatalog/UICatalog.cs
+++ b/UICatalog/UICatalog.cs
@@ -1,4 +1,4 @@
-´╗┐using NStack;
+using NStack;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
@@ -151,9 +151,9 @@ namespace UICatalog {
                        public MenuItem miIsMouseDisabled;
                        public MenuItem miHeightAsBuffer;

-                       public FrameView LeftPane;
+                       public FrameView ContentPane;
+                       public SplitContainer SplitContainer;
                        public ListView CategoryListView;
-                       public FrameView RightPane;
                        public ListView ScenarioListView;

                        public StatusItem Capslock;
@@ -201,24 +201,29 @@ namespace UICatalog {
                                        }),
                                        new StatusItem(Key.F10, "~F10~ Hide/Show Status Bar", () => {
                                                StatusBar.Visible = !StatusBar.Visible;
-                                               LeftPane.Height = Dim.Fill(StatusBar.Visible ? 1 : 0);
-                                               RightPane.Height = Dim.Fill(StatusBar.Visible ? 1 : 0);
+                                               ContentPane.Height = Dim.Fill(StatusBar.Visible ? 1 : 0);
                                                LayoutSubviews();
                                                SetChildNeedsDisplay();
                                        }),
                                        DriverName,
                                };

-                               LeftPane = new FrameView ("Categories") {
+                               ContentPane = new FrameView ("Categories") {
                                        X = 0,
                                        Y = 1, // for menu
-                                       Width = 25,
+                                       Width = Dim.Fill (),
                                        Height = Dim.Fill (1),
                                        CanFocus = true,
                                        Shortcut = Key.CtrlMask | Key.C
                                };
-                               LeftPane.Title = $"{LeftPane.Title} ({LeftPane.ShortcutTag})";
-                               LeftPane.ShortcutAction = () => LeftPane.SetFocus ();
+                               ContentPane.Title = $"{ContentPane.Title} ({ContentPane.ShortcutTag})";
+                               ContentPane.ShortcutAction = () => ContentPane.SetFocus ();
+
+                               SplitContainer = new SplitContainer {
+                                       Width = Dim.Fill (0),
+                                       Height = Dim.Fill (0),
+                                       SplitterDistance = 25
+                               };

                                CategoryListView = new ListView (_categories) {
                                        X = 0,
@@ -229,21 +234,23 @@ namespace UICatalog {
                                        CanFocus = true,
                                };
                                CategoryListView.OpenSelectedItem += (a) => {
-                                       RightPane.SetFocus ();
+                                       ScenarioListView.SetFocus ();
                                };
                                CategoryListView.SelectedItemChanged += CategoryListView_SelectedChanged;
-                               LeftPane.Add (CategoryListView);
+                               ContentPane.Add (SplitContainer);

-                               RightPane = new FrameView ("Scenarios") {
-                                       X = 25,
+                               SplitContainer.Panel1.Add (CategoryListView);
+
+                               Label lblScenarios = new Label ("Scenarios") {
+                                       X = SplitContainer.SplitterDistance + 1,
                                        Y = 1, // for menu
-                                       Width = Dim.Fill (),
-                                       Height = Dim.Fill (1),
-                                       CanFocus = true,
-                                       Shortcut = Key.CtrlMask | Key.S
                                };
-                               RightPane.Title = $"{RightPane.Title} ({RightPane.ShortcutTag})";
-                               RightPane.ShortcutAction = () => RightPane.SetFocus ();
+                               SplitContainer.SplitterMoved += (s, e) => {
+                                       lblScenarios.X = e.SplitterDistance + 1;
+                                       Application.Top.BringSubviewToFront (lblScenarios);
+                                       lblScenarios.SetNeedsDisplay ();
+                                       Application.Top.SetNeedsDisplay ();
+                               };

                                ScenarioListView = new ListView () {
                                        X = 0,
@@ -255,13 +262,13 @@ namespace UICatalog {
                                };

                                ScenarioListView.OpenSelectedItem += ScenarioListView_OpenSelectedItem;
-                               RightPane.Add (ScenarioListView);
+                               SplitContainer.Panel2.Add (ScenarioListView);

                                KeyDown += KeyDownHandler;
                                Add (MenuBar);
-                               Add (LeftPane);
-                               Add (RightPane);
+                               Add (ContentPane);
                                Add (StatusBar);
+                               Add (lblScenarios);

                                Loaded += LoadedHandler;

@@ -287,7 +294,7 @@ namespace UICatalog {
                                        _isFirstRunning = false;
                                }
                                if (!_isFirstRunning) {
-                                       RightPane.SetFocus ();
+                                       ScenarioListView.SetFocus ();
                                }
                                Loaded -= LoadedHandler;
                        }

Ok UICatalog is now using the new Splitter pane and it looks good.  Its one commit so if we don't think it is an improvement I can just revert dd246b7

Why can't we have a "T" here?

Thanks for your code @tig its looking way better now! I've fixed the compilation errors in the unit tests and added support for SplitContainer detecting when theres no border set (which results in it not using T's).  But there does seem to be some bad layout logic when the split container gets very small (most evident in tests since they use a 11x3 size).  But you can repro it in the UICatalog Scenario too:
Wierder still the splitter line seems to jump around when the height is small and you mouse on and off it (see end of this video):

Here my opinion. I think SplitContainer must obtain the border configuration of his host. If has no border then a single line must be drawn without T. If it's a single border then it must drawn a single T (left-right or top-bottom). If it's a double border it must drawn double T. In the bellow image the A and B was created with a single vertical SplitContainer. In the B panel was created another horizontal SplitContainer generating the C panel. I think this strategic is more controllable to deal with odd panels.

I think SplitContainer must obtain the border configuration of his host. If has no border then a single line must be drawn without T.

I think we can get the best of both worlds by tapping into the Border property.
@tig change means SplitContainer inherits from FrameView which looks great and works well with Titles.  But if user sets the BorderStyle to None then we should adapt to that.  I've started that in
e4cb4b9a676374a7b8b9dc7924fdadde7eb3f16c but few kinks to work out.

I've still got 3 failing tests after your changes @tig.  They are all the same and manifest when having horizontal splitter and height 3.  The top panel does not render (or is cleared, or something renders over the top of it.  I've not been able to track down what the issue is.  The positions are all correct according to the Watch window:

Any help would be appreciated.
    Expected:
<PHONE_NUMBER>1
    ───────────
<PHONE_NUMBER>2
    But Was:
    ───────────
<PHONE_NUMBER>2

Have added a 3 way split to the SplitContainerExample which makes this more exciting demo.  But it has also revealed an issue with Tab navigation not working.
Ill dig into it when I have some time but marked as Draft for now.
I can tab fine on the UICatalog home screen but in the example I can only tab into the first split container and not the nested one.

Have added a 3 way split to the SplitContainerExample which makes this more exciting demo. But it has also revealed an issue with Tab navigation not working.
Ill dig into it when I have some time but marked as Draft for now.
I can tab fine on the UICatalog home screen but in the example I can only tab into the first split container and not the nested one.

Thanks for your effort. That great. I think the SplitContainer must deal with tabbing. So, if the the last view on the is selected, tabbing will move to the first view of the nested slit container. If the first view of he nested split container is selected, shift tabbing will move to the last view of the first split container.

Ok turns out I just needed CanFocus = true; on SplitContainer.  Seems to work correctly now

Ok turns out I just needed CanFocus = true; on SplitContainer.  Seems to work correctly now

Ok I've done some thinking (dangerous I know) and I think this is doable.
We need 2 systems for this to work:
Arbitrary Connected Lines Drawer
This would work like a 'back buffer' in in graphics.  It would store all the vector lines that are added to it.  Then user would call 'Finalize' or 'Merge' or something which would create a 2D array in which all the lines are drawn.  Corners would be rendered with the appropriate symbol (T, Crosshair or L) based on the direction of intersecting vectors at that point.
The full final frame would then be used for whatever (e.g. drawn to screen).  This would be pretty easy to test and develop independently and demoable with a kind of 'drawing' Scenario.
Integrated nesting of SplitContainers
Currently a SplitContainer has 2 panels.  If we change SplitPanel to be a binary tree we can do let the user define as many sublevels as they want without having to create additional instances (good!).
In layout logic we can use recursion to pass ever reducing Bounds sizes into child branches based on the Splitter position consmed at the current level.
Estimate
Lots of work! but sounds fun!

Ok started exploring this idea here:
https://github.com/tznind/gui.cs/blob/line-drawer/Terminal.Gui/Core/Graphs/StraightLineCanvas.cs

Ok I've done some thinking (dangerous I know) and I think this is doable.
We need 2 systems for this to work:
Arbitrary Connected Lines Drawer
This would work like a 'back buffer' in in graphics. It would store all the vector lines that are added to it. Then user would call 'Finalize' or 'Merge' or something which would create a 2D array in which all the lines are drawn. Corners would be rendered with the appropriate symbol (T, Crosshair or L) based on the direction of intersecting vectors at that point.
The full final frame would then be used for whatever (e.g. drawn to screen). This would be pretty easy to test and develop independently and demoable with a kind of 'drawing' Scenario.
Integrated nesting of SplitContainers
Currently a SplitContainer has 2 panels. If we change SplitPanel to be a binary tree we can do let the user define as many sublevels as they want without having to create additional instances (good!).
In layout logic we can use recursion to pass ever reducing Bounds sizes into child branches based on the Splitter position consmed at the current level.
Estimate
Lots of work! but sounds fun!

I'm so in love with this thinking I can't stand it.
I wonder if we can do just enough to the current PR to ship it quickly while ensuring we can layer this other stuff in without breaking backwards compat?

StraightLineCanvas is comming along:

I wonder if we can do just enough to the current PR to ship it quickly while ensuring we can layer this other stuff in without breaking backwards compat?

It should be possible but I think i need to work this a bit longer to be sure that the solution will work.  Don't want to rename our panels Left and Right in anticipation of a binary tree structure then find out its not going to work out.

You guys are going to be disgusted by this, but for giggles, I asked ChatGPT to write a paneled window manager:

I want to build a paneling window manager for Terminal.Gui in c#. Please write the code for a c# class that implements a paneled window manager that supports an arbitrary number of panels. The lines separating the panels should be draggable to allow the panels to be resized.

using System;
using System.Collections.Generic;
using Terminal.Gui;

namespace PanelDemo
{
    public class PanelManager
    {
        private List<Panel> panels;
        private List<Line> lines;
        private Window window;
        private int panelSize;
        private int lineSize;
        private int numPanels;

        public PanelManager(Window window, int numPanels, int panelSize, int lineSize)
        {
            this.window = window;
            this.numPanels = numPanels;
            this.panelSize = panelSize;
            this.lineSize = lineSize;

            panels = new List<Panel>();
            lines = new List<Line>();
            for (int i = 0; i < numPanels; i++)
            {
                Panel panel = new Panel(new Rect(0, 0, panelSize, window.Frame.Height));
                panels.Add(panel);
                window.Add(panel);

                if (i < numPanels - 1)
                {
                    Line line = new Line(new Rect(panelSize, 0, lineSize, window.Frame.Height));
                    lines.Add(line);
                    window.Add(line);
                }
            }
        }

        public void ResizePanel(int panelIndex, int newSize)
        {
            Panel panel = panels[panelIndex];
            int oldSize = panel.Frame.Width;
            panel.Frame = new Rect(panel.Frame.X, panel.Frame.Y, newSize, panel.Frame.Height);
            if (panelIndex < numPanels - 1)
            {
                Line line = lines[panelIndex];
                line.Frame = new Rect(line.Frame.X + newSize - oldSize, line.Frame.Y, line.Frame.Width, line.Frame.Height);
                panels[panelIndex + 1].Frame = new Rect(panels[panelIndex + 1].Frame.X + newSize - oldSize, panels[panelIndex + 1].Frame.Y, panels[panelIndex + 1].Frame.Width - newSize + oldSize, panels[panelIndex + 1].Frame.Height);
            }
            window.Refresh();
        }
    }
}

To use this class, you will need to create an instance of the PanelManager class and pass in the Window object that you want to add the panels to, the number of panels you want, the initial size of each panel, and the size of the lines separating the panels. Then you can use the ResizePanel method to resize a panel by passing in the index of the panel and the new size.

Window window = new Window("Panel Demo");
PanelManager panelManager = new PanelManager(window, 3, 50, 2);

// Resize the second panel to be 60 units wide
panelManager.ResizePanel(1, 60);

Starting to feel like a deep rabbit hole!
Not sure this recursive approach is the best.  I'll keep digging and see but does feel a bit like I am working against API rather than with it.
class SplitPanel : View

    View Left
    View Right
    Pos SplitterDistance

    public virtual void LayoutSubviews ()
    {
        var currentSize = Bounds;
        LayoutSubviews(this, currentSize);
    }

    private LayoutSubviews(SplitPanel panel, Rect bounds)
    {

        var leftSpace = panel.SplitterDistance.Anchor(currentSize)
        var rightSpace = bounds.Width - leftSpace;

        if(panel.Left is SplitPanel ls)
        {
            LayoutSubviews(ls,new Rect(bounds.X,bounds.Y, width:leftSpace, height: bounds.Height));
        }
        else
        {
            panel.Left.X = bounds.X;
            panel.Left.Y = bounds.Y;
            panel.Width = leftSpace;
            panel.Height = bounds.Height;
        }

        if(panel.Right is SplitPanel rs)
        {
            LayoutSubviews(rs,new Rect(bounds.X+leftSpace,bounds.Y, width:rightSpace, height: bounds.Height));
        }
        else
        {
            panel.Right.X = bounds.X + leftSpace;
            panel.Right.Y = bounds.Y;
            panel.Right.Width = rightSpace;
            panel.Right.Height = bounds.Height;
        }

        // TODO: Also position line view
    }

    // TODO: Override get child views to return from tree

    // TODO: How to suppress child layouts?

    // TODO: How to add new child views

}

Not sure this recursive approach is the best. I'll keep digging and see but does feel a bit like I am working against API rather than with it.

No, what's happening is you are more closer to find the best way to do this.

Haha thanks for your confidence :)

As requested, bottomless recursion for SplitContainer! Still need to sort out titles and some other bits and bobs.  This PR now includes #2281 PR which is necessary for the line drawing.

@BDisp I've got a strange bug where Label is not respecting its max bounds during layout in some situations.  Its very wierd.  Manifests in test TestNestedContainer2LeftAnd1Right_RendersNicely.  Failing line is where I try to confirm that Label Frame width is constrained correctly to the available space (10).  The issue does not seem to manifest when using TableView (see video).  Also the Label does not render its text the full length (the '1' characters stop at the right place) but they overwrite the right panel (2s).
[Fact,AutoInitShutdown]
public void TestNestedContainer2LeftAnd1Right_RendersNicely()
{
	// [...]

	Assert.Equal (10, onesTop.Frame.Width);
	Assert.Equal (10, onesBottom.Frame.Width);

	splitContainer.Redraw (splitContainer.Bounds);

	string looksLike =
@"
1111111111│22222222
1111111111│22222222
          │
          │
          │
──────────┤
          │
          │
          │
          │";
	TestHelpers.AssertDriverContentsAre (looksLike, output);

}

You can see the issue in action here.  It manifests when you set the number of panels to 3 or 7 and use Label instead of TextView.  If you don't have any ideas, I can try to manifest it using vanilla views.  It may be a side effect of moving a Label out of one View and putting it into another one? (This happens during splitting to create more panels).

Quick response, before I can view this. Do you are using AutoSize as true or false?

Quick response, before I can view this. Do you are using AutoSize as true or false?

AutoSize is true.  I am creating them using new Label (new string ('1', 100))

Test passes if switching to TextView
@@ -583,10 +583,10 @@ namespace UnitTests {

                        container.IntegratedBorder = withBorder ? BorderStyle.Single : BorderStyle.None;

-                       container.Panel1.Add (new Label (new string ('1', 100)));
-                       container.Panel1.Add (new Label (new string ('1', 100)) { Y = 1});
-                       container.Panel2.Add (new Label (new string ('2', 100)));
-                       container.Panel2.Add (new Label (new string ('2', 100)) { Y = 1});
+                       container.Panel1.Add (new TextView { Text = new string ('1', 100), Height = 1, Width = Dim.Fill()});
+                       container.Panel1.Add (new TextView { Text = new string ('1', 100), Height = 1, Width = Dim.Fill (), Y = 1});
+                       container.Panel2.Add (new TextView { Text = new string ('2', 100), Height = 1, Width = Dim.Fill ()});
+                       container.Panel2.Add (new TextView { Text = new string ('2', 100), Height = 1, Width = Dim.Fill (), Y = 1});

                        container.Panel1MinSize = 0;
                        container.Panel2MinSize = 0;

But I think using AutoSize as false and also set the Width=Dim.Fill(). If still not working also set the Height=1.

But I think using AutoSize as false and also set the Width=Dim.Fill(). If still not working also set the Height=1.

Thanks that worked! Is AutoSize supposed to allow a Label to overspill its parents bounds?
[Theory, AutoInitShutdown]
[InlineData(true)]
[InlineData (false)]
public void Test_LayoutSizeOfLabel(bool label)
{
	var root = new View (){ Width = 20};

	var v = label == true ?
		new Label (new string ('c', 100)) {
			// Height = 1,          // <- Uncomment to make this test pass
			// AutoSize = false,
			Width = Dim.Fill () } :
		(View)new TextView () {
			Height = 1,
			Text = new string ('c', 100),
			Width = Dim.Fill () };

	root.Add (v);

	Application.Top.Add (root);
	root.LayoutSubviews ();
	root.BeginInit ();
	root.EndInit ();

	root.LayoutSubviews ();
	Assert.Equal (20, v.Frame.Width);
}

Thanks that worked! Is AutoSize supposed to allow a Label to overspill its parents bounds?

If it's using X=0, Y=0,Width=Dim.Fill(),Height=Dim.Fill() it must not  overspill its parents bounds. If it's using absolute values that is lower or greater than its parents bounds it's possible. If it's using X=0, Y=0,Width=Dim.Fill(),Height=Dim.Fill() and occupies all the  parents bounds, which has border and DrawMarginFrame is true, if the parent draw the border after the children, the border may overlap it's children. If overlap mustn't happen then the children must use pos and dim like X=1, Y=1,Width=Dim.Fill(1),Height=Dim.Fill(1). That why the advantage of the content view as a container to avoid adding the necessary margin to the children. The PanelView use a similar approach. If AutoSize is true and the text is greater than the parent width then word wrap comes into action, but I think it may overlap the parent height, not sure. Please, let me know if a label AutoSize is false and X=0, Y=0,Width=Dim.Fill(),Height=Dim.Fill() and the label still overspill its parents bounds. Thanks.

Ok, thanks for the test. I see that it's failing in width, I think it's supposed the word wrap comes into action. I'll see this better.

@tznind I already remember about this. Do you remember when I asked if AutoSize is true the view Width and Height must be ignored and only get the text length and you answered if them are set then we must use its size if the text length is lower than the Width or Height size. So, the logic is correct because the text length is greater than the Width in this unit test. At the time we agree if we need the view size setting is respected then we also must se AutoSize to false. If you still think this is not perfect please  let me know.

Ok, I think I understand.  Lets leave it for now then if behaviour is intended.  Sounds like a balancing act.

This PR is freaking amazing BTW.
The combination of "SplitContainer" and "LineCanvas" are such fundamental/rich capabilities: going to enable a ton of great apps, me thinks.
I now wonder if SplitContainer is the correct name?
Consider this: The SplitContainerNesting Scenario, could be abstracted into the library as a "Tiled View Container". Or just "Tiled Container"? Or "TileView"?
https://en.wikipedia.org/wiki/Tiling_window_manager
I guess I'm railing (really just brainstorming) against the choice of the word "Container" given the legacy of Terminal.Gui has never really used the term "Container" because "View" is fundamentally a container, thus "container" is superfluous.

(I'm actually excited to refactor Wizard to use all this at some point (esp the left & right panes in WizardStep and the area where the buttons go).

Sorry for all the comments, but I haz questions...
The latest code here, drives a model where tiles are nested (because SplitContainer has Panel1 and Panel2; if you want additional panels, you make Panel1 or Panel2 a container of a sub-view that is also SplitContainer).

I have an intuition that there are cases where a developer will want a flat model. e.g. the case where all Views that are contained within the "TileView" are siblings of each other.
// Append "!" to the Title of every tile
foreach (var view in TileView) {
   view.Title += "!";
}

@tznind, given the current architecture, is this possible?

Also the Label does not render its text the full length (the '1' characters stop at the right place) but they overwrite the right panel (2s). You can see this in the video when you select the Label (I made them focusable) - the grey focus line spills into the next container but the text does not.

The case of the grey focus line spills into the next container it's a bug that I will investigate. Thanks for the catch @tznind.

One more observation to emphasize that AutoSize as true must grow if the text is bigger than its parents bounds is for the case of alignments. Imagine you have a view with AutoSize as true, text alignment as centered and his size is bigger than the parent' size. Forcing the child size the same of the parent's size will result in a erroneous center alignment behavior, but the child never should never drawn outside the its parent bound. Please, correct me if I'm wrong.

@tznind I already submitted the PR #2290 that fixed the clearing bug. Thanks for the catch. But the label size maintain higher than it parent. So, you can't rely on the label size but only on the lower size of both.

I now wonder if SplitContainer is the correct name?
Consider this: The SplitContainerNesting Scenario, could be abstracted into the library as a "Tiled View Container". Or just "Tiled Container"? Or "TileView"?
https://en.wikipedia.org/wiki/Tiling_window_manager
I guess I'm railing (really just brainstorming) against the choice of the word "Container" given the legacy of Terminal.Gui has never really used the term "Container" because "View" is fundamentally a container, thus "container" is superfluous.
"SplitView"?
"PanelView"? I like this since the two main properties of the class are named "Panel1" and "Panel2"?

Naming
Good point.  I like SplitView and I can rename Panel1 to View1 and Panel2 to View2 if we are sticking with the current implementation.
API
I have moved some of the nesting code into SplitContainer (e.g. see TrySplitPanel1) but I think its worth exploring how in an ideal world the user might want to interact with the API.
I've detailed below how user would create various simple but common configurations but would like to open floor to how in an ideal world the user would interact with the control to create various panel layouts.
The current implementation expects user to do something like:
var root = new SplitContainer {
		Width = Dim.Fill (),
		Height = Dim.Fill (),
		Orientation = Terminal.Gui.Graphs.Orientation.Vertical,
		SplitterDistance = 30 };

root.TrySplitPanel1 (out SplitContainer lhs);

lhs.Orientation = Terminal.Gui.Graphs.Orientation.Horizontal;
lhs.SplitterDistance = Pos.Percent (25);

lhs.Panel1.Add (myNavigationPane);
lhs.Panel2.Add (myContentTreePane);
root.Panel2.Add (myMainContentView);

Creating a 3 panel UI where left 2 appear ontop of each other
If you want a 2x2 grid you would do
var root = new SplitContainer {
		Width = Dim.Fill (),
		Height = Dim.Fill (),
		Orientation = Terminal.Gui.Graphs.Orientation.Vertical,
		SplitterDistance = 30 };

root.TrySplitPanel1 (out SplitContainer lhs);
root.TrySplitPanel2 (out SplitContainer rhs);

rhs.Orientation = Terminal.Gui.Graphs.Orientation.Horizontal;
rhs.Orientation = Terminal.Gui.Graphs.Orientation.Horizontal;

lhs.Panel1.Add (myXPlane);
lhs.Panel2.Add (myYPlane);
rhs.Panel1.Add (myZPlane);
rhs.Panel2.Add (my3DRender);

"how in an ideal world the user would interact with the control?"

I have been thinking about this. Here's a scenario:

I'd like the ConfigurationEditor scenario I wrote to use SplitView instead of TabView. It would have 6 vertical split views, one for each config file/resource (the resources TextViews would be read only):

		/// <summary>
		/// Describes the location of the configuration files. The constancts can be
		/// combined (bitwise) to specify multiple locations.
		/// </summary>
		[Flags]
		public enum ConfigLocation {
			/// <summary>
			/// Application configuration found in the users's home directory (<c>~/.tui/appname.config.json</c>) -- Highest precidence
			/// and the default for <see cref="ConfigurationManager.Save()"/>.
			/// </summary>
			AppHomeDirectory,

			/// <summary>
			/// Global configuration in the directory the app was launched from (<c>./.tui/config.json</c>).
			/// </summary>
			GlobalAppDirectory,

			/// <summary>
			/// Global configuration in the user's home directory (<c>~/.tui/config.json</c>).
			/// </summary>
			GlobalHomeDirectory,

			/// <summary>
			/// Application configuration in the app's resources (<c>appname.Resources.config.json</c>).
			/// </summary>
			AppResources,

			/// <summary>
			/// Application configuration in the directory the app was launched from.
			/// </summary>
			AppDirectory,

			/// <summary>
			/// Global configuration in <c>Terminal.Gui.dll</c>'s resources (<c>Terminal.Gui.Resources.config.json</c>) -- Lowest Precidence.
			/// </summary>
			LibraryResources,

			/// <summary>
			/// This constant is a combination of all locations
			/// </summary>
			All = AppHomeDirectory | GlobalAppDirectory | GlobalHomeDirectory | AppResources | AppDirectory | LibraryResources

		}

So instead of the above, you'd have a1x6 grid.
I'd expect to be able to create/manage (so I could show/hide locations the user didn't want to see) like this:
foreach (var configFile in configFiles) {
	var homeDir = $"{Environment.GetFolderPath (Environment.SpecialFolder.UserProfile)}";
	FileInfo fileInfo = new FileInfo (configFile.Replace ("~", homeDir));
	string json;
	json = File.ReadAllText (fileInfo.FullName);

        var textView = new TextView () {
	  X = 0,
	  Y = 0,
	  Width = Dim.Fill (),
	  Height = Dim.Fill (),
   	  Text = initialText
         };

         // Add a panel to the right of the last one

         // Add textView to that panel
}

How would this look with your concept?

Take this to the next level, and enable spitting editor panes arbitrarily like VSCode does:

![66Rshzr 1](https://user-images.githubusercontent.com/585482/213715868-6d754552-6694-4a2d-af26-5ce79c0ca8e1.gif)

Take this to the next level, and enable spitting editor panes arbitrarily like VSCode does:

Ok this is a good target.  I think it is reasonable to write a scenario that allows for this kind of SplitUp/SplitDown etc experience.
I started exploring implementing this and realised that getting a context menu up for tabs is needlessly difficult currently so have created this seperate PR https://github.com/gui-cs/Terminal.Gui/pull/2299

Is this the experience you are looking for @tig ?  I've only implemented SplitRight for now and its buggy when you split a panel you've already split (e.g. split right then split the right pane right again).  But just trying to get the visuals down.  Its making me feel like theres scope for a root level view e.g. DynamicSplitView that hosts and manages its subcontainers and has the SplitLeft, SplitRight, SplitUp, SplitDown methods on it.  Kind of like a facade design pattern.
But if it gets good enough it might even be possible to make SplitView internal and only expose the DynamicSplitView (naming to be confirmed).

Is this the experience you are looking for @tig ?

Yep!

Getting closer.  Some layout bugs and bad measurements but the pattern is now there.
I've come around to the Tile idea.  So a SplitView (probably to be renamed TileView) can have any number of Tile (including 1).  All tiles have the same orientation (e.g. all horizontal or all vertical).
If you want to switch orientation you still need to nest but you can just convert a single Tile into a new SplitView with the alternate orientation.
This allows all tiles on a plane to resize equally nicely and makes for simpler insertion (see InsertTile).
And the best bit is we got rid of View1 and View2 stuff.  A SplitView has N Tiles and N-1 Splitter lines

@tig this is now ready for review.  I've left some comments though.
Specifically there are some lines that exist to work around https://github.com/gui-cs/Terminal.Gui/pull/2309 which can be removed if that is merged first.
Also if its easier to review seperately you could tackle #2281 pull request since this is a supper set of that branch.

Found a bug, titles can spill over into other Tiles.  Should be possible to stop this.

@tig do you want me to re-target this at v2 branch?

If my opinion is allowed I think if a PR doesn't cause any break changes it may be target the develop branch, because the v2 branch will always be merged with the develop branch before releasing.

Cool, makes sense 👍
On Sun, 5 Feb 2023, 13:07 BDisp, @.***> wrote:

If my opinion is allowed I think if a PR doesn't cause any break changes
it may be target the develop branch, because the v2 branch will always be
merged with the develop branch before releasing.
—
Reply to this email directly, view it on GitHub
https://github.com/gui-cs/Terminal.Gui/pull/2258#issuecomment-1417791533,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHO3C5FEHWKSQDGV6FQZVCTWV6Q2BANCNFSM6AAAAAATIASQFU
.
You are receiving this because you were mentioned.Message ID:
@.***>

@tznind can you resolve merge conflicts?

@tznind can you resolve merge conflicts?

Conflicts fixed @tig and have removed the now superfluous Bounds workarounds.
I did have to add SetNeedsDisplay on a lot of my tests  after merging.  Not a problem since they are redraw heavy tests but might be worth noting for later.  I didn't see any changes in behavior of the Scenarios (i.e. things not updating) so should be fine.

I wanted to write some code against this before merging (redo of AllViewsTester and ConfigurationEditor) but I now think the right thing to do is merge it now because it's so damn epic and any issues I find are likely on the margins.
I'll do a deep CR asap!

Here's Wizard as-is today (but with FrameView.DefaultBorder set to have a double style just to make a point).

Via LineView and SplitView it would be awesome if Wizard could be refactored (and other apps easily built) such that:
a) the horiztontal line above the buttons had the correct T connectors with the frame
b) the helptext box on right had a splitter between it and the controls of the step to the left (again, with proper Ts at top and bottom).
Having the correct Ts is one of the reasons I'm so excited about the work on this PR. Apps look SOOOO MUCH BETTER when this is done right. It really helps make Terminal.Gui shine, IMO.
I think you punted on mixed border styles (e.g. you can't mix Single and Double); can you opine on whether you think it's impossible with current SplitView architecture, possible but hard, or easy but will just take time?

I think you punted on mixed border styles (e.g. you can't mix Single and Double); can you opine on whether you think it's impossible with current SplitView architecture, possible but hard, or easy but will just take time?

This is doable and I have a design pattern in mind.  I've started coding up the approach in https://github.com/tznind/gui.cs/tree/line-canvas-style-mixing .  Basically we isolate each intersection type into its own 'resolver' class so it is maintainable and we just handle all the relevant permutations in each of those.

 I just accidentally force pushed an experiment to your splitcontainer branch, @tznind.
I meant to submit a PR to your PR. Ugh.

@tznind please forgive me for my incompetence. I think the PR I just submitted to your fork (for this PR) fixes the build break.
Anyway, please checkout the experiment i added in that PR (and force pushed). I modified FrameView such that this code magically does all the borders correctly. E.g. is the whole TIleView needed if we can go a route like this??
public override void Setup ()
		{
			var menu = new MenuBar (new MenuBarItem [] {
			new MenuBarItem ("_File", new MenuItem [] {
				new MenuItem ("_Quit", "", () => Application.RequestStop()),
			}) });

			Application.Top.Add (menu);

			var frame = new FrameView () {
				X = 0,
				Y = 1,
				Width = Dim.Fill (),
				Height = Dim.Fill (),
				IgnoreBorderPropertyOnRedraw = true
			};
			frame.Border.BorderStyle = BorderStyle.Double;

			Application.Top.Add (frame);

			var view1 = new FrameView () {
				Title = "View 1",
				Text = "View1 30%/50% Single",
				X = -1,
				Y = -1,
				Width = Dim.Percent (30),
				Height = Dim.Percent (50),
				ColorScheme = Colors.ColorSchemes ["Dialog"],
				Border = new Border () { BorderStyle = BorderStyle.Single }
			};

			frame.Add (view1);

			var view2 = new FrameView () {
				Title = "View 2",
				Text = "View2 right of view1, 30%/Fill Single.",
				X = Pos.Right (view1) - 1,
				Y = -1,
				Width = Dim.Percent (30),
				Height = Dim.Fill (-1),
				ColorScheme = Colors.ColorSchemes ["Error"],
				Border = new Border () { BorderStyle = BorderStyle.Single }
			};

			frame.Add (view2);

			var view3 = new FrameView () {
				Title = "View 3",
				Text = "View3 right of View2 Fill/Fill Single",
				X = Pos.Right (view2) - 1,
				Y = -1,
				Width = Dim.Fill (-1),
				Height = Dim.Fill (-1),
				ColorScheme = Colors.ColorSchemes ["Menu"],
				Border = new Border () { BorderStyle = BorderStyle.Single }
			};

			frame.Add (view3);

			var view4 = new FrameView () {
				Title = "View 4",
				Text = "View4 below View1 30%/5 Single",
				X = -1,
				Y = Pos.Bottom (view1)-1,
				Width = Dim.Percent (30),
				Height = 5,
				ColorScheme = Colors.ColorSchemes ["TopLevel"],
				Border = new Border () { BorderStyle = BorderStyle.Single }
			};

			frame.Add (view4);

			var view5 = new FrameView () {
				Title = "View 5",
				Text = "View5 below View4 view4.Width/5 Double",
				X = -1,
				Y = Pos.Bottom (view4) - 1,
				Width = view4.Width,
				Height = 5,
				ColorScheme = Colors.ColorSchemes ["TopLevel"],
				Border = new Border () { BorderStyle = BorderStyle.Double }
			};

			frame.Add (view5);
		}

This was all accopmlished by modifying Frameview.Redraw thusly:
if (!IgnoreBorderPropertyOnRedraw) {
				Driver.SetAttribute (GetNormalColor ());
				//Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: false);
				Border.DrawContent (this, false);
				if (HasFocus)
					Driver.SetAttribute (ColorScheme.HotNormal);
				if (Border.DrawMarginFrame)
					Driver.DrawWindowTitle (scrRect, Title, padding.Left, padding.Top, padding.Right, padding.Bottom);
				Driver.SetAttribute (GetNormalColor ());
			} else {
				Driver.SetAttribute (ColorScheme.Normal);

				var lc = new LineCanvas ();

				if (Border?.BorderStyle != BorderStyle.None) {

					lc.AddLine (new Point (0, 0), bounds.Width - 1, Orientation.Horizontal, Border.BorderStyle);
					lc.AddLine (new Point (0, 0), bounds.Height - 1, Orientation.Vertical, Border.BorderStyle);

					lc.AddLine (new Point (bounds.Width - 1, bounds.Height - 1), -bounds.Width + 1, Orientation.Horizontal, Border.BorderStyle);
					lc.AddLine (new Point (bounds.Width - 1, bounds.Height - 1), -bounds.Height + 1, Orientation.Vertical, Border.BorderStyle);
				}

				foreach (var subview in contentView.Subviews) {
					lc.AddLine (new Point (subview.Frame.X+1, subview.Frame.Y+1), subview.Frame.Width - 1, Orientation.Horizontal, subview.Border.BorderStyle);
					lc.AddLine (new Point (subview.Frame.X+1, subview.Frame.Y+1), subview.Frame.Height - 1, Orientation.Vertical, subview.Border.BorderStyle);

					lc.AddLine (new Point (subview.Frame.Width - 1, subview.Frame.Y + subview.Frame.Height), -subview.Frame.Width + 1, Orientation.Horizontal, subview.Border.BorderStyle);
					lc.AddLine (new Point (subview.Frame.X + subview.Frame.Width, subview.Frame.Height - 1), -subview.Frame.Height + 1, Orientation.Vertical, subview.Border.BorderStyle);
				}

				//TODO: Figure out how to draw Titles

				// TODO: Figure out how to add splitters
}

Which is hacky, but shows directionally that this idea should work.
To get the Splitters, my thinking is to detect where they're needed in LayoutSubviews and add them.
Or, perhaps, not do it automatically, but let the caller (who added the subviews to FrameView) add them explicitly.  Noodling on this now.

Titles were easy:

// FrameView.Redraw...
var lc = new LineCanvas ();

				if (Border?.BorderStyle != BorderStyle.None) {

					lc.AddLine (new Point (0, 0), bounds.Width - 1, Orientation.Horizontal, Border.BorderStyle);
					lc.AddLine (new Point (0, 0), bounds.Height - 1, Orientation.Vertical, Border.BorderStyle);

					lc.AddLine (new Point (bounds.Width - 1, bounds.Height - 1), -bounds.Width + 1, Orientation.Horizontal, Border.BorderStyle);
					lc.AddLine (new Point (bounds.Width - 1, bounds.Height - 1), -bounds.Height + 1, Orientation.Vertical, Border.BorderStyle);
				}

				foreach (var subview in contentView.Subviews) {
					lc.AddLine (new Point (subview.Frame.X + 1, subview.Frame.Y + 1), subview.Frame.Width - 1, Orientation.Horizontal, subview.Border.BorderStyle);
					lc.AddLine (new Point (subview.Frame.X + 1, subview.Frame.Y + 1), subview.Frame.Height - 1, Orientation.Vertical, subview.Border.BorderStyle);

					lc.AddLine (new Point (subview.Frame.X + subview.Frame.Width, subview.Frame.Y + subview.Frame.Height), -subview.Frame.Width + 1, Orientation.Horizontal, subview.Border.BorderStyle);
					lc.AddLine (new Point (subview.Frame.X + subview.Frame.Width, subview.Frame.Y + subview.Frame.Height), -subview.Frame.Height + 1, Orientation.Vertical, subview.Border.BorderStyle);

				}

				Driver.SetAttribute (ColorScheme.Normal);
				lc.Draw (this, bounds);

				foreach (var subview in contentView.Subviews) {
					if (subview is FrameView viewWithTite) {
						var rect = viewWithTite.Frame;
						rect.X = rect.X + 1;
						rect.Y = rect.Y + 2;
						Driver.DrawWindowTitle (rect, viewWithTite.Title, padding.Left, padding.Top, padding.Right, padding.Bottom);
					}
				}

Two thoughts just collided:

I don't like the fact that keyboard access to the splitter is via TAB. E.g. in UICatalog it breaks the simplicity of using Tab to toggle between the two panes (I have to double-tab now). Suggestion: Let's define a standard keystroke that activates "sizing" and subsequent presses navigates across possible points where sizing can occur. E.g. F10.

View should be optionally sizable on all 4 sides. E..g view.IsSizable = true -> diamonds show up on all 4 borders. Click/Drag on any border supports resize. Or hit F10 and left border diamond shows foucus. HIt F10 again and it moves to top, etc... 5th press resumes previous focus.

If we did this, then setting up the subviews of a FrameView as I show above, will automatically get splitter functionality (mostly).
I think this concept will work. Pretty excited about it.

Love this work on FrameView.  Looks really nice and the way the subframes float freely looks very cool!

I have fixed the layout bug when horizontal orientation with a border.  I've also added a Ctrl+F10 key shortcut to toggle splitter focusability.

FWIW, I've been massively distracted refactoring View for v2. I have some eggciting results that I hopefully can share soon that will make all of this work you've done be even more magic.

I'll need to update this to the new method signature of LineCanvas, shouldn't take long, should manage thisevening.

Think tests are failing due to this bug which manifests when nesting normal (non TileViews too), see repro.
https://github.com/gui-cs/Terminal.Gui/issues/2368

@tznind can you please try to get this passing again. the unit tests are failing after accepting your change and updating from develop

Ok I think the failing tests are due to me merging https://github.com/tznind/gui.cs/pull/158 so I have reverted it.
Was that PR purely stuff already in develop? if so something must have gone wrong with me merging it.
If theres other work in it then I can look into porting it to the this branch.

Hmn seems to be an issue with Tab navigation after splitting containers in Notepad Scenario.  You end up getting stuck in a cycle where you can't get across to there other tile no matter how much you hit Tab.  Think I need to look into that and see if theres a 'recompute tabs' method or something.

Hmn seems to be an issue with Tab navigation after splitting containers in Notepad Scenario. You end up getting stuck in a cycle where you can't get across to there other tile no matter how much you hit Tab. Think I need to look into that and see if theres a 'recompute tabs' method or something.

The better choose is perhaps using the alternate key navigation which default is the Ctrl+Tab for forward and Shift+Ctrl+Tab for backward.

Ok heres a minimum repro (see below).  But the weird thing is that Shift+Tab works! its only Tab that gets stuck looping.

Pressing Tab repeatedly

Pressing shift tab repeatedly
Repro Code:
Application.Init ();

var t = new TileView (1) {Y = 1, Width = Dim.Fill (), Height = Dim.Fill () };
t.Tiles.ElementAt (0).ContentView.Add (new TextField { Width = 10, Height = 1, Text = "111" });
var result = t.InsertTile (1);
result.ContentView.Add (new TextField { Width = 10, Height = 1, Text = "222" });
var w = new Window ();
w.Add (t);
w.Add (new TextField { Text = "000" ,Width = 10,Height = 1});

Application.Run (w);
Application.Shutdown ();

Ok I think the problem is this code in OnEnter
if (!Tiles.Where (t => t.ContentView.HasFocus).Any ()) {
		Tiles.FirstOrDefault ()?.ContentView.SetFocus ();
	}

Ok I think the problem is this code in OnEnter

Ah right. You have to ensure if there have or not another tile view. If exist and is the last view focused and Tab pressed then must navigate to the first view of the tile view.

Ok should be working now.  I have deleted the entire OnEnter override and made the TileView itself CanFocus false (the default).

Yet better, let the View base work :-)

It's working but has a new wrong behavior. The navigation is backwards.

It's working but has a new wrong behavior. The navigation is backwards.
Edit: Never mind. It's the right navigation. So when a new tile is inserted the last being focused. So first "222", "111" and last "000".

Yeah I think it mostly depends what order you split and add to TileView.  For example in the Notepad example if you SplitLeft then take left pane and SplitDown then tab navigation works correctly but feels off since it enters the bottom from the right then goes up:

But if you SplitLeft then take the left pane and SplitUp then tab navigation works and feels right.

Hmn test failures are System.InvalidOperationException : Cannot set CanFocus to true if the SuperView CanFocus is false!
They are for when you make the splitter lines focusable during runtime.

Well if you want to order always by left top corner to down and right bottom corner, then you have to use BringSubviewForward, SendSubviewBackwards, BringSubviewToFront or SendSubviewBackwards, accordingly.

Well if you want to order always by left top corner to down and right bottom corner, then you have to use BringSubviewForward, SendSubviewBackwards, BringSubviewToFront or SendSubviewBackwards, accordingly.

Yeah don't think I want to do that! feels a bit hacky/risky and I think the current behaviour is ok.
Might look into adjusting the tabIndexes during InsertTile or TrySplitTile though.

Hmn test failures are System.InvalidOperationException : Cannot set CanFocus to true if the SuperView CanFocus is false!
They are for when you make the splitter lines focusable during runtime.

At runtime you have to set the superview can focus to true before.

I guess maybe I need to remove the line views and then add them again as focusable or something

If you are adding at load a line view that has CanFocus as true it will also sets the superview CanFocus to true.

Strangely it doesn't affect the Scenarios only the tests.
Because the scenarios ha already initialized by the Application.Begin.

Let me say some clarification on this. Toplevel.CanFocus is false. When a subview with CanFocus as true and if toplevel is enabled, then the Toplevel.CanFocus is sets to true, but this is done when the subview is adding to the superview. At runtime if you sets the superview CanFocus to false it also will sets all the subviews CanFocus to false.

Cool, so the fix I applied for the CanFocus buisness is https://github.com/gui-cs/Terminal.Gui/pull/2258/commits/7929084591c753b2841bd8ce2a38495c95ea54d0 which seems to avoid the throw even if it seems a bit hacky.  And since the LineView has no children it shouldn't have any unforseen consequences I think.

Cool, so the fix I applied for the CanFocus buisness is 7929084 which seems to avoid the throw even if it seems a bit hacky. And since the LineView has no children it shouldn't have any unforseen consequences I think.

Well I don't agree. Even it have no children, but it could can get the focus to manage his position. Imagine you want to move the line through the keyboard. For that it needed to get focus first for being receiving keys events. But if the superview CanFocus is false, then you can't also focused the LineView. Make sense.

Cool, so the fix I applied for the CanFocus buisness is 7929084 which seems to avoid the throw even if it seems a bit hacky. And since the LineView has no children it shouldn't have any unforseen consequences I think.

Well I don't agree. Even it have no children, but it could can get the focus to manage his position. Imagine you want to move the line through the keyboard. For that it needed to get focus first for being receiving keys events. But if the superview CanFocus is false, then you can't also focused the LineView. Make sense.

Ah there is a keypress (Ctrl+F10 by default) that makes the lines focusable so user can tab to them and move them with cursor keys :).  In fact it is that toggling that was originally throwing the InvalidArgumentException.

I've also seen that even if CanFocus is false you can still focus children. Even the default View class has CanFocus of false but you can select stuff that you have added to it no problem.

The trick is bellow. It's handled on View.Add method. At runtime if the superview CanFocus is false you can't add a subview with CanFocus as true without first sets the superview CanFocus to true. This is the expected the desired behavior. If a superview CanFocus was sets to false at runtime, we need to inspect his value before adding a subview with CanFocus as true to it.
https://github.com/gui-cs/Terminal.Gui/blob/9cfa78a0330f6ff05c9460d7064fd9167d90d60d/Terminal.Gui/Core/View.cs#L943-L953

@tznind - same question about v1 v v2 for this.

Sure, if it saves work I'm all for it
On Tue, 28 Feb 2023, 01:57 Tig, @.***> wrote:

@tznind https://github.com/tznind - same question about v1 v v2 for
this.
—
Reply to this email directly, view it on GitHub
https://github.com/gui-cs/Terminal.Gui/pull/2258#issuecomment-1447448144,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHO3C5FV7O4DFPIYRZTTGUDWZVLSDANCNFSM6AAAAAATIASQFU
.
You are receiving this because you were mentioned.Message ID:
@.***>

I hadn't realized this was already in v2.  I've fetched and merged v2 into this and now the only changes are the toggle button and tab order fixes.  It also targets the v2 branch now.

Yeah, I needed it for Config Manager so merged it a bit ago.
Why does this PR have all the config manager stuff in it as well?

This PR is now only +102 / −62 after merging v2 branch into it (splitcontainer) and re targeting the pr to merge back into v2.  I thought that was the plan? but didn't realize it had in effect already been merged into v2.
Looks like there are only very recent (unmerged) changes now in this branch that are not still on v2.
The configuration manager stuff is already in v2.


System.ArgumentOutOfRangeException when logging a message with unused parameters

I am running NLog Version 4.6.6, .NET Framework 4.7.1 on VS2017.
When logging a message which exceeds short.MaxValue characters might result in an ArgumentOutOfRangeException.
Try this:
public static void Bumm()
{
	string char32 = "ABCDEFÖ8901234567890123456789012";
	string a = "";
	for (int i = 0; i < 1023 * 1; i++)
	{
		a += char32;
	}
	var myLogger = NLog.LogManager.GetLogger("myLogger");
	LogEventInfo theEvent = new LogEventInfo(
		LogLevel.Debug, "muh", CultureInfo.InvariantCulture, a, new object[] { 42 });
	myLogger.Log(theEvent);  // OK (length < short.MaxValue)
	a += char32;
	theEvent = new LogEventInfo(
		LogLevel.Debug, "muh", CultureInfo.InvariantCulture, a, new object[] { 42 });
	myLogger.Log(theEvent); // Exception length = short.MaxValue + 1
}

The reason is an overflow when converting an int32 (returned by SkipUntil) to an int16 (Literal.Skip) in the TemplateEnumerator.ParseTextPart.
What is the preferred way of fixing this?

Change the Literal.Skip from short to int
Ensure that no overflow happens when assigning the Skip Property (more or less: (short)Math.Min(short.MaxValue, SkipUntil(...))
It depends on what the intention was when defining the Skip as a short in the firstplace.
If I read the history correct, the Skip and Print both have been ushort in the first place. Someone has changed Print to an int32 but the sense of changing the position from ushort to short I do not get.

@snakefoot @304NotModified do you have any concerns when changing the type of Skip to an int32?

Think it is a great idea to change Literal.Skip to be an int.

Created PR #4053

Pre-release nuget-package is now available (Download NLog.<IP_ADDRESS>60-PR4053.nupkg and place in local-path nuget-repository):
https://ci.appveyor.com/project/nlog/nlog/builds/34238992/artifacts

Thank you for fixing this super fast!
Do I have to close this issue myself or is this done automatically with the next release?

Do I have to close this issue myself or is this done automatically with the next release?

When the PR is merged, then it will resolve the issue.


Issues with using/re-training saved models

Hi,
I'm trying to compute Rule Set 2 scores using model_comparison.predict on the nopos model.
If I download the latest version from github, the pickle files don't seem to load:
ValueError: Buffer dtype mismatch, expected 'SIZE_t' but got 'long long'

So I run model_comparison.py as instructed on the main github page to reproduce the two models.
It prints a LOT of warnings:
WARNING: trimming max_index_to use down to length of string=30

but does eventually produce two model files.
However if I use those files, I get a different answer to the value you report in the README that comes with the Rule Set 2 Calculator 0.5909 vs 0.5656.
Looking at that latest test_saved_models.py, it looks like you expect the new value. So I guess I'm just wondering what the reason is for the change? Which one corresponds to the method used in your paper? I'm guessing the older one? In which case, how do I reproduce that?
(sorry I didn't mean to submit this issue when I submitted it, and have since resolved some issues with versioning, so now it's a question instead!)
Thanks,
Felicity

A further observation is that the web server appears to produce the 0.5656 answer.

Hi Felicity,

If I download the latest version from github, the pickle files don't seem to load

you could be using the wrong version of scikit-learn. If you install Azimuth now, it should force you to use the correct version. You can also retrain the models to match your version of scikit-learn (see instructions in the readme).

So I guess I'm just wondering what the reason is for the change?

We fixed a small indexing bug in #1, so perhaps that's the reason for the discrepancy. You can find more details in release v1.0 here.
Let us know if any of this helps, I will close the bug for now.
Nicolo