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.


Topics - jbk

Pages: [1] 2 3
1
Questions & Answers / BED batch files
« on: 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

2
Off-Topic Discussions / moped recommendation
« on: 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?

3
Off-Topic Discussions / WSL2 anyone ?
« on: 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

4
Off-Topic Discussions / cloning hard drives
« on: 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  :)

5
Off-Topic Discussions / untangling spaghetti code
« on: 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 ?
Code: [Select]
     '-----------------------------------------------------------
     ' 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

6
Wish List / inttypes
« on: 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

7
Off-Topic Discussions / Windows security
« on: August 20, 2024, 07:08:23 PM »
just saw this concerning PIv6 vulnerability on Windows https://youtu.be/qhQRSUYnVG4?si=aPIuNiClttnHqM6n

8
Off-Topic Discussions / exe performance of some C/C++ compilers
« on: August 18, 2024, 09:49:16 PM »
...
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

9
Bug Reports / Bed Bug
« on: August 11, 2024, 03:18:39 PM »
I couldn't resist naming the thread Bed Bug  ;D
but there's a bug in Bed, I have all my dev tools installed in drive D:, I try to keep my C drive relatively low in content so that making a backup and restore using disk imaging software is more efficient, about every 2 weeks I save what needs to be saved from the C drive and restore to the last image, update windows and make a new image, well lcc's Appdata was never saved because it was installed after the backup, so now even though lcc's installation is still on the D drive I can't use it from within the Bed editor, it just displays working... but never does anything, but here's the bed bug, I closed the Bed editor, reopened it and selected another compiler but when I click on Build Application it displays LccWin32 is compiling [ "D:\bed\BcxProgs\secure3".c ] as a 32-bit CONSOLE application.
it does that no matter what compiler is selected, I close bed, delete bed.ini and relaunch, open the file try to compile with the other compiler but it gives me the same lcc message, what's the deal?

10
Off-Topic Discussions / AI stock market in trouble
« on: July 25, 2024, 08:36:34 PM »
Looks bad for all the tech companies investing in AI https://youtu.be/vqgAy3gprLM?si=q0Om4kBIpvv2Musu

11
Off-Topic Discussions / scary technology
« on: July 02, 2024, 08:30:59 PM »
mind-reading/controlling technology is here https://youtu.be/jlyRvT92_zA?si=4T0rzxaNstEWZdoG and https://youtu.be/IOdZtFWvwL0?si=HDrE4Flgdrvs6e-y
I don't mind the mind reading part so much but altering your memories ?
that's Frankenstein  scary

12
Off-Topic Discussions / Negative Rings in Intel Architecture
« on: July 01, 2024, 04:49:21 PM »
I found this interesting https://medium.com/swlh/negative-rings-in-intel-architecture-the-security-threats-youve-probably-never-heard-of-d725a4b6f831
until today I had never heard of negative rings, the most intriguing is ring -3

13
Questions & Answers / $BCXSTRSIZE posible bug in BCX_TmpStr ???
« on: June 23, 2024, 05:05:54 PM »
I noticed while trying to run some benchmarks using my decfloat routines that changing $BCXSTRSIZE to a high value has no effect from preventing a crash when trying to print a very big string.
if the string length exceeds 16383 or so then there's crash no matter what value I assign to $BCXSTRSIZE
I am a bit suspicious of the BCX_TmpStr function but I don't understand what exactly the function is doing, would you explain?

14
Compiler Related Discussions / Intel Toolkits
« on: June 22, 2024, 08:55:31 PM »
I just downloaded the Intel oneAPI Base Toolkit and the Intel HPC Toolkit, I plan on playing with it and compare their performance with msvc and mingw in the next few days https://www.intel.com/content/www/us/en/developer/tools/oneapi/toolkits.html#gs.annfx1

15
Compiler Related Discussions / corrected lccwin headers
« on: May 31, 2024, 05:33:51 PM »
Hi MrBcx  :)
sometime ago you posted a link to your lccwin headers, would you post link again?
I seem to have broken my lccwin installation and need to reinstall

Pages: [1] 2 3