Code snippets: Difference between revisions
No edit summary |
|||
(42 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
EDM/2's collection of code snippets, and links to such small programs on external sites. Most of the snippets are for common scripting languages such as [[REXX]], [[Tcl]], [[PHP]] and so on but there is also code for traditional programming languages such as [[C]], [[Modula-2]], [[LISP]] and [[Prolog]]. The idea behind such small programs is primarily to be used as educational examples that a programmer can learn from but depending on licence, they can also be taken and used in your own programs. | EDM/2's collection of code snippets, and links to such small programs on external sites. Most of the snippets are for common scripting languages such as [[REXX]], [[Tcl]], [[PHP]] and so on but there is also code for traditional programming languages such as [[C]], [[Modula-2]], [[LISP]] and [[Prolog]], et cetera. The idea behind such small programs is primarily to be used as educational examples that a programmer can learn from but depending on licence, they can also be taken and used in your own programs. | ||
Code snippets are usually linked to from the Wiki page for each programming language, but it makes sense to also collect them here all together and sort them by function since they can be used in multi-language projects, it may be easier for you to call a function in another language than to rewrite it in your preferred language, and understanding it in another language even if you have not fully mastered that language can be helpful even if you intend to rewrite the function in your preferred programming tool, and so on. | Code snippets are usually linked to from the Wiki page for each programming language, but it makes sense to also collect them here all together and sort them by function since they can be used in multi-language projects, it may be easier for you to call a function in another language than to rewrite it in your preferred language, and understanding it in another language even if you have not fully mastered that language can be helpful even if you intend to rewrite the function in your preferred programming tool, and so on. | ||
The snippets here are primarily targeting OS/2, but [[DOS]], [[UNIX]] and even more alien | The snippets here are primarily either targeting OS/2 or generic in nature, but code targeting [[DOS]], [[UNIX]] and even more alien systems may be included especially if they have some educational value. | ||
==OS/2 system== | ==OS/2 system== | ||
===WPS=== | ===WPS=== | ||
* [[BuildSOM]] - REXX - Creates program and folder objects via [[SOM]]. | |||
* [[PostWhat WPS Class Example]] - C++ & REXX | |||
* [[Small examples of Workplace Shell programming]] - C | * [[Small examples of Workplace Shell programming]] - C | ||
===Memory management=== | |||
Aka Garbage collection, malloc etc. | |||
* [[Use DosAllocMem for Boundary Overflow Protection]] - C++ | |||
===Collections=== | |||
* [[Dave Briccetti's Programming Samples]] - Sundry C++ code example | |||
* [http://www.norrsken-data-teknik.com/eCS/index.html norrsken data teknik eCS tools] - Helge Nordmann's REXX system utility collection. | |||
* [[OS/2 Primecuts]] - C and C++ OS/2 specific code examples | |||
==Internet== | ==Internet== | ||
* [[Update Homepage]] | ===WWW & HTML=== | ||
* [http://www.totallyobjects.com/files/tobtwhl.zip Text Widget Hyperlink] - A small piece of [[VisualAge Smalltalk]] code that shows how to use a Text Widget as a hyperlink. By Matt Sims/[http://www.totallyobjects.com Totally Objects]. | |||
* [http://www.lafn.org/~aw585/txt2html.html txt2HTML] - REXX - Converts text files to [[HTML]] files. | |||
* [[Update Homepage]] - REXX & Object REXX | |||
* [http://www.totallyobjects.com/files/fileupload.zip WebConnection File Attachment] Adds file attachment capacity to the WebConnection part in [[VisualAge Smalltalk]] - By David Pennington/[[Totally Objects]]. | |||
===E-Mail & USENET=== | |||
* [[Get Usenet News Articles Using REXX, Network News Transfer Protocol and Sockets]] | |||
* [[Sending Mail with REXX]] | |||
* [[Send Mail to an Email List with REXX, SMTP and Sockets]] | |||
==General== | |||
;Date and time operations | |||
* [http://www.totallyobjects.com/files/tobdted5-5_1-0-0.zip Date and Time Editor] - A small piece of [[VisualAge Smalltalk]] code that allows you to place date and time editors in a normal VA Smalltalk window. By Matt Sims/[http://www.totallyobjects.com Totally Objects]. | |||
* [[Harold Zbiegien's date algorithms in REXX]] and in FORTRAN | |||
* [http://www.rexswain.com/b2mmddyy.rex Rex Swain's B2MMDDYY.REX] - Convert Base format date to MM/DD/YYYY (REXX) | |||
==Files & file operations== | ==Files & file operations== | ||
* [[PDCRC]] - CRC routines in C | * [[PDCRC]] - CRC routines in C | ||
===Databases=== | |||
====DBF files==== | |||
* [[dbfread]] - Python | |||
* [http://www.antonis.de/faq/qbmonfaq-dateien/1047642646.html How to read DBF files with QBasic] | |||
* [[libdbf]] - tiny C library that reads .dbf files | |||
==Graphics== | |||
* [http://www.totallyobjects.com/files/jpeg.zip JPEG Displayer] - Demonstrates how to use JPEG images, requires VA Smalltalk 4 or up - By David Pennington/[[Totally Objects]]. | |||
* [[SDRAW]] - Draws LISP language substructures | |||
* [https://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/oop/clos/code/3d_geom.tgz 3D Geometry classes] - Simple 3d gemometry classes in LISP/CLOS | |||
==Utilities & small applets== | |||
* [https://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/oop/clos/code/util.tgz CLOS utilites] - Sundry small utilities written in LISP wCLOS. | |||
==Object oriented functions== | |||
* [[Artificial flavors]] - LISP | |||
==Language and system extensions== | |||
;LISP | |||
* [[Artificial flavors]] - LISP | |||
* [http://www.cs.cmu.edu/~dst/Lisp/defstruct.scheme Defstruct] - CL like Defstruct for Scheme | |||
* [[DTRACE]] - Trace/Untrace replacements | |||
* [http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/m-expression/ M-Expressions] - Alternative syntax for CL | |||
;Smalltalk | |||
* [http://www.totallyobjects.com/files/tobap6-0_1-0-0.zip Application Prerequisites] - Replaces the Prerequisites windows in VA Smalltalk | |||
==Games== | |||
===Collections=== | |||
* [https://github.com/lispgames/lispgames.github.io/wiki LISP games Wiki] | |||
==Sundry & collections== | ==Sundry & collections== | ||
* [[OZPD]] - Sundry C routines and programs | * [http://zabrodsky-rexx.byethost18.com/aat/ Album of Algorithms and Techniques for Standard Rexx] - [[Vladimír Zábrodský]]'s collection of REXX code, mostly small snippets. | ||
* [http://mzelden.com/mvsutil.html Mark's MVS Utilities] - While mostly XEDIT and MVS related there are a few worthwhile REXX programs in there as well. | |||
* [[OZPD]] - Sundry [[PD]] C routines and programs | |||
* [http://pleac.sourceforge.net/pleac_rexx/index.html PLEAC-REXX] - Collection of common REXX rutines | |||
* [http://vastgoodies.com Vastgoodies.com] - A reprisotory of VA Smalltalk functions run by Adriaan van Os , only a subset of these will work with the OS/2 version of VisualAge Smalltalk 6.x | |||
* [http://www.wpachl.at/Rexx_Programs.html Walter Pachl's REXX code] | |||
* [[VX-REXX Code snippets]] | |||
[[Category:Languages Articles]] |
Latest revision as of 21:48, 2 April 2025
EDM/2's collection of code snippets, and links to such small programs on external sites. Most of the snippets are for common scripting languages such as REXX, Tcl, PHP and so on but there is also code for traditional programming languages such as C, Modula-2, LISP and Prolog, et cetera. The idea behind such small programs is primarily to be used as educational examples that a programmer can learn from but depending on licence, they can also be taken and used in your own programs.
Code snippets are usually linked to from the Wiki page for each programming language, but it makes sense to also collect them here all together and sort them by function since they can be used in multi-language projects, it may be easier for you to call a function in another language than to rewrite it in your preferred language, and understanding it in another language even if you have not fully mastered that language can be helpful even if you intend to rewrite the function in your preferred programming tool, and so on.
The snippets here are primarily either targeting OS/2 or generic in nature, but code targeting DOS, UNIX and even more alien systems may be included especially if they have some educational value.
OS/2 system
WPS
- BuildSOM - REXX - Creates program and folder objects via SOM.
- PostWhat WPS Class Example - C++ & REXX
- Small examples of Workplace Shell programming - C
Memory management
Aka Garbage collection, malloc etc.
Collections
- Dave Briccetti's Programming Samples - Sundry C++ code example
- norrsken data teknik eCS tools - Helge Nordmann's REXX system utility collection.
- OS/2 Primecuts - C and C++ OS/2 specific code examples
Internet
WWW & HTML
- Text Widget Hyperlink - A small piece of VisualAge Smalltalk code that shows how to use a Text Widget as a hyperlink. By Matt Sims/Totally Objects.
- txt2HTML - REXX - Converts text files to HTML files.
- Update Homepage - REXX & Object REXX
- WebConnection File Attachment Adds file attachment capacity to the WebConnection part in VisualAge Smalltalk - By David Pennington/Totally Objects.
E-Mail & USENET
- Get Usenet News Articles Using REXX, Network News Transfer Protocol and Sockets
- Sending Mail with REXX
- Send Mail to an Email List with REXX, SMTP and Sockets
General
- Date and time operations
- Date and Time Editor - A small piece of VisualAge Smalltalk code that allows you to place date and time editors in a normal VA Smalltalk window. By Matt Sims/Totally Objects.
- Harold Zbiegien's date algorithms in REXX and in FORTRAN
- Rex Swain's B2MMDDYY.REX - Convert Base format date to MM/DD/YYYY (REXX)
Files & file operations
- PDCRC - CRC routines in C
Databases
DBF files
- dbfread - Python
- How to read DBF files with QBasic
- libdbf - tiny C library that reads .dbf files
Graphics
- JPEG Displayer - Demonstrates how to use JPEG images, requires VA Smalltalk 4 or up - By David Pennington/Totally Objects.
- SDRAW - Draws LISP language substructures
- 3D Geometry classes - Simple 3d gemometry classes in LISP/CLOS
Utilities & small applets
- CLOS utilites - Sundry small utilities written in LISP wCLOS.
Object oriented functions
- Artificial flavors - LISP
Language and system extensions
- LISP
- Artificial flavors - LISP
- Defstruct - CL like Defstruct for Scheme
- DTRACE - Trace/Untrace replacements
- M-Expressions - Alternative syntax for CL
- Smalltalk
- Application Prerequisites - Replaces the Prerequisites windows in VA Smalltalk
Games
Collections
Sundry & collections
- Album of Algorithms and Techniques for Standard Rexx - Vladimír Zábrodský's collection of REXX code, mostly small snippets.
- Mark's MVS Utilities - While mostly XEDIT and MVS related there are a few worthwhile REXX programs in there as well.
- OZPD - Sundry PD C routines and programs
- PLEAC-REXX - Collection of common REXX rutines
- Vastgoodies.com - A reprisotory of VA Smalltalk functions run by Adriaan van Os , only a subset of these will work with the OS/2 version of VisualAge Smalltalk 6.x
- Walter Pachl's REXX code
- VX-REXX Code snippets