News for hackers. Stuff that matters.
Re:Introducing extended line endings support in Notepad by Hello71 on Tuesday May 08, 2018 @03:54PM (#17024285)
if it's trying to be a database, it's doing a terrible job. all the problems of not being files (can you do "find HKEY_CURRENT_USER -name mypackage" to see what the uninstaller left behind?) with none of the benefits of a database (ACID).
Re:Introducing extended line endings support in Notepad by krylon on Tuesday May 08, 2018 @04:02PM (#17024377)
When they were working on Windows 7, Microsoft tried to be more open about the development process in order to repair some of the damage Vista had done. So one day, I came across this video, an interview of a few Windows developers.

At one point, the person doing the interview asks, "So, what do you guys think of the Registry?". Awkward silence, followed by uncomfortable laughter. Finally, one of the programmers says, "I think it's fair to say it was far more [widely used] than any of its designers had anticipated."

(Quoting from memory from a video I saw once, ~10 years ago, so the wording might not be perfectly accurate, but that's how I remember it.)

Re:Introducing extended line endings support in Notepad by mappu on Tuesday May 08, 2018 @04:55PM (#17024989)
> can you do "find HKEY_CURRENT_USER -name mypackage"

Powershell comes with a kind of FUSE mount for the registry:

    PS C:\> Set-Location HKCU:
    PS HKCU:\> Get-ChildItem -Recurse | where-object { $_.Name -match "HeidiSQL" }
Re:Introducing extended line endings support in Notepad by Slackwise on Tuesday May 08, 2018 @05:47PM (#17025502)
Or for those who come from Unixland and see way too much typing, PowerShell has aliases that make this much shorter:

    cd HKCU:
    ls -r -i *HeidiSQL*
Or if you really want to use the match operator, regex, or other expression, you can still pipe it through the Where-Object alias:

    ls -r | ? {$_.Name -match "HeidiSQL"}
Re:Introducing extended line endings support in Notepad by joeyaiello on Tuesday May 08, 2018 @05:37PM (#17025416)
Just to make sure everyone on HN knows you can get real pithy with PowerShell, this also works:

  PS C:\> cd hkcu:
  PS HKCU:\> ls -r | ? name -m 'HeidiSQL'
Re:Introducing extended line endings support in Notepad by Analemma_ on Tuesday May 08, 2018 @04:00PM (#17024355)
> with none of the benefits of a database (ACID)

This is not correct, Windows Registry updates are atomic and transactional. There may be other problems with the registry model, but it is a "real" database.

Re:Introducing extended line endings support in Notepad by krylon on Tuesday May 08, 2018 @04:07PM (#17024452)
ACID means more than atomic updates, though. To be ACID-compliant, you'd have to be able to group several changes to the registry and have them take effect either all at once or not at all.
Re:Introducing extended line endings support in Notepad by Const-me on Tuesday May 08, 2018 @06:49PM (#17026024)
> To be ACID-compliant, you'd have to be able to group several changes to the registry and have them take effect either all at once or not at all.

You mean transactions? Windows registry supports them since Vista when they added Kernel Transaction Manager: https://msdn.microsoft.com/en-us/library/windows/desktop/bb9...

See CreateTransaction, RegCreateKeyTransacted, RegOpenKeyTransacted, CommitTransaction[Async], RollbackTransaction[Async] APIs.

Re:Introducing extended line endings support in Notepad by krylon on Wednesday May 09, 2018 @12:04AM (#17027340)
I stand corrected. Good to know, thank you!
Re:Introducing extended line endings support in Notepad by Const-me on Wednesday May 09, 2018 @09:04AM (#17029438)
To be fair, I’ve never used KTM in my apps.

In cases when I need to write several values atomically (e.g. in a program with persistent window positions, after user moved a window I want to write all 4 coordinates of the rectangle), I just keep them in a single value, either string or binary. Even without KTM, registry API already guarantees value writes are atomic.

Re:Introducing extended line endings support in Notepad by eterm on Tuesday May 08, 2018 @04:09PM (#17024474)
A word for that is transactional.
Re:Introducing extended line endings support in Notepad by fulafel on Tuesday May 08, 2018 @05:03PM (#17025070)
It's implied by the I (isolation).
Re:Introducing extended line endings support in Notepad by ksk on Tuesday May 08, 2018 @04:21PM (#17024621)
https://msdn.microsoft.com/en-us/library/windows/desktop/ms7...

Could you point out which of these doesn't work as intended?