« first day (1188 days earlier)      last day (3986 days later) » 

11:00
@thecoshman There's a bunch of bytes coming in, and fromAscii interprets them as ASCII. Except it doesn't. It interprets them as whatever you set on some global state beforehand. Even if you didn't set anything, it doesn't interpret them as ASCII.
@R.MartinhoFernandes yeah... common sense is surprisingly rare
@ScottW I didn't. Also what people on the streets think about articles on the internet is irrelevant
but since you're just going to be sensational rather than logical I'll not bother :)
Some people are truly unbelieveable
@StackedCrooked "\x prints an error if you access the GUI from another thread than the main thread"? Really?
@TonyTheLion haha
gutted
@TonyTheLion smooth
11:11
heh
Finally we'll be able to question about your inner workings :)
@LightnessRacesinOrbit Yes, giving OP answer with exceptions not being handled in any way, not saying a word about it it's really the best way to teach. Give OP good code that he will probably ignore. I give up discussion with your egos. — zoska 3 mins ago
Turns out that navigating to line 25334002 in a 2GB log file is not very fast
Who knew
11:15
I knew
@thecoshman -.-
> Which markets allow weapon sales?
Second post from the top.
@LightnessRacesinOrbit /random vOv
That's why I don't click /random
Jan 11 at 17:07, by R. Martinho Fernandes
We can read it all on the page.
@TonyTheLion it's fine :P
11:19
@CatPlusPlus even with less +25334002? Or sed -ne /25334000,+5/p or similar?
less craps out, sed worked
Woot. At least you picked the right tools.
Still not very fast though
perhaps /random is tailored to the individual
11:20
@R.MartinhoFernandes Damn, at first I thought this was still about Robotics.SE.
The program needs to search '\n' 25334001 times. Unless you use fixed-length for log lines, of course.
@LightnessRacesinOrbit Hmmmm. I suppose it reminds me of Miranda Rights, where it says "Everything you say can and will be used against you". :P
@TonyTheLion That's right :D
@CatPlusPlus It might be related to less "plugins". Popular distros come with quite a bunch of nifties that could make it prone to suboptimal performance
11:20
@LightnessRacesinOrbit lol, mabe :P
It's Ubuntu so I wouldn't be surprised
Yup that's one of the worst.
9
A: Fast textfile reading in c++

seheUpdates: Be sure to check the (surprising) updates below the initial answer Memory mapped files have served me well1: #include <boost/iostreams/device/mapped_file.hpp> // for mmap #include <algorithm> // for std::find #include <iostream> // for std::cout #include <cstring> int main() { ...

^ I actually benchmarked some approaches (unsurprisingly, GNU's wc implementation won)
@LightnessRacesinOrbit I see you've played this game before
when you get home, you can add the 'N'
working from home today :)
BBL
11:24
o_0 I don't think he is joking people
@LightnessRacesinOrbit lies
ew come on man, if you are going to wank, at least stop talking to us!
> HTTP/1.1 500 Internal Server Error
not the response I wanted
11:26
@thecoshman ew gross man
I was only gonna go make a cup of tea
@TonyTheLion quoth the server...
@thecoshman Doesn't work. You should try that before you recommend it, you now.
ITT Puppy is into RedHeads
@DeadMG really? surely there is a NSFW redheads?
If I make an SSL connection, I have to authenticate as a client to the server by giving it my username and password, no?
@TonyTheLion some people like some freaky porn man.
@TonyTheLion not at all
11:31
hmmmm
@LightnessRacesinOrbit Oh, come on. When I posted that, there were three or four very long quotes from the same thread on the screen, and at least one of them was a dupe.
SSL is just about making a trustable connection to the server you are expecting to connect to.
> there doesn't seem to be anything here
@thecoshman Nope.
11:31
@R.MartinhoFernandes I'm messing ;)
I'm ok with people quoting shit here, but not the whole goddamn thing.
@LightnessRacesinOrbit Ah, k.
Thought it was obvious!
You should know by now that I'm basically always messing
Not trolling, but being good-humoured ;)
I always took it that you were trolling by default.
@LightnessRacesinOrbit apparently, you can't do that here
This Lounge is always trolling me.
11:34
welp, found it.
What did you find?
instead of add N, just remove SFW.
@DeadMG commence fapping
I should have figured that obviously a page of Redheads images would be NSFW by default.
Aahahahaha I can't close Visual Studio
"Operation is not valid due to the current state of the object."
11:35
lolwat
let the "oh don't post images" commence
inb4 bin
Ok I gave in before y'all could complain
I was an adorable asshole
tl;dr socialy awkward lion
11:39
s/socialy/socially
@TonyTheLion meg
I was sort of semi-trolling there
11:42
@LightnessRacesinOrbit informative
@TonyTheLion thanks!
oh, took me a while to pick up on what he was complaining about
@ScottW no, just 'amazing' reading skills
I was thinking exactly about this as I was leaving work yesterday. You beat me to it :). I'd suggest declaring self_check() as inline, to avoid linking issues (same symbol Foo::self_check() found in multiple object files). — the swine 47 mins ago
11:46
Hilarious
Apparently I am a magnet for ugly and ill-designed code today
It's gonna be hard choosing a winner from this
Yakk put in a lot of work, but Ralph's answer is great
@jalf goto jalf;
WHY WOULD YOU USE strcmp TO COMPARE QSTRINGS?
auto-vectorization for mad performance yo
@LucDanton does it work with strcmp? you don't know lengths of strings
11:52
lol
they're null terminated.
but you need to detect that null. is there such instruction?
@Abyx "please detect that null"
there you go
strcmp knows how to handle that.
Oh you're thinking of the vectorisation thing.
yep
11:58
@zoska I didn't "not say anything about it". I'm saying I modified the code to do a minimum of error checking. In the process I show how to use if(stream) style, .bad(), .fail() and .eof() correctly and the alternative style of error reporting using c++ exceptions as well. Anyone interested in learning will read more here than in browsing several "quick" and "clear" answers scattered across the site. If the OP doesn't ask himself the questions, that's not because I'm showing the wrong stuff. Also, exceptions are not advanced. IOStream exceptions are just relatively underrated — sehe 42 mins ago
bit late
@sehe about 15 years too late, I fear :(
@R.MartinhoFernandes I find it funny that ninja is so aggressive in multiprocessing that I get races unless I take care when writing the graph.
For me it insists on launching 10 processes.
@LightnessRacesinOrbit I want to watch that movie
It's a quad core HT
12:01
Close enuff.
@TonyTheLion me too
@LightnessRacesinOrbit I saw that a while ago. Interesting.
But it's funny that some people think this also applies to humans.
Hmm, Britney just came on, and I'm enjoying it. What.
not sure if I want to try to work out random terrain... or craft my own
12:21
Fuck. I'm getting a cold.
update your AV man
Tomorrow is definitely not the day to get sick.
What happens tomorrow?
other than you getting sick, that is
Boss going away for month-long vacation and we have a "plan out everything for his absence meeting sorta thing"
feet up and relax?
12:23
He doesn't need to know that.
;)
so why do you need to be there? Are you the only one he can talk to?
Well there's like status reporting to be done and times to estimate and I don't want someone else to do that for my tasks.
you can't do that now?
is that much going to change by tomorrow?
I guess I'll chat with him today just in case I am docked up tomorrow.
12:27
ohai
@thecoshman "Hi team, sorry to fuck you around, but at very late notice I need this three-hour meeting to take place this afternoon because I might be getting a cold and I'm a pussy. Would you mind dropping everything at a moment's notice? Thanks"
@ArneMertz wagwan
Yeah what @Lightness said
@LightnessRacesinOrbit wtf, stop being obtuse. The robot clearly got what I said. Talk to the boss today, so that he does not need to be in tomorrow.
@thecoshman My point is that it may not be a quick chat with the boss, but a big team meeting. Since he said "we" and "meeting"
Stop with the "you disagree therefore you must be setting out to be obtuse because I can't possibly be wrong" logic -.-
Of course, it may just be a quick chat with his boss, in which case there is no problem :)
It is supposed to be a big team meeting.
12:30
@LightnessRacesinOrbit nuttin :P
@R.MartinhoFernandes yes, but if you can not make it to that, and are worried you need your bit said, say it now so people can go into that meeting knowing.
But it's still better than "Hey team, you go ahead and have that meeting. I'll stay in bed drinking lots of tea"
Ubuntu sucks today.
Java sucks as well, today.
12:31
Just having a chat about your bits in advance is not even close to being present and discussing the thing with the entire team
@LightnessRacesinOrbit stop being obtuse so much
You apparently cannot create ArrayList out of iterator.
And neither can I.
@thecoshman chill dude! stop with the personal attack
fuck it
@wilx skip "today" in that sentence
12:32
C++ sucks more, today
but not quite as much as Robot's immune system
@wilx There's probably something in Apache.Commons. Or Guava.
@ArneMertz Yeah.
@R.MartinhoFernandes Beh, you'll live
@R.MartinhoFernandes Ah, found com.google.common.collect.Lists.newArrayList(Iterable<? extends X>)
Also fuck framed JavaDocs jesus who the fuck came up with that shit
12:37
Apache.Commons and Guava are like Java's Boost.
@CatPlusPlus the 90s?
nothing wrong with frames
inb4 "omhergehd think of the blind people"
to be fair, only blind people would opt to use Java
@CatPlusPlus John Frame.
so maybe you have a point, hypothetical inb4er
12:41
fuck the blind people, frames are just horrible whoever you are
@LightnessRacesinOrbit Destroys navigation
I miss frames to a degree. Possibly because life was easier in those days
@CatPlusPlus No, not really.
Coliru has frames.
@StackedCrooked omg u so evil
But Coliru is not really a "web page".
12:42
Click on a link in frames, look at your URL bar
Take a link out of frames woop now you've got missing information
@CatPlusPlus By the same logic, you hate most AJAX sites then.
It's shit
@StackedCrooked That's what they all say.
@LightnessRacesinOrbit If they do the same shit, yes
What a retardedly absurd generalisation
12:43
@LightnessRacesinOrbit Some of them are horrible, yes.
It's a solved problem and there's literally no reason to do this
No, it's always bad
Jesus
It's a desktop application on top of DOM.
You don't need to call me Jesus. We've known each for a while.
12:43
It's like webdev 101
Especially those that GET you nothing but a JS bootstrapper that does the actual loading.
You mean, webdev mantra 101
I already have a browser, thank you. You don't need to browsercept your pages.
If you break Back, your application is bad
Solid argument there
Are you aware that browsers work properly with Back and frames?
Clicking back undoes the previous frame change, whether that frame is the only frame or one among several)
12:45
Yes
I get that you have issues with the location bar
but, as @StackedCrooked said, this is for applications built on top of DOM and served from the web, not for "websites" per se
It still does not update URL bar and does not allow you to easily give someone a link to the shit you're looking at
you don't link to the middle of an application
do you hate desktop applications with this passion?
one problem with frames iirc is that Internet search results might give you a link to a frame instead of the page. (maybe this is no longer the case)
8 mins ago, by Cat Plus Plus
http://commons.apache.org/proper/commons-collections/javadocs/api-release/org/ap‌​ache/commons/collections4/IteratorUtils.html#toList(java.util.Iterator)
12:46
to be clear, I said I miss frames because of the nostalgia
@LightnessRacesinOrbit Linking to docs seems perfectly desirable though.
@R.MartinhoFernandes oh, yeah, for JavaDocs it's fucking stupid
@LightnessRacesinOrbit Depends on the application, usually it makes perfect sense and there's no reason to not allow that
this sort of sweeping generalisation vitriol is baseless though
@CatPlusPlus What utter nonsense. There is almost always at the very least a login context involved
12:47
In Coliru I use frames in order to allow resizing the output window. This is not easy to implement in JS.
Or some sort of user-specific context or state
So? That doesn't mean there shouldn't be a viable navigation
@StackedCrooked Coliru is a perfect example of how frames still have their place
And bookmarking ability
It's like breaking Back on mobile platforms
12:48
It violates conventions for no fucking reason
I think I'll just leave you to your rant and wait until you've simmered down a bit
Just don't ever do anything with web kthx
@CatPlusPlus I'm well aware of that, thank you. Most applications don't use it.
12:50
Yes, that's why they're bad, good job
@CatPlusPlus "bad"
You're that guy. "Which technology is better, XML or JSON?"
inb4 "they both suck"
oops I was going to leave you to it
la de da
I'm not very interested in explaining why these conventions matter, too basic
12:51
Don't web kk
I understand the principles of the semantic web, you condescending shit
I tried to introduce to you the notion that not all websites need to be that, but whatever
<3
That's... not semantic web, but okay w/e
Now, tell me, steak or burgers?
@LightnessRacesinOrbit json sucks 'cuz it has no types. in XML you can use tag names as type names
@Abyx JSON has types
checks profile
Yep, Turbo C++
12:53
They both suck, ok?
@Abyx wat?
@R.MartinhoFernandes called it ;)
haha:
Nothing stopping you from including type information in JSON
I think you need to install MSDOS 6.22 from three floppy disks and then run Turbo C++ with that. — ta.speot.is yesterday
@LightnessRacesinOrbit well my point is that you can't use stream parsing in deserialization (sorta SAX parser)
@Abyx lost me now
Sure you can
{"type": "whatever", "value": "whatever else"}
@Abyx So <intValue>42</intValue> is more typed than {"intValue":42}?
Not that it's necessary
@jalf No, it's less because it closes the wrong tag.
Your argument is invalid. ;)
12:55
@CatPlusPlus you can't 'cuz you can't guarantee that type will be the first field
@Abyx O.o
Then use tuples ugh ["type", {...}]
then you need to use "DOM" a variant type and then deserialize from it
What
No, it works exactly like SAX
@Abyx I think you're trying to use JSON as something that it is not (note that this does not inherently make it "suck")
12:56
Event open array, event string, event ...
@LightnessRacesinOrbit It circumvents shortcomings!
TIL: "XML is typed and JSON is untyped because you can't use stream parsing to deserialize JSON"
@R.MartinhoFernandes :D
Mork is the best format anyway
Is there a JSON schema language already? And a JSON stylesheet language?
12:59
There's schema yes
I just said that if you need to deserialize polymorphic types, you can't just get its type from JSON text stream, create object and deserialize it.
because "JSON has no types"
Sure you can, you don't need to stream to do that (but you also can do that if you use ordered types)

« first day (1188 days earlier)      last day (3986 days later) »