Using AI models ? (deepseek and ...)

Everything else that doesn't fall into one of the other PB categories.
tj1010
Enthusiast
Enthusiast
Posts: 716
Joined: Mon Feb 25, 2013 5:51 pm

Re: Using AI models ? (deepseek and ...)

Post by tj1010 »

Mijikai wrote: Tue Feb 11, 2025 9:30 pm I think those are still toys.
DeepSeek is better and overall makes more sense imho.
I use A"I" for entertainment and not for research.
I don't think 99% of people know there are standardized benchmarks for AI across specializations.. At the end of the day: Not a single one produces usable code; even for hello-world in a lot of cases..

Image
Image
  • CodeForces: A competition coding benchmark designed to evaluate the reasoning capabilities of large language models (LLMs) with human-comparable standardized ELO ratings.
  • HumanEval: A test developed by OpenAI to measure the code generation capability of LLMs by using 164 programming problems.
  • Omni-MATH: A math benchmark that presents hard challenges, similar to AIME, and is used to evaluate the reasoning skills of LLMs.
  • LiveAoPSBench: A benchmark that provides a set of problems to evaluate the reasoning capabilities of LLMs, similar to CodeForces.
  • APPS: A competitive coding benchmark that tests models in isolated coding challenges, but actual development workflows involve more variables like understanding requirements, following prompts, and collaborative debugging.
  • Elo Rating System: A method used to calculate the standardized ELO rating of LLMs, similar to the official CodeForces platform ELO rating calculation system, which reflects an individual's competitive programming ability and is comparable between humans, models, and across both humans and models.
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: Using AI models ? (deepseek and ...)

Post by BarryG »

STARGÅTE wrote: Tue Feb 11, 2025 2:00 pmSome one should tell ChatGPT that PureBasic strings have no escape characters.
"C:\\Windows\\Fonts" should be "C:\Windows\Fonts"

Well, double backslashes are valid in Windows (they're called UNC paths), so ChatGPT isn't technically wrong. But per your request:


Image

STARGÅTE wrote: Tue Feb 11, 2025 2:00 pmFurther I wonder about the construct "While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend"
I never saw such code part here in the forum, nor in the PureBasic documentation.

It's also valid, and I've seen other people use it here (https://www.purebasic.fr/english/viewto ... 13#p439913). But again per your request:


Image
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Re: Using AI models ? (deepseek and ...)

Post by ShadowStorm »

At the end of the day: Not a single one produces usable code; even for hello-world in a lot of cases..
I think you're talking nonsense !
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
User avatar
STARGÅTE
Addict
Addict
Posts: 2231
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Using AI models ? (deepseek and ...)

Post by STARGÅTE »

BarryG wrote: Wed Feb 12, 2025 1:04 am
STARGÅTE wrote: Tue Feb 11, 2025 2:00 pmSome one should tell ChatGPT that PureBasic strings have no escape characters.
"C:\\Windows\\Fonts" should be "C:\Windows\Fonts"

Well, double backslashes are valid in Windows (they're called UNC paths), so ChatGPT isn't technically wrong. But per your request:
[image]
STARGÅTE wrote: Tue Feb 11, 2025 2:00 pmFurther I wonder about the construct "While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend"
I never saw such code part here in the forum, nor in the PureBasic documentation.
It's also valid, and I've seen other people use it here (https://www.purebasic.fr/english/viewto ... 13#p439913). But again per your request:
[image]
But this updates only your conversation right? It doesn't change ChatGPT itself, an other user would see again the escaped string?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: Using AI models ? (deepseek and ...)

Post by BarryG »

STARGÅTE wrote: Wed Feb 12, 2025 7:11 amBut this updates only your conversation right? It doesn't change ChatGPT itself, an other user would see again the escaped string?
You're right - I just tested it with another account, and it didn't remember what I taught it for my first account (see red box below). I suppose that's a good thing, though, so nobody can maliciously mess with what I've taught it and give me incorrect results.

Image
User avatar
STARGÅTE
Addict
Addict
Posts: 2231
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Using AI models ? (deepseek and ...)

Post by STARGÅTE »

BarryG wrote: Wed Feb 12, 2025 7:40 am I suppose that's a good thing, though, so nobody can maliciously mess with what I've taught it and give me incorrect results.
Yes, that's right. But actually the answer is also at the moment not correct! So what else can we (as the community of Pure Basic) do, to correct such wrong answers, for ALL?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Using AI models ? (deepseek and ...)

Post by miso »

AI is a dumb rock. You tell it to go into the library and to read all the books in it. It does.
OK, now time to ask some question, what is the life the universe and everything? It will tell it's 42.
It wont know though, that the answer comes from the SF section, the science or the children's section.
That can lead to unwanted behavior.

There are AI though that is fed with weighted data, that even aware of the sections, so it will be better than the previous.
So what else can we (as the community of Pure Basic) do, to correct such wrong answers, for ALL?
I belive it's PB coding capabilities comes from the web, providing good code here will improve them with time,
and also providing bad code will make it worse. (without weighted data, it often mixes languages with the major ones,
or even invent new keywords that non existing from another lang.)

That's why the writers protests. The AI can't write stories, it just mixes the patterns and literature of thousands of real people's stories,
whose books was used to train these AI's. (without asking them)

Data is the soul of these tools.
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: Using AI models ? (deepseek and ...)

Post by BarryG »

miso wrote: Wed Feb 12, 2025 8:32 amwhat is the life the universe and everything? It will tell it's 42
To be fair, most humans say that answer as well when you ask them that question. ;)
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: Using AI models ? (deepseek and ...)

Post by BarryG »

STARGÅTE wrote: Wed Feb 12, 2025 8:12 amwhat else can we (as the community of Pure Basic) do, to correct such wrong answers, for ALL?
I don't know enough about AI to answer that. Maybe those sorts of global corrections aren't possible. We're stuck with "Protected" answers. ;)
Joris
Addict
Addict
Posts: 890
Joined: Fri Oct 16, 2009 10:12 am
Location: BE

Re: Using AI models ? (deepseek and ...)

Post by Joris »

AI Model to create new materials...
If importing is punished with tariffs... make your own material :

https://www.youtube.com/watch?v=7_y9aF_T9qc

Just one of the many models arrising the last time.
Yeach, it's scares me a bit, knowing human...
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
tj1010
Enthusiast
Enthusiast
Posts: 716
Joined: Mon Feb 25, 2013 5:51 pm

Re: Using AI models ? (deepseek and ...)

Post by tj1010 »

ShadowStorm wrote: Wed Feb 12, 2025 4:25 am
At the end of the day: Not a single one produces usable code; even for hello-world in a lot of cases..
I think you're talking nonsense !
ChatGPT 4

Code: Select all

Print("Hello, World!")
Input()  ; Wait for user input to keep the console window open
[13:46:18] Waiting for executable to start...
[13:46:19] Executable type: Windows - x64 (64bit, Unicode)
[13:46:19] Executable started.
[13:46:19] [ERROR] Line: 1
[13:46:19] [ERROR] No console is currently opened. OpenConsole() must be called first.

Code: Select all

; System Information using msinfo32 in PureBasic

; Define an array to store system information
Define systemInfo.s(10)

; Define a temporary file to store the output of the msinfo32 command
Define tempFile.s = "msinfo_output.txt"

; Run msinfo32 and output to a file
RunProgram("msinfo32", "/report " + tempFile, "", #PB_Program_Wait)

; Wait for the process to finish (add a small delay)
Delay(1000)

; Open the temporary file to read the system information
If OpenFile(0, tempFile)
  ; Read lines from the file and store them in the array
  Define line.s
  Define index = 0
  While Eof(0) = 0 And index < ArraySize(systemInfo)
    line = ReadString(0)
    systemInfo(index) = line
    index + 1
  Wend
  CloseFile(0)
  
  ; Display the captured information from the array
  For i = 0 To index - 1
    Debug "Info " + Str(i + 1) + ": " + systemInfo(i)
  Next
Else
  MessageRequester("Error", "Unable to open the system information file.", #PB_MessageRequester_Ok)
EndIf

; Optionally, delete the temporary file after use
DeleteFile(tempFile)
[13:55:14] [COMPILER] Line 4: Illegal operator for 'Define'.
[13:55:54] [COMPILER] Line 20: Bad parameter type: an array is expected.
DeepSeek V3

Code: Select all

; Define the path to the output file
OutputFile$ = GetTemporaryDirectory() + "msinfo.nfo"

; Run msinfo32 and export the system information to the output file
RunProgram("msinfo32", "/nfo " + OutputFile$, "", #PB_Program_Wait)

; Open the output file for reading
If ReadFile(0, OutputFile$)
  
  ; Define an array to store the information
  Dim SystemInfo$(0)
  
  ; Read the file line by line
  While Eof(0) = 0
    Line$ = ReadString(0)
    
    ; Add the line to the array
    ReDim SystemInfo$(ArraySize(SystemInfo$()) + 1)
    SystemInfo$(ArraySize(SystemInfo$()) - 1) = Line$
  Wend
  
  ; Close the file
  CloseFile(0)
  
  ; Display the information stored in the array
  For i = 0 To ArraySize(SystemInfo$()) - 1
    Debug SystemInfo$(i)
  Next
  
Else
  MessageRequester("Error", "Could not open the file: " + OutputFile$)
EndIf
lol

Code: Select all

; Import necessary Windows API functions
Prototype.i PFN_BCryptOpenAlgorithmProvider(*phAlgorithm, pszAlgId.p-unicode, pszImplementation.p-unicode, dwFlags.i)
Prototype.i PFN_BCryptGenerateSymmetricKey(*hAlgorithm, *phKey, *pbKeyObject, cbKeyObject.i, *pbSecret, cbSecret.i, dwFlags.i)
Prototype.i PFN_BCryptEncrypt(*hKey, *pbInput, cbInput.i, *pPaddingInfo, *pbIV, cbIV.i, *pbOutput, cbOutput.i, *pcbResult, dwFlags.i)
Prototype.i PFN_BCryptCloseAlgorithmProvider(*hAlgorithm, dwFlags.i)
Prototype.i PFN_BCryptDestroyKey(*hKey)

; Load the BCrypt library
If OpenLibrary(0, "Bcrypt.dll")
  BCryptOpenAlgorithmProvider.PFN_BCryptOpenAlgorithmProvider = GetFunction(0, "BCryptOpenAlgorithmProvider")
  BCryptGenerateSymmetricKey.PFN_BCryptGenerateSymmetricKey = GetFunction(0, "BCryptGenerateSymmetricKey")
  BCryptEncrypt.PFN_BCryptEncrypt = GetFunction(0, "BCryptEncrypt")
  BCryptCloseAlgorithmProvider.PFN_BCryptCloseAlgorithmProvider = GetFunction(0, "BCryptCloseAlgorithmProvider")
  BCryptDestroyKey.PFN_BCryptDestroyKey = GetFunction(0, "BCryptDestroyKey")
Else
  MessageRequester("Error", "Failed to load Bcrypt.dll")
  End
EndIf

; Define constants
#BCRYPT_AES_ALGORITHM = "AES"
#BCRYPT_OBJECT_LENGTH = "ObjectLength"
#BCRYPT_BLOCK_PADDING = 1

; Initialize variables
hAlgorithm.i = 0
hKey.i = 0
pbKeyObject.i = 0
cbKeyObject.i = 0
pbIV.s = Space(16) ; Initialization Vector (16 bytes for AES)
pbSecret.s = "MySecretKey123" ; Secret key (must be 16, 24, or 32 bytes for AES)
cbSecret.i = Len(pbSecret)
pbInput.s = "Hello, World!" ; String to encrypt
cbInput.i = Len(pbInput)
pbOutput.s = Space(cbInput + 16) ; Output buffer (input size + padding)
cbOutput.i = Len(pbOutput)
pcbResult.i = 0

; Open an algorithm provider
If BCryptOpenAlgorithmProvider(@hAlgorithm, #BCRYPT_AES_ALGORITHM, #Null, 0) <> 0
  MessageRequester("Error", "Failed to open algorithm provider")
  End
EndIf

; Get the size of the key object
If BCryptGetProperty(hAlgorithm, #BCRYPT_OBJECT_LENGTH, @cbKeyObject, SizeOf(Integer), @pcbResult, 0) <> 0
  MessageRequester("Error", "Failed to get key object size")
  End
EndIf

; Allocate memory for the key object
pbKeyObject = AllocateMemory(cbKeyObject)
If pbKeyObject = 0
  MessageRequester("Error", "Failed to allocate memory for key object")
  End
EndIf

; Generate a symmetric key
If BCryptGenerateSymmetricKey(hAlgorithm, @hKey, pbKeyObject, cbKeyObject, @pbSecret, cbSecret, 0) <> 0
  MessageRequester("Error", "Failed to generate symmetric key")
  End
EndIf

; Encrypt the data
If BCryptEncrypt(hKey, @pbInput, cbInput, #Null, @pbIV, Len(pbIV), @pbOutput, cbOutput, @pcbResult, #BCRYPT_BLOCK_PADDING) <> 0
  MessageRequester("Error", "Failed to encrypt data")
  End
EndIf

; Display the encrypted data
MessageRequester("Encrypted Data", PeekS(@pbOutput, pcbResult))

; Clean up
If hKey <> 0
  BCryptDestroyKey(hKey)
EndIf
If hAlgorithm <> 0
  BCryptCloseAlgorithmProvider(hAlgorithm, 0)
EndIf
If pbKeyObject <> 0
  FreeMemory(pbKeyObject)
EndIf

; Close the BCrypt library
CloseLibrary(0)
dumpster fire

Advice: If you're going to BS on the internet do it with something that takes longer than minutes to see flaws in.. Also.. again: Standardized..Benchmarks. AI isn't reliable(as indicated by ALL benchmarks) and you obviously know how it works and what it is.. Which one do you suggest for solving millennium problems? XD
ShadowStorm
Enthusiast
Enthusiast
Posts: 303
Joined: Tue Feb 14, 2017 12:07 pm

Re: Using AI models ? (deepseek and ...)

Post by ShadowStorm »

@tj1010, have you ever used DeepSeek (Deep Think V1)?
Take a look and tell me it's rubbish, just for laughs :mrgreen:
Okay, the user wants a "Hello World" code in PureBasic. Let me start by recalling the syntax for PureBasic. I remember that PureBasic uses procedures like MessageRequester for dialogs and Debug for the console. Since "Hello World" is simple, I can choose either method.

First, I'll consider the console approach. In PureBasic, the OpenConsole() command opens a console window, then PrintN("text") prints a line, and CloseConsole() closes it. But maybe using Debug is even simpler because it doesn't require opening or closing the console. Debug "Hello World!" would output to the debugger window, which is handy for quick tests.

Alternatively, a message box might be more user-friendly. Using MessageRequester("Title", "Hello World!") would create a dialog box with the message. The user might prefer a graphical window instead of the console. I should present both options.

Wait, but the user just asked for a Hello World code. Maybe the simplest version is best. Let me check the syntax again. For the console version, the code would be:

OpenConsole()

PrintN("Hello World!")

CloseConsole()

But some IDEs might automatically handle the console, so maybe just Debug is sufficient. Alternatively, using a message box is more visual. Let me provide both examples. That way, the user can choose based on their needs.

Also, in PureBasic, the program needs to end properly. Wait, does the compiler automatically add the necessary End command? Or should I include it? Let me confirm. For simple programs, the code can just be the commands, but sometimes you need to handle the event loop if creating a window. However, for MessageRequester, it's a blocking call, so no event loop needed. So the code can be as simple as:

MessageRequester("Hello", "Hello World!")

Or:

Debug "Hello World!"

I think including both options in the answer would be helpful. So I'll write two examples: one using Debug for the console and another using MessageRequester for a dialog box. That covers different scenarios the user might have in mind.
Result:
Here is an example of a "Hello World" code in PureBasic:

; Displays a message box
MessageRequester("Hello World", "Hello, world!")

; Alternative: displays in the console
; OpenConsole()
; PrintN("Hello, world!")
; Input() ; Waits for user input
; CloseConsole()

And here is a version with a GUI window:

If OpenWindow(0, 0, 0, 200, 100, "Hello World", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TextGadget(0, 20, 40, 160, 20, "Hello, world!", #PB_Text_Center)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf

Choose the version you prefer:

The first version shows a simple message box.
The second version creates a window with centered text.
The commented part shows how to display in the console.
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: Using AI models ? (deepseek and ...)

Post by BarryG »

STARGÅTE wrote: Wed Feb 12, 2025 8:12 amthe answer is also at the moment not correct!
No, it's correct. I mentioned that in this topic a page back. Double-slashes in paths are valid in Windows.
User avatar
STARGÅTE
Addict
Addict
Posts: 2231
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Using AI models ? (deepseek and ...)

Post by STARGÅTE »

BarryG wrote: Wed Feb 12, 2025 11:15 pm
STARGÅTE wrote: Wed Feb 12, 2025 8:12 amthe answer is also at the moment not correct!
No, it's correct. I mentioned that in this topic a page back. Double-slashes in paths are valid in Windows.
That may be so, but the point is that ChatGPT thinks there are escape characters.
As I don't habe a chat bot account you can try to ask ChatGPT:
- Give me an example code how to use a Backslash in PureBasic strings?
- Give me an example code how to use a double quote in PureBasic strings?
- Give me an example code how to use a line feed in PureBasic strings?
I'm curious how it will answer.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
BarryG
Addict
Addict
Posts: 4173
Joined: Thu Apr 18, 2019 8:17 am

Re: Using AI models ? (deepseek and ...)

Post by BarryG »

STARGÅTE wrote:the point is that ChatGPT thinks there are escape characters

Yep, true. See my screenshot below. But I have since told it that it's not an escape character in PureBasic.

STARGÅTE wrote:As I don't habe a chat bot account you can try to ask ChatGPT:
- Give me an example code how to use a Backslash in PureBasic strings?
- Give me an example code how to use a double quote in PureBasic strings?
- Give me an example code how to use a line feed in PureBasic strings?

You don't need to pay for a ChatGPT account, if that's stopping you? I use the free version. :)

Screenshots of its answers are below. Note: I had to shrink the zoom level of the last screenshot.


Image


Image


Image


Image
Post Reply