Go to advanced search

by jalih
Mon Dec 06, 2021 10:17 am
Forum: General programming discussion
Topic: Advent of Code 2021 - the main bit!
Replies: 104
Views: 2931

Re: Advent of Code 2021 - the main bit!

The ocean doesn't fit on Turbo Pascal I recall there were tricks with pointers one could use to access more than 64K. There may have been ways to access the HIMEM driver as well, but instead I erased DOS, installed Linux and never looked back until I think there was an article by Kent Porter in yea...
by jalih
Thu Dec 02, 2021 6:38 pm
Forum: General programming discussion
Topic: Advent of Code 2021 - the main bit!
Replies: 104
Views: 2931

Re: Advent of Code

ejolson wrote:
Thu Dec 02, 2021 6:27 pm
Was that another PL/I code? It would be interesting to know what compiler.
Also, as an old PL/I hobbyist programmer, I would love to see some code!
by jalih
Thu Dec 02, 2021 6:01 pm
Forum: General programming discussion
Topic: Advent of Code 2021 - the main bit!
Replies: 104
Views: 2931

Re: Advent of Code

I solved day 2 by letting the 8th drive the submarine on it's own... :D Here is the first part and shows how 8th's interpreter can just eval the puzzle data. ns? ns: driver with: driver var depth var horizontal-position : forward parsews >n horizontal-position n:+! ; : down parsews >n depth n:+! ; :...
by jalih
Thu Dec 02, 2021 4:29 pm
Forum: General programming discussion
Topic: Advent of Code 2021 - the main bit!
Replies: 104
Views: 2931

Re: Advent of Code

A little late to the party, I just solved the first day using the 8th programming language. : app:main a:new "1.txt" f:slurp ( >n a:push ) s:eachline dup >r ( swap n:- ) a:y ( 0 n:> ) a:filter a:len nip . cr a:new ( r@ swap 3 a:slice ' n:+ 0 a:reduce a:push ) 0 r@ a:len nip loop rdrop ( sw...
by jalih
Sat Oct 30, 2021 10:33 am
Forum: C/C++
Topic: Basic bluetooth app in C/C++
Replies: 23
Views: 1378

Re: Basic bluetooth app in C/C++

AnneRanch wrote:
Sat Oct 30, 2021 12:41 am
Thanks, but...
the library is based on libbluetooth-dev which is based on bluez which is based on HCI....
It uses BlueZ with D-Bus support. What is wrong with that, as D-Bus interface is currently the preferred method to access BLE?
by jalih
Sun Oct 24, 2021 9:10 am
Forum: C/C++
Topic: Anyone got movfuscator working on ARM/Raspberry Pi OS?
Replies: 2
Views: 292

Re: Anyone got movfuscator working on ARM/Raspberry Pi OS?

If you're up for a little programming challenge just for fun, how about implementing a x86 emulator that runs on the Pi that only implements the x86 MOV instruction. Then you could run programs compiled with movfuscator on the Pi. Well, Box64 - Linux userspace x86_64 Emulator works on Raspberry Pi ...
by jalih
Fri Oct 22, 2021 8:55 pm
Forum: C/C++
Topic: Basic bluetooth app in C/C++
Replies: 23
Views: 1378

Re: Basic bluetooth app in C/C++

Now rewriting "stuff" seems to be typical of Linux - my question is - does it make coding easier ? Libraries like gattlib are available. There are small examples for things like BLE scan, notifications and reading and writing characteristics. Not sure if license is suitable for your proje...
by jalih
Wed Oct 20, 2021 7:18 am
Forum: C/C++
Topic: Basic bluetooth app in C/C++
Replies: 23
Views: 1378

Re: Basic bluetooth app in C/C++

I thought Bluez and D-Bus API is still the preferred way to access BLE on Linux? Socket interface is deprecated with newer kernels...
by jalih
Mon Sep 20, 2021 6:11 am
Forum: C/C++
Topic: Which library should I use to make a GUI?
Replies: 17
Views: 1512

Re: Which library should I use to make a GUI?

Gavinmc42 wrote:
Mon Sep 20, 2021 1:17 am
Can run on most of those Code::Blocks templates?
https://dexp.in/articles/nuklear-intro/
I would use Nuklear too as it's easy to use and works nicely without X11 with SDL2 backend.
by jalih
Sat Sep 18, 2021 8:32 pm
Forum: C/C++
Topic: Which library should I use to make a GUI?
Replies: 17
Views: 1512

Re: Which library should I use to make a GUI?

Sounds line LVGL is not of use on a Pi using Linux unless one is prepared to put a lot of work into getting to actually display stuff, using X or direct frame buffer. Perhaps someone has already done that work. I get the idea LVGL is designed for small memory constrained systems like micro-controll...
by jalih
Sat Apr 24, 2021 8:17 am
Forum: Other programming languages
Topic: Julia the Language
Replies: 153
Views: 21321

Re: Julia my Friend

ejolson wrote:
Sat Apr 24, 2021 5:20 am
Maybe this test just measures the random number algorithms and has nothing to do with the actual efficiency of the respective languages.
Choosing PCG RNG should be fast and good enough for most purposes. If program uses some cryptographically secure RNG, it's going to be a lot slower..
by jalih
Tue Apr 20, 2021 1:51 pm
Forum: Other programming languages
Topic: Julia the Language
Replies: 153
Views: 21321

Re: Julia my Friend

I hadn't thought it'd possible, but another miracle happened with the per-thread random number generators. That is pretty amazing. It is further arguable that both languages were specifically designed to make just-in-time compilation easy and effective to implement. That is indeed the case. In the ...
by jalih
Tue Apr 20, 2021 1:45 pm
Forum: Other programming languages
Topic: Julia the Language
Replies: 153
Views: 21321

Re: Julia my Friend

I hadn't thought it'd possible, but another miracle happened with the per-thread random number generators. That is pretty amazing. It is further arguable that both languages were specifically designed to make just-in-time compilation easy and effective to implement. That is indeed the case. In the ...
by jalih
Sun Apr 18, 2021 4:16 pm
Forum: Other programming languages
Topic: Julia the Language
Replies: 153
Views: 21321

Re: Julia my Friend

I use separate thread to do calculations and plot pixels into image. Main GUI thread just displays the Image. That gives live update for free... Actually BBC BASIC does the same (calculations in worker thread, plotting in GUI thread) but it's individual pixels that are queued for plotting, not the ...
by jalih
Sun Apr 18, 2021 12:25 pm
Forum: Other programming languages
Topic: Julia the Language
Replies: 153
Views: 21321

Re: Julia my Friend

ejolson wrote:
Sat Apr 17, 2021 9:09 pm
Here is a fern program in Julia
Thanks, I have to try that and Go version when I get back home!
by jalih
Sun Apr 18, 2021 12:20 pm
Forum: Other programming languages
Topic: Julia the Language
Replies: 153
Views: 21321

Re: Julia my Friend

Of course programs which build a bitmap in memory and then display it in one hit will take a very different time from those which plot individual pixels (often plotting the same pixel multiple times). But isn't the whole point of the fern fractal to see it 'grow'? Having to wait before anything app...
by jalih
Sat Apr 17, 2021 6:10 pm
Forum: Other programming languages
Topic: Julia the Language
Replies: 153
Views: 21321

Re: Julia the Language

I presume it looks like the Barnsley Ferns : https://en.wikipedia.org/wiki/Barnsley_fern. Plenty of readable example codes there. Had ours of fun with that back in the day on my Atari ST 520. That sounds reasonable. However, right now the main problem is the purpose of the nip function in the Eight...
by jalih
Sat Apr 17, 2021 1:48 pm
Forum: Other programming languages
Topic: Julia the Language
Replies: 153
Views: 21321

Re: Julia the Language

How easy it is to plot images from Julia? Anyone here written a program in Julia to calculate and draw Fern fractal? Below is my version written in 8th programming language. I would love to compare performance... needs nk/gui libbin font/Roboto-Regular.ttf 500 constant WIDTH 500 constant HEIGHT WIDT...
by jalih
Wed Apr 07, 2021 9:39 am
Forum: Other programming languages
Topic: Julia the Language
Replies: 153
Views: 21321

Re: Julia the Language

While interactive experimentation is definitely useful when first learning to program, Julia also functions as a programmable command line similar to bash that has been extended for working with vectors, matrices and other structured data. It further includes a just-in-time compiler to make things ...
by jalih
Fri Mar 26, 2021 2:12 pm
Forum: C/C++
Topic: qt5 creator: QGraphicsView: delete old item before painting a new one?
Replies: 64
Views: 3709

Re: qt5 creator: QGraphicsView: delete old item before painting a new one?

I don't need and don't want extra timer signals or extra slots as I already have a timer loop which synchronizes all GPIO read/write, i2c read/write, GUI button reading, label and textbox printing, and gauge painting from the current updated runtime variables. And I don't want and don't need to &qu...
by jalih
Fri Mar 26, 2021 12:43 pm
Forum: C/C++
Topic: qt5 creator: QGraphicsView: delete old item before painting a new one?
Replies: 64
Views: 3709

Re: qt5 creator: QGraphicsView: delete old item before painting a new one?

you act like a little know-it-all, as it seems, just repeatedly chattering vague things like "rtfm", but never able to provide actual code. I think you'd better stick to your own statement I can't help you as I know nothing about Qt and don't want to give bad advice. Insulting people tryi...
by jalih
Fri Mar 26, 2021 11:59 am
Forum: C/C++
Topic: qt5 creator: QGraphicsView: delete old item before painting a new one?
Replies: 64
Views: 3709

Re: qt5 creator: QGraphicsView: delete old item before painting a new one?

Heater's suggestions have been faulty, misleading, or ununderstandable because of missing actual code. Your actual code please? Or are you just trolling? Read the documentation, QGraphicsScene::advance calls QGraphicsItem::advance for all Items on the scene. That gives you easy way to update graphi...
by jalih
Fri Mar 26, 2021 11:35 am
Forum: C/C++
Topic: qt5 creator: QGraphicsView: delete old item before painting a new one?
Replies: 64
Views: 3709

Re: qt5 creator: QGraphicsView: delete old item before painting a new one?

dsyleixa123 wrote:
Fri Mar 26, 2021 11:08 am
why "Better way"?
And actual code please?
You create graphics scene describing gauge only once, no need to delete and add graphic items again. It should work like Heater tried to explain.
by jalih
Fri Mar 26, 2021 11:06 am
Forum: C/C++
Topic: qt5 creator: QGraphicsView: delete old item before painting a new one?
Replies: 64
Views: 3709

Re: qt5 creator: QGraphicsView: delete old item before painting a new one?

solved: I made some plineX (X=0...3) public in mainwindow.h ( MainWindow::MainWindow), and in mainwindow.cpp: then drew the 4 clock faces as before in MainWindow::MainWindow, then initialized all 4 plineX pointer needles in MainWindow::MainWindow by addLine, then inside the timer loop I 1st deleted...
by jalih
Fri Mar 26, 2021 9:41 am
Forum: C/C++
Topic: qt5 creator: QGraphicsView: delete old item before painting a new one?
Replies: 64
Views: 3709

Re: qt5 creator: QGraphicsView: delete old item before painting a new one?

again. it's a specific qt QGraphics problem ("delete old item before painting a new one?"), not a general C++ problem, and it makes absoutely no scense here to argue with you. For the last time... It's a general C++ problem. Without knowing nothing about Qt, I could see straight a way you...

Go to advanced search