HNHacker News
TopNewBestAskShowJobs

pjtr

255 karma · joined February 1, 2014

submissionscomments
pjtr··on Why is F# code robust and reliable?
Is "let-over-lambda" (variable capture / closure) not possible in F#? Is that not a form of implicit dependency injection?
pjtr··on Why is F# code robust and reliable?
This seems fine within a file, but isn't this problematic across files? Now the file order is significant, so not only is the Visual Studio XML project file is an essential part of the language semantics, you also can't organize your files in subdirectories freely? Or did they fix that at some point? How does that scale to larger projects?
pjtr··on JAX – NumPy on the CPU, GPU, and TPU
Is there a specific reason why Windows is not supported?
pjtr··on Why did InterlockedIncrement/Decrement only return result’s sign? (2004)
I don't think Microsoft invented it:

> On the CDC CYBER, an interlock register is available ... Operation of this interlock register is similar to TEST AND SET

Concurrency in Operating Systems, October 1976 https://www.computer.org/csdl/magazine/co/1976/10/01647182/1...

pjtr··on OBS Studio: Open-source software for video recording and live streaming
OBS is very good software, thanks for working on it!

Recording the screen works much better than any other screen recording software I tried. For this use case the preview can be a bit confusing. If the resolution does not match (because of OS 200% scaling for example) going to the settings each time to adjust it is a bit cumbersome; the interactive resizing handles in the preview somehow never helped me. Sometimes one of the reset zoom context menus helps.

Also the "Window source" would be awesome, but is a bit cumbersome to set up every time, and doesn't capture things like menus unfortunately.

It's probably really difficult to improve these things, so they work automagically for dummies like me that know very little about OBS and use only a tiny feature set, without taking making things worse for power users, which are probably happy with things as they are.

pjtr··on Terrain rendering algorithm in less than 20 lines of code
A short article titled "Voxel Landscapes 2D and 3D By Scout/C-Lous" described most of the tricks, but I can't find the text anywhere. A similar article by the same author on another topic I found here https://github.com/ggnkua/Atari_ST_Sources/blob/master/Docs/...
pjtr··on Terrain rendering algorithm in less than 20 lines of code
The one I remember was "voxel.pas by Steven H Don". A Delphi port survived here: http://tothpaul.free.fr/sources.php?dprgrp.voxel

Searching for "voxel" in https://github.com/nickelsworth/swag/ also finds some very similar tiny Turbo Pascal programs.

pjtr··on Terrain rendering algorithm in less than 20 lines of code
Even drawing front-to-back you don't need the y-buffer, if you switch the loops: for x ... for y ...

Another trick I now remember was to interpolate the color values on such a y-segment, to reduce the pixelated look.

pjtr··on Terrain rendering algorithm in less than 20 lines of code
Same with leaning. Add one more line of code and tweak the draw call:

    var ylean = (input.leftright*(i/screenwidth-0.5) + 0.5) * screendata.canvas.height / 4;
    DrawVerticalLine(i, heightonscreen+ylean, hiddeny[i]+ylean, map.color[mapoffset]);
It adds a lot to the "feeling" IMO :)
pjtr··on Terrain rendering algorithm in less than 20 lines of code
There were also tricks to extend this simple rendering algorithm to allow limited rotations around the other two axes, to look up / down slightly (just move everything up / down; also implemented in the demo here) and to "lean" when steering left / right (just move everything up / down proportional to the distance from the center of the screen; not implemented in the demo here, but visible in the 1992 NovaLogic Comanche example GIF).

There were Turbo Pascal versions of this on websites in the 90s I think, but it seems they were lost.

pjtr··on How to undo almost anything with Git (2015)
You are correct, thanks.
pjtr··on How to undo almost anything with Git (2015)
purge is a third-party extension; it removes untracked files as you wrote.

But ~purge~ prune is also a command of the evolve extension, that is conceptually similar to strip, as GP wrote.

pjtr··on How to undo almost anything with Git (2015)
Fortunately "transplant" is just an old extension, so you can just forget entirely about it.

"Graft" copies; "Rebase" moves.

Alternatively just forget about graft also, and use "rebase --keep" to copy.

"Rebase with evolve" is conceptually still rebase.

Mercurial has strip (removes changesets from repository, by default stores a backup). Mercurial does not have purge.

Evolve has ~purge~ prune (marks changesets as obsolete).

Evolve is similar to a git reflog.

Evolve stores more contextual information than the reflog, so Mercurial+Evolve it is safer and easier to undo things than in Git+reflog. Mercurial also pushes some of this contextual information, so even collaborative history rewriting is possible in a safe and easy way, unlike git.

pjtr··on ECMAScript proposal: String.prototype.replaceAll
I don't understand the reasons. What is the actual problem in this "even-odd problem"?

How do all the other languages that have an equivalent function (Perl quotemeta, PHP preg_quote, Python re.escape, Ruby: Regexp.escape, Java Pattern.quote, C# Regex.Escape, Go QuoteMeta, Rust regex::escape) avoid or deal with this problem?

pjtr··on Unicode Is Awesome
And WORD 16 bits: https://docs.microsoft.com/en-us/openspecs/windows_protocols...

(QWORD 64 bits)

pjtr··on More MS-DOS Games Playable at the Internet Archive
Targhan maybe?

https://archive.org/details/msdos_Targhan_1989

pjtr··on .NET Core gRPC
Are there options for machine local IPC over pipes in .NET Core?
pjtr··on String Lengths in Unicode
"Python 3’s approach is unambiguously the worst one"

No rationale for this seems to be included in the article.

pjtr··on A Beginner’s Introduction to Python Web Frameworks (2018)
TurboGears 2 https://turbogears.org/
pjtr··on Fork: A fast and friendly Git client for Mac and Windows
I did see the screenshots. That's what triggered my comment. I did not see any branch names. Now I see "nh-scroll-fix" and "origin/fix-simulate-na..." in the conflict dialog, but not in the merge dialog. Branch names seem insufficient anyway though, but it would be a slight improvement I guess.
pjtr··on Fork: A fast and friendly Git client for Mac and Windows
Why do merge tools pretend that "their" and "our" or "remote" and "local" are good labels? Can they not show the commit message and hash? Nowadays with history editing often both sides are local and mine.
pjtr··on 'My son spent £3,160 in one game'
Coffee, religion, cigarettes, facebook, anger
pjtr··on Announcing Rust 1.35.0
Can't you use this "alternative rust compiler. Capable of building a fully-working copy of rustc" https://github.com/thepowersgang/mrustc and a trusted C++ compiler instead?
pjtr··on Death by PowerPoint: The slide that killed seven people
> you're making the same mistake

I assume you mean the "generic you", as it was the article quoting the NASA report that suggested the comparison.

pjtr··on Death by PowerPoint: The slide that killed seven people
"there is a huge amount of text, more than 100 words"

"PowerPoint briefing slides instead of technical papers"

Would technical papers have fewer than 100 words?

If people can't be bothered to read 13 slides, what would they do with a technical paper?

If people can't be bothered to make their message clear in slides, how would they create a readable technical paper?

I don't like presentations that consist of "monotonously reading [bullets] as we read along" either. But what does PowerPoint have to do with this? I've seen such presentations done with trendy web tools instead; they don't change anything. I've also read full technical papers written in LaTeX that didn't manage to get their point through the unclear writing (and vaguely misused technical jargon buzzwords).

pjtr··on Death by PowerPoint: The slide that killed seven people
So the real slide was actually quite different from the one presented in the article. The article shows various errors not present in the real slide (vaires, e.?g., Ln, hanrd). The real slide also use different font weights and bullet symbols. Was that intentional to give a bad impression, or just really sloppy? Or were those slides cleaned up?
pjtr··on German Regulators Tell Tesla to Stop Advertising Cars with Gas Savings in Price
The list of members is here: https://www.wettbewerbszentrale.de/de/institution/mitgliedsc...

It includes for example Audi, BMW, Daimler, Ford, Opel, Volkswagen, the VDA (Verband der Automobilindustrie; German Association of the Automotive Industry) and the VDIK (Verband der Internationalen Kraftfahrzeughersteller; Association of International Motor Vehicle Manufacturers)

VDA members are here: https://www.vda.de/en/association/members.html

VDIK members are here: http://www.vdik.de/members/members.html and include for example Citroën, Fiat, Honda, Hyundai, Jeep, Mitsubishi, Nissan, Peugot, Renault, Saab, Toyota, Volvo...

pjtr··on JSON with Sqlite
Especially for things like Python's embedded SQLite. Packaging and loading an extension module cross-platform with an otherwise pure Python script seems difficult.
pjtr··on Chrome will Soon Let You Share Links to a Specific Word or Sentence on a Page
Similar Javascript feature existed for a long time:

Link to first occurrence of "pseudo" on page: https://trac.edgewall.org/wiki/TracLinks#/pseudo

Link to last occurrence of "highlight" on page: https://trac.edgewall.org/browser/trunk/trac/htdocs/js/searc...

pjtr··on What's next for SemVer
1) In the Windows ecosystem almost every version has 4 parts. (e.g. file headers in exe, dll, assembly etc.) So it's impossible to use semver which only allows 3 parts. This seems like a major unnecessary roadblock.

2) IMO packaging tools should have fields to indicate the versioning scheme they follow, for example:

{ "version": "1.0.0", "version_scheme": "https://semver.org/spec/v2.0.0.html" }

{ "version"="19.02", "version_scheme": "https://calver.org/")

{ "version"="1.0.0.0", "version_scheme": "https://altver.example.org/winver/1.0.0.0.html")

{ "version"="1.0.0.0", "version_scheme": "custom")

Currently the tools pretend to know that "all" versions follow the same scheme. But in reality they just don't and never will.

Maybe also allow a prefix instead, but make it explicit and unmistakable (i.e. not "v1.0.0", but "semver2-1.0.0").

Page 1 of 4Next →