Go to advanced search

by gkreidl
Sat Jun 15, 2019 9:00 pm
Forum: General programming discussion
Topic: A Final Fibonacci Challenge
Replies: 504
Views: 13089

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: 504
Views: 13089

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: 504
Views: 13089

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: 504
Views: 13089

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: 504
Views: 13089

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: 504
Views: 13089

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: 504
Views: 13089

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: 504
Views: 13089

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

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: 504
Views: 13089

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: 504
Views: 13089

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

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

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

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

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

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

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

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.
by gkreidl
Thu May 23, 2019 8:24 am
Forum: Python
Topic: Command line program that doesn't end when pressing Ctrl + C
Replies: 7
Views: 354

Re: Command line program that doesn't end when pressing Ctrl + C

You can set the daemon property on any thread (Python2 at least). Then Python will not wait for the thread to finish.
by gkreidl
Mon May 20, 2019 5:05 pm
Forum: General discussion
Topic: Reply with quote stopped working
Replies: 3
Views: 166

Reply with quote stopped working

Since the maintenance update a short while ago "Reply with quote"returns an empty web page.
by gkreidl
Mon May 20, 2019 4:56 pm
Forum: Advanced users
Topic: Run Stretch wifi GUI from command line
Replies: 4
Views: 248

Re: Run Stretch wifi GUI from command line

You can start X-ORG with xinit and directly open a specific application (without any desktop). Many applications also require a window manager.
by gkreidl
Wed May 15, 2019 5:47 pm
Forum: Other programming languages
Topic: HTML power button
Replies: 5
Views: 348

Re: HTML power button

<a href="file:///homepage.html?cmd=leafpad"><button>Text Editor</button></a> creates a button to open Leafpad. <a href="file:///homepage.html?cmd=sudo%20shutdown%20-h%20now"><button>Shutdown</button></a> creates a button to shut down your RPi. Commands like that will be executed inside a terminal, ...
by gkreidl
Wed May 15, 2019 7:31 am
Forum: Other programming languages
Topic: HTML power button
Replies: 5
Views: 348

Re: HTML power button

kweb (MInimal Kiosk Browser) supports executing any kind of command from inside local HTML files (link, button, form or hidden).
by gkreidl
Tue May 14, 2019 7:03 am
Forum: Beginners
Topic: GUI FOR TEXT SEARCH
Replies: 2
Views: 116

Re: GUI FOR TEXT SEARCH

In Windows I use Agent Ransack to search for a text string in multiple files. Is ther a GUI equivalent that runs on the Raspberry Pi? I downloaded Searchmonkey but it wont install - it says its for Ubuntu so as a necomer to the Pi does that mean it is incompatible with the Raspberry os? Searchmonke...
by gkreidl
Tue May 14, 2019 3:10 am
Forum: Beginners
Topic: Open X number of browsers and tile them
Replies: 2
Views: 125

Re: Open X number of browsers and tile them

Create a simple local HTML file with a table and iframes pointing to the web uris. No need to use multiple browser instances or xdotool.

Go to advanced search