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

This does not seem very well tought out, gives off more of a frustrated teen vibe.

I wouldnt call the Munich one successful as in "nailed it". the shortcomings are many and increasingly visible


Everybody loves to complain about their own city, but compare it to US cities and its fine. I just listed a bunch of European cities that I have visited and seemed fine. My point is that if you want to 'learn' there are lots of places that you can take a look at.


But you get the Environment for free if you choose the ISA, so ISA=>ISA ecosystem. It really does matter when making a decision


I too fell victim to mistaking LoRa for LoRa


*really really bloody good. i would more broadly say knowledge base? I have yet to find a tool that has so little friction in storing/retrieving (Text+img based) ideas + Interoperability + Speed


Do you have a good way of storing and organizing images (and other media) in Obsidian? It's the one aspect where I've found its functionality wanting.


I am surprised to hear this, as the Obsidian functionality is the only out-of-box offering I find acceptable in a corporate environment. Other alternatives like notion, logseq, joplin all break my workflow in spite of their selling points, because they do not simply store or reference a file. Obsidian is easy for me because I simply drag and drop something like a pdf or recording, and even if it is not a readable file within the Obsidian view, a file copy is dumped to the attachments folder without altering any of the metadata and a simple path reference is inserted in the fancy-markdown document. You can configure different workspaces/settings to dump to different folders if needed, but I treat mine mostly as a dumping ground that I manage similar to a bucket. If I need to audit images I can simply look at the folder with another program.


I thought you can just embed images and other media [1]. They have to be stored in the attachments folder [2].

[1] https://help.obsidian.md/Linking+notes+and+files/Embed+files

[2] https://help.obsidian.md/Contributing+to+Obsidian/Style+guid...


iiuc, it's both. drag / paste an image into obsidian it will automatically be stored in your attachments folder (regardless of what note you're in) and a preview is placed in the note itself


That's not really my experience. It depends on your browser and configuration on how well this works. Firefox for example does not work, but chrome does. With Firefox it instead creates a broken <a>-link with nested <img>.


maybe that wasn't that good of an Idea either then? I would argue that this kind of interference is in every way problematic, especially when the outset goal is to erode trust in democratic institutions, which it is in this case.


Can you recommend any good write ups or articles for this topic?


AMD's "From vertex shader to mesh shader" [1] helps navigate between the older pipeline to the newer pipeline. Links in the sidebar get into other things like procedural geometry.

"Mesh Shaders and Meshlet Culling in Metal 3" [2] was also a good tutorial to learn about the mesh shading computation model.

I did most of my work in Metal. Apple WWDC's "Transform your geometry with Metal mesh shaders" [3] helped introduce it there. I liked playing with it in Swift -- this was a port of Apple's demos to Swift [4]. The Metal Shading Language manual also helps get your head around it. [5]

[1] https://gpuopen.com/learn/mesh_shaders/mesh_shaders-from_ver...

[2] https://metalbyexample.com/mesh-shaders/

[3] https://developer.apple.com/videos/play/wwdc2022/10162/

[4] https://github.com/jonmhobson/MeshShadersMetalSwift?tab=read...

[5] https://developer.apple.com/metal/Metal-Shading-Language-Spe...



thanks!


I use different languages for different purposes. Although bash euns everywhere, its a walking footgun and thus I only use it for small sub 100 line no or one option Scripts. the rest goes to one of Python, which nowadays runs almost everywhere, Julia or a compiled language for the larger stuff


If you just want to move some files around and do basic text substitution, turning to Python or another other "full fledged programming language" is a mistake. There is so much boiler plate involved just to do something simple like rename a file.


You mean

    import os
    os.rename(“src.txt”, “dest.txt”)

?


Yes. And it is only downhill from there.

Now, show us `mycommand | sed 's/ugly/beautiful/g' | awk -F: '{print $2,$4}' 1> something.report 2> err.log` in Python.


That looks like a snippet from a command session which is a perfectly great place to be using sh syntax.

If it became unwieldy you’d turn it into a script:

  #!/bin/sh

  beautify() {
    sed -e ‘
      s/ugly/beautiful/g
      …other stuff
    ‘
  }

  select() {
    awk ‘
      {print $2, $4}
      …other stuff
    ‘
  }

  mycommand | beautify | select
For me, now it’s starting to look like it could be safer to do these things in a real language.


I have a lot of scripts that started as me automating/documenting a manual process I would have executed interactively. The script format is more amenable to putting up guardrails. A few even did get complex enough that I either rewrote them from the ground up or translated them to a different language.

For me, the "line in the sand" is not so much whether something is "safer" in a different language. I often find this to be a bit of a straw-man that stands in for skill issues - though I won't argue that shell does have a deceptively higher barrier to entry. For me, it is whether or not I find myself wanting to write a more robust test suite, since that might be easier to accomplish with Ginkgo or pytest or `#include <yourFavorateTestLibrary.h>`.


Is it really so bad? A bit more verbose but also more readable, can be plenty short and sweet for me. I probably wouldn't even choose Python here myself and it's the kind of thing shell scripting is tailor-made for, but I'd at least be more comfortable maintaining or extending this version over that:

  from subprocess import Popen, PIPE

  CMD = ("printf", "x:hello:67:ugly!\nyy$:bye:5:ugly.\n")
  OUT = "something.report"
  ERR = "err.log"

  def beautify(str_bytes):
      return str_bytes.decode().replace("ugly", "beautiful")

  def filter(str, \*index):
      parts = str.split(":")
      return " ".join([parts[i-1] for i in index])

  with open(OUT, "w") as out, open(ERR, "w") as err:
      proc = Popen(CMD, stdout=PIPE, stderr=err)
      for line_bytes in proc.stdout:
        out.write(filter(beautify(line_bytes), 2, 4))
I would agree though if this is a one-off need where you have a specific dataset to chop up and aren't concerned with recreating or tweaking the process bash can likely get it done faster.

Edit: this is proving very difficult to format on mobile, sorry if it's not perfect.


In ruby you can just call out to the shell with backticks.

Like.

    myvar = `mycommand | sed 's/ugly/beautiful/g' | awk -F: '{print $2,$4}' 1> something.report 2> err.log`
That way, if something is easier in Ruby you do it in ruby, if something is easier in shell, you can just pull its output into a variable.. I avoid 99% of shell scripting this way.


That is fair...

But if all I need to do is generate the report I proposed...why would I embed that in a Ruby script (or a Python script, or a Perl script, etc.) when I could just use a bash script?


Bash scripts tend to grow to check on file presence, conditionally run commands based on the results of other commands, or loop through arrays. When it is a nice pipelined command, yes, bash is simpler, but once the script grows to have conditions, loops, and non-string data types, bash drifts into unreadability.


I don’t think it’s fair to compare a workflow that is designed for sed/awk. It’s about 10 lines of python to run my command and capture stdout/stderr - the benefit of which is that I can actually read it. What happens if you want to retry a line if it fails?


> I don’t think it’s fair to compare a workflow that is designed for sed/awk.

If your position is that we should not be writing bash but instead Python, then yes, it is absolutely fair.

> the benefit of which is that I can actually read it.

And you couldn't read the command pipeline I put together?

> What happens if you want to retry a line if it fails?

Put the thing you want to do in a function, execute it on a line, if the sub-shell returns a failure status, execute it again. It isn't like bash does not have if-statements or while-loops.


My point is that if you take a snippet designed to be terse in bash, it’s an unfair advantage to bash. There are dozens of countless examples in python which will show the opposite

> And you couldn't read the command pipeline I put together?

It took me multiple goes, but the equivalent in python I can understand in one go.

> Put the thing you want to do in a function, execute it on a line, if the sub-shell returns a failure status, execute it again. It isn't like bash does not have if-statements or while-loops.

But when you do that, it all of a sudden looks a lot more like the python code


Just ask chatgpt and you’ll get a script, probably makes some tests too if you ask for it.


I have not really been a fan of ChatGPT quality. But even if that were not an issue, it is kinda hard to ask ChatGPT to write a script and a test suite for something that falls under export control and/or ITAR, or even just plain old commercial restrictions.


import os

os.system('mycommand | sed 's/ugly/beautiful/g' | awk -F: '{print $2,$4}' 1> something.report 2> err.log')


You forgot to point out all those "footguns" you avoided by writing in Python rather than bash...


This has all of the purported problems of doing this directly in a shell language and zero advantages...


I think this take on history is a bit rough. Free markets are a fiction. Their ideal picture can only exist in a capitalist sense due to the force monopoly of the state. Otherwise, what is stopping me to shoot you to get your means of production? And is that really a free market, given that I skipped the laws of supply an demand by taking your life? So some governance is needed to keep things kind of orderly. Now the question becomes how much, but that is a political question.

As for your second point: One could indeed argue in turn that they were. In both countries WW2 was preceeded by extremely harsh economic conditions for most of the population, while industrialists prospered, leading to extremist voting shares previously unheard of. Big Industry in turn directly sponsored the NSDAP in many ways, big and small, to get them into power. Hitler especially preached terror to the masses and met with Krupp, Bormann et al. in the backrooms to talk policy. So the previous comment had a point, yours not so much I am afraid. one particular item of interest: https://en.wikipedia.org/wiki/Adolf_Hitler_Fund_of_German_Tr...


no, that is a terrible idea, and it is about scale and quality of life. First, there just is not the technology to do what you propose on Mars. The tech we have is limited to a few at absolutely astronomical costs and many many unknown unknowns. Second, life in a biosphere will not be able to compare to just living out in the open with (current+100Years) of Tech, Just think how much effort goes into infrastructure for people today, roads, bridges, water supply, electricity, and now imagine having to protect every kilometer from a hostile environment. Just extremely impractical.

Sure, a very select few rich people could survive this, but it just does not scale and is a pretty shitty life. There is no cost effective way around protecting earth's biosphere so that we all can continue to live here.


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

Search: