« first day (2175 days earlier)      last day (2770 days later) » 

3:00 PM
0
A: A New Silver Badge That Robots Simply Can't Win

R. Martinho Fernandes A New Silver Badge That Robots Simply Can't Win But... Q_Q

 
nwp
TFW you have to write a thing with 20 pages where you have to find references and find enough references to get to 20 pages, and then they tell you that the references don't count for the page count .... I'm down to 5.
oh, and it is due tomorrow
 
everything can wait
 
nwp
lets see how high I can make the font size and space between lines
 
font size 22 comic sans
 
Xeo
@R.MartinhoFernandes WHAT
that codetalks thing is today
in Hamburg
why didn't I know
wait, that was only posted 23h ago
3
tch
 
3:06 PM
Always late to the party
 
Xeo
geh
it's expensive
 
At least you're here
So you're one of the cool kids
 
Xeo
ah, now I know where some of my team members are
heh.
Damn, and I can't contact them
or I could get them to tell someone there my email.
 
I can't seem to differentiate a function call from a tuple. ;;
 
@R.MartinhoFernandes If I thought you could get there without getting lost, I'd try to convince you to take the day off to go to Hamburg, just so "THE robot" could be among the first awarded the "not a robot" badge. :-)
 
3:11 PM
OCaml syntax is ThePhD's new projection matrices
 
Xeo
@JerryCoffin can't buy tickets anymore :<
 
Are... OCaml functions not allowed to have more than 2 arguments...?
 
@ThePhD ...OCaml functions always have at most 1 argument. Because they are curried.
 
More than 1 to be exact
Griwes'd
 
@Xeo I also think this should be awarded ex post facto for those who attended qualifying functions in the past...
 
3:13 PM
But then what are these functions were I define map key ?
 
Xeo
@Griwes declaration-wise, it's still more though, so don't confuse the poor guy!
He's confused enough already
 
@Xeo It's better to think in all curried though. :P
Good; that way when he finally gets it he will always remember. :P
 
@ThePhD You can see every function that takes n arguments as a function that takes 1 argument and returns a function that takes n - 1 arguments
this is not complicated
 
<_>
I am the sads.
 
Xeo
@ThePhD What is declared as [](auto a, auto b){ ... } is actually [](auto a){ return [a](auto b){ ... }; } - that's currying.
 
3:14 PM
3 hours ago, by Griwes
It's not a function with n arguments returning a value, it's an nth-order function returning an (n-1)th order function returning... and so on.
Griwes'd again.
 
Doesn't count I wasn't there
 
pfff
 
I... don't know how to write this then.
Fuck.
 
Xeo
gawd
do I need to learn OCaml to help with this?
 
pls no ;~;
You'll just send me to the corner
 
3:15 PM
Banished forever
 
Okay, what are you trying to do wrong, this time?
 
Uh. Nothing too heinous? ;;
 
;; as in OCaml? lol
 
let swap li (key, val) = List.cons (fun -> (val, key)) li;;
let counts = StringMap.fold swap (count_words ["bark";"bark";"woof";"bark";"woof";"pant";"meow";"meow";"meow";"meow";]);;
 
...why are you swapping this
 
3:17 PM
Trying to basically reverse the order of key, value
 
please tell me you're not swapping this just to sort it
please
 
Now, listen. Before you judge me, I know I can sort on the second value, but, BUT
I figured this would be a nice exercise.
 
lol
 
Judged
 
let swap (x, y) = (y, x)
let swap_list = List.map swap
 
Ell
3:19 PM
Griwes
Don't spoil it for him
 
lol swapping elements by folding on the list :D
@Ell You have to see some ready examples to figure the general idiomatic way to do things though.
 
can't wait to see him pick up Prolog
 
:D
 
3:36 PM
@JerryCoffin whistles
If I happen to be at one such event, I'll avoid the badge on principle.
 
Ven
Don't be mean
 
4:00 PM
Is there a easy way to zero-initialize on new Object before the constructor runs? new Object{} doesn't seem to do it.
 
@Ven He isn't mean. He's median.
 
I have a 500 member struct that I'm trying to compare for diffs. It has a mix of pod and non-pod fields. And not all members are always initialized.
I need to ignore diffs for uninitialized members.
 
@Mysticial MSVC?
 
GCC
 
@Mysticial If you're really desperate, you could create a builder function that allocates raw memory with operator new, then zeros the memory, and finally does a placment new to invoke the ctor.
 
4:02 PM
@Mysticial {} should zero init
 
@PatrickM'Bongo That's what I thought. But when I do this it still shows stack garbage:
Object* obj = new Object{};
cout << obj->some_int_field << endl;
Personally, I would never have a single struct with 500 members. But that's what I've inherited.
I already bit the bullet to write a comparator for the 500 members. But now I need deal with this initialization shit. lol
 
Is your object POD, or aggregate?
 
An aggregate of PODs and non-PODs. No constructor defined.
Mostly integers and std::strings. But there's also an unordered_map in there.
 
o.O I'm fairly sure {} for aggregates zero inits all members, can anyone more qualified than me confirm
 
4:08 PM
Can I overload new so I can manually memset(0) before placement new?
17
Q: Overloading operator new for a class

user673114When we overload new operator of a class, we declare the function as a member function. For eg: class OpNew { public: OpNew() { cout << "OpNew::OpNew()" << endl;} void* operator new(size_t sz) { cout << "OpNew::new: " << sz << " bytes" << endl; return ::new ...

 
I don't think you can memset(0) on a non-POD
 
> If the number of initializer clauses is less than the number of members and bases (since C++17) or initializer list is completely empty, the remaining members and bases (since C++17) are initialized by their default initializers, if provided in the class definition, and otherwise (since C++14) by empty lists
 
@Mysticial You can replace new on a per-class basis, in which case you wouldn't have to do a placement new (but this would only work for dynamically allocated objects).
 
Aggregate-initialization rules are horrible.
 
@R.MartinhoFernandes that sounds... broken
 
4:10 PM
@JerryCoffin For now, I only care about the one site where I'm new'ing. And I have control over that.
I'm doing some refactoring, and I need to make sure that I don't break any shit.
 
@JerryCoffin But then might as well just write the ctor.
 
@R.MartinhoFernandes The ctor will default construct all the non-PODs before I have a chance to memset the object to zero.
Wait...
 
@R.MartinhoFernandes I can't agree. A replacement new (especially one that just passes through to ::operator new, then zero-fills) is trivial compared to a ctor that has to individually initialize a huge number of members.
 
I inherit the object from a dummy class. I give that dummy class a constructor that takes a size.
 
@Mysticial No, that's what the init list is for.
 
4:12 PM
Then I memset() that many bytes in the dummy class. That will let me memset the object before the ctors for the non-PODs in the big object runs.
 
@Mysticial Still problematic. You want to do the memset before any ctor even starts to run.
 
But still lol 500 fields in a struct
 
@JerryCoffin I know, but it's just for the duration of the refactor.
It's not something I'm submitting.
 
@Mysticial OH SHIT I MISSED THIS
@JerryCoffin Nevermind.
 
I have some really ugly code that creates and returns a pointer to a 500-field struct. (no RAII yeah!). I need to refactor that code. And I need to make sure that the object it returns is the same before and after the refactor. Uninitialized members don't matter.
 
4:15 PM
@Mysticial If it's just one site, I'd just rewrite foo = new bar(args) as temp = ::operator new(sizeof(bar)); memset(...); new (temp) foo(args); and be done with it.
 
@Mysticial ...work code? :Ð
 
@PatrickM'Bongo yeah
 
withdraws application
 
Ven
@JerryCoffin I'd be mean to people but I don't feel confident enough, because I'm barely average
 
@Ven But average (even just barely average) is still mean.
 
4:17 PM
@JerryCoffin That works? I can safely call delete foo later?
 
Ven
I mean, it might be true
 
I was thinking more on the lines of this:
 
@Mysticial I think so; though ptr->~foo(); ::operator delete(ptr); is the paranoid way to do it.
 
Object* obj = new Object{};
obj->~Object();
memset(obj, 0, sizeof(Object));
new (obj) Object();
 
Those first two steps are pretty much going to be the same as ::operator new but slower.
 
4:19 PM
@Mysticial Should be able to.
 
@R.MartinhoFernandes oh, I didn't know that.
 
Ven
Oo
 
delete foo is pretty much just shorthand for foo->~Foo(); ::operator delete(foo);
 
@Mysticial new is basically shorthand for op new+placement-new.
 
@Mysticial christ
 
4:20 PM
@R.MartinhoFernandes Ah... I didn't know that existed.
 
@Mysticial needs more std::launder
 
operator new is functionally malloc.
 
Every part of this code is bad in every way you can imagine. No RAII, raw new's and delete's. A 2000-line function in a 5k line file.
 
@Mysticial withdraws application and blocks HR
 
No consistent formatting.
Basically every time someone added a new exchange, that person copied in their own initialization with their own personal formatting. Nobody bothered to split up the file over time.
And now it looks like it's my job to clean some of this up.
 
4:23 PM
"clean"
@Griwes BTW I have a question regarding std::launder
 
not again
 
@Mysticial good luck with that...
 
@Griwes yes again
 
file not found again
 
4:25 PM
I would pester Luc with it also but he's not here atm so
 
lol
 
@ratchetfreak Welcome to the world of finance programming. Unlike at Google, not everybody is necessarily good at programming. So technical debt on top of technical debt has compounding interest.
@R.MartinhoFernandes I wish I could do that, but everyone uses it.
 
@Mysticial I like how you worded that "not everybody"
Euphemisms
 
@Mysticial That's what Burke said!
 
burkakke
channeling my inner rightfold
 
4:27 PM
task: refactor god object into something sane
estimated cost: infinite
 
> Ripley: I say we take off and nuke the entire site from orbit. It's the only way to be sure.
Private Hudson: Fuckin' A!
Burke: Hold on, hold on just a second. This installation has a substantial dollar value attached to it.
Also relevant from Aliens:
> Private Drake: They ain't paying us enough for this, man.
 
@PatrickM'Bongo The code quality was actually worse at my previous place. Hardly anybody stays employed there for a very long time. So most of the code is written by people who are no longer there. That makes things a lot harder to maintain.
 
@Mysticial Plus as you said many developers have no background in programming
They just want to "get things done" (which is understandable, to some extent)
 
> Van Leuwin: It's what we call a shake-n-bake colony.
 
That being said I'm really surprised that = {} doesn't zero-init everything
 
4:33 PM
@PatrickM'Bongo I'd think that for non-POD that would do default construct for everything
 
that seems broken
 
seems non surprising
and won't mess with RAII
 
why would it zero-init (or value-init? I can never remember) pods and not aggregates
 
@R.MartinhoFernandes eel.is/c++draft/dcl.init.aggr#8
> If there are fewer initializer-clauses in the list than there are elements in the aggregate, then each element not explicitly initialized shall be initialized from its default member initializer ([class.mem]) or, if there is no default member initializer, from an empty initializer list ([dcl.init.list]).
 
@Mysticial Can't you just add assignment of zero with NSDMIs to all appropriate members?
 
4:36 PM
I believe this says it does init from default value where there's NSDMI, and value-init otherwise.
(And that the wording on cppreference is just very unfortunate.)
> [ Example:

struct S { int a; const char* b; int c; int d = b[a]; };
S ss = { 1, "asdf" };
initializes ss.a with 1, ss.b with "asdf", ss.c with the value of an expression of the form int{} (that is, 0), and ss.d with the value of ss.b[ss.a] (that is, 's'), and in

struct X { int i, j, k = 42; };
X a[] = { 1, 2, 3, 4, 5, 6 };
X b[2] = { { 1, 2, 3 }, { 4, 5, 6 } };
a and b have the same value — end example ]
IMO this is 100% clear that it does value-init where NSDMI is not present. @Mysticial
Hopefully this didn't change since a while...
 
@Griwes That's the same as what I quoted, no?
 
@wilx I could, but there's probably around 400 PODs in there.
 
@Mysticial Don't be a wimp! :D
 
@R.MartinhoFernandes I don't believe so?
29 mins ago, by R. Martinho Fernandes
> If the number of initializer clauses is less than the number of members and bases (since C++17) or initializer list is completely empty, the remaining members and bases (since C++17) are initialized by their default initializers, if provided in the class definition, and otherwise (since C++14) by empty lists
 
> Private Vasquez: All right. We got seven canisters of CM-20. I say we roll them in there and nerve gas the whole fuckin' nest.
 
4:39 PM
@Griwes how is the wording unfortunate? the default initializers is a direct link to NSDMI :P
 
@wilx I'm also less willing to do a lot of grinding work if I'm not actually going to submit it.
 
This suggests that it makes the choice for all members at once, and that'd indeed mean no value-init for foo{}.
While the text directly from the current draft explicitly says it makes that decision per element.
 
@Griwes I don't read it like that.
 
@R.MartinhoFernandes So much so, that (at least at one time, and I think still) void *operator new(size_t size) { return malloc(size); } is a valid implementation.
 
@R.MartinhoFernandes Ah. I can see how that can be interpreted differently now.
The wording is somewhat ambiguous, since we interpreted the "otherwise" as bound to different conditions.
 
4:41 PM
Yeah.
 
Okay, so the conclusion is that aggregate-init with empty braces value-initializes and @Mysticial 's code should've worked the way he wants it to?
 
I think so.
But I'm not in a mood to think about it too much.
 
I think that the standard text is pretty unambiguous.
 
I've been using list init for everything, never had any problem with non-value init
Don't make me review my code
 
@CatPlusPlus Go review your code.
 
4:43 PM
> Ripley: Did IQs just drop sharply while I was away?
 
@Mysticial Are you compiling your code in C++11/14/17 mode?
Frankly your issue baffles me
 
Aliens is awesome film.
 
@PatrickM'Bongo GCC 4.9. I'm less sure about the flags since there's several hundred of them and they're buried deep within the company's makefiles. Nobody is dumb enough to even dare look at it.
 
> Bishop: Not bad for a human.
 
@Mysticial Could be a compiler bug? Let me investigate
 
4:47 PM
@PatrickM'Bongo Btw, are you really applying to Citadel?
 
@Mysticial Makefiles? make VERBOSE=1 then. :D
 
can you repro on godbolt or something?
 
@Mysticial I got several recruiters to send me the same offer from them, so I applied, yes. (In HK)
 
@melak47 I'm not gonna bother trying. After all, I have shit to do that needs to get done.
 
:D
 
4:47 PM
But it's kinda far from where I live and I just moved so idk
@melak47 Am doing now
 
> Corporal Hicks: It's a bug hunt.
Ok, I'll stop now.
 
::operator new(sizeof(Object))
memset(0)
new (ptr) Object
finally does it.
At least it better.
@PatrickM'Bongo Ah... Any idea what department? The hedge fund or the HFT?
 
yep, before gcc 5.0 I'm getting 6 : warning: missing initializer for member 'robert::i' [-Wmissing-field-initializers]. 5.0+ and the warning is gone
 
@PatrickM'Bongo There's also a bunch of disabled warnings in the build options. That might be it. lol
 
Ven
4:51 PM
Good old -Wnothing.
 
Ell
Lol
That is p stupid
 
I have no control over that.
 
> Ripley: You sent them out there and you didn't even warn them. Why didn't you warn them, Burke?
Couldn't resist this one.
 
@Mysticial Market access, so HFT, presumably?
 
"Market Access" or "Market Making". I've never heard of the first one.
 
4:56 PM
Market access. Developing the middleware that translates proprietary trading protocols into protocols used by exchanges.
 
Oh that's very specific.
 
@sehe can I configure git to keep files in the repo but stop tracking them?
 
@PatrickM'Bongo Btw, the hedge funds do it electronically too. So I can't tell if they're looking to put you in the hedge fund or the HFT. The hedge funds need to do it electronically when they split up large orders over multiple exchanges. If they can't send the orders simultaneously, they'll get front-runned by the HFTs.
 
Ignoring did not help as they were already added
 
5:00 PM
@Mysticial I would think both share the same infrastructure
@Mysticial Very specific and very boring but also very important :w
And apparently quite demanded
Also most protocols are terrible and a pain to work with
 
@PatrickM'Bongo Here, the hedge fund and the HFT don't talk. They share no resources other than HR, a couple high-level execs, and the building they are in. That's for compliance reasons.
 
@Mysticial Understandable, but they can still share the same infrastructure to send orders as long as the accounts are separate.
 
No they don't.
There's that much separation.
 
Are you saying they develop everything twice
 
Correct.
 
5:02 PM
lol
 
All for compliance reasons.
I'm not sure on the exact reasons, but I believe it might related to wash-orders. It's normally illegal to trade with yourself. And that's unavoidable between the hedge fund and the HFT. So they just declare themselves to be separate companies with the same owner and it keeps the feds happy.
 
Well, if your system is well designed, self trades never leave your internal infrastructure
 
@JohanLarsson "stop tracking them"?
 
But then given the scale of Citadel maybe they simply can't do that, idk
 
IOW, if the hedge fund was about to place a large sell order on say Apple. It would be illegal for the hedge fund to tell the HFT to cancel all their marketing making orders on the buy-side for Apple in anticipation that the hedge fund is going to wipe out 10 price levels.
 
5:05 PM
They do manage a massive amount of money
 
@milleniumbug I don't want changes to be checked in any more, dunno how to word it
 
git rm --cached
 
@JohanLarsson ah, so the modifications to the file aren't shown in the git status command, for example?
 
I dunno the commands as i use gui, but think so yes :)
 
and you aren't able to accidentally push the file
 
5:10 PM
yeah
 
as if you're ignoring the file, but not the version you've initially pushed
 
or more that I don't have to scan and make sure to not stage them by mistake
 
interesting
 
yep, exactly
Not a very important use case
 
tbh it feels a bit contrived, but heh
 
5:11 PM
could make a separate repo for them but makes sense to have them where they are
@milleniumbug it is for the demo project.
 
user1804599
////////////////////////////////////////////////////////////////////////////////‌​/////////////////////////////////////////////////////////////////////////////////‌​////////////////////////////////////////////////////////?////////////////////////‌​////////...////////////////..............
 
user1804599
I spilled sugar over my keyboard and it's all sticky now
 
user1804599
fml
 
Xeo
rip keyboard
 
user1804599
Well it survived coke a few years ago ;p
 
user1804599
5:15 PM
eject button was a little sticky back then
 
user1804599
but it dried up now
 
user1804599
but this laptop is from 2009 and slow
 
user1804599
maybe I should buy a new one
 
user1804599
I'm going to a Facebook hackaton in London /cc @Ell
 
Ell
@rightfold nice :D
 
user1804599
5:21 PM
Only one day though
 
user1804599
of the two
 
lol the US Libertarian Party candidate can't name any foreign leader.
 
lolbertarian
 
@R.MartinhoFernandes Well it's not like he cares about any foreign country.
 
Hello I have this
void start_new(char path) {
char write_name[] = "Hello Mrs " path " Welcome!";
}
when I do start_new("path here"); it's not work
 
5:28 PM
These people really have their heads up their butts, don't they?
 
user1804599
void start_new(std::string const& path) {
    auto write_name = "Hello Mrs " + path + " Welcome!";
}
 

C++ Questions and Answers

Solve problems and approach solutions. Just ask and lurkers wi...
 
with pointer?
and how I call the function?
 
user1804599
Don't use pointers if you are not a C++ expert.
 
He also doesn't know what Aleppo is.
 
5:30 PM
Is it an instrument
 
That's bad advice really, just say "don't use pointers". Experts will figure out when they can and need to use them.
 
the code is for c11
 
His excuse was that merely knowing what it is doesn't qualify you for President. As if not knowing did.
@IsabelCariod This room is for C++, sorry.
 
but was good good answer Thank!
but not not completely
 
@R.MartinhoFernandes Who? Libertarians? Not particularly, no. Only idiots-who-identify-as-libertarians do.
 
5:35 PM
I don't see a difference
 
Stronk statement there.
Well, I don't really disagree with you.
 
C++ is all about pointers
8
without pointers headache it;s not a C++
 
Wow, that UB guy on meta really took a beating over night. ahaha
 
user1804599
xD
 
Of course he did.
You don't waltz in and pretend you know everything when you clearly do not.
 
5:43 PM
Deleting his answer actually helped put him out of his misery. Otherwise it'd probably be at like stupid -30 or something.
 
nwp
@EtiennedeMartel And here I thought that's how one becomes president.
 
Since it looks like the entire fucking SO C++ community descended on the guy to tell him he's an idiot.
 
#politics
 
who is idiot?
 
@Mysticial The Lounge and Meta, united into a glorious crusade.
 
5:44 PM
-38
Q: Should there be experts to review disputable answers?

KryptonSometimes the community does not really judge an answer on its correctness, but rather on the reputation of the one who answers (or some other reasons). For example, although the first answer to this question got the most votes, it does not correctly answer the question (read the comments to see...

 
@Mysticial The answer should be at -9001
 
6:06 PM
@Mysticial Oh c***. Forgot about that one. Yeah total BS on MS for that. — NathanOliver 44 secs ago
^^ idgi, what 4 letter word starts with "c" and works in that sentence?
 
Ven
crapo
 
cunt
 
I think it's supposed to be "fuck" with a typo. "c" is next to "f".
@milleniumbug But that's not grammatically correct.
 
Ven
@Mysticial no it's "crap"
"Oh crap"
 
but that's not profanity. lol
 
Ven
6:08 PM
..yes it is :o
 
no it isn't :)
 
Ven
It might not be where you live. I can assure you I'd get hella scolded if I ever use that in an english class
 
English class ^_^
 
Ven
yes
 
that's dumb
What kind of English class doesn't teach profanity?
 
6:11 PM
crap is a bit vulgar, but not to the point of being profane. Mostly it's frowned upon in formal English communication
 
Ven
every single ones I've had
 
user1804599
Nice, Erlang file:open has an option delayed_write, with which you can define not only the buffer size but also a flush timeout.
 
@rightfold Sweet, so no need for rewriting the file i/o :)
 
user1804599
@Mysticial coño
 
user1804599
@Mysticial cuck
 
6:18 PM
@Mysticial cunt, obv
 
@iksemyonov The big issue with efficient recursion is that in many languages, it enters a new stack frame; every time you recurse, you create more state in memory. A looping construct usually only carries 1 state throughout the entire run. Programming efficiently is very often about avoiding unnecessary overhead (steps, state, LOC, illegibility, etc.)
 
user1804599
lol languages without guaranteed TCO
 
@Aaron3468 I generally enforce a provable logarithmic depth to all my recursions.
 
@rightfold Yes, good languages can recurse very efficiently :)
@Mysticial That's a fair tradeoff I think
 
I think the only exception I have in my personal code is the parser for a JSON-like config file.
The user can technically nest an unlimited # of levels. But that's just asking to be shot in the foot anyway.
 
6:23 PM
In that case they deserve to wait hours if they have a 5GB config file
OTOH, I can see how that might become a security concern if the behaviour of your program isn't defined when the config file exceeds available memory
 
The use-cases for the config currently don't have arbitrary depths of DOM objects. But the parser will stackoverflow and crash if you did several thousand nested objects.
 
Honestly though, there's not a lot you could do to prevent it. Maybe spit out a warning/log file when the stack/depth exceeds the limits you expect, or if security's really important, terminate. You can't trust the system APIs to tell you the correct stack size if someone is actively trying to crack your program with a stack overflow
 
The memory limit would blow up way before that. The text reader reads the entire file into to memory. Then it detects the encoding and converts it to UTF-8. Only then does the parser touch it.
 
;-; One thing I've grown increasingly aware of is how there's no such thing as a universally correct program. Given a context of use, some approaches are significantly better, but those change the moment the program is used out of the context.
 
6:43 PM
This whole config thing came up recently when I was playing around with hardware detection. I realized early on that I cannot reliably detect the hardware configuration - let alone pick settings that are optimal. So I need a way to allow the user to input their own hardware settings. This combined with the program's existing web of options let me to the conclusion that I need a real configuration system. And not just cmdline parameters or cmdline UI.
 
Ah, very good decision. It also means that if there's a bug in one of your implementations, users can temporarily switch to a bug-free compatible implementation
 
Yeah. Right now, the program doesn't do much with affinities. So that didn't matter. But I plan to in the future.
The idea is that on startup, the program will create an map of core #s to native affinity handles specific to the OS.
That way I can set affinity based on the core id. The program will make a best effort to pick the core id that matches what the OS provides. This is possible on Linux, but not on Windows.
That part is easy.
The hard part is coming up with the correct groups of core ids (and their associated affinity masks) that correspond to NUMA nodes or other "locality" groups.
The program will provide a default "best effort" set of assignments. The user can change them via the config.
 
6:59 PM
@Mysticial I can see how that would be a difficult problem. It's similar to being given a set of colours and trying to sort them according to similarity to a palette. There's just no well defined solution
 
The problem is that when we're talking about machines with hundreds or thousands of logical cores, I'm not gonna ask the user to input them manually into the cmdline either as a parameter, or part of the UI. (and do it every time they run the program)
 
Haha, of course not, so your automated best effort solution needs to at least be performant
 
Yeah, the config will at least let them do it just once. Then they can reuse the config.
 
Mornevening.
 
Good morning!
 
7:03 PM
So the config file starts with a large comment section that displays what the program thinks the hardware configuration is. Below it is the actual configuration with the best-effort group assignments. This file is generated automatically if it doesn't already exist. The user can then edit the actual configuration.
Comments is one of the reasons why I opted not to use exactly JSON, but rather a variant of it.
 
I imagine that trimming comments out to yield valid JSON would be a trivial task though
 
There's also other issues with JSON, that I didn't like. I can't duplicate keys. And it doesn't preserve ordering within objects. While those aren't major issues from a functional perspective, it does fuck things up visually. (along with quotes around keys)
So I decided to do away with the key-quotes. And replace map-based objects with vector-based objects to allow dupes and preserve order.
 
Ah, that's a fair critique. Sometimes it's better to create your own standard. Usually I advocate against this unless the new standard is simpler and more consistent than the old one.
And in JSON's case, there are a lot of gotchas that come with a format that is used in so many fields.
 
I'm still a little undecided on the dupe keys part. But I am adamant on preserving the order.
@Aaron3468 I initially thought it would be a fairly big task to implement such a parser. But I was able to do it one night. Completely with escape characters, and line # accurate error messages.
And lots of abuse of fall-through switches.
 
7:19 PM
@Mysticial I'm almost tempted to say you should have used XML instead--but while I'm sure you'd realize that had to be a joke, it'd be hard to blame somebody coming along later for flagging it as offensive.
 
@JerryCoffin Funny, I had an argument about that Tuesday.
 

« first day (2175 days earlier)      last day (2770 days later) »