Go to advanced search

by paddyg
Thu Oct 31, 2019 4:10 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9534

Re: Pi3D transparent background on Pi4

OK, I've played around with X11 a bit. The consensus (when I can find anyone interested in this) seems to be that it could be done by taking a snap of what was on the screen then using it as background for the window. However this is unsatisfactory if the stuff behind the pi3d window is changing (a ...
by paddyg
Sun Oct 27, 2019 11:58 am
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9534

Re: Pi3D transparent background on Pi4

It's something that's been niggling for a while.

Just to check; for your purposes is it no use making the whole window partly transparent (as attached) as opposed to the background only?
scrshot.jpg
scrshot.jpg (104.9 KiB) Viewed 3735 times
by paddyg
Sat Oct 26, 2019 9:42 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9534

Re: Pi3D transparent background on Pi4

OK the rust_pi3d transparency works on my laptop and was easy enough to do. But it's setting the opacity of the whole window not just the background. I will have another think about this.
by paddyg
Sat Oct 26, 2019 8:49 pm
Forum: Graphics programming
Topic: Pi3D transparent background on Pi4
Replies: 88
Views: 9534

Re: Pi3D transparent background on Pi4

Hi, Yes it's a pity about the transparent background that used to be available with the old bcm display surface. For the RPi4 I get pi3d to check /proc/modules for vc4 https://github.com/tipam/pi3d/blob/1478c2d4961b870e99713b9ae43e03cb3dbc1f1f/pi3d/constants/__init__.py#L81 and if it's there it beha...
by paddyg
Thu Oct 17, 2019 9:18 pm
Forum: Python
Topic: Compile .py to stand-alone code with no external dependencies
Replies: 5
Views: 826

Re: Compile .py to stand-alone code with no external dependencies

The other approach, which blender does https://www.blender.org/download/ for instance, is to download a zip with python along with all required modules. A bit like the trendy container system that web developers have recently latched on to. The files are not so big really.
by paddyg
Sun Oct 13, 2019 8:30 pm
Forum: Python
Topic: STICKY: [announcement] python 2 end of life
Replies: 20
Views: 6297

Re: STICKY: [announcement] python 2 end of life

I always thought Ubuntu was a Debian derivative the same as Raspbian. Maybe Canonical is big enough to add more tweaks.
by paddyg
Thu Oct 10, 2019 9:52 pm
Forum: Python
Topic: STICKY: [announcement] python 2 end of life
Replies: 20
Views: 6297

Re: STICKY: [announcement] python 2 end of life

paddyg wrote: Maybe what's needed is an LXTermial hack (that can be switched off by accomplished users) that spots when a new user is typing pip or python and pops up a helpful suggestion. It could even have an animated paperclip or such-like. :twisted: This is what Ubuntu does! https://twitter.com...
by paddyg
Mon Oct 07, 2019 1:21 pm
Forum: Python
Topic: picamera problem: reading from the camera at one resolution, cropping out part of the image and streaming at another
Replies: 2
Views: 447

Re: picamera problem: reading from the camera at one resolution, cropping out part of the image and streaming at anothe

There's obviously something I don't understand but why not just cut out the zoom step?

EDIT, ok I see that zoom is the new name for crop. Does this thread help? https://www.raspberrypi.org/forums/view ... p?t=116414
by paddyg
Thu Oct 03, 2019 9:59 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 128
Views: 13154

Re: The Rust debate.

On occasion it does seem a bit micro-managed, as you say. But often, it's a matter of choosing (or later revising) the original types so casting isn't needed everywhere. The u8 is essentially byte arrays so they crop up a lot (along with all the string and unicode char stuff the ugliness of which wa...
by paddyg
Thu Oct 03, 2019 7:39 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 128
Views: 13154

Re: The Rust debate.

sal55 there are things about rust that are annoying and hard to get used to, but the definition and casting of integers is not one of them. Basically you get exactly what you ask for explicitly without any compiler deciding what it thinks you want. You could also do let c = a as u32 + b as u32; or l...
by paddyg
Thu Oct 03, 2019 5:17 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 128
Views: 13154

Re: The Rust debate.

@sal55, Rust might have a slight inconstancy there but

Code: Select all

let a:u64 = 1 << 62;
works OK on my laptop
by paddyg
Thu Oct 03, 2019 5:01 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 128
Views: 13154

Re: The Rust debate.

Anyway. Returning to the subject of this thread: after pondering why Rust bundles so much into its executables I read this post which gives a good justification (to avoid dependency issues etc) and also what to do if you really need to make it smaller. By adding additional flags to the cargo command...
by paddyg
Wed Oct 02, 2019 9:34 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 128
Views: 13154

Re: The Rust debate.

Reasonably, you would expect some considerable overhead to check that. Out of curiosity I tried use std::env; fn main() { let args: Vec<String> = env::args().collect(); let mut my_array: Vec<u8> = args[1].bytes().collect(); my_array[args.len()] = 42; //println!("{:?}", my_array); } Approximation fo...
by paddyg
Wed Oct 02, 2019 8:16 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 128
Views: 13154

Re: The Rust debate.

something similar "-j N"
there is codegen-units which I think does something similar. I've previously ignored these options but with the latest rustc on Raspberry Pi this seems to have to be set to 1 (not really noticed any difference in compile times)
by paddyg
Wed Oct 02, 2019 7:44 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 128
Views: 13154

Re: The Rust debate.

So it's paddyg who is confused usually the case, if not confusing! I never turn those warnings off myself as they are indeed very helpful. I wanted to show the flexibility of the compiler. (It's probably better and quicker to global replace a with _a anyway) However, what the OP was comparing (for ...
by paddyg
Tue Oct 01, 2019 10:53 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 128
Views: 13154

Re: The Rust debate.

On my ubuntu i7 laptop, if I tell the compiler to ignore unused stuff (#[allow(dead_code)], #[allow(unused_variables)], #[allow(unused_assignments)], or simply call a _a) it takes 3.0s for 20k and 15.2s for 100k, also using cargo build --release interesting in a rather academic way but probably not ...
by paddyg
Mon Sep 30, 2019 11:17 am
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 226
Views: 40888

Re: Image viewer with transition between images

Hi @sapnho, Just tried a new buster SD and pi3d installed OK. Provisos: 1. I used the full fat 2019-07-10-raspbian-buster.zip and etcher 2. I started with the SD card in a RPi zero W but it took so long I unplugged it from the power and put the card into a RPi 3 3. I told it Not to do the first star...
by paddyg
Mon Sep 30, 2019 8:04 am
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 226
Views: 40888

Re: Image viewer with transition between images

Hi, I will have a go installing on a fresh latest buster as in case something has changed. It looks like the download and unpacking into the /tmp/ folder didn't work properly for some reason. Did they retry just the pip3 bit? On my (Ubuntu) laptop I find I have to use pip3 install xyz --user Instead...
by paddyg
Mon Sep 30, 2019 7:27 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 128
Views: 13154

Re: The Rust debate.

Gavinmc42 were you using the --offline option in cargo? I think that's a relatively recent feature so there might be quirks you need to Google round. I use vscode and do everything on my laptop (writing code that just works unaltered or cross compiles on different platforms or OSs seems a strong poi...
by paddyg
Sun Sep 29, 2019 11:04 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 128
Views: 13154

Re: The Rust debate.

I think there is an issue that Rust is hard to get to grips with. Personally I think it's worth it, but there were times over the first few weeks when it was very frustrating! The bounds checking is a case in point - It's easy to make a 2D array and iterate over it in such a way that the bounds need...
by paddyg
Sun Sep 29, 2019 10:20 pm
Forum: Python
Topic: Optimalization request for DMD
Replies: 2
Views: 228

Re: Optimalization request for DMD

I'm not sure I can really help but a quick and quite effective profiling technique is to CtrlC the program a few times and see where it spends most of its time. (or using cprofile is pretty easy)... It will most likely be in the tight loop inside spi_send for x in 0..4 for x in 0..row.size for i in ...
by paddyg
Sat Sep 28, 2019 11:26 pm
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 226
Views: 40888

Re: Image viewer with transition between images

@basm, in your modified code these are the places the images would be rotated: here the orientation is found from the exif data here you see that the returned file list is now a list of tuples which include orientation in the main loop here tex_load is called, the * splits the tuple into the two arg...
by paddyg
Sat Sep 28, 2019 10:04 pm
Forum: Advanced users
Topic: Midi control for PictureFrame.py
Replies: 1
Views: 157

Re: Midi control for PictureFrame.py

erik, I think I would make your midi reading code part of the PictureFrame program rather than trying to pass info between different running programs (which IMHO can be rather a minefield). I'm not sure how you are running your video sequences but you will have to coordinate that with the PictureFra...
by paddyg
Thu Sep 26, 2019 5:53 pm
Forum: General discussion
Topic: Image viewer with transition between images
Replies: 226
Views: 40888

Re: Image viewer with transition between images

Hi Thanks for that. I'm away from computer at the moment so can't do much to help. In the post with the diff, the revised version of the file is above it in full. Each section of the diff has the line numbers before and after the change. They're quite hard to read but maybe Google it. In a few days ...
by paddyg
Fri Sep 20, 2019 6:36 pm
Forum: Python
Topic: Send datas to an arduino with pySerial
Replies: 5
Views: 558

Re: Send datas to an arduino with pySerial

Hi, you say it worked ok when you typed the "1" in response to raw_input ? In that case maybe it's something to do with having a delay between starting the serial and writing the bytes? You could try putting in a time.sleep(1.0). The other thing is that the program looks to end straight away. Someti...

Go to advanced search