Earlier quoted context omitted.
I started programming before stack overflow, was never any good (still am not to this day), but I was always scared of asking questions on stack overflow. I felt like there was a certain amount of homework expected when you ask a question and usually by the time I did enough work to post a question, it was moot because I would have solved my problem usually by stringing together two or more stack overflow questions t…
That's interesting. When SO came out, I was a big contributor, all in on getting the karma points and whatnots. Eventually, I realized I was being bullied by a bunch of Europeans who had never actually worked a real job in their entire lives and were, for lack of a better term, "software enthusiasts." Invariably, I would answer something based on actual experience only to get downvoted because some idiot hobbyist tho…
The deadline isn't when AI outsmarts us – it's when we stop using our own minds
301–310 of 341 posts
Re: The deadline isn't when AI outsmarts us – it's when we stop using our own minds
#302Earlier quoted context omitted.
How is this not what is currently the norm? How do dissertations work at your university, if they are not exactly this?
For PHDs yes. Everyone else takes written exams. Highschool needs this hard.
Re: The deadline isn't when AI outsmarts us – it's when we stop using our own minds
#303Earlier quoted context omitted.
Oh, yeah. SO is infamous for treating question-askers badly. I have used LLMs for some time, and have no intentions of ever going back to SO. I get tired of being insulted. > The only stupid question is the one you don't ask. - A poster on my old art teacher's studio wall.
SO wasn't even the first site with this phenomenon. IMO SO is way more cordial than some of the forums from the early 00s. And before that, many irc channels were known for being brutal to people coming for help. I was part of the problem there until I realized there was a problem and decided to change my approach, but it took years to unlearn what I had picked up from other channels ops.
One of the reasons that I strive to behave, hereabouts, is that I feel the need to atone.
It can be quite difficult to hold my tongue/keyboard, though. I feel as if it’s good exercise.
Re: The deadline isn't when AI outsmarts us – it's when we stop using our own minds
#304Earlier quoted context omitted.
Oh, yeah. SO is infamous for treating question-askers badly. I have used LLMs for some time, and have no intentions of ever going back to SO. I get tired of being insulted. > The only stupid question is the one you don't ask. - A poster on my old art teacher's studio wall.
Wikipedia does the same to those who contribute StackOverflow intimidated me for reasons you say. What is it with the power trip that some of these forum mods have?
“Breaking the chain” is quite difficult, because it means not behaving in the manner that every cell in your body demands.
Re: The deadline isn't when AI outsmarts us – it's when we stop using our own minds
#305Earlier quoted context omitted.
Well, there is immigration and there is immigration. There are people that move between similar socialized countries, directly from one high-paying job to the next. Every country wants to have them. Then there are basically refugees, that are only named immigrants, because they happen to flee through another country. They might also have had a well paying job, but they often need to learn the language, they often nee…
It’s undeniably worth investing in immigrants, including refugees. Rhetoric otherwise is just veiled racism. These people already exist. It’s our duty to take care of them as global citizens, just like it’s our duty to care for the elderly and others. I also think you’d be surprised how little time to pay off would actually be needed. Give people a calm space and community (including their friends and family), and we…
These are different things. Yes we are required to provide the resources needed for life to refugees as well as to the elderly. That doesn't automatically mean that this is a worthy investment. What dividends do you intend to get from a bedridden old person.
> Rhetoric otherwise is just veiled racism.
No, it's not, were did a talk about race? If anything, you could accuse me of egoism, nationalism and social darwinism. Dealing with other perspectives by shouting you are bad guy(tm) won't advance anyone.
But I did not say, that any culture will perform worse than another. I did say a person robbed from his culture, law and economic system, and displaced into another will struggle. Putting on rose tinted glasses will help neither, your society, the refugee nor the refugees society.
> I also think you’d be surprised how little time to pay off would actually be needed.
Sure, that's why the societies with the refugees all outperform their neighbor and are way more peaceful.
> Give people a calm space and community (including their friends and family), and we will all flourish.
Sure, but why should this take place in your country, just because you have a self-inflicted lack of young people? That is very much egoistic and unfair, in my opinion. Providing money for education aid to developing countries and then sending ministers there to openly headhunt the well educated for your country, doesn't seem too far from colonialism and slave trade to me.
Re: The deadline isn't when AI outsmarts us – it's when we stop using our own minds
#306Earlier quoted context omitted.
I'll give you an easy example. LMDB has a (very) long-standing bug where "DUPSORT" databases become corrupted over time. Separately, I wanted to make some changes to LMDB but the code is so opaque that it's hard to do anything with it (safely). So I gave the entire codebase to Gemini Pro 2.5 and had it develop a glossary for local variable renames and for structure member renames. I then hand-renamed all of the struc…
What's the bug ID, have you submitted the fix back?
Fix: Use correct stack index when adjusting cursors in mdb_cursor_del0
In `mdb_cursor_del0`, the second cursor adjustment loop, which runs after
`mdb_rebalance`, contained a latent bug that could lead to memory corruption or
crashes.
The Problem: The loop iterates through all active cursors to update their
positions after a deletion. The logic correctly checks if another cursor
(`cursor_to_update`) points to the same page as the deleting cursor (`cursor`)
at the same stack level: `if
(cursor_to_update->mc_page_stack[cursor->mc_stack_top_idx] == page_ptr)`
However, inside this block, when retrieving the `MDB_node` pointer to update a
sub-cursor, the code incorrectly used the other cursor's own stack top as the
index:
`PAGE_GET_NODE_PTR(cursor_to_update->mc_page_stack[cursor_to_update->mc_stack_to
p_idx], ...)`
If `cursor_to_update` had a deeper stack than `cursor` (e.g., it was a cursor
on a sub-database), `cursor_to_update->mc_stack_top_idx` would be greater than
`cursor->mc_stack_top_idx`. This caused the code to access a page pointer from
a completely different (and deeper) level of `cursor_to_update`'s stack than
the level that was just validated in the parent `if` condition. Accessing this
out-of-context page pointer could lead to memory corruption, segmentation
faults, or other unpredictable behavior.
The Solution: This commit corrects the inconsistency by using the deleting
cursor's stack index (`cursor->mc_stack_top_idx`) for all accesses to
`cursor_to_update`'s stacks within this logic block. This ensures that the node
pointer is retrieved from the same B-tree level that the surrounding code is
operating on, resolving the data corruption risk and making the logic
internally consistent.
And here's the function with renames (and the fix): struct MDB_cursor {
/** Next cursor on this DB in this txn */
MDB_cursor *mc_next_cursor_ptr;
/** Backup of the original cursor if this cursor is a shadow */
MDB_cursor *mc_backup_ptr;
/** Context used for databases with #MDB_DUPSORT, otherwise NULL */
struct MDB_xcursor *mc_sub_cursor_ctx_ptr;
/** The transaction that owns this cursor */
MDB_txn *mc_txn_ptr;
/** The database handle this cursor operates on */
MDB_dbi mc_dbi;
/** The database record for this cursor */
MDB_db *mc_db_ptr;
/** The database auxiliary record for this cursor */
MDB_dbx *mc_dbx_ptr;
/** The @ref mt_dbflag for this database */
unsigned char *mc_dbi_flags_ptr;
unsigned short mc_stack_depth; /**mc_vl32_overflow_page_ptr)
# define CURSOR_SET_OVERFLOW_PAGE_PTR(cursor, page_ptr) ((cursor)->mc_vl32_overflow_page_ptr = (page_ptr))
#else
# define CURSOR_OVERFLOW_PAGE_PTR(cursor) ((MDB_page *)0)
# define CURSOR_SET_OVERFLOW_PAGE_PTR(cursor, page_ptr) ((void)0)
#endif
};
/** @brief Complete a delete operation by removing a node and rebalancing.
*
* This function is called after the preliminary checks in _mdb_cursor_del().
* It performs the physical node deletion, decrements the entry count, adjusts
* all other cursors affected by the deletion, and then calls mdb_rebalance()
* to ensure B-tree invariants are maintained.
*
* @param[in,out] cursor The cursor positioned at the item to delete.
* @return 0 on success, or a non-zero error code on failure.
*/
static int
mdb_cursor_del0(MDB_cursor *cursor)
{
int rc;
MDB_page *page_ptr;
indx_t node_idx_to_delete;
unsigned int num_keys_after_delete;
MDB_cursor *cursor_iter, *cursor_to_update;
MDB_dbi dbi = cursor->mc_dbi;
node_idx_to_delete = cursor->mc_index_stack[cursor->mc_stack_top_idx];
page_ptr = cursor->mc_page_stack[cursor->mc_stack_top_idx];
// 1. Physically delete the node from the page.
mdb_node_del(cursor, cursor->mc_db_ptr->md_leaf2_key_size);
cursor->mc_db_ptr->md_entry_count--;
// 2. Adjust other cursors pointing to the same page.
for (cursor_iter = cursor->mc_txn_ptr->mt_cursors_array_ptr[dbi]; cursor_iter; cursor_iter = cursor_iter->mc_next_cursor_ptr) {
cursor_to_update = (cursor->mc_flags & CURSOR_IS_SUB_CURSOR) ? &cursor_iter->mc_sub_cursor_ctx_ptr->mx_cursor : cursor_iter;
if (!(cursor_iter->mc_flags & cursor_to_update->mc_flags & CURSOR_IS_INITIALIZED)) continue;
if (cursor_to_update == cursor || cursor_to_update->mc_stack_depth mc_stack_depth) continue;
if (cursor_to_update->mc_page_stack[cursor->mc_stack_top_idx] == page_ptr) {
if (cursor_to_update->mc_index_stack[cursor->mc_stack_top_idx] == node_idx_to_delete) {
// This cursor pointed to the exact node we deleted.
cursor_to_update->mc_flags |= CURSOR_JUST_DELETED;
if (cursor->mc_db_ptr->md_flags & MDB_DUPSORT) {
cursor_to_update->mc_sub_cursor_ctx_ptr->mx_cursor.mc_flags &= ~(CURSOR_IS_INITIALIZED | CURSOR_AT_EOF);
}
continue;
} else if (cursor_to_update->mc_index_stack[cursor->mc_stack_top_idx] > node_idx_to_delete) {
// This cursor pointed after the deleted node; shift its index down.
cursor_to_update->mc_index_stack[cursor->mc_stack_top_idx]--;
}
XCURSOR_REFRESH(cursor_to_update, cursor->mc_stack_top_idx, page_ptr);
}
}
// 3. Rebalance the tree, which may merge or borrow from sibling pages.
rc = mdb_rebalance(cursor);
if (rc) goto fail;
if (!cursor->mc_stack_depth) { // Tree is now empty.
cursor->mc_flags |= CURSOR_AT_EOF;
return rc;
}
// 4. Perform a second cursor adjustment pass. This is needed because rebalancing
// (specifically page merges) can further change cursor positions.
page_ptr = cursor->mc_page_stack[cursor->mc_stack_top_idx];
num_keys_after_delete = NUMKEYS(page_ptr);
for (cursor_iter = cursor->mc_txn_ptr->mt_cursors_array_ptr[dbi]; !rc && cursor_iter; cursor_iter = cursor_iter->mc_next_cursor_ptr) {
cursor_to_update = (cursor->mc_flags & CURSOR_IS_SUB_CURSOR) ? &cursor_iter->mc_sub_cursor_ctx_ptr->mx_cursor : cursor_iter;
if (!(cursor_iter->mc_flags & cursor_to_update->mc_flags & CURSOR_IS_INITIALIZED)) continue;
if (cursor_to_update->mc_stack_depth mc_stack_depth) continue;
if (cursor_to_update->mc_page_stack[cursor->mc_stack_top_idx] == page_ptr) {
if (cursor_to_update->mc_index_stack[cursor->mc_stack_top_idx] >= cursor->mc_index_stack[cursor->mc_stack_top_idx]) {
// If cursor is now positioned past the end of the page, move it to the next sibling.
if (cursor_to_update->mc_index_stack[cursor->mc_stack_top_idx] >= num_keys_after_delete) {
rc = mdb_cursor_sibling(cursor_to_update, 1);
if (rc == MDB_NOTFOUND) {
cursor_to_update->mc_flags |= CURSOR_AT_EOF;
rc = MDB_SUCCESS;
continue;
}
if (rc) goto fail;
}
if (cursor_to_update->mc_sub_cursor_ctx_ptr && !(cursor_to_update->mc_flags & CURSOR_AT_EOF)) {
// BUG FIX: Use the main cursor's stack index to access the other cursor's stacks.
// This ensures we are retrieving the node from the same B-tree level
// that the parent `if` condition already checked. The previous code used
// `cursor_to_update->mc_stack_top_idx`, which could be incorrect if its
// stack was deeper than the main cursor's.
MDB_node *node_ptr = PAGE_GET_NODE_PTR(cursor_to_update->mc_page_stack[cursor->mc_stack_top_idx], cursor_to_update->mc_index_stack[cursor->mc_stack_top_idx]);
if (node_ptr->mn_flags & NODE_DUPLICATE_DATA) {
if (cursor_to_update->mc_sub_cursor_ctx_ptr->mx_cursor.mc_flags & CURSOR_IS_INITIALIZED) {
if (!(node_ptr->mn_flags & NODE_SUB_DATABASE))
cursor_to_update->mc_sub_cursor_ctx_ptr->mx_cursor.mc_page_stack[0] = NODE_GET_DATA_PTR(node_ptr);
} else {
mdb_xcursor_init1(cursor_to_update, node_ptr);
rc = mdb_cursor_first(&cursor_to_update->mc_sub_cursor_ctx_ptr->mx_cursor, NULL, NULL);
if (rc) goto fail;
}
}
cursor_to_update->mc_sub_cursor_ctx_ptr->mx_cursor.mc_flags |= CURSOR_JUST_DELETED;
}
}
}
}
cursor->mc_flags |= CURSOR_JUST_DELETED;
fail:
if (rc)
cursor->mc_txn_ptr->mt_flags |= TXN_HAS_ERROR;
return rc;
}
I have confirmed the fixed logic seems correct, but I haven't written a test for it (I moved on to another project immediately after and haven't returned back to this one). That said…I'm almost certain I have run into this bug in production on a large (1TB) database that used DUPSORT heavily. It's kinda hard to trigger.Also, thanks for a great library! LMDB is fantastic.
Re: The deadline isn't when AI outsmarts us – it's when we stop using our own minds
#307Earlier quoted context omitted.
GPS allowed me to go where I would have been hesitant to venture before.
Can you draw this analogy or a bit? What hesitation has an LLM helped you overcome?
Then I can pretty quickly see whether my idea was a good one or not. It's so easy and quick to build tiny bespoke tools now, that I'm building them left and right.
Some stay with me and I use them regularly, the others I forget. But I didn't have to spend hours and hours building them so the time-cost is not an issue.
Re: The deadline isn't when AI outsmarts us – it's when we stop using our own minds
#308Earlier quoted context omitted.
Not to out myself as old, but I learned to program before ChatGPT before stack overflow and before Google. There are some here that are even older. There were paper books with indexes. Indexes! That way of life is gone for me. I've got a smartphone and I doomscroll to my detriment. What's new and fascinating to me is the models themselves. https://fi-le.net/oss/ currently trending here is the tip of a whole new area…
I've been programming for 46 years. The first program I wrote was on a piece of notebook paper, in anticipation of getting my first computer a few weeks later (Atari 400).
Re: The deadline isn't when AI outsmarts us – it's when we stop using our own minds
#309Earlier quoted context omitted.
Show code and explain, or it didn't happen. Takes a capable interviewer, of course, to distinguish sweet talk from profound knowledge.
I’m confused by your response. You expect the candidates to show code from their current/previous employer ? Or side projects that most people aren’t allowed to do by employers?
My employer definitely doesn't own all the code I write in the evenings and on the weekends on my own time. Does yours?
Re: The deadline isn't when AI outsmarts us – it's when we stop using our own minds
#310Atrophy has really been an issue in my recent hiring cycles for good senior engineers. 80% of senior candidates I interview now aren’t able to do junior level tasks without GenAI helping them. We’ve had to start doing more coding tests to weed their skill set out as a result, and I try and make my coding tests as indicative of our real work as possible and the work they current do. But these people are struggling to…
Grade inflation has spilled over into the corporate world. I’ve interviewed people titled “principal” who would barely qualify as “senior” a few decades ago.
Me being from a place where they definitely aren't found this hilarious.
I've had meetings with Principal Architects with less experience than me (title: Backend Programmer).
Bigger organisations really should standardise their titles to specific experience/responsibility/capability milestones so people from other sides of the org can use the title to estimate the skill level of the other person they're talking with.