« first day (1092 days earlier)      last day (3853 days later) » 

12:01 AM
I have this convenience wrapper for std::thread. (I decided that I needed it because I got std::terminate so often.)
 
user1804599
@StackedCrooked What is joinable?
 
Good question.
 
user1804599
It’s mine. Of course it’s good.
 
> Checks if the thread object identifies an active thread of execution. Specifically, returns true if get_id() != std::thread::id(). So a default constructed thread is not joinable.
I didn't even now std::thread had a default constructor.
 
user1804599
Huh.
 
user1804599
12:04 AM
What would that do. :V
 
@not-rightfold more or less a thread, which is still running, only those need to be joined
 
> 1) Creates new thread object which does not represent a thread.
 
user1804599
Fuck thread objects.
 
user1804599
I want template<typename F> void spawn(F);.
 
Isn't that what async does?
 
user1804599
12:05 AM
No. async returns a future.
 
std::thread(f).detach(); (more or less)
 
user1804599
erlang:spawn(F) :D
 
I wonder if multiprocessing would be practical as an alternative to threading in C++.
 
user1804599
I like how spawn in Erlang never fails.
 
user1804599
Well, unless you pass in a bad argument but that’s silly.
 
user1804599
12:09 AM
1> spawn(non_existing_module, non_existing_function, []).
<0.34.0>

=ERROR REPORT==== 12-Oct-2013::02:09:40 ===
Error in process <0.34.0> with exit value: {undef,[{non_existing_module,non_existing_function,[],[]}]}
 
user1804599
Hmm. This is silly.
 
Yes you fool.
That module does not exist.
 
user1804599
But the process still spawns.
 
user1804599
It simply fails directly after spawning.
 
user1804599
I even get a process ID back!
 
12:16 AM
Amazing.
:D
Do you collect them in a book?
 
user1804599
Do I collect what in a book?
 
user1804599
It’s funny how googling “the church of the finite state machine” turns up results about the Flying Spaghetti Monster, due to the common abbreviation FSM.
 
> undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'
 
Actually, mostly the formatting is a little creative.
The code isn't too bad I think.
But that's 60 compressed lines of code to parse a HTTP method ("POST", "GET" or "PUT"). That in itself is rather silly.
 
user1804599
12:31 AM
Oh cool.
 
user1804599
Today was national coming out day.
 
user1804599
They said in the news that homosexuals don’t get bullied more than heterosexuals at work places.
 
user1804599
@StackedCrooked Oh god.
 
@StackedCrooked Looks like a fairly typical state machine to me.
 
user1804599
You can do that much easier.
 
12:36 AM
@JerryCoffin That was the first time I wrote something like that.
 
user1804599
Instead of one outer for-loop, write multiple loops.
 
Xeo
@StackedCrooked Ugh, the inner switchs... ugh
 
It looked really big so I tried to compress it like that.
 
Xeo
Just make it an if D:
 
user1804599
Make it a Flex.
 
user1804599
12:39 AM
Or, you know, strstr(begin, "GET") == begin.
 
@Xeo I first thought you were mentioning the D language.
 
user1804599
Or write a Perl script that generates the state machine.
 
user1804599
But god don’t write it manually.
 
This was the only thing I could think of at that time.
 
user1804599
When was it?
 
12:41 AM
About two months ago I guess.
 
user1804599
I am disappoint.
 
Ok three months.
 
user1804599
The Flying Spaghetti Monster approves, though.
 
> make[4]: *** [load_16_.lo] Error 1
Not very helpful. Possibly related: >/dev/null 2>&1 in the preceding command.
why ._.
 
user1804599
12:48 AM
0b110110110 ftw.
 
@Rapptz If it were available to string literals they'd be useful.
 
@LucDanton Yeah surprisingly useless.
I wish we could do operator"" _stuff(const char (&arr)[N]) { }
 
That's not much benefit over (const char*, std::size_t).
 
You can use the size_t parameter for a class.
template<size_t N> constexpr my_stuff<N> operator"" _s(const char (&arr)[N]) { .. }
Oh well :(
 
user1804599
1:05 AM
You know.
 
Yeah, he knows.
 
user1804599
Are there any problems related to template variables w.r.t. dependent names?
 
template variables?
 
user1804599
How would you parse T::foo<bar>(42) if foo happens to be a template variable and not a normal variable, depending on T?
 
user1804599
@StackedCrooked It’s a proposal.
 
1:07 AM
huh?
Aren't template variables foo<T>()?
where'd the other stuff come from
 
this one or this one, or is it another one? :D
 
user1804599
Can’t you put them in classes?
 
@not-rightfold Yes
Which tbh I don't get
Might have to do myclass:: template<int>::etc like you usually do
 
user1804599
struct S { template<typename T> constexpr T pi = T(3.14); };

template<typename T> void foo() {
    T::pi < U > ( 10 ); // variable, lower than U, greater than 10?
                        // or is pi a template variable which is being instantiated and then called?
}
 
Where'd U come from?
also, T::pi template<U>(10)
 
user1804599
1:11 AM
lol
 
user1804599
dat syntax
 
it already exists
you can circumvent it sometimes
 
user1804599
T::template pi<U>(10) exists. Didn’t know of template after the identifier.
 
user1804599
What does it do?
 
disambiguates your issue
 
user1804599
1:12 AM
huh
 
I might have messed it up though syntactically
 
user1804599
how
 
Since I usually circumvent it by doing using x = T::type::f etc then doing x<int>
 
user1804599
C++ syntax is horrible.
 
that one is particularly bad.
 
user1804599
1:14 AM
C++®: Broken by design™
 
Does GCC have relaxed constexpr?
 
Haven't done much C++1y.
 
@StackedCrooked Well, congrats--for your first state machine, it's really quite clean.
 
user1804599
I don’t give a bother.
 
@JerryCoffin It does not require much deep thought. It's more a matter of consistently applying simple logic. (Sometimes fatigue and coffee bring me in such a state.)
I might be possible to generate it with template magic.
 
user1804599
1:24 AM
@StackedCrooked It is.
 
I haven't looked at spirit and such, but it should at least be able to generate this.
I wanted to write very fast code though.
 
user1804599
@StackedCrooked Use strstr.
 
lol
 
Now that I think of it. I could reinterpret the first 4 characters as an uint32_t and switch on that.
However, PUT only has three characters.
 
user1804599
@StackedCrooked and NUL.
 
1:27 AM
NUL?
 
user1804599
'\0'
 
user1804599
@StackedCrooked I can’t imagine a decent compiler not doing that for you if you say s[0] == 'P' && s[1] == 'O' && s[2] == 'S' && s[3] == 'T'.
 
The HTTP initial request line is 'HTTP 1.1 GET /url'
So that's my data.
@not-rightfold I don't think the compiler will do that.
It's easy to test with coliru though :P
 
user1804599
Uhgwtf.
 
user1804599
	cmpb	$80, (%rdi)
	jne	LBB0_4
	cmpb	$79, 1(%rdi)
	jne	LBB0_4
	cmpb	$83, 2(%rdi)
	jne	LBB0_4
	cmpb	$84, 3(%rdi)
	sete	%al
 
1:30 AM
@StackedCrooked Yes, it is. In hardware design, there are quite a few tools to generate similar code directly from a state diagram.
@StackedCrooked This is pretty much what any lexer generator does, though most of them encode most of the work into tables instead of a switch statement. In this case, that would be producing a pretty sparse (therefore fairly wasteful) table.
The classic version (where you care only about speed, not table size) is a table with one row for each state, and one column for each possible input. At each location, you have the next state for that pair of current state and input, and (optionally) a function to execute as you make that transition.
Anyway, I guess I have to go eat some supper. Later.
 
user1804599
@StackedCrooked (*(uint32_t const*)s >> 8) == (*(uint32_t const*)"PUT" >> 8) or something like that?
 
@not-rightfold I mean to store the number which maps to "POST" and compare against it.
 
user1804599
Can you give an example?
 
user1804599
Don’t you mean exploiting the fact that encoding the string “POST” takes 32 bits?
 
user1804599
That’s what *(uint32_t const*)s == *(uint32_t const*)"POST" should do.
 
1:41 AM
@not-rightfold yep
 
user1804599
Given a sufficiently forgiving compiler.
 
user1804599
Optimizing this away as UB would break a lot of existing code, so I doubt they do it.
 
user1804599
@StackedCrooked Well, and “PUT” is only three characters, so you can shift one character off of the four.
 
user1804599
Hence the >> 8.
 
The data I receive is something like "PUT /blabla HTTP 1/1.0". so I could try to match "PUT "
 
user1804599
1:45 AM
That’s very easy.
 
GET /path/to/file/index.html HTTP/1.0
My mistake.
 
user1804599
lol HTTP 1.0.
 
user1804599
Just a thought.
 
I just copy pasted that line from the Internet.
 
user1804599
If you can be very permissive, why not match only the first three characters in any case? :P
 
user1804599
1:47 AM
There are no two methods that share the same three-letter prefixes. Except if you must allow custom methods or must validate complete request validity.
 
There might be implementations that do so.
 
user1804599
Or you can just match the first four characters using the uint32_t cast.
 
user1804599
The methods are always followed by space, so you can just match against *(uint32_t const*)"GET " (note the space).
 
That would probably be good enough.
 
Just take a substring and compare it jesus
 
user1804599
1:49 AM
Cat go to sleep.
 
user1804599
inb4 drunk
 
You need to parse the entire header anyway if you want this to be useful
I was watching films
 
We absolutely must figure out the fastest way to parse a sequence of 4 characters is sometimes only 3 characters.
 
user1804599
Bitshift.
 
Regex
In Perl
Using PHP VM
 
user1804599
1:51 AM
Do it in assembly.
 
Anything is fast enough. Just don't use std::string.
 
Then run the assembly on JVM
In qemu
 
user1804599
Hardware JVM.
 
user1804599
@StackedCrooked brb
 
On a virtualised Windows
Basically you're all terrible good night
 
1:53 AM
@JerryCoffin I have something like that for a TCP state machine. (I might have mentioned this a few months ago.)
night
 
user1804599
@StackedCrooked with vector instructions you might even be able to compare the input to two strings at the same time.
 
Good lord.
We could make the internet 2x faster :D
 
user1804599
@StackedCrooked Have some job security.
 
user1804599
It even works.
 
user1804599
Cool.
 
2:10 AM
I'm not drunk.
Hi.
 
soup
 
user1804599
Everybody is drunk.
 
user1804599
Haha oh god.
 
user1804599
clang evaluated the thing at compile-time.
 
I feel really sad but I'm not sure why.
Also, my bed is comfy.
 
2:13 AM
Could be some neurotransmitter imbalance in your brain.
Random stuff.
 
user1804599
Magnets.
 
For some reason on Firefox I can't log into gist.github.com
but I can on Chrome
 
user1804599
 
yep..
If I do private browsing it works.
 
I also feel kinda sad.
Are the aliens emitting radio waves?
 
user1804599
2:22 AM
I feel sad too.
 
Let's all drink then.
 
user1804599
@StackedCrooked Let’s Drink
 
I am seriously confused :/
 
user1804599
s/confused/sad/
 
ENTERTAIN ME PUNY HUMANS
 
2:27 AM
lol
 
user1804599
0
Q: Why do I have created a potential stray pointer when having delete in the destructor here?

user2856452My program crashes upon exit. Tracing the error back I arrived at the destructor of the class gWSW. Here is the problem: I have a class gShop: public gTexture. In this class I declare and initializes a pointer to an object of the class gWSW. In gWSW I have again a pointer to an object declared...

 
time to go back to Chrome
I don't like FF too much
 
user1804599
time to think of something fun to do this weekend
 
I need to prepare a new character for another round of Call of Cthulhu tomorrow.
 
I'm listening to "The Crane Wife" from the Decemberists.
 
2:36 AM
That's a nice song.
A sad story.
Maybe I shouldn't be listening to sad songs.
Actually, that album is pretty damn sad all over.
 
Stop listening to it or you'll end up like Cat++
 
Guys your not going to believe this, but i found a lost iphone 5s today
 
I seem to have a much larger variety of sad songs than others.
:( I remember when I said that about sbi.
 
Sorry to hear.
 
g'day
 
user1804599
2:48 AM
Hello.
 
user1804599
@DavidKron Sell it on the black market.
 
@not-rightfold Im really terrified, one part of me thinks about "taking from the rich and giving to the poor"...
 
user1804599
Give it to a poor guy and he will sell it and buy drugs from the money.
 
user1804599
vOv
 
Sounds reasonably ethical
 
2:51 AM
Nice perception
 
When i turned the iphone on for a glimpse there was this text from the owner, saying like: Lets to this the quick way so you wont get all beaten up, the phone is tracked anyway.
 
user1804599
lol
 
user1804599
Wipe it.
 
user1804599
Or call the owner.
 
And i know that simply taking out the sim and turning it of for a while SHOULD help, but still theres this eager in me
What if apple stores the serial and like, always tries to hook it
 
2:53 AM
Wait what.
 
user1804599
Sell it on Silk Ro… oh wait.
 
Why don't you just return it to its owner?
 
why is it always that I'm either high or drunk? can I blame the standard or is this undefined behavior?
 
user1804599
Because you like Perl.
 
@not-rightfold that's true though.. but perl should be the only drug one need
it's heavy enough.. isn't even considered a gateway drug, it's just a drug.
 
2:55 AM
@R.MartinhoFernandes Its probably because i have this curious interest in seeing if i can get away without doing it. As-well as a hate for posh people and everything apple.
 
You think i should try to return it?
Im really drunk
Anyone know around what it costs to buy new? It really is the new one, whatever its called
 
I say return it, you know. Like a decent human being.
 
^^^^^^^^^^^this
 
user1804599
If you want to be what others want you to be, return it. Otherwise do whatever you want.
 
2:58 AM
^ mos' def' that
 
user1804599
vOv
 
I guess, fuck i wish i hadent picked it up in the first place
 
well, not "that" what @not-rightfold.. the question isn't whether to return it or not, just bloody return it (if it's not yours, try to return it)
 
user1804599
@DavidKron Put it back where you found it.
 
I mean, if the owners doesn't pick it up; consider it to be yours
 
2:59 AM
Il probably turn it to the police right?
 
It seems you have a way to contact the owner... use it?
 
@DavidKron what country are you in?
 
Sweden..
 
This reminds me: do you guys know if mailable wallets exist?
 
user1804599
Haha turning found lost items to the police.
 
user1804599
3:00 AM
Great idea!
 
user1804599
They will know what to do with it!
 
@DavidKron så länge du gör rätt för dig kommer du att få tillbaka telefonen om ägaren in hämtar den, dock är det säkerligen lättare att få tag på ägaren på annat sätt
@DavidKron har du tur är det en äldre tant som sedan bjuder på bullar och en trisslott, annan tur vore det om det är en tjej av högre "snygg-grad". har du otur är det en otacksam gubbe som skriker på dig
 
I had the phone number for some contact for like one secound
 
user1804599
@refp Being Dutch, I can understand a tiny little bit of that.
 
Erm, what.
 
user1804599
3:01 AM
And only if I pronounce it.
 
He texted me from anouther number, now its gone tough
 
@not-rightfold Tror jag inte
 
user1804599
Open text messages. :v
 
I have a dutch guy in my programming group, he never gets a thing
 
3:03 AM
@not-rightfold Not mine. I've googled for it before and couldn't find it, but maybe I don't know the right terms.
 
to sum it up; "turning it in to the police will grant you the object back if the owner doesn't pick it up, contacting the owner by other means is probably easier, if you're lucky you'll get a reward, some other kind of luck would be a hot girl (who you may date), if you're unlucky the item will belong to an eldery, angry, man"
@DavidKron where are you studying?
 
user1804599
@R.MartinhoFernandes That wasn’t a reply to that. :v
 
Oh. Sometimes I forget you're a dumb teenager.
 
user1804599
Thank you for being the nicest robot on the planet.
 
This is how its gonna turn out, its going to be a angry dude that throws himself at me for not contacting him earlier. Probably hes going to beat me up or set the police on ME instead
 
3:05 AM
@DavidKron ... you're bloody swedish
 
@R.MartinhoFernandes Here in American you can put a wallet in the mailbox and the mailman will deliver it to the person.
 
I study "software engineering and management" at gothenburg university
 
user1804599
@DavidKron Uh well, if he doesn't like it even if you bring it back, fuck him.
 
At least that's what I've heard. Never actually done it.
 
@not-rightfold Only 3 types of ppl say the truth: kids, drunk people and seriously pissed off people :P
 
3:06 AM
@DavidKron "gothenburg university", is that the equivalent of "SU" but.. "GU"? (stockholms universitet vs göteborgs universitet)
 
user1804599
Putting a wallet in a mailbox is a wonderful plan if you want somebody to steal all your money.
 
It's for returning one to the lost person. It's also illegal to open up someone's mailbox and no one does it anyway.
 
@not-rightfold unless the mailbox is rather small and fit inside your pocket, than it's the same as having a regular wallet.. (just a bit more inconvinient)
 
Your wallet was stolen already, and the guy took all the money. Now all he needs to do is drop the wallet in a mailbox instead of a trash can.
 
3:07 AM
@refp More or less i guess, chalmers is usually the way to be for gothenburgers tough, HOWEVER, at GU i can study in English with international students, i really hate the swedish terms for for loops etc etc
 
@DavidKron it's a common trait to hate swedish if you're swedish
I guess...
 
Also, it's not wallets. It's actually lost IDs.
 
user1804599
Lost IDs are for losers.
 
user1804599
They lose things.
 
time to cook me something to eat, then roll a fattie
 
3:10 AM
Yeah well anyhow, its been a long day for me, its currently 5:09 here. So i gonna go to bed now and tomorrow il take the train to gothenburg and pretend for the police like i didnt take the iphone home or something. Il tell you how it goes GN
 
@DavidKron damn it.. is it 5am already?
rethorical question, still surprised though
 
yeah, here atleast
 
@DavidKron I'm in stockholm
 
@refp Get, lost
Vet du hur många det bor i stockholm?
 
I found this in a 2009 post about constexpr
> I don't think that dereferencing a pointer inside a constexpr function
is legal (I'm not sure). Also, recursion might not be legal.
good thing those are legal :v
 
3:13 AM
@DavidKron varierar rätt kraftigt beroende på hur man räknar, men storstockholm.. runt 1.2 miljoner?
 
@refp En DRYG miljon
Good night
 
@DavidKron innanför tullarna, sure. storstockholm; 2.1 miljoner (enligt wikipedia som länkar till SCB (statistiska centralbyrån))
@DavidKron enligt samma källa; 1.4 miljoner i "tätorten" stockholm, vilket jag antar är tunnelbanenätet (lite drygt)
innanför tullarna.. mm, säkerligen < 1 000 000
 
Det var ett tort göteborgskämt
 
@DavidKron ah, now I got it.. I'm too drunk
man vill inte vara den som är den.
 
I'm going to sleep.
 
3:17 AM
@R.MartinhoFernandes g'night.
 
hello guys
 
@ved_null_ hi
 
@ved_null_ the answer to your, not yet written, question is; no, but c++1y has it.
another glad customer. NEXT!
 
@Mikhail Hello
@refp hey whatsup
 
@ved_null_ I have the munchies but just ran out of cheese, and with that said I cannot make any more toasts.. so that kinda suck
 
3:27 AM
@refp lol
 
@ved_null_ laugh all you want.. I'm seriously considering heading out to buy some more..
 
@refp all right then.. best of luck
 
seems like a bad idea though.. I'll probably just try to sleep. not many good ideas emerge when you're not sober, though they seem magical when you are
anyhow; I'm off.
 
ok.. perhaps you might get nice sleep
 
New version is up only 122 revisions though
 
3:59 AM
And it still cant compile hello world =/
 
4:17 AM
Guten Tag
 
4:38 AM
morning
 
morning all
what happened to all out pinned messages?
 
budget cuts
 
@ScottW Scotty! :)
How ya been bro?
 
the hell is a mang
 
What did you buy? Are you gna cook yourself?
 
4:52 AM
woof woof motherfucker
 
@DeadMG you're feeling jolly 2day
 
not really
both last night and the night before that, I had a whole bunch of nightmares for no apparent reason, which is quite unusual for me.
probably something to do with the freezing cold
 
@ScottW and you see reality is the nightmare
 
I have to work till 3 AM in the morning.
Life sucks, and I'm tired today.
 
@StackedCrooked Eh, I've been waking up to that every day since I was about four years old.
 
4:59 AM
Ok.
 

« first day (1092 days earlier)      last day (3853 days later) »