Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - jbk

#1
Questions & Answers / PellesC batch file
October 27, 2025, 08:06:34 PM
PellesC does not seem to like cpp extensions so I altered the bat files like the following
IF EXIST "%~dpn1.c" DEL "%~dpn1.c"
IF EXIST "%~dpn1.cpp" DEL "%~dpn1.cpp"

%BCX%\Bc.exe   %1>bcxout.txt

IF EXIST "%~dpn1.cpp" (
ren "%~dpn1.cpp" "%~dpn1.c"
)
but it doesn't rename the file, why?
#2
Bug Reports / hyphen in filename
October 14, 2025, 04:17:50 PM
I tried to compile msvcrt-vs-ucrt.bas but all I got was
QuoteError: Source file "D:\Bed\BcxProgs\msvcrt-vs-ucrt.c" or "D:\Bed\BcxProgs\msvcrt-vs-ucrt.cpp" was not found. Operation aborted.
spaces instead of hyphens are ok, did I mess up my batch files or do you have the same problem?

the reason for that program was to test the performance of the respective libraries math functions, ucrt is 2 to 5 times faster
BTW, it seems that choosing MS Visual C++ is equal in performance with MS Visual C++ (ucrt)
#3
QuoteThere's a second computer inside your laptop... and you never knew it was there.

Since 2008, nearly every Intel-powered device has shipped with a hidden microcomputer running a mysterious operating system called Minix. It's invisible. Undetectable. And completely beyond your control.

It doesn't matter if your laptop is off. If it's plugged in, Intel's Management Engine is still running — watching, logging, and potentially listening. It bypasses your firewall. It can access your files. It can control your device without your permission.

In this video, we uncover the truth about Intel ME — the most widespread, least understood technology embedded in billions of machines around the world. From NSA backdoors to unpatchable exploits, this is the dark side of computing no one warned you about.
https://youtu.be/ZpXkJqTAY5Y?si=bvazAUkhyMNNMSum
#4
Off-Topic Discussions / high cost of internet
September 15, 2025, 05:34:15 PM
my ISP decided to increase my monthly bill from 61.51 to 76.62, ouch!!!
I am considering going offline altogether, I can turn off windows updates and connect once a week via USB phone tethering to check my mail
#5
Off-Topic Discussions / AI fun and sillyness
August 30, 2025, 08:04:25 PM
while I was comparing the output of LM Studio and ChatGPT, I looked at ChatGPT's history and came across an entry that I didn't recognize
Q: Describe me based on all our chats — make it catchy!

A:  jbk: The Code Alchemist

A relentless explorer at the intersection of math, code, and curiosity, jbk conjures logic from chaos—one algorithm at a time. Whether diving deep into Karatsuba roots, crafting VB-style pattern matching in FreeBASIC, or bending OEIS sequences to his will, he thrives where precision meets creativity. Python, C, Lua, or hand-tuned BigInts—no tool is too obscure, no concept too arcane. A true digital craftsman, jbk doesn't just solve problems—he reverse-engineers the universe's patterns, wraps them in a script, and makes them run faster.

🤣

#6
Bug Reports / Bcx-828 emits bad double exponent
August 29, 2025, 11:10:03 AM
MrBcx
the following illustrated the pronlem
function foo() as double
    Return 1.797693134862316e+307
end function

print foo()
pause

the C++ code
double foo (void)
{
  double  Bcx_RetVal={0};
  Bcx_RetVal=1.797693134862316e + 307;
  return Bcx_RetVal;
}

BCX BASIC to C/C++ Translator (c) 1999-2025 by Kevin Diggins
Version 8.2.8 (08/28/2025) Compiled using LLVM-Clang (21.1.0) for 64-bit Windows
[Lines In: 6 ] [Lines Out: 325 ] [Statements: 8 ] [Time: 0.01 Sec's]
BCX translated [Foo2.Bas] to [Foo2.C] for a C Compiler
**************************************************************************
MinGW g++ is compiling [ D:\Bed\BcxProgs\Foo2 ] as a 64-bit CONSOLE application
D:\Bed\BcxProgs\Foo2.c:306:14: error: exponent has no digits
306 |   Bcx_RetVal=1.797693134862316e + 307;
|              ^~~~~~~~~~~~~~~~~~
#7
I use virtual machines frequently via VMware, I have several Windows 11 VM's and they have developed the problem of disappearing address bar, menu items and the context menu just shows a blank rectangle
try this, open and close a folder about 4 or 5 times and see if all is well or not
searching online I find that others have the same problem and it's not related to a VM
#8
for the past two weeks I have seen a lot of YouTube videos about China's Internet blackouts and severe censorship https://youtu.be/ytEHFzQ2Mso?si=Sq2iRefh9PVig57b and https://youtu.be/oY7O2VK1cfI?si=9zUIjt510FIeMaGj now it seems to also happen in Russia https://youtu.be/n-kxqLM-d-Y?si=TF0oDJ-YDLUR834B
makes me wonder, how would it affect us if it happened here ?
#9
Hi MrBcx
I saw this post https://forum.it-berater.org/index.php/topic,6926.0.html and thought that it would be good to keep in mind when using AI generated code

[edit] this seems to bring to memory something I read years ago and forgot, something about malicious code hidden in comments, but the details evade me
perhaps this ? https://www.malwarebytes.com/blog/news/2021/11/trojan-source-hiding-malicious-code-in-plain-sight
#10
Off-Topic Discussions / AI on a Pentium 2 PC
May 09, 2025, 05:01:00 AM
"Someone Experimented With a 1997 Processor and Showed That Only 128 MB of Ram Were Needed to Run a Modern AI" https://indiandefencereview.com/someone-experimented-with-a-1997-processor-and-showed-that-only-128-mb-of-ram-were-needed-to-run-a-modern-ai/

this should be an interesting read for MrBcx
#11
Off-Topic Discussions / secure KVM switch
March 11, 2025, 08:58:44 AM
I want a secure(no backdoor) KVM switch, any advice?
with recent reports of a backdoor on popular patient monitors made in China I don't trust anything made in China and I don't want to spend more than $100
#12
Off-Topic Discussions / renaming *.dll.a files
February 18, 2025, 08:03:10 AM
I tried to rename 1000+ lib files from *.dll.a to *.a without success, I tried the obvious: ren *.dll.a *.a and in bash mv *.dll.a *.a without luck, windows CLI simply does nothing while bash complains that the last file in the list isn't a file or directory and errors out
I wound up using basic to create a batch file  to do the job, renaming each file individually e.g. ren foo.dll.a foo.a
is there a way to do it like ren *.dll.a *.a ?
#13
Questions & Answers / BED batch files
January 24, 2025, 06:04:55 AM
hello MrBcx
in the latest BED release I find 33 instances of c:\bc\bc   %1>bcxout.txt while in some batch files I see
Quote
CALL  %~dp0Config32.bat

%BCX%\bc "%~dpn1"  >> bcxout.txt 2>&1
shouldn't the 33 instances be similar ?

I was also thinking of cooking-up a gui program where you would enter the paths of the different compilers and then generate the appropriate batch files
#14
Off-Topic Discussions / moped recommendation
October 01, 2024, 05:50:24 PM
I have one pickup and last Friday it broke down so I was thinking that a moped would be good to have, any suggestions?
#15
Off-Topic Discussions / WSL2 anyone ?
September 05, 2024, 08:14:47 PM
today I decided to try WSL again, after enabling Virtual Machine Platform and Windows Subsystem for Linux
I launched PowerShell in Admin mode and wsl --install -d Ubuntu-24.04
after some more PS maneuvers I set wsl --set-default-version 2
I then installed the nautilus file manager, launching it was rather slow and gave some errors but it eventually seemed to function ok
then I installed the pcmanfm file manager, it too gave some error but also worked ok, I like pcmanfm better, it has a pane on the left similar to the Windows explorer
I tried to drag and drop files from Windows to the file manager but that didn't work, so how to transfer files from Windows?
after some searching I found this tip; from the Ubuntu shell type explorer.exe . it will open the Windows Folder where Ububuntu resides, you can then open the Home directory and copy files to it
I also installed the geany IDE which run ok but when I tried to run a program via geany nothing showed, a terminal was supposed to open an display the results
geany was invoking x-terminal but it was not working, then I tried konsole but it took a VERY long time to launch, after some searching I installed tilda
tilda launches quickly but it starts in full screen mode, no title bar or anything, took me a while to figure out that you can right-click on the screen and open preferences to change the size, after that change I like tilda, it has no title bar or scroll bars but you can scroll with the mouse wheel
#16
Off-Topic Discussions / cloning hard drives
August 29, 2024, 05:32:29 PM
I have Ubuntu installed on an external esata ssd but I don't trust the ssd for reliability so I wanted to clone the ssd to a mechanical HD, found clonezilla and works quite well  :)
#17
Off-Topic Discussions / untangling spaghetti code
August 28, 2024, 10:57:17 AM
trying to untangle even a small spaghetti program can be a major challenge, I was trying to untangle this fortran 77 program https://www3.cs.stonybrook.edu/~algorith/implement/wilf/distrib/processed/powser_2.f
from the book "Combinatorial Algorithms" https://www2.math.upenn.edu/~wilf/website/CombAlgDownld.html

here's what I have so far, how would you untangle this mess ?

     '-----------------------------------------------------------
     ' chapter 21: composition of power series(p187)
     '-----------------------------------------------------------
     '   name of subroutine: powser
     '
     '   algorithm:compose power series.
     '
     '   input: n=10   
     '   complier: f77 powser.f
     '-----------------------------------------------------------


      Const nmax=10

      Dim dynamic a[nmax+1] As Double
      Dim dynamic b[nmax+1] As Double
      Dim dynamic c[nmax+1] As Double
      Dim dynamic d[nmax+1] As Double
      Dim Alpha As Double
      Dim As Long i, opti0n
     
      For i=1 To nmax
         c[i]=1/Cdbl(i)
      Next
      a[1] = 1
     
      Alpha= 0
      opti0n=4
      powser(a, b, c, nmax, Alpha, opti0n, d)
     
      For i=1 To nmax
         Print b[i]
      Next
      Pause
      End

      Sub powser(a As Double Ptr, b As Double Ptr, c As Double Ptr, _
          Byval n As Long, Byval Alpha As Double, Byval opti0n As Long, d As Double Ptr)
      Dim As Double alp, r, s, t, v
      Dim As Long q, ind, i, j, j1, l, m, m0, m1, n1, opt
     
      ind=1
      q=0
      opt = opti0n - 3
      If opt < 0 Then
         Goto L10
      Elseif opt=0 Then
         Goto L30
      Else
         Goto L40
      End If

L10:
      m1=0
      s=1
      If opti0n=2 Then ind=0
      alp=1
      If opti0n=1 Then alp=Alpha
      n1=n
L15:
      For j=1 To n1
         v=0
         If j<>1 Then
            j1=j-1
             For i=1 To j1
                v=v+a[i]*c[j-i+q]*(alp*(j-i)-ind*i)
             Next i
         End If
         a[j]=(alp*c[j]+v/Cdbl(j))*s
      Next j
     
      If (opti0n - 2) <= 0 Then
         Goto L43
      Else
         Goto L36
      End If
L30:
      For i=1 To n
         d[i]=b[1]*c[i]
      Next i
      For q=1 To n
         If c[q]<>0 Then Goto L34
      Next q
      Goto L38
L34:
      s=1./c[q]
      m=1
L35:
      m=m+1
      m1=m*q
      If m1>n Then Goto L38
      If b[m] = 0 Then Goto L35
      alp = m
      r = b[m]*c[q] ^m
      d[m1] = d[m1] + r
      n1 = n-m1
      If n1<0 Then
         Goto L38
      Else
         Goto L15
      End If
L36:
      m1 = m*q
      For i=1 To n1
         d[i+m1] = d[i+m1]+a[i]*r
      Next i
      Goto L35
L38:
      For i = 1 To n
         a[i] = d[i]
      Next i
      Exit Sub
L40:
      t = 1
      For i = 1 To n
         t = t/c[1]
         b[i] = a[i] * t
         d[i] = c[i] * t
      Next i
      If n = 1 Then Exit Sub
      For m = 2 To n
         s = -d[m]
         m0 = m-1
         For i = m To n
            For l = i To n
               b[l] = b[l] + s*b[l-m0]
               d[l] = d[l] + s*d[l-m0]
            Next l
         Next i
      Next m
L43:
      End Sub

#18
Wish List / inttypes
August 24, 2024, 12:19:24 PM
MrBcx, I am in favor of pedantic programming, for example I don't like to leave out byval or byref in function/sub declarations
but here's my wish, that Bcx use inttypes in the translated code, so you would have (u)int8_t, (u)int16_t, (u)int32_t and (u)int64_t, that way there's no guesswork, also C data types on Linux differ somewhat than that on Windows and using inttypes would make porting the translated C code to Linux easier
#19
Off-Topic Discussions / Windows security
August 20, 2024, 07:08:23 PM
just saw this concerning PIv6 vulnerability on Windows https://youtu.be/qhQRSUYnVG4?si=aPIuNiClttnHqM6n
#20
Quote from: jbk on August 17, 2024, 06:37:18 AM
...
on the other hand the times for computing the first 1000 Bernoulli numbers to 80 digits precision using my mp routines are
MSVC (CRT)(64-bit) -- Result is ready withIn :  0.6875 Seconds.
MSVC(UCRT)(64-bit) -- Result is ready withIn :  0.7539 Seconds.
MINGW64   (64-bit) -- Result is ready withIn :  1.844  Seconds.
Lcc-Win32 (32-bit) -- Result is ready withIn :  2.797  Seconds.
PellesC   (64-bit) -- Result is ready withIn :  2.859  Seconds.
...
Intel C++   (64-bit) -- Result is ready withIn :  0.5  Seconds.

recently, perhaps a month ago, I mentioned that I installed the Intel compilers, I ran into some difficulties testing some programs for performance, but today I compiled the afore mentioned program using the Intel compiler and the runtime was 0.5 Seconds
now I wanted to test g++ on real Linux, that is, not in a VM
but I needed the C code produced by BCX to compile on Linux, so I used UbxBasic from https://sourceforge.net/projects/ubxbasic/files/
after many fixes to the C code I got it to compile but it would segfault when executed, after an hour trying to figure out the problem it hit me,  UbxBasic produced longjmp instead of a simple return when exit sub/function is encountered, editing out all the longjpm's fixed the problem, runtime 0.59 Seconds
still slower than Intel