« first day (702 days earlier)      last day (4246 days later) » 

7:11 AM
Can someone help me with this ? I have a solution in which one of the projects builds to an exe but the other builds to a lib, however in order to get everything to compile I have to indicate the sources from the lib project to the other one , otherwise , it just indicates that the header files are unrecognized ! I thought the point of making a lib is that you dont have to make such hard links
 
sbi
@angryInsomniac If I understand your problem correctly, you need to make your lib a dependency of the exe. Right click onto the exe's project node, and look for a menu item like "Dependencies".
 
@sbi Good morning
 
sbi
@ManofOneWay Hi. I am still at home.
 
@sbi did that! but when I try to include one of the headers in my lib building project into the other one , it just cant find the header
 
sbi
> I’ve got null problems, but a regex ain’t one! …Wait. That was supposed to match “99.” Maybe I put the + in the wrong place; hold on… — Mat Marquis
 
7:16 AM
Cat is on the frontpage - 9gag.com (2nd photo)
 
sbi
@angryInsomniac Ah, the headers. Well, they got to be somewhere where the exe project can pick them up. Look at the exe project's C++ compiler settings' include path property.
 
@sbi so doing that wont make the compiler directly link them into the exe ?
 
sbi
@angryInsomniac What do you mean — "link"? Are we talking of compilation (headers) or linking (obj/lib files)?
 
@sbi as I see it (I may be wrong) if I indicate the include dir's in the Additional include directories then the compiler might as well just use those header files and link everything into the exe file
whats the use of the lib file then ?
 
@sbi So when are you heading for work?
 
sbi
7:19 AM
@angryInsomniac I think you are thoroughly confused about including, linking, and the whole compilation model. See this question, please.
@ManofOneWay As soon as I can get myself unstuck from this keyboard.
 
@sbi possibly , however , one last query, if I add it in the additional include dir's and then take the debug folder , remove the .lib file from it and then try to run the .exe , it should not run , right ?
 
sbi
@angryInsomniac No, you shouldn't blindly fiddle with this until it seems to work, you should understand what's the problem is.
 
@sbi am trying to be methodical actually, deleted the lib file to check if the exe actually depended on it , turns out, it didnt
 
sbi
In short, and applied to VS: You need to put the headers somewhere where the compiler can pick them up. That is, somewhere that's in the exe project's include path list. You need to make the exe depend on the lib file in order for the linker to find the obj files necessary to link the exe.
@angryInsomniac This all won't help if you do not understand what compilation/linking does, and when and why headers or obj/lib files are needed.
 
@sbi lemme re-read, but i think that i am in the right ( I may not be tho :D )
 
7:25 AM
Tony actually asked that? o.o
Whoa
 
sbi
@Rapptz IIRC he did so because we thought such an FAQ would be very helpful.
 
I don't get how it's hard to tell what's being asked??? It doesn't get as straightforward as this? Or can some people not handle straightforward questions? — Tony The Lion Jun 7 '11 at 15:55
So he's being facetious?
 
sbi
@Rapptz I suppose there was a lengthy comment discussion about the question getting closed.
 
@sbi I just realized the massive stupidity ! I was expecting dll like behaviour from a static lib , ofcourse the static lib is compiled into the exe at the compilation time
(I should prolly sleep :D )
 
sbi
@angryInsomniac Actually, a lib is just a bag of obj files, from which the linker extracts the ones it needs.
 
7:30 AM
@sbi yup, so all the dependencies would be resolved at compile time , thereby the lib file would not really be needed for the program to run
unlike a dll where the dll should be ready at hand in order for stuff to run
 
sbi
@angryInsomniac No, dammit! I was talking about linking, not compilation!
Go to sleep, and then reread the answers to Tony's question. And then try again.
 
@sbi arrgh, sorry noob mistake , for me the terms are almost interchangeable ! (While I realize that they are not)
yup, so all the dependencies would be resolved during linking , thereby the lib file would not really be needed for the program to run
 
@angryInsomniac Don't mess with the angry ape-man in the corner.
 
there , corrected :D
 
sbi
@angryInsomniac Yep.
@Neil You just shut up and listen while the grown-ups talk to each other.
Anyway, I gotta grab a shower now, pack my lunch, and leave for work. See you later!
 
7:35 AM
huh? we're not in gallery mode
 
Yeah, weird.
 
morning all
 
@sbi That was just mean
 
@thecoshman How did you manage to request access? We aren't in gallery mode.
 
@Mysticial no we're not in Gallery Mode AFAICS
 
7:38 AM
@thecoshman I had a weird dream and you were in it.
I think it involved a pub in space, possibly on an asteroid, but I don't remember much honestly
Though I'm pretty sure it rocked.
I think we were playing pool
 
What is Gallery Mode
 
@Rapptz The room becomes read-only to everyone except for those with explicit write-access.
 
Where read-only access is default for any non room owner
and you have to ask for write access
 
For example, the Android room gets enough trolls and drive-by linkers that they are forever in gallery mode.
We only go into gallery mode when there's an extreme troll or something like that.
 
Ah I see.
 
7:42 AM
The chat system doesn't support banning. So the only alternative is to go into gallery mode and let everyone else but the troll in.
 
Essentially then we're trolling the troll.
trollception
 
Only if the troll didn't know about it
And if the troll thought he was somehow still trolling someone
 
Then you'd have to fall in a vat of water to get out of gallery mode
 
7:53 AM
not going for map coz i want this code into dll..which vl be generic — james 8 mins ago
wut?
 
@sehe I said a "Yo mamma" joke. He gave me an ugly glare and threatened to hit me by comparison
 
@Mysticial I'm not too sure... was it in Gallery mode over weekend? It did show up as such when I got in this morning
@Neil with me in your dreams, of course it rocked!
 
@thecoshman I often have very strange dreams.. my wife tells me she dreams about something bad happening or something like that
 
@thecoshman We briefly (< 1 min.) went into gallery mode a week or so ago. That might've messed with something.
 
I dream about pubs in space and what it would like living as an ant and the sky falling to pieces, things like that.. weird stuff
 
7:57 AM
@Neil I wouldn't mind to be hit by a comparison
 
@sehe Your refrigerator is like a hockey rink in a box. *slap*!
 
IIRC, somebody messed with the write-access list and fat-fingered a few privilege changes. So if you were on the write-access list and you weren't when you joined a few min. ago, it could be that you were removed.
You are back on the write-access list now.
 
fat-fingered, what a lovely verb. I think I'll use it sometime today
 
Hmmm what's the difference between std::quick_exit and std::abort ?
 
I'd never heard of quick_exit, but that doesn't sound kosher
 
8:02 AM
no
but abort isn't kosher either
 
@TonyTheLion what about the registered callbacks?
 
they both don't clean up after themselves
@LuchianGrigore what bout them?
 
That's the difference...
@TonyTheLion quick_exit does - "Functions passed to std::at_quick_exit are called in reverse order of their registration."
 
@Mysticial so did you grant me access?
 
@thecoshman I was going to, but someone beat me to it.
 
8:04 AM
Do I have access?
 
@LuchianGrigore but you can only pass an int to that function???
 
@Neil I get boring dreams if anything, usually just me at work doing work stuff
 
@Mysticial as long as I have access :P
 
@TonyTheLion It's a different function to register the callbacks.
 
8:05 AM
nevermind
different
 
@thecoshman Wish I could lucid dream. I had a roommate that could, or at least he did once.
He tried every trick in the book to get another lucid dream
 
@LuchianGrigore No you don't. It makes no difference. The people on the write access list are mainly regulars who happened to be in the room in at least one instance when we into gallery mode.
 
My dreams are interesting.
 
@Neil I did it once, but the trigger for making me know I was dreaming shocked me so much I woke up
 
8:08 AM
@Neil lol
@Neil Mushrooms
 
@sehe Almost every trick in the book, anyway
 
Foo:~Foo()
{
    pthread_mutex_lock ( &mutex );
}
if this isn't asking for trouble
who's going to unlock mutex when Foo is destroyed?
 
Or just... copy the damn header. The boost license allows you to do that (slightly non-essential: is RAII also not allowed? Use it for the lock guards) — sehe 1 min ago
@TonyTheLion precisely ^
 
yes
but locking a mutex in a dtor to prevent the object from being destroyed is silly. It won't even help wait for other threads using the object to finish, cause something is already holding the mutex. The best it can do is cause a deadlock
all threads wait for Thread A to release mutex, but thread A is long done and Foo was accidentally destroyed.
oops. :/
 
@TonyTheLion absolutely. hence "less essential". The essence is, the guy is misguided, about the language, about using (standard) library, about threading and about the goal. 'Nuff said
 
8:19 AM
mutex stays locked for duration of program.
@sehe yes :)
 
@TonyTheLion :)
 
8:35 AM
lol
> What is the fastest way to do it using bitwise operations in C?
aren't bitwise operations just constant time? and don't they map to CPU instructions anyway?
I don't get how any could be faster than any others?
 
@TonyTheLion Most instructions are constant time.
Including the bitwise instructions.
But not all bitwise instructions are always the same speed.
 
indeed
@Mysticial really? Woah
 
@TonyTheLion Yep. Shifts tend to have lower throughputs than all the "direct-bit" instructions like &, |, xor, not, etc...
Believe it or not, shifts are even slower than additions on a lot of current processors.
Even though shifts are cheaper to implement than adders in hardware, addition is such a common operation, that they are optimized to be as fast as possible - faster than shifts in a lot of cases.
 
hmmm
interesting
so that C question wasn't as dumb as it sounded then?
 
@sehe lol, the code posted is sequential.
 
8:43 AM
0
Q: optimizing bitwise operations

zimbra314I have a unsigned integer N = abcd where a,b,c,d represents bits from msb to lsb. I want get following numbers x1 = ab0cd x2 = ab1cd What is the fastest way to do it using bitwise operations in C? What I'm trying right now is as follows unsigned int blockid1 = N>>offset; unsigned int ...

 
@TonyTheLion Pretty much. It's easy to look at it and call it stupid. (and it is in most cases) But if you do lower enough, you'll find subtle differences that may or may not make a difference in the large scale.
 
right
 
On some of the Pentiums, right-shift was slower than left-shift. :)
 
well, that question is not as stupid as 'how can I make & faster?'
 
Wanna take a wild guess at why?
 
8:47 AM
@Mysticial why would any one want to right shift?
 
@Mysticial Because the processor was tilted to the left?
 
@R.MartinhoFernandes That's not a bad guess actually.
 
Wait, what?
 
@Mysticial left handed chip designers wanted to make a statement?
 
It's because the data-flow circuits only go from low-bits to high-bits. That's fine for all the arithmetic operations where carry-propagation only goes up. But for rihgt-shift, you need to transfer data downwards.
 
8:50 AM
lol
 
yeah, it sounds really messed up...
 
that is messed up
 
> You cannot delete an object which is in use. No amount of mutexes will fix that.
 
it's not stupid, if you where under the belief that you hardly ever do right shift compared to left shit, of course you are going to optimise for left shit at the cost of right shift
 
MSalters nailed it.
 
8:54 AM
is there no std::find_all?
@R.MartinhoFernandes huh, interesting point.
 
@R.MartinhoFernandes cannot or should not?
 
On that note, I'm off to bed. 4 am here.
 
@TonyTheLion You can do it with repeated applications of std::find.
 
boost::adaptors::filtere[ed] may be an option.
 
Found it! I nailed the problem! (finally). I had index based by identity, and I tried to find using the id
 
9:03 AM
Hello and hi! :)
 
+1 quote Then why are you asking on StackOverflow? That's essentially the same license.sehe 18 secs ago
 
How are you today, @sehe, my dear friend? :)
 
@Takarakaka Hi and Hello
 
@Takarakaka I'm fine. Personally, at least
 
Nice to hear it! That's the spirit. :) If any trouble exists whatsoever, it can be solved. ;) @sehe
:) @TonyTheLion
 
9:12 AM
@Takarakaka Erm... Technically that isn't exactly true, unless you are willing to redefine 'trouble' to make some problems (like, you know, dying) less irreversible
 
sbi
@Neil Yeah, been known to be mean once in a while. You got hurt? No? Well.
@Mysticial And why would you think we would be??
Oops, he's gone already.
Did I miss anything? Gallery last night?
 
@sbi Not that I'm aware
 
sbi
@sehe So why would he be surprised?
<puzzled/>
 
@sbi Somehow we got a write access request from @thecosh.
 
sbi
@R.MartinhoFernandes Ah, now I see.
Sorry for the confusion (which I expressed and caused).
 
9:24 AM
I had the same thing happen somewhere last week. It was ventured that perhaps
(a) they were old pending access request (from a time when the Lounge _did_ go into gallery)
(b) the user involved changed his name (e.g. into DeadMG - lol) thus triggering a new notfication for the (old) access requrest
^ That is entirely unchecked hypothesis, though /cc @R.MartinhoFernandes
@ScottW You hungry. How's life
 
So, this guy had m1 = new char[strlen(m2)]; in an answer and someone correctly pointed out he was missing a +1 because strlen doesn't count the null terminator. So he changes that to: m1 = new char[strlen(m2)]; // <---- reserve memory for m1, oops! i've forget the +1 to alloc the termination character
 
I'm always puzzled as to how to handle critical errors
 
@TonyTheLion Bail out.
 
sbi
@sehe I don't think @thecoshman changed his name. Also, he wrote he saw the room in gallery mode when he entered, and thus requested access.
 
TRWTF is "is allowed for ideas, not for code". Can you spell "NIH syndrome" — sehe 5 secs ago
 
sbi
9:26 AM
@TonyTheLion Prefer to cleanly terminate over dirtily muddling on.
 
seems sensible
 
@sbi Really? That's estraaaaaange. Must be some kind of racy control flow bug in the javascript, then
 
sbi
2 hours ago, by thecoshman
@Mysticial I'm not too sure... was it in Gallery mode over weekend? It did show up as such when I got in this morning
 
@sbi Even terminating in a fiery explosion is preferable to pressing on.
 
@sbi indeed, though I am not sure I actively request access, I was only just up, so perhaps I did
 
9:28 AM
@TonyTheLion I have my work cut out here. Over the next week, I'm to implement a service that transactionally reads and processes queue items received over proprietary protocol. And yes, this includes database transactions. Let's hope the custom transport is any good w.r.t. transaction acknowledgements
@R.MartinhoFernandes And more fun as well
 
wait... no, it was when I got to work... so perhaps I was just turning off my mind for the day
 
Ok, let's just chalk it up to @thecosh on drugs.
 
@R.MartinhoFernandes ¬_¬ hardly
 
@thecoshman Erm. Surely, those two events occur at the same, undividable instant?
 
@sehe well, first I slack off for a bit, then I settle down to not work
 
9:31 AM
@sehe lolwut.
Allowed for ideas... haha, nice joke.
 
@sehe oh yes, that sounds like quite a task
 
btw, you made it to 9gag, @Cat : 9gag.com/gag/5377603
 
9:57 AM
damn, 9gag is just fucking annoying. It automatically redirects me to F’book every time
 
sbi
@KonradRudolph Wrong browser.
 

« first day (702 days earlier)      last day (4246 days later) »