SlideShare a Scribd company logo
1 of 12
Download to read offline
Introduction to CODEsign 
Do IT twice! 
Max Kleiner 
maXbox 
max@kleiner.com 
softwareschule.ch
Check of Simplification 
function StripTags2(const S: string): 
string; 
var 
Len: Integer; 
i, APos: Integer; 
begin 
Len:= Length(S); 
i:= 0; 
Result:= ''; 
while (i <= Len) do begin 
Inc(i); 
APos:= ReadUntil(i, len, '<', s); 
Result:= Result + Copy(S, i, APos-i); 
i:= ReadUntil(APos+1,len, '>',s); 
end; 
end; 
●11 
● Design your functions twice to simplify (expert systems, 
planning engines or classes) with the same result 
Writeln(ReplaceRegExpr ('<[^>]*>', 
●22 
'<p>This is text.<br/> This is line 2</p>','', True))
Check Performance 
function IsPrime(N: Integer): Boolean; 
var I: Integer; 
begin 
for I:= 2 to N - 1 do 
if (N mod I) = 0 then 
exit; 
result:= true; 
end; 
function IsPrime2(acti: integer): 
boolean; 
var j: Integer; 
isprim: boolean; 
begin 
isprim:= true; 
if acti=1 then isprim:= false; 
for j:= 2 to round(sqrt(acti)) do 
if ((acti mod j) = 0) then begin 
isprim:= false; 
break 
end; 
result:= isprim; 
end; 
● function1 is slower than function2 
● A profiler detects conditions based on features 
Feature 
Features Conditions 
Features 
Data extractor 
Classifier 
●11 
●22
2 Types of Validations 
function GetLinesCount(sFileName : String): 
Integer; 
var 
oSL : TStringlist; 
begin 
oSL:= TStringlist.Create; 
oSL.LoadFromFile(sFileName); 
result:= oSL.Count; 
oSL.Free; 
end; //[/mX4] 
function getLinesCount2(sfilename:string): 
double; 
var hFile : TextFile; 
sLine : String; 
iLinescount: Double; 
begin 
result:=0; 
if not FileExists(sfilename) then exit; 
AssignFile(hFile, sFileName); 
Reset(hFile); 
closefile(hfile); 
iLinescount:=0; 
while NOT EOF(hFile) do begin 
ReadLn(hFile, sLine); 
iLinescount:=iLinescount+1; 
end; 
result:=iLinescount; 
end; 
●11 
●22 
● Check a function twice to compare the result (plausible) 
● By the way function1 is faster than function2
Proof it twice 
writeln('CRC:'+itoa(ComputeFileCRC32(exepath+'maXbox3.exe'))); 
//writeln(itoa(CRC32(exepath+'maxbox3.exe'))); 
writeln('CRC:'+itoa(Crc32OfFile(exepath+'maXbox3.exe'))); 
writeln(intToHex(-1808407689,2)); 
writeln(IntToHex(CRC32OfFile(exepath+'maXbox3.exe'),4)); 
writeln(intToHex(ComputeFileCRC32(exepath+'maXbox3.exe'),2)); 
●11 
●22 
● Compare the reference
Run & Test with Redundancy 
function DownloadFile(SourceFile, DestFile: string): 
Boolean; 
begin 
try 
Result:= UrlDownloadToFile(Nil, Pchar(SourceFile), 
PChar(DestFile),0,Nil) = 0; 
except 
Result:= False; 
end; 
end; 
●11 
wGet2('http://max.kleiner.com/images/texturemap.jpg','texturemap7.jpg'); 
DownloadFile('http://max.kleiner.com/images/texturemap.jpg','texturemap77.jpg') 
●22 
//Test also Result 
Result:= UrlDownloadToFile(Nil, Pchar(SourceFile), PChar(DestFile),0,Nil) = 0; 
● Supervised test Exception: “Socket Error # 11004” 
● Non supervised redundancy of code at run-time 
● Two functions as fallback for mission critical availability
Test twice 
● Simple probabilistic testing theorem – Function Test, Unit Test 
● Assumes that the functions are independent from each other 
● Very efficient when trained in supervised environment 
● Requires relatively small amount of test data and conditions to 
produce good results with high quality 
● Check your function & test in unit integration 
●11 ●22 
printF('addition theorem %.18f ',[maXcalc('sin(2.5/2)')]) 
printF('addition theorem %.18f ',[maXcalc('sqrt(1/2*(1-cos(2.5)))')]) 
printF('addition theorem2 %22.18f ',[maXcalc('cos(2.5/2)')]) 
printF('addition theorem2 %22.18f ',[maXcalc('sqrt(1/2*(1+cos(2.5)))')]) 
Windows crashed again. I am the Blue Screen of Death. No one hears your screams.
Document & save twice 
● Make a Model or UML Diagram 
● Write a Description or Comment with an example 
● Save/Sync project in GIT & Bitbucket! 
● 
● 
● 
● 
● 
● 
● 
● 
● 
● 
function StripTags2(const S: string): string; ●11 
function StripTags2(const S: string): string; 
// Strips tags from a HTML file: <p>This is text.<br/> ---> This is text. 
// Make sure valid TStrings has been passed in 
●22 
● They don't need to be complex; they just need to be clever in that they will allow for an 
easy/inelegant solution, and a difficult/elegant solution. In time, the students will learn to 
prefer the difficult/elegant solution, and that is how their brains will "domesticate" 
themselves into thinking algorithmically. 
●
Visualize twice 
u y 
+ F(u) 
X1 
X2 
X3 
W1 
W2 
W3 
●11 
●22
Teach it twice 
●11 ●22 
TThread = class 
private 
{$IFDEF MSWINDOWS} 
FHandle: THandle; 
FThreadID: THandle; 
{$ENDIF} 
{$IFDEF LINUX} 
// ** FThreadID is not THandle in Linux 
** 
FThreadID: Cardinal; 
FCreateSuspendedSem: TSemaphore; 
TSortThread = class(TThread) 
strict private 
FBox: TPaintBox; 
//FSortArray: PThreadSortArray; 
FSortArray: TSortArray; 
FSize: Integer; 
FA, FB, FI, FJ: Integer; 
Fbolthslowmotion: boolean; 
procedure DoVisualSwap; 
procedure SetbolthSlowmotion(const Value: 
boolean); 
● Train with data and functions 
● Use validation data to optimize the teaching 
● Test the teacher – Train the trainee!
CODEsign for 
● SPAM filtering 
● Computer vision 
● OCR and Pattern Recognition 
● Speech recognition 
● Diagnostic utilities 
● Industrial control 
● Investment & Science 
● Code formatting 
● Gesture recognition 
● Robotics, IOT 
● Games 
● Function approximation
About the Speaker 
Max Kleiner – softwareschule.ch 
● max@kleiner.com 
maXbox Software - www.softwareschule.ch 
Products: 
● maXbox – Scripter Studio 
● DWS – Delphi Web Start, Delphi Web Security 
● CryptoBox – Crypto processing library 
● PEP – Pascal Education Program 
● 
● https://github.com/maxkleiner/maXbox3/releases 
●

More Related Content

What's hot

Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"OdessaJS Conf
 
jq: JSON - Like a Boss
jq: JSON - Like a Bossjq: JSON - Like a Boss
jq: JSON - Like a BossBob Tiernay
 
4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладка4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладкаDEVTYPE
 
Конверсия управляемых языков в неуправляемые
Конверсия управляемых языков в неуправляемыеКонверсия управляемых языков в неуправляемые
Конверсия управляемых языков в неуправляемыеPlatonov Sergey
 
Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil Witecki
 
FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2rohassanie
 
Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)Ray Buse
 
Lecture 4.2 c++(comlete reference book)
Lecture 4.2 c++(comlete reference book)Lecture 4.2 c++(comlete reference book)
Lecture 4.2 c++(comlete reference book)Abu Saleh
 
A look into the sanitizer family (ASAN & UBSAN) by Akul Pillai
A look into the sanitizer family (ASAN & UBSAN) by Akul PillaiA look into the sanitizer family (ASAN & UBSAN) by Akul Pillai
A look into the sanitizer family (ASAN & UBSAN) by Akul PillaiCysinfo Cyber Security Community
 
The Ring programming language version 1.8 book - Part 86 of 202
The Ring programming language version 1.8 book - Part 86 of 202The Ring programming language version 1.8 book - Part 86 of 202
The Ring programming language version 1.8 book - Part 86 of 202Mahmoud Samir Fayed
 
Clojure concurrency
Clojure concurrencyClojure concurrency
Clojure concurrencyAlex Navis
 
Александр Гранин, Функциональная 'Жизнь': параллельные клеточные автоматы и к...
Александр Гранин, Функциональная 'Жизнь': параллельные клеточные автоматы и к...Александр Гранин, Функциональная 'Жизнь': параллельные клеточные автоматы и к...
Александр Гранин, Функциональная 'Жизнь': параллельные клеточные автоматы и к...Sergey Platonov
 
What did you miss in Java from 9-13?
What did you miss in Java from 9-13?What did you miss in Java from 9-13?
What did you miss in Java from 9-13?relix1988
 
3. Объекты, классы и пакеты в Java
3. Объекты, классы и пакеты в Java3. Объекты, классы и пакеты в Java
3. Объекты, классы и пакеты в JavaDEVTYPE
 
Concurrency in Programming Languages
Concurrency in Programming LanguagesConcurrency in Programming Languages
Concurrency in Programming LanguagesYudong Li
 

What's hot (20)

Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
 
Constructor,destructors cpp
Constructor,destructors cppConstructor,destructors cpp
Constructor,destructors cpp
 
jq: JSON - Like a Boss
jq: JSON - Like a Bossjq: JSON - Like a Boss
jq: JSON - Like a Boss
 
C++ programming
C++ programmingC++ programming
C++ programming
 
4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладка4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладка
 
Конверсия управляемых языков в неуправляемые
Конверсия управляемых языков в неуправляемыеКонверсия управляемых языков в неуправляемые
Конверсия управляемых языков в неуправляемые
 
MFC Message Handling
MFC Message HandlingMFC Message Handling
MFC Message Handling
 
C++ aptitude
C++ aptitudeC++ aptitude
C++ aptitude
 
C++ idioms.pptx
C++ idioms.pptxC++ idioms.pptx
C++ idioms.pptx
 
Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, code
 
FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2FP 201 - Unit 3 Part 2
FP 201 - Unit 3 Part 2
 
Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)Automatically Describing Program Structure and Behavior (PhD Defense)
Automatically Describing Program Structure and Behavior (PhD Defense)
 
Lecture 4.2 c++(comlete reference book)
Lecture 4.2 c++(comlete reference book)Lecture 4.2 c++(comlete reference book)
Lecture 4.2 c++(comlete reference book)
 
A look into the sanitizer family (ASAN & UBSAN) by Akul Pillai
A look into the sanitizer family (ASAN & UBSAN) by Akul PillaiA look into the sanitizer family (ASAN & UBSAN) by Akul Pillai
A look into the sanitizer family (ASAN & UBSAN) by Akul Pillai
 
The Ring programming language version 1.8 book - Part 86 of 202
The Ring programming language version 1.8 book - Part 86 of 202The Ring programming language version 1.8 book - Part 86 of 202
The Ring programming language version 1.8 book - Part 86 of 202
 
Clojure concurrency
Clojure concurrencyClojure concurrency
Clojure concurrency
 
Александр Гранин, Функциональная 'Жизнь': параллельные клеточные автоматы и к...
Александр Гранин, Функциональная 'Жизнь': параллельные клеточные автоматы и к...Александр Гранин, Функциональная 'Жизнь': параллельные клеточные автоматы и к...
Александр Гранин, Функциональная 'Жизнь': параллельные клеточные автоматы и к...
 
What did you miss in Java from 9-13?
What did you miss in Java from 9-13?What did you miss in Java from 9-13?
What did you miss in Java from 9-13?
 
3. Объекты, классы и пакеты в Java
3. Объекты, классы и пакеты в Java3. Объекты, классы и пакеты в Java
3. Объекты, классы и пакеты в Java
 
Concurrency in Programming Languages
Concurrency in Programming LanguagesConcurrency in Programming Languages
Concurrency in Programming Languages
 

Similar to CODEsign 2015

An Overview of SystemVerilog for Design and Verification
An Overview of SystemVerilog  for Design and VerificationAn Overview of SystemVerilog  for Design and Verification
An Overview of SystemVerilog for Design and VerificationKapilRaghunandanTrip
 
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...David Walker
 
EdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaEdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaLisa Hua
 
A closure ekon16
A closure ekon16A closure ekon16
A closure ekon16Max Kleiner
 
Os2 2
Os2 2Os2 2
Os2 2issbp
 
Gpu workshop cluster universe: scripting cuda
Gpu workshop cluster universe: scripting cudaGpu workshop cluster universe: scripting cuda
Gpu workshop cluster universe: scripting cudaFerdinand Jamitzky
 
Subtle Asynchrony by Jeff Hammond
Subtle Asynchrony by Jeff HammondSubtle Asynchrony by Jeff Hammond
Subtle Asynchrony by Jeff HammondPatrick Diehl
 
Quick tour of PHP from inside
Quick tour of PHP from insideQuick tour of PHP from inside
Quick tour of PHP from insidejulien pauli
 
Software Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW SydneySoftware Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW Sydneyjulien.ponge
 
Eff Plsql
Eff PlsqlEff Plsql
Eff Plsqlafa reg
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudAndrea Righi
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisFastly
 
Actor Concurrency
Actor ConcurrencyActor Concurrency
Actor ConcurrencyAlex Miller
 
Best C++ Programming Homework Help
Best C++ Programming Homework HelpBest C++ Programming Homework Help
Best C++ Programming Homework HelpC++ Homework Help
 

Similar to CODEsign 2015 (20)

An Overview of SystemVerilog for Design and Verification
An Overview of SystemVerilog  for Design and VerificationAn Overview of SystemVerilog  for Design and Verification
An Overview of SystemVerilog for Design and Verification
 
Staging driver sins
Staging driver sinsStaging driver sins
Staging driver sins
 
Golang dot-testing-lite
Golang dot-testing-liteGolang dot-testing-lite
Golang dot-testing-lite
 
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
The Effect of Hierarchical Memory on the Design of Parallel Algorithms and th...
 
EdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaEdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for Java
 
A closure ekon16
A closure ekon16A closure ekon16
A closure ekon16
 
Os2 2
Os2 2Os2 2
Os2 2
 
00_Introduction to Java.ppt
00_Introduction to Java.ppt00_Introduction to Java.ppt
00_Introduction to Java.ppt
 
C Programming Homework Help
C Programming Homework HelpC Programming Homework Help
C Programming Homework Help
 
Gpu workshop cluster universe: scripting cuda
Gpu workshop cluster universe: scripting cudaGpu workshop cluster universe: scripting cuda
Gpu workshop cluster universe: scripting cuda
 
Subtle Asynchrony by Jeff Hammond
Subtle Asynchrony by Jeff HammondSubtle Asynchrony by Jeff Hammond
Subtle Asynchrony by Jeff Hammond
 
Quick tour of PHP from inside
Quick tour of PHP from insideQuick tour of PHP from inside
Quick tour of PHP from inside
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
Software Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW SydneySoftware Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW Sydney
 
Eff Plsql
Eff PlsqlEff Plsql
Eff Plsql
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloud
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
 
Actor Concurrency
Actor ConcurrencyActor Concurrency
Actor Concurrency
 
Clojure basics
Clojure basicsClojure basics
Clojure basics
 
Best C++ Programming Homework Help
Best C++ Programming Homework HelpBest C++ Programming Homework Help
Best C++ Programming Homework Help
 

More from Max Kleiner

EKON26_VCL4Python.pdf
EKON26_VCL4Python.pdfEKON26_VCL4Python.pdf
EKON26_VCL4Python.pdfMax Kleiner
 
EKON26_Open_API_Develop2Cloud.pdf
EKON26_Open_API_Develop2Cloud.pdfEKON26_Open_API_Develop2Cloud.pdf
EKON26_Open_API_Develop2Cloud.pdfMax Kleiner
 
maXbox_Starter91_SyntheticData_Implement
maXbox_Starter91_SyntheticData_ImplementmaXbox_Starter91_SyntheticData_Implement
maXbox_Starter91_SyntheticData_ImplementMax Kleiner
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Max Kleiner
 
EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4Max Kleiner
 
maXbox Starter87
maXbox Starter87maXbox Starter87
maXbox Starter87Max Kleiner
 
maXbox Starter78 PortablePixmap
maXbox Starter78 PortablePixmapmaXbox Starter78 PortablePixmap
maXbox Starter78 PortablePixmapMax Kleiner
 
maXbox starter75 object detection
maXbox starter75 object detectionmaXbox starter75 object detection
maXbox starter75 object detectionMax Kleiner
 
BASTA 2020 VS Code Data Visualisation
BASTA 2020 VS Code Data VisualisationBASTA 2020 VS Code Data Visualisation
BASTA 2020 VS Code Data VisualisationMax Kleiner
 
EKON 24 ML_community_edition
EKON 24 ML_community_editionEKON 24 ML_community_edition
EKON 24 ML_community_editionMax Kleiner
 
maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingMax Kleiner
 
EKON 23 Code_review_checklist
EKON 23 Code_review_checklistEKON 23 Code_review_checklist
EKON 23 Code_review_checklistMax Kleiner
 
EKON 12 Running OpenLDAP
EKON 12 Running OpenLDAP EKON 12 Running OpenLDAP
EKON 12 Running OpenLDAP Max Kleiner
 
EKON 12 Closures Coding
EKON 12 Closures CodingEKON 12 Closures Coding
EKON 12 Closures CodingMax Kleiner
 
NoGUI maXbox Starter70
NoGUI maXbox Starter70NoGUI maXbox Starter70
NoGUI maXbox Starter70Max Kleiner
 
maXbox starter69 Machine Learning VII
maXbox starter69 Machine Learning VIImaXbox starter69 Machine Learning VII
maXbox starter69 Machine Learning VIIMax Kleiner
 
maXbox starter68 machine learning VI
maXbox starter68 machine learning VImaXbox starter68 machine learning VI
maXbox starter68 machine learning VIMax Kleiner
 
maXbox starter67 machine learning V
maXbox starter67 machine learning VmaXbox starter67 machine learning V
maXbox starter67 machine learning VMax Kleiner
 
maXbox starter65 machinelearning3
maXbox starter65 machinelearning3maXbox starter65 machinelearning3
maXbox starter65 machinelearning3Max Kleiner
 
EKON22_Overview_Machinelearning_Diagrams
EKON22_Overview_Machinelearning_DiagramsEKON22_Overview_Machinelearning_Diagrams
EKON22_Overview_Machinelearning_DiagramsMax Kleiner
 

More from Max Kleiner (20)

EKON26_VCL4Python.pdf
EKON26_VCL4Python.pdfEKON26_VCL4Python.pdf
EKON26_VCL4Python.pdf
 
EKON26_Open_API_Develop2Cloud.pdf
EKON26_Open_API_Develop2Cloud.pdfEKON26_Open_API_Develop2Cloud.pdf
EKON26_Open_API_Develop2Cloud.pdf
 
maXbox_Starter91_SyntheticData_Implement
maXbox_Starter91_SyntheticData_ImplementmaXbox_Starter91_SyntheticData_Implement
maXbox_Starter91_SyntheticData_Implement
 
Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475Ekon 25 Python4Delphi_MX475
Ekon 25 Python4Delphi_MX475
 
EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4EKON 25 Python4Delphi_mX4
EKON 25 Python4Delphi_mX4
 
maXbox Starter87
maXbox Starter87maXbox Starter87
maXbox Starter87
 
maXbox Starter78 PortablePixmap
maXbox Starter78 PortablePixmapmaXbox Starter78 PortablePixmap
maXbox Starter78 PortablePixmap
 
maXbox starter75 object detection
maXbox starter75 object detectionmaXbox starter75 object detection
maXbox starter75 object detection
 
BASTA 2020 VS Code Data Visualisation
BASTA 2020 VS Code Data VisualisationBASTA 2020 VS Code Data Visualisation
BASTA 2020 VS Code Data Visualisation
 
EKON 24 ML_community_edition
EKON 24 ML_community_editionEKON 24 ML_community_edition
EKON 24 ML_community_edition
 
maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage coding
 
EKON 23 Code_review_checklist
EKON 23 Code_review_checklistEKON 23 Code_review_checklist
EKON 23 Code_review_checklist
 
EKON 12 Running OpenLDAP
EKON 12 Running OpenLDAP EKON 12 Running OpenLDAP
EKON 12 Running OpenLDAP
 
EKON 12 Closures Coding
EKON 12 Closures CodingEKON 12 Closures Coding
EKON 12 Closures Coding
 
NoGUI maXbox Starter70
NoGUI maXbox Starter70NoGUI maXbox Starter70
NoGUI maXbox Starter70
 
maXbox starter69 Machine Learning VII
maXbox starter69 Machine Learning VIImaXbox starter69 Machine Learning VII
maXbox starter69 Machine Learning VII
 
maXbox starter68 machine learning VI
maXbox starter68 machine learning VImaXbox starter68 machine learning VI
maXbox starter68 machine learning VI
 
maXbox starter67 machine learning V
maXbox starter67 machine learning VmaXbox starter67 machine learning V
maXbox starter67 machine learning V
 
maXbox starter65 machinelearning3
maXbox starter65 machinelearning3maXbox starter65 machinelearning3
maXbox starter65 machinelearning3
 
EKON22_Overview_Machinelearning_Diagrams
EKON22_Overview_Machinelearning_DiagramsEKON22_Overview_Machinelearning_Diagrams
EKON22_Overview_Machinelearning_Diagrams
 

Recently uploaded

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 

CODEsign 2015

  • 1. Introduction to CODEsign Do IT twice! Max Kleiner maXbox max@kleiner.com softwareschule.ch
  • 2. Check of Simplification function StripTags2(const S: string): string; var Len: Integer; i, APos: Integer; begin Len:= Length(S); i:= 0; Result:= ''; while (i <= Len) do begin Inc(i); APos:= ReadUntil(i, len, '<', s); Result:= Result + Copy(S, i, APos-i); i:= ReadUntil(APos+1,len, '>',s); end; end; ●11 ● Design your functions twice to simplify (expert systems, planning engines or classes) with the same result Writeln(ReplaceRegExpr ('<[^>]*>', ●22 '<p>This is text.<br/> This is line 2</p>','', True))
  • 3. Check Performance function IsPrime(N: Integer): Boolean; var I: Integer; begin for I:= 2 to N - 1 do if (N mod I) = 0 then exit; result:= true; end; function IsPrime2(acti: integer): boolean; var j: Integer; isprim: boolean; begin isprim:= true; if acti=1 then isprim:= false; for j:= 2 to round(sqrt(acti)) do if ((acti mod j) = 0) then begin isprim:= false; break end; result:= isprim; end; ● function1 is slower than function2 ● A profiler detects conditions based on features Feature Features Conditions Features Data extractor Classifier ●11 ●22
  • 4. 2 Types of Validations function GetLinesCount(sFileName : String): Integer; var oSL : TStringlist; begin oSL:= TStringlist.Create; oSL.LoadFromFile(sFileName); result:= oSL.Count; oSL.Free; end; //[/mX4] function getLinesCount2(sfilename:string): double; var hFile : TextFile; sLine : String; iLinescount: Double; begin result:=0; if not FileExists(sfilename) then exit; AssignFile(hFile, sFileName); Reset(hFile); closefile(hfile); iLinescount:=0; while NOT EOF(hFile) do begin ReadLn(hFile, sLine); iLinescount:=iLinescount+1; end; result:=iLinescount; end; ●11 ●22 ● Check a function twice to compare the result (plausible) ● By the way function1 is faster than function2
  • 5. Proof it twice writeln('CRC:'+itoa(ComputeFileCRC32(exepath+'maXbox3.exe'))); //writeln(itoa(CRC32(exepath+'maxbox3.exe'))); writeln('CRC:'+itoa(Crc32OfFile(exepath+'maXbox3.exe'))); writeln(intToHex(-1808407689,2)); writeln(IntToHex(CRC32OfFile(exepath+'maXbox3.exe'),4)); writeln(intToHex(ComputeFileCRC32(exepath+'maXbox3.exe'),2)); ●11 ●22 ● Compare the reference
  • 6. Run & Test with Redundancy function DownloadFile(SourceFile, DestFile: string): Boolean; begin try Result:= UrlDownloadToFile(Nil, Pchar(SourceFile), PChar(DestFile),0,Nil) = 0; except Result:= False; end; end; ●11 wGet2('http://max.kleiner.com/images/texturemap.jpg','texturemap7.jpg'); DownloadFile('http://max.kleiner.com/images/texturemap.jpg','texturemap77.jpg') ●22 //Test also Result Result:= UrlDownloadToFile(Nil, Pchar(SourceFile), PChar(DestFile),0,Nil) = 0; ● Supervised test Exception: “Socket Error # 11004” ● Non supervised redundancy of code at run-time ● Two functions as fallback for mission critical availability
  • 7. Test twice ● Simple probabilistic testing theorem – Function Test, Unit Test ● Assumes that the functions are independent from each other ● Very efficient when trained in supervised environment ● Requires relatively small amount of test data and conditions to produce good results with high quality ● Check your function & test in unit integration ●11 ●22 printF('addition theorem %.18f ',[maXcalc('sin(2.5/2)')]) printF('addition theorem %.18f ',[maXcalc('sqrt(1/2*(1-cos(2.5)))')]) printF('addition theorem2 %22.18f ',[maXcalc('cos(2.5/2)')]) printF('addition theorem2 %22.18f ',[maXcalc('sqrt(1/2*(1+cos(2.5)))')]) Windows crashed again. I am the Blue Screen of Death. No one hears your screams.
  • 8. Document & save twice ● Make a Model or UML Diagram ● Write a Description or Comment with an example ● Save/Sync project in GIT & Bitbucket! ● ● ● ● ● ● ● ● ● ● function StripTags2(const S: string): string; ●11 function StripTags2(const S: string): string; // Strips tags from a HTML file: <p>This is text.<br/> ---> This is text. // Make sure valid TStrings has been passed in ●22 ● They don't need to be complex; they just need to be clever in that they will allow for an easy/inelegant solution, and a difficult/elegant solution. In time, the students will learn to prefer the difficult/elegant solution, and that is how their brains will "domesticate" themselves into thinking algorithmically. ●
  • 9. Visualize twice u y + F(u) X1 X2 X3 W1 W2 W3 ●11 ●22
  • 10. Teach it twice ●11 ●22 TThread = class private {$IFDEF MSWINDOWS} FHandle: THandle; FThreadID: THandle; {$ENDIF} {$IFDEF LINUX} // ** FThreadID is not THandle in Linux ** FThreadID: Cardinal; FCreateSuspendedSem: TSemaphore; TSortThread = class(TThread) strict private FBox: TPaintBox; //FSortArray: PThreadSortArray; FSortArray: TSortArray; FSize: Integer; FA, FB, FI, FJ: Integer; Fbolthslowmotion: boolean; procedure DoVisualSwap; procedure SetbolthSlowmotion(const Value: boolean); ● Train with data and functions ● Use validation data to optimize the teaching ● Test the teacher – Train the trainee!
  • 11. CODEsign for ● SPAM filtering ● Computer vision ● OCR and Pattern Recognition ● Speech recognition ● Diagnostic utilities ● Industrial control ● Investment & Science ● Code formatting ● Gesture recognition ● Robotics, IOT ● Games ● Function approximation
  • 12. About the Speaker Max Kleiner – softwareschule.ch ● max@kleiner.com maXbox Software - www.softwareschule.ch Products: ● maXbox – Scripter Studio ● DWS – Delphi Web Start, Delphi Web Security ● CryptoBox – Crypto processing library ● PEP – Pascal Education Program ● ● https://github.com/maxkleiner/maXbox3/releases ●