Go to advanced search

by jahboater
Mon Jun 18, 2018 12:24 pm
Forum: C/C++
Topic: Dynamic sized arrays
Replies: 120
Views: 3531

Re: Dynamic sized arrays

Heater wrote:
Mon Jun 18, 2018 12:16 pm
Can't we get the garbage collection using shared_ptr or something?
Wow, I didn't know about that. Well spotted.
Looks like it was designed for the job!

http://en.cppreference.com/w/cpp/memory/shared_ptr

This en.cppreference.com site is a useful resource by the way.
by jahboater
Mon Jun 18, 2018 12:14 pm
Forum: Beginners
Topic: New to Raspberry pi, what do I need to know to start a project?
Replies: 6
Views: 178

Re: New to Raspberry pi.

And of course you can always learn 'on the go'. Yes - and thats the key point. The Pi is about education. I myself (a retired software engineer) have learned huge amounts in the last few years, for which I thank the RPF. (even though that was not the original purpose of the Pi). Learning on the Pi ...
by jahboater
Mon Jun 18, 2018 10:00 am
Forum: C/C++
Topic: Dynamic sized arrays
Replies: 120
Views: 3531

Re: Dynamic sized arrays

But with the added bonus that when I feel the need for speed I still have all the low level facilities of C available, in the same source in the same language. This morning I saw some code produced by the C compiler:- uint64_t n, base; if( n > UINT64_MAX / base ) { handle overflow } n *= base; Look...
by jahboater
Mon Jun 18, 2018 9:30 am
Forum: C/C++
Topic: Dynamic sized arrays
Replies: 120
Views: 3531

Re: Dynamic sized arrays

Thanks for posting that, very interesting.
If you read it all, he is not that negative.
But I saw this amusing spoof in the comments :-
http://www-users.cs.york.ac.uk/susan/joke/cpp.htm
:)
by jahboater
Mon Jun 18, 2018 8:46 am
Forum: C/C++
Topic: Dynamic sized arrays
Replies: 120
Views: 3531

Re: Dynamic sized arrays

Except... what I'd like is for some bright spark to create some class / template arrangement in C++ such that any variable I define with it behaves like a Javascript variable. Then I can have variable length and dynamically sized arrays, easily runtime extensible objects, add numeric strings to int...
by jahboater
Sun Jun 17, 2018 4:26 pm
Forum: Beginners
Topic: GPIO + memory resident programs (and other ?)
Replies: 2
Views: 78

Re: GPIO + memory resident programs (and other ?)

Yes
Linux is multi-tasking, it runs many different programs continuously all the time.

Try "top" or "ps -el" which will give a list of the all the processes.
by jahboater
Sun Jun 17, 2018 4:13 pm
Forum: Troubleshooting
Topic: Raspberry Pi 3 B+ lockups
Replies: 385
Views: 21556

Re: Raspberry Pi 3 B+ lockups

Ethernet is always killing my 3B+ when i mount a network drive, the commands didn't help. WiFi works fine and the 3B+ runs stable without any crashes, but i bought the 3B+ specially because of the faster ethernet so this is not acceptable for me... Does it work with a USB GiGe adaptor? Like this? h...
by jahboater
Sun Jun 17, 2018 12:27 pm
Forum: C/C++
Topic: Dynamic sized arrays
Replies: 120
Views: 3531

Re: Dynamic sized arrays

Hmm...looking at the draft. If we restrict ourselves to the actual language definition and ignore all that useless library junk we only have 446 pages to deal with. Much nicer. Sounds like I have some bedtime reading ahead... There are now several books on C++17 but none of them cover the entire la...
by jahboater
Sun Jun 17, 2018 9:07 am
Forum: Beginners
Topic: Need help with hash sum check
Replies: 9
Views: 234

Re: Need help with hash sum check

DougieLawson wrote:
Sun Jun 17, 2018 9:00 am
jahboater wrote:
Sun Jun 17, 2018 6:50 am
Everything is so hard on Windows ...
...

Code: Select all

sha256sum 2018-04-18-raspbian-stretch.zip
No it isn't
https://docs.microsoft.com/en-us/window ... tall-win10
gives you sha256sum in a Windows bash shell.
Yes - by allowing a Linux command to be run :)
I rest my case.
by jahboater
Sun Jun 17, 2018 6:54 am
Forum: C/C++
Topic: Dynamic sized arrays
Replies: 120
Views: 3531

Re: Dynamic sized arrays

Please could you could fix the link, currently it points to a small part of the doct about ranges?
by jahboater
Sun Jun 17, 2018 6:50 am
Forum: Beginners
Topic: Need help with hash sum check
Replies: 9
Views: 234

Re: Need help with hash sum check

I ended up giving up on this. I just used etcher. I don't know if it checksumed ot not, but it did check the install on the sd card. Everything is so hard on Windows ... Now you have a working Pi with Raspbian, you can simply do as HawaiianPi says above:- sha256sum 2018-04-18-raspbian-stretch.zip
by jahboater
Sun Jun 17, 2018 1:30 am
Forum: C/C++
Topic: Dynamic sized arrays
Replies: 120
Views: 3531

Re: Dynamic sized arrays

It's impossible to determine from the actual standards document which is nearly 2000 pages long and completely unreadable: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4685.pdf Thats part of a draft. The actual standard has now finally been published, its available here:- https://websto...
by jahboater
Sat Jun 16, 2018 10:01 pm
Forum: C/C++
Topic: Dynamic sized arrays
Replies: 120
Views: 3531

Re: Dynamic sized arrays

Heater,

I am using gcc 8.1 (which has full support for C++17)

This simpler example compiles cleanly with C++

Code: Select all

#include <iostream>

int
main( int argc, const char *argv[] )
{
  int x[argc][argc];
}
Your example, on the other hand, fails in the same way here as it did for you.
Hmm...
by jahboater
Sat Jun 16, 2018 6:04 pm
Forum: Raspbian
Topic: simplified steps to login as root / set root password.
Replies: 4
Views: 180

Re: simplified steps to login as root / set root password.

and on the command line:

sudo su

will get you a root shell without needing a password.
by jahboater
Sat Jun 16, 2018 3:46 pm
Forum: C/C++
Topic: Dynamic sized arrays
Replies: 120
Views: 3531

Re: Dynamic sized arrays

If there are bad things about VLA's it's that: 1) It diverges the C standard from C++, which might be inconvenient sometimes. They work fine in C++17 by the way. I saw this in the C99 Rationale (the second paragraph is amusing) ... Minimize incompatibilities with C++. The Committee recognizes the n...
by jahboater
Fri Jun 15, 2018 4:57 pm
Forum: Beginners
Topic: Fan on Pi
Replies: 13
Views: 394

Re: Fan on Pi

I don't know the PI2, but the 3B under moderate use will go up to 85 . Mine did not. However I suggest getting a Pi3+, the thermal management is dramatically better than the old Pi3. The PCB ground plane is part of the cooling. So even if you have a poorly designed case with no ventilation, you can...
by jahboater
Fri Jun 15, 2018 11:28 am
Forum: Beginners
Topic: Fan on Pi
Replies: 13
Views: 394

Re: Fan on Pi

For others, you can measure the temp easily with vcgencmd measure_temp It starts throttling at 80C. The 3B+ is a bit different in that it starts throttling at 70C (drops to 1.2GHz) then at 80C it throttles back a little more (but that takes a lot of abuse!). The lifetime is measured in decades, so d...
by jahboater
Fri Jun 15, 2018 11:22 am
Forum: Beginners
Topic: Fan on Pi
Replies: 13
Views: 394

Re: Fan on Pi

LTolledo wrote:
Fri Jun 15, 2018 11:19 am
Ambient here goes up to 38C so I installed fans on my RPis , even the RPi1B+, because I WANT the temp to be below 40C (my requirement). Of course I placed a heat sink on the SoC too.
That implies a delta-T of 2C which is impressive :)
by jahboater
Fri Jun 15, 2018 10:51 am
Forum: Beginners
Topic: Fan on Pi
Replies: 13
Views: 394

Re: Fan on Pi

What are you doing with a Pi2B that requires a fan? Fans weren't really a necessity until the Pi3B and even then only if you were doing particlarly cpu or gpu intensive tasks I don't think fans are necessary on any Pi - except perhaps for an extreme closed space with no natural ventilation. They ar...
by jahboater
Fri Jun 15, 2018 8:42 am
Forum: C/C++
Topic: Dynamic sized arrays
Replies: 120
Views: 3531

Re: Dynamic sized arrays

Serving web pages is not an example of a long running process. It most certainly is. The operating system needs to keep running, but the time to process one request for a web page is measured in milliseconds. What Heater is saying is that the web server process runs indefinitely nowadays. And there...
by jahboater
Fri Jun 15, 2018 7:43 am
Forum: General discussion
Topic: HDD Storage for Raspberry Pi?
Replies: 6
Views: 327

Re: HDD Storage for Raspberry Pi?

Does anyone have a work-around for the FAT32 Format when trying to use an internal HDD. I am trying to building a media server, and would like to be able to transfer larger files than the FAT32 formatting will allow. I find out that some guys use a 2.5 " SATA with a expansion module, but i need a 3...
by jahboater
Thu Jun 14, 2018 9:23 pm
Forum: Raspbian
Topic: Passwords for Stretch
Replies: 8
Views: 310

Re: Passwords for Stretch

If i tell you that you have to ask first everytime you leave your house would you do it? Or would you feel like a slave? I have dont set a password for user "pi" and i dont want do that. pi@pi3:~ $ pi@pi3:~ $ sudo su root@pi3:/home/pi# root@pi3:/home/pi# See! I didn't have to give a password to do ...
by jahboater
Thu Jun 14, 2018 6:08 pm
Forum: Raspbian
Topic: Passwords for Stretch
Replies: 8
Views: 310

Re: Passwords for Stretch

There is no password for root by default.
Your system works fine.
Just type:

sudo su

if you want a root shell (for some weird and risky reason).
by jahboater
Thu Jun 14, 2018 3:29 pm
Forum: C/C++
Topic: gdb stack trace from core
Replies: 3
Views: 182

Re: gdb stack trace from core

I use these options. Not sure if all this is still needed .... -g -Og -ggdb -fno-omit-frame-pointer -gcolumn-info -Og ....... -Og Optimize debugging experience. -Og enables optimizations that do not interfere with debugging. It should be the optimization level of choice for the standard edit- compil...
by jahboater
Wed Jun 13, 2018 7:00 pm
Forum: Beginners
Topic: entering the logical OR operation (pipe symbol) in terminal
Replies: 7
Views: 194

Re: entering the logical OR operation (pipe symbol) in terminal

Its also often called a FIFO (first in, first out).
That is, the first byte the producer writes to the pipe is the first byte the consumer reads (compare that to a LIFO which is a stack).

Its popular and intuitive, for example people often write:-

cat xxx | sort

instead of

sort <xxx

Go to advanced search