1,311 karma · joined Dec 19, 2020 (5y ago) · 495 submissions
comment 3y ago · link · parent
Relevant: https://xkcd.com/1988/
comment 3y ago · link · parent
> using the conditional-value ("ternary") operator in any capacity
Looks like author of some code I had to comb through recently, maybe had that among guidelines. Said code was replete with:
if(function_that_returns_boolean()){
return true;
}else{
return false;
}
...and... if(foo()){
return true;
}else{
if(bar()){
return true;
}else{
return false;
}
}comment 3y ago · link · parent
import html
print(html.unescape(foo))
And the best part - you don't need to debug/update the (g)sub list every time you stumble upon new weird &whatever; too. And there are a lot of those out there:comment 3y ago · link · parent
Micripython's "viper" just-in-time compiler. It can only be applied to one function at a time, restricts what you can do in such a JIT-ted function quite severely, but resulting speed is pretty much native:
https://docs.micropython.org/en/latest/reference/speed_pytho...
comment 3y ago · link · parent
It's really not that hard, once you get used to it. Or, if you rather not spend that precious time, there is a GUI tool that would configure those parameters for you:
Bonus: once started with virt-manager, run "ps ax | grep qemu", et voila - you have your qemu parameters, ready to copy-paste, should you wish to run exact same VM later from a script, or something...
comment 3y ago · link · parent
https://www.ultraedit.com/wp-content/uploads/2023/01/ue-img-...
comment 3y ago · link · parent
Number of defects vary. Chips coming from the same factory, even same batch, are likely to have different number of defects, and will be binned accordingly.
Devices with larger (but manageable) number of defects will simply have larger ECC region reserved - leaving smaller space to show to host computer. OP's new USB stick is like that, that's it, I reckon.