Better HN
topnewbestaskshowjobs
Log inSign up

bArray

7,485 karma · joined Mar 14, 2016 (10y ago) · 2,314 submissions

Why jump in one pond when you can dip your foot in many?
Submissions

comment 4y ago · link · parent

> 4. Many school problems are caused by disruptive children.

> Disruptive children are caused by parents who frankly just don’t give a shit. Throwing more money into schools won’t ever fix this problem.

Some. Most children I believe require an approach that the education system cannot adequately provide (for numerous reasons). Children are relatively malleable and in the right environment will thrive.

comment 4y ago · link · parent

If everybody sailed their parcels across the Sea, we'd avoid 4.5% of global emissions [1].

[1] https://www.theguardian.com/environment/2008/feb/13/climatec...

comment 4y ago · link · parent

I think this will be the way towards general intelligence, multiple decentralized 'brains' working together. For example, you may have something that processes vision, something that does task planning, something that does motion planning, something that processes audio, etc.

One day we will bring these parts together into single systems, but for now it's much easier to train and test these independent 'brains' until we figure out a proper architecture. There are quite a few different things we need to answer, for example, can motion planning and motions be de-coupled? Can vision detection be de-coupled from object classification? Can hearing be de-coupled from vocalization?

comment 4y ago · link · parent

As @pseudobry mentions: 'the book uses GDP as a "human welfare" metric'.

I don't think anybody here (even the author of the book presumably) is suggesting that they are cause and effect, but they do appear to be correlated.

Also just because 50% have 1% of the wealth, doesn't mean they don't contribute towards the wealth of the other 50% of people holding 99% of the wealth. For example, your boss gets the majority of the profit, but they couldn't run the company by themselves.

comment 4y ago · link · parent

As others have commented, $14.5 trillion USD (even with inflation) is nothing compared to the US's current outgoings.

What I _never_ see costed is the other side - what negative cost will the climate policies have on GDP? I imagine that number to be far greater.

For example: Great, you increased fuel tax and got less people driving. Now people can't get to work, deliveries are now too costly, the cost of living increases because even basic items like food need to be transported to the store, with costs given directly to the consumer.

The single most concerning thing is that no politician appears to be doing these calculations. There is no open discussion about viable climate policies that don't crush the middle and working class into poverty.

comment 4y ago · link · parent

Thank you! This is really awesome!

I'm trying to figure out if the Ladybird version tracks the SerenityOS version: https://github.com/SerenityOS/serenity/tree/master/Userland/...

comment 4y ago · link · parent

It's a shame it didn't get more eyes at time, this is super cool!

comment 4y ago · link · parent

> The real problem is that nearly all website render terribly. It just can't keep up with the complexity that it the modern web. It's a real shame.

I was thinking since quite a while now to write a wrapper around the Serenity OS browser [1] that supports JS, CSS and WASM, and passes ACID 3 tests [2].

I did have a quick look at the source, but couldn't think of a nice way to wrap it as it's quite closely tied to the Serenity OS GUI.

[1] https://github.com/SerenityOS/serenity/tree/master/Userland/...

[2] https://lunduke.substack.com/p/serenityos-web-browser-passes...

comment 4y ago · link · parent

Hence why I wrote "For an ultra simple hash table". I think that for C that doesn't natively have such a data structure, a couple of lines to introduce such a structure really isn't too bad.

comment 4y ago · link · parent

Key collisions are of course a problem. This is a quick and dirty implementation. If you care about checking for collisions, you could instead have:

    typedef struct{ char* k; char* v; } KV;
    int L = <table length>; // Large enough to reduce collisions
    KV* t = (KV*)malloc(L * sizeof(KV));
    memset(t, 0, L * sizeof(KV)); // Set it all to empty by default
Then:

    /* Put example (detect collisions) */
    char* k;
    if(t[H(k) % L] == NULL || strcmp(t[H(k) % L].k, k) == 0)
      t[H(k) % L] = "value string";
    else
      printf("Collision\n"); // Handle as you like
Of course this can get more and more advanced. The point wasn't to make a zero-collision table, it was just something that could be used quickly.

comment 4y ago · link · parent

> I genuinely applaud any file format that can be diffed, but skidl seems like an absolutely painful way to develop a circuit - [..]

It depends what your background is. For example, to wire up a header to an ATmega328, I wrote this:

    micro = Part("MCU_Microchip_ATmega", "ATmega328-A")
    micro.footprint = "TQFP-32_7x7mm_P0.8mm"
    u_head = Part("Connector", "Conn_01x32_Male")
    u_head.footprint = "PinHeader_1x32_P2.00mm_Vertical"
    for x in range(32) :
       micro[x + 1] += u_head[x + 1]
Suddenly you see how powerful it can be when you programmatically hook things up together.

> [..] unless you already have a schematic (which seems redundant).

It can also output schematics. So you're just working on the skidl Python file.

> Freerouting seems like a good way to iterate quick solutions to routing approaches, but obviously has a lot of limitations.

Of course, I personally wouldn't use it for a high-speed bus or radio circuit, but otherwise it is quite reasonable.

comment 4y ago · link · parent

Sure, some parts are obviously a manual process and hard to automate. But this is about automating the parts than can be automated.

It would be like suggesting that there is no point having LaTeX perform typesetting because the research takes so long anyway and you like typesetting your documents. I personally would rather spend that time doing something else and let the machine get on with it.

comment 4y ago · link · parent

> I'm definitely curious.

I'll see what I can do to write it up.

> As a software guy who occasionally does a test or automation fixture, I find the workflow of most EDAs a bit strange. It seems to actively discourage reuse.

Being able to re-use Python code sections is obviously quite cool.

I don't yet have a good solution to footprints, but slowly but surely getting there with the tooling.

comment 4y ago · link · parent

> What kind of boards are you making?

Boards with power circuits and micro-controllers. I'm not sure I would trust the routing software when it comes to a high-speed bus or radio just yet.

> There was no easy way to combine schematic and skidl-based circuits. This was a problem at a company environment where design reviews become impossible because nobody else could write their heads around a power converter circuit made in skidl.

You can output a schematic: https://devbisme.github.io/skidl/#svg-schematics

I haven't got a solution for half-and-half skidl and KiCad designs.

> I really like KiCad's backannotation feature for adjusting BGA fanouts and whatnot from the layout.

I've not tried this so can't comment on it.

comment 4y ago · link · parent

You would of course check whether there is a collision if you care. You would size it such that a collision is low probability though.

comment 4y ago · link · parent

> This doesn't work because you don't know who allocated that memory.

I obviously haven't fully fleshed it out (I'm not writing an RFC here), but address re-use would be a consideration as you mention.

> You only "need" it if you've lost track of your memory and have no clue what is allocated and what isn't and you're trying to solve the problem (the wrong way) with these runtime checks.

No, you can do:

    char* a = (char*)malloc(/**/);
    if(a == NULL) printf("error"); // Never runs
    /* Any other checks you want to perform */
    /* Some processing later */
    a[0] = 'a'; // Crash here
In this case you have done nothing wrong. At the time of requesting memory there was enough space and the kernel said that you could have it. It's only when you come to actually access it did you find that it wasn't really allocated yet and there was no longer enough memory there for it.

> If you're going to change the language anyway (changing what the compiler does), just use C++ with unique_ptrs and they do precisely that without is_alloc.

You don't have to change the way in which the compiler works. You can likely do this with some macros. You would need some way to probe memory allocations though.

comment 4y ago · link · parent

For an ultra simple hash table, you just need a few things (the following is from my head).

First is a 'reasonable' hash function (although with a few more lines you can do better [1]):

    unsigned int H(char* s){ int h; for(h = 0; *s; s++) h = ((h << 5) + h) + *s; return h; }
And then to build your hash table:

    int L = <table length>; // Large enough to reduce collisions
    char** t = (char**)malloc(L * sizeof(char*));
    memset(t, 0, L * sizeof(char*)); // Set it all to empty by default
Then to use it:

    /* Put example */
    t[H("key string") % L] = "value string";
    /* Get example */
    char* v = t[H("some key") % L];
    if(v) printf("value -> %s\n", v);
    /* Remove example */
    t[H("another key") % L] = NULL;
For them most part you can get pretty far with just this in C.

[1] https://coffeespace.org.uk/projects/hash-functions-part-2.ht...

comment 4y ago · link · parent

The best thing to happen to KiCad was skidl [1] paired with freerouting [2]. You can spin a board in so little time it's insane. In the future I will be looking to automate even the parts placement too.

P.S. If there is interest I will look to document my workflow.

[1] https://github.com/devbisme/skidl

[2] https://github.com/freerouting/freerouting

comment 4y ago · link · parent

> Oh, I remember when these were popular for dot-com who just needed to get to the next round.

One of the best skills to learn is when to stop throwing good resources after bad. Sure, maybe you need just a little more to get over the finish line, but more than likely you are just investing more resources into delaying failure.

People often bring up Elon Musk and Tesla as a positive example of perseverance, where he was apparently sinking personal money to keep the company alive. It did pay off in retrospect, but there was a very large chance it didn't - and we're just celebrating survivor bias.

> Edit: Bridge loans were also really popular to stretch home buying power in 2006,2007. Hmmm.

You wait, this bubble is about to pop. Not a great time to have large financial obligations. I suspect this will make 2008 look like nothing (people weren't struggling to fuel their cars or eat then).

comment 4y ago · link · parent

I think we are typically not as good at spotting good code as we think we are.

For example, I inherited a large code base I while back and thought the classic "I can do better than this". After a few hours of hacking together a demo, only then could I appreciate the existing code base and how nice it actually was.

I think in general I look for a good level of abstraction - but not too an insane level. The best measure is how quickly you can understand it, and how long it takes for you to contribute to it.

comment 4y ago · link · parent

> is_alloc: If you have to call is_alloc because you don't know and you get `true` back, you still don't know anything, it could be your memory is live or it could be something else was allocated over your stale pointer.

The answer I want is a simple one - is _this_ pointer currently pointing to somewhere with allocated memory? The goal would be to avoid double free, or double allocating (and therefore memory leaks).

> free_all: This is just ridiculous. Now the heap is completely unusable because your memory could be freed from under you at any time by a concurrent free_all.

I think you misunderstand. You could have a (contrived) structure like:

    typedef struct{ char* a, char** b } s;
You then have the following allocations (not tested):

    s* data = (s*)malloc(sizeof(s));
    data->a = (char*)malloc(n * sizeof(char));
    data->b = (char**)malloc(l * sizeof(char*));
    for(int x = 0; x < l; x++) data->b[x] = (char*)malloc(n * sizeof(char));
Rather than free each of these allocations individually, you would instead have `free_all(data)` (might not be a great name). At compile time the compiler would look at the structure and expand out to be all the free operations as required. Of course you would need the `is_alloc` to test if somebody actually did allocate memory.

I would then imagine a common pattern would be:

    s* data = NULL; // Indicate we point to nothing
    /* Allocate */
    free_all(data); // Free associated memory
    data = NULL;    // Indicate no memory allocated
Of course one trap would be:

    s* data = (s*)malloc(sizeof(s));
    data->a = y;
    data->b = z;
    free_all(data);
Then one would have to consider whether y and z and free'd or not.

comment 4y ago · link · parent

I've always wondered why there isn't a `free_all()` function (that I'm aware of) for exactly ensuring that handles this. Or why you can't probe memory, with something like `is_alloc()` (is allocated).

I usually define my own version of `free()` to check whether the pointer is NULL, free the memory if not, and then set the pointer to NULL. That way if your pointer isn't NULL, it should be pointing somewhere. I believe there are some caveats though, specifically around OOM allocations as memory isn't truly allocated until you go to access it.

C memory is generally quite cool to work with, but those tripping points really will trip you up. It's exceptionally easy to have stuff lingering around indefinitely, even worse when it happens in a loop.

comment 4y ago · link · parent

I follow a Facebook page for Helium miners in the UK, because a family member was interested in getting involved and I said I would check it out first. I recommended against it (as I do with all crypto 'investments').

I observed it going "well", with people boasting massive return on investment. I then saw their profits drop, with software updates and faulty equipment being blamed. As a result, people went out and purchased new and more expensive equipment, many buying ludicrously expensive support equipment to improve signal properties. After quite some time of this, I then saw their revenue drop even more so.

Many of these people are invested several thousand pounds (multiple miners, multiple types of miners and support equipment). I see fewer and fewer people post now, with many now accepting their loss.

There is a real cost here, and as per usual, it is the people least able to afford it that pay it.

comment 4y ago · link · parent

Appreciated, thanks.

comment 4y ago · link · parent

> A maintainer who "doesn't care" if their infrastructure is proprietary is not doing a good job.

This isn't to mention also the issues regarding code ownership, where GitHub now trains their Co-Pilot AI on code under any license.

> Note that GitLab is not really the answer to this problem. It's open core, subservient to its investors, and pulls a lot of stupid shit like this.

Even if GitLab pulled out on their payed-tiers now, it's too late. This has been coming for years with the paid version of GitLab features vs the free version, which always ran behind on functionality.

We are currently considering our options to move away from GitLab. Ideally we look for tickets, merge/pull requests, CI and the ability to allow the public to contribute.

@ddevault We have been looking at SourceHut at an alternative. Specifically some questions for you:

1. Will you have a non-email merge/patch system for SourceHut in the near future [1]? The problem isn't so much for our team, but to encourage external people to help with our project who are used to the likes of GitHub and GitLab.

2. With regards to pricing for SourceHut, how will the pricing look in the future [2]? We have a small project that could pay per person/group, but would struggle to pay what GitLab are asking [3]. GitHib pricing is better, but obviously your code then becomes the product.

Great work in any case, I really enjoy seeing your blog updates.

[1] https://drewdevault.com/2022/07/25/Code-review-with-aerc.htm...

[2] https://sourcehut.org/pricing/

[3] https://about.gitlab.com/pricing/

comment 4y ago · link · parent

Thinking about it, this could be the way forwards. Memory offers several natural bottlenecks:

1. Memory size - Memory is somewhat costly (even now), with most entry laptops being stuck in the range of 8GB.

2. Access bandwidth - Getting a CPU to communicate with the RAM takes some time, improvements are incremental and are fundamentally limited.

3. Thread access - Threads compete for bandwidth, as long as cache hits are low.

comment 4y ago · link · parent

> If they kill off Pinephone, they'll have no smartphone that actually works and will piss off anyone who did a lot of work on software thinking this device is LTS as they promised.

It's not to say they will kill it, but the Pinephone Pro is clearly the device they will move forwards with and spend time to develop. The A64 is simply too slow.

comment 4y ago · link · parent

Checkout Apache's NuttX [1]. It's pretty impressive.

[1] https://nuttx.apache.org/docs/latest/

comment 4y ago · link · parent

From what I understand, this would allow somebody with reasonable resources to easily crack captchas with a high-end GPU. You could increase the complexity of the PoW, but ultimately you then just end up in a resource race.

Ideally you want an attacker to spend as long as possible using up computation resources, whilst your normal clients spend on average little. I believe you would want a multi-stage approach that involves some human interaction, which is statistically failed more often by computers, and keeps them busy for a long time doing pointless math.

The reason it would have to be multi-staged is that you don't want the attacker doing the computing to realize they are solving a pointless list of problems with no hope of getting a token. A normal user might on average do a -> b -> c, whereas you would make an attacking machine do a -> b -> c -> d -> e -> f, and the not get a token for example. (It would have to be statistically setup as not to encourage the attacker to bail early.)

I think I would make it a slightly RAM heavy problem that limits how many of these problems could be solved in parallel. You would obviously setup the problem in such a way that networking is minimal.

For example, you could send a variation of a Langton's Ant map pre-seeded with random patches for a significantly large map, and then tell the client to run for X time steps, then give you the result in some specific area.

comment 4y ago · link · parent

> This product family will never run Linux, as developers will need to develop a new firmware from scratch. This is obviously not a problem for the earbuds, but a big limitation for the player

Perhaps not Linux, but I suspect there would be a place here for a Unix-like platform that feels familiar. If for example we could get wide-adoption of something like the JVM or wasm3 [0] on these platforms, code could become quite portable, despite wildly different architectures.

For example, Apache's NuttX [1] (that I first learned from Lupyuen [2], a guy making great progress working with Pine64 products).

> Processing wise, this chip is well sufficient for TWS headphones, but very inadequate for an audio player. It will not drive a good screen, it nor run high-resolution flacs or (probably?) support a high-quality, high-bandwidth codec. In fact, a first generation iPod Nano (retailing for $149 in 2006) had 16MB RAM, so over 16 times what the PinePod would offer. In fact, even the features of any custom firmware are limited from so little memory

I wouldn't call it time just yet. Displays can be interacted with intelligently (to reduce pixel bandwidth) and ultra high quality audio codecs offer diminishing returns, especially when you don't have a DAC or headphones to make the most of them.

My advice to Pine64 would be this:

1. Consolidate your product lines. The Pinebook is just a slower Pinebook Pro, just go with the Pinebook Pro. The PineTab is just a Pinebook without the keyboard, again I would consolidate this with the Pinebook Pro and just make the keyboard detachable.

2. The SBCs should just go straight into the device, thus creating a clear upgrade path for future products. If you want a PineBook Pro running Quartz, just swap the boards (of course with daughter boards for USB expansion, display driver, power, etc).

3. Don't be afraid to kill off products. The Pinebook and PineTab have never seen a new release. The PinePhone appears to be taking a back seat to the PinePhone Pro. The PineCube is basically DoA due to the processing power struggling to process the camera image.

More generally, try to do fewer things, but do them well.

[0] https://github.com/wasm3/wasm3

[1] https://nuttx.apache.org/docs/latest/

[2] https://lupyuen.github.io/articles/sensor

1
313233
78