Search found 54 matches
- Thu Nov 25, 2021 9:42 am
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
Yeah, the '${M//0}' is the other thing I miss from bash, besides the '${var:0:1}'. But I soon realized it would seldom be helpful. Check what happens if you change -3.1230000... to -301.10020030000 I applied the double-mask [^+-0] and [!0] everywhere and got response times doubled -slower, I mean. R...
- Tue Nov 23, 2021 8:35 am
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
All the error and input-handling in each function, seems to have leveled the playing field between the various shells, so that response times (for pow/nthrt) are very similar for all shells. At some point, I might create and function for interactive or one-shot usage, that would isolate all the erro...
- Mon Nov 22, 2021 6:31 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
Great. I just pushed changes so you both can get up to date. from iq, everything below div has moved to iq+ without changes. All the ai functions are moved out elsewhere. I added an integer^integer pow (bnpow) function like '**' and used the bracket pattern suggested you guys came up with. It all lo...
- Mon Nov 22, 2021 9:50 am
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
This works only with bash, not even zsh works. a="firstandlast"; echo ${a::1} The only other way I found to read trailing/leading was this really ugly bit: case $res in 0*) r=0 ;; 1*) r=1 ;; 2*) r=2 ;; 3*) r=3 ;; 4*) r=4 ;; 5*) r=5 ;; 6*) r=6 ;; 7*) r=7 ;; 8*) r=8 ;; 9*) r=9 ;; esac ; res=...
- Sun Nov 21, 2021 7:43 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
Yeah, that's the same pattern I'm using -for chunking also. I can't confirm speed advantage yet for the very neat solutions above, but even if they are slower I'll use them to tidy a few places. And I'll of course do more testing on that to better check speeds. MM, are you normally using bash, or ot...
- Sun Nov 21, 2021 7:06 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
Hey, that's great. That works for posh also. I had edited above asking about reading a single leading/trailing digit, can you guys come up with aything? I just checked and that works here too, under posh/dash (ubuntu /bin/sh): M_int="000000000020001.23"; echo ${M_int#${M_int%%[!0+-]*}} and...
- Sun Nov 21, 2021 5:21 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
You're very sharp MM! and thorough. Just spent a little time fixing div for small divisor problems -before I saw your post. It was already covered for shorter numbers. M_int=${M_int#${M_int%%[^0+-]*}} That's very nice indeed -something I hadn't really looked into enough. Just tried that under bash, ...
- Fri Nov 19, 2021 6:25 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
I've done a lot of fixing, input handling, errors -primarily in nthrt, which should handle negatives bases correctly for Real-Cartesian. Started same as above for intpow and epow . next time, pow will get nearly the same error routine as nthrt Added tests for NULL input to most functions. Thanks for...
- Thu Nov 18, 2021 9:20 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
I've spent two days working on all the special cases for nthrt. I've narrowed it down ...to under 20! Everything else gets handled normally. I'm still gonna hang on to that till tomorrow and check more in the mo'nin'. About the various pows. For fstpow you need to KNOW how much scale is needed to gi...
- Tue Nov 16, 2021 9:21 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
MochiMoppel, I know about printf and did use it before. However it will not work properly with large numbers and figuring out when to use it and when to bypass it -slower than just doing it. I used it to generate pads ad truncate fractions. It's also not implemented uniformly among shells and you ha...
- Mon Nov 15, 2021 8:55 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
Okay, I've pushed some updates again, including the stuff you found and a couple of speed-up. And more comments. I'm interested to know what you think, generally, about which functions are included in main 'iq'. I added the 100 lines of "e^x" at the very last after finally getting it up to...
- Sun Nov 14, 2021 9:36 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
You're a great help -I've gotten these all and probably the next ones you'll find, but I'll not push till tomorrow to make sure. It's bed time here anyway.
- Sun Nov 14, 2021 12:20 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
Also now fixed, thanks again. I'll be out-of-house for next few hours, but keep it up. If we can just get the first 300 lines right...
- Sun Nov 14, 2021 10:50 am
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: IQ4sh - Calculator for CLI or scripts -Testers wanted
@MochiMoppel @JakeSFR thanks for hanging in there. The issues should be fixed now. It was very quiet here for a couple of days. I thought maybe I had lost you all. I really appreciate the help you all provide. Most of the problems have been regressions because of major re-writes of functions just be...
- Wed Nov 10, 2021 7:19 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: [ANN] IQ4sh - Calculator for CLI or scripts -Testers wanted
@chris_r, nice find -fixed. @jamesbond -howdy fella -sniffing around the factorials already? There used to be some math-guys around on murga -I don't remember the handles. Is anyone 'like that' around here? I'm still shopping for efficient algorithms to solve more or faster. For instance a better ap...
- Wed Nov 10, 2021 1:28 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: [ANN] IQ4sh - Calculator for CLI or scripts -Testers wanted
Please get updated iq and iq+. All the issues mentioned yesterday should be fixed -please try your tests again. Also, to not keep you waiting anymore, there's a new repo at: https://github.com/math-for-shell/ai4sh with neural-network demo ( predict-able folder ) I mentioned. I'll be gone a couple of...
- Wed Nov 10, 2021 7:06 am
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: [ANN] IQ4sh - Calculator for CLI or scripts -Testers wanted
@MochiMopel, which 'ash' are you talking about. I'm guessing you mean busybox ash. I have been wondering if iq would run under any ash-variant besides dash.
- Wed Nov 10, 2021 6:57 am
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
Re: [ANN] IQ4sh - Calculator for CLI or scripts -Testers wanted
Thanks to everyone for chipping in. 'ANN' was meant as ANNOUNCE, but NN= neural-network. Made a bunch of pregress yesterday and will push changes today. I'm not calling iq over and over for the NN. The whole thing is sourced into the NN script. Since it is all functions they stay loaded and availabl...
- Mon Nov 08, 2021 2:16 pm
- Forum: Other Distros
- Topic: Slackware AutoStart X as good as Puppy
- Replies: 7
- Views: 1182
Re: Slackware AutoStart X as good as Puppy
I've been away from slack so long that I'm unsure about paths/filenames. But, I think you need to look at your xinitrc files. Each Wm/DE installs one and there is a wm chooser which will let you choose which wm to use as default. Probably bets to ask around or look around in the slackforum at linuxq...
- Mon Nov 08, 2021 5:55 am
- Forum: Other Distros
- Topic: Slackware AutoStart X as good as Puppy
- Replies: 7
- Views: 1182
Re: Slackware AutoStart X as good as Puppy
In the file /etc/inittab, change the default runlevel to '4' instead of 3 and you will boot to desktop.
- Sun Nov 07, 2021 2:44 pm
- Forum: Programming
- Topic: IQ4sh - Calculator for CLI or scripts -Testers wanted
- Replies: 85
- Views: 6193
IQ4sh - Calculator for CLI or scripts -Testers wanted
I have a new project called IQ4sh or simply 'iq'. It's a calculator written to replace calls to 'bc', 'awk', etc., from within scripts. It also can be used from the CLI as a one-shot calculator or sourced into you shell session for interactive use anytime. I need testers and folks eager to try somet...
- Fri Nov 05, 2021 9:30 pm
- Forum: Programming
- Topic: is there anything wrong with this unusual use of loop device?
- Replies: 10
- Views: 1313
Re: is there anything wrong with this unusual use of loop device?
Thanks Barry. Bit of rain out there lately, I heard.
- Thu Nov 04, 2021 1:28 pm
- Forum: Programming
- Topic: is there anything wrong with this unusual use of loop device?
- Replies: 10
- Views: 1313
Re: is there anything wrong with this unusual use of loop device?
Hi! I had kinda retired from programming after 10 years on the same projects. For years I had mostly coded during the cold months. But, when the lockdowns came in 2020, I re-visited a question from years earlier -would it be possible to use, or at least demonstrate neural networks from a shell scrip...
- Wed Nov 03, 2021 8:27 pm
- Forum: Programming
- Topic: is there anything wrong with this unusual use of loop device?
- Replies: 10
- Views: 1313
Re: is there anything wrong with this unusual use of loop device?
I used to use this in KISS linux as a way to have certain directories read-only. For instance, for /usr/bin, I'd create a filesystem image .iso, ext2 or whatever, place that in a read-write framework or as part of normal boot. I'd put the image under /usr/bin, then during bootup, look for such image...