Go to advanced search

by jahboater
Thu May 11, 2017 3:52 pm
Forum: Beginners
Topic: Where is the program that executes when a command is typed
Replies: 6
Views: 841

Re: Where is the program that executes when a command is typ

It isn't always an executable program, try "type" which works for other things.

Code: Select all

pi@Pi3:~ $ type cc
cc is /usr/bin/cc
pi@Pi3:~ $ type ls
ls is aliased to `ls --color=auto'
pi@Pi3:~ $ type type
type is a shell builtin
pi@Pi3:~ $ 
by jahboater
Mon May 08, 2017 7:51 pm
Forum: Beginners
Topic: What languages are used to program raspberry PI?
Replies: 17
Views: 12812

Re: programming

ok so I would install raspbian OS to my laptop and run that OS, and with that use a programming language like Phyton or C to start programming? is that correct? You install Raspbian on the Raspberry Pi, not on your laptop (though technically you could do that as well). when I run raspbian OS, does ...
by jahboater
Sun May 07, 2017 8:41 pm
Forum: General discussion
Topic: Gig Nic
Replies: 5
Views: 1181

Re: Gig Nic

thyatt wrote: Would you please share how you setup the USB in the interface file?
No different from the in-built ethernet (except that its eth1 instead of eth0).

Probably best not to edit the interfaces file - its /etc/dhcpcd.conf now.
by jahboater
Sat May 06, 2017 2:14 pm
Forum: AIY Projects
Topic: How do you Shutdown?
Replies: 21
Views: 17419

Re: How do you Shutdown?

Do we all have to create a custom command to achieve a shutdown or is there some hidden button or pre-installed command? It wouldn't be much good if you couldn't shut it down cleanly would it! There are several ways - I like "sudo poweroff", but the shutdown command suggested above is more capable....
by jahboater
Fri May 05, 2017 4:54 pm
Forum: General discussion
Topic: Signal Strength from Rasperry Pi 3 Model B SBC
Replies: 3
Views: 913

Re: Signal Strength from Rasperry Pi 3 Model B SBC

I could only show signal level = 82/100, but not db level. How should i get it? Have you tried exactly what fruitoftheloom said? Please post the result (or just all the output from iwconfig). 82/100 looks like a Link Quality figure, the Signal level is further along the same line and already in -dB...
by jahboater
Fri May 05, 2017 3:03 pm
Forum: C/C++
Topic: New Gcc 7.1, his build sources result success with B model A
Replies: 52
Views: 7757

Re: New Gcc 7.1, his build sources result success with B mod

Looks like its configured for armv6 and vfp, no mention of neon. Does it work if you want to use neon on a modern Pi I wonder? I use a separate configure line for each type of Pi. ../configure -v --enable-languages=c,c++ --with-cpu=cortex-a53 \ --with-fpu=neon-fp-armv8 --with-float=hard --build=arm-...
by jahboater
Thu May 04, 2017 4:26 pm
Forum: C/C++
Topic: New Gcc 7.1, his build sources result success with B model A
Replies: 52
Views: 7757

Re: New Gcc 7.1, his build sources result success with B mod

I'm trying to build 7.1 (released day before yesterday) but it needs so much memory it keeps dying (I think). Probably need to add some swap. I'll try that tomorrow. Yes it does for a brief period need extra memory - if you use make -j5 or some such. "make" on its own runs fine in 1GB but takes for...
by jahboater
Thu May 04, 2017 2:21 pm
Forum: C/C++
Topic: New Gcc 7.1, his build sources result success with B model A
Replies: 52
Views: 7757

Re: New Gcc 7.1, his build sources result success with B mod

jamesh wrote:Adding packages not support by Debian is not a one off operation, there is a continual requirement for support, so it is not something we are likely to do, because the current compiler works fine.
OK understand. I guess the existing five versions of gcc were put there by Debian.
by jahboater
Thu May 04, 2017 12:12 pm
Forum: C/C++
Topic: New Gcc 7.1, his build sources result success with B model A
Replies: 52
Views: 7757

Re: New Gcc 7.1, his build sources result success with B mod

crossover post, I just added the quotes above - because, as people said, when installing a newer GCC then the stability of the whole system is perhaps shaky. OK there may have been some bad wording somewhere in all that and several different issues were being discussed. I can state for a fact that ...
by jahboater
Thu May 04, 2017 12:02 pm
Forum: C/C++
Topic: New Gcc 7.1, his build sources result success with B model A
Replies: 52
Views: 7757

Re: New Gcc 7.1, his build sources result success with B mod

Of course I as an end-user am not interested in recompiling the whole GCC with the Linux kernel I don't know what "with the Linux kernel" means? and then be responsible for the fail-safety of the entire system, Why does installing a compiler affect anything like that? You don't recompile the kernel...
by jahboater
Thu May 04, 2017 11:07 am
Forum: C/C++
Topic: New Gcc 7.1, his build sources result success with B model A
Replies: 52
Views: 7757

Re: New Gcc 7.1, his build sources result success with B mod

because of 25000 packages depending on that upgrade to work safely and stable with the Linux kernel. +1 to JamesH's comment. Not a single one of those 25000 existing packages will be affected by a newer compiler. Simply because you don't compile them! To JamesH The repos already contain several ver...
by jahboater
Wed May 03, 2017 5:43 pm
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13624

Re: Writing clean code isn't hard!

PeterO wrote: PS: Latest code draws and animates this:
Image
Impressive. I guess it shows the paper tape running through the reader and the algol on it being printed out at the same time.
by jahboater
Wed May 03, 2017 4:54 pm
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13624

Re: Writing clean code isn't hard!

<Edit> Just looked in K&R C (2nd edition), that gives an example where functions are declared in a header without using extern, so that's ~30 years of not needing it at least (yet gcc still provides the standard libraries with explicit extern function prototypes). Perhaps its to help readability - ...
by jahboater
Wed May 03, 2017 3:32 pm
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13624

Re: Writing clean code isn't hard!

My code will (eventually) run on Raspbian and 64 bit PC Linux so it's probably going to be wrong on one platform or another :lol: PS: Now upto 10,300 lines of code with no warnings. I think you will be fine, you have done it the right way round (32-bit first). long a; unsigned int b; a = b; // will...
by jahboater
Wed May 03, 2017 3:00 pm
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13624

Re: Writing clean code isn't hard!

PeterO wrote:Where do you stand on putting the previously necessary "extern" in front of function prototypes in header files ?
You've got me there, I didn't know it had changed :-(

I use "static" if the actual function definition is within the same compilation unit or "extern" iff its in a different one.
by jahboater
Wed May 03, 2017 12:34 pm
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13624

Re: Writing clean code isn't hard!

I can see the point of adding "assert()" statements early in a development as a way to prompt the programmer that there is an unhanded case that still needs to be considered and handled in the code. I think its two differing ways of thinking about assert. The above is not why I put them in (I use T...
by jahboater
Wed May 03, 2017 10:46 am
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13624

Re: Writing clean code isn't hard!

I sometimes do things like this to justify a cast. int a; unsigned int b; assert( a >= 0 ); b = (unsigned int)a; I can see where you're going with that, but it kind of says "I'm actually not sure that a will always be positive and I can't be bothered to work out when it might be negative, so I'm no...
by jahboater
Wed May 03, 2017 10:08 am
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13624

Re: Writing clean code isn't hard!

Well that's an interesting point ! The "character" held in ch is actually only 5 bits (it represents a character form a length of paper tape from an 1960's computer) so uint8_t seems the most appropriate type to use. Upper case only! (why not "char" by the way? reads better and sign extension will ...
by jahboater
Wed May 03, 2017 9:53 am
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13624

Re: Writing clean code isn't hard!

preferring instead to think about the limits of the values in variables and using appropriate types. This has worked fine for me for over 30 years. Yes indeed. And that sort of thought is still needed. If you are going to override a warning with a cast you are saying that you have actually done so....
by jahboater
Wed May 03, 2017 9:42 am
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13624

Re: Writing clean code isn't hard!

The only solution I've found that is warning free is to replace "ch += a;" with "ch = (uint8_t) (ch + a);" which seems nonsensical until you remember the integer promotion rules mentioned earlier). I think thats the only way of doing it - if ch really must be 8 bits. or perhaps this horrid macro! #...
by jahboater
Wed May 03, 2017 8:31 am
Forum: C/C++
Topic: Writing clean code isn't hard!
Replies: 138
Views: 13624

Re: Writing clean code isn't hard!

Annoying isn't it! Especially as in your example the compiler must know that 0x10 + 0x20 is perfectly safe. As you know, in C types smaller than int are promoted to int for the expression, which is for processors like ARM that cannot correctly do 8-bit arithmetic (they only have 32-bit registers). T...
by jahboater
Wed May 03, 2017 7:25 am
Forum: Troubleshooting
Topic: Trying to use ssh
Replies: 1
Views: 368

Re: Trying to use ssh

I use:

ssh pi@192.168.1.11

You must have enabled ssh on the Pi first by placing a file called "ssh" in the boot FAT partition.

The default password for user pi is raspberry, you should change that.
by jahboater
Wed May 03, 2017 7:03 am
Forum: C/C++
Topic: GCC 7.1 released
Replies: 0
Views: 466

GCC 7.1 released

by jahboater
Tue May 02, 2017 7:52 am
Forum: Troubleshooting
Topic: execute script by pi after startup
Replies: 9
Views: 1141

Re: execute script by pi after startup

Try this then:

Code: Select all

python /home/pi/ledmatrix/ledmatrix.py /home/pi/ledmatrix/image.png & 
As noted above the environment is different, and its already root.

In you case it doesn't run in your home directory and so has no idea where the "ledmatrix" folder is - so you must give it the full path.
by jahboater
Tue May 02, 2017 6:33 am
Forum: Beginners
Topic: How fast can the GPIO be?
Replies: 4
Views: 808

Re: How fast can the GPIO be?

For C, use the pigpio library (already included with Raspbian)
http://abyz.co.uk/rpi/pigpio/

Go to advanced search