« first day (432 days earlier)      last day (4742 days later) » 

Xeo
Xeo
11:00
And finally here.
Gotta love things that work with "unique technology that does something wonderful".
Given template <typename T> class blah { void f(); void g(); } I can specialize just f without writing a full class specialization, right?
Xeo
Xeo
Only inside the class
no wait
No, I don't think you can specialize the members at all without specializing the class
could you not do some sort of sneaky having that function part of a separate class so that it can be specialised for the type, but the main class is not specialised?
Hello all , I'm having a weird problem I was hoping someone could help me with
I have written a piece of code where I am opening an Input stream
std::ifstream fileInput(sourceFile.s_fileName,std::ios::binary);
but this line gives me a compilation error saying that there is no matching function ! I dont get it , this worked fine on my Windows machine and it doesnt on the Mac I am using now !
11:12
What's the type of s_fileName?
Its a standard string
std::string? For some inscrutable reason, std::ifstream doesn't have a constructor taking a std::string :( That's a Microsoft extension.
You need to pass a C string with .c_str().
@RMartinhoFernandes "incrustable" what a word
@thecoshman Oops.
@RMartinhoFernandes nope, that's a C++11 thing.
11:15
Fixed now.
Xeo
Xeo
@RMartinhoFernandes Seems C++11 does!
@RMartinhoFernandes !! So it would work on my windows machine because of the fact that Microsoft has extended the library in some way , but not on the Mac ?
Xeo
Xeo
@rubenvb Yeah, but MSVC supported it before that
@rubenvb Ah, kewl
@Xeo and they have std::wstring overloads as well
Xeo
Xeo
11:15
@angryInsomniac Update you stdlib on your mac or compile with -std=c++0x
@RMartinhoFernandes how is that fixed? incrustable is an epic word!
@thecoshman Yeah, but wrong.
@rubenvb Ahhh , hearing way too much about C++ 11 today, where can I read up more about this ?
I meant "inscrutable".
@RMartinhoFernandes yeah, but epic ¬_¬
Xeo
Xeo
11:16
afk breakfast
xmas shopping? pfff ya right, today is for writing NEON asm code. moar speed! 60fps or gtfo
hmm
Xeo
Xeo
Or rather, lunch
I need to go shopping today :(
@Xeo brunch perhaps?
Hearing way too much about C++ 11 today, where can I read up more about this ? (Anyone ?)
11:17
@angryInsomniac There are a couple links in the tag info.
For a start: http://en.wikipedia.org/wiki/C%2B%2B11
For a more decent read: http://www2.research.att.com/~bs/C++0xFAQ.html
For the read of a lifetime (literally): http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372
@angryInsomniac what's to know? its now what standard C++ is. Came out this yeah... has a lot of great features that where missing for a while
any way... meeting ¬_¬
Aug 2011 ? This is quite recent ! I'd hope that there are some tut's or something to update my stdlib !
@angryInsomniac Yeah, but compiler support has been rolled out gradually for some time now. MSVC has some support, and both the latest GCC and Clang versions have very good support.
@angryInsomniac On Mac you're in luck, use Clang and -std=c++0X -stdlib=libc++ with the latest XCode for best library support. For best compiler support, you'll need to get a hold of GCC 4.6 for now.
Is there any active effort in Boost for a GUI abstraction?
All I can dig up is some old mailing list postings with opinions
11:25
Not that I know of.
It'd be interesting to see how a decent GUI API would look like.
I'd guess they should heavily piggy-back on Boost.signals for the event handling
and essentially all other "subsystems" included in Qt/wxWidgets/etc... are already in Boost in a better form, so it should be possible
@RMartinhoFernandes ?
11:45
fileformat.info has a "Google+1" button for the Unicode character "GREEK SMALL LETTER MU". I'm tempted to push it.
well, dang. Boost.Signals is thread-unsafe. Go figure...
There's signals2.
yo bitches
yo asshole
mmmmm, expression templates
DeadMG loves you
11:56
Oh, flags.
Xeo
Xeo
I hope that idiot doesn't come here
Yay, all my flags got me 7 or 8 flag weight.
That badge will take forever.
Xeo
Xeo
Hell yeah.
698 flagweight
usually people flag me, not the other way around :P
Xeo
Xeo
-7
Q: "fake search engine" with displaying only paid ads

user903794Hey does anyone know how some one would go about creating a "fake search engine" with displaying only paid ads using google as the search engine in the back ground. I'm looking for tutorials or just the php script that will take a query and search google and display the top 3 results?

lol
cpx
cpx
@Xeo Oh I missed it.
@Xeo Now I'm wondering if Ripley said to nuke'em before or after meeting Newt. I'll have to watch that again. You just cost me two hours of my life.
@rubenvb how about boost.signals2
Slowpoke.
Xeo
Xeo
12:21
5
Q: What's the meaning of "Deine Mudda"?

BuxmeIn germany, i hear a lot of jokes containing "deine Mudda". I don't understand them, what does this mean, and what kind of jokes are containing them?

Ahaha
Argh, having to type erase shit is annoying.
what are you doing?
12:38
Trying too much to make my API look neat.
Way too much.
hmmm, I have a problem
Syntactic contorsionism could be an accurate description.
@DeadMG Shoot.
@sehe yes, missed that... apparently :/
exception class depends on string class for definition, string class depends on exception class for malformed unicode errors
ah I should stop being lazy and just move the implementation into a .cpp file
lol
You can keep in the header. Just define something out-of-class.
12:40
IIRC that is declared as const char* what() throw() for reasons like that (and exception safety :))
Returning a std::string reference is exception safe.
Yeah. My guess is that it they deemed it even safer to return const char* :) They can be statically defined (data segment shit)
Bit silly to have to construct (and keep as a member) a std::string, so that you can return a reference to it.
If we had immutable strings...
We'd be singing in the choir of Java and C#
And many others of course
My point is, we have immutable strings.
12:43
constexpr std::string? Haven't tried it yet
std::string const. They just need that extra kick of compiler magic to be interesting.
const char[]
Xeo
Xeo
The extra kick being?
Not being a boring string, likely
The extra kick is - of course - already that you can now embed null characters in exception messages. YAY!
@Xeo The abilities of character arrays: that static initialization thing.
Xeo
Xeo
12:44
Ah
O shit, std::exception doesn't support it :)
std::exception is an interface rather than concrete class
And no, const char[] doesn't cut it because then you need a schizophrenic API to use them.
BTW. I missed a const there. const char* what() const throw()
Xeo
Xeo
Really, std::string needs support for not allocating memory when you initialize it with a string literal and want to keep that string immutable.
12:46
@Xeo Exactly.
(but VC++ thinks that it's concrete class)
@Xeo imo you need a completely separate string class for that
would be silly to cram that into std::string
Xeo
Xeo
Nah, the world runs on std::string, no need for another one.
@Xeo sounds like CoW
the problem is that std::string is much too big a class. Nearly all its functionality should've been free functions, so it could be applied to other string implementations too
Xeo
Xeo
12:47
@Abyx immutability says you can't write
@Xeo honestly, no, the world runs on char*
3
Yay, chat-vim.
Xeo
Xeo
d'oh
@RMartinhoFernandes const char (&what())[256] const throw() - something nice and inflexible like that
@Xeo std::string can't know if it's const
Xeo
Xeo
12:48
@Abyx Eh? Of course it can
Xeo
Xeo
void foo() const; // can only be called on const strings
@Xeo But constructors can't know that.
Unless you add a manual parameter.
Xeo
Xeo
user-defined literals and a special ctor
That would be sweet.
12:49
@Xeo and a special class implementation, and a special interface
that's what the rest of us would call a separate class
Xeo
Xeo
UDLs can only be added to real literals, so no chance of abuse
@RMartinhoFernandes What, do you use vim to chat?
cpx
cpx
-2
Q: Is it OK to program in bed?

user10264531Do you lot sit with PCs on the bed or do you sit on a chair while programming? I usually sit with my laptop computer on a bed where I sleep. Is this a good practice? Do you ever feel lazy and then feel like going to sleep? Do people around you believe that you're always sleeping while your studyi...

lol
Xeo
Xeo
constexpr std::string operator "" _s(char const* lit, size_t size){
  return std::string(lit, size, std::string::literal_tag());
}
and
@cpx personally, I prefer programming on a boat
also, please tell me that question is intended as a joke
12:51
Boat programming is awesome.
cpx
cpx
:s
Xeo
Xeo
constexpr string(char const* str, size_type size, literal_tag)
  : str(str), size(size)
{}
@sehe lol, actually... yes
Xeo
Xeo
That should be all that is needed
12:52
hah. vimperator and muttator never did it for me. I use ViEmu for VS2008 though. Still regularly open a vim window to do .. real work :)
> You are not likely to find a job where they let you bring your bed in to work.
lol
cpx
cpx
lol
I'll ask that in my next interview.
@RMartinhoFernandes I find that I'm orders of magnitude quicker with Opera's 9.2 single-key bindings than the not-so well-panned-out mappings of vim-keys onto FF/Thunderbird.
But I'd very much like something like It'sAllText for Opera that will turn any input box into a Vim editor
12:56
@sehe Opera's Shift+Arrow link navigation is awesome.
and qa/QA, ws/WS, zx/ZX combos, /incrementalsearch (why the F**CK doesn't Chrome have it?) 1,2,3,4,5, C-S-n (dup), C-A-z (undo close), etc etc. BUt I take it you use FF since you mention Vimperator
KerrekSB uses Opera, IIRC
Arrgh, stupid GCC, that lambda is calling a static function, I don't need to capture this.
@sehe I wonder if there's an extension or something for incremental search...I find myself pissed off daily that I need to stretch all the way to ctrl-f to do a simple search.
Xeo
Xeo
I'm missing message editing more and more in IRC -.-
13:11
has anybody used gtkmm? I was reading last night, and I can't decide if it's more worth fooling with than Qt.
> Automatic widgets in class scope suffer the same disadvantages as any other class scope automatic variable.
weak sauce.
They say to do this:
foo.add( manage(new Gtk::Label("Hello")) );
as in, sort-of RAII using the containing widget to manage destruction.
I don't like it...I think I'd rather use a shared_ptr instead.
Hello all, another small query : I was reading up on priority Queues and it seems that they use Vectors for storage by default, is it possible to change this container to using "list" instead ?
Oops, wrong window.
And they haven't really convinced me of a real hit by using automatic variables.
@angryInsomniac yes. Check out the constructors.
13:18
@angryInsomniac The second template parameter sets the container type.
Xeo
Xeo
hm, is it possible to sudo something and type the password in the same line?
So you want std::priority_queue<T, std::list<T>>.
OMG this crap compiled.
Xeo
Xeo
Which crap?
@Xeo Don't think so. You can edit sudoers to not need a password.
@Xeo My code.
Maybe you could pipe an echo into it.
But I guess that would screw up stdin of the sudone process.
@RMartinhoFernandes Sorry about the asinine query !
13:24
Hey, no worries.
13:55
Hi
I am going through part of legacy code and I see - void bar( var ) const char* var; { /* */ }
What does it signify ?
That's very old C syntax.
It's the same as void bar(const char* var) { /* */ }.
Xeo
Xeo
"very old" is good
That's K&R C
@keithlayne ew, just like Qt, then?
@jalf Yeah, I was disappointed. Seems woefully behind on using c++11 features too. Even so, I wonder how much it would matter seeing as how it's really just a c++ binding to gtk+.
@jalf Is there really a compelling reason to even use pointers for all of those UI elements? I'm thinking maybe if you're writing Eclipse, but I never plan to do that.
> You wrote a better Eclipse, but that's still not a valid excuse.
14:03
@RMartinhoFernandes Thanks.
@Xeo are you saying K&R is good? boo.
Xeo
Xeo
@keithlayne I didn't. The sentence before that is just a german idiom meaning "'quote' is not enough to accurately describe it", often in an ironic way
@keithlayne I don't know. I'm with you in that it seems ugly and unnecessary, but in fairness, I've never written a UI framework the size of Qt, so there might just be something I'm missing
obviously, the notion of "copying" a UI element is a bit weird, which might justify dealing with pointers/references instead of value objects, but with move semantics, that potential problem goes away
@Xeo I didn't think so, but you Germans are crazy sometimes...
and sure, UI elements may have somewhat complex lifetime management
but even so, it seems like it could be done in a sane C++'ish style
14:07
that's my thinking
But where is the fun in doing things the sane way :P
Ugh, apparently I have something named T loose on my global namespace.
Who the fuck does that?
@RMartinhoFernandes It even has a space in its name!
A space?
It's just a T. Nothing else.
Xeo
Xeo
Hm, even MSVC isn't that insane. They only have _T as a macro
14:09
So, I decided to rename some template parameter from T to something meaningful, and the compiler didn't catch a sizeof(T) in there.
Apparently it has size 4.
It's reserved for Mr T.
Xeo
Xeo
Ouch
@keithlayne apart from that, gtk is, afaik, even less C++-style than Qt, and results in fugly UI that doesn't look native anywhere, so I don't feel a strong urge to poke around with gtkmm
@Xeo no, they just have a macro for interface
Okay, I just accidentally hit ESC twice reaching for the backtick after typing a bunch. FML.
Xeo
Xeo
typedef int Mr;
static Mr T;
14:10
grumble grumble
@keithlayne Ctrl+Z?
no way. I wish.
Xeo
Xeo
@jalf At least VS2008 had a _T macro. It's a synonym of _TEXT for ASCII/Unicode conversion independent of project settings.
okay, GTK+ has at least two different ref-counted smart pointers, with the same name, in different namespaces. Ugh.
Xeo
Xeo
Boost does too!
But it got a good reason. :> boost::shared_ptr and boost::interprocess::shared_ptr IIRC
14:12
Ah, wait, it's not in the global namespace.
Damn.
or glib has the _ macro for gettext. poop.
I should be more careful with the usings :S
Xeo
Xeo
@RMartinhoFernandes typedef int T; in the class template? :D
haha
Wait, still, why does any namespace contain T as an identifier?!
@Xeo ah yeah, sorry, didn't mean that they don't have a _T macro. I know they do.
Xeo
Xeo
@jalf Ah, you meant that as a reply to the insane part?
Well, yea. #define interface struct ...
With some __declspec IIRC
Could be __declspec(novtable)
14:15
@Xeo yeah
What's that for? COM?
Xeo
Xeo
Yeah
IUnknown and stuff
That should have been IDunno.
lol
Xeo
Xeo
#define __STRUCT__ struct
#define interface __STRUCT__
Found it
Wait, is extern "C++" even valid?
Xeo
Xeo
And that does what?
Nothing.
Unless you're inside a extern something_else {} block.
Xeo
Xeo
lol
Oh, right, they do all this #define stuff so you can create nearly the same code for C and C++
it's for creating homogeneous interfaces across all languages
AFAIK, it works, but it's pretty involved.
Xeo
Xeo
Yeah, looks pretty crazy
#define DECLARE_INTERFACE(iface)    typedef interface iface { \
                                    const struct iface##Vtbl FAR* lpVtbl; \
                                } iface; \
                                typedef const struct iface##Vtbl iface##Vtbl; \
                                const struct iface##Vtbl
C version
14:23
Ugh, that's scary.
Xeo
Xeo
Well, it just does explicitly what the compiler in C++ implictily does for you
/****** Interface Declaration ***********************************************/

/*
 *      These are macros for declaring interfaces.  They exist so that
 *      a single definition of the interface is simulataneously a proper
 *      declaration of the interface structures (C++ abstract classes)
 *      for both C and C++.
 *
 *      DECLARE_INTERFACE(iface) is used to declare an interface that does
 *      not derive from a base interface.
 *      DECLARE_INTERFACE_(iface, baseiface) is used to declare an interface
They use it to keep compatibility across... everything
One COM DLL can be used with just about everything (.NET, C++, C, Windows Media Player, Explorer, etc...)
Xeo
Xeo
Paint?
lol probably not :) That's a just a fossil.
14:46
http://stackoverflow.com/questions/8605409/complex-const-declarations-in-c
> I'm taking my first foray into C++, specifically the Google RE2 library, and I am stuck on some of the syntax
sometimes I hate n00bs
however StringPiece* input, const RE2& pattern, const Arg* const args[], int argc is scary
@Xeo check this out
2
A: Shell script - Sudo-permissions lost over time

seheThe flexibility of sudo is widely under-estimated. This leads to very poor practices (like the sudo su - canon-ball surgery method). A much better method is to specificly allow the commands you intend to allow without use of a password: phill = NOPASSWD: /bin/ls, /usr/bin/lprm You can optio...

@Xeo: sorry for the delay. I'm always too quick posting links.
(keep getting the "You can try this again in 1 seconds" prompt, but not noticing)

« first day (432 days earlier)      last day (4742 days later) »