« first day (742 days earlier)      last day (4211 days later) » 

user142019
12:12 AM
In the future, when somebody posts a stupid question on Stack Overflow, this will be my reply:

………………………………………………………………………………………………………__„,—-~”¯’,
……………………_„,——,…………………………………………………………………___„,—-~~”¯¯ … … ,/’
…………….._,-~’¯ ; ; ; ; ;’,——,……………………………………………………….,~” … … … . __,-~~’¯
………,_,-~’¯; ; ; ; ;,-‘¯¯¯” ‘¯~’,|,……………………………………………….._,-~’ … … . ._,—~”’¯¯
…… ‘¯¯; ; ; ; ; ;_. ,/’ …¯’o~- ‘|…………………………………………_,-~-~’¯ . , … . ¯¯, . . ‘,
……¯¯,-~*_ . /’ . ‘\| … … . .’\…………………………………_,-~*’¯,/’,/’ … . .¯¯¯’~——„,,„, .’,
 
Xeo
lol
 
user142019
Meh.
 
Problem is, it is a question... just a stupid one
 
user142019
Chat’s font fucks it up.
 
try with backticks?
 
Xeo
12:13 AM
which wont does it render good under?
 
lol it looks like he doesn't have an arm and he's screaming in pain from being armless.
 
@Xeo I'm trying adding explicit specializations of gen_seq for some values of N via the preprocessor for fun.
 
user142019
@Xeo Arial.
 
Xeo
@LucDanton For what reason?
 
@Xeo Bigger values of N!
 
Xeo
12:15 AM
lol
explicit specs for small N or what?
 
Well I first wrote one for 256. I'm trying to generalize but I'm not that Boost.PP proficient.
 
@WTP'-- whoa, arial makes a big difference!
 
In this instance I hit the BOOST_PP_LIMIT_REPEAT of 256.
 
Xeo
mhm
Btw, did you change how the indices are generated now, aka map first, generate and reverse if necessary?
 
No. I have to settle on semantics before. I'm not sure why we decided that FromTo<3, -3> should generate [3, -3).
Okay using BOOST_PP_MUL is ridiculous.
 
12:20 AM
Arqade has the best titles.
19
Q: How to murder efficiently as an assassin?

oskobMy character is a archer/sneak type of guy but I'm having a hard time playing the game. I can kill regular NPCs easily with sneak attack but as soon as I run into a more bad ass type of enemy I'm unable to kill them and I have to run by them like a coward... One example is the first time you go ...

 
Here's a suggestion, FromTo<a, b> [a, b], FromUntil<a,b> [a, b[
 
@Borgleader This is a terrible suggestion.
 
Its the convention used in scala
 
Xeo
FromTo<3, -3> for an 8-tuple would be FromTo<3, 5>, aka indices<3, 4>. Makes sense, or not?
 
No. With that kind of logic, I'd expect From<3> concatenated with To<5>.
I.e. some repeats
Uh, that needs another full tuple in the middle I think. Ya it does.
 
Xeo
12:27 AM
Hm. Maybe I'm confusing myself again. FromTo<A, B> is [A, B), e.g. FromTo<0,4> would be [0, 4), aka it's a half-open range. Right?
 
Yes.
 
Xeo
Then why would FromTo<3, -3> not be FromTo<3, 5> aka indices<3, 4> for an 8-tuple?
 
No it makes sense. No reason to expect repeats since it's a 5-slice out of an 8-tuple.
 
Xeo
Shouldn't it be a 2-slice, yielding two elements?
 
Sticking with that is there an identity between FromTo<i, j> and FromTo<i,j, -1>?
@Xeo I want to each -3 by wrapping around, so to speak.
 
Xeo
12:31 AM
Oh, you'd want FromTo<3, -3> to go backwards?
 
From<3> is FromTo<3, 8> and To<5> is FromTo<0, 5>. Together that yields <3, 4, 5, 6, 7, 0, 1, 2, 3, 4>. There are actually repeats and that's definitively not length 5 lol.
 
Xeo
That logic doesn't make sense to me. Or do you mean it's implemented like that at the moment?
 
No.
 
Is Sphinx only for Python?
 
I think I prefer having either that behaviour or yielding an empty slice. Python has the latter.
 
12:34 AM
I'm not sure how to use it for C++ even though it says it's supported
 
@Xeo The logic is that negative indices are 'to the left'. To reach a negative index with a positive stride, one has to wrap around to come back from the left.
Time for a free-hand diagram.
 
Xeo
I thought they were just a shortcut for the third-last element, for example
@LucDanton No need, I see what you mean
 
@Xeo That is certainly some possible semantics. It doesn't have to be that way though.
 
Xeo
@LucDanton Totally right, it's what I personally would expect though
 
What I dislike with that semantics is that it operates on the bounds individually, by remapping them via modulo. It's not an interpretation of range.
 
Xeo
12:37 AM
The problem with those semantics is however, that once the To index is smaller than the From index, you get a reversed range without specifically saying that.
 
Interpreting it as an 'impossible' range yields an empty range. The other interpretation is that the space is a continuous (-n, -n + 1, ..., -1, 0, 1, ..., n - 1, n) ribbon. (One of the extremity is repeated here.)
@Xeo Isn't -3 smaller than 3?
 
Xeo
@LucDanton Not necessarily if you map first
I meant if the mapped index is smaller
 
Oh, wrong semantics.
 
Xeo
(Only thinking about my proposed semantics here.)
 
That should be the third interpreation, no? The space is [-n + 1, ..., -1, 0, 1, ..., n - 1, n), and you have to get from one index to the other.
 
user142019
12:41 AM
Oh fun.
 
Xeo
I think so.
 
user142019
Bring Me the Horizon is on the radio. ಠ_ಠ
 
Xeo
Basically, you say negative indices need a wrap-around to be reached, and I say negative indices should be mapped first and then be treated like normal indices
If I recap our conversation correctly here
 
You can relate the two: bFromTo<3, -3, 1> is aFromTo<3, -3, -1> (where a is the former interpretation, b the latter).
 
user142019
@Rapptz it supports C++, but not C++11.
 
user142019
12:42 AM
But not autodoc (i.e. you need to write your documentation in .rst files).
 
I decided to ignore Sphinx. It's probably easier to do it by hand.
 
Xeo
I think I'm getting confused about the negative striding (again).
 
@Xeo We've been a bit sloppy with the notation. Yet another take is, assuming we're using model a, we need to settle on whether aFromTo<3, -3> should default to aFromTo<3, -3, 1> (that one wraparounds) or aFromTo<3, -3, -1> (that one goes in reverse).
 
Xeo
Settling on semantics sure is hard.
 
Yep.
 
Xeo
12:46 AM
Btw, in my semantics, FromTo<3, -3, 1> shouldn't be reversed if map<-3, Size>::value > 3
 
user142019
In this song I’m listening to they say “say hey” aka @sehe.
 
Xeo
I think I need to think about this some more and consider some more implications of that
 
Perhaps it would be simple to settle on what we want 'common' operations to be.
What should From<-1> 'naturally' be?
 
Xeo
One implication of my semantics is that you get a reversed slice if map<To, Size>::value < From without explicitly requesting one
 
For instance we want To<-1> to be 'everything but the last element' right?
 
Xeo
12:49 AM
@LucDanton If we fill in the To as Size, then I'd expect a 1-tuple with the last element.
@LucDanton Yea
 
That's unambiguously expressed with negative indices as FromTo<-Size + 1, -1, 1> or FromTo<0, Size -2, 1> (nevermind if Size is 1, heh).
 
Xeo
@LucDanton If FromTo is a half-open range, shouldn't the latter be FromTo<0, Size-1, 1>?
Aka working correctly for a 1-tuple?
 
We don't want the last element. The last element is as position Size - 1.
Ya that's it.
 
Xeo
[0, Size-1) aka [0, LastIndex)
 
Size - 1 is -(-Size + 1), there's an identity here with that model.
I.e. FromTo<i, j, 1> is FromTo<-j, -i, 1>.
Should we settle on 'positive stride means increasing indices'? Doesn't mean that an unspecified stride is always 1.
 
Xeo
12:54 AM
I think that would be the least-confusing
 
(I'm asking because I have a very strong bias for a model that 'increases towards the right'. No idea if that works as well for you.)
 
Xeo
If I want a stride of +1, I'd expect the indices to grow by +1 each step.
 
Ya that's definitively too useful not to keep.
Semantics of FromTo<2, 1, 1> is empty range right?
 
Xeo
@LucDanton But does that also mean that conversely, a stride of -1 should be decreasing indices?
 
Yes.
 
Xeo
12:58 AM
@LucDanton That's the question for me. I somehow want a "From<Larger>::To<Smaller>` to be a reversed slice, but that's hard to incorporate with the rest it seems
 
Whoah whoah wait a bit.
 
Xeo
Wait
 
We can later specify FromTo<i, j> to mean FromTo<i, j, dir>.
However I want an ambiguous notation for some things.
Both to reason about it and it would be a boon for actual use as well :p
 
Xeo
Okay, then yeah, if you explicitly specify increasing indices, that should be either empty or a static_assert that the range end can never be reached.
if j < i && stride > 0
 
Hee hee, I'm documenting this stuff with unit tests and indices<5, 4, 3, 2, 1, 0 > {} = FromTo<5, -1, -1>::Complete<8> {}; already fails.
 
1:02 AM
From C++11:

`template <typename T> using Vec = std::vector<T>; int main() {
Vec<int> a;
}

Why doesn't this work?
 
What's the error? In all likeliness your compiler simply doesn't support that.
 
Xeo
Yeah, that's valid C++11 code if you include <vector>
 
@LucDanton error: expected unqualified-id before 'using'
 
Xeo
@LucDanton What does the rhs yield?
@David Compiler is ?
 
@Xeo Decreasing indices of some sort. I'm tearing down things left and right.
 
1:04 AM
@Xeo gcc-4.5.1
 
Xeo
hrhr
@David -std=c++0x?
 
@Xeo I'm running it on Ideone with C++0x as the language.
 
Xeo
Then it's simply not implemented in that version
I recommend liveworkspace.org, btw
 
Preliminary attempt: if Distance * Stride <= 0, the slice is considered empty or impossible, where Distance is oriented, so To - From really.
 
Xeo
1:06 AM
GCC 4.7.2 + Boost 1.51.0
 
@Xeo I figured that was the case. Thanks.
 
Xeo
@LucDanton With or without mapping From and To first?
 
@Xeo No, I want to avoid that at all costs. I want a primary template FromTo<i, j, s> that does all the work and other specializations that matches defaults and do the actual remapping of those defaults.
> error: integral expression '(((T - F) * S) > 0)' is not constant
 
Xeo
lol
 
Shit, I need laziness.
 
1:31 AM
@Xeo Okay, I'm reasonably sure positive strides are properly dealt with.
 
1:49 AM
^ Nicest recording I know of that Al Di Meola song.
Likewise, for bestest recording of Deep Purple's "Lazy", check out the Machine Head album.
 
Are all templates evaluated at compile time? Is this guaranteed?
 
user142019
Yes.
 
user142019
Templates are instantiated at compile-time.
 
Xeo
@David Types and as such templates are a compile-time mechanism.
@LucDanton What for?
 
I unconditionally evaluated generate_indices</* compute */> where the computation ended negative.
Or when the range should be empty or whatever.
Good thing offset_indices<Base, indices<>> still is indices<>, was a matter of moving the conditional inside of that.
 
2:27 AM
@Xeo Yeah, negative strides also work, even e.g. -3 or so. Turns out offset_indices can essentially do all the work, then I take the abs out of everything and generate indices with just the right length.
In my defense I had to round away from 0.
@Xeo I think that mean there's only the fun stuff ahead! That is to say, defaults and such. You interested?
 
Xeo
2:45 AM
Not now, sorry. Gotta get some sleep. :(
 
Np, no hurry.
 
Xeo
But nice that everything's working so far.
 
Currently writing the 2^3 - 1 specializations that dispatch to the primary template >.>
 
Xeo
lol
Aw damn, LWS is down again. -.-
 
Uuuuuum...
Remember when I wanted to make N bigger?
7 hours ago, by Luc Danton
I think I killed LWS again.
 
Xeo
2:56 AM
lol
 
3:50 AM
coffee. i need more coffee
 
4:41 AM
Damn, it's too late for pizza.
 
5:09 AM
Coffee and pizza. Programming in the dawn can't be more fun
 
5:44 AM
hi
gooooood morning
please tell me any method to convert a program into algorithms and flowchrts :/
 
Woa woa woa.
First things first, you ought to do like any newcomer and read the newbie hints.
 
Draw a box around you source code and you'll get a flowchart
2
 
Second, you should ask that on Stack Overflow proper. This is a C++ chatroom, and don't even know if your question is about C++. In fact, I don't even know what your question is about.
Sooo, yeah. Anyway, I'm going to sleep. Good luck!
 
6:31 AM
@Xeo Okay, I think I've got Python semantics. Which means some cases return empty ranges which we could still decide to have different semantics -- in particular we were on the fence whenever the direction of the range is opposite to the sign of the stride, I think.
 
 
1 hour later…
7:45 AM
@Xeo I implemented Python's defaults as well. It was horrible.
 
@LucDanton may I ask how old you are?
 
I'm one of the twenty-somethings of the Lounge.
 
@LucDanton ok, so you are still studying?
 
Ya.
 
cool, already know where you wanna go afterwards?
 
7:56 AM
Nope.
 
club of the secret TMP junkies?
 
I'm not a junkie and it's not a secret!
 
^^, everybody knows you crashed LWS, twice.
 
Write a function in C for
string concatenation. Without the use of
inbuilt string function.
^is this posible
???
 
sure
 
8:04 AM
@DextOr Of course
 
HOW @VinayakGarg
what will be the logic
a = "TEXT1" and b = "TEXT2"
c = a + c;
 
create a new string which can carry both strings, then copy them both into the new string
 
Right ?
Hay @bamboon is that correct ?
 
First you need a character array which is big enough to hold both the strings. Then copy first string, followed by second into it.
 
ok
ok I will try
 
8:06 AM
Err.. move the chars from the first string in up to, but not including, the null, move the chars from the second string in including the null.
 
8:24 AM
@DextOr Yes, it's possible, but you cannot use the + symbol for that. You will need to write an ordinary function, like my_strcat or something.
 
:/ @FredOverflow the only condition is we can't use inbult c function
i have writen this program plz hav a look
#include<stdio.h>

main()
{

char stra[30], strb[30], strc[60];
printf("\nENTER TEXT A");
scanf("%s",&stra);
printf("\nENTER TEXT B");
scanf("%s",&strb);

strc = stra+strb;
printf("\n ==============");
printf("\n%s",&strc);
getch();

}
 
stra + strb doesn't make any sense, you cannot add two arrays.
 
ya its showing error on that line :(
can I use pointers for that
???
 
Also, according to the assignment you posted, you should write a function for string concatenation. You didn't do that.
First step is to think about the signature of that function.
Ah, you already know pointers.
Hint: there will be pointers in the function signature.
 
I will create function first it shud work
 
8:27 AM
room topic changed to Lounge<C++>: There will be pointers. (The pointers are a lie) [c++] [c++11] [c++-faq]
 
strc = *stra+*strb;
will this work ?
 
No, *stra + *strb would add two characters.
 
no
 
No. + will never work. Now get working on the function.
 
:'( I am a newbie
 
8:29 AM
The C equivalent that actually works (and that you are forbidden to use) is:
strcpy(strc, stra);
strcat(strc, strb);
Now you have to write your own versions of strcpy and strcat. Call them my_strcpy and my_strcat. Alternatively, you could write a function my_non_std_concat which does both of those things at once.
 
ya those functions I know but ......
 
Your main function isn't returning anything.
 
That's fine in C99. Oh wait, it doesn't even have a return type, lol. His book must be really old. K&R 1st edition, probably.
 
@thecoshman The big problems with that are: #1 some reviewers are reviewing for badges and thus approve all kinds of crap; #2 some reviewers have no idea about what they're reading but still feel entitled to an opinion about it; #3 some reviewers are just droning on.
 
@DextOr If you are in a C course, chances are 90% of your assignments is going to be "rewrite the C standard library from scratch".
 
8:32 AM
(FWIW Your edit was good; the typo was completely irrelevant (and already fixed) when compared with the kinds of crap that was there)
 
I fixed that typo actually. I also added en.cppreference.com
 
@FredOverflow Which I think is a very good exercise.
@DextOr: I told you to copy the string, not add. So no + operator. You need to use a for loop, to go over each character of input strings, and assign them to output string.
 
lol
 
8:36 AM
can you tell me what original++; is doing
 
Increments original by one.
 
Ell
incrementing original by one
 
You don't know that operator?
 
while(*original++);
while(*original++ = *add++);
// so much cooler, right?
 
I know but is he incrementing string or Address of that variable ???
 
8:38 AM
Incrementing the pointer.
 
@R.MartinhoFernandes lol @ terminating the while before actually looping over anything
 
Ell
I'm glad I learnt vectors n shiz before anything
 
@Rapptz What?
 
while();
 
It's all in the condition.
But it is wrong. :(
 
8:39 AM
I've never seen it work like that.
 
I got an answer on my bounty question that seems to be on the right path but I don't completely understand. :S
 
I'm not convinced.
 
Ell
what field of compsci/programming is everyone most fascinated by?
I find artificial intelligence and genetic algorithms just amazing
 
@Ell I find AI lectures extremely boring.
I like Computer Graphics and Algorithms.
 
Multithreading, and watching DB admins tomorrow morning when their DB's have stopped because time has gone backwards.
 
Ell
8:48 AM
really? I think artificial neural networks combined with genetic algorithms are awesome, simulating creatures and the like
 
@R.MartinhoFernandes Are you just asking what Multibyte characters are?
I'm unclear what the question is actually asking.
 
Nope.
@Rapptz I think it can't become any clearer: does the assertion hold?
 
@Ell I don't know theory must be like that. Haven't done anything interesting in it.
 
Oh that's your question.
If you're wondering, I meant this part "What is this "multibyte character representation"?"
 
Can you recommend a good book on AI?
 
Ell
8:50 AM
I cannot unfortunately
 
@Rapptz That is asking what multibyte characters are produced by c32rtomb.
 
@Ell See there is none.
 
Ell
well I haven't really looked tbh. I'm still at 6th form and programming is a hobby
 
Ah I gotcha.
 
@DextOr If I'm not mistaken, all postfix operators have higher precedence than all prefix operators. So for example, *p++ means *(p++).
 
8:53 AM
@Ell I hope you are not fascinated by something that you haven't done.
 
@Ell Parsing and interpretation and stuff.
 
@FredOverflow Language processing? You're cool.
 
@VinayakGarg I am often fascinated by stuff I don't really understand yet. Like monads :)
 
@R.MartinhoFernandes Well, I am currently building a tool for software education where I do exactly that :) It's based on Karel the Robot.
@R.MartinhoFernandes I will never fully comprehend monads, so yeah :)
 
8:55 AM
@FredOverflow Yeah, you've mentioned that before. Robots are cool.
 
@FredOverflow I said "I hope". Because, if he hasn't done something he may realize later how boring it is.
BTW I don't understand Computer Graphics completely. Atleast not as much as I would like to.
 
Here is Karel, staring at the beauty of binary numbers :)
 
@FredOverflow Nice!
 
Lately I've been fascinated by Unicode. I feel like I'm starting to enjoy it, which kind of annoys me. I don't want to like this.
 
@VinayakGarg I was totally blown away when my first line-drawing algorithm worked. I think I implemented with inline assembly in Borland Pascal or something :)
 
8:58 AM
can i use scanf("%s",original); in place of gets(original);
 
@R.MartinhoFernandes I hate Unicode. I see the necessity for it, but I hate it.
 
@DextOr I see no difference.
 
sorry edited :P
 
Yes. By the way, gets was banned in C99 or the latest C standard because it is an invitation for buffer overflows.
 
@FredOverflow Cool cool!! Same here. My Z-buffer algorithm still makes me smile :)
 
8:59 AM
Oh, I remember the Z buffer :)
 
Ell
I don't understand Unicode at all, I just want to be able to use a string class that handles it all for me. will that be possible? for me to just completely have to deal with nothing to do with it?
 
You want to give another string class to the world? What a great idea.
 
but when i use scanf("%s",original); program runs in a strange fashion :/
 
@Ell What do you mean "handle it all"?
 
Ell
9:00 AM
aww man that sucks.
 
You can't stop thinking.
I'm going to make that my motto.
 
@DextOr Maybe the string you enter is too long? How about scanf("%29s", original); instead?
 
It's now the "about" in my chat profile.
 
Ell
well I don't know to be honest, because I don't know what there is to handle. I mean I just want to be able to use a string class without needing to know anything about Unicode
 
@DextOr Or are you entering multiple words with spaces in between? Because scanf will stop at the first whitespace.
 
9:01 AM
Then the question is: what's a 'string' to you? What operations do you want to be able to use?
 
@Ell You can do that when what you're doing does not have anything to do with it.
 
Please tell us more, we cannot guess what "runs in a strange fashion" means.
 
Ell
right okay
 
@FredOverflow i think you are right i was using text with space ...that mey be the reason
 
@R.MartinhoFernandes Wait, wasn't the previous motto a quote by me? You are going to replace that? But we had such a good run! :(
 
9:02 AM
@FredOverflow Yes, it was :) I think this one is much more powerful and generic.
 
@DextOr If you want to be able to read in spaces as well, use fgets(original, 30, stdin); instead.
 
ok
 
1 min ago, by Luc Danton
Then the question is: what's a 'string' to you? What operations do you want to be able to use?
I think this is a relevant question.
 
@R.MartinhoFernandes I want to rip it off women's bodies.
 
That's completely Unicode-unaware. No worries here.
 
9:04 AM
(And I'm going to count this as surveying for my API)
 
Ell
a string to me is a piece of text
 
Not enough detail.
 
Ell
and i want to be able to compare for equality or order and iterate through it
 
Operations!
 
Ell
and to save and load from a file
 
9:06 AM
Iterate over what?
 
Ell
also to down/uppercase it
over each "character"(codepoint?)
oh and get substrings
 
I don't think any of those can be done with Unicode text by knowing nothing about Unicode.
 
Okay half of those operations requires you to think. Namely equality and case operations. Operations on the codepoint level (iteration, substrings) can be transparent and painless behind a good enough interface, which may or may not exist to this day.
 
@LucDanton There is one for iteration :P
 
Ell
well I guess I'm gonna have to Learn to do this thinking thing you're all talking about ;)
 
9:08 AM
Serializing I don't know. Still investigating codecvt & friends.
 
Ell
anyway I'm gonna go get a cheese toastie, see you all later :)
 
notes substringing as a feature to implement
 
@R.MartinhoFernandes especially substrings
 
@Ell Not necessarily. What would you ever need case ops? Get rid of that and you're almost there.
 
If you say "for case-insensitive comparison", don't.
 
9:10 AM
please have a look for these conversions from "for" to "do while" and 'while"
 
You want the i++ as the last statement inside the body of the loop. Otherwise, it will never get executed, and you will get an infinite loop.
 
in while or do while
?
 
while(0); sum = 55;
 
Hmm, the Unicode 6.2 PDF is not available for download yet. Fuckers.
 
doesn't there have to be a semicolon after a do while?
 
9:13 AM
@DextOr Of course in both. You want to increment i every time he loop runs, right?
 
@FredOverflow now I have change please refresh the pastie link
 
@DextOr Looks okay to me, apart from the missing semicolon that @bamboon mentioned.
 
ohh yeah thanks @FredOverflow and @bamboon :D
 
Hmm, nevermind, seems the only changes in 6.2 are in the UCD and in the algorithms. Text segmentation changed. My library is still in its infancy and is outdated already. Dammit.
 
Ouch.
 
Ah, good old Binky.
 
The magic wand of dereferencing.
@LucDanton Luckily it's easy to fix. Update the UCD and add this line to the grapheme cluster rules: Regional_Indicator * Regional_Indicator. Yes, I made a DSL for these rules. :P
 
Wait, for text segmentation?
 
Dafuck? Is it a super easy kind of grammar?
 
9:30 AM
So far it can only handle the grapheme cluster rules, though.
@LucDanton Yes. The whole thing is 18 lines.
 
I love Scala, but the IDE experience is terrible. It takes so fucking long to compile :(
 
Coming from a C++ developer? That's a scathing comment!
 
@LucDanton I don't think I'll repeat the experiment for the other segmentation algorithms though. Those use some more regex-y things.
 

« first day (742 days earlier)      last day (4211 days later) »