Live data from Hacker News

What algorithm did Windows XP use to choose your initial user picture?

devblogs.microsoft.com

131–140 of 168 posts

Re: What algorithm did Windows XP use to choose your initial user picture?

#131

Earlier quoted context omitted.

Why wouldn't you know that? It's a set of preloaded stock photos, it's always gonna be the same number.

On initial install, sure. But user accounts can also be created at arbitrary times. The user may have changed the set of photos in the intervening time and might even be editing the directory during profile creation.

I thought the same thing, and then wondered if this must be an enterprise problem, because what home user adds loads of icons - so many that IO becomes a concern - and also wants them to be randomly assigned to other family members?

But then it occurred to me that XP was of an era when you would absolutely spend an afternoon downloading some megapack of 10000 cool user icons.

Re: What algorithm did Windows XP use to choose your initial user picture?

#132
post #27

Man, every post from Raymond Chen regarding Windows internals is like a little Xmas. I wonder whether he has to ask someone for permission before publishing this knowledge, though.

Easier for a guy like him to be forgiven than to ask permission. Being tenured and one of the top engineers in your company with a very proven track record gives you quite a bit more freedom.

Yeah - he's more likely the guy that would be giving that kind of permission to someone more junior.

Re: What algorithm did Windows XP use to choose your initial user picture?

#133
post #85

Earlier quoted context omitted.

They simply find some problems more interesting to solve than others. Just like the rest of us.

(Perhaps it shows that Apple engineers are pushed to grind at the boring problems more; therefore maybe it is better to work at Microsoft)

Early in my career, I have read a blog post from someone senior about boring/entertaining work. In short it stated to following:

    Even if you work on exciting things, the project will always have boring parts.
    You'll need to develop these parts as well, so be prepared and show the same respect to all parts.
So, I'd personally rather work on all parts equally well rather than winging boring parts and create something subpar.

Re: What algorithm did Windows XP use to choose your initial user picture?

#134
post #102

I love the understated "some time ago" linking to a 2004 blog post. Raymond has been at this a long time :-)

I love that 2004 sounds like "some time ago" to some people. Seems like yesterday to me.

Isn't that the truth! I remember it very, very well. Vividly even.

Re: What algorithm did Windows XP use to choose your initial user picture?

#136
post #114

Earlier quoted context omitted.

The problem isn’t counting the files (the algorithm in the article also counts the files), but that if you determine that you want to use the i th file only after counting all files, you have to iterate over the whole directory again (or over expected half of it) to find that file.

The mechanism is interesting, but I'm not fully understanding the importance. We say it was done this way because a user would appreciate the speedup. The difference is one traversal versus expected one and one-half traversals. How slow was this traversal at the time for this difference to be significant?

Apart from the performance issues, it also prevents a bug. If some files get deleted between the first and the second pass, then you end up with unexpected behaviour and probably a crash.

Re: What algorithm did Windows XP use to choose your initial user picture?

#137
post #20

That is a case I only become aware of when I read blogs like this. Technically I could solve it the same way, but these days you have so many tasks on your desk, you don't think about the problem and implications at all and that awareness/discipline is drowned in the noise/unlearned over time. If someone only gave me 2 minutes for this, because they think it is very simple (as always), I'd have done a count of files…

Two things that have helped me with quickly recognizing these situations:

Programming for MCUs. Less so today when multi-hundred MHz MCUs are cheap, but even several years ago there were a lot of products where you needed to use the cheapest MCU and everything it did had to be optimized to avoid stalls and edge cases.

Second is doing LeetCode problems for fun/practice. This will elicit a groan from a lot of people, but the algorithms and pathological edge cases you learn really do change your thinking. The most interesting ones are the hard problems where they’ve added some hidden test case that causes naive solutions and algorithms to blow up. You start thinking on high alert for edge cases and Big O problems. It’s more fun when you’re doing it to learn on your own than for forced interview prep.

Re: What algorithm did Windows XP use to choose your initial user picture?

#139

Earlier quoted context omitted.

(Perhaps it shows that Apple engineers are pushed to grind at the boring problems more; therefore maybe it is better to work at Microsoft)

Early in my career, I have read a blog post from someone senior about boring/entertaining work. In short it stated to following: Even if you work on exciting things, the project will always have boring parts. You'll need to develop these parts as well, so be prepared and show the same respect to all parts. So, I'd personally rather work on all parts equally well rather than winging boring parts and create something s…

Maybe. By the way, I chose Apple as an example but their software is just about as bad, only slightly better.

Re: What algorithm did Windows XP use to choose your initial user picture?

#140
post #20

That is a case I only become aware of when I read blogs like this. Technically I could solve it the same way, but these days you have so many tasks on your desk, you don't think about the problem and implications at all and that awareness/discipline is drowned in the noise/unlearned over time. If someone only gave me 2 minutes for this, because they think it is very simple (as always), I'd have done a count of files…

How many user pictures are there to choose from, though? This is a nice, elegant way to sample from the set, but the nature, size, and frequency of the problem don't justify more than five or ten seconds' or thought and one or two minutes of coding.
Post reply on HN