« first day (278 days earlier)      last day (4673 days later) » 

2:02 PM
Hi all ! What a tough day yesterday was ?
Amazon interview !! Tough luck ;)
 
Yesterday was just fine.
How did it go?
 
It made me understand how tough it is to make some one understand what I am thinking over a telephone.
 
Language issues?
Or just regular communication trouble?
 
No, algorithms
Language ... No barrier
 
2:18 PM
I'm going to "create" this thing I'm going to call the Global Variable Pattern. It's a pattern that is used when you want something to be accessible everywhere. It's rather easy to implement. You just drop a line Foo foo; somewhere in a namespace, and you're done.
 
You need a fancy name.
How about... globleton.
 
No, no, that might give the wrong idea. You don't want a ton of those things.
 
Glingleton?
 
Where did that come from?
And it still has the -ton part, which I'm trying to avoid. I think that is a subliminal message in the "singleton" name to make people use tons of them.
 
@MartinhoFernandes Well, from mingletons, fingletons and hingletons.
 
2:40 PM
 
Is that why you stopped smoking?
 
lol
you'd have to be certifiably insane to start, imo
 
hahah
well, I guess...
 
but then
I guess you could equally argue that you'd have to be certifiably insane to become overweight
 
2:45 PM
smoking is awesome
i miss it a lot :(
 
smoking has no value to the end-user, the cigarette literally goes up in smoke and the remains thrown away
in exchange for your nothing, you get an early death
 
your comment has no value, you were never a smoker
 
it gives me an objective view point
 
still, from the outside
 
if I was a smoker, my opinions would be influenced by things like, addiction to nicotine
 
2:47 PM
CREATE PROCEDURE Foo
	@Blah int,
AS
SELECT TOP 0
	'' AS [Bar],
	'' AS [Qux],
	'' AS [Fred]
GO
Just found this in our database (names changed to protect the not-so-innocent). Awesome.
 
lol
 
@jalf I asked a question about the localization thing
 
now, if you'll excuse me
I'm going to go and feed my addiction to sugar in a completely value-less way
 
oh and what are you going to stuff down your throat?
 
2:50 PM
the only brand of chocolate bar that's still safe to eat
 
oh I see
lol
 
^^
it's one thing to waste your life eating too much chocolate when there's lots of normal variety out there
and quite another when you have only yoghurt and spaghetti and beans every day for months
 
I guess yea... I live in the country that is renowned for chocolate and I hardly ever eat it
 
Chocolate is awesome.
But cocoa is addictive, apparently.
And if you stuff your face with it, you get fat.
Seems like there's no tasty food that can be eaten without problems :(
This world sucks.
 
You should see me with a bucket of KFC. It's like a scene out of New Jack City
 
2:57 PM
Oh great, the guy that was supposed to have written that stupid stored procedure (which I'm supposed to call from my code) is not around.
 
maybe he's waiting for KFC to open
 
@MartinhoFernandes I think it's more or less the sugar that accompanies cocoa that causes weight gain.
Also, chocolate doesn't inherently contain sugar
See baking chocolate.
See it, but don't eat it please.
Baking Chocolate: Consumer Warning: Don't eat this, doesn't contain sweeteners. AKA, it's nasty.
 
3:12 PM
so then
I guess now I'mma have to write a custom parser
 
Tested all the corner cases of your lexer?
(I don't think there are many, though)
Btw, you ended up using the WinAPI?
 
I stuck a few tests in and they seem to be working just dandy
yes, I did
I read the whole thing in at once with ReadFile
much faster, I got the characters I needed, win/win
 
win/win with the WinAPI :)
Not portable, though.
 
meh
I never was going to write a portable first implementation
more likely, I'd bootstrap the language on Windows and then write a compiler in portable "DeadMG++".
 
Hah. And how do you compile that portable DeadMG++ if there's no compiler anywhere else?
 
3:16 PM
if I could be bothered :P
cross-compile?
if I can cross-compile between x86 and x64, I can sure as hell cross-compile between operating systems
 
Oh right.
Can MSVC cross-compile to other platforms?
 
Itanium, x64
at least
 
Well, you're going to translate to C++ and feed it to a C++ compiler right?
 
I'm not sure
I want to do that, but I'm quite concerned
some "DeadMG++" concepts won't go across so easily, and it could take a very long time
it would be much easier to LLVM-generate the code
but I do definitely want to be able to load C++ code, instantiate C++ templates, inherit from C++ base classes, and that malarky
which is the hard part
 
3:21 PM
I mean
I was going to get away with no name mangling
at all
if I could LLVM-compile
 
Clang produces LLVM output right?
 
yep
I've been thinking about that possibility
actually
i.e., see if I can hook in an existing C++ compiler
the thing about that is
it would screw my plans for some kinds of code :(
I'll worry about code-gen after I've done parsing and semantic analysis
and there's plenty of both to be done
 
@DeadMG you should take a look at the lexer used in LCC. Although it's in C the approach is similar to that you're using in the while block of your lexer
 
on earth is LCC?
 
@DeadMG lcc, A Retargetable Compiler for ANSI C - sites.google.com/site/lccretargetablecompiler
 
3:33 PM
well
my lexer's finished, as far as I can tell, it's the parser I need to write now
 
thought you still had to deal with literals and identifiers
 
I have done identifiers and some literals
the other literals I'll worry about later, they aren't really needed
 
ah. was going by the comments from your post on CR
nvm lol
 
yeah, I updated the code
do you like my lambda approach? I think it's awesum
who needs classes
 
What lambda approach? I don't see anything.
 
3:36 PM
I mean, the lambdas I defined to re-use the logic without having to write a class or member function
 
yeah I've got the CR post bookmarked...still need to fav it
it's neet-o lol
 
2 hours ago, by DeadMG
[](){[](){[](){}();}();[](){[](){}();}();}();
 
it was certainly a new idea for me, anyway
 
lol
no
talking about my lexer code
I posted the full thing up on codereview
 
3:38 PM
Ahh.
 
ugh. that lambda made my head hurt
 
which one?
 
the one from a couple of hours ago martinho just referenced
 
ah that
well, it would be perfectly readable if you indent it :P
 
To be honest, I'm not a big fan of functions that can't fit my screen.
So, I don't really like that trick with the lambdas.
 
3:42 PM
it can't fit on your screen anyway
at least with the lambdas it's all used in one place
if I had to define member functions, they'd be all over the place
 
But they are all over the place. Except in the middle of other stuff.
 
they're distinctly limited to the scope in which they are used
 
Well, it's a tradeoff. Personally, I'd sacrifice the scoping benefit for the readability.
 
1
Q: Are multiple sequential array access optimised?

NickWill C++ compilers automatically optimise the following code to calculate 3*i only once, and increment the result, or must the programmer code this? void writeToArray(int i, int a, int b, int c) { array[3*i][1]=a; array[3*i][2]=b; array[3*i][3]=c; }

 
ugh really?
@0A0D sometimes I just have to bite my tongue or I end up saying things like "No. You have to enable optimizations first"
 
3:57 PM
What's the "canonical" dupe for "Why can't I implement templates on my .cpp files?"
 
dunno, I think there's a FAQ for it
 
@ChetSimpson People seem to worry about optimizing alot on SO. Seems to be a newbie question
 
Yeah, found it.
 
@0A0D it is a newb question
 
It's not just on SO. I think this is a common newbie concern.
 
4:01 PM
one of these days I'm not gonna have much tongue left
 
You know you can bite your tongue without tearing off pieces, right?
 
yeah but it never used to be like this. only started when I quit smoking tylonol
 
@MartinhoFernandes Yes, so much worrying. Just dive in ! :)
 
With time they learn to trust the compiler and worry about correctness and maintainability first. We have to nudge them towards that.
 
would u guys mind helping we with a quick pseudo-code question. its for a job and i have the answer i just wanted to see if someone can confirm im right
 
4:09 PM
www.stackoverflow.com
 
ok thanks
 
@DeadMG you bandwidth waster! It's just stackoverflow.com
 
sorry, My Lord
 
In the future, bandwidth will be the new oil.
 
Als
4:13 PM
eh....the tiger is back @TonyTheTiger
 
Quote me on that if it ever becomes true. STFU if it doesn't.
 
Als
Hello folks
Anything interesting happenings for the day?
 
Today is the 2367th anniversary of the burning of the Temple of Arthemis at Ephesus.
 
Als
@MartinhoFernandes: I was just about to wonder if I was alone out here, even if it showed ppl online..... Great! not that I understand anything of that burning
but interesting that you took time to find it...wikipedia eh?
 
Als
4:18 PM
btw, when does the c++0x actually rolls out?
 
When everyone finishes signing it off... The ISO site sets the expected publication date at 28-02-2012.
 
When ISO finishes the paperwork.
 
Als
I know it's just a formality since the final draft has been already finalized, but when does it come out formally? mid of 2011 was the earlier timeline
 
Like I said, the "official" expected publication date is 28-02-2012.
 
Als
& whats with the final draft being removed after initially being made available for free?
@MartinhoFernandes: That answers, so 2012 it is
 
4:20 PM
No idea. I snatched a copy to my hard drive beforehand :)
 
@Martinho same here. glad I did
 
Als
Its still available there on loads of mirror websites :)
 
Rob
Hmm, does anyone have a mirror for that?
 
pretty sure it's available via a torrent
 
what isn't?
 
4:22 PM
@Rob I think Google has one.
 
Als
naah even on loads of websites
and i think its not illegal since it was obtained by someone legally when it was free
 
@Als as long as it isn't bound by a copyright it's legal
 
Rob
Heh @MartinhoFernandes , I wouldn't have asked if I hadn't already looked
 
Everything is bound by copyright.
 
Rob
keeps searching
 
4:24 PM
In most countries copyright is not opt-in, it's opt-out.
 
Als
Maybe
Its not legal but the definition of legal on copyright varies across countries
 
It all depends on whether you have rights to distribute it.
 
Als
besides there are no of hostings and websites which are still having the link to it
 
And of course, IANAL.
 
well I never thought you were a llama
 
4:26 PM
I'd rather be a llama than a lawyer.
 
Rob
Copyright doesn't matter in this case anyhow, should fall under fair use in most countries
 
Als
And well, If you didn't want to provide it for free, why bother putting it out for free in the first place?
 
Rob
Unless you begin to redistribute of course
 
@Rob I can find one in the first page of Google results for a fairly obvious search.
 
should still be up on open-std.org
 
Als
4:28 PM
@MartinhoFernandes: :)
The more you restrict the more people revolt!
 
revolting takes too much energy
 
Rob
@MartinhoFernandes, yea... I just used a bad search query... FDIS N3290 did it
 
@ChetSimpson Yes, if you can authenticate.
And for the record, I ran that search for statistics only :)
 
Als
haha
 
I don't really see the value in it
 
4:29 PM
lol
 
0
Q: Is it better to blindly match the project requirements or to match the spirit of the project requirements.

XaadeYou know what they're asking for. You know what they really want. However, technically the way they wrote it is with a litmus test of requirements that don't match what they want because they don't understand what they're asking for. Should it be a part of our job to match the spirit of the requ...

 
it's not like there's not already enough information about C++0x out there
 
Well, it's the standard text. It's got to have some value.
@Xaade Talk to the customer?
 
@Xaade What exactly is "it" that "they" wrote?
 
@Als At least from what I've seen, the committee itself would rather it was free. Many of the standards bodies make most of their money by selling the standards. The committee does what it can to make it all freely available, but they still have to follow the rules.
 
Als
4:35 PM
@JerryCoffin: I agree, but putting it out there for free initially, and then suddenly retracting it was a fiasco that could be avoided
I believe the fact that they retracted it added more fuel to the people's want of having it
 
@ChetSimpson Well, there's some conflicts with windows interpretation of color and the standard color scheme that we're suppose to use. Certain controls ignore color in certain states and it's outside my ability to resolve this. I can't do anything in this case, but I'm just wondering for future reference if I ever have more control over the situation.
 
So in other words they gave you a function requirements spec
functional*
or did they give you a program requirements spec?
 
What value is __cplusplus defined to in C++03?
 
Als
should'nt just #define __cplusplus suffice?
 
@ChetSimpson reflex requirements (expectations)
 
4:51 PM
@Als No, it's pre-defined. The standard mandates it (16.8 in the FDIS).
But I see the FDIS defines a know value for it 201103L.
I wonder what that value was for C++03.
Oh, wait, that's easy.
 
Als
@MartinhoFernandes: Ah okay, I get the reference where you are coming from now
 
Hmm, maybe there was no value mandated.
 
Als
@MartinhoFernandes: Yes, you proved it :)
 
Well, it could be that it was either mandated to be 1, or that's just because GCC implements it like that.
 
ok
I realized that I have no idea how to write a parser
:P
 
Als
4:53 PM
@MartinhoFernandes: Pedantic detail IMHO
 
@DeadMG haha.
 
Als
It is also used sometimes to avoid some compilers optimizing virtual function call. someone posted that in reason for using this
and I cant relate...
 
that's because that's BS
 
Gimme a link, I've got downvotes.
4
Q: Detecting C++0x mode on Intel C++?

uj2Does Intel C++ predefine some macro when compiling with Qstd=c++0x? Something like __GXX_EXPERIMENTAL_CXX0X__ in GCC? __cplusplus is still 199711. Any way to detect C++0x compilation?

 
Als
@DeadMG: I thought so, but just refrained the strong word for maybe I was missing something
 
4:56 PM
This question mentions __cplusplus having the value 199711.
Hmm, and GCC isn't yet conforming with C++11: ideone.com/eJi4X
 
Rob
@DeadMG : character by character. :P
 
@Rob No that's a lexer.
A parser would be token by token.
 
sounds like a sitcom
 
Rob
I consider the lexer a smaller part of the parser, you have to get the tokens somehow ;)
 

« first day (278 days earlier)      last day (4673 days later) »