lhamil64

joined 1 year ago
[–] lhamil64@programming.dev 6 points 4 months ago (1 children)

The professor that taught my algorithms & data structures course said if we were going to keep one book it should be the one for that course. I followed that advice and it's the one textbook I still have. It's been 8 years since graduation and I haven't opened it once. I tend to just read Wikipedia if I need to understand a particular algorithm or data structure.

[–] lhamil64@programming.dev 1 points 6 months ago

But if time travel is a thing, imagine the whole new time nightmares! Oh you went back a year with your phone? Now all your TLS root certs are invalid because you're before the start date. Or you have files/emails/whatever that are dated in the future. I guess you can get to that state by just setting your clock forward but I imagine some stuff would break.

[–] lhamil64@programming.dev 2 points 7 months ago (1 children)

Rereading it, I now understand what you meant. I interpreted the "like regex" as an example of advanced git knowledge. I'm not sure the comma helps make it unambiguous though.

[–] lhamil64@programming.dev 10 points 7 months ago (9 children)

How is regex git knowledge? I guess you can use regular expressions with git grep but it's certainly not a git-oriented concept...

[–] lhamil64@programming.dev 11 points 7 months ago

Boolean is named after George Boole so that is too, sort of

[–] lhamil64@programming.dev 2 points 7 months ago

From a quick Google, yes they do, because the muscles relax.

[–] lhamil64@programming.dev 2 points 7 months ago

To play devil's advocate, tab completion would have also likely caught this. OP could have typed /mnt/t and it would autofill temp, or would show the matching options if it's ambiguous.

[–] lhamil64@programming.dev 1 points 7 months ago

Oh good to know. I googled it and got that 32767 number but it did say "guarantee to be at least 32767"

[–] lhamil64@programming.dev 43 points 7 months ago (2 children)

This looks like a C macro. Basically what it does is replaces the word "true" in the code with (rand() > 10). The rand() function will return a random number from 0 to 32767. So (rand() > 10) will very likely return "true" but not always.

So say you have some code like this: if (someVar == true) { // Do stuff } It would replace "true" with code that usually evaluates to "true" but not always. So every so often your code would just do the wrong thing but it would be hard to debug because it would be rare.

Granted, in that example you probably would just write "if (someVar)" making this moot, but there are more realistic cases where you'd use the constant "true"

[–] lhamil64@programming.dev 2 points 8 months ago (1 children)

I'm confused by this. Your company had to pay when employees clicked ads in Gmail? I assume this the enterprise version? But then that implies that Google puts ads in the enterprise Gmail which sounds both unsurprising and crazy to me.

[–] lhamil64@programming.dev 18 points 8 months ago (1 children)

Ehh I wouldn't say variables in programming are all that similar to variables in algebra. In a programming language, variables typically are just a name for some data. Whereas in algebra, they are placeholders for unknown values.

[–] lhamil64@programming.dev 1 points 8 months ago

Or you'll go to put the new battery somewhere and find the old one already there.

view more: next ›