Better HN
topnewbestaskshowjobs
Log inSign up

devnull3

819 karma · joined Aug 2, 2021 (5y ago) · 273 submissions

Submissions

comment 1y ago · link · parent

All the stunts in async/await or goroutines in go stem from the fact that there is no support for something lighter than posix threads in kernel.

Shouldn't the OS kernel innovate in this area instead of different languages in userland attempting to solve it?

comment 1y ago · link · parent

In most production cases, there is no luxury of debugger.

In my current $job, all we get is logs from 70+ node cluster and that too in a shared-nothing architecture. You have to stitch together varied datapoints (job logs on multiple nodes, netstat o/p, job logs of other services, http access logs, tcpdump, etc) to even prove that problem is on the customer side and not ours.

comment 1y ago · link · parent

DHH is spot on like he is on many issues!

There is a saying in my language which translates: give someone a hand and they'll take your whole arm.

comment 1y ago · link · parent

A lot of PRO plugins can be self developed. An example: there is a poor-man's inspector plugin at [1].

The replace-url thing should be a simple JS code using history API no?

[1] https://github.com/sudeep9/datastar-plugins?tab=readme-ov-fi...

comment 1y ago · link · parent

Why not use a different encryption key per session and stamp encrypted ids (or whatever info) to the outside word.

This way the DBs can use simple sequence numbers instead of timestamp based IDs.

comment 1y ago · link · parent

I am backend dev and dipping my toes in frontend dev for my side hustle.

It is a typical CRUD app (like most of them). I like the idea behind HTMX or datastar. I built a prototype in it as well. But then I pivoted to solidjs.

Some reasons for this:

1. Single backend API for web, mobile and any other platform

2. Some UI patterns which are suited for JSON REST APIs [#patterns]

3. Ability to support partial functionality offline.

#patterns

1. Showing a subset of columns in a table but have an option to view & edit each record in detail. In my case a dialog opens with editable checkbox. So it doubles-up as "view" and "edit". These actions render just another view of existing data. A round-trip to server is not desirable IMO.

2. Filtering, sorting on columns. HTML based solution becomes tedious if some of the cells are not plain text but instead a complex component like a <div>. Sorting json and rendering is much better experience IMO.

Edit: About solidjs & datastar

1. It has fine-grained reactivity which I find it appealing and it uses signals which hopefully will be standardized.

2. The compiled bundle size is much smaller than I expected. I have 24KB compressed js which is serves quite a lot of views, pages.

3. Datastar is amazing and I have added it in my toolbox.

comment 1y ago · link · parent

There was a time when my main aim of a choosing a certain ringtone was to appear edgy and cool ... and how annoying and wrong was I!

A sample of bad ringtone (auto-tuned baby crying) which was trending back then (2007-2008) was [1]. Thankfully I never used it.

[1] https://www.youtube.com/watch?v=SVvFRzMWdL8

comment 1y ago · link · parent

For me the look and feel of Win XP was breath of fresh air compared to Windows 98. WinXP was more user friendly and I was not a power user back then.

comment 1y ago · link · parent

Win XP remains my favourite OS till date. I was in college and getting hands on a pirated copy back then makes me so nostalgic.

There was a cambrian explosion of tools to customize the look and feel. TweakXP pro is the one I remember. All pirated off-course.

comment 1y ago · link · parent

> He just put the sessionId in the form data instead of a cookie.

This does not have the benefit of being usable across different tabs or even closing and re-opening the page. Besides, (a minor point) shoving all the state in the cookie makes code simple i.e. don't have use URL params.

comment 1y ago · link · parent

Not really. DS v1.0 has HTMX like request/response option as well.

You might need async if there are lot of concurrent users and each of them using long duration SSE. However, this is not DS specific.

comment 1y ago · link · parent

Cookie is what we make of it. For browser, its opaque data anyway.

So, when /upload is requested, the backend in response sets a cookie with a random uploadId (+ TTL). At the backend, we tie sessionId and uploadId.

With every step which is called, we verify sessionId and uploadId along with additional state which is stored.

This means even if the form is opened on a different tab, it will work well.

comment 1y ago · link · parent

With DS (and HTMX) the backend is the source of truth. In the context of the blog post, the state will be made-up of: step no, file content, file path, etc. This can be stored against the session ID in a database.

So when opened on a different tab, the backend would do authentication and render the page depending on the store state.

In general, the backend must always compare the incoming state/request with stored state. E.g the current step is step 2 but the client can forces it to go to step 4 by manipulating the URL.

DS v1.0 now supports non-SSE (i.e. simple request/response interaction as well) [1]. This is done by setting appropriate content-type header.

[1] https://data-star.dev/reference/actions#response-handling

comment 1y ago · link · parent

In DS, with SSE you can paint different parts of the page with ease. So in this case, it can update <form> and <label> separately. So instead of one update the backend fires 2. There is not separate marker or indicator for OOB.

I think it is best seen in examples on DS website.

comment 1y ago · link · parent

> Challenge 2: Passing data down each step

Why not use cookies?

comment 1y ago · link · parent

This should be trivial with the HTMX alternative: datastar [1]

In datastar the "Out Of Band" updates is a first class notion.

[1] https://data-star.dev

comment 1y ago · link · parent

One of the recent inventions I like: Presstitute

Its a combo of "Press" and "Prostitute" and it aptly describes some journalists and media people who clearly take sides and have sold their souls.

comment 1y ago · link · parent

This does not talk about the numbering system. See [1]

"Lakh" => 100K

"Crore" => 100Lakhs

[1] https://en.wikipedia.org/wiki/Indian_English#Numbering_syste...

comment 1y ago · link · parent

Another one: updation

https://www.oed.com/dictionary/updation_n

comment 1y ago · link · parent

Prepone is now a word in Cambridge dictionary [1]. It acknowledges the origin to India.

[1] https://dictionary.cambridge.org/dictionary/english/prepone

comment 1y ago · link · parent

The irony is that these companies will make you sign & enrol trainings for "code-of-ethics" and the same management will indulge into shady practices (like the OP mentioned). Btw, there are other ways to get rid of employees which do not even need PIP.

I have made peace with the fact employees are just means to an end. Always have been. Nothing less or nothing more. The power is extremely lopsided in favour of the companies. This makes so many things beyond the control of an individual [1]. Focus on things in your control:

1. Keep learning

2. Be debt free as soon as possible.

3. Invest and build a financial cushion

4. Eat healthy and exercise (I am pretty bad at this but trying to improve)

5. Develop an alternative skill(s) which can you put to use if needed

6. Never burn the bridges, no matter what.

All of the above are easier said than done but I see no sustainable way of coping up.

[1] My current employer (which is a listed company) got acquired by a private equity. I have no idea what will happen but I am relaxed.

comment 1y ago · link · parent

Is there any list of games with same focus on being ad-free? Does not have to be free.

comment 1y ago · link · parent

The behavior attributed to Indians in the article is universal. Admission to few college seats is a zero sum game anywhere in the world.

In SF, see if companies share knowledge if they are after the securing a contract from the same B2B customer.

In UK, drivers give way as a courtesy many times even though one has the priority. In return the other driver thanks using hand gestures. However, there was a local football match on a weekend and parking was very hard to find. Parking spots are zero-sum game. People started violating many rules. People started driving against the arrows on the road in desperation to grab the spot. Parking in places which were not marked as parking spots. All the manners & niceties went out of the window. It has hunger-games for parking spots.

BTW, google (and other big companies) hiring top graduates and researchers to deprive others of the same talent is hoarding.

comment 1y ago · link · parent

Fun fact: The computer in simpsons is a coleco [1].

On an unrelated note, the short clip is funny as well.

[1] https://youtu.be/av4lbel9aIo?t=7

comment 1y ago · link · parent

I may have a outdated notion about the trades you mentioned, but I have seen an "apprentice" model a lot. I have seen it with a masonry where the experienced guy was bringing in his nephew and teaching him on the job. A lot of these trades are family owned and have seen taking in people based on someone vouching for the new guy.

Maybe this varies country to country. I have seen this in India and UK atleast.

In UK atleast there are trades like roofing, landscaping, exterior building cleaning, masonry, tree surgeon etc which I have seen them are mostly family based.

comment 1y ago · link · parent

Males are under pressure to "sustain" it for 10-15 min atleast (with many people watching). For females, no such thing.

comment 1y ago · link · parent

I wonder which other professions or trade ask people to perform infront of them in a simulated env as a filter criteria.

Actors for sure with auditions and maybe maybe chefs, male pornstars.

comment 1y ago · link · parent

Amazing! This nicely demonstrates capabilities of datastar.

I suggest to put a comment on the page to open dev tools and see the SSE event in action. I think people will appreciate D* even more.

comment 1y ago · link · parent

If I have to guess the tuning and optimizations:

SQLITE:

1. Smaller page size (to be specific: max(disk_sector_size, 512))

2. Integer primary keys

3. WAL mode

4. Increase page cache size. This is assuming that most people will click in the top-left 100x100 checkboxes.

Other optimzation:

1. In mem cache of bitmap of 1B bits, which is about 120MB, which is a shared state for all incoming connections.

comment 1y ago · link · parent

Barring the interactivity SPAs will also end up talking to server anyway. So even SPAs will feel sluggish in a high latency env.
12345
10