« first day (3111 days earlier)      last day (1820 days later) » 

12:51 AM
I was doing lab work
 
 
1 hour later…
1:51 AM
I was sleeping.
Hey, wait. I should still be sleeping.
 
you can sleep on a second thread
 
2:03 AM
People always sleep on second thread as their subconscious is always working on the first.
Humans are multithread animals.
 
2:17 AM
I'm single threaded. I can only do one thing at a time.
 
Your subconsciousness runs are like background processes, handles the likes of breaths, heart rate, alerts you when you are hungry. Without which we will all be dead.
 
2:35 AM
Time flies like an arrow; fruit flies like a banana.
 
Horse flies like you.
Have anyone else been bitten by a horse fly? They can pierce jeans, then to get through your skin to suck your blood.
 
 
1 hour later…
3:42 AM
So I got this piece of code where I need to insert five hundred widgets into a layout. It takes about 10 seconds to do the insert, but i'm wondering whats the best strategy for user experience.
 
3:59 AM
Can someone tell if line #17 is safe: hastebin.com/waciyoqeco.cpp ?
 
5:08 AM
This answer: stackoverflow.com/a/10873443 says its okay to use << on binary file but I want to know why because I have been told that << are only for formatted output and for binary we use write.
 
Those operators will format the output. Sometimes this is desired, other times it isn't. Sometimes like with unsigned char it will be the same thing.
 
I don't understand. Standard reference would be appreciated!
 
5:28 AM
@user963241 This isn't really the sort of question the standard can answer. It's more about your expectations. Chances are that if you're writing a string to a binary file, you expect to read the data back later, and re-constitute a string from it. If so, operator<< is probably a part of the solution a best. You'd most likely prefix the string with the length, and follow that by the data itself. Given that it's binary, you might write the length as a 4- or 8-byte binary field.
 
@JerryCoffin How can #17 not safe? Commented out code are the safest :x
 
@TelKitty Safe from what?
 
From being executed.
 
5:45 AM
@TelKitty Looks like it's already been subjected to a guillotine.
 
nwp
6:21 AM
@Mikhail Try disabling updates or hiding the widget during the inserts.
 
neat
 
7:18 AM
@JerryCoffin: The entire file will be just utf-8 encoded text. I am just using binary mode to avoid any unexpected translations which could be implementation defined. So, should I use write(..) or << to write the string or both are same in this case.
 
7:35 AM
@Rick Took me a few seconds.
 
7:52 AM
Does Monte Carlo Algorithm refer more to a type of algorithm than a specific algorithm or even a family of algorithms?
 
nwp
If only there was a website explaining such things.
 
Cool. Now could you say how that website answers the question?
 
nwp
> Well-known Monte Carlo algorithms include the Solovay–Strassen primality test, the Baillie–PSW primality test, the Miller–Rabin primality test, and certain fast variants of the Schreier–Sims algorithm in computational group theory.
 
8:56 AM
Need to run activation batch script to get out of Windows S mode, can't run CMD.exe in Windows S mode.
 
nwp
I didn't know that existed. Let's take bets when that will become mandatory.
 
ITS ALREADY FUCKING HAPPENING
This is terrible because there is no fucking in way in hell my code is going to Windows Whore certified.
 
nwp
Rip your developer career.
 
switch to linux now to save your jobs
 
nwp
Linux users are all terrorists. Maybe we let you get away with Steam OS.
 
9:08 AM
First they came for dynamically modifiable code, then they said my drivers were neither functional nor passed basic static verification, now they won't let the loosers who use my program run it.
Fuck, I fucking can't fucking even fucking login into my fucking own fucking machine
 
nwp
Clearly you tried to circumvent security measures. You may turn yourself in for treason now.
I have never tried logging into my fucking machine
 
Static Verification is Minority Report
 
nwp
Getting undefined reference to 'WinMain' when trying to make a dll is lots of fun.
 
 
2 hours later…
nwp
10:56 AM
cd test; git init; git add *.lua; cd ..; mkdir test2; git clone ../test
> fatal: update_ref failed for ref 'HEAD': cannot update ref 'refs/heads/master': trying to write ref 'refs/heads/master' with nonexistent object 018069f068564201633d4075b98e39c2c390a904
fatal: The remote end hung up unexpectedly
I don't understand. Why does everything have to be bad.
 
nwp
11:24 AM
I forgot a commit in the command above. It turns out if you don't make a commit and clone an empty repository and then commit and pull, it doesn't cause weird git errors.
 
11:56 AM
@Mikhail wat
 
@Mgetz I assume mik meant safe mode ... 's' for safe.
 
@TelKitty no it's a different locked down mode meant for IoTish devices. I'm just surprised he had to deal with it at all
 
 
2 hours later…
1:49 PM
@user963241 Yeah, no particular reason you need to do anything special for a case like this.
 
I see. Because both things will write the whole string regardless, right, @JerryCoffin ?
 
@user963241 Yes.
 
nwp
> 105 files changed, 147 insertions(+), 746 deletions(-)
That is a pretty decent day.
 
2:06 PM
@nwp good progress
 
nwp
Luacheck is good. Would recommend to anyone messing with Lua.
Without it, finding typos in Lua is really difficult.
 
 
2 hours later…
4:03 PM
A question for those who may be in the industry. How realistic is it to expect other users who want to build your program to use C++17? The code that I am working on contains wstring_convert which has been deprecated since 17, I didn't catch this until I tried compiling it with my Ubuntu distro. VS2017 only gives a warning with this.
 
nwp
Nobody knows.
But it's somewhat common to specify a standard to compile with.
Also you can use deprecated functions just fine.
 
wstring_convert is not a member of std, I'm assuming they removed this entirely.
 
nwp
The standard mandates that the function exists. You probably forgot to #include <locale> or something.
 
Isn't it in #include <codecvt>?
well...that was odd. You're right, #include <locale> did the trick.
 
4:33 PM
@Sailanarmo <codecvt> is deprecated
@nwp removed c++20
 
4:53 PM
@Mgetz wait, it will be removed in the next update?
 
@Sailanarmo it was either very firmly deprecated or scheduled to be removed in c++20. To the consternation of many (including myself) as it was the only standards compliant way to (easily, there are hard ways) convert UTF encodings
which means all my windows code is now using MultiByteToWide etc
 
@Mgetz should I go with boost then? I am about to have a conversation with my coworker about why we need this piece of code anyways.
 
never found out the actual reasoning @Morwenn might be able to provide that color
@Sailanarmo what are you using it for?
 
To be honest, I am not really sure
`std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> converter;
os << converter.to_bytes(dynamic_cast<const TemplateValue<std::wstring>*>(&v)->getValue());`
 
@Sailanarmo what in the name of all that is holy.... clearly converting to UTF-16 for some reason...
 
4:58 PM
Yeah, and there is an overload like that for each type, bool, char, unsigned char, etc. My coworker said it was for XML, but I have 0 clue why we need one for each type.
 
why not just use an XML library and be done?
 
I was going to templatize it, but I have no clue how to get the types. Can't really make a map that takes T for a key and a string for a value.
 
@Sailanarmo you don't really need to, just use sfinae or defined overloads?
if it's "close enough" that you can use other templates to make it work use SFINAE
 
Well, I need to talk to him first. If it is purely for XML then I'll use QT's built in XML library and refactor this all.
 
if it requires special work use explict implementations
@Sailanarmo probably the best move regardless
 
5:01 PM
Well, he has 27 overloaded setValue, getValue, and addValue functions. So 81 functions in total.
 
@Sailanarmo do any of them do anything non-trivial?
 
The only issue is, TemplateValue<char>* val = new TemplateValue<char>(
name, "char", value);
replace char with T is easy, the hard part is the "char", that is hard coded.
 
@Sailanarmo uggg raw new
without seeing the code I can't really comment but it sounds like serialization code
in which case I'd probably just write a serializer class and call it done focusing it on just doing the one job of translation
 
Which why my initial thought was, if I have a map that was like map<T, std::string> myMap; and then do myMap[T] for that string, then I could do it, but I don't think that is allowed.
 
@Sailanarmo so what I was saying is you really shouldn't need to?
if you know the input type it's just a matter of providing specializations where necessary
 
5:04 PM
How do you mean?
 
general purpose serializers aren't actually available in C++ yet and won't be until reflection lands
 
@Mgetz, no I mean what do you mean by I really shouldn't need to?
 
correct me if I'm wrong, but the base pointer stays at the bottom of the stack frame so when the function returns it just jumps to the base pointer, right?
 
@Sailanarmo you're working on a specific type right?
e.g. class foo
 
No, I'm working with 27 types.
within a class foo
 
5:09 PM
primitives are easy, so ask yourself what the hard ones are?
is it convertible to a string_view?
 
Like here is a short, example: warning, lots of functions.
bool setValue(const std::string &name, Referenced* value, Event& event);
bool setValue(const std::string &name, bool value, Event& event);
bool setValue(const std::string &name, char value, Event& event);
bool setValue(const std::string &name, unsigned char value, Event& event);
bool setValue(const std::string &name, short value, Event& event);
bool setValue(const std::string &name, unsigned short value, Event& event);
bool setValue(const std::string &name, long value, Event& event);
bool setValue(const std::string &name, unsigned long value, Event& event);
And each one of those is defined in their own code:
bool ValueSet::setValue(const std::string &name, bool value, Event& event)
{
Value* val = findValue(name);
if (val && val->_etype == Value::vt_bool)
{
(dynamic_cast<TemplateValue<bool>*>(val))->setValue(value, event);
return true;
}
else
return false;
}

bool ValueSet::setValue(const std::string &name, char value, Event& event)
{
Value* val = findValue(name);
if (val && val->_etype == Value::vt_char)
{
(dynamic_cast<TemplateValue<char>*>(val))->setValue(value, event);
return true;
}
else
return false;
 
@Sailanarmo yeah some of those can be combined, some of those you can talk with them to ignore
for example in XML there is no concept of unsigned short
so you can combine almost all unsigned items
ditto signed
 
Again, 27 of those. Those can easily be templatized in setValue, however in addValue, they have the hard coded strings in their.
 
strings fall into two categories std::string_view and std::wstring_view
 
Yeah, and that is what I was thinking too.
 
5:14 PM
Floats unless you're having precision issues I'd promote to double
that is one where it MIGHT pay to do a separate overload for float
but see if it's worthwhile or if you're even using that
also that code is going to be slow as molassas
at least as written
 
5:30 PM
I agree
 
5:45 PM
@Mgetz It's deprecated because the committee considers that it's a poor way to do things
Also considering the removal: the committee has decided to remove the library parts faster from the standard, but implementations are allowed to provide them anyway
 
@Morwenn so they force us to use worse ways...
 
There's a "zombie names" sections in the standard for this
It just means that the committee doesn't want to keep maintaining the wording
@Mgetz you can actually convert between encodings using std::filesystem::path even though it's very uncool x)
But the message is "it's so poor you're better off using a 3rd party until we provide something better"
The first big stp of "something better" will likely be something akin to std::text_view, so an immutable view of unicode data
 
what's the point of doing this auto func() -> int when you can just do this int func() ?
 
6:06 PM
it's better because it's better x)
your pick: function alignment, readability, consistency with cases where you have to use the trailing return type anyway, and also because having the return type last aligns with how you generally describe function orally: "a function that takes an X and returns a Y", and also because the return type can depend on the parameters but AFAIK you generally don't have the opposite
 
@VioAriton I don't think you can use auto return type for declarations.
oh wait, nvm
You're talking about trailing return type.
When you have a complicated template shit as a return type such as:
template <typename Type>
typename MyClass<Type>::SubType MyClass<Type>::function():
Can then be reduced to:
template <typename Type>
auto MyClass<Type>::function() -> SubType
 
6:26 PM
gotta love when you find a comment that says, "Cannot put header file above because it will create a circular dependency."
 
6:58 PM
^ ಠ_ಠ
 
that's why you use dependency injection
 
Is that what you call PIMPL?
 
7:14 PM
I think PIMPL is a broader pattern. but I could be wrong.
 
eh
DI is not PIMPL, it's probably the opposite of PIMPL
and PIMPL has motivations beyond avoiding weird header circularity
 
@Puppy why is DI the opposite of PIMPL
 
in DI, you accept your implementations of things from the outside; the entire point of PIMPL is to obscure your implementation
 
so it's more about version control
and backwards compatibility
 
7:35 PM
PIMPL is also about compile times and public ABI stability
 
you could say it gives developers goosebumps.
 
you do lose runtime performance though
which is one reason why I dislike it
 
I guess that the tradeoff is interesting still
 
 
1 hour later…
8:45 PM
PIMPL also comes with a bunch of boilerplate
 
yup
I don't use it myself, but I do recognize that it has strengths
 
I gotta use it. For example, I have interpolating functions that use CGAL. I can isolate them with PIMPL.
Anybody had this happen? EnumDisplayMonitors from Win32 gives you a size that differs from the monitor size displayed by Windows. In this case less. Was wondering if that kid of stuff can happen with DPI scaling?
 
@Mikhail are you marked as per monitor aware?
because if you're not prepare for teh fuzz
 
Making some dependencies private is certainly an interesting use
 
DI in c++: VIRTUAL ALL THE THINGS (AKA COM)
PIMPL in C++: I'm like DI but tightly coupled!
 
8:56 PM
Boost.DI
 
I know Jerry absolutely detests COM but it's really not as bad as he thinks it is (in most cases)
 
@Mgetz I really have no clue. Basically in the middle of a Qt program I'm bringing up a OGL context from scratch, in another thread. Seems that the mismatch is exactly equal to the scaling on the monitor.
 
Basically, the monitor reads 1280 when its really 1920. In the Windows settings somebody choose to make everything look 150%. the numbers are not a coincidence, its just i need to override.
 
@Morwenn Boost.Dagger
 
9:02 PM
Boost.DIY x)
 
stabbing its way through your dependencies
@Morwenn Great now we're going to get Boost.HardwareStore that we'll have to visit 20 times to get things set up
 
just build your own DI it's like the easiest thing ever
 
Boost.DI is mostly interesting for all the metaprogramming tricks it uses
 
@Morwenn metaprogramming tricks, like what?
 
the whole presentation is interesting but for some reason I had this specific slide bookmarked
 
9:11 PM
interesting
 

« first day (3111 days earlier)      last day (1820 days later) »