Go to advanced search

by jahboater
Tue Oct 06, 2020 11:11 am
Forum: C/C++
Topic: Random Number Generator Using Build In Hardware
Replies: 103
Views: 13856

Re: Random Number Generator Using Build In Hardware

a user interface: "press button to continue", for reaction time seeding? I think that sort of thing is a waste of time on Linux. The kernel uses the timings of certain interrupts (such as keyboard events) as one of many sources of entropy. Linux uses naturally occurring chaotic events on the local ...
by jahboater
Tue Oct 06, 2020 9:21 am
Forum: C/C++
Topic: Random Number Generator Using Build In Hardware
Replies: 103
Views: 13856

Re: Random Number Generator Using Build In Hardware

for seeding, you could take the actual 64bit Unix time, or perhaps the ADC value of an unconnected ADC IC (Arduino, ads1115,...) or a user interface: "press button to continue", for reaction time seeding - how could one predict that? You cant if its a good seed. And I think that's what CSPRNG's rel...
by jahboater
Tue Oct 06, 2020 8:55 am
Forum: C/C++
Topic: Random Number Generator Using Build In Hardware
Replies: 103
Views: 13856

Re: Random Number Generator Using Build In Hardware

dsyleixa123 wrote:
Tue Oct 06, 2020 8:14 am
But if you don't know the seed, how could you figure out the sequence? e.g., for the Xoroshiro1024++ (reseeded for either draw)?
As above, if you know the algorithm, then given ANY value (state), you can predict the next value and so on.
by jahboater
Tue Oct 06, 2020 7:51 am
Forum: C/C++
Topic: Random Number Generator Using Build In Hardware
Replies: 103
Views: 13856

Re: Random Number Generator Using Build In Hardware

dsyleixa123 wrote:
Tue Oct 06, 2020 7:38 am
after all the discussion, why would anyone need a hardware RNG, other than the excellent available PRNGs we have been talking about?
1) Cryptography.
2) Lotteries
...
by jahboater
Mon Oct 05, 2020 2:04 pm
Forum: Beginners
Topic: 4, 8GB RAM or no Pi at all for Firefox browsing ?
Replies: 30
Views: 1029

Re: 4, 8GB RAM or no Pi at all for Firefox browsing ?

UbuntuWizard wrote:
Mon Oct 05, 2020 2:51 am
My point is there arent many people who would need so much RAM but they still are, and the 8 GB model probably exists to make the Raspberry Pi look a lot like a good desktop computer mostly
It would be interesting to see the sales figures for the 8GB model.
My guess it is that it has been popular.
by jahboater
Sun Oct 04, 2020 4:13 pm
Forum: C/C++
Topic: Random Number Generator Using Build In Hardware
Replies: 103
Views: 13856

Re: Random Number Generator Using Build In Hardware

Heater wrote:
Sun Oct 04, 2020 1:47 pm
Easy peasy eh.
If only ....
:)
by jahboater
Sun Oct 04, 2020 12:45 pm
Forum: C/C++
Topic: Random Number Generator Using Build In Hardware
Replies: 103
Views: 13856

Re: Random Number Generator Using Build In Hardware

This way we get a nice "high entropy" jumble of bits to seed xoroshiro1024plusplus which are for sure never all zero. That is 64-bits of entropy ? What about:- ssize_t nread = 0; const int fd = open( "/dev/urandom", O_RDONLY ); if( fd >= 0 ) { nread = read( fd, s, 16 * 8 ); close(fd); } if( nread =...
by jahboater
Sun Oct 04, 2020 12:31 pm
Forum: C/C++
Topic: Random Number Generator Using Build In Hardware
Replies: 103
Views: 13856

Re: Random Number Generator Using Build In Hardware

sorry, I don't understand this uint64_t s[16] seed thing (nor the splitmix64 thing) ; will I have to call millis() 16 times one after another (perhaps by random delay() in between) to fill the array s[0]...s[15]? That's not very random, though it would probably do. I would call millis() once and us...
by jahboater
Sun Oct 04, 2020 11:57 am
Forum: C/C++
Topic: Random Number Generator Using Build In Hardware
Replies: 103
Views: 13856

Re: Random Number Generator Using Build In Hardware

what if I had for seeding just uint32_t millis()? how to proceed then to fill that s[16] array? Anything you like:- 1) leave the remainder as zero (have to check millis() didn't return zero) 2) use an LCG to compute them from the first millis() value (I think MT1997 does something like to seed its ...
by jahboater
Sun Oct 04, 2020 10:10 am
Forum: Troubleshooting
Topic: installing mingw32 kit for QTCreator on Raspberry Pi OS
Replies: 2
Views: 79

Re: installing mingw32 kit for QTCreator on Raspberry Pi OS

Yes.

mingw is a version of GCC for use on x86 Windows platforms.

Raspberry Pi OS has normal GCC pre-installed which you may build QT with.
by jahboater
Sat Oct 03, 2020 2:38 pm
Forum: Beginners
Topic: Booting Up Headless
Replies: 51
Views: 1562

Re: Booting Up Headless

My clock runs from /etc/rc.local (just before the exit 0) /usr/bin/tvservice -o nice --adjustment=-20 /home/pi/clock.py & The first line turns off hdmi to save a little power. The nice bit increases the priority of the clock program in the (slight) hope it will improve the accuracy :) You may log in...
by jahboater
Sat Oct 03, 2020 2:34 pm
Forum: General discussion
Topic: Software Front Panel Similar to Research Machines RM380Z?.
Replies: 6
Views: 250

Re: Software Front Panel Similar to Research Machines RM380Z?.

Not a fancy front panel (I used a 380Z too!), but much of the functionality is available in the debugger. Compile a program for debug in the usual way, and enter gdb. Type: layout reg (dual asm window display; may be abbreviated to "la r") starti (starts at the first instruction) stepi (single step;...
by jahboater
Sat Oct 03, 2020 10:45 am
Forum: C/C++
Topic: Any alternative library of WiringPi in C++
Replies: 11
Views: 560

Re: Any alternative library of WiringPi in C++

dsyleixa123 wrote:
Sat Oct 03, 2020 9:21 am
and multiple example codes for either function are hard to find.
The examples are here:
http://abyz.me.uk/rpi/pigpio/examples.html

This is for the Raspberry Pi by the way, not the Arduino.
by jahboater
Sat Oct 03, 2020 9:11 am
Forum: General discussion
Topic: Power efficiency of official power supply?
Replies: 8
Views: 562

Re: Power efficiency of official power supply?

pidd wrote:
Fri Oct 02, 2020 1:54 pm
I suspect the figures are very conservative.
Very likely.

I am impressed by the simple fact that the detailed spec is actually published.
by jahboater
Sat Oct 03, 2020 9:10 am
Forum: C/C++
Topic: Any alternative library of WiringPi in C++
Replies: 11
Views: 560

Re: Any alternative library of WiringPi in C++

This one is well written, well supported, and fast:
http://abyz.me.uk/rpi/pigpio/
by jahboater
Sat Oct 03, 2020 7:28 am
Forum: C/C++
Topic: questions to libs having a .h file and a .c file
Replies: 48
Views: 1472

Re: questions to libs having a .h file and a .c file

Just avoid putting code in header files.
by jahboater
Sat Oct 03, 2020 1:48 am
Forum: Advanced users
Topic: Pi 4 sudden drastic slowdown by two-thirds
Replies: 10
Views: 504

Re: Pi 4 sudden drastic slowdown by two-thirds

timrowledge wrote:
Sat Oct 03, 2020 1:23 am
so I make my own from PSU's like this -
https://www.amazon.ca/dp/B00DECXUD0/ref ... FbC5ZCJSW
The official Pi4 usb-c PSU is much cheaper than that, and is known to be reliable.
by jahboater
Fri Oct 02, 2020 10:25 pm
Forum: C/C++
Topic: Random Number Generator Using Build In Hardware
Replies: 103
Views: 13856

Re: Random Number Generator Using Build In Hardware

I wish one of these people who think that electronic random number generators are so poor would publish next week's lottery results ... I liked the first version of the UK premium bonds lottery (ERNIE) which derived the winning numbers from the coordinates of cosmic ray particles arriving on a metre...
by jahboater
Thu Oct 01, 2020 7:44 pm
Forum: Python
Topic: Using subtraction on variables
Replies: 6
Views: 242

Re: Using subtraction on variables

razor23 wrote:
Thu Oct 01, 2020 7:41 pm
Yes, but if i use -= it raises syntax error and points to = sign
Really?
Try

x = x - 5

instead
by jahboater
Thu Oct 01, 2020 7:34 pm
Forum: Python
Topic: Using subtraction on variables
Replies: 6
Views: 242

Re: Using subtraction on variables

Is this what you want ?

Code: Select all

Python 3.8.5 (default, Aug  1 2020, 10:14:08) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 10
>>> x -= 5
>>> x
5
>>> x -= 3
>>> x
2
>>> 
You can run Python interactively (as here) to experiment and learn.
by jahboater
Thu Oct 01, 2020 6:02 pm
Forum: General discussion
Topic: retrieve a file location by recognizing only the link of the file
Replies: 12
Views: 355

Re: retrieve a file location by recognizing only the link of the file

dickon wrote:
Thu Oct 01, 2020 5:54 pm
Nit pick: the directories with the two (or more) entries do not have to be the same.
Yes. Of course.
I was trying to keep the explanation reasonably simple to illustrate the difference between hard and soft links!
Like not mentioning reference counts and deletion.
by jahboater
Thu Oct 01, 2020 5:45 pm
Forum: General discussion
Topic: retrieve a file location by recognizing only the link of the file
Replies: 12
Views: 355

Re: retrieve a file location by recognizing only the link of the file

Hard links work by having two entries in a directory (which is a file containing filename/inode number pairs) with the same inode number. Thus the file has two names. They are indistinguishable from each other. The trouble with that is file system specific, the inodes are local to the filesystem. So...
by jahboater
Thu Oct 01, 2020 5:10 pm
Forum: General discussion
Topic: retrieve a file location by recognizing only the link of the file
Replies: 12
Views: 355

Re: retrieve a file location by recognizing only the link of the file

thanks for the friendly advices! All terminal commands work, but what I meant what would be more convenient is if one could read all path information just out of the link-file properties, e.g. by enlarging the properties window or scroll through the explicite uncorrupted pathname . :geek: :ugeek: :...
by jahboater
Thu Oct 01, 2020 5:02 pm
Forum: General discussion
Topic: Power efficiency of official power supply?
Replies: 8
Views: 562

Re: Power efficiency of official power supply?

I cant find a datasheet for the Pi4 PSU that 99.99999% of people use.
Here it is for the older Pi3 PSU:
http://www.farnell.com/datasheets/2020879.pdf
80.86%
by jahboater
Thu Oct 01, 2020 2:48 pm
Forum: General discussion
Topic: retrieve a file location by recognizing only the link of the file
Replies: 12
Views: 355

Re: retrieve a file location by recognizing only the link of the file

Cool!

There is readlink too, but it only opens the first file.

Go to advanced search