gnosek
Joined 12 years ago
Joined 12 years ago
This looks like infinity times better than Ansible in some cases and somewhat worse in others (python.call every time I'd need to access a previous operation's result feels clunky, though I certainly understand why it works that way).
Do you think it would be possible to use Ansible modules as pyinfra operations? As in, for example:
- name: install foo
apt:
pkg: foo
state: present
could be available as: from pyinfra import ansible
ansible(name='install foo').apt(pkg='foo', state='present')
where the `ansible` function itself would know nothing about apt, just forward everything to the Ansible module.Note 1: I know pyinfra has a way to interface with apt, this is just an example :) Note 2: It's just my curiosity, my sysadmin days are long gone now.
If so, IMO they're the best thing that happened to roundabout design ever. You do need to choose a lane before entering but it's similar to how you'd choose a lane on a traditional two-lane roundabout. However, then you don't change lanes while on the roundabout, with ~zero visibility to the other lane while turning in a fairly tight circle.
This may differ across countries but around here you're supposed to: * pick the inner lane unless you're taking the first exit (to the right) * change to the outer lane just before your exit
which is about infinity times more stressful in traffic (you have very little time, it's hard to see the outer lane and the outer lane has right of way). It would work fine if everybody followed the rules but 1. they don't since it's unsafe in a tragedy of the commons sort of way and 2. then you end up with an informal turbo roundabout anyway.
A compromise that's becoming fairly common is a "soft" turbo roundabout where the lanes are divided not by ridges but by solid lines you can't cross only legally, not physically :)
Only in some fairly esoteric environments: https://en.wikipedia.org/wiki/Filename#Comparison_of_filenam...
cat > outputfilename.txt
fn twiddle<I>(foozles: I)
where
I: Iterator<Item=Foozle>
(or probably IntoIterator<Item=Foozle>). `impl T` is (modulo some details I don't remember right now) just syntactic sugar for this.What I find fascinating about Slavic languages is that I can speak Polish in Slovakia*, get responses in Slovak and mostly understand each other. It has basically zero chance of success in the Czech Republic to the point where it's easier to find an English speaker. I speak neither Czech nor Slovak and I cannot really distinguish them but I had this experience multiple times. In written form, both are similarly understandable to me (I can get the gist and guess the rest).
* the caveat about szukanie czegoś do picia still applies though.
Exactly. This will generally be application specific so we can't choose The One Right Definition for adding `Option<i32>`s.
> Yours make sense if it means "zero", but that's far less useful.
Not in my experience but I agree there are different situations. Personally, I'd default to `Option<i32>::None` meaning "no number there, so just skip it"[1] and prefer `Result<i32, E>::Err` to denote "there should be a number here but we don't have one", which would behave like a SQL NULL (propagate in all calculations).
1. What's the length of data in a header-only packet? I wouldn't say it's zero, especially when trying to fit a read() like API on top of a framed protocol (read() returning Ok(0) marks the end of file).
> > We can’t perform arithmetic on an Option<int> any more than we could on a List<int>.
> Why not? One sensible definition is (...)
It's not the only sensible definition. It would be equally sensible to implement it as:
Some(x) + Some(y) => Some(x+y)
Some(x) + None => Some(x)
None + Some(y) => Some(y)
None + None => None println!("hello, world");
or todo!();
are macro invocations.Two? https://developer.android.com/reference/java/net/URLConnecti...