« first day (875 days earlier)      last day (4298 days later) » 

user1357851
13:00
I have been posting, like 2 pics a day for the past half a week. And yet people complain about my excessive pic posting. I think instead of posting pics I should just resort in changing avatars :x
Ell
Ell
Hmm right. I will look at boost then :P
Wait a second, why do I need boost/std::begin and ::end if you pass the beginning and end to the function/object?
no
you don't pass begginning and end
you pass an object compatible with begin and end operations
Ell
Ell
Sorry, I'm newb at iterators, I never saw the point. But may as well learn
like std::vector<>&
Ell
Ell
Hmm. Why do you do that?
13:03
see, std::begin(vec) == vec.begin()
@Ell to be more generic
look
Ell
Ell
Right
for (auto it = begin(obj); it != end(obj); it++)
Ell
Ell
But how is passing iterators not generic?
If you template it
well, you have to pass two variables
Ell
Ell
and doesn't passing iterators allow you to pass a range?
13:04
which is PITA to use
no, it doesn't
how should it?
if my fun accepts fun(iter begin, iter end)
to call, it, I have to do fun(vec.begin(), vec.end())
Ell
Ell
Well, you could pass a beginning and an end, where end doesn't necessarily == std::end(vec)
so you can construct another range object from vec
Ell
Ell
so you could do fun(vec.begin(), vec.begin()+8) or however you do it
no
that's iterators
in ranges you do like fun(range_first_n(vec, 8))
fun(vec | sliced(0, 8)) :v:
13:06
@Telkitty I've seen more than that, and I have not complained, nor binned, IIRC. You keep repeating history, yet you seem to forget that you were misbehaving at the time. The last week has been ok, and you should acknowledge that we have treated you accordingly. Thank you very much.
or like Cat said, that's even better
Ell
Ell
@BartekBanachewicz ahhhh, because the range has begin/end iterators?
I understand it now I think :D
@Ell yes! it is compatible with begin/end operations
Ell
Ell
Yayyy thank you :D
In an all-range environment iterators are not needed at all
Ell
Ell
13:07
Oops. I think my internet is dying again
and that's beautiful, innit
Ell
Ell
'Tis beautiful indeed.
Some internal details maybe
Ell
Ell
Anyway my lunch is ready - I appreciate the help, thank you!
user1357851
@sehe why so sentimental? Is it my avatar? Sweet isn't it
user1357851
13:09
It's like a pink barbie, a round pink barbie, but not on a cake
user1357851
^_^
@Telkitty I have no clue what you mean by sentimental. I don't think it means what you think it means. Also: I don't notice gravatars. I can't make anything out of that blurb, so, meh
/ack
13:11
hmmm
Ell
Ell
And I'm back again with pasta now
according to Clang, this constructor takes nothing and returns nothing
Ell
Ell
default ctor? :3
yeah
but it still needs to take a pointer to the memory to construct the object into.
How was the mumble rumble?
Ell
Ell
13:15
I don't think I was there for it
I didn't hear much rumbling when I was on mumble
:)
@StackedCrooked mumbling and rumbling. Scroll up to see beautiful charts
> (hint: nobody or just Etienne; don't ask him what he's doing there by himself).
lol
Ell
Ell
Now I need to learn to write my own iterators :3
so I can have a token_iterator
no
why.
why on earth.
^And there's a slightly less confusing graph (since you asked <grin/>)
Ell
Ell
13:19
:D
@Ell You've been talkative for about 50 minutes :)
as you can see, there's only a rumble when the puppy's there
Ell
Ell
@BartekBanachewicz how should I do it?
I try to rumble!
@Ell what do you want to do?
@DeadMG Not true. It started around 18:00 - only I didn't think of monitoring activity then
13:21
:( ^
I can't see myself topping the chart
Ell
Ell
@BartekBanachewicz So, I'm writing a lexer class, and I don't know what the interface should look like. As you have told me, I should take a generic container on which I can do boost::begin() and boost::end() on to get the characters. What interface should I have for getting tokens out?
@DeadMG Also, you bailed around 21:45, and the rest rumbled on for ... 2 hours, apparently
but not very much, it would seem
@Ell Now i think it might be a good idea to ask @DeadMG
@BartekBanachewicz You certainly would have been in the first hour
13:22
basically just ell talking to himself
2
@DeadMG Indeed
@DeadMG Looks more like a monologue to me :P
Ell
Ell
@DeadMG yeah xD
@StackedCrooked Ask GrebDioZ since he was apparently nodding and nudging
Ell
Ell
@DeadMG what do you think the interface for a lexer class should be? When getting tokens out? e.g. when I've been playing around I've had Token GetNextToken(), but that's no good
@sehe A lot of last night consisted of me asking zoidberg if he could hear me xD
13:23
getthemtokes()
Ell
Ell
Nobody was replying to me so I assumed my mic wasn't working :L
Wife Acceptance Factor, Wife Approval Factor, or Wife Appeal Factor (WAF), are design elements that increase the likelihood a wife will approve the purchase of expensive consumer electronics products such as high-fidelity loudspeakers, home theater systems and personal computers. Stylish, compact, unobtrusive forms and appealing colors are commonly considered WAF. The term is a tongue-in-cheek play on electronics jargon such as "form factor" and "power factor" and derives from the gender stereotype that men are predisposed to appreciate gadgetry and performance criteria whereas women must b...
So I was googling for Waf.
@Ell that drove him away :)
@DeadMG public member variables begin and end do work with boost::begin/end?
13:26
@BartekBanachewicz Doubt it.
they have to be member functions.
ouch.
so it would be better if it had functions, me think
yes.
but also no.
Anyways, in case someone wants to see the kittens I killed to get this information out of a tcpdump: paste.ubuntu.com/5598843
iterators stink, why do you think I made my lexer into a range.
I used to have an iterator-based lexer, and I just upgraded it to a range, because iterator-based range sucked.
@DeadMG what about for ( : range)?
it won't work withouth proper functions
13:28
@BartekBanachewicz You can't work with that form with your parser anyway.
it's not that much of a change, right?
Ell
Ell
Ima just write Token GetNextToken() and change it after :p
@BartekBanachewicz A parser is a PDA, it requires stacks and states and shit. You can write one as a loop but you really, really don't want to.
I thought we were supposed to write ranges so they will fit everything
I am using boost::begin/end and it works great now, I mean
I can pass a string, a literal, and (with my wrapper) a stream
yes, but a lexer is a specialist piece of kit
13:30
okey.
sometimes I am really happy I am not creating my own language
yeah
I just got fucked by default arguments.
basic_string(
    const value_type* _Ptr,
    const allocator_type& _Al = Allocator ( )
);
aaah
and Clang's codegenerator is ten billion miles away from as flexible as mine.
so I doubt I can use it to generate the default argument
@sehe I don't understand why you 'cc'ed me into that? I have no idea to what you are referring
oh, cock
if I want to permit any default parameter, I have to ... interpret any C++ expression.
well let's start with just = T() params because they're way the most common.
Ell
Ell
@DeadMG a lexer can be written easily as a loop though?
@Ell Yes, it can.
relatively speaking, anyway.
as it is a finite-state machine and therefore only requires constant space (i.e. your loop variables) overhead.
Ell
Ell
13:38
lol: throw std::runtime_error("Fuckshitballs.");
eh
it's a default
if you want something more useful, just set the error function yourself
Ell
Ell
Yeah
@Ell throw Fuckshitballs();
is better
or just call abort().
user1357851
@Ell or sleep(1000);
user1357851
13:43
$
user1357851
way to make people hate your software
^ another clever thought, huh?
Ell
Ell
Hmm, making this uber generic is gonna be a waste of time
@Ell yeah, also looks like a KISS/YAGNI violation.
Ell
Ell
It's like, making the lexer accept a range as an input means I have to cascade all that genericness to everything else
but maybe it will teach me a bit more about templates, so I'm gonna go for it anyway:P
13:49
@Ell uhm, a range of what? CharT* is more than enough
Ell
Ell
@Abyx Sorry, not range, just anything I can do boost::begin() and boost::end() on
We're moving away from iterators and pointers doubly so
Lazy buffered I/O range :getin:
IMO it's faster to compare with '\0' rather than with end(x)
user1357851
I wouldn't be surprised that's what end(x) does anyways after checked for char's validity
I mean while (true) switch(*it++) { case '\0': ... vs while (it != end(x)) ...
13:56
fuck const T&.
Ell
Ell
Meh I'll just make it ascii only :P
@Abyx It's really not.
user1357851
I wish my iphone app can re-write itself for Android
user1357851
makes my life more complete perfect
also, \0 only works on null-terminated strings, not iterators.
13:58
@DeadMG yeah, but I don't see any case when I'd use not null-terminated input.
@Abyx Memory-mapped I/O?
a string you received through I/O?
a string you generated?
@DeadMG allocate one more byte.
in fact... pretty much everything?
@Abyx Why? It's a pointless exercise.
null termination sucks, and there's no reason to do it unless you're forced to, and in C++ in virtually every case you're not.
yeah, you always can allocate one more byte for '\0'.
well, if we'd have immutable strings and slices, it would be a case, but we don't have'em in C++.
no, but we do have iterators and those don't require null termination in the slightest
and std::string has this really nice fashion of taking care of any NULL termination forced on you quietly behind the scenes.
14:05
This is pretty good. Assembly tutorial using Visual C++.
yep. we have iterators, but they're nearly unusable.
well
they're not exactly ranges, but they are still a million miles ahead of NULL terminators
nope. also comparing to end() is slow costs some cycles, when adding case '\0' is free.
user1357851
nothing is free
user1357851
when there is a comparison there is a speed cost
14:10
@Telkitty if there is a jump-table, it's free.
not all Americans are idiots
the cost of a single comparison, especially when the branch predictor will get maximal efficiency out of it, let alone, say, loop unrolling
is negligible at most.
not to mention that your loop has to run one time more to even get to \0.
user1357851
Correct me if I am wrong, even if you have a jump table which I am not sure why you do when you don't have function pointers, you still have to compare the char* at some point in your machine code?
@Telkitty nope. there is jmp table[currentChar] instead of comparison.
but yep, I agree that difference in performance is negligible
however, using '\0' feels faster ;)
user1357851
@Abyx but that means you have to jump for every other case?
user1357851
14:20
for example I have this string myPet = "Cat mimi";
@Telkitty huh? there is only one jump
user1357851
which really is 'cat mimi\0'
user1357851
no, the only case jump table is cost free is that every char uses the jump_table, otherwise you have to compare every char with '/0'
void* table[] = {&case0, &case1, ... }; jmp table[*str++]
user1357851
and when you reach '/0'?
14:22
ohai
user1357851
meow
Hello, anyone know of a way to force RegQueryValueEx give me the leading 0 of a hex key?
For example if my value is "03 e6" when I read it I only get "3 e6".
@Telkitty case0 is for \0, case1 - for \x01, and ~128 more table entries
@nicotranquil lolwut?
@TonyTheLion afternoon
FUCK
14:28
What's up?
FUCK YOU CLANG, FUCK YOU
Let's say I have a hex key in the registry that is "03 e6". When I use RegQueryValueEx to read that key, I only get "3 e6", without the leading 0.
what's Clang done now?
@TonyTheLion (it's that time of the month)
it decided to pull that "multiple LLVM types for one actual type" bullshit again.
14:28
@thecoshman you have your period?
@DeadMG oh
lol
@nicotranquil I bet you just print them wrong.
user1357851
@Abyx seems so much jumping is quite unsafe for little speed improvement ...but that's just my opinion
user1357851
the same way you should not use goto unless you have too
@Telkitty it's compiler-generated stuff. i.e. compiler generates a jump table for switch
eh
there is no speed improvement
14:31
@abyx You think? I hope it's that easy to fix...
the \0 loop will have to run another time to even encounter the \0.
user1357851
@Abyx for function calls, yes
@Telkitty nope.
@DeadMG well, for 1K-byte string it's OK to run one more time.
user1357851
How about you post a question on SO if there isn't already one, and asking whether a jump table is generated when you read a string from a buffer ended by '/0' using case statement
14:33
@Abyx Sure. And it's also OK to check against end.
@nicotranquil use setw and whatnot.
Somehow I ended up here.
@TonyTheLion ¬_¬
@Telkitty how about you compile some code and see output?
user1357851
sure, pass your example
14:36
@Telkitty take any switch with dense cases
user1357851
Sry no time to write one, I am busy fixing my Android stuff :p
Don
Don
@BartekBanachewicz Tried the luasocket, it worked with telnet. but can't it also communicate with other things such as AS3 applications? (I tried to writeUTF after connecting but had no luck)
@Telkitty here is an example - gyazo.com/77a93999a9477638df5e27155c3c43d0
user1357851
but it is not in a loop
meh. loops have nothing to do with switch
user1357851
14:42
and jump is more for the break statement
user1357851
break = goto the end => jump
nevermind...
0
Q: Linking: making virtual address corresponding to file offset

user35443I'm having small problems with getting my system working, so I decided to ask question if is it possible to make virtual address corresponding to file offset. So if virtual address of my .text section is 0x1000, I want linker to fill "padding" space to position with zeroes. Is it possible?

I don't think this is a good way to solve his problem
honestly, relying on this kind of stuff is really silly, imho
I was thinking he'd be better of memory mapped files, but unsure?
@TonyTheLion I don't get what he want to achieve, but why memory mapped files?
actually that's a good point.
no idea why I thought that
14:54
I'm not even sure WTF he does want.
@sehe No way, new Mahjongg record is now 3:01 :-)
@DeadMG he want to have RVA == file offsets
user784668
relative virtual address
14:59
ah
if you want an offset in a file, open the file and seek to offset
@thecoshman well well, you might accuse me of OCD, but you (a) don't understand much (b) seem to have the memory of a brick.
2 days ago, by thecoshman
@sehe I think you have a problem :O
why make it more difficult than that?
2 days ago, by thecoshman
@sehe OCD

« first day (875 days earlier)      last day (4298 days later) »