xoudini
Re:Show HN: Chard – simple async/await background tasks for Django
on Sunday September 11, 2022 @11:53AM (#32800686)
> without any external dependencies (i.e. no Redis/RabbitMQ)
You still depend on a database with the `Task` model. This would be a no-go for that reason, since there's no reasonable way to have an impact on its behaviour, outside of creating a custom database router to avoid having every third-party library hitting the same database as core logic.
If you absolutely must use a model, take a look at enumeration types[1] for a slightly "neater" way to declare choices.
[1]: https://docs.djangoproject.com/en/4.1/ref/models/fields/#enu...
Re:Researchers use tiny magnetic swirls to generate true random numbers
on Wednesday February 09, 2022 @08:10PM (#30281198)
I won't comment on whether it's a solved problem in general, as I don't actively follow the area very closely, but that particular QRNG has been shown to be more biased than /dev/urandom [0], and other QRNGs have exhibited similar issues.
Re:Starlink lost 40 satellites to a geomagnetic storm
on Tuesday February 08, 2022 @08:58PM (#30267689)
Link to anchor: https://www.spacex.com/updates/index.html#sl-geostrom (sic)
Re:Show HN: Never have an SSL certificate expire again
on Tuesday February 08, 2022 @02:45PM (#30263529)
Well, just letting it expire would certainly halt local development at <dayjob> until renewing. The primary reason for this is that some integrations require TLS for callbacks, so we have a local reverse proxy serving everything with TLS enabled. Hence, it's just more pragmatic to run the dev environment with TLS enabled all the time: no need to modify configurations and reset the browser cache when moving between a TLS and non-TLS setup.
I do get emails from the CA reminding me to renew a month or so before expiry, and the certificate hasn't been revoked as of yet, but it'd be useful to be alerted regarding the latter, were it to happen.
Re:Show HN: Never have an SSL certificate expire again
on Tuesday February 08, 2022 @01:56PM (#30262779)
That would be my exact use-case for a service like this: monitoring a domain I have pointing at localhost (and not only for expiry, but also for revocation). At least currently the demo check fails on trying on trying to establish a connection[0], although a valid certificate definitely exists[1].
Re:The Good and the Limitations of Github Copilot
on Monday July 05, 2021 @07:56AM (#27737013)
Well, to be fair, the `len` operation on lists in Python is a constant time operation. What makes the example particularly bad is using a cast on the result of a floating-point division, rather than just using Python 3 integer division (i.e. the `//` operator). Copilot was clearly just spitting out Python 2 code here.
Re:EFF sues Proctorio on behalf of student falsely DMCA'd
on Thursday April 22, 2021 @11:17AM (#26903693)
I'm not familiar with the software in question, but I'm quite sure it'd still be possible to have someone else to sit your exam. For instance, you could have an external webcam pointed at yourself, and have someone else in front of your computer writing the actual exam. Maybe even mirror the display so that you can see what your accomplice is doing.
Re:The Cursed Computer Iceberg Meme
on Sunday April 11, 2021 @08:34AM (#26769898)
Here's a (perhaps "unnecessarily clever") Python 3 version I wrote a while back, for some reason:
import functools
def fizzbuzz(n):
if not n % 3: yield (r := "fizz")
if not n % 5: yield (r := "buzz")
if not "r" in locals(): yield n
compose = lambda f, g: lambda *args: f(g(*args))
functions = "".join, functools.partial(map, str), fizzbuzz
transform = functools.reduce(compose, functions)
print("\n".join(map(transform, range(1, 100))))
Re:Commits are snapshots not diffs (2020)
on Friday April 09, 2021 @06:24AM (#26748726)
I can see this happening, but with a reasonable bug-tracking solution in place and enforcing `fix/...` branches for fixes, these situations could mostly be avoided.
Re:Commits are snapshots not diffs (2020)
on Thursday April 08, 2021 @05:04PM (#26743729)
Hm, you're right. The simplest example I could think of right now is the upstream having renamed/deleted something that the dev branch depends on, but didn't directly touch. That would definitely cause a "broken" history during the rebased commits, and is technically unavoidable.
Re:Commits are snapshots not diffs (2020)
on Thursday April 08, 2021 @04:04PM (#26743114)
In some cases I agree, but squashes can end up so large that doing a `git bisect` (which is quite useful in finding the comparatively small commit which introduced a bug) becomes unfeasible.
Re:Commits are snapshots not diffs (2020)
on Thursday April 08, 2021 @03:59PM (#26743060)
When you rebase, you basically replay the history of your branch since it diverged from the branch you're rebasing onto. Thus, the branch is always in a consistent state (or equally consistent to when you originally authored the commit you're replaying). And of course this assumes the target branch is already in a consistent state.
Re:Commits are snapshots not diffs (2020)
on Thursday April 08, 2021 @03:41PM (#26742844)
There shouldn't be an issue in doing so. During a rebase you'll either have no conflicts — in which case there isn't an issue — or you'll have to stop to resolve conflicts, and you might as well run tests before continuing the rebase. In both cases I'd argue that the statement "coherent set of atomic changes" applies.
Re:String length functions for single emoji characters evaluate to gre...
on Friday March 26, 2021 @01:00PM (#26594366)
In Swift 3 (and probably previous versions as well), `String.count` defaulted to the count of the Unicode scalar representation. In this version, iterating over a string would operate on each Unicode scalar, which often doesn't make sense due to the expected behaviour of extended grapheme clusters. So, this is my best guess why `String` in Swift 4 and later ended up with the current default behaviour.
Re:We created a fake language to root out resume liars
on Wednesday March 10, 2021 @09:29AM (#26411549)
I had a similar thought:
git init -q && git commit -q --allow-empty -m "Hello, World\!" && git show --format=%B | head -1