« first day (545 days earlier)      last day (4389 days later) » 

3:00 PM
:p
 
@GuyGreer you're hoping to solve the problem that you didn't post, all without showing even the code for the problem you did describe... Hmmm — sehe 16 secs ago
 
My first attempt at a backflip; missed the grab and forgot to flip fast enough. We didn't have foam pits bac http://instagr.am/p/JWS3kcrHjE/
 
Seems legit
 
@sehe It's a verified account.
 
@RMartinhoFernandes I don't see how that is relevant. Oh I see, Tony Hawk is 'someone'
 
3:07 PM
It adds legitimacy?
Weren't you being sarcastic?
 
Well. It does strike me as a bit odd. I can believe it happened, and the picture is legit, but the description seems a bit over the top
Wait, is it about stunt motor crossing?
Aha. I see a wheel now.
'Missed the grab'. Of course :)
 
@sehe Seriously, just look at the avatar. He's a skateboarder.
 
@RMartinhoFernandes Oh. Like that. I tend to fully disregard avatars :(
Quite effectively. I'm beginning to find out there are precious few people who are as non-visually oriented as I am.
 
sbi
@sehe Yeah, we can tell.
 
If it's of any consolation to you, I do feel stupid now :)
 
3:12 PM
lol
 
sbi
@sehe Oh, I wasn't referring to the tweet the robot quoted. I was referring to your mandala.
 
@sbi E.g. I still haven't bothered to figure out what's in @RMartinhoFernandes' avatar. I mean, it is something, and it looks a bit blurry. Lost interest already :)
I do appreciate the ape avatar, though. I can make sense of that. Like the MooingDuck, too
It took me a while (like, some months) to actively notice that the @DeadMG's avatar actually is a dog.
 
sbi
@sehe I don't care much about that either (although it's hard to avoid knowing about it, because he's posted bigger pix of it and explanations before). What I like most about his avatar is that I can easily recognize it. That's much harder with yours.
Although I am now sufficiently advanced with reading mandalas that I can tell, from a quick glance at the rows of avatars, that @sehe, @GMan, and @Luc are here. However, I consider that a serious achievement, whereas it's trivial to see Konrad, the robot, the puppy,the cosh, ruben, etc.
 
True enough. I do recognize the avatars. I just don't see what they depict, most of the time.
 
the robot's avatar is actually a robot
 
3:17 PM
oh, is mandala what they call the random user pics
 
@sbi !
 
I just look at the announcements to the left of messages :)
@thecoshman Nope. But it fits the description
 
sbi
@GManNickG ?
 
<googles mandal> oooh I see
 
sbi
@thecoshman I do so. If anyone else here does so, I suppose they copied that from me.
 
3:18 PM
@sbi .
 
is a town and municipality in Vest-Agder county, Norway. The administrative center of the municipality is the town of Mandal. The town of Mandal was established as a municipality on 1 January 1838 (see formannskapsdistrikt). The rural municipalities of Halse og Harkmark and Holum were merged with Mandal on 1 January 1964. Mandal borders Lindesnes to the west and northwest, Marnardal to the north, Søgne to the east. It is the southernmost town of Norway and the skerry Pysen (south of the town) is the southernmost point of land. Besides Mandal proper, Mandal municipality includes the ...
 
sbi
@thecoshman I doubt you see. Or did google fix your abysmal spelling?
 
hehe
 
@sbi google is magic, it lets me write :D
 
sbi
@GManNickG $+~#²@€'\
 
3:21 PM
@sbi Good thing you can easily spot my messages by their density and bad puns
 
@sehe I spot your posts by the big X to the left of them :P
 
sbi
@sehe I actually recognize your messages due to the brown spot to the left of them. (I am not making this up!)
 
1 hour ago, by R. Martinho Fernandes
Intermission!
@GManNickG Interpunction!
 
I actually have to look at the name of @sehe 's messages to spot them.
 
@sbi It's like that for me too, but with the longer names I spot the names before I do the avatar
Oh sweet. I thought you had to go and read the transcript
Or get me off your ignore list :)
 
sbi
3:23 PM
@DeadMG Dogs aren't all that good at pattern recognition. (Baboons, OTOH, are.)
 
They can smell avatars a mile away, though
 
@sbi dogs can't use regex? TIL
 
@sehe It's Robby the Robot.
 
Tyrannosaurus Regex
2
 
Geez, you guys are the older people, you're the ones supposed to know these things.
 
3:25 PM
@sehe You're not on my ignore list.
 
any ways, home time for me
 
who, me?
 
have a good weekend all!
 
@DeadMG hence, "Sweet"!
 
ah
 
sbi
3:26 PM
@RMartinhoFernandes Wait until you are old enough that your youngers are able to pick a random cultural artifact you never encountered and confront you with it, insisting you would need to know it, since it's "from your time", and, given the two dozen things they know about "your time", they cannot imagine that you wouldn't be able to remember two dozen cultural references...
 
@thecoshman Cheers.
 
@sbi How are you?
 
@sbi Hey, I try to know more than two dozen things...
 
sbi
@ManofOneWay Oh, c'mon, just ask the question you actually want to ask!
 
sbi
3:27 PM
@RMartinhoFernandes OMG. Your reading and comprehension module really is broken, too.
 
@sbi Well.. are you working?!
 
sbi
@ManofOneWay See, I knew it!
No, I am chatting.
But, yes, I am at work.
 
Good, then I know!
 
sbi
@ManofOneWay And what are you doing, besides chatting here?
@TonyTheLion I think you already said that today.
 
3:29 PM
well, now I've said it twice
 
Mutiny
 
makes me feel better
 
Listening to music, hanging out with a friend. Gonna eat some dinner soon and then head to some pub
 
Oh, there's a daily allowance of certain words?
 
I enter the chat with "morning" multiple times a day
 
3:30 PM
You actually pair chat? Extreem Chatting, perhaps?
 
@ManofOneWay is your nickname supposed to have sexual connotations to it? (no offence)
 
@DeadMG To be fair, mawning is more usual
 
Oh, Tony is back.
 
@DeadMG we know that you're strange :P
 
@RMartinhoFernandes Zing!
 
3:31 PM
why not zoidberg?
I want to compile one C++ project and I have to install 50 libraries
that's just insane
 
@TonyTheLion If you want it to baby ;)
 
hahah, best response evar!
 
sbi
@DeadMG Actually I believe this is the first time I have seen you spelling "morning".
 
I know what you're thinking. No, I won't.
 
lol
 
3:33 PM
wut?
 
sbi
@RMartinhoFernandes What are you talking about? And to whom?
And is "to baby" an actual verb?
 
Apr 10 at 9:53, by DeadMG
morning
 
sbi
@DeadMG I hadn't seen that. Smug look.
 
lol
 
sbi
@TonyTheLion Really. Who but you would have thought of that?
@RMartinhoFernandes Oh, now I get it. Sorry for being so dense.
 
3:36 PM
@sbi donno
 
Feb 15 at 20:33, by DeadMG
morning
you even replied to it :P
 
sbi
@DeadMG Ha! And look what I replied:
Feb 15 at 20:34, by sbi
@DeadMG You already said that today, about 10hrs ago.
 
> This user has been temporarily suspended by a moderator and cannot chat for 6 days. that user-prime-number-guy
5
 
3:38 PM
yeah, I know
all I'm saying is that now I have proof that it is, in fact, not at all the first time you've seen me spell it "morning" instead of mawning or mawnin or mornin or something
 
sbi
@RMartinhoFernandes Is that the guy whom I have blocked?
 
@sbi Yep.
 
@sbi Yeah.
 
sbi
@DeadMG Damn. I meant to create a diversion, so you would forget about that.
 
Which guy is that?
 
sbi
3:40 PM
4 hours ago, by sbi
So one of the few users I have blocked has spammed the JS room with C++ template questions. How appropriate.
There were three or four such flagged, I think.
 
In the PHP room too.
Seems like he just went nuts.
 
sbi
I validated them all. I probably wasn't the only one. That's likely how he got suspended.
@RMartinhoFernandes From what I have seen you guys replying to him, he already was a few days ago.
 
@sbi Martinho and I also validated them.
 
-6
Q: Box in a box algorithm c, c++, java

Ben WatsonBox in a box algorithm c, c++, java

Really. Posting search terms as questions is a new low.
3
 
3:43 PM
@RMartinhoFernandes poor green thing, I'll miss it, maybe, for a minute
 
sbi
@Abyx Why?
 
@RMartinhoFernandes He even forgot to add . Oh the effort.
 
Google really, really, really, loves SO. That stupid question is already the first hit: google.com/#q=Box+in+a+box+algorithm+c%2C+c%2B%2B%2C+java
 
@sbi uhm... dunno, but sometimes it manged to make chat alive, when animals didn't wake up yet
 
sbi
@RMartinhoFernandes Interestingly, it's also the second. :)
 
3:48 PM
Oh, that's true. Maybe he edited it to add the languages after Google indexed it once.
 
sbi
@Abyx That's like saying "Yes, it was rape, but at least she did have sex."
 
Hmm.
For some reason, the OP made an edit that moved most of the original question into an edit summary: stackoverflow.com/posts/10143509/revisions
I'm not sure if I can stress how stupid that is.
 
wtf
 
sbi
Maybe he wanted the editor badge? :)
 
@sbi no, it's wrong comparison, I really didn't bothered with stuff he was writing. Chat is for trolls and fun, anyway.
 
sbi
3:50 PM
@RMartinho Do you actually know what you are talking about?
 
@sbi I have no idea what it is you are not talking about.
 
sbi
@Abyx Call me old-fashioned, but for me, "trolls" and "fun" exclude each other.
 
@sbi well, trolling can be fun (for both sides). The other kind of troll is one that should go to a cave in Norway and freeze to death.
 
I'm off. Bye everyone.
 
@RMartinhoFernandes power off?
 
3:53 PM
Same, bye bye.
 
sbi
@rubenvb As we all know, trolls don't freeze to death. They just think faster when it gets cold.
 
lol
 
Oh sweet, class cancelled, nevermind.
 
sbi
@RMartinhoFernandes You're off what?
my_class.cancel(nvm)
 
@GManNickG Lounge<C++> is a better class anyway. :P
 
3:54 PM
@daknok_t Agreed.
 
agreed
 
I agree that you agree.
 
really? I thought you would disagree that I agreed
but, although surprising, I must concur that you agree that I agree
 
Let's just disagree to agree.
 
4:13 PM
Stupid bird is scared of the cat, yet chases it anyway.
 
4:25 PM
@Mysticial @Maxpm Sorry, my solution last night was right but the method had an error. Fixed, same result though: gmannickg.com/?p=40 (Yes, 9 hours later I still care a tiny bit.)
 
in the "hot questions list" how is the ranking number actually calculated?
 
@GManNickG I just got back from my early morning meeting. So good timing. Guess I can look at it now. :)
@bamboon It's messy. Jeff posted the equation somewhere on meta - but it's since been changed. IMO, the algorithm is part of the reason why dumb questions get popular.
It's something like: (votes on question * # of answers) * (some constant) + (combined votes on all the answers) + (some logarithmic formula of the # of views)
and everything divided by some power function of time
 
4:43 PM
@Mysticial ah ok
 
The culprit is the * # of answers part...
questions with a lot of answers tend to be FGITW and/or really dumb
For that matter, if you run down the list of top questions, you'll notice that the vast majority of them have a lot of answers.
And the ones with fewer than say 10 answers are either very googleable or were linked on reddit or something.
 
heyo
 
All those git questions are very googleable. Flash CS4 and Waldo were linked...
 
can someone advise me how to speed up some loops ftw?
i've got mad loops
 
@JohnSmith Code Review is the best place to go if you're looking to optimize some working code.
 
4:55 PM
Hi all!
If I read from file, putting in a string, how many characters it will copy each time?
(and if I would read 'till the first white space?)
 
@GManNickG Why do you need to divide by two in the equation in the first sentence?
 
@Mysticial: With respect to finding the minimum, it's not needed, but that's the actual value of a+b+c.
 
@GManNickG oh right, I see what you did there. If you add up all 3 equations, you duplicate all of a - c...
 
can i return multiple valuies at once in C++
like in python
a,b=f()
in f(), return a,b;
 
@JohnSmith no
 
5:02 PM
:[
 
26
Q: Returning multiple values from a C++ function

Fred LarsonIs there a preferred way to return multiple values from a C++ function? For example, imagine a function that divides two integers and returns both the quotient and the remainder. One way I commonly see is to use reference parameters: void divide(int dividend, int divisor, int& quotient, in...

You have to do it indirectly.
 
You can return a pair or tuple though, which is all other languages really do.
 
ungh i never understood that make pair stuff
 
@GManNickG Doesn't a, b, c all have to be positive?
That would rule out your 0, 9, 16 solution?
 
@Mysticial Right, it's a possible configuration, but isn't valid
Should probably have added that column
 
5:07 PM
or are you relaxing that requirement for the sake of writing it :)
I don't know haskell, I wouldn've done it in Mathematica. lol
 
I don't have Mathematica. :)
I even forgot to write that a,b,c are all positive.
Derp.
 
I've been living off of Mathematica since like 6th grade...
It literally does my homework for me.
 
I'm jelly once more.
 
sbi
@unNaturhal That depends on the method of reading you are using.
 
@sbi: For example?
 
sbi
5:10 PM
@unNaturhal Are we talking IO streams? char buffers? std::string? Reading lines? Words?
 
@sbi: Ok, I explain my problem :P
 
@GManNickG It takes a bit to learn it though. Since it's half functional, half imperative.
 
I have to convert an html file (a table in html) into an xml file
 
@Mysticial Sounds like a good match for me. I do know SciLab (MatLab clone) a bit.
 
how do i return and receive a pair
 
5:13 PM
The table has this form:
<table>
<tr>
<td>
</td>
// 7 times <td>
</tr>
</table>
 
sbi
@unNaturhal Then you need a parser.
 
@sbi Exactly, but I don't think that exist a parser that made what I need
 
Or regex. :P (no actually don't...)
 
@unNaturhal If the table is as well formed as you're showing, it may be practically XML already, just needing the correct header and such (though even in that case, finding and extracting the table may be non-trivial).
 
@Mysticial Regex it's a bit harder :P
 
sbi
5:15 PM
@unNaturhal I'm not sure. Couldn't some XSLT voodoo do this?
 
@unNaturhal of course that exists, it are simply html tables.
 
shit it doesn't like make_pair?
 
@JohnSmith Just like any other type. :) std::pair<int, float> f() { return std::make_pair(1, 3.14f); } std::pair<int, float> x = f();
 
cannot convert std::pair<long long int, long long int>' to long long int' in return
 
@sbi XSLT is to give a style to and xml file...
 
sbi
5:17 PM
@unNaturhal A classical parser would employ a lexer that breaks this thing down into lexical tokens (tag_open, tag_close, any_text_in_between), and work from there. I suppose your problem is the lexer?
 
@JohnSmith Sounds reasonable, those are two different types.
 
receiving via pair <long long,long long> one;
pair <long long,long long> two;
 
@unNaturhal Does it have to be in C++? such things are usually done in some higher-level language (and you've got for example beautiful soup in python to do it for you)
 
@unNaturhal no, XSLT is to transform XML into something else (other XML data, binary data, HTML, text files…).
 
@JerryCoffin: In which way? An header doesn't change a tag :/
 
5:18 PM
@Mysticial: I've updated it a final time, it is laid to rest.
 
sbi
@unNaturhal Did I use the wrong buzzword? The one I was referring to transforms XML into something else. That something else can be XML HTML, text, or whatever.
 
C++ is probably one of the worst (high-level) languages to do parsing with.
 
i am doing return make_pair(n1,n2); and receiving it into one=f(a,b) where one is pair <long long,long long> one;
why would this fail
 
@JohnSmith: Does the return type of f match what you're returning?
 
n1 and n2 are long longs
 
5:18 PM
@unNaturhal No, but all the tags there are legitimate in XML -- all lower case, matched/nested, (well, I'm guessing that the last <td> is matched by a </td> and you just haven't shown it here...
 
Wait wait. My english is not good enough to can reply to all this messages :P
 
@GManNickG That was fast. Looks good now. :)
 
@JohnSmith sscce.org would help here a lot
 
the return type of my function needed to change
changed it to pair <long long,long long>
ok so what is this:
no match for 'operator[]' in 'one[0]'
i am trying to refer to items in my pair via one[0] and one[1]
 
You are trying to use a non-existing overload of operator[].
Use one.first and one.second.
 
5:21 PM
nvm i had to use first and second
 
The problem is this:
I have a table (in HTML), with a number of rows (<tr> tags... about 559 rows). Each row has 7 cells. Now, I need to convert this table, in a XML one, because I need to import all this 559 rows into a mysql database, and it's impossible to do starting from HTML.
Moreover, this is a good programming exercise :P
 
@unNaturhal Using XSLT that's a piece of cake.
Usually.
Then I'd just use something simple like Python or Ruby to apply the XSLT to the HTML and spit out the XML.
 
@daknokt: Mmmh, but how? I thought that XSLT was for XML, not for HTML
I don't know python or ruby... At least PHP
 
@unNaturhal Most decent XML parsers understand HTML, even when it's not strictly correct XML. They offer a setting or an option for that.
libxml can do that, AFAIK.
You can also use PHP, of course.
 
@unNaturhal i'd suggest forgetting PHP and learning any other decent scripting language.
 
5:27 PM
@KillianDS It's my next good thing to do... as soon as I have time
 
True. Forgetting about PHP increases your quality of life significantly. These days I write my web apps in Ruby and sometimes C++, which I like even more than PHP for that purpose. :P
 
as i said before, this can easily be done in python using the beautiful soup library
 
sbi
@daknok_t Nothing is a piece of cake in XSLT. A (any, really) "programming language" requiring you to write its code in XML is an abomination. :)
 
@sbi I've used XSLT very much in the past, so I don't find it too difficult. (:
 
sbi
@unNaturhal If you want to do that in C++, write a lexer that creates token according to what I wrote above. Then write a parser that parses those tokens and stores the table's data in some internal data structure. Then write a backend that dumpy that data structure into XML.
 
5:29 PM
@unNaturhal writing a lexer in C++ (or PHP for that matter) will take longer time
 
Boost.Spirit!
 
@sbi, @KillianDS Ok, so I'm fucked...
 
YACC YUCC!
 
Ok, try in another way
 
@unNaturhal just use an existing HTML parser and a decent scripting language. Doing stuff like this in Python shouldn't be too difficult, even if you've never used that language.
 
sbi
5:31 PM
@KillianDS Actually, that shouldn't take more than a few hours, even for a beginner. Peek at the stream of characters, and when you see a < or a >, you got a tag. The rest is free text. What more do you need?
 
Learning the basics of Python will take a few hours at most.
 
sbi
@daknok_t When I was teaching C++, I would keep my students' results in an Excel sheet. I would export that as CSV, parse the text file with a small program, and dump XML. From that, I created HTML using XSLT, which I then posted on a website, so they could see their results. And XSLT was the worst headaches in that whole chain. It took me forever to dig through that and get it working.
 
@sbi It mainly depends how complex the actual html page he needs to parse is. But yeah, it won't take days, that's true
 
sbi
@daknok_t Yeah, then he knows some Python. But he still doesn't know how to do IO in C++.
 
@daknokt, The problem is that I have no idea on how to use an HTML parser. Python is in my wishlist, and I will learn it, but now I need to convert this table in a, at least, a pair of days :/
 
sbi
5:34 PM
@unNaturhal A couple of days?
 
@sbi "parse the text file with a small program, and dump XML." Why didn't you just dump HTML immediately instead of the XML in between?
 
@unNaturhal if you cannot write your own lexer or learn python basics + the appropriate library for this problem in a couple of days, you're in the wrong industry
 
sbi
@daknok_t Because 1) writing XML is simpler than writing HTML, 2) I thought it would be simpler to adapt the XSLT than the program, and 3) I wanted to learn XSLT. :-/
 
@sbi Yeah, I need a formed xml film within monday
 
XML film? Sounds scary. Most likely a horror film…
 
5:36 PM
you know, it are only 500 lines you said. if it's such a trouble to script it, you can always do it by hand
 
Or using a little shell script, grep and all that shit! :D
 
@KillianDS 559 lines handmaded? Oh, yeah... I prefer to create a lexer and a parser in C++...
 
sbi
@unNaturhal Look into IO streams. If it's a file, you'll need file streams. write some function that reads characters from the stream and shits tokens. Write a function that reads those tokens and fills some std::vector containing the data. Write a function that iterates over that vector and dumps the result into XML.
@unNaturhal If it's really just this one-time thing, a good editor with search and replace will get you a long way.
 
@unNaturhal software engineers tend to overestimate the duration of "manual" labour. If you know what you're doing this shouldn't take more than a few hours, unless the data in the cells itself has to be converted in some weird way
 
@sbi This is very close to my idea, but I have no idea on how to create a token. The HTML tags in this file are really full of shit..
 
5:41 PM
for one time things it's very likely the script solution will take longer than the manual one
 
sbi
@unNaturhal A token is a data type that you create.
 
but whatever you do, good luck with it :), I'm off
 
It's Friday!!!
 
Yeah :D
 
5:43 PM
@sbi I know, but take this code as example:
<tr style="background: none repeat scroll 0% 0% rgb(255, 255, 255);">
<td>1</td>
<td><a href="http://" title="title">Name</a></td>
</tr>
 
Neat example.
 
How it's possible to extract a token (<tr>...</tr>) among all that attributes...
 
Just ignore the attributes.
 
My idea was:
1. Read a string from file 'till the first white space
2. Verify if this string is equal to "<tr" or "<td"
3. Do something...
 
sbi
@unNaturhal In order to do this, your parser might have to understand the whole thing.
 
5:45 PM
Use a while loop that continues till the first >, assuming the attributes don't contain any >'s. :P
 
sbi
@unNaturhal "Read a string from file 'till the first white space" — won't work. Whitespace is optional in HTML.
 
@sbi Ehm... but you can't write:
<trstryle="something">
This is an error
 
Or use an already-existing XML parser that's much faster, much more reliable and has much fewer bugs! :D
@unNaturhal but you can write < tr style="something"> and it is valid.
Or put some newlines in there as well…
 
sbi
@unNaturhal But you can write <td>blah blah</td>. A whitespace is in the middle of one token, and not between it and its both neighboring tokens.
 
@daknokt @sbi Oh, yeah :O
 
@StackedCrooked Why would you want that?
 
sbi
enum token_type { opening_tag, closing_tag, free_text };

typedef std::pair<std::string,std::string> attribute_type;

struct token {
  token_type  type;
  std::string data;
  std::vector<attribute_type> attributes; // if you care
};

token get_next_token(std::istream& is);
 
@daknok_t Tuple is handy for serialization, but it's very inconvenient when you want to simply read of write to one of it's fields.
 
@sbi You saved my life, I never came up with something as simple as token get_next_token(std::istream& is);. You are awesome!
 
sbi
@daknok_t What?
 
5:51 PM
I always tried to do that using a string and an index wrapped in a class with a get_token member function.
class Lexer {
public:
  token get_token() {
    ++index_;
     // get token
    return tok;
  }
private:
  std::string text_;
  size_t index_;
};
 
sbi
@daknok_t I suppose you learned Java or C# or something like that first? A language that has no free functions?
 
@sbi C, Haskell, PHP, Objective-C and Ruby…
 
...D:
 
I knew, but I never realized that an std::istream already stored the "index" information for me.
That said, I'm still pretty new to C++ anyway. :P
 
Couldn't one do decltype(Getter::get()) here?
 
5:57 PM
I just slept 13 hours. I feel weird.
 

« first day (545 days earlier)      last day (4389 days later) »