« first day (2417 days earlier)      last day (2546 days later) » 

8:04 PM
@nwp lol
@nwp it means "In all honesty with ye fine gentry, I am currently experiencing a certain level of despair at the lack of new episodes of my favourite television series that has arisen over the past week or two, and which shall continue for several more months."
 
I miss stargate
 
nwp
@BoundaryImposition Well I can relate to that; I too feel withdrawal when my shows stop for a while.
 
@nwp for a while is better than forever... like stargate universe ended
 
nwp
On a positive note, Dr Who got a lot better the last 2 episodes. The first episodes of this season had me worried.
Maybe I just had to get used to it again.
 
just tells you something about how backwards Doctor Who is, from what I can tell
1999, The Matrix, you live in a computer simulation. 2017, Doctor Who, you might live in a computer simulation.
 
nwp
8:12 PM
I learned a lot from that episode. Like how in a computer program all subroutines always generate the same random numbers and can send e-mails to outside the simulation.
 
erm, what?
that makes absolutely no sense whatsoever.
 
~TV writers~
 
sounds like Hollywood IT
 
2 idiots 1 keyboard remains a favorite of mine
 
actual Hollywood IT gets hacked by North Korea
 
8:16 PM
@nwp pseudo random numbers which use the same seed may be
the email part... well smtp isn't all that magical
I think it was sarcasm
 
nwp
I guess that sentence makes no sense if you have not seen that Dr Who episode but I don't want to spoil anything.
 
what idiot tied the simulated internet into the irl internet though
I mean
I have discovered code of about that quality in the last week
but this has been a very strange week
and if I ever meet the person who wrote that code again I will spend the next while yelling
 
@jaggedSpire git blame?
or something like that
 
oh, I know who it is
they're no longer with the company
 
nwp
aww, I expected you to find out it was yourself and you now had to yell into a mirror, even though it was not the mirror's fault.
 
8:22 PM
I hope that part of code wasn't commented with "//secret backdoor"
 
@LoïcFaure-Lacroix don't worry, the only comments their code had were commented out blocks of random code and rotted/completely irrelevant comments
 
Talking about bad code, I once worked in a place to find out someone was throwing exceptions to return "peacefully" from a method to return some data instead of using the return statements... All of that after refactoring the code to make it no throw an index out of bound exception
 
:|
this guy just uses pokemon catch statements all over the place
 
Like somewhere it was catching the index out of bound exception to print the result
 
Enums for numbers are a personal favorite, because in a normal world that field would be an integer
 
8:28 PM
jesus
oh!
 
Except Integers aren't finite like enums
 
On Thursday, I found a string utility class named StrUtils
 
Wasn't there some weird part of gcc where they had enum numbers but they weren't what you'd expect, for example Three = 119
 
this was one of the methods: string ToInt(bool b)
8
 
@jaggedSpire strutting around
 
8:29 PM
@milleniumbug lol
 
@jaggedSpire and was returning 1 and 2 right?
 
the internal implementation took three lines (or five?) to do return b ? "1" : "0";
 
@jaggedSpire because internationalization matters
 
haha
this is database interaction code, fortunately
 
Should have returned "True" or "False"
 
8:31 PM
not that any of his code is internationalizable
@Mikhail that wouldn't be an integer :V
 
neither is "1"
 
Make it return_("Aladeen")
 
@milleniumbug exactly
I get angrier every time I look at this code
and I've been tasked to get the part of it I rely on in working order
@LoïcFaure-Lacroix like MsoTriState
the string utils boolean to stringified integer isn't the most bullshit part of his code, even
it's just an additional corn kernel in the shitpile he produced
 
I wouldn't say it's a bad thing if there is a reason to parse bool to string.
 
8:38 PM
@LoïcFaure-Lacroix Think about it for a moment. Once you have String ToInt(T), it hardly matters what it returns. Nothing (that fits the signature) can possibly be right.
 
@LoïcFaure-Lacroix You don't "parse" a bool.
 
@BoundaryImposition it's a classic
 
@LoïcFaure-Lacroix And you don't call the function ToInt if it returns a string.
 
@jaggedSpire This seems like nothing to me.
we have data in our database that we can't decode.
 
@Puppy he introduced new columns in our database tables and didn't tell the people who patch the production databases
 
8:40 PM
@BoundaryImposition ah right
 
@Puppy Better keep extra backups of that data!
 
@jaggedSpire That sounds like your process is broken, it shouldn't be possible for production to fall out of sync
 
it is, and that's part of the problem (and how it got this far)
 
So, my code has a lot of ` std::map<SettingEnum, int>` where there are maybe 4 or 5 settings, is there some more computationally efficient way to handle this stuff?
 
@jaggedSpire sounds like you're doing dangerous things if you call it patch the production
 
8:44 PM
@LoïcFaure-Lacroix patches are how we update the databases for new releases, that's just the unit in which they're updated
 
@Mikhail Given only 4 or 5 items, it's almost certainly faster to use a std::vector<std::pair<SettingEnum, int>>, and probably just use a linear search to find the right spot.
@wilx Repost.
 
@JerryCoffin I am always slow and behind. :(
 
@JerryCoffin Yeah a more optimal solution would be to us a small vector class, but ideally the enum, because they are sequential, would be the index avoiding a search. But not sure how to do this in a C++ style.
 
@Mikhail If they're contiguous and start at 0, I'd just wrap an array into a small "settings" template with the enum as a template parameter (and possibly the int as another template parameter). If they're contiguous by don't start at 0, you can typically just subtract the smallest from each to get values starting from 0.
 
user2411267
8:50 PM
hello guys
 
@Ali.B Hello.
 
2 messages moved to bin
 
user2411267
@JerryCoffin
 
it's definitely bin-complete
 
@Ali.B how about you look up a list of np-complete problems and see if any match the task there
 
user2411267
well it's a shortest Hamiltonian path
 
@JerryCoffin I didn't want to inflict somebody who took a photo/scan of an exam question on them.
 
user2411267
in a fully connected graph
 
@Ali.B In what significant way does it differ from the TSP?
 
@JerryCoffin Yeah, then I'd have to label those bastards, they might accidentally convert to ints, which is undesired because I got some constructors that take a few ints + enums and I need type safety. Time to scour the internet for somebody elses code.
 
8:54 PM
@Mikhail enum class is your friend.
 
user2411267
just that he doesn't have to return to source
 
user2411267
that's the only difference I see
 
@JerryCoffin There's no limit on revisiting stars and I also see no constraint that you must visit every star in the input, only 20 stars where the input may be more stars, and you don't need to return to base.
in fact I reckon this could be solved fairly easily with A*
 
@JerryCoffin really we need things like lls::SmallVector in the std, and also some kind of memory efficient map
 
@Mikhail In this case, it would appear that std::array probably suffices (and is about as memory efficient as anything--but in general I agree).
 
8:57 PM
Yeah, but then my enums need to convert to ints which would be sad. I might as well use #defines
 
but your problem is "accidental" conversion, isn't it
 
yes
 
then "intentional" conversion in your lookup function is fine
 
But you can't do static_cast<int>(enum) without labeling them
 
@Mikhail Oh, you'd wrap the array in a class that defines operator[], and only converts from the enum class to an integer type internally (but doesn't use any virtual functions, or anything like that, so it retains the same memory footprint as the std::array.
 
Ell
8:59 PM
@Mikhail labeling?
 
enum Settings {Option1=0, etc
 
Ell
as opposed to?
without the =0?
 
yeah, no =
 
Ell
you don't have to assign integers to them to convert them to an int
 
@Mikhail an array?
although I'd stick with the map unless you have performance concerns.
(it'll be nice and expressive, for the most part)
@Mikhail that's not true. they always have integer representations; =x just overrides the default auto-increment initialisations with your own choices
 
9:03 PM
enum A { a, b, c } is equivalent to enum A { a = 0, b = 1, c = 2 }
 
and enum B { a, b = 42, c } is equivalent to enum B { a = 0, b = 42, c = 43 }
 
I swear some guy wrote this kind of performance efficient mapping as well as a version of SmallVector and even benchmarked his implementation for a quasi-rearch paper, but I can't find the link.
 
modulo typo in name
first page of c++ map enum value performance vector on Google ;)
 
9:08 PM
These are good links but they aren't the one I saw
 
@Mikhail they can still help you out
 
@jaggedSpire Sounds cleaner than what I'm doing right now... skipping a version for a migration for something written custom by the client to something how it should be
I think I can clearly say I hate migrating stuff now
I think there is nothing more depressing to see the migration fail at 21% then fail at 21.03% for 2 different problems
 
ouch
 
Then once you finish to 100% you learn that you've been migrating an outdated backup on a 1 years old code base.
 
9:21 PM
How do you get a % for code migration? Isn't that when you change languages, etc?
 
@Mikhail not code migration, database migration sort of
schema changed and relations are differents
my biggest issue is that the client allowed to have multiple attributes with the same name, but it's not possible with the standard way.. There is no point to have multiple attributes with the same category/name
 
Yeah, I had to read that sentence a few times to understand exactly how much they shot themselves in the foot.
 
think this was my favourite DS9 episode
 
I was able to mostly solve a GPU memory fragmentation issue by limiting memory allocation to 75% of the GPU. How fucked am I? Code is "shipping" to Georgia Tech on Wednesday.
 
9:47 PM
@Mikhail Perhaps you're thinking of Modern C++ Design, and the Loki library?
 
@JerryCoffin That stuff felt so out of date when I read it after learning C++11 (which was the ratified standard when I learned programming, so anyway)
 

« first day (2417 days earlier)      last day (2546 days later) »