« first day (806 days earlier)      last day (4146 days later) » 

4:00 AM
try just using it, and letting the compiler error out
 
@johnathon why? could you give me an example? does it make the job easier or is there something else?
 
and secondly
 
@Tuntuni it's easier to manipulate data using the std lib, and a string or a vector<char> both work nicely
 
@johnathon aha. okay :)
 
I was thinking that maybe I could try to force the compiler to at least try some converting before passing it all down. Or, that was the hope, anyhow.
Maybe I could do it using recursion instead?
 
4:00 AM
@Tuntuni just makes the job easier, cleaner, typesafe, and overall easier to maintain
@Tuntuni like , insted of passing a char* and a size, pass a string.. and when passing it to the fucntions call the strings to_cstr() funciton, keep in mind if your compiling for unicode you'll have to use a wstring
 
@johnathon okay. thanks :)
 
The idea was: pass parameters, if the parameters aren't the right type, have stack-allocation accomodate for that and just perform the conversion using constructors / operators by the time it got there, then just operate on all the arguments. The compiler would error if a conversion was impossible, but the idea was that conversions only happened for individual elements, rather than copy everything into a new array to make it all work out.
 
@johnathon and if the function modifies the buffer (and the string char buffer isn't to be changed), should i then use char buffers?
 
@Tuntuni no prob. Like, for instance, string data; data = "heres some data to send"; send(s, data.to_cstr(), data.size(), 0);
@Tuntuni aer you takling about recievig?
 
@johnathon i meant something like a function to which you pass a buffer of data and it returns new data in the same buffer, overwriting the old data
can't remember which function it was
but i definitely found one
 
4:04 AM
@Tuntuni the function should take a non cost reference to a string
 
The goal here is invoking as little overhead as possible and letting RAII take care of things, with no copying and such done if there's no parmaters that are not of the right type.
 
@Tuntuni and then just modify the string in place inside the funciton body
 
@johnathon it is a part of the WSA though
can't remember which one it is :/ maybe it is one of the deprecated ones
 
@Tuntuni Are you asking about a recieve buffer?
 
@johnathon no, but sure tell me about that too :D
@johnathon (there's a function which takes a char buffer as an inout arg)
 
4:06 AM
@Tuntuni getaddrinfo, and send, and recv all take char*'s
 
@johnathon ya
 
@Tuntuni im telling you you can use stl containers insetd of those char*'s, and for a buffer, really a plain old char array on the stack is fine , just have a vector<char> or a string you can suff what you recieved into
 
@johnathon ok
 
@Tuntuni when recieving, you may not get all of the data in one call to recv, hence you'll need an expandable buffer for that, and a fixed size buffer just for calls to recv. recv tels you how much of that array it wrote to as it's return value, then just copy that amount over into your expandable buffer
 
4:10 AM
Don't work with broken APIs
Work with abstractions that deal with them properly
 
@CatPlusPlus name me one good free winsock abstraction in C++ that is decent all the way around
 
@johnathon ah that, ok :D
 
Okay
 
Boost.Asio
 
I think I'm on the right track with Variadics
But I need some help
 
4:11 AM
@CatPlusPlus i ask not being a smart ass , im asking because i've not found one
 
Seriously, it's not hard to find something better than BSD socket API
 
@CatPlusPlus you mean winsock api?
 
I mean BSD socket API
 
@CatPlusPlus were discussing winsock
 
Take a guess which API WinSock is implementation of
 
4:13 AM
@CatPlusPlus i know what winsock is implemented off of , the 1.0 calls, after that it dirverges a lot
 
i just stick to winsock 1.1... havent had any major problems
 
Both send and recv are BSD
 
except for one issue that has to do with i believe sending udp packets to a port that isnt open
 
@CatPlusPlus yea, he's working with blocking sockets atm, learning the api as best he can, and im just giving him pointers to save him pain down the road on
 
its not a bad idea to learn how bsd sockets work... when you graduate to the higher level apis you will have some idea of how they work
 
4:15 AM
@CatPlusPlus especially when he gets to non blocking , Async io, and io completion ports
 
The pointer is don't use low-level networking API
 
use it to learn knowledge is power ;)
 
Use XMLHttpRequest!
 
@CatPlusPlus again, name me one good general abstraction on top of the winsock api
 
ALL OF THEM
 
4:16 AM
@CatPlusPlus i've found none. not even boost.asio
@CatPlusPlus poco comes close, but still no bar.
 
@CatPlusPlus he said 1 not all ;)
 
Lol.
It's okay Cat, I understand.
 
@johnathon A good abstraction on top of the winsock api? Is that even possible?
 
@StackedCrooked no, it's not, which is my point
 
4:18 AM
I did not realize that.
 
@StackedCrooked well , the winsock api covers a lot of space
not just bsd style sockets, but WSAAsyncSelect, AsincFIO , and IO Completion ports
 
Is it possible to have explicit specializations of templated functions?
 
one abstraction is good for one domain, but not for others
if you need a high end performance service using io completion ports... your not going to use boost.asio
 
If you really think C++-aware library would not make async I/O better then I don't know what to tell you
 
@ThePhD Yes, for free functions. IIRC not for member functions. However, you can overload on identity<T> to emulate specialization..
 
4:20 AM
Especially that using IOCP manually ties you to a single platform, which is silly
 
@StackedCrooked Oh. That explains a lot then.
So then there's no way for me to get this working without copying.
 
@CatPlusPlus the big problem with client side code while using boost.asio or poco for that matter is ui events that need to happen due to network events , you cannot hook that up with boost.asio, or poco
 
Well, fuck dicks, that sucks.
 
Oh right, using WinAPI for UIs too
 
@StackedCrooked ... Wat?
 
4:21 AM
I really don't want to know anything more
 
shakes his head
 
AHAAA
VC IS INCOMPLIANT
Fuck yes, nonstandard extensions for the mother fucking win
Oh wait, now they're compliant....
.... Fuck you, VC2012. Conforming to The Man.
 
lmfao
 
@all Hi!
 
4:30 AM
hello
 
How is it going?
 
@DeadMG @StackedCrooked I figured it out, because I'm amazing and I can beat The Man
0 heap allocations, no std::vector or std::array
Just recursion
Fuck stack space in the mouth.
 
Of course I can see some explicit contents in verbal form in this room rather than technical things ;)
 
@ThePhD nice work.
 
Now I just have to figure out how to make this work for my purposes. ._.
 
4:35 AM
Fuck. I just realised LWS deleted all its archives.
I had a couple of private bookmarks for it.
:(
 
@Rapptz I mean, I'm so sorry. Hands a cookie of Forgiveness and wubs.
 
Shush you. :(
 
user142019
lol
 
user142019
PE is fun.
 
@Zoidberg'-- First 15 problems are easy.
 
user142019
4:36 AM
I'm at 5 now.
 
user142019
I do all of them in Haskell.
 
Oh lord.
He's on a Mission to prove Haskell is the greatest.
 
Doesn't need to.
You have two level 15 users.
 
Level 15?
 
375+ problems solved. It's the last level for PE.
 
4:38 AM
Ah.
 
On that last Grid problem.
Mmboy.
 
@ThePhD Which?
 
The admissible paths.
 
4:40 AM
@Rapptz what's your name on PE?
 
"Danny"
 
woah nice :D
 
Okay
Just for fun
I'm going to solve Problem 67
Just because I can, bitches.
 
brute force it
lel
 
Do you want the answer for comparison sake?
 
4:42 AM
nou :O
 
WAIT
 
you can always google it
 
I will NOT be
EULER'D
 
i wonder what the algo is
 
By you FILTHY Eulerians!
 
4:42 AM
Probably. 67 is a popular problem.
 
rapptz, is the algo hard?
 
No lol
 
lol :o, pastebin? :D
 
I don't keep most of the source files. I recently started doing them all over and putting them on github.
I can solve it again though, I remember this one being just a couple of for loops.
 
ah :) nice
oh btw, do you use a bigint library or something?
e.g. find the sum of the last 10 digits of 2 to <something huge>
 
4:44 AM
It smells like a maximization problem to me.
 
I made my own.
 
^ He's crazy like that.
 
do you use it for PE?
@ThePhD lol :D
 
yeah sometimes
 
kk
 
4:45 AM
Damnit, Rapptz
Stop being so awesome with PE
 
could you just find maximum of a 3 number triangle at a time and then do that recursively?
 
You're gonna make me wanna make a BigInt library
 
@Pubby Just do bottom to top.
 
user142019
Problem 5 takes ages to compute with my terribly slow implementation. xD
 
@Rapptz dunno what that means
 
4:46 AM
@Zoidberg'-- Problem 5 takes ages BECAUSE I'M USING HASKELL.
FTFY.
 
user142019
Uh no that's irrelevant.
 
Start from the bottom of the triangle and work your way up. Most people did it the other way around.
 
I don't see how that helps :S
 
user142019
Let me time it. :P
 
oh problem 5, I did that one by hand
 
4:47 AM
lol
owned
 
no
 
just write a big if :D
if mod this == 0, mod that == 0
;)
 
you could do it that way too
 
how do you check if a number is prime? divide it by every number that is less than or equal to its sqrt and if none of them divide it evenly it is prime, right?
 
Use a sieve
like the Sieve of Eratosthenes
 
4:50 AM
is that faster?
 
Hey guys
 
hello
 
@Tuntuni, yes
 
@Walkerneo ;)
 
My Sieve can do 100m primes in like 0.1s
 
4:51 AM
is this the number? 232792560
 
user142019
Is PE 6 a joke or something?
 
@Pubby for 67 or 5?
 
user142019
Even a baby can solve that.
 
haha, euler stuff going on in here?
 
@Rapptz 5
 
4:51 AM
It's all a joke
 
yeah that's right
 
btw, that's "oiler" not "you-ler"
 
@Rapptz wtf
@Rapptz nice
 
> Congratulations, the answer you gave to problem 5 is correct.
awwwww yusss
 
Professional Pubby
:P
 
4:52 AM
haha
 
you forgot to click share
 
I always forget to share :(
 
ANYWAY guys, I need some ideas for tools and resources that were used independently by some organization and then released for public use
Twitter bootstrap for example. I remember seeing some others, but I can't remember what they are.
 
Why goto
 
4:53 AM
@Rapptz E-peen +1cm
 
@Borgleader Unfortunately I don't believe that's a prime number.
 
@CatPlusPlus because it's less typing
 
Fuck it.
 
@Walkerneo Anything Facebook released
 
I'm doing Project Euler too.
 
4:54 AM
@Pubby You suck
 
Got a Visual Studio Project setup and a repository.
 
Aw snap.
 
Should I make 1 project per Problem, or 1 SOurce File per Problem?
 
fmm @CatPlusPlus, that's a thought
*hmmm
 
@ThePhD file
 
4:54 AM
And just swap out mains when I need it?
Let's do this shit.
 
@CatPlusPlus well, how would you write it otherwise? I forget how to break out of two loops.
 
@CatPlusPlus correctness > style
 
@CatPlusPlus, did they release their php to c++ compiler thing? That's all I know about their internal tools
 
I don't know what that code does and have better things to do
 
@ThePhD 1 .cpp per problem
 
@Rapptz Hm. So then I just create a main per.
 
Well I name it Problem#.cpp
 
user142019
@Rapptz s/cpp/hs/
 
You need project per problem if you want separate executables
 
user142019
Just invoke the compiler from the command-line.
 
4:58 AM
Oh yeah, I compile with command line.
 
And while you're at it, use vim to edit the source
As usual, not using VS solves all the problems
 
user142019
Fuck, I mixed up curry and uncurry.
 
user142019
COMPILER ERRORS Y U NO HELPFUL
 
You just don't know how to read them
:v
 

« first day (806 days earlier)      last day (4146 days later) »