« first day (998 days earlier)      last day (3951 days later) » 

12:03 AM
@R.MartinhoFernandes No, it's just about the api of this thing, really.
Is there really no way to construct a shared_ptr with a ref count of 1?
 
All shared_ptrs come with a ref count of 1.
 
Er, sorry
with a ref count > 1
 
lol, quote
@ThePhD What would that do?
 
@R.MartinhoFernandes When the shared_ptr inside the reader class dies,
the stream doesn't have its deleter called.
 
If the point is not deleting, use a nop deleter.
But that's very silly.
 
12:08 AM
I should have a no-delete somewhere...
 
You are basically working around the problem you created.
@ThePhD [](void*){}
 
Well, I don't quite else know how to solve it.
I need to make it so the reader's deletion of its internal stream is optional.
 
Why does it even take a shared_ptr if it won't be sharing ownership?
 
For the vast majority of cases, it should delete. For certain cases, it shouldn't (because the stream is already owned). I don't know how I could communicate potentially-shared ownership semantics, except with shared_ptr.
For a while, the API had 2 constructors.
One would take a Stream&, which was an indicator that the stream was already owned by somebody else. It would not delete in that case.
The other took Stream* and assumed deletion. In both cases, there was a boolean for "do you want the reader to tie its lifetime to the stream's?"
So it would work like
FileStream stream ( /* blah */ );
MyReader reader( stream /* , default boolean assumes non-deletion */ );

MyReader reader( new FileStream( /* blah */ ) /* , assume deletion */ );
Of course, those semantics seemed weak and error-prone, and seemed to violate the idea of Least-surprise.
So I baked the constructors into one, thinking shared_ptr might be the panacea to the issue.
 
12:18 AM
aw, beat me to it.
 
Get good, son.
 
oh god
talk about pms moderators
 
Jun 28 at 16:22, by thecoshman
If you are new here, please read the newbie hints and keep the acronym list under your pillow. Thank you.
Plus no one is a mod here.
 
I'm trying to help (you won't get Java help here).
If you feel offended by that, I don't know what to say.
 
I'm not offended by it, im just a bit suprised that you moved it over to java 'rightly so' though the only reason why i asked it here is because somebody would a quick reply to something very minor. If you've gone and check out the java chat room no one is in there.
 
12:21 AM
anyone else have an issue with SSD cards not having good connections with the sata cable?
 
That's the thing though, the chat isn't supposed to be a place for quick dumps of questions for a quick reply.
 
That is the whole reason for chat! lol
 
Stack Overflow can respond pretty quick to that stuff.
 
@Chad Nope.
 
12:21 AM
And you'd usually get lots of upvotes too.
 
The questions part of the site is appropriately labelled with the word "Questions".
 
@Chad Don't worry man. I did that in my first 2 secondsin the room
@Chad Then bartek made fun of me twice
 
The chat FAQ says that what you talk about in a chat is the topic set forth by room owners.
> When talking in a room, it's polite to stay roughly on topic for the room, as defined by the room owners. If you find yourself consistently veering into other topics, you should consider taking it to another room.
 
oh put a sock in it
 
@chad hold on a sec is that really java ?
 
12:23 AM
Hey, don't be offended. That's just rude and uncalled for.
 
Firstly, most chat rooms and the title of the chat room changes per day. It goes from one day post quesiton dont ask to post questions
 
I haven't had any problem with my garbage collection but my programs are small in scope
 
Lounge<C++> has had the "no-helpdesk" tag on for as long as I've been here.
 
@Chad You know that, and are still surprised?
 
I'd say the same thing, but it would be pretty meaningless
 
12:25 AM
No my issue is that @R.MartinhoFernandes if you would of spent some time and seen that the other room was empty there was no need to move it.
 
It was either that or the bin.
:S
 
The bottom line is that it doesn't belong in here.
 
I could move to the room dedicated to garbage...
It would be the same to me.
 
Where it goes is not our problem. You have it on copy-paste, so feel free to re-paste it somewhere else.
 
@R.MartinhoFernandes chat has garbage collection?
 
12:26 AM
It's too slow
 
The number of people in the room is irrelevant (FWIW, 4 users != empty).
 
"There are other rooms, with 83 users currently talking in 19 rooms."
we didnt' know
 
So, back to ThePhD's thing.
 
go ask the other 78
 
scrolls up
 
12:32 AM
Back to my doxygen thing.
 
What are you doing?
@ThePhD Well, as I said, pass a shared_ptr with a no-op deleter. However, I would really consider avoiding the optional ownership.
 
That would mean every reader would need to pack all the functionality of the other readers.
 
@R.MartinhoFernandes Documenting my code.
 
So that I wouldn't have to pass around streams
Albeit, optionally I could just make it so no reader owns anything.
 
Hmm, I think I'll have to download the Win7 ISO.
Stupid DreamSpark crap needs its own download manager. Almost makes me want to pirate it.
 
12:51 AM
SecureDownloadManager sucks.
 
visual studio sucks
 
@A.H. Love the compiler, hate the IDE. At least it is not eclipse.
 
i actually don't mind eclipse for java
 
@A.H. Eclipse has a good version of JarJarLinks but it also runs its own crazy version of Java. I use Eclipse for Java deployment
 
@Mikhail I didn't know eclipse has its own version of java
 
12:59 AM
I used Eclipse for Android development and the frequency at which I had to use the "File > Restart" menu was hilarious.
 
@Mikhail Isn't it the other way around?
 
speaking of IDEs
Who here uses VS?
 
@Rapptz The thing I don't like about the VS world is the lack of makefiles. VS was able to vectorize some stuff gcc wasn't. The best performance I got was on icc or craycc... Took a 190ms program and made it 170ms
 
Gross.. you actually like makefiles?
 
1:02 AM
@Rapptz My programs have 10 cpp files and often need to mix compilers (gcc and nvcc). I have no clue what my compile flags are or do in VS
 
I'd say that's your fault if anything
 
@Rapptz Sometimes the defaults are bad. For example CUDA 5.5 chooses to target earliest version CUDA by default. (which is nonsense). I got to junk through a lot of hoops to choose correct build targets, in gcc we just target=native
 
That's if you are compiling on the target...
 
@Pawnguy7 I do
 
Okay.. well I see the EXTRA_STYLESHEET thing on Doxygen is apparently useless.
It doesn't override anything :v
 
1:13 AM
Why not look at SFML source code?
See how Laurent did it.
 
Because CSS isn't supposed to be hard but they make overriding it annoying T_T
I have to basically copy paste the doxygen.css and replace shit I don't want from there.
 
Hello.
 
dota2 released out of beta
 
Um.
I shoot myself in the foot slightly less than people new to it, but no, I don't really know it haha.
I can try to help, though?
Not really an expert on this, but the last two times I got heap corruption - and yes it did still work after - was misusing pointers. UB and stuff.
on SO?
 
Lol.
An array of pointers.
If you're using C++, using: std::array<std::unique_ptr<Class>, MAX_AMOUNT_OF_DATA> -- no delete required
std::vector<std::unique_ptr<Class>>;
 
1:29 AM
@ThePhD shouldn't an array of pointers still work though?
 
Are you asking when to manually delete?
 
If youre doing manual memory management in C++ youre doing something wrong.
 
After trying to read that, I have no idea what you are doing.
 
but there is none for pointers..
 
@Gizmo myuniqueptr.reset(nullptr) would manually use the deleter I think.
 
1:34 AM
@Gizmo I think the easiest would be start off tackling auto_ptr
 
Ow my stomach,..
 
(or unique_ptr in C++11)
 
I wonder if htis is how DeadMG feels. D:
 
Never use auto_ptr.
 
sorry unique_ptr?
 
1:34 AM
yes
 
same concept
 
Anybody want to help me contemplate a generation?
 
@JustinMeiners Different semantics.
 
@Gizmo anyway if you tackle unique_ptr it can solve a lot of memory problems for you automatically.
RAII is a powerful tool
 
Oh that's cryptic.
They're using pseudo-delete by making it private.
It just means you're trying to copy a unique_ptr but it can only be moved.
I'm going to guess it's not supported by MSVC.
 
1:51 AM
It is creepy how many MLP pictures there are.
 
@Rapptz Using a unique_ptr as an associative key simply doesn't make sense. It's nothing MSVC-specific.
 
@DeadMG True? But it has std::hash specialization.
So I guess that's one thing going for it..
 
frankly, I don't even know why that's in the Standard.
there's no use case for it#
 
@Gizmo Is it saying that you tried to modify the block of code defined within a object after you freed it? As in you tried to access a block of memory of a NULL pointer?
 
Wild shot, so unordered_map and friends can all work out of the box with most things in the standard library?
 
1:56 AM
they don't work with unique_ptr<T> as a key type.
which is the only use of std::hash.
 
Are raw pointers valid key types in an unordered_map?
 
@Gizmo No, they're not. You suck.
@ThePhD Yes, they are.
 
@Gizmo hahaha usually when I do it, I didn't think I was either :)
 
@Gizmo Could be. But you must be careful to cast it to ints of the same size and signedness.
 
@DeadMG Then unique_ptr<T> has to be valid as well, mostly.
 
1:58 AM
Good morning BTW.
 
It has different move and copy requirements, but as a key value it's just std::hash< unique_ptr<T>::pointer > h; h( myunique.get() );
 
@ThePhD No, it isn't.
how would you possibly look up a value associated with a unique_ptr?
construct two unique_ptr's?
 
Shrug.
 
@Gizmo Because it's domain is strictly limited to the range of currently-valid instances of that type. It's not just some random integer.
viewing a pointer as an integer is a nice simplification but if you actually try to do things that way you will get fucked a thousand ways from Sunday
@ThePhD In other words, it's impossible to do this. That's why it's pointless.
I proposed N3573 to fix this but it's not in yet.
and I likely won't be in Chicago to present an updated version
anyway I'm going to try and get a micron of sleep
not that it ever has any effect.
also
no helpdesk.
I also downvoted your question for linkdumping.
hope you don't get question-banned because twice in one day for that would be too funny.
 
twice?
when?
 
2:03 AM
the last guy who dumped his question here, I downvoted him and he got questionbanned.
then he came crying back to me to fix it
I laughed.
 
oh.
 
anyway, no-helpdesk.
 
I am an outsider here :D
 
alright "this" is still valid in the DTOR so that would not be the issue...
=NULL for an pointer does not call delete for the pointer...
so I am left with a map which I suspect is issuing a "Delete" to the pointer...
or delete array[index] simply deletes the array too.
 
It shouldn't, but there is both delete and delete[].
 
2:08 AM
yeah if array[index] returns an pointer I just want the object that is pointing to be deleted, not the array, that is why I used delete.. not delete[]. but I could be wrong
 
That should be ok. If memory servers, it is safe to use delete on a null pointer. Just that mixing new with delete[] or new[] with delete ends badly.
 
heh
 
The way I remember it is if you do new Item[] then you use delete [] Item
 
ah so I don't need to check if the pointer is valid
one call less
 
I think so. As I said, if I remember correctly. I believe it was here, actually. I had been checking, and they said it was pointless, because it does it anyway.
 
2:11 AM
Also, if the array persists then set the key to NULL so that it doesn't think there is a pointer there
 
@Chemistpp yeah I do that
 
Oo those legs, I thought they were something else :x
 
are ponies & unicorns interchangeably used in this lounge?
 
2:21 AM
@Telkitty猫咪咪 Rhinos and unicorns are more closely related.
 
unicorns all the way.
 
very true, you know what a unicorn would look like when it gains gain ...
 
2:33 AM
@MarkGarcia Well, now I can finally say someone agrees with me when I say managed languages suck on mobile devices.
If you want a managed language, it should be optional to the device itself; the device should always be programmed in a reasonable language that can offer speed, power, and everything else you need if you want it (C++). Most popular language VMs are written in some flavor of C or C++ anyways, so you can have your C#, Java VM, or whatever else if you just program the thing natively in the goddamn first place. =l
 
@ThePhD One problem with that is the accessibility of your app. Want it in the web? Can't do that with C++.
Unless you're doing some hybrid design which could be hard.
 
As I said, the backends for such things like Chromium & friends are done in C++.
So you make sure phone programmable in C++. Then you can layer on junk later, when you want it.
 
I'm still not finished reading so I'll not draw into conclusions, yet.
 
it is worse if you write corn features in C++ then layer on junk API later
that way you have to debug C++, junk and all the connection issues between C++ and the junk :p
 
You get those issues anyways.
It's just that now you're not allowed to work in native code anymore.
 
2:41 AM
But I agree iPhone, Android & windows phone app all require their own native languages and it is silly
 
Windows Phone IIRC is programmable in (botched) C++.
That... WinRT thing.
 
@ThePhD C# .net
I know because I have written one :p
 
@Telkitty猫咪咪 That's Windows 7 phone. Windows 8 allows C++ again.
 
But I heard it is some managed C++ or something like that
 
@Telkitty猫咪咪 I believe it supports this week's flavor (C++/CX, I believe) but also supports real, native C++ as well.
 
2:50 AM
I don't get the point of managed C++.
 
Managed C++ is for GC opt-in.
 
Meh, smart pointers, RAII, etc
 
wut... and I can't throw an uncopyable object?
oh nevermind, throw can take an rvalue reference.
 
Lul.
Question
Who's responsibility should buffering be?
Should it be the responsiblity of the Reader to provide a decent buffer?
Or should it be the streambuf's responsibility to buffer itself (if it wants to)?
 
3:13 AM
I don't love you guys like I used to
the spark is just gone
I'm sorry but I am leaving you guys for the python room
 
Oh, no.
My heart.
It's breaking.
 
it's okay bby, I'm here <3
 
@ThePhD Depends on what you're doing.
Usually, you can rely on the default buffering provided by the language/OS.
But in some cases... well...
 
Ok, now I have this problem, my site is due to expire in 5 days. I tried to pay for 5 year site registration through the webhosting service, but their API is broken. So I contacted the person in charge directly and asked him to issue me an invoice manually so he did. I have paid the invoice 10 days ago, then contacted him like 3 times, but as of today the website's registration is not renewed.
 
@Mysticial Haha, "some cases" is right.
I was reading a Flac file from the FS once,
and I had a small buffer size. "The OS will save me", I said,
and then it took over 20 minutes to read a 3 minute song. :3c
 
3:17 AM
shared_ptr doesn't like new?
these things just became a lot less cool to me
 
can vector<int> be initialized by the bool representation of a int
 
@Telkitty猫咪咪 Sounds like you've been screwed.
 
thanks, your comment has been awesomely constructive :p
Maybe it will be renewed on expiry
Also I have another site to fall back on
 
I don't know what to tell you.
If they don't renew your site, you've indeed been screwed.
Could just wait and see.
We'll enact on the worst, if the worst happens. :D
 
3:40 AM
private Context context;
public void  setContext(Context context)
{   this.context = context;   }
 
Hm.
Smells of Java.
 
it is ...
but does it look awful
using the same name for global and local variables?
 
Doesn't really matter, you're disambiguating with this.
 
yeah, that's what I thought ...
maybe I should pass the context in the constructor ...
hey doggy
 
@Telkitty猫咪咪 At least assuming this is supposed to be C++, perhaps this -> context = context;? Shadowing the name isn't nearly as bad (IMO) having a setContext.
 
3:58 AM
How would something like std::thread::hardware_concurrency be implemented?
@ScottW oh hello puppy #2
then again, let's call DeadMG puppy #2, hello puppy! ;_;
:c. Fine.
 
@JerryCoffin huh? but setVariable() & getVariable() are almost standard syntax for setters and getters
 
@Telkitty猫咪咪 getters and setters are abominations.
 
getters and setters are useful when the process of getting/setting is not as trivial as accessing the variable directly
I'm starting to use them less and it's making me feel saner ;_;
@ScottW I wish I could do that for every object ;.;
 
@Magtheridon96 Apparently I wasn't clear enough the first time. Getters and setters are horrible abominations. (Feel free to insert "fucking" before"horrible" if necessary to get the point).
 
What happens to an exception that propagates to the top of a thread that was launched either using pthread_create() or CreateThread()?
Right now I'm just catching them and turning them into return values. (or just quitting the program)
 
4:07 AM
@Mysticial CreateThread would imply Windows. If nothing catches it on the C++ side, I believe it propagates to the system as a Vectored Exception, in which case it's handled as SetUnhandledExceptionFilter dictates.
 
Interesting. Never heard of either of those.
No seriously... Like I just don't even...
 
@Mysticial A vectored exception is what's usually called a structured exception (but SEH turned into VEH as of Windows XP, if memory serves).
 
@Mysticial you have depth in certain things but not the breadth :p
 
@JerryCoffin Sounds like it's easier to just to keep at what I'm doing right now.
At the end of a thread, I catch all exceptions. All the ones that I can handle I convert them into return values and elevate them to the caller that spawned the thread. Anything that I can't handle (such as bad_alloc) or any other STL exception, I'll kill the program on the spot.
 
4:11 AM
@Mysticial Might easily be -- and it's pretty easy to keep it portable as well. I've mostly used SetUnhandledExceptionFilter when I was handed a big chunk of existing code that was doing nasty things, and calling it was easier than rewriting enough code to do anything else sane.
 
@JerryCoffin But what would you call a function that gets the endianness of a machine? ;_;
... I'm going to get hit in the face with a crowbar aren't I
 
@ScottW I've used it a couple of different times, and didn't react the same way in all cases. Don't remember many details though -- fortunately, those were quite some time ago.
@Magtheridon96 I'd avoid having such a thing in the first place. I'd prefer something like htonX and ntohX that reacts appropriately based on endianness, without forcing the user to pay attention to it.
 
@JerryCoffin sounds reasonable enough
I was taught programming incorrectly and I'm trying to get myself into better habits :v
 
@Magtheridon96 I should probably warn that my ideas on this subject are relatively controversial. Many people (especially with Java backgrounds) consider setXXX and getXXX the epitome of OOP, and object strongly to my pointing out how horrible they are.
 
@JerryCoffin I did a double take when I saw "consider setXXX" far from my monitor.
 
4:21 AM
In many cases, you're just creating a public variable with ugly access -- in which case it might as well just be public, and use it as such. The object that's raised is "but what if, someday, you want to change it so it's no longer a simple assignment to a simple type?"
 
@JerryCoffin I consider your ideas correct to a certain extent because I was once using so many getters and setters in one tiny project, that nothing made sense anymore and I couldn't maintain it at one point
 
The answer to that is that if you want to change how assignment is done, you change it to a user-defined type, and overload operator= for that type. Likewise, if retrieving the value is more than just returning an existing value, you overload operator T (for some type T) to do the work necessary to return the value correctly.
@Mysticial I just knew that was going to happen, and I did it anyway on purpose.
 
if I overload operator T() in a class, can I access the members of T from an instance of that class without my compiler screaming at me and making me cry? ;_;
 
@JerryCoffin lol
 
@Magtheridon96 I have, unfortunately, seen that far too often. I still have to work to keep from vomiting when I see BigInteger code in Java. It quickly ends up looking like some warped imitation of assembly language.
 
4:27 AM
@JerryCoffin yeah they are redundant coding in many ways. but IDEs have setters and getters auto generated for you in exact that syntax
 
@Magtheridon96 Yes -- overloading operator T lets an object of that class be converted to (and used as) a T. As of C++111, you can mark those explicit to ensure they only happen when explicitly requested.
 
like tab or spaces, whether to turn PC off everyday after work - purely personal preferences
 
@Telkitty猫咪咪 Throw away those IDEs and get something that works. While you're at it, you probably want to quit using that language if it doesn't provide better options.
 
I've seen BigInteger code in Java before and I still wonder why the people who implemented it would do such a thing to a large userbase
@JerryCoffin That's nice, now I can write slightly more maintainable code ;_;
 
@JerryCoffin are you planning to take on Microsoft? :p
 
4:29 AM
@Magtheridon96 Like most of Java, a combination of lousy judgement, and a (admittedly, mostly justified) lack of respect for their users.
@Telkitty猫咪咪 Planning to? A little late for that.
 
@Magtheridon96 Java's BigInteger code was one of the first things I studied to learn how to do bignum arithmetic. It didn't take long for me to actually beat their implementation.
 
In my opinion, xcode & objective C combo is awful, so awful it would make C# .net in VS looks like some shinning piece of gold
 
@Mysticial Is this related to y-cruncher? :D
 
@Telkitty猫咪咪 I doubt anything could make C# look that nice, but yes, Objective-C is objectively awful.
 
@Magtheridon96 This was looooong before y-cruncher.
Like years.
Almost 4 years.
 
4:31 AM
@Mysticial More like a-cruncher. :-)
 
So when you were 13-15 years old? Because I read somewhere that you made y-cruncher in your highschool years :o
 
At the time I just called it "BigNumber".
It was in Java, but had C on the backend to do multiplication.
That ended up being good enough for me to break one record* during my freshman year undergraduate.
(* or so I thought)
 
@JerryCoffin never too late for anything ... the oldest person who climbed Mt Everest is 80 :D
 
After I came up with the new multiplication algorithm, I began a full rewrite of the entire program in C. That would eventually become y-cruncher.
 
Kayo
 
4:34 AM
@Telkitty猫咪咪 Point is, I've been fighting them for years now; it's well beyond the planning stage.
 
I think my interface is good.
 
@Mysticial A friend of mine came up with a nice division algorithm for a BigInteger library
He never documented it though =/.
 
@Magtheridon96 lol
sounds like me
I have two "top-secret" multiplication algorithms in y-cruncher.
About once a month, I get people asking me WTH it is.
 
why is it I feel exhausted at 1pm but wide awake at 1am?
 
@Mysticial I wonder if you could use that for proprietary benefits :o
 
4:37 AM
@Magtheridon96 I'm definitely keeping that option open.
Which is why I took care to make sure I kept enough record to prove that I own all the IP for y-cruncher (especially those two algorithms) before I joined Google.
I don't expect to ever be able to commercialize it. But who knows.
 
Is the algorithm purely mathematical, or does it only make sense in the context of processor architecture? :3
 
@Magtheridon96 Both. It's a marriage between math and computers. :)
 
What a beautiful thing ;_;
 
If a non-programmer mathematician were to look at it, (s)he'll be like WTF is this bullshit?
If a non-mathematician programmer were to look at it, (s)he'll be like WTF is this? Java?
Granted, it would take even an expert in the field quite some time to actually understand how either algorithm works.
 
does it ever piss anyone else off how much non-programmers simplify programming?
 
4:44 AM
I happen to be planning on majoring in Computer Science and Mathematics
 
today someone asked me to make them a website. Full of security features and these ridiculously large database tasks. They thought it could be done in a week
 
anyone here use vim?
 
who doesn't use vim?
 
@Crowz "I have a website idea! It's like Facebook, Twitter and YouTube, but with unique stuff"
 
I hate vim.
 
4:47 AM
lol someone the other day "will you sign an NDA"
no
 
bbl, time to pick up my Uncle from the airport.
He finally made it into SFO.
 
@Mysticial Without crashing! (we hope).
 
vim is cool once you get it set up
 
why doesn't
:g/\*\_.\{-}\*
select
/*STUFF
STUFF
STUFF */

?
help me regex gods
 
I never tried it before. I may try it in the future
 
4:50 AM
wait i meant :g/\/*_.\{-}*\/
hmm
chat is messing it up. this: cl.austin.pe/text/0a37061a1K23
 
@AustinPray that looks like a robot lobster
 
ALL Regex looks like Zoidberg
 
please copy into mspaint.exe and sketch lobster around it
 
@Magtheridon96 a lot of people ask for that... her idea was actually unique and good but ridiculously hard to implement
 
4:56 AM
@Crowz There's this dude in my class who told me he'd pay me to make him a website and an iOS application for his "company" or whatever
He was fucking nuts
And he thought $400 was too much
 
@JerryCoffin :D
& my startup is an insignificant partner of Microsoft
 
I was willing to charge at least $4000 for his crazy ideas
 
irony ...
 
just get bootstrap and make a flashy but generic looking website
 
I just gave up and told him I don't like Objective-C and he found some other dude. As for the website, I think he also found some other web developer to do that for him.
 
4:58 AM
how much does a website usually cost? Probably around $2000 for a decent one?
 
depends on the contents
 
It involved transactions and video streaming and blekh
 
could be as cheap as $500 or as expensive as $50000
 
video streaming is pretty easy with HTML5 isn't it?
 

« first day (998 days earlier)      last day (3951 days later) »