| MAUI horror | |
|
|
|
Author | Message |
---|
TheSelfImprover
Posts : 3110 Join date : 2020-11-18
| Subject: Re: MAUI horror Fri Jun 28, 2024 3:38 pm | |
| There's always the old favourite - Windows Forms (or WPF). You'd be able to focus on building your chess program rather than wrestling with the framework itself. | |
|
| |
Henk
Posts : 1379 Join date : 2020-11-17
| Subject: Re: MAUI horror Fri Jun 28, 2024 4:41 pm | |
| I am currently still using MAUI for windows. Devil made/makes me do it. Something to do with MVVM. I have forgotten. Who knows maybe I have to run it in on another operating system. | |
|
| |
TheSelfImprover
Posts : 3110 Join date : 2020-11-18
| Subject: Re: MAUI horror Fri Jun 28, 2024 4:57 pm | |
| If you use MAUI, it's supposed to then be possible to make apps for iOS, Android, macOS, and Windows from the same code base. | |
|
| |
Henk
Posts : 1379 Join date : 2020-11-17
| Subject: Re: MAUI horror Sat Jun 29, 2024 9:44 am | |
| I deleted too much now intellisense not working any more. Maybe I have to create a new project. But then again compile time often taking too long.
So I go on until it gets a real burden. | |
|
| |
Henk
Posts : 1379 Join date : 2020-11-17
| Subject: Re: MAUI horror Sat Jun 29, 2024 12:59 pm | |
| Now sometimes intellisense is working or maybe always. Don't know what happened. Still found no good reason not to use WPF. Might be I could create the MAUI tools myself on WPF. I don't know much about WPF. | |
|
| |
Henk
Posts : 1379 Join date : 2020-11-17
| Subject: Re: MAUI horror Tue Jul 02, 2024 10:07 am | |
| - TheSelfImprover wrote:
- Henk wrote:
- Probably nobody knows what data flow charts are. It is different from flow charts (only or mainly) focussing on data.
By the way I don't feel comfortable with multi-threading. One thread already complicated enough. In c# you use lock(object). I stupidly copy the pattern without thinking.
Looks like everything has to run asynchronously in user interfaces. Also adding complexity.
I understand your reticence with multi-threading: if you're not careful, everything goes wrong!
If you're aspiring to write a chess engine that competes with the best, though, you will need multi-threading unfortunately. Ok. Method fails. Dataflow charts with objects and swimlanes. Dataflow charts with objects is called collaboration diagram. At school I already hated semaphores. Today you have to use tasks or threads
Last edited by Henk on Sat Jul 13, 2024 1:57 pm; edited 2 times in total | |
|
| |
Henk
Posts : 1379 Join date : 2020-11-17
| Subject: Re: MAUI horror Fri Jul 05, 2024 10:20 am | |
| - Code:
-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
This is what I am using now. No other TargetFrameworks. Also I deleted some other non-windows code. Even packages. But can't remember. Friday or saturday, last week being a destructive day. Looks like visual studio is working fine now. But not sure. | |
|
| |
Henk
Posts : 1379 Join date : 2020-11-17
| Subject: Re: MAUI horror Fri Jul 12, 2024 12:24 pm | |
| | |
|
| |
Henk
Posts : 1379 Join date : 2020-11-17
| Subject: Re: MAUI horror Tue Jul 16, 2024 6:47 pm | |
| This kept me busy for at least a week: Answer is from ChatGPT:
Why is the Cancellation Check Not Enough Alone? Continuous Execution:
If the loop executes continuously without any awaitable operations, it doesn't provide a break for the cancellation token's state change to be processed. The check while (!cancellationTokenSource.Token.IsCancellationRequested) will run rapidly, but the cancellation request handling is deferred until the loop naturally yields control or completes. Blocking the Thread:
A tight loop can monopolize the CPU, blocking the thread from performing other tasks. This includes the task responsible for setting the IsCancellationRequested property of the token. Thus, the loop may continue running without realizing a cancellation has been requested. | |
|
| |
Henk
Posts : 1379 Join date : 2020-11-17
| Subject: Re: MAUI horror Tue Jul 16, 2024 6:50 pm | |
| - Code:
-
private async Task StartAnalysisAsync() { var position = Game.ChessBoard; string fen = position.ConvertToFen(Game.MoveNumber); stockfishAnalyzer.StartAnalysis(fen, EngineOptionsViewModel.Instance.MultiPV);
AnalysisOutput.Clear(); try { while (!cancellationTokenSource.Token.IsCancellationRequested) { var nextLine = stockfishAnalyzer.NextLine();
if (nextLine == null) break;
if (nextLine.Contains("pv")) // useful information { var analysisLine = ParseStockFishLine(nextLine, position); if (analysisLine != null) { AnalysisOutput.Insert(0, analysisLine); ProgressBarValue = 0.5 + analysisLine.Value / 1000; } } // Use Task.Delay to make the loop yield and check for cancellation await Task.Delay(10, cancellationTokenSource.Token); } } catch (OperationCanceledException) { //Handle the cancellation } }
| |
|
| |
Henk
Posts : 1379 Join date : 2020-11-17
| Subject: Re: MAUI horror Tue Jul 16, 2024 7:03 pm | |
| | |
|
| |
Sponsored content
| Subject: Re: MAUI horror | |
| |
|
| |
| MAUI horror | |
|