- Top Version: Win V4.7.6.10 - V3.9.9.195 - Linux V3.8.2 - Mac V1.2.9.5
- Screenshots and History
- GUI and maXbox Form and the new mX3.9 GUI
- Release available:
- mX3 available!
- V3.0.1 January 2011 Service Pack 1
- V3.2.1 April 2011 Interface, Webservices
- V3.3.0 Juli 2011: DBX, ADO, Jedi, Grid, Printer, MediaPlayer, SQL, Dataset & Database Support
- V3.5.0 September 2011: Types, BigInteger, Containers, Conversions, 220 Examples
- V3.6.1 October 2011: DBClient; DBPlatform; Provider; FMTBcd; DBCGrids; 240 Examples
- V3.6.2 October 2011: CDSUtil/Borland MIDAS API; VarHlpr/Delphi RTL; ExtDlgs/Delphi VCL;
- V3.7.1 December 2011: HTTPApp; WideStrUtils RTL; GraphUtil VCL; TypeTrans API, DBWeb
- V3.8.0 December 2011: Upgrade of mX4 compiler, Unit support, Boot-Loader Scripting
- V3.8.1 January 2012: Tested mX4 compiler, JclGraphUtils (OpenGL), JclSysInfo, IdUserAccounts more
- V3.8.4 March 2012: CryptoBox, Crypto Units of LockBox3, JvVCLUtils, Function pdf
- V3.8.5 April 2012: Serial Interface, Add-ons, more Units, Objects and Functions
- V3.8.6 Mai 2012: JBL (JediBaseLibrary), Variants, GenetiX Algorithms, Turtle, Threads, Workbench
- V3.9.1 June 2012: DB Functions, WinAPI, Activity-Diagram, SysTools4 by TurboPower
- V3.9.2 September 2012: maXcalc, Parallels, SyncObj, Extended FPU, plus Win API
- V3.9.4 October 2012: COM Port cPort, Arduino Scripts, HTTPServer, Boldutils, LAN Manager
- V3.9.6.3 November 2012: PCRE RegEx, MemoryLeakReport, ADO SQL
- V3.9.7.1 December 2012: extRTL, Graphics32, FundamentalsTLS, DMath, Intf Navigator
- V3.9.7.4 January 2013: SimLogicPac, MIDI, APPInst, more Dialogs, Intf Navigator2, FullTextFinder2
- V3.9.7.5 February 2013: more 12 Units, forensic functions, add Blix the Programmer
- V3.9.8.6 April 2013: more Form/Control events, Widget Lib, JvChart, Indy IOHandler, CodeSearch, ExtCtrls2, JvPaintFX
- V3.9.8.8 Mai 2013: 7 Units, Compress-Decompress Zip, Services Tutorial22, Synopse framework, PFDLib
- V3.9.8.9 June 2013: SynEdit API, macro, Object Shell, Config Tutorial 25, more Units
- V3.9.9.1 July 2013: Bookmarks, 12 Units, additional OpenTools API
- V3.9.9.6 August 2013: REST/XML, Astro & Barcode Package, Addon Units, DevCUnits
- V3.9.9.7 September 2013: 12 Units, DCOM, MDAC, MIDI, TLS support
- V3.9.9.16 September 2013: WebServices, SQL Interrogator, Addon Docu more Units and Tutorials
- V3.9.9.20 October 2013: SQL ADO, Tools Package, Richedit, 25 Units
- V3.9.9.80 November 2013: more Indy, Form Prototyping, Bold Package, TypeSetKit and Tutorials
- V3.9.9.81 December 2013: more Indy, Othello, GOL, Geometry OpenGL Demo
-
V3.9.9.82 January 2014: InterBase Package, 31 units, Refactoring
-
V3.9.9.85 January 2014: add 72 units, memcached DB,autobookmark,Alcinoe PAC,IPCLib,GSM Module, CGI
-
V3.9.9.86 February 2014: Orpheus, Alcinoe PAC, AsyncFree Lib, advapi32, Firebird Exp+MySQL units
-
V3.9.9.88 March 2014: 2 Tutorials 30 Units add, VCL constructors, controls+, unit list
-
V3.9.9.91 March 2014: 2 Tutorials 42 Units add, Synapse V40, LDAP, OpenSSL, AVScan
-
V3.9.9.94 April 2014: 1 DLL Report, UML Tutor, 34 Units add, DBCtrls, Stream+, IRadio, Wininet
-
V3.9.9.95 Mai 2014: Oscilloscope V4, Mixer, 7 Units add, URLMon, Form properties+
-
V3.9.9.96 June 2014: SendBuffer,ComboSet,SetPrivilege, WakeOnLAN ParaDice 3D Cube Polygraph, OCR, GPS, 20 Units add
-
V3.9.9.98 September 2014: Add 36 Units, Wav res, RoundTo, OpenOffice, Pipes, GSM2, TFixedCriticalSection, XPlatform beta, GCC Command Pipe, Unittesting, VfW(Video), FindFirst3, ResFiler,AssemblyCache, maXring
- V3.9.9.101 November 2014: Add 27 Units, 1 Tutor, maXmap, OpenStreetView, MAPX, timers
Function Menu/View/GEO Map View, DownloadFile, wgetX, sensors, StreamUtils, IDL Syntax, OpenStreetMap, OpenMapX, LPT1, LazDOM, ByteCode2, runByteCode, sensors, CGI-Powtils, IPUtils2, GPS_2
- V3.9.9.120 December 2014: ByteCode2, STExpressions, Tutors,Units, Stream++, OpenStreetMap, MAPX
- V3.9.9.160 January 2015: Add 9 Units, 2 Slides 1 Tutor, CLXUp, ExampleEdition, UnitConverter
- V3.9.9.180 February 2015: Add 6 Units, 1 Tutor, Big Numbers 2, ExecuteMultiProcessor
- V3.9.9.190 March 2015: Add 18 Units, 1 Tutor, COMUtils, WebServiceUtils
- V3.9.9.195 May 2015: 36 Units, OLEUtils2, ACM2, CDS, Terminal, XML Transform
- V4.2.0.10 March 2016: FPC, WideString, REST, Classes & Class Diagram
- V4.2.2.90 April 2016: Add 15 Units, 1 Tutor, Pipe Libraray2, KLog, FPlot42, KGraphics
- V4.2.2.98 Mai 2016: Add 21 Units, 1 Tutor, Pipe Libraray2, KLog, FPlot42, Kronos, KMemo
- V4.2.4.25 June 2016: Add 16 Units, 2 Tutors (43+44), ASN1+, IdNNTPServer, UtilsMax5
- V4.2.4.80 October 2016: 16 units + 420 functions- WMI Script Type Library - webbox, UtilsMax6
- V4.2.5.10 Feb 2017: 6 units + 328 funcs HugeInt-HugeWord Library - SimpleTCP
- V4.2.8.10 Oct 2017: 18 units +560 functions SHA256 -StreamStorage -WMI, XMLDoc, ADO4
- V4.5.8.10 Dez 2017: 26 units , Indent Guidelines, StreamStore2 -WMI+, XMLDoc+, ADO4+
- V4.6.2.10 Jan 2018: Tutor 56 Neural Network -Python Checker- 3 more Units PascalCoin
- V4.7.1.10 Sep 2019:Tutor 57-70, VState Machine, CGI,MachineLearning +20 Units +Tensorflow dll
- V4.7.1.20 Nov 2019:Tutor 70-72, EKON 23 Fixing, WebSockets, DRBOBCGI, 5+ overbyte Units
- V4.7.1.82 Dec 2019:Tutor 70-72, EKON23 Fixing, WebSockets/Spider, PHP_CGI,JS, OpenOffice,7+overbyte Units
- V4.7.4.64 June 2020: EKON24 Fixing, uPSI_SimpleRSS, Json Base Prometheus, neural CAI, Dendron
- V4.7.5.20 Jan 2021: few Fundamentals 5.00, JCL fixes, GraphMathLibrary, StringBuilder
V4.7.5.80 July 2021: RSS+, WDCC, P4D_Beta (Python4Delphi), Wininet Threads
V4.7.5.90 October 2021: FLC Vectors, CAI Neuralnet, SingleListClass
V4.7.6.10 August 2022: Threadslist, CAI Neuralnet3, P4D+, EKON25 fixing, klib
(V5.0.1 2018: MAC Version, FPC, (64-bit), Android and Arduino Dump, Unicode, Classes / Class Diagram)
Click on the following image to upload a new version of the PNG logo image for your project:
maXbox is a free programming tool with an inbuilt delphi engine in one exe! It is designed for teaching, test and analyze methods and algorithms for Win and Linux (CLX). maXbox is built on RemObjects PascalScript, the smart evolution of programming. Scripting in the box has a main advantage: An open script means you can look at the code, see how it works, change it so it works better for you and run it once again in the box. If it fits your idea give your changes of the script back to the community and reuse as you can.
by the way: files and shuffle mode is close behind, the best shuffle code is from Don Knuth (elegant and efficient):
Contents
Current Development to mX3 V3.1
Just converted and registered TStringGrid/TDrawGrid (Grid/QGrid) for the proof of Concept Memory Game with a Grid of bitmaps. also TPrinter and TMediaPlayer for more output DBCommon, DBTypes and DBTables in Progress, not all finished but DBX in V3.2 possible, for now in V3.1 for e.g.:
const SQLQuery = 'select * from customer where company like "%SCUBA%";
procedure DoQuery(aDB: TDataBase); var i: integer;
begin
end;
A big example of 3 ways (DBX, BDE, ADO-OLEDB (ODBC)) to connect a Firebird/Interbase DB shows script
http://www.softwareschule.ch/examples/301_SQL_DBfirebird3.htm
CodeHunter
Just build the StreamDream in comming soon mX 3.0
procedure getHTTP_PNG(vimage: TImage); var
begin
end;
// my favor to mX3.2 convert an image as easy as that:
procedure ConvertImage(vsource, vdestination: string); begin
end;
The same goes for a script loader with a ScriptStream!:
Procedure GetScriptAndRun; var
begin
end;
function ExtractUrlPath1(const FileName: string): string; var I: Integer; begin
end;
function ExtractUrlName1(const FileName: string): string; var I: Integer; begin
end;
writeln(extractUrlPath1('http://www.softwareschule.ch/maxbox.htm')) result: http://www.softwareschule.ch/ writeln(extractUrlName1('http://www.softwareschule.ch/maxbox.htm')) result: maxbox.htm
Change a Row in a StringGrid
case CreateMessageDialog('Text the maXbox', mtWarning,[mbYes,mbNo,mbCancel]).ShowModal
3 Steps of Clear Code Test:
Step 1: Exchange
procedure exchange(var a,b: integer); begin
end;
Step 2: TimesTable Solution
Function TimesTable2(row,col: integer; tab: byte):string;
Step 3: Tokenizer
Procedure strTokenizer(const S: string; Delims:TSysCharSet; Results:TStrings); var i,j: integer; tmp: string; begin
end;
Test Function Overall
function Average(a,b,c: Extended): Extended;
Education Recursion
Palindrome Checker (RegEx and Recursion in One) //***************************************maXbox
//****************************************
function PalindromeChecker2(asc: string): boolean;
Josephus Problem and 3 Solutions!
function josephus(n,k: byte): integer;
//******************************* CoCreate Object (without constructor)
//******************************* StrToWord with StrtoInt (StrtoWord is buggy)
Example of the month:
Richter Generator to show:
http://www.softwareschule.ch/examples/069_Richter_MATRIX.TXT
Input Query and RegEx PathFinder to show:
http://www.softwareschule.ch/examples/480_regex_pathfinder.txt
Input Query and RegEx PathFinder to show:
http://www.softwareschule.ch/examples/480_regex_pathfinder.txt
Clever Function Copy2SymbDel
Magic Card Trick
Due to recent advances, it's now possible to sense the vibrations caused by the human voice as the sound impacts the speakers attached to your PC!?!.
http://www.softwareschule.ch/examples/471_cardmagic2.txt
or just ALL cards to show:
http://www.softwareschule.ch/examples/472_allcards.txt
maXbox to Excel Export (maXcel)
function SaveAsExcelFile(AGrid: TStringGrid; aSheetName, aFileName: string): Boolean;
var
begin
end;
call:
more on script: 318_excel_export.txt
Multitask enabled Delay
procedure Delay2(msecs: integer); var
begin
end;
Test it with:
procedure DB_XML_AliasConverter; //uses
var
begin
end;
Recursive Select Statement
Select to_char(id)||chr(9)||rtrim(lpad(' ',2*(level-1)) || bez,' ')||
chr(9)||rtrim(ueberschrift,' ')||chr(9)||rtrim(text,' ') from knoten
start with id=69 connect by prior id=parent
SHL EXponent:
var i: int64;
bin exp with SHL: 2^1 = 2 bin exp with SHL: 2^2 = 4 bin exp with SHL: 2^3 = 8 bin exp with SHL: 2^4 = 16 bin exp with SHL: 2^5 = 32.........
Minesweeper Game, January 2013:
http://www.softwareschule.ch/examples/285_minesweeper2.htm
Working with BigIntegers:
function BigMulu2(aone, atwo: string): string; var bigint, bigint1, bigintres: TXRTLInteger; begin
end;
function BigExp2(aone, atwo: string): string; var bigint, bigint1, bigintres: TXRTLInteger; begin
end;
Generate QRCode
{This is using the Google Charts API, but it does demonstrate a quick and easy way to get QR barcodes in a maXbox, Delphi or Lazarus/FreePascal application.
Const
var
procedure GetQrCode(Width,Height: Word; Correct_Level: string; const Data:string); var
begin
end;
Call to invoke:
HTTP Download with MemoryStream and Progress:
procedure GetFileDownloadProgress(myURL, myFile: string); var
begin
end;
Third Law of Kepler to find the height of a Geostationary Satellite
(1/27.5)^2 = (x/384000)^3 ca. 42000 km - 6300 ~ 36000 km
the idea ist to get the moon as relation to the daly track around the earth 1/27 per day
and the solve it with maXbox:
The Moon has an orbit radius of 3.8x108 m and a period of 27.3 days. Use this information to calculate the radius (RS) of the orbit of a geostationary satellite.
Smart/Small Manual for maXbox
25 User Tips for mX3 3.9.9
- Install: just save your maxboxdef.ini before and then extract the zip file!
- Toolbar: Click on the red maXbox Sign (right on top) opens your work directory or jump to <Help>
- Menu: With <F2> you check syntax with <F8> you debug and <F9> you compile!
- Menu: With <Crtl><F3> you can search for code on examples
- Menu: Open in menu Output a new instance <F4> of the box to compare or prepare your scripts
- Menu: Set Interface Naviagator in menu /View/Intf Navigator
- Menu: Switch or toogle between the last 2 scripts in menu File/LoadLast (History is set to 9 files)
- Inifile: Set memory report in ini: MEMORYREPORT=Y :report on memory leaks on shutdown by dialog
- Context Menu: You can printout your scripts as a pdf-file or html-export
- Context: You do have a context menu with the right mouse click
- Menu: With the UseCase Editor you can convert graphic formats too.
- Menu: On menu Options you find Addons as compiled scripts
- IDE: You don't need a mouse to handle maXbox, use shortcuts
- Menu: Check Options/ProcessMessages! if something is wrong or you can't see graphics in a time
- IDE: Drag n' drop your scripts in the box or the model in use case editor (Cut,Copy,Paste always available)
- Editor: You can get templates as code completion with <ctrl j> in editor like classp or iinterface or ttimer (you type classp and then CTRL J),or you type tstringlist and <Ctrl><J>
- Menu: In menu output (console) you can set output menu in edit mode by unchecking <read only output>
- Editor: After the end. you can write or copy notes or descriptions concerning the app or code
- Code: If you code a loop till key-pressed use function: isKeyPressed;
- Code: Macro set the macros #name, #date, #host, #path, #file, #head #sign, see Tutorial maxbox_starter25.pdf
- Editor: - Dbl Click on Word in Editor search amount of words with highlighting, Dbl Click on Bookmarks to delete and Click and mark to drag a bookmark
- Menu: To start handling from CD-ROM (read only mode) uncheck in Menu /Options/Save before Compile
- IDE: A file info with system and script information you find in menu Program/Information
- IDE: Make a screenshot of the content and environment in menu Output/Save Screenshot
- IDE: Use a boot loader script 'maxbootscript.txt' (as auto start) to change the box each time you start it.
- IDE: With escape or <Ctrl> Q you can also leave the box or stop a script in menu program - stop program
Current Development to mX4 V4.0
Switch between Pascal and C = PasCal
In the version 3.8 we upgrade from mX3 (delphi2007) to mX4 compiler (delphi2009) A Unit support, Boot-Loader Scripting and Version Check routine is already workable The idea of a BOOTSCRIPT is before start the maXbox you can alter, init or change functions or features of the OpenTools API in maXbox, so the bootscript is named maxbootscript.txt and all those routines will be executed by starting the box. For example you change the buttons or color options of the editor or you set some monitor or processing functions valid for all scripts to be executed.
With mX4 we do have full decompile or debug possibility of the scripts, mX3 < 3.6 had some trouble with event handler in it.
Type Conversion like floatToString are with implicit or explicit type casts, so an error is shown but the script runs anyway. The full variant support depends on a compiler directive in pascalscript.inc
With the CPort as a Serial Component we now have support for Arduino, see Tutorial 18 The new Package/Component Model Viewer is included, see menu /Debug/Units Explorer
RegEX PCRE Lib integration finished in 3.9.6:
//I have the following REGEX: //^(\[[A-Za-z0-9,]+\])?([A-Za-z0-9]+:)?([A-Za-z]+)\(?([^\)]*)\)?$ (*When presented with Set(ID,99) Perl returns: 1:[], 2:[], 3:[Set], 4:[ID,99] - as I expected
Delphi's Reg ex returns:
Group 1:[] Group 2:[] Group 3:[Set] Group 4:[ID,99]
procedure DelphiCoreCodeRegEx; var
begin
Profiler and QueryByExample (QBE) is done by Jedi and implemented in maXbox:
http://www.softwareschule.ch/examples/332_jprofiler_form2.txt http://www.softwareschule.ch/examples/332_jprofiler_form2.htm http://www.softwareschule.ch/examples/333_querybyexample.txt
Another Cool Feature is the TCustomImageList:
//////////////////// digi clock rock procedure DigiTForm1_FormActivate(Sender: TObject); //Startinit on Form var i,t: integer; begin
end;
procedure DigiTForm1_TimerTimer(Sender: TObject); var i: integer;
begin
end;
http://www.softwareschule.ch/examples/336_digiclock2.htm http://www.softwareschule.ch/examples/336_digiclock2.txt
For a 64 version a way to query the env. is:
JVChart, CodeSearchEngine and BigInteger has been finished
Exception Handling with decompile address out: for example you set a function with false type:
function HexToStr(Value: string): string;
and then you mistaken the para type integer instead of string, but it will compile, the registration is a literal in addfunction:
Sender.AddFunction(@HexToStr, 'function HexToStr(Value: integer): string;');
but at runtime you get
Exception: Access violation at address 004069A0 in module 'maxbox3_9.exe'. Read of address 00000F98 at 0.3461
So you can find the error at 0.3461 with the decompiler:
then you go to CALL 165 and you see the miserable function: Proc [165]: External Decl: \01\00 HEXTOSTR
Design Mind Mapping of the 4.0 IDE >> To help prioritize and design them, I'd like to better understand the >> various requests for editor improvements (e.g. auto-complete, better >> syntax highlighting). What are the user experience problems you're >> trying to solve? For who? (Please be more specific than "making >> maXbox more like other IDEs". If that's the goal, I think we're >> better off making it easier to let you use those other IDEs.) >> >> Anything that requires heuristic parsing of incomplete / invalid code >> (e.g. because you're in the middle of typing it) is probably beyond >> the scope of what we can reasonably do (unless there's a great >> library or example to draw on). That is, I don't think we're going >> to be able to do things like dynamically parse the user sketch as >> it's being typed, extract the names of functions defined in the >> sketch, and provide dynamic syntax highlighting / command completion >> for calls to those functions elsewhere in the sketch. On the other >> hand, looking for a known string like PrintF() to appear in >> your script and dropping down a list of arguments doesn't seem so unrealistic. >> >> The overall point is that, for each feature request, we're trying to >> balance the degree to which we can improve the user experience with >> the feasibility / difficulty of implementation. Keep that in mind as >> we discuss improvements to the IDE.
Just a glance for an app:
MemoryStream overloading
As no direct overloading is possible, we do it by name conventions:
For example a write to buffer with an dynamic array of byte is WriteBufferABD:
procedure CreateEmptyZipFile; var i: integer;
begin
end;
Tower of Hanoi Decoded
PROGRAM Tower_of_Hanoi_Steps_SolutionSequence; //Uses Crt; {
//uses crt;
Const SOLUTIONFILE = 'hanoilist.txt';
Type
var answer: string;
//The 12 Main Step Patterns!
procedure initPatternArray; //codelist begin
end;
procedure Search_Write_Codes; var vs, tmp: shortstring;
begin
end;
procedure move(high: integer; a,c,b: char); begin
end;
begin //main
End.
The 12 Main Step Patterns! --1-------2-------3-------4------- A 1,2,3,4 a to b a to b a to c a to c a to c a to c a to b a to b b to c b to c c to b c to b a to b b to a a to c c to a --5-------6--------7-------8------ B 5,6,7,8 b to a b to a b to c b to c b to c b to c b to a b to a a to c a to c c to a c to a b to a a to b b to c c to b --9-------10-------11------12----- C 9,10,11,12 c to a c to a c to b c to b c to b c to b c to a c to a a to b a to b b to a b to a c to a a to c c to b b to c
//***************************************************************
This is the solution code sequence for all even piles! repeat n/24:
3-6-11-3-5-12-3-(5/6)-11-4-5-11-3-6-11-(3/4)-5-12-3-5-11-4-5-(11/12)
This is the solution code sequence for all odd piles!:
1-10-7-1-9-8-1-(9/10)-7-2-9-7-1-10-7-(1/2)-9-8-1-9-7-2-9-(7/8)
//***************************************************************
www.softwareschule.ch/examples/080_pas_hanoi2_file.txt
Closures, RegEx and Threads
And the story goes on: A Function containing at least one free variable is called an Open Term. In order to get to a fully functional Function, all free variables have to be bound (turning that open term into a closed term). For this to be done, the compiler reaches out to the so called lexical environment, in which that Function was defined and tries to find a binding. This process is called closing over which results in a closed expression or – for short – a Closure.
Before I get into closures, I want to address the constant use of the word as a misnomer. The term Closures is very frequently treated as a synonym for the term anonymous methods. Though closures are specific to anonymous methods, they are not the same concept. Anonymous methods are possible without closures. Do not use the terms interchangeably.
the same in Scala: 01 val belowFirst = ( xs : List[Int] ) => { 02 03 val first = xs( 0 ) 05 val isBelow = ( y : Int ) => y < first 07 for( x <- xs; if( isBelow( x ) ) yield x 08 } 10 ... 11 belowFirst( List( 5, 1, 7, 4, 9, 11, 3 ) ) // => List( 1, 4, 3 )
//Avoid globals and various lines with a strategy pattern:
function loadPForm(vx, vy: integer): TForm; var psize: integer;
begin
end;
procedure LetBitmaponForm(aform: TForm); var mbitmap: TBitMap; begin
end;
Call: LetBitmaponForm(loadPForm(8,8));
Closure Pattern with procedure type:
type TProc = procedure(VAR x: single);
Call:
RegEx in maxbox has some components one is the RegExp Studio it goes like this:
How do I get the last term in URL between slashes ie 'last' using regex?
Pascal Parser Regex
function ParseReturnType(const AText: string): string;
function ParseDefaultValue(const AText: string): string;
function ParseTypeName(const AText: string): string;
procedure ParseParamNames(Routine: TRoutineDeclaration; const AText: string);
function ParseSingleDeclaration(Routine: TRoutineDeclaration; const AText: string): TParamType;
function ParseTypeDeclaration(Routine: TRoutineDeclaration; const AText: string): TParamType;
API Code
Window Themes and Color
To set a color in a Panel or to override themes two ways are possible: - controlstyle set - parentbackground
Error Handling
Service, App or Session?
function GetShortPathName(lname, sname: pchar; mpath: longint): bool;
//undocumented !
function MessageBoxTimeOut(hWnd: HWND; lpText: PChar; lpCaption: PChar; uType: UINT;
BitBlt: Own Mouse Moving Pic Cursor
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer); //var FOldRect: TRect; //makes a blur and zoom effect begin
end;
function NumProcessThreads2: integer; var
begin
end;
For example, the thread queues are more than lists of messages--they also maintain some state information. Some messages (like WM_PAINT) aren't really queued, but synthesized from the additional state information when you query the queue and it's empty. Messages sent to windows owned by other threads are actually posted to the receiver's queue rather than being processed directly, but the system makes it appear like a regular blocking send from the caller's point of view; this can cause deadlock (because of circular sends back to the original thread).
function FileTimeGMT2 (FileName: STRING): TDateTime;
VAR
begin
END;
procedure OpenIEURL(aURL:string); var sz: string; begin
end;
Procedure HideWindowForSecondsT(secs: integer);
Var T : tdateTime; begin
end;
DataBase Init
procedure newDBTableScript; begin
end;
Create a Table with Index procedure CreateATable(DBName, TblName : String); //Path Alias & Table Name to Create var tbl: TTable; begin
end;
procedure addRecord(DBName, TblName : String); begin
end;
Firebird 2.5.2
Released November 06, 2012. Updated March 24, 2013. Works well with 301_SQL_DBfirebird4.txt
CONNECTSTRING = 'Provider=MSDASQL;DSN=mxfirebird;Uid=sysdba;Pwd=masterkey'; $Provider=MSDASQL.1;Persist Security Info=False;Data Source=mxfirebird
http://www.softwareschule.ch/examples/301_SQL_DBfirebird5.txt
begin
end;
Floating Point Test Routine
By comparing a float point result like a double or extended type delivers a reference value is needed. Second a loop or iteration is needed to prove the approximation of the lasting result. I got the idea to make it with a well known series. There are several well-known proofs of the divergence of the harmonic series. Two of them are given below but one is chosen, cause it converges to ln(2) as our reference point. The series
is known as the alternating harmonic series. This series converges by the alternating series test.
for i:= 1 to 50000000 do begin //zeta: double or extended;
50000 = 0.693137180659968 100000 = 0.693142180584982 500000 = 0.693146180561005 10^6 = 0.693146680560255 5*10^6 = 0.693147080560068 50*10^6= 0.693147170560399
ln(2) = 0.693147180559945
Leibniz formula:
did some test routines from fundamentals4
also
Boolean Logic
with the so called double implication you can switch a light from 2 different points in distance and the logic table is this:
in code they said a biconditional goes like this:
BUT its easier like this:
see example of all boolean functions:
http://www.softwareschule.ch/examples/308_bitbox3.htm
http://www.softwareschule.ch/examples/308_bitbox3.txt
Proposal for Abbreviation Symbol
Boolean Laws Proof
Teaching for Proof:
Big Int Numbers or Big Decimals
function BigMulu2(aone, atwo: string): string; var bigint, bigint1, bigintres: TXRTLInteger; begin
end;
function BigExp2(aone, atwo: string): string; var bigint, bigint1, bigintres: TXRTLInteger; begin
end;
Entropy Mystery
HUMAT: Entropy form: SIGMASUM j=1 to n (pj * log 1 / pj).
SIGMASUMpj * log(1 / pj)
The implicit unpredictability or randomness of a propabilitiy p can be measured by the extent to which it ist possible to compress data like a tar or zip archive:
much compressible -> less random -> more predictable
This is the entropy, a measure of how much randomness (unpredictable) it contains.
To explain entropy with a coin goes like this: E.g. a fair coin has two outcomes, each with a probability of 1/2 so the entropy is
1/2 log 2 + 1/2 log 2 = 1
This is sort of logic, the coin flip contains one bit of randomness, but what if the coin is not fair (manipulated), if it has a 3/4 chance of turning up heads:
3/4 log 4/3 + 1/4 log 4 = 0.81
unit StEclpse;
Helmholtz Function
Big increase Entropy in the beginning then decreases away to zero
Entropy and Cryptography
HUMAT: you cant compress a strong cipher (output of a cryptographic function), cause it has high entropy (randomness).
less compressible -> most random -> not predictable
To explain entropy with a coin goes like this:
SHA1 with Indy
function Indy_SHA1Hash(apath: string): string; var
begin
end;
Object Oriented
A with statement with type casting
cause of
ShowModal shows a window and waits until it is closed. Until closing, you can't interact with any other form of the application. What many do not know: You can define a result value on events of the ShowModal Form, which you can use very clean in your program. For example to check which date a user has clicked.
Arduino
Open a COM Port and use Arduino as Timer:
procedure SetArduinoTime(Sender: TObject);
Save Space with Function Chaining
Second you can save fst on var with parameter passing
Third you can pass all vars by a one liner (not so maintainable):
Bugs
1. COM Port Information:
2. Streams with File/Memory Stream:
3. Full Text Finder:
4. Button Set
5. File Stream Buffer
6. High() of Enumerator and Set
7. Themes Color in Panel, Label, Bars etc.
8. Open other files with maXbox (Open with...)
Performance
Performance is dark chapter cause maXbox is an interpreter But it does have more functions precompiled than interpreted!
As a comparison take the EightQueens Problem [8*8] You had to set 8 queens on a chessboard without collision {recursive solution to the Eight Queens problem} As a long time runner I set it to 14 Queens:
\examples\044_pas_14queens_solwith14.txt
Take the following reference implemantation for measures:
http://www.softwareschule.ch/examples/044_queens_performer2.txt
http://www.softwareschule.ch/examples/044_queens_performer2.htm
Result: 365596 solutions Time: start is: 21:30:32:233 all codestrings of solutions stop is: 23:19:44:183 1 h run time: 49:11:950 mX3 executed: 23.05.2014 23:19:44 Runtime: 1:49:13.10 Memoryload: 52% use
file in editor: 6215131 lines Very slow but all solutions are painted in a file (94.7 MB (99'331'007 Bytes)) , e.g. the last solution one:
365596
XXXXXXXXXXXXXQ XXXXXXXXXXXQXX XXXXXXXXXQXXXX XXXXXXXQXXXXXX XXQXXXXXXXXXXX XXXXQXXXXXXXXX XQXXXXXXXXXXXX XXXXXXXXXXQXXX QXXXXXXXXXXXXX XXXXXQXXXXXXXX XXXXXXXXXXXXQX XXXXXXXXQXXXXX XXXXXXQXXXXXXX XXXQXXXXXXXXXX
solution string: 14/12/10/8/3/5/2/11/1/6/13/9/7/4
08 Queens: 92 solutions: 0 h run time: 00:00:376
09 Queens: 352 solutions: 0 h run time: 00:01:493
10 Queens: 724 solutions: 0 h run time: 00:06:460
11 Queens: 2680 solutions: 0 h run time: 00:32:107
12 Queens: 14200 solutions: 0 h run time: 02:58:011
13 Queens: 73712 solutions: 0 h run time: 17:24:995
Compiled solution with 14 Queens (365596 solutions) Intel Core 2 Quad (Q9559, 2.83 GHz) 9712ms!
Tuning
To speed up a script has following rules:
1. Set the Application.ProcessMessages OFF:
in menu Options/ProcessMessages
or in code with processMessagesOFF; //more speed
2. use internal functions instead of script functions:
e.g. FileSearch('firstdemo.txt',exepath))
3. Start a seconde instance of maXbox with F4
Current Development to mX3 V3.0
V3.0 supports more graphic formats, I work with
ImageFileLibBCB for Delphi/BCB on sourceforge
which supports many formats, with this library, Delphi programs can read and write BMP, ICO, CUR, PNG, MNG, PCX, TIFF and JPEG 2000 bitmaps. RAS, PNM, PGM, PPM, HIPS images can be loaded, but not created.
Concerning Indy, the SMPT, IdDayTime, hashCRC and message support is going on, maXbox becomes a simple mailbox too, also the Indy globals with a lot of network functions like to get the hostname is under way
The conversion of the TPSImport_StrUtils is already done, soundex and much string functions will be possible
a lot of delphi (sysutils, system) and indy functions (indy globals) are now going to convert to the box, by end of september a beta will be available to get first impressions of maXbox3
Also mX3 on Linux is on the way, ported Indy 9 to Kylix3 so graphics and math functions too. Release date for mX3 win and mX3 linux will be the January 31th on 2011.
Improvments of 64Bit, PNG, and Ansi/WideStrings are done, Dialogs and Plugins are under way (e.g. MP3-Player and POP3-Mail Function) From October to February time will spent on tuning, testing, tutorials and a list of all functions in mX3 Sysutils.converted and a thread function (casting&converting) has done, now I'm updating all the examples from _1 to _150 in categories base, math, graphic, statistic, system, net and internet.
>>>Release Date for mX3 (Win and Linux) will be the 31.th of January 2011!
Function CharToBin(_Chr: Char): String; Var
Begin
Result:= Format('%s%d', [Result, Byte((Ord(_Chr) And (1 Shl i))
SHL EXponent:
var i: int64;
bin exp with SHL: 2^1 = 2 bin exp with SHL: 2^2 = 4 bin exp with SHL: 2^3 = 8 bin exp with SHL: 2^4 = 16 bin exp with SHL: 2^5 = 32.........
Minesweeper Game, January 2013:
http://www.softwareschule.ch/examples/285_minesweeper2.htm
Working with BigIntegers:
function BigMulu2(aone, atwo: string): string; var bigint, bigint1, bigintres: TXRTLInteger; begin
end;
function BigExp2(aone, atwo: string): string; var bigint, bigint1, bigintres: TXRTLInteger; begin
end;
Generate QRCode
{This is using the Google Charts API, but it does demonstrate a quick and easy way to get QR barcodes in a maXbox, Delphi or Lazarus/FreePascal application.
Const
var
procedure GetQrCode(Width,Height: Word; Correct_Level: string; const Data:string); var
begin
end;
Call to invoke:
HTTP Download with MemoryStream and Progress:
procedure GetFileDownloadProgress(myURL, myFile: string); var
begin
- Menu: With <F2> you check syntax with <F8> you debug and <F9> you compile!
- Menu: With <Crtl><F3> you can search for code on examples
- Menu: Open in menu Output a new instance <F4> of the box to compare or prepare your scripts
- Menu: Set Interface Naviagator in menu /View/Intf Navigator
- Menu: Switch or toogle between the last 2 scripts in menu File/LoadLast (History is set to 9 files)
- Inifile: Set memory report in ini: MEMORYREPORT=Y :report on memory leaks on shutdown by dialog
- Context Menu: You can printout your scripts as a pdf-file or html-export
- Context: You do have a context menu with the right mouse click
- Menu: With the UseCase Editor you can convert graphic formats too.
- Menu: On menu Options you find Addons as compiled scripts
- IDE: You don't need a mouse to handle maXbox, use shortcuts
- Menu: Check Options/ProcessMessages! if something is wrong or you can't see graphics in a time
- IDE: Drag n' drop your scripts in the box or the model in use case editor (Cut,Copy,Paste always available)
- Editor: You can get templates as code completion with <ctrl j> in editor like classp or iinterface or ttimer (you type classp and then CTRL J),or you type tstringlist and <Ctrl><J>
- Menu: In menu output (console) you can set output menu in edit mode by unchecking <read only output>
- Editor: After the end. you can write or copy notes or descriptions concerning the app or code
- Code: If you code a loop till key-pressed use function: isKeyPressed;
- Code: Macro set the macros #name, #date, #host, #path, #file, #head #sign, see Tutorial maxbox_starter25.pdf
- Editor: - Dbl Click on Word in Editor search amount of words with highlighting, Dbl Click on Bookmarks to delete and Click and mark to drag a bookmark
- Menu: To start handling from CD-ROM (read only mode) uncheck in Menu /Options/Save before Compile
- IDE: A file info with system and script information you find in menu Program/Information
- IDE: Make a screenshot of the content and environment in menu Output/Save Screenshot
- IDE: Use a boot loader script 'maxbootscript.txt' (as auto start) to change the box each time you start it.
- IDE: With escape or <Ctrl> Q you can also leave the box or stop a script in menu program - stop program
Current Development to mX4 V4.0
Switch between Pascal and C = PasCal
In the version 3.8 we upgrade from mX3 (delphi2007) to mX4 compiler (delphi2009) A Unit support, Boot-Loader Scripting and Version Check routine is already workable The idea of a BOOTSCRIPT is before start the maXbox you can alter, init or change functions or features of the OpenTools API in maXbox, so the bootscript is named maxbootscript.txt and all those routines will be executed by starting the box. For example you change the buttons or color options of the editor or you set some monitor or processing functions valid for all scripts to be executed.
With mX4 we do have full decompile or debug possibility of the scripts, mX3 <Return> to run the Sentence';
end;
procedure LetBitmaponForm(aform: TForm); var mbitmap: TBitMap; begin
end;
Call: LetBitmaponForm(loadPForm(8,8));
Closure Pattern with procedure type:
Call:
RegEx in maxbox has some components one is the RegExp Studio it goes like this:
How do I get the last term in URL between slashes ie 'last' using regex?
Pascal Parser Regex
function ParseReturnType(const AText: string): string;
function ParseDefaultValue(const AText: string): string;
function ParseTypeName(const AText: string): string;
procedure ParseParamNames(Routine: TRoutineDeclaration; const AText: string);
function ParseSingleDeclaration(Routine: TRoutineDeclaration; const AText: string): TParamType;
function ParseTypeDeclaration(Routine: TRoutineDeclaration; const AText: string): TParamType;
API Code
SendMessage Ex.:
Window Themes and Color
To set a color in a Panel or to override themes two ways are possible: - controlstyle set - parentbackground
Error Handling
Service, App or Session?
function GetShortPathName(lname, sname: pchar; mpath: longint): bool;
//undocumented !
function MessageBoxTimeOut(hWnd: HWND; lpText: PChar; lpCaption: PChar; uType: UINT;
BitBlt: Own Mouse Moving Pic Cursor
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer); //var FOldRect: TRect; //makes a blur and zoom effect begin
end;
function NumProcessThreads2: integer; var
begin
end;
For example, the thread queues are more than lists of messages--they also maintain some state information. Some messages (like WM_PAINT) aren't really queued, but synthesized from the additional state information when you query the queue and it's empty. Messages sent to windows owned by other threads are actually posted to the receiver's queue rather than being processed directly, but the system makes it appear like a regular blocking send from the caller's point of view; this can cause deadlock (because of circular sends back to the original thread).
function FileTimeGMT2 (FileName: STRING): TDateTime;
VAR
begin
The implicit unpredictability or randomness of a propabilitiy p can be measured by the extent to which it ist possible to compress data like a tar or zip archive:
much compressible -> less random -> more predictable
This is the entropy, a measure of how much randomness (unpredictable) it contains.
To explain entropy with a coin goes like this: E.g. a fair coin has two outcomes, each with a probability of 1/2 so the entropy is
1/2 log 2 + 1/2 log 2 = 1
This is sort of logic, the coin flip contains one bit of randomness, but what if the coin is not fair (manipulated), if it has a 3/4 chance of turning up heads:
3/4 log 4/3 + 1/4 log 4 = 0.81
unit StEclpse;
Helmholtz Function
Big increase Entropy in the beginning then decreases away to zero
Entropy and Cryptography
HUMAT: you cant compress a strong cipher (output of a cryptographic function), cause it has high entropy (randomness).
less compressible -> most random -> not predictable
To explain entropy with a coin goes like this:
SHA1 with Indy
function Indy_SHA1Hash(apath: string): string; var
begin
end;
Object Oriented
A with statement with type casting
cause of
ShowModal shows a window and waits until it is closed. Until closing, you can't interact with any other form of the application. What many do not know: You can define a result value on events of the ShowModal Form, which you can use very clean in your program. For example to check which date a user has clicked.
Arduino
Open a COM Port and use Arduino as Timer:
procedure SetArduinoTime(Sender: TObject);
Second you can save fst on var with parameter passing
Third you can pass all vars by a one liner (not so maintainable):
Bugs
1. COM Port Information:
2. Streams with File/Memory Stream:
3. Full Text Finder:
4. Button Set
5. File Stream Buffer
6. High() of Enumerator and Set
7. Themes Color in Panel, Label, Bars etc.
8. Open other files with maXbox (Open with...)
9. OpenProcessToken()
Performance
Performance is dark chapter cause maXbox is an interpreter But it does have more functions precompiled than interpreted!
As a comparison take the EightQueens Problem [8*8] You had to set 8 queens on a chessboard without collision {recursive solution to the Eight Queens problem} As a long time runner I set it to 14 Queens:
\examples\044_pas_14queens_solwith14.txt
Take the following reference implemantation for measures:
http://www.softwareschule.ch/examples/044_queens_performer2.txt
http://www.softwareschule.ch/examples/044_queens_performer2.htm
Result: 365596 solutions Time: start is: 21:30:32:233 all codestrings of solutions stop is: 23:19:44:183 1 h run time: 49:11:950 � mX3 executed: 23.05.2014 23:19:44 Runtime: 1:49:13.10 Memoryload: 52% use
file in editor: 6215131 lines Very slow but all solutions are painted in a file (94.7 MB (99'331'007 Bytes)) , e.g. the last solution one:
365596
XXXXXXXXXXXXXQ XXXXXXXXXXXQXX XXXXXXXXXQXXXX XXXXXXXQXXXXXX XXQXXXXXXXXXXX XXXXQXXXXXXXXX XQXXXXXXXXXXXX XXXXXXXXXXQXXX QXXXXXXXXXXXXX XXXXXQXXXXXXXX XXXXXXXXXXXXQX XXXXXXXXQXXXXX XXXXXXQXXXXXXX XXXQXXXXXXXXXX
solution string: 14/12/10/8/3/5/2/11/1/6/13/9/7/4
08 Queens: 92 solutions: 0 h run time: 00:00:376
09 Queens: 352 solutions: 0 h run time: 00:01:493
10 Queens: 724 solutions: 0 h run time: 00:06:460
11 Queens: 2680 solutions: 0 h run time: 00:32:107
12 Queens: 14200 solutions: 0 h run time: 02:58:011
13 Queens: 73712 solutions: 0 h run time: 17:24:995
Compiled solution with 14 Queens (365596 solutions) Intel Core 2 Quad (Q9559, 2.83 GHz) 9712ms!
Tuning
To speed up a script has following rules:
1. Set the Application.ProcessMessages OFF:
in menu Options/ProcessMessages
or in code with processMessagesOFF; //more speed
2. use internal functions instead of script functions:
e.g. FileSearch('firstdemo.txt',exepath))
3. Start a seconde instance of maXbox with F4
Last edit: Max Kleiner 2017-03-20
Machine Learning Tutorials and Courses
Learn Machine Learning online from the best machine learning courses/tutorials submitted & voted by the programming community.
Congratulations! maXbox has just been recognized with the following awards by SourceForge:
Community Leader
Open Source Excellence
SourceForge Favorite
These honors are awarded only to select projects that have reached significant milestones in terms of downloads and user engagement from the SourceForge community.
This is a big achievement, as your project has qualified for these awards out of over 500,000 open source projects on SourceForge. SourceForge sees nearly 30 million users per month looking for, and developing, open source software. An award badge will now appear on your project page, and the award assets can be found in your project admin section.
To recognize maXbox's achievement, we've awarded you with the aforementioned awards, which you can see below: Now that maXbox is an official winner of the these awards, you have express permission to use the award badges wherever you'd like.
Feel free to proudly display the awards on your personal or organizational website, social media, or anywhere else you'd like.