« first day (460 days earlier)      last day (4491 days later) » 

6:00 PM
no idea
 
lol (pun intended)
 
There must be some file extension they're using that is still set to firefox but heck if I know what it is
 
There is no overload for string in istream ? : basic_istream& operator>>( string& T );
 
@MrAnubis there's a global version in the string header isn't there?
 
6:01 PM
@MooingDuck Check the "Default Programs" thing in the Control Panel.
 
sbi
@MrAnubis #include <string>
 
aah , was seeing the ref of istream and didn't find any overload :) , thanks @MooingDuck @sbi
 
@RMartinhoFernandes I'm running XP with the "classic" control panel, I don't see anything relevant to that
 
that is defined in string header
 
The Universe should, out of a sense of universal justice, just shoot people that claim T* p = nullptr; T& x = *p; will produce a null reference.
@MooingDuck Oh, that's a Vista+ thing.
Try the Default Programs Editor (third-party, not in Windows).
Not sure if it works on XP.
 
sbi
6:04 PM
@MooingDuck I dunno. I tweeted my operator overloading FAQ, too, and didn't feel like I got any votes for it. :) And the @visualc twitter team once tweeted a link to one answer of mine, which got me one upvote.
 
@RMartinhoFernandes I went to (explorer folder)->tools->folder options->file types, the only thing I see there with firefox is "Firefox URL" with no extension type. I can't be sure though, no search functionality
 
sbi
@RMartinhoFernandes Let's qualify that: "After 1 year of seriously working with C++." Most of us wouldn't be here otherwise.
 
Fair enough.
So, I can claim it without being shot!
 
@RMartinhoFernandes for WinXP I can only access "File Type Settings" which has nothing for firefox. The "Default Program Settings" isn't for WinXP
By the sounds of my fans, a process has gone rogue
 
6:09 PM
It has "Works on my machine" in the about box.
 
@RMartinhoFernandes that's what I was talking about. It's designed for Win7
 
Ah. Damn.
Uninstall Firefox?
Kill Firefox with fire?
 
@RMartinhoFernandes thinkin about it, but I still use it to download videos from sites that won't let me download videos
 
And then reinstall it!
 
ah, the iTunes Wireless Sync Service is maxing out my CPU. Again. (I don't have a wireless apple device to sync with)
 
sbi
6:14 PM
@MooingDuck Is that what you get when you right-click on an html file?
 
@sbi no, "html" is a "chrome html document"
 
Then why us wireless sync??
*use
 
sbi
@Gmenfan83 You can edit here.
 
@MooingDuck Why don't you just kill the service?
 
@RMartinhoFernandes I do. regularly
 
sbi
6:16 PM
@RMartinhoFernandes Isn't that what big companies do? Killing their service?
 
@sbi Admit it, you made that typo on purpose, just to show the editing ability!
 
@Gmenfan83 it starts itself when my computer turns on, and I have to switch to my admin user to turn it off, and then it starts itself anyway when I plug in my iPod
 
@MooingDuck Well, kill it with fire on the Services things on the Control Panel.
 
sbi
@RMartinhoFernandes Yes, of course I did. But also, I found "editing her" funny.
 
@sbi i see, thanks!
 
sbi
6:18 PM
@MooingDuck You should simply switch the service off once and for all.
 
so if I want an IDE that can use cygwin/gcc on my windows box, and also Java, that's as close to Visual Studio as possible, any suggestions?
 
@MooingDuck did not know it started automatically and i use all Apple devices, smh
 
@sbi I'll see if I can do that later
 
sbi
@MooingDuck And what about HKEY_CLASSES_ROOT\http?
 
so the Android dude thought Pubby's advice was helpful
tsss
 
6:19 PM
@sbi regedit can search! Good idea!
 
@MooingDuck NetBeans? Eclipse?
Why the heck did you have to throw Java into the mix?
Stupid m key.
 
sbi
@MooingDuck Just open HKEY_CLASSES_ROOT, put the mark on the first item, and type htt...
 
Emacs? (although i know it is not a true IDE)
 
-4
Q: Should I bother with design patterns?

user1148237Design patterns sound great and all, and it can work well in certain situations, but in most of my actual coding, I don't follow it.

@Gmenfan83 Go away demon!
 
sbi
@RMartinhoFernandes parser error near 'to'
 
6:21 PM
@sbi chrome
 
@sbi Gosh, how could I write that?
 
sbi
@RMartinhoFernandes Keyboard?
@MooingDuck HKEY_CLASSES_ROOT\.html?
 
@sbi Chrome
 
sbi
@MooingDuck .URL?
 
grep the registry for firefox.exe
 
6:23 PM
HKEY_CLASSES_ROOT\FirefoxHTML\ is firefox :/
 
@MooingDuck That's not an extension association.
 
@sbi all the ones that begin with HKEY_CLASSES_ROOT\.* have no firefox
 
sbi
@MooingDuck Look where FirefoxHTML is referenced! And FirefoxURL.
 
@sbi I am
HKEY_CLASSES_ROOT\MacromediaFlashPaper is firefox :/
 
I just got slapped in the face with a herring in the Android room (!)
 
6:25 PM
HKEY_CLASSES_ROOT\RealNetworks\Update\6.0\Preferences is firefox
 
by a @cat
 
retrieves his herring
that's my supper
 
@MooingDuck RealNetworks. Ugh. Bad memories.
 
@RMartinhoFernandes I searched all of HKEY_CLASSES_ROOT and told you (most) of what I found, should I search the other trees too?
 
It could just be that those programs are sucky and fire up firefox directly for some reason.
 
6:28 PM
@RMartinhoFernandes Skype? Owned by microsoft? unlikely
 
Skype is owned by Microsoft?
 
@RMartinhoFernandes I thought the deal completed, didn't it?
Skype () is a proprietary voice over Internet Protocol service and software application originally created by Niklas Zennström and Janus Friis, and owned by Microsoft since 2011. The service allows users to communicate with peers by voice, video, and instant messaging over the Internet. Phone calls may be placed to recipients on the traditional telephone networks. Calls to other users within the Skype service are free of charge, while calls to landline telephones and mobile phones are charged via a debit-based user account system. Skype has also become popular for its additional feat...
 
Oh well...
Did you try uninstalling and installing Firefox again?
 
@RMartinhoFernandes not worth the effort really. I just end up using firefox unexpectedly once in a while
 
6:31 PM
I guess that's subjective. I wouldn't let a machine tell me what to do.
 
@RMartinhoFernandes For a while, now.
 
Anyone here agree that this should be reopened?
26
Q: C++ vs Java? Simple loop shows frustrating results

thesaintThe following is a simple loop in C++. The timer is using QueryPerformanceCounter() and is quite accurate. I found Java to take 60% of the time C++ takes and this can't be?! What am I doing wrong here? Even strict aliasing (which is not included in the code here) doesn't help at all... long long...

 
No. Benchmarks between languages are dumb.
 
That just what the title says, but if you read further down, it's mostly a complier vs. compiler comparison within C++.
 
indeed
 
6:37 PM
@Mysticial I think it's interesting data, just needs a new name/reworded question :/
 
Demotivational: Walking is like falling without following through.... You quitters.
 
Ugh, walls and walls of assembly.
 
Yeah, I don't see what's Java doing in there.
 
@EtiennedeMartel it sparked the original question
 
@MooingDuck It started off as just a C++ vs. Java question. That's where the initial downvotes and close votes came. Then after the wall of comments and edits, it turned out that Java had nothing to do with it.
 
6:38 PM
He noticed the Java was faster, was smart and tried a different compiler to see if that would make the difference, and came to the conclusion C++ compilers suck
 
@Mysticial I'm aware, but I think if the title/top half the question is reworded, it becomes a valid and interesting question
 
@MooingDuck I agree, I'm not sure how it should be edited though.
 
"Why do C++ compilers suck so badly?"
 
Because C++ sucks.
 
6:42 PM
@EtiennedeMartel you might be in the wrong room. You might want one without an elephant
 
Yeah, maybe it's too obvious.
 
is it possible to tell GCC to compile and link all CPP files in a directory without listing them by name? Visual Studio's "external tools" won't let me pass all the cpp files at once
 
*.cpp?
Wait, you're trying to set up GCC on VS?
 
Weird shit.
 
@RMartinhoFernandes Install Android on iPhone
 
6:47 PM
@RMartinhoFernandes yeah, I use Visual Studio. I'd like to have an option to say "run this through GCC and tell me it's errors." Just to test portability, obviously I wont be able to debug
 
@Xaade Err, I think you referred to the wrong message...
 
geez. I thought I could hold #1 answer at least 12 hours... and then Jon Skeet throws throws a curve ball...
 
@MooingDuck Does it work with *.cpp? If not, you could put that in a .bat, there it works.
 
What's with all these insanely high scoring answers lately?
 
@RMartinhoFernandes No. Just pointing out that there are weirder things afoot.
 
6:49 PM
@RMartinhoFernandes doesn't seem to work
 
@Xaade Wait! Only now did I actually try to understand what you wrote. Android on iPhone? WTF?
 
@RMartinhoFernandes I guess I'll start with one file at a time. Now I'm getting "error while loading shared libraries: ?: cannot open shared object file: No such file or directory" I should learn to linux
 
@RMartinhoFernandes As weird as putting Windows on a Mac.
@MooingDuck Can you run g++ from the command line?
 
@EtiennedeMartel Isn't that supported without hackery?
 
@EtiennedeMartel dunno
@RMartinhoFernandes yes
 
6:52 PM
@RMartinhoFernandes This goes to prove that I can think of anything, google it, and find out I've had someone else do it for me, retroactive ESP.
 
@RMartinhoFernandes Yeah, but it's still weird to put Windows on incredibly expensive hardware.
I mean, the only reason to get a Mac is because it's the only legal way to use Mac OS X.
 
ugh
 
@EtiennedeMartel I learned the hard way. I'll never buy a mac again
 
... Mac
 
@EtiennedeMartel You're paying for five letters, the rest of it (software and hardware and such) is just a bonus.
 
6:53 PM
Hey, I'm talking to you guys on a MacBook Pro.
 
Apparently, the fact that it works, is a bonus too. That bonus isn't guaranteed. You're holding it wrong
 
@Xaade Don't fuck with Mr. Jobs.
 
@EtiennedeMartel yeah, seems to work from the cygwin command line, after I change \` to /
 
@EtiennedeMartel Will be difficult now that he's no longer amongst us living ones
 
6:56 PM
@MooingDuck Oh, you have cygwin...
 
@MooingDuck Trouble with markdown?
 
@EtiennedeMartel srsly. It seems to not like backslashes
 
You can't run it from the regular command line, can you?
@MooingDuck \ to /
See? That was easy.
 
Nothing is easy once markdown is involved.
@MooingDuck But, can you run it from an actual Windows command prompt?
 
@RMartinhoFernandes nope, can't.
 
6:57 PM
You need to find a way to do that.
Or get MinGW.
0
Q: Multiple definition of C++. How to split C++ program properly?

koleSI wrote a program that works without problems, but the thing I am afraid of is that I get a lot of warnings, when I compile it with -Wall option ( it's program written in C and C++). Actually there is only one type of warning, but occurs many times : Multiple definition of .... ( contructors , de...

Protective goggles recommended.
 
There's Windows native GCC
MinGW-w64 and all
good stuff
even has std::thread, partially, partially thanks to me
 
@rubenvb so, get rid of cygwin, get mingw is everyone's advice? (Is one better at GCC updates than the other?)
 
1
Q: g++ not working on Windows command prompt. Cygwin installed

ShaneI have installed Eclipse and CDT (to use C/C++ in eclipse CDT is needed), as well as installing Cygwin so that I can compile my files. In environment variables I've set Path to include the following: "C:\cygwin\bin;" g++, make and GDC are all installed via Cygwin. I made sure of this by searchi...

Hmm. Looks like you'll have to use MinGW.
 
if you want to run gcc from the Windows command prompt and built non-cygwin apps, yes
MinGW GCC != Cygwin GCC
there's a huge difference
and MinGW-w64 != MinGW. There's a small but very significant difference
 
The 64 bit part?
 
7:00 PM
for starters
 
@rubenvb alright, noted
 
I can point you to very good MinGW-w64 builds ;);)
 
So, just by formatting the error message as code to prevent Markdown from going wild on it, I added 540 characters to the question.
 
@rubenvb don't have 64bit OS
 
@RMartinhoFernandes Badass.
 
7:02 PM
@MooingDuck that's one common misconception. MinGW-w64 is also 64-bit
but also 32-bit
 
@rubenvb You can't blame people from thinking it if you name it like that.
 
historical reasons
I didn't name it
 
@EtiennedeMartel Apparently turning capitalism into a dictatorship through the policy of make consumers more stupid, is praiseworthy???
 
@rubenvb Oh, I meant "you" as "one".
 
lol
I made you think I thought something you thought I didn't think I thought
 
7:04 PM
"thought".
There, you troll me, I point out your spelling mistakes :P
 
@Xaade Wait, what?
 
what spelling mistakes?
 
> I threw warning message out, because it makes this topic unreadable.
Sigh, now all my work adding those 540 characters is lost.
 
@EtiennedeMartel Some people appreciate freedom. Others would rather have it taken away.
 
@rubenvb ah, I'd gotten Cygwin due to misreading this sentance on the mingw site: "If you want POSIX application deployment on this platform, please consider Cygwin instead."
 
7:11 PM
Right, that means "if you want to use things like fork() and shit".
 
@MooingDuck well, if you need full POSIX, you'll need Cygwin. MinGW(-w64) is only GCC targetting win32.
@RMartinhoFernandes exactly.
pthreads is MinGW-w64 ported
in two varieties
 
@rubenvb doesn't Windows have an optional posix emulation dll somewhere? I could swear they do
 
That was abandoned.
 
Interix is the name of an optional, full-featured POSIX and Unix environment subsystem for Microsoft's Windows NT-based operating systems. Interix is a component of the Services for Unix (SFU) release 3.0 and 3.5 (this last one is distributed freely). The most recent releases of Interix, 5.2 and 6.0, are components of the Windows Server 2003 R2, Windows Vista Enterprise and Ultimate editions and Windows Server 2008 under the name SUA (Subsystem for Unix-based Applications). Version 6.1 is included in Windows 7 (Enterprise and Ultimate) and Windows Server 2008 R2 (all editions). It is set...
 
@MooingDuck no, that SFU and stuff. Optional, external, unmaintained, abandoned crap
it was mightily cool though
the concept that is
 
7:13 PM
Do any of you know about any ways to restore files in the recycle bin from the recycle bin folder?
 
@RMartinhoFernandes it will be abandoned for Win8
 
@KianMayne right click on them?
Interix includes GCC 3.3? Didn't know that
 
@MooingDuck No, in the rootDiskDrive:\$RECYCLE.BIN folder
 
@Xaade Oh, you mean FREEEDOOOOOMM!!!
 
7:14 PM
@MooingDuck old crap :p
 
@rubenvb very. But it's a start
 
@MooingDuck Interix was a start
 
It's even older than what ships with Dev-C++.
shivers
 
Woa, that's old.
 
hehe, IDEs sucked when Dev-C++ was around
it's still popular.
 
7:17 PM
Sadly.
 
It's popular even though there's a much better alternative available: Code::Blocks.
 
@EtiennedeMartel I believe Code::Blocks was the successor of Dev-c++
 
I had to tell someone to upgrade to something just 3 hours ago: stackoverflow.com/q/8928817/46642
 
IDEs shouldn't ship toolchains
 
@rubenvb I'm fine with them shipping toolchains as long as they're replacable
 
7:28 PM
IDE stands for Integrated Development Environment. I would expect it to come with "batteries included".
2
 
Not sure what happened during my last install of Python, but half is in "C:/Python27/" and half is in "C:/Put a directory on PYTHONPATH here/"
 
my boost install is half a gig? wow
 
I posted a stupid answer to a stupid question.
0
A: Number of Virtual tables and Virtual Pointers in a C++ Program

R. Martinho FernandesNone. This program can be optimized to be exactly like this one: int main(){}

 
lol
like the thread question yesterday with the while(1)
 
7:40 PM
I really appreciate the day I realized the compiler won't produce code that does as I asked, or the CPU won't run the code as the compiler asked. Knowing that reduces your attempts to guess performance and it keeps you on your toes when you're doing something with multiple threads.
 
The only thing I have done with threads is very basic. A rng per thread, and a reference to a vector that has to be filled
then join all threads, and continue with the next step :)
 
@rubenvb k, removed cygwin, installed MinGW. Can compile from command line, but when I try through Visual Studio: "cc1plus.exe - Unable to locate component" "This application has failed to start because libgmp-10.dll was not found."
 
PATH issues?
You probably need to restart VS.
 
@MooingDuck Ah, you downloaded MinGW.org's version
that sucks
 
7:44 PM
@RMartinhoFernandes I thought I put all the relevant paths on the... ah. Haven't restarted VS
 
Wait, what?
 
@MooingDuck get this one instead: sourceforge.net/projects/mingw-w64/files/…
 
get the -gcc- one without _linux or _cygwin
 
Achievements?
For VS?
What?
 
7:45 PM
you can even try out the Clang addon too. If it's only for compiling
 
@RMartinhoFernandes it's not dated Apr 1 ....
 
@RMartinhoFernandes Gamification!
 
I think that would better fit things like vim.
 
@rubenvb It's tempting, but I hesitate to download executables linked in a public chatroom from personal sites or organizations I haven't heard of
 
Yeah, but vim isn't developed by snarky people.
 
7:47 PM
@MooingDuck I build toolchains for mingw-w64
sheesh
Check the friggin' URL
 
@rubenvb the URL you linked was sourceforge.net/projects/mingw-w64/files in a directory called / Personal Builds / rubenvb /
 
of course. There's personal builds and automated builds
There's no official release channel for MinGW-w64.
You're being paranoid.
 
That's what all the bad guys say. ;)
 
@RMartinhoFernandes You're not helping. You can check the internets for my street credibility
 
@RMartinhoFernandes that's what I'm thinking. The second link looks more legit
 
7:51 PM
@rubenvb Oh, I should've used a smiley then :)
 
@MooingDuck join #mingw-w64 on irc.oftc.net and talk to ktietz
ffs
@MooingDuck click on Win32 Downloads -> Toolchains targetting 32-bit -> Personal Builds -> rubenvb -> celebrate
Well, suit yourself. I don't care. Be ignorant. I'm outta here in five
 
0
Q: G++ can't find boost libraries. I say they're in plain sight

jmbeckI'm trying to build some code. Here is the error I'm getting: main.o: In function `__static_initialization_and_destruction_0': /home/jmbeck/Downloads/boost_1_48_0/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()' There is more, but I don't think it's r...

lol @ title.
 
@rubenvb I'm still looking at how much work is involved, I believed you quite a while back
 
I have over 2200 downloads for my 32-bit toolchains. Cool
 
Is that like Facebook likes to you?
2
 
7:58 PM
and 3600+ for 64-bit. I'm so awesome
It's a sf.net "+ I digg like 1 this reddit"
 
@rubenvb If I just install yours over the mingw.org, that'll mess everything up right? I have to uninstall theirs to install yours? Yeah, stupid question
 
Overwriting will probably work fine.
 
How is yours better? Why should I do all that work?
 
@MooingDuck mine's unzippable. Just delete the files
Mine has std::thread if you link your exe with "-static"
It includes winpthreads, is optimized for core2 (over -mtune=generic), has me if you run into trouble
 
@rubenvb since my primary compiler is visual studio, things that MSVC10 lacks I won't be using
 
8:01 PM
And you can try out Clang
@MooingDuck VC11 has <thread> and <chrono>
 
@rubenvb waitwhat? Oh 11. That's not out yet
 
it's... available
And I regularly update the build too
with latest svn stable stuff from everywhere
 
@rubenvb so it is! Downloading!
 
lol
boy meets internets
And I'm out
 
@MooingDuck Now you can use all the new features of C+... wait, you can't.
 
8:05 PM
@RMartinhoFernandes I know :/ At least I get much more of the library
@RMartinhoFernandes "Setup Blocked: Correct the following problems and then run setup again. (1) " <end of message>
 
ah, I don't meet the system requirements
someday soonish I'll get up the guts to upgrade to Windows Vista+
 
@RMartinhoFernandes requires Win7. I think I have a 7 CD somewhere. I should find it
.tar.gz file huh? I wonder if I have anything that can open that. Yup!
@rubenvb I can't figure out... It looks like I'm downloading sourcecode? Do I have to build it myself? Because the purpose of this is to get a compiler besides visual studio. Ergo my only compiler is visual studio. which probably won't compile this.
I assume I'm downloading the wrong files. Your website is not helpful
 
@MooingDuck What did you download?
Wasn't it a .7z file?
 
8:21 PM
@RMartinhoFernandes not the first two I tried
I was trying to find "official releases" instead of his personal build. Apperently I was in the wrong area
The personal one he linked has binaries, so that confirms I'm just stupid
 
There are no official releases.
 
@RMartinhoFernandes explains a lot.
I like stackoverflow.com/questions/8932543/c-memory-management He wants to make smart pointers for C.
 
0
Q: convert 4 bytes to 3 bytes in C++

JimmI have a requirement, where 3 bytes (24 bits) need to be populated in a binary protocol. The original value is stored in an int (32 bits). One way to achieve this would be as follows:- int x = 24; int y = x<<7; memcpy(dest, hton(&y), 3); Please let me know if above is the correct wa...

 
@RMartinhoFernandes I found some files that look good to me
what the, "error: '>>' should be '> >' within a nested template argument list" GCC still requires this?
MSVC made things easy :/
 
GCC allows >>
 
8:31 PM
@Pubby I'll start at the top of the errors, maybe I confused it. Or more likely I'm missing a flag
 
@MooingDuck In C++98 mode, yes.
 
@MooingDuck Actually, 4.6 might not allow it. Not sure if there's an option, but I always added spaces. 4.7 definitely allows it.
 
But -std=c++11 does wonders.
 
@Pubby I have 4.5.4 apperently, but no flags. What are good flags if I want to test portability/conformance?
 
-Wall -Wextra -pedantic-errors -std=c++0x
 
8:34 PM
--version
 
@RMartinhoFernandes unrecognized command line option "-std=c++11"
 
Or -std=c++98 if you want the old standard.
 
-std=c++0x
 
@MooingDuck Ah, I thought you were on 4.7. For 4.5 it's still 0x.
 
@RMartinhoFernandes thanks, that works wonders
wow look at all these blatant errors MSVC10 never caught. I have constructors initializing members that don't exist
 
8:37 PM
Wut?
 
How could MSVC not catch that?
 
@Pubby never instantiated that template constructor I guess. Since I hadn't used it
 
@Pubby MSVC's template checking is thoroughly broken.
 
ping ping ping
 
8:50 PM
so what's the gcc option to specify name and location of output executable?
 
-o
 
hey, is there some elegant way to pack an integer into a char* ?
I.e. make 0x12345678 into [0x12, 0x34, 0x56, 0x78]
 
Is memcpy UB?
When using it like that
 
8:54 PM
What does UB mean?
 
Then why would union/reinterpret_cast be?
 
@NikiC Undefined behaviour.
 
@Pubby padding
 
@Pubby First one is just because it's explicitly called out as UB. Second is because of strict aliasing.
 
So it would be memcpy(string, &int, sizeof(int))?
 
8:57 PM
@NikiC depending on the type of string, yes
 
With & at appropriate places.
 
I thought the memcpy would break strict aliasing, or is it because to char* is allowed?
 
and you might want to tack on a string[4] = 0; after, to be safe
 
char buffer[sizeof(int)]; int x; memcpy(buffer, &x, sizeof(buffer));
 
@RMartinhoFernandes I'd tack on a NULL char for safety
 
8:58 PM
@Pubby memcpy doesn't break strict aliasing because there are two different objects.
@MooingDuck I wouldn't expect that produce a meaningful string, but people try to do strange things sometimes...
 
Oh, right.
 
@RMartinhoFernandes If I have a array of chars in any form, I put a NULL on the end to prevent stupid mistakes
 
@MooingDuck Sounds like a nasty bug if x contains a '\0'
 

« first day (460 days earlier)      last day (4491 days later) »