Version:0.9
StartHTML:0000000105
EndHTML:0000154252
StartFragment:0000000141
EndFragment:0000154216
2 //https://www.perplexity.ai/search/new?q=pending&newFrontendContextUUID= ?? ?? ??
3 //https://medium.com/@yaduvanshineelam09/10-python-functions-every-data-scientist-must-memorize-fc5ff51d6c91
4 //https://python.plainenglish.io/master-functional-programming-in-python-4527f5f6cc0a
5 //https://rosettacode.org/wiki/Decimal_floating_point_number_to_binary#Delphi
6 //https://rosettacode.org/wiki/Death_Star#Delphi
7 //https://rosettacode.org/wiki/Dutch_national_flag_problem#Delphi
8 //https://rosettacode.org/wiki/Bioinformatics/base_count#Pascal
9 //https://python.plainenglish.io/15-python-built-in-functions-youll-wish-you-knew-sooner-c8cf98d6c51a
10
11 program DNA_basecount_15PythonBuiltin_Functions;
12
13 (*
14 {$IFDEF FPC}
15 {$MODE DELPHI}//String = AnsiString
16 {$ELSE}
17 {$APPTYPE CONSOLE}
18 {$ENDIF} *)
19
20 const
21 dna =
22 'CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG' +
23 'CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG' +
24 'AGGACAAAGGTCAAGATGGAGCGCATCGAACGCAATAAGGATCATTTGAT' +
25 'GGGACGTTTCGTCGACAAAGTCTTGTTTCGAGAGTAACGGCTACCGTCTT' +
26 'CGATTCTGCTTATAACACTATGTTCTTATGAAATGGATGTTCTGAGTTGG' +
27 'TCAGTCCCAATGTGCGGGGTTTCTTTTAGTACGTCGGGAGTGGTATTATA' +
28 'TTTAATTTTTCTATATAGCGATCTGTATTTAAGCAATTCATTTAGGTTAT' +
29 'CGCCGCGATGCTCGGTTCGGACCGCCAAGCATCTGGCTCCACTGCTAGTG' +
30 'TCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATTCGTGTAGAC' +
31 'GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT';
32 var
33 CntIdx : array of NativeUint;
34 DNABases : String;
35 SumBaseTotal : NativeInt;
36
37 procedure OutFormatBase(var DNA: String;colWidth:NativeInt);
38 var
39 j: NativeInt;
40 Begin
41 j := 0;
42 Writeln(' DNA base sequence:');
43 while j<Length(DNA) do Begin
44 //writeln(j:5,copy(DNA,j+1,colWidth):colWidth+2);
45 writeln(format('%5d %*s',[j,colwidth+2,copy(DNA,j+1,colWidth)]));
46 inc2(j,colWidth);
47 end;
48 writeln('');
49 end;
50
51 procedure Cnt(const DNA: String);
52 var
53 i,p :NativeInt; st: string;
54 Begin
55 SetLength(CntIdx,Length(DNABases));
56 i := 1;
57 while i <= Length(DNA) do Begin
58 p := Pos(DNA[i],DNABases);
59 //found new base so extend list
60 if p = 0 then Begin
61 DNABases := DNABases+DNA[i];
62 p := length(DNABases);
63 Setlength(CntIdx,p+1);
64 end;
65 //writ(itoa(CntIdx[p-1]));
66 inc(CntIdx[p-1]);
67 inc(i);
68 end;
69 Writeln('Base Count');
70 SumBaseTotal := 0;
71 For i := 0 to Length(DNABases)-1 do Begin
72 p := CntIdx[i];
73 inc2(SumBaseTotal,p);
74 //writeln(DNABases[i]:4,p:10)
75 st:= (DNABases[i+1]);
76 //writeln(format('%4s %10d',[st,p]));
77 formatF('%4s %10d',[st,p]);
78 end;
79 Writeln('Total base count: '+itoa(SumBaseTotal));
80 writeln(' ');
81 end;
82
83 var TestOrder: array [0..11] of string; { =
84 ('Blue','Blue','White','Blue','White','Blue',
85 'Red','White','White','Blue','White','Red'); }
86
87 function DecodeList(SL: TStringList): string;
88 {Convert encoded colors 1, 2 and 3 to Red, White and Blue}
89 var I: integer;
90 begin
91 Result:='';
92 for I:=0 to SL.Count-1 do begin
93 if I>0 then Result:=Result+',';
94 if SL[I]='1' then Result:=Result+'Red'
95 else if SL[I]='2' then Result:=Result+'White'
96 else Result:=Result+'Blue'
97 end;
98 end;
99
100 procedure DoDutchFlag(Memo: TMemo; Order: array of string);
101 {Solve dutch flag color order using TStringList component}
102 {Encode colors "Red", "White" and "Blue" to "1", "2", and "3" }
103 {This allows them to be sorted in the TString List}
104 var I: integer;
105 var SL: TStringList;
106 var S2: string;
107 begin
108 SL:=TStringList.Create;
109 try
110 {Encode colors from array of strings}
111 for I:=0 to High(TestOrder) do begin
112 if Order[I]='Red' then SL.Add('1')
113 else if Order[I]='White' then SL.Add('2')
114 else SL.Add('3');
115 end;
116 Memo.Lines.Add('Original Order:');
117 Memo.Lines.Add('['+DecodeList(SL)+']');
118 SL.Sort;
119 Memo.Lines.Add('Sorted Order:');
120 Memo.Lines.Add('['+DecodeList(SL)+']');
121 finally SL.Free; end;
122 end;
123
124 procedure RandomTestOrder;
125 var vQ: TStringList;
126 begin
127 vQ:= TStringList.create;
128 for it:=0 to High(TestOrder) do
129 vQ.add(testorder[it]);
130 Shuffle(vQ);
131 for it:= 0 to high(Testorder) do
132 testorder[it]:= vQ[it];
133 vQ.Free;
134 end;
135
136 procedure ShowDutchFlag(Memo: TMemo);
137 begin
138 DoDutchFlag(Memo,TestOrder);
139 end;
140
141 const DEFGDC =
142 '# Gradient Descent algorithm '+LF+
143 'def gradient_descent(derivative_func,initial_x,learning_rate,epochs): '+LF+
144 ' x = initial_x '+LF+
145 ' for _ in range(epochs): '+LF+
146 ' grad = derivative_func(x) '+LF+
147 ' x -= learning_rate * grad # Update rule '+LF+
148 ' return x '+LF+
149 '# Derivative of f(x) = x^2, which is f''(x) = 2x '+LF+
150 'def derivative(x): '+LF+
151 ' return 2 * x ';
152
153 const DEFDNA =
154 'def basecount(dna): '+LF+
155 ' return sorted(Counter(dna).items()) '+LF+
156 ' '+LF+
157 'def seq_split(dna, n=50): '+LF+
158 ' return [dna[i: i+n] for i in range(0, len(dna), n)] '+LF+
159 ' '+LF+
160 'def seq_pp(dna, n=50): '+LF+
161 ' for i, part in enumerate(seq_split(dna, n)): '+LF+
162 ' print(f"{i*n:>5}: {part}") '+LF+
163 ' print("\n BASECOUNT:") '+LF+
164 ' tot = 0 '+LF+
165 ' for base, count in basecount(dna): '+LF+
166 ' print(f" {base:>3}: {count}") '+LF+
167 ' tot += count '+LF+
168 ' base, count = ''TOT'', tot '+LF+
169 ' print(f" {base:>3}= {count}") ';
170
171
172 procedure DnA_PySolution_Fundamental_15Built(loc: string);
173 var OWMKEYS: string;
174 begin
175 with TPythonEngine.Create(Nil) do begin
176 //pythonhome:= PYHOME64;
177 loadDLL;
178 autofinalize:= false;
179 try
180 Execstring('import re, requests, time, pyttsx3');
181 // Execstring('import plotly.express as px');
182 Execstring('from PIL import Image; import os, math, collections');
183
184 // 7. Enumerate Function
185 Execstr('Sphere = collections.namedtuple("Sphere", "cx cy cz r")');
186 Execstr('V3 = collections.namedtuple("V3", "x y z")');
187 //def powersum(power, *args):
188
189 //Execstr(DEFNORM);
190 Execstr(DEFGDC);
191 Execstr(DEFDNA);
192 Execstr('import io, sys');
193 execstr('output = io.StringIO()')
194 execstr('sys.stdout = output')
195 //execstr('V3 = {-50, 30, 50}')
196 //execstr('light = normalize(-50, 30, 50, V3)');
197 execstr('is_relively_prime = lambda a, b: gcd(a, b) == 1');
198 execstr('sigma_sum = lambda x: sum(factors(x))');
199 execstr('is_duffinian = lambda x: is_relively_prime(x, sigma_sum(x)) and len(factors(x)) > 2');
200 Execstring('from collections import Counter');
201 println(evalstr('__name__'));
202 execstr('if __name__ == ''__main__'': '+LF+
203 ' print("SEQUENCE:") '+LF+
204 ' sequence = ''\'+
205 'CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG\'+
206 'CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG\'+
207 'AGGACAAAGGTCAAGATGGAGCGCATCGAACGCAATAAGGATCATTTGAT\'+
208 'GGGACGTTTCGTCGACAAAGTCTTGTTTCGAGAGTAACGGCTACCGTCTT\'+
209 'CGATTCTGCTTATAACACTATGTTCTTATGAAATGGATGTTCTGAGTTGG\'+
210 'TCAGTCCCAATGTGCGGGGTTTCTTTTAGTACGTCGGGAGTGGTATTATA\'+
211 'TTTAATTTTTCTATATAGCGATCTGTATTTAAGCAATTCATTTAGGTTAT\'+
212 'CGCCGCGATGCTCGGTTCGGACCGCCAAGCATCTGGCTCCACTGCTAGTG\'+
213 'TCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATTCGTGTAGAC\'+
214 'GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT'''+LF+ //*)
215 ' seq_pp(sequence) ');
216 //println('t-stat,p-val '+evalstr('t_stat, p_value'));
217 //execstr('print(''sys.stdout = output'')');
218 execstr('print(''\n'')');
219 //1. print() with end and sep – Customizing Output
220 execstr('print("Hello", "World", sep=", ", end="!!!")');
221 //# Output: Hello, World!!!
222 execstr('print(''\n'')');
223
224 //2. divmod() – Divide Smarter
225 println('divmod: '+evalstr('print(divmod(10, 3)) # Output: (3, 1)'));
226
227 //3. any() and all() – Logic Simplified
228 println(evalstr('print(any([0, 0, 1])) # Output: True (because 1 is True)'));
229 println(evalstr('print(all([1, 2, 3])) # Output: True (because all are non-zero)'));
230
231 //4. enumerate() – Index and Value, Together
232 execstr('for i, value in enumerate(["Python", "Rocks", "Always"]): '+LF+
233 ' print(i, value)');
234
235 //5. zip() – Combine Like a Boss
236 execstr('names = ["Alice", "Bob"]');
237 execstr('scores = [95, 85]');
238 execstr('combined = list(zip(names, scores))');
239 execstr('print(combined) # Output: [(''Alice'', 95), (''Bob'', 85)]');
240
241 //6. map() – Functional Programming Made Easy
242 execstr('squared = list(map(lambda x: x**2, [1, 2, 3]))');
243 execstr('print(squared) # Output: [1, 4, 9]');
244
245 //7. filter() – Keep Only What You Need
246 execstr('evens = list(filter(lambda x: x % 2 == 0, [1, 2, 3, 4]))');
247 execstr('print(evens) # Output: [2, 4]');
248
249 //8. sorted() vs .sort() – Know When to Use What
250 execstr('nums = [3, 1, 4]');
251 execstr('print(sorted(nums)) # Output: [1, 3, 4]');
252 execstr('print(nums) # Output: [3, 1, 4]');
253 execstr('nums.sort()');
254 execstr('print(nums) # Output: [1, 3, 4]');
255
256 //9. getattr(), setattr(), hasattr(), and delattr() – Object Wizards
257 execstr('class Person:'+LF+
258 ' name = "Alice"'+LF+
259 'person = Person()');
260 execstr('print(getattr(person, "name")) # Output: Alice ');
261
262 //10. type() – Not Just for Type Checking
263 execstr('MyClass = type("MyClass", (object,), {"x": 10})'+LF+
264 'obj = MyClass()');
265 execstr('print(obj.x) # Output: 10');
266
267 //11. globals() and locals() – Scope Checkers
268 execstr('x = 42'+LF+
269 'def test(): '+LF+
270 ' y = 10 '+LF+
271 '# print("Global:", globals()) '+LF+
272 ' print("Local:", locals()) '+LF+
273 'test() ');
274
275 //12. int() with Base Conversion – Math Made Easy
276 execstr('binary = "1010" '+LF+
277 'print(int(binary, 2)) # Output: 10 (binary to decimal) '+LF+
278 'hex_num = "A" '+LF+
279 'print(int(hex_num, 16)) # Output: 10 (hex to decimal) ');
280
281 //13. min() and max() with key – Custom Comparisons
282 execstr('fruits = ["apple", "banana", "cherry"] '+LF+
283 'print(min(fruits, key=lambda x: len(x))) # Output: apple '+LF+
284 'print(max(fruits, key=lambda x: len(x))) # Output: banana ');
285
286 //14. round() – Precision Control
287 execstr('print(round(3.14159, 2)) # Output: 3.14');
288 execstr('print(round(123.456, -1)) # Output: 120');
289
290 //15. eval() – Dynamically Run Python Code
291 execstr('code = "3 + 5" ');
292 execstr('print(eval(code)) # Output: 8');
293 println(evalstr('(eval(code)) # Output: 8'));
294
295 println(stringreplace(evalstr('output.getvalue().strip()'),
296 #10,#13#10,[rfReplaceAll, rfIgnoreCase]));
297 //println(evalstr('(output.getvalue().strip())'));
298 //memo2.lines.linebreak:= #10;
299 //memo2.lines.add(evalstr('(output.getvalue().strip())'));
300 //memo2.text:= evalstr('(output.getvalue().strip())');
301 // println(evalstr('(output.getvalue())'));
302 //println('enum: '+evalstr('list_products_with_index([''Laptop'',''Mouse'',''Keyboard''])'));
303 except
304 raiseError;
305 finally
306 UnloadDll;
307 Free;
308 end;
309 end;
310 end;
311
312 var TestDNA: String;
313
314 begin //@main
315 // for command line interface
316 //maxbox5 -c C:\maxbox\maxbox51\examples\1330_perplexity_coder.pas 5000
317 //max_range := {SysUtils.}StrToIntDef( paramStr(3), -1); // -1 if not an integer
318 //writeln('cli back '+itoa(max_range))
319 //DataScience_PySolution('"Basel,CH"');
320 //DataScience_PySolution_FunctionalProgramming('"Basel,CH"');
321 //openWeb('http://www.softwareschule.ch/examples/deathstar.htm');
322 //*)
323
324 writ(bigpow(16,16));
325 writ(bigpow(2,64));
326 { maxcalcF('24*25*26');
327 maxcalcF('fact(26)');
328 writ(bigfac(26));
329 maxcalcF('fact(26) / fact(23) ');
330 maxcalcF('23*24*25*26');
331 maxcalcF('fact(26) / fact(22) ');
332
333 TestOrder[0]:='Blue'; TestOrder[1]:='Blue'; TestOrder[2]:='White';
334 TestOrder[3]:='Blue'; TestOrder[4]:='White'; TestOrder[5]:='Blue';
335 TestOrder[6]:='Red'; TestOrder[7]:='White'; TestOrder[8]:='White';
336 TestOrder[9]:='Blue'; TestOrder[10]:='White'; TestOrder[11]:='Red';
337
338 RandomTestOrder;
339 ShowDutchFlag(memo2); }
340
341 memo2.font.name:= 'Courier';
342 memo2.wordwrap:= true;
343 DNABases :='ACGT';// predefined
344 TestDNA := DNA;
345 OutFormatBase(TestDNA,50);
346 Cnt(TestDNA);
347
348 DNA_PySolution_Fundamental_15Built('Biel');
349
350 end.
351
352 https://rosettacode.org/wiki/Bioinformatics/base_count#Procedural
353 ref SEQUENCE:
354 0: \CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAAT
355 50: G\CTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTC
356 100: TG\AGGACAAAGGTCAAGATGGAGCGCATCGAACGCAATAAGGATCATTT
357 150: GAT\GGGACGTTTCGTCGACAAAGTCTTGTTTCGAGAGTAACGGCTACCG
358 200: TCTT\CGATTCTGCTTATAACACTATGTTCTTATGAAATGGATGTTCTGA
359 250: GTTGG\TCAGTCCCAATGTGCGGGGTTTCTTTTAGTACGTCGGGAGTGGT
360 300: ATTATA\TTTAATTTTTCTATATAGCGATCTGTATTTAAGCAATTCATTT
361 350: AGGTTAT\CGCCGCGATGCTCGGTTCGGACCGCCAAGCATCTGGCTCCAC
362 400: TGCTAGTG\TCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATT
363 450: CGTGTAGAC\GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTA
364 500: CGAACGTAAT
365
366 BASECOUNT:
367 A: 129
368 C: 97
369 G: 119
370 T: 155
371 \: 10
372 TOT= 510
373
374
375 ref: SEQUENCE:
376 0: \ CGTAAAAAATTA
377 50: CAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATG\ CTCGTGC
378 100: TTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTG\ AG
379 150: GACAAAGGTCAAGATGGAGCGCATCGAACGCAATAAGGATCATTTGAT\
380 200: GGGACGTTTCGTCGACAAAGTCTTGTTTCGAGAGTAACGGCTACCGT
381 250: CTT\ CGATTCTGCTTATAACACTATGTTCTTATGAAATGGATGTTC
382 300: TGAGTTGG\ TCAGTCCCAATGTGCGGGGTTTCTTTTAGTACGTCGG
383 350: GAGTGGTATTATA\ TTTAATTTTTCTATATAGCGATCTGTATTTAA
384 400: GCAATTCATTTAGGTTAT\ CGCCGCGATGCTCGGTTCGGACCGCCA
385 450: AGCATCTGGCTCCACTGCTAGTG\ TCCTAAATTTGAATGGCAAACA
386 500: CAAATAAGATTTAGCAATTCGTGTAGAC\ GACCGGGGACTTGCATG
387 550: ATGGGAGCAGCTTTGTTAAACTACGAACGTAAT
388
389 BASECOUNT:
390 : 73
391 A: 129
392 C: 97
393 G: 119
394 T: 155
395 \: 10
396 TOT= 583
397 sys.stdout = output
398
399 \TCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATT
400 450: CGTGTAGAC\GACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTA
401 500: CGAACGTAAT
402
403 BASECOUNT:
404 A: 129
405 C: 97
406 G: 119
407 T: 155
408 \: 10
409 TOT= 510
410
411
412 Hello, World!!!
413
414 CGAACGTAAT
415
416 BASECOUNT:
417 A: 129
418 C: 97
419 G: 119
420 T: 155
421 \: 10
422 TOT= 510
423 Hello, World!!!
424
425 ref: Original Order:
426 [Blue,Blue,White,Blue,White,Blue,Red,White,White,Blue,White,Red]
427 Original Order:
428 [Red,Red,White,White,White,White,White,Blue,Blue,Blue,Blue,Blue]
429
430 Doc:
431 ref: https://python.plainenglish.io/master-functional-programming-in-python-4527f5f6cc0a
432 ref: https://blog.stackademic.com/20-python-scripts-that-will-give-you-superpowers-4c6f4b15fe63
433 ref: https://rosettacode.org/wiki/Decimal_floating_point_number_to_binary#Delphi
434 https://maxbox5.wordpress.com/2024/08/07/dragon-curve/
435 https://stackoverflow.com/questions/75409117/how-to-make-tmemo-treat-new-lines-in-linux-style
436
437 Get more than one function result as the example of a vector below:
438
439 type
440 TTVector = array of double;
441
442 procedure TNormalize(var v: TTVector);
443 var alen: double;
444 begin
445 alen:= Sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
446 v[0]:= v[0] / alen;
447 v[1]:= v[1] / alen;
448 v[2]:= v[2] / alen;
449 end;
450 So we can pass a vector with call by reference:
451
452 alight:= [-50, 30, 50];
453 TNormalize(alight);
454 writeln(flots(alight[0]));
455 >>> -0.650944554904119
456 In Python we use a named tuple. Here the three values x,y,z of the namedtuple
457 are applied, in order, to the keyword arguments in the function. Those 3 arguments
458 can be addressed as positional arguments still, after all!
459
460 Execstr('Sphere = collections.namedtuple("Sphere", "cx cy cz r")');
461 Execstr('V3 = collections.namedtuple("V3", "x y z")');
462
463 def normalize(x, y, z,*args):
464 len = math.sqrt(x**2 + y**2 + z**2)
465 return V3(x / len, y / len, z / len)
466
467 execstr('light = normalize(-50, 30, 50, V3)');
468 println('tuples '+evalstr('light.x'))
469 >>> tuples -0.6509445549041194
470
471 from collections import namedtuple
472
473 # Step 1: Define the named tuple
474 Person = namedtuple('Person', ['name', 'age', 'city'])
475 # Step 2: Create an instance of the named tuple
476 person = Person(name='Alice', age=30, city='Bern')
477 # Step 3: Define a function that takes a named tuple as an argument
478 def greet(person):
479 return f"Hello, {person.name} from {person.city}! You are {person.age} years old."
480 # Step 4: Pass the named tuple to the function
481 print(greet(person))
482
483 JavaScript:
484 <!DOCTYPE html>
485 <html>
486 <body style="margin:0">
487 <canvas id="myCanvas" width="250" height="250" style="border:1px solid #d3d3d3;">
488 Your browser does not support the HTML5 canvas tag.
489 </canvas>
490 <script>
491 var c = document.getElementById("myCanvas");
492 var ctx = c.getContext("2d");
493 //Fill the canvas with a dark gray background
494 ctx.fillStyle = "#222222";
495 ctx.fillRect(0,0,250,250);
496
497 // Create radial gradient for large base circle
498 var grd = ctx.createRadialGradient(225,175,190,225,150,130);
499 grd.addColorStop(0,"#EEEEEE");
500 grd.addColorStop(1,"black");
501 //Apply gradient and fill circle
502 ctx.fillStyle = grd;
503 ctx.beginPath();
504 ctx.arc(125,125,105,0,2*Math.PI);
505 ctx.fill();
506
507 // Create linear gradient for small inner circle
508 var grd = ctx.createLinearGradient(75,90,102,90);
509 grd.addColorStop(0,"black");
510 grd.addColorStop(1,"gray");
511 //Apply gradient and fill circle
512 ctx.fillStyle = grd;
513 ctx.beginPath();
514 ctx.arc(90,90,30,0,2*Math.PI);
515 ctx.fill();
516
517 //Add another small circle on top of the previous one to enhance the "shadow"
518 ctx.fillStyle = "black";
519 ctx.beginPath();
520 ctx.arc(80,90,17,0,2*Math.PI);
521 ctx.fill();
522 </script>
523 </body>
524 </html>
525
526 # Create a list to store the results
527 results = []
528 # Create a StringIO object to capture the print output
529 output = io.StringIO()
530 # Redirect standard output to the StringIO object
531 sys.stdout = output
532 # Example print statement
533 print("Hello, World!")
534 # Reset standard output to its original value
535 sys.stdout = sys.__stdout__
536 # Get the output from the StringIO object and add it to the list
537 results.append(output.getvalue().strip())
538 # Print the list to verify the result
539 print(results)
540
541 Immutability:
542 In functional programming, data is immutable, meaning once a data structure is created,
543 it cannot be modified. Instead, new data structures are returned when changes are needed,
544 which helps avoid unintended side effects and makes code easier to understand.
545 Performance Overhead:
546 Creating new objects for each transformation (as required by immutability) can lead to
547 performance overhead. In large-scale applications, the functional style can consume more
548 memory and CPU than imperative solutions.
549
550 Sonar squad must list seven terrible programers' faults for growing technical debt:
551 ? Bugs and possible errors
552 ? Coding principles breached
553 ? Redundancy of the program
554 ? Inadequate coverage of consumers modules
555 ? Lack of structure diffusion
556 ? Spaghetti Pattern of
557 ? Excessive amounts of comments
558
559
560 3.3.3 Konsistenzprüfung
561 Eine Entscheidung wird als konsistent bzw. transitiv bezeichnet, wenn z. B. A zweimal wichtiger
562 als B, B dagegen dreimal wichtiger als C und A folglich sechsmal wichtiger als C ist [29]. Die Annahme
563 der Transitivität erfordert die Widerspruchsfreiheit der Präferenzordnung. Somit ist die Bewertungsmatrix
564 konsistent, wenn a ij ×a jk =a ik für beliebige i, j und k gilt [13]. Aufgrund der beim AHP geforderten
565 Präzisierung der Bewertungsurteile und der begrenzten Informationsverarbeitungskapazität ist ein Entscheider
566 jedoch häufig nicht fähig, vollständig konsistente Werturteile zu treffen.
567
568 https://multimedia.easeus.com/bpm-key-finder/
569 https://www.hochweber.ch/theorie/akkordaufbau/akkordaufbau.htm
570 https://moises.ai/de/blog/tipps/wie-man-die-tonart-eines-liedes-findet/
571 https://www.hooktheory.com/cheat-sheet/key/c/lydian
572
573 G9_zeitraum mp3 127 C# Major EbM camelot 3B EbM Db@
574
575 I have had this error when trying to create a python service using pywin32 module.
576 I copied pythoncom38.dll and pywintypes38.dll into the root directory of the project
577 and it solved the issue.
578
579 C:\maxbox\maxbox4\maxbox4>py -0
580 -V:3.12 * Python 3.12 (64-bit)
581 -V:3.11 Python 3.11 (64-bit)
582 -V:3.11-32 Python 3.11 (32-bit)
583 -V:3.10-32 Python 3.10 (32-bit)
584 -V:3.8 Python 3.8 (64-bit)
585
586 https://www.wolframalpha.com/input?i=factorial%2820%29
587 https://www.perplexity.ai/search/new?q=pending&newFrontendContextUUID=c13c71de-
588
589 Exception: IndentationError: expected an indented block after 'for' statement on line 1
590 (line 2, offset 1): 'if (result := f(x)) > 400:' at 847.1011
591
592 Exception: ConnectionError: HTTPConnectionPool(host='api.openweathermap.org', port=80):
593 Max retries exceeded with url: /data/2.5/weather?q=Basel,CH&appid=55013bf3d09cfb0619989a00ed5bed09
594 (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x000001C57CEFFF80>:
595 Failed to resolve 'api.openweathermap.org' ([Errno 11001] getaddrinfo failed)")) at 869.4724
596
597 To implement real-time data syncing in a .NET MAUI application, you can leverage SignalR, a library for ASP.NET developers that simplifies the process of adding real-time web functionality to applications. Real-time web functionality is the abili
598
599 Here are the basic steps to achieve this:
600
601 https://github.com/zuercheram/Master-Thesis/blob/main/bericht/Theia-Baustellen-App.docx
602
603 You’ll receive notifications for all issues, pull requests, and comments that happen inside the repository. If you would like to stop watching any of these repositories, you can manage your settings here:
604
605 https://github.com/zuercheram/bauestellen-app/subscription
606 https://github.com/zuercheram/Master-Thesis/subscription
607
608 Create a SignalR Hub:
609 On the server side, create a SignalR Hub. The hub is a class that acts as a high-level pipeline that allows the client and server to call methods on each other.
610 Set Up the Server:
611 Set up the server to host the SignalR Hub and configure it to respond to client requests.
612 Create a .NET MAUI Client:
613 In your .NET MAUI application, add the necessary SignalR client library.
614 Establish a connection to the SignalR Hub.
615 Define methods to send and receive messages.
616 Handle Data Syncing:
617 Define methods in the SignalR Hub to handle data syncing between clients.
618 Call these methods from the .NET MAUI client whenever you need to sync data.
619 Remember to handle various aspects such as error handling, reconnection, and securing your
620 SignalR Hub. Also, consider the scalability of your solution, especially if you expect
621 a large number of clients to be connected simultaneously.