News for hackers. Stuff that matters.
Re:Eric Engstrom, co-creator of DirectX, has died by ma2rten on Monday December 14, 2020 @06:09PM (#25424646)
What do you mean by projections? Do you have another example?
Re:Eric Engstrom, co-creator of DirectX, has died by josephg on Monday December 14, 2020 @10:36PM (#25426672)
More examples:

When debugging a web app, you can debug the code (and add print statements / breakpoints). Or look at the HTTP queries its making in the inspector. Or debug the server - look at what queries its receiving and returning. Or experiment with different values in the database.

Last year I was trying to track down a memory leak in some wasm code. The tooling for that sort of thing in wasm was/is quite primitive, so I did some work to compile the module natively then ran valgrind on the resulting executable. That didn't work - the C code executed differently from the wasm and didn't exhibit the bug! So I added print statements randomly through the program and ran it both natively and through wasm, then diffed the text output to track down when the execution traces diverged. (It wasn't a compiler bug, fwiw.)

I wanted more information about the memory leak. So I wrapped all the malloc/free calls with a replacement that stored all outstanding allocations in a list, with the stack trace when malloc was called. When the leak happened, I could ask for the stack trace of all outstanding allocated objects[1]. That was fast and effective, and I added a memory leak check in my CI.

At one of my first programming jobs we were using visual source safe (oh god, kill it with fire). I ended up losing some changes I'd made in a ~3000 line java class that we'd already deployed to production. I didn't want to do my work over again (or admit the mistake to my boss!). So I ran a decompiler against the class file we deployed to production - but it was huge and unreadable. To find the changes I'd made I took the current version of the java file, then compiled it and decompiled it again. So then I had two ugly files - but I could diff them, and that highlighted immediately the dozen or so changes I'd made. Then I just manually rewrote each change back into the original source file. Importantly, I had complete confidence that I didn't miss any of my changes.

[1] Its not pretty, but the code looks like this if anyone's curious: https://github.com/josephg/mime-to-jmap/blob/2a7429f7b805cb0...

Re:Eric Engstrom, co-creator of DirectX, has died by tomduncalf on Tuesday December 15, 2020 @03:43AM (#25428293)
Diffing log output is a great technique for tracking down weird, hard to repro bugs I find - log out as much as you can in a normal session and then in a buggy session, and diff the two, just as you describe.

Have also used this technique to compare build logs when you have a version of a project which will compile and one which doesn’t (eg when trying to integrate a second project into an existing one, or battling CI issues), useful if you aren’t an expert in that particular tool chain especially.

Personally I use VS Code’s diff these days, since they added support for word wrap recently, it’s the easiest to read.

Re:Eric Engstrom, co-creator of DirectX, has died by HexagonalKitten on Monday December 14, 2020 @11:25PM (#25426996)
> visual source safe (oh god, kill it with fire)

Did you have merge week too? Often stretching into a second?

Re:Eric Engstrom, co-creator of DirectX, has died by josephg on Tuesday December 15, 2020 @06:47AM (#25429384)
No - we had a small team (5 people). We still managed to corrupt the sourcecode database every couple of weeks and needed to reinitialize the whole thing.
Re:Eric Engstrom, co-creator of DirectX, has died by sumtechguy on Tuesday December 15, 2020 @09:04AM (#25430368)
We did daily backups to a second machine keeping the last 3. When it corrupted itself we copied it all back. I liked sourcesafe. It was kind of cool the way it worked and integrated into all the MS tooling we used at that time. Plus it was decently cheap enough for a small inhouse group of devs to afford. Its semantics for usage were very straightforward and easy to learn. BUT it was a pain for how it would corrupt itself randomly. That 'one' bug is why no one dares use it today and hates the thing. To this day because of how easy it was to use I compare the UX of all other source controls to it.
Re:Eric Engstrom, co-creator of DirectX, has died by Jtsummers on Monday December 14, 2020 @06:18PM (#25424741)
Map the problem into other domains. In this case, he could work with the original (hard to understand) source code. Or he could use a tool that would translate it (or the binary) into a more sensible language.

In other tasks, consider different data structures or representations that fundamentally represent the same data, but in different ways that offer different guarantees. Representing a graph with a matrix may let you answer some questions very quickly, but it may make others harder to answer, for example.

Re:Eric Engstrom, co-creator of DirectX, has died by tenken on Monday December 14, 2020 @06:23PM (#25424783)
Its an eastern mode if thinking. When faced by a problem, walk around the problem and examine all avenues of approach. Much like scaling a mountain. Seek the path of least resistance.

To often we simply reach for our trusty hammer, and it's not always an efficient or usable tool.

Re:Eric Engstrom, co-creator of DirectX, has died by sidlls on Monday December 14, 2020 @07:54PM (#25425651)
How is this an "eastern" mode of thinking. It's a pretty typical way we'd approach solving problems in physics anyway, and this was all in very western university here in the US.
Re:Eric Engstrom, co-creator of DirectX, has died by tenken on Monday December 14, 2020 @10:06PM (#25426506)
It may be prevalent in niche industries. But it's largely not culturally apart of historically western culture. And would you apply that problem approach prior to becoming a physics expert, did they teach that in kindergarten?

Eg in school we learn as kids derivatives, rote routines to solve a type of problem, and we plug and chug, but we are not shown (necessarily) by govt education the underlying theories that may create a solution. This/my opinion is of course dependant on how expert an instructor is ...

The best anecdotal example I can give off the net offhand would be: https://www.google.com/amp/ask.metafilter.com/105309/Tao-thi...

Thanks for your feedback

Edit: Also in the usa we're taught do your own homework for example. In asian cultures often students band together to succeed in classes (I work in higherEd and this is culturally visible in peers in classes). This is another example of this philosophy being different between cultures.

Re:Eric Engstrom, co-creator of DirectX, has died by bouncycastle on Monday December 14, 2020 @10:32PM (#25426649)
Creative/critical thinking is taught heavily from kindergarten in western schools.

In contrast to eastern education which tends to greatly focus on memorization through repetition.. (i.e https://en.m.wikipedia.org/wiki/Rote_learning)

The quote you have included is based on Taoism. Is that common? I was under the impression that Confucianism has the more dominant influence on values and thought.

Anyways, at least that's one thing we can agree on - Taoism's philosophy encourages an open mind and awareness.

Re:Eric Engstrom, co-creator of DirectX, has died by oreally on Tuesday December 15, 2020 @12:09AM (#25427229)
> In contrast to eastern education which tends to greatly focus on memorization through repetition..

Wouldn't quite say that is true. People use a variety of techniques to get scored higher and there's always a certain percentage who will use such rote learning techniques, be it eastern or western.

I think what what's missing in the discussion is the western focus on individualism as compared to east asian communitarianism. Both have their pros and cons and mutual dislikes.

There was a book by 2 high level western/eastern women managers in Hewlett Packard that highlights this dichotomy. It's a great read.

Re:Eric Engstrom, co-creator of DirectX, has died by bouncycastle on Tuesday December 15, 2020 @02:36AM (#25427928)
> individualism as compared to east asian communitarianism

Again, that's because of a deep rooting in Confucianism. Also, "Communitarianism" is a western (Christian) philosophy. It may have been borrowed from Confucianism? I'm not sure. A lot of religions and philosophies share these kinds of values, so it's not unique to just one region / culture, IMO.

Anyhow, neither is better or worse, and probably a balance between communitarianism and individualism is best. All cultures can learn from each other.

Re:Eric Engstrom, co-creator of DirectX, has died by oreally on Tuesday December 15, 2020 @08:01AM (#25429861)
> Also, "Communitarianism" is a western (Christian) philosophy

Hm probably a better word would be collectivism

Re:Eric Engstrom, co-creator of DirectX, has died by lotsofpulp on Monday December 14, 2020 @11:13PM (#25426934)
> Edit: Also in the usa we're taught do your own homework for example.

I went to a mix of 7 private and government schools between K through 12th grades in the US, and I don’t remember any of them not having group projects. Some, or most of the homework is individual, but there’s plenty of group work too.

Re:Eric Engstrom, co-creator of DirectX, has died by sidlls on Tuesday December 15, 2020 @02:55AM (#25428035)
He's referring to the phenomenon of certain groups of students cheating on homework and justifying it by claiming it's a cultural difference in approach to learning. It's not. It's outright splitting up work between peers, often with the use of illicit solutions manuals, for the purpose of gaming the grading system. It's especially beneficial in classes where the professor just writes exams from homework problems or problems very similar to them.

There isn't anything special or insightful, mystical or different or "eastern" about cooperative learning. I'm thoroughly "western" and had plenty of homework groups in both undergrad and grad school. Nor is there anything special about the cooperative cheating I described: "certain groups" applied to plenty of western peer groups I saw in undergrad especially, though they didn't claim what they were doing was some "cultural" thing, as they knew it was simply cheating.

Re:Eric Engstrom, co-creator of DirectX, has died by aneutron on Monday December 14, 2020 @06:20PM (#25424766)
He means mathematical projections. For example, calculating rotation velocities in a cartesian projection is harder than using cylindrical projection.
Re:Eric Engstrom, co-creator of DirectX, has died by notretarded on Monday December 14, 2020 @06:51PM (#25425069)
Nope you're giving him too much credit. He meant projections as in to a different view on the problem. Not anything more well defined than that. Your manner of explaining it is much better.
Re:Eric Engstrom, co-creator of DirectX, has died by dllthomas on Tuesday December 15, 2020 @12:35PM (#25432571)
I very much meant mathematical projections, but also (by analogy) other kinds of perspective shift where they have enough of the same properties.
Re:Eric Engstrom, co-creator of DirectX, has died by dllthomas on Tuesday December 15, 2020 @05:20PM (#25436009)
Two classic examples (Cartesian vs polar coordinates, frequency vs time domain) are mentioned in other comments.

I would certainly add "looking at values vs looking at differences" and "looking at the generator vs looking at what's generated" (which the top level story is an example of).

It may take a little squinting, but we can see the common mathematical practice of reducing one problem to an example of another as an instance of this. There are also tweakier math examples where treating something as topology or something makes it easy to solve.

Re:Eric Engstrom, co-creator of DirectX, has died by tclancy on Monday December 14, 2020 @06:19PM (#25424748)
Back up and consider if all of the turns you made to get down this particular blind alley actually made sense. “First principles” and all that.
Re:Eric Engstrom, co-creator of DirectX, has died by CRConrad on Tuesday December 15, 2020 @06:40AM (#25429329)
> What do you mean by projections?

@Jtsummers puts it as “Map the problem into other domains”; another interpretation (or a variation on the same) is “look at it from a different angle” or “look at it in a different light”. Do both -- move around with your light source, shine a torch/flashlight at your problem, and different shapes will be “projected” onto the wall behind it. Kind of like, if you are familiar with Hofstadter's _Gödel, Escher, Bach_ -- remember that “G,E,B” cube pictured on the cover of many editions? A more or less abstract “thing” or idea can be “projected” into different practical views depending on perspective. In actual practical work talking about “projections” can of course feel a little highfalutin’; to me it's a bit like always talking about your RDBMS tables or views as “relations”.

But in a more philosophical sense it is of course perfectly valid. And AFAICS it's an age-old idea in Western philosophy; what I described above is essentially precisely what is known as _Plato's Cave_. (Which incidentally is why @tenken’s identifying it as “Eastern” feels quite peculiar to me.)