Better HN
topnewbestaskshowjobs
Log inSign up

nousermane

1,311 karma · joined Dec 19, 2020 (5y ago) · 495 submissions

Submissions

comment 3y ago · link · parent

Yep. If you go and register a new gmail account today, there will likely be no option to enable IMAP access for that account, altogether.

comment 3y ago · link · parent

> glue together some massively bloated thing that they have absolutely no understanding of

Relevant: https://xkcd.com/1988/

comment 3y ago · link · parent

> writing "return condition" instead of "if condition then return true else return false end"

> 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

With newer android versions, you might want to check the "disable adb authorization timeout" option too. Otherwise, phone will "forget" your computer's adb key after a week.

comment 3y ago · link · parent

That is quite nifty implementation of reverse HTML escaping. But in python that could be done with much less work:

  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:

https://www.freeformatter.com/html-entities.html

comment 3y ago · link · parent

Hug of death from HN visitors.

For fellow website admins, this is your regular reminder to use static site generators, where possible, and server-side cache where not.

comment 3y ago · link · parent

Yep:

  $ cat foo.tsv

  name    foo     bar
  Alice   10      8888
  Bob     20      9999

  $ cat foo.tsv | sqlite3 -batch \
    -cmd ".mode tabs" \
    -cmd ".import /dev/stdin x" \
    -cmd "select foo from x where bar > 9000;"

  20

comment 3y ago · link · parent

Talking about tricks to make python faster, there is an interesting one that is essentially exact polar opposite of what Nuitka does:

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

> tried qemu, and spent many days trying to figure out the correct set of parameters

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:

https://virt-manager.org/

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

To search very long texts by the "text shape". Same idea as some popular editors show on the right, next to the scrollbar:

https://www.ultraedit.com/wp-content/uploads/2023/01/ue-img-...

comment 3y ago · link · parent

Unlike RAM, where you always get exact power-of-2 number of bits per chip, modern flash storage normally ships with defects, plus error-correction codes to deal with those.

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.

12345
17