|
Suspicious Dish posted:Curious what people in here think of Arthur Whitney's code style. code:
Beef posted:I've seen a similar style before, with mathematician coders being the factor in common: Being kind of a mathematician coder, though more of the latter than the former tbh, more arguments come to mind: 1. Short variable names make it easier to visually recognize/parse a medium-sized formula at once. 2. In specific situations, certain identifiers may just be idiomatic, so calling something "K" or "I" could be down to familiarity and may in fact communicate well to someone familiar with the algorithm or problem domain. 3. Establishing one's own language can be a great boon to working with a problem; much of mathematics revolves around it. That's more a general comment rather than about the sources given; but it might explain a tendency in mathematicians to come up with seemingly weird internal dialects. I've certainly done it to extents. As to the question of what I think about the particular style, it seems to cross the line in the examples given, at least from today's standpoint, but I can definitely sympathize with it. In general, I do feel that there is an argument to be made in favor of what could be considered unreadable or unmaintainable code, just as there are arguments in favor of verbose identifiers and "plain" coding style (think Python's stance against higher-order functions). It depends on context (like how many inexperienced coders have to work with this), but from an abstract (what would you expect from your coders rather than what can you expect) standpoint, I think that too much is made of "coding style" and "readability". A reasonably proficient coder can read these things; if they can learn an API, they can learn some macros and snowflake idioms. However, consistency trumps policy - work with existing style rather than imposing another; and this goes both ways. double riveting fucked around with this message at 15:19 on Apr 5, 2018 |
# ? Apr 5, 2018 15:14 |
|
|
# ? May 25, 2024 00:45 |
|
Couldn't decide if this should go in any of the working/oldie/newbie threads: https://stackoverflow.com/jobs/162835/free-bass-fishing-lessons-for-full-stack-c-sharp-net-catch-co Certainly an interesting tactic for getting me to click on your job ad. For a probably-horror, have the idea behind this startup: https://stackoverflow.com/jobs/155287/full-stack-developer-at-sports-tech-startup-teamgenius Taking kids sports way too seriously but with an app! Munkeymon fucked around with this message at 16:11 on Apr 5, 2018 |
# ? Apr 5, 2018 16:06 |
ratbert90 posted:I just translated a massive project with 28 sub-projects from GNU Autotools to Meson. This is a good post, thanks. So I'm set to graduate from my doctoral program soon, and before I do I'd like to fix up the code for a pipeline I wrote (lest I see it in this thread in a few years). Right now I'm in charge of maintaining and updating it, but the pipeline is extremely useful to a lot of people so after I graduate maintenance will pass on to some other graduate students, my advisor, and whoever else is interested in the project. One of the things I'm looking at updating is the build system. Right now it is an artisanal handcrafted makefile, but I'd like to move it to something more maintainable / reasonable / portable, and I'm looking for suggestions. My current thought is actually autotools, because it's the de-facto standard in my field. Is CMake enough better than autotools that ignore that standard? Relevant info: the project is about 12 kloc of C++, with a few extraneous files that it needs to be able to refer to. Also, this will be run primarily on old CentOS clusters and old Ubuntu desktops (my advisor runs 12.04), so I can't count on a recent CMake being easily installable.
|
|
# ? Apr 5, 2018 19:04 |
|
VikingofRock posted:One of the things I'm looking at updating is the build system. Right now it is an artisanal handcrafted makefile, but I'd like to move it to something more maintainable / reasonable / portable, and I'm looking for suggestions. My current thought is actually autotools, because it's the de-facto standard in my field. Is CMake enough better than autotools that ignore that standard? VikingofRock posted:Relevant info: the project is about 12 kloc of C++, with a few extraneous files that it needs to be able to refer to. Also, this will be run primarily on old CentOS clusters and old Ubuntu desktops (my advisor runs 12.04), so I can't count on a recent CMake being easily installable. Lets make that a maybe. Downloading a current CMake binary generally works pretty well, is there a reason you cannot do that?
|
# ? Apr 5, 2018 19:25 |
Xarn posted:Lets make that a maybe. Downloading a current CMake binary generally works pretty well, is there a reason you cannot do that? Nah, that should work. Or, I guess if there's a problem with that, people can always build CMake from source. I was thinking that people would want to install it from their package managers, or use whatever is already on the cluster, but you are right--downloading the binary shouldn't be much of a hassle.
|
|
# ? Apr 5, 2018 19:49 |
|
What is the oldest cent distro you are using? Edit* To get Meson/Ninja working on Debian8, I did these steps: Meson: 1) Downloaded Miniconda using This script . 2) Ran the script and installed it to /opt/python3.6.4/ 3) Ran /opt/python3.6.4/bin/pip install meson 4) Added /opt/python3.6.4/bin/ to my path 5) Tarred /opt/python3.6.4/ and added it to the vagrant project. Ninja: 1) Downloaded ninja from This link 2) Ran './configure.py --bootstrap' 3) copied the resulting ninja binary into /usr/bin 4) Backed up the ninja binary to the vagrant project. FlapYoJacks fucked around with this message at 19:57 on Apr 5, 2018 |
# ? Apr 5, 2018 19:51 |
|
VikingofRock posted:old Ubuntu desktops (my advisor runs 12.04)
|
# ? Apr 5, 2018 19:52 |
|
why are you replacing something that works
|
# ? Apr 5, 2018 19:55 |
|
JawnV6 posted:why are you replacing something that works Maintainability/extensibility/others probably need to actually look/change it?
|
# ? Apr 5, 2018 19:58 |
|
Our build system "works" and needs to be replaced badly
|
# ? Apr 5, 2018 20:02 |
ratbert90 posted:What is the oldest cent distro you are using? CentOS 6.6. And thanks for the instructions! Neither seems too bad. Bonfire Lit posted:Your advisor should upgrade, 12.04 isn't getting security updates anymore. I know, and I've tried convincing her to update, but it's a losing battle. She's convinced that everything will break upon updating, which is a valid fear, because in my experience astonomy tools are notorious for breaking on OS updates and Ubuntu specifically seems to have more problems with updates than other distros. And she's more loathe to deal with that than she is worried about some nebulous security threats. I'm meeting with her this afternoon; I'll pester her about it again then and maybe I can convince her to update.
|
|
# ? Apr 5, 2018 20:09 |
|
VikingofRock posted:CentOS 6.6 I love not having tab completion in sftp or scrolling in top.
|
# ? Apr 5, 2018 23:04 |
|
VikingofRock posted:She's convinced that everything will break upon updating, She's not wrong, can you get a second machine for her to transition to?
|
# ? Apr 6, 2018 18:19 |
fritz posted:She's not wrong, can you get a second machine for her to transition to? I mean, she's my advisor, usually she's the one getting me machines if anything. Probably when I graduate this summer she'll put some of her newly-freed-up grant money towards a new computer, so really this particular problem will probably fix itself then.
|
|
# ? Apr 6, 2018 18:49 |
|
I have uncovered hell, and it is timezones. As part of a system upgrade, we discovered that some of our timezone files were out of date. Specifically, trying to set a particular new timezone in Russia would cause truly nasty things to happen, as in the page straight up would throw errors rather than loading because reasons. Anyway, so they update the timezone files, build new info, update the libraries, and it fixes that timezone. All done, right? Enter Buenos Aires. In the previous timezone files, it was marked thusly: code:
When we updated the timezone files, for whatever reason they switched Buenos Aires to this format: code:
Here's the thing: Argentina doesn't observe DST and hasn't for nearly a decade. The most recent I can find is that San Luis briefly experimented with it back in 2009 and enough people hated it that they stopped. So since 2009, all of Argentina is in "ART", or -3. This means that there is no rule in the IANA files for when DST begins and ends, because it's currently not observed at all. Now, the timezone library we were using to parse all this out, it has some code to handle the case of a timezone being marked as observing DST, but having no rules defined for when the switchover happens. DST is just assumed to be off all the time. If the zone DST is defined using the %s format. There is a bug in the library that causes the retrieval of the timezone abbreviation to fail. Specifically, it tries to access the DST switchover rule, but the switchover rule does not exist, and it chokes. There is a null check in the case of %s format, but not the split slash format. Adding a null check and falling back to 'DST always off' like the %s format fixed the problem. After figuring all this out and fixing the problem so the page actually loads, I went and checked to see where in our code it was trying to load the time zone and see what it was doing with it. It only cared about the minute offset, and immediately threw the abbreviation away. We never even use the data it was choking on trying to retrieve.
|
# ? Apr 7, 2018 02:27 |
|
"Falsehoods programmers believe about time zones"
|
# ? Apr 7, 2018 02:32 |
|
Time is an abomination. The universe would be much easier to program if everything happened simultaneously.
|
# ? Apr 7, 2018 02:34 |
|
https://www.youtube.com/watch?v=-5wpm-gesOY
|
# ? Apr 7, 2018 02:37 |
|
It'll all become easier once everyone's moved to DNT.
|
# ? Apr 7, 2018 03:05 |
|
I for one write all my date and time operations exclusively in the french revolutionary calendar and swatch internet time. Happy .beat 279 of 18 Germinal!
Xerophyte fucked around with this message at 05:45 on Apr 7, 2018 |
# ? Apr 7, 2018 05:43 |
|
quote:
i'm sorry, but whatever paul eggert says your time is, that's what your time loving is
|
# ? Apr 7, 2018 06:09 |
|
I am curious on what kind of app someone is writing where historians are calling you, seemingly out of the blue, going uh by the way... I'm just imagining a historian making a profile and going gently caress this is the wrong calendar I can't role play as King Henry the 8th now.
|
# ? Apr 7, 2018 06:10 |
|
DELETE CASCADE posted:i'm sorry, but whatever paul eggert says your time is, that's what your time loving is I dug a little further and the updated files have Argentina divided into 12 sub-zones, 9 of which don't use DST at all and 3 that do. Everything I've found elsewhere indicate that all of Argentina is -3 all the time, including a couple people I know who actually live there. Nude posted:I am curious on what kind of app someone is writing where historians are calling you, seemingly out of the blue, going uh by the way... I'm sure SOMEBODY must use the historical data for something but I imagine it's 100% useless for 99.9% of people who just wanna know what loving time to show their users RIGHT NOW.
|
# ? Apr 7, 2018 06:22 |
|
Nude posted:I am curious on what kind of app someone is writing where historians are calling you, seemingly out of the blue, going uh by the way... I guess your name isn't Bill or Ted.
|
# ? Apr 7, 2018 06:58 |
|
UraniumAnchor posted:I'm sure SOMEBODY must use the historical data for something but I imagine it's 100% useless for 99.9% of people who just wanna know what loving time to show their users RIGHT NOW. What a weird outburst. Historical data just changed: we're not talking ancient history, a change happened what, two weeks ago? Do you want to show wrong timestamps for last month's events?
|
# ? Apr 7, 2018 13:51 |
|
hackbunny posted:What a weird outburst. Historical data just changed: we're not talking ancient history, a change happened what, two weeks ago? Do you want to show wrong timestamps for last month's events? When I say history I mean the parts of the data that fall under 'we have no events in the app that are this old'. The frustration is more because it's apparently not even completely correct for parts of Argentina NOW.
|
# ? Apr 7, 2018 14:52 |
TooMuchAbstraction posted:Time is an abomination. The universe would be much easier to program if everything happened simultaneously. Definitely. We would also not care much about halting problems or P-NP questions.
|
|
# ? Apr 8, 2018 08:21 |
|
Tom says a naughty thing there and says that Unix timestamp is the solution to leap seconds but it definitely is not. Unix time does not have leap seconds - it is a count of seconds since January 1 1970 minus the leap seconds!
|
# ? Apr 8, 2018 16:35 |
|
Timezones are the devil and if you're rolling your own library, congrats, you've stared into the abyss and it's stared back.
|
# ? Apr 8, 2018 18:33 |
|
TooMuchAbstraction posted:Time is an abomination. The universe would be much easier to program if everything happened simultaneously. Thanks, I just understood the plot of Final Fantasy eight. Ultimecia is a programmer
|
# ? Apr 8, 2018 21:52 |
|
iospace posted:Timezones are the devil and if you're rolling your own library, congrats, you've stared into the abyss and it's stared back. Definitely not rolling my own library, but after realizing this one's got this stupid bug in it and hasn't been updated in years I'm going to look into switching to something else.
|
# ? Apr 9, 2018 03:05 |
|
iospace posted:Timezones are the devil and if you're rolling your own library, congrats, you've stared into the abyss and it's stared back. I think at that point you've leapt into the abyss yelling "this can't be that hard".
|
# ? Apr 9, 2018 15:33 |
|
EssOEss posted:Tom says a naughty thing there and says that Unix timestamp is the solution to leap seconds but it definitely is not. Unix time does not have leap seconds - it is a count of seconds since January 1 1970 minus the leap seconds! It's the solution to leap seconds in the same way it's a solution to time zones: It just doesn't give a gently caress about them. Which is great, because neither do I nor most of anybody else. Converting a unix timestamp to human readable and localized is a display issue, not an implementation issue. There can't be 'invalid' values or, particularly if using decimals, seconds that are longer than others. Moar: https://www.youtube.com/watch?v=84aWtseb2-4 Ranzear fucked around with this message at 19:28 on Apr 9, 2018 |
# ? Apr 9, 2018 19:15 |
|
not giving a gently caress about leap seconds would be if it was just a count of the number of seconds since Jan 1 1970, the unix timestamp explicitly does care about them (because it wants to be able to keep the 1 calendar day = 86400 seconds fiction)
|
# ? Apr 9, 2018 19:40 |
|
The only correct time reference for use on Earth is Geocentric Coordinate Time, obviously.
|
# ? Apr 9, 2018 21:18 |
|
double riveting posted:The only correct time reference for use on Earth is Geocentric Coordinate Time, obviously. I'm more of a fan of Egocentric Coordinate Time.
|
# ? Apr 9, 2018 22:01 |
|
double riveting posted:The only correct time reference for use on Earth is Geocentric Coordinate Time, obviously. wikipedia posted:It is equivalent to the proper time experienced by a clock at rest in a coordinate frame co-moving with the center of the Earth: that is, a clock that performs exactly the same movements as the Earth but is outside the Earth's gravity well. Am I reading it right that this means a second on the surface on the earth is some different amount of time than a second in this system?
|
# ? Apr 10, 2018 03:45 |
|
KernelSlanders posted:Am I reading it right that this means a second on the surface on the earth is some different amount of time than a second in this system? Yeah. Time doesn't move the same speed at different places in the gravity well. Or, rather, if you try to synchronize clocks along a gravity well, you have to consider the one further in as slower.
|
# ? Apr 10, 2018 03:51 |
|
Ranzear posted:It's the solution to leap seconds in the same way it's a solution to time zones: It just doesn't give a gently caress about them. if you pick 1970/01/01T00:00:00Z as a UTC timestamp and convert that precisely to a unix epoch, you should technically get -27 as a value. If you use UTC formatting to validate the input to your internal epoch conversion and that you use an unsigned integer, you underflow and get millenias in the future. There's suspicions that this is what ended up bricking a bunch of iPhones a few years ago: https://www.theguardian.com/technology/2016/feb/12/setting-the-date-to-1-january-1970-will-brick-your-iphone-ipad-or-ipod-touch
|
# ? Apr 10, 2018 03:55 |
|
|
# ? May 25, 2024 00:45 |
|
KernelSlanders posted:Am I reading it right that this means a second on the surface on the earth is some different amount of time than a second in this system? Even satellites in Earth's orbit need to account for this to get the accuracy we expect, due to their velocity.
|
# ? Apr 10, 2018 04:21 |