« first day (796 days earlier)      last day (4145 days later) » 

12:00 AM
2012 version?
 
@Ell I'd (1) minimize the exact use case, then (2) present the question.
 
@Crowz all the way since the beginning.
@Crowz what is the problem that you are experiencing?
 
@Ell You can use void* in C#.
declare the parameter as IntPtr, and you can use the fixed construct to fix objects in place so you can operate on them.
it'll nasty your performance if a GC happens, but that's very unlikely to happen whilst in a kernel call.
if not impossible
 
Xeo
@MooingDuck I was wondering who you guys were replying to, since hovering didn't yield any messages... turns out I have that guy plonked.
 
Ell
It's okay I don't care about performance in this case
 
12:05 AM
It's probably easier to just write a C++/CLI wrapper.
 
@MooingDuck I don't know what the deal is with this "start project", it has all manners of bullshit. I just want a blank document
 
Ell
I'll look up fixed, I've not done enough c# to know about that
 
cpx
> Witticism - 5 questions with score of 1 or more.
 
@Crowz oh, that has nothing to do with C, you just don't know how to use visual studio
 
@R.MartinhoFernandes Nah- not in this case.
 
cpx
12:06 AM
Why don't I have this hat already?
 
@MooingDuck Exactly
 
@Ell Basically, it fixes an object in place in memory (can't be moved by the GC) so that you can create a raw pointer to it.
 
@Crowz compiler options are part of a solution/project. If you want to compile, you must have a solution/project. file->new->project->VisualC++->General->EmptyProject.
 
@MooingDuck Got it. How do I add a class? Let's say I am just programming hello world
 
Ell
Ahh right
 
12:07 AM
then you can simply do the whole casting things just as you would in C++
but IIRC, C# can convert managed delegates to native function pointers
 
Then open the Solution Explorer (if it's not one of the sidebars, then view->solutionExplorer), right click the project, and add->newItem->VisualC++->Code->c++File.
 
Ell
Yeah
 
so you can simply pass a member function as the parameter
and make the Dictionary a member
or possibly even a lambda
 
Ell
I must say the interop stuff in c# is pretty darn good
 
so
 
Xeo
12:09 AM
@MooingDuck I hope you have lots of patience stored up.
 
I'm off now
but tomorrow, gotta store up my Java knowledge
 
Ell
Night night, have fun with java :P
 
got phone interview at 10am
a little early for my taste but y'know
 
@DeadMG gl
 
@Crowz to tell the compiler to compile it as "pure C", select the file in the solution explorer, right click->properties->ConfigurationProperties->C/C++->Advanced->CompileAs->CompileAsCCode.
@Crowz wait, C doesn't have "classes"
 
12:10 AM
@MooingDuck and this is why I am confused
 
@Crowz so you don't know VIsual Studio OR the C language?
 
@MooingDuck yeah I suck
 
You might want to invest in a C book
 
@Crowz well, do the stuff I said, then get a C book and read it
 
@MooingDuck How does it run?
 
12:15 AM
@Crowz you type code in the file, then use Debug->Start Debugging. (There's also a green arrow icon, or the F5 button)
 
F7 compiles without running. In case you need that too
 
@Crowz if you open view->otherWindows->ErrorList and view->otherwindows->Output, the ErrorList will have summaries of compiler errors, and Output will have detailed compiler errors. (After you try to compile)
 
"Cannot find or open the PDB file." ? What?
 
@Crowz it... that's an odd message. Try again?
 
Ell
Something to do with debugging IIRC
 
12:20 AM
@Crowz some places on the net say to run the program as admin
@Ell yeah, the pdb file is where it stores details about your code, for intellisense and code completion and go-to-declaration and whatnot.
no wait, that's a different file
@Ell PDB is the debugging symbols, so it knows which parts of the exe are which parts of your code.
 
I... I don't think I am doing anything wrong...
 
waait
put the cursor on the "return" line, press F9, and run it again
That output shows it actually loaded, ran, completed, and closed properly :D (without debugging symbols)
 
Ell
His code has run?
Yeah I was going to say
He just needs to find the console? Add a gets(); before the return?
 
@Ell last line says his code returned a zero.
@Ell I just put a breakpoint on the return. console is probably flashing so fast he doesn't see it
@Ell I dislike gets()
 
Ell
Why is that?
I would never use it for getting input, but just for pausing I think its okay
 
12:25 AM
@Ell well one, it makes no real sense for it to be there program-wise. Two, gets is a terrible function that should never ever be used period. It's so bad that C++ deprecated it, and C removed it altogether because it's so dangerous.
 
Seems to run yes
 
@Crowz there ya go
 
Apparently I just really suck at C
 
Ell
fair enough, 'system("pause");' it is ;)
@crowz most people suck at things they have just started, just keep practising And practising, and learning from other people's code
 
Isn't it SUPPOSED to return 0?
 
@Ell That won't even work on all platforms. If you really want to add a statement, and not a breakpoint, my suggestion would be to use std::cin.get();
 
@Crowz It's just telling you that it can't find debugging symbols for the Windows DLLs and such. You're not doing anything wrong, though you can download symbols for Windows if you want.
 
@Crowz yes, the "output" can show lots of things. At the top of the "output" there's a dropdown to select which it's showing. "Debug" is the debugging-output of your code. Those messages are shown by the OS launching and cleaning up after your code. Those aren't errors.
@Crowz The "Build" output will have anything output by the compiler and linker
 
Where's my 0 to 99?
 
Ell
I know, I was kidding, hence the ;) sorry it was my bad should have been more clear
 
12:31 AM
@Crowz in the console, witch is where "standard" output goes.
@Crowz Did you use F9 to make a breakpoint at the return like I said?
 
@MooingDuck yes, I saw the output. Why wouldn't I see that in my standard views?
 
Ell
The standard output will show your 0..99 but I think what you're looking at is the log
 
@Crowz printf sends characters to the "standard output". By default, that is to the terminal (command line thingy) of the program. That's how virtually all languages work.
@Ell yeah, one can use OutputDebugString to send text to the attached debugger, which is what appears in the "Debug" output, along with whatever messages Windows put there as it launched and cleaned up his program.
 
@MooingDuck I know but like, with eclipse java, it prints it out to a little window. Just redirecting it isn't hard...
 
@Crowz That would be neat, but I'm not certain how to do that with VS.
 
12:39 AM
there's a Windows API function OutputDebugString (IIRC)
 
I don't think there is any way to redirect standard out to the IDE window. OutputDebugString is the only way I know of writing to that window
 
@Crowz where do you type input in eclipse then? In the same window?
 
Yeah
 
i never used the C++11 threading so now i'm going to translate this Python counter program to C++ :-) after a little medication, food and coffee
 
@Crowz neat feature. I don't think VisualStudio can do that :( I wish it could
 
Ell
12:43 AM
@mooingduck change stdout and stdin To an external terminal?
 
@Ell To one of the windows in the IDE itself. By default the standard output goes into its own console window.
 
It's happening again (Humble Indie Bundle 7)
 
Ell
Ahh right
 
even trickier, user's can't type in the "output" pane, it's not a terminal.
 
Ell
I was under the impeession that was possible? Can't you just undock mmthe output window?
Oh yeah its just text printing isnt I t :/
 
12:46 AM
One can make a VS plugin to allow for "output-to-somewhere-within-the-IDE" function
 
Bird :(
 
I think devenv.exe launches executables separately from itself (i.e. there's no parent/child relationship between the processes).
 
@Insilico I was just thinking that
 
@Griwes No std::vectors allowed?
 
12:48 AM
@Insilico It's definitely attached as a debugger, so they can't be completely seperate.
 
@MooingDuck Right, but having a debugger attached does not necessarily mean there's a parent/child relationship, which would make stdout redirection trivial.
 
oh, "Tools->Options...->Debugging->General:"Redirect all Output Window text to Immediate Window"
does it exist
 
After all, WinDbg can attach to running processes after the fact.
 
takes some time to fire up vs
 
@Cheersandhth.-Alf It says "redirect all output window text", not all standard output
 
12:50 AM
"preparing solution", "update available", blah blah blah
 
I'm not sure if it does what you think it does.
 
@Insilico oh
 
@Cheersandhth.-Alf You can try it, but I think it refers to the window called "Output" in the IDE.
 
@Cheersandhth.-Alf also what would that do with stdin?
 
@Insilico No nothing allowed.
We are "learning to use dynamic memory management".
So, guess what - write everything yourself, without any helping stuff!
Anyway, 2am, time to sleep. G'night all.
 
1:00 AM
Okay. What's something that's good to program for a super bad programmer?
 
@Crowz the game where the computer picks a number between 1 and 100 and the user guesses what it is. "higher" or "lower"
 
@MooingDuck thank you good sir
 
That might be a little advanced for you yet :( requires input and output and if and loops.
 
I'm in my third year of computer science in uni hah
Just done all java and a tiny bit of C
 
@Crowz alright, so it's the language and not the concepts. You should be able to do it then, if probably not a "stable" version.
I tried to google it, but it seems to go by "The Number Guessing Game"
@Crowz as a note, picking random numbers in a range in C is not intuitive
I just saw that the animation for someone leaving the room changed to a sleigh
 
1:08 AM
Is there a toInt concept in C?
 
chat.stackoverflow.com/transcript/10?m=6618639#6618639 took me ten days to notice. And that's assuming it was mentioned day1
@Crowz not really, gotta use a library function. You probably want scanf("%d", &user_guess);
which reads from the console input (by default)
 
@MooingDuck That was my first reaction when I saw your gravatar leave the room on a sleigh.
 
@Crowz C has the primitives, and pointers, and that is it. Everything else is a library function, or you have to code it yourself. There are no members functions.
 
Dec 14 at 1:31, by In silico
Did MooingDuck's gravatar just leave the users list on a sled?
Apparently I called it a "sled" even though I knew it was a "sleigh". :-/
 
does boost have a method to swap to filenames?
 
1:20 AM
Well something just went horribly wrong
 
18 mins ago, by Mooing Duck
@Crowz alright, so it's the language and not the concepts. You should be able to do it then, if probably not a "stable" version.
 
@MooingDuck Conceptually, it seems to work, but I don't think I understand scanf
gist: 4342265, 2012-12-20 01:22:30Z
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
  int input=0;
	int random_number = rand() / RAND_MAX;
	random_number = random_number * 100;
	int count=0;
	while(1) {
		printf("guess my number! You have 10 tries!");
		scanf("%d", input);
		if(input > random_number) printf("smaller!");
		if(input < random_number) printf("bigger!");
		if(input == random_number) {
			printf("you win!");
			break;
		}
		count++;
		if(count>9) {
			printf("you lose!");
			break;
		}
	}
	return 0;
}
 
@Crowz can you copy the code to ideone.com
@Crowz well, first problem I see is rand() / RAND_MAX. And that's the same problem Java would have, so you have no excuse there.
 
:(
 
@Crowz actually other than that it looks pretty good
other than the common novice practice of not checking if scanf worked. It returns the number of variables read.
@Crowz wait no, you did get scanf wrong
17 mins ago, by Mooing Duck
@Crowz not really, gotta use a library function. You probably want scanf("%d", &user_guess);
 
1:26 AM
@MooingDuck definitely did
 
note the &
 
Yeah doesn't that get the value at the pointer location?
 
& means "instead of giving the function a copy of the variable, give it a pointer to the variable."
which is what lets it alter input.
 
Ooooh that makes more sense
 
Xeo
Man, you really got some stamina here. Still going at it?
 
1:31 AM
Can you do something along the lines of this?
printf("you have %d attempts left", 10-count);
 
@Crowz sure
@Crowz I'm actually very impressed considering you didn't know that C didn't have classes.
 
They have really scheduled the Miss Universe right before the end of the world.
 
1:46 AM
@MooingDuck More accurately, give it access to the variable -- probably via a pointer, but could be some other way as well.
 
@JerryCoffin are you talking about an optimization or is C more different than I thought?
 
@MooingDuck Oops -- I didn't read back far enough. I thought you were talking about a reference. My apologies. Yes -- in this case, it's clearly a pointer.
@MarkGarcia If the world is going to end, what better to do first? (well, okay -- spending time with Miss Universe in person might be better).
 
2:13 AM
Anyone using windows 8?
 
@Crowz Only when I can't avoid it (I've done some testing on it for work, but that's it).
 
@JerryCoffin I have a bit of a question here... is there a way to change the standard themes? Or are you just stuck with what they give you?
 
:\
 
sometimes it's impressive how much memory browsers take
 
2:27 AM
Chrome doesn't take a whole lot
But AVG seems to think it does
 
@Crowz chrome takes up much space in task manager
 
@MarkGarcia What, like 300mb?
 
@Crowz No. In the task list. Hehe.
 
@Crowz with pandora and this tab, 660mb
half a gig :(
then again, a lot of the processes probably share, so that's probably not a fair measurement
 
@MooingDuck Woooow how is pandora taking up that much memory? I have 20+ YouTube videos loading
 
2:32 AM
chrome itself reports 1,019,280 k of virtual space
 
It's lying! FILTH AND LIES
 
big hogs seems to be "browser" 58m, "Stack Alert Extension" 12m, "AdBlock" extension 31m, "Lounge<C++>" 62m, "Shockwave Flash" 76m, "Pandora" 85m, and "About" 13m.
 
Fucking vaio knows how to make THE most annoying error messages
 
and of course, nobody is surprised that flash takes more memory than the SO chat tab.
 
I like flash :(
 
2:35 AM
@Crowz it's convenient, but terribly programmed.
 
@MooingDuck I trust adobe
 
and terribly designed
@Crowz I trust photoshop
 
@MooingDuck I don't trust its users.
 
I like photoshop :(
Well this is odd. Windows PowerShell?
 
@Crowz what about it?
 
2:38 AM
@MooingDuck I've never seen it before... it appears to be quite linux like
Does it have chrons?
 
@Crowz flash is slow. flash takes lots of memory. flash is a security nightmare. flash crashes all the time. flash doesn't work on many systems.
@Crowz that's the goal
@Crowz I think chron is a program isn't it?
 
Chron is basically activating a program at a certain time
ie, every 7 days, run this program
 
@Crowz I checked, cron is a program
 
I used them tons when I had linux hah they made my system so GLOOORIOUS!
 
@Crowz you may be interested in cygwin
 
2:43 AM
@MooingDuck Used it a bit, it's alright
$echo poop > poop.txt
$cat poop.txt
$man which
Why does that make me laugh so much?
 
3:35 AM
hm, reason i can't get it to work with g++ is that g++ in windows doesn't yet support threads (as of 4.7.1) ugh
 
@R.MartinhoFernandes I don't recall you ever showing me how to make the magic work.
only vaguely related: is it legal to pass parameters to a destructor?
 
@MooingDuck The real question is, do destructors have parameters?
Or could they?
 
@MarkGarcia that's... yeah that's what I asked
 
@MooingDuck Oh, I thought you mean "parameters" to as "arguments" because of the word "pass".
 
Xeo
3:50 AM
@MooingDuck No
A destructor always has the signature ~ClassName()
 
4:06 AM
Bye everyone...
 
4:16 AM
bye bye
or good night
or morning
whatever
 
@Xeo it's frustrating that there's no easy way for a containing object/function to tell member/local objects to use a specific member/local to destruct itself (without giving all such instances of the members/local objects each their own pointer to the member/local resulting in excess memory usage :(
 
just in case anybody wondered about the earlier Python -> C++ thing, here's my Visual C++ equivalent. I don't know how standard-conforming it is. Would be better if could also compile with g++!
 
JNI sticks out in my head, need to pass the JNI environment pointer to the functions that clean up resources. Which means every JNI variable class needs it's own copy of the stupid pointer.
 
flyweight possibly
 
Xeo
@MooingDuck Tell me, how would you pass an actual argument to a destructor?
And when?
 
4:19 AM
but think about this: the JNI memory layout was modeled on COM, which in turn was modeled on early Visual C++ polymorphic class memory layout
 
@Xeo you mean destructor?
 
Xeo
Yes, sorry.
 
regarding when, andrei had some thoughts about that, for use with transactions ("release" member)
 
Xeo
Anyways, you might cheat around with assembly and messing with the call stack directly, having something like destructor_info _x_dtor_info; X x; and accessing the memory area directly before this, but... eh, no, just don't.
 
@Xeo I was thinking there should be a way to mark a class that "enclosing scope (class/function) must have a objected named thingy, which the class will use.
 
4:21 AM
Gods, 900 lines of Java code and I'm still not finished with this shit
 
easily abused though
 
Xeo
@MooingDuck Propose it. For all we know, it might get added.
I think it's rather unlikely, though.
 
@Xeo it needs to be thought through first
 
Xeo
That's part of proposing it. :P
 
namely, I ran into this again when I wanted to be able to pass an allocator in a container to elements being destructed. If the unique_ptr's destructor was able to know that the calling function had a allocator it could use, it wouldn't need to store a reference to the allocator itself. That information is always in the calling scope (in these situations), but the unique_ptr can't reach it.
 
4:33 AM
CG assignment
 
@CatPlusPlus CG?
what graphics course has you writing Java ;_;
 
4:51 AM
Guys, we should have a Lounge Minecraft server.
 
How much you want to bet someone will use it to ask us C++ questions?
 
Look at that another sleepless night
And for what
 
5:12 AM
@Borgleader Then we should not call it "Lounge<C++>".
But rather "We don't know C++".
Or something.
@CatPlusPlus Time to drink.
 
Honestly if this shit app is not good enough then I'm failing this course again
Because fuck this shit
room topic changed to Lounge<C++>: Animals anonymous [c++] [c++11] [c++-faq]
 
5:56 AM
what could i put for that TODO
 
guys sorry if im interupting
i needed to present an IEEE Paper
have any suggestions
 
What is going on.
 
If you didn't reply we could have pretended chat was dead
 
No walls of code.
@Rapptz I never liked stealth when straight up combat is an option.
 
6:09 AM
@techno christmas is a time for presents yes
 
6:27 AM
0
Q: Which STL object or memory management to be used for dynamic entities

Suman VajjalaI am developing applications for large scale computing and have some specific questions regarding the choice of STL objects and/or better memory management techniques to minimize compute resources. Specifically, my question is the following: I am currently using a STL vector obj to store data fr...

What does that mean in english?
 
Here's a Christmas future<present>.
 
@Borgleader He has fixed-size, zero-filled records. He wants to avoid storing the zero-padding. So, for example, if each record is 5 numbers, and only the first three are non-zero, he only wants to store the first three, with the other two implicitly zero.
 
And he wants to know if something is better than vectors?
 
No he wants to use std::vector for heterogeneous storage.
 
6:33 AM
std::vector<boost::variant> ?
Somehow that sounds awful...
 
@CatPlusPlus again? :S
 
> I do a one-shot read from the file and store in a vector. The issue is how do I convert this vector into the one I require?
I thought he had a memory problem?
 
7:23 AM
I'm pretty sure his problem is not what he thinks it is.
He has a vague idea of what he wants to do but I feel he has no clue how to do it.
 
Hah, figures
Of course today's attendance to 7:30 class is optional
Not like I did a mad dash over there to make it on time
@EtiennedeMartel "the game is awful. Animations are janky. There's a distinct lack of user prompts or directions. Some textures look like they're from a 1990s flight simulator. The zombie AI is comedic."
So it's faithful to the original then :v (better english)
Also I've decided to stop worrying about uni
 
moaning
 
I'm bit happier already
 
Unless you know precisely why you stopped [worrying], this could be a situational emotion
 
The entire thing is making me angry, nervous and tired
Time to kick back and relax
And probably fail but whatever
I think I'm also doing it wrong
I should work Monday-Friday and do uni on weekends
 
7:37 AM
bad idea
I say that because in hindsight, that seems to hinder no "me-days", which is pretty crucial.
 
In that system the classes are every other week or so
 
how would you graduate?
that doesn't seem like a lot of credit hours lol
 
But yeah, not doing uni would be the best option :v
We go by ECTS points, not hours; also, different thresholds
The degree is the same, the only difference is this system is paid
(That also proves how useful that degree is but hey)
 
@CatPlusPlus Do you have any idea how it would be in english "Żeby mi się tak chciało jak mi się nie chce"? It seems Englishmen don't have such problems ;)
 
I just settle on "I'm lazy fuck off"
 
sbi
7:47 AM
Watch out for that guy!
 
If you don't know how to say something in English, throw more fucks in it
 
That might work
 
sbi
@StackedCrooked If so, he must have forgotten.
(Yes, this was a pun.)
Dis rume iz deade.
 
Which reminds me that I just started watching this:
But now I have to leave for work.
 
Haha, I don't have to leave bed till 11
 
sbi
8:04 AM
@R.MartinhoFernandes That reminded me of John Peel, who, in an ad for the regularly broadcasting of his radio show on a Berliner station, said: "I might be old and ugly, and a non-German speaker, but I do find you some very good records."
 
I'm already at work ;)
- Hi, what are you doing?
- Nothing, I'm at work.
 
8:31 AM
ergh... I feel hard done by... I only drank a few last night... why do my eyes feel like they have been gouged out?
 
'Few' is not defined by the standard, so drinking a few is UB.
 
@thecoshman: You should check whether you still have eyes. Apply acid. If it hurts you still had them. If it didn't: well, nothing to worry about. *
 
I must be getting old :(
canny take it no more
 
@thecoshman Next time try drinking with mouth, not eyes.
 
@yetihehe And swallow downwards, not upwards.
 
8:38 AM
Don't worry about it - total visual impairment is bad, sure, but you can still get served if you're blind. Get a taxi to the pub.
 
can't wait for breaky though
omn nom nom
 
@StackedCrooked I heard alcohol enema is rather effective.
 
@yetihehe never been tempted to try one my self
I'd imagine it would hurt... though I guess that depends what exactly you decided use
 
@thecoshman Me neither
 
@yetihehe IIRC there was a darwin award for somebody who died of alcohol overdose by doing that.
 
8:51 AM
IIRC there was a "notable mention" of someone who tried this with concrete.
 
you know... I've herd a lot of these 'there was a darwin award for that' stories... who are these so called people who hand out these awards?
 
Lethal alcohol level - 3.5 promiles. (* Doesn't apply to Poles and Russians)
 
Hola
 
8:58 AM
@ereOn Cześć
 
Well, that's pretty much all the spanish i know. I'll go with english for the rest.
 

« first day (796 days earlier)      last day (4145 days later) »