Better HN
topnewbestaskshowjobs
Log inSign up

shangxiao

694 karma · joined Jun 17, 2013 (13y ago) · 262 submissions

Submissions

1.

Common Postgres Row-Level-Security Footguns(bytebase.com ↗)

1 points · by shangxiao · 1y ago · discuss

comment 3y ago · link · parent

You don't have to use VimScript, you can write your Vim plugins in Python if you wish.

comment 3y ago · link · parent

I was also surprised the first time I heard you can safely burn explosives: I was reading some comments on the Vietnam war from veterans talking about how they used to heat their meals by burning pieces of C4.

comment 3y ago · link · parent

> It is funny people can't envision things breaking...

This is what enraged me about the Therac-25 design which ended up killing people. There's a whole report to read on the design, failure and follow up but to paraphrase the designers eliminated the physical locking mechanism and had this attitude that "oh it's electronic so it won't wear out and fail".

comment 4y ago · link · parent

Incidentally most of them _are_ focusable by the keyboard but just aren't tabbable.

I'm using a Chrome plugin Vimium - one of the shortcuts 'f' (documented as opening links) actually highlights all focusable elements. Using this feature shows most of the checkboxes are interactive.

Edit: I guess the reason for me pointing this out is hopefully there's an easy way to make these more accessible for keyboard users.

comment 5y ago · link · parent

"Good practice" is also common in English. When folks use the term "Best Practice" I often ask them whether they in fact mean the former.

comment 5y ago · link · parent

Couldn't be further from the truth, see my reply.

comment 5y ago · link · parent

Typer looks neat. I don't think it was well-established when I started on this, there were quite a few offerings but the only one I managed to find was python-fire. It didn't quite do what my team wanted and there were a few behaviours that we didn't quite like so we decided to make this.

Having said that bargeparse was meant to rely solely on stdlib as the environment we were operating in was tightly controlled and any 3rd party packages had to go through a lengthy review process to be whitelisted.

Additionally, since our team (and others in our organisation) were mostly using argparse, the goal was to provide a way to declaratively interact with it using existing features in the language itself.

comment 5y ago · link · parent

I don't have a startup but I did make a useful little Python library while at my previous job to help ease the pain with using argparse to make CLIs.

It's called bargeparse [1]. The idea is to define an entry point function and use its signature as a means to declare the CLI arguments & options. I was surprised at how well Python's syntax for function arguments works for this... especially the use of pos-only & keyword-only arguments to force a particular style.

[1] https://github.com/shangxiao/bargeparse

comment 5y ago · link · parent

Mainstream news outlets have been caught doing this. Australian ABC News (government funded) deceptively edited a Navy ceremony that showed the Governor-General & Navy Chief ogling over young women twerking [1]

[1] https://www.theguardian.com/media/2021/apr/15/australian-nav...

comment 6y ago · link · parent

Nice!

Slight nitpick: Django should automatically create the Hstore extension for you [1] during migrate whenever you use a HStoreField

[1] https://github.com/django/django/blob/f5e07601b233a50e6bcca4...

Edit: I might've been mistaken here in thinking the above migration operation was automatically applied as the docs seem to suggest you need to add it yourself [2] but at least it's as easy as adding an operation ;)

[2] https://docs.djangoproject.com/en/3.1/ref/contrib/postgres/f...

comment 6y ago · link · parent

I'm quietly hoping they'll ask him to work on a typescript-style of project that adds static typing as a layer on top of Python :)

comment 6y ago · link · parent

"Professional use" just means to use in your profession, not that they are claiming to be an IT expert.

comment 7y ago · link · parent

I feel like we're just transferring the labour from ops to dev though. Where I work we still haven't got as good a development workflow with lambdas as we did with our monolith (Django).

comment 7y ago · link · parent

What about future Microsoft? :)

comment 8y ago · link · parent

yeah nah…

comment 8y ago · link · parent

I'm curious to know what it is about each of the strings that makes it naughty. A comment next to each one describing what it's supposed to be testing would be great.

comment 8y ago · link · parent

Yes, that's correct. At 300km, Steve would be situated within the thermosphere [1]

> The highly diluted gas in this layer can reach 2,500 °C (4,530 °F) during the day. Even though the temperature is so high, one would not feel warm in the thermosphere, because it is so near vacuum that there is not enough contact with the few atoms of gas to transfer much heat.

[1] https://en.wikipedia.org/wiki/Thermosphere

Edit: typo

comment 8y ago · link · parent

ORMs are good for 90% of your use cases, the rest I'm happy to use SQL for.

I could attempt to deconstruct the ORM problem, but Martin Fowler had a nice article [1] on replying to "ORM hate" a few years back which is worth the read for folks that question the usefulness of ORMs (and I believe questioning things is a healthy thing to do!)

[1] https://martinfowler.com/bliki/OrmHate.html

20.

HAVING a Blunderful Time (or Wish You Were WHERE) (2007)(dcs.warwick.ac.uk ↗)

31 points · by shangxiao · 8y ago · 6 comments

comment 8y ago · link · parent

She actually had another crack at it where it looked as though she studied the lyrics harder as she does quite a good job

[1] https://www.youtube.com/watch?v=uEbV5M59Xc8

comment 8y ago · link · parent

Nobody is downvoting to win a petty fight. It just looks like you haven't understood the thread of the conversation and are trying to argue about something when there is no argument.

I wouldn't take it personally.

comment 8y ago · link · parent

This is a bit easier to grok: http://www.timescale.com/how-it-works

(if you're new to this like me)

comment 8y ago · link · parent

According to Merriam-Webster [1] "rackless" is a variant of "reckless".

[1] https://www.merriam-webster.com/dictionary/rackless

comment 8y ago · link · parent

I was rated as 71% US ;) I wonder if the various accents of Australia rate differently or whether I'm influenced too much by foreign media.

comment 8y ago · link · parent

Philip DeFranco has analysed this well and covered this in several videos, the latest being [1]. I agree with his analysis that the problem here is YT itself, not the content creators. I personally believe this latest development makes Logan Paul somewhat of a scapegoat, especially since his video apology [2] was one of the most sincere public apologies I've seen.

[1] https://www.youtube.com/watch?v=C-ePy-2WLfY

[2] https://www.youtube.com/watch?v=QwZT7T-TXT0

comment 9y ago · link · parent

I find this to be a legitimate question. At least in my country all news outlets have a political bias one way or another, including those run by the government itself.

Is there something about NY times (I don't read it) that warrants a downvote on OP's comment?

comment 9y ago · link · parent

I was thinking exactly this as I was going through those examples.

comment 9y ago · link · parent

I love the fact that IRC is still alive and kicking. The #django channel on freenode is still pretty active as opposed other communities that flock to slack or gitter.
12345
9