2,338 karma · joined November 9, 2012
Many students aren't going to learn by rote memorization of completing homework. It it helpful to support different learning styles.
A big problem with math education is that it's too abstract. It's hard to relate mathematical concepts to real life. "When are we going to use this?", people ask. Phrasing your questions in terms of real problems with a narrative can help students learn.
git discard bad-idea-didnt-work
Which creates a tag discarded-bad-idea-didnt-work, then resets back to the previous commit.I can still find and rescue the changes later by looking at my tags.
Others have suggested using the stash for this but I prefer to keep my stash stack free for shorter-term contexts, eg. if I'm halfway through something but need to go checkout another branch briefly.
-a, --all
Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.If only. In practice it's more like "They don't have a history of paying off their debts", which crucially means if you don't have a history of being in debt then you have no history of paying it off, and therefore you're considered high risk. Thus you get otherwise-nonsencial behaviours like taking out a loan only for the reason of paying it off.
I consider ubuntu completely unsuitable for server and cloud. I don't think there is any use case they are suitable for anymore. Which is definitely sad.
[1] https://en.wikipedia.org/wiki/Leo_Szilard [2] https://en.wikipedia.org/wiki/Einstein%E2%80%93Szil%C3%A1rd_...
* How their system architecture made them particularly vulnerable to this kind of issue
* Their actions to diagnose and attempt to mitigate the issue
* The whole later part about effectively cold-starting their entire infrastructure, all while millions of users were banging on their metaphorical door to start using the service again.
It sounds like it relies heavily on autocomplete, which means it's unlikely to be useful for coding instead of just English text.
> Unfortunately, as the ??? shows, the different output arrays have different lengths – a u16 would be 2 bytes and a u64 8 bytes – and so the Rust trait system at the time of this writing is (to my knowledge) not powerful enough to represent this trait as is.
It seems to me that this is possible using const generics. If you define your EndianBytes like this:
trait EndianBytes<const N: usize> {
fn be_bytes(self) -> [u8; N];
fn le_bytes(self) -> [u8; N];
}
Then provide a concrete length with each impl: impl EndianBytes<4> for u32 {
fn be_bytes(self) -> [u8; 4] {
self.to_be_bytes()
}
fn le_bytes(self) -> [u8; 4] {
self.to_le_bytes()
}
}
(I've renamed their methods to avoid conflicting with u32::to_be_bytes to make it easier to read)Then that allows you to use the EndianBytes type as long as you remain generic over both the value type and its length:
fn write<T: EndianBytes<N>, const N: usize>(val: T) {
println!("{:?}", val.be_bytes());
}
fn main() {
write(0x1234u16);
write(0x12345678u32);
}
This code (plus an impl for EndianBytes<2> for u16) works for me on 1.51 stable.EDIT: I thought about doing this with an associated constant, ie:
trait EndianBytes {
const LENGTH: usize;
fn be_bytes(self) -> [u8; Self::LENGTH];
fn le_bytes(self) -> [u8; Self::LENGTH];
}
However it turns out that this kind of usage is not quite supported yet: https://github.com/rust-lang/rust/issues/60551There have been several libraries that provide the concept of a promise, but with modern python these are built into the stdlib with native async/await support, though many interfaces are still sync-only (though you can work around that with things like gevent that monkey-patch those interfaces to work with an event loop under the hood).
I agree that python would be a poor fit for the kind of uses that JS in the browser usually serve, but it's really a matter of ecosystem, not core language design.
The standing of "actually none, but if you go to court to prove this you risk bankrupcy". Unless you have a major legal organization (like EFF) backing you (or you are a billionare), large corporations are essentially above the law when it comes to interacting with individuals.
I sometimes refer to this as "scar tissue" - an over-response to a trauma that causes ongoing issues more so than the initial injury.
There's also some stuff it adds, such as the swap instruction (swapping the upper and lower nibbles of a byte) and the stop instruction (puts the gameboy into a low-power state until it is woken by a keypress).
* ubuntu - Increasingly hostile to container usage (I tried to install a package recently, the install "succeeded" but at runtime the installed binary simply printed 'oh actually this is a stub, use snap instead' and exited), along with all the other downsides of debian (see below)
* debian - Very old packages if you're running a supported version. There's a ton of boilerplate to make apt behave itself in a container environment, something like "apt-get update && DEBIAN_FRONTEND=non-interactive apt-get install --assume-yes --no-install-recommends PACKAGE", compare to "apk --update add PACKAGE".
* distroless - More work to create and manage, can't install things ad-hoc in a running container for debugging purposes
As it is, I use debian and put up with the annoyances and need to occasionally install things from source to get a modern version. But there's really no good options. Alpine would be amazing, except I've hit too many problems with musl (though I'm sure it's not actually musl's fault). If someone was advertising "alpine but with glibc" and it actually WAS that (not "alpine with glibc tacked on top"), I'd use it in a heartbeat.
[(.number|tostring), .title] | join(" | ")
I would write: "\(.number) | \(.title)"
which IMO is more readable in cases where you have specific values you want to put in specific places, as opposed to a list of unknown length which you want joined (eg. I would still use join("\n") in your example).Efforts like youtube-dl are a constant arms race between google making changes that prevent it working, and the youtube-dl devs pushing fixes. It's a piece of software where "too old to be useful" is measured in months as tons of things don't work anymore.
These companies will never willingly give up control over the user experience (especially if they NEED that control in order to serve ads), and they'll use every method at their disposal in order to do so. Discord already threatens to ban anyone who tries to use a third party client - how long until twitter does the same?
Is this meant to be a medical document, or a legal one? If medical, then it shouldn't be allowed to be required for identification for privacy reasons. If legal, then why does it contain medical information at all?
As an example of the kinds of runaway increase in P and Q I'm talking about, consider calcuating the sum of x/(x+1) for values of x from 1 to 999, using python's fractions module:
>>> sum(Fraction(x)/(x+1) for x in range(1000))
Fraction(7075502361382798268120793110090229940258706389605508780354900641905867818691614397718938054011886551220308728288024788414601821895503124242001568659978565050184167864774563757893457200995977901194872761682228965032590045181707202517783731540396927542180527680245723964874429994374505238893797078720320991788231820649513569449454767125309918934132672543174716802507966087781714014833406311821646176291230132112749836042537756095388477483, 7128865274665093053166384155714272920668358861885893040452001991154324087581111499476444151913871586911717817019575256512980264067621009251465871004305131072686268143200196609974862745937188343705015434452523739745298963145674982128236956232823794011068809262317708861979540791247754558049326475737829923352751796735248042463638051137034331214781746850878453485678021888075373249921995672056932029099390891687487672697950931603520000)
That's a 436-digit P and a 433-digit Q.Rational types like this can definitely be a good choice in a use-case where accuracy is important, and operations do not compound. But they're a poor default, which is why we generally see float types as the most common non-integer number representation.