« first day (561 days earlier)      last day (4386 days later) » 

5:00 PM
Someone asked me today if I did PHP
 
Did you kill them?
 
do you know PHP?
 
@TonyTheLion std::loss
 
I asked him if he thought I was stupid
 
how is it stupid to know php?
 
5:01 PM
I know PHP. I don't like to brag about it though.
 
Now I know 'lots of people do it' is rarely a good excuse for anything
 
sorry I'm not very program literate.
@EtiennedeMartel can you help program a user system for this chevereto.com
 
But if it's well-supported, popular and accepted, what's the problem?
 
@LearningC Oh hell no. I stopped doing Web stuff a while ago.
 
problem is, with PHP in particular, lots of dumb people do it and write shitty code
 
5:03 PM
is it easy to learn how to do a user system in php?
 
@TonyTheLion Yeah. It's possible to do clean PHP. But you have to be quite disciplined about it because it's so easy to get carried away and write crap. And no PHP tutorial online teaches about discipline.
 
PHP is embarassing.
 
Heaven forbid that beginners who just want to get something done will write code that doesn't suit your aesthetic taste
 
@EtiennedeMartel and where does your average PHP coder learn PHP? online. 'nuff said
 
holds up large banner that reads "DEVIL'S ADVOCATE"
 
5:04 PM
@TomW nothing about aesthetic taste, but the quality of code
 
just so we're clear
 
Anyone recommend a simple php book?
 
NO.
WE DO NOT ADVOCATE PHP HERE
 
Can I use c instead then?
 
ADVOCATE ALL THE THINGS
 
5:05 PM
In this case, the devil is the user, not the framework
 
In all seriousness, why does PHP itself have such an ugly, boring website?
All it does is say "Look, use our framework to create ugly, boring websites!"
 
@LearningC You want to do Web? Python. Ruby. Hell, even C# or Java.
 
@EtiennedeMartel But Hell isn't finished yet. Or so i last heard.
 
Har har har.
 
5:09 PM
@EtiennedeMartel what Python web framework(s) would you recommend?
 
@EtiennedeMartel so I can build a user system with thoes?
 
a "user system"...
 
@TomW I'm not the right guy to ask that. I just throw out names here. But I was an ASP.NET developer once.
But I heard Django works.
 
If I were to do web, it'd be in ASP MVC
 
Yeah, that rocks the boat.
 
5:10 PM
@rubenvb like people can log on and upload images and change password, emails, post comments
 
@TomW PHP isn't a framework.
 
No, PHP is a cancer.
 
lol
 
Alright, well you know what I meant
 
You guys really have php that much..
 
I'm defending programmers with limited competence, rather than the technology they're using - and that only ina tongue-in-cheek way
 
So what language do you guys recommend to build a user system?
 
PHP: lowering quality standards since 1995!
6
@LearningC What do you mean by "user system"?
Every system has a user. It's quite redundant.
 
2 mins ago, by Learning C
@rubenvb like people can log on and upload images and change password, emails, post comments
 
@EtiennedeMartel a system that allows people to log on and upload images and change password, emails, post comments
Or even something like stackechange, with badges and points and reps
 
5:14 PM
....could you rip off the backend of StackExchange?
is StackExchange open-source?
 
Nope. I've searched
 
oh well
 
@LearningC And why do you want to do that?
 
@EtiennedeMartel so I can add onto this script chevereto.com
 
5:19 PM
You did not explain how is your system going to fix an actual problem.
 
Hi. I'm trying to initialize a static data member thusly: const unordered_map<int, double> logfactclass::cache = {{1, 0.0}};
But I want to use a function to do the initialization.
 
There no way of people managing their images. So I need to build a system that keeps files according to the user that uploads it.
 
However I don't see a syntax for const unordered_map<int, double> logfactclass::cache = {{1, f(1)}};
 
That should work.
Provided f is in scope, obviously.
 
@LearningC You mean like Picasa? Or Flickr?
 
5:21 PM
Yea
 
Hell, even Facebook.
 
What language they use for their system?
Did you hear facebook bought instagram for 1billion $??
 
that is crazy. I can't even get 1 thousand$ left alone 1billion all at once...
 
@RMartinhoFernandes Oh, it seems to. Hmm. Is there a way I can get all values for say 1 to 10 without typing them all out?
 
5:23 PM
> We recommend avoiding C++ application code that depends on _UNICODE define. This includes TCHAR/LPTSTR types on Windows and APIs defined as macros such as CreateWindow. We also recommend alternative ways to reach the goals of these APIs.
 
@FaheemMitha No. You'll need a function for that.
 
@RMartinhoFernandes Ok.
 
@FaheemMitha const T foo = []() -> T { T t; /* long initialization */ }(); counts as using a function though.
 
aaargh
I hate Sunday trading laws
 
> The standard library shipped with MSVC is poorly implemented. It forwards narrow-string parameters directly to the OS ANSI API. There’s no way to override this. Changing std::locale doesn’t work. It’s impossible to open a file with a Unicode name on MSVC using standard features of C++.
I'm flabbergasted.
 
5:25 PM
I want to purchase chocolate and milk; but the shops are all shut due to our 16th Century laws
 
....what country?
 
@LucDanton : Can you elaborate? Or do you have an example link?
 
UK
 
Hm?
Where you do live, Chipping Bumblefuck?
 
huh?
 
5:27 PM
@FaheemMitha You put the initialization code in a lambda that you call on the spot of initialization.
 
the shops are all closed because it's half past six
 
the local Tesco is open 5am till midnight on a weekday
and Saturday
 
@LucDanton So if you want to initialize a unordered map, the lambda should return an unordered map?
 
and the other one in my town is 24hour
 
Yeah and most of the big supermarkets close at 4pm on a sunday, I think that's probably because they need cleaning and the security people need to sleep
 
5:28 PM
@FaheemMitha Yes.
 
no, it's because we have an idiotic law forcing them to
 
@LucDanton Ok, I'll give that a try. Thanks.
 
I just about remember when you couldn't buy alcohol after midday on a sunday...that always seemed a bit arbitrary
 
@DeadMG Is this UK wide?
 
@FaheemMitha As far as I'm aware.
 
5:30 PM
asian corner shop
problem solved
they're NEVER closed
 
@DeadMG I see.
 
@TomW lol
 
@LucDanton Would this have worked pre C++ 11?
 
@FaheemMitha No lambda expressions in C++03.
 
@LucDanton I thought they were available as libraries or something.
Though I never used them.
Boost, maybe?
 
5:32 PM
Doesn't really work for arbitrary code (statements, really) like we're using here.
 
@LucDanton Ok.
Handy, certainly.
But couldn't you use a named function on the rhs too?
 
You can. Lambda expressions are not privileged, any kind of call is allowed. I suggested a lambda because it doesn't require 'wasting' a name for this one-of-a-kind initialization.
 
@LucDanton : Yes, that does make sense. And in this context, it would be global too.
 
for(auto it = myMap.begin(); it != myMap.end(); ++it){} <-- that will loop through all items in a map yeah? will this let me then treat (*it) as the items them selves, or is that the std::pair that I inserted?
 
That would be the pair.
Why not the range based thingy, btw? You on MSVC?
 
5:45 PM
so I would have to use it->second as my value
you mean foreach?
 
for(auto&& pair : myMap)
@thecoshman Right.
 
Why use auto&&?
 
@RMartinhoFernandes oh god that looks ugly as sin :P
@RMartinhoFernandes yay! I can do computers!
 
@Pubby It's the default.
 
@RMartinhoFernandes I don't understand
 
5:48 PM
@thecoshman It's the same syntax as Java. Make of that what you will.
@Pubby It becomes an lvalue reference if *it is an lvalue, and it becomes an rvalue reference if *it is an rvalue.
It "just works".
 
@Pubby do you not know the wonders of auto?
 
@RMartinhoFernandes But why prefer that over auto? I thought iterators were cheap.
 
@Pubby That is not the type of the iterator but the type of *it.
If you use auto you make copies of the value.
 
Oh, ranged based for uses value type and not iterator type?
Ok, that makes sense
 
Yep. The point is to avoid clutter with the iterator dance. for(int x : { 1, 2, 3 })
 
5:51 PM
erm... I've got a long arse type (thanks templates) and I want to make a std::pair with that type. is there a way to say 'the type of this variable that I just defined there'
 
decltype(expression)
 
I love having an AI unit to hand :D
 
@EtiennedeMartel Yes. I knew this.
They do have std::wstring overloads for fstreams though
which equate to UTF-16 filenames which is fine and dandy
 
@RMartinhoFernandes that works?
 
well this is odd... my IDE has some how managed to make the suggestion pop up come up over anything else
 
5:55 PM
@bamboon Yup.
 
@RMartinhoFernandes cool, didn't think so
 
@thecoshman Why do you guys still use IntelliSense? Is it not disableable?
 
@RMartinhoFernandes I'm not using VS :P
giving code::blocks a try, seems rather nice
so far :P
@RMartinhoFernandes do I need to include something for that? or is just part of 'normal' std?
 
@thecoshman It's a core language feature.#
 
huh... apparently it's returning an invalid template argument
 
5:58 PM
Code.
 
@ell I have given you an too complicated advice today, you can just do for(auto i : {"blah", "blah", "blah"}). almighty robot taught me so
 
unsigned int node::register(std::function<void(const node&)> callBack){
  callbacks.insert(std::pair<unsigned int, std::decltype(callBack)>(nextCallBackID, callBack));
  ...
 
lol, decltype is just a keyword.
It's part of the language, not a member of the std namespace.
 
oooooh :P
all fixed :D
 
Btw, do you know about the "avoid std::function parameters" thing? (Is there a link for this?)
Though in this case it's possibly fine.
Just make sure you move it into the map then.
Also, std::make_pair.
 
6:03 PM
I know that I am forcing the caller to do the std::bind, but I figure that's ok
@RMartinhoFernandes what that magic do?
 
@thecoshman make a pair? ^^
 
@thecoshman Exploits type deduction to your favour!
callbacks.insert(std::make_pair(nextCallBackID, callBack));
And I'd also mention callbacks[nextCallBackID] = callBack in passing.
 
o_0
starting to twitch...
does that handle it all for me then?
 
The last one requires the map value type to be default constructible, which is true for std::function.
 
though I think I prefer the look of using insert looks a bit more obvious what I am doing
 
6:06 PM
So, yeah, it works fine.
 
cpx
Did anyone else receive a Career 2.00 invite?
I received it last monday..
though i don't deserve it
 
Long time ago, yeah.
I got automatically promoted from 1.0
 
I received one a while ago for my "performance" in the C++ tag.
 
> How about a place that *deserves* the Olympics? Pyongyang in North Korea would be a good place.

Good idea. I have a hypothesis that Olympic Games inevitably bring the downfall of authoritarian regimes. Let's see:

Third Reich: hosted 1936, fell 1945. 9 years.
USSR: hosted 1980, fell 1991. 11 years.
PRC: hosted 2008. If the trend is linear, should fall 13 years later, in 2021.

So yeah, Olympics in North Korea, 15 years later the country will be free...
lol
 
@RMartinhoFernandes flawless logic
 
6:14 PM
so sick of the cheesy greedy Olympics adverts right now that I want to never buy any products from any of the companies involved ever again
 
@thecoshman Quick, grab your tinfoil hats.
 
@RMartinhoFernandes you mean your not wear yours already :O
 
@thecoshman I don't need one. I have a firewall.
 
@RMartinhoFernandes your still susceptible to EMP
man spelling that was hard work. You best appreciate it :P
 
@thecoshman I'm Faraday-caged.
whistles
 
6:19 PM
it gets to you doesn't it :P
 
Hey, you're the one that mentioned it.
 
shh
 
-3
Q: Custom main window in Win32 Windows Application

NieARI have created Win32 Windows Application. I want to create main window like this: http://postimage.org/image/sap9ab5fx/ How can I to add controls to the main window?

^ I voted to close, needs more votes.
 
and Lounge<c++> closed another question in record time :)
 
@CheersandhthAlf closed already :P
 
6:28 PM
0
Q: C++/ build project got errors

Adam ShI have the next files in c++ in Visual Studio 2010: stdafx.h // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include "targetver.h" #include <stdio.h> #include &...

^ am I missing something there?
 
@awoodland Sounds like another one of those "console window disappears too fast" questions.
 
@RMartinhoFernandes I never worked out how to solve that one, I just had to hit print screen at just the right time and hope I would see the results
 
Woah.
Ctrl+F5.
 
joke :P
 
If you want to debug, place a breakpoint. And bitch about this crap on Connect.
 
6:36 PM
huh?
 
Honestly, I don't really care that running in debug mode doesn't pause at the end. If I'm debugging, I want to stop before the program is over to erm, debug, you know. If I'm not debugging, I prefer to not have the debugger slowing me down.
 
ergh... if I have a uniqe_ptr... how can I 'return' ownership of it? do I have to do something like std::unique_ptr<node> takeChild(){ return std::swap(child_ptr); }
 
Just return it.
 
or std::move it.
 
but what happens to the node.child_ptr does it get set to some sort of invalid state?
 
6:40 PM
@thecoshman Oh, it's a member?
std::move it.
@thecoshman It becomes empty/null/whachamacallit.
Basically assert(!node.child_ptr)
 
so erm... class node{ unique_ptr<foo> child; public: unique_ptr<foo> takeChild(){ return std::move(child); }};
 
Greetings, dog.
 
hello!
 
@thecoshman Yup.
 
oh man, turning into a serious pro at this shit!
if only I could sort out this Java at work problem ¬_¬
 
6:45 PM
lol
What are you building btw?
 
@LearningC C++, obviously.
 
workings on a new project, I call it "HaM"
It's going to be a HUD and Menu system for use in games, or any other 3D thing
 
@thecoshman for your own projects, or as a general library?
 
hopefully, it will not suck ass
 
@classdaknokt huh?\
 
6:47 PM
@TomW mostly for my self, but others can use it if they feel brace enough :P
 
2 hours ago, by Learning C
So what language do you guys recommend to build a user system?
 
@thecoshman a noble endeavour
plenty of games out there with an overlay that's epic shit
 
@classdaknokt oh lol, didn't know people read messages 2 hours ago. Thanks
 
@TomW But at least it's epic, right? ;)
 
@LearningC Every time I come back here I take a look at the contexts of the starred messages.
 
6:51 PM
Treading a fine line, want to get as much 'boiler plate' done by the library, whilst making it easy as pie to connect the GUI to you game code, make it look how you want it too, simple for designer types to create the menu's and relatively easy to add your own additions if you need something fancy
any way, snack time for now :D
 

« first day (561 days earlier)      last day (4386 days later) »