« first day (1684 days earlier)      last day (3279 days later) » 

user562566
10:00 AM
@BartekBanachewicz "Tonight, on All My Bugz"
 
@TechnikEmpire you must be new here
 
user562566
@BartekBanachewicz I am
 
also Octavarium starting in my headphones (the track)
man this album is so great
 
user562566
@R.MartinhoFernandes ew nvm that site is garbage. just google->news "oracle vs google"
 
10:04 AM
Oh, you meant the reversal thing?
 
Hard to call it "won" when all that happened was that they were allowed to pursue their claim again.
 
words.emplace( words.begin() + i + 1, word.Split( splitPoint ) );
this causes the realloc
and invalidates all pointers
 
Oracle lost, and then was given a second chance.
 
Lines stored pointers to Words, which was a vector of objects
 
user562566
10:06 AM
@R.MartinhoFernandes yeah I guess you're right, it could still go either way.
 
when a new word was added the pointers broke
how the fuck did that ever work
 
What's a better word for something that composes something else? I have an "Item" that is merged from a bunch of other smaller "Items"
"components" is alreayd taken
@BartekBanachewicz vector iters dont always get trashed when it changes
 
user562566
@Prismatic for a project name?
 
only if realloc
 
@Prismatic still this is so dumb.
hmpfh
 
10:07 AM
@TechnikEmpire No, for a list of the constituents of the merged thing
 
I have to fix it somehow.
 
std::list all day baby
 
@Prismatic All of that sounds incredibly generic and borderline devoid of actual meaning.
 
take your performance and shove it :p
 
"A thing with things."
 
10:08 AM
Yeah sorry, it was asked in a pretty poor way
 
@Prismatic What about "items", btw? It's what you called it right there.
 
user562566
module?
 
@Prismatic parts... or cogs!
 
@BartekBanachewicz There are iterator-stable vectors on Boost.
 
They are both the same type already. So say the name of the type is "Item":

Item merged_item;
ListItems /* list of items that composes merged_item */
 
10:09 AM
parts
 
@BartekBanachewicz If you have an upper bound on the vector size you can always pre allocate the space to make sure the vectors remain stable. It's a bit of nasty trick but it works
 
@R.MartinhoFernandes no boost. I think I'll just change words to vector<unique_ptr<word>> instead of vector<word>
 
That works. Layer of indirection saves the day again.
 
Ell
So much tradition in opening the houses of parliament
I wonder how much it costs
 
Guys, I need small brain storming to do. Anyone wanna help? it is about std::make_heap
 
user562566
10:11 AM
@Ell you're not allowed to wonder you're just supposed to pay for it
 
gerrit is truly terrible UX
 
@R.MartinhoFernandes it's the safest thing to do I think
 
user562566
@BartekBanachewicz but what happens when someone pushes a defaulted unique_ptr and then directly accesses vector[n]->member
 
user562566
@BartekBanachewicz back to the drawing board
 
@TechnikEmpire what?
you mean (the problem is that I introduced) nullability?
 
10:14 AM
:D you can now drive the entire order engines through rest so hipster and exciting
 
hmm actually I think they use empty emplace_back at times
this could be a problem
 
Wouldn't using a list be less effort
You wouldn't even need to change code that uses iterators
 
it uses numerical indices right now
 
ah
 
so yeah well
 
user562566
10:15 AM
@BartekBanachewicz not really, I suppose, was just making shit up to be critical for fun
 
I wasn't the one who wrote it
why is there no value_ptr in stdlib
hmm what if I used ref_wrapper
 
Ell
@R.MartinhoFernandes does gin make you sad?
 
What?
No.
I like gin.
 
Ell
It makes some people sad when they drink it
I don't know if it's placebo or what
Or just a myth
Probably a myth
 
Isn't that true of alcohol in general?
And require a predisposed state of mind?
Beer Street and Gin Lane are two prints issued in 1751 by English artist William Hogarth in support of what would become the Gin Act. Designed to be viewed alongside each other, they depict the evils of the consumption of gin as a contrast to the merits of drinking beer. At almost the same time and on the same subject, Hogarth's friend Henry Fielding published An Inquiry into the Late Increase in Robbers. Issued together with The Four Stages of Cruelty, the prints continued a movement started in Industry and Idleness, away from depicting the laughable foibles of fashionable society (as he had done...
This?
 
Ell
10:24 AM
I'm not sure, I just heard it vOv
 
Gin has a bit of a history in the UK.
 
Ell
Yeah
 
user562566
@R.MartinhoFernandes There's no "American" in there
 
Ell
The DofE is so old
 
10:28 AM
At least this one clearly states "Chinese" is not a language.
 
user562566
@R.MartinhoFernandes I thought it was a food
 
Xeo
You know, I've grown quite fond of upper_bound as an algorithm. Just thought I'd mention that.
It's nothing complicated, but I've used it quite a bit here.
 
upper_bound and lower_bound are p cool
handy for sorted inserts
I always get confused with the definitions and have to look them up though
one is first greater than and the other is not less than... i think
 
Xeo
lower_bound is "not less" (aka greater or equal) and upper_bound is "not less or equal" (aka strictly greater)
The confusing wording with "less" is due to the predicate, I think
 
10:40 AM
@R.MartinhoFernandes It’s the chronological order.
 
Templates even being a thing is solving the problem the wrong way - just have first class types and functions and pass the "template arguments" to functions operating of values ("regular" values and types) so that all these "template syntax is ugly" and "templates are hard" shit goes away.
 
It started burning first, and that's why it came crashing down, no?
 
At least that's how I see it.
 
@R.MartinhoFernandes cool stuff
@Griwes yeah!
3
 
user1804599
@BartekBanachewicz +1 static if.
 
10:43 AM
@LucDanton I like that they got both Chinese and Hindi-Urdu right.
 
@LucDanton :D
 
It's interesting that of the Western European languages, only French and Italian have more speakers in their original countries than in ex-colonies.
 
user1804599
lol, this guy posted a pic on facebook where has sex with the mother of his ex.
 
A quick glance at the chart gives the impression that Italian and French are the major Western European languages.
 
@LucDanton lol
 
10:45 AM
@R.MartinhoFernandes I can see it. An administrative/lingua franca(hah), but not spoken at home.
 
the funniest thing is that Luc is probably amongst people who know Agda best here
 
I'm not happy about the Eastern Europe thing, though.
It only serves to single out German (and the almost unnoticeable Turkish minority in Bulgaria).
 
@LucDanton did someone say sigils?
 
@buttifulbuttefly btw I saw 'La liberté d’expression s’arrête où commence la vérité' stickers on the street and I thought of you
 
I'm gonna take that as a compliment
 
10:50 AM
Hmm, Africa's presence in it is also interesting.
Only Arabic is there. Africa is the continent with the highest language diversity.
 
Oh there’s a variant on the intarwebs but with 'zionism' instead of 'truth'.
 
Zion is my second name
 
@buttifulbuttefly If that’s true then you’re not allowed to tell us.
 
jewtiful jewtefly
 
user1804599
@buttifulbuttefly Zionist.
 
10:51 AM
@LucDanton I can lie.
 
Hmm. Japanese's isolation is also curious. I thought Japan used to have an empire. Somehow their language didn't stick. They suck at empires.
 
Ell
@Griwes how does the compiler know what to evaluate at compile time?
 
@buttifulbuttefly Naw, you must lie! No free speech on the truth!
 
It's a paradox
 
check out his autocomplete thing
(first few seconds of the video)
 
10:52 AM
@R.MartinhoFernandes Do they? That’s kinda what an empire is ;)
 
@LucDanton If you don't overimpose your culture on the natives, it's not a real empire.
 
he also calls cout retarded
 
It’s settling that the Anglos are good at :Þ dunno what the Spanish and Portoguese managed exactly
 
@Prismatic He's illuminated
 
@Prismatic FWIW he suffers from mental issues
 
10:54 AM
I'm so tempted to link my question here. Somebody stop me
 
@LucDanton Extermination and slavery, respectively.
 
@R.MartinhoFernandes Who didn’t? Or did they put a language spin on it?
 
@R.MartinhoFernandes Higher res
 
Xeo
Oh man. I coded this thing for the last 8 work hours, without starting the app once. Just now I ran it, and it works \o/
modulo some weird offset bug
 
Well, I suppose exterminating other languages makes yours stand out, comparatively speaking.
 
10:55 AM
@LucDanton I'm well aware
 
I've just realized I've been using Lua for 7 years already
 
@Rapptz Oh. That's what I was looking at. Seems imgur downsampled it. Sorry.
 
@Rapptz oh sweet optical relief
 
@Prismatic Oh that's super recent.
 
reminds me of that REST api guidelines I read today: "all identifiers should be composed of letters from a to z and numbers from 0 to 9", well yeah the whole world uses latin and speaks english!
 
10:57 AM
@Rapptz wtf german. Where are the Slavic languages
 
Ell
@Prismatic woah
 
I’ve never seen 'Asia minor' used to designate what looks to me like South-East Asia. That usual?
 
user1804599
@buttifulbuttefly APIs and code must always be in American English.
 
Asia minor = Turkey
 
user1804599
Anything else is unacceptable.
 
10:57 AM
Right, it’s supposed to be Anatolia. Where did they pull that from?
 
@LucDanton You want slaves that can understand your commands :P
 
@rightfold You're unacceptable!
 
@R.MartinhoFernandes Yeah but that doesn’t mean they speak it at home does it? (I’m extrapolating what they mean by 'native tongue' though.)
 
As opposed to bytecode interpreted tongue I guess
 
Ell
God said let it be 640x480, and it was 640x480. God saw that 640x480 was good.
 
10:59 AM
@LucDanton As far as I know, Asia minor is an old geographic term for the anatolia region.
 
@LucDanton Oh yeah, that's weird. It's not really SE Asia, either, because it includes India and Pakistan (but Bangladesh is in ME!)
 
Ven
french fries > *
 
That diagram is weird
 
@SeçkinSavaşçı However, "Asia" is an even older term for the same region.
@LucDanton Oh, we let our slaves breed.
 
@R.MartinhoFernandes I cannot discuss how old the term is, I simply don't know about the times where Anatolia is referred as Asia.
 
11:07 AM
Antiquity or thereabout.
 
@SeçkinSavaşçı It's the time before "Asia" came to mean more than Anatolia, so they changed it to "Mikra Asia".
 
so
std::non_null_unique_ptr
 
"Asia" comes from Akkadian and originally means exactly the same as "Anatolia" meant in Greek: land where the sun rises.
 
Why isn't there such pointer type in the stdlib
 
Where’s Catatolia? Near Catalona?
 
11:09 AM
Can reference_wrapper own? I don't think so.
 
user1804599
No.
 
user1804599
It has no deleter.
 
I need/want non_null_ptr :/
 
user1804599
Implement it. vOv
 
Ell
non_null_ptr?
 
Xeo
UE has TSharedRef<T>
 
@BartekBanachewicz you mean assignable_reference? :P
 
user1804599
 
Xeo
@rightfold Make the ctor take a reference :P
 
user1804599
Why?
 
Xeo
11:13 AM
Because those can't be nullptr
 
Ven
That's devanagari text
 
user1804599
Having a pointer ctor take a reference is weird.
 
Ven
juste use an overload will nullptr_t that's deleted, obviously
 
user1804599
Also deref null ptr is UB whereas here it throws exception.
 
Ven
runtime errors = bad
 
user1804599
11:14 AM
@Ven void* x = nullptr; non_null_ptr<void> p(x); OOPS
 
Xeo
@Ven NULL lets its greetings be heard.
 
user1804599
Overload resolution in C++ is done statically, not dynamically.
 
@rightfold lacks deleter
 
user1804599
@BartekBanachewicz then add one and implement in terms of std::unique_ptr.
 
11:16 AM
@Xeo hrmfhrhfebehfmfashf
 
@BartekBanachewicz value_ptr?
 
Xeo
@LucDanton I kinda expected that
 
@LucDanton ahhaa
 
I think ambiguity is possibly the most hellish outcome.
 
Xeo
it's the bestest!
weeds out the uses of NULL.
 
user1804599
 
Xeo
@LucDanton I meant to that particular function.
 
@rightfold nicety. Maybe I could actually push that to that codebase
 
The non-null pointer cannot be guaranteed to be non null
and runtime crashes for that? What is it that you gain then?
It's more of a checked_ptr.
 
user1804599
Guaranteed exception > UB.
 
user1804599
11:21 AM
UB doesn't mean segfault.
 
> Is this a joke? There’s no way an apple product could have such a flaw.

Apple devices don’t crash. They just don’t.
 
user1804599
Compiler can do all sorts of optimisations.
 
user1804599
Example: x->y; if (x == nullptr) { ... } compiler can optimise out entire two statements. It assumes x != nullptr because you dereference it.
 
@rightfold but will it do so if there's a class template and member function and stuff in between?
 
user1804599
Also, it can indeed never be null here. That moved-from values store null pointers is an unobservable implementation detail.
 
user1804599
11:22 AM
@rubenvb Of course.
 
user1804599
Many optimisations are performed after inlining.
 
Hmm.
I always have a feeling there's a way to write the code so that it ensures there's never a null value anywhere reachable.
(or it's a bug, in which case most current compilers segfault (right?))
but ok, a portable segfault/exception/whatnot on null pointer dereference may be useful.
there should be a C function segfault()
 
@rightfold It is an observable part of the spec for several components.
 
void segfault() { volatile int[100000000000000]; }
 
user1804599
@R.MartinhoFernandes "here" is "in my non_null_unique_ptr implementation".
 
11:25 AM
Increase if necessary.
 
user1804599
@rubenvb I think that can be optimised out.
 
user1804599
You don't read-from/write-to that memory.
 
user1804599
Write the function in assembly. Compiler won't mess with that.
 
@rubenvb Dereference a volatile null pointer.
I dunno why you'd want that, though.
 
user3010322
non_null_unique_ptr doesn't make any sense.
 
user1804599
11:28 AM
@rubenvb hhahahahahahah it indeed segfaults, but it segfaults the compiler coliru.stacked-crooked.com/a/afb3ac0c6e0f6f23
5
 
@Ted why not?
 
Ell
@BartekBanachewicz what happens when you move out of it?
it has to be null
 
it becomes invalid
 
@BartekBanachewicz Eric Niebler has been over it in one of his talks.
 
11:29 AM
that's different from null
 
user3010322
@BartekBanachewicz chop out unique. What you're left with is non_null_pointer. This is what a reference is. So what you're trying to define is a unique_reference.
 
Ell
@BartekBanachewicz why?
 
@Ted lol, the name?
 
user1804599
kill(0, SIGSEGV);
 
That's it?
 
user1804599
11:30 AM
Oops.
 
user3010322
@R.MartinhoFernandes No, but constructing unique_reference with good move-out-of semantics is next-to impossible.
 
@Ted But it's a pointer because you dereference it.
 
user1804599
> If pid equals -1, then sig is sent to every process for which the calling process has permission to send signals, except for process 1 (init)
 
user3010322
For obvious reasons.
 
user1804599
@StackedCrooked hahahaha I broke Coliru. With this program: int main() { kill(-1, SIGKILL); }.
 
11:31 AM
@Ted Ah. That's one of the things Niebler goes over.
 
Jeez, I was just gonna answer this, and then spilled a cup of coffee over my laptop. Made it in time though
8
Q: Ambiguous assignment operator

rivI have two classes, one of which, say, represents a string, and the other can be converted to a string: class A { public: A() {} A(const A&) {} A(const char*) {} A& operator=(const A&) { return *this; } A& operator=(const char*) { return *this; } char* c; }; class B { public: ope...

 
Xeo
@Columbo Too excited? :P
 
@Xeo Pretty much
 
@rightfold wfm
 
user1804599
It stopped working.
 
11:31 AM
wfm
 
user1804599
I guess the server automatically restarts.
 
@rightfold It works just fine
 
user1804599
@R.MartinhoFernandes you already said that.
 
@R.MartinhoFernandes "work for money!"?
 
user1804599
The server does go down for a split second.
 
11:32 AM
@rightfold that's unexpected.
 
user1804599
then I get redirected to coliru.stacked-crooked.com/a
 
@Ted a reference doesn't own anything.
 
@rightfold It became relevant again.
 
lol
 
@Ell because null is a valid state and moved-from isn't.
I dunno what other explanation do you want
 
user1804599
11:35 AM
#include <sys/types.h>
#include <signal.h>
int main ( ) { kill(-1, SIGKILL); }
 
user1804599
Try running this.
 
user1804599
Add arbitrary whitespace to circumvent cache.
 
Ell
@BartekBanachewicz why do you need it then?
 
@Ell to prevent default null construction
 
Ell
I guess I'd just copy paste the impl of unique_ptr but get rid of default ctor
 
11:38 AM
@Ell wrapping is easier
 
user1804599
@Ell UB.
 
Ell
@rightfold how come?
 
user1804599
unique_ptr implementations use reserved identifiers.
 
icrosoft Visual Studio 12.0\VC\include\xmemory0(600): error C2664: 'std::unique_ptr<MyClass,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : cannot convert argument 1 from 'MyClass' to 'std::nullptr_t'
wtf is that
 
Ell
fair enough
yeah wrap then vOv
 
user1804599
11:39 AM
also unmaintainable
 
@rightfold So rename them then.
 
why would it want to convert my class to nullptr_t
 
it's a bogus message
maybe picking wrong overload?
show teh codez
 
@Ell It evaluates everything it can at compile time. Also it knows what is a type and what is not, since type pretty much must be a special type.
 
Ell
@Griwes Yeah
I think that would be an ideal solution
 
11:44 AM
11
Q: Using std::unique_ptr for Windows HANDLEs

bRad GibsonI am attempting to use std::unique_ptrs to manage Windows HANDLEs in an exception-safe manner. First I tried: struct HandleDeleter { void operator()( HANDLE handle ) { if( handle ) { FindVolumeClose( handle ) } } } typedef std::unique_ptr< HANDLE,...

found this
 
@Ell I'd like to have the line between compile time and runtime be as invisible as possible.
 
Ell
Yeah
Someone get writing that :P
 
@Griwes have you tried Terra?
 
To "fully"(-ish) erase it you'd need to delve into dependent typing.
@BartekBanachewicz I think I've seen it...
 
@Griwes TLDR Terra types are Lua values, and a lua program is ran during compilation. Builds into native binary.
 
11:45 AM
@BartekBanachewicz can't show your code?
 
@AndyProwl not really. It has deleted copy ctors, it has move ctors and is default-constructible
 
@Ell 1, 2, as well as theorem provers etc.
 
@BartekBanachewicz Yeah, I've seen it. The thing I really want is to have X types be X values (plus a lot of other features :P).
 
@BartekBanachewicz can't tell much from this
 
@Griwes Considering how close Lua and Terra syntax is, it's almost that vOv
you wouldn't get much more benefit imho
 
Ell
11:47 AM
I don't really understand dependent typing
 
@Ell I was asked about it on the interview :)
 
Ell
It allows types to be predicated on values, I don't understand the difference between it and type parametrisation
 
@BartekBanachewicz I have a C++ library that kind of uses C++ types as values. It could be greatly simplified if types were actual C++ values.
 
@Ell 'Someone get writing DT tutorials/books!'
 
@thecoshman Same here.
 
Ell
11:48 AM
like T<20>
@LucDanton haha yeah
 
@Ell the compiler being able to infer that from your code.
consider
 
Ell
I do have idris installed
I tried it a while ago
 
@Ell That uses a constant, not a term-level value.
 
The thing with dependent typing is, you can pretty much parametrize types on runtime values and get the type checker to check your code based on that.
 
let a = []
a.push_back(1)
// the compiler is now able to assess that type of a is "non-empty list"
print(head(a)) // this is valid, because of the above
@Ell ^
 
Ell
11:49 AM
Oh right
 
So basically that's kind of the last step to make the line between compile time and runtime disappear completely.
 
(Well you can have a term-level 20, too.)
 
@Ell of course the push_back can be really any set of instructions as long as you can prove somehow manually or automatically that the a won't be empty
it can combine theorems about types and reason with them
 
I kind of understand what dependent types are about, but I still fail to see how some of their aspects work.
 
@Griwes example?
you should try Liquid Haskell instead of Idris IMHO @Ell. Of course as long as you know Haskell, but that should be a prereq for Idris anyway vOv
 
11:51 AM
@Griwes GADTs are sort of a gateway to DT, if that’s any help.
 
hard for me to really formulate what I'm missing
 
Also the singleton/reflect stuff too, I guess, but I find it too ugly to really suggest.
 
@LucDanton Okay, that might point me in the right direction actually.
It looks like an obvious observation, but it kinda is not.
 
GADTs are quite intuitive once you "click" I think
they make a lot of sense
lemme find that tutorial
 
GADTs I do understand. :P
 
11:53 AM
If you write functions on GADTs, it’s interesting to note what that kind of elimination does to type-checking. That gave me insight on what it meant to eliminate, say a Pi-type or Sigma-type value.
 
Ell
app : Vect n a -> Vect m a -> Vect (n + m) a
I understand now what it means
 
user1804599
What should I call the highest log level?
 
user1804599
"Critical" or "catastrophe"?
 
Ell
"code red"
 
@rightfold Isn't that the almost-lowest (with lowest being "None")?
 
11:55 AM
the problem with dependent types is that the understanding typically sits right in the middle of "useless and trivial" and "impossible magic" :D
 
user1804599
@milleniumbug I want ERROR > INFO to be true.
 
user1804599
That way you can say "min level is INFO" instead of "max level is INFO".
 
@rightfold I have "crash" as the highest level.
 
@rightfold Oh I see
 
So basically for farewell messages before terminating.
 
11:56 AM
I want to open my iphone up & have a look
 
user1804599
Just crash all the time.
 
user1804599
Have the supervisor restart you!
 
only sh!t phone doesn't offer DIY
 
:D
"Our software is not buggy, because each time it crashes, it is immediately restarted."
 
user1804599
Automatically restart all services every five minutes.
 
user1804599
11:57 AM
Rebooting is the best way to prevent bugs from appearing!
 
Nice troll
 
This is an actual "argument" someone tried to use to tell me that iOS is the best thing ever, except s/Our/This/ (it was some years ago, no idea if that's still how it operates).
 
My tablet's web browser crashes every time I connect/disconnect a keyboard.
 

« first day (1684 days earlier)      last day (3279 days later) »