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

Ell
8:01 PM
do all intel/amd 32 bit processors have the same architecture? I'm talking about general purpose processors i.e. intel i3, i5, i7, pentium, celeron, etc. ?
 
Can anyone help me out with changing the entry point into a VS 11 C++ windows project? I have "stdafx.h" included in the same place as main is defined, and there are no other places where there is a main function. It tell me that it cannot find "stdafx.h" How can I tell VS where the entry point is?
 
yes
 
@Ell They're probably all variants of x86. So it should probably be similar enough.
 
it's called x86 for 32bit and x64 for 64bit
else, they could never all execute the same programs, as they only target x86 or x64
 
Ell
I was going to say, they must be identical unless my understanding was incorrect? or at least all support a minimum architecture
 
8:04 PM
yes, that architecture is x86
 
@soandos If you don't need precompiled headers, don't use them.
 
@EtiennedeMartel, I do need them, but I need the complirer to know where to look for the file that says that I am including it
It for some reason has a different file as the entry point (I think?)
 
Ell
Why is it x86 and not x32?
 
@soandos I think you're confusing "entry point" with something else.
 
they're all descendants of the original chip, the Intel 8086
I have no idea why it was called that
but Intel named their next processors 8186, 8286, etc
that's where the processor names of 386 and 486 come from
and hence x86 being the instruction set common to all Intel's processors whose model numbers ended in 86
 
8:06 PM
@EtiennedeMartel, so then what would cause "Error 3 error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source" As an error if it is in fact included in a different file?
 
Ell
I wonder if there are any open source processors
 
the lineage goes back to the 4004, an incredible 4-bit processor
then the 8008
 
ARM
 
Ell
aah okay
 
and then the 8080, which I programmed in assembly and Basic
 
8:07 PM
well, ARM is as close as you can get, anyway
 
@Ell They are very expensive to make, and this is hardware, not software....
 
@soandos If you use precompiled headers, you have to put #include "stdafx.h" at the top of every single .cpp file.
 
the 8080 begat the Z80 (from Zilog) and the 8086.
 
@EtiennedeMartel, thanks
 
@DeadMG you left out a 0. It was 80x86 for some reason :)
 
8:08 PM
@jalf aaah
 
the 8086 was one of 3 chips in that chipset. it was the main processor. there was also a math co-processor and an i/o co-processor. nobody used the i/o co-processor, as far as I know, but it was all modeled on mainframe architecture
 
close enough, anyway :P
 
@soandos VC++ simply ignores anything above the #include "stdafx.h" line.
 
oh man, game gear. A friend had one. Such an amazingly silly device
I'd completely forgotten about that
 
@EtiennedeMartel, ah, got it. Why is that?
 
8:10 PM
@ScottW oh. i programmed it in i can't remember. but it had a separate interrupt stack, and nice bit-level instructions; i do recall that. :-)
 
@soandos Probably a design decision.
 
well, the whole point of PCH is impossible if you don't
you can't precompile a header when it's contents could change at the flip of a #define, because the content isn't static
 
That make sense
 
oh yes, it was at college. we were doing a "house control" system, automatically turning on and off heaters and such. it was pretty advanced equipment: we used HP64000 workstations to develop the software, and cross-compiled for the Z80 single-board computer.
 
man
I need to get on and stop procrastinating about my render refactor
 
8:13 PM
Mostly at that time we had to use text-only terminals. There were a few graphics terminals but they were vector based. However, in my second year we got a few DEC Rainbow workstations, where we did color graphics in UCSD p-Pascal! Wow.
^ How I miss those real keyboards, not the doll keyboards of today!
 
@CheersandhthAlf That shit must weight 8 tons.
 
Yeah :) :)
 
@CheersandhthAlf Interestingly, professional PC gamers all use mechanical keyboards because of the improved feedback.
 
@Mysticial he he, congratz!
 
8:19 PM
lol
I feel like I've accomplished something. :)
 
Is there a portable way in std/boost for getting environment variables?
 
@StackedCrooked i don't think so. people have always answered "no" when i've asked.
 
Seems pretty easy to implement though.
// Can improvements be made to this API?
std::string GetEnvironmentVariable(const std::string & name, const std::string & default_value = "");
 
Iterating is something I hadn't thought about yet.
 
8:25 PM
@StackedCrooked getenv is C99.
It's also available to C++11. No idea for C++03.
 
Ok, I'll go with getenv then. I'm on OS X anyway.
 
getenv doesn't support default value.
Also, const char*.
 
@StackedCrooked it also gives this code:
19	    wstring environmentVar( wchar_t const* const name )
20	    {
21	        DWORD const bufSize = GetEnvironmentVariable( name, nullptr, 0 );
22
23	        wstring result( bufSize, L'#' );
24	        DWORD const nCharacters = GetEnvironmentVariable( name, &result[0], bufSize );
25	        assert( nCharacters <= bufSize );
26	        hopefully( nCharacters > 0 )
27	            || throwX( "winapi::EnvironmentVar: GetEnvironmentVariable failed" );
28	        result.resize( nCharacters );
29	        return result;
 
I'd wrap it anyway.
 
Xeo
On Windows you can have int main(int argc, char** argv, char** env) :)
 
8:28 PM
std::string GetEnv(const std::string & name, const std::string & def= "") {
    const char * res = getenv(name.c_str());
    return res ? res : def;
}
 
sbi
 
envp overload works on GCC on POSIX platforms, too, I think.
But those arrays are meh.
 
One main problem is that in Windows env carries ANSI-encoded text, so loses information (in general).
 
hmmm
to write a vector style wrapper over GPU vertex buffers, or not to write such a wrapper?
 
@CheersandhthAlf there's a parse_environment function in the program options library
 
Ell
8:34 PM
im setting up a cli only vm now so I can experience what you old fogies did ;)
 
@CheersandhthAlf That's quite bloated.
At least it looks at first sight. Could be wrong.
 
@StackedCrooked not really. it's the minimum you can do without making assumptions about buffer size
 
getenv returns a char * without any mention ownership. I suppose it is implemented using local static.
 
getenv returns const char*.
Oh, not in POSIX.
That's most likely pre-const-ism.
Or just usual POSIX stupidity.
 
Also, subsequent calls to getenv overwrite the previous return value.
Which is probably unavoidable.
 
8:42 PM
> As typically implemented, getenv() returns a pointer to a string within the environment list. The caller must take care not to modify this string, since that would change the environment of the process.
Perfect design.
Let's return non-modifiable string not marked as const.
 
Anyone knows where to find a look up table for converting x86_64 assembly to machine code?
 
the Intel website will posssess a reference manual that will document in excruciating detail it's binary code
 
To read contents between two specific words in a file, do we have any standard algorithm to do this ?
 
@CatPlusPlus Perhaps that made sense in an old computer culture where people prided themselves about knowing the subtle side effects of system calls.
 
It's not even a system call.
It cannot be a system call.
 
8:45 PM
I wouldn't know.
 
If system call returned char*, it'd point to kernel memory space.
 
@Mahesh A regular expression?
 
So what kind of call is then? A user space call?
POSIX call I guess.
 
At least I think so.
 
8:48 PM
In computing, a system call is how a program requests a service from an operating system's kernel. This may include hardware related services (e.g. accessing the hard disk), creating and executing new processes, and communicating with integral kernel services (like scheduling). System calls provide the interface between a process and the operating system. Privileges The design of the microprocessor architecture on practically all modern systems (except some embedded systems) involves a security model (such as the rings model) which specifies multiple privilege levels under which softwa...
I guess you're right.
 
@KillianDS Yes, thinking of to use Boost::regex. Just wondering any std::algorithm already exists to do this.
 
If you're using C++11 there's a regex library available
 
@KillianDS C++03
 
If you're not using C++11, start using C++11.
 
C++03? Use Boost
 
8:52 PM
At my workplace we're gonna get a 4 day C++ course.
Today I got segmentation faults because someone tried to cast a byte array to a ipv6 address object.
That's quite impressive.
Given that ipv6 class has polymorphic base class.
 
> singletons
 
So the course will be a good thing :)
@CatPlusPlus I knew this was gonna come up :)
 
@DeadMG I didn't get you.
 
@StackedCrooked I hope that didn't got into production code :P
 
@KillianDS It did.
Not released yet, of course.
Ok, so, not production code, if that's what you meant.
 
9:01 PM
@StackedCrooked I did (good you catched it in time :))
 
Ell
woohoo im learning norwegian! with memrise :D
 
9:14 PM
@StackedCrooked it doesn't look very c++11ish to me
 
@bamboon They are working on a C++11 course. They agreed to include some of it.
 
quiz°!
what is wrong with this c++11 struct A { }; A a; A b{a}; code?
 
nothing?
 
no there is something wrong!
 
you get unused variable warning :p
 
9:18 PM
nono
really a compile time error
 
The copy constructor doesn't allow the {} syntax?
 
In that case it has something to do with A being empty.
 
it has nothing to do with A being empty
 
error: too many initializers for 'A'
 
9:21 PM
Aggregates ruining everyone's day once again?
 
sbi
If you like M.C.Escher (and which programmer wouldn't?), you need to watch this video. Make sure you watch it in high-quality, if possible.
3
 
@sbi std::find(argv[0], argv[argc], algorithm); // argv => wchar_t *[], algorithm =>wstring. Does std::find support it? Just out of my head. Didn't check it.
 
@sbi music is awesome :)
 
sbi
The first two arguments to std::find() need to be iterators. IIRC, the third must be of a type for which there must be a comparison operator must be defined that works with whatever dereferencing the iterator yields. ICBWT.
 
9:33 PM
@Mahesh std::vector<std::wstring> args(argv, argv + argc);
Don't use that ugly array longer than necessary.
 
sbi
@MrAnubis The music is good, but when you like M.C.Escher, the film is great. I especially like how that familiar pic with the small saurians first is 2D, and then suddenly is 3D, and then one of them lifts its head and puffs some smoke. That is just plain awesome.
@CatPlusPlus If all you want to do is iterate over the arguments, what do you care whether the iterators point into a C array or a std::vector?
 
@sbi Already downloading (my bad download speed :( ) , just heard the buffered music.
 
It converts to std::wstring at the same time.
 
@sbi int myints[] = { 10, 20, 30 ,40 };
p = find(myints,myints+4,30);
The above code is valid. Why doesn't in the same way work for my previous example ? I see operator == overloaded taking arguments of type wchar_t* and wstring in wstring class.
 
And vector is more comfortable to pass around.
 
sbi
9:38 PM
@CatPlusPlus What for?
 
Comparison, for one.
std::find won't work with pointers without == overload or custom functor.
And it remembers the size and stuff.
 
@Mahesh You used argv[0] and argv[argc], which are not equivalent to myints and myints + 4. Try argv + 0 and argv + argc.
 
sbi
@Mahesh You haven't said it wouldn't compile. How about you post the actual code, plus the exact error message, plus your compiler version, preferably on SO proper.
And please stop pinging me. I'm not your personal support team.
 
@Mahesh argv[0] is cstring pointer , when incremented , it points to next char of cstring argv[0]
 
@sbi I don't have a compiler. Just going through the standard docs.
 
9:41 PM
@Mahesh Ok...? We're not compilers either :)
 
@sehe lol
 
sbi
Well, FF is becoming almost unusably slow, so I will have to restart it. Also, my OS had been begging me to install some updates for at least a week now. I guess I will have to bite the bullet and restart this whole machine. How I hate that.
 
I sometimes reboot to get a little break at work.
 
@sbi thanks! Some more videos in the same genre on youtube when you look through the related vids (some by the same studio). "Isfahan" is quite amazing too
 
10:32 PM
-3
Q: Linux vs Windows: Execution Speed

ShibliI have a code written in C++ with VS 10 and running on Windows. I wonder if I work with Linux, would execution speed increase? Additionally, which distribution of Linux should I prefer if the execution speed is the only concern?

"Hmm, haven't seen much windows-linux flamewars here on SO. I will start one to spice thins up a little bit. Linux is clearly faster, everytime." – drhirsch 1 min ago
 
It isn't off topic IMO.
 
It would've been closed as Not Constructive... dunno why it ended as Off Topic.
 
@Mysticial Linux timers measures cpu time, windows wall-clock time. Windows timers can't be faster during any given time. In the clock() case at least.
 
But I think these questions do have value. There probably are interesting differences between these platforms that relate to performance.
 
@CaptainGiraffe You should post that as a comment on that question. :P
 
10:36 PM
sex
oh sorry
 
@Mysticial I should, I saw it after it got closed
 
wrong place :P
 
@StackedCrooked There definitely are, but they aren't noticable unless the code it littered with system calls.
@CaptainGiraffe You can still post comments on closed questions.
 
@Mysticial Still its a minus A lot question; so I doubt my comments value.
 
The x64 calling convention in Linux in better than in Windows. But Window's shared library system has less overhead.
 
10:38 PM
@TonyTheLion Relax, we're used to you sexdumping here
 
@Mysticial sounds about right for a summary of us c++ afficionados
 
lol
hahah
puppy your gravatar isn't loading
 
I find that applications launch very slow on my Ubuntu. Launching simple apps like TextEdit, Terminal or Google Chrome often takes 5+ seconds.
I wonder if it has to do with dynamic linking.
 
oh now it is
lol
 
I wonder what the sexuality.SE chats looked like?
Oh wtf? It got closed down?
 
10:40 PM
@StackedCrooked Most likely, you've modified your ubuntu installation, or trying to run gnome apps in a non-gnome desktop environment?
 
Clearly programmers don't get enough sex...
 
Do you know of any case where getters setters, java / c++ or Properties C# style has saved an "implementation detail" being exposed to the API?
 
I got offered a project for iOS
 
@sehe I switched from Unity to Gnome (which is installed along with Unity).
 
wondering if I should take it
 
10:41 PM
hi all.
 
even it's just to get experience
 
@sehe I also changed some settings to resemble to old look-and-feel more.
And I experimented with prelink.
 
@StackedCrooked I have 6+ year old gear and I'm not that slow. I do KDE or xfce though
 
@StackedCrooked I've got similar symptoms. Always assumed it has to do with gnome services not being there - not responding (think session, dbus, bonobo :))
@StackedCrooked, really, my solution is excruciatingly simple: I don't use those gnome apps that require this :)
 
Usually Ubuntu is very fast when it's a fresh install. But it doesn't stay that way for long.
 
10:42 PM
@StackedCrooked Not true for me. I'm a speed freak and won't have a slow PC for a minute.
 
A colleague of mine swears by Gentoo.
 
@StackedCrooked I noticed this last install when I had been procrastinating the upgrade because of Unity G3, that a Documents mount really helps
 
My ubuntu installations last for well over 1.5yrs - especially now that they try to dump their unity shit on me :) I'm still evaluating Mint or straight Debian, but to be honest, I'm too lazy to decide since my Natty runs so smooth
 
@sehe Different words. Same sentiment.
 
@StackedCrooked Don't go there. Gentoo is a perfect time waster and wonderful to learn about how stuff works. However, for real life, I won't go through all the hassle, unless I decide to (apt-build, apt-get source --compile etc.)
 
10:44 PM
@sehe Same here. Currently using Ubuntu with Gnome 3.
 
night night
wish me luck in actually sleeping instead of "ARGH MY STOMACH"
 
@sehe Yeah, I don't feel like spending a whole weekend setting up a system.
 
@DeadMG My sympathies. Good night
 
@DeadMG Good luck.
 
you shell/bash/ksh/csh guys, did you ever want to do "cat stuff | lpr" just to realise you would like margins on that sucker?
 
10:48 PM
@StackedCrooked: I think I just found out what causes my gedit to delay. It has recently used files that refer to network locations that aren't available at the time
 
Hm, I may have that as well.
 
@StackedCrooked Not a likely delay.
 
@StackedCrooked That should be it. I noticed by doing strace gedit (it would do something like
[pid 10410] stat("/home/sehe/Downloads/NZB",  <unfinished ...>
[pid 10412] <... futex resumed> )       = -1 ETIMEDOUT (Connection timed out)
[pid 10412] futex(0x2379b30, FUTEX_WAKE_PRIVATE, 1) = 0
[pid 10412] futex(0x7febc0005464, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, {1330642062, 498086000}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
with the futex wait taking very long
 
A faulty intermittent connection maybe but not a gone one.
 
@CaptainGiraffe What do you mean? If the ip link is gone, it will be fast. Otherwise, it will try to reach the server. My config of nfs shares obviously delays, because I can see it happen :)
 
10:51 PM
I actually always open a shortcut to a network file, however in my case the file is available.
 
@sehe Is gedit doing the networking or is it a mount?
 
@CaptainGiraffe it is a mount
 
Chrome allows you to click open on a file while it is still downloading. This way it will be opened right after download. It's like a std::future.
 
@sehe Then my head is not enough (007 style) to think this would cause a delay.
 
10:54 PM
@StackedCrooked Opera will actually be downloading the file while you are still browsing for a location or choosing where to 'Open' or 'Save' :)
 
@StackedCrooked We all saw it and chuckled =)
 
@sehe I think Firefox used to do that as well.
Silliness.
 
@ScottW You must be new to the Internet. Sit down have a seat, don't be that upset.
 
Hey now, don't make assumptions about Scott.
Arrg, Unity excels at sucking.
 
sudo apt-get install kubuntu-desktop
IANAL
 
11:01 PM
I am not a lawyer?
 
That was not legal advice =)
It might not even be correct in syntax
Also backup! =)
 
I'm just installing a new Ubuntu 11.10 VBox so that I can use gcc 4.6.1.
 
Hey I run 4.6.1 =)
g++ (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
 
Now compile with -std=c++0x :)
 
A student of mine was fancy with the new initializer code, while preparing for his presentation today.
He was kinda surprised when it didn't work without the -std=c++0xx switch =)
 
11:06 PM
ohhh legs
women's legs
 
@CaptainGiraffe in my experience, kde is just a bit more bloated. It makes fewer assumptions, but loading any KDE app used to be excruciatingly slow because it would memory map all icons on each lounch, and stat-ing thousands of files in the process.
Meh. I ditched KDE when they switched to 'KDE4' (really: we threw everything, sorry to have you wait while we play with our toy DE)
I learned I can live without the frills - less distraction, less dependencies and more speed. Gnome used to fill the gap - it'll be XFCE soon, I guess
 
Yes KDE4 was a rag, but now with 4.6+ im quite happy.
xfce++
 
@CaptainGiraffe the visual style still turns me off, but maybe my taste has changed. I don't need 3D looks, glassy effects or transparencies. I do use compiz so I can make any window translucent 'just so' at my discretion anyway
 
@sehe I redid a lot of the xml!!! files in my current config.
 
Harhar! I just noticed that people who are on my ignore list will have their gravatars diminished in the 'current user' area on the right. Nice
 
11:11 PM
What happened to line based text being the greatest format of all times?
 
@CaptainGiraffe huh. what is with the exclamation marks
 
@sehe why the xml of course?
 
@CaptainGiraffe yeah. XML, supposed to be simple. Unfortunately, as with most abstractions, this one was a spectactularly leaking one
@CaptainGiraffe I suppose a similar reasoning would explain the presence of that question mark then 8) - /rolls eyes/
 
Its almost like the getters and setters all over again. The only one that gets this stuff right is Roy Fielding, and maybe Tim.
 
I think I'll rewatch Contact.
 
11:14 PM
SOAP is the joke of the century. It's when a few committees from a consortium spends years 'designing' a Simple (<-- lol) Object Access Protocol when stuff like WS-EX happen
 
Dear Sehe, I am not a computer. I can't pass the Chinese room test.
 
@CaptainGiraffe dunno who these are
@StackedCrooked Jodie Foster? I think it's the one about SETI?
 
@sehe Yep.
 
@sehe ++agreed
@sehe Yep the Carl Sagan novel
 
I remember seeing that move for the first time. It found it breathtaking. It was the first time I saw a movie that actually discussed the topic of extraterrestrial life intelligently.
 
11:15 PM
And then the restful rastafarians smoothly overtake them without breaking a sweat.
Catapulting javascript in the process. Gotta love the irony
 
@sehe Yep, brown fighting mauve =)
@sehe Actually I thought serverside Node.js would make a difference. I'm still a sad puppy.
 
@CaptainGiraffe I'm sorry, but again you completely lost me with, presumably, an external reference? brown? mauve?
 
gotta go stuff are blowing up near me.
 
@CaptainGiraffe Hope that isn't too dangerous?
 
False alarm, just really Huge snow clearing mobiles, strutting their gear.
 
11:20 PM
@CaptainGiraffe hehe
 
They
took me by surprise
@StackedCrooked This time I was quick enough to star it =)
 
Alright.
I don't mind.
Just thought my joke was little too silly.
 
One mans dirt is another ones gold =)
For the record: That was not gold in my opinion.
 
One upvote to +100.
Because some idiot downvoted some time ago without explanation.
 
@CatPlusPlus ?
 
11:25 PM
Waaaaaaaaaaaaaaaaaaaaaaaaaaah.
99
A: Python datetime to Unix timestamp

Cat Plus PlusAnother way is to use time.mktime: future = datetime.datetime.now() + datetime.timedelta(minutes=5) return time.mktime(future.timetuple()) It's also more portable than %s flag to strftime — latter is not supported on win32.

 
@CatPlusPlus there you go. saw that answer earlier. Thought it had enough votes :)
 
> My friend told me I don't understand irony, which was ironic because, at the time, we were waiting for the bus.
 
@sehe Now it does. Thanks!
 
Hehe. I can remove mine. It was now at 101 :)
 
@CatPlusPlus I should have known you were a Tabby
 
11:27 PM
Yes, I do have a lot of tabs open.
 
@CatPlusPlus who doesn't. why would that make a tabby - whatever it is
 
It's a cat species (or whatever the proper term is). And it was a silly play on words.
 
@CatPlusPlus oh that way
 
@sehe Python uses whitespace instead of {...}
 
@CaptainGiraffe: lay off the booze. You're really off the charts
 
11:33 PM
@sehe Yes, I'll see myself out.
 
hi @je4d
 
@sehe ello ello
 
@ScottW scary
 
Wee, badger.
 
damn, I need faster interwebs... that video in sbi's starred message is loading at about half realtime
 
11:44 PM
I downloaded it with Firefox Video downloader addon.
 
Now I have "lay off the booze. You're really off the charts" and "haha what?" and "her leg in that photo has been receiving attention, I thought somebody making a twitter of it was kinda funny" and I have no idea what you are talking about.
@ScottW regular internet stuff
 

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