Go to advanced search

by Paeryn
Mon Jan 21, 2019 1:03 am
Forum: General programming discussion
Topic: PyGame and C
Replies: 1
Views: 43

Re: PyGame and C

Can PyGame be used by other languages, C for example? Doesn't Raspian come with a high level API for playing wav files, generating tones, playing MIDI, etc? Thanks, -Carl Technically you probably could use PyGame from C by embedding the Python interpretter, not the cleanest way of working. SDL is a...
by Paeryn
Mon Jan 21, 2019 12:14 am
Forum: Troubleshooting
Topic: reading 1.45v instead of 3.3v from ribbon cable.
Replies: 3
Views: 80

Re: reading 1.45v instead of 3.3v from ribbon cable.

It sounds like your reading the wrong sides of the connector such that you are actually testing between pins 2 (5v) & 5 (GPIO3). If GPIO3 is high then the difference between them would be 1.7v assuming you have exactly 5v on the power rail, so getting a result of 1.45v is round about right. Easy way...
by Paeryn
Sun Jan 20, 2019 3:53 pm
Forum: Beginners
Topic: Material for the elderly, and glossary for python.
Replies: 6
Views: 120

Re: Hi new member here, too!

What do you need to know about Python? A good starting place for all things Python is the official docs Python 3.5 Documentation . As to what elderly people would enjoy, well that all depends on the individuals, as you help out at the community centre then you are in the best place to determine what...
by Paeryn
Sat Jan 19, 2019 9:02 pm
Forum: Troubleshooting
Topic: Permissions set correctly but not working
Replies: 1
Views: 49

Re: Permissions set correctly but not working

Permissions are not set correctly, directories need execute permission for you to be able to access the files in the directory, without it all you can do is list what files are there.
by Paeryn
Sat Jan 19, 2019 8:41 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: 2.13 epaper display problem
Replies: 2
Views: 126

Re: 2.13 epaper display problem

From the error I would say that the required font /usr/share/fonts/truetype/wqy/wqy-microhei.ttc doesn't exist on your system (it looks to be trying to open it and failing). I can't check the code as from the link you gave the demo code is supplied in a zipped file (which I can't open on my phone), ...
by Paeryn
Sat Jan 19, 2019 3:43 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1290
Views: 40933

Re: Why Avoid BASIC on RPi?

Oops. I was under the impression that volatile was not part of ANSI/C89 standard. I guess it is, so never mind. Is it possible FreeBasic originally targeted a K&R style C compiler as the code generator? Ah yes, volatile was introduced in C89. I've just found a scanned archive of the 1st edition of ...
by Paeryn
Fri Jan 18, 2019 10:33 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1290
Views: 40933

Re: Why Avoid BASIC on RPi?

Paeryn, No, it's just plain broken. Automatic variables in the function that called setjmp() (in FreeBasic's case the entire program is in one large fuction) which have been altered since the call to setjmp() must be declared volatile otherwise they will have indeterminate values when longjmp() cau...
by Paeryn
Fri Jan 18, 2019 9:05 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1290
Views: 40933

Re: Why Avoid BASIC on RPi?

I have a theory how the gcc backend got broken in Free Basic: I think Free Basic generates C89 compliant code but newer versions of gcc since 5.x use C99 as the default. No, it's just plain broken. Automatic variables in the function that called setjmp() (in FreeBasic's case the entire program is i...
by Paeryn
Wed Jan 16, 2019 9:59 pm
Forum: Beginners
Topic: Permissions folders within folders
Replies: 1
Views: 66

Re: Permissions folders within folders

I have a folder with multiple folders inside and i want to delete the main one With everything inside it. How can i do this? Without giving every folder permissions. You can forcibly remove a directory and all its contents regardless of who owns individual files by doing so as root. Be warned, this...
by Paeryn
Wed Jan 16, 2019 9:07 pm
Forum: OpenGLES
Topic: OpenGLES2 on RaspBerry Pi 1B
Replies: 3
Views: 569

Re: OpenGLES2 on RaspBerry Pi 1B

No worries, it's an easy thing to overlook.
by Paeryn
Wed Jan 16, 2019 12:09 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1290
Views: 40933

Re: Why Avoid BASIC on RPi?

Yes, that Haskell implementation demonstrates the algorithm nicely for a human to see what is happening (as it does all the work in decimal and keeps spliting the decimal number in half until at least one half is a single digit). Not very efficient for a binary cpu with a full 32-bit multiplier (or ...
by Paeryn
Tue Jan 15, 2019 11:16 pm
Forum: OpenGLES
Topic: OpenGLES2 on RaspBerry Pi 1B
Replies: 3
Views: 569

Re: OpenGLES2 on RaspBerry Pi 1B

A non-negative value from graphics_get_display_size() means the function was successful. Though looking at, it returns the value that vc_displaymanx_get_info() returned to it, and that only sets the info struct if the value it is returning is zero. Have you allocated enough memory to the GPU? AFAIK ...
by Paeryn
Sat Jan 12, 2019 5:05 pm
Forum: Troubleshooting
Topic: unable to set user shell using chsh but usermod works
Replies: 3
Views: 86

Re: unable to set user shell using chsh but usermod works

chsh changes the user's shell, sudo runs a command as root, therefore sudo chsh will change root's shell. For root to change a specific user's shell then you need to give the user's name at the end of the command. Also, afaik, chsh should have setuid set which means it will be started as if the own...
by Paeryn
Fri Jan 11, 2019 5:19 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1290
Views: 40933

Re: Why Avoid BASIC on RPi?

I suspect a language like Haskell is something that could be used to express all kind of algorithms nicely, once one is familiar with it. For example karatsuba. Nothing stopping people implementing that in Haskell as a learning exercise. I have no idea if the end result would be as efficient as Has...
by Paeryn
Thu Jan 10, 2019 11:44 am
Forum: Python
Topic: How to display an image using tkinter in gui
Replies: 13
Views: 480

Re: How to display an image using tkinter in gui

You are calling create_image() from within create_widgets() but nowhere are you calling create_widgets() so neither will be run.
by Paeryn
Thu Jan 10, 2019 11:24 am
Forum: General discussion
Topic: Geany Error
Replies: 7
Views: 202

Re: Geany Error

Hi, My Pi 3 B+ came with a preloaded Linux which included Geany - love it - and started to use it straight away with Python 3.5. Then at the W/E, Grandkids came around and played about with Scratch. Coincidence?? Now, whenever I execute a python program in Geany, it runs OK first time, but Geany wi...
by Paeryn
Wed Jan 09, 2019 10:46 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1290
Views: 40933

Re: Why Avoid BASIC on RPi?

No idea. Just following the instructions I linked above. No mention of release mode or any other mode there. But of course, they have this other "Getting Started" page here: https://llvm.org/docs/GettingStarted.html which does talk about release types. Grrr.... It does, in step 7, though it doesn't...
by Paeryn
Wed Jan 09, 2019 10:02 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1290
Views: 40933

Re: Why Avoid BASIC on RPi?

Heater wrote:
Wed Jan 09, 2019 9:36 pm

Code: Select all

[ 92%] Linking CXX executable ../../../../../../bin/clangd
/usr/bin/ld: final link failed: No space left on device
Grrr....
Did you configure it for release mode? By default clang/llvm builds in debug mode and the files it creates are humongous (talking GBytes).
by Paeryn
Tue Jan 08, 2019 4:19 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1290
Views: 40933

Re: Why Avoid BASIC on RPi?

Haskell is fast with big numbers because GMP is fast. I would disagree there. Haskell, the language, knows nothing of GMP. The Glasgow Haskell compiler I am using certainly uses GMP under the hood. But that is an implementation detail. I'm sure it could use some other big maths library. I guessing ...
by Paeryn
Mon Jan 07, 2019 11:28 pm
Forum: Raspbian
Topic: Again parse error on Sudoers file
Replies: 8
Views: 149

Re: Again parse error on Sudoers file

So you are saying you didn't edit it yourself? As far as I'm aware no package should be altering the sudoers file when installing, especially not adding in the default Raspbian user and even more so with a glaring error in the line. Also Raspbian doesn't put individual user's lines in the main file,...
by Paeryn
Mon Jan 07, 2019 11:05 pm
Forum: Beginners
Topic: Building Graphic Interface w/Python ? ? ?
Replies: 4
Views: 171

Re: Building Graphic Interface w/Python ? ? ?

The Python on-line docs has links to various places for information. Tkinter is a wrapper for Tcl/Tk, you don't generally need to know how Tcl/Tk works (Tkinter deals with generating and executing Tcl/Tk code) but you may like to read up on it to understand what is really going on. Tkinter module do...
by Paeryn
Mon Jan 07, 2019 10:35 pm
Forum: Raspbian
Topic: Again parse error on Sudoers file
Replies: 8
Views: 149

Re: Again parse error on Sudoers file

You've got that last line wrong, you put NOPASSWORD where it should be spelt NOPASSWD.

Code: Select all

pi ALL=(ALL) NOPASSWD:ALL
by Paeryn
Sun Jan 06, 2019 7:49 pm
Forum: Graphics, sound and multimedia
Topic: Flashing Text in Tkinter
Replies: 4
Views: 388

Re: Flashing Text in Tkinter

Yes, that's what the code I gave will do, the flash_colours tuple is the two colours to alternate between (the code is set up so the non-flashing state uses the first colour). Calling flashColour() with the first parameter being the Tkinter widget to flash (as long as it uses foreground as that is w...
by Paeryn
Sun Jan 06, 2019 12:10 pm
Forum: C/C++
Topic: #include <sys/socket.h>
Replies: 9
Views: 393

Re: #include <sys/socket.h>

hedbonker wrote:
Sun Jan 06, 2019 11:26 am
OK I have one at /usr/include/arm-linux-gnueabihf/sys (as the above post shows) - Will try that. Thanks!
That's the file that's in libc6-dev and that directory should already be in gcc's default include search path.
by Paeryn
Sun Jan 06, 2019 3:51 am
Forum: Python
Topic: Need Python not to use vast amount of CPU
Replies: 2
Views: 182

Re: Need Python not to use vast amount of CPU

try: setup() while True: getTEMP() time.sleep(30) # Read the temperature every 30 sec except KeyboardInterrupt: # trap a CTRL+C keyboard interrupt GPIO.cleanup() # resets all GPIO ports used by this program The way you have this your code is never sleeping, it is constantly calling getTEMP() becaus...

Go to advanced search