Go to advanced search

by Paeryn
Sun Feb 18, 2018 2:34 am
Forum: General discussion
Topic: Same code, compiler version, and HW. Different results
Replies: 30
Views: 863

Re: Same code, compiler version, and HW. Different results

Ah, sorry Heater, I was thinking you meant the compiler had a bug that was causing it... Your printing is wrong though, in the printf format string when you have %ld you pass an int64_t . But %ld refers to a long int which is generally 32 bits on a 32 bit system, %lld refers to a long long int which...
by Paeryn
Sat Feb 17, 2018 9:46 pm
Forum: Beginners
Topic: Running a Procedure from a tkinter button or an event
Replies: 10
Views: 241

Re: Running a Procedure from a tkinter button or an event

Yes, wherever you are redrawing things that are already drawn you are better off moving / updating the original object (it will stay in the same place in the drawing stack so you don't have to worry about objects above or below it), or delete the original and create a new one (but that will require ...
by Paeryn
Sat Feb 17, 2018 8:56 pm
Forum: General discussion
Topic: Same code, compiler version, and HW. Different results
Replies: 30
Views: 863

Re: Same code, compiler version, and HW. Different results

No, it's a bug. I can appreciate that there are many surprises to be found from the fact that floating point cannot represent decimal fractions very well. Not to mention the many other issues with the IEEE 754 floating point standard we use. One can expect all kind of "errors" when working with flo...
by Paeryn
Sat Feb 17, 2018 12:54 am
Forum: General discussion
Topic: Same code, compiler version, and HW. Different results
Replies: 30
Views: 863

Re: Same code, compiler version, and HW. Different results

It's not a bug, it's a case of precision. 4.5 can be easily represented in binary, 0.1 cannot (at least not without infinite binary places). According to the debugger on my PC (using gcc 4.8) the value used for 0.1 is actually 0.1000000000000000055511151231257827. The resultant divide gives an answe...
by Paeryn
Fri Feb 16, 2018 12:26 am
Forum: Beginners
Topic: Running a Procedure from a tkinter button or an event
Replies: 10
Views: 241

Re: Running a Procedure from a tkinter button or an event

No need to create a separate function to do the same thing just because one way passes a parameter and the other doesn't. You could do it a couple of other ways (probably more knowing Python), in both examples I use None as the value to pass for when the button is pressed since your flashLED() funct...
by Paeryn
Tue Feb 13, 2018 1:45 pm
Forum: Troubleshooting
Topic: Python program running in Idle but not with command line
Replies: 6
Views: 168

Re: Python program running in Idle but not with command line

You say you use IDLE3 (Python 3), but when you run from the command line (and as given in the shebang line) you use python (which is Python 2), you need to use python3 to run it with Python 3.
by Paeryn
Mon Feb 12, 2018 11:23 pm
Forum: Beginners
Topic: Error string to float: !OVF
Replies: 3
Views: 97

Re: Error string to float: !OVF

Python has already told you what it can't convert right there in the exception, spectro_tabWatt = '!OVF' , you need to validate your string. Easiest way to check if it can be converted into a float as PeterO said, using exceptions to catch when it can't. def is_float(v): try: float(v) return True ex...
by Paeryn
Mon Feb 12, 2018 10:42 pm
Forum: Python
Topic: [SOLVED] Can't execute 'hugin_executor' from python script
Replies: 3
Views: 138

Re: Can't execute 'hugin_executor' from python script

I don't know about hugin but it sounds like the files possibly aren't in the directory that your script thinks they are in. What happens when you print the command string that you are trying to run? If the filenames don't have absolute paths are you in the correct directory when you run the script? ...
by Paeryn
Sat Feb 10, 2018 5:55 am
Forum: Graphics programming
Topic: graphics with a designer
Replies: 10
Views: 361

Re: graphics with a designer

pyGTK is the python bindings for GTK+2, for GTK+3 they recommend using the bindings in pyGObject (it provides bindings for other GObject based libraries as well as GTK+). Tkinter does a similar job for Tcl/Tk as pyGTK/pyGObject does for GTK+, namely provides python bindings for the toolkits. Tcl/Tk ...
by Paeryn
Fri Feb 09, 2018 11:33 pm
Forum: Advanced users
Topic: new user that can run startx without sudo
Replies: 12
Views: 434

Re: new user that can run startx without sudo

I copied over /usr/share/X11 made a directory in users/home/ of .Xauthority chmod 777 it ran startx .Xauthority is a file, not a directory. If you created a directory with that name then there's no wonder that xauth complained that it couldn't find the file. Also setting its attributes to be access...
by Paeryn
Fri Feb 09, 2018 10:43 pm
Forum: Graphics programming
Topic: graphics with a designer
Replies: 10
Views: 361

Re: graphics with a designer

GTK+ is quite well featured https://www.gtk.org/features.php , it's been going about 20 years, and yes, glade is the program that lets you design your UI layout which can then be loaded into your program. Just be aware if you follow various tutorials on the web that some older ones predate version 3...
by Paeryn
Fri Feb 09, 2018 5:17 pm
Forum: General discussion
Topic: /usr/bin/ld: error: controller uses VFP register arguments
Replies: 1
Views: 66

Re: /usr/bin/ld: error: controller uses VFP register arguments

From the error you are given several of the libraries you are trying to link in are compiled with softfp whereas you are compiling your program for hardfp. You need hardfp copies of those libraies (libftpserver, libftpclient, libtar and any others it complains about).
by Paeryn
Mon Feb 05, 2018 7:32 pm
Forum: Advanced users
Topic: X11 XLoadQueryFont() no response.
Replies: 4
Views: 158

Re: X11 XLoadQueryFont() no response.

I mis-read your notation too (in your C example you looked to be using aFontStruct as both a variable and a type, and as the name was so much like the type name X uses I put 2 + 2 and made 5, plus I'm not used to seeing the = in an assignment stuck up against the item on its right - I thought that w...
by Paeryn
Mon Feb 05, 2018 9:01 am
Forum: Advanced users
Topic: X11 XLoadQueryFont() no response.
Replies: 4
Views: 158

Re: X11 XLoadQueryFont() no response.

I have no experience of Euphoria, but... (based on what I quickly read at OpenEuphoria.org) XLoadQueryFont(aDis, "fixed") returns 0, probably meaning that the function should be ok. Experimenting with lines like: "*-c-60-iso8859-1" or "l-regular-o-normal--0-0-0-0-p-0-iso8859-1" or "-*-helvetica-medi...
by Paeryn
Mon Feb 05, 2018 7:53 am
Forum: Python
Topic: Unable to get correct value of environment variable.
Replies: 6
Views: 306

Re: Unable to get correct value of environment variable.

Where do you declare and export the FLASK_ENV environment variable and where do you run the program from? Every process has its own private environment variables, no process can see any other's environment. When a process spawns a new process (e.g. you run a program from the shell or from the file m...
by Paeryn
Mon Feb 05, 2018 2:07 am
Forum: General discussion
Topic: Can't get out of this loop?
Replies: 2
Views: 187

Re: Can't get out of this loop?

Apologises if this is a simple or obvious question, but I have been struggling all day with programming a senseHat and picamera that is part of the European Space Agency project I am doing with my class (primary school). I'm trying to get data from the sensors on the board and pictures from the cam...
by Paeryn
Sun Feb 04, 2018 3:55 am
Forum: C/C++
Topic: VFP register arguments error C++
Replies: 7
Views: 455

Re: VFP register arguments error C++

Hi, Look like some one found same the problem. https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=79988 I tried change C flags before Complie project follow link but dit not help. You cannot link a softfp library into your program if your program and all the libraries (including system librari...
by Paeryn
Sat Feb 03, 2018 11:22 am
Forum: C/C++
Topic: VFP register arguments error C++
Replies: 7
Views: 455

Re: VFP register arguments error C++

Also for interest, I don't think the Pi3 even supports VFP - it is NEON only. I didn't think of that, they could have optimised their code to use the vector abilities (the VFP was rarely used in vector mode). The floating point unit is still called VFP even on modern CPUs with NEON, though it can o...
by Paeryn
Sat Feb 03, 2018 2:09 am
Forum: Gaming
Topic: Running a game in Raspbian
Replies: 4
Views: 265

Re: Running a game in Raspbian

I've just tried running it on my RPi. Firstly it requires the Broadcom OpenGLES library and it links to the old name of libGLESv2.so , as of Raspbian Stretch that name has been reserved for use of the MESA OpenGLES library, the Broadcom version is now solely named libbrcmGLESv2.so (in Jessie both na...
by Paeryn
Fri Feb 02, 2018 11:09 pm
Forum: C/C++
Topic: VFP register arguments error C++
Replies: 7
Views: 455

Re: VFP register arguments error C++

You can't mix hardfp with softfp, everything has to use the same abi. The abi specifies exactly how data is passed between functions, e.g. if a function compiled with hardfp makes a function call passing a single float parameter it will store that value in the first floating point register, if the f...
by Paeryn
Fri Feb 02, 2018 2:28 am
Forum: Beginners
Topic: Reducing stress on the Raspbeery pi CPU
Replies: 5
Views: 287

Re: Reducing stress on the Raspbeery pi CPU

I'm not sure you are understanding things correctly. What do you mean by cpu power? Changing the clock frequency of the GPU won't have much of an effect on the speed the CPUs run at and vice versa (not counting the obvious possible contentions of shared resources like memory bandwidth). The only thi...
by Paeryn
Fri Feb 02, 2018 1:13 am
Forum: C/C++
Topic: VFP register arguments error C++
Replies: 7
Views: 455

Re: VFP register arguments error C++

The linker is telling you that you are compiling for hardfp (floating point values are passed between functions using the floating point registers and the stack) whereas libfpengine.a contains code compiled with softfp (floating point values are passed using integer registers and the stack) or possi...
by Paeryn
Tue Jan 30, 2018 8:23 pm
Forum: Python
Topic: guizero - Strange behavior with two windows
Replies: 5
Views: 273

Re: guizero - Strange behavior with two windows

In Tkinter you (or in this case guizero) should really be using tk.Toplevel() to create additional top level windows rather than tk.Tk() . tk.Tk() creates a new instance of the Tcl/Tk interpreter. From a quick check * it looks like Tkinter creates Tcl variables bound to the first instance that was c...
by Paeryn
Mon Jan 29, 2018 4:42 pm
Forum: Python
Topic: very absurd problem with if
Replies: 8
Views: 241

Re: very absurd problem with if

That looks like usb is a string of 2 (or more) characters where the first character is 2 and the last character is the newline (with possibly any number of spaces/tabs between them), e.g. "2\n" You can strip whitespace from the front and end of a string with usb.strip() (strip() returns a string wit...
by Paeryn
Sun Jan 28, 2018 11:11 pm
Forum: Python
Topic: Python vs arduino question
Replies: 9
Views: 497

Re: Python vs arduino question

Any code after root.mainloop() won't execute until the Tkinter window is closed as root.mainloop() doesn't return until root is destroyed with root.destroy() . The close button window decoration usually defaults to calling root.destroy() for you. Note: Not strictly true as root.quit() will exit the ...

Go to advanced search