« first day (1023 days earlier)      last day (4151 days later) » 

00:00
hmm
I wonder if, when I fix it, LLVM and Clang will compile in a more reasonable time frame
@Borgleader Yeah! Mine idles at 59-60.
@MartinJames lolwat? I'm running eve online and im at 45C
@Borgleader Stock Intel cooler :(
Hyper 212 Evo :) Best 35$ I ever spent
Is github down?
00:04
@Borgleader 60 is OK. If I run 8 CPU threads, gets up to 80 :(
Error 3 error C2678: binary '<' : no operator found which takes a left-hand operand of type 'const sf::Vector2i' (or there is no acceptable conversion) c:\program files (x86)\vc\include\xstddef 180 1 BlockScreensaver
How do I find where this came from?
@Mysticial it is
Ell
Ell
I have some fancy cooler, I'm not sure what, I bought this PC when I was a hardware noob
@Pawnguy7 The source code?
@MartinJames it doesn't list any of my source files though
Ell
Ell
00:06
@martin unfortunately I'm in bed and turbo grapefruit would require much more effort than I can muster at the minute :P
@Pawnguy7 Hmm.. it looks like a compile error. WTF is 'xstddef'?
@MartinJames Some library header file I assume. Something in relation to std::map.
@Borgleader Funny though. It went down literally seconds after I just uploaded an entire repository.
Presumably some X lib?
@MartinJames MSVC's internal std header
00:09
@Tuntuni OK, so not X. Dunno then...
@MartinJames Yeah, MSVC's internal helper header, they've also got xutility, xmemory and loads of others.
@Pawnguy7 Seems like you're missing the less than operator (which a function xstddef is trying to use).
@Tuntuni Why they gos such confusing lib names? To me, 'Xblah' should be linux GUI layer.
@MartinJames So people would stay away and not use them. :D
@MartinJames don't think people would assume that when using VS
also ^
00:13
@A.H. Didn't know MSVC when question first asked.
It resides somewhere within here.
@MartinJames "C2678"? Clearly VC++.
'void Volcano::' I like that :)
Normally when I have such errors, it tells me on the line it occurs.
I wonder if it has to do with using std::map.find
Does that invoke said operator?
@JerryCoffin To you, maybe. I have less experience.
00:17
@MartinJames I s'pose.
@Pawnguy7 Are you storing sf::Vector2i in a std::map?
@Tuntuni that was the idea
@JerryCoffin Oh, I can guarantee it :)
@Pawnguy7 Yes, std::map::find uses the less than operator for comparing - !(a<b) && !(b<a).
@Pawnguy7 It came from you trying to use an sf::Vector2i in some context that requires operator<, like the key of a std::map. The compiler should give a stack trace of template instantiations.
00:18
That checks for equality.
@MartinJames At my age, that's starting to become almost a given.
What I wanted was contains basically.
sf::Vector2i is probably missing that operator.
Anyway, you guys/gals/puppies can sort Prawnguy's issues, I'm off to bed.
00:19
It doesn't have it,not sure why it would.
prawnguy lol
According to an SO question I found, stf::map::find can act like a contains - if it has 1 or more, than it would be true, basically.
@MartinJames night
@DeadMG I'm dreaming of a prawn vindaloo :)
@Pawnguy7 It can only be 1 or 0. Only multimap can have more than 1
00:20
BFN..
@MartinJames night
@DeadMG true. Either way, it should work.. hrm
What else can I use to see if it has that key?
er
if sf::Vector2i doesn't have an < operator and you can't provide one through the custom comparator, then all you can do is a linear loop through the map- std::find should work (with an appropriate predicate).
@Pawnguy7 It can't, because you don't have the < operator.
I feel this is going to be very inefficient.
00:22
@Pawnguy7 Either do what @DeadMG said (std::find with a custom predicate) or define operator<(const sf::Vector2i lhs, const sf::Vector2i rhs).
Custom predicate?
@Pawnguy7 Linear time (plus your cache will get utterly fucked). But without a hash for unordered_map or a suitable binary predicate, you've got no other options.
@Pawnguy7 Yes. A functor which will be called with the 2 elements to check for equality.
There you would do something like a.x == b.x && a.y == b.y.
Ah. What I am trying to do here is, get all the lava blocks, calculate light level based on distance, and set it to the higher one, as to not overrite stuff.
But you could just implement operator< for sf::Vector2i and be done with it.
00:24
hi
@Pawnguy7 So if it's higher it should be changed?
@Tuntuni Yes. I wanted the highest level.
well, if you want better than linear time, you will need an appropriate comparator.
map's result gives a pair.
also, he wants to find, nor for_each
@DeadMG Where?
3 mins ago, by Pawnguy7
Ah. What I am trying to do here is, get all the lava blocks, calculate light level based on distance, and set it to the higher one, as to not overrite stuff.
@Tuntuni *map.begin() gives a pair<K, V>.
00:28
Yay, finished uploading my new github repository.
@DeadMG Ah, right.
is there another way to store the "full value" of something?
without using a big int?
Define "full value".
^ this
your question is really vague as of now
if I multiply together a,b,c,d,e...z it could be a very large number if I do not apply modulus to it
00:30
How big can your numbers be?
sigh...
oh.
just multiply a and b, do the mod
multiply by c, do the mod
up to about 100 each but there can be many numbers, maybe hundreds of thousands
@user2597879 Yeah, you'll have to use a big integer to store your results if they're that big.
@user2597879 boost::multiprecision
00:31
25
A: Need help in mod 1000000007 questions

MysticialThe key to these large-number modulus tasks is not to compute the full result before performing the modulus. You should reduce the modulus in the intermediate steps to keep the number small: 500! / 20! = 21 * 22 * 23 * ... * 500 21 * 22 * 23 * 24 * 25 * 26 * 27 = 4475671200 4475671200 mod 1000...

@user2597879 You can store it in one big integer, or a bunch of smaller ones.
the problem is I need to do the multiplication again and again and again for different moduli
@Mysticial I was thinking of that question precisely :D
but doing it from scratch each time is timeconsuming
but i don't know how else to store the value
00:31
boost::multiprecision should work
i think it would be too slow though
trying to understand a logic around the issue
never guess performance
benchmark it
If you don't want to do division, it'll be great
@user2597879 There's a certain minimum of time, but reducing modulo N to keep the size reasonable is generally faster than maintaining full precision throughout.
for instance if i asked you to multiply together numbers from Start to End mod m multiple times, it's time consuming to do the multiplication each time mod m because maybe you're just re-doing the same multiplications, so you keep an array where each index is the product up to i. Then the answer is typically product(End)/product(start-1) mod m
00:35
Javascript doesn't have overloading? WTF
but when there are different moduli you can't store such an array for every single outcome, nor can you store the full value, so i am at a loss
Look at Jerry's code, now back to yours, now back to Jerry's, now back to yours. Sadly, your code is not Jerry's.
Jerry's on a computer
is there some way to do the multiplications mod X and then translate the results to another mod later?
If Y is your second number, and you can find a certain relation between X and Y, then sure
If x % 4 == 0,
then x % 2 == 0
If you did x MOD y, if you're going to do x MOD z where z is a factor of y, you return the same result
not sure about other cases however~
|x - y| might be special
You can also do fancy shit with the Chinese Remainder Theorem. I won't go into that.
It really is the kind of shit that is so fancy, you don't even want to touch it - let alone smell it.
00:42
Same error.
Going to grab some foodstuffs, be back
@Mysticial I figure it is CRT-related, but I didn't understand the wiki enough to see if it would address my particular problem
sometimes if you work in one mod you can't easily translate to another mod
@Mysticial Coming from you it really must be fancy
@Borgleader I still have yet to understand the math behind how it works.
Like, I understand why it works and why it's possible. But I haven't been able to actually do the algorithm manually without cheating with Mathematica.
CRT is some nebulous shiznit
00:50
I failed the course that tried to teach me about it
Do either of you know how to address my particular q?
x = (3a + 2) = (5b + 3) = (7c + 2)
And we want to find the least positive value of x that can satisfy such a relation.
That's the first example they gave on that CRT and I don't know how to solve it without brute force :v
I mean (5b + 3) tells me that the number must end with 8 or 3 but that's irrelevant
I suck at math more than I suck at programming, what does that tell you about my math competence?
3a = 7c tells me something
oh shit
that actually works
you deduce that a = 7 and solve the whole thing
x % a == x % b == k must tell us something special
Diophantine equations?
00:58
yes
(Also, yes, I had to google Diophantine equations)
> When I grow up, if I ever find a partner, I don't want to have kids. I don't like the idea of having other people masturbate in my house
Back.
Any idea what the error is now?
01:13
man nobody knows how to answer this thing lol
i even asked my buddy over at harvard
Use boost::multiprecision and be ~~~happy~~~
Once you get it working, you can think of ways to optimize
That will not work here
the numbers are way too huge
would need many many (something)a-bytes
How many digits would you expect?
because each digit can be stored in 4 bits
1 byte for convenience
Would anybody like to help me find this? I still cannot find it.
If you use octal instead of decimal, you can store a digit in 3 bits /o/
01:23
hey guys, if am doing some winpcap stuff in c+ and im facing a problem, i have two class files, main.cpp and netadapter.cpp aswell as netadapter.h

the problem is that both netadapter.cpp and netadapter.h needs to include pcap.h but how can i do this when netadapter.cpp is including netadapter.h ? O.o i guess my question is how to have both the source file and the header file include the same file.
don't make netadapter.cpp include pcap.h
problem solved
yea but it needs it :P to work
@Paze Either don't include pcap.h in netadapter.cpp or add header guards to pcap.h.
Would my question be suitable for SO?
@Paze Yeah, but if you include netadapter.h which includes pcap.h you'll get pcap.h too.
01:27
@MohammadAliBaydoun Well each number can be a few hundred big, and there may be some 300,000+ numbers, so 100^(300000) at maximum
since i am finding products
yea i know that :/ but i have guards in netadapter.h, and pcap.h is a library, that i did not create, its like the core file of winpcap
@Pawnguy7 Idk. Same error with operator less than?
and i thought that 1 octal was the same as 1 byte ?
they're not analogous
@Paze Then either 1) add header guards to pcap.h or 2) rely on netadapter.h to include pcap.h.
And since netadapter.h has header guards, there should be no problems (unless you include others headers that also include pcap.h).
01:30
i tried that, including netadapter.h from .cpp but then my main would not work, which also includes netadapter.h
@Tuntuni yes
a byte is an array of bits (most commonly 8 nowadays) while octal is base 8.
If you want to store octal digits (0,1,2,3,4,5,6,7), you would need 3 bits of information at the very least to represent 1 digit.
@Paze Meh, I'd go with 1). It does seem a bit hackish to modify files that come with a library you didn't write, but IMO they should have added the header guards.
But of course, you wouldn't want to do that.
I mean, unless you're insane.
will my application work with winpcap later tho ? like users running my software ?
01:31
@Pawnguy7 Try to define operator<(const sf::Vector2i& lhs, const sf::Vector2i rhs) as a free function.
Meh, I'm bad at XCOM.
@Paze Yeah, that's the problem. You'll probably have to add that header guard each time you upgrade to a new version of the library.
well ill try adding guards to it and see what happens ;) thanks for your oppinions on this problem of mine :)
@Tuntuni Seems a mess to inherit it just to do that, and I got rid of std::map::find as well.
huh...windows explorer pretends to store XMP tags in jpegs separated with semicolons, yet when I store, say "one, still one; two; three" via explorer, the actual data shows up as "one, still one, two, three". How does it manage to read and display it properly separated by semicolons again?
01:33
@Pawnguy7 Inherit? There's no inheritance involved here.
@Paze Maybe you could wrap it in a header of your own? Like pcap.hpp which then has header guards and includes pcap.h.
@Mohammad Ali i see how u need 3 bits to store one digit :P why use octal tho ? what u working with ?
Assuming the name of pcap.h never changes, you'll never have to modify anything.
yea that would be a good solution
Yeah, it's a one time job.
I'd go with that.
It's also like 4 lines. :P
hmm, ill try to figure it out ;) just moved from C to C++ and the Object orientation part is a litlle hard tog et used to :P
01:35
2 if you use #pragma once. :D
@Paze It's actually @user2597879 who's working with this.
@Tuntuni Ah. I don't really user operator overloading, I must be thinking of something else. But what is using it iffind isn't? Would i t be the foreach?
I am starting to run out of ideas
@Paze OOP is just one of the paradigms C++ supports. Don't forget that it's a multi-paradigm language, i.e. no one forces you to use OOP.
no clue how this is possible
01:36
what u trying to accomplish ?
yea i know but OOP is one of the main reasons i wanted to get used to some C++ aswell i love it, im just not used to it
first message was meant for @user2597879
@Pawnguy7 Hmm, can't tell. Why did you get rid of std::map::find though.
Trying to find a way to calculate a sumproduct from a list of numbers efficiently from Start to End, modulo M for many start,end,M
@Tuntuni it used comparison, I was told.
@Pawnguy7 You could use the free function std::find with a custom predicate if you don't want to define operator< for sf::Vector2i.
But that custom predicate would then need to have logic for operator< which is silly.
Why not just define operator< for sf::Vector2i?
Why is it so hard to make a simple contains :\
01:40
didn't really get that @user2597879 but good luck :P
@Pawnguy7 Well, basically, pair.first.x == position.x && pair.first.y == position.y is similar to what std::map::find does.
Except it operates on sf::Vector2i, not on its elements (it doesn't know what its elements are anyway).
@Tuntuni that is what I did, and it sitll didn't work.
Ever since lambdas my GUI code looks like JAVA :-(
And it also uses operator< instead of operator= like this: !(a<b) && !(b<a).
@Pawnguy7 I'll write a little test app and show you.
I really need to learn C++ collections.
Evidently I have no idea how to use them.
01:43
std::vector will make your dick rock hard
weird :S i just checked and pcap.h does in fact have guards O.o and im still getting and error stating that the C++ standard library forbids macroizing keywords
@MohammadAliBaydoun um... what?
@Paze o.O
@Pawnguy7 What were your map's key and value types?
@Pawnguy7 Seriously
@Tuntuni a struct with int x, int y, and double
01:45
@Pawnguy7 So each point has some sort of a light value?
@Tuntuni Yes. Blocks, in this case.
@Pawnguy7 Mhm. Gimmie a sec.
hey @Pawnguy7 what is ur error ? ur post is too old for me to see it :/
@Paze Something in std::map calling operator< on a type that does not have it.
01:50
i see, allthought i have not used std::map before myself
Neither have I.
I still don't understand the benefit to iterators.
iterators pretty much allow you to make an algorithm without caring what container you're working on.
what is the purpose of a map ? the only thing i understand from a brief reading is that it is a container and it kinda reminds me of a vector.
It's a map
It maps one object to another
Holds key-value pairs.
01:55
like nodes ?
@Paze its nothing like a vector, a vector is a sequential container, a map is an associative container
std::map<std::string, std::string> some_map;
some_map["lol"] = "what";
For example, maybe you store a list of highscores as a string (playername) and value (score)
ahh
i see
You can pull off the same thing with a vector, but searching would be O(n)
Typically, compiler vendors implement a map as a red-black tree
so searching for a key-value pair when you pass a key to get a value is done in the worst case in O(log_2 n) time
01:57
yea i have worked with similar things to a map in android b4 ;)
back then we called it a node-tree
so if you have 1 million key-value pairs, in the worst case, you need 20 iterations in the tree
ah
yea
i used thoose for game algorithms
@Borgleader Ah. That makes a bit more sense, although I cannot currently think of of said algorithms. Example?
uhmm for example pathfinding ?
I was addressing a comment before, you can see which one by clicking on the gray arrow next to it. If you already know that and are answering, I have no idea what you mean.
02:00
@Pawnguy7 sort? lower_bound? upper_bound? binary_search?
for_each? etc
ohh sorry ;)
these pretty much all take a begin and end iterator
Couldn't they also be done with random access and knowing the size of the container?
@Pawnguy7 cant use random access on lists, or maps
because a list is a bunch of nodes, and map is often a tree
A list is sequential nodes though, correct?
02:04
They're not sequential in memory however
^ this
you're confusing "one node follows another node in sequence" with "all the allocated bytes form a contiguous chunk of memory"
I may have vector and list confused.
Anyway, I still don't get it. Hopefully someday it will click :D
The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.

anyone have a clue on what this error is freakin out for ? i though it was my includes but it can't be :L they all have guards
@Tuntuni How is that going?
@Paze Are you macroizing a keyword?
@Pawnguy7 The big difference is that a list does not provide random access. Each node has a pointer to the next (and, in a doubly linked list, previous) node. Therefore, to get to node N, you have to walk through nodes 0...N-1 to get there. With a vector/array, you can use subscripting to go directly to node N in constant time.
02:08
@Pawnguy7 Almost.
nope
I can't believe I found a decent use case for std::list
i do not have defines with the same name
Or well, something similar to it~
02:09
@JerryCoffin Example where such a node structure would be of use?
@Paze May be the standard library. In debug mode, it uses defines for new and delete to use a version that tracks allocations/deletions, so if you have memory leaks it can tell you.
48
Q: Under what circumstances are linked lists useful?

Jerry CoffinMost times I see people try to use linked lists, it seems to me like a poor (or very poor) choice. Perhaps it would be useful to explore the circumstances under which a linked list is or is not a good choice of data structure. Ideally, answers would expound on the criteria to use in selecting a ...

yea but i really doubt i have any memory leaks, i hardly have 300 lines of code, started on this two days ago
Ah. Right.
ahh finally :D i found out it was a macro by winpcap -.- they have defined '__inline' as a macro
02:15
What was a deque again?
its a bunch of contiguous chunks of memory linked together AFAIK
A deque is a double ended queue
It's a queue that you can add shit at the front to as well as the back
1 hour 5 minutes?
yeah i just realized that
xD
I am actually right?
02:26
well it would make sense
i just dont see where the "riddle" is
I thought so, but I am wrong a lot so :D
it's a flat rate
@Pawnguy7 Well, I give up. It's 4:26 am and I'm really tired and I'm getting loads of template errors. Fucking nasty. I'll check it again tomorrow if I can, soz. Night all.
It compiles but I don't know why it requires operator< to be in namespace std.
Ugh. :/
Anyway, good night all. :-)
02:28
It compiles? Better than mine then.
haha :P atleast i know i don't want to introduce myself to maps for a while
anyways good night all :)
what kind of encoding makes "酱油猪骨拉面!(Aug.3,2013); " look like "酱油猪骨拉面!(Aug.3,2013)"? is this UTF-8?
apparently it is. wee
What happens if a function doesn't return?
nothing much? :p
like a int function not returning anything ?
void
02:43
Yes. And what happens if you assign to void?
no like, if u do not return anything :P ur essentially returning "void" or null
returns 5 if the "if" is executed, or it will return "void" :P
so ur handle, int etc will not be set
Just doesn't set?
@Pawnguy7 It keeps executing?
02:47
@JerryCoffin see paste?
yea, it would literally be like trying to assign something to void

int hellyeah = SomeVoidFunc();
^ won't work
@Pawnguy7 Ah, trying to use a value when none was returned. Undefined behavior.
Ah.
I wonder if there is a page somewhere of undefined behavior jokes.
Like, what would happen.
i remember seing some programming meme's on 4chan a while ago :P
@Pawnguy7 "no return specified on a function returning non-void"
02:52
@Rapptz Compile error?
Compiler warning but it's UB.
Ah.
If memory serves, Java errors.
That wasn't very satisfying.
Java errors.
Make some lava siptting up
Spitting up from?
@Tuntuni made non-templated map to test, it seems to work... or at least, that part is good now. I think.
Night.
hey everybody. I was wondering, is an api just a collection of methods for working on some abstract thing X?
02:59
An API is an Application Programming Interface. It's whatever you are allowed to use in a library.
be it some functions, a class and its methods, etc...
@MohammadAliBaydoun, thx
In most cases an API is just a fancy word for a library.
Like the C++ standard library is an API, but things can also define an API (like POSIX and the actual C++ standard).
@Rapptz Yes and no -- "API" specifically refers to the interface, not the implementation.
and the interface is through method calls right?
03:04
Also includes stand-alone functions. BTW, hello all.
TIL rms named POSIX
I'm guessing this is homework.
@Telkitty猫咪咪 Hi. :)
03:14
@MohammadAliBaydoun, nope. Just want to make sure i understand whats going on
> Your dog has learned how to rip throats out of fallen enemies more effectively.
Oh, Fable.
lol
I found the third fable to be too short
I enjoyed it but it was too short
The condition for me to be able to use my own class in a range based for loop is that begin() and end() are present, is that correct?
yes
03:52
hello kids
My doog is floating in the air
@Borgleader Based on the solution:
@Borgleader First wasn't that long either. vOv
03:55
@CatPlusPlus I know, but we'll talk more about this once you finish the game.
You'll understand what I mean. I hope.

« first day (1023 days earlier)      last day (4151 days later) »