« first day (3987 days earlier)      last day (953 days later) » 

12:33 PM
What language's programs have the longest life? Like once a piece of code is written, it tends to be used for years and years without re-written?
 
Probably FORTRAN for the most part
but those are also very very specialized applications
 
I was think more like ... C? Could be COBOL, but I don't know COBOL that well. I mean, most of the drivers & communication tools are written in C.
@Mgetz What kind of specialised applications?
 
COBOL is a curious one
@TelKitty Numerics applications. Just like COBOL they tend to be write once use until its no longer useful
 
 
nwp
I managed to get the brightness thing working. It turns out that either SetMonitorBrightness or IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS works, but apparently never both.
Yesterday I was confused for hours why IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS doesn't exist even though I included all the headers. It turns out that #define WIN32_LEAN_AND_MEAN does have its drawbacks.
 
In all fairness, most people don't need to touch this?
so why include it
 
nwp
Not including something should be done via not writing #include <header>, not via #define SPECIAL_MACRO.
 
1:19 PM
and MS has started doing that?
Buuuut that shift happened more recently than that particular functionality
 
nwp
I also got screwed again for not having partial template argument deduction when making a std::unique_ptr with a custom deleter (when else will I get the chance to DestroyPhysicalMonitor?) and then again because std::function does not support move-only types. So now it's a std::shared_ptr which solves both issues at the cost of making me unhappy for having used it for non-multithreading purposes.
 
@nwp as long as the destructor is visible at the time of destruction you can use std::unique_ptr
it's awkward but I've done it
 
nwp
1:35 PM
Well, I cannot. I need to capture that std::unique_ptr in a lambda which makes the lambda move-only which means I cannot assign it to std::function anymore.
 
I don't want to know why you're using std::function do I?
 
nwp
It's because sometimes you need to use SetMonitorBrightness + DestroyPhysicalMonitor and sometimes IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS + CloseHandle. Stuffing then into an std::function<void(Brightness)> seemed like a reasonable way at the time.
You can also do it with a bool and avoid those issues. You even have the same signature for DestroyPhysicalMonitor and CloseHandle.
 
nwp
Seems more of a pain than std::shared_ptr, but I guess if you do more WinAPI stuff than setting the monitor brightness it might be useful.
 
I'm currently using WRL which preceded that and it ships with visual studio, all I had to do was define a traits class for the specific type of handle I was using
but yeah if I was doing more I'd probably use WIL
 
 
3 hours later…
4:52 PM
The pain people put themselves through...
0
Q: "This library now requires a C++11 or later compiler..." when compiling 'number_base.hpp' of boost library

Xiang YueI have a c++ project using boost 1.77.0 library. The compiler is g++ 4.8.5, and as I know it supports the c++11 standard. The following command is used to compile the project: g++ -std=c++11 main.cpp Logger.cpp MOCMesh.cpp Mesh.cpp CFDMesh.cpp Solver.cpp -o main -I../tools -I/usr/code/include -I....

 
😭
 
nwp
Programming in hard mode. Just add permadeath and you can become a streamer.
 
 
1 hour later…
6:22 PM
Oh god I forgot it was september...
 
 
2 hours later…
 
1 hour later…

« first day (3987 days earlier)      last day (953 days later) »