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

> But a lot of UK housing relies on on-street parking, and there's flats with car parks where charging isn't currently practical.

You forget the larger problem less wealthy individuals face: They typically already own a ICE-car and can‘t afford to purchase a new car multiple times in their lives.


The used car market should solve that eventually - so long as battery longevity is there. A reasonably maintained ICE car can last 20+ years of low mileage use. We need battery packs that last that long, or that are modular and replaceable for a reasonable price.

Since sand is a non-renewable resource that is needed for construction, there’s a lot of illegal activity going on.

In India, illegal sand mining is the country's largest organized criminal activity.

https://en.wikipedia.org/wiki/Sand_theft

https://en.wikipedia.org/wiki/Illegal_sand_trade


This was part of the plot of an Elementary (modern-day Sherlock Holmes in NYC with Jonny Lee Miller & Lucy Liu) episode called Sand Trap.

https://cbselementary.fandom.com/wiki/Sand_Trap#Plot


Importing construction sand was a plot in the HBO series Barry as well.

Just our luck that desert sand doesn’t work for this because we have essentially endless amounts of it. Instead people are destroying pristine river banks.

Would the single sentence „Imagine you are a regular computer player and accustomed to the usual elements of games“ count as a harness?

My header on top of every script

            #!/usr/bin/env bash
            set -eEuo pipefail
            # shellcheck disable=SC2034
            DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
            #######################################################

If you're using `set -e` you almost always want a trap on ERR to print where you suddenly exited from your program. Otherwise there's no way to tell.

Also worth mentioning, but not including permanently, is `set -x` which will print every command to stderr with a `+ ` prefix before running it.

For `DIR` I usually pick a name less likely to conflict with one randomly selected in my script, like `SCRIPT_DIR`.

You also need to think about symlinks and how you want to handle them. Your current `DIR` resolution gives you the directory name without any symlinks resolved. If you're possibly a script that got symlinked to by someone, this may not be the directory of your actual script anymore, but the directory containing the symlink. As long as you want that it's fine, but a lot of the time you want the script to see it's resolved folder so it can call scripts in the real folder with it instead


Wait... Most of my shell scripts have zero unused variables: I prefer to comment them if I may need them later on.

Why do you disable SC2034?

I don't think not having unused variables prevent me from doing things in my scripts!?

I understand if it's a preference but SC2034 is basically one of my biggest timesavers: in my case unused variables are typically a bug. Except, maybe, ANSI coloring variables at the top of the script.


It depends too on whether you use shellcheck as a primary tool or not. I prefer to have no shellcheck errors/warnings by default so when they do appear it's very obvious. But having a consistent opening block on a bunch of scripts is often more important, so setting a shellcheck disable on that one variable that may or may not be used is a better solution.

I disable it only for the DIR variable which I might not use.

I'd suggest `pwd -P` to resolve symlinks too. (if you use DIR to call/source neighbouring scripts).

Certificate/key renewal was a mess in every enterprise environment I worked in.

My suspicion is that corporations in general don‘t handle tasks well that need to follow an exact timeline and can‘t be postponed by a week or two.


The real fun starts when you have to do an unscheduled renewal!

Companies are generally able to develop a workable process around regularly-scheduled tasks. If you can't, you'll quickly run into trouble due to late salary payouts or missed tax filing deadlines. They'll rapidly accumulate a thick layer of bureaucracy around it, but as long as it gets exercised regularly it'll remain more-or-less functional.

Try the same with PKI and you'll run into massive issues during mass revocation events. Having a renewal process which takes 2 months and involves dozens of stakeholders is totally fine for a cert which gets renewed every 12 months on a well-known date - but not when you're working with a 72-hour deadline...


As well as having; proper documented (and tested) procedures and appropriate level of staffing/staff availability (not overburdened by juggling too many tasks and projects) - AND... keeping staff over several period/activity cycles, so they have actual experience performing the ongoing maintenance activities required. Oh - and heck, even a master calendar of "events" which need to be acted on, with - ya'know reminders and things...

Yeah - I have almost never seen any corporate or government environment actually take a "forward-thinking" approach to any of the above...


> a lot of real world performance comes down to how efficiently you are calling external services (including the database)

Apart from that my experience over the last 20 years was that a lot of performance is lost because of memory allocation (in GCed languages like Java or JavaScript). Removing allocation in hot loops really goes a long way and leads to 10 or 100 fold runtime improvements.


This has been the key for me as well, memory allocation in hot paths is usually the first optimization that I look for. It's quite surprising to see how far very inefficient algorithms (time complexity wise) can go as long as no allocations are made.

This applies to non-GC languages as well. Memory management is slow. Even with manual memory management I have been able to dramatically speed up code simply by modifying how memory is allocated.

Parts of the GC language crowd in particular have come to hold some false optimistic beliefs about how well a GC can handle allocations. Also, Java and C# can sneak in silly heap allocations in the wrong places (e.g. autoboxing). So there is a tendency for programs to overload the GC with avoidable work.


> Parts of the GC language crowd in particular have come to hold some false optimistic beliefs about how well a GC can handle allocations.

Yep, the idea is "we've made allocations fast, so allocate away!". But that's a trap — every allocation puts pressure on the GC, no matter how fast you've made the very act of allocating. It's a terrible mindset to encourage the users of your language to have.

Then there's the more insidious problem — to make allocations fast you must have traded something off, like GC throughput. So now your GC is slower and encourages programmers to allocate, which makes it even slower.


Autoboxing is more a Java problem mainly because of type erasure with generics. C# has "proper" generics and no hidden boxing is occuring there.

That and also the JVM is a marvel of engineering with millions of hours that were poured in by smart people over the last 30 years.

It can be as fast a C, supports a multitude of languages, introspection, surveillance etc.


JFR is one of my favorite things about the JVM. Such good tooling to figure out whatever it is you are having problems with in production.

I've also used Eclipse MAT to find tricky dangling references to objects that caused memory leaks. Definitely not as polished, but extremely useful.


I agree JFR is amazing.

Also that you can start it on a running JVM and it that is has minimal ~1% performance overhead.


My guess is that some cell in an excel sheet says that some customers bought certain models in the past and no manager at Dell has enough weight or enough courage to question that and rule to NOT release a certain model.


I have been alone for quite some time in my life, for various reasons.

Here is my advice

1. Don’t listen to people telling you that there‘s something wrong with you if you aren’t happy alone and that you need therapy. You probably don‘t.

If you aren’t able to survive a single day on your own, then you have an issue, but in general people are social animals and need talking to and touching other people on a regular basis to regulate themselves emotionally. Some don’t, but you don‘t seem to be one of them. (In my experience people who honestly enjoy being alone for weeks at end often got used to this in their childhood, for example by being single children. If you had a noisy, lively house when growing up you will always miss that.)

2. That being said it is still nourishing and useful to follow the tips for spending time on your own (cooking for yourself, going into the cinema) now and then. But don‘t expect it to magically fix your yearning for social connections.

3. Doing sports and going to the gym often is great advice, because sports generally gives you a more positive mood and a better outlook and it quiets down negative thoughts. But also keep in mind here that it will not replace social interactions and touch.

4. So the question remains where you get your social interaction from, and I suggest that you replace the single person you had with a lot of tiny social interactions.

None of those is going to fix your solitude on it’s own, but the mixture will enrich your life. If you do all of those things once per week, your mood will improve:

- Online dating and chatting with friends (but don’t expect anything to come out of it)

- Dancing classes (this is especially great because you get the physical touch component)

- Regular coffee/dinner dates (1-2 per week) with a friend, coworker or relative.

- Going for a walk and talking to a random stranger

- Singing in a choir or similar hobbies

- Going to pubquizzes or free to join community walks

- Commuting to the office instead of doing home office.

5. I won‘t argue against your psychiatrist, but I find that medication is only useful in a minority of cases. Both anti depressants and anti anxiety meds can actually reduce your motivation to go out, by mellowing you into a not-great-not-terrible dreamy state.

6. Don‘t start rummaging and contemplating your thoughts when you are lonely. Being lonely makes you weird: https://arstechnica.com/science/2023/07/lonely-people-see-th...


I once digged into this database out of curiosity and found incredibly detailed research on many edge cases. Like time zones in Germany being temporarily aligned to Moscow during soviet occupancy after World War Two.

One particular commenter stood out to me, so I looked him up because I was interested which kind of people spend so much time correcting timezone information.

Turns out he was an astrologer and wanted his astrology-program to work perfectly correct.

I find it funny that we have to thank astrology for the correct calculations in our banking software :).


On the other hand, it was also astrologers that made copyright claims on the database and caused it to become unavailable to the world for a short period of time.


It were not astrologers, it was a company that creates astrology software.. Don't mix people with companies, they are different things! One is there definitely for the money, the other may or may not..


I didn’t see that in the blog post!

I was curious and found more info here: https://www.computerworld.com/article/1548822/astrolabe-with...


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

Search: