Go to advanced search

by Paeryn
Wed Jan 16, 2019 12:09 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1230
Views: 35170

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: 1
Views: 89

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: 69

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: 1230
Views: 35170

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: 257

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: 181

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: 1230
Views: 35170

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: 1230
Views: 35170

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: 1230
Views: 35170

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: 117

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: 137

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: 117

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: 143

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: 233

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: 167

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...
by Paeryn
Sun Jan 06, 2019 3:21 am
Forum: General discussion
Topic: No good at shellscripts, how to split data into an array?
Replies: 4
Views: 134

Re: No good at shellscripts, how to split data into an array?

You need to use curly brackets to let bash know that the array index is related to the variable otherwise it assumes the opening square bracket is the start of the next item and nothing to do with the variable. Also you might want to change how you create the array as your method will perform globbi...
by Paeryn
Sun Jan 06, 2019 2:47 am
Forum: C/C++
Topic: #include <sys/socket.h>
Replies: 9
Views: 233

Re: #include <sys/socket.h>

hedbonker wrote:
Sat Jan 05, 2019 6:30 pm
This was not included in my base Raspian install. What library is it in so that I can fetch with apt-get?

tia!
It's in the package libc6-dev so this should get it if you don't have it already.

Code: Select all

sudo apt install libc6-dev
by Paeryn
Sat Jan 05, 2019 4:19 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1230
Views: 35170

Re: Why Avoid BASIC on RPi?

Although the Karatsuba algorithm was published in 1962, it is possible the size of the big numbers expected for programs written in BASIC on RISC OS in the 80s was sufficiently small that the asymptotic superiority of Karatsuba multiplication wasn't a clear win over the simplicity of the O(n^2) alg...
by Paeryn
Sat Jan 05, 2019 3:55 am
Forum: Graphics, sound and multimedia
Topic: Flashing Text in Tkinter
Replies: 4
Views: 143

Re: Flashing Text in Tkinter

When you want to flash the text (e.g. by changing its colour) have a function that swaps its colour and periodically calls itself using the after(msec_delay, function, args) method of the top level widget (root in my example). Note that in the call to after(), function is the name of the function to...
by Paeryn
Fri Jan 04, 2019 11:59 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1230
Views: 35170

Re: Why Avoid BASIC on RPi?

I suspect this volatile fix should be incorporated into the FreeBASIC gcc back end, even though it seems a bit of a severe work around as there must be many cases where there is no longjump and the values in the registers are still good. I find it odd, however, that the gcc optimiser assumes regist...
by Paeryn
Fri Jan 04, 2019 11:08 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1230
Views: 35170

Re: Why Avoid BASIC on RPi?

It's a big problem with the generated code. It uses setjmp()/longjmp() to handle GOSUB/RETURN but this fails spectacularly when longjmp() happens as variables that were held in registers at the time of the setjmp() end up with incorrect values when it returns. If you add -Wextra to gcc's compile lin...
by Paeryn
Wed Jan 02, 2019 6:40 pm
Forum: Python
Topic: trying to rename a file
Replies: 11
Views: 279

Re: trying to rename a file

see this thread... https://www.raspberrypi.org/forums/viewtopic.php?f=32&t=229158&p=1410886#p1410886 Well juliolop never referenced that thread in this one and I hadn't read that thread before. It's a bit much for a poster to expect that anybody else either knows what has been posted in other threa...
by Paeryn
Wed Jan 02, 2019 3:43 pm
Forum: Python
Topic: trying to rename a file
Replies: 11
Views: 279

Re: trying to rename a file

So whatever UUT_wo is I suspect it has a dependency on CDU and calling CDU.destroy() first left UUT_wo with garbage data. It would have helped if you'd have told us what these things are and how they are related, there was nothing in what you posted that even hinted at a connection between these two...
by Paeryn
Wed Jan 02, 2019 2:54 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1230
Views: 35170

Re: Why Avoid BASIC on RPi?

Heater wrote:
Wed Jan 02, 2019 2:23 pm
I just found Knuth does have an algorithm: "Algorithm_X": https://en.wikipedia.org/wiki/Knuth%27s_Algorithm_X I have no idea what it does or why I would need one.
It can be used to solve sudoku puzzles amonst other things.
by Paeryn
Wed Jan 02, 2019 2:28 pm
Forum: Python
Topic: trying to rename a file
Replies: 11
Views: 279

Re: trying to rename a file

first of all Happy New Year and thanks again for all your support this line you gave me causes an "unexpected indent" error Python is heavily dependent on indentation, you have to indent that line so that it matches the line before it so that it belongs to the same block of code. You failed to have...

Go to advanced search