Go to advanced search

by gkreidl
Tue Jun 25, 2019 4:39 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

ScriptBasic wrote:
Tue Jun 25, 2019 2:05 am
Is it my understanding all fibos using GMP leak? How does the Python GMP extension do running in a loop?
No leak.
by gkreidl
Mon Jun 24, 2019 9:57 am
Forum: General discussion
Topic: Raspberry Pi 4 Thread - general discussion
Replies: 279
Views: 12349

Re: Raspberry Pi 4 Thread - general discussion

Is OpenMax still supported? Will omxplayer continue to work (except for the missing HW codecs)? I'm using it a lot of projects.
by gkreidl
Wed Jun 19, 2019 5:05 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

gkreidl, Of course they are getting smaller, but there are more of them, not just "20 or so (recursions)" as you wrote some posts above. And usually 3 numbers of about half the size are required (not for the first recursion). What I wrote was correct: "That is very different to starting with a bunc...
by gkreidl
Tue Jun 18, 2019 9:02 pm
Forum: General discussion
Topic: GUI based video player PI3
Replies: 6
Views: 271

Re: GUI based video player PI3

mmkw43 wrote:
Tue Jun 18, 2019 8:07 pm
Oh -- my bad. I thought it was just a command line player. I'll look into that. !
It wraps a GUI around omxplayer.
by gkreidl
Tue Jun 18, 2019 8:09 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

gkreidl, That's not very precise. I believe what I posted is very precise. There are 1000000 digits in fibo(4784969) There are 500000 digits in fibo(4784969 / 2) There are 250000 digits in fibo(4784969 / 2 / 2) There are 125000 digits in fibo(4784969 / 2 / 2 / 2) ... That accounts for the sizes of ...
by gkreidl
Tue Jun 18, 2019 7:12 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

At every level of recursion a fibo(n) is making calls to fibo(n/2) and fibo(n/2 + 1) So the number of digits of the result of each recursion is half as many as the caller is calculating. 500000, 250000, 125000, 62500, 31250....etc. They get small pretty fast. That's not very precise. Here is a list...
by gkreidl
Tue Jun 18, 2019 7:04 pm
Forum: General discussion
Topic: GUI based video player PI3
Replies: 6
Views: 271

Re: GUI based video player PI3

Omxplayer does a great job playing videos, found that VLC does not. Would like however a GUI based player like VLC that does the trick, maybe with some options like playing all videos in a folder with a shuffle option? Anything available? Like Omxplayer and I could write a script I suppose but just...
by gkreidl
Sat Jun 15, 2019 9:00 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

To compare the speed of doing maths with big integers in Python and C we can look at the results of running ejolson's fibogmp.c and my fibo.py. Neither of these cheat by using any ready made fibo function, they just do regular maths operations on big ints. fibogmp.c $ time ./fibogmp | tail -c 100 G...
by gkreidl
Sat Jun 15, 2019 8:06 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

How much faster is GMP over Python's native BIGINT? Fibo function: 26 (Python 3) to 31 (Python 2) times faster. For small numbers the difference is smaller. The string conversion needed for printing is 240 times faster. The GMP fibo function is about 1.6 times faster than the Python function using ...
by gkreidl
Thu Jun 13, 2019 8:31 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

Here is my final Python Fibonacci challenge script (fibo_final.py). It can be used with Python 2 or 3 and also with pypy and uses the fastest available method (if not told otherwise) without cheating (using the fibo function built into GMP). That means, it will use GMP, if gmpy2 is available. Otherw...
by gkreidl
Tue Jun 11, 2019 6:10 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

The Python wrappings for GMP are in the repository, both for Python 2 and 3: sudo apt-get install python-gmpy2 python3-gmpy2 We do not have to change the fibo code at all, just add imports and redefine the fibs dictionary and the string conversion for printing. At the bottom of the script I have add...
by gkreidl
Sun Jun 09, 2019 5:24 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

Nobody has mentioned or tested the Python fibo challenge algorithms with pypy so far, which is a bit unfair when comparing it to JS, for example, as most modern JS engines include a JIT compiler. fiboch.py is my script using the Python algorithm from github. At the end I have added: t = time.time() ...
by gkreidl
Thu Jun 06, 2019 9:27 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

The riddle of slow or fast printing (Python, both algorithms) Before anything can be printed it has to be converted to a string. The conversion of the fibo(4784969) bigint takes about 301 seconds res = fibo(4784969) t = time.time() restr = str(res) print (time.time()-t) The conversion of the high pr...
by gkreidl
Wed Jun 05, 2019 5:52 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

gkreidl, Interesting. I have somewhat different results running on a Pi 3 (not +) under 64 bit Debian: With printing of the output removed in both cases: $ time python3 fibo.py 4784969 real 0m5.096s user 0m5.051s sys 0m0.044s $ time python3 fibo_phi.py 4784969 real 1m15.632s user 1m15.019s sys 0m0....
by gkreidl
Wed Jun 05, 2019 9:16 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

No idea, I never use Python. But the "python" command here uses python2. After a while I was wondering why it was not finishing... Now you know why I put days or month on it. I was thinking that could be a good approach because is only one calculation but each variable contains a lot of significant...
by gkreidl
Wed Jun 05, 2019 7:50 am
Forum: Raspbian
Topic: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)
Replies: 1522
Views: 628561

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Thanks. I have to confess, I'm not sure about how the website is generated. I'm using version 3 of it: https://github.com/Manuel83/craftbeerpi3 Even if I start kweb with just: kweb http:localhost:5000 it only loads a dark screen below the address bar - nothing else. I've tried Midori also - same pr...
by gkreidl
Tue Jun 04, 2019 11:49 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

gkreidl, This will stop working (like any float based solution) as soon as the precision limit (number of digits) of floats is reached (system dependent). I tested a similar algorithm and it first failed at fibo(72) on a RPi. Yes. If you are using hardware floating point or your typical languages s...
by gkreidl
Tue Jun 04, 2019 5:54 am
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 601
Views: 18054

Re: A Final Fibonacci Challenge

rounded to the nearest integer to obtain the exact value. It is possible that this trick only works when n is large enough, but I haven't checked. nope it works even with small numbers MacBook-Air-de-Daniel:~ daniel$ python fibo2.py 2 1 MacBook-Air-de-Daniel:~ daniel$ python fibo2.py 3 1.8944271909...
by gkreidl
Tue Jun 04, 2019 5:00 am
Forum: Raspbian
Topic: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)
Replies: 1522
Views: 628561

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

Hey. I'm trying to set up a craftbeerpi system. I'm using a rpi zerow, and are trying to get the website running in kweb. I can get kweb to start using: kweb -K http://localhost:5000 It seems like it's loading the site, but nothing comes up on the page. I can get the page to display in chromium, bu...
by gkreidl
Fri May 31, 2019 6:26 am
Forum: HATs and other add-ons
Topic: The Pi TVHAT, tvheadend URLs and gkreidls rtranscode4
Replies: 1
Views: 197

Re: The Pi TVHAT, tvheadend URLs and gkreidls rtranscode4

... I will accept that VLC produces a higher quality output than omxplayergui ... No, it doesn't. As long as you stay in window mode (and not go to full screen using the x11 MMAL splitter), you get quite a lot of lost frames in VLC, if the video format is quite demanding (e. g. German 720p50 TV liv...
by gkreidl
Fri May 31, 2019 3:51 am
Forum: Raspbian
Topic: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)
Replies: 1522
Views: 628561

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

It seems like my iframe shell scripts all start by running a visible lxterminal that quickly disappears. But it can cause confusion to the kiosk users because they flash on the screen. They both have entries in the "direct command execution" section. The information there is confusing as whether th...
by gkreidl
Sat May 25, 2019 11:22 am
Forum: Raspbian
Topic: Howto: Play Web Video from any Browser with omxplayerGUI
Replies: 8
Views: 13830

Re: Howto: Play Web Video from any Browser with omxplayerGUI

Yes that's I tried but the video stay always on top. index.html <div style="width:100%;height:50%;background:#F00;color:#FF0000;position:relative;z-index:100;">TOTO</div> <iframe src="http://localhost:9192/dplay?url=%2Fapp%2F1557013221510.mp4&omxoptions=--loop;--layer;-127;--win;0,0,1000,1000;stop"...
by gkreidl
Sat May 25, 2019 10:58 am
Forum: Raspbian
Topic: Howto: Play Web Video from any Browser with omxplayerGUI
Replies: 8
Views: 13830

Re: Howto: Play Web Video from any Browser with omxplayerGUI

Thanks to you I can display the video. but it's always above the web page. What I want to do if to make the video below the webpage (that have transparent area) to make an overlay. something like this for example : https://i.ytimg.com/vi/sKyZuGWLU6Q/maxresdefault.jpg This can also be done but requi...
by gkreidl
Sat May 25, 2019 6:26 am
Forum: Raspbian
Topic: Howto: Play Web Video from any Browser with omxplayerGUI
Replies: 8
Views: 13830

Re: Howto: Play Web Video from any Browser with omxplayerGUI

Hello, Thanks for all the work you've done. I have a question how can I use omxplayergui to play a local video from an electron app ? The ytdl-server must be running (standalone might be better for your case). If you have a local video like /home/pi/myvideo.mkv it can be played with the following U...
by gkreidl
Fri May 24, 2019 9:08 am
Forum: Raspbian
Topic: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)
Replies: 1522
Views: 628561

Re: Kweb Suite (Minimal Kiosk Browser, omxplayerGUI)

migarcia wrote:
Fri May 24, 2019 6:46 am
Hello:
How can I install kweb today? I have not managed to find any repository to do it
kweb is not in any repository (although it is packaged as a Debian/Raspbian package).
You will always find latest install instructions in the first post of this thread.

Go to advanced search