« first day (493 days earlier)      last day (4446 days later) » 

12:05 AM
I heard that
 
hi all
i'm disappointed with free pascal, so now I am learning C++. :>
FP doesn't have a very good debugger... GDB crashes!
 
@AdamScottRoan That's one hell of a transition you're doing there. How are you learning C++?
 
C++ Primer 5th Ed.
I've been writing C for 5 years, so it won't be majorly difficult.
 
Actually, it might.
 
C++ is a very, very complex from what I see.
language*
 
12:11 AM
When transitioning from C to C++, there are quite a few things you need to unlearn.
 
ah well, that can be a pain depending on what it is.
the only difference I understand is what NULL represents.
 
@AdamScottRoan Oh dear.
It's worse than that, I'm afraid.
 
I figured. hah.
 
The thing you have to always remember is that C and C++ only share part of their syntax and standard library.
 
do you know if C++ Primer 5th Ed. is a good resource for learning C++?
 
12:16 AM
@AdamScottRoan I don't know. Just a second.
 
Well, great.
 
cool. yeah I bought it last year.
 
just letting you know I'm sound asleep
in case you were wondering :)
 
Not that shit again.
 
12:21 AM
@sehe Tell me you didn't create a cron job to post that.
 
Hey i got a quick question, without using std::getline() how can i determine when i come to the end of a line in file when trying to parse it?
 
There's a line terminator at the end of it?
 
Would that just save the end of line inside the character array?
 
@RMartinhoFernandes And if so, how can i preserve the end of line thing when i manipulate the array?
 
12:30 AM
@oorosco That will skip whitespace.
 
I started striving to write the math in markdown, deriving the update formula for the OP. Meanwhile someone else posted an answer without explanation and with the code in Python. Argh.
 
You need to use std::noskipws, or the unformatted input functions.
 
How can i preserve the whitespace and the line indents?
 
@CheersandhthAlf Where?
 
0
Q: %mod compatible ways of generating Binomial Coefficients

srbh.kmrI would like to optimize a part of my program where I'm calculating the sum of Binomial Coefficients up to K. i.e. C(N,0) + C(N,1) + ... + C(N,K) Since the values go beyond the data type (long long) can support, I'm to calculate values mod M and was looking for procedures to do that. Curren...

It was extra frustrating because I knew this answer intimately, since it was about first things I did in programming, about 1980, displaying Pascal's triangle in Basic, without using auxiliary array.
Grr.
 
12:33 AM
I usually don't click the "Show answers posted while you were writing" banner. I prefer to post my answer anyway and delete it afterwards if it is truly redundant. Leads to a lot less frustation. At least for me.
 
man
I am so bad at math.
I know Algebra 2, and that's it.
I need to trig and such... i just bought a book on some math topics, going to begin studying soon.
study8
 
"This is what the C++ part of C++ is like" <- derp
 
surprisingly I don't think you have to be really excellent at math to be a good programmer.
but the best programmers I know personally are always excellent at math, so I don't know. :P
 
@AdamScottRoan once you get into game programming and simulation creation then, yes
 
Okay, Can someone please tell me how to deal with the end of line? What is it saved into the character array as when reading in a file character by character?
I can't figure out what its acii value is.
 
12:37 AM
@ScottW though I think the more important part would be knowing how to use a computer ;)
 
struct trap {};
struct bait {
    trap* switch() { // damn keywords
        static_assert(sizeof(trap) <= sizeof(bait), "can't bait-and-switch to bigger types");
        this->~bait();
        return new(this) trap;
    }
};
@oorosco It's '\n'.
 
@oorosco on windows its \r\n
 
@Hoxieboy On C++ it's '\n'. Even on Windows.
 
I know how it is in cout<< but if i am parsing a file... it can't possibly be one character...?!??
 
@Hoxieboy only in binary mode
 
@oorosco Yes, it's one character.
 
Okay so... how can i check for it?
 
c == '\n'?
 
if ( '\n' == char_array[x])?
 
12:40 AM
Okay
 
Is it posible to make a GUI (form like) with just 2 boxes from a code which is made for command line run ?
 
@georgemano sure. What do you mean two boxes?
 
@georgemano yes, but exactly what are you talking about?
 
@georgemano You mean like cmd.exe?
 
Should I make a new project at VS ?
 
12:43 AM
@georgemano yes, if you need a new visual studio project
 
@CheersandhthAlf When you run the .exe it shows you black screen with white letters
@CheersandhthAlf I want it to be run in a window
 
In Windows just do it as an HTML app, filename extension .hta
 
lol
 
Woah, are you serious? That exists?
 
12:46 AM
Like Adobe Air, but even worse.
 
@georgemano make a project that is a "Visual C++"->CLR->"Windows Forms Application"
 
@MooingDuck I have already a project , is it nesessary to make a new one for the gui?
 
@georgemano it's not needed but it's hard to convert from non-GUI to GUI
namely because the logic is 100% different
 
@daknøk no, HTML apps in Windows do not involve proprietary stuff (unless you put it there), needs no installation, etc. They are clean and simple. Just what george appears to need.
 
@CheersandhthAlf Wow. I never came across one of those things.
 
12:48 AM
@MooingDuck So its suggested to make a new project , right ?
 
@RMartinhoFernandes Just try it out. Well there is a custom tag you can use to get rid of scrollbars (I think it was). But you can just use standard HTML and CSS and JavaScript, with access to all that can be scripted of the Windows API.
 
@MooingDuck Please help
 
@georgemano that's what I would do, but Alf seems to know a easier way
 
@MooingDuck Who is Alf?
 
12:50 AM
@MooingDuck What?
@MooingDuck Cant understand
 
@georgemano that's his name
 
@CheersandhthAlf Can't try out now. No Windows installed. I need to pirate it first to be able download the genuine Windows ISO, so I won't do it any time soon.
 
Alf P Steinbach
 
@MooingDuck what is the easier way ?
 
@georgemano I don't know, but Alf seems to.
 
12:52 AM
@MooingDuck I'm amazed at how well this new screen name suits him.
 
Alf are you here ?
 
is there a better way to make a non-form-gui to a gui .exe from making a new project at VS?
I have a code that is writen in C++ for console
I mean when you run it , it appears in console
 
if i have while(myfile>> temp) (action); while(myfile>> temp) (other action); Will the second loop start from the beginning of myfile?
 
just letting you know I'm sound asleep
in case you were wondering :)
 
12:56 AM
Oh my god , some help please , I am in a bad situation
 
@georgemano yes, make a new project
@oorosco nope, you'll have to clear and seek between them. myfile.clear(); myfile.seek(0);
 
What does that do?
@MooingDuck to be specific wouldn't seek be enough?
 
@georgemano what does the program do, and how do you want it to appear instead?
 
@oorosco no, while(myfile>>temp) will read until the badbits are set, and I don't think seek clears flags, so the second loop would fail immediately
 
Okay
 
1:02 AM
@CheersandhthAlf It takes values for .txt , makes calculations, and appears the results in command line. Now I want to have boxes for the inputs and boxes for the outputs.
 
Well, the Windows API has special support for letting a script run a program and catch the output (which it can then present).
I'll try to cook something up, but I need coffee first.
Meanwhile try to put the following in an .hta file and run it:
<html>
    <head>
        <title>Blah blah</title>
        <style>
            *
            {
                color: white; background: black;
                font-family: "Lucida Console"; font-size: 9pt;
            }
        </style>
    </head>

    <body>
        <div>
            Some text blah ljasdølkj asdlkjasdlkjasdlkj<br/>
            The quick brown fox jumped over the lazy dog.
        </div>
    </body>
</html>
 
@CheersandhthAlf you still think an .hta file is the way to go?
 
yes, but it depends on the input side of things
 
@RMartinhoFernandes Alright, I finally finished the first year of the game. loungecpp.wikidot.com/df-game-1
 
@CheersandhthAlf we've probably already lost him by giving two totally different bits of advice
@Pubby I lost the game
 
1:06 AM
@MooingDuck Me too :(
 
oh! DF! AWESOME!
 
@MooingDuck What game?
@MooingDuck Wanna be next in our succession game?
@Pubby Downloading.
 
@CheersandhthAlf I done it . very nice trick
 
@RMartinhoFernandes I didn't upload it yet, heh
 
@RMartinhoFernandes I'm not dependable, I procrastinate everything that isn't in my daily routine
 
1:08 AM
@Pubby That explains why I couldn't find any links.
 
@RMartinhoFernandes Also, I haven't played in years, I'd want to get back into things before doing co-op
 
@MooingDuck Err, you think I'm different?
 
@Pubby wait, you have Bjarne making chairs?
Stroustrup and Meyers....
 
@MooingDuck Yeah, he is rather good at them.
 
Sutter is a great name for a miller.
 
1:11 AM
@RMartinhoFernandes I might partake in the future. I'll have to figure out how to take screenshots though. It's tricky on a macbook with WinXP.
 
Hm, what's a good upload site for large amounts of data?
(Assuming 50MB is large)
 
@Pubby facebook
 
Don't use facebook :(
Actually, can you do torrent?
 
1:12 AM
dropbox I believe is the best
 
But 1-to-1 torrent sounds a bit silly.
 
Yeah, but a hosting site would be the same way
 
Making Visual Studio cancel a build is slow :/ It's been like two minutes
 
@Pubby It's not that it wouldn't work. It just sounds silly.
 
I just taskkilled cl.exe, was that a good idea? Seems to have worked fine
 
1:14 AM
its a compiler driver, probably not a good idea lol
I don't think it did anything harmful :P just restart it
 
@MooingDuck I suppose that the worse that can happen can be solved by cleaning.
 
@RMartinhoFernandes that was my thought
 
@Pubby vegetarian dwarfs?
 
@RMartinhoFernandes it's common, hunting is dangerous
 
@RMartinhoFernandes No meat so far. Anyway I uploaded the .torrent: host-a.net/u/pubby8/cpp1.tar.gz.torrent
 
1:17 AM
@RMartinhoFernandes though fishing isn't deadly anymore since carp can no longer reach 5 squares out of the water and pull in dwarves that can't swim
 
@MooingDuck There's always livestock.
 
I had some cows or something but they starved somehow. I think it's because I traded their food away for that mace.
 
@RMartinhoFernandes yeah, that too
 
Hey does anyone know why when i print out the myfile's data via the cout it gives me nonsense characters? codepad.org/L0ycQEH2
 
1:19 AM
I have no idea
Been looking at this for like 15 min it's so random
 
are we talking about DF?
 
@RMartinhoFernandes Is the torrent working?
 
Trackers returned one seeder, but it doesn't seem to want to connect.
 
@CheersandhthAlf can we talk private ? in a chat or something ?
 
Is it because of i'm saving the data wrong? Because it's literally printing out random characters: codepad.org/L0ycQEH2
 
1:22 AM
@Hoxieboy on and off yes
@georgemano kinda
 
@oorosco check your ide's search path for the compiler exe its using
 
I have no idea how to do that... Search path? As if in it's readin gthe wrong text file?
 
I usually bring in a breeding pair of dogs (Pubby brought two males, hmm), so I can get both guard dogs, and emergency puppy food.
 
@oorosco actually, check if you saved it as a C file or C++ file
 
1:23 AM
@Hoxieboy Saved the file i'm trying to compile or the text file i'm attempting to read?
 
@oorosco check and see if the program file is saved as a C or C++ source file
 
So i'm in the folder and i see driver.cpp and inside the debug folder i see driver.obj
@Hoxieboy
 
@Pubby I stopped all other torrents to make sure they weren't hogging the bandwidth, but it still doesn't want to start downloading :(
 
@RMartinhoFernandes that's what trading is for. Did he pick a site with sand?
 
@oorosco good, that means your program is a C++ source file, now, whatever IDE you are using, check if the compiler it is using is set up correctly, or there at all
 
1:26 AM
@RMartinhoFernandes I'm trying an upload site, hold on
 
i'm using microsoft visula studio express 2010. And how do i check to see if the compiler is set up correctly
@Hoxieboy
 
@oorosco I don't use VC++, but it should be somewhat in the format: options > compiler settings > compiler path
 
@MooingDuck Why trade? AFAIR females cost as much as males. I can understand two male cats, but dogs can't become an infestation.
 
@oorosco if you see the file in the solution explorer window, it's probably
 
@RMartinhoFernandes filedropper.com/cpp1tar
 
1:29 AM
@RMartinhoFernandes both for guard dogs, and emergency puppy food.
 
@Hoxieboy No idea how to get to this, but i'm quite certain that it's the way i'm reading in the data.... Have you looked at the codepad?
 
just letting you know I'm sound asleep
in case you were wondering :)
 
@sehe Oh, come on! You did set up a job for this. That's like... spam!
 
@sehe Next time I see that, I flag it.
 
@oorosco no, its not an issue with your source (I'm pretty sure), but that it can't find the import libraries for the C++ program itself: "Line 46: error: fstream: No such file or directory" I would like to know why it says line 46
 
1:33 AM
Yes
It runs and in the output window it has wild characters
Also it has a random message "This program cannot run in dos mode" which is the only non-random character part
 
Er, you're opening an executable file.
 
@Hoxieboy #include <fstream>?
 
argv[0] is your program name.
Not the first argument.
 
@oorosco another thing is you don't need std:: before every thing that uses the library if you already have using namespace std;
 
Oh
 
1:34 AM
That's argv[1].
 
@RMartinhoFernandes Oh, I forgot to tell you that the init files being used are all the default ones. Not sure if that matters. (btw did the DL work)
 
@Hoxieboy don't tell him that
 
Oh that makes a lot of sense.
Oh right, argv[0] is the name of the exectuable?
Damn me
 
@oorosco Exactly.
 
@oorosco sometimes, kinda, sorta, if you're lucky
 
1:35 AM
@Pubby It's on 40+MB now.
 
What's that mean?
@MooingDuck
 
@oorosco argv[0] is whatever string was used to launch your process. That's commonly the name of the executable, sometimes with a path, sometimes without. It can also be an alias, or have various links involved
 
Ok, so, where do I place DF save files on Linux?
 
@RMartinhoFernandes /data/save
 
Ok
 
1:37 AM
@Pubby You mean, on the game folder? Not somewhere under ~?
@ScottW No, not the entire line.
 
@RMartinhoFernandes Dunno. I didn't install it, just downloaded the files from the website.
 
Crap, I'm in an editwar with Oli Charlesworth.
 
charlesworth? swarthy
 
@RMartinhoFernandes yeah, game folder
 
@Hoxieboy Yep dear old swarthy =)
 
1:39 AM
well, he's basically perfectly correct
 
lol
 
@Pubby Ah. My distro's package manager has a package for it (and it seems to be updated pretty quick) so I installed that.
 
free store is a useless Standard term that nobody really uses
 
It's two words anyway.
 
@DeadMG its about time you woke up :)
 
1:40 AM
@RMartinhoFernandes Alright, just make sure it's 0.34.02. There was another version a few days earlier that had some nasty corruption bugs.
 
I have been awake since 8:30 pm
 
by woke up I meant came back to us
@sehe plink, wake up, thats what you get for spamming the chat
 
@CaptainGiraffe It can disagree all it likes. All that question says is that free store is the Standard term
not that it's not useless
or that anybody really uses it
 
just an example Windows HTML app that runs a C++ console program "behind":
 
1:47 AM
@DeadMG I'm quite unclear on your position here.
 
ok
my position is that free store is a worthless term used only by the Standard that nobody actually uses or cares about
"the heap" is a perfectly acceptable way to describe the location of a dynamically allocated object
just like we describe automatic objects as being on "the stack"
 
@DeadMG Clear. I could not agree more. (well besides the worthlessness)
 
and that editing a question to exchange "heap" with "free store" is therefore wrong
 
@DeadMG And as a consequence the reedit "freestore" to "heap" was correct.
@ScottW No of course not. All those people we can read signing off on those documents are Harry Potters at best.
@ScottW Yes, the whiskery beard and the glasses.
 
@Pubby, can you tell me how big is the file? Or give me an hash? I'm not sure this downloaded correctly :S
 
1:57 AM
@RMartinhoFernandes ~47.5 MB. MD5: 53fe0a11b38b9c9145f4f0fc349edeca
 
Hmm, 49.1 MB.
WTF?
 
@RMartinhoFernandes Have you tried loading it?
 
Gunzip says it's not a valid gzip file.
 
just letting you know I'm sound asleep
in case you were wondering :)
 
@RMartinhoFernandes Found a new host, hold on
I apologize for the mess :S
@RMartinhoFernandes Try this one: dffd.wimbli.com/file.php?id=5631
 
2:19 AM
Time to create a learning knowledge base
 
@Hoxieboy: How's that different from Stack Overflow? :-P
 
As in, an AI that waits for you to ask a question, and if it knows the answer, says it, otherwise asks what it is and learns
 
@RMartinhoFernandes close
 
Hi everyone
 
2:22 AM
Cyc is an artificial intelligence project that attempts to assemble a comprehensive ontology and knowledge base of everyday common sense knowledge, with the goal of enabling AI applications to perform human-like reasoning. The project was started in 1984 by Douglas Lenat at MCC and is developed by company Cycorp. Parts of the project are released as OpenCyc, which provides an API, [http://sw.opencyc.org/ RDF endpoint], and data dump under an open source license. Overview The project was started in 1984 as part of Microelectronics and Computer Technology Corporation. The objective was ...
 
@CheersandhthAlf thats fine and all, but I'm making this specifically for my learning
 
lol
 
@Pubby finally. It's working!
 
@RMartinhoFernandes Great!
 
2:40 AM
just letting you know I'm sound asleep
in case you were wondering :)
 
2:55 AM
I caught myself whistling along when they played old Wham! tune on the radio.
It was "Careless Whisper", I think
 
Fuck it, enough studying for tonight.
I think I'm going to nail this exam tomorrow
AI planning.
At the university level, many extremely competent professors also happen to be poor communicators.
Woop-di-doo.
 
Hello everyone!
 
which language is easier to create bots? Java or C or #C?
 
What kind of bot?
 
3:09 AM
@ScottW Lol no.
 
@ScottW Doubt so. The only robot we have here is @RMartinhoFernandes.
And one is enough. Otherwise I might start thinking that Skynet is in the house.
 
just letting you know I'm sound asleep
in case you were wondering :)
 
A damn annoying one.
 
DAMN IIIIIIIITTTTTT
 
3:37 AM
@EtiennedeMartel If Skynet was here, you wouldn't be.
 
So, what, @sehe is running a cron job to write here he's sleeping?
 
Hey quick question, if i have an array of pointers to objects say: object *name = new object[size]; and i set object *pointer = object[element]; would the act of setting the pointer object[element] effect pointer?
 
@oorosco What do you mean by effect pointer?
 
Would the value of what pointer is pointing at would anything change?
Like the object it's pointing to, woulld it change?
@Prætorian
 
@oorosco object[element] doesn't seem correct. Did you mean name[element]?
 
3:48 AM
yes
 
Still not sure what you mean, but object *p = nullptr; p = container[elementIndex]; changes what p was pointing at
 
sorry name[element]
 
And would the second snippet in fact then be object* pointer = &name[element];?
 
@LucDanton I think his container contains object *
 
@Prætorian There's no container involved.
 
3:49 AM
@LucDanton Why would you use the &
 
just letting you know I'm sound asleep
in case you were wondering :)
 
@oorosco The only way for object* pointer = name[element]; to be correct is that there's a conversion from object to object*.
I recommend you try writing a small program to try your snippets.
 
@LucDanton So the array i made is not a list of pointers to memory with the objects butt rather the objects themselves?
 
@oorosco If you used new object[size] then yes, it's an array of object, not an array of object*. You'd use something like new object*[size] for the latter (or more realistically, std::vector<object*>).
 
@LucDanton WHy do you say more realizsitcally? Does something go wrong if you do the later?
 
3:54 AM
It's not as convenient. For instance, you can't resize it.
 
Hum
 

« first day (493 days earlier)      last day (4446 days later) »