Hacker News new | past | comments | ask | show | jobs | submit | pgtan's comments login

Does someone have stock portfolio of superconductor manufacturer to share? I watch Furukawa, Sumitomo, and AMSC and they are performing not bad.


That article not even mention Bauhaus in Tel Aviv!

https://bauhaus-center.com/bauhaus-in-tel-aviv/


Well, POWER9 and later CPUs have builtin hardware compression using the 8-4-2 algorithm.

https://en.wikipedia.org/wiki/842_(compression_algorithm)

https://github.com/plauth/lib842


This bash code is a parade example how NOT to write scripts.


What would you change about it ? I'd be happy to learn how to write better code.


OK, for starter the while loop. Main rule of writing shell scripts is, Use The Shell, Luke. Don't start external programs, if your shell (which is already running) can do it. "while /usr/bin/true" is nonsense, every time an external program gets executed for nothing. There are plenty of bash (since this shell is used in the example) internals, which evaluate to true, like ":", "test 1", "(( 1 ))", maybe others too. So "while :" should be better. But why even use dummy true statement, since the loop terminates with read? You can put the read as argument to while directly: "while read -r line; do" ... Same with echo and date. Just use one single printf builtin.

while read -r line ; do printf '%(%FT%T%z)T %-9s %s' -1 "$(/usr/bin/id --user --name --real)" "$line" ; done


Thanks for the pointer about the useless use of true.

Using builtins may be a security risk as they can be overloaded (hence the use of full paths everywhere).

I did not know about bash's extension of printf to print a date. I need to use the builtin to use it though. But I've received good advice elsewhere on how to do that securely, so I'll do it and do a write-up because it's not information that's easy to come by.

Your advice is very helpful, thank you.


Bash and zsh both allow:

  function /usr/bin/cat { echo hello; }; 
  /usr/bin/cat
  hello
So specifying a path isn't as useful as it seems



Well, Kornshell (ksh93) has some nice programming features, much better than bash.


Yuliya Zdanovska, here in an old team picture:

https://euromaidanpress.com/2017/04/13/ukrainian-schoolgirls...


I for myself get annoyed every time I see this misspell. The name is X Window. Even microserfs can learn it.


1. Thank you for getting annoyed every time.

2. The name is not "X Window".

Citation: See the June 1988 "XNextEvent" newsletter, The Official Newsletter of XUG, the X User’s Group, "Things That Happen When You Say ‘X Windows’", for the definitive list of its official names, and the dire consequences of getting it wrong:

https://news.ycombinator.com/item?id=28522534


>microserfs

Cringing intensifies.


[edit] sorry, I've mistaken the concepts. The name is active memory deduplication, which sits on top on memory sharing.

http://www.redbooks.ibm.com/redpapers/pdfs/redp4827.pdf

[old]

It is called active memory sharing in the POWER world

https://www.ibm.com/docs/en/power9/9080-M9S?topic=sharing-ma...

http://www.redbooks.ibm.com/redpapers/pdfs/redp4470.pdf


This has nothing to do with Logo, the programming language. It's Python all the way down.


No, process substitution must be provided by the kernel/syslibs, it is not feature of bash. For example there is bash on AIX, but process substitution is not possible because the OS do not support it.


ksh93 depends exclusively on the kernel implementation of /dev/fd devices. I just checked `cat <(ls)` a moment ago on both Linux and AIX 7.2--the latter fails in ksh93t+.

Bash uses /dev/fd when available, but also appears to have an internal implementation which silently creates named pipes and cleans them up. In Bash 5.0.18 on AIX, fake process substitution works just fine, in my testing.


Yes, you are right. Bash 5 on AIX 7.2 works with process substitution. Thanks for the advise!


Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: