« first day (776 days earlier)      last day (4173 days later) » 

6:00 AM
I don't really care :P
I just spent 4 hours procrastinating translating shit
 
But its not exactly like his. I just did doSomething() vs w.doSomething()
 
I've also seen VS2010 do constant propagation into a function that is called in only one place - without actually inlining the function.
 
If I'm not using boost, am I allowed to use vectors for everything?
 
What do you mean?
What does using boost have to do with not using vectors?
 
@Moshe No. You should always use Boost. It's great and does all things.
 
6:03 AM
@Borgleader I dunno, I'm new to C++, and I get the feeling that boost is the jQuery of C++
 
lol
 
Vectors for everything??
 
You should use boost but.... that being said, vectors and boost are not mutually exclusive
 
In fact, iirc Bjarne said vector is meant to be the default container, and that you should pick another one only if you have a reason not to use it.
 
6:05 AM
You should use parts of boost. Don't view it as a monolithic library.
 
@Mysticial Cant see it,
 
I thought deque was the default container
 
@Borgleader It was the boobs operator question.
> -1 not enough boost. – R. Martinho Fernandes Jul 20 at 16:40
> -1 not enough jquery – Sam DeHaan Jul 20 at 16:40
 
@Mysticial LOL
HAHA
 
@Pubby Many experts (Scott Meyer, Bjarne Stroustrup) suggests the uses of the vector by default while others (like Herb Sutter as Steve Jessop pointed out) suggest the deque. I would strongly suggest you to chose the container that best suite your need. (stackoverflow.com/a/7361308/583833)
 
6:06 AM
@Mysticial You forgot to mention: this comment got 15 up-votes.
 
I am making an attempt at a basic code analysis tool.
 
@Moshe Check out the votes on the question.
 
Cyclomatic complexity.
Y'know, analyze lines of code, count the decisions...
So I want a vector of Function objects.
 
posted on November 30, 2012 by Anders Schau Knatten

I have now written twice about why you should minimize the use of include in header files. As one reader on Reddit politely put it (“crap article”), it is about time I write a post about how to do that. There is mainly two things you can do: Reduce the number of headers you include. [...]

 
@Moshe So go for it.
 
6:08 AM
 
Is that really the size of your monitor?
 
@Pubby Two monitors on top of each other.
 
Is it OK to pass vectors around as arguments? Return types?
I know it works, but it feels too awesome.
Also, is there a multi-type vector?
 
Meh, yes, maybe.
 
@Moshe Yes -- though to avoid copying, you may want to pass a reference instead.
 
6:11 AM
Iterators are also a possibility.
 
Why would you want a multi-type vector?
 
@Moshe As arguments use reference to vector, as return types yeah go ahead. As for multi-type why?
 
@Moshe "multi-type vector"? You mean a vector that holds objects of different types? If so, no -- though if you really insist, you can create a vector of something like boost::any (but that's rarely a good idea, IMO).
 
iterators > vector const& > vector& > vector
 
In other languages, arrays can be multi-type. Honestly, now that I think about it, I don't have a good use case, except if I had two similar classes, in which case they're likely a subclass of the same superclass.
@LucDanton Never used them.
 
6:12 AM
You mean dynamically typed languages?
 
@Moshe Look into those. They're very useful.
 
@Pubby Well, don't laugh - I know what folks here have to say about it, but - Objective-C. It has the "id" type.
 
std::vector<std::unique_ptr<base>> works for that case
 
I'm trying to get a feel for the angle brackets in C++.
 
Is id a fancy name for void*?
 
6:13 AM
@Moshe I'm not laughing. I will however welcome you to a better world ;)
 
@Pubby I believe so.
@Borgleader Thanks, lol. I like Objective-C.
 
I had to use it for a project at school. Hated it. Didn't like the memory models. Too many pointers.
lol
Still looking? :P
 
@Borgleader Nope, not any more.
 
Heh, you realize you just got some of us to look at that spam link?
 
@Borgleader Heh, I don't even think about that. ARC, and just use pointers except for primitives (and certain specific classes).
 
6:16 AM
You did more harm than good!
 
@Moshe We couldn't use ARC IIRC. We were doing some iPad dev.
 
@Borgleader Ah, I did a job interview where ARC and UIWebView were out of bounds.
 
That wasn't spam though. Just a really bad question.
 
@Pubby All part of my nefarious schemes. I'm really a spammer in disguise.
 
(iTunes 11 did a really good job with this mix.)
Question: Instead of defining private instance variables in my header, is there a way to declare them in my CPP file?
 
user406009
6:18 AM
@Moshe Pimpl idiom.
 
@Lalaland ?
 
Short answer is no.
 
@LucDanton Ok, that's fine, just curious.
 
user406009
@Moshe C++ does not allow you to define private members in the header, but there is a technique called the pimpl idiom (or opaque pointer) that allows this. Here is a relevant Wikipedia article with example C++ code.
 
And I'll be a zombie at school tomorrow T_T
6h of sleep is not enough
oh well
bye
 
6:22 AM
Night @Borgleader!
 
night
 
Anyone want to see my cyclomatic?
(Haven't implemented it completely yet.)
I'm not sure if I'm doing this right, but I designed some classes to do my bidding. (Evil cackle) Here's what I've got: github.com/MosheBerman/cyclomatic
 
@Moshe you pass object into functions by name, is passing const reference better?
 
@billz What do you mean?
 
e.g. Function::Function(std::string _name) to Function::Function(const std::string& _name)
 
6:31 AM
I agree that const reference is better in this case
 
especially with containers e.g. Function::Function(std::string _name, std::vector<Argument> _arguments, std::string _returnType)
 
Also, use initializer lists in your constructors
 
@Pubby As in the colon followed by paramaters?
 
@Moshe Yes
 
@Pubby But they get long really quickly... Why is that preferred?
 
6:32 AM
could eliminate lots of unnecessary copies
 
@Moshe It calls the constructor of your members rather than assignment operator
 
member initializers save one copy
and is faster
 
@billz What do you mean they save a copy?
 
Oooh, great to know. Coming from iOS I'm a performance fanatic.
Not necessarily the best, but a fanatic.
 
Function::Function(std::string const& name)
: name(name)
, numberOfDecisions(0)
, returnType("void") {
}
 
6:34 AM
Does look like it needs a fair amount of work yet. You might find this helpful: http://ideone.com/IoyEcy
and this: http://ideone.com/IllIzZ
 
@Pubby So newlines separation is acceptable there. Never thought about it.
 
@Pubby member initializer will initialize the data members when creating objects. while operator assigner will create temp obj then assign to data member.
 
@JerryCoffin Thanks Jerry!
 
@billz What? There shouldn't be a need for a temporary.
 
@Moshe Those are C rather than C++, but at least cover some of the basic guts of tokenizing C and C++ source code.
 
6:36 AM
@JerryCoffin I'm not planning to tokenize as much as count certain strings in certain contexts.
Context counts more than tokens here, because cyclomatic complexity is per function.
Sure, I could count all the decisions per program, but that's a broad overview, and easily calculable based on the sum of the functions.
 
@Pubby, agree with you. no temp obj
 
@Moshe Essentially the only choice is to tokenize -- otherwise, you don't know the context correctly.
 
@JerryCoffin Why's that?
 
Don't forget Clang can do your parsing for you
 
@Pubby how so?
I've never taken a compiler course, nor parsed files like this before.
 
6:38 AM
@Moshe It has some libraries or something. I dunno.
 
I figured I could go line by line, check if we're in a function, and if so, count decisions.
 
Parsing C++ is a huge pain though
@Moshe How do you know what's a function or not if you don't lex and parse it?
 
@Moshe Just for a couple of obvious examples, you don't want to count an if or for inside a comment or string as contributing to cyclomatic complexity.
 
@JerryCoffin True.
@Pubby I plan to parse, but function declarations follow a formula.
 
6:39 AM
1
A: This pointer and performance penalty

perreal#include <iostream> #include <stdint.h> #include <limits.h> struct Dummy { uint32_t counter; Dummy(): counter(0) {} void do_something() { counter++; } }; uint32_t counter = 0; void do_something() { counter++; } int main(int argc, char **argv) { Dummy dummy; if...

^^ Looks like someone made a benchmark... :)
 
@JerryCoffin tbh, I forgot about that. I suppose a few flags will do for now, no?
 
@Mysticial Oh no, how horrible the this pointer is. =[
 
@Moshe And that formula requires parsing everything else
 
@Moshe A few flags to what? To something based on clang? Yes, probably. Bottom line: to produce results that are meaningful at all, you're going to have to tokenize at the very least. Fortunately, the code I linked earlier makes that pretty trivial.
 
I need 1 upvote til gold badge
 
6:44 AM
@Pubby Unfortunately true -- given the most vexing parse, you need a full parser (with symbol table) to be sure whether something is a function declaration or a definition.
 
@JerryCoffin Ok, I'll need to give this a second look now. Where's that code from, btw?
 
@Moshe My hard drive.
 
@Pubby You have almost 19 hours to get it. Since the script runs once a day and ran about 5 hours ago.
 
@JerryCoffin Nice. Thank you.
@Mysticial lol.
 
@Mysticial You keep track of that? Heh.
 
6:45 AM
@Pubby No, but I've been the site long enough to notice that the tag badge scripts run at 10pm CST everyday.
 
I'm going to get to sleep and work on this when I can. I have 4 more C++ homeworks to do in the next few weeks. And some iOS apps due out for clients. But this was a fun reprieve for tonight.
Thanks for the help guys!
 
Goodbye friend
 
cya
 
@Moshe Later.
 
Haaaaave fun.
 
Xeo
6:48 AM
@R.MartinhoFernandes lol, I was sleeping! Compiling Clang throws my PCs performance to the ground and I want as much RAM available as possible, so I closed FF.
 
Compiling Clang is more important than seeing the robot?
 
@Xeo You need to download more RAM.
 
@Xeo You won't be apart of that system?
 
There is no vector::pop_front? That's funny, I thought there was!
I want my expensive, pointless, operations :(
 
@Mysticial Shame on you, leaving out the link.
 
6:51 AM
even there is one pop_front, will be low performance?
 
@JerryCoffin Damn... too late to edit. :(
 
@billz That what makes it so great!
 
@Mysticial You shame your famiry with this. Forwaver!
 
I still vote you up, so you can get your gold badge :)
 
Well, it's almost midnight -- I think I'll get to bed early for once.
 
6:54 AM
@billz Thanks
 
@JerryCoffin Don't do it, yo. Stay up and do pointless coding tasks, like a real man.
 
Guess I can stop my rep promiscuity now that I got the badge
 
@JerryCoffin Oh, well then. It's all good then.
 
Xeo
@Pubby vector::pop_front is specified as "user-call: copy to std::list, pop_front, copy back"
2
 
7:03 AM
@Xeo how much RAM does it need to compile(on how many threads)?
 
@Xeo I assume you're kidding.
 
Xeo
@StackedCrooked Look at me. Do I look like I'm kidding?
 
Absolutely.
 
It should probably be a shared_ptr of list to be safe
 
Xeo
@bamboon Dunno, I just throw ~2/3rd of my RAM at it, which equals ~1.4gig, and 2 threads since I have 2 cores.
 
7:05 AM
At work I can ssh into a 16-core machine and use make -j17.
 
Xeo
@Mysticial That's just pointlessly stupid.
@StackedCrooked That extra thread doesn't help much, I guess? Since there's only 16 phyisical (or virtual) cores available?
 
Physical.
 
Xeo
Hm. Either I misremember something or my Debian box got faster somehow.
 
@Xeo You need to download more cores.
 
I always heard #CPU + 1.
 
Xeo
7:07 AM
Clang finished compiling in ~1h
 
But that might be folklore.
 
Xeo
The compilation threw an error at me, but it did finish after that.
The idea behind the +1 being that it helps keep the processor(s) doing something while they're waiting on disk I/O for the next source file. — Tyler McHenry Jun 11 '10 at 19:29
Makes sense, in a way.
> llvm/tools/clang/lib/Driver/Driver.cpp:51:47 error: use of undeclared identifier 'DEFAULT_SYSROOT'
WHYYYYY
 
Xeo
7:31 AM
This is bad. And noone answers on #llvm. :(
 
any fedora users here?
 
Xeo
Fuck. I think I broke my libc++ installation. Crap~
 
7:54 AM
> “The results of a multiple regression analysis of 49 metropolitan areas show that the greater the airtime devoted to country music, the greater the white suicide rate.” here
 
Xeo
Craaap. If I atleast knew the revision before the update just now...
 
@JimMischel: Yes, that's correct. After running it, I'm actually a bit uncertain about what the original is supposed to do. I thought he intended to copy "words" to the output with exactly one space between them. Testing it, the code actually just skips spaces completely, so it's equivalent to for (int i=0; i<strlen(src); i++) if (!isspace(src[i]) *dest++ = *src;Jerry Coffin 15 hours ago
^ @JerryCoffin that last bit of code looks a bit off. (src[i] vs. *src?)
 
Xeo
Phew, thank you Clang for showing the revision number with -v.
Now I just need to find out why Clang won't compile...
 
Xeo
8:22 AM
Hm. I just inhaled that pack of cream puffs. Now I want more. :(
 
8:50 AM
good morning crowd :)
 
9:00 AM
Small crowd
 
mawning :)
 
9:17 AM
good morning
(tricky laptop keyboard)
 
lol
I'm so glad it's Friday
 
TAIF!
(Thank Alf it's Friday!)
 
hahah
 
Taif (Arabic الطائف ) is a city in the Mecca Province of Saudi Arabia at an elevation of on the slopes of the Sarawat Mountains (Al-Sarawat Mountains). It has a population of 521,273 (2004 census). Each summer the Saudi Government moves from the heat of Riyadh to Ta'if. The city is the centre of an agricultural area known for its grapes, roses and honey. Ethnography The inhabitants of Ta'if, are largely made up of the Hanbali and Maliki Sunnis Saudi Arabians. There are also significant foreign populations, primarily from Asia, Turkey, and other Arab countries. History Early history In...
^ How to learn new things: just google everything
 
Xeo
9:22 AM
for(word w : sentence) brain.knowledge += google(w).results;
 
heheh
 
throw memory_allocation_error
 
> How to learn new things

http://doc-edit.herokuapp.com/
 
@Cheersandhth.-Alf TLDR
 
'morning
 
9:37 AM
Friday! Troll permit granted.
 
ohhhh
open the doors to trolling :P
 
@Xeo, I am afraid the complexity of your logarithm is exponential
because results are sentences
 
ITT: logarithms are exponentials
 
I'm mistook logarithm with algorithm...
 
fffs, don't edit the funny typos :(
 
Xeo
9:40 AM
@StephaneRolland Hey, I'm not recursing.
 
ouch it won't be a good day
 
@StephaneRolland It's motherfucking friday!
 
:-)
I put it back to original so
 
grrr, server connection times out all the time, how am I supposed to work here? Why doesn’t ServerAliveInterval work?!
 
@Xeo, unless you've never used wikipedia, one alwayse recurse while googling and wikipediing
 
Xeo
9:42 AM
@StephaneRolland Ever been on TVTropes?
 
@Xeo to recurse: to curse again
 
@Xeo I went once but didn't really understood the concept
 
Xeo
@Cheersandhth.-Alf Recursing is natural to developers: "Fuck fuck fuck fuck fuck...."
 
@KonradRudolph Shitty connection? I have the same problem here since they replaced the entire network stack.
 
GrooveShark seems to think I’m an angsty teenager, puts Linkin Park into my rock radio station …
@Cicada Meh, more likely shitty server config
 
Xeo
9:44 AM
@KonradRudolph What's wrong with LP? :P
 
@Cicada shitty is better than non-existent
 
@KonradRudolph Implying you're not an angsty teenager!
 
That's oblivion to the internet world
 
my connection is fine, and the server’s connection should be stellar, given that it’s in Europe’s foremost bioinformatics database hub
 
9:45 AM
@Neil I have a lot of packet loss, timeouts and annoying stuff. For browsing it doesn't matter too much since I can just reload, but gaming has become a horrible pain.
 
@Cicada Implying I’m not a teenager – according to my ID card
 
@KonradRudolph Maybe some bacterias escaped the lab and are eating the optic fiber! Quick! Do something!
@KonradRudolph You could always run a trace route and see where your packets are lost
 
> traceroute: unknown host
 
lol
what's the server domain please?
 
while I’m connected to the beshissene server
… I do not understand that weird config :/
@Cicada ebi-002.ebi.ac.uk
 
9:50 AM
What OS are you on?
I remember having that problem once, where ping would resolve the name but tracert wouldn't.
 
dude, what’s with all the questions? I wasn’t expecting some kind of Spanish inquisition …!
nah, ping also fails to pong
 
Man I'm trying to help you and I don't have a cristal ball but if it's too much for you then fine
Well can't resolve host name here either so it's a problem from the server.
 
an innocent man is a guilty man that doesn't know about it
 
@Cicada Oops :p I thought you were just nosy. Otherwise I would have told you that I’m beyond help … I’ve already escalated with IT, they’re as clueless as me
In other matters, our server is using Platform LSF for batch execution, and I’m of the firm conviction that the software was written by horny teens
 
@KonradRudolph FYI I listed the DNS entries of your ebi.ac.uk and I see no mention of any "ebi-" whatsoever
 
9:56 AM
proof: the commands are all modeled after the Unix queue commands but with different prefixes, e.g. qsub becomes bsub. But they’ve renamed qstat not to bstat but bjobs
@Cicada That’s by design.
@Cicada Erm, I’m stupid. The servers don’t exist to the outside. ಠ)ಠ
 
._.
 
… so no traceroute or ping of course
I’m tunnelling the SSH connection
 
You must set up your dns appropriately then
 
… doesn’t really explain the problem though because I still don’t know where the connection is dropped
 
Well do it step by step. Tunnel in your ebi.ac.uk, nsresolve that ebi-002 and check that it resolves well
 

« first day (776 days earlier)      last day (4173 days later) »