Hacker Newsnew | past | comments | ask | show | jobs | submit | nurpax's commentslogin

The same can happen with C malloc/free too.


AR?


The grandparent likely means Augmented Reality; they may be imagining a strange world where you wear glasses that filter ads out of your vision, and yet those ads are on a computer screen you view rather than right there in the headset being projected onto your eyes.


AR seems like a gimmick/fad. I think we’re more likely to see eyeball scanning ads/AI ala Minority Report instead.

Hello, Mr. Yakamoto! Welcome back to The Gap…


Shut up and take my money


Augmented Reality? The semi-real-world version of VR?


Augmented reality


It’s not just you. Python seems to suffer from Python-specific ”tutorial sites” being SEO’d above Python’s official docs. I don’t know what it is about the Python documentation that lowers its rank on Google search results. In general, not a big fan of Python docs.


JS has / had the same problem, which is why a common tip is to add "MDN" to the keywords to get a higher quality reference style result from MDN: https://developer.mozilla.org/


I wish there was an MDN for Python/Julia.


This field contains the worker-specific seed:

    torch.utils.data.get_worker_info().seed
So I guess something like the below (untested!) could work too:

   worker_init_fn=lambda id: np.random.seed(torch.utils.data.get_worker_info().seed)


Yup, especially as you often need to access dict's with foo["field"] and you get a syntax error if the f-strings is also f"". JavaScript backtick syntax doesn't lead to this extra syntactic friction.


You can use any of

    f"{foo['field']}"
    f'{foo["field"]}'
    f"""{foo["field"]}"""
(I see from your carefully worded first sentence that you already knew this but still find it annoying, but I'll leave this here for any that aren't aware.)


Yes, and anyone who has written a "one-liner" at the command line is familiar with it. Wouldn't say it is a big problem.


The problem with this is when you run it through a formatter that changes all ' to ".


Sounds like a bug in your formatter, if it's meant to just do formatting but actually replaces valid syntax with invalid.


I don't totally disagree. My company uses the black formatter, which does this[0]. There are flags to skip string formatting, but is frowned upon at my organization.

[0] https://github.com/psf/black/blob/master/docs/the_black_code...


For what it's worth, black appears to do a reasonable thing and preserves the semantics of your quoted strings (as is promised by the documentation):

  $ echo "'foo'" | black -
  "foo"
  
  $ echo "'foo[\"bar\"]'" | black -
  'foo["bar"]'

  $ echo "'foo[\"bar\"]+\\'baz\\''" | black -
  "foo[\"bar\"]+'baz'"


This is because of how f-strings were initially implemented: I piggy-backed them off of "regular" strings, then post-parsed inside that string. But the restriction is that the entire f-string (after the f) needs to be a valid regular Python string.

Since this:

"this is a "regular" string"

isn't valid, then neither is this:

f"dict lookup: {d["key"]}"

However, we've talked about changing f-string parsing from a "post-process regular strings" mode, to instead having the tokenizer and parser themselves aware of f-strings. When we do that, the f-string example above will work.

(edit for formatting)


I'm surprised it works like that in Python. C# has similar interpolated strings but there it's legal to embed quotation marks within the curly brackets. Though I guess it's less necessary in Python since you can just use the other type of quote inside.


This is easily avoidable in python by using single quotes for the outer string and double quotes for the inner string, or vice versa. Or, use triple quotes for the outer string.


Yeah, if you get to the level of nesting where having available quotes is an issue, you really need to break it up into multiple expressions.


It can feel annoying sometimes, but it's also nice that it prevents you from getting overly complicated with your string interpolations. Human readability is highly valued in Python culture, and things start getting hard for humans to quickly parse when you allow arbitrarily complex interpolation expressions. Assigning your complicated expression to a well-named variable first will usually make your code more readable, even if it's slightly more verbose.


Inline images would be great too (bitmap or svg). There’d be a lot less need for something like jupyter if you could show images in the shell.


This was an interesting Twitter thread about Encrochat: https://twitter.com/josephfcox/status/1278638671416168450?s=...


Looking forward to trying out Linear. I'd really love to use a tool with good performance and offline support! Your website looks slick and lovely too.

Alas, the e-mail sign up seems to take a while to send the registration link e-mail. When I got the e-mail after maybe 5-10 minutes of waiting, the sign up link had already expired. :( It says "Verification code expired. Please request a new one." I did, but the same thing happened.


Sorry about that! It should work now.

We had some issues (and wondering if Gmail is having issues) with emails today. We rolled a fix that increased token expiration and currently looking our email provider if there are things we can do to speed it up.


I think it's Gmail having issues since our login emails sent to Gmail and GSuite arrived late as well. It's been like 7-10min delay, even though our mail delivery system said that the email was delivered.


The download page says only macOS is currently supported. Electron supports Windows and Linux quite well - any ETA on when you will be adding these platforms?


We are working on this. We have some test build, but each platform adds bit complexity to the build process so looking to automate better first.

All Linear features, including the offline mode works on the browser tool.


I’d like to think so too. It’s hard to actually understand how Docker works by reading their documentation.

Everything looks so simple.. and it magically runs on macOS and Windows too. No wonder people think it’s some sort of a VM.


Technically, containers running on MacOS and Windows are a (Linux) VM, under the hood. Now, Microsoft put in a lot of work to support something like namespaces in the Windows kernel, so that it's now possible to run "Windows-native containers" for Windows software. But both Windows and MacOS still use a Linux VM under the hood to run Linux containers. That being said, I'm not familiar with the details of Windows containers because I don't use any Windows software and therefore don't have a reason to run any Windows containers. If you are interested in how containers work at a lower level, you might get more out of the documentation for containerd and runc, which are the underlying container runtimes.


> No wonder people think it’s some sort of a VM.

From what I read, if one packages a Linux container for Windows, Docker does then run it in HyperV?

https://stackoverflow.com/questions/52164563/what-is-the-doc...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: