@pjh They're all different from each other; they've got different numbers written on them. GENIUS!
dkf
@dkf
The background picture in my profile is one I took myself. It's taken at Niarbyl in the Isle of Man, and is looking south-west along the coast. It's a splendid place, though it tends to be a bit… bracing most of the time; the picture was taken on one of the rare relatively calm days.
I do software engineering to support scientists at a research university. I get to work with a lot of fields and see many (usually small) WTFs. I also write software for fun. There's a really good chance you're using something I've written right now and you don't know it. That pleases me a lot.
Am I a polymath as well as a software engineer? If that means someone who gets to dabble on lots of areas of human endeavour without having to spend ages learning masses of background, then maybe? It'd be pretty cool if it was true!
Best posts made by dkf
-
RE: Spot the difference: Chickens.
-
RE: Guy leaves programming career because he wants to change the world... meditating
@Jarry said in Guy leaves programming career because he wants to change the world... meditating:
he decided he wants to make the world a better place, meditating.
Well, if he's stopped writing shit that other poor folks have to maintain, he will have made the world a better place.
-
Shuffling off this mortal coil
One of our (thankfully now former) developers was writing some code to randomly distributed things over a grid. That developer was someone who loved to write what he thought were super-fast algorithms that were simultaneously as Pythonic as possible. He never met an advanced feature of a programming language that he didn't want to work into what he was doing, whether or not it was useful, and Python is a language that gives you a lot of rope for mischief indeed. Why would you use classes when you could use something custom? Why would you write a simple sort when you could use a complex list comprehension instead? His code was often extremely short and had a beautiful surface reading, yet would open great chasms of bewilderment once you poked under the covers.
Now, the grid was of reasonable size, but 256×256 really isn't exactly massive. The only real nuance was that the things that were being distributed would sometimes be much fewer than the number of grid cells, and other times would end up needing to cover the whole grid; a few orders of magnitude of difference in the number of items.
Now, there's a well known algorithm for doing random placing of a dense collection: shuffle the items or the places and just match them up against each other. It's been around forever and is pretty simple: shuffle the grid points in a big list and then match off against the set of things to be placed. It takes linear time; nice and efficient, no surprises. The only time you ought to consider picking anything else is when the number of items to place is much much smaller than the number of points you could use, when you'd pick random places and hope that there were no collisions. That'd happen some of the time with our application, but often there'd be a lot more loading.
But the developer in this little story just couldn't see past the fact that that algorithm would need to quite a bit of work in the case that there were very few points, so he decided to use the random selection algorithm for all the items. He'd just kept a set of locations that he'd already used and retried placing if the point had already been used.
Sure, his code worked fine with the test cases he ran, and was extremely fast. But as the number of points increased, things would go strange; the amount of time to place the items would increase massively. (What was happening was that as the number of used points increased, the probability of choosing an unused point would decrease and the number of iterations would increase. Massively so, as the target loading factor approached 1.) This was unacceptable! Being under a bit of pressure due to his impending departure for pastures new, and unwilling to admit that an up-front shuffle would be better, he came up with a “clever” adjustment to his algorithm to stop the infinite looping problem. He put an upper bound on the number of iterations used. That pesky apparently-infinite loop gone: the amount of work required was now strictly bounded and everything was fine!
Our (enormously more competent) intern had a good look at this code yesterday, and noticed that it would tend to not place all the items; a random selection would simply get forgotten. She realised that the code, which could have been using that classic shuffle and been working correctly with a few hours coding, had instead started out using a Bad algorithm (which would produce a right answer eventually) and then, under mild pressure, had been converted to a Fail of a non-algorithm that didn't produce even a vaguely correct answer.
I don't remember our intern actually facepalming before.
Our former developer's code is gradually being converted into things that work with more conventional code and less crazy, and in the process is becoming often orders of magnitude faster. Smartass coding is all very well, but paying attention to what costs and what you can cache actually works better.
-
CSVs ought to be in ASCII
Sometimes, Microsoft just makes you wonder what they are thinking.
I happen to have some code that generates a CSV that contains, among other things, a list of student names (it'll also contain automatic marking info). Some of those student names contain diacritics (because that's how things go). No big deal, just make sure the CSV is written out as UTF-8 (the system encoding on Macs and Linux) and write it out like that. Job done.
Then double-click on the resulting file to open in Excel for Mac to get the mojibake experience! Because when opening a CSV you don't use the platform's default encoding! It doesn't even work when you put a BOM at the beginning of the file or choose an explicit import using UTF-8 (unless you like the diacritics converted to underscores). Huh.
What about if we export a file from Excel with these characters in? Surely that will work. Well, on output it generates the file using Mac Latin (:WTF:?! Nobody else has used that in the OSX era.) and when reading it back in, the same file it generated, it really assumes that it's CP1250, the Windows Western European encoding (a.k.a., not-quite-ISO8859-1). Well done, Microsoft, you've made some software that can't even round-trip with itself let alone with any sane tool, at least not without making a whole bunch of twiddly adjustments along the way.
What's better, the bug report on this has a truly pathetic corporate response:
Excel for Mac does not currently support UTF-8.
If this is a feature you’d like to see in future versions of Office for Mac, be sure to send your feedback by clicking “Help” > “Send Feedback…” in any Office application or by clicking on the link below:
The link is the standard feature request one. Total failure to understand what is going on here. Idiots.
-
RE: The International Space Station is finally getting a printer upgrade
@gąska said in The International Space Station is finally getting a printer upgrade:
They're one of the most technologically advanced organizations in the world. Why print out anything?
They are part of the US Government. They have to print things out to show that they are conforming to the Paperwork Reduction Act.
-
RE: Which is better? Australia or Maths? There's only one way to find out....
@pjh He ought to try repealing the Law of Gravity and then proving his success by stepping off the top floor of a high building.
-
RE: WTF Bites
@tsaukpaetra said in WTF Bites:
"C:\WINDOWS\system32\rundll32.exe" Shell32.dll,Control_RunDLL input.dll,,{C07337D3-DB2C-4D0B-9A93-B722A6C106E2}
DISCOVERABLE!
-
RE: In other news today...
@PJH Sounds like they've emulated the behaviour of human BMW drivers perfectly!
-
RE: Signs your code is unmaintainable
For a bad code practice, the monkeypatching done widely in the Ruby-on-Rails community is a classic example of how something that makes things appear easier on the surface can really shit on long-term maintainability. The core of the issue is that it makes things so massively magical that when things go wrong, it's very hard to figure out ways to fix them in a sensible amount of time/effort. You end up with something that starts out great but progressively converts into codethulhu's pet black hole and nobody can figure how you got there because every step along the way seemed like a great idea at the time.
Latest posts made by dkf
-
RE: Today in reading the headlines...
@izzion said in Today in reading the headlines...:
@dkf said in Today in reading the headlines...:
@DogsB Were the student and thief in Limerick at the time, or was that just some previous encounter? (Not gonna read the article to find out...)
Sir, that is not an appropriate question for this thread.
The question is fine. Answering it would not be.
-
RE: Today in reading the headlines...
@DogsB Were the student and thief in Limerick at the time, or was that just some previous encounter? (Not gonna read the article to find out...)
-
RE: WTF Bites
Naive question, but why did that take so long?
Probably because there weren't many people working on it and it wasn't a high priority project for them?
-
RE: WTF Bites
@Zerosquare said in WTF Bites:
we wish we could make robots with that sort of thing!
Errrr... I don't think you'd want to make robots based on Tsaukpaetra-ware. Unless the goal is "make sure they won't ever overtake humanity", maybe.
It would be better than what we have now. The state of robotics is genuinely terrible, deriving largely from industrial tools rather than anything else.
-
RE: WTF Bites
@Tsaukpaetra said in WTF Bites:
@Zerosquare said in WTF Bites:
It's not implemented on your hardware?
Wetware-assisted processing offload works, until it doesn't.
It's part of your BIOS, and is driven by a coprocessor in wetware. That same coprocessor also handles most of the details of muscle control; we wish we could make robots with that sort of thing!
-
RE: The Official Funny Stuff Thread™
@Gern_Blaanston said in The Official Funny Stuff Thread™:
I'm pretty sure that geese are usually naked.
That, or you can't see the geese when they dress up as ninjas.
-
RE: I, ChatGPT
@Carnage said in I, ChatGPT:
I think it's a local maxima optimization for AI, and it's gonna get slightly better and then hit a ceiling. It'll keep being a statistical word analysis, no matter how much input they can take. It's a very good fake. There is also the problem of AIs being fed the products of AI, which will cause it to regress to a mean according to whatever statistical djinn is running things.
It's an interesting toy, and in some cases a pretty nice tool, but it's basically maybe the next step in "search" for information. I'm still waiting for the same mountain of hardware and attention being applied to genetic programs instead. I believe that there is more interesting possibilities there than in NNs.
Or some entirely new thing that hasn't been thought of yet that's gonna be developed in someones garage and just take the world by storm, as is the common way to do further things in IT.
The big problems with LLMs are that they can't plan and can't truly identify critically salient points that they need to hold in a longer-term context. You can do that for them — many people are excellent at those sorts of tasks (when not bored and/or distracted) — but then it isn't AGI, but rather just a fancy decision support system for a person. Improving the true learning capabilities would help a lot, but current standard AI architectures suck at that. (Neuromorphic AI seems to be able to do better, much better, but uses a completely different computation scheme and needs a lot of investment to catch up with the billions pured into LLMs. But I'm biased as that was an area I was working on the edge of until late last year; other approaches might also work and be easier to adapt what we have to.)
The most interesting aspect of LLMs for me is that they are clearly simulating some of what happens in creative thinking. Pairing them up with an AI that can go "no, that's impossible, try again in this area" would be fruitful. (That's sort of what a Planner would do, except our planners are far too crude.)
-
RE: The Cat Status Thread
@HardwareGeek said in The Cat Status Thread:
@dkf said in The Cat Status Thread:
That's what cats have claws for: hoicking
bits of food out ofthemselves into spots too awkwardto get their mouth.And scratching the hands that
feedpet them.Nature's multitools...
-
RE: I, ChatGPT
@boomzilla quoted in I, ChatGPT:
(I subscribe to this latter hypothesis, by the way -- some reasoning, not great reasoning)
It's recalling reasoning from its training material and pattern matching against that.