| ▲ | What algorithm did Windows XP use to choose your initial user picture?(devblogs.microsoft.com) |
| 141 points by soheilpro 4 hours ago | 65 comments |
| |
|
| ▲ | mawadev 2 hours ago | parent | next [-] |
| 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 of a specific pattern in the directory and then picked a random index, very naive and quick and dirty programming, no sampling at all, just to avoid discussions why it takes so long with people who don't want to hear it. This reminds me of when I did a lot of C#, Java, JS, Python in my life, filling maps of strings and objects until I started with zig and noticed how expensive and complicated strings and data structure allocations can be. It kind of blew my mind how much memory and computation we waste when we try to get stuff done as fast as possible because of budget/time constraints. |
|
| ▲ | lyorig 2 hours ago | parent | prev | next [-] |
| 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. |
| |
|
| ▲ | impoppy 41 minutes ago | parent | prev | next [-] |
| >Raymond has been involved in the evolution of Windows for more than 30 years. He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information. |
| |
|
| ▲ | cgio 2 hours ago | parent | prev | next [-] |
| The times when people spent an extra brain cycle to avoid billions of second passes. |
|
| ▲ | Aditya_0315 12 minutes ago | parent | prev | next [-] |
| What is amazing is the amount of consideration given to an issue which would escape the majority of users. It is surprising how complex an apparently easy process turns out when considering certain special cases. |
|
| ▲ | EMIRELADERO 42 minutes ago | parent | prev | next [-] |
| For those interested, here's the actual code Chen talks about: https://github.com/tongzx/nt5src/blob/daad8a087a4e75422ec96b... |
| |
| ▲ | ycuser2 33 minutes ago | parent [-] | | Didn't know that NT5 source is available for the public. Why Microsoft does not ban/delete it on GitHub? |
|
|
| ▲ | dsego 16 minutes ago | parent | prev | next [-] |
| Why doesn't it return on the first match? |
| |
| ▲ | yoz-y 4 minutes ago | parent | next [-] | | Because it would always return the first match in that case. You still need to see all of the items once. Imagine you have 2 items. First one has 100% chance to be selected. So it does. Then the second has 50% chance to be selected. If it isn’t you effectively chosen the first one and have 50/50 chance to return either. Now you add a third item. There is 50/50 chance of having either selected. And 1/3 chance of replacing the selection with the new one. Resulting in a 1/3 chance of selecting any of the three. (Because 1/2-1/6 = 1/3) 1/6 because there is 50% chance you will “steal” the selection. | |
| ▲ | quentinkent1 7 minutes ago | parent | prev [-] | | exactly. There is something wrong with the code snippet. |
|
|
| ▲ | ape4 32 minutes ago | parent | prev | next [-] |
| It somewhat odd that systems don't have a call to tell you how many files are in a folder. |
| |
| ▲ | ygra 17 minutes ago | parent | next [-] | | Either that call would have to do the same (i.e., walking the files and counting), or you'd need some additional metadata in the directory entry to store how many files there are, requiring additional storage accesses for adding and removing files. Adding to that that both FAT32 and NTFS are quite old and had to run on older hardware. Cycles and disk accesses are not free. On top of that, how often is it necessary to efficiently know the number of files in a directory while at the same time not caring about the files enough to list or display them? This algorithm is a special case where you could use the count of using a bit simpler code that ultimately would have the same file system API calls (since you cannot tell the FS to give you file #37 from that directory, so you'd have to use FindNextFile 37 times anyway, just like the sampling algorithm). | |
| ▲ | eventualcomp 20 minutes ago | parent | prev | next [-] | | I feel like there would either be too many locks or too much contention on something like /var/log or /tmp if that API was ever exposed to userspace. | |
| ▲ | conorcleary 30 minutes ago | parent | prev [-] | | just have it count how many times del cmd runs successfully /s | | |
|
|
| ▲ | jasonvorhe 3 hours ago | parent | prev | next [-] |
| A couple of screenshots would've been useful for the post-millennial generations that never got to see the "beauty" (cough) of XP. |
| |
| ▲ | moritzwarhier 3 hours ago | parent | next [-] | | Here's a blog post from 2003 with beautiful pictures. https://jakeludington.com/2003/12/17/create_your_own_windows... | |
| ▲ | Maken 2 hours ago | parent | prev | next [-] | | XP is Microsoft's prettiest OS by far. | | |
| ▲ | mrweasel 2 hours ago | parent | next [-] | | That's a matter of taste, but for many it was the Windows they used first and/or spend the most time on and there's a lot of love for that reason alone. I never used XP all that much, but I always changed the theme to the Windows 2000 look. I really didn't like the default, it looked unprofessional and clunky in my eyes. Upon release XP was also pretty universally mocked as a Fisher Price-like UI. To me Windows 95/NT 4 is still the gold standard in Windows UI. It's certainly not the prettiest, that would be Windows 2000, but it was easy to use, easy to navigate and efficient with space. | | |
| ▲ | agumonkey an hour ago | parent | next [-] | | win2k was peak for me. lean, functional, just a pinch of glitter here and there (short fade-ins). it was on par with the amazing stability brought by nt5 kernel. i kinda miss xp at a cultural level since it was a bit the end of that computing culture cycle (after that apple started to dominate and ubuiquitous computing influenced desktop ui) | | |
| ▲ | Intermernet 29 minutes ago | parent [-] | | "after that apple started to dominate" When did Apple dominate? I'm not trying to hate on Apple here, but there's this weird belief that Apple have had a lead in personal computer OS market share at some point in the last few decades, and it isn't really true since about 1984. You can argue that they should dominate, but that doesn't seem to have happened. |
| |
| ▲ | afzalive 2 hours ago | parent | prev | next [-] | | Took me years to like Windows XP. Hated the new start menu. I always kept installing Windows 2000 (or ME, probably because it could use Windows 98 drivers but look like Windows 2000). I eventually got used to it and ended up liking it. | | |
| ▲ | deltoidmaximus 8 minutes ago | parent | next [-] | | I always ran it with the 2000 style theme. That said XP offered me nothing over 2000 so 2000 is what I ran on my main machine since it used less ram but did all the same things, often a bit faster. For awhile I ran XP 64-bit though, that did do one thing 2000 couldn't do. | |
| ▲ | alex_suzuki an hour ago | parent | prev | next [-] | | IIRC correctly, XP’s stability greatly increased after Service Pack 2 was published. | |
| ▲ | stingraycharles an hour ago | parent | prev [-] | | It was at this moment I realized that people are talking about liking the non-classic-look XP. I always immediately put things in classic look, no grouped windows, etc. |
| |
| ▲ | Maken 2 hours ago | parent | prev | next [-] | | The first Windows I used was 98, and I sure didn't miss the blocky grey menus nor the pixelated icons. Maybe it was Fisher Price-ish but the new rounded buttons and borders were way more appealing to me. | |
| ▲ | TazeTSchnitzel 2 hours ago | parent | prev [-] | | The "Windows Classic" look on XP is exceptionally ugly, because those 3D-rendered icons just do not belong on a Windows 2000-style grey background for menus or buttons. (I have recently had to test both these OSes in VMs…) | | |
| ▲ | mrweasel 2 hours ago | parent [-] | | That is true, it looked completely off, as if no one really bothered to tests it and make it look nice. It got rid of the horrible window decoration of the default theme, but the start menu looked terrible. |
|
| |
| ▲ | bsoqk 39 minutes ago | parent | prev | next [-] | | https://devblogs.microsoft.com/oldnewthing/20040331-00/?p=39... >During the Luna studies, that people’s reaction to Luna was often, “Wow this would be a great UI for X,” where X was “my dad” or “my employees” or “my daughter”. People didn’t look at it as the UI for themselves; rather, they thought it was a great UI for somebody else. (Luna is the name of the default look of Windows XP) | |
| ▲ | delta_p_delta_x an hour ago | parent | prev | next [-] | | I feel Vista was by far the best. 7 simplified it a bit, but that Start orb and black taskbar on Vista, man, that was glorious. | |
| ▲ | YPPH 2 hours ago | parent | prev | next [-] | | I found each of 2000, XP, and 7 to be excellent in its own unique way. I'd be happy with any of them. But it also felt exciting to upgrade. It's all been downhill from there as far as UX goes. | |
| ▲ | fractal618 43 minutes ago | parent | prev | next [-] | | I like the installation music :-) | | |
| ▲ | rzzzt 9 minutes ago | parent [-] | | "Welcome to Windows 98" with the church bell and sick bass intro can never be beaten. It's cut short unfortunately. |
| |
| ▲ | meerita an hour ago | parent | prev | next [-] | | Ehem... nothing beats the beauty and simplicity of Win 95 :) | |
| ▲ | amiga-workbench 2 hours ago | parent | prev | next [-] | | Perhaps with the Zune theme installed. | |
| ▲ | sunaookami 2 hours ago | parent | prev [-] | | You mean 7 ;) | | |
| ▲ | medwards666 2 hours ago | parent | next [-] | | Windows 7 was certainly pretty, but I still think that W2000 was peak Windows UI
(and I've been around since Windows 2.0) | |
| ▲ | Maken 2 hours ago | parent | prev [-] | | Windows 7 fixed Vista a bit, but the Aero windows were never pretty and the non-Aero decorations were painfully obvious a placeholder. |
|
| |
| ▲ | CalRobert 2 hours ago | parent | prev | next [-] | | I thought it looked great :-/ | |
| ▲ | PalmPilotProMax 2 hours ago | parent | prev [-] | | I don't see how that's relevant? Article is about the RNG implementation, it doesn't matter what the profile pictures are. | | |
|
|
| ▲ | KellyCriterion an hour ago | parent | prev | next [-] |
| Why they made it that complex? A simple rand/mod based on first character of username should be sufficient? |
| |
| ▲ | lentil_soup an hour ago | parent | next [-] | | because you don't know the number of images before running the code so no number to do the mod part | | |
| ▲ | moffkalast an hour ago | parent [-] | | Why wouldn't you know that? It's a set of preloaded stock photos, it's always gonna be the same number. | | |
| ▲ | elgertam 29 minutes ago | parent | next [-] | | 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. | |
| ▲ | bombcar 31 minutes ago | parent | prev | next [-] | | It’s a directory. You could add pictures to it, and we did in our image layout (mainly for fun, but they wanted the logo as one). | |
| ▲ | herywort 43 minutes ago | parent | prev | next [-] | | > As a final safety check, the code stops after sampling 100 pictures. This avoids pathological behavior if somebody puts a million files in the Default Pictures directory | |
| ▲ | consp an hour ago | parent | prev [-] | | At compile time of when the pr department decided to change it? |
|
| |
| ▲ | nkrisc 30 minutes ago | parent | prev | next [-] | | So users Adam, Anne and Archie all have the same profile image? | |
| ▲ | stephenlf 25 minutes ago | parent | prev [-] | | How is that simpler? |
|
|
| ▲ | bhaney 3 hours ago | parent | prev | next [-] |
| 100 seems like a very unnecessarily low limit, even for the time |
| |
| ▲ | daveoc64 2 hours ago | parent [-] | | It's well above the number of images that were in the applicable folder by default, so seems pretty appropriate to me. |
|
|
| ▲ | bombcar 2 hours ago | parent | prev | next [-] |
| Does it also check existing users so you don't match one? |
| |
|
| ▲ | moritzwarhier 3 hours ago | parent | prev [-] |
| Some say the Admin account defaulted to a chessboard. I think it's true, but not sure if I'm just falling victim to false memories... help? |
| |
| ▲ | TazeTSchnitzel 2 hours ago | parent | next [-] | | The account named "Administrator" that Windows created for you always had the chess piece. | |
| ▲ | bhaney 2 hours ago | parent | prev | next [-] | | There's no way my memory of this is reliable anymore, but I also remember my administrator account being chess pieces (and my user account being an orange fish). | |
| ▲ | bombcar 2 hours ago | parent | prev | next [-] | | It might be that the randomization code was bypassed in some cases - like creating an account in safe boot mode or similar. | |
| ▲ | xx_ns 2 hours ago | parent | prev | next [-] | | It makes sense. The chess piece is the first profile picture in the list. | |
| ▲ | abhinavk 2 hours ago | parent | prev [-] | | I remember it like that too. Or is it Mandela effect? | | |
|