Feature list (?)

Everything else that doesn't fall into one of the other PB categories.
AZJIO
Addict
Addict
Posts: 1317
Joined: Sun May 14, 2017 1:48 am

Feature list (?)

Post by AZJIO »

Has anyone had the desire to compile a list of functions by section, so that those who are starting to program can immediately get more features, knowing about the existence of these functions.

For example:

String
Split, Join, SplitL, JoinL (wilbert)
Remove all duplicate lines
StringBetween (mk-soft)
FastString - Structured Memory String (mk-soft)
Fast concatenating (AZJIO)
TrimCharsToString (mk-soft)
IsNumeric (mk-soft)
IsLatin, IsDigital, IsHex, IsFloat (AZJIO)
RTrimChar, LTrimChar (AZJIO)
SplitListByWords, SplitMapByWords (AZJIO)

File operations
ForceDirectories (ts-soft)
GetFileList (idle)
ScanDir
FileSearch + regular expression (AZJIO)
Phone-MTP (RSBasic), (Phone-MTP+Examples Russian)
Finding files using cmd.exe + Dir (AZJIO, G.Sandler)

Math
BigInt (wilbert)
MulDiv (wilbert)
Lizard - scripting language for large and exact numbers (STARGÅTE)
Vast (Little John)

Scintilla
GoScintilla
ScintillaBoost (kenmo)
Autocompletion (AZJIO, eddy)
Styling (AZJIO)
PanelGadget
Folding (Lite), more

Other
Registry (ts-soft)
Detecting Text File Encoding without BOM (Demivec)
FindData (wilbert)
PureAutoIt (ward)

IDE-Tool
IceDesign (ChrisR)
Einruecker (HeX0R)
DataMaker (wilbert)
FindAllReferences (Kiffi, AZJIO, Mesa, ChrisR, Axolotl, Dadlick)
AnotherFileNearby (AZJIO)
Help (AZJIO)
Variable renaming (AZJIO)
AutoCompletionIDE (AZJIO)
Code Localization (AZJIO)
remove comments (AZJIO)
Code Cleaner (RSBasic)
Trim whitespace (skywalk)
Include Helper (AZJIO)
Tidy [Win] (AZJIO)

Network
Module NetworkTCP - Send and Receive Data over 64kB (mk-soft)
UDP Local Network Short Text Sending (All OS) (mk-soft)

Games
Tetris - PureTris (Mindphazer)
Balloons (AZJIO)
Fifteen (AZJIO)

Gadget
TabBarGadget - Tabs like in a browser (STARGÅTE)
ListIconGadget (nalor)

Other features
Is64BitOS (ChrisR)
Disc Information (AZJIO)
Extract Icon (nalor)

User functions
Last edited by AZJIO on Thu Mar 28, 2024 1:58 am, edited 23 times in total.
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: Feature list (?)

Post by Sicro »

Isn't that what I do already with my code archive (see my signature)? In the archive, the codes are directly executable and licensed with open source licenses, so anyone can safely use and modify them.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: Feature list (?)

Post by Mijikai »

It would probably be a good idea to have a link to Sircos and RSBasics Code Archives visibly pinned in the Coding Questions & Tipps and Tricks threads.
AZJIO
Addict
Addict
Posts: 1317
Joined: Sun May 14, 2017 1:48 am

Re: Feature list (?)

Post by AZJIO »

Sicro
Do you have links to discussions? I have looked at ListDirectoryEntries.pbi.

Code: Select all

              If Not FindString("," + FileExtensions$ + ",", "," + EntryExtension$ + ",", 1, #PB_String_NoCase)
                Continue
              EndIf
Using the ,png, extension lookup inside the string ,bmp,gif,jpg,jpeg,png,tif,tiff is slow because it takes 4 steps to get to the next comma. If you make a list, then if the 1st character does not match, there will be a transition to the next element. This works faster.

150-160 ms
8-9 ms
It's fast enough, you can ignore it.

Code: Select all

EnableExplicit

DisableDebugger

Define FileExtensions$ = "bmp,gif,jpg,jpeg,png,tif,tiff,dds,pcx,cals"
Define EntryExtension$ = "txt"
Define StartTime, Res.s, Res2.s, i

StartTime = ElapsedMilliseconds()

For i = 0 To 100000
	If FindString("," + FileExtensions$ + ",", "," + EntryExtension$ + ",", 1, #PB_String_NoCase)
		
	EndIf
Next

Res = "Elapsed time between marks " + Str(ElapsedMilliseconds() - StartTime) + " ms"
Debug Res


NewList ext.s()
Declare SplitL(String.s, List StringList.s(), Separator.s = " ")

StartTime = ElapsedMilliseconds()

SplitL(FileExtensions$, ext(), ",")

For i = 0 To 100000
	ForEach ext()
		If EntryExtension$ = ext()
			
		EndIf
	Next
Next

Res2 = "Elapsed time between marks " + Str(ElapsedMilliseconds() - StartTime) + " ms"
Debug ListSize(ext())
Debug Res2

MessageRequester("", Res + #CRLF$ + Res2)

Procedure SplitL(String.s, List StringList.s(), Separator.s = " ")
  
  Protected S.String, *S.Integer = @S
  Protected.i p, slen
  slen = Len(Separator)
  ClearList(StringList())
  
  *S\i = @String
  Repeat
    AddElement(StringList())
    p = FindString(S\s, Separator)
    StringList() = PeekS(*S\i, p - 1)
    *S\i + (p + slen - 1) << #PB_Compiler_Unicode
  Until p = 0
  *S\i = 0
  
EndProcedure
Last edited by AZJIO on Fri Feb 03, 2023 12:58 am, edited 1 time in total.
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: Feature list (?)

Post by Kuron »

Mijikai wrote: Thu Feb 02, 2023 6:59 pm It would probably be a good idea to have a link to Sircos and RSBasics Code Archives visibly pinned in the Coding Questions & Tipps and Tricks threads.

Although dated, Pure Area has a plethora of code examples for almost anything, and it can be modified for current versions of PureBasic with some effort. Three excellent resources.
Best wishes to the PB community. Thank you for the memories. ♥️
AZJIO
Addict
Addict
Posts: 1317
Joined: Sun May 14, 2017 1:48 am

Re: Feature list (?)

Post by AZJIO »

Why did I bring up this topic? I have previously programmed in AutoIt3 and got used to certain functions that are required for standard programs. If they are available, then you can write any program without having to create them yourself. That is, functions with a high need priority. For example, the Split function is just brilliant and it is used in almost every program I have. Similarly, the ForceDirectories function, which is necessary to create a settings file, and any program has settings and you need to create a path before creating a file in it. A very commonly used function is to enumerate all the files in a folder in order to do something with them. Also in AutoIt3 there is a function to create a temporary file %TEMP%\~8fd6skj03.tmp, that is, the generated name of a non-existent file. I recently needed this. Therefore, it would be great if this would be presented and pinned at the top of the forum and supplemented from time to time.
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: Feature list (?)

Post by blueb »

While I like all efforts to gather 'like' code into sections... it's difficult to isolate every function into it's correct category.

I have gathered PureBasic code since 2003 (or earlier) from these forums and have my own system. In fact, my 'String' folder is nearly 30 MB and contains 270 files (I'm sure some are duplicates with different filenames. haha)

But that's the point... it's difficult to pigeon-hole every sample correctly.
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Feature list (?)

Post by Fred »

I think it's a great idea, may be it would be better in 'Coding question', so I can pin it to the top and everyone could it. You can also add the other repo like Sirco, code archive etc. We could also use the topic to accept suggestion, and once it's added to the first post, delete the suggestion, so the topic only remain a single (big) post.
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: Feature list (?)

Post by Caronte3D »

Many users doing the same thing an everything disconnected :(

I think "Templates" in the PB tools menu should be extended to an online mode, where everyone can upload her code snippets and have them shared with everyone.
Maybe even a score system would be interesting to put the better ones to the top places.
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: Feature list (?)

Post by Sicro »

AZJIO wrote: Thu Feb 02, 2023 9:11 pm Do you have links to discussions?
For many codes, the corresponding forum thread URLs are specified in the code header. But I didn't create a forum thread for all my codes.

The general threads about the archive itself: German thread / English thread

The issues list on GitHub.
AZJIO wrote: Thu Feb 02, 2023 9:11 pm I have looked at ListDirectoryEntries.pbi.
[...]
Using the ,png, extension lookup inside the string ,bmp,gif,jpg,jpeg,png,tif,tiff is slow because it takes 4 steps to get to the next comma. If you make a list, then if the 1st character does not match, there will be a transition to the next element. This works faster.

150-160 ms
8-9 ms
It's fast enough, you can ignore it.
Yes, I assumed it would be fast enough, so I kept it simple. However, I have now revised the code to use a fast trie when filtering the file extensions. The trie should be even faster than your solution with a list. The new version is online in the archive.
blueb wrote: Fri Feb 03, 2023 2:04 pm t's difficult to isolate every function into it's correct category.
The alternative to categories would be tags, but then you need a search program to be able to search for the tags and list the corresponding codes.

I wanted to save the creation of such a search program. I also stayed with it, because I have the idea in my head for a long time to create a package manager, which would then also contain such a search function. But I still haven't implemented this idea, because too few people in the PB community are interested in versioning their PB codes (old versions should also still be downloadable), and I have too little motivation and free time to implement everything on my own.

Currently, I still keep the archive simple: Just download the archive as a ZIP file and all codes are offline directly usable. This is not a problem yet, because the archive is still small and can be downloaded completely quickly. I think many PB users would also prefer it to be simple.
Caronte3D wrote: Fri Feb 03, 2023 2:29 pm Many users doing the same thing an everything disconnected :(
The WinAPI codes archive of RSBasic is not the same as my archive, because they are only code snippets instead of - like in my archive - include files, which are meant to extend the commands of PureBasic with self-programmed commands. But yes, it is also a very great archive.

For small code snippets the forum threads are still good, but for extensive include files the forum should not be used.

Some codes in the forum have been split into multiple posts because the post length limit has been reached, which then requires the codes to be copied together in a cumbersome manner.

Or file sharing services are used, where you have to solve captchas first to be able to download the code afterwards. This variant is ok if there is no great interest in others helping on the project. In addition, one has here again the problem that there is no versioning.

There is often the situation where the software developer wants to stay with a certain old include file version (library package) and so it is advantageous if the old version can still be downloaded from the source.

But I think there is still not much interest in the PB community to use better solutions, to publish extensive codes (as packages) than to post them in the forum or upload them to Dropbox or the like. At least this thread has not shown much participation from the PB community:
For PB6?: pbpm - PB Package Manager
Caronte3D wrote: Fri Feb 03, 2023 2:29 pm I think "Templates" in the PB tools menu should be extended to an online mode, where everyone can upload her code snippets and have them shared with everyone.
For small code snippets, that would be good, yes.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
AZJIO
Addict
Addict
Posts: 1317
Joined: Sun May 14, 2017 1:48 am

Re: Feature list (?)

Post by AZJIO »

Everyone has their own way of placing code. I also collected and I had folders with the author's name and all his code snippets or modules were in his folder. The file name was used by the author, and if it was a fragment without a name, then either the name of the function, or I myself came up with a name for the file.
To find the code I needed, I used a search by file name. I also sometimes remembered the author and went into the author's folder and it was immediately clear there, since one author does not have such a large list that one could get confused. Even if he didn’t find it in this way, he did a search by the contents of the files using his program.
That is, I always found what I needed. But the problem is, if the collection of fragments was made by another author, then it is more difficult for you to find the one you need. Here is an example of how I made a collection of fragments for AutoIt3.
User avatar
Demivec
Addict
Addict
Posts: 4086
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Feature list (?)

Post by Demivec »

AZJIO wrote: Mon Feb 06, 2023 3:28 amEveryone has their own way of placing code.
Here's the method I've used to organized code collections from the forum:
  • By Topic. Topics such as math, gadgets, or color (related) are in their own folder (under a folder of the first letter of the topic) with sub folders to further divide related items or variations. Files for code include the name of the author(s).
  • By Name. Folders are named by individual author and sub folders are for specific code groups.
  • By Trouble. Folders are named by an individual author whose code was not working or requested help for a particular problem. Sub folders are for specific issues or forum thread topics.
Each of the folders contain code, linked forum images or sample program output, and a pdf of the forum
thread named after the thread and including specfically if the French or German forum was the source.

When locating code I can look by topic or author. If I
do a file search I can find matches by topic, file, author, forum thread, etc.
AZJIO
Addict
Addict
Posts: 1317
Joined: Sun May 14, 2017 1:48 am

Re: Feature list (?)

Post by AZJIO »

BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Feature list (?)

Post by BarryG »

Kuron wrote: Thu Feb 02, 2023 11:50 pmPure Area has a plethora of code examples
What is a plethora?
daveb
User
User
Posts: 30
Joined: Tue Jun 07, 2022 6:12 pm

Re: Feature list (?)

Post by daveb »

BarryG wrote: Sat Feb 25, 2023 6:03 am
Kuron wrote: Thu Feb 02, 2023 11:50 pmPure Area has a plethora of code examples
What is a plethora?
Basically it means "A large amount". For detailed meaning: https://dictionary.cambridge.org/dictio ... h/plethora
Post Reply