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

applying to yc with this idea.


It's possible they aren't talking about code at all.

"This team member, and this other team member are both filing a particular kind of report but are doing so in very different ways, is one of them more effecient?"

I like it. Seems like there could be lots of ways to automate the creation of SOP for many businesses. I do wonder how high level of tasks it could pick up on. Though maybe that gets better with a bigger context window.


That's fair. Assumption on my part. Hence couched in "is it possible..." weasel words.


This is exactly it! I'm sure I do a lot of things slower than others as well, and simply never came across an "alternative, but faster" method.


There is a youtube video id on the remote :)

I personally love the minimalism.


Hhmmm not sure how react helps here. I would love to see your code if you could share a gist?


I'll make one when I get home. IIRC: You'd scroll down vertically on the site, through divs with different backgrounds. The initial HTML/CSS approach was nothing special, just adjacent divs with background-image with background-size options, and I tried other tricks to no avail. The React approach was useWindowSize(), set div width to 100% or the screen width in px, set div height to (image aspect ratio) times width, set `background-size: 100% 100%` or the exact div width/height px.


Either ChatGPT has gotten better or I gave it a better prompt this time. It suggested this padding-bottom hack that sorta works but requires hardcoding aspect ratios, which I didn't want, but at least it demonstrates the layout we wanted with a Windows XP Bliss background image example:

  <style>

  .image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 80.44%; /* h/w aspect ratio */
    background-image: url('https://d7hftxdivxxvm.cloudfront.net/?quality=80&resize_to=width&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2F2RNK1P0BYVrSCZEy_Sd1Ew%252F3417757448_4a6bdf36ce_o.jpg&width=910');
    background-size: cover;
    background-position: center;
  }

  </style>

  <div class="image-container">hi</div>
  <div class="image-container">hi2</div>
  <div class="image-container">hi3</div>
Though it seems laggier than the React version when I resize, and this doesn't get into making the text resize to fit the divs...


I don't know what the intended treatment of the text is, but did you consider using an img element and stacking the text on top of it?

What you have is basically just an image element with width: 100 height: auto, but it has children.

Here's an example, written with tailwind for my convenience but should be pretty legible to anyone who knows CSS:

    <div class="grid place-items-center [&>*]:[grid-area:1/1]">
      <img
        src="https://picsum.photos/500/400?grayscale&blur=2"
        class="w-full h-auto"
      />
      <div>Hello.</div>
    </div>
    <div class="grid place-items-center [&>*]:[grid-area:1/1]">
      <img
        src="https://picsum.photos/500/400?grayscale&blur=2"
        class="w-full h-auto"
      />
      <div>Hello.</div>
    </div>
    <div class="grid place-items-center [&>*]:[grid-area:1/1]">
      <img
        src="https://picsum.photos/500/400?grayscale&blur=2"
        class="w-full h-auto"
      />
      <div>Hello.</div>
    </div>
The height of the container is governed by the height of the image (until the text becomes taller than the image). You still have fully fleixible in terms placement (place-self) and/or sizing (height: 100%) of the text container.


Yeah, that worked, thanks! I didn't think to try that, probably because I don't typically go towards absolute positioning (I'm sorta n00b), but it makes sense now.


Using grid like this isn't absolute positioning, we still have implicit sizing and regular document flow. We're just assigning the elements to the same grid area and letting that area be sized by its contents.


This takes 0 reasoning. You’ve given it an exact map to follow to the answer.


LLMs are also good at tasks that are roughly "linear" in the sense that a group of input tokens corresponds to a group of output tokens and that translation moves from left to right.

In a hard programming problem, for instance, you have a number of actions that have to take place in a certain dependency order that you could resolve by topological sort, but in a problem like the above one bit of English corresponds to one bit of Python in basically the same order. Similarly if it couldn't translate

    take the sine of...
to

    Math.sin(x)
because the language didn't already have a sin function it would have to code one up. Similarly, translating between Chinese and English isn't really that hard because it is mostly a linear problem, people will accept some errors, and it's a bit of an ill-defined problem anyway. (Who's going to be mad if one word out of 50 is wrong whereas getting one word wrong in a program could mean it doesn't compile and delivers zero value?)

LLMs can do a bit of generalization beyond full text search, but people really underestimate how much they fake reasoning by using memory and generalization and how asking them problems that aren't structurally close to problems in the training set reveals their weakness. Studies show that LLMs aren't robust at all to the changes in the order of parts of problems, for instance.

The biggest problem people have reasoning about ChatGPT is that they seem to have a strong psychological need to credit it with more intelligence than it has the same way we're inclined to see a face inside a cut stem. It can do an awful lot, but it cheats pervasively and if you don't let it cheat it doesn't seem as smart anymore.


I wish this were true. In the modern JavaScript ecosystem you either pin everything or pin nothing.


If you live in a semi-dense population, put it on the curb then post about it on your local facebook group and it will disappear in minutes.


Funny story - I used to live somewhere very central in London.

I noticed there was this one spot that always had something there.

After living there for about 2 years I knew it was THE SPOT.

So when it was my turn to move out, I had to get rid of all my furniture and thought I'd give it a go: over the course of a day I got rid of two 3x3 ikea kallax, a 2m cupboard and a tv amongst other stuff. An old woman even tried to tell me off for illegal flytipping but the ONLY time anything lasted more than 30 mins was when a guy found the 2m cupboard and was organising a car to come pick it up for him. And he stood there protecting his quarry for about 1 hr (I could watch the spot from my balcony)

My fav was actually helping to carry one of the kallax shelves about 400m to the other guy's house with him.

The life of selling stuff via listing pages


That's heavily locale dependent advice. This is not something you can do without it getting reported and treated as trash everywhere, and in many places you'll just anger your neighbours and inconvenience the municipal trash department.


Since it's free, people probably don't think they are missing out as they can get that "free" at some point later on. You take things more seriously when you pay for them.


this is the way. put it on Craigslist "Free" and FB Marketplace, drop specific coordinates / locations / picture.

"first come, first served", then walk away. Like one time I put the furniture and other stuff at the end of the driveway and then took a shower, and when I went back to look maybe 30 min later it was gone. deleted the posts and got on with life.


I believe memory leaks to start


Memory leaks can occur when a component adds events to an element outside of the component (such as the window) and then gets removed from the DOM without removing the event handler from the window. This is solved in native Web Components by the mount/unmount methods where you can run code to remove event listeners when the component has been unmounted.

For other event listeners, they get removed when the DOM element is removed.

The frameworks do not solve this to any greater degree. They also just make everything invisible and behind-the-scenes and hard to debug due to their declarative nature, but that is another topic.


Example with web components in all frameworks https://webcomponents.dev/blog/all-the-ways-to-make-a-web-co... and an other version to experiment with https://jsbin.com/yiviragiba/8/edit?html,css,js,console,outp...


Removing event listeners upon some component being removed actually sounds like a great use case for the new FinalizationRegistry API[1]

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...


This is one of those points where you need to link to some kind of data or conclusive result actually showcasing this, because you're arguing against a pattern that's been in browser ecosystems for decades. I've done this for larger applications and haven't experienced issues.

Being charitable, the best I can imagine right now that'd cause memory leaks is someone running into the old school JS scoping issues and capturing something in handlers that they shouldn't. That's not the handler itself that's the problem, though - that's the developer.

(Yes, we could rant on and on about the poor design decisions that JS has built in, but that's been beaten to death)


Are you implying that there are memory leaks in browsers' internal implementation of events? Because my take is that the problem is with "user space" scripts not cleaning up after themselves, and I don't see how that would get better by adding yet another API to be mindful of.


I believe this would be more related to something like memoizing a DOM structure in a "Live" listener that is later removed from the DOM but not garbage collected due to the reference in the event listener. As the poster mentioned, developer error -- not a fundamental language or browser implementation flaw.


If a language or browser implementation can't reclaim this unused memory thus creating a memory leak, that arguably is a flaw. It's literally a DoS attack vector that can be exploited by the untrusted scripts that run in the browser sandbox.


I've seen this before too. Clearly shady.


To sell a product. “Look at what our tool can produce.”


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

Search: